SDL: Replace gfx_mode with scale_factor in initSizeHint()

This commit is contained in:
Cameron Cawley 2022-01-14 21:25:28 +00:00 committed by Filippos Karapetis
parent 42bc12a007
commit a14c5a4a53
6 changed files with 1 additions and 41 deletions

View file

@ -138,26 +138,11 @@ bool SdlGraphicsManager::defaultGraphicsModeConfig() const {
return true;
}
int SdlGraphicsManager::getGraphicsModeIdByName(const Common::String &name) const {
if (name == "normal" || name == "default") {
return getDefaultGraphicsMode();
}
const OSystem::GraphicsMode *mode = getSupportedGraphicsModes();
while (mode && mode->name != nullptr) {
if (name.equalsIgnoreCase(mode->name)) {
return mode->id;
}
++mode;
}
return -1;
}
void SdlGraphicsManager::initSizeHint(const Graphics::ModeList &modes) {
#if SDL_VERSION_ATLEAST(2, 0, 0)
const bool useDefault = defaultGraphicsModeConfig();
int scale = getGraphicsModeScale(getGraphicsModeIdByName(ConfMan.get("gfx_mode")));
int scale = ConfMan.getInt("scale_factor");
if (scale == -1) {
warning("Unknown scaler; defaulting to 1");
scale = 1;