[Scummvm-cvs-logs] SF.net SVN: scummvm: [29364] scummvm/trunk/engines/igor

cyx at users.sourceforge.net cyx at users.sourceforge.net
Thu Nov 1 19:16:03 CET 2007


Revision: 29364
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29364&view=rev
Author:   cyx
Date:     2007-11-01 11:16:02 -0700 (Thu, 01 Nov 2007)

Log Message:
-----------
added bootparam handling, minor cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/igor/igor.cpp
    scummvm/trunk/engines/igor/igor.h
    scummvm/trunk/engines/igor/menu.cpp
    scummvm/trunk/engines/igor/parts/part_90.cpp
    scummvm/trunk/engines/igor/parts/part_main.cpp

Modified: scummvm/trunk/engines/igor/igor.cpp
===================================================================
--- scummvm/trunk/engines/igor/igor.cpp	2007-11-01 18:15:25 UTC (rev 29363)
+++ scummvm/trunk/engines/igor/igor.cpp	2007-11-01 18:16:02 UTC (rev 29364)
@@ -153,7 +153,10 @@
 int IgorEngine::go() {
 	restart();
 	setupDefaultPalette();
-	_currentPart = kStartupPart;
+	_currentPart = ConfMan.getInt("boot_param");
+	if (_currentPart == 0) {
+		_currentPart = kStartupPart;
+	}
 	if (!_ovlFile.open("IGOR.DAT")) {
 		error("Unable to open 'IGOR.DAT'");
 	}
@@ -204,7 +207,8 @@
 		while (_eventMan->pollEvent(ev)) {
 			switch (ev.type) {
 			case Common::EVENT_QUIT:
-				_currentPart = 255;
+				_inputVars[kInputEscape] = 1;
+				_currentPart = kInvalidPart;
 				_eventQuitGame = true;
 				break;
 			case Common::EVENT_KEYDOWN:

Modified: scummvm/trunk/engines/igor/igor.h
===================================================================
--- scummvm/trunk/engines/igor/igor.h	2007-11-01 18:15:25 UTC (rev 29363)
+++ scummvm/trunk/engines/igor/igor.h	2007-11-01 18:16:02 UTC (rev 29364)
@@ -58,6 +58,8 @@
 
 enum {
 	kStartupPart = 900,
+	kInvalidPart = 255,
+	kSharewarePart = 950,
 	kTalkColor = 240,
 	kTalkShadowColor = 241,
 	kTickDelay = 1193180 / 4096

Modified: scummvm/trunk/engines/igor/menu.cpp
===================================================================
--- scummvm/trunk/engines/igor/menu.cpp	2007-11-01 18:15:25 UTC (rev 29363)
+++ scummvm/trunk/engines/igor/menu.cpp	2007-11-01 18:16:02 UTC (rev 29364)
@@ -143,7 +143,7 @@
 
 bool IgorEngine::handleOptionsMenu_handleKeyDownQuit(int key) {
 	if (key == Common::KEYCODE_y) {
-		_currentPart = 255; // display the shareware screens
+		_currentPart = kInvalidPart;
 	}
 	return true;
 }
@@ -257,13 +257,13 @@
 	int currentPage = 0;
 	bool menuLoop = true;
 	bool focusOnPage = false;
-	while (menuLoop && _currentPart != 255) {
+	while (menuLoop && !_eventQuitGame && _currentPart != kInvalidPart) {
 		int previousPage = currentPage;
 		Common::Event ev;
 		while (_eventMan->pollEvent(ev)) {
 			switch (ev.type) {
 			case Common::EVENT_QUIT:
-				_currentPart = 255;
+				_currentPart = kInvalidPart;
 				_eventQuitGame = true;
 				break;
 			case Common::EVENT_KEYDOWN:
@@ -333,6 +333,11 @@
 		_system->updateScreen();
 		_system->delayMillis(1000 / 60);
 	}
+	if (!_eventQuitGame && _currentPart == kInvalidPart) {
+		if (_gameVersion == kIdEngDemo100 || _gameVersion == kIdEngDemo110) {
+			_currentPart = kSharewarePart;
+		}
+	}
 }
 
 void IgorEngine::handlePause() {

Modified: scummvm/trunk/engines/igor/parts/part_90.cpp
===================================================================
--- scummvm/trunk/engines/igor/parts/part_90.cpp	2007-11-01 18:15:25 UTC (rev 29363)
+++ scummvm/trunk/engines/igor/parts/part_90.cpp	2007-11-01 18:16:02 UTC (rev 29364)
@@ -27,8 +27,10 @@
 
 namespace Igor {
 
-static const char *STR_COPYRIGHT = "(C) 1995 Optik Software. All rights reserved.";
+static const char *STR_COPYRIGHT_1995 = "(C) 1995 Optik Software. All rights reserved.";
 
+static const char *STR_COPYRIGHT_1994 = "(C) 1994 PENDULO STUDIOS. All rights reserved.";
+
 void IgorEngine::PART_90() {
 	memset(_currentPalette, 0, 768);
 	setPaletteRange(0, 255);
@@ -52,11 +54,11 @@
 	case 904:
 		loadData(PAL_TitleScreen, _paletteBuffer);
 		loadData(IMG_TitleScreen, _screenVGA);
-		drawString(_screenVGA, STR_COPYRIGHT, 2, 187, 0xF5, 0, 0);
+		drawString(_screenVGA, (_gameVersion == kIdEngDemo110) ? STR_COPYRIGHT_1994 : STR_COPYRIGHT_1995, 2, 187, 0xF5, 0, 0);
 		break;
 	}
 	fadeInPalette(768);
-	while (!_inputVars[kInputEscape] && !_eventQuitGame) {
+	while (!_inputVars[kInputEscape]) {
 		waitForTimer();
 		if (_inputVars[kInputOptions]) {
 			_inputVars[kInputOptions] = 0;
@@ -66,10 +68,12 @@
 	}
 	_inputVars[kInputEscape] = 0;
 	fadeOutPalette(768);
-	if (_currentPart == 904) {
-		_currentPart = 850;
-	} else {
-		++_currentPart;
+	if (_currentPart != kInvalidPart) {
+		if (_currentPart == 904) {
+			_currentPart = 850;
+		} else {
+			++_currentPart;
+		}
 	}
 }
 

Modified: scummvm/trunk/engines/igor/parts/part_main.cpp
===================================================================
--- scummvm/trunk/engines/igor/parts/part_main.cpp	2007-11-01 18:15:25 UTC (rev 29363)
+++ scummvm/trunk/engines/igor/parts/part_main.cpp	2007-11-01 18:16:02 UTC (rev 29364)
@@ -929,9 +929,18 @@
 		case 904:
 			PART_90();
 			break;
+		case 950:
+		case 951:
+		case 952:
+		case 953:
+		case 954:
+		case 955:
+		case 956:
+			PART_95();
+			break;
 		default:
 			warning("PART_MAIN() Unhandled part %d", _currentPart);
-			_currentPart = 255;
+			_currentPart = kInvalidPart;
 			break;
 		}
 		if (_currentPart >= 10) {
@@ -966,9 +975,6 @@
 			_gameState.nextMusicCounter = 0;
 		}
 	} while (_currentPart != 255 && !_eventQuitGame);
-	for (_currentPart = 950; _currentPart <= 956 && !_eventQuitGame; ++_currentPart) {
-		PART_95();
-	}
 }
 
 } // namespace Igor


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