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

kirben at users.sourceforge.net kirben at users.sourceforge.net
Wed Mar 15 23:09:01 CET 2006


Revision: 21327
Author:   kirben
Date:     2006-03-15 23:08:05 -0800 (Wed, 15 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21327&view=rev

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

Modified Paths:
--------------
    scummvm/trunk/engines/simon/charset.cpp
    scummvm/trunk/engines/simon/icons.cpp
    scummvm/trunk/engines/simon/items.cpp
    scummvm/trunk/engines/simon/saveload.cpp
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/simon/simon.h
    scummvm/trunk/engines/simon/verb.cpp
Modified: scummvm/trunk/engines/simon/charset.cpp
===================================================================
--- scummvm/trunk/engines/simon/charset.cpp	2006-03-16 05:41:39 UTC (rev 21326)
+++ scummvm/trunk/engines/simon/charset.cpp	2006-03-16 07:08:05 UTC (rev 21327)
@@ -299,7 +299,7 @@
 	byte width = 6;
 
 	if (c == 0xC) {
-		video_fill_or_copy_from_3_to_2(fcs);
+		clearWindow(fcs);
 	} else if (c == 0xD || c == 0xA) {
 		video_putchar_newline(fcs);
 	} else if ((c == 1 && _language != Common::HB_ISR) || (c == 8)) {

Modified: scummvm/trunk/engines/simon/icons.cpp
===================================================================
--- scummvm/trunk/engines/simon/icons.cpp	2006-03-16 05:41:39 UTC (rev 21326)
+++ scummvm/trunk/engines/simon/icons.cpp	2006-03-16 07:08:05 UTC (rev 21327)
@@ -208,8 +208,8 @@
 		ha->height = 24;
 		ha->flags = 0xB0;
 		ha->id = 0x7FFD;
-		ha->layer = 100;
-		ha->unk3 = 0xD0;
+		ha->priority = 100;
+		ha->verb = 0xD0;
 	} else {
 		ha->x = x + 110;
 		ha->y = fcs->y + y;
@@ -218,8 +218,8 @@
 		ha->height = 20;
 		ha->flags = 0xB0;
 		ha->id = 0x7FFD;
-		ha->layer = 100;
-		ha->unk3 = 0xD0;
+		ha->priority = 100;
+		ha->verb = 0xD0;
 	}
 
 	return ha - _hitAreas;

Modified: scummvm/trunk/engines/simon/items.cpp
===================================================================
--- scummvm/trunk/engines/simon/items.cpp	2006-03-16 05:41:39 UTC (rev 21326)
+++ scummvm/trunk/engines/simon/items.cpp	2006-03-16 07:08:05 UTC (rev 21327)
@@ -590,7 +590,7 @@
 				uint flags = 0;
 				uint id = getVarOrWord();
 				uint params = id / 1000;
-				uint x, y, w, h, unk3;
+				uint x, y, w, h, verb;
 				Item *item;
 
 				id = id % 1000;
@@ -611,12 +611,12 @@
 				w = getVarOrWord();
 				h = getVarOrWord();
 				item = getNextItemPtrStrange();
-				unk3 = getVarOrWord();
+				verb = getVarOrWord();
 				if (x >= 1000) {
-					unk3 += 0x4000;
+					verb += 0x4000;
 					x -= 1000;
 				}
-				addNewHitArea(id, x, y, w, h, flags, unk3, item);
+				addNewHitArea(id, x, y, w, h, flags, verb, item);
 			}
 			break;
 
@@ -639,7 +639,7 @@
 				uint hitarea_id = getVarOrWord();
 				uint x = getVarOrWord();
 				uint y = getVarOrWord();
-				set_hitarea_x_y(hitarea_id, x, y);
+				moveBox(hitarea_id, x, y);
 			}
 			break;
 
@@ -930,7 +930,7 @@
 			break;
 
 		case 160:{
-				o_unk_160(getVarOrByte());
+				o_setTextColor(getVarOrByte());
 			}
 			break;
 
@@ -1649,8 +1649,11 @@
 		_sound->playEffects(sound_id);
 }
 
-void SimonEngine::o_unk_160(uint a) {
-	fcs_setTextColor(_windowArray[_curWindow], a);
+void SimonEngine::o_setTextColor(uint color) {
+	FillOrCopyStruct *fcs;
+
+	fcs = _windowArray[_curWindow];
+	fcs->text_color = color;
 }
 
 void SimonEngine::o_unk_103() {

Modified: scummvm/trunk/engines/simon/saveload.cpp
===================================================================
--- scummvm/trunk/engines/simon/saveload.cpp	2006-03-16 05:41:39 UTC (rev 21326)
+++ scummvm/trunk/engines/simon/saveload.cpp	2006-03-16 07:08:05 UTC (rev 21327)
@@ -340,7 +340,7 @@
 	_base_time = time(NULL) - save_time + _base_time;
 	_copyPartialMode = 0;
 
-	dx_copy_rgn_from_3_to_2(94, 208, 46, 80);
+	restoreBlock(94, 208, 46, 80);
 
 	i = _timer4;
 	do {
@@ -383,7 +383,7 @@
 	ha->height = 8;
 	ha->flags = 0x20;
 	ha->id = 0x7FFF;
-	ha->layer = 0x3EF;
+	ha->priority = 0x3EF;
 
 loop:;
 	_lastHitArea = _lastHitArea3 = 0;

Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-03-16 05:41:39 UTC (rev 21326)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-03-16 07:08:05 UTC (rev 21327)
@@ -251,7 +251,7 @@
 	_mouseCursor = 0;
 	_vgaVar9 = 0;
 	_scriptUnk1 = 0;
-	_vgaVar6 = 0;
+	_restoreWindow6 = 0;
 	_scrollX = 0;
 	_scrollY = 0;
 	_scrollXMax = 0;
@@ -1824,9 +1824,9 @@
 		ha->height = 17;
 		ha->flags = 0x24;
 		ha->id = 0x7FFB;
-		ha->layer = 100;
+		ha->priority = 100;
 		ha->fcs = fcs;
-		ha->unk3 = 1;
+		ha->verb = 1;
 	} else {
 		ha->x = 81;
 		ha->y = 158;
@@ -1834,9 +1834,9 @@
 		ha->height = 26;
 		ha->flags = 36;
 		ha->id = 0x7FFB;
-		ha->layer = 100;
+		ha->priority = 100;
 		ha->fcs = fcs;
-		ha->unk3 = 1;
+		ha->verb = 1;
 	}
 
 	ha = findEmptyHitArea();
@@ -1849,9 +1849,9 @@
 		ha->height = 17;
 		ha->flags = 0x24;
 		ha->id = 0x7FFC;
-		ha->layer = 100;
+		ha->priority = 100;
 		ha->fcs = fcs;
-		ha->unk3 = 1;
+		ha->verb = 1;
 
 		// Simon1 specific
 		o_kill_sprite_simon1(128);
@@ -1863,9 +1863,9 @@
 		ha->height = 26;
 		ha->flags = 36;
 		ha->id = 0x7FFC;
-		ha->layer = 100;
+		ha->priority = 100;
 		ha->fcs = fcs;
-		ha->unk3 = 1;
+		ha->verb = 1;
 	}
 }
 
@@ -2021,7 +2021,7 @@
 		} else if (ha->id == 0x7FFC) {
 			handle_downarrow_hitarea(ha->fcs);
 		} else if (ha->id >= 101 && ha->id < 113) {
-			_verbHitArea = ha->unk3;
+			_verbHitArea = ha->verb;
 			handle_verb_hitarea(ha);
 			_hitAreaUnk4 = 0;
 		} else {
@@ -2038,12 +2038,12 @@
 					break;
 			} else {
 				// else 1
-				if (ha->unk3 == 0) {
+				if (ha->verb == 0) {
 					if (ha->item_ptr)
 						goto if_1;
 				} else {
-					_verbHitArea = ha->unk3 & 0xBFFF;
-					if (ha->unk3 & 0x4000) {
+					_verbHitArea = ha->verb & 0xBFFF;
+					if (ha->verb & 0x4000) {
 						_hitAreaSubjectItem = ha->item_ptr;
 						break;
 					}
@@ -2390,7 +2390,7 @@
 			_unkPalFlag = true;
 		} else {
 			_dxUse3Or4ForLock = true;
-			_vgaVar6 = true;
+			_restoreWindow6 = true;
 		}
 	}
 
@@ -2857,10 +2857,6 @@
 	}
 }
 
-void SimonEngine::fcs_setTextColor(FillOrCopyStruct *fcs, uint value) {
-	fcs->text_color = value;
-}
-
 void SimonEngine::o_vga_reset() {
 	_lockWord |= 0x8000;
 	vc27_resetSprite();
@@ -3063,11 +3059,11 @@
 }
 
 // ok
-void SimonEngine::video_fill_or_copy_from_3_to_2(FillOrCopyStruct *fcs) {
+void SimonEngine::clearWindow(FillOrCopyStruct *fcs) {
 	if (fcs->flags & 0x10)
-		copy_img_from_3_to_2(fcs);
+		restoreWindow(fcs);
 	else
-		video_erase(fcs);
+		colorWindow(fcs);
 
 	fcs->textColumn = 0;
 	fcs->textRow = 0;
@@ -3076,24 +3072,24 @@
 }
 
 // ok
-void SimonEngine::copy_img_from_3_to_2(FillOrCopyStruct *fcs) {
+void SimonEngine::restoreWindow(FillOrCopyStruct *fcs) {
 	_lockWord |= 0x8000;
 
 	if (getGameType() == GType_SIMON1) {
-		dx_copy_rgn_from_3_to_2(fcs->y + fcs->height * 8 + ((fcs == _windowArray[2]) ? 1 : 0), (fcs->x + fcs->width) * 8, fcs->y, fcs->x * 8);
+		restoreBlock(fcs->y + fcs->height * 8 + ((fcs == _windowArray[2]) ? 1 : 0), (fcs->x + fcs->width) * 8, fcs->y, fcs->x * 8);
 	} else {
-		if (_vgaVar6 && _windowArray[2] == fcs) {
+		if (_restoreWindow6 && _windowArray[2] == fcs) {
 			fcs = _windowArray[6];
-			_vgaVar6 = 0;
+			_restoreWindow6 = 0;
 		}
 
-		dx_copy_rgn_from_3_to_2(fcs->y + fcs->height * 8, (fcs->x + fcs->width) * 8, fcs->y, fcs->x * 8);
+		restoreBlock(fcs->y + fcs->height * 8, (fcs->x + fcs->width) * 8, fcs->y, fcs->x * 8);
 	}
 
 	_lockWord &= ~0x8000;
 }
 
-void SimonEngine::video_erase(FillOrCopyStruct *fcs) {
+void SimonEngine::colorWindow(FillOrCopyStruct *fcs) {
 	byte *dst;
 	uint h;
 
@@ -3289,7 +3285,7 @@
 
 void SimonEngine::video_copy_if_flag_0x8_c(FillOrCopyStruct *fcs) {
 	if (fcs->flags & 8)
-		copy_img_from_3_to_2(fcs);
+		restoreWindow(fcs);
 	fcs->mode = 0;
 }
 
@@ -3777,7 +3773,7 @@
 	startUp_helper_2();
 }
 
-void SimonEngine::dx_copy_rgn_from_3_to_2(uint b, uint r, uint y, uint x) {
+void SimonEngine::restoreBlock(uint b, uint r, uint y, uint x) {
 	byte *dst, *src;
 	uint i;
 

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-03-16 05:41:39 UTC (rev 21326)
+++ scummvm/trunk/engines/simon/simon.h	2006-03-16 07:08:05 UTC (rev 21327)
@@ -68,8 +68,8 @@
 	uint16 id;
 	FillOrCopyStruct *fcs;
 	Item *item_ptr;
-	uint16 unk3;
-	uint16 layer;
+	uint16 verb;
+	uint16 priority;
 	HitArea() { memset(this, 0, sizeof(*this)); }
 };
 
@@ -253,7 +253,7 @@
 	byte _mouseCursor;
 	bool _vgaVar9;
 	int16 _scriptUnk1;
-	bool _vgaVar6;
+	bool _restoreWindow6;
 	int _scrollX, _scrollXMax, _scrollHeight;
 	int _scrollY, _scrollYMax, _scrollWidth;
 	int _scrollCount, _scrollFlag;
@@ -540,7 +540,7 @@
 	void closeWindow(uint a);
 	void clear_hitarea_bit_0x40(uint hitarea);
 	void set_hitarea_bit_0x40(uint hitarea);
-	void set_hitarea_x_y(uint hitarea, int x, int y);
+	void moveBox(uint hitarea, int x, int y);
 	bool is_hitarea_0x40_clear(uint hitarea);
 	void delete_hitarea(uint hitarea);
 	void addNewHitArea(int id, int x, int y, int width, int height, int flags, int unk3, Item *item_ptr);
@@ -562,7 +562,7 @@
 	void killAllTimers();
 
 	uint getOffsetOfChild2Param(Child2 *child, uint prop);
-	void o_unk_160(uint a);
+	void o_setTextColor(uint color);
 	void o_playSFX(uint a);
 	void o_lockZone();
 	void o_unlockZone();
@@ -617,7 +617,7 @@
 
 	void showActionString(uint x, const byte *string);
 	void video_putchar(FillOrCopyStruct *fcs, byte c, byte b = 0);
-	void video_fill_or_copy_from_3_to_2(FillOrCopyStruct *fcs);
+	void clearWindow(FillOrCopyStruct *fcs);
 	void video_toggle_colors(HitArea * ha, byte a, byte b, byte c, byte d);
 
 	void read_vga_from_datfile_1(uint vga_id);
@@ -801,18 +801,16 @@
 
 	bool isSpriteLoaded(uint16 id, uint16 fileId);
 
-	void fcs_setTextColor(FillOrCopyStruct *fcs, uint value);
-
 	void video_copy_if_flag_0x8_c(FillOrCopyStruct *fcs);
 	void delete_hitarea_by_index(uint index);
 
 	void removeArrows(FillOrCopyStruct *fcs, uint fcs_index);
 	void fcs_putchar(uint a);
 
-	void copy_img_from_3_to_2(FillOrCopyStruct *fcs);
-	void video_erase(FillOrCopyStruct *fcs);
+	void restoreWindow(FillOrCopyStruct *fcs);
+	void colorWindow(FillOrCopyStruct *fcs);
 
-	void dx_copy_rgn_from_3_to_2(uint b, uint r, uint y, uint x);
+	void restoreBlock(uint b, uint r, uint y, uint x);
 
 	byte *getBackBuf();
 	byte *getFrontBuf();

Modified: scummvm/trunk/engines/simon/verb.cpp
===================================================================
--- scummvm/trunk/engines/simon/verb.cpp	2006-03-16 05:41:39 UTC (rev 21326)
+++ scummvm/trunk/engines/simon/verb.cpp	2006-03-16 07:08:05 UTC (rev 21327)
@@ -301,7 +301,7 @@
 
 	fcs = _windowArray[1];
 	if (fcs != NULL && fcs->text_color != 0)
-		video_fill_or_copy_from_3_to_2(fcs);
+		clearWindow(fcs);
 
 	_lastHitArea2Ptr = NULL;
 	_hitAreaPtr7 = NULL;
@@ -345,7 +345,7 @@
 	}
 }
 
-void SimonEngine::set_hitarea_x_y(uint hitarea, int x, int y) {
+void SimonEngine::moveBox(uint hitarea, int x, int y) {
 	HitArea *ha = findHitAreaByID(hitarea);
 	if (ha != NULL) {
 		ha->x = x;
@@ -370,7 +370,7 @@
 	return (ha->flags & 0x40) == 0;
 }
 
-void SimonEngine::addNewHitArea(int id, int x, int y, int width, int height, int flags, int unk3, Item *item_ptr) {
+void SimonEngine::addNewHitArea(int id, int x, int y, int width, int height, int flags, int verb, Item *item_ptr) {
 	HitArea *ha;
 	delete_hitarea(id);
 
@@ -380,8 +380,8 @@
 	ha->width = width;
 	ha->height = height;
 	ha->flags = flags | 0x20;
-	ha->id = ha->layer = id;
-	ha->unk3 = unk3;
+	ha->id = ha->priority = id;
+	ha->verb = verb;
 	ha->item_ptr = item_ptr;
 
 	_needHitAreaRecalc++;
@@ -409,7 +409,7 @@
 		_hitAreaUnk4 = 999;
 		_hitAreaPtr5 = NULL;
 	} else {
-		_verbHitArea = ha->unk3;
+		_verbHitArea = ha->verb;
 		handle_verb_hitarea(ha);
 	}
 }
@@ -483,7 +483,7 @@
 	HitArea *best_ha;
 	HitArea *ha = _hitAreas;
 	uint count = ARRAYSIZE(_hitAreas);
-	uint16 layer = 0;
+	uint16 priority = 0;
 	uint16 x_ = x;
 	const uint16 y_ = y;
 
@@ -499,8 +499,8 @@
 		if (ha->flags & 0x20) {
 			if (!(ha->flags & 0x40)) {
 				if (x_ >= ha->x && y_ >= ha->y &&
-						x_ - ha->x < ha->width && y_ - ha->y < ha->height && layer <= ha->layer) {
-					layer = ha->layer;
+						x_ - ha->x < ha->width && y_ - ha->y < ha->height && priority <= ha->priority) {
+					priority = ha->priority;
 					best_ha = ha;
 				} else {
 					if (ha->flags & 2) {


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