From 6e0a8895a245e1489ebc639ef2f12389923e0cc5 Mon Sep 17 00:00:00 2001 From: Vladimir Menshakov Date: Mon, 9 Nov 2009 21:26:07 +0000 Subject: added special case of loadScene svn-id: r45780 --- engines/teenagent/scene.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'engines') 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; -- cgit v1.2.3