From d9d15f9e7ec845dfbf21d2dff191dfe4d19b6726 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Thu, 1 Nov 2007 18:16:02 +0000 Subject: added bootparam handling, minor cleanup svn-id: r29364 --- engines/igor/igor.cpp | 8 ++++++-- engines/igor/igor.h | 2 ++ engines/igor/menu.cpp | 11 ++++++++--- engines/igor/parts/part_90.cpp | 18 +++++++++++------- engines/igor/parts/part_main.cpp | 14 ++++++++++---- 5 files changed, 37 insertions(+), 16 deletions(-) (limited to 'engines/igor') diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp index aa314e2898..ece5645743 100644 --- a/engines/igor/igor.cpp +++ b/engines/igor/igor.cpp @@ -153,7 +153,10 @@ void IgorEngine::restart() { 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 @@ void IgorEngine::waitForTimer(int ticks) { 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: diff --git a/engines/igor/igor.h b/engines/igor/igor.h index 018232396a..7074637fa5 100644 --- a/engines/igor/igor.h +++ b/engines/igor/igor.h @@ -58,6 +58,8 @@ enum { enum { kStartupPart = 900, + kInvalidPart = 255, + kSharewarePart = 950, kTalkColor = 240, kTalkShadowColor = 241, kTickDelay = 1193180 / 4096 diff --git a/engines/igor/menu.cpp b/engines/igor/menu.cpp index abe38d35ea..60d1d287c3 100644 --- a/engines/igor/menu.cpp +++ b/engines/igor/menu.cpp @@ -143,7 +143,7 @@ void IgorEngine::handleOptionsMenu_paintQuit() { 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 @@ void IgorEngine::handleOptionsMenu() { 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 @@ void IgorEngine::handleOptionsMenu() { _system->updateScreen(); _system->delayMillis(1000 / 60); } + if (!_eventQuitGame && _currentPart == kInvalidPart) { + if (_gameVersion == kIdEngDemo100 || _gameVersion == kIdEngDemo110) { + _currentPart = kSharewarePart; + } + } } void IgorEngine::handlePause() { diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp index e5578fc18e..c069d5d34e 100644 --- a/engines/igor/parts/part_90.cpp +++ b/engines/igor/parts/part_90.cpp @@ -27,7 +27,9 @@ 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); @@ -52,11 +54,11 @@ void IgorEngine::PART_90() { 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 @@ void IgorEngine::PART_90() { } _inputVars[kInputEscape] = 0; fadeOutPalette(768); - if (_currentPart == 904) { - _currentPart = 850; - } else { - ++_currentPart; + if (_currentPart != kInvalidPart) { + if (_currentPart == 904) { + _currentPart = 850; + } else { + ++_currentPart; + } } } diff --git a/engines/igor/parts/part_main.cpp b/engines/igor/parts/part_main.cpp index 0a6587f1e5..98c8f3bffb 100644 --- a/engines/igor/parts/part_main.cpp +++ b/engines/igor/parts/part_main.cpp @@ -929,9 +929,18 @@ void IgorEngine::PART_MAIN() { 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 @@ void IgorEngine::PART_MAIN() { _gameState.nextMusicCounter = 0; } } while (_currentPart != 255 && !_eventQuitGame); - for (_currentPart = 950; _currentPart <= 956 && !_eventQuitGame; ++_currentPart) { - PART_95(); - } } } // namespace Igor -- cgit v1.2.3