[Scummvm-cvs-logs] SF.net SVN: scummvm: [26497] scummvm/trunk/engines/agos

kirben at users.sourceforge.net kirben at users.sourceforge.net
Sun Apr 15 16:12:09 CEST 2007


Revision: 26497
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26497&view=rev
Author:   kirben
Date:     2007-04-15 07:12:08 -0700 (Sun, 15 Apr 2007)

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

Modified Paths:
--------------
    scummvm/trunk/engines/agos/agos.h
    scummvm/trunk/engines/agos/charset.cpp
    scummvm/trunk/engines/agos/cursor.cpp
    scummvm/trunk/engines/agos/oracle.cpp
    scummvm/trunk/engines/agos/string.cpp
    scummvm/trunk/engines/agos/verb.cpp

Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h	2007-04-15 13:44:49 UTC (rev 26496)
+++ scummvm/trunk/engines/agos/agos.h	2007-04-15 14:12:08 UTC (rev 26497)
@@ -637,7 +637,7 @@
 
 	virtual void resetVerbs();
 	virtual void setVerb(HitArea * ha);
-	void hitarea_leave(HitArea * ha, bool state = false);
+	virtual void hitarea_leave(HitArea * ha, bool state = false);
 	void leaveHitAreaById(uint hitarea_id);
 
 	void sendSync(uint a);
@@ -695,21 +695,7 @@
 	void clearMenuStrip();
 	void doMenuStrip(uint menuNum);
 
-	void checkLinkBox();
- 	void hyperLinkOn(uint16 x);
- 	void hyperLinkOff();
-	void linksUp();
-	void linksDown();
-	void oracleTextUp();
-	void oracleTextDown();
-	void listSaveGames(int n);
-	void saveUserGame(int slot);
-	void windowBackSpace(WindowBlock *window);
-
 	void oracleLogo();
-	void scrollOracle();
-	void scrollOracleUp();
-	void scrollOracleDown();
 	void swapCharacterLogo();
 
 	void mouseOff();
@@ -740,8 +726,6 @@
 	void endCutscene();
 	void runSubroutine101();
 
-	void checkUp(WindowBlock *window);
-	void checkDown(WindowBlock *window);
 	virtual void inventoryUp(WindowBlock *window);
 	virtual void inventoryDown(WindowBlock *window);
 
@@ -761,14 +745,11 @@
 	void displayName(HitArea * ha);
 	void resetNameWindow();
 	void displayBoxStars();
-	void invertBox_FF(HitArea *ha, bool state);
 	void invertBox(HitArea * ha, byte a, byte b, byte c, byte d);
 
 	void handleMouseMoved();
 	void initMouse();
-	void loadMouseImage();
 	virtual void drawMousePointer();
-	void drawMousePart(int image, byte x, byte y);
 
 	void addArrows(WindowBlock *window);
 	void removeArrows(WindowBlock *window, uint num);
@@ -818,12 +799,6 @@
 	void renderStringAmiga(uint vga_sprite_id, uint color, uint width, uint height, const char *txt);
 	void renderString(uint vga_sprite_id, uint color, uint width, uint height, const char *txt);
 
-	void boxTextMessage(const char *x);
-	void boxTextMsg(const char *x);
-	void printBox();
-	uint16 getBoxSize();
-	uint16 checkFit(char *Ptr, int width, int lines);
-
 	void writeChar(WindowBlock *window, int x, int y, int offs, int val);
 
 	byte *allocBlock(uint32 size);
@@ -1160,7 +1135,7 @@
 	void fillBackGroundFromBack(uint lines);
 	void fillBackFromFront(uint x, uint y, uint w, uint h);
 
-	void print_char_helper_1(const byte *src, uint len);
+	virtual void print_char_helper_1(const byte *src, uint len);
 	void clsCheck(WindowBlock *window);
 
 	void quickLoadOrSave();
@@ -1180,7 +1155,7 @@
 	void openTextWindow();
 	void tidyIconArray(uint i);
 
-	void windowNewLine(WindowBlock *window);
+	virtual void windowNewLine(WindowBlock *window);
 	void windowDrawChar(WindowBlock *window, uint x, uint y, byte chr);
 
 	void loadMusic(uint music);
@@ -1362,6 +1337,12 @@
 
 	virtual void executeOpcode(int opcode);
 
+	void boxTextMessage(const char *x);
+	void boxTextMsg(const char *x);
+	void printBox();
+	uint16 getBoxSize();
+	uint16 checkFit(char *Ptr, int width, int lines);
+
 	void oww_moveDirn();
 	void oww_goto();
 	void oww_addTextBox();
@@ -1470,8 +1451,6 @@
 
 	virtual void executeOpcode(int opcode);
 
-	virtual void drawMousePointer();
-
 	void off_chance();
 	void off_jumpOut();
 	void off_addTextBox();
@@ -1515,15 +1494,42 @@
 
 	const OpcodeEntryFeeble *_opcodesFeeble;
 
+	void drawMousePart(int image, byte x, byte y);
+	virtual void drawMousePointer();
+
 	virtual void resetVerbs();
 	virtual void setVerb(HitArea * ha);
+	virtual void hitarea_leave(HitArea * ha, bool state = false);
+	void invertBox(HitArea *ha, bool state);
 
+	virtual void windowNewLine(WindowBlock *window);
+
+	virtual void clearName();
+
+	virtual void drawIconArray(uint i, Item *item_ptr, int line, int classMask);
+
+	virtual void print_char_helper_1(const byte *src, uint len);
+
+	void checkLinkBox();
+ 	void hyperLinkOn(uint16 x);
+ 	void hyperLinkOff();
+	void linksUp();
+	void linksDown();
+
+	void checkUp(WindowBlock *window);
+	void checkDown(WindowBlock *window);
 	virtual void inventoryUp(WindowBlock *window);
 	virtual void inventoryDown(WindowBlock *window);
 
-	virtual void clearName();
+	void oracleTextUp();
+	void oracleTextDown();
+	void scrollOracle();
+	void scrollOracleUp();
+	void scrollOracleDown();
 
-	virtual void drawIconArray(uint i, Item *item_ptr, int line, int classMask);
+	void listSaveGames(int n);
+	void saveUserGame(int slot);
+	void windowBackSpace(WindowBlock *window);
 };
 
 class AGOSEngine_PuzzlePack : public AGOSEngine_Feeble {
@@ -1561,6 +1567,8 @@
 	const OpcodeEntryPuzzlePack *_opcodesPuzzlePack;
 
 	virtual void resetVerbs();
+
+	void loadMouseImage();
 };
 
 } // End of namespace AGOS

Modified: scummvm/trunk/engines/agos/charset.cpp
===================================================================
--- scummvm/trunk/engines/agos/charset.cpp	2007-04-15 13:44:49 UTC (rev 26496)
+++ scummvm/trunk/engines/agos/charset.cpp	2007-04-15 14:12:08 UTC (rev 26497)
@@ -28,47 +28,52 @@
 
 namespace AGOS {
 
-void AGOSEngine::print_char_helper_1(const byte *src, uint len) {
-	uint idx;
-
+void AGOSEngine_Feeble::print_char_helper_1(const byte *src, uint len) {
 	if (_textWindow == NULL)
 		return;
 
 	while (len-- != 0) {
-		if (getGameType() == GType_FF || getGameType() == GType_PP) {
-			if (getBitFlag(93)) {
+		if (getBitFlag(93)) {
+			if (_curWindow == 3) {
+				if ((_newLines >= _textWindow->scrollY) && (_newLines < (_textWindow->scrollY + 3)))
+					windowPutChar(*src);
+				if (*src == '\n')		// Do two top lines of text only
+					_newLines++;
+				src++;
+			}
+		} else {
+			if (getBitFlag(94)) {
 				if (_curWindow == 3) {
-					if ((_newLines >= _textWindow->scrollY) && (_newLines < (_textWindow->scrollY + 3)))
+					if (_newLines == (_textWindow->scrollY + 7))
 						windowPutChar(*src);
-					if (*src == '\n')		// Do two top lines of text only
+					if (*src == '\n')	// Do two top lines of text only
 						_newLines++;
 					src++;
 				}
 			} else {
-				if (getBitFlag(94)) {
-					if (_curWindow == 3) {
-						if (_newLines == (_textWindow->scrollY + 7))
-							windowPutChar(*src);
-						if (*src == '\n')	// Do two top lines of text only
-							_newLines++;
-						src++;
-					}
-				} else {
-					if (getBitFlag(92))
-						delay(50);
-					windowPutChar(*src++);
-				}
+				if (getBitFlag(92))
+					delay(50);
+				windowPutChar(*src++);
 			}
-		} else {
-			if (*src != 12 && _textWindow->iconPtr != NULL &&
-					_fcsData1[idx = getWindowNum(_textWindow)] != 2) {
-	
-				_fcsData1[idx] = 2;
-				_fcsData2[idx] = 1;
-			}
+		}
+	}
+}
 
-			windowPutChar(*src++);
+void AGOSEngine::print_char_helper_1(const byte *src, uint len) {
+	uint idx;
+
+	if (_textWindow == NULL)
+		return;
+
+	while (len-- != 0) {
+		if (*src != 12 && _textWindow->iconPtr != NULL &&
+				_fcsData1[idx = getWindowNum(_textWindow)] != 2) {
+
+			_fcsData1[idx] = 2;
+			_fcsData2[idx] = 1;
 		}
+
+		windowPutChar(*src++);
 	}
 }
 
@@ -666,35 +671,30 @@
 	}
 }
 
-void AGOSEngine::windowNewLine(WindowBlock *window) {
-	if (getGameType() == GType_FF) {
-		if (_noOracleScroll == 0) {
-			if (window->height < window->textRow + 30) {
-				if (!getBitFlag(94)) {
-					_noOracleScroll = 1;
-					if (getBitFlag(92)) {
-						_noOracleScroll = 0;
-						checkLinkBox();
-						scrollOracle();
-						linksUp();
-						window->scrollY++;
-						_oracleMaxScrollY++;
-					} else {
-						_oracleMaxScrollY++;
-						checkLinkBox();
-					}
+void AGOSEngine_Feeble::windowNewLine(WindowBlock *window) {
+	if (_noOracleScroll == 0) {
+		if (window->height < window->textRow + 30) {
+			if (!getBitFlag(94)) {
+				_noOracleScroll = 1;
+				if (getBitFlag(92)) {
+					_noOracleScroll = 0;
+					checkLinkBox();
+					scrollOracle();
+					linksUp();
+					window->scrollY++;
+					_oracleMaxScrollY++;
+				} else {
+					_oracleMaxScrollY++;
+					checkLinkBox();
 				}
-			} else {
-				window->textRow += 15;
-				checkLinkBox();
 			}
 		} else {
-			_oracleMaxScrollY++;
+			window->textRow += 15;
 			checkLinkBox();
 		}
 	} else {
-		if (window->textRow != window->height)
-			window->textRow++;
+		_oracleMaxScrollY++;
+		checkLinkBox();
 	}
 
 	window->textColumn = 0;
@@ -702,6 +702,15 @@
 	window->textLength = 0;
 }
 
+void AGOSEngine::windowNewLine(WindowBlock *window) {
+	if (window->textRow != window->height)
+		window->textRow++;
+
+	window->textColumn = 0;
+	window->textColumnOffset = 0;
+	window->textLength = 0;
+}
+
 #ifdef PALMOS_68K
 static const byte *czech_windowFont;
 static const byte *russian_windowFont;

Modified: scummvm/trunk/engines/agos/cursor.cpp
===================================================================
--- scummvm/trunk/engines/agos/cursor.cpp	2007-04-15 13:44:49 UTC (rev 26496)
+++ scummvm/trunk/engines/agos/cursor.cpp	2007-04-15 14:12:08 UTC (rev 26497)
@@ -494,7 +494,7 @@
 	}
 }
 
-void AGOSEngine::loadMouseImage() {
+void AGOSEngine_PuzzlePack::loadMouseImage() {
 	loadZone(_variableArray[500]);
 	VgaPointersEntry *vpe = &_vgaBufferPointers[_variableArray[500]];
 
@@ -502,43 +502,29 @@
 	memcpy(_mouseData, src, _maxCursorWidth * _maxCursorHeight);
 }
 
-void AGOSEngine::drawMousePointer() {
-	if (getGameType() == GType_PP && getGameId() != GID_DIMP) {
-		CursorMan.replaceCursor(_mouseData, _maxCursorWidth, _maxCursorHeight, 37, 48, 0);
-	} else if (getGameType() == GType_SIMON2) {
-		CursorMan.replaceCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7);
-	} else if (getGameType() == GType_SIMON1) {
-		CursorMan.replaceCursor(_mouseData, 16, 16, 0, 0, 0xFF);
-	} else {
-		const uint16 *src;
-		int i, j;
+void AGOSEngine_Feeble::drawMousePart(int image, byte x, byte y) {
+	VgaPointersEntry *vpe = &_vgaBufferPointers[7];
+	byte *src;
+	int width, height;
 
-		const uint8 color = (getGameType() == GType_ELVIRA1) ? 15: 65;
-		memset(_mouseData, 0xFF, _maxCursorWidth * _maxCursorHeight);
+	byte *dst = _mouseData + y * _maxCursorWidth + x;
 
-		uint cursor = _mouseCursor;
-		if (getGameType() == GType_ELVIRA1 && cursor == 2)
-			cursor = 3;
+	src = vpe->vgaFile2 + image * 8;
+	width = READ_LE_UINT16(src + 6);
+	height = READ_LE_UINT16(src + 4);
 
-		if (_dragFlag != 0)
-			cursor = 2;
+	src = vpe->vgaFile2 + READ_LE_UINT32(src);
 
-		src = _common_cursors[cursor];
+	assert(width + x <= _maxCursorWidth);
+	assert(height + y <= _maxCursorWidth);
 
-		for (i = 0; i < 16; i++) {
-			for (j = 0; j < 16; j++) {
-				if (src[0] & (1 << (15 - (j % 16)))) {
-					if (src[1] & (1 << (15 - (j % 16)))) {
-						_mouseData[16 * i + j] = color;
-					} else {
-						_mouseData[16 * i + j] = 0;
-					}
-				}
-			}
-			src += 2;
+	for (int h = 0; h < height; h++) {
+		for (int w = 0; w < width; w++) {
+			if (src[w] != 0)
+				dst[w] = src[w];
 		}
-
-		CursorMan.replaceCursor(_mouseData, 16, 16, 0, 0, 0xFF);
+		src += width;
+		dst += _maxCursorWidth;
 	}
 }
 
@@ -599,29 +585,43 @@
 	}
 }
 
-void AGOSEngine::drawMousePart(int image, byte x, byte y) {
-	VgaPointersEntry *vpe = &_vgaBufferPointers[7];
-	byte *src;
-	int width, height;
+void AGOSEngine::drawMousePointer() {
+	if (getGameType() == GType_PP && getGameId() != GID_DIMP) {
+		CursorMan.replaceCursor(_mouseData, _maxCursorWidth, _maxCursorHeight, 37, 48, 0);
+	} else if (getGameType() == GType_SIMON2) {
+		CursorMan.replaceCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7);
+	} else if (getGameType() == GType_SIMON1) {
+		CursorMan.replaceCursor(_mouseData, 16, 16, 0, 0, 0xFF);
+	} else {
+		const uint16 *src;
+		int i, j;
 
-	byte *dst = _mouseData + y * _maxCursorWidth + x;
+		const uint8 color = (getGameType() == GType_ELVIRA1) ? 15: 65;
+		memset(_mouseData, 0xFF, _maxCursorWidth * _maxCursorHeight);
 
-	src = vpe->vgaFile2 + image * 8;
-	width = READ_LE_UINT16(src + 6);
-	height = READ_LE_UINT16(src + 4);
+		uint cursor = _mouseCursor;
+		if (getGameType() == GType_ELVIRA1 && cursor == 2)
+			cursor = 3;
 
-	src = vpe->vgaFile2 + READ_LE_UINT32(src);
+		if (_dragFlag != 0)
+			cursor = 2;
 
-	assert(width + x <= _maxCursorWidth);
-	assert(height + y <= _maxCursorWidth);
+		src = _common_cursors[cursor];
 
-	for (int h = 0; h < height; h++) {
-		for (int w = 0; w < width; w++) {
-			if (src[w] != 0)
-				dst[w] = src[w];
+		for (i = 0; i < 16; i++) {
+			for (j = 0; j < 16; j++) {
+				if (src[0] & (1 << (15 - (j % 16)))) {
+					if (src[1] & (1 << (15 - (j % 16)))) {
+						_mouseData[16 * i + j] = color;
+					} else {
+						_mouseData[16 * i + j] = 0;
+					}
+				}
+			}
+			src += 2;
 		}
-		src += width;
-		dst += _maxCursorWidth;
+
+		CursorMan.replaceCursor(_mouseData, 16, 16, 0, 0, 0xFF);
 	}
 }
 

Modified: scummvm/trunk/engines/agos/oracle.cpp
===================================================================
--- scummvm/trunk/engines/agos/oracle.cpp	2007-04-15 13:44:49 UTC (rev 26496)
+++ scummvm/trunk/engines/agos/oracle.cpp	2007-04-15 14:12:08 UTC (rev 26497)
@@ -31,7 +31,7 @@
 
 namespace AGOS {
 
-void AGOSEngine::checkLinkBox() {	// Check for boxes spilling over to next row of text
+void AGOSEngine_Feeble::checkLinkBox() {	// Check for boxes spilling over to next row of text
 	if (_hyperLink != 0) {
 		_variableArray[52] = _textWindow->x + _textWindow->textColumn - _variableArray[50];
 		if (_variableArray[52] != 0) {
@@ -43,7 +43,7 @@
 	}
 }
 
-void AGOSEngine::hyperLinkOn(uint16 x) {
+void AGOSEngine_Feeble::hyperLinkOn(uint16 x) {
 	if (!getBitFlag(51))
 		return;
 
@@ -53,7 +53,7 @@
 }
 
 
-void AGOSEngine::hyperLinkOff() {
+void AGOSEngine_Feeble::hyperLinkOff() {
 	if (!getBitFlag(51))
 		return;
 
@@ -63,28 +63,117 @@
 	_hyperLink = 0;
 }
 
-void AGOSEngine::linksUp() {	// Scroll Oracle Links
+void AGOSEngine_Feeble::linksUp() {	// Scroll Oracle Links
 	uint16 j;
 	for (j = 700; j < _variableArray[53]; j++) {
 		moveBox(j, 0, -15);
 	}
 }
 
-void AGOSEngine::linksDown() {
+void AGOSEngine_Feeble::linksDown() {
 	uint16 i;
 	for (i = 700; i < _variableArray[53]; i++) {
 		moveBox(i,0, 15);
 	}
 }
 
-void AGOSEngine::scrollOracle() {
+void AGOSEngine_Feeble::checkUp(WindowBlock *window) {
+	uint16 j, k;
+
+	if (((_variableArray[31] - _variableArray[30]) == 40) && (_variableArray[31] > 52)) {
+		k = (((_variableArray[31] / 52) - 2) % 3);
+		j = k * 6;
+		if (!isBoxDead(j + 201)) {
+			uint index = getWindowNum(window);
+			drawIconArray(index, window->iconPtr->itemRef, 0, window->iconPtr->classMask);
+			animate(4, 9, k + 34, 0, 0, 0);	
+		}
+	}
+	if ((_variableArray[31] - _variableArray[30]) == 76) {
+		k = ((_variableArray[31] / 52) % 3);
+		j = k * 6;
+		if (isBoxDead(j + 201)) {
+			animate(4, 9, k + 31, 0, 0, 0);
+			undefineBox(j + 201);
+			undefineBox(j + 202);
+			undefineBox(j + 203);
+			undefineBox(j + 204);
+			undefineBox(j + 205);
+			undefineBox(j + 206);
+		}
+		_variableArray[31] -= 52;
+		_iOverflow = 1;
+	}
+}
+
+void AGOSEngine_Feeble::inventoryUp(WindowBlock *window) {
+	_marks = 0;
+	checkUp(window);
+	animate(4, 9, 21, 0 ,0, 0);	
+	while (1) {
+		if (_currentBox->id != 0x7FFB || !getBitFlag(89))
+			break;
+		checkUp(window);
+		delay(1);
+	}
+	waitForMark(2);
+	checkUp(window);
+	sendSync(922);
+	waitForMark(1);
+	checkUp(window);
+}
+
+
+void AGOSEngine_Feeble::checkDown(WindowBlock *window) {
+	uint16 j, k;
+
+	if (((_variableArray[31] - _variableArray[30]) == 24) && (_iOverflow == 1)) {
+		uint index = getWindowNum(window);
+		drawIconArray(index, window->iconPtr->itemRef, 0, window->iconPtr->classMask);
+		k = ((_variableArray[31] / 52) % 3);
+		animate(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 (isBoxDead(j + 201)) {
+			animate(4, 9, k + 28, 0, 0, 0);
+			undefineBox(j + 201);
+			undefineBox(j + 202);
+			undefineBox(j + 203);
+			undefineBox(j + 204);
+			undefineBox(j + 205);
+			undefineBox(j + 206);
+		}
+	}
+}
+
+void AGOSEngine_Feeble::inventoryDown(WindowBlock *window) {
+	_marks = 0;
+	checkDown(window);
+	animate(4, 9, 23, 0, 0, 0);	
+	while (1) {
+		if (_currentBox->id != 0x7FFC || !getBitFlag(89))
+		break;
+		checkDown(window);
+		delay(1);
+	}
+	waitForMark(2);
+	checkDown(window);
+	sendSync(924);
+	waitForMark(1);
+	checkDown(window);
+}
+
+void AGOSEngine_Feeble::scrollOracle() {
 	int i;
 
 	for (i = 0; i < 5; i++)
 		scrollOracleUp();
 }
 
-void AGOSEngine::oracleTextUp() {
+void AGOSEngine_Feeble::oracleTextUp() {
 	Subroutine *sub;
 	int i = 0;
 	changeWindow(3);
@@ -118,7 +207,7 @@
 	}
 }
 
-void AGOSEngine::oracleTextDown() {
+void AGOSEngine_Feeble::oracleTextDown() {
 	Subroutine *sub;
 	int i = 0;
 	changeWindow(3);
@@ -152,7 +241,7 @@
 	}
 }
 
-void AGOSEngine::scrollOracleUp() {
+void AGOSEngine_Feeble::scrollOracleUp() {
 	byte *src, *dst;
 	uint16 w, h;
 
@@ -181,7 +270,7 @@
 	}
 }
 
-void AGOSEngine::scrollOracleDown() {
+void AGOSEngine_Feeble::scrollOracleDown() {
 	byte *src, *dst;
 	uint16 w, h;
 
@@ -277,7 +366,7 @@
 	}
 }
 
-void AGOSEngine::listSaveGames(int n) {
+void AGOSEngine_Feeble::listSaveGames(int n) {
 	char b[108];
 	Common::InSaveFile *in;
 	uint16 j, k, z, maxFiles;
@@ -344,7 +433,7 @@
 	}
 }
 
-void AGOSEngine::saveUserGame(int slot) {
+void AGOSEngine_Feeble::saveUserGame(int slot) {
 	WindowBlock *window;
 	Common::InSaveFile *in;
 	char name[108];
@@ -407,7 +496,7 @@
 	}
 }
 
-void AGOSEngine::windowBackSpace(WindowBlock *window) {
+void AGOSEngine_Feeble::windowBackSpace(WindowBlock *window) {
 	byte *dst;
 	uint x, y, h, w;
 

Modified: scummvm/trunk/engines/agos/string.cpp
===================================================================
--- scummvm/trunk/engines/agos/string.cpp	2007-04-15 13:44:49 UTC (rev 26496)
+++ scummvm/trunk/engines/agos/string.cpp	2007-04-15 14:12:08 UTC (rev 26497)
@@ -490,7 +490,7 @@
 }
 
 // String code for boxes in Waxworks
-uint16 AGOSEngine::getBoxSize() {
+uint16 AGOSEngine_Waxworks::getBoxSize() {
 	int x;
 	switch (_boxLineCount) {
 	case 1: x = _lineCounts[0];
@@ -634,7 +634,7 @@
 }
 
 
-uint16 AGOSEngine::checkFit(char *Ptr, int width, int lines) {
+uint16 AGOSEngine_Waxworks::checkFit(char *Ptr, int width, int lines) {
 	int countw = 0;
 	int countl = 0;
 	char *x = NULL;
@@ -659,7 +659,7 @@
 	return 1;
 }
 
-void AGOSEngine::boxTextMessage(const char *x) {
+void AGOSEngine_Waxworks::boxTextMessage(const char *x) {
 	char *BoxBufferPtr = _boxBuffer;
 	sprintf(BoxBufferPtr, "%s\n", x);
 	_lineCounts[_boxLineCount] += strlen(x);
@@ -669,7 +669,7 @@
 	_boxCR = 1;
 }
 
-void AGOSEngine::boxTextMsg(const char *x) {
+void AGOSEngine_Waxworks::boxTextMsg(const char *x) {
 	char *BoxBufferPtr = _boxBuffer;
 	sprintf(BoxBufferPtr, "%s", x);
 	_lineCounts[_boxLineCount] += strlen(x);
@@ -677,7 +677,7 @@
 	_boxCR = 0;
 }
 
-void AGOSEngine::printBox() {
+void AGOSEngine_Waxworks::printBox() {
 	char *BoxBufferPtr = 0;
 	uint16 BoxSize;
 	_linePtrs[0] = _boxBuffer;

Modified: scummvm/trunk/engines/agos/verb.cpp
===================================================================
--- scummvm/trunk/engines/agos/verb.cpp	2007-04-15 13:44:49 UTC (rev 26496)
+++ scummvm/trunk/engines/agos/verb.cpp	2007-04-15 14:12:08 UTC (rev 26497)
@@ -591,10 +591,12 @@
 	_currentVerbBox = ha;
 }
 
+void AGOSEngine_Feeble::hitarea_leave(HitArea *ha, bool state) {
+	invertBox(ha, state);
+}
+
 void AGOSEngine::hitarea_leave(HitArea *ha, bool state) {
-	if (getGameType() == GType_FF) {
-		invertBox_FF(ha, state);
-	} else if (getGameType() == GType_SIMON2) {
+	if (getGameType() == GType_SIMON2) {
 		invertBox(ha, 231, 229, 230, 1);
 	} else {
 		invertBox(ha, 223, 213, 218, 5);
@@ -607,77 +609,6 @@
 		hitarea_leave(ha);
 }
 
-void AGOSEngine::checkUp(WindowBlock *window) {
-	uint16 j, k;
-
-	if (((_variableArray[31] - _variableArray[30]) == 40) && (_variableArray[31] > 52)) {
-		k = (((_variableArray[31] / 52) - 2) % 3);
-		j = k * 6;
-		if (!isBoxDead(j + 201)) {
-			uint index = getWindowNum(window);
-			drawIconArray(index, window->iconPtr->itemRef, 0, window->iconPtr->classMask);
-			animate(4, 9, k + 34, 0, 0, 0);	
-		}
-	}
-	if ((_variableArray[31] - _variableArray[30]) == 76) {
-		k = ((_variableArray[31] / 52) % 3);
-		j = k * 6;
-		if (isBoxDead(j + 201)) {
-			animate(4, 9, k + 31, 0, 0, 0);
-			undefineBox(j + 201);
-			undefineBox(j + 202);
-			undefineBox(j + 203);
-			undefineBox(j + 204);
-			undefineBox(j + 205);
-			undefineBox(j + 206);
-		}
-		_variableArray[31] -= 52;
-		_iOverflow = 1;
-	}
-}
-
-void AGOSEngine::checkDown(WindowBlock *window) {
-	uint16 j, k;
-
-	if (((_variableArray[31] - _variableArray[30]) == 24) && (_iOverflow == 1)) {
-		uint index = getWindowNum(window);
-		drawIconArray(index, window->iconPtr->itemRef, 0, window->iconPtr->classMask);
-		k = ((_variableArray[31] / 52) % 3);
-		animate(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 (isBoxDead(j + 201)) {
-			animate(4, 9, k + 28, 0, 0, 0);
-			undefineBox(j + 201);
-			undefineBox(j + 202);
-			undefineBox(j + 203);
-			undefineBox(j + 204);
-			undefineBox(j + 205);
-			undefineBox(j + 206);
-		}
-	}
-}
-
-void AGOSEngine_Feeble::inventoryUp(WindowBlock *window) {
-	_marks = 0;
-	checkUp(window);
-	animate(4, 9, 21, 0 ,0, 0);	
-	while (1) {
-		if (_currentBox->id != 0x7FFB || !getBitFlag(89))
-			break;
-		checkUp(window);
-		delay(1);
-	}
-	waitForMark(2);
-	checkUp(window);
-	sendSync(922);
-	waitForMark(1);
-	checkUp(window);
-}
-
 void AGOSEngine::inventoryUp(WindowBlock *window) {
 	if (window->iconPtr->line == 0)
 		return;
@@ -688,23 +619,6 @@
 	mouseOn();
 }
 
-void AGOSEngine_Feeble::inventoryDown(WindowBlock *window) {
-	_marks = 0;
-	checkDown(window);
-	animate(4, 9, 23, 0, 0, 0);	
-	while (1) {
-		if (_currentBox->id != 0x7FFC || !getBitFlag(89))
-		break;
-		checkDown(window);
-		delay(1);
-	}
-	waitForMark(2);
-	checkDown(window);
-	sendSync(924);
-	waitForMark(1);
-	checkDown(window);
-}
-
 void AGOSEngine::inventoryDown(WindowBlock *window) {
 	mouseOff();
 	uint index = getWindowNum(window);
@@ -870,7 +784,7 @@
 		_lastNameOn = ha;
 }
 
-void AGOSEngine::invertBox_FF(HitArea *ha, bool state) {
+void AGOSEngine_Feeble::invertBox(HitArea *ha, bool state) {
 	if (getBitFlag(205) || getBitFlag(206)) {
 		if (state != 0) {
 			_mouseAnimMax = _oldMouseAnimMax;


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