fix: TSL has a different computer background

This commit is contained in:
Vsevolod Kremianskii 2021-01-28 09:18:39 +07:00
parent d2aa1c3241
commit ff88b23e0a
2 changed files with 36 additions and 23 deletions

View file

@ -67,6 +67,7 @@ MainMenu::MainMenu(Game *game) :
_backgroundType = BackgroundType::Menu;
break;
}
_resolutionX = 800;
_resolutionY = 600;
}

View file

@ -85,31 +85,43 @@ void GUI::load() {
void GUI::loadBackground(BackgroundType type) {
string resRef;
if ((_gfxOpts.width == 1600 && _gfxOpts.height == 1200) ||
(_gfxOpts.width == 1280 && _gfxOpts.height == 960) ||
(_gfxOpts.width == 1024 && _gfxOpts.height == 768) ||
(_gfxOpts.width == 800 && _gfxOpts.height == 600)) {
resRef = str(boost::format("%dx%d") % _gfxOpts.width % _gfxOpts.height);
if (_version == GameVersion::TheSithLords) {
switch (type) {
case BackgroundType::Computer0:
case BackgroundType::Computer1:
resRef = "pnl_computer_pc";
break;
default:
break;
}
} else {
resRef = "1600x1200";
}
switch (type) {
case BackgroundType::Menu:
resRef += "back";
break;
case BackgroundType::Load:
resRef += "load";
break;
case BackgroundType::Computer0:
resRef += "comp0";
break;
case BackgroundType::Computer1:
resRef += "comp1";
break;
default:
return;
if ((_gfxOpts.width == 1600 && _gfxOpts.height == 1200) ||
(_gfxOpts.width == 1280 && _gfxOpts.height == 960) ||
(_gfxOpts.width == 1024 && _gfxOpts.height == 768) ||
(_gfxOpts.width == 800 && _gfxOpts.height == 600)) {
resRef = str(boost::format("%dx%d") % _gfxOpts.width % _gfxOpts.height);
} else {
resRef = "1600x1200";
}
switch (type) {
case BackgroundType::Menu:
resRef += "back";
break;
case BackgroundType::Load:
resRef += "load";
break;
case BackgroundType::Computer0:
resRef += "comp0";
break;
case BackgroundType::Computer1:
resRef += "comp1";
break;
default:
return;
}
}
_background = Textures::instance().get(resRef, TextureType::Diffuse);
}