[Scummvm-cvs-logs] SF.net SVN: scummvm: [24527] scummvm/trunk/engines/agos

kirben at users.sourceforge.net kirben at users.sourceforge.net
Fri Oct 27 13:04:17 CEST 2006


Revision: 24527
          http://svn.sourceforge.net/scummvm/?rev=24527&view=rev
Author:   kirben
Date:     2006-10-27 04:04:05 -0700 (Fri, 27 Oct 2006)

Log Message:
-----------
Cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/agos/agos.h
    scummvm/trunk/engines/agos/icons.cpp
    scummvm/trunk/engines/agos/res_snd.cpp
    scummvm/trunk/engines/agos/script.cpp
    scummvm/trunk/engines/agos/script_e1.cpp
    scummvm/trunk/engines/agos/script_e2.cpp
    scummvm/trunk/engines/agos/script_ff.cpp
    scummvm/trunk/engines/agos/script_s2.cpp
    scummvm/trunk/engines/agos/string.cpp

Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h	2006-10-27 10:43:48 UTC (rev 24526)
+++ scummvm/trunk/engines/agos/agos.h	2006-10-27 11:04:05 UTC (rev 24527)
@@ -649,7 +649,7 @@
 	void setItemParent(Item *item, Item *parent);
 	void setItemState(Item *item, int value);
 
-	void stopAnimateSimon1(uint a);
+	void stopAnimate(uint a);
 	void stopAnimateSimon2(uint a, uint b);
 
 	void enableBox(uint hitarea);
@@ -1072,16 +1072,6 @@
 	void o_clearTimers();
 	void o_setDollar();
 	void o_isBox();
-	void o_doTable();
-	void o_storeItem();
-	void o_getItem();
-	void o_bSet();
-	void o_bClear();
-	void o_bZero();
-	void o_bNotZero();
-	void o_getOValue();
-	void o_setOValue();
-	void o_ink();
 
 	// Opcodes, Elvira 1
 	void oe1_present();
@@ -1142,12 +1132,22 @@
 	void oe2_doClass();
 	void oe2_pObj();
 	void oe2_drawItem();
+	void oe2_doTable();
 	void oe2_setDoorOpen();
 	void oe2_setDoorClosed();
 	void oe2_setDoorLocked();
 	void oe2_ifDoorOpen();
 	void oe2_ifDoorClosed();
 	void oe2_ifDoorLocked();
+	void oe2_storeItem();
+	void oe2_getItem();
+	void oe2_bSet();
+	void oe2_bClear();
+	void oe2_bZero();
+	void oe2_bNotZero();
+	void oe2_getOValue();
+	void oe2_setOValue();
+	void oe2_ink();
 	void oe2_printStats();
 	void oe2_unk162();
 	void oe2_setSuperRoom();

Modified: scummvm/trunk/engines/agos/icons.cpp
===================================================================
--- scummvm/trunk/engines/agos/icons.cpp	2006-10-27 10:43:48 UTC (rev 24526)
+++ scummvm/trunk/engines/agos/icons.cpp	2006-10-27 11:04:05 UTC (rev 24527)
@@ -632,7 +632,7 @@
 		ha->window = window;
 		ha->verb = 1;
 
-		stopAnimateSimon1(128);
+		stopAnimate(128);
 		animate(0, 1, 128, 0, 0, 14);
 	} else if (getGameType() == GType_WW) {
 		ha->x = 255;
@@ -671,7 +671,7 @@
 
 void AGOSEngine::removeArrows(WindowBlock *window, uint num) {
 	if (getGameType() == GType_SIMON1) {
-		stopAnimateSimon1(128);
+		stopAnimate(128);
 	} else if (getGameType() == GType_WW) {
 		setBitFlag(22, false);
 		setWindowImageEx(6, 103);

Modified: scummvm/trunk/engines/agos/res_snd.cpp
===================================================================
--- scummvm/trunk/engines/agos/res_snd.cpp	2006-10-27 10:43:48 UTC (rev 24526)
+++ scummvm/trunk/engines/agos/res_snd.cpp	2006-10-27 11:04:05 UTC (rev 24527)
@@ -54,9 +54,9 @@
 			if (_subtitles && _scriptVar2) {
 				animate(4, 2, 204, 0, 0, 0);
 				waitForSync(204);
-				stopAnimateSimon1(204);
+				stopAnimate(204);
 			}
-			stopAnimateSimon1(vgaSpriteId + 201);
+			stopAnimate(vgaSpriteId + 201);
 			loadVoice(speech_id);
 			animate(4, 2, vgaSpriteId + 201, 0, 0, 0);
 		}
@@ -108,7 +108,7 @@
 			_variableArray[100] = 15;
 			animate(4, 1, 130, 0, 0, 0);
 			waitForSync(130);
-			stopAnimateSimon1(1);
+			stopAnimate(1);
 		}
 	}
 }

Modified: scummvm/trunk/engines/agos/script.cpp
===================================================================
--- scummvm/trunk/engines/agos/script.cpp	2006-10-27 10:43:48 UTC (rev 24526)
+++ scummvm/trunk/engines/agos/script.cpp	2006-10-27 11:04:05 UTC (rev 24527)
@@ -130,16 +130,16 @@
 	op[140] = &AGOSEngine::o_clearTimers;
 	op[141] = &AGOSEngine::o_setDollar;
 	op[142] = &AGOSEngine::o_isBox;
-	op[143] = &AGOSEngine::o_doTable;
-	op[151] = &AGOSEngine::o_storeItem;
-	op[152] = &AGOSEngine::o_getItem;
-	op[153] = &AGOSEngine::o_bSet;
-	op[154] = &AGOSEngine::o_bClear;
-	op[155] = &AGOSEngine::o_bZero;
-	op[156] = &AGOSEngine::o_bNotZero;
-	op[157] = &AGOSEngine::o_getOValue;
-	op[158] = &AGOSEngine::o_setOValue;
-	op[160] = &AGOSEngine::o_ink;
+	op[143] = &AGOSEngine::oe2_doTable;
+	op[151] = &AGOSEngine::oe2_storeItem;
+	op[152] = &AGOSEngine::oe2_getItem;
+	op[153] = &AGOSEngine::oe2_bSet;
+	op[154] = &AGOSEngine::oe2_bClear;
+	op[155] = &AGOSEngine::oe2_bZero;
+	op[156] = &AGOSEngine::oe2_bNotZero;
+	op[157] = &AGOSEngine::oe2_getOValue;
+	op[158] = &AGOSEngine::oe2_setOValue;
+	op[160] = &AGOSEngine::oe2_ink;
 }
 
 void AGOSEngine::setupOpcodes() {
@@ -713,7 +713,7 @@
 	if (params & 8)
 		flags |= kBFTextBox;
 	if (params & 16)
-		flags |= 0x10;
+		flags |= kBFDragBox;
 
 	x = getVarOrWord();
 	y = getVarOrWord();
@@ -946,106 +946,6 @@
 	setScriptCondition(isBoxDead(getVarOrWord()));
 }
 
-void AGOSEngine::o_doTable() {
-	// 143: start item sub
-	SubRoom *r = (SubRoom *)findChildOfType(getNextItemPtr(), 1);
-	if (r != NULL) {
-		Subroutine *sub = getSubroutineByID(r->subroutine_id);
-		if (sub) {
-			startSubroutine(sub);
-			return;
-		}
-	}
-
-	if (getGameType() == GType_ELVIRA2) {
-		SubSuperRoom *sr = (SubSuperRoom *)findChildOfType(getNextItemPtr(), 4);
-		if (sr != NULL) {
-			Subroutine *sub = getSubroutineByID(sr->subroutine_id);
-			if (sub) {
-				startSubroutine(sub);
-				return;
-			}
-		}
-	}
-}
-
-void AGOSEngine::o_storeItem() {
-	// 151: set array6 to item
-	uint var = getVarOrByte();
-	Item *item = getNextItemPtr();
-	_itemStore[var] = item;
-}
-
-void AGOSEngine::o_getItem() {
-	// 152: set m1 to m3 to array 6
-	Item *item = _itemStore[getVarOrByte()];
-	uint var = getVarOrByte();
-	if (var == 1) {
-		_subjectItem = item;
-	} else {
-		_objectItem = item;
-	}
-}
-
-void AGOSEngine::o_bSet() {
-	// 153: set bit
-	setBitFlag(getVarWrapper(), true);
-}
-
-void AGOSEngine::o_bClear() {
-	// 154: clear bit
-	setBitFlag(getVarWrapper(), false);
-}
-
-void AGOSEngine::o_bZero() {
-	// 155: is bit clear
-	setScriptCondition(!getBitFlag(getVarWrapper()));
-}
-
-void AGOSEngine::o_bNotZero() {
-	// 156: is bit set
-	uint bit = getVarWrapper();
-
-	// WORKAROUND: Fix for glitch in some versions
-	if (getGameType() == GType_SIMON1 && _subroutine == 2962 && bit == 63) {
-		bit = 50;
-	}
-
-	setScriptCondition(getBitFlag(bit));
-}
-
-void AGOSEngine::o_getOValue() {
-	// 157: get item int prop
-	Item *item = getNextItemPtr();
-	SubObject *subObject = (SubObject *)findChildOfType(item, 2);
-	uint prop = getVarOrByte();
-
-	if (subObject != NULL && subObject->objectFlags & (1 << prop) && prop < 16) {
-		uint offs = getOffsetOfChild2Param(subObject, 1 << prop);
-		writeNextVarContents(subObject->objectFlagValue[offs]);
-	} else {
-		writeNextVarContents(0);
-	}
-}
-
-void AGOSEngine::o_setOValue() {
-	// 158: set item prop
-	Item *item = getNextItemPtr();
-	SubObject *subObject = (SubObject *)findChildOfType(item, 2);
-	uint prop = getVarOrByte();
-	int value = getVarOrWord();
-
-	if (subObject != NULL && subObject->objectFlags & (1 << prop) && prop < 16) {
-		uint offs = getOffsetOfChild2Param(subObject, 1 << prop);
-		subObject->objectFlagValue[offs] = value;
-	}
-}
-
-void AGOSEngine::o_ink() {
-	// 160
-	setTextColor(getVarOrByte());
-}
-
 // -----------------------------------------------------------------------
 
 byte AGOSEngine::getByte() {
@@ -1200,27 +1100,6 @@
 	_lockWord &= ~0x8000;
 }
 
-void AGOSEngine::waitForMark(uint i) {
-	_exitCutscene = false;
-	while (!(_marks & (1 << i))) {
-		if (_exitCutscene) {
-			if (getGameType() == GType_PP) {
-				if (_picture8600)
-					break;
-			} else {
-				if (getBitFlag(9)) {
-					endCutscene();
-					break;
-				}
-			}
-		} else {
-			processSpecialKeys();
-		}
-
-		delay(10);
-	}
-}
-
 void AGOSEngine::sendSync(uint a) {
 	uint16 id = to16Wrapper(a);
 	_lockWord |= 0x8000;
@@ -1236,7 +1115,7 @@
 	window->text_color = color;
 }
 
-void AGOSEngine::stopAnimateSimon1(uint a) {
+void AGOSEngine::stopAnimate(uint a) {
 	uint16 b = to16Wrapper(a);
 	_lockWord |= 0x8000;
 	_vcPtr = (byte *)&b;

Modified: scummvm/trunk/engines/agos/script_e1.cpp
===================================================================
--- scummvm/trunk/engines/agos/script_e1.cpp	2006-10-27 10:43:48 UTC (rev 24526)
+++ scummvm/trunk/engines/agos/script_e1.cpp	2006-10-27 11:04:05 UTC (rev 24527)
@@ -560,7 +560,7 @@
 
 void AGOSEngine::oe1_stopAnimate() {
 	// 227: stop animate
-	stopAnimateSimon1(getVarOrWord());
+	stopAnimate(getVarOrWord());
 }
 
 void AGOSEngine::oe1_menu() {

Modified: scummvm/trunk/engines/agos/script_e2.cpp
===================================================================
--- scummvm/trunk/engines/agos/script_e2.cpp	2006-10-27 10:43:48 UTC (rev 24526)
+++ scummvm/trunk/engines/agos/script_e2.cpp	2006-10-27 11:04:05 UTC (rev 24527)
@@ -136,6 +136,29 @@
 	mouseOn();
 }
 
+void AGOSEngine::oe2_doTable() {
+	// 143: start item sub
+	SubRoom *r = (SubRoom *)findChildOfType(getNextItemPtr(), 1);
+	if (r != NULL) {
+		Subroutine *sub = getSubroutineByID(r->subroutine_id);
+		if (sub) {
+			startSubroutine(sub);
+			return;
+		}
+	}
+
+	if (getGameType() == GType_ELVIRA2) {
+		SubSuperRoom *sr = (SubSuperRoom *)findChildOfType(getNextItemPtr(), 4);
+		if (sr != NULL) {
+			Subroutine *sub = getSubroutineByID(sr->subroutine_id);
+			if (sub) {
+				startSubroutine(sub);
+				return;
+			}
+		}
+	}
+}
+
 void AGOSEngine::oe2_setDoorOpen() {
 	// 144: set door open
 	Item *i = getNextItemPtr();
@@ -175,6 +198,83 @@
 	setScriptCondition(getDoorState(i, d) == 3);
 }
 
+void AGOSEngine::oe2_storeItem() {
+	// 151: set array6 to item
+	uint var = getVarOrByte();
+	Item *item = getNextItemPtr();
+	_itemStore[var] = item;
+}
+
+void AGOSEngine::oe2_getItem() {
+	// 152: set m1 to m3 to array 6
+	Item *item = _itemStore[getVarOrByte()];
+	uint var = getVarOrByte();
+	if (var == 1) {
+		_subjectItem = item;
+	} else {
+		_objectItem = item;
+	}
+}
+
+void AGOSEngine::oe2_bSet() {
+	// 153: set bit
+	setBitFlag(getVarWrapper(), true);
+}
+
+void AGOSEngine::oe2_bClear() {
+	// 154: clear bit
+	setBitFlag(getVarWrapper(), false);
+}
+
+void AGOSEngine::oe2_bZero() {
+	// 155: is bit clear
+	setScriptCondition(!getBitFlag(getVarWrapper()));
+}
+
+void AGOSEngine::oe2_bNotZero() {
+	// 156: is bit set
+	uint bit = getVarWrapper();
+
+	// WORKAROUND: Fix for glitch in some versions
+	if (getGameType() == GType_SIMON1 && _subroutine == 2962 && bit == 63) {
+		bit = 50;
+	}
+
+	setScriptCondition(getBitFlag(bit));
+}
+
+void AGOSEngine::oe2_getOValue() {
+	// 157: get item int prop
+	Item *item = getNextItemPtr();
+	SubObject *subObject = (SubObject *)findChildOfType(item, 2);
+	uint prop = getVarOrByte();
+
+	if (subObject != NULL && subObject->objectFlags & (1 << prop) && prop < 16) {
+		uint offs = getOffsetOfChild2Param(subObject, 1 << prop);
+		writeNextVarContents(subObject->objectFlagValue[offs]);
+	} else {
+		writeNextVarContents(0);
+	}
+}
+
+void AGOSEngine::oe2_setOValue() {
+	// 158: set item prop
+	Item *item = getNextItemPtr();
+	SubObject *subObject = (SubObject *)findChildOfType(item, 2);
+	uint prop = getVarOrByte();
+	int value = getVarOrWord();
+
+	if (subObject != NULL && subObject->objectFlags & (1 << prop) && prop < 16) {
+		uint offs = getOffsetOfChild2Param(subObject, 1 << prop);
+		subObject->objectFlagValue[offs] = value;
+	}
+}
+
+void AGOSEngine::oe2_ink() {
+	// 160
+	setTextColor(getVarOrByte());
+}
+
 void AGOSEngine::oe2_printStats() {
 	// 161: print stats
 	WindowBlock *window = _dummyWindow;

Modified: scummvm/trunk/engines/agos/script_ff.cpp
===================================================================
--- scummvm/trunk/engines/agos/script_ff.cpp	2006-10-27 10:43:48 UTC (rev 24526)
+++ scummvm/trunk/engines/agos/script_ff.cpp	2006-10-27 11:04:05 UTC (rev 24527)
@@ -165,7 +165,7 @@
 	if (params & 8)
 		flags |= kBFTextBox;
 	if (params & 16)
-		flags |= 0x10;
+		flags |= kBFHyperBox;
 
 	x = getVarOrWord();
 	y = getVarOrWord();

Modified: scummvm/trunk/engines/agos/script_s2.cpp
===================================================================
--- scummvm/trunk/engines/agos/script_s2.cpp	2006-10-27 10:43:48 UTC (rev 24526)
+++ scummvm/trunk/engines/agos/script_s2.cpp	2006-10-27 11:04:05 UTC (rev 24527)
@@ -241,4 +241,25 @@
 		waitForMark(i);
 }
 
+void AGOSEngine::waitForMark(uint i) {
+	_exitCutscene = false;
+	while (!(_marks & (1 << i))) {
+		if (_exitCutscene) {
+			if (getGameType() == GType_PP) {
+				if (_picture8600)
+					break;
+			} else {
+				if (getBitFlag(9)) {
+					endCutscene();
+					break;
+				}
+			}
+		} else {
+			processSpecialKeys();
+		}
+
+		delay(10);
+	}
+}
+
 } // End of namespace AGOS

Modified: scummvm/trunk/engines/agos/string.cpp
===================================================================
--- scummvm/trunk/engines/agos/string.cpp	2006-10-27 10:43:48 UTC (rev 24526)
+++ scummvm/trunk/engines/agos/string.cpp	2006-10-27 11:04:05 UTC (rev 24527)
@@ -453,7 +453,7 @@
 	}
 
 	if (getGameType() == GType_SIMON1)
-		stopAnimateSimon1(vgaSpriteId + 199);
+		stopAnimate(vgaSpriteId + 199);
 	else
 		stopAnimateSimon2(2, vgaSpriteId);
 
@@ -678,7 +678,7 @@
 	_linePtrs[0] = _boxBuffer;
 	if (_boxCR == 0)
 		_boxLineCount++;
-	stopAnimateSimon1(105);
+	stopAnimate(105);
 	BoxSize = getBoxSize();
 	_variableArray[53] = BoxSize;
 	animate(3, 1, 100, 0, 0, 0);


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