[Scummvm-cvs-logs] scummvm master -> 3e8e91300cc29e00f94af61b590fd20f1632cf42

urukgit urukgit at users.noreply.github.com
Sun Feb 9 12:39:25 CET 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
3e8e91300c AVALANCHE: Optimise the picture loading in GhostRoom.


Commit: 3e8e91300cc29e00f94af61b590fd20f1632cf42
    https://github.com/scummvm/scummvm/commit/3e8e91300cc29e00f94af61b590fd20f1632cf42
Author: uruk (koppirnyo at gmail.com)
Date: 2014-02-09T03:38:49-08:00

Commit Message:
AVALANCHE: Optimise the picture loading in GhostRoom.

Changed paths:
    engines/avalanche/ghostroom.cpp
    engines/avalanche/ghostroom.h



diff --git a/engines/avalanche/ghostroom.cpp b/engines/avalanche/ghostroom.cpp
index ea1e428..1047105 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 b4a2b28..b4917d8 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);






More information about the Scummvm-git-logs mailing list