From 3e8e91300cc29e00f94af61b590fd20f1632cf42 Mon Sep 17 00:00:00 2001 From: uruk Date: Sun, 9 Feb 2014 12:38:40 +0100 Subject: AVALANCHE: Optimise the picture loading in GhostRoom. --- engines/avalanche/ghostroom.cpp | 8 +++++++- engines/avalanche/ghostroom.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp index ea1e428b3a..1047105658 100644 --- a/engines/avalanche/ghostroom.cpp +++ b/engines/avalanche/ghostroom.cpp @@ -48,6 +48,7 @@ GhostRoom::GhostRoom(AvalancheEngine *vm) { _greldetX = _greldetY = 0; _greldetCount = 0; _redGreldet = false; + _wasLoaded = false; } GhostRoom::~GhostRoom() { @@ -200,7 +201,12 @@ void GhostRoom::run() { _vm->fadeIn(); _vm->_graphics->drawFilledRectangle(Common::Rect(0, 0, 640, 200), kColorBlack); // Black out the whole screen. - loadPictures(); + // Only load the pictures if it's our first time walking into the room. + // After that we simply use the already loaded images. + if (!_wasLoaded) { + loadPictures(); + _wasLoaded = true; + } // Avvy walks over: _glerkStage = 0; diff --git a/engines/avalanche/ghostroom.h b/engines/avalanche/ghostroom.h index b4a2b28cd5..b4917d8cb4 100644 --- a/engines/avalanche/ghostroom.h +++ b/engines/avalanche/ghostroom.h @@ -75,6 +75,7 @@ private: int16 _greldetX, _greldetY; byte _greldetCount; bool _redGreldet; + bool _wasLoaded; void loadPictures(); void wait(uint16 howLong); -- cgit v1.2.3