Add VSync graphics option, off by default

This is if you want delta-timesteps to go as quickly as possible. Also
it seems like on Windows this only has an effect in exclusive fullscreen
mode.
This commit is contained in:
Misa
2020-05-04 13:19:47 -07:00
committed by Ethan Lee
parent 179315c889
commit 694e8f42ab
6 changed files with 43 additions and 4 deletions

View File

@@ -4753,6 +4753,11 @@ void Game::loadstats()
over30mode = atoi(pText);
}
if (pKey == "vsync")
{
graphics.vsync = atoi(pText);
}
if (pKey == "notextoutline")
{
graphics.notextoutline = atoi(pText);
@@ -5002,6 +5007,10 @@ void Game::savestats()
msg->LinkEndChild(doc.NewText(help.String((int) over30mode).c_str()));
dataNode->LinkEndChild(msg);
msg = doc.NewElement("vsync");
msg->LinkEndChild(doc.NewText(help.String((int) graphics.vsync).c_str()));
dataNode->LinkEndChild(msg);
for (size_t i = 0; i < controllerButton_flip.size(); i += 1)
{
msg = doc.NewElement("flipButton");
@@ -7075,9 +7084,10 @@ void Game::createmenu( enum Menu::MenuName t, bool samemenu/*= false*/ )
option("toggle analogue");
option("toggle mouse");
option("toggle fps");
option("toggle vsync");
option("return");
menuxoff = -50;
menuyoff = 8;
menuxoff = -85;
menuyoff = 0;
break;
case Menu::ed_settings:
option("change description");