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

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sun May 28 09:23:02 CEST 2006


Revision: 22724
Author:   eriktorbjorn
Date:     2006-05-28 09:22:12 -0700 (Sun, 28 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22724&view=rev

Log Message:
-----------
Mock-up version of the Kyra 3 main menu. Just enough to be able to select the
intro cutscene.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra3.cpp
Modified: scummvm/trunk/engines/kyra/kyra3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra3.cpp	2006-05-28 15:09:38 UTC (rev 22723)
+++ scummvm/trunk/engines/kyra/kyra3.cpp	2006-05-28 16:22:12 UTC (rev 22724)
@@ -30,6 +30,9 @@
 #include "common/system.h"
 #include "common/config-manager.h"
 
+// TODO: Temporary, to get the mouse cursor mock-up working
+#include "graphics/cursorman.h"
+
 namespace Kyra {
 KyraEngine_v3::KyraEngine_v3(OSystem *system) : KyraEngine(system) {
 	_soundDigital = 0;
@@ -131,6 +134,8 @@
 		break;
 	
 	case 1:
+		playVQA("K3INTRO");
+		// TODO: Restart the menu animation
 		break;
 	
 	case 2:
@@ -223,8 +228,41 @@
 	uint32 nextRun = 0;
 	
 	drawMainMenu(strings);
+
+#define A 0x00
+#define B 0xFF
+#define C 0x7F
+
+	// TODO: This is just a mock-up of the real mouse cursor.
+	const byte cursorImage[] = {
+		A, A, C, C, C, C, C, C, C, C,
+		A, B, A, C, C, C, C, C, C, C,
+		A, B, B, A, C, C, C, C, C, C,
+		A, B, B, B, A, C, C, C, C, C,
+		A, B, B, B, B, A, C, C, C, C,
+		A, B, B, B, B, B, A, C, C, C,
+		A, B, B, B, B, B, B, A, C, C,
+		A, B, B, B, B, B, B, B, A, C,
+		A, B, B, B, B, B, B, B, B, A,
+		C, A, A, A, B, B, B, A, A, C,
+		C, C, C, C, A, B, B, B, A, C,
+		C, C, C, C, C, A, B, B, B, A,
+		C, C, C, C, C, C, A, A, A, C
+	};
+
 	_system->warpMouse(300, 180);
+	CursorMan.replaceCursor(cursorImage, 10, 13, 1, 1, C);
+	_screen->hideMouse();	// HACK to get _mouseLockCount to 1.
 	_screen->showMouse();
+
+#undef A
+#undef B
+#undef C
+
+	int fh = _screen->getFontHeight();
+	int textPos = ((_screen->_curDim->w >> 1) + _screen->_curDim->sx) << 3;
+
+	Common::Rect menuRect(x + 16, y + 4, x + width - 16, y + 4 + fh * 4);
 	
 	while (command == -1 && !_quitFlag) {
 		// yes 2 * _tickLength here not 3 * like in the first draw
@@ -249,6 +287,26 @@
 			if ((int32)nextRun - (int32)_system->getMillis() >= 10)
 				delay(10);
 		}
+
+		if (menuRect.contains(mouseX(), mouseY())) {
+			int item = (mouseY() - menuRect.top) / fh;
+
+			if (item != _selectedMenuItem) {
+				gui_printString(strings[_selectedMenuItem], textPos, menuRect.top + _selectedMenuItem * fh, 0x80, 0, 5);
+				gui_printString(strings[item], textPos, menuRect.top + item * fh, 0xFF, 0, 5);
+
+				_selectedMenuItem = item;
+			}
+
+			if (_mousePressFlag) {
+				// TODO: Flash the text
+				command = item;
+
+				// TODO: For now, only the intro is supported
+				if (command != 1)
+					command = -1;
+			}
+		}
 	}
 	
 	if (_quitFlag)


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