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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Tue Jul 25 17:11:48 CEST 2006


Revision: 23593
Author:   lordhoto
Date:     2006-07-25 08:11:42 -0700 (Tue, 25 Jul 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=23593&view=rev

Log Message:
-----------
Add support for looping the kyra3 main menu.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/kyra.cpp
    scummvm/trunk/engines/kyra/kyra3.cpp
Modified: scummvm/trunk/engines/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra.cpp	2006-07-25 03:47:26 UTC (rev 23592)
+++ scummvm/trunk/engines/kyra/kyra.cpp	2006-07-25 15:11:42 UTC (rev 23593)
@@ -104,6 +104,7 @@
 	_scrollDownButton.process0PtrShape = _scrollDownButton.process1PtrShape = _scrollDownButton.process2PtrShape = 0;
 	memset(_sceneAnimTable, 0, sizeof(_sceneAnimTable));
 	_features = 0;
+	_quitFlag = false;
 }
 
 KyraEngine_v1::KyraEngine_v1(OSystem *system)

Modified: scummvm/trunk/engines/kyra/kyra3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra3.cpp	2006-07-25 03:47:26 UTC (rev 23592)
+++ scummvm/trunk/engines/kyra/kyra3.cpp	2006-07-25 15:11:42 UTC (rev 23593)
@@ -93,59 +93,70 @@
 }
 
 int KyraEngine_v3::go() {
-	_screen->_curPage = 0;
-	_screen->clearPage(0);
+	uint8 *pal = _screen->getPalette(1);
+	assert(pal);
 	
-	uint8 pal[768];
-	memset(pal, 0, sizeof(pal));
-	
 	WSAMovieV3 *logo = new WSAMovieV3(this);
+	assert(logo);
 	logo->open("REVENGE.WSA", 1, pal);
 	assert(logo->opened());
 	
-	pal[0] = pal[1] = pal[2] = 0;
-	
-	_screen->setScreenPalette(pal);
-	
-	// XXX
-	playMenuAudioFile();
-	
-	logo->setX(0); logo->setY(0);
-	logo->setDrawPage(0);
+	bool running = true;
+	while (running) {
+		_screen->_curPage = 0;
+		_screen->clearPage(0);
 
-	for (int i = 0; i < 64 && !_quitFlag; ++i) {
-		uint32 nextRun = _system->getMillis() + 3 * _tickLength;
-		logo->displayFrame(i);
-		_screen->updateScreen();
-		delayUntil(nextRun);
-	}
+		pal[0] = pal[1] = pal[2] = 0;
+		
+		_screen->setScreenPalette(pal);
+		
+		// XXX
+		playMenuAudioFile();
+		
+		logo->setX(0); logo->setY(0);
+		logo->setDrawPage(0);
 
-	for (int i = 64; i > 29 && !_quitFlag; --i) {
-		uint32 nextRun = _system->getMillis() + 3 * _tickLength;
-		logo->displayFrame(i);
-		_screen->updateScreen();
-		delayUntil(nextRun);
+		for (int i = 0; i < 64 && !_quitFlag; ++i) {
+			uint32 nextRun = _system->getMillis() + 3 * _tickLength;
+			logo->displayFrame(i);
+			_screen->updateScreen();
+			delayUntil(nextRun);
+		}
+
+		for (int i = 64; i > 29 && !_quitFlag; --i) {
+			uint32 nextRun = _system->getMillis() + 3 * _tickLength;
+			logo->displayFrame(i);
+			_screen->updateScreen();
+			delayUntil(nextRun);
+		}
+		
+		switch (handleMainMenu(logo)) {
+		case 0:
+			//delete logo;
+			//logo = 0;
+			//XXX run game
+			//running = false;
+			break;
+		
+		case 1:
+			playVQA("K3INTRO");
+			break;
+		
+		case 2:
+			//delete logo;
+			//logo = 0;
+			//show load dialog
+			//running = false;
+			break;
+		
+		case 3:
+			running = false;
+			break;
+		
+		default:
+			break;
+		}
 	}
-	
-	switch (handleMainMenu(logo)) {
-	case 0:
-		break;
-	
-	case 1:
-		playVQA("K3INTRO");
-		// TODO: Restart the menu animation
-		break;
-	
-	case 2:
-		break;
-	
-	case 3:
-		break;
-	
-	default:
-		break;
-	}
-	
 	delete logo;
 
 	return 0;
@@ -301,8 +312,8 @@
 				// TODO: Flash the text
 				command = item;
 
-				// TODO: For now, only the intro is supported
-				if (command != 1)
+				// TODO: For now, only playing the intro and quitting is supported
+				if (command != 1 && command != 3)
 					command = -1;
 			}
 		}


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