diff --git a/binding-mri/graphics-binding.cpp b/binding-mri/graphics-binding.cpp index ecda37b..bb49078 100644 --- a/binding-mri/graphics-binding.cpp +++ b/binding-mri/graphics-binding.cpp @@ -21,9 +21,11 @@ #include "graphics.h" #include "sharedstate.h" +#include "eventthread.h" #include "binding-util.h" #include "binding-types.h" #include "exception.h" +#include "config.h" RB_METHOD(graphicsUpdate){ RB_UNUSED_PARAM; @@ -186,7 +188,6 @@ DEF_GRA_PROP_B(Frameskip) void graphicsBindingInit(){ VALUE module = rb_define_module("Graphics"); - _rb_define_module_function(module, "update", graphicsUpdate); _rb_define_module_function(module, "freeze", graphicsFreeze); _rb_define_module_function(module, "transition", graphicsTransition); @@ -199,6 +200,8 @@ void graphicsBindingInit(){ _rb_define_module_function(module, "width", graphicsWidth); _rb_define_module_function(module, "height", graphicsHeight); + const Config &conf = shState->rtData().config; + rb_define_const(module, "ASPECT", rb_str_new_cstr(conf.AspectPreset.c_str())); _rb_define_module_function(module, "wait", graphicsWait); _rb_define_module_function(module, "fadeout", graphicsFadeout); _rb_define_module_function(module, "fadein", graphicsFadein); diff --git a/oneshot.conf b/oneshot.conf index 7fb2e75..a868623 100644 --- a/oneshot.conf +++ b/oneshot.conf @@ -25,8 +25,13 @@ printFPS=false # as opposed to stretch-to-fill fixedAspectRatio=true -# 16:9 support -EnableSixteenByNine=false +# Set Monitor Aspect preset +# Aviable: +# _4_3 (default) +# _16_9 +# _16_10 +# _2_3 +AspectPreset="_4_3" # Controlling the resolution of the game window, # it is not recommended to change. diff --git a/src/config.cpp b/src/config.cpp index d7f6d9d..22325d8 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -71,9 +71,9 @@ void Config::read(int argc, char *argv[]){ PO_DESC(debugMode, bool, false) \ PO_DESC(screenMode, bool, false) \ PO_DESC(printFPS, bool, false) \ - PO_DESC(EnableSixteenByNine, bool, false) \ PO_DESC(fullscreen, bool, false) \ PO_DESC(fixedAspectRatio, bool, true) \ + PO_DESC(AspectPreset, std::string, "_4_3") \ PO_DESC(smoothScaling, bool, false) \ PO_DESC(vsync, bool, true) \ PO_DESC(defScreenW, int, 640) \ @@ -177,13 +177,6 @@ void Config::read(int argc, char *argv[]){ game.title = "OneShot: Sunshine"; game.scripts = "Data/xScripts.rxdata"; - if(defScreenW == 640 || defScreenH == 480){ - if (EnableSixteenByNine){ - defScreenW = 1280; - defScreenH = 720; - } - } - #ifdef STEAM /* Override fullscreen config if Big Picture */ if (const char *env = SDL_getenv("SteamTenfoot")){ diff --git a/src/config.h b/src/config.h index 9cd997f..cfd392f 100644 --- a/src/config.h +++ b/src/config.h @@ -35,7 +35,6 @@ struct Config{ bool Windows_AllocConsole; bool smoothScaling; bool vsync; - bool EnableSixteenByNine; int defScreenW; int defScreenH; std::string windowTitle; @@ -51,6 +50,7 @@ struct Config{ int maxTextureSize; std::string gameFolder; + std::string AspectPreset; bool allowSymlinks; bool pathCache;