added special case of loadScene

svn-id: r45780
This commit is contained in:
Vladimir Menshakov 2009-11-09 21:26:07 +00:00
parent 46ef23a7b9
commit 6e0a8895a2

View File

@ -376,7 +376,10 @@ bool Scene::render(OSystem *system) {
return true;
}
system->copyRectToScreen((const byte *)background.pixels, background.pitch, 0, 0, background.w, background.h);
if (background.pixels)
system->copyRectToScreen((const byte *)background.pixels, background.pitch, 0, 0, background.w, background.h);
else
system->fillScreen(0);
Graphics::Surface *surface = system->lockScreen();
@ -590,8 +593,20 @@ bool Scene::processEventQueue() {
break;
case SceneEvent::kLoadScene: {
init(current_event.scene, current_event.dst);
sounds.clear();
if (current_event.scene != 0) {
init(current_event.scene, current_event.dst);
sounds.clear();
} else {
//special case, empty scene
background.free();
on.free();
delete[] ons;
ons = NULL;
for (byte i = 0; i < 4; ++i) {
animation[i].free();
custom_animation[i].free();
}
}
current_event.clear();
}
break;