Allow Game::savestats() to accept a pointer to ScreenSettings

Another step to fix the bug #556 is to allow Game::savestats() to accept
a pointer to an existing ScreenSettings struct. This entails refactoring
Game::savesettings() and Game::serializesettings() to accept the
function as well, along with adding Screen::GetSettings() so the
settings of the current Screen can be easily grabbed.
This commit is contained in:
Misa
2020-12-21 16:34:16 -08:00
committed by Ethan Lee
parent b62908f0f4
commit 55163e90d5
4 changed files with 46 additions and 30 deletions

View File

@@ -93,6 +93,21 @@ void Screen::init(const ScreenSettings& settings)
ResizeScreen(settings.windowWidth, settings.windowHeight);
}
void Screen::GetSettings(ScreenSettings* settings)
{
int width, height;
GetWindowSize(&width, &height);
settings->windowWidth = width;
settings->windowHeight = height;
settings->fullscreen = !isWindowed;
settings->useVsync = vsync;
settings->stretch = stretchMode;
settings->linearFilter = isFiltered;
settings->badSignal = badSignalEffect;
}
void Screen::LoadIcon()
{
unsigned char *fileIn = NULL;