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

kirben at users.sourceforge.net kirben at users.sourceforge.net
Thu Mar 16 02:32:01 CET 2006


Revision: 21328
Author:   kirben
Date:     2006-03-16 02:30:59 -0800 (Thu, 16 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21328&view=rev

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

Modified Paths:
--------------
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/simon/simon.h
    scummvm/trunk/engines/simon/verb.cpp
    scummvm/trunk/engines/simon/vga.cpp
Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-03-16 07:08:05 UTC (rev 21327)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-03-16 10:30:59 UTC (rev 21328)
@@ -282,11 +282,11 @@
 	_lastHitArea3 = 0;
 	_leftButtonDown = 0;
 	_hitAreaSubjectItem = 0;
-	_hitAreaPtr5 = 0;
+	_currentVerbBox = 0;
 	_hitAreaPtr7 = 0;
 	_needHitAreaRecalc = 0;
 	_verbHitArea = 0;
-	_hitAreaUnk4 = 0;
+	_defaultVerb = 0;
 	_mouseHideCount = 0;
 
 	_windowNum = 0;
@@ -1522,10 +1522,10 @@
 
 	if (getGameType() == GType_SIMON2) {
 		_mouseCursor = 0;
-		if (_hitAreaUnk4 != 999) {
+		if (_defaultVerb != 999) {
 			_mouseCursor = 9;
 			_needHitAreaRecalc++;
-			_hitAreaUnk4 = 0;
+			_defaultVerb = 0;
 		}
 	}
 
@@ -1635,12 +1635,12 @@
 	if (_mouseY >= _screenHeight - 1)
 		_mouseY = _screenHeight - 1;
 
-	if (_hitAreaUnk4) {
+	if (_defaultVerb) {
 		uint id = 101;
 		if (_mouseY >= 136)
 			id = 102;
-		if (_hitAreaUnk4 != id)
-			hitarea_proc_1();
+		if (_defaultVerb != id)
+			resetVerbs();
 	}
 
 	if (getGameType() == GType_FF) {
@@ -1994,7 +1994,7 @@
 	_hitAreaSubjectItem = NULL;
 	_hitAreaObjectItem = NULL;
 
-	hitarea_proc_1();
+	resetVerbs();
 
 startOver:
 	for (;;) {
@@ -2022,8 +2022,8 @@
 			handle_downarrow_hitarea(ha->fcs);
 		} else if (ha->id >= 101 && ha->id < 113) {
 			_verbHitArea = ha->verb;
-			handle_verb_hitarea(ha);
-			_hitAreaUnk4 = 0;
+			setVerb(ha);
+			_defaultVerb = 0;
 		} else {
 			if ((_verbHitArea != 0 || _hitAreaSubjectItem != ha->item_ptr && ha->flags & 0x80) &&
 					ha->item_ptr) {

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-03-16 07:08:05 UTC (rev 21327)
+++ scummvm/trunk/engines/simon/simon.h	2006-03-16 10:30:59 UTC (rev 21328)
@@ -278,10 +278,10 @@
 	HitArea *_lastHitArea3;
 	byte _leftButtonDown;
 	Item *_hitAreaSubjectItem;
-	HitArea *_hitAreaPtr5, *_hitAreaPtr7;
+	HitArea *_currentVerbBox, *_hitAreaPtr7;
 	uint _needHitAreaRecalc;
 	uint _verbHitArea;
-	uint16 _hitAreaUnk4;
+	uint16 _defaultVerb;
 	uint _mouseHideCount;
 
 	uint16 _windowNum;
@@ -545,8 +545,8 @@
 	void delete_hitarea(uint hitarea);
 	void addNewHitArea(int id, int x, int y, int width, int height, int flags, int unk3, Item *item_ptr);
 	HitArea *findEmptyHitArea();
-	void hitarea_proc_1();
-	void handle_verb_hitarea(HitArea * ha);
+	void resetVerbs();
+	void setVerb(HitArea * ha);
 	void hitarea_leave(HitArea * ha);
 	void leaveHitAreaById(uint hitarea_id);
 

Modified: scummvm/trunk/engines/simon/verb.cpp
===================================================================
--- scummvm/trunk/engines/simon/verb.cpp	2006-03-16 07:08:05 UTC (rev 21327)
+++ scummvm/trunk/engines/simon/verb.cpp	2006-03-16 10:30:59 UTC (rev 21328)
@@ -200,7 +200,7 @@
 		}
 	}
 
-	last = _hitAreaPtr5;
+	last = _currentVerbBox;
 
 	if (last == _hitAreaPtr7)
 		return;
@@ -341,7 +341,7 @@
 		ha->flags |= 0x40;
 		ha->flags &= ~2;
 		if (hitarea == 102)
-			hitarea_proc_1();
+			resetVerbs();
 	}
 }
 
@@ -387,7 +387,7 @@
 	_needHitAreaRecalc++;
 }
 
-void SimonEngine::hitarea_proc_1() {
+void SimonEngine::resetVerbs() {
 	uint id;
 	HitArea *ha;
 
@@ -399,28 +399,28 @@
 		id = (_mouseY >= 136) ? 102 : 101;
 	}
 
-	_hitAreaUnk4 = id;
+	_defaultVerb = id;
 
 	ha = findHitAreaByID(id);
 	if (ha == NULL)
 		return;
 
 	if (ha->flags & 0x40) {
-		_hitAreaUnk4 = 999;
-		_hitAreaPtr5 = NULL;
+		_defaultVerb = 999;
+		_currentVerbBox = NULL;
 	} else {
 		_verbHitArea = ha->verb;
-		handle_verb_hitarea(ha);
+		setVerb(ha);
 	}
 }
 
-void SimonEngine::handle_verb_hitarea(HitArea *ha) {
-	HitArea *tmp = _hitAreaPtr5;
+void SimonEngine::setVerb(HitArea *ha) {
+	HitArea *tmp = _currentVerbBox;
 
 	if (ha == tmp)
 		return;
 
-	if (!(getGameType() == GType_SIMON2)) {
+	if (getGameType() == GType_SIMON1) {
 		if (tmp != NULL) {
 			tmp->flags |= 8;
 			video_toggle_colors(tmp, 0xd5, 0xd0, 0xd5, 0xA);
@@ -439,7 +439,7 @@
 		_mouseCursor = ha->id - 101;
 		_needHitAreaRecalc++;
 	}
-	_hitAreaPtr5 = ha;
+	_currentVerbBox = ha;
 }
 
 void SimonEngine::hitarea_leave(HitArea *ha) {

Modified: scummvm/trunk/engines/simon/vga.cpp
===================================================================
--- scummvm/trunk/engines/simon/vga.cpp	2006-03-16 07:08:05 UTC (rev 21327)
+++ scummvm/trunk/engines/simon/vga.cpp	2006-03-16 10:30:59 UTC (rev 21328)
@@ -862,17 +862,13 @@
 			dst_org = state->surf_addr;
 			w = 0;
 			do {
-				byte color;
-
 				src = vc10_depack_column(state);
 				dst = dst_org;
 
 				h = 0;
 				do {
-					color = *src;
-					*dst = color;
+					*dst = *src++;
 					dst += _screenWidth;
-					src++;
 				} while (++h != state->draw_height);
 				dst_org++;
 			} while (++w != state->draw_width);
@@ -882,7 +878,7 @@
 				_scaleX = state->x;
 				_scaleY = state->y;
 				_scaleWidth = state->width;
-				_scaleHeight = state->width;
+				_scaleHeight = state->height;
 			} else {
 				scaleClip(state->height, state->width, state->y, state->x, _scrollY);
 			}


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