1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 10:09:43 +01:00

Fall back to default settings when screenbuffer is not present

This commit is contained in:
Ethan Lee 2020-07-13 16:09:44 -04:00
parent 47eba09edb
commit 11312976fc

View file

@ -4652,7 +4652,15 @@ void Game::savestats()
dataNode->LinkEndChild( msg ); dataNode->LinkEndChild( msg );
int width, height; int width, height;
if (graphics.screenbuffer != NULL)
{
graphics.screenbuffer->GetWindowSize(&width, &height); graphics.screenbuffer->GetWindowSize(&width, &height);
}
else
{
width = 320;
height = 240;
}
msg = doc.NewElement( "window_width" ); msg = doc.NewElement( "window_width" );
msg->LinkEndChild( doc.NewText( help.String(width).c_str())); msg->LinkEndChild( doc.NewText( help.String(width).c_str()));
dataNode->LinkEndChild( msg ); dataNode->LinkEndChild( msg );
@ -4730,8 +4738,17 @@ void Game::savestats()
msg->LinkEndChild(doc.NewText(help.String((int) glitchrunnermode).c_str())); msg->LinkEndChild(doc.NewText(help.String((int) glitchrunnermode).c_str()));
dataNode->LinkEndChild(msg); dataNode->LinkEndChild(msg);
int vsyncOption;
msg = doc.NewElement("vsync"); msg = doc.NewElement("vsync");
msg->LinkEndChild(doc.NewText(help.String((int) graphics.screenbuffer->vsync).c_str())); if (graphics.screenbuffer != NULL)
{
vsyncOption = (int) graphics.screenbuffer->vsync;
}
else
{
vsyncOption = 0;
}
msg->LinkEndChild(doc.NewText(help.String(vsyncOption).c_str()));
dataNode->LinkEndChild(msg); dataNode->LinkEndChild(msg);
for (size_t i = 0; i < controllerButton_flip.size(); i += 1) for (size_t i = 0; i < controllerButton_flip.size(); i += 1)