aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent/scene.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/teenagent/scene.cpp')
-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;