diff options
author | uruk | 2014-02-09 12:38:40 +0100 |
---|---|---|
committer | uruk | 2014-02-09 12:38:49 +0100 |
commit | 3e8e91300cc29e00f94af61b590fd20f1632cf42 (patch) | |
tree | 35fd69f0ba9403f3968832ba7ce6c4ca13a88b24 /engines | |
parent | c97ce839fd5c4a169d0f9f8c5ab99abb17aef9f3 (diff) | |
download | scummvm-rg350-3e8e91300cc29e00f94af61b590fd20f1632cf42.tar.gz scummvm-rg350-3e8e91300cc29e00f94af61b590fd20f1632cf42.tar.bz2 scummvm-rg350-3e8e91300cc29e00f94af61b590fd20f1632cf42.zip |
AVALANCHE: Optimise the picture loading in GhostRoom.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/avalanche/ghostroom.cpp | 8 | ||||
-rw-r--r-- | engines/avalanche/ghostroom.h | 1 |
2 files changed, 8 insertions, 1 deletions
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); |