vSync is now always on.

This commit is contained in:
Steve 2016-02-28 10:00:17 +00:00
parent 44c7e78606
commit a1703d5066
4 changed files with 1 additions and 29 deletions

View File

@ -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",

View File

@ -389,7 +389,6 @@ typedef struct {
int fullscreen;
int musicVolume;
int soundVolume;
int vSync;
Mouse mouse;
int keyboard[MAX_KEYBOARD_KEYS];
SDL_Texture *backBuffer;

View File

@ -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);

View File

@ -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;