aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Menshakov2009-11-09 21:26:07 +0000
committerVladimir Menshakov2009-11-09 21:26:07 +0000
commit6e0a8895a245e1489ebc639ef2f12389923e0cc5 (patch)
treebea079506bb060cbb14ea3622e68f91ea8a0b180
parent46ef23a7b913aa6ad4352ba8868010603b63384b (diff)
downloadscummvm-rg350-6e0a8895a245e1489ebc639ef2f12389923e0cc5.tar.gz
scummvm-rg350-6e0a8895a245e1489ebc639ef2f12389923e0cc5.tar.bz2
scummvm-rg350-6e0a8895a245e1489ebc639ef2f12389923e0cc5.zip
added special case of loadScene
svn-id: r45780
-rw-r--r--engines/teenagent/scene.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index f6473681ec..bf37133bcd 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -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;