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

kirben at users.sourceforge.net kirben at users.sourceforge.net
Tue Apr 4 16:30:06 CEST 2006


Revision: 21613
Author:   kirben
Date:     2006-04-04 16:29:24 -0700 (Tue, 04 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21613&view=rev

Log Message:
-----------
Add inventory array differences in FF and minor cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/simon/charset.cpp
    scummvm/trunk/engines/simon/oracle.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-04-04 23:26:11 UTC (rev 21612)
+++ scummvm/trunk/engines/simon/charset.cpp	2006-04-04 23:29:24 UTC (rev 21613)
@@ -34,7 +34,7 @@
 
 	while (len-- != 0) {
 		if (getGameType() == GType_FF) {
-			if ((_bitArray[5] & (1 << 13)) != 0) {
+			if (getBitFlag(93)) {
 				if (_curWindow == 3) {
 					if ((_newLines >= _textWindow->scrollY) && (_newLines < (_textWindow->scrollY + 3)))
 						fcs_putchar(*src);
@@ -43,7 +43,7 @@
 					src++;
 				}
 			} else {
-				if ((_bitArray[5] & (1 << 14)) != 0) {
+				if (getBitFlag(94)) {
 					if (_curWindow == 3) {
 						if (_newLines == (_textWindow->scrollY + 7))
 							fcs_putchar(*src);
@@ -52,7 +52,7 @@
 						src++;
 					}
 				} else {
-					//if ((_bitArray[5] & (1 << 12)) != 0)
+					//if (getBitFlag(92))
 					//	while(!_nextCharacter);
 					fcs_putchar(*src++);
 					//_nextCharacter = false;
@@ -245,7 +245,7 @@
 	}
 }
 
-static const byte fontSize[208] = {
+static const byte feebleFontSize[208] = {
 	8, 2, 5, 7, 8, 8, 8, 2, 4, 4, 8, 8, 3, 8, 2, 9,
 	8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2, 3, 5, 8, 5, 8,
 	8, 8, 8, 8, 8, 8, 8, 8, 8, 4, 8, 8, 8, 8, 8, 8,
@@ -306,7 +306,7 @@
 				if (chr == 10)
 					_printCharCurPos = 0;
 				else if (chr != 0)
-					_printCharCurPos++;
+					_printCharCurPos += (getGameType() == GType_FF) ? feebleFontSize[chr - 32] : 1;
 			}
 		} else {
 			const byte newline_character = 10;
@@ -315,7 +315,7 @@
 			print_char_helper_1(_lettersToPrintBuf, _numLettersToPrint);
 			if (chr == ' ') {
 				print_char_helper_1(&chr, 1);
-				_printCharCurPos++;
+				_printCharCurPos += (getGameType() == GType_FF) ? feebleFontSize[chr - 32] : 1;
 			} else {
 				print_char_helper_1(&chr, 1);
 				_printCharCurPos = 0;
@@ -323,6 +323,8 @@
 		}
 		_numLettersToPrint = 0;
 	} else {
+		if (getGameType() == GType_FF)
+			_printCharCurPos += feebleFontSize[chr - 32];
 		_lettersToPrintBuf[_numLettersToPrint++] = chr;
 	}
 }
@@ -376,10 +378,10 @@
 				}
 			}
 		}
-	} else if (c >= 0x20) {
+	} else if (c >= 32) {
 		if (getGameType() == GType_FF) {
 			video_putchar_drawchar(fcs, fcs->textColumn + fcs->x, fcs->textRow + fcs->y, c);
-			fcs->textColumn += fontSize[c - 0x20];
+			fcs->textColumn += feebleFontSize[c - 32];
 			return;
 		}
 

Modified: scummvm/trunk/engines/simon/oracle.cpp
===================================================================
--- scummvm/trunk/engines/simon/oracle.cpp	2006-04-04 23:26:11 UTC (rev 21612)
+++ scummvm/trunk/engines/simon/oracle.cpp	2006-04-04 23:29:24 UTC (rev 21613)
@@ -167,26 +167,26 @@
 	j = maxFiles - n + 1;
 	k = maxFiles - j + 1;
 	z = maxFiles;
-	if ((_bitArray[5] & (1 << 15)) != 0) {
+	if (getBitFlag(95)) {
 		j++;
 		z++;
 	}
 
 	while(1) {
 		OK=1;
-		if ((_bitArray[5] & (3 << 13)) != 0) {
+		if (getBitFlag(93)) {
 			OK = 0;
 			if(j > z)
 				break;
 		}
 
-		if ((_bitArray[5] & (1 << 13)) != 0) {
+		if (getBitFlag(93)) {
 			if (((_newLines + 1) >= _textWindow->scrollY) && (
 						(_newLines + 1) < (_textWindow->scrollY + 3)))
 				OK = 1;
 		}
 
-		if ((_bitArray[5] & (1 << 14)) != 0) {
+		if (getBitFlag(94)) {
 			if ((_newLines + 1) == (_textWindow->scrollY + 7))
 				OK = 1;
 		}
@@ -281,7 +281,7 @@
 	x = _variableArray[91];
 	if (x > _variableArray[90])
 		x--;
-	if( x < _variableArray[90])
+	if (x < _variableArray[90])
 		x++;
 	_variableArray[91] = x;
 

Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-04-04 23:26:11 UTC (rev 21612)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-04-04 23:29:24 UTC (rev 21613)
@@ -283,6 +283,7 @@
 	_item1 = 0;
 
 	_currentBoxNumber = 0;
+	_iOverflow = 0;
 	_hitAreaObjectItem = 0;
 	_lastHitArea = 0;
 	_lastHitArea2Ptr = 0;

Modified: scummvm/trunk/engines/simon/simon.h
===================================================================
--- scummvm/trunk/engines/simon/simon.h	2006-04-04 23:26:11 UTC (rev 21612)
+++ scummvm/trunk/engines/simon/simon.h	2006-04-04 23:29:24 UTC (rev 21613)
@@ -291,6 +291,7 @@
 	uint16 _defaultVerb;
 	uint _mouseHideCount;
 	uint _currentBoxNumber;
+	uint _iOverflow;
 
 	uint16 _windowNum;
 
@@ -631,6 +632,8 @@
 	void defocusHitarea();
 	void endCutscene();
 	void runSubroutine101();
+	void checkUp(FillOrCopyStruct *fcs);
+	void checkDown(FillOrCopyStruct *fcs);
 	void inventoryUp(FillOrCopyStruct *fcs);
 	void inventoryDown(FillOrCopyStruct *fcs);
 	void hitareaChangedHelper();

Modified: scummvm/trunk/engines/simon/verb.cpp
===================================================================
--- scummvm/trunk/engines/simon/verb.cpp	2006-04-04 23:26:11 UTC (rev 21612)
+++ scummvm/trunk/engines/simon/verb.cpp	2006-04-04 23:29:24 UTC (rev 21613)
@@ -508,27 +508,107 @@
 		hitarea_leave(ha);
 }
 
-void SimonEngine::inventoryUp(FillOrCopyStruct *fcs) {
-	uint index;
+void SimonEngine::checkUp(FillOrCopyStruct *fcs) {
+	uint16 j, k;
 
-	index = get_fcs_ptr_3_index(fcs);
+	if (((_variableArray[31] - _variableArray[30]) == 40) && (_variableArray[31] > 52)) {
+		k = (((_variableArray[31] / 52) - 2) % 3);
+		j = k * 6;
+		if (!is_hitarea_0x40_clear(j + 201)) {
+			uint index = get_fcs_ptr_3_index(fcs);
+			drawIconArray(index, fcs->fcs_data->item_ptr, 0, fcs->fcs_data->unk2);
+			loadSprite(4, 9, k + 34, 0, 0, 0);	
+		}
+	}
+	if ((_variableArray[31] - _variableArray[30]) == 76) {
+		k = ((_variableArray[31] / 52) % 3);
+		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);
+		}
+		_variableArray[31] -= 52;
+		_iOverflow = 1;
+	}
+}
 
-	if (fcs->fcs_data->unk1 == 0)
-		return;
+void SimonEngine::checkDown(FillOrCopyStruct *fcs) {
+	uint16 j, k;
 
-	mouseOff();
-	drawIconArray(index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1 - 1, fcs->fcs_data->unk2);
-	mouseOn();
+	if (((_variableArray[31] - _variableArray[30]) == 24) && (_iOverflow == 1)) {
+		uint index = get_fcs_ptr_3_index(fcs);
+		drawIconArray(index, fcs->fcs_data->item_ptr, 0, fcs->fcs_data->unk2);
+		k = ((_variableArray[31] / 52) % 3);
+		loadSprite(4, 9, k + 25, 0, 0, 0);	
+		_variableArray[31] += 52;
+	}
+	if (((_variableArray[31] - _variableArray[30]) == 40) && (_variableArray[30] > 52)) {
+		k = (((_variableArray[31] / 52) + 1) % 3);
+		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);
+		}
+	}
 }
 
-void SimonEngine::inventoryDown(FillOrCopyStruct *fcs) {
-	uint index;
+void SimonEngine::inventoryUp(FillOrCopyStruct *fcs) {
+	if (getGameType() == GType_FF) {
+		_marks = 0;
+		checkUp(fcs);
+		loadSprite(4, 9 ,21 ,0 ,0, 0);	
+		while(1) {
+			if (_currentBoxNumber != 32763 || _leftButtonDown)
+				break;
+			checkUp(fcs);
+		}
+		o_waitForMark(2);
+		checkUp(fcs);
+		o_sync(922);
+		o_waitForMark(1);
+		checkUp(fcs);
+	} else {
+		if (fcs->fcs_data->unk1 == 0)
+			return;
 
-	index = get_fcs_ptr_3_index(fcs);
+		mouseOff();
+		uint index = get_fcs_ptr_3_index(fcs);
+		drawIconArray(index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1 - 1, fcs->fcs_data->unk2);
+		mouseOn();
+	}
+}
 
-	mouseOff();
-	drawIconArray(index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1 + 1, fcs->fcs_data->unk2);
-	mouseOn();
+void SimonEngine::inventoryDown(FillOrCopyStruct *fcs) {
+	if (getGameType() == GType_FF) {
+		_marks = 0;
+		checkDown(fcs);
+		loadSprite(4, 9, 23, 0, 0, 0);	
+		while(1) {
+			if (_currentBoxNumber != 32764 || _leftButtonDown)
+				break;
+			checkDown(fcs);
+		}
+		o_waitForMark(2);
+		checkDown(fcs);
+		o_sync(924);
+		o_waitForMark(1);
+		checkDown(fcs);
+	} else {
+		mouseOff();
+		uint index = get_fcs_ptr_3_index(fcs);
+		drawIconArray(index, fcs->fcs_data->item_ptr, fcs->fcs_data->unk1 + 1, fcs->fcs_data->unk2);
+		mouseOn();
+	}
 }
 
 void SimonEngine::setup_hitarea_from_pos(uint x, uint y, uint mode) {


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