[Scummvm-cvs-logs] SF.net SVN: scummvm:[53695] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Fri Oct 22 04:08:28 CEST 2010


Revision: 53695
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53695&view=rev
Author:   lordhoto
Date:     2010-10-22 02:08:26 +0000 (Fri, 22 Oct 2010)

Log Message:
-----------
KYRA: A little refactoring (name change).

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_hof.cpp
    scummvm/trunk/engines/kyra/kyra_mr.cpp
    scummvm/trunk/engines/kyra/kyra_v2.h
    scummvm/trunk/engines/kyra/scene_hof.cpp
    scummvm/trunk/engines/kyra/scene_mr.cpp
    scummvm/trunk/engines/kyra/script_v2.cpp

Modified: scummvm/trunk/engines/kyra/kyra_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_hof.cpp	2010-10-22 01:30:18 UTC (rev 53694)
+++ scummvm/trunk/engines/kyra/kyra_hof.cpp	2010-10-22 02:08:26 UTC (rev 53695)
@@ -507,7 +507,7 @@
 		update();
 
 		if (inputFlag == 198 || inputFlag == 199) {
-			_unk3 = _mouseState;
+			_savedMouseState = _mouseState;
 			handleInput(_mouseX, _mouseY);
 		}
 
@@ -528,7 +528,7 @@
 	if (!_screen->isMouseVisible())
 		return;
 
-	if (_unk3 == -2) {
+	if (_savedMouseState == -2) {
 		snd_playSoundEffect(13);
 		return;
 	}
@@ -537,8 +537,8 @@
 
 	if (x <= 6 || x >= 312 || y <= 6 || y >= 135) {
 		bool exitOk = false;
-		assert(_unk3 + 6 >= 0);
-		switch (_unk3 + 6) {
+		assert(_savedMouseState + 6 >= 0);
+		switch (_savedMouseState + 6) {
 		case 0:
 			if (_sceneExit1 != 0xFFFF)
 				exitOk = true;
@@ -569,7 +569,7 @@
 		}
 	}
 
-	if (checkCharCollision(x, y) && _unk3 >= -1) {
+	if (checkCharCollision(x, y) && _savedMouseState >= -1) {
 		runSceneScript2();
 		return;
 	} else if (pickUpItem(x, y)) {
@@ -609,7 +609,7 @@
 
 			dropItem(0, _itemInHand, x, y, 1);
 		} else {
-			if (_unk3 == -2 || y > 135)
+			if (_savedMouseState == -2 || y > 135)
 				return;
 
 			if (!_unk5) {
@@ -1169,25 +1169,25 @@
 	_pathfinderFlag = 15;
 
 	if (!_unkHandleSceneChangeFlag) {
-		if (_unk3 == -3) {
+		if (_savedMouseState == -3) {
 			if (_sceneList[curScene].exit4 != 0xFFFF) {
 				x = 4;
 				y = _sceneEnterY4;
 				_pathfinderFlag = 7;
 			}
-		} else if (_unk3 == -5) {
+		} else if (_savedMouseState == -5) {
 			if (_sceneList[curScene].exit2 != 0xFFFF) {
 				x = 316;
 				y = _sceneEnterY2;
 				_pathfinderFlag = 7;
 			}
-		} else if (_unk3 == -6) {
+		} else if (_savedMouseState == -6) {
 			if (_sceneList[curScene].exit1 != 0xFFFF) {
 				x = _sceneEnterX1;
 				y = _sceneEnterY1 - 2;
 				_pathfinderFlag = 14;
 			}
-		} else if (_unk3 == -4) {
+		} else if (_savedMouseState == -4) {
 			if (_sceneList[curScene].exit3 != 0xFFFF) {
 				x = _sceneEnterX3;
 				y = 147;
@@ -1200,13 +1200,13 @@
 	int vocH = _flags.isTalkie ? 131 : -1;
 
 	if (_pathfinderFlag) {
-		if (findItem(curScene, 13) >= 0 && _unk3 <= -3) {
+		if (findItem(curScene, 13) >= 0 && _savedMouseState <= -3) {
 			strId = 252;
 		} else if (_itemInHand == 72) {
 			strId = 257;
-		} else if (findItem(curScene, 72) >= 0 && _unk3 <= -3) {
+		} else if (findItem(curScene, 72) >= 0 && _savedMouseState <= -3) {
 			strId = 256;
-		} else if (getInventoryItemSlot(72) != -1 && _unk3 <= -3) {
+		} else if (getInventoryItemSlot(72) != -1 && _savedMouseState <= -3) {
 			strId = 257;
 		}
 	}

Modified: scummvm/trunk/engines/kyra/kyra_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_mr.cpp	2010-10-22 01:30:18 UTC (rev 53694)
+++ scummvm/trunk/engines/kyra/kyra_mr.cpp	2010-10-22 02:08:26 UTC (rev 53695)
@@ -100,7 +100,7 @@
 	_unkSceneScreenFlag1 = false;
 	_noScriptEnter = true;
 	_itemInHand = _mouseState = -1;
-	_unk3 = -1;
+	_savedMouseState = -1;
 	_unk4 = 0;
 	_loadingState = false;
 	_noStartupChat = false;
@@ -966,7 +966,7 @@
 		_timer->update();
 
 		if (inputFlag == 198 || inputFlag == 199) {
-			_unk3 = _mouseState;
+			_savedMouseState = _mouseState;
 			Common::Point mouse = getMousePos();
 			handleInput(mouse.x, mouse.y);
 		}
@@ -988,7 +988,7 @@
 	if (!_screen->isMouseVisible())
 		return;
 
-	if (_unk3 == -3) {
+	if (_savedMouseState == -3) {
 		snd_playSoundEffect(0x0D, 0x80);
 		return;
 	}
@@ -997,7 +997,7 @@
 
 	int skip = 0;
 
-	if (checkCharCollision(x, y) && _unk3 >= -1 && runSceneScript2()) {
+	if (checkCharCollision(x, y) && _savedMouseState >= -1 && runSceneScript2()) {
 		return;
 	} else if (_itemInHand != 27 && pickUpItem(x, y, 1)) {
 		return;
@@ -1023,7 +1023,7 @@
 	if (checkCharCollision(x, y)) {
 		if (runSceneScript2())
 			return;
-	} else if (_itemInHand >= 0 && _unk3 >= 0) {
+	} else if (_itemInHand >= 0 && _savedMouseState >= 0) {
 		if (_itemInHand == 27) {
 			makeCharFacingMouse();
 		} else if (y <= 187) {
@@ -1033,10 +1033,10 @@
 				dropItem(0, _itemInHand, x, y, 1);
 		}
 		return;
-	} else if (_unk3 == -3) {
+	} else if (_savedMouseState == -3) {
 		return;
 	} else {
-		if (y > 187 && _unk3 > -4)
+		if (y > 187 && _savedMouseState > -4)
 			return;
 		if (_unk5) {
 			_unk5 = 0;
@@ -1052,25 +1052,25 @@
 	_pathfinderFlag = 15;
 
 	if (!_unkHandleSceneChangeFlag) {
-		if (_unk3 == -4) {
+		if (_savedMouseState == -4) {
 			if (_sceneList[curScene].exit4 != 0xFFFF) {
 				x = 4;
 				y = _sceneEnterY4;
 				_pathfinderFlag = 7;
 			}
-		} else if (_unk3 == -6) {
+		} else if (_savedMouseState == -6) {
 			if (_sceneList[curScene].exit2 != 0xFFFF) {
 				x = 316;
 				y = _sceneEnterY2;
 				_pathfinderFlag = 7;
 			}
-		} else if (_unk3 == -7) {
+		} else if (_savedMouseState == -7) {
 			if (_sceneList[curScene].exit1 != 0xFFFF) {
 				x = _sceneEnterX1;
 				y = _sceneEnterY1 - 2;
 				_pathfinderFlag = 14;
 			}
-		} else if (_unk3 == -5) {
+		} else if (_savedMouseState == -5) {
 			if (_sceneList[curScene].exit3 != 0xFFFF) {
 				x = _sceneEnterX3;
 				y = 191;

Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h	2010-10-22 01:30:18 UTC (rev 53694)
+++ scummvm/trunk/engines/kyra/kyra_v2.h	2010-10-22 02:08:26 UTC (rev 53695)
@@ -301,6 +301,7 @@
 	int _itemListSize;
 
 	int _itemInHand;
+	int _savedMouseState;
 
 	int findFreeItem();
 	int countAllItems();
@@ -360,7 +361,7 @@
 	virtual void randomSceneChat() = 0;
 
 	// unknown
-	int _unk3, _unk4, _unk5;
+	int _unk4, _unk5;
 	bool _unkSceneScreenFlag1;
 	bool _unkHandleSceneChangeFlag;
 

Modified: scummvm/trunk/engines/kyra/scene_hof.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_hof.cpp	2010-10-22 01:30:18 UTC (rev 53694)
+++ scummvm/trunk/engines/kyra/scene_hof.cpp	2010-10-22 02:08:26 UTC (rev 53695)
@@ -241,7 +241,7 @@
 }
 
 void KyraEngine_HoF::enterNewSceneUnk2(int unk1) {
-	_unk3 = -1;
+	_savedMouseState = -1;
 
 	if (_flags.isTalkie) {
 		if (_mainCharX == -1 && _mainCharY == -1 && _mainCharacter.sceneId != 61 &&
@@ -265,7 +265,7 @@
 	}
 
 	_unk4 = 0;
-	_unk3 = -1;
+	_savedMouseState = -1;
 }
 
 int KyraEngine_HoF::trySceneChange(int *moveTable, int unk1, int updateChar) {
@@ -339,16 +339,16 @@
 	int facing = 0;
 	int process = 0;
 
-	if (_screen->getLayer(charX, charY) == 1 && _unk3 == -6) {
+	if (_screen->getLayer(charX, charY) == 1 && _savedMouseState == -6) {
 		facing = 0;
 		process = 1;
-	} else if (charX >= 316 && _unk3 == -5) {
+	} else if (charX >= 316 && _savedMouseState == -5) {
 		facing = 2;
 		process = 1;
-	} else if (charY >= 142 && _unk3 == -4) {
+	} else if (charY >= 142 && _savedMouseState == -4) {
 		facing = 4;
 		process = 1;
-	} else if (charX <= 4 && _unk3 == -3) {
+	} else if (charX <= 4 && _savedMouseState == -3) {
 		facing = 6;
 		process = 1;
 	}

Modified: scummvm/trunk/engines/kyra/scene_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/scene_mr.cpp	2010-10-22 01:30:18 UTC (rev 53694)
+++ scummvm/trunk/engines/kyra/scene_mr.cpp	2010-10-22 02:08:26 UTC (rev 53695)
@@ -287,7 +287,7 @@
 }
 
 void KyraEngine_MR::enterNewSceneUnk2(int unk1) {
-	_unk3 = -1;
+	_savedMouseState = -1;
 	if (_mainCharX == -1 && _mainCharY == -1 && !unk1) {
 		_mainCharacter.animFrame = _characterFrameTable[_mainCharacter.facing];
 		updateCharacterAnim(0);
@@ -300,7 +300,7 @@
 	}
 
 	_unk4 = 0;
-	_unk3 = -1;
+	_savedMouseState = -1;
 }
 
 void KyraEngine_MR::unloadScene() {
@@ -696,16 +696,16 @@
 	int facing = 0;
 	int process = 0;
 
-	if (_screen->getLayer(charX, charY) == 1 && _unk3 == -7) {
+	if (_screen->getLayer(charX, charY) == 1 && _savedMouseState == -7) {
 		facing = 0;
 		process = 1;
-	} else if (charX >= 316 && _unk3 == -6) {
+	} else if (charX >= 316 && _savedMouseState == -6) {
 		facing = 2;
 		process = 1;
-	} else if (charY >= 186 && _unk3 == -5) {
+	} else if (charY >= 186 && _savedMouseState == -5) {
 		facing = 4;
 		process = 1;
-	} else if (charX <= 4 && _unk3 == -4) {
+	} else if (charX <= 4 && _savedMouseState == -4) {
 		facing = 6;
 		process = 1;
 	}
@@ -742,7 +742,7 @@
 	return 1;
 }
 int KyraEngine_MR::runSceneScript1(int x, int y) {
-	if (y > 187 && _unk3 > -4)
+	if (y > 187 && _savedMouseState > -4)
 		return 0;
 	if (_deathHandler >= 0)
 		return 0;

Modified: scummvm/trunk/engines/kyra/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v2.cpp	2010-10-22 01:30:18 UTC (rev 53694)
+++ scummvm/trunk/engines/kyra/script_v2.cpp	2010-10-22 02:08:26 UTC (rev 53695)
@@ -69,7 +69,7 @@
 	if (success) {
 		_emc->init(script, script->dataPtr);
 		_unk4 = 0;
-		_unk3 = -1;
+		_savedMouseState = -1;
 		_unk5 = 1;
 		return 0;
 	} else {


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