[Scummvm-cvs-logs] SF.net SVN: scummvm: [21880] scummvm/trunk/engines/simon

kirben at users.sourceforge.net kirben at users.sourceforge.net
Fri Apr 14 02:58:04 CEST 2006


Revision: 21880
Author:   kirben
Date:     2006-04-14 02:57:43 -0700 (Fri, 14 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21880&view=rev

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

Modified Paths:
--------------
    scummvm/trunk/engines/simon/debug.cpp
    scummvm/trunk/engines/simon/items.cpp
    scummvm/trunk/engines/simon/saveload.cpp
    scummvm/trunk/engines/simon/simon.h
    scummvm/trunk/engines/simon/verb.cpp
    scummvm/trunk/engines/simon/vga.cpp
    scummvm/trunk/engines/simon/vga.h
Modified: scummvm/trunk/engines/simon/debug.cpp
===================================================================
--- scummvm/trunk/engines/simon/debug.cpp	2006-04-14 09:45:29 UTC (rev 21879)
+++ scummvm/trunk/engines/simon/debug.cpp	2006-04-14 09:57:43 UTC (rev 21880)
@@ -348,7 +348,7 @@
 
 	if (getGameType() == GType_FF) {
 		for (i = 0; i != w; i++) {
-			byte *c = vc10_depack_column(&state);
+			byte *c = vc10_depackColumn(&state);
 			for (j = 0; j != h; j++) {
 				byte pix = c[j];
 				b[j * w + i] = pix;
@@ -356,7 +356,7 @@
 		}
 	} else {
 		for (i = 0; i != w; i += 2) {
-			byte *c = vc10_depack_column(&state);
+			byte *c = vc10_depackColumn(&state);
 			for (j = 0; j != h; j++) {
 				byte pix = c[j];
 				b[j * w + i] = (pix >> 4) | base;

Modified: scummvm/trunk/engines/simon/items.cpp
===================================================================
--- scummvm/trunk/engines/simon/items.cpp	2006-04-14 09:45:29 UTC (rev 21879)
+++ scummvm/trunk/engines/simon/items.cpp	2006-04-14 09:57:43 UTC (rev 21880)
@@ -952,17 +952,17 @@
 
 void SimonEngine::o_delBox() {
 	// 108: delete hitarea
-	delete_hitarea(getVarOrWord());
+	undefineBox(getVarOrWord());
 }
 
 void SimonEngine::o_enableBox() {
 	// 109: clear hitarea bit 0x40
-	clear_hitarea_bit_0x40(getVarOrWord());
+	enableBox(getVarOrWord());
 }
 
 void SimonEngine::o_disableBox() {
 	// 110: set hitarea bit 0x40
-	set_hitarea_bit_0x40(getVarOrWord());
+	disableBox(getVarOrWord());
 }
 
 void SimonEngine::o_moveBox() {
@@ -2139,7 +2139,7 @@
 	uint16 id = to16Wrapper(a);
 	_lockWord |= 0x8000;
 	_vcPtr = (byte *)&id;
-	vc15_wakeup_id();
+	vc15_sync();
 	_lockWord &= ~0x8000;
 }
 

Modified: scummvm/trunk/engines/simon/saveload.cpp
===================================================================
--- scummvm/trunk/engines/simon/saveload.cpp	2006-04-14 09:45:29 UTC (rev 21879)
+++ scummvm/trunk/engines/simon/saveload.cpp	2006-04-14 09:57:43 UTC (rev 21880)
@@ -163,7 +163,7 @@
 		return;
 
 	do {
-		clear_hitarea_bit_0x40(0xd0 + i - 1);
+		enableBox(0xd0 + i - 1);
 	} while (--i);
 }
 
@@ -211,7 +211,7 @@
 	if_1:;
 		unk132_result = i;
 
-		set_hitarea_bit_0x40(208 + i);
+		disableBox(208 + i);
 		leaveHitAreaById(208 + i);
 
 		// some code here
@@ -274,7 +274,7 @@
 				if (b) {
 					if (i == 205)
 						goto get_out;
-					clear_hitarea_bit_0x40(0xd0 + unk132_result);
+					enableBox(0xd0 + unk132_result);
 					if (_saveLoadFlag) {
 						clearCharacter(_windowArray[5], 8);
 						// move code
@@ -284,7 +284,7 @@
 
 				// is_not_b
 				if (!_saveLoadFlag) {
-					clear_hitarea_bit_0x40(0xd0 + unk132_result);
+					enableBox(0xd0 + unk132_result);
 					goto restart;
 				}
 			} while (i >= 0x80 || i == 0);
@@ -404,7 +404,7 @@
 
 void SimonEngine::unk_132_helper_3() {
 	for (int i = 208; i != 208 + 6; i++)
-		set_hitarea_bit_0x40(i);
+		disableBox(i);
 }
 
 void SimonEngine::clearCharacter(WindowBlock *window, int x, byte b) {
@@ -476,7 +476,7 @@
 		goto loop;
 
 	// Return
-	delete_hitarea(0x7FFF);
+	undefineBox(0x7FFF);
 }
 
 bool SimonEngine::saveGame(uint slot, char *caption) {

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-04-14 09:45:29 UTC (rev 21879)
+++ scummvm/trunk/engines/simon/simon.h	2006-04-14 09:57:43 UTC (rev 21880)
@@ -562,11 +562,11 @@
 
 	void changeWindow(uint a);
 	void closeWindow(uint a);
-	void clear_hitarea_bit_0x40(uint hitarea);
-	void set_hitarea_bit_0x40(uint hitarea);
+	void enableBox(uint hitarea);
+	void disableBox(uint hitarea);
 	void moveBox(uint hitarea, int x, int y);
 	bool is_hitarea_0x40_clear(uint hitarea);
-	void delete_hitarea(uint hitarea);
+	void undefineBox(uint hitarea);
 	void defineBox(int id, int x, int y, int width, int height, int flags, int verb, Item *item_ptr);
 	HitArea *findEmptyHitArea();
 	void resetVerbs();
@@ -638,7 +638,7 @@
 
 	void resetNameWindow();
 	void printVerbOf(uint hitarea_id);
-	HitArea *findHitAreaByID(uint hitarea_id);
+	HitArea *findBox(uint hitarea_id);
 
 	void showActionString(const byte *string);
 	void windowPutChar(WindowBlock *window, byte c, byte b = 0);
@@ -726,8 +726,8 @@
 	void vc12_delay();
 	void vc13_addToSpriteX();
 	void vc14_addToSpriteY();
-	void vc15_wakeup_id();
-	void vc16_sleep_on_id();
+	void vc15_sync();
+	void vc16_waitSync();
 	void vc17_setPathfinderItem();
 	void vc18_jump();
 	void vc19_chain_to_script();
@@ -762,11 +762,11 @@
 	void vc48_setPathFinder();
 	void vc49_setBit();
 	void vc50_clearBit();
-	void vc51_clear_hitarea_bit_0x40();
+	void vc51_enableBox();
 	void vc52_playSound();
-	void vc53_no_op();
+	void vc53_panSFX();
 	void vc54_no_op();
-	void vc55_offset_hit_area();
+	void vc55_moveBox();
 	void vc56_delay();
 	void vc57_no_op();
 	void vc58();

Modified: scummvm/trunk/engines/simon/verb.cpp
===================================================================
--- scummvm/trunk/engines/simon/verb.cpp	2006-04-14 09:45:29 UTC (rev 21879)
+++ scummvm/trunk/engines/simon/verb.cpp	2006-04-14 09:57:43 UTC (rev 21880)
@@ -216,7 +216,7 @@
 	resetNameWindow();
 	_lastVerbOn = last;
 
-	if (last != NULL && (ha = findHitAreaByID(200)) && (ha->flags & kBFBoxDead) && !(last->flags & kBFBoxDead))
+	if (last != NULL && (ha = findBox(200)) && (ha->flags & kBFBoxDead) && !(last->flags & kBFBoxDead))
 		printVerbOf(last->id);
 }
 
@@ -318,7 +318,7 @@
 	_lastVerbOn = NULL;
 }
 
-HitArea *SimonEngine::findHitAreaByID(uint hitarea_id) {
+HitArea *SimonEngine::findBox(uint hitarea_id) {
 	HitArea *ha = _hitAreas;
 	uint count = ARRAYSIZE(_hitAreas);
 
@@ -340,14 +340,14 @@
 	return NULL;
 }
 
-void SimonEngine::clear_hitarea_bit_0x40(uint hitarea) {
-	HitArea *ha = findHitAreaByID(hitarea);
+void SimonEngine::enableBox(uint hitarea) {
+	HitArea *ha = findBox(hitarea);
 	if (ha != NULL)
 		ha->flags &= ~kBFBoxDead;
 }
 
-void SimonEngine::set_hitarea_bit_0x40(uint hitarea) {
-	HitArea *ha = findHitAreaByID(hitarea);
+void SimonEngine::disableBox(uint hitarea) {
+	HitArea *ha = findBox(hitarea);
 	if (ha != NULL) {
 		ha->flags |= kBFBoxDead;
 		ha->flags &= ~kBFBoxSelected;
@@ -357,7 +357,7 @@
 }
 
 void SimonEngine::moveBox(uint hitarea, int x, int y) {
-	HitArea *ha = findHitAreaByID(hitarea);
+	HitArea *ha = findBox(hitarea);
 	if (ha != NULL) {
 		if (getGameType() == GType_FF) {
 			ha->x += x;
@@ -369,8 +369,8 @@
 	}
 }
 
-void SimonEngine::delete_hitarea(uint hitarea) {
-	HitArea *ha = findHitAreaByID(hitarea);
+void SimonEngine::undefineBox(uint hitarea) {
+	HitArea *ha = findBox(hitarea);
 	if (ha != NULL) {
 		ha->flags = 0;
 		if (ha == _lastNameOn)
@@ -380,7 +380,7 @@
 }
 
 bool SimonEngine::is_hitarea_0x40_clear(uint hitarea) {
-	HitArea *ha = findHitAreaByID(hitarea);
+	HitArea *ha = findBox(hitarea);
 	if (ha == NULL)
 		return false;
 	return (ha->flags & kBFBoxDead) == 0;
@@ -388,7 +388,7 @@
 
 void SimonEngine::defineBox(int id, int x, int y, int width, int height, int flags, int verb, Item *item_ptr) {
 	HitArea *ha;
-	delete_hitarea(id);
+	undefineBox(id);
 
 	ha = findEmptyHitArea();
 	ha->x = x;
@@ -447,7 +447,7 @@
 
 		_defaultVerb = id;
 
-		ha = findHitAreaByID(id);
+		ha = findBox(id);
 		if (ha == NULL)
 			return;
 
@@ -526,7 +526,7 @@
 }
 
 void SimonEngine::leaveHitAreaById(uint hitarea_id) {
-	HitArea *ha = findHitAreaByID(hitarea_id);
+	HitArea *ha = findBox(hitarea_id);
 	if (ha)
 		hitarea_leave(ha);
 }
@@ -548,12 +548,12 @@
 		j = k * 6;
 		if (is_hitarea_0x40_clear(j + 201)) {
 			loadSprite(4, 9, k + 31, 0, 0, 0);
-			delete_hitarea(j + 201);
-			delete_hitarea(j + 202);
-			delete_hitarea(j + 203);
-			delete_hitarea(j + 204);
-			delete_hitarea(j + 205);
-			delete_hitarea(j + 206);
+			undefineBox(j + 201);
+			undefineBox(j + 202);
+			undefineBox(j + 203);
+			undefineBox(j + 204);
+			undefineBox(j + 205);
+			undefineBox(j + 206);
 		}
 		_variableArray[31] -= 52;
 		_iOverflow = 1;
@@ -575,12 +575,12 @@
 		j = k * 6;
 		if (is_hitarea_0x40_clear(j + 201)) {
 			loadSprite(4, 9, k + 28, 0, 0, 0);
-			delete_hitarea(j + 201);
-			delete_hitarea(j + 202);
-			delete_hitarea(j + 203);
-			delete_hitarea(j + 204);
-			delete_hitarea(j + 205);
-			delete_hitarea(j + 206);
+			undefineBox(j + 201);
+			undefineBox(j + 202);
+			undefineBox(j + 203);
+			undefineBox(j + 204);
+			undefineBox(j + 205);
+			undefineBox(j + 206);
 		}
 	}
 }
@@ -711,7 +711,7 @@
 			_lastNameOn = ha;
 			return;
 		}
-		if (findHitAreaByID(50))
+		if (findBox(50))
 			return;
 
 		if (getBitFlag(99))

Modified: scummvm/trunk/engines/simon/vga.cpp
===================================================================
--- scummvm/trunk/engines/simon/vga.cpp	2006-04-14 09:45:29 UTC (rev 21879)
+++ scummvm/trunk/engines/simon/vga.cpp	2006-04-14 09:57:43 UTC (rev 21880)
@@ -48,8 +48,8 @@
 		&SimonEngine::vc12_delay,
 		&SimonEngine::vc13_addToSpriteX,
 		&SimonEngine::vc14_addToSpriteY,
-		&SimonEngine::vc15_wakeup_id,
-		&SimonEngine::vc16_sleep_on_id,
+		&SimonEngine::vc15_sync,
+		&SimonEngine::vc16_waitSync,
 		&SimonEngine::vc17_setPathfinderItem,
 		&SimonEngine::vc18_jump,
 		&SimonEngine::vc19_chain_to_script,
@@ -84,11 +84,11 @@
 		&SimonEngine::vc48_setPathFinder,
 		&SimonEngine::vc49_setBit,
 		&SimonEngine::vc50_clearBit,
-		&SimonEngine::vc51_clear_hitarea_bit_0x40,
+		&SimonEngine::vc51_enableBox,
 		&SimonEngine::vc52_playSound,
-		&SimonEngine::vc53_no_op,
+		&SimonEngine::vc53_panSFX,
 		&SimonEngine::vc54_no_op,
-		&SimonEngine::vc55_offset_hit_area,
+		&SimonEngine::vc55_moveBox,
 		&SimonEngine::vc56_delay,
 		&SimonEngine::vc57_no_op,
 		&SimonEngine::vc58,
@@ -436,7 +436,7 @@
 		vcSkipNextInstruction();
 }
 
-byte *vc10_depack_column(VC10_state * vs) {
+byte *vc10_depackColumn(VC10_state * vs) {
 	int8 a = vs->depack_cont;
 	const byte *src = vs->depack_src;
 	byte *dst = vs->depack_dest;
@@ -480,7 +480,7 @@
 
 void vc10_skip_cols(VC10_state *vs) {
 	while (vs->x_skip) {
-		vc10_depack_column(vs);
+		vc10_depackColumn(vs);
 		vs->x_skip--;
 	}
 }
@@ -855,7 +855,7 @@
 			dst_org = state->surf_addr;
 			w = 0;
 			do {
-				src = vc10_depack_column(state);
+				src = vc10_depackColumn(state);
 				dst = dst_org;
 
 				h = 0;
@@ -891,7 +891,7 @@
 			do {
 				byte color;
 
-				src = vc10_depack_column(state);
+				src = vc10_depackColumn(state);
 				dst = dst_org;
 
 				h = 0;
@@ -940,7 +940,7 @@
 				do {
 					byte color;
 
-					src = vc10_depack_column(state);
+					src = vc10_depackColumn(state);
 					dst = dst_org;
 
 					h = 0;
@@ -959,7 +959,7 @@
 				do {
 					byte color;
 
-					src = vc10_depack_column(state);
+					src = vc10_depackColumn(state);
 					dst = dst_org;
 
 					h = 0;
@@ -1036,7 +1036,7 @@
 
 		w = 0;
 		do {
-			mask = vc10_depack_column(state);	/* esi */
+			mask = vc10_depackColumn(state);	/* esi */
 			src = state->surf2_addr + w * 2;	/* ebx */
 			dst = state->surf_addr + w * 2;		/* edi */
 
@@ -1202,7 +1202,7 @@
 				dst_org = state->surf_addr;
 				w = 0;
 				do {
-					src = vc10_depack_column(state);
+					src = vc10_depackColumn(state);
 					dst = dst_org;
 
 					h = 0;
@@ -1223,7 +1223,7 @@
 				do {
 					byte color;
 
-					src = vc10_depack_column(state);
+					src = vc10_depackColumn(state);
 					dst = dst_org;
 
 					h = 0;
@@ -1442,7 +1442,7 @@
 	_vgaSpriteChanged++;
 }
 
-void SimonEngine::vc15_wakeup_id() {
+void SimonEngine::vc15_sync() {
 	VgaSleepStruct *vfs = _vgaSleepStructs, *vfs_tmp;
 	uint16 id = vcReadNextWord();
 	while (vfs->ident != 0) {
@@ -1463,7 +1463,7 @@
 		_vgaWaitFor = 0;
 }
 
-void SimonEngine::vc16_sleep_on_id() {
+void SimonEngine::vc16_waitSync() {
 	VgaSleepStruct *vfs = _vgaSleepStructs;
 	while (vfs->ident)
 		vfs++;
@@ -1792,8 +1792,6 @@
 	int16 value = vcReadVar(var) - vcReadNextWord();
 
 	if ((getGameType() == GType_SIMON2) && var == 15 && !getBitFlag(80)) {
-		int16 tmp;
-
 		if (_scrollCount != 0) {
 			if (_scrollCount < 0)
 				goto no_scroll;
@@ -1941,8 +1939,8 @@
 	setBitFlag(vcReadNextWord(), false);
 }
 
-void SimonEngine::vc51_clear_hitarea_bit_0x40() {
-	clear_hitarea_bit_0x40(vcReadNextWord());
+void SimonEngine::vc51_enableBox() {
+	enableBox(vcReadNextWord());
 }
 
 void SimonEngine::vc52_playSound() {
@@ -1971,12 +1969,12 @@
 	}
 }
 
-void SimonEngine::vc53_no_op() {
+void SimonEngine::vc53_panSFX() {
 	// Start sound effect, panning it with the animation
 	int snd = vcReadNextWord();
 	int xoffs = vcReadNextWord();
 	int vol = vcReadNextWord();
-	debug(0, "STUB: vc53_no_op: snd %d xoffs %d vol %d", snd, xoffs, vol);
+	debug(0, "STUB: vc53_panSFX: snd %d xoffs %d vol %d", snd, xoffs, vol);
 }
 
 void SimonEngine::vc54_no_op() {
@@ -1984,7 +1982,7 @@
 	_vcPtr += 6;
 }
 
-void SimonEngine::vc55_offset_hit_area() {
+void SimonEngine::vc55_moveBox() {
 	HitArea *ha = _hitAreas;
 	uint count = ARRAYSIZE(_hitAreas);
 	uint16 id = vcReadNextWord();

Modified: scummvm/trunk/engines/simon/vga.h
===================================================================
--- scummvm/trunk/engines/simon/vga.h	2006-04-14 09:45:29 UTC (rev 21879)
+++ scummvm/trunk/engines/simon/vga.h	2006-04-14 09:57:43 UTC (rev 21880)
@@ -135,7 +135,7 @@
 	byte depack_dest[480];
 };
 
-byte *vc10_depack_column(VC10_state *vs);
+byte *vc10_depackColumn(VC10_state *vs);
 
 } // End of namespace Simon
 


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