[Scummvm-cvs-logs] SF.net SVN: scummvm:[49146] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat May 22 19:59:49 CEST 2010


Revision: 49146
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49146&view=rev
Author:   peres001
Date:     2010-05-22 17:59:49 +0000 (Sat, 22 May 2010)

Log Message:
-----------
Cleanup (removed many Parallaction::getGameType() calls).

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2010-05-22 17:59:33 UTC (rev 49145)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2010-05-22 17:59:49 UTC (rev 49146)
@@ -102,7 +102,8 @@
 
 
 Common::Error Parallaction::init() {
-
+	
+	_gameType = getGameType();
 	_engineFlags = 0;
 	_objectsNames = NULL;
 	_globalFlagsNames = NULL;
@@ -408,7 +409,7 @@
 	uint16 layer = LAYER_FOREGROUND;
 	uint16 scale = 100;
 
-	switch (getGameType()) {
+	switch (_gameType) {
 	case GType_Nippon:
 		if ((anim->_flags & kFlagsNoMasked) == 0) {
 			// Layer in NS depends on where the animation is on the screen, for each animation.
@@ -523,7 +524,7 @@
 	}
 
 	// TODO: move this balloons stuff into DialogueManager and BalloonManager
-	if (getGameType() == GType_Nippon) {
+	if (_gameType == GType_Nippon) {
 		if (!data->_filename.empty()) {
 			if (data->_gfxobj == 0) {
 				data->_gfxobj = _disk->loadStatic(data->_filename.c_str());
@@ -540,7 +541,7 @@
 			_gfx->setItem(_char._talk, 190, 80);
 		}
 	} else
-	if (getGameType() == GType_BRA) {
+	if (_gameType == GType_BRA) {
 		_balloonMan->setSingleBalloon(data->_examineText.c_str(), 0, 0, 1, BalloonManager::kNormalColor);
 		_gfx->setItem(_char._talk, 10, 80);
 	}
@@ -653,14 +654,13 @@
 
 bool Parallaction::checkSpecialZoneBox(ZonePtr z, uint32 type, uint x, uint y) {
 	// check if really a special zone
-	int gameType = getGameType();
-	if (gameType == GType_Nippon) {
+	if (_gameType == GType_Nippon) {
 		// so-called special zones in NS have special x coordinates
 		if ((z->getX() != -2) && (z->getX() != -3)) {
 			return false;
 		}
 	}
-	if (gameType == GType_BRA) {
+	if (_gameType == GType_BRA) {
 		// so far, special zones in BRA are only merge zones
 		if (ACTIONTYPE(z) != kZoneMerge) {
 			return false;
@@ -691,14 +691,12 @@
 }
 
 bool Parallaction::checkZoneType(ZonePtr z, uint32 type) {
-	int gameType = getGameType();
-
-	if (gameType == GType_Nippon) {
+	if (_gameType == GType_Nippon) {
 		if ((type == 0) && (ITEMTYPE(z) == 0))
 			return true;		
 	}
 
-	if (gameType == GType_BRA) {
+	if (_gameType == GType_BRA) {
 		if (type == 0) {
 			if (ITEMTYPE(z) == 0) {			
 				if (ACTIONTYPE(z) != kZonePath) {
@@ -731,13 +729,12 @@
 			return true;
 
 		// check if self-use zone (nothing to do with kFlagsSelfuse)
-		int gameType = getGameType();
-		if (gameType == GType_Nippon) {
+		if (_gameType == GType_Nippon) {
 			if (z->getX() != -1) {	// no explicit self-use flag in NS
 				return false;
 			}
 		}
-		if (gameType == GType_BRA) {
+		if (_gameType == GType_BRA) {
 			if (!(z->_flags & kFlagsYourself)) {
 				return false;
 			}
@@ -787,9 +784,6 @@
 		}
 	}
 
-
-	int gameType = getGameType();
-
 	int16 _a, _b, _c, _d;
 	bool _ef;
 	for (AnimationList::iterator ait = _location._animations.begin(); ait != _location._animations.end(); ++ait) {
@@ -799,7 +793,7 @@
 		_a = (a->_flags & kFlagsActive) ? 1 : 0;	// _a: active Animation
 		
 		if (!_a) {
-			if (gameType == GType_BRA && ACTIONTYPE(a) != kZoneTrap) {
+			if (_gameType == GType_BRA && ACTIONTYPE(a) != kZoneTrap) {
 				continue;
 			}
 		}
@@ -995,7 +989,7 @@
 }
 
 void Parallaction::beep() {
-	if (getGameType() == GType_Nippon) {
+	if (_gameType == GType_Nippon) {
 		_soundMan->execute(SC_SETSFXCHANNEL, 3);
 		_soundMan->execute(SC_SETSFXVOLUME, 127);
 		_soundMan->execute(SC_SETSFXLOOPING, (int32)0);

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2010-05-22 17:59:33 UTC (rev 49145)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2010-05-22 17:59:49 UTC (rev 49146)
@@ -280,6 +280,7 @@
 	int32			_screenWidth;
 	int32			_screenHeight;
 	int32			_screenSize;
+	int				_gameType;
 
 	// subsystems
 	Gfx				*_gfx;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list