Config: Correctly setup rgssVer / screen size with customScript

This commit is contained in:
Jonas Kulla 2014-09-05 21:54:16 +02:00
parent 4d54fce8ee
commit 7f41b9cc45
1 changed files with 16 additions and 5 deletions

View File

@ -241,11 +241,26 @@ static std::string baseName(const std::string &path)
return path.substr(pos + 1); return path.substr(pos + 1);
} }
static void setupScreenSize(Config &conf)
{
if (conf.defScreenW <= 0)
conf.defScreenW = (conf.rgssVersion == 1 ? 640 : 544);
if (conf.defScreenH <= 0)
conf.defScreenH = (conf.rgssVersion == 1 ? 480 : 416);
}
void Config::readGameINI() void Config::readGameINI()
{ {
if (!customScript.empty()) if (!customScript.empty())
{ {
game.title = baseName(customScript); game.title = baseName(customScript);
if (rgssVersion == 0)
rgssVersion = 1;
setupScreenSize(*this);
return; return;
} }
@ -355,9 +370,5 @@ void Config::readGameINI()
} }
} }
if (defScreenW <= 0) setupScreenSize(*this);
defScreenW = (rgssVersion == 1 ? 640 : 544);
if (defScreenH <= 0)
defScreenH = (rgssVersion == 1 ? 480 : 416);
} }