diff --git a/data/widgets/options.json b/data/widgets/options.json index e477a1c..1031e3f 100644 --- a/data/widgets/options.json +++ b/data/widgets/options.json @@ -43,17 +43,6 @@ "w" : 400, "h": 34 }, - { - "name" : "vSync", - "group" : "options", - "type" : "WT_SELECT", - "text" : "VSync", - "options" : "Off;On", - "x" : -1, - "y" : 475, - "w" : 400, - "h": 34 - }, { "name" : "ok", "group" : "options", diff --git a/src/structs.h b/src/structs.h index b072bb0..b134555 100644 --- a/src/structs.h +++ b/src/structs.h @@ -389,7 +389,6 @@ typedef struct { int fullscreen; int musicVolume; int soundVolume; - int vSync; Mouse mouse; int keyboard[MAX_KEYBOARD_KEYS]; SDL_Texture *backBuffer; diff --git a/src/system/init.c b/src/system/init.c index a1cfb00..822613b 100644 --- a/src/system/init.c +++ b/src/system/init.c @@ -61,16 +61,11 @@ void initSDL(void) /* done in src/plat/ */ createSaveFolder(); - rendererFlags = SDL_RENDERER_ACCELERATED; + rendererFlags = SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC; windowFlags = 0; loadConfig(); - if (app.vSync) - { - rendererFlags |= SDL_RENDERER_PRESENTVSYNC; - } - if (app.fullscreen) { windowFlags |= SDL_WINDOW_FULLSCREEN; @@ -256,7 +251,6 @@ static void loadConfig(void) app.winWidth = cJSON_GetObjectItem(root, "winWidth")->valueint; app.winHeight = cJSON_GetObjectItem(root, "winHeight")->valueint; - app.vSync = cJSON_GetObjectItem(root, "vSync")->valueint; app.fullscreen = cJSON_GetObjectItem(root, "fullscreen")->valueint; app.musicVolume = cJSON_GetObjectItem(root, "musicVolume")->valueint; app.soundVolume = cJSON_GetObjectItem(root, "soundVolume")->valueint; @@ -280,7 +274,6 @@ void saveConfig(void) root = cJSON_CreateObject(); cJSON_AddNumberToObject(root, "winWidth", app.winWidth); cJSON_AddNumberToObject(root, "winHeight", app.winHeight); - cJSON_AddNumberToObject(root, "vSync", app.vSync); cJSON_AddNumberToObject(root, "fullscreen", app.fullscreen); cJSON_AddNumberToObject(root, "musicVolume", app.musicVolume); cJSON_AddNumberToObject(root, "soundVolume", app.soundVolume); diff --git a/src/system/options.c b/src/system/options.c index a862cdb..edbbc40 100644 --- a/src/system/options.c +++ b/src/system/options.c @@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static void changeWindowSize(char *value); static void changeSoundVolume(char *value); static void changeMusicVolume(char *value); -static void changeVSync(char *value); static void changeFullscreen(char *value); static void ok(void); @@ -38,7 +37,6 @@ void initOptions(void (*rtn)(void)) getWidget("windowSize", "options")->onChange = changeWindowSize; getWidget("soundVolume", "options")->onChange = changeSoundVolume; getWidget("musicVolume", "options")->onChange = changeMusicVolume; - getWidget("vSync", "options")->onChange = changeVSync; getWidget("fullscreen", "options")->onChange = changeFullscreen; getWidget("ok", "options")->action = ok; @@ -51,8 +49,6 @@ void initOptions(void (*rtn)(void)) sprintf(optionStr, "%d", app.musicVolume); setWidgetOption("musicVolume", "options", optionStr); - setWidgetOption("vSync", "options", app.vSync ? "On" : "Off"); - setWidgetOption("fullscreen", "options", app.fullscreen ? "On" : "Off"); returnFromOptions = rtn; @@ -108,11 +104,6 @@ static void changeMusicVolume(char *value) Mix_VolumeMusic(app.musicVolume * MIX_MAX_VOLUME / 10); } -static void changeVSync(char *value) -{ - app.vSync = strcmp(value, "On") == 0; -} - static void changeFullscreen(char *value) { app.fullscreen = strcmp(value, "On") == 0;