GRIM: Don't crash if no splash screen was used.

This commit is contained in:
Vincent Pelletier 2011-09-10 20:47:07 +02:00
parent 4c8e28fab2
commit c2ca1d0057

View file

@ -486,7 +486,7 @@ Common::Error GrimEngine::run() {
// refresh the theme engine so that we can show the gui overlay without it crashing. // refresh the theme engine so that we can show the gui overlay without it crashing.
GUI::GuiManager::instance().theme()->refresh(); GUI::GuiManager::instance().theme()->refresh();
Bitmap *splash_bm; Bitmap *splash_bm = NULL;
if (!(_gameFlags & ADGF_DEMO) && getGameType() == GType_GRIM) if (!(_gameFlags & ADGF_DEMO) && getGameType() == GType_GRIM)
splash_bm = g_resourceloader->loadBitmap("splash.bm"); splash_bm = g_resourceloader->loadBitmap("splash.bm");
else if ((_gameFlags & ADGF_DEMO) && getGameType() == GType_MONKEY4) else if ((_gameFlags & ADGF_DEMO) && getGameType() == GType_MONKEY4)
@ -540,7 +540,8 @@ Common::Error GrimEngine::run() {
} }
g_grim->setMode(ENGINE_MODE_NORMAL); g_grim->setMode(ENGINE_MODE_NORMAL);
delete splash_bm; if (splash_bm)
delete splash_bm;
g_grim->mainLoop(); g_grim->mainLoop();
return Common::kNoError; return Common::kNoError;