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

athrxx at users.sourceforge.net athrxx at users.sourceforge.net
Sun Dec 28 23:09:31 CET 2008


Revision: 35595
          http://scummvm.svn.sourceforge.net/scummvm/?rev=35595&view=rev
Author:   athrxx
Date:     2008-12-28 22:09:31 +0000 (Sun, 28 Dec 2008)

Log Message:
-----------
LOL: - fixed some bugs in the main menu code (premature pak file unloading etc.) and added floppy support

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/gui.cpp
    scummvm/trunk/engines/kyra/lol.cpp
    scummvm/trunk/engines/kyra/staticres.cpp

Modified: scummvm/trunk/engines/kyra/gui.cpp
===================================================================
--- scummvm/trunk/engines/kyra/gui.cpp	2008-12-28 20:19:22 UTC (rev 35594)
+++ scummvm/trunk/engines/kyra/gui.cpp	2008-12-28 22:09:31 UTC (rev 35595)
@@ -476,6 +476,12 @@
 
 	Common::Rect menuRect(x + 16, y + 4, x + width - 16, y + 4 + fh * _static.menuTable[3]);
 
+	Common::Event evt;
+	while(_system->getEventManager()->pollEvent(evt)) {
+		if (evt.type != Common::EVENT_LBUTTONUP && evt.type != Common::EVENT_LBUTTONDOWN)
+			break;
+	}
+
 	while (!_vm->shouldQuit()) {
 		updateAnimation();
 		bool mousePressed = getInput();

Modified: scummvm/trunk/engines/kyra/lol.cpp
===================================================================
--- scummvm/trunk/engines/kyra/lol.cpp	2008-12-28 20:19:22 UTC (rev 35594)
+++ scummvm/trunk/engines/kyra/lol.cpp	2008-12-28 22:09:31 UTC (rev 35595)
@@ -111,6 +111,7 @@
 		setupPrologueData(false);
 	}
 
+	setupPrologueData(true);
 	preInit();
 
 	int processSelection = -1;
@@ -120,6 +121,7 @@
 		_screen->fadePalette(_screen->getPalette(0), 0x1E);
 
 		int selection = mainMenu();
+		_screen->clearPage(0);
 
 		switch (selection) {
 		case 0:		// New game
@@ -127,11 +129,10 @@
 			break;
 
 		case 1:		// Show intro
-			setupPrologueData(true);
 			_screen->hideMouse();
 			showIntro();
 			_screen->showMouse();
-			setupPrologueData(false);
+			
 			break;
 
 		case 2:		// "Lore of the Lands"
@@ -157,17 +158,17 @@
 		memset(_screen->getPalette(0), 0, 768);
 		_screen->fadePalette(_screen->getPalette(0), 0x54);
 
-		setupPrologueData(true);
 		_sound->loadSoundFile("LOREINTR");
 		_sound->playTrack(6);
 		/*int character = */chooseCharacter();
 		_sound->playTrack(1);
 		_screen->fadeToBlack();
-		setupPrologueData(false);
 	} else if (processSelection == 3) {
 		//XXX
 	}
 
+	setupPrologueData(false);
+
 	return Common::kNoError;
 }
 
@@ -218,7 +219,6 @@
 	_screen->setMouseCursor(0, 0, _shapes[0]);
 }
 
-
 int LoLEngine::mainMenu() {
 	debugC(9, kDebugLevelMain, "LoLEngine::mainMenu()");
 
@@ -234,25 +234,32 @@
 	if (hasSave)
 		++data.menuTable[3];
 
-	static const uint16 mainMenuStrings[2][5] = {
+	static const uint16 mainMenuStrings[4][5] = {
 		{ 0x4248, 0x4249, 0x42DD, 0x424A, 0x0000 },
-		{ 0x4248, 0x4249, 0x42DD, 0x4001, 0x424A }
+		{ 0x4248, 0x4249, 0x42DD, 0x4001, 0x424A },
+		{ 0x4248, 0x4249, 0x424A, 0x0000, 0x0000 },
+		{ 0x4248, 0x4249, 0x4001, 0x424A, 0x0000 }
 	};
 
+	int tableOffs = _flags.isTalkie ? 0 : 2;
+
 	for (int i = 0; i < 5; ++i) {
 		if (hasSave)
-			data.strings[i] = getLangString(mainMenuStrings[1][i]);		
+			data.strings[i] = getLangString(mainMenuStrings[1 + tableOffs][i]);		
 		else
-			data.strings[i] = getLangString(mainMenuStrings[0][i]);		
+			data.strings[i] = getLangString(mainMenuStrings[tableOffs][i]);		
 	}
 
 	MainMenu *menu = new MainMenu(this);
 	assert(menu);
 	menu->init(data, MainMenu::Animation());
 
-	int selection = menu->handle(hasSave ? 12 : 6);
+	int selection = menu->handle(_flags.isTalkie ? (hasSave ? 12 : 6) :(hasSave ? 6 : 13));
 	delete menu;
 
+	if (!_flags.isTalkie && selection >= 2)
+		selection++;
+
 	if (!hasSave && selection == 3)
 		selection = 4;
 
@@ -303,14 +310,28 @@
 void LoLEngine::setupPrologueData(bool load) {
 	debugC(9, kDebugLevelMain, "LoLEngine::setupPrologueData(%d)", load);
 
-	static const char * const fileList[] = {
+	_res->unloadAllPakFiles();
+
+	static const char * const fileListCD[] = {
 		"GENERAL.PAK", "INTROVOC.PAK", "STARTUP.PAK", "INTRO1.PAK",
 		"INTRO2.PAK", "INTRO3.PAK", "INTRO4.PAK", "INTRO5.PAK",
-		"INTRO6.PAK", "INTRO7.PAK", "INTRO8.PAK", "INTRO9.PAK"
+		"INTRO6.PAK", "INTRO7.PAK", "INTRO8.PAK", "INTRO9.PAK", 0
 	};
 
+	static const char * const fileListFloppyExtracted[] = {
+		"general.pak", "intro.pak", "introvoc.pak", 0
+	};
+
+	static const char * const fileListFloppy[] = {
+		"general.pak", "intro.pak", "introvoc.cmp", 0
+	};
+
+	const char * const *fileList = _flags.isTalkie ? fileListCD : 
+		(_flags.useInstallerPackage ? fileListFloppy : fileListFloppyExtracted);
+		
+
 	char filename[32];
-	for (uint i = 0; i < ARRAYSIZE(fileList); ++i) {
+	for (uint i = 0; fileList[i]; ++i) {
 		filename[0] = '\0';
 
 		if (_flags.isTalkie) {
@@ -332,6 +353,11 @@
 	_screen->clearPage(3);
 	
 	if (load) {
+		if (_flags.isTalkie) {
+			_res->loadPakFile("startup.pak");
+			_res->loadPakFile("general.pak");
+		}
+
 		_chargenWSA = new WSAMovie_v2(this, _screen);
 		assert(_chargenWSA);
 

Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp	2008-12-28 20:19:22 UTC (rev 35594)
+++ scummvm/trunk/engines/kyra/staticres.cpp	2008-12-28 22:09:31 UTC (rev 35595)
@@ -2363,13 +2363,14 @@
 	{ 0x0B, 0x7B, 0x1C, 0x12, 0xFE, 0xFC, 0x00, 0x00 },
 	{ 0x0B, 0x7B, 0x1C, 0x2D, 0xFE, 0xFC, 0x00, 0x00 },
 	{ 0x55, 0x7B, 0xE9, 0x37, 0xFE, 0xFC, 0x00, 0x00 },
-	{ 0x0B, 0x8C, 0x10, 0x2B, 0x3D, 0x01, 0x00, 0x00 },	// Main menu box (3 entries)
+	{ 0x0B, 0x8C, 0x10, 0x2B, 0x3D, 0x01, 0x00, 0x00 },	// Main menu box (4 entries)
 	{ 0x04, 0x59, 0x20, 0x3C, 0x00, 0x00, 0x00, 0x00 },
 	{ 0x05, 0x6E, 0x1E, 0x0C, 0xFE, 0x01, 0x00, 0x00 },
 	{ 0x07, 0x19, 0x1A, 0x97, 0x00, 0x00, 0x00, 0x00 },
 	{ 0x03, 0x1E, 0x22, 0x8C, 0x00, 0x00, 0x00, 0x00 },
 	{ 0x02, 0x48, 0x24, 0x34, 0x00, 0x00, 0x00, 0x00 },
-	{ 0x0B, 0x8C, 0x10, 0x33, 0x3D, 0x01, 0x00, 0x00 }	// Main menu box (4 entries)
+	{ 0x0B, 0x8C, 0x10, 0x33, 0x3D, 0x01, 0x00, 0x00 },	// Main menu box (5 entries)
+	{ 0x0B, 0x8C, 0x10, 0x23, 0x3D, 0x01, 0x00, 0x00 }	// Main menu box (3 entries)
 };
 
 const int Screen_LoL::_screenDimTableCount = ARRAYSIZE(Screen_LoL::_screenDimTable);


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