[Scummvm-cvs-logs] SF.net SVN: scummvm: [31882] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon May 5 20:50:43 CEST 2008


Revision: 31882
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31882&view=rev
Author:   lordhoto
Date:     2008-05-05 11:50:42 -0700 (Mon, 05 May 2008)

Log Message:
-----------
Implemented opcode 91: o3_daggerWarning.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra_mr.h
    scummvm/trunk/engines/kyra/kyra_v2.cpp
    scummvm/trunk/engines/kyra/screen_mr.cpp
    scummvm/trunk/engines/kyra/screen_mr.h
    scummvm/trunk/engines/kyra/script_mr.cpp

Modified: scummvm/trunk/engines/kyra/kyra_mr.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_mr.h	2008-05-05 17:56:39 UTC (rev 31881)
+++ scummvm/trunk/engines/kyra/kyra_mr.h	2008-05-05 18:50:42 UTC (rev 31882)
@@ -559,6 +559,7 @@
 	int o3_stopMusic(EMCState *script);
 	int o3_playSoundEffect(EMCState *script);
 	int o3_getScore(EMCState *script);
+	int o3_daggerWarning(EMCState *script);
 	int o3_blockOutRegion(EMCState *script);
 	int o3_showSceneStringsMessage(EMCState *script);
 	int o3_showGoodConscience(EMCState *script);

Modified: scummvm/trunk/engines/kyra/kyra_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-05-05 17:56:39 UTC (rev 31881)
+++ scummvm/trunk/engines/kyra/kyra_v2.cpp	2008-05-05 18:50:42 UTC (rev 31882)
@@ -124,7 +124,6 @@
 			Common::Point pos = getMousePos();
 			_mouseX = pos.x;
 			_mouseY = pos.y;
-			screen()->updateScreen();
 			} break;
 
 		case Common::EVENT_LBUTTONDOWN:
@@ -132,7 +131,7 @@
 			Common::Point pos = getMousePos();
 			_mouseX = pos.x;
 			_mouseY = pos.y;
-			keys = event.type == Common::EVENT_LBUTTONDOWN ? 199 : (200 | 0x800);
+			keys = (event.type == Common::EVENT_LBUTTONDOWN ? 199 : (200 | 0x800));
 			breakLoop = true;
 			} break;
 
@@ -174,8 +173,11 @@
 			_eventList.push_back(Event(event, true));
 			break;
 
+		case Common::EVENT_MOUSEMOVE:
+			screen_v2()->updateScreen();
+			// fall through
+
 		case Common::EVENT_LBUTTONUP:
-		case Common::EVENT_MOUSEMOVE:
 			_eventList.push_back(event);
 			break;
 

Modified: scummvm/trunk/engines/kyra/screen_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/screen_mr.cpp	2008-05-05 17:56:39 UTC (rev 31881)
+++ scummvm/trunk/engines/kyra/screen_mr.cpp	2008-05-05 18:50:42 UTC (rev 31882)
@@ -135,4 +135,18 @@
 	return layer;
 }
 
+void Screen_MR::drawFilledBox(int x1, int y1, int x2, int y2, uint8 c1, uint8 c2, uint8 c3) {
+	debugC(9, kDebugLevelScreen, "Screen_MR::drawFilledBox(%d, %d, %d, %d, %d, %d, %d,)", x1, y1, x2, y2, c1, c2, c3);
+
+	fillRect(x1, y1, x2, y2, c1);
+
+	fillRect(x1, y1, x2, y1+1, c2);
+	fillRect(x2-1, y1, x2, y2, c2);
+
+	drawClippedLine(x1, y1, x1, y2, c3);
+	drawClippedLine(x1+1, y1+1, x1+1, y2-2, c3);
+	drawClippedLine(x1, y2, x2, y2, c3);
+	drawClippedLine(x1, y2-1, x2-1, y2-1, c3);
+}
+
 } // end of namespace Kyra

Modified: scummvm/trunk/engines/kyra/screen_mr.h
===================================================================
--- scummvm/trunk/engines/kyra/screen_mr.h	2008-05-05 17:56:39 UTC (rev 31881)
+++ scummvm/trunk/engines/kyra/screen_mr.h	2008-05-05 18:50:42 UTC (rev 31882)
@@ -47,6 +47,8 @@
 
 	int getDrawLayer(int x, int y);
 	int getDrawLayer2(int x, int y, int height);
+
+	void drawFilledBox(int x1, int y1, int x2, int y2, uint8 c1, uint8 c2, uint8 c3);
 private:
 	static const ScreenDim _screenDimTable[];
 	static const int _screenDimTableCount;

Modified: scummvm/trunk/engines/kyra/script_mr.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_mr.cpp	2008-05-05 17:56:39 UTC (rev 31881)
+++ scummvm/trunk/engines/kyra/script_mr.cpp	2008-05-05 18:50:42 UTC (rev 31882)
@@ -723,6 +723,81 @@
 	return _score;
 }
 
+int KyraEngine_MR::o3_daggerWarning(EMCState *script) {
+	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_daggerWarning(%p) ()", (const void *)script);
+	int selection = 1;
+
+	_screen->hideMouse();
+	_screen->copyRegionToBuffer(0, 0, 0, 320, 200, _screenBuffer);
+	int curPageBackUp = _screen->_curPage;
+	_screen->_curPage = 2;
+
+	_screen->drawFilledBox(0, 0, 0x13F, 0xC7, 0xB4, 0xB3, 0xB6);
+	_screen->drawFilledBox(0xF, 0xAA, 0x68, 0xBA, 0xB4, 0xB3, 0xB6);
+	_screen->drawFilledBox(0x73, 0xAA, 0xCC, 0xBA, 0xB4, 0xB3, 0xB6);
+	_screen->drawFilledBox(0xD6, 0xAA, 0x12F, 0xBA, 0xB4, 0xB3, 0xB6);
+
+	int y = 15;
+	for (int i = 100; i <= 107; ++i) {
+		const char *str = (const char *)getTableEntry(_cCodeFile, i);
+		int x = _text->getCenterStringX(str, 0, 0x13F);
+		_text->printText(str, x, y, 0xFF, 0xF0, 0x00);
+		y += 10;
+	}
+	y += 15;
+	for (int i = 110; i <= 113; ++i) {
+		const char *str = (const char *)getTableEntry(_cCodeFile, i);
+		int x = _text->getCenterStringX(str, 0, 0x13F);
+		_text->printText(str, x, y, 0xFF, 0xF0, 0x00);
+		y += 10;
+	}
+
+	const char *str = 0;
+	int x = 0;
+	
+	str = (const char *)getTableEntry(_cCodeFile, 120);
+	x = _text->getCenterStringX(str, 0xF, 0x68);
+	_text->printText(str, x, 174, 0xFF, 0xF0, 0x00);
+
+	str = (const char *)getTableEntry(_cCodeFile, 121);
+	x = _text->getCenterStringX(str, 0x73, 0xCC);
+	_text->printText(str, x, 174, 0xFF, 0xF0, 0x00);
+
+	str = (const char *)getTableEntry(_cCodeFile, 122);
+	x = _text->getCenterStringX(str, 0xD6, 0x12F);
+	_text->printText(str, x, 174, 0xFF, 0xF0, 0x00);
+
+	_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
+	_screen->updateScreen();
+
+	_screen->_curPage = curPageBackUp;
+	_screen->showMouse();
+
+	while (!_quitFlag) {
+		int keys = checkInput(0);
+		removeInputTop();
+
+		if (keys == 198 || keys == 199) {
+			if (_mouseX >= 15 && _mouseX <= 104 && _mouseY >= 170 && _mouseY <= 186) {
+				selection = 1;
+				break;
+			} else if (_mouseX >= 115 && _mouseX <= 204 && _mouseY >= 170 && _mouseY <= 186) {
+				selection = 2;
+				break;
+			} else if (_mouseX >= 214 && _mouseX <= 303 && _mouseY >= 170 && _mouseY <= 186) {
+				selection = 3;
+				break;
+			}
+		}
+
+		delay(10);
+	}
+
+	restorePage3();
+	_screen->copyBlockToPage(1, 0, 0, 320, 200, _screenBuffer);
+	return selection;
+}
+
 int KyraEngine_MR::o3_blockOutRegion(EMCState *script) {
 	debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3_blockOutRegion(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
 	const int x1 = stackPos(0);
@@ -1175,7 +1250,7 @@
 	Opcode(o2_playWanderScoreViaMap);
 	Opcode(o3_playSoundEffect);
 	Opcode(o3_getScore);
-	OpcodeUnImpl();
+	Opcode(o3_daggerWarning);
 	// 0x5c
 	Opcode(o3_blockOutRegion);
 	Opcode(o3_dummy);


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