[Scummvm-cvs-logs] SF.net SVN: scummvm: [26760] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun May 6 11:59:07 CEST 2007


Revision: 26760
          http://scummvm.svn.sourceforge.net/scummvm/?rev=26760&view=rev
Author:   peres001
Date:     2007-05-06 02:59:05 -0700 (Sun, 06 May 2007)

Log Message:
-----------
Menu handling simplification.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/menu.cpp
    scummvm/trunk/engines/parallaction/menu.h
    scummvm/trunk/engines/parallaction/parallaction.cpp

Modified: scummvm/trunk/engines/parallaction/menu.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/menu.cpp	2007-05-06 09:46:43 UTC (rev 26759)
+++ scummvm/trunk/engines/parallaction/menu.cpp	2007-05-06 09:59:05 UTC (rev 26760)
@@ -94,6 +94,7 @@
 
 Menu::Menu(Parallaction *vm) {
 	_vm = vm;
+
 }
 
 Menu::~Menu() {
@@ -105,6 +106,20 @@
 
 	_vm->_disk->selectArchive((_vm->getPlatform() == Common::kPlatformPC) ? "disk1" : "disk0");
 
+	splash();
+
+	_language = chooseLanguage();
+	_vm->_disk->setLanguage(_language);
+
+	int game = selectGame();
+	if (game == 0)
+		newGame();
+
+	return;
+}
+
+void Menu::splash() {
+
 	_vm->_disk->loadSlide("intro");
 	_vm->_gfx->setPalette(_vm->_gfx->_palette);
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
@@ -115,33 +130,17 @@
 	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
 	g_system->delayMillis(2000);
 
-	if (_vm->getPlatform() == Common::kPlatformPC) {
-		_vm->_gfx->setFont(kFontMenu);
+}
 
-		_vm->_disk->loadSlide("lingua");
-		_vm->_gfx->setPalette(_vm->_gfx->_palette);
-		_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
+void Menu::newGame() {
 
-		_vm->_gfx->displayString(60, 30, "SELECT LANGUAGE");
-
-		_vm->_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack);
-		_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);
-		_language = chooseLanguage();
-
-		_vm->_disk->setLanguage(_language);
-
-		if (selectGame() == 0) {
-			newGame();
-		}
-	} else {
-		_vm->_disk->setLanguage(1);
+	if (_vm->getFeatures() & GF_DEMO) {
+		// character screen is not shown on demo
+		// so user warps to the playable intro
+		strcpy(_vm->_location._name, "fognedemo");
+		return;
 	}
 
-	return;
-}
-
-void Menu::newGame() {
-
 	const char **v14 = introMsg3;
 
 	_vm->_disk->loadScenery("test", NULL);
@@ -156,7 +155,6 @@
 	_vm->_gfx->updateScreen();
 	_vm->_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack);
 
-
 	_mouseButtons = kMouseNone;
 
 	for (; _mouseButtons != kMouseLeftUp; ) {
@@ -164,8 +162,10 @@
 		if (_mouseButtons == kMouseRightUp) break;
 	}
 
-	if (_mouseButtons != kMouseRightUp)
+	if (_mouseButtons != kMouseRightUp) {
+		strcpy(_vm->_location._name, "fogne");
 		return;    // show intro
+	}
 
 	selectCharacter();
 
@@ -177,6 +177,25 @@
 
 uint16 Menu::chooseLanguage() {
 
+	if (_vm->getPlatform() == Common::kPlatformAmiga) {
+		// TODO: should return the language ID supported by this version
+		// this can be done with some flags in the detection structures
+		return 1;
+	}
+
+	// user can choose language in dos version
+
+	_vm->_gfx->setFont(kFontMenu);
+
+	_vm->_disk->loadSlide("lingua");
+	_vm->_gfx->setPalette(_vm->_gfx->_palette);
+	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBitFront);
+
+	_vm->_gfx->displayString(60, 30, "SELECT LANGUAGE");
+
+	_vm->_gfx->copyScreen(Gfx::kBitFront, Gfx::kBitBack);
+	_vm->_gfx->copyScreen(Gfx::kBitBack, Gfx::kBit2);
+
 	_vm->changeCursor(kCursorArrow);
 
 	do {
@@ -210,6 +229,9 @@
 uint16 Menu::selectGame() {
 //	  printf("selectGame()\n");
 
+	if (_vm->getFeatures() & GF_DEMO) {
+		return 0;	// can't load a savegame in demo versions
+	}
 
 	_vm->_disk->loadSlide("restore");
 	_vm->_gfx->setPalette(_vm->_gfx->_palette);
@@ -254,6 +276,11 @@
 
 	// load game
 
+	// TODO: allow the user to change her mind in this screen, that is
+	// don't force her to start at the intro when she closes her load
+	// game window without picking a savegame.
+	// The 2 strcpy's below act as workaround to prevent crashes for
+	// time being.
 	strcpy(_vm->_location._name, "fogne");
 	strcpy(_vm->_characterName, "dough");
 

Modified: scummvm/trunk/engines/parallaction/menu.h
===================================================================
--- scummvm/trunk/engines/parallaction/menu.h	2007-05-06 09:46:43 UTC (rev 26759)
+++ scummvm/trunk/engines/parallaction/menu.h	2007-05-06 09:59:05 UTC (rev 26760)
@@ -41,6 +41,7 @@
 	void		selectCharacter();
 
 protected:
+	void 		splash();
 	void		newGame();
 	uint16		chooseLanguage();
 	uint16		selectGame();

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2007-05-06 09:46:43 UTC (rev 26759)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2007-05-06 09:59:05 UTC (rev 26760)
@@ -193,11 +193,6 @@
 	_location._startPosition.y = -1000;
 	_location._startFrame = 0;
 
-	if (getFeatures() & GF_DEMO)
-		strcpy(_location._name, "fognedemo");
-	else
-		strcpy(_location._name, "fogne");
-
 	_location._comment = NULL;
 	_location._endComment = NULL;
 


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