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

kirben at users.sourceforge.net kirben at users.sourceforge.net
Fri Sep 29 05:25:16 CEST 2006


Revision: 23998
          http://svn.sourceforge.net/scummvm/?rev=23998&view=rev
Author:   kirben
Date:     2006-09-28 20:25:08 -0700 (Thu, 28 Sep 2006)

Log Message:
-----------
Add more changes for PP

Modified Paths:
--------------
    scummvm/trunk/engines/simon/charset.cpp
    scummvm/trunk/engines/simon/res.cpp
    scummvm/trunk/engines/simon/simon.cpp
    scummvm/trunk/engines/simon/verb.cpp
    scummvm/trunk/engines/simon/window.cpp

Modified: scummvm/trunk/engines/simon/charset.cpp
===================================================================
--- scummvm/trunk/engines/simon/charset.cpp	2006-09-29 02:18:48 UTC (rev 23997)
+++ scummvm/trunk/engines/simon/charset.cpp	2006-09-29 03:25:08 UTC (rev 23998)
@@ -35,7 +35,7 @@
 		return;
 
 	while (len-- != 0) {
-		if (getGameType() == GType_FF) {
+		if (getGameType() == GType_FF || getGameType() == GType_PP) {
 			if (getBitFlag(93)) {
 				if (_curWindow == 3) {
 					if ((_newLines >= _textWindow->scrollY) && (_newLines < (_textWindow->scrollY + 3)))
@@ -184,7 +184,7 @@
 void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint height, const char *txt) {
 	VgaPointersEntry *vpe = &_vgaBufferPointers[2];
 	byte *src, *dst, *p, *dst_org, chr;
-	const int textHeight = (getGameType() == GType_FF) ? 15: 10;
+	const int textHeight = (getGameType() == GType_FF || getGameType() == GType_PP) ? 15: 10;
 	uint count = 0;
 
 	if (vga_sprite_id >= 100) {
@@ -194,7 +194,7 @@
 
 	src = dst = vpe->vgaFile2;
 
-	if (getGameType() == GType_FF) {
+	if (getGameType() == GType_FF || getGameType() == GType_PP) {
 		if (vga_sprite_id == 1)
 			count = 45000;
 	} else {
@@ -205,7 +205,7 @@
 
 	p = dst + vga_sprite_id * 8;
 
-	if (getGameType() == GType_FF) {
+	if (getGameType() == GType_FF || getGameType() == GType_PP) {
 		WRITE_LE_UINT16(p + 4, height);
 		WRITE_LE_UINT16(p + 6, width);
 		// We need to adjust the offset to the next buffer to be right
@@ -243,7 +243,7 @@
 			byte *img_hdr, *img;
 			uint i, img_width, img_height;
 
-			if (getGameType() == GType_FF) {
+			if (getGameType() == GType_FF || getGameType() == GType_PP) {
 				img_hdr = src + 96 + chr * 8;
 				img_height = READ_LE_UINT16(img_hdr + 4);
 				img_width = READ_LE_UINT16(img_hdr + 6);
@@ -314,7 +314,7 @@
 		openTextWindow();
 		if (!_showMessageFlag) {
 			_windowArray[0] = _textWindow;
-			if (getGameType() == GType_FF)
+			if (getGameType() == GType_FF || getGameType() == GType_PP)
 				showmessage_helper_3(_textWindow->textColumn, _textWindow->width);
 			else
 				showmessage_helper_3(_textWindow->textLength, _textWindow->textMaxLength);
@@ -341,7 +341,7 @@
 		// _printCharMaxPos. In Simon, that is probably prevented by
 		// testing if _printCharCurPos == _printCharMaxPos below.
 
-		if (getGameType() == GType_FF) {
+		if (getGameType() == GType_FF || getGameType() == GType_PP) {
 			fit = _printCharMaxPos > _printCharCurPos + _printCharPixelCount;
 		} else {
 			fit = _printCharMaxPos - _printCharCurPos >= _printCharPixelCount;
@@ -359,7 +359,7 @@
 				if (chr == 10)
 					_printCharCurPos = 0;
 				else if (chr != 0)
-					_printCharCurPos += (getGameType() == GType_FF) ? feebleFontSize[chr - 32] : 1;
+					_printCharCurPos += (getGameType() == GType_FF || getGameType() == GType_PP) ? feebleFontSize[chr - 32] : 1;
 			}
 		} else {
 			const byte newline_character = 10;
@@ -368,7 +368,7 @@
 			print_char_helper_1(_lettersToPrintBuf, _numLettersToPrint);
 			if (chr == ' ') {
 				print_char_helper_1(&chr, 1);
-				_printCharCurPos += (getGameType() == GType_FF) ? feebleFontSize[chr - 32] : 1;
+				_printCharCurPos += (getGameType() == GType_FF || getGameType() == GType_PP) ? feebleFontSize[chr - 32] : 1;
 			} else {
 				print_char_helper_1(&chr, 1);
 				_printCharCurPos = 0;
@@ -378,7 +378,7 @@
 		_printCharPixelCount = 0;
 	} else {
 		_lettersToPrintBuf[_numLettersToPrint++] = chr;
-		_printCharPixelCount += (getGameType() == GType_FF) ? feebleFontSize[chr - 32] : 1;
+		_printCharPixelCount += (getGameType() == GType_FF || getGameType() == GType_PP) ? feebleFontSize[chr - 32] : 1;
 	}
 }
 
@@ -386,7 +386,7 @@
 	if (_textWindow)
 		return;
 
-	if (getGameType() == GType_FF)
+	if (getGameType() == GType_FF || getGameType() == GType_PP)
 		_textWindow = openWindow(64, 96, 384, 172, 1, 0, 15);
 	else
 		_textWindow = openWindow(8, 144, 24, 6, 1, 0, 15);
@@ -433,7 +433,7 @@
 			}
 		}
 	} else if (c >= 32) {
-		if (getGameType() == GType_FF) {
+		if (getGameType() == GType_FF || getGameType() == GType_PP) {
 			video_putchar_drawchar(window, window->textColumn + window->x, window->textRow + window->y, c);
 			window->textColumn += feebleFontSize[c - 32];
 			return;
@@ -1537,7 +1537,7 @@
 
 	dst = getFrontBuf() + y * _dxSurfacePitch + x + window->textColumnOffset;
 
-	if (getGameType() == GType_FF) {
+	if (getGameType() == GType_FF || getGameType() == GType_PP) {
 		h = 13;
 		w =  feebleFontSize[chr - 0x20];
 
@@ -1583,7 +1583,7 @@
 		i = 0;
 		do {
 			if (b < 0) {
-				if (getGameType() == GType_FF) {
+				if (getGameType() == GType_FF || getGameType() == GType_PP) {
 					if (dst[i] == 0)
 						dst[i] = color;
 				} else {

Modified: scummvm/trunk/engines/simon/res.cpp
===================================================================
--- scummvm/trunk/engines/simon/res.cpp	2006-09-29 02:18:48 UTC (rev 23997)
+++ scummvm/trunk/engines/simon/res.cpp	2006-09-29 03:25:08 UTC (rev 23998)
@@ -968,6 +968,9 @@
 }
 
 void SimonEngine::loadVoice(uint speechId) {
+	if (getGameType() == GType_PP && speechId == 99)
+		return;
+
 	if (getFeatures() & GF_ZLIBCOMP) {
 		char filename[15];
 

Modified: scummvm/trunk/engines/simon/simon.cpp
===================================================================
--- scummvm/trunk/engines/simon/simon.cpp	2006-09-29 02:18:48 UTC (rev 23997)
+++ scummvm/trunk/engines/simon/simon.cpp	2006-09-29 03:25:08 UTC (rev 23998)
@@ -784,8 +784,14 @@
 uint SimonEngine::getVarOrWord() {
 	uint a = READ_BE_UINT16(_codePtr);
 	_codePtr += 2;
-	if (a >= 30000 && a < 30512) {
-		return readVariable(a - 30000);
+	if (getGameType() == GType_PP) {
+		if (a >= 60000 && a < 62048) {
+			return readVariable(a - 60000);
+		}
+	} else {
+		if (a >= 30000 && a < 30512) {
+			return readVariable(a - 30000);
+		}
 	}
 	return a;
 }
@@ -873,7 +879,9 @@
 	if (variable >= _numVars)
 		error("readVariable: Variable %d out of range", variable);
 
-	if (getGameType() == GType_FF) {
+	if (getGameType() == GType_PP) {
+		return (uint16)_variableArray[variable];
+	} else if (getGameType() == GType_FF) {
 		if (getBitFlag(83))
 			return (uint16)_variableArray2[variable];
 		else

Modified: scummvm/trunk/engines/simon/verb.cpp
===================================================================
--- scummvm/trunk/engines/simon/verb.cpp	2006-09-29 02:18:48 UTC (rev 23997)
+++ scummvm/trunk/engines/simon/verb.cpp	2006-09-29 03:25:08 UTC (rev 23998)
@@ -180,7 +180,7 @@
 	HitArea *last;
 	HitArea *ha;
 
-	if (getGameType() == GType_FF) {
+	if (getGameType() == GType_FF || getGameType() == GType_PP) {
 		stopAnimateSimon2(2, 6);
 		_lastNameOn = NULL;
 		_animatePointer = 0;
@@ -344,7 +344,7 @@
 	if (sub)
 		startSubroutine(sub);
 
-	if (getGameType() == GType_SIMON2 || getGameType() == GType_FF)
+	if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP)
 		_runScriptReturn1 = false;
 
 	permitInput();
@@ -410,7 +410,7 @@
 void SimonEngine::moveBox(uint hitarea, int x, int y) {
 	HitArea *ha = findBox(hitarea);
 	if (ha != NULL) {
-		if (getGameType() == GType_FF) {
+		if (getGameType() == GType_FF || getGameType() == GType_PP) {
 			ha->x += x;
 			ha->y += y;
 		} else {
@@ -451,7 +451,8 @@
 	ha->verb = verb;
 	ha->item_ptr = item_ptr;
 
-	if (getGameType() == GType_FF && (ha->flags & kBFHyperBox)) {
+	if ((getGameType() == GType_FF || getGameType() == GType_PP) &&
+		(ha->flags & kBFHyperBox)) {
 		ha->data = _hyperLink;
 		ha->priority = 50;
 	}
@@ -460,8 +461,11 @@
 }
 
 void SimonEngine::resetVerbs() {
-	if (getGameType() == GType_FF) {
+	if (getGameType() == GType_PP) {
 		_verbHitArea = 300;
+		return;
+	} else if (getGameType() == GType_FF) {
+		_verbHitArea = 300;
 		int cursor = 0;
 		int animMax = 16;
 
@@ -513,7 +517,9 @@
 }
 
 void SimonEngine::setVerb(HitArea *ha) {
-	if (getGameType() == GType_FF) {
+	if (getGameType() == GType_PP) {
+		return;
+	} else if (getGameType() == GType_FF) {
 		int cursor = _mouseCursor;
 		if (_noRightClick)
 			return;
@@ -737,8 +743,13 @@
 
 	if (mode != 0 && mode != 3) {
 		_lastHitArea = best_ha;
-		_variableArray[1] = x;
-		_variableArray[2] = y;
+		if (getGameType() == GType_PP) {
+			_variableArray[400] = x;
+			_variableArray[401] = y;
+		} else {
+			_variableArray[1] = x;
+			_variableArray[2] = y;
+		}
 	}
 
 	if (best_ha->flags & kBFNoTouchName) {
@@ -759,7 +770,7 @@
 	bool result;
 	int x = 0, y = 0;
 
-	if (getGameType() == GType_FF) {
+	if (getGameType() == GType_PP) {
 		if (ha->flags & kBFHyperBox) {
 			_lastNameOn = ha;
 			return;
@@ -767,6 +778,20 @@
 		if (findBox(50))
 			return;
 
+		y = ha->y;
+		y -= 17;
+		if (y < 0)
+			y = 0;
+		y += 2;
+		x = ha->width / 2 + ha->x;
+	} else if (getGameType() == GType_FF) {
+		if (ha->flags & kBFHyperBox) {
+			_lastNameOn = ha;
+			return;
+		}
+		if (findBox(50))
+			return;
+
 		if (getBitFlag(99))
 			_animatePointer = ((ha->flags & kBFTextBox) == 0);
 		else

Modified: scummvm/trunk/engines/simon/window.cpp
===================================================================
--- scummvm/trunk/engines/simon/window.cpp	2006-09-29 02:18:48 UTC (rev 23997)
+++ scummvm/trunk/engines/simon/window.cpp	2006-09-29 03:25:08 UTC (rev 23998)
@@ -72,7 +72,7 @@
 	showmessage_print_char(0);
 	_textWindow = _windowArray[a];
 
-	if (getGameType() == GType_FF)
+	if (getGameType() == GType_FF || getGameType() == GType_PP)
 		showmessage_helper_3(_textWindow->textColumn, _textWindow->width);
 	else
 		showmessage_helper_3(_textWindow->textLength, _textWindow->textMaxLength);
@@ -109,7 +109,7 @@
 
 	_lockWord |= 0x8000;
 
-	if (getGameType() == GType_FF) {
+	if (getGameType() == GType_FF || getGameType() == GType_PP) {
 		dst = getFrontBuf() + _dxSurfacePitch * window->y + window->x;
 
 		for (h = 0; h < window->height; h++) {
@@ -142,7 +142,7 @@
 void SimonEngine::restoreWindow(WindowBlock *window) {
 	_lockWord |= 0x8000;
 
-	if (getGameType() == GType_FF) {
+	if (getGameType() == GType_FF || getGameType() == GType_PP) {
 		restoreBlock(window->y + window->height, window->x + window->width, window->y, window->x);
 	} else if (getGameType() == GType_SIMON2) {
 		if (_restoreWindow6 && _windowArray[2] == window) {


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