vSync is now always on.
This commit is contained in:
parent
44c7e78606
commit
a1703d5066
|
@ -43,17 +43,6 @@
|
||||||
"w" : 400,
|
"w" : 400,
|
||||||
"h": 34
|
"h": 34
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name" : "vSync",
|
|
||||||
"group" : "options",
|
|
||||||
"type" : "WT_SELECT",
|
|
||||||
"text" : "VSync",
|
|
||||||
"options" : "Off;On",
|
|
||||||
"x" : -1,
|
|
||||||
"y" : 475,
|
|
||||||
"w" : 400,
|
|
||||||
"h": 34
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name" : "ok",
|
"name" : "ok",
|
||||||
"group" : "options",
|
"group" : "options",
|
||||||
|
|
|
@ -389,7 +389,6 @@ typedef struct {
|
||||||
int fullscreen;
|
int fullscreen;
|
||||||
int musicVolume;
|
int musicVolume;
|
||||||
int soundVolume;
|
int soundVolume;
|
||||||
int vSync;
|
|
||||||
Mouse mouse;
|
Mouse mouse;
|
||||||
int keyboard[MAX_KEYBOARD_KEYS];
|
int keyboard[MAX_KEYBOARD_KEYS];
|
||||||
SDL_Texture *backBuffer;
|
SDL_Texture *backBuffer;
|
||||||
|
|
|
@ -61,16 +61,11 @@ void initSDL(void)
|
||||||
/* done in src/plat/ */
|
/* done in src/plat/ */
|
||||||
createSaveFolder();
|
createSaveFolder();
|
||||||
|
|
||||||
rendererFlags = SDL_RENDERER_ACCELERATED;
|
rendererFlags = SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC;
|
||||||
windowFlags = 0;
|
windowFlags = 0;
|
||||||
|
|
||||||
loadConfig();
|
loadConfig();
|
||||||
|
|
||||||
if (app.vSync)
|
|
||||||
{
|
|
||||||
rendererFlags |= SDL_RENDERER_PRESENTVSYNC;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (app.fullscreen)
|
if (app.fullscreen)
|
||||||
{
|
{
|
||||||
windowFlags |= SDL_WINDOW_FULLSCREEN;
|
windowFlags |= SDL_WINDOW_FULLSCREEN;
|
||||||
|
@ -256,7 +251,6 @@ static void loadConfig(void)
|
||||||
|
|
||||||
app.winWidth = cJSON_GetObjectItem(root, "winWidth")->valueint;
|
app.winWidth = cJSON_GetObjectItem(root, "winWidth")->valueint;
|
||||||
app.winHeight = cJSON_GetObjectItem(root, "winHeight")->valueint;
|
app.winHeight = cJSON_GetObjectItem(root, "winHeight")->valueint;
|
||||||
app.vSync = cJSON_GetObjectItem(root, "vSync")->valueint;
|
|
||||||
app.fullscreen = cJSON_GetObjectItem(root, "fullscreen")->valueint;
|
app.fullscreen = cJSON_GetObjectItem(root, "fullscreen")->valueint;
|
||||||
app.musicVolume = cJSON_GetObjectItem(root, "musicVolume")->valueint;
|
app.musicVolume = cJSON_GetObjectItem(root, "musicVolume")->valueint;
|
||||||
app.soundVolume = cJSON_GetObjectItem(root, "soundVolume")->valueint;
|
app.soundVolume = cJSON_GetObjectItem(root, "soundVolume")->valueint;
|
||||||
|
@ -280,7 +274,6 @@ void saveConfig(void)
|
||||||
root = cJSON_CreateObject();
|
root = cJSON_CreateObject();
|
||||||
cJSON_AddNumberToObject(root, "winWidth", app.winWidth);
|
cJSON_AddNumberToObject(root, "winWidth", app.winWidth);
|
||||||
cJSON_AddNumberToObject(root, "winHeight", app.winHeight);
|
cJSON_AddNumberToObject(root, "winHeight", app.winHeight);
|
||||||
cJSON_AddNumberToObject(root, "vSync", app.vSync);
|
|
||||||
cJSON_AddNumberToObject(root, "fullscreen", app.fullscreen);
|
cJSON_AddNumberToObject(root, "fullscreen", app.fullscreen);
|
||||||
cJSON_AddNumberToObject(root, "musicVolume", app.musicVolume);
|
cJSON_AddNumberToObject(root, "musicVolume", app.musicVolume);
|
||||||
cJSON_AddNumberToObject(root, "soundVolume", app.soundVolume);
|
cJSON_AddNumberToObject(root, "soundVolume", app.soundVolume);
|
||||||
|
|
|
@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
static void changeWindowSize(char *value);
|
static void changeWindowSize(char *value);
|
||||||
static void changeSoundVolume(char *value);
|
static void changeSoundVolume(char *value);
|
||||||
static void changeMusicVolume(char *value);
|
static void changeMusicVolume(char *value);
|
||||||
static void changeVSync(char *value);
|
|
||||||
static void changeFullscreen(char *value);
|
static void changeFullscreen(char *value);
|
||||||
static void ok(void);
|
static void ok(void);
|
||||||
|
|
||||||
|
@ -38,7 +37,6 @@ void initOptions(void (*rtn)(void))
|
||||||
getWidget("windowSize", "options")->onChange = changeWindowSize;
|
getWidget("windowSize", "options")->onChange = changeWindowSize;
|
||||||
getWidget("soundVolume", "options")->onChange = changeSoundVolume;
|
getWidget("soundVolume", "options")->onChange = changeSoundVolume;
|
||||||
getWidget("musicVolume", "options")->onChange = changeMusicVolume;
|
getWidget("musicVolume", "options")->onChange = changeMusicVolume;
|
||||||
getWidget("vSync", "options")->onChange = changeVSync;
|
|
||||||
getWidget("fullscreen", "options")->onChange = changeFullscreen;
|
getWidget("fullscreen", "options")->onChange = changeFullscreen;
|
||||||
getWidget("ok", "options")->action = ok;
|
getWidget("ok", "options")->action = ok;
|
||||||
|
|
||||||
|
@ -51,8 +49,6 @@ void initOptions(void (*rtn)(void))
|
||||||
sprintf(optionStr, "%d", app.musicVolume);
|
sprintf(optionStr, "%d", app.musicVolume);
|
||||||
setWidgetOption("musicVolume", "options", optionStr);
|
setWidgetOption("musicVolume", "options", optionStr);
|
||||||
|
|
||||||
setWidgetOption("vSync", "options", app.vSync ? "On" : "Off");
|
|
||||||
|
|
||||||
setWidgetOption("fullscreen", "options", app.fullscreen ? "On" : "Off");
|
setWidgetOption("fullscreen", "options", app.fullscreen ? "On" : "Off");
|
||||||
|
|
||||||
returnFromOptions = rtn;
|
returnFromOptions = rtn;
|
||||||
|
@ -108,11 +104,6 @@ static void changeMusicVolume(char *value)
|
||||||
Mix_VolumeMusic(app.musicVolume * MIX_MAX_VOLUME / 10);
|
Mix_VolumeMusic(app.musicVolume * MIX_MAX_VOLUME / 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void changeVSync(char *value)
|
|
||||||
{
|
|
||||||
app.vSync = strcmp(value, "On") == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void changeFullscreen(char *value)
|
static void changeFullscreen(char *value)
|
||||||
{
|
{
|
||||||
app.fullscreen = strcmp(value, "On") == 0;
|
app.fullscreen = strcmp(value, "On") == 0;
|
||||||
|
|
Loading…
Reference in New Issue