diff options
author | Max Horn | 2009-11-14 13:11:06 +0000 |
---|---|---|
committer | Max Horn | 2009-11-14 13:11:06 +0000 |
commit | 81762edf338be5394120787696d9af61a00a0f9d (patch) | |
tree | dd9ba845e92d973c2ef764eaee0bb169468640a6 | |
parent | 05a735c4428c51e8a050c4c55d06dedf34aace66 (diff) | |
download | scummvm-rg350-81762edf338be5394120787696d9af61a00a0f9d.tar.gz scummvm-rg350-81762edf338be5394120787696d9af61a00a0f9d.tar.bz2 scummvm-rg350-81762edf338be5394120787696d9af61a00a0f9d.zip |
Remove Igor engine
svn-id: r45898
70 files changed, 2 insertions, 17684 deletions
diff --git a/Makefile.common b/Makefile.common index 7f6c3c4082..57bdd4e62e 100644 --- a/Makefile.common +++ b/Makefile.common @@ -226,9 +226,6 @@ DIST_FILES_ENGINEDATA= ifdef ENABLE_DRASCULA DIST_FILES_ENGINEDATA+=drascula.dat endif -ifdef ENABLE_IGOR -DIST_FILES_ENGINEDATA+=igor.tbl -endif ifdef ENABLE_KYRA DIST_FILES_ENGINEDATA+=kyra.dat endif diff --git a/backends/platform/PalmOS/Src/launcher/games.h b/backends/platform/PalmOS/Src/launcher/games.h index 0572504dc8..7c381a40f4 100644 --- a/backends/platform/PalmOS/Src/launcher/games.h +++ b/backends/platform/PalmOS/Src/launcher/games.h @@ -173,7 +173,6 @@ enum { ENGINE_TOUCHE, ENGINE_CRUISE, ENGINE_DRASCULA, - ENGINE_IGOR, ENGINE_COUNT }; @@ -197,7 +196,6 @@ static const struct { { "touche", "Touche: The Adventures of the Fifth Musketeer" }, { "cruise", "Beta -> Cruise for a Corpse" }, { "drascula", "Beta -> Drascula" }, - { "igor", "Beta -> Igor" }, }; // protos diff --git a/backends/platform/PalmOS/Src/prefixes/compile.h b/backends/platform/PalmOS/Src/prefixes/compile.h index c2bb51385a..cb91957104 100644 --- a/backends/platform/PalmOS/Src/prefixes/compile.h +++ b/backends/platform/PalmOS/Src/prefixes/compile.h @@ -46,7 +46,6 @@ #undef ENABLE_PARALLACTION #undef ENABLE_CRUISE #undef ENABLE_DRASCULA -#undef ENABLE_IGOR // ScummVM #define DISABLE_HQ_SCALERS diff --git a/backends/platform/PalmOS/Src/prefixes/native_igor.h b/backends/platform/PalmOS/Src/prefixes/native_igor.h deleted file mode 100644 index 2808dd2331..0000000000 --- a/backends/platform/PalmOS/Src/prefixes/native_igor.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef PREFIX_H -#define PREFIX_H - -#include "native_common.h" -#define ENABLE_IGOR STATIC_PLUGIN - -#endif diff --git a/backends/platform/dc/Makefile b/backends/platform/dc/Makefile index 5148036d1b..a19e119c76 100644 --- a/backends/platform/dc/Makefile +++ b/backends/platform/dc/Makefile @@ -51,7 +51,6 @@ ENABLE_CRUISE = $(ENABLED) ENABLE_DRASCULA = $(ENABLED) ENABLE_GOB = $(ENABLED) ENABLE_GROOVIE = $(ENABLED) -ENABLE_IGOR = $(ENABLED) ENABLE_IHNM = $(ENABLED) ENABLE_KYRA = $(ENABLED) ENABLE_LURE = $(ENABLED) diff --git a/backends/platform/ps2/Makefile.gdb b/backends/platform/ps2/Makefile.gdb index 7177275830..25fee65e30 100644 --- a/backends/platform/ps2/Makefile.gdb +++ b/backends/platform/ps2/Makefile.gdb @@ -20,7 +20,6 @@ ENABLE_SCUMM_7_8 = $(ENABLED) #ENABLE_CRUISE = $(ENABLED) #ENABLE_DRASCULA = $(ENABLED) #ENABLE_GOB = $(ENABLED) -#ENABLE_IGOR = $(ENABLED) #ENABLE_KYRA = $(ENABLED) #ENABLE_LURE = $(ENABLED) # ENABLE_M4 = $(ENABLED) diff --git a/backends/platform/ps2/Makefile.ps2 b/backends/platform/ps2/Makefile.ps2 index 1dfa24a39e..8c1d8f81fe 100644 --- a/backends/platform/ps2/Makefile.ps2 +++ b/backends/platform/ps2/Makefile.ps2 @@ -20,7 +20,6 @@ ENABLE_CINE = $(ENABLED) ENABLE_CRUISE = $(ENABLED) ENABLE_DRASCULA = $(ENABLED) ENABLE_GOB = $(ENABLED) -ENABLE_IGOR = $(ENABLED) ENABLE_KYRA = $(ENABLED) ENABLE_LURE = $(ENABLED) # ENABLE_M4 = $(ENABLED) diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile index 22086c26d0..51d90e85a8 100644 --- a/backends/platform/psp/Makefile +++ b/backends/platform/psp/Makefile @@ -19,7 +19,6 @@ ENABLE_DRASCULA = $(ENABLED) ENABLE_GOB = $(ENABLED) ENABLE_GROOVIE = $(ENABLED) ENABLE_GROOVIE2 = $(ENABLED) -ENABLE_IGOR = $(ENABLED) ENABLE_IHNM = $(ENABLED) ENABLE_KYRA = $(ENABLED) ENABLE_LOL = $(ENABLED) diff --git a/backends/platform/symbian/AdaptAllMMPs.pl b/backends/platform/symbian/AdaptAllMMPs.pl index 6378c2ba72..5c64b69d09 100644 --- a/backends/platform/symbian/AdaptAllMMPs.pl +++ b/backends/platform/symbian/AdaptAllMMPs.pl @@ -15,7 +15,6 @@ chdir("../../../"); "mmp/scummvm_drascula.mmp", "mmp/scummvm_gob.mmp", "mmp/scummvm_groovie.mmp", - "mmp/scummvm_igor.mmp", "mmp/scummvm_kyra.mmp", "mmp/scummvm_lure.mmp", "mmp/scummvm_m4.mmp", @@ -124,7 +123,6 @@ ParseModule("_touche", "touche", \@section_empty); ParseModule("_parallaction","parallaction",\@section_empty); ParseModule("_cruise", "cruise", \@section_empty); ParseModule("_drascula","drascula", \@section_empty); -ParseModule("_igor", "igor", \@section_empty); ParseModule("_made", "made", \@section_empty); ParseModule("_m4", "m4", \@section_empty); ParseModule("_tinsel", "tinsel", \@section_empty); diff --git a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl index 753b29f5d8..d4619595dc 100644 --- a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl +++ b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl @@ -4,13 +4,13 @@ @WorkingEngines = qw( scumm agos sky queen gob groovie saga drascula kyra lure agi touche parallaction cine - cruise igor made m4 tinsel tucker sword1 sword2 sci + cruise made m4 tinsel tucker sword1 sword2 sci ); @WorkingEngines_1st = qw( scumm queen groovie saga drascula touche parallaction cine - cruise igor made m4 tucker + cruise made m4 tucker ); @WorkingEngines_2nd = qw( diff --git a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg index 4547af0597..e9809dd8b7 100644 --- a/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg +++ b/backends/platform/symbian/S60/scummvm-CVS-SymbianS60v2.pkg @@ -50,7 +50,6 @@ ; Common datafiles needed for some games "..\..\..\..\dists\engine-data\kyra.dat"-"!:\system\apps\scummvm\kyra.dat" "..\..\..\..\dists\engine-data\sky.cpt"-"!:\system\apps\scummvm\sky.cpt" -"..\..\..\..\dists\engine-data\igor.tbl"-"!:\system\apps\scummvm\igor.tbl" "..\..\..\..\dists\engine-data\lure.dat"-"!:\system\apps\scummvm\lure.dat" "..\..\..\..\dists\engine-data\drascula.dat"-"!:\system\apps\scummvm\drascula.dat" diff --git a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg index 4c86c9d29d..d1f716f9fb 100644 --- a/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg +++ b/backends/platform/symbian/S60v3/scummvm-CVS-SymbianS60v3.pkg @@ -59,7 +59,6 @@ ; Common datafiles needed for some games "..\..\..\..\dists\engine-data\kyra.dat"-"c:\data\scummvm\kyra.dat" "..\..\..\..\dists\engine-data\sky.cpt"-"c:\data\scummvm\sky.cpt" -"..\..\..\..\dists\engine-data\igor.tbl"-"c:\data\scummvm\igor.tbl" "..\..\..\..\dists\engine-data\lure.dat"-"c:\data\scummvm\lure.dat" "..\..\..\..\dists\engine-data\drascula.dat"-"c:\data\scummvm\drascula.dat" "..\..\..\..\dists\engine-data\m4.dat"-"c:\data\scummvm\m4.dat" diff --git a/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg b/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg index c6b3e6f82f..131854a4d1 100644 --- a/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg +++ b/backends/platform/symbian/S80/scummvm-CVS-SymbianS80.pkg @@ -51,7 +51,6 @@ ; Common datafiles needed for some games "..\..\..\..\dists\engine-data\kyra.dat"-"!:\system\apps\scummvm\kyra.dat" "..\..\..\..\dists\engine-data\sky.cpt"-"!:\system\apps\scummvm\sky.cpt" -"..\..\..\..\dists\engine-data\igor.tbl"-"!:\system\apps\scummvm\igor.tbl" "..\..\..\..\dists\engine-data\lure.dat"-"!:\system\apps\scummvm\lure.dat" "..\..\..\..\dists\engine-data\drascula.dat"-"!:\system\apps\scummvm\drascula.dat" diff --git a/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg b/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg index b578019979..17f194f3b1 100644 --- a/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg +++ b/backends/platform/symbian/S90/scummvm-CVS-SymbianS90.pkg @@ -51,7 +51,6 @@ ; Common datafiles needed for some games "..\..\..\..\dists\engine-data\kyra.dat"-"!:\system\apps\scummvm\kyra.dat" "..\..\..\..\dists\engine-data\sky.cpt"-"!:\system\apps\scummvm\sky.cpt" -"..\..\..\..\dists\engine-data\igor.tbl"-"!:\system\apps\scummvm\igor.tbl" "..\..\..\..\dists\engine-data\lure.dat"-"!:\system\apps\scummvm\lure.dat" "..\..\..\..\dists\engine-data\drascula.dat"-"!:\system\apps\scummvm\drascula.dat" diff --git a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg index a500e92529..d7b2c7a227 100644 --- a/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg +++ b/backends/platform/symbian/UIQ3/scummvm-CVS-SymbianUIQ3.pkg @@ -57,7 +57,6 @@ ; Common datafiles needed for some games "..\..\..\..\dists\engine-data\kyra.dat"-"c:\shared\scummvm\kyra.dat" "..\..\..\..\dists\engine-data\sky.cpt"-"c:\shared\scummvm\sky.cpt" -"..\..\..\..\dists\engine-data\igor.tbl"-"c:\shared\scummvm\igor.tbl" "..\..\..\..\dists\engine-data\lure.dat"-"c:\shared\scummvm\lure.dat" "..\..\..\..\dists\engine-data\drascula.dat"-"c:\shared\scummvm\drascula.dat" "..\..\..\..\dists\engine-data\m4.dat"-"c:\shared\scummvm\m4.dat" diff --git a/backends/platform/symbian/mmp/scummvm_igor.mmp.in b/backends/platform/symbian/mmp/scummvm_igor.mmp.in deleted file mode 100644 index 196a5ecf3c..0000000000 --- a/backends/platform/symbian/mmp/scummvm_igor.mmp.in +++ /dev/null @@ -1,56 +0,0 @@ -/* ScummVM - Scumm Interpreter
- * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
- * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
- * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
- * Copyright (C) 2005-2007 The ScummVM project
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-//
-// EPOC MMP makefile project for ScummVM
-//
-
-// *** Definitions
-
-TARGET scummvm_igor.lib
-TARGETTYPE lib
-OPTION MSVC /QIfist /Ob1 /Oy /GF // /QIfist disables use of __ftol2 to avoid linker probs with MS libc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/vcrefQIfistSuppress_ftol.asp
-OPTION GCC -Wno-multichar -Wno-reorder // don't optimize for ARM, platform way too sensitive for that :( just turn off some common warnings
-OPTION GCCE -Wno-multichar -Wno-reorder -fsigned-char
-ALWAYS_BUILD_AS_ARM
-
-//START_AUTO_MACROS_SLAVE//
-
- // empty base file, will be updated by Perl build scripts
-
-//STOP_AUTO_MACROS_SLAVE//
-
-// *** SOURCE files
-
-SOURCEPATH ..\..\..\..\engines\igor
-
-//START_AUTO_OBJECTS_IGOR_//
-
- // empty base file, will be updated by Perl build scripts
-
-//STOP_AUTO_OBJECTS_IGOR_//
-
-// *** Include paths
-
-USERINCLUDE ..\..\..\..\engines
-USERINCLUDE ..\..\..\.. ..\..\..\..\common ..\..\..\..\gui ..\..\..\..\sound ..\src
-SYSTEMINCLUDE \epoc32\include \epoc32\include\libc ..\src
diff --git a/backends/platform/wince/Makefile b/backends/platform/wince/Makefile index 49101dcb27..8c70879482 100644 --- a/backends/platform/wince/Makefile +++ b/backends/platform/wince/Makefile @@ -43,7 +43,6 @@ ENABLE_TINSEL = STATIC_PLUGIN ENABLE_CRUISE = STATIC_PLUGIN ENABLE_MADE = STATIC_PLUGIN #ENABLE_SCI = STATIC_PLUGIN -#ENABLE_IGOR = STATIC_PLUGIN #ENABLE_M4 = STATIC_PLUGIN ######################################################################## diff --git a/base/plugins.cpp b/base/plugins.cpp index 215942fffc..c7688b42a3 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -115,9 +115,6 @@ public: #if PLUGIN_ENABLED_STATIC(GROOVIE) LINK_PLUGIN(GROOVIE) #endif - #if PLUGIN_ENABLED_STATIC(IGOR) - LINK_PLUGIN(IGOR) - #endif #if PLUGIN_ENABLED_STATIC(KYRA) LINK_PLUGIN(KYRA) #endif @@ -88,7 +88,6 @@ add_engine drascula "Drascula: The Vampire Strikes Back" yes add_engine gob "Gobli*ns" yes add_engine groovie "Groovie" yes "groovie2" add_engine groovie2 "Groovie 2 games" no -add_engine igor "Igor: Objective Uikokahonia" no add_engine kyra "Legend of Kyrandia" yes "lol" add_engine lol "Lands of Lore" no add_engine lure "Lure of the Temptress" yes diff --git a/dists/engine-data/igor.tbl b/dists/engine-data/igor.tbl Binary files differdeleted file mode 100644 index 351462c5ac..0000000000 --- a/dists/engine-data/igor.tbl +++ /dev/null diff --git a/engines/engines.mk b/engines/engines.mk index 485dd73f20..35be7f1252 100644 --- a/engines/engines.mk +++ b/engines/engines.mk @@ -60,11 +60,6 @@ DEFINES += -DENABLE_GROOVIE2 endif endif -ifdef ENABLE_IGOR -DEFINES += -DENABLE_IGOR=$(ENABLE_IGOR) -MODULES += engines/igor -endif - ifdef ENABLE_KYRA DEFINES += -DENABLE_KYRA=$(ENABLE_KYRA) MODULES += engines/kyra diff --git a/engines/igor/detection.cpp b/engines/igor/detection.cpp deleted file mode 100644 index c33dc12e96..0000000000 --- a/engines/igor/detection.cpp +++ /dev/null @@ -1,147 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "base/plugins.h" - -#include "engines/advancedDetector.h" -#include "common/config-manager.h" - -#include "igor/igor.h" - -struct IgorGameDescription { - ADGameDescription desc; - int gameVersion; - int gameFlags; -}; - -using Common::GUIO_NONE; - -static const IgorGameDescription igorGameDescriptions[] = { - { - { - "igor", - "Demo 1.00s", - { - { "IGOR.DAT", 0, 0, 4086790 }, - { "IGOR.FSD", 0, 0, 462564 }, - { 0, 0, 0, 0 } - }, - Common::EN_ANY, - Common::kPlatformPC, - ADGF_DEMO, - GUIO_NONE - }, - Igor::kIdEngDemo100, - Igor::kFlagDemo | Igor::kFlagFloppy - }, - { - { - "igor", - "Demo 1.10s", - { - { "IGOR.DAT", 0, 0, 4094103 }, - { "IGOR.FSD", 0, 0, 462564 }, - { 0, 0, 0, 0 } - }, - Common::EN_ANY, - Common::kPlatformPC, - ADGF_DEMO, - GUIO_NONE - }, - Igor::kIdEngDemo110, - Igor::kFlagDemo | Igor::kFlagFloppy - }, - { - { - "igor", - "Talkie", - { - { "IGOR.EXE", 0, 0, 9115648 }, - { "IGOR.DAT", 0, 0, 61682719 }, - { 0, 0, 0, 0 } - }, - Common::ES_ESP, - Common::kPlatformPC, - ADGF_NO_FLAGS, - GUIO_NONE - }, - Igor::kIdSpaCD, - Igor::kFlagTalkie - }, - { AD_TABLE_END_MARKER, 0, 0 } -}; - -static const PlainGameDescriptor igorGameDescriptors[] = { - { "igor", "Igor: Objective Uikokahonia" }, - { 0, 0 } -}; - -static const ADParams igorDetectionParams = { - (const byte *)igorGameDescriptions, - sizeof(IgorGameDescription), - 1024, // number of md5 bytes - igorGameDescriptors, - 0, - "igor", - 0, - 0, - // Additional GUI options (for every game} - Common::GUIO_NONE -}; - -class IgorMetaEngine : public AdvancedMetaEngine { -public: - IgorMetaEngine() : AdvancedMetaEngine(igorDetectionParams) {} - - virtual const char *getName() const { - return "Igor: Objective Uikokahonia"; - } - - virtual const char *getOriginalCopyright() const { - return "Igor: Objective Uikokahonia (C) Pendulo Studios"; - } - - virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const; -}; - -bool IgorMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const { - const IgorGameDescription *gd = (const IgorGameDescription *)desc; - if (gd) { - Igor::DetectedGameVersion dgv; - dgv.version = gd->gameVersion; - dgv.flags = gd->gameFlags; - dgv.language = gd->desc.language; - dgv.ovlFileName = gd->desc.filesDescriptions[0].fileName; - dgv.sfxFileName = gd->desc.filesDescriptions[1].fileName; - *engine = new Igor::IgorEngine(syst, &dgv); - } - return gd != 0; -} - -#if PLUGIN_ENABLED_DYNAMIC(IGOR) - REGISTER_PLUGIN_DYNAMIC(IGOR, PLUGIN_TYPE_ENGINE, IgorMetaEngine); -#else - REGISTER_PLUGIN_STATIC(IGOR, PLUGIN_TYPE_ENGINE, IgorMetaEngine); -#endif diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp deleted file mode 100644 index 2811df88a2..0000000000 --- a/engines/igor/igor.cpp +++ /dev/null @@ -1,3084 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "common/config-manager.h" -#include "common/events.h" -#include "common/system.h" - -#include "graphics/cursorman.h" - -#include "sound/voc.h" - -#include "igor/igor.h" -#include "igor/midi.h" - -namespace Igor { - -IgorEngine::IgorEngine(OSystem *system, const DetectedGameVersion *dgv) - : Engine(system), _game(*dgv) { - - _screenVGA = (uint8 *)malloc(320 * 200); - for (int i = 0; i < 4; ++i) { - _facingIgorFrames[i] = (uint8 *)malloc(13500); - } - _screenLayer1 = (uint8 *)malloc(320 * 144); - _screenLayer2 = (uint8 *)malloc(320 * 144); - _screenTextLayer = (uint8 *)malloc(320 * 144); - _screenTempLayer = (uint8 *)malloc(9996); - _igorHeadFrames = (uint8 *)malloc(3696); - _animFramesBuffer = (uint8 *)malloc(65535); - _inventoryPanelBuffer = (uint8 *)malloc(9600 * 2); - _inventoryImagesBuffer = (uint8 *)malloc(48000); - _verbsPanelBuffer = (uint8 *)malloc(3840); - - Common::addDebugChannel(kDebugEngine, "Engine", "Engine debug level"); - Common::addDebugChannel(kDebugResource, "Resource", "Resource debug level"); - Common::addDebugChannel(kDebugScreen, "Screen", "Screen debug level"); - Common::addDebugChannel(kDebugWalk, "Walk", "Walk debug level"); - Common::addDebugChannel(kDebugGame, "Game", "Game debug level"); - - if (_game.flags & kFlagFloppy) { - _midiPlayer = new MidiPlayer(this); - } else { - _midiPlayer = 0; - } -} - -IgorEngine::~IgorEngine() { - free(_resourceEntries); - free(_soundOffsets); - free(_screenVGA); - for (int i = 0; i < 4; ++i) { - free(_facingIgorFrames[i]); - } - free(_screenLayer1); - free(_screenLayer2); - free(_screenTextLayer); - free(_screenTempLayer); - free(_igorHeadFrames); - free(_animFramesBuffer); - free(_inventoryPanelBuffer); - free(_inventoryImagesBuffer); - free(_verbsPanelBuffer); - - Common::clearAllDebugChannels(); - - delete _midiPlayer; -} - -void IgorEngine::restart() { - _screenVGAVOffset = 0; - - memset(&_gameState, 0, sizeof(_gameState)); - _nextTimer = 0; - _fastMode = false; - _language = 0; - - memset(_walkData, 0, sizeof(_walkData)); - _walkCurrentPos = 0; - _walkDataLastIndex = _walkDataCurrentIndex = 0; - _walkCurrentFrame = 0; - _walkDataCurrentPosX = _walkDataCurrentPosY = 0; - _walkToObjectPosX = _walkToObjectPosY = 0; - - memset(&_currentAction, 0, sizeof(_currentAction)); - _currentAction.verb = kVerbWalk; - _actionCode = 0; - _actionWalkPoint = 0; - memset(_inputVars, 0, sizeof(_inputVars)); - _musicData = 0; - - _talkDelay = _talkSpeechCounter = _talkDelayCounter = 0; - memset(_dialogueTextsTable, 0, sizeof(_dialogueTextsTable)); - _dialogueTextsStart = 0; - _dialogueTextsCount = 0; - _dialogueDirtyRectY = 0; - _dialogueDirtyRectSize = 0; - memset(_dialogueQuestions, 0, sizeof(_dialogueQuestions)); - memset(_dialogueReplies, 0, sizeof(_dialogueReplies)); - _dialogueEnded = false; - _dialogueChoiceSelected = 0; - memset(_dialogueInfo, 0, sizeof(_dialogueInfo)); - - memset(_objectsState, 0, sizeof(_objectsState)); - memcpy(_inventoryImages, INVENTORY_IMG_INIT, 36); - memset(_inventoryInfo, 0, sizeof(_inventoryInfo)); - memset(_verbPrepositions, 0, sizeof(_verbPrepositions)); - memset(_globalObjectNames, 0, sizeof(_globalObjectNames)); - memset(_globalDialogueTexts, 0, sizeof(_globalDialogueTexts)); - memset(_verbsName, 0, sizeof(_verbsName)); - memset(_roomObjectNames, 0, sizeof(_roomObjectNames)); - - _igorTempFrames = _facingIgorFrames[0] + 10500; - - memset(_roomObjectAreasTable, 0, sizeof(_roomObjectAreasTable)); - memset(_roomActionsTable, 0, sizeof(_roomActionsTable)); - _executeMainAction = 0; - _executeRoomAction = 0; - _previousMusic = 0; - _musicData = 0; - _actionCode = 0; - _actionWalkPoint = 0; - memset(_inputVars, 0, sizeof(_inputVars)); - _scrollInventory = false; - _roomCursorOn = true; - _currentCursor = 0; - _dialogueCursorOn = true; - _updateDialogue = 0; - _updateRoomBackground = 0; - - _resourceEntriesCount = 0; - _resourceEntries = 0; - _soundOffsetsCount = 0; - _soundOffsets = 0; - - _demoActionsCounter = 0; - - _gameTicks = 0; -} - -Common::Error IgorEngine::run() { - initGraphics(320, 200, false); - _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume")); - - restart(); - setupDefaultPalette(); - _currentPart = ConfMan.getInt("boot_param"); - if (_currentPart == 0) { - _currentPart = kStartupPart; - } - if (!_ovlFile.open(_game.ovlFileName)) { - error("Unable to open '%s'", _game.ovlFileName); - } - if (!_sndFile.open(_game.sfxFileName)) { - error("Unable to open '%s'", _game.sfxFileName); - } - readTableFile(); - loadMainTexts(); - loadIgorFrames(); - _gameState.talkMode = kTalkModeTextOnly; - _gameState.talkSpeed = 3; - _talkSpeechCounter = 5; - _eventQuitGame = false; - PART_MAIN(); - _ovlFile.close(); - _sndFile.close(); - return Common::kNoError; -} - -void IgorEngine::readTableFile() { - Common::File tblFile; - uint32 stringsEntriesOffset = 0, resourcesEntriesOffset = 0, soundEntriesOffset = 0; - if (tblFile.open("IGOR.TBL") && tblFile.readUint32BE() == MKID_BE('ITBL') && tblFile.readUint32BE() == 4) { - stringsEntriesOffset = tblFile.readUint32BE(); - uint32 borlandOverlaySize = _ovlFile.size(); - int gameVersionsCount = tblFile.readByte(); - for (int i = 0; i < gameVersionsCount; ++i) { - uint32 size = tblFile.readUint32BE(); - if (size == borlandOverlaySize) { - resourcesEntriesOffset = tblFile.readUint32BE(); - soundEntriesOffset = tblFile.readUint32BE(); - break; - } - tblFile.skip(8); - } - } - if (resourcesEntriesOffset != 0 && soundEntriesOffset != 0) { - tblFile.seek(resourcesEntriesOffset); - _resourceEntriesCount = tblFile.readUint16BE(); - _resourceEntries = (ResourceEntry *)malloc(sizeof(ResourceEntry) * _resourceEntriesCount); - for (int i = 0; i < _resourceEntriesCount; ++i) { - _resourceEntries[i].id = tblFile.readUint16BE(); - _resourceEntries[i].offs = tblFile.readUint32BE(); - _resourceEntries[i].size = tblFile.readUint32BE(); - } - tblFile.seek(soundEntriesOffset); - _soundOffsetsCount = tblFile.readUint16BE(); - _soundOffsets = (uint32 *)malloc(sizeof(uint32) * _soundOffsetsCount); - for (int i = 0; i < _soundOffsetsCount; ++i) { - _soundOffsets[i] = tblFile.readUint32BE(); - } - tblFile.seek(stringsEntriesOffset); - int stringsCount = tblFile.readUint16BE(); - for (int i = 0; i < stringsCount; ++i) { - int id = tblFile.readUint16BE(); - int lang = tblFile.readByte(); - int len = tblFile.readByte(); - bool skipString = (lang == 1 && _game.language != Common::EN_ANY) || (lang == 2 && _game.language != Common::ES_ESP); - if (skipString) { - tblFile.skip(len); - } else { - char buf[256]; - tblFile.read(buf, len); - buf[len] = 0; - _stringEntries.push_back(StringEntry(id, buf)); - } - } - return; - } - error("Unable to read 'IGOR.TBL'"); -} - -const char *IgorEngine::getString(int id) const { - const char *str = 0; - for (Common::Array<StringEntry>::const_iterator it = _stringEntries.begin(); it != _stringEntries.end(); ++it) { - if ((*it).id == id) { - str = (*it).str.c_str(); - break; - } - } - return str; -} - -void IgorEngine::waitForTimer(int ticks) { - _system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset); - _system->updateScreen(); - uint32 endTicks = (ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay; - do { - Common::Event ev; - while (_eventMan->pollEvent(ev)) { - switch (ev.type) { - case Common::EVENT_QUIT: - _inputVars[kInputEscape] = 1; - _currentPart = kInvalidPart; - _eventQuitGame = true; - break; - case Common::EVENT_KEYDOWN: - if (ev.kbd.keycode == Common::KEYCODE_ESCAPE) { - _inputVars[kInputEscape] = 1; - } else if (ev.kbd.keycode == Common::KEYCODE_SPACE) { - _inputVars[kInputOptions] = 1; - } else if (ev.kbd.keycode == Common::KEYCODE_p) { - _inputVars[kInputPause] = 1; - } else if (ev.kbd.keycode == Common::KEYCODE_F11) { - sprintf(_saveStateDescriptions[kQuickSaveSlot], "Quicksave part %d", _currentPart); - saveGameState(kQuickSaveSlot); - } else if (ev.kbd.keycode == Common::KEYCODE_F12) { - loadGameState(kQuickSaveSlot); - } - break; - case Common::EVENT_MOUSEMOVE: - _inputVars[kInputCursorXPos] = ev.mouse.x; - _inputVars[kInputCursorYPos] = ev.mouse.y; - break; - case Common::EVENT_RBUTTONDOWN: - _inputVars[kInputSkipDialogue] = 1; - break; - case Common::EVENT_LBUTTONDOWN: - _inputVars[kInputClick] = 1; - _inputVars[kInputCursorXPos] = ev.mouse.x; - _inputVars[kInputCursorYPos] = ev.mouse.y; - break; - default: - break; - } - } - _system->delayMillis(10); - if (_system->getMillis() >= endTicks) { - break; - } - } while (!_fastMode); - _nextTimer = _system->getMillis() + kTimerTicksCount * 1000 / kTickDelay; - if (ticks != -1) { - return; - } - _gameTicks += kTimerTicksCount; - if ((_gameTicks & 31) == 0) { - setCursor(_currentCursor); - _currentCursor = (_currentCursor + 1) & 3; - } - if (_game.flags & kFlagFloppy) { - updateMusic(); - } - if (_gameTicks == 64) { - _gameTicks = 0; - } -} - -void IgorEngine::copyArea(uint8 *dst, int dstOffset, int dstPitch, const uint8 *src, int srcPitch, int w, int h, bool transparent) { - uint8 *p = dst + dstOffset; - for (int y = 0; y < h; ++y) { - if (transparent) { - for (int x = 0; x < w; ++x) { - if (src[x] != 0) { - p[x] = src[x]; - } - } - } else { - memcpy(p, src, w); - } - p += dstPitch; - src += srcPitch; - } -} - -int IgorEngine::getRandomNumber(int m) { - assert(m > 0); - return _rnd.getRandomNumber(m - 1); -} - -void IgorEngine::startMusic(int cmf) { - _midiPlayer->stopMusic(); - free(_musicData); - int musicDataSize; - _musicData = loadData(cmf, 0, &musicDataSize); - _midiPlayer->playMusic(_musicData, musicDataSize); -} - -void IgorEngine::playMusic(int num) { - debugC(9, kDebugEngine, "playMusic() %d", num); - if (_game.flags & kFlagFloppy) { - static const int cmf[] = { 0, 0, CMF_2_1, CMF_3, CMF_4, 0, 0, CMF_7_1, CMF_8, CMF_9, CMF_10, CMF_11, CMF_12 }; - assert(num < ARRAYSIZE(cmf) && cmf[num] != 0); - _gameState.musicNum = num; - _gameState.musicSequenceIndex = 1; - startMusic(cmf[num]); - } else { - // TODO: play CD track - } -} - -void IgorEngine::updateMusic() { - static const int cmf2Seq[] = { CMF_2_1, CMF_2_2, CMF_2_3, CMF_2_4 }; - static const int cmf7Seq[] = { CMF_7_1, CMF_7_2, CMF_7_3, CMF_7_4 }; - if (_gameState.jumpToNextMusic && 0) { // TODO: enable - switch (_gameState.musicNum) { - case 2: - _gameState.musicSequenceIndex = getRandomNumber(4) + 1; - startMusic(cmf2Seq[_gameState.musicSequenceIndex - 1]); -// _timerHandler0x1CCounter = 5; - break; - case 7: - if (_gameState.musicSequenceIndex == 4) { - _gameState.musicSequenceIndex = 1; - } else { - ++_gameState.musicSequenceIndex; - } - startMusic(cmf7Seq[_gameState.musicSequenceIndex - 1]); -// _timerHandler0x1CCounter = 5; - break; - case 3: - case 4: - case 8: - case 9: - case 10: -// _timerHandler0x1CCounter = 50; - break; - case 11: -// _timerHandler0x1CCounter = 5; - break; - } - } -} - -void IgorEngine::playSound(int num, int type) { - debugC(9, kDebugEngine, "playSound() %d", num); - --num; - int soundOffset = -1; - Audio::Mixer::SoundType soundType; - Audio::SoundHandle *soundHandle = 0; - if (type == 1) { - if (_mixer->isSoundHandleActive(_sfxHandle)) { - return; - } - assert(num >= 0 && num < _soundOffsetsCount); - soundOffset = _soundOffsets[num]; - soundType = Audio::Mixer::kSFXSoundType; - soundHandle = &_sfxHandle; - } else if (type == 0 && (_game.flags & kFlagTalkie) != 0 && num != kNoSpeechSound) { - if (_mixer->isSoundHandleActive(_speechHandle)) { - _mixer->stopHandle(_speechHandle); - } - num += 100; - assert(num >= 0 && num < _soundOffsetsCount); - soundOffset = _soundOffsets[num]; - soundType = Audio::Mixer::kSpeechSoundType; - soundHandle = &_speechHandle; - } else { - return; - } - _sndFile.seek(soundOffset); - Audio::AudioStream *stream = Audio::makeVOCStream(_sndFile, Audio::Mixer::FLAG_UNSIGNED); - if (stream) { - _mixer->playInputStream(soundType, soundHandle, stream); - } -} - -void IgorEngine::stopSound() { - _mixer->stopHandle(_sfxHandle); -} - -void IgorEngine::loadIgorFrames() { - loadData(FRM_IgorDirBack, _facingIgorFrames[0]); - loadData(FRM_IgorDirRight, _facingIgorFrames[1]); - loadData(FRM_IgorDirFront, _facingIgorFrames[2]); - loadData(FRM_IgorDirLeft, _facingIgorFrames[3]); - loadData(FRM_IgorHead, _igorHeadFrames); - memcpy(_igorPalette, PAL_IGOR_1, 48); -} - -void IgorEngine::loadIgorFrames2() { - loadData(FRM_IgorDirBack2, _facingIgorFrames[0]); - loadData(FRM_IgorDirRight2, _facingIgorFrames[1]); - loadData(FRM_IgorDirFront2, _facingIgorFrames[2]); - loadData(FRM_IgorDirLeft2, _facingIgorFrames[3]); - loadData(FRM_IgorHead2, _igorHeadFrames); - memcpy(_igorPalette, PAL_IGOR_2, 48); -} - -void IgorEngine::fixDialogueTextPosition(int num, int count, int *x, int *y) { - int textLineWidth = 0; - for (int i = 0; i < count; ++i) { - int w = getStringWidth(_globalDialogueTexts[num + i]); - if (w > textLineWidth) { - textLineWidth = w; - } - } - int textX = *x; - textX += textLineWidth / 2 - 1; - if (textX > 318) { - textX = 317 - textLineWidth; - } else { - textX -= textLineWidth; - } - if (textX < 1) { - textX = textLineWidth / 2 + 1; - } else { - textX += textLineWidth / 2; - } - *x = textX; - - int textY = *y; - textY -= count * 10; - if (textY < 1) { - textY = 1; - } - *y = textY; -} - -void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) { - debugC(9, kDebugEngine, "startCutsceneDialogue() pos %d,%d color %d,%d,%d", x, y, r, g, b); - --_dialogueTextsCount; - int talkX = x; - int talkY = y; - const DialogueText *dt = &_dialogueTextsTable[_dialogueTextsStart]; - fixDialogueTextPosition(dt->num, dt->count, &talkX, &talkY); - _dialogueDirtyRectY = talkY * 320; - _dialogueDirtyRectSize = dt->count * 11 * 320; - assert(_dialogueDirtyRectSize < 320 * 72); - memcpy(_screenTextLayer, _screenVGA + _dialogueDirtyRectY, _dialogueDirtyRectSize); - memcpy(_screenTextLayer + 320 * 72, _screenVGA + _dialogueDirtyRectY, _dialogueDirtyRectSize); - for (int i = 0; i < dt->count; ++i) { - const char *textLine = _globalDialogueTexts[dt->num + i]; - int textLineWidth = getStringWidth(textLine); - int textX = talkX - textLineWidth / 2; - int textY = i * 10; - drawString(_screenTextLayer, textLine, textX, textY, kTalkColor, kTalkShadowColor, kTalkShadowColor); - } - setPaletteColor(kTalkColor, r, g, b); - setPaletteColor(kTalkShadowColor, 0, 0, 0); - if (_gameState.talkMode != kTalkModeSpeechOnly) { - memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer, _dialogueDirtyRectSize); - } - if (_gameState.talkMode == kTalkModeTextOnly) { - _talkDelay = (2 * dt->count) * _talkDelays[_gameState.talkSpeed]; - _talkDelayCounter = 0; - } else { - _talkDelay = -1; - _talkDelayCounter = 0; - } - if (_gameState.talkMode == kTalkModeTextOnly) { - playSound(24, 0); - } - _gameState.dialogueTextRunning = true; - _inputVars[kInputSkipDialogue] = 0; -} - -void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b) { - do { - if (_gameState.dialogueTextRunning && _inputVars[kInputSkipDialogue]) { - _talkDelayCounter = _talkDelay; - _inputVars[kInputSkipDialogue] = 0; - } - if (compareGameTick(19, 32) && _gameState.dialogueTextRunning) { - if (_talkSpeechCounter > 2) { - if (_gameState.talkMode != kTalkModeTextOnly) { - _talkDelayCounter = _talkDelay; - } - if (_talkDelay == _talkDelayCounter) { - if (_updateDialogue) { - (this->*_updateDialogue)(kUpdateDialogueAnimEndOfSentence); - } - memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize); - if (_dialogueTextsCount == 0) { - _gameState.dialogueTextRunning = 0; - } else { - ++_dialogueTextsStart; - if (_gameState.talkMode != kTalkModeTextOnly) { - if (_talkSpeechCounter != -1) { - _talkSpeechCounter = 0; - } else { - _talkSpeechCounter = 5; - startCutsceneDialogue(x, y, r, g, b); - } - } else { - startCutsceneDialogue(x, y, r, g, b); - } - } - } else { - ++_talkDelayCounter; - if (_updateDialogue) { - (this->*_updateDialogue)(kUpdateDialogueAnimMiddleOfSentence); - } - } - } else { - if (_talkSpeechCounter == 2) { - startCutsceneDialogue(x, y, r, g, b); - } - ++_talkSpeechCounter; - } - } - if (_updateRoomBackground) { - (this->*_updateRoomBackground)(); - } - if (_inputVars[kInputEscape]) return; - waitForTimer(); - } while (_gameState.dialogueTextRunning); -} - -void IgorEngine::fixIgorDialogueTextPosition(int num, int count, int *x, int *y) { - WalkData *wd = &_walkData[_walkDataLastIndex - 1]; - *x = wd->x; - *y = wd->y - wd->scaleWidth - 3; - fixDialogueTextPosition(num, count, x, y); -} - -void IgorEngine::startIgorDialogue() { - debugC(9, kDebugEngine, "startIgorDialogue()"); - --_dialogueTextsCount; - int talkX, talkY; - const DialogueText *dt = &_dialogueTextsTable[_dialogueTextsStart]; - fixIgorDialogueTextPosition(dt->num, dt->count, &talkX, &talkY); - _dialogueDirtyRectY = talkY * 320; - _dialogueDirtyRectSize = dt->count * 11 * 320; - assert(_dialogueDirtyRectSize < 320 * 72); - memcpy(_screenTextLayer, _screenVGA + _dialogueDirtyRectY, _dialogueDirtyRectSize); - - if (_currentPart == 690) { - memcpy(_screenTextLayer + 320 * 72, _screenLayer1 + _dialogueDirtyRectY, _dialogueDirtyRectSize); - if (_currentAction.verb == kVerbLook && _currentAction.object1Num == 15) { - memcpy(_screenTextLayer + 320 * 72, _screenVGA + _dialogueDirtyRectY, _dialogueDirtyRectSize); - } - if (_currentAction.verb == kVerbLook && _currentAction.object1Num == 19) { - memcpy(_screenTextLayer + 320 * 72, _screenVGA + _dialogueDirtyRectY, _dialogueDirtyRectSize); - } - } else { - memcpy(_screenTextLayer + 320 * 72, _screenVGA + _dialogueDirtyRectY, _dialogueDirtyRectSize); - } - for (int i = 0; i < dt->count; ++i) { - const char *textLine = _globalDialogueTexts[dt->num + i]; - int textLineWidth = getStringWidth(textLine); - int textX = talkX - textLineWidth / 2; - int textY = i * 10; - drawString(_screenTextLayer, textLine, textX, textY, kTalkColor, kTalkShadowColor, kTalkShadowColor); - } - setPaletteColor(kTalkColor, _dialogueColor[0], _dialogueColor[1], _dialogueColor[2]); - setPaletteColor(kTalkShadowColor, 0, 0, 0); - if (_gameState.talkMode != kTalkModeSpeechOnly) { - memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer, _dialogueDirtyRectSize); - } - if (_gameState.talkMode == kTalkModeTextOnly) { - _talkDelay = (2 * dt->count) * _talkDelays[_gameState.talkSpeed]; - _talkDelayCounter = 0; - } else { - _talkDelay = -1; - _talkDelayCounter = 0; - } - if (_gameState.talkMode == kTalkModeTextOnly) { - playSound(24, 0); - } - _gameState.dialogueTextRunning = true; - _inputVars[kInputSkipDialogue] = 0; -} - -void IgorEngine::waitForEndOfIgorDialogue() { - do { - if (_gameState.dialogueTextRunning && _inputVars[kInputSkipDialogue]) { - _talkDelayCounter = _talkDelay; - _inputVars[kInputSkipDialogue] = 0; - } - if (compareGameTick(19, 32) && _gameState.dialogueTextRunning) { - if (_talkSpeechCounter > 2) { - if (_gameState.talkMode != kTalkModeTextOnly) { - _talkDelayCounter = _talkDelay; - } - if (_talkDelay == _talkDelayCounter) { - animateIgorTalking(0); - memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize); - if (_dialogueTextsCount == 0) { - _gameState.dialogueTextRunning = 0; - } else { - ++_dialogueTextsStart; - if (_gameState.talkMode != kTalkModeTextOnly) { - if (_talkSpeechCounter != -1) { - _talkSpeechCounter = 0; - } else { - _talkSpeechCounter = 5; - startIgorDialogue(); - } - } else { - startIgorDialogue(); - } - } - } else { - animateIgorTalking(getRandomNumber(6)); - ++_talkDelayCounter; - } - } else { - if (_talkSpeechCounter == 2) { - startIgorDialogue(); - } - ++_talkSpeechCounter; - } - } - if (_updateRoomBackground) { - (this->*_updateRoomBackground)(); - } - if (_inputVars[kInputEscape]) return; - waitForTimer(); - } while (_gameState.dialogueTextRunning); -} - -int IgorEngine::getObjectFromInventory(int x) const { - if (x >= 20 && x <= 299) { - int i = (x - 20) / 40 + _inventoryInfo[72]; - if (i <= _inventoryInfo[73]) { - return _inventoryInfo[i - 1]; - } - } - return 0; -} - -static int compareResourceEntry(const void *a, const void *b) { - int id = *(const int *)a; - const ResourceEntry *entry = (const ResourceEntry *)b; - return id - entry->id; -} - -ResourceEntry *IgorEngine::findData(int id) { - ResourceEntry *re = (ResourceEntry *)bsearch(&id, _resourceEntries, _resourceEntriesCount, sizeof(ResourceEntry), compareResourceEntry); - assert(re); - return re; -} - -uint8 *IgorEngine::loadData(int id, uint8 *dst, int *size) { - debugC(9, kDebugResource, "loadData() id %d", id); - ResourceEntry *re = findData(id); - if (!dst) { - dst = (uint8 *)malloc(re->size); - if (!dst) { - error("Unable to allocate %d bytes", re->size); - } - } - _ovlFile.seek(re->offs); - _ovlFile.read(dst, re->size); - if (size) { - *size = re->size; - } - return dst; -} - -static void decodeRoomString(const uint8 *src, char *dst, int sz) { - for (int i = 0; i < sz; ++i) { - uint8 code = *src++; - if ((code >= 0xAE && code <= 0xC7) || (code >= 0xCE && code <= 0xE7)) { - code -= 0x6D; - } else if (code > 0xE7) { - switch (code) { - case 0xE8: - code = 0xA0; - break; - case 0xE9: - code = 0x82; - break; - case 0xEA: - code = 0xA1; - break; - case 0xEB: - code = 0xA2; - break; - case 0xEC: - code = 0xA3; - break; - case 0xED: - code = 0xA4; - break; - case 0xEE: - code = 0xA5; - break; - } - } - *dst++ = (char)code; - } -} - -void IgorEngine::decodeRoomStrings(const uint8 *p, bool skipObjectNames) { - if (!skipObjectNames) { - for (int i = 0; i < 20; ++i) { - _roomObjectNames[i][0] = '\0'; - } - uint8 code = *p++; - int index = -1; - while (code != 0xF6) { - if (code == 0xF4) { - ++index; - } - int len = *p++; - if (len != 0) { - assert(index >= 0); - decodeRoomString(p, _roomObjectNames[index], len); - p += len; - _roomObjectNames[index][len] = '\0'; - debugC(9, kDebugResource, "decodeRoomStrings() _roomObjectNames[%d] '%s'", index, _roomObjectNames[index]); - } - code = *p++; - } - } - for (int i = 200; i < 250; ++i) { - _globalDialogueTexts[i][0] = '\0'; - } - uint8 code = *p++; - int index = 200; - while (code != 0xF6) { - if (code == 0xF4) { - ++index; - } - int len = *p++; - if (len != 0) { - decodeRoomString(p, _globalDialogueTexts[index], len); - p += len; - _globalDialogueTexts[index][len] = '\0'; - debugC(9, kDebugResource, "decodeRoomStrings() _globalDialogueTexts[%d] '%s'", index, _globalDialogueTexts[index]); - } - code = *p++; - } -} - -void IgorEngine::decodeRoomText(const uint8 *p) { - debugC(9, kDebugResource, "decodeRoomText()"); - memcpy(_walkXScaleRoom, p, 320); p += 320; - memcpy(_walkYScaleRoom, p, 432); p += 432; - decodeRoomStrings(p); -} - -void IgorEngine::decodeRoomAreas(const uint8 *p, int count) { - for (int i = 0; i < count; ++i) { - RoomObjectArea *roa = &_roomObjectAreasTable[i]; - roa->area = *p++; - assert((roa->area & 0x80) == 0); - roa->object = *p++; - roa->y1Lum = *p++; - roa->y2Lum = *p++; - roa->deltaLum = *p++; - } -} - -void IgorEngine::decodeRoomMask(const uint8 *p) { - uint8 *dst = _screenLayer2; - int sz = 320 * 144; - while (sz != 0) { - uint8 b = *p++; - int len = READ_LE_UINT16(p); p += 2; - if (len > sz) { - len = sz; - } - memset(dst, b, len); - dst += len; - sz -= len; - } -} - -void IgorEngine::loadRoomData(int pal, int img, int box, int msk, int txt) { - if (pal != 0) { - loadData(pal, _paletteBuffer); - } - if (img != 0) { - loadData(img, _screenLayer1); - } - if (box != 0) { - int sz; - uint8 *p = loadData(box, 0, &sz); - memset(_roomObjectAreasTable, 0, sizeof(_roomObjectAreasTable)); - assert((sz % 5) == 0); - decodeRoomAreas(p, sz / 5); - free(p); - } - if (msk != 0) { - uint8 *p = loadData(msk); - decodeRoomMask(p); - free(p); - } - if (txt != 0) { - uint8 *p = loadData(txt); - decodeRoomText(p); - free(p); - } -} - -void IgorEngine::loadAnimData(const int *anm, int loadOffset) { - if (loadOffset == 0) { - memset(_animFramesBuffer, 0, 65535); - } - while (*anm) { - int dataSize; - loadData(*anm++, &_animFramesBuffer[loadOffset], &dataSize); - loadOffset += dataSize; - } -} - -void IgorEngine::loadActionData(int act) { - if (act != 0) { - assert(findData(act)->size <= 0x2000); - loadData(act, _roomActionsTable); - } -} - -void IgorEngine::loadDialogueData(int dlg) { - uint8 *p = loadData(dlg); - int dialogueDataSize = _roomDataOffsets.dlg.questionsOffset + 164 + 41; - assert(dialogueDataSize <= 500); - memcpy(_gameState.dialogueData, p, dialogueDataSize); - assert(_roomDataOffsets.dlg.questionsSize <= MAX_DIALOGUE_QUESTIONS); - for (int i = 0; i < _roomDataOffsets.dlg.questionsSize; ++i) { - for (int n = 0; n < 2; ++n) { - const uint8 *src = p + _roomDataOffsets.dlg.questionsOffset + (i + 1) * 164 + _language * 82 + (n + 1) * 41; - int len = *src++; - if (len != 0) { - decodeRoomString(src, _dialogueQuestions[i][n], len); - _dialogueQuestions[i][n][len] = '\0'; - debugC(9, kDebugResource, "loadDialogueData() _dialogueQuestions[%d][%d] '%s'", i, n, _dialogueQuestions[i][n]); - } else { - _dialogueQuestions[i][n][0] = '\0'; - } - } - } - assert(_roomDataOffsets.dlg.repliesSize <= MAX_DIALOGUE_REPLIES); - for (int i = 0; i < _roomDataOffsets.dlg.repliesSize; ++i) { - const uint8 *src = p + _roomDataOffsets.dlg.repliesOffset + (i + 1) * 102 + _language * 51; - int len = *src++; - if (len != 0) { - decodeRoomString(src, _dialogueReplies[i], len); - _dialogueReplies[i][len] = '\0'; - debugC(9, kDebugResource, "loadDialogueData() _dialogueReplies[%d] '%s'", i, _dialogueReplies[i]); - } else { - _dialogueReplies[i][0] = '\0'; - } - } - free(p); -} - -static void decodeMainString(const uint8 *src, char *dst) { - int sz = *src - 0x6D; - if (sz != 0) { - ++src; - for (int i = 0; i < sz; ++i) { - uint8 code = src[i] - 0x6D; - dst[i] = (char)code; - } - } - dst[sz] = '\0'; -} - -void IgorEngine::loadMainTexts() { - loadData(IMG_VerbsPanel, _verbsPanelBuffer); - if (_game.version == kIdSpaCD) { - const struct { - int strId; - int x; - } verbTexts[] = { - { STR_Talk, 21 }, - { STR_Take, 67 }, - { STR_Look, 113 }, - { STR_Use, 159 }, - { STR_Open, 205 }, - { STR_Close, 251 }, - { STR_Give, 297 } - }; - for (int i = 0; i < 7; ++i) { - const char *s = getString(verbTexts[i].strId); - int x = verbTexts[i].x - getStringWidth(s) / 2; - drawString(_verbsPanelBuffer, s, x, 0, 0xF2, -1, 0); - } - } - int dataSize; - uint8 *p = loadData(TXT_MainTable, 0, &dataSize); - const uint8 *src = &p[0] + _language * 7; - for (int i = 0; i < 3; ++i, src += 7 * 2) { - decodeMainString(src, _verbPrepositions[i]); - debugC(9, kDebugResource, "loadMainTexts() _verbPrepositions[%d] '%s'", i, _verbPrepositions[i]); - } - src = &p[0x2A] + _language * 31; - for (int i = 0; i < 35; ++i, src += 31 * 2) { - decodeMainString(src, _globalObjectNames[i]); - debugC(9, kDebugResource, "loadMainTexts() _globalObjectNames[%d] '%s'", i, _globalObjectNames[i]); - } - src = &p[0x8BA] + _language * 51; - for (int i = 0; i < 250; ++i, src += 51 * 2) { - decodeMainString(src, _globalDialogueTexts[i]); - debugC(9, kDebugResource, "loadMainTexts() _globalDialogueTexts[%d] '%s'", i, _globalDialogueTexts[i]); - } - src = &p[0x6CA4] + _language * 12; - for (int i = 0; i < 9; ++i, src += 12 * 2) { - decodeMainString(src, _verbsName[i]); - debugC(9, kDebugResource, "loadMainTexts() _verbsName[%d] '%s'", i, _verbsName[i]); - } - free(p); -} - -void IgorEngine::setupDefaultPalette() { - memset(_currentPalette, 0, 255 * 3); - memset(&_currentPalette[255 * 3], 63, 3); - updatePalette(768); -} - -void IgorEngine::updatePalette(int count) { - assert(count <= 768); - uint8 pal[1024]; - for (int j = 0, i = 0; i < count; ++i) { - pal[j++] = (_currentPalette[i] << 2) | (_currentPalette[i] >> 4); - if (((i + 1) % 3) == 0) { - pal[j++] = 0; - } - } - _system->setPalette(pal, 0, count / 3); -} - -void IgorEngine::clearPalette() { - memset(_currentPalette, 0, 768); - updatePalette(768); -} - -void IgorEngine::setPaletteColor(uint8 index, uint8 r, uint8 g, uint8 b) { - uint8 pal[4]; - pal[0] = (r << 2) | (r >> 4); - pal[1] = (g << 2) | (g >> 4); - pal[2] = (b << 2) | (b >> 4); - pal[3] = 0; - _system->setPalette(pal, index, 1); -} - -void IgorEngine::setPaletteRange(int startColor, int endColor) { - debugC(9, kDebugScreen, "setPaletteRange(%d, %d)", startColor, endColor); - assert(endColor - startColor + 1 <= 256); - for (int i = startColor; i <= endColor; ++i) { - setPaletteColor(i, _currentPalette[3 * i], _currentPalette[3 * i + 1], _currentPalette[3 * i + 2]); - } -} - -void IgorEngine::fadeInPalette(int count) { - debugC(9, kDebugScreen, "fadeInPalette(%d)", count); - _system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset); - int m = 66; - do { - m -= 3; - for (int i = 0; i < count; ++i) { - if (_paletteBuffer[i] >= m) { - uint8 color = _currentPalette[i] + 3; - if (color > _paletteBuffer[i]) { - color = _paletteBuffer[i]; - } - _currentPalette[i] = color; - } - } - updatePalette(count); - _system->updateScreen(); - _system->delayMillis(1000 / 60); - } while (m > 0); -} - -void IgorEngine::fadeOutPalette(int count) { - debugC(9, kDebugScreen, "fadeOutPalette(%d)", count); - _system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset); - memcpy(_paletteBuffer, _currentPalette, 768); - int m = 0; - do { - for (int i = 0; i < count; ++i) { - if (_paletteBuffer[i] >= m) { - uint8 color = _currentPalette[i]; - if (color >= 3) { - color -= 3; - } else { - color = 0; - } - _currentPalette[i] = color; - } - } - updatePalette(count); - _system->updateScreen(); - _system->delayMillis(1000 / 60); - m += 3; - } while (m < 66); -} - -void IgorEngine::scrollPalette(int startColor, int endColor) { - debugC(9, kDebugScreen, "scrollPalette(%d, %d)", startColor, endColor); - uint8 c[3]; - memcpy(c, &_currentPalette[startColor * 3], 3); - memmove(&_currentPalette[startColor * 3], &_currentPalette[(startColor + 1) * 3], (endColor - startColor) * 3); - memcpy(&_currentPalette[endColor * 3], c, 3); -} - -void IgorEngine::drawChar(uint8 *dst, int chr, int x, int y, int color1, int color2, int color3) { - dst += y * 320 + x; - for (int j = 0; j < 11; ++j, dst += 320) { - uint32 chrLineMask = _fontData[chr * 11 + j]; - for (int i = 0; i < 9; ++i, chrLineMask >>= 2) { - switch (chrLineMask & 3) { - case 1: - dst[i] = color1; - break; - case 2: - if (color2 != -1) { - dst[i] = color2; - } - break; - case 3: - if (color3 != -1) { - dst[i] = color3; - } - break; - } - } - } -} - -void IgorEngine::drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2, int color3) { - for (; *s; ++s) { - if (*s == ' ') { - x += 5; - } else { - int chr = _fontCharIndex[(uint8)*s]; - if (chr == 99) { - continue; - } - if (x + _fontCharWidth[chr] > 320) { - break; - } - drawChar(dst, chr, x, y, color1, color2, color3); - x += _fontCharWidth[chr]; - } - } -} - -int IgorEngine::getStringWidth(const char *s) const { - int w = 0; - for (; *s; ++s) { - if (*s == ' ') { - w += 5; - } else { - int chr = _fontCharIndex[(uint8)*s]; - if (chr == 99) { - continue; - } - w += _fontCharWidth[chr]; - } - } - return w; -} - -void IgorEngine::drawActionSentence(const char *sentence, uint8 color) { - memset(_screenVGA + 144 * 320, 0, 11 * 320); - int w = getStringWidth(sentence); - int x = (320 - w) / 2; - drawString(_screenVGA, sentence, x, 144, color, 0, 0); -} - -void IgorEngine::formatActionSentence(uint8 color) { - char actionSentence[512]; - if (_currentAction.verb == kVerbWalk && _inputVars[kInputCursorYPos] > 143) { - _currentAction.object1Num = 0; - } - strcpy(actionSentence, _verbsName[_currentAction.verb]); - if (_currentAction.object1Num != 0) { - if (_currentAction.object1Type == kObjectTypeInventory) { - strcat(actionSentence, _globalObjectNames[_currentAction.object1Num]); - } else { - strcat(actionSentence, _roomObjectNames[_currentAction.object1Num]); - } - if (_currentAction.verbType != 0) { - strcat(actionSentence, _verbPrepositions[_currentAction.verbType]); - if (_currentAction.object2Num != 0) { - if (_currentAction.object2Type == kObjectTypeInventory) { - strcat(actionSentence, _globalObjectNames[_currentAction.object2Num]); - } else { - strcat(actionSentence, _roomObjectNames[_currentAction.object2Num]); - } - } - } - } - drawActionSentence(actionSentence, _sentenceColorIndex[color]); -} - -const uint8 *IgorEngine::getAnimFrame(int baseOffset, int tableOffset, int frame) { - const uint8 *src = _animFramesBuffer + baseOffset; - assert(frame >= 1); - int frameOffset = READ_LE_UINT16(src + tableOffset + (frame - 1) * 2); - return src + frameOffset - 1; -} - -void IgorEngine::decodeAnimFrame(const uint8 *src, uint8 *dst, bool preserveText) { - int y = READ_LE_UINT16(src) * 320; src += 2; - int h = READ_LE_UINT16(src); src += 2; - while (h--) { - int w = *src++; - int pos = y; - while (w--) { - pos += *src++; - int len = *src++; - if (len & 0x80) { - uint8 color = *src++; - len = 256 - len; - if (preserveText) { - for (int i = pos; i < pos + len; ++i) { - if (dst[i] != kTalkColor && dst[i] != kTalkShadowColor) { - dst[i] = color; - } - } - } else { - memset(dst + pos, color, len); - } - pos += len; - } else { - if (preserveText) { - for (int i = pos; i < pos + len; ++i) { - if (dst[i] != kTalkColor && dst[i] != kTalkShadowColor) { - dst[i] = src[i - pos]; - } - } - } else { - memcpy(dst + pos, src, len); - } - src += len; - pos += len; - } - } - y += 320; - } -} - -void IgorEngine::copyAnimFrame(int srcOffset, int frame, int frameSize, int w, int h, int dstOffset) { - for (int y = 0; y <= h; ++y) { - memcpy(_screenLayer1 + y * 320 + dstOffset, _animFramesBuffer + frame * frameSize + y * w + srcOffset, w); - } -} - -void IgorEngine::setCursor(int num) { - uint8 cursor[11 * 11]; - memset(cursor, 0, 11 * 11); - const uint8 *mask = &_mouseCursorMask[num * 24]; - for (int i = 0; i < 24; ++i) { - if (mask[i]) { - const int offset = ((int8)_mouseCursorData[i + 24] + 5) * 11 + ((int8)_mouseCursorData[i] + 5); - cursor[offset] = 255; - } - } - CursorMan.replaceCursor(cursor, 11, 11, 5, 5, 0); -} - -void IgorEngine::showCursor() { - debugC(9, kDebugEngine, "showCursor()"); - _roomCursorOn = true; - CursorMan.showMouse(_roomCursorOn); -} - -void IgorEngine::hideCursor() { - debugC(9, kDebugEngine, "hideCursor()"); - _roomCursorOn = false; - CursorMan.showMouse(_roomCursorOn); -} - -void IgorEngine::updateRoomLight(int fl) { - WalkData *wd = &_walkData[_walkDataLastIndex - 1]; - if (wd->scaleHeight != 50 || _gameState.dialogueTextRunning) { - return; - } - int offset = 320 * (wd->y + 1 - wd->scaleWidth); - int x = wd->x - _walkWidthScaleTable[wd->scaleHeight - 1] / 2; - if (x <= 0) { - return; - } - offset += x; - RoomObjectArea *roa; - int color = (fl == 0) ? 196 : 195; - switch (wd->posNum) { - case 2: - roa = &_roomObjectAreasTable[_screenLayer2[offset + 1298]]; - if (wd->y > roa->y1Lum) { - if (wd->y <= roa->y2Lum && _gameState.enableLight == 1) { - color -= roa->deltaLum; - } - _screenVGA[offset + 1298] = color; - } - break; - case 3: - roa = &_roomObjectAreasTable[_screenLayer2[offset + 1293]]; - if (wd->y > roa->y1Lum) { - if (wd->y <= roa->y2Lum && _gameState.enableLight == 1) { - color -= roa->deltaLum; - } - _screenVGA[offset + 1293] = color; - } - color = (fl == 0) ? 196 : 195; - roa = &_roomObjectAreasTable[_screenLayer2[offset + 1296]]; - if (wd->y > roa->y1Lum) { - if (wd->y <= roa->y2Lum && _gameState.enableLight == 1) { - color -= roa->deltaLum; - } - _screenVGA[offset + 1296] = color; - } - break; - case 4: - roa = &_roomObjectAreasTable[_screenLayer2[offset + 1291]]; - if (wd->y > roa->y1Lum) { - if (wd->y <= roa->y2Lum && _gameState.enableLight == 1) { - color -= roa->deltaLum; - } - _screenVGA[offset + 1291] = color; - } - break; - } -} - -void IgorEngine::drawVerbsPanel() { - memcpy(_screenVGA + 320 * 156, _verbsPanelBuffer, 320 * 12); -} - -void IgorEngine::redrawVerb(uint8 verb, bool highlight) { - uint8 verbBitmap[44 * 12]; - if (verb >= 2 && verb <= 8) { - verb -= 2; - for (int i = 0; i <= 11; ++i) { - for (int j = 0; j <= 43; ++j) { - uint8 color = _verbsPanelBuffer[i * 320 + verb * 46 + j]; - if (highlight && color != 0) { - color += 8; - } - verbBitmap[i * 44 + j] = color; - } - } - for (int i = 0; i <= 11; ++i) { - memcpy(_screenVGA + 320 * 156 + verb * 46 + i * 320, verbBitmap + i * 44, 44); - } - } -} - -void IgorEngine::drawInventory(int start, int mode) { - loadData(IMG_InventoryPanel, _inventoryPanelBuffer); - loadData(IMG_Objects, _inventoryImagesBuffer); - int y, i; - int end = start + 6; - int x = 1; - for (y = start; y != end; ++y) { - if (_inventoryInfo[y - 1] == 0) { - for (i = 1; i <= 30; ++i) { - memset(_inventoryPanelBuffer + x * 40 - 20 + (i - 1) * 320, 0, 40); - } - } else { - for (i = 1; i <= 30; ++i) { - int img = _inventoryInfo[y - 1]; - assert(img >= 1); - memcpy(_inventoryPanelBuffer + x * 40 - 20 + i * 320 - 321, _inventoryImagesBuffer + (i - 1) * 40 + (_inventoryImages[img - 1] - 1) * 1200, 40); - } - } - ++x; - } - if (_inventoryInfo[72] == 1) { - // 'hide' scroll up - for (y = 5; y <= 11; ++y) { - for (x = 4; x <= 12; ++x) { - uint8 *p = _inventoryPanelBuffer + y * 320 + x - 321; - if (*p == 0xF2) { - *p = 0xF3; - p = _inventoryPanelBuffer + y * 320 + x + 305 - 321; - *p = 0xF3; - } - } - } - } - if (_inventoryInfo[73] <= _inventoryInfo[72] + 6 || _inventoryInfo[72] >= _inventoryInfo[73] - 6) { - // 'hide' scroll down - for (y = 19; y <= 25; ++y) { - for (x = 4; x <= 12; ++x) { - uint8 *p = _inventoryPanelBuffer + y * 320 + x - 321; - if (*p == 0xF2) { - *p = 0xF3; - p = _inventoryPanelBuffer + y * 320 + x + 305 - 321; - *p = 0xF3; - } - } - } - } - switch (mode) { - case 0: - memcpy(_screenVGA + 54400, _inventoryPanelBuffer, 9600); - _scrollInventory = false; - break; - case 1: - for (y = 0; y <= 11; ++y) { - for (x = 0; x <= 14; ++x) { - uint8 *p = _screenVGA + x + y * 320 + 59520; - if ((*p & 0x80) != 0) { - *p += 8; - p = _screenVGA + x + y * 320 + 59825; - *p += 8; - } - } - } - memmove(_inventoryPanelBuffer + 9600, _inventoryPanelBuffer, 9600); - memcpy(_inventoryPanelBuffer, _screenVGA + 54400, 9600); - _scrollInventoryStartY = 7; - _scrollInventoryEndY = 31; - _scrollInventoryDy = 6; - _scrollInventory = true; - break; - case 2: - for (y = 0; y <= 11; ++y) { - for (x = 0; x <= 14; ++x) { - uint8 *p = _screenVGA + x + y * 320 + 55040; - if ((*p & 0x80) != 0) { - *p += 8; - p = _screenVGA + x + y * 320 + 55345; - *p += 8; - } - } - } - memmove(_inventoryPanelBuffer + 9600, _inventoryPanelBuffer, 9600); - memcpy(_inventoryPanelBuffer + 9600, _screenVGA + 54400, 9600); - _scrollInventoryStartY = 25; - _scrollInventoryEndY = 1; - _scrollInventoryDy = -6; - _scrollInventory = true; - break; - } -} - -void IgorEngine::packInventory() { - for (int i = 1; i <= _inventoryInfo[73]; ++i) { - if (_inventoryImages[i - 1] != 0) { - continue; - } - int count = _inventoryInfo[73] - 1; - for (int index = i; index <= count; ++index) { - _inventoryImages[index - 1] = _inventoryImages[index]; - _inventoryImages[_inventoryImages[index - 1] - 1] = index; - } - _inventoryImages[_inventoryInfo[73] - 1] = 0; - --_inventoryInfo[73]; - } -} - -void IgorEngine::scrollInventory() { - if (_scrollInventoryStartY == _scrollInventoryEndY) { - memcpy(_screenVGA + 54400, _inventoryPanelBuffer + (_scrollInventoryStartY - 1) * 320, 9600); - _scrollInventory = false; - } else { - int offset = 54420; - for (int y = _scrollInventoryStartY; y < _scrollInventoryStartY + 29; ++y) { - memcpy(_screenVGA + offset, _inventoryPanelBuffer + 320 * y - 300, 280); - offset += 320; - } - _scrollInventoryStartY += _scrollInventoryDy; - } -} - -void IgorEngine::addObjectToInventory(int object, int index) { - ++_inventoryInfo[73]; - _inventoryInfo[_inventoryInfo[73] - 1] = object; - _inventoryInfo[index] = _inventoryInfo[73]; - _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7]; - drawInventory(_inventoryInfo[72], 0); - playSound(51, 1); -} - -void IgorEngine::removeObjectFromInventory(int index) { - _inventoryInfo[_inventoryInfo[index] - 1] = 0; - _inventoryInfo[index] = 0; - packInventory(); - if (_inventoryInfo[72] > _inventoryInfo[73]) { - _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7]; - } - drawInventory(_inventoryInfo[72], 0); - playSound(63, 1); -} - -void IgorEngine::executeAction(int action) { - debugC(9, kDebugEngine, "executeAction %d", action); - assert(action < 200); - if (action <= 100) { - (this->*_executeMainAction)(action); - } else { - (this->*_executeRoomAction)(action); - } -} - -void IgorEngine::clearAction() { - redrawVerb(_currentAction.verb, false); - memset(&_currentAction, 0, sizeof(_currentAction)); - _currentAction.verb = kVerbWalk; - _actionCode = 0; - _actionWalkPoint = 0; -} - -void IgorEngine::handleRoomInput() { - if (_inputVars[kInputPause]) { - _inputVars[kInputPause] = 0; - handlePause(); - } - if (_inputVars[kInputOptions]) { - _inputVars[kInputOptions] = 0; - handleOptionsMenu(); - } - if (_inputVars[kInputSkipDialogue] && _gameState.dialogueTextRunning) { - _talkDelayCounter = _talkDelay; - if (_gameState.talkMode != kTalkModeTextOnly && _talkSpeechCounter > 2) { - stopSound(); - _talkSpeechCounter = -1; - } - _inputVars[kInputSkipDialogue] = 0; - } - if (!_roomCursorOn || _gameState.dialogueTextRunning || _scrollInventory) { - return; - } - if (_inputVars[kInputCursorYPos] >= 156 && _inputVars[kInputCursorYPos] <= 167) { - if (_inputVars[kInputClick]) { - int verb = getVerbUnderCursor(_inputVars[kInputCursorXPos]); - if (verb != _currentAction.verb) { - redrawVerb(_currentAction.verb, false); - _currentAction.verb = verb; - redrawVerb(_currentAction.verb, true); - } - // reset action command - memset(&_currentAction, 0, sizeof(_currentAction)); - _currentAction.verb = verb; - _currentAction.verbType = 0; - formatActionSentence(0); - _inputVars[kInputClick] = 0; - } - return; - } - if (_inputVars[kInputCursorYPos] >= 172 && _inputVars[kInputCursorYPos] <= 183 && (_inputVars[kInputCursorXPos] < 15 || _inputVars[kInputCursorXPos] > 304)) { - if (_inputVars[kInputClick]) { - if (_inventoryInfo[72] > 1) { - _inventoryInfo[72] -= 7; - drawInventory(_inventoryInfo[72], 2); - } - _inputVars[kInputClick] = 0; - } - return; - } - if (_inputVars[kInputCursorYPos] >= 186 && _inputVars[kInputCursorYPos] <= 197 && (_inputVars[kInputCursorXPos] < 15 || _inputVars[kInputCursorXPos] > 304)) { - if (_inputVars[kInputClick]) { - if (_inventoryInfo[73] > _inventoryInfo[72] + 6) { - _inventoryInfo[72] += 7; - drawInventory(_inventoryInfo[72], 1); - } - _inputVars[kInputClick] = 0; - } - return; - } - -/* if (_inputVars[kInputClick]) { - if (_gameState.igorMoving) { - _walkDataCurrentPosX = _walkData[_walkDataCurrentIndex - 1].x; - _walkDataCurrentPosY = _walkData[_walkDataCurrentIndex - 1].y; - if (_roomObjectAreasTable[_screenLayer2[_walkDataCurrentPosY * 320 + _walkDataCurrentPosX].area == 0) { - return; - } - _walkDataCurrentPosX = _walkData[_walkDataCurrentIndex + 1].x; - _walkDataCurrentPosY = _walkData[_walkDataCurrentIndex + 1].y; - if (_roomObjectAreasTable[_screenLayer2[_walkDataCurrentPosY * 320 + _walkDataCurrentPosX].area == 0) { - return; - } - } - _inputVars[kInputClick] = 0; - }*/ - - bool actionHovering = !_inputVars[kInputClick]; - _inputVars[kInputClick] = 0; - - if (actionHovering && _actionCode != 0) { - return; - } - - //Action previousAction = _currentAction; - if (_inputVars[kInputCursorYPos] >= 170 && _inputVars[kInputCursorYPos] <= 199) { - int object = getObjectFromInventory(_inputVars[kInputCursorXPos]); - if (_currentAction.verbType == 0) { - _currentAction.object1Num = object; - _currentAction.object1Type = kObjectTypeInventory; - if (_currentAction.verb == kVerbUse && _roomActionsTable[_roomDataOffsets.action.useVerb + 10 + _currentAction.object1Num] != 0) { - formatActionSentence(0); - if (!actionHovering) { - _currentAction.verbType = 1; - } - return; - } - if (_currentAction.verb == kVerbGive && _roomActionsTable[_roomDataOffsets.action.giveVerb + 10 + _currentAction.object1Num] != 0) { - formatActionSentence(0); - if (!actionHovering) { - _currentAction.verbType = 2; - } - return; - } - } else { - _currentAction.object2Num = object; - _currentAction.object2Type = kObjectTypeInventory; - } - } else if (_inputVars[kInputCursorYPos] < 144) { - int area = _screenLayer2[_inputVars[kInputCursorYPos] * 320 + _inputVars[kInputCursorXPos]]; - int object = _roomObjectAreasTable[area].object; - if (_currentAction.verbType == 0) { - _currentAction.object1Num = object; - _currentAction.object1Type = kObjectTypeRoom; - if (_currentAction.verb == kVerbUse && _roomActionsTable[_roomDataOffsets.action.useVerb + 48 + _currentAction.object1Num] != 0) { - formatActionSentence(0); - if (!actionHovering) { - _currentAction.verbType = 1; - } - return; - } - if (_currentAction.verb == kVerbGive && _roomActionsTable[_roomDataOffsets.action.giveVerb + 48 + _currentAction.object1Num] != 0) { - formatActionSentence(0); - if (!actionHovering) { - _currentAction.verbType = 2; - } - return; - } - } else { - _currentAction.object2Num = object; - _currentAction.object2Type = kObjectTypeRoom; - } - } else { - return; - } - - if (_currentAction.verbType == 0) { - if (_currentAction.object1Type == kObjectTypeInventory) { - _actionCode = _inventoryActionsTable[(_currentAction.verb - 1) * 2 + _currentAction.object1Num * 20]; - } else { - _actionCode = _roomActionsTable[_roomDataOffsets.action.defaultVerb + _currentAction.verb * 2 + _currentAction.object1Num * 20]; - } - } - if (_currentAction.verbType == 1) { - int offset = _roomActionsTable[_roomDataOffsets.action.object2 + _currentAction.object2Num + _currentAction.object2Type * 38] * 2; - offset += _roomActionsTable[_roomDataOffsets.action.object1 + _currentAction.object1Num + _currentAction.object1Type * 38] * _roomDataOffsets.action.objectSize; - _actionCode = _roomActionsTable[_roomDataOffsets.action.useVerb + offset]; - } - if (_currentAction.verbType == 2) { - int offset = _roomActionsTable[_roomDataOffsets.action.object2 + _currentAction.object2Num + _currentAction.object2Type * 38] * 2; - offset += _roomActionsTable[_roomDataOffsets.action.object1 + _currentAction.object1Num + _currentAction.object1Type * 38] * _roomDataOffsets.action.objectSize; - _actionCode = _roomActionsTable[_roomDataOffsets.action.giveVerb + offset]; - } - - if (actionHovering) { - formatActionSentence(0); - _currentAction.object2Num = 0; - _actionCode = 0; - return; - } - debugC(9, kDebugEngine, "handleRoomInput() actionCode %d", _actionCode); - if (_actionCode == 0) { - clearAction(); - return; - } - - formatActionSentence(1); - if (_currentAction.verbType == 0) { - if (_currentAction.object1Type == kObjectTypeRoom) { - _actionWalkPoint = _roomActionsTable[_roomDataOffsets.action.defaultVerb + _currentAction.verb * 2 + _currentAction.object1Num * 20 + 1]; - if (_actionWalkPoint > 0) { - if (_currentAction.object1Num == 0) { - // no object selected, just walk - _walkToObjectPosX = _inputVars[kInputCursorXPos]; - _walkToObjectPosY = _inputVars[kInputCursorYPos]; - if (_roomObjectAreasTable[_screenLayer2[_walkToObjectPosY * 320 + _walkToObjectPosX]].area == 0) { - fixWalkPosition(&_walkToObjectPosX, &_walkToObjectPosY); - } - } else { - // walk to object - int offset = READ_LE_UINT16(_roomActionsTable + _roomDataOffsets.obj.walkPoints + _currentAction.object1Num * 2); - _walkToObjectPosX = offset % 320; - _walkToObjectPosY = offset / 320; - debugC(9, kDebugEngine, "handleRoomInput() walkToObject offset %d (0x%X)", offset, _roomDataOffsets.obj.walkPoints); - } - if (_gameState.igorMoving) { - // stop igor at the current position - _walkDataLastIndex = _walkDataCurrentIndex - 1; - _walkDataCurrentPosX = _walkData[_walkDataLastIndex].x; - _walkDataCurrentPosY = _walkData[_walkDataLastIndex].y; - _walkCurrentFrame = _walkData[_walkDataLastIndex].frameNum; - _walkCurrentPos = _walkData[_walkDataLastIndex].posNum; - WalkData::setNextFrame(_walkCurrentPos, _walkCurrentFrame); - } else { - --_walkDataLastIndex; - _walkDataCurrentPosX = _walkData[_walkDataLastIndex].x; - _walkDataCurrentPosY = _walkData[_walkDataLastIndex].y; - _walkCurrentPos = _walkData[_walkDataLastIndex].posNum; - _walkCurrentFrame = 1; - } - if (_walkDataCurrentPosX != _walkToObjectPosX || _walkDataCurrentPosY != _walkToObjectPosY) { - if (_roomDataOffsets.area.boxSize == 0) { - buildWalkPathSimple(_walkDataCurrentPosX, _walkDataCurrentPosY, _walkToObjectPosX, _walkToObjectPosY); - } else { - buildWalkPath(_walkDataCurrentPosX, _walkDataCurrentPosY, _walkToObjectPosX, _walkToObjectPosY); - } - if (_actionWalkPoint != 3) { - _walkCurrentFrame = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - } - if (_actionWalkPoint == 1) { - _walkCurrentPos = _roomActionsTable[_roomDataOffsets.obj.walkFacingPosition + _currentAction.object1Num]; - _walkData[_walkDataLastIndex].posNum = _walkCurrentPos; - } - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - } - return; - } - } - hideCursor(); - executeAction(_actionCode); - if (!_gameState.dialogueTextRunning) { - showCursor(); - } - clearAction(); - return; - } -} - -void IgorEngine::animateIgorTalking(int frame) { - if (getPart() == 4) { - return; - } - if (getPart() == 85) { - PART_85_HELPER_6(frame); - return; - } - WalkData *wd = &_walkData[_walkDataLastIndex - 1]; - int y = (wd->y - wd->scaleWidth + 1) * 320; - int delta = wd->x - _walkWidthScaleTable[wd->scaleHeight - 1] / 2; - if (delta > 0) { - y += delta; - } - for (int yOffset = 0; yOffset < wd->scaleWidth; y += 320, ++yOffset) { - int index = READ_LE_UINT16(_walkScaleTable + 0x6CE + wd->scaleHeight * 2) + yOffset; - uint8 yScale = _walkScaleTable[index]; - if (yScale >= 11) { - continue; - } - for (int x = 0, xOffset = wd->clipSkipX - 1; x < wd->clipWidth; ++x, ++xOffset) { - index = READ_LE_UINT16(_walkScaleTable + 0x734 + _walkWidthScaleTable[wd->scaleHeight - 1] * 2) + xOffset; - uint8 xScale = _walkScaleTable[0x4FC + index]; - if (xScale < 8 || xScale > 21) { - continue; - } - uint8 screenColor = _screenVGA[y + x]; - if (screenColor < kTalkColor || screenColor > kTalkShadowColor) { - int offset = yScale * 14 + frame * 154 + (wd->posNum - 1) * 924 + (xScale - 8); - uint8 srcColor = _igorHeadFrames[offset]; - if (srcColor == 0) { - _screenVGA[y + x] = _screenLayer1[y + x]; - continue; - } - RoomObjectArea *roa = &_roomObjectAreasTable[_screenLayer2[y + x]]; - if (wd->y <= roa->y1Lum) { - _screenVGA[y + x] = _screenLayer1[y + x]; - continue; - } - if (wd->y <= roa->y2Lum && _gameState.enableLight == 1) { - srcColor -= roa->deltaLum; - } - _screenVGA[y + x] = srcColor; - } - } - } -} - -void IgorEngine::handleRoomDialogue() { - if (_gameState.dialogueTextRunning) { - if (_talkDelayCounter == _talkDelay) { - animateIgorTalking(0); - memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize); - if (_dialogueTextsCount == 0) { - _gameState.dialogueTextRunning = false; - showCursor(); - } else { - ++_dialogueTextsStart; - startIgorDialogue(); - } - } else { - animateIgorTalking(getRandomNumber(6)); - ++_talkDelayCounter; - } - } -} - -void IgorEngine::handleRoomIgorWalk() { - if (_walkDataCurrentIndex > _walkDataLastIndex) { - _gameState.igorMoving = false; - _walkDataLastIndex = _walkDataCurrentIndex; - if (_actionCode > 0) { - hideCursor(); - executeAction(_actionCode); - if (!_gameState.dialogueTextRunning) { - showCursor(); - } - clearAction(); - } - } - if (_gameState.igorMoving) { - moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum); - ++_walkDataCurrentIndex; - } -} - -void IgorEngine::handleRoomInventoryScroll() { - if (_scrollInventory) { - scrollInventory(); - } -} - -void IgorEngine::handleRoomLight() { - if (_gameState.dialogueTextRunning || _gameState.igorMoving) { - _gameState.updateLight = false; - } else if (_gameState.updateLight) { - updateRoomLight(0); - _gameState.updateLight = 0; - } else if (getRandomNumber(10) == 0) { - updateRoomLight(1); - _gameState.updateLight = true; - } -} - -void IgorEngine::enterPartLoop() { - if (!_gameState.dialogueTextRunning) { - showCursor(); - } - _gameState.igorMoving = false; - if (_game.version == kIdEngDemo110) { - CHECK_FOR_END_OF_DEMO(); - } -} - -void IgorEngine::leavePartLoop() { - hideCursor(); - SET_EXEC_ACTION_FUNC(1, 0); - _updateRoomBackground = 0; -} - -void IgorEngine::runPartLoop() { - handleRoomInput(); - if (compareGameTick(1, 16)) { - handleRoomIgorWalk(); - } - if (compareGameTick(19, 32)) { - handleRoomDialogue(); - } - if (compareGameTick(4, 8)) { - handleRoomInventoryScroll(); - } - if (compareGameTick(1)) { - handleRoomLight(); - } - if (_updateRoomBackground) { - (this->*_updateRoomBackground)(); - } - waitForTimer(); -} - -int IgorEngine::lookupScale(int xOffset, int yOffset, int h) const { - int index = READ_LE_UINT16(_walkScaleTable + 0x734 + _walkWidthScaleTable[h - 1] * 2); - int offset = _walkScaleTable[0x4FC + index + xOffset]; - index = READ_LE_UINT16(_walkScaleTable + 0x6CE + h * 2); - offset += _walkScaleTable[index + yOffset] * 30; - return offset; -} - -void IgorEngine::moveIgor(int pos, int frame) { - assert(_gameState.enableLight == 1 || _gameState.enableLight == 2); - debugC(9, kDebugWalk, "moveIgorHelper _walkDataCurrentIndex %d pos %d frame %d", _walkDataCurrentIndex, pos, frame); - WalkData *wd = &_walkData[_walkDataCurrentIndex]; - uint8 _walkClipSkipX = wd->clipSkipX; - uint8 _walkHeightScale = wd->scaleHeight; - int16 _walkClipWidth = wd->clipWidth; - uint16 _walkScaleWidth = wd->scaleWidth; - uint8 _walkXPosChanged = wd->xPosChanged; - int16 _walkDxPos = wd->dxPos + 1; - uint8 _walkYPosChanged = wd->yPosChanged; - int16 _walkDyPos = wd->dyPos; - int16 _walkDataCurrentPosX2 = wd->x; - int16 _walkDataCurrentPosY2 = wd->y; - - uint16 _walkDataDrawOffset = (wd->y - wd->scaleWidth + 1) * 320; - - int xPos = _walkWidthScaleTable[wd->scaleHeight - 1] / 2; - if (wd->x > xPos) { - _walkDataDrawOffset += wd->x - xPos; - } - if (_walkXPosChanged != 0) { - _walkDataDrawOffset -= _walkDxPos; - } - if (_walkYPosChanged != 0) { - _walkDataDrawOffset -= _walkDyPos * 320; - } - if (_gameState.enableLight == 2) { - int8 colorLum = _roomObjectAreasTable[_screenLayer2[_walkDataCurrentPosY2 * 320 + _walkDataCurrentPosX2]].y2Lum; - if (_gameState.colorLum != colorLum) { - for (int color = 192 * 3; color <= 207 * 3; ++color) { - int c = _currentPalette[color] + colorLum; - if (c < 1) { - c = 0; - } else if (c > 62) { - c = 63; - } - _currentPalette[color] = c; - } - setPaletteRange(192, 207); - _gameState.colorLum = colorLum; - } - } - uint16 screenIgorDrawOffset = _walkDataDrawOffset; - uint16 igorScaledWidth = _walkDxPos + _walkClipWidth; - uint16 igorScaledHeight = _walkHeightScale + _walkDyPos; - uint16 igorBodyScanLine = 0; - if (_walkYPosChanged != 0) { - for (int i = 1; i <= _walkDyPos; ++i) { - memcpy(_igorTempFrames + igorBodyScanLine * 50, _screenLayer1 + _walkDataDrawOffset, igorScaledWidth); - _walkDataDrawOffset += 320; - ++igorBodyScanLine; - } - } - if (_walkXPosChanged != 0) { - for (int yOffset = 0; yOffset < _walkScaleWidth; ++yOffset) { - assert(_walkDxPos > 0); - assert(igorBodyScanLine * 50 + _walkDxPos <= 3000); - memcpy(_igorTempFrames + igorBodyScanLine * 50, _screenLayer1 + _walkDataDrawOffset, _walkDxPos); - int xOffset = _walkClipSkipX - 1; - for (int i = 0; i < _walkClipWidth; ++i) { - int offset = lookupScale(xOffset, yOffset, _walkHeightScale); - offset += frame * 1500; - uint8 color = _facingIgorFrames[pos - 1][offset]; - if (color != 0) { - assert(_walkDataDrawOffset + _walkDxPos + i >= 0); - int index = _screenLayer2[_walkDataDrawOffset + _walkDxPos + i]; - int yPos = _roomObjectAreasTable[index].y1Lum; - if (wd->y <= yPos) { - _igorTempFrames[igorBodyScanLine * 50 + i + _walkDxPos] = _screenLayer1[_walkDataDrawOffset + _walkDxPos + i]; - } else { - if (_gameState.enableLight == 1 && wd->y <= _roomObjectAreasTable[index].y2Lum) { - color -= _roomObjectAreasTable[index].deltaLum; - } - _igorTempFrames[igorBodyScanLine * 50 + i + _walkDxPos] = color; - } - } else { - _igorTempFrames[igorBodyScanLine * 50 + i + _walkDxPos] = _screenLayer1[_walkDataDrawOffset + _walkDxPos + i]; - } - ++xOffset; - } - _walkDataDrawOffset += 320; - ++igorBodyScanLine; - } - } else { - for (int yOffset = 0; yOffset < _walkScaleWidth; ++yOffset) { - int xOffset = _walkClipSkipX - 1; - for (int i = 0; i < _walkClipWidth; ++i) { - int offset = lookupScale(xOffset, yOffset, _walkHeightScale); - offset += frame * 1500; - uint8 color = _facingIgorFrames[pos - 1][offset]; - if (color != 0) { - assert(_walkDataDrawOffset + i >= 0); - int index = _screenLayer2[_walkDataDrawOffset + i]; - int yPos = _roomObjectAreasTable[index].y1Lum; - if (wd->y <= yPos) { - _igorTempFrames[igorBodyScanLine * 50 + i] = _screenLayer1[_walkDataDrawOffset + i]; - } else { - if (_gameState.enableLight == 1 && wd->y <= _roomObjectAreasTable[index].y2Lum) { - color -= _roomObjectAreasTable[index].deltaLum; - } - _igorTempFrames[igorBodyScanLine * 50 + i] = color; - } - } else { - _igorTempFrames[igorBodyScanLine * 50 + i] = _screenLayer1[_walkDataDrawOffset + i]; - } - ++xOffset; - } - const uint8 *src = _screenLayer1 + _walkDataDrawOffset + _walkClipWidth; - memcpy(_igorTempFrames + igorBodyScanLine * 50 + _walkClipWidth, src, _walkDxPos); - _walkDataDrawOffset += 320; - ++igorBodyScanLine; - } - } - if (_walkYPosChanged == 0) { - for (int i = 1; i <= _walkDyPos; ++i) { - memcpy(_igorTempFrames + igorBodyScanLine * 50, _screenLayer1 + _walkDataDrawOffset, igorScaledWidth); - _walkDataDrawOffset += 320; - ++igorBodyScanLine; - } - } - for (igorBodyScanLine = 0; igorBodyScanLine < igorScaledHeight; ++igorBodyScanLine) { - assert(screenIgorDrawOffset + igorScaledWidth <= 320 * 200); - memcpy(_screenVGA + screenIgorDrawOffset, _igorTempFrames + igorBodyScanLine * 50, igorScaledWidth); - screenIgorDrawOffset += 320; - } -} - -void IgorEngine::buildWalkPathSimple(int srcX, int srcY, int dstX, int dstY) { - debugC(9, kDebugWalk, "IgorEngine::buildWalkPathSimple(%d, %d, %d, %d)", srcX, srcY, dstX, dstY); - if (srcX != dstX || srcY != dstY) { - _walkData[0] = _walkData[_walkDataLastIndex]; - _walkDataLastIndex = 1; - buildWalkPathArea(srcX, srcY, dstX, dstY); - --_walkDataLastIndex; - } -} - -void IgorEngine::getClosestAreaTrianglePoint(int dstArea, int srcArea, int *dstY, int *dstX, int srcY, int srcX) { - int minSqrDist = -1; - assert(dstArea >= 1 && srcArea >= 1); - const uint8 *p = _roomActionsTable + ((dstArea - 1) + (srcArea - 1) * _roomDataOffsets.area.boxSize) * 6; - for (int i = 0; i < 3; ++i) { - const uint16 offset = READ_LE_UINT16(p + i * 2); - const int yPos = offset / 320; - const int xPos = offset % 320; - int y = srcY - yPos; - int x = srcX - xPos; - int sqrDist = y * y + x * x; - if (minSqrDist == -1 || sqrDist < minSqrDist) { - *dstY = yPos; - *dstX = xPos; - minSqrDist = sqrDist; - } - } - debugC(9, kDebugWalk, "getClosestAreaTrianglePoint() sqrDist %d pos %d,%d", minSqrDist, *dstX, *dstY); -} - -void IgorEngine::getClosestAreaTrianglePoint2(int dstArea, int srcArea, int *dstY, int *dstX, int srcY1, int srcX1, int srcY2, int srcX2) { - int minSqrDist = -1; - assert(dstArea >= 1 && srcArea >= 1); - const uint8 *p = _roomActionsTable + ((dstArea - 1) + (srcArea - 1) * _roomDataOffsets.area.boxSize) * 6; - for (int i = 0; i < 3; ++i) { - const uint16 offset = READ_LE_UINT16(p + i * 2); - const int yPos = offset / 320; - const int xPos = offset % 320; - int y1 = srcY1 - yPos; - int x1 = srcX1 - xPos; - int y2 = srcY2 - yPos; - int x2 = srcX2 - xPos; - int sqrDist = y1 * y1 + x1 * x1 + y2 * y2 + x2 * x2; - if (minSqrDist == -1 || sqrDist < minSqrDist) { - *dstY = yPos; - *dstX = xPos; - minSqrDist = sqrDist; - } - } - debugC(9, kDebugWalk, "getClosestAreaTrianglePoint2() sqrDist %d pos %d,%d", minSqrDist, *dstX, *dstY); -} - -void IgorEngine::buildWalkPath(int srcX, int srcY, int dstX, int dstY) { - if (srcX != dstX || srcY != dstY) { - _walkData[0] = _walkData[_walkDataLastIndex]; - _walkDataLastIndex = 1; - int srcArea = _roomObjectAreasTable[_screenLayer2[srcY * 320 + srcX]].area; - int dstArea = _roomObjectAreasTable[_screenLayer2[dstY * 320 + dstX]].area; - debugC(9, kDebugWalk, "srcArea = %d dstArea = %d", srcArea, dstArea); - int currentArea = srcArea; - for (int i = 1; dstArea != currentArea; ++i) { - const int boxOffset = srcArea * _roomDataOffsets.area.boxSrcSize + dstArea * _roomDataOffsets.area.boxDstSize; - int nextArea = _roomActionsTable[boxOffset + i + _roomDataOffsets.area.box]; - debugC(9, kDebugWalk, "nextArea %d (%d,%d,%d)", nextArea, _roomDataOffsets.area.box, _roomDataOffsets.area.boxSrcSize, _roomDataOffsets.area.boxDstSize); - int nextPosX, nextPosY; - if (dstArea != nextArea) { - getClosestAreaTrianglePoint(nextArea, currentArea, &nextPosY, &nextPosX, srcY, srcX); - } else { - getClosestAreaTrianglePoint2(nextArea, currentArea, &nextPosY, &nextPosX, dstY, dstX, srcY, srcX); - } - debugC(9, kDebugWalk, "buildWalkPath() transitionArea = %d next %d,%d pos %d,%d offset 0x%X", nextArea, nextPosX, nextPosY, dstX, dstY, _roomDataOffsets.area.box); - buildWalkPathArea(srcX, srcY, nextPosX, nextPosY); - srcX = nextPosX; - srcY = nextPosY; - currentArea = nextArea; - } - buildWalkPathArea(srcX, srcY, dstX, dstY); - --_walkDataLastIndex; - } - debugC(9, kDebugWalk, "buildWalkPath() end _walkDataLastIndex %d", _walkDataLastIndex); -} - -void IgorEngine::buildWalkPathArea(int srcX, int srcY, int dstX, int dstY) { - if (srcX != dstX || srcY != dstY) { - const int dx = dstX - srcX; - const int dy = dstY - srcY; - debugC(9, kDebugWalk, "buildWalkPathArea() dx = %d dy = %d src %d,%d dst %d,%d", dx, dy, srcX, srcY, dstX, dstY); - assert(_walkDataLastIndex > 0); - if (ABS(dy) * 2 > ABS(dx)) { - if (srcY > dstY) { - buildWalkPathAreaUpDirection(srcX, srcY, dstX, dstY); - } else { - buildWalkPathAreaDownDirection(srcX, srcY, dstX, dstY); - } - } else { - if (srcX < dstX) { - buildWalkPathAreaRightDirection(srcX, srcY, dstX, dstY); - } else { - buildWalkPathAreaLeftDirection(srcX, srcY, dstX, dstY); - } - } - } -} - -static int16 roundReal(float f) { - return (int16)(f + .5); -} - -static int16 truncReal(float f) { - return (int16)f; -} - -int IgorEngine::getVerticalStepsCount(int minX, int minY, int maxX, int maxY) { - debugC(9, kDebugWalk, "getVerticalStepsCount() %d %d %d %d", minX, minY, maxX, maxY); - int curX = 2; - if ((_walkXScaleRoom[minX] != 1 || _walkXScaleRoom[maxX] != 3) && (_walkXScaleRoom[maxX] != 1 || _walkXScaleRoom[minX] != 3)) { - curX = _walkXScaleRoom[minX]; - } - int curY = minY; - int count = 0; - while (1) { - uint8 scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY]; - scale = _walkScaleTable[0x901 + scale]; - if (maxY - curY <= scale) { - break; - } - curY += scale; - ++count; - } - return count; -} - -int IgorEngine::getHorizontalStepsCount(int minX, int minY, int maxX, int maxY) { - uint8 scale, frame = _walkCurrentFrame; - - scale = _walkYScaleRoom[(_walkXScaleRoom[maxX] - 1) * 144 + maxY]; - float r1 = _walkScaleSpeedTable[scale - 1]; - scale = _walkYScaleRoom[(_walkXScaleRoom[minX] - 1) * 144 + minY]; - float r2 = _walkScaleSpeedTable[scale - 1]; - debugC(9, kDebugWalk, "getHorizontalStepsCount() maxX - minX = %d r1 = %f r2 = %f", maxX - minX, r1, r2); - - int16 steps = roundReal((maxX - minX) / ((r1 + r2) / 2.0f)); - int count = 0; - if (steps != 0) { - float r3 = (maxY - minY) / (float)steps; - int curX = minX; - int curY = minY; - float r4 = r3; - while (1) { - scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY]; - uint8 c = _walkScaleTable[0x769 + scale * 8 + frame]; - if (maxX - curX <= c) { - break; - } - curX += c; - curY = minY + truncReal(r4); - if (frame == 8) { - frame = 1; - } else { - ++frame; - } - r4 += r3; - ++count; - } - } - return count; -} - -void IgorEngine::lookupScale(int curX, int curY, uint8 &scale, uint8 &xScale, uint8 &yScale) const { - scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY]; - yScale = _walkScaleTable[0x901 + scale]; - xScale = _walkWidthScaleTable[scale - 1]; -} - -void IgorEngine::buildWalkPathAreaUpDirection(int srcX, int srcY, int dstX, int dstY) { - int _walkCurrentPosLocalVar = _walkCurrentPos; - if (_walkCurrentPos == 3) { - _walkCurrentPos = 1; - _walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1]; - _walkData[_walkDataLastIndex].posNum = (dstX > srcX) ? kFacingPositionRight : kFacingPositionLeft; - _walkData[_walkDataLastIndex].frameNum = 5; - ++_walkDataLastIndex; - } else { - _walkCurrentPos = 1; - } - if (_walkCurrentFrame > 6) { - _walkCurrentFrame -= 6; - } - WalkData *wd; - uint8 scale, xScale, yScale; - float vStepDist, vStepCur; - int curX = srcX; - int curY = srcY; - if (srcX > dstX) { - int vStepsCount = getVerticalStepsCount(dstX, dstY, srcX, srcY); - if (vStepsCount > 0) { - vStepCur = vStepDist = (srcX - dstX) / (float)vStepsCount; - for (int i = 1; i <= vStepsCount; ++i) { - wd = &_walkData[_walkDataLastIndex]; - curX = srcX - truncReal(vStepCur); - lookupScale(curX, curY, scale, xScale, yScale); - curY -= yScale; - lookupScale(curX, curY, scale, xScale, yScale); - wd->setPos(curX, curY, 1, _walkCurrentFrame); - WalkData::setNextFrame(kFacingPositionBack, _walkCurrentFrame); - wd->setScale(scale, scale); - wd->yPosChanged = 0; - wd->dyPos = _walkData[_walkDataLastIndex - 1].y - wd->y; - int x = xScale - xScale / 2 + curX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 0; - wd->dxPos = 0; - } else { - x = curX - xScale / 2; - if (x < 0) { - wd->clipWidth = x + xScale; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 0; - wd->dxPos = _walkData[_walkDataLastIndex - 1].x - wd->x; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 0; - wd->dxPos = _walkData[_walkDataLastIndex - 1].x - wd->x; - } - } - ++_walkDataLastIndex; - vStepCur += vStepDist; - } - } else { - if (_walkCurrentPosLocalVar == 1 && _walkToObjectPosX == dstX && _walkToObjectPosY == dstY) { - _walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1]; - _walkData[_walkDataLastIndex].posNum = 1; - _walkData[_walkDataLastIndex].frameNum = 1; - ++_walkDataLastIndex; - } - } - lookupScale(dstX, dstY, scale, xScale, yScale); - wd = &_walkData[_walkDataLastIndex]; - wd->setPos(dstX, dstY, 1, _walkCurrentFrame); - WalkData::setNextFrame(kFacingPositionBack, _walkCurrentFrame); - wd->setScale(scale, scale); - wd->yPosChanged = 0; - wd->dyPos = _walkData[_walkDataLastIndex - 1].y - wd->y; - int x = xScale - xScale / 2 + dstX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale / 2); - wd->xPosChanged = 0; - wd->dxPos = 0; - } else { - x = dstX - xScale / 2; - if (x < 0) { - wd->clipWidth = xScale + x; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 0; - wd->dxPos = curX - dstX; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 0; - wd->dxPos = curX - dstX; - } - } - ++_walkDataLastIndex; - } else { - int vStepsCount = getVerticalStepsCount(dstX, dstY, srcX, srcY); - if (vStepsCount > 0) { - vStepCur = vStepDist = (dstX - srcX) / (float)vStepsCount; - for (int i = 1; i <= vStepsCount; ++i) { - wd = &_walkData[_walkDataLastIndex]; - curX = srcX + truncReal(vStepCur); - lookupScale(curX, curY, scale, xScale, yScale); - curY -= yScale; - lookupScale(curX, curY, scale, xScale, yScale); - wd->setPos(curX, curY, 1, _walkCurrentFrame); - WalkData::setNextFrame(kFacingPositionBack, _walkCurrentFrame); - lookupScale(curX, curY, scale, xScale, yScale); - wd->setScale(scale, scale); - wd->yPosChanged = 0; - wd->dyPos = _walkData[_walkDataLastIndex - 1].y - wd->y; - int x = xScale - xScale / 2 + curX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 0; - wd->dxPos = wd->x - _walkData[_walkDataLastIndex - 1].x; - } else { - x = curX - xScale / 2; - if (x < 0) { - wd->clipWidth = x + xScale; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 1; - wd->dxPos = 0; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 1; - wd->dxPos = wd->x - _walkData[_walkDataLastIndex - 1].x; - } - } - ++_walkDataLastIndex; - vStepCur += vStepDist; - } - } else { - if (_walkCurrentPosLocalVar == 1 && _walkToObjectPosX == dstX && _walkToObjectPosY == dstY) { - _walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1]; - _walkData[_walkDataLastIndex].posNum = 1; - _walkData[_walkDataLastIndex].frameNum = 1; - ++_walkDataLastIndex; - } - } - lookupScale(dstX, dstY, scale, xScale, yScale); - wd = &_walkData[_walkDataLastIndex]; - wd->setPos(dstX, dstY, 1, _walkCurrentFrame); - WalkData::setNextFrame(kFacingPositionBack, _walkCurrentFrame); - wd->setScale(scale, scale); - wd->yPosChanged = 0; - wd->dyPos = _walkData[_walkDataLastIndex - 1].y - wd->y; - int x = xScale - xScale / 2 + dstX - 1; - if (x > 319) { - wd->clipSkipX = 1; - int16 _dx = x - xScale; - int16 _cx = 319 - _dx; - wd->clipWidth = _cx; - wd->xPosChanged = 0; - wd->dxPos = dstX - curX; - } else { - x = dstX - xScale / 2; - if (x < 0) { - wd->clipWidth = xScale + x; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 1; - wd->dxPos = 0; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 1; - wd->dxPos = dstX - curX; - } - } - ++_walkDataLastIndex; - } -} - -void IgorEngine::buildWalkPathAreaDownDirection(int srcX, int srcY, int dstX, int dstY) { - int _walkCurrentPosLocalVar = _walkCurrentPos; - if (_walkCurrentPos == 1) { - _walkCurrentPos = 3; - _walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1]; - _walkData[_walkDataLastIndex].posNum = (srcX > dstX) ? kFacingPositionLeft : kFacingPositionRight; - _walkData[_walkDataLastIndex].frameNum = 1; - ++_walkDataLastIndex; - } else { - _walkCurrentPos = 3; - } - if (_walkCurrentFrame > 6) { - _walkCurrentFrame -= 6; - } - WalkData *wd; - uint8 scale, xScale, yScale; - float vStepCur, vStepDist; - int curX = srcX; - int curY = srcY; - if (srcX > dstX) { - int vStepsCount = getVerticalStepsCount(srcX, srcY, dstX, dstY); - if (vStepsCount > 0) { - vStepCur = vStepDist = (srcX - dstX) / (float)vStepsCount; - for (int i = 1; i <= vStepsCount; ++i) { - wd = &_walkData[_walkDataLastIndex]; - curX = srcX - truncReal(vStepCur); - lookupScale(curX, curY, scale, xScale, yScale); - curY += yScale; - lookupScale(curX, curY, scale, xScale, yScale); - wd->setPos(curX, curY, 3, _walkCurrentFrame); - WalkData::setNextFrame(kFacingPositionFront, _walkCurrentFrame); - wd->setScale(scale, scale); - wd->yPosChanged = 1; - wd->dyPos = wd->y - _walkData[_walkDataLastIndex - 1].y; - int x = xScale - xScale / 2 + curX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 0; - wd->dxPos = 0; - } else { - x = curX - xScale / 2; - if (x < 0) { - wd->clipWidth = x + xScale; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 0; - wd->dxPos = _walkData[_walkDataLastIndex - 1].x - wd->x; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 0; - wd->dxPos = _walkData[_walkDataLastIndex - 1].x - wd->x; - } - } - ++_walkDataLastIndex; - vStepCur += vStepDist; - } - } else { - if (_walkCurrentPosLocalVar == 3 && _walkToObjectPosX == dstX && _walkToObjectPosY == dstY) { - _walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1]; - _walkData[_walkDataLastIndex].posNum = 3; - _walkData[_walkDataLastIndex].frameNum = 1; - ++_walkDataLastIndex; - } - } - lookupScale(dstX, dstY, scale, xScale, yScale); - wd = &_walkData[_walkDataLastIndex]; - wd->setPos(dstX, dstY, 3, _walkCurrentFrame); - WalkData::setNextFrame(kFacingPositionFront, _walkCurrentFrame); - wd->setScale(scale, scale); - wd->yPosChanged = 1; - wd->dyPos = wd->y - _walkData[_walkDataLastIndex - 1].y; - int x = xScale - xScale / 2 + dstX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 0; - wd->dxPos = 0; - } else { - x = dstX - xScale / 2; - if (x < 0) { - wd->clipWidth = xScale + x; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 0; - wd->dxPos = curX - dstX; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 0; - wd->dxPos = curX - dstX; - } - } - ++_walkDataLastIndex; - } else { - int vStepsCount = getVerticalStepsCount(srcX, srcY, dstX, dstY); - if (vStepsCount > 0) { - vStepCur = vStepDist = (dstX - srcX) / (float)vStepsCount; - for (int i = 1; i <= vStepsCount; ++i) { - wd = &_walkData[_walkDataLastIndex]; - curX = srcX + truncReal(vStepCur); - lookupScale(curX, curY, scale, xScale, yScale); - curY += yScale; - lookupScale(curX, curY, scale, xScale, yScale); - wd->setPos(curX, curY, 3, _walkCurrentFrame); - WalkData::setNextFrame(kFacingPositionFront, _walkCurrentFrame); - wd->setScale(scale, scale); - wd->yPosChanged = 1; - wd->dyPos = wd->y - _walkData[_walkDataLastIndex - 1].y; - int x = xScale - xScale / 2 + curX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 1; - wd->dxPos = wd->x - _walkData[_walkDataLastIndex - 1].x; - } else { - x = curX - xScale / 2; - if (x < 0) { - wd->clipWidth = x + xScale; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 1; - wd->dxPos = 0; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 1; - wd->dxPos = wd->x - _walkData[_walkDataLastIndex - 1].x; - } - } - ++_walkDataLastIndex; - vStepCur += vStepDist; - } - } else { - if (_walkCurrentPosLocalVar == 3 && _walkToObjectPosX == dstX && _walkToObjectPosY == dstY) { - _walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1]; - _walkData[_walkDataLastIndex].posNum = 3; - _walkData[_walkDataLastIndex].frameNum = 1; - ++_walkDataLastIndex; - } - } - lookupScale(dstX, dstY, scale, xScale, yScale); - wd = &_walkData[_walkDataLastIndex]; - wd->setPos(dstX, dstY, 3, _walkCurrentFrame); - WalkData::setNextFrame(kFacingPositionFront, _walkCurrentFrame); - wd->setScale(scale, scale); - wd->yPosChanged = 1; - wd->dyPos = wd->y - _walkData[_walkDataLastIndex - 1].y; - int x = xScale - xScale / 2 + dstX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 1; - wd->dxPos = dstX - curX; - } else { - x = dstX - xScale / 2; - if (x < 0) { - wd->clipWidth = xScale + x; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 1; - wd->dxPos = 0; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 1; - wd->dxPos = dstX - curX; - } - } - ++_walkDataLastIndex; - } -} - -void IgorEngine::buildWalkPathAreaRightDirection(int srcX, int srcY, int dstX, int dstY) { - int _walkCurrentPosLocalVar = _walkCurrentPos; - if (_walkCurrentPos == kFacingPositionLeft) { - _walkCurrentPos = kFacingPositionRight; - _walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1]; - _walkData[_walkDataLastIndex].posNum = (srcY > dstY) ? kFacingPositionBack : kFacingPositionFront; - _walkData[_walkDataLastIndex].frameNum = 5; - ++_walkDataLastIndex; - } else { - _walkCurrentPos = kFacingPositionRight; - } - WalkData *wd; - uint8 scale, xScale, xSkip; - float hStepCur, hStepDist; - int curX = srcX; - int curY = srcY; - if (srcY > dstY) { - int hStepsCount = getHorizontalStepsCount(srcX, dstY, dstX, srcY); - if (hStepsCount > 0) { - hStepCur = hStepDist = (srcY - dstY) / (float)hStepsCount; - for (int i = 1; i <= hStepsCount; ++i) { - wd = &_walkData[_walkDataLastIndex]; - scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY]; - xSkip = _walkScaleTable[0x769 + scale * 8 + _walkCurrentFrame]; - if ((curX + xSkip) >= dstX) { - break; - } - curX += xSkip; - curY = srcY - truncReal(hStepCur); - wd->setPos(curX, curY, 2, _walkCurrentFrame); - scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY]; - xScale = _walkWidthScaleTable[scale - 1]; - wd->setScale(scale, scale); - wd->yPosChanged = 0; - wd->dyPos = _walkData[_walkDataLastIndex - 1].y - wd->y; - int x = xScale - xScale / 2 + curX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 1; - wd->dxPos = xSkip; - } else { - x = x - xScale / 2; - if (x < 0) { - wd->clipWidth = x + xScale; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 1; - wd->dxPos = 0; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 1; - wd->dxPos = xSkip; - } - } - ++_walkDataLastIndex; - hStepCur += hStepDist; - WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame); - } - } else { - if (_walkCurrentPosLocalVar == 2 && _walkToObjectPosX == dstX && _walkToObjectPosY == dstY) { - _walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1]; - _walkData[_walkDataLastIndex].posNum = 2; - _walkData[_walkDataLastIndex].frameNum = 1; - ++_walkDataLastIndex; - } - } - wd = &_walkData[_walkDataLastIndex]; - wd->setPos(dstX, dstY, 2, _walkCurrentFrame); - scale = _walkYScaleRoom[(_walkXScaleRoom[dstX] - 1) * 144 + dstY]; - xScale = _walkWidthScaleTable[scale - 1]; - wd->setScale(scale, scale); - wd->yPosChanged = 0; - wd->dyPos = _walkData[_walkDataLastIndex - 1].y - wd->y; - int x = xScale - xScale / 2 - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 1; - wd->dxPos = dstX - curX; - } else { - x = dstX - xScale / 2; - if (x < 0) { - wd->clipWidth = xScale + x; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 1; - wd->dxPos = 0; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 1; - wd->dxPos = dstX - curX; - } - } - ++_walkDataLastIndex; - WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame); - } else { - int hStepsCount = getHorizontalStepsCount(srcX, srcY, dstX, dstY); - if (hStepsCount > 0) { - hStepCur = hStepDist = (dstY - srcY) / (float)hStepsCount; - for (int i = 1; i <= hStepsCount; ++i) { - wd = &_walkData[_walkDataLastIndex]; - scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY]; - xSkip = _walkScaleTable[0x769 + scale * 8 + _walkCurrentFrame]; - if (curX + xSkip >= dstX) { - break; - } - curX += xSkip; - curY = srcY + truncReal(hStepCur); - _walkData[_walkDataLastIndex].setPos(curX, curY, 2, _walkCurrentFrame); - scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY]; - xScale = _walkWidthScaleTable[scale - 1]; - wd->setScale(scale, scale); - wd->yPosChanged = 1; - wd->dyPos = wd->y - _walkData[_walkDataLastIndex - 1].y; - int x = xScale - xScale / 2 + curX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 1; - wd->dxPos = xSkip; - } else { - x = curX - xScale / 2; - if (x < 0) { - wd->clipWidth = x + xScale; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 1; - wd->dxPos = 0; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 1; - wd->dxPos = xSkip; - } - } - ++_walkDataLastIndex; - hStepCur += hStepDist; - WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame); - } - } else { - if (_walkCurrentPosLocalVar == 2 && _walkToObjectPosX == dstX && _walkToObjectPosY == dstY) { - _walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1]; - _walkData[_walkDataLastIndex].posNum = 2; - _walkData[_walkDataLastIndex].frameNum = 1; - ++_walkDataLastIndex; - } - } - wd = &_walkData[_walkDataLastIndex]; - wd->setPos(dstX, dstY, 2, _walkCurrentFrame); - scale = _walkYScaleRoom[(_walkXScaleRoom[dstX] - 1) * 144 + dstY]; - xScale = _walkWidthScaleTable[scale - 1]; - wd->setScale(scale, scale); - wd->yPosChanged = 1; - wd->dyPos = wd->y - _walkData[_walkDataLastIndex - 1].y; - int x = xScale - xScale / 2 + dstX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 1; - wd->dxPos = dstX - curX; - } else { - x = dstX - xScale / 2; - if (x < 0) { - wd->clipWidth = xScale + x; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 1; - wd->dxPos = 0; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 1; - wd->dxPos = dstX - curX; - } - } - ++_walkDataLastIndex; - WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame); - } -} - -void IgorEngine::buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, int dstY) { - int _walkCurrentPosLocalVar = _walkCurrentPos; - if (_walkCurrentPos == kFacingPositionRight) { - _walkCurrentPos = kFacingPositionLeft; - _walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1]; - _walkData[_walkDataLastIndex].posNum = (srcY > dstY) ? kFacingPositionBack : kFacingPositionFront; - _walkData[_walkDataLastIndex].frameNum = 5; - ++_walkDataLastIndex; - } else { - _walkCurrentPos = kFacingPositionLeft; - } - WalkData *wd; - uint8 scale, xScale, xSkip; - float hStepCur, hStepDist; - int curX = srcX; - int curY = srcY; - if (srcY > dstY) { - int hStepsCount = getHorizontalStepsCount(dstX, dstY, srcX, srcY); - if (hStepsCount > 0) { - hStepCur = hStepDist = (srcY - dstY) / (float)hStepsCount; - for (int i = 1; i <= hStepsCount; ++i) { - wd = &_walkData[_walkDataLastIndex]; - scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY]; - xSkip = _walkScaleTable[0x769 + scale * 8 + _walkCurrentFrame]; - if ((curX - xSkip) <= dstX) { - break; - } - curX -= xSkip; - curY = srcY - truncReal(hStepCur); - wd->setPos(curX, curY, 4, _walkCurrentFrame); - scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY]; - xScale = _walkWidthScaleTable[scale - 1]; - wd->setScale(scale, scale); - wd->yPosChanged = 0; - wd->dyPos = _walkData[_walkDataLastIndex - 1].y - wd->y; - int x = xScale - xScale / 2 + curX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 0; - wd->dxPos = 0; - } else { - x = curX - xScale / 2; - if (x < 0) { - wd->clipWidth = x + xScale; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 0; - wd->dxPos = xSkip; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 0; - wd->dxPos = xSkip; - } - } - ++_walkDataLastIndex; - hStepCur += hStepDist; - WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame); - } - } else { - if (_walkCurrentPosLocalVar == 4 && _walkToObjectPosX == dstX && _walkToObjectPosY == dstY) { - _walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1]; - _walkData[_walkDataLastIndex].posNum = 4; - _walkData[_walkDataLastIndex].frameNum = 1; - ++_walkDataLastIndex; - } - } - wd = &_walkData[_walkDataLastIndex]; - wd->setPos(dstX, dstY, 4, _walkCurrentFrame); - scale = _walkYScaleRoom[(_walkXScaleRoom[dstX] - 1) * 144 + dstY]; - xScale = _walkWidthScaleTable[scale - 1]; - wd->setScale(scale, scale); - wd->yPosChanged = 0; - wd->dyPos = curY - dstY; - int x = xScale - xScale / 2 + dstX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 0; - wd->dxPos = 0; - } else { - x = dstX - xScale / 2; - if (x < 0) { - wd->clipWidth = xScale + x; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 0; - wd->dxPos = curX - dstX; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 0; - wd->dxPos = curX - dstX; - } - } - ++_walkDataLastIndex; - WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame); - } else { - int hStepsCount = getHorizontalStepsCount(dstX, srcY, srcX, dstY); - if (hStepsCount > 0) { - hStepCur = hStepDist = (dstY - srcY) / (float)hStepsCount; - for (int i = 1; i <= hStepsCount; ++i) { - wd = &_walkData[_walkDataLastIndex]; - scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY]; - xSkip = _walkScaleTable[0x769 + scale * 8 + _walkCurrentFrame]; - if (curX - xSkip <= dstX) { - break; - } - curX -= xSkip; - curY = srcY + truncReal(hStepCur); - wd->setPos(curX, curY, 4, _walkCurrentFrame); - scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY]; - xScale = _walkWidthScaleTable[scale - 1]; - wd->setScale(scale, scale); - wd->yPosChanged = 1; - wd->dyPos = wd->y - _walkData[_walkDataLastIndex - 1].y; - int x = xScale - xScale / 2 + curX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 0; - wd->dxPos = 0; - } else { - x = curX - xScale / 2; - if (x < 0) { - wd->clipWidth = x + xScale; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 0; - wd->dxPos = xSkip; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 0; - wd->dxPos = xSkip; - } - } - ++_walkDataLastIndex; - hStepCur += hStepDist; - WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame); - } - } else { - if (_walkCurrentPosLocalVar == 4 && _walkToObjectPosX == dstX && _walkToObjectPosY == dstY) { - _walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1]; - _walkData[_walkDataLastIndex].posNum = 4; - _walkData[_walkDataLastIndex].frameNum = 1; - ++_walkDataLastIndex; - } - } - wd = &_walkData[_walkDataLastIndex]; - wd->setPos(dstX, dstY, 4, _walkCurrentFrame); - scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY]; - xScale = _walkWidthScaleTable[scale - 1]; - wd->setScale(scale, scale); - wd->yPosChanged = 1; - wd->dyPos = curY - dstY; - int x = xScale - xScale / 2 + dstX - 1; - if (x > 319) { - wd->clipSkipX = 1; - wd->clipWidth = 319 - (x - xScale); - wd->xPosChanged = 0; - wd->dxPos = 0; - } else { - x = dstX - xScale / 2; - if (x < 0) { - wd->clipWidth = xScale + x; - wd->clipSkipX = xScale - wd->clipWidth + 1; - wd->xPosChanged = 0; - wd->dxPos = curX - dstX; - } else { - wd->clipWidth = xScale; - wd->clipSkipX = 1; - wd->xPosChanged = 0; - wd->dxPos = curX - dstX; - } - } - ++_walkDataLastIndex; - WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame); - } -} - -void IgorEngine::waitForIgorMove() { - _gameTicks = 0; - do { - if (compareGameTick(1, 16)) { - if (_walkDataCurrentIndex > _walkDataLastIndex) { - _gameState.igorMoving = false; - _walkDataLastIndex = _walkDataCurrentIndex; - } - if (_gameState.igorMoving) { - moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum); - ++_walkDataCurrentIndex; - } - } - if (_updateRoomBackground) { - (this->*_updateRoomBackground)(); - } - waitForTimer(); - } while (_gameState.igorMoving); -} - -void IgorEngine::setRoomWalkBounds(int x1, int y1, int x2, int y2) { - assert(x1 <= x2 && y1 <= y2); - _roomWalkBounds.x1 = x1; - _roomWalkBounds.x2 = x2; - _roomWalkBounds.y1 = y1; - _roomWalkBounds.y2 = y2; -} - -void IgorEngine::fixWalkPosition(int *x, int *y) { - int xPos = *x; - if (xPos < _roomWalkBounds.x1) { - xPos = _roomWalkBounds.x1; - } - if (xPos > _roomWalkBounds.x2) { - xPos = _roomWalkBounds.x2; - } - if (getPart() == 22) { - *x = xPos; - *y = _roomWalkBounds.y1; - return; - } - int yPos = *y; - if (getPart() == 13) { - if (xPos >= 92 && xPos <= 186 && yPos > 127) { - *x = xPos; - *y = 127; - return; - } - if (xPos >= 191 && xPos <= 289 && yPos > 127) { - *x = xPos; - *y = 127; - return; - } - } - // skip areas from top to bottom - while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && yPos < _roomWalkBounds.y2) { - ++yPos; - } - if (getPart() == 17) { - if (yPos != 143 || _roomObjectAreasTable[_screenLayer2[45760 + xPos]].area != 0) { - *x = xPos; - *y = yPos; - return; - } - } - // skip areas from bottom to top - while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && yPos > _roomWalkBounds.y1) { - --yPos; - } - *x = xPos; - *y = yPos; -} - -void IgorEngine::recolorDialogueChoice(int num, bool highlight) { - uint8 *p = _screenVGA + 320 * (11 * num + 135); - for (int i = 0; i < 320 * 11; ++i) { - if (highlight) { - if (p[i] == 240) { - p[i] = 241; - } - } else { - if (p[i] == 241) { - p[i] = 240; - } - } - } -} - -void IgorEngine::handleDialogue(int x, int y, int r, int g, int b) { - _gameState.dialogueStarted = true; - _gameState.dialogueChoiceStart = 1; - _gameState.dialogueChoiceCount = 1; - _dialogueEnded = false; - if (getPart() == 12 && _objectsState[44] == 0) { - _gameState.dialogueData[6] = 1; - dialogueReplyToQuestion(x, y, r, g, b, 40); - } - do { - if (getPart() == 15 && _objectsState[48] == 0) { - _gameState.dialogueData[6] = 0; - } - drawDialogueChoices(); - (this->*_updateDialogue)(kUpdateDialogueAnimStanding); - _dialogueChoiceSelected = selectDialogue(); - if (_dialogueChoiceSelected == 0) { - break; - } else if (_dialogueChoiceSelected == -1) { - return; - } - dialogueAskQuestion(); - dialogueReplyToQuestion(x, y, r, g, b); - int offset = (_dialogueInfo[_dialogueChoiceSelected] - 1) * 6 + (_gameState.dialogueChoiceCount - 1) * 30 + (_gameState.dialogueChoiceStart - 1) * _roomDataOffsets.dlg.matSize; - int code = _gameState.dialogueData[offset + 5]; - if ((code >= 1 && code <= 99) || (getPart() == 15 && code == 1)) { - _gameState.dialogueData[offset] = 0; - if (getPart() == 21 && (code == 60 || code == 70 || code == 80) && _dialogueInfo[0] == 1) { - _gameState.dialogueData[offset + 2] = 4; - } - if (getPart() == 33 && (code == 21 || code == 22 || code == 23) && _dialogueInfo[0] == 1) { - _gameState.dialogueData[offset + 2] = 2; - } - } - debugC(9, kDebugEngine, "handleDialogue() action %d offset %d", _gameState.dialogueData[offset + 2], offset); - switch (_gameState.dialogueData[offset + 2]) { - case 1: - _gameState.dialogueChoiceCount = _gameState.dialogueData[offset + 1]; - ++_gameState.dialogueChoiceStart; - break; - case 2: - _gameState.dialogueChoiceCount = _gameState.dialogueData[offset + 1]; - --_gameState.dialogueChoiceStart; - break; - case 4: - _gameState.dialogueChoiceCount = _gameState.dialogueData[offset + 1]; - _gameState.dialogueChoiceStart -= 2; - break; - case 0: - _dialogueEnded = true; - break; - } - debugC(9, kDebugEngine, "handleDialogue() end %d start %d count %d", _dialogueEnded, _gameState.dialogueChoiceStart, _gameState.dialogueChoiceCount); - } while (!_dialogueEnded); - memset(_screenVGA + 46080, 0, 17920); - drawVerbsPanel(); - drawInventory(_inventoryInfo[72], 0); - _currentAction.verb = kVerbWalk; - _gameState.dialogueStarted = false; -} - -void IgorEngine::drawDialogueChoices() { - memset(_screenVGA + 46080, 0, 56 * 320); - setPaletteColor(240, 0, 0, 0); - _dialogueInfo[0] = 0; - for (int i = 1; i <= 5; ++i) { - _dialogueInfo[i] = 0; - } - for (int i = 1; i <= 5; ++i) { - int offset = (i - 1) * 6 + (_gameState.dialogueChoiceCount - 1) * 30 + (_gameState.dialogueChoiceStart - 1) * _roomDataOffsets.dlg.matSize; - if (_gameState.dialogueData[offset] == 1) { - ++_dialogueInfo[0]; - _dialogueInfo[_dialogueInfo[0]] = i; - int num = _gameState.dialogueData[offset + 3] - 1; - char questionText[128]; - sprintf(questionText, "@%s %s", _dialogueQuestions[num][0], _dialogueQuestions[num][1]); - drawString(_screenVGA, questionText, 0, _dialogueInfo[0] * 11 + 135, 240, 0, 0); - } - debugC(9, kDebugEngine, "drawDialogueChoices() i %d state %d num %d", i, _gameState.dialogueData[offset], _gameState.dialogueData[offset + 3]); - } - setPaletteColor(240, _paletteBuffer[0x2F6 + 1], _paletteBuffer[0x2F6 + 2], _paletteBuffer[0x2F6 + 3]); - setPaletteColor(241, _paletteBuffer[0x2F0 + 1], _paletteBuffer[0x2F0 + 2], _paletteBuffer[0x2F0 + 3]); -} - -int IgorEngine::selectDialogue() { - showCursor(); - int hoveredChoice = 0; - bool end = false; - do { - int currentChoice = (_inputVars[kInputCursorYPos] - 134) / 11; - if (currentChoice < 0) { - currentChoice = 0; - } - - if (currentChoice != hoveredChoice) { - if (hoveredChoice != 0) { - recolorDialogueChoice(hoveredChoice, false); - } - hoveredChoice = currentChoice; - if (hoveredChoice != 0) { - recolorDialogueChoice(hoveredChoice, true); - } - } - if (_inputVars[kInputClick]) { - if (hoveredChoice != 0 && hoveredChoice <= _dialogueInfo[0]) { - end = true; - } - _inputVars[kInputClick] = 0; - } - - waitForTimer(); - } while (!end && !_eventQuitGame); - hideCursor(); - return hoveredChoice; -} - -void IgorEngine::dialogueAskQuestion() { - memset(_screenVGA + 46080, 0, 17920); - int offset = (_dialogueInfo[_dialogueChoiceSelected] - 1) * 6 + (_gameState.dialogueChoiceCount - 1) * 30 + (_gameState.dialogueChoiceStart - 1) * _roomDataOffsets.dlg.matSize; - int num = _gameState.dialogueData[offset + 3] - 1; - if (getPart() == 17) { - num = 5; - } - debugC(9, kDebugEngine, "dialogueAskQuestion() num %d offset %d", num, offset); - strcpy(_globalDialogueTexts[250], _dialogueQuestions[num][0]); - strcpy(_globalDialogueTexts[251], _dialogueQuestions[num][1]); - if (_globalDialogueTexts[251][0]) { - ADD_DIALOGUE_TEXT(250, 2); - } else { - ADD_DIALOGUE_TEXT(250, 1); - } - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); -} - -void IgorEngine::dialogueReplyToQuestion(int x, int y, int r, int g, int b, int reply) { - if (reply == 0) { - int offset = (_dialogueInfo[_dialogueChoiceSelected] - 1) * 6 + (_gameState.dialogueChoiceCount - 1) * 30 + (_gameState.dialogueChoiceStart - 1) * _roomDataOffsets.dlg.matSize; - reply = _gameState.dialogueData[offset + 4]; - debugC(9, kDebugEngine, "dialogueReplyToQuestion() dialogue choice %d reply %d", _dialogueChoiceSelected, reply); - if (reply == 0) { - return; - } - } - int offset = 30 + _roomDataOffsets.dlg.matSize + reply; - int count = _gameState.dialogueData[offset - 1]; - int dialogueIndex = 250; - for (int i = 0; i < count; ++i) { - int num = _gameState.dialogueData[offset] - 1; - int len = _gameState.dialogueData[offset + 1]; - debugC(9, kDebugEngine, "dialogueReplyToQuestion() reply %d %d offset %d", num, len, offset); - ADD_DIALOGUE_TEXT(dialogueIndex, len); - for (int j = 0; j < len; ++j) { - strcpy(_globalDialogueTexts[dialogueIndex], _dialogueReplies[num + j]); - ++dialogueIndex; - } - offset += 2; - } - SET_DIALOGUE_TEXT(1, count); - startCutsceneDialogue(x, y, r, g, b); - waitForEndOfCutsceneDialogue(x, y, r, g, b); -} - -} // namespace Igor diff --git a/engines/igor/igor.h b/engines/igor/igor.h deleted file mode 100644 index 6d2c464efb..0000000000 --- a/engines/igor/igor.h +++ /dev/null @@ -1,985 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#ifndef IGOR_ENGINE_H -#define IGOR_ENGINE_H - -#include "common/array.h" -#include "common/endian.h" -#include "common/file.h" -#include "common/str.h" -#include "common/util.h" - -#include "sound/mixer.h" - -#include "engines/engine.h" - -#include "igor/resource_ids.h" - -namespace Igor { - -enum { - kDebugEngine = 1 << 0, - kDebugResource = 1 << 1, - kDebugScreen = 1 << 2, - kDebugWalk = 1 << 3, - kDebugGame = 1 << 4 -}; - -enum { - kIdEngDemo100, - kIdEngDemo110, - kIdEngFloppy, - kIdSpaFloppy, - kIdEngCD, - kIdSpaCD -}; - -enum { - kFlagDemo = 1 << 0, - kFlagFloppy = 1 << 1, - kFlagTalkie = 1 << 2 -}; - -enum { - kStartupPart = 900, - kInvalidPart = 255, - kSharewarePart = 950, - kTalkColor = 240, - kTalkShadowColor = 241, - kTickDelay = 1193180 / 4096, - kTimerTicksCount = 8, - kQuickSaveSlot = 0, - kMaxSaveStates = 10, - kNoSpeechSound = 999 -}; - -enum { - kLanguageEnglish = 0, - kLanguageSpanish = 1 -}; - -enum { - kTalkModeSpeechOnly = 0, - kTalkModeSpeechAndText = 1, - kTalkModeTextOnly = 2 -}; - -enum Verb { - kVerbWalk = 1, - kVerbTalk, - kVerbTake, - kVerbLook, - kVerbUse, - kVerbOpen, - kVerbClose, - kVerbGive -}; - -enum ObjectType { - kObjectTypeInventory = 1, - kObjectTypeRoom = 2 -}; - -enum FacingPosition { - kFacingPositionBack = 1, - kFacingPositionRight = 2, - kFacingPositionFront = 3, - kFacingPositionLeft = 4 -}; - -enum { - kUpdateDialogueAnimEndOfSentence = 1, - kUpdateDialogueAnimMiddleOfSentence, - kUpdateDialogueAnimStanding -}; - -enum InputVar { - kInputSkipDialogue = 0, - kInputCursorXPos, - kInputCursorYPos, - kInputClick, - kInputEscape, - kInputPause, - kInputOptions, - kInputVarCount -}; - -struct DetectedGameVersion { - int version; - int flags; - Common::Language language; - const char *ovlFileName; - const char *sfxFileName; -}; - -struct DialogueText { - int num; - int count; - int sound; -}; - -struct ResourceEntry { - int id; - uint32 offs; - uint32 size; -}; - -struct StringEntry { - int id; - Common::String str; - - StringEntry() : id(0) {} - StringEntry(int i, const char *s) : id(i), str(s) {} -}; - -struct RoomObjectArea { - uint8 area; - uint8 object; - uint8 y1Lum; - uint8 y2Lum; - uint8 deltaLum; -}; - -struct RoomDataOffsets { - struct { - int box; - int boxSize; - int boxSrcSize; - int boxDstSize; - } area; - struct { - int walkPoints; - int walkFacingPosition; - } obj; - struct { - int defaultVerb; - int useVerb; - int giveVerb; - int object2; - int object1; - int objectSize; - } action; - struct { - int questionsOffset; - int questionsSize; - int repliesOffset; - int repliesSize; - int matSize; - } dlg; -}; - -struct RoomWalkBounds { - int x1, y1; - int x2, y2; -}; - -struct WalkData { - int16 x, y; - uint8 posNum; - uint8 frameNum; - uint8 clipSkipX; - int16 clipWidth; - int16 scaleWidth; - uint8 xPosChanged; - int16 dxPos; - uint8 yPosChanged; - int16 dyPos; - uint8 scaleHeight; - - void setPos(int xPos, int yPos, uint8 facingPos, uint8 frame) { - x = xPos; - y = yPos; - posNum = facingPos; - frameNum = frame; - } - - void setDefaultScale() { - clipSkipX = 1; - clipWidth = 30; - scaleWidth = 50; - xPosChanged = 1; - dxPos = 0; - yPosChanged = 1; - dyPos = 0; - scaleHeight = 50; - } - - void setScale(int w, int h) { - scaleWidth = w; - scaleHeight = h; - } - - static void setNextFrame(uint8 pos, uint8 &frame) { - switch (pos) { - case kFacingPositionBack: - case kFacingPositionFront: - if (frame == 6) { - frame = 1; - } else { - ++frame; - } - break; - case kFacingPositionLeft: - case kFacingPositionRight: - if (frame == 8) { - frame = 1; - } else { - ++frame; - } - break; - } - } -}; - -struct GameStateData { - uint8 enableLight; - int8 colorLum; - int16 counter[5]; - bool igorMoving; - bool dialogueTextRunning; - bool updateLight; - bool unkF; - uint8 unk10; - uint8 unk11; - bool dialogueStarted; - // byte[1] - uint8 dialogueData[500]; - uint8 dialogueChoiceStart; - uint8 dialogueChoiceCount; - // byte[2] - uint8 nextMusicCounter; - bool jumpToNextMusic; - uint8 configSoundEnabled; - uint8 talkSpeed; - uint8 talkMode; - // byte[3] - uint8 musicNum; - uint8 musicSequenceIndex; -}; - -struct Action { - uint8 verb; - uint8 object1Num; - uint8 object1Type; - uint8 verbType; // 1:use,2:give - uint8 object2Num; - uint8 object2Type; -}; - -class TypeSerializer; -class MidiPlayer; - -class IgorEngine: public Engine { -public: - - enum { - MAX_DIALOGUE_TEXTS = 6, - MAX_OBJECT_NAME_LENGTH = 31, - MAX_DIALOGUE_TEXT_LENGTH = 51, - MAX_VERB_NAME_LENGTH = 12, - MAX_ROOM_OBJECT_AREAS = 256, - MAX_DIALOGUE_QUESTIONS = 30, - MAX_DIALOGUE_REPLIES = 70 - }; - - typedef void (IgorEngine::*ExecuteActionProc)(int action); - typedef void (IgorEngine::*UpdateDialogueProc)(int action); - typedef void (IgorEngine::*UpdateRoomBackgroundProc)(); - - IgorEngine(OSystem *system, const DetectedGameVersion *dgv); - virtual ~IgorEngine(); - - // Engine APIs - virtual Common::Error run(); - - void handleOptionsMenu_paintSave(); - bool handleOptionsMenu_handleKeyDownSave(int key); - void handleOptionsMenu_paintLoad(); - bool handleOptionsMenu_handleKeyDownLoad(int key); - void handleOptionsMenu_paintQuit(); - bool handleOptionsMenu_handleKeyDownQuit(int key); - void handleOptionsMenu_paintCtrl(); - bool handleOptionsMenu_handleKeyDownCtrl(int key); - -protected: - - bool compareGameTick(int add, int mod) const { return ((_gameTicks + (add & ~7)) % mod) == 0; } // { return ((_gameTicks + add) % mod) == 0; } - bool compareGameTick(int eq) const { return _gameTicks == (eq & ~7); } // { return _gameTicks == eq; } - int getPart() const { return _currentPart / 10; } - void readTableFile(); - const char *getString(int id) const; - void restart(); - void waitForTimer(int ticks = -1); - void copyArea(uint8 *dst, int dstOffset, int dstPitch, const uint8 *src, int srcPitch, int w, int h, bool transparent = false); - int getRandomNumber(int m); - void handleOptionsMenu(); - void handlePause(); - void startMusic(int cmf); - void playMusic(int num); - void updateMusic(); - void playSound(int num, int type); - void stopSound(); - void loadIgorFrames(); - void loadIgorFrames2(); - void fixDialogueTextPosition(int num, int count, int *x, int *y); - void startCutsceneDialogue(int x, int y, int r, int g, int b); - void waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b); - void fixIgorDialogueTextPosition(int num, int count, int *x, int *y); - void startIgorDialogue(); - void waitForEndOfIgorDialogue(); - int getObjectFromInventory(int x) const; - ResourceEntry *findData(int num); - uint8 *loadData(int num, uint8 *dst = 0, int *size = 0); - void decodeMainText(const uint8 *p); - void decodeRoomStrings(const uint8 *p, bool skipObjectNames = false); - void decodeRoomText(const uint8 *p); - void decodeRoomAreas(const uint8 *p, int count); - void decodeRoomMask(const uint8 *p); - void loadRoomData(int pal, int img, int box, int msk, int txt); - void loadAnimData(const int *anm, int loadOffset = 0); - void loadActionData(int act); - void loadDialogueData(int dlg); - void loadMainTexts(); - void setupDefaultPalette(); - void updatePalette(int count); - void clearPalette(); - void setPaletteColor(uint8 index, uint8 r, uint8 g, uint8 b); - void setPaletteRange(int startColor, int endColor); - void fadeInPalette(int count); - void fadeOutPalette(int count); - void scrollPalette(int startColor, int endColor); - void drawChar(uint8 *dst, int chr, int x, int y, int color1, int color2, int color3); - void drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2 = -1, int color3 = -1); - int getStringWidth(const char *s) const; - void drawActionSentence(const char *sentence, uint8 color); - void formatActionSentence(uint8 color); - const uint8 *getAnimFrame(int baseOffset, int tableOffset, int frame); - void decodeAnimFrame(const uint8 *src, uint8 *dst, bool preserveText = false); - void copyAnimFrame(int srcOffset, int frame, int frameSize, int w, int h, int dstOffset); - void setCursor(int num); - void showCursor(); - void hideCursor(); - void updateRoomLight(int fl); - void drawVerbsPanel(); - void redrawVerb(uint8 verb, bool highlight); - int getVerbUnderCursor(int x) const { return ((x % 46) < 44) ? (kVerbTalk + x / 46) : 0; } - void drawInventory(int start, int mode); - void packInventory(); - void scrollInventory(); - void addObjectToInventory(int object, int index); - void removeObjectFromInventory(int index); - void executeAction(int action); - void clearAction(); - void handleRoomInput(); - void animateIgorTalking(int frame); - void handleRoomDialogue(); - void handleRoomIgorWalk(); - void handleRoomInventoryScroll(); - void handleRoomLight(); - void enterPartLoop(); - void leavePartLoop(); - void runPartLoop(); - int lookupScale(int xOffset, int yOffset, int h) const; - void moveIgor(int pos, int frame); - void buildWalkPathSimple(int srcX, int srcY, int dstX, int dstY); - void getClosestAreaTrianglePoint(int dstArea, int srcArea, int *dstY, int *dstX, int srcY, int srcX); - void getClosestAreaTrianglePoint2(int dstArea, int srcArea, int *dstY, int *dstX, int srcY1, int srcX1, int srcY2, int srcX2); - void buildWalkPath(int srcX, int srcY, int dstX, int dstY); - void buildWalkPathArea(int srcX, int srcY, int dstX, int dstY); - int getVerticalStepsCount(int minX, int minY, int maxX, int maxY); - int getHorizontalStepsCount(int minX, int minY, int maxX, int maxY); - void lookupScale(int curX, int curY, uint8 &scale, uint8 &xScale, uint8 &yScale) const; - void buildWalkPathAreaUpDirection(int srcX, int srcY, int dstX, int dstY); - void buildWalkPathAreaDownDirection(int srcX, int srcY, int dstX, int dstY); - void buildWalkPathAreaRightDirection(int srcX, int srcY, int dstX, int dstY); - void buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, int dstY); - void waitForIgorMove(); - void setRoomWalkBounds(int x1, int y1, int x2, int y2); - void fixWalkPosition(int *x, int *y); - void recolorDialogueChoice(int num, bool highlight); - void handleDialogue(int x, int y, int r, int g, int b); - void drawDialogueChoices(); - int selectDialogue(); - void dialogueAskQuestion(); - void dialogueReplyToQuestion(int x, int y, int r, int g, int b, int reply = 0); - - void saveOrLoadGameState(TypeSerializer &typeSerializer); - Common::Error loadGameState(int slot); - Common::Error saveGameState(int slot); - void generateGameStateFileName(int num, char *dst, int len) const; - - MidiPlayer *_midiPlayer; - - Common::RandomSource _rnd; - - Common::File _ovlFile; - Common::File _sndFile; - - Audio::SoundHandle _sfxHandle; - Audio::SoundHandle _speechHandle; - - uint8 *_screenVGA; - uint8 *_facingIgorFrames[4]; - uint8 *_screenLayer1; - uint8 *_screenLayer2; - uint8 *_screenTextLayer; - uint8 *_screenTempLayer; - uint8 *_igorHeadFrames; - uint8 *_animFramesBuffer; - uint8 *_inventoryPanelBuffer; - uint8 *_inventoryImagesBuffer; - uint8 *_verbsPanelBuffer; - int _screenVGAVOffset; - - bool _eventQuitGame; - GameStateData _gameState; - uint32 _nextTimer; - bool _fastMode; - int _language; - DetectedGameVersion _game; - - WalkData _walkData[100]; - uint8 _walkCurrentPos; - uint8 _walkDataLastIndex; - uint8 _walkDataCurrentIndex; - uint8 _walkCurrentFrame; - int _walkDataCurrentPosX, _walkDataCurrentPosY; - int _walkToObjectPosX, _walkToObjectPosY; - - int16 _currentPart; - int _talkDelay; - int _talkSpeechCounter; - int _talkDelayCounter; - DialogueText _dialogueTextsTable[MAX_DIALOGUE_TEXTS]; - int _dialogueTextsStart; - int _dialogueTextsCount; - int _dialogueDirtyRectY; - int _dialogueDirtyRectSize; - char _dialogueQuestions[MAX_DIALOGUE_QUESTIONS][2][41]; - char _dialogueReplies[MAX_DIALOGUE_REPLIES][51]; - bool _dialogueEnded; - int _dialogueChoiceSelected; - uint8 _dialogueInfo[6]; - - uint8 _objectsState[112]; - uint8 _inventoryImages[36]; - uint8 _inventoryInfo[74]; - char _verbPrepositions[3][7]; - char _globalObjectNames[35][MAX_OBJECT_NAME_LENGTH]; - char _globalDialogueTexts[300][MAX_DIALOGUE_TEXT_LENGTH]; - char _verbsName[9][MAX_VERB_NAME_LENGTH]; - char _roomObjectNames[20][MAX_OBJECT_NAME_LENGTH]; - uint8 _currentPalette[768]; - uint8 _paletteBuffer[768]; - uint8 _igorPalette[48]; - uint8 *_igorTempFrames; - uint8 _walkXScaleRoom[320]; - uint8 _walkYScaleRoom[144 * 3]; - RoomObjectArea _roomObjectAreasTable[MAX_ROOM_OBJECT_AREAS]; - uint8 _roomActionsTable[0x2000]; - ExecuteActionProc _executeMainAction; - ExecuteActionProc _executeRoomAction; - uint8 _previousMusic; - uint8 *_musicData; - Action _currentAction; - uint8 _actionCode; - uint8 _actionWalkPoint; - int16 _inputVars[kInputVarCount]; - bool _scrollInventory; - int _scrollInventoryStartY, _scrollInventoryEndY, _scrollInventoryDy; - bool _roomCursorOn; - int _currentCursor; - bool _dialogueCursorOn; - RoomDataOffsets _roomDataOffsets; - RoomWalkBounds _roomWalkBounds; - UpdateDialogueProc _updateDialogue; - UpdateRoomBackgroundProc _updateRoomBackground; - int _demoActionsCounter; - int _gameTicks; - int _resourceEntriesCount; - ResourceEntry *_resourceEntries; - int _soundOffsetsCount; - uint32 *_soundOffsets; - Common::Array<StringEntry> _stringEntries; - char _saveStateDescriptions[kMaxSaveStates][100]; - - static const uint8 _dialogueColor[]; - static const uint8 _sentenceColorIndex[]; - static const uint8 _fontCharIndex[]; - static const uint8 _fontCharWidth[]; - static const uint32 _fontData[]; - static const uint8 _talkDelays[]; - static const uint8 _inventoryOffsetTable[]; - static const uint8 _inventoryActionsTable[]; - static const uint8 _walkWidthScaleTable[]; - static const float _walkScaleSpeedTable[]; - static const uint8 _walkScaleTable[]; - static const uint8 _mouseCursorMask[]; - static const uint8 _mouseCursorData[]; - - - // - // game logic - // - - // main loop - void ADD_DIALOGUE_TEXT(int num, int count, int sound = kNoSpeechSound); - void SET_DIALOGUE_TEXT(int start, int count); - void SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p); - void EXEC_MAIN_ACTION(int action); - void EXEC_MAIN_ACTION_38(); - void EXEC_MAIN_ACTION_43(); - void EXEC_MAIN_ACTION_54(); - void CHECK_FOR_END_OF_DEMO(); - void SET_PAL_208_96_1(); - void SET_PAL_240_48_1(); - void UPDATE_OBJECT_STATE(int num); - void PART_MEANWHILE(); - void PART_MARGARET_ROOM_CUTSCENE_HELPER_1(); - void PART_MARGARET_ROOM_CUTSCENE_HELPER_2(int frame); - void PART_MARGARET_ROOM_CUTSCENE_UPDATE_DIALOGUE_MARGARET(int action); - void PART_MARGARET_ROOM_CUTSCENE(); - void PART_UPDATE_FIGURES_ON_PAPER(int delay); - void PART_MAIN(); - - // college map - void PART_04_EXEC_ACTION(int action); - void PART_04_CLEAR_OBJECT_STATE_84(int num); - void PART_04(); - - // bridge - void PART_05_EXEC_ACTION(int action); - void PART_05_ACTION_102(); - void PART_05_ACTION_103(); - void PART_05_UPDATE_ROOM_BACKGROUND(); - void PART_05_HELPER_1(); - void PART_05_HELPER_2(); - void PART_05_HELPER_3(int frame); - void PART_05_HELPER_4(int num); - void PART_05_HELPER_5(int frame); - void PART_05_HELPER_6(); - void PART_05(); - - // bridge (rock) - void PART_06_EXEC_ACTION(int action); - void PART_06_ACTION_102(); - void PART_06_ACTION_103(); - void PART_06_ACTION_105(); - void PART_06_ACTION_107(); - void PART_06_ACTION_108(); - void PART_06_UPDATE_DIALOGUE_PHOTOGRAPHER(int action); - void PART_06_HANDLE_DIALOGUE_PHOTOGRAPHER(); - void PART_06_UPDATE_ROOM_BACKGROUND(); - void PART_06_HELPER_1(int frame); - void PART_06_HELPER_2(); - void PART_06_HELPER_3(); - void PART_06_HELPER_6(int num); - void PART_06_HELPER_7(int frame); - void PART_06_HELPER_8(int frame); - void PART_06_HELPER_12(); - void PART_06_HELPER_13(int frame); - void PART_06_HELPER_14(); - void PART_06_HELPER_15(int frame); - void PART_06(); - - // outside church - void PART_12_EXEC_ACTION(int action); - void PART_12_ACTION_101(); - void PART_12_ACTION_104(); - void PART_12_ACTION_105(); - void PART_12_ACTION_108(); - void PART_12_UPDATE_ROOM_BACKGROUND(); - void PART_12_UPDATE_DIALOGUE_CHURCHMAN(int action); - void PART_12_HANDLE_DIALOGUE_CHURCHMAN(); - void PART_12_HELPER_1(int num); - void PART_12_HELPER_2(); - void PART_12_HELPER_3(); - void PART_12_HELPER_4(); - void PART_12_HELPER_5(); - void PART_12_HELPER_6(); - void PART_12_HELPER_8(); - void PART_12_HELPER_9(); - void PART_12_HELPER_10(int frame); - void PART_12(); - - // inside church - void PART_13_EXEC_ACTION(int action); - void PART_13_ACTION_101_103(); - void PART_13_ACTION_104(); - void PART_13_HELPER_1(int num); - void PART_13_HELPER_2(); - void PART_13_HELPER_3(); - void PART_13(); - - // church puzzle - void PART_14_EXEC_ACTION(int action); - void PART_14_UPDATE_ROOM_BACKGROUND_ACTION_108(); - void PART_14_ACTION_101(); - void PART_14_ACTION_103(); - void PART_14_ACTION_105(); - void PART_14_ACTION_106(); - void PART_14_ACTION_108(); - void PART_14_HELPER_1(int num); - void PART_14_HELPER_2(); - void PART_14_HELPER_3(); - void PART_14_HELPER_4(); - void PART_14_HELPER_6(); - void PART_14_HELPER_7(int frame); - void PART_14_HELPER_8(int start, int end); - void PART_14_HELPER_9(); - void PART_14_HELPER_10(); - void PART_14_PUSH_STONE(int screenOffset, int w, int h, int animOffset); - void PART_14(); - void loadResourceData__ROOM_ChurchPuzzle(); - void loadResourceData__ANIM_ChurchPuzzle(); - - // tobias office - void PART_15_EXEC_ACTION(int action); - void PART_15_ACTION_101(); - void PART_15_ACTION_107(); - void PART_15_ACTION_115(); - void PART_15_ACTION_116(); - void PART_15_UPDATE_ROOM_BACKGROUND(); - void PART_15_UPDATE_DIALOGUE_TOBIAS(int action); - void PART_15_HANDLE_DIALOGUE_TOBIAS(); - void PART_15_HELPER_1(int num); - void PART_15_HELPER_2(); - void PART_15_HELPER_3(); - void PART_15_HELPER_5(); - void PART_15_HELPER_6(int frame); - void PART_15_HELPER_7(int frame); - void PART_15_HELPER_8(int frame); - void PART_15_HELPER_9(int frame); - void PART_15_HELPER_10(int frame); - void PART_15(); - - // laboratory - void PART_16_EXEC_ACTION(int action); - void PART_16_ACTION_101(); - void PART_16_UPDATE_DIALOGUE_MARGARET_HARRISON(int action); - void PART_16_UPDATE_DIALOGUE_MARGARET(int action); - void PART_16_HELPER_1(int num); - void PART_16_HELPER_2(); - void PART_16_HELPER_3(); - void PART_16_HELPER_5(); - void PART_16_HELPER_6(int frame); - void PART_16(); - void loadResourceData__ROOM_Laboratory(); - void loadResourceData__ANIM_Laboratory(); - - // outside college - void PART_17_EXEC_ACTION(int action); - void PART_17_ACTION_101(); - void PART_17_ACTION_103(); - void PART_17_ACTION_105(); - void PART_17_ACTION_106(); - void PART_17_HANDLE_DIALOGUE_PHILIP(); - void PART_17_UPDATE_DIALOGUE_PHILIP(int action); - void PART_17_UPDATE_DIALOGUE_PHILIP_JIMMY(int action); - void PART_17_UPDATE_ROOM_BACKGROUND(); - void PART_17_HELPER_1(int num); - void PART_17_HELPER_2(); - void PART_17_HELPER_3(int lum); - void PART_17_HELPER_4(); - void PART_17_HELPER_5(int lum); - void PART_17_HELPER_6(); - void PART_17_HELPER_8(int num); - void PART_17_HELPER_9(int num); - void PART_17_HELPER_10(); - void PART_17_HELPER_11(int frame); - void PART_17(); - - // men toilets - void PART_18_EXEC_ACTION(int action); - void PART_18_ACTION_109(); - void PART_18_ACTION_111(); - void PART_18_HELPER_1(int num); - void PART_18_HELPER_2(); - void PART_18(); - void loadResourceData__ROOM_MenToilets(); - void loadResourceData__ANIM_MenToilets(); - - // women toilets - void PART_19_EXEC_ACTION(int action); - void PART_19_ACTION_107(); - void PART_19_ACTION_109(); - void PART_19_UPDATE_DIALOGUE_WOMEN(int action); - void PART_19_UPDATE_BACKGROUND_HELPER_9(); - void PART_19_HELPER_1(int num); - void PART_19_HELPER_2(); - void PART_19_HELPER_3(); - void PART_19_HELPER_4(); - void PART_19_HELPER_5(); - void PART_19_HELPER_7(int frame); - void PART_19(); - - // college corridor margaret - void PART_21_EXEC_ACTION(int action); - void PART_21_ACTION_101(); - void PART_21_ACTION_102(); - void PART_21_ACTION_107(); - void PART_21_ACTION_108(); - void PART_21_ACTION_110(); - void PART_21_ACTION_111(); - void PART_21_ACTION_113(); - void PART_21_UPDATE_ROOM_BACKGROUND(); - void PART_21_UPDATE_DIALOGUE_MARGARET_1(int action); - void PART_21_UPDATE_DIALOGUE_MARGARET_2(int action); - void PART_21_UPDATE_DIALOGUE_MARGARET_3(int action); - void PART_21_HANDLE_DIALOGUE_MARGARET(); - void PART_21_HELPER_1(int num); - void PART_21_HELPER_2(); - void PART_21_HELPER_3(); - void PART_21_HELPER_4(); - void PART_21_HELPER_6(int frame); - void PART_21_HELPER_7(); - void PART_21_HELPER_8(); - void PART_21_HELPER_9(); - void PART_21_HELPER_10(); - void PART_21_HELPER_11(int frame); - void PART_21(); - - // bell church - void PART_22_EXEC_ACTION(int action); - void PART_22_ACTION_101(); - void PART_22_ACTION_102(); - void PART_22_HELPER_1(int num); - void PART_22_HELPER_2(); - void PART_22(); - - // college corridor lucas - void PART_23_EXEC_ACTION(int action); - void PART_23_ACTION_105(); - void PART_23_ACTION_107(); - void PART_23_ACTION_108(); - void PART_23_UPDATE_ROOM_BACKGROUND(); - void PART_23_HELPER_1(int num); - void PART_23_HELPER_2(int frame); - void PART_23_HELPER_3(); - void PART_23_HELPER_4(); - void PART_23_HELPER_5(); - void PART_23_HELPER_6(); - void PART_23_HELPER_7(int frame); - void PART_23_HELPER_8(int frame); - void PART_23(); - - // college corridor sharon michael - void PART_24_EXEC_ACTION(int action); - void PART_24_ACTION_102(); - void PART_24_ACTION_104(); - void PART_24_ACTION_105(); - void PART_24_ACTION_107(); - void PART_24_UPDATE_ROOM_BACKGROUND(); - void PART_24_HELPER_1(int num); - void PART_24_HELPER_2(int frame); - void PART_24_HELPER_3(int frame); - void PART_24_HELPER_4(); - void PART_24_HELPER_5(); - void PART_24_HELPER_7(); - void PART_24_HELPER_8(); - void PART_24_HELPER_9(); - void PART_24(); - - // college corridor announcement board - void PART_25_EXEC_ACTION(int action); - void PART_25_ACTION_105(); - void PART_25_ACTION_107(); - void PART_25_ACTION_108(); - void PART_25_HELPER_1(int num); - void PART_25_HELPER_2(); - void PART_25_HELPER_3(); - void PART_25_HELPER_4(); - void PART_25_HELPER_5(); - void PART_25_HELPER_7(); - void PART_25(); - - // college corridor miss barrymore - void PART_26_EXEC_ACTION(int action); - void PART_26_ACTION_103(); - void PART_26_ACTION_104(); - void PART_26_ACTION_107(); - void PART_26_UPDATE_ROOM_BACKGROUND(); - void PART_26_HELPER_1(int num); - void PART_26_HELPER_2(); - void PART_26_HELPER_3(); - void PART_26_HELPER_4(); - void PART_26_HELPER_5(); - void PART_26_HELPER_7(int frame); - void PART_26(); - - // college lockers - void PART_27_EXEC_ACTION(int action); - void PART_27_ACTION_106(); - void PART_27_ACTION_107(); - void PART_27_ACTION_108(); - void PART_27_ACTION_110(); - void PART_27_HELPER_1(int num); - void PART_27_HELPER_2(); - void PART_27_HELPER_3(); - void PART_27_HELPER_4(); - void PART_27_HELPER_5(); - void PART_27(); - - // college corridor caroline - void PART_28_EXEC_ACTION(int action); - void PART_28_ACTION_108(); - void PART_28_ACTION_109(); - void PART_28_UPDATE_DIALOGUE_CAROLINE(int action); - void PART_28_UPDATE_ROOM_BACKGROUND(); - void PART_28_HELPER_1(int num); - void PART_28_HELPER_2(); - void PART_28_HELPER_3(); - void PART_28_HELPER_5(int frame); - void PART_28_HELPER_6(); - void PART_28_HELPER_8(int frame); - void PART_28(); - - // college corridor stairs first floor - void PART_30_EXEC_ACTION(int action); - void PART_30_ACTION_102(); - void PART_30_ACTION_104(); - void PART_30_UPDATE_DIALOGUE_LAURA(int action); - void PART_30_HANDLE_DIALOGUE_LAURA(); - void PART_30_HELPER_1(int num); - void PART_30_HELPER_2(); - void PART_30_HELPER_3(); - void PART_30_HELPER_4(); - void PART_30_HELPER_5(); - void PART_30_HELPER_8(); - void PART_30_HELPER_9(int frame); - void PART_30(); - - // college corridor stairs second floor - void PART_31_EXEC_ACTION(int action); - void PART_31_ACTION_102(); - void PART_31_ACTION_103(); - void PART_31_ACTION_106(); - void PART_31_ACTION_110(); - void PART_31_UPDATE_ROOM_BACKGROUND(); - void PART_31_HELPER_1(int num); - void PART_31_HELPER_2(int frame); - void PART_31_HELPER_3(); - void PART_31_HELPER_4(); - void PART_31_HELPER_5(); - void PART_31_HELPER_6(); - void PART_31_HELPER_9(); - void PART_31(); - - // library - void PART_33_EXEC_ACTION(int action); - void PART_33_ACTION_109(); - void PART_33_ACTION_111(); - void PART_33_ACTION_113(); - void PART_33_ACTION_114(); - void PART_33_ACTION_115(); - void PART_33_UPDATE_DIALOGUE_HARRISON_1(int action); - void PART_33_UPDATE_DIALOGUE_HARRISON_2(int action); - void PART_33_UPDATE_DIALOGUE_HARRISON_3(int action); - void PART_33_HANDLE_DIALOGUE_HARRISON(); - void PART_33_UPDATE_ROOM_BACKGROUND(); - void PART_33_HELPER_1(int num); - void PART_33_HELPER_2(); - void PART_33_HELPER_3(); - void PART_33_HELPER_4(int frame); - void PART_33_HELPER_5(int frame); - void PART_33_HELPER_7(); - void PART_33_HELPER_8(int frame); - void PART_33_HELPER_9(); - void PART_33(); - void loadResourceData__ROOM_Library(); - void loadResourceData__ANIM_Library(); - - // chemistry classroom - void PART_36_EXEC_ACTION(int action); - void PART_36_ACTION_102(); - void PART_36_HELPER_1(int num); - void PART_36_HELPER_2(); - void PART_36_HELPER_4(int frame); - void PART_36_HELPER_5(int *x, int *y); - void PART_36(); - - // physics classroom - void PART_37_EXEC_ACTION(int action); - void PART_37_ACTION_102(); - void PART_37_HELPER_1(int num); - void PART_37_HELPER_2(); - void PART_37(); - - // philip vodka cutscene - void PART_75_UPDATE_DIALOGUE_PHILIP(int action); - void PART_75_HELPER_1(int frame); - void PART_75(); - - // introduction cutscene - void PART_85_UPDATE_ROOM_BACKGROUND(); - void PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action); - void PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay); - void PART_85_HELPER_2(); - void PART_85_HELPER_4(); - void PART_85_HELPER_6(int frame); - void PART_85(); - - // startup screens - void PART_90(); - - // shareware screens - void PART_95(); - - - static const uint8 PAL_48_1[]; - static const uint8 PAL_96_1[]; - static const uint8 PAL_IGOR_1[]; - static const uint8 PAL_IGOR_2[]; - static const uint8 INVENTORY_IMG_INIT[]; - static const RoomDataOffsets PART_04_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_05_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_06_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_12_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_13_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_14_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_15_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_16_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_17_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_18_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_19_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_21_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_22_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_23_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_24_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_25_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_26_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_27_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_28_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_30_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_31_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_33_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_36_ROOM_DATA_OFFSETS; - static const RoomDataOffsets PART_37_ROOM_DATA_OFFSETS; -}; - -} // namespace Igor - -#endif diff --git a/engines/igor/menu.cpp b/engines/igor/menu.cpp deleted file mode 100644 index e947b9f198..0000000000 --- a/engines/igor/menu.cpp +++ /dev/null @@ -1,347 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "common/events.h" -#include "common/system.h" - -#include "igor/igor.h" - -namespace Igor { - -static const struct { - int y; - int h; -} buttonsBarCoords[] = { - { 3, 1 }, - { 1, 1 }, - { 2, 2 }, - { 4, 1 }, - { 5, 10 }, - { 6, 1 }, - { 2, 2 }, - { 7, 1 }, - { 8, 93 }, - { 9, 1 }, - { 2, 2 }, - { 3, 1 } -}; - -static void drawButtonsBar(uint8 *dst, const uint8 *src) { - int y0 = 15; - for (int i = 1; i <= 11; ++i) { - int y2 = y0 + buttonsBarCoords[i].h - 1; - if (y0 > y2) { - continue; - } - for (int y1 = y0; y1 <= y2; ++y1) { - memcpy(dst + (y1 - 15) * 320 + 43, src + (buttonsBarCoords[i].y - 1) * 234, 234); - ++y0; - } - } -} - -static void redrawButton(uint8 *dst, int button, bool highlight) { - const int colorDiff = highlight ? 4 : -4; - for (int y = 0; y <= 11; ++y) { - uint8 *p = dst + (y + 3) * 320 + button * 46 + 43 + 3; - for (int x = 0; x <= 43; ++x) { - p[x] += colorDiff; - } - } -} - -enum { - kPageSave = 0, - kPageLoad, - kPageQuit, - kPageCtrl, - kPagePlay -}; - -struct Page { - const char *captions[2]; - int xPos[2]; - void (IgorEngine::*paintProc)(); - bool (IgorEngine::*handleKeyDownProc)(int key); -}; - -static const Page pages[] = { - { - { "SAVE", "Choose a position to SAVE to" }, - { 53, 75 }, - &IgorEngine::handleOptionsMenu_paintSave, - &IgorEngine::handleOptionsMenu_handleKeyDownSave - }, - { - { "LOAD", "Choose a game to load" }, - { 98, 93 }, - &IgorEngine::handleOptionsMenu_paintLoad, - &IgorEngine::handleOptionsMenu_handleKeyDownLoad - }, - { - { "QUIT", "QUIT" }, - { 146, 146 }, - &IgorEngine::handleOptionsMenu_paintQuit, - &IgorEngine::handleOptionsMenu_handleKeyDownQuit - }, - { - { "CTRL", "Game CONTROLS" }, - { 190, 112 }, - &IgorEngine::handleOptionsMenu_paintCtrl, - &IgorEngine::handleOptionsMenu_handleKeyDownCtrl - }, - { - { "PLAY", 0 }, - { 237, 0 }, - 0, - 0 - } -}; - -void IgorEngine::handleOptionsMenu_paintSave() { - drawString(_screenTextLayer, "Not available in shareware version", 60, 70 - 16, 0xF6, -1, 0); -} - -bool IgorEngine::handleOptionsMenu_handleKeyDownSave(int key) { - return true; -} - -void IgorEngine::handleOptionsMenu_paintLoad() { - drawString(_screenTextLayer, "Not available in shareware version", 60, 70 - 16, 0xF6, -1, 0); -} - -bool IgorEngine::handleOptionsMenu_handleKeyDownLoad(int key) { - return true; -} - -void IgorEngine::handleOptionsMenu_paintQuit() { - drawString(_screenTextLayer, "Are you sure?", 120, 64 - 15, 0xF6, -1, 0); - drawString(_screenTextLayer, "(Y/N)", 143, 76 - 15, 0xF6, -1, 0); -} - -bool IgorEngine::handleOptionsMenu_handleKeyDownQuit(int key) { - if (key == Common::KEYCODE_y) { - _currentPart = kInvalidPart; - } - return true; -} - -static void redrawRect(uint8 *dst, int num, bool border) { - const int x = 43 + 6; - const int y = 22 * num; - for (int i = 0; i < 21; ++i) { - memset(dst + (y + i) * 320 + x, 0xF8, 222); - } - if (border) { - memset(dst + y * 320 + x, 0xF7, 222); - memset(dst + (y + 20) * 320 + x, 0xF9, 222); - for (int i = 1; i < 20; ++i) { - dst[(y + i) * 320 + x ] = 0xF7; - dst[(y + i) * 320 + x + 221] = 0xF9; - } - } -} - -void IgorEngine::handleOptionsMenu_paintCtrl() { - static const char *textsStrTable1[] = { - "Sound effects OFF", - "Sound effects ON", - "Sound effects UNAVAILABLE" - }; - static int textsPosTable1[] = { 106, 110, 77 }; - int i = _gameState.configSoundEnabled; - redrawRect(_screenTextLayer, 1, false); - drawString(_screenTextLayer, textsStrTable1[i], textsPosTable1[i], 41 - 15, 0xF7, -1, 0); - - redrawRect(_screenTextLayer, 2, false); - drawString(_screenTextLayer, "Only TEXT AVAILABLE", 93, 63 - 15, 0xF7, -1, 0); - - static const char *textsStrTable2[] = { - "Music OFF", - "Music ON", - "Music UNAVAILABLE" - }; - static int textsPosTable2[] = { 129, 133, 100 }; - i = 1; - redrawRect(_screenTextLayer, 3, false); - drawString(_screenTextLayer, textsStrTable2[i], textsPosTable2[i], 85 - 15, 0xF7, -1, 0); - - static const char *textsStrTable3[] = { - "Text speed VERY SLOW", - "Text speed SLOW", - "Text speed NORMAL", - "Text speed FAST", - "Text speed VERY FAST" - }; - static int textsPosTable3[] = { 93, 110, 102, 111, 94 }; - i = _gameState.talkSpeed - 1; - redrawRect(_screenTextLayer, 4, true); - drawString(_screenTextLayer, textsStrTable3[i], textsPosTable3[i], 107 - 15, 0xF6, -1, 0); -} - -bool IgorEngine::handleOptionsMenu_handleKeyDownCtrl(int key) { - switch (key) { - case Common::KEYCODE_ESCAPE: - return true; - case Common::KEYCODE_RETURN: - if (_gameState.talkSpeed == 5) { - _gameState.talkSpeed = 1; - } else { - ++_gameState.talkSpeed; - } - handleOptionsMenu_paintCtrl(); - break; - } - return false; -} - -void IgorEngine::handleOptionsMenu() { - hideCursor(); - memcpy(_paletteBuffer, _currentPalette, 768); - memset(_screenVGA + 144 * 320, 0, 11 * 320); - _system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, 200); - for (int m = 3; m < 22; m += 3) { - for (int i = 1 * 3; i <= 245 * 3; ++i) { - if (_paletteBuffer[i] >= m) { - _currentPalette[i] = MAX<int>(_paletteBuffer[i] - m, _currentPalette[i] - 3); - } - } - setPaletteRange(1, 245); - _system->updateScreen(); - _system->delayMillis(1000 / 60); - } - setPaletteColor(255, 35, 35, 23); - - memcpy(_screenTextLayer, _screenVGA + 4800, 36800); - - uint8 *optionsMenu = loadData(IMG_OptionsMenu); - for (int i = 0; i < 36800; ++i) { - if (optionsMenu[i]) { - _screenTextLayer[i] = optionsMenu[i]; - } - } - free(optionsMenu); - uint8 *optionsButton = loadData(IMG_OptionsButton); - drawButtonsBar(_screenTextLayer, optionsButton); - free(optionsButton); - - const int yPosCaption = 18 - 15; - for (int i = 0; i < 5; ++i) { - drawString(_screenTextLayer, pages[i].captions[0], pages[i].xPos[0], yPosCaption, 0xF6, -1, 0); - } - redrawButton(_screenTextLayer, 0, true); - - uint8 buttonsBarBackup[320 * 12]; - int currentPage = 0; - bool menuLoop = true; - bool focusOnPage = false; - while (menuLoop && !_eventQuitGame && _currentPart != kInvalidPart) { - int previousPage = currentPage; - Common::Event ev; - while (_eventMan->pollEvent(ev)) { - switch (ev.type) { - case Common::EVENT_QUIT: - _currentPart = kInvalidPart; - _eventQuitGame = true; - break; - case Common::EVENT_KEYDOWN: - if (focusOnPage) { - if ((this->*pages[currentPage].handleKeyDownProc)(ev.kbd.keycode)) { - memcpy(_screenTextLayer + 3 * 320, buttonsBarBackup, 320 * 12); - for (int y = 22; y <= 110; ++y) { - memset(_screenTextLayer + y * 320 + 43 + 4, 0xF8, 226); - } - focusOnPage = false; - } - } else { - switch (ev.kbd.keycode) { - case Common::KEYCODE_ESCAPE: - menuLoop = false; - break; - case Common::KEYCODE_RETURN: - if (currentPage == kPagePlay) { - menuLoop = false; - } else { - memcpy(buttonsBarBackup, _screenTextLayer + 3 * 320, 320 * 12); - for (int y = 0; y <= 11; ++y) { - memset(_screenTextLayer + (y + 3) * 320 + 44, 0xF8, 232); - } - drawString(_screenTextLayer, pages[currentPage].captions[1], pages[currentPage].xPos[1], yPosCaption, 0xFB, -1, 0); - (this->*pages[currentPage].paintProc)(); - focusOnPage = true; - } - break; - case Common::KEYCODE_LEFT: - --currentPage; - if (currentPage < 0) { - currentPage = 0; - } - break; - case Common::KEYCODE_RIGHT: - ++currentPage; - if (currentPage > 4) { - currentPage = 4; - } - break; - default: - break; - } - } - break; - default: - break; - } - } - if (previousPage != currentPage) { - redrawButton(_screenTextLayer, previousPage, false); - redrawButton(_screenTextLayer, currentPage, true); - } - _system->delayMillis(10); - _system->copyRectToScreen(_screenTextLayer, 320, 0, 15, 320, 115); - _system->updateScreen(); - } - - for (int m = 21; m >= 3; m -= 3) { - for (int i = 1 * 3; i <= 245 * 3; ++i) { - if (_paletteBuffer[i] >= m) { - _currentPalette[i] = MIN<int>(_paletteBuffer[i], _currentPalette[i] + 3); - } - } - setPaletteRange(1, 245); - _system->updateScreen(); - _system->delayMillis(1000 / 60); - } - showCursor(); -} - -void IgorEngine::handlePause() { - drawActionSentence(getString(STR_GamePaused), 0xFB); - do { - waitForTimer(); - } while (!_inputVars[kInputPause]); - memset(_inputVars, 0, sizeof(_inputVars)); -} - -} // namespace Igor diff --git a/engines/igor/midi.cpp b/engines/igor/midi.cpp deleted file mode 100644 index f5e0d9ae74..0000000000 --- a/engines/igor/midi.cpp +++ /dev/null @@ -1,362 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" -#include "igor/midi.h" - -namespace Igor { - -MidiParser_CTMF::MidiParser_CTMF() - : _instrumentsCount(0) { - memset(_instruments, 0, sizeof(_instruments)); -} - -void MidiParser_CTMF::decodeHeader(const uint8 *p) { - _instrumentsDataOffset = READ_LE_UINT16(p); p += 2; - _midiDataOffset = READ_LE_UINT16(p); p += 2; - _ticksPerQuarter = READ_LE_UINT16(p); p += 2; - _ticksPerSecond = READ_LE_UINT16(p); p += 2; - p += 22; - _instrumentsCount = READ_LE_UINT16(p); p += 2; - _basicTempo = READ_LE_UINT16(p); p += 2; -} - -void MidiParser_CTMF::decodeAdlibInstrument(struct AdlibInstrument *ins, const uint8 *p) { - ins->chr[kAdlibCarrier] = p[0]; - ins->chr[kAdlibModulator] = p[1]; - ins->scale[kAdlibCarrier] = p[2]; - ins->scale[kAdlibModulator] = p[3]; - ins->attack[kAdlibCarrier] = p[4]; - ins->attack[kAdlibModulator] = p[5]; - ins->sustain[kAdlibCarrier] = p[6]; - ins->sustain[kAdlibModulator] = p[7]; - ins->waveSel[kAdlibCarrier] = p[8]; - ins->waveSel[kAdlibModulator] = p[9]; - ins->feedback = p[10]; -} - -bool MidiParser_CTMF::loadMusic(byte *data, uint32 size) { - if (memcmp(data, "CTMF", 4) == 0 && READ_LE_UINT16(data + 4) == 0x101) { - decodeHeader(data + 6); - assert(_instrumentsCount <= kMaxInstruments); - for (int i = 0; i < _instrumentsCount; ++i) { - decodeAdlibInstrument(&_instruments[i], data + _instrumentsDataOffset + i * 16); - } - // reset parser - _num_tracks = 1; - _tracks[0] = data + _midiDataOffset; - _ppqn = _ticksPerQuarter; - setTempo(500000); - setTrack(0); - return true; - } - return false; -} - -void MidiParser_CTMF::parseNextEvent(EventInfo &info) { - info.start = _position._play_pos; - info.delta = readVLQ(_position._play_pos); - - if ((_position._play_pos[0] & 0xF0) >= 0x80) { - info.event = *_position._play_pos++; - } else { - info.event = _position._running_status; - } - - if ((info.event & 0x80) == 0) { - return; - } - - _position._running_status = info.event; - switch (info.command()) { - case 0x8: // Note Off - case 0x9: // Note On - case 0xB: // Control Mode Change - info.basic.param1 = *_position._play_pos++; - info.basic.param2 = *_position._play_pos++; - if (info.command() == 0x9 && info.basic.param2 == 0) { - info.event = info.channel() | 0x80; // Note Off - } - return; - case 0xC: // Program Change - info.basic.param1 = *(_position._play_pos++); - info.basic.param2 = 0; - return; - case 0xF: - switch (info.event & 15) { - case 0xF: - info.ext.type = *(_position._play_pos++); - info.length = readVLQ(_position._play_pos); - info.ext.data = _position._play_pos; - _position._play_pos += info.length; - return; - } - } - warning("MidiParser_CTMF::parseNextEvent: Unhandled event code %x", info.event); -} - -int AdlibMidiDriver::open() { - MidiDriver_Emulated::open(); - _opl = makeAdlibOPL(getRate()); - memset(_adlibData, 0, sizeof(_adlibData)); - _adlibRhythmMode = false; - for (int i = 0; i < kAdlibChannelsCount; ++i) { - _adlibChannels[i].ch = -1; - _adlibChannels[i].lt = _adlibChannels[i].note = 0; - } - memset(_adlibInstrumentsMappingTable, 0, sizeof(_adlibInstrumentsMappingTable)); - adlibSetupCard(); - _mixer->playInputStream(Audio::Mixer::kMusicSoundType, &_mixerSoundHandle, this, -1, Audio::Mixer::kMaxChannelVolume, 0, false, true); - return 0; -} - -void AdlibMidiDriver::close() { - _mixer->stopHandle(_mixerSoundHandle); - OPLDestroy(_opl); -} - -void AdlibMidiDriver::send(uint32 b) { - int channel = b & 15; - int cmd = (b >> 4) & 7; - int param1 = (b >> 8) & 255; - int param2 = (b >> 16) & 255; - switch (cmd) { - case 0: - adlibTurnNoteOff(channel, param1); - break; - case 1: - adlibTurnNoteOn(channel, param1, param2); - break; - case 3: - adlibControlChange(channel, param1, param2); - break; - case 4: - adlibProgramChange(channel, param1); - break; - default: - warning("Unhandled cmd %d channel %d (0x%X)", cmd, channel, b); - break; - } -} - -void AdlibMidiDriver::generateSamples(int16 *data, int len) { - memset(data, 0, sizeof(int16) * len); - YM3812UpdateOne(_opl, data, len); -} - -void AdlibMidiDriver::adlibWrite(int port, int value) { - OPLWriteReg(_opl, port, value); - _adlibData[port & 255] = value & 255; -} - -void AdlibMidiDriver::adlibSetupCard() { - for (int i = 0; i < 256; ++i) { - adlibWrite(i, 0); - } - adlibWrite(1, 0x20); - adlibWrite(0xBD, 0xC0); -} - -void AdlibMidiDriver::adlibTurnNoteOff(int channel, int note) { - for (int i = 0; i < kAdlibChannelsCount; ++i) { - if (_adlibChannels[i].ch == channel && _adlibChannels[i].note == note) { - adlibEndNote(i); - _adlibChannels[i].ch = -1; - } - } -} - -void AdlibMidiDriver::adlibTurnNoteOn(int channel, int note, int velocity) { - assert(velocity != 0); - - for (int i = 0; i < kAdlibChannelsCount; ++i) { - if (_adlibChannels[i].ch != -1) { - ++_adlibChannels[i].lt; - } - } - - int ch = -1; - if (!_adlibRhythmMode || channel < 11) { - int maxLt = -1; - int maxCh = -1; - for (int i = 0; i < (_adlibRhythmMode ? 6 : 9); ++i) { - if (_adlibChannels[i].ch == -1) { - ch = i; - break; - } - if (_adlibChannels[i].lt > maxLt) { - maxLt = _adlibChannels[i].lt; - maxCh = i; - } - } - if (ch == -1) { - assert(maxCh != -1); - ch = maxCh; - adlibEndNote(ch); - } - } else { - ch = _adlibPercussionsMappingTable[channel - 11]; - } - - const AdlibInstrument &ins = _adlibInstruments[_adlibInstrumentsMappingTable[channel]]; - if (!_adlibRhythmMode || channel < 12) { - adlibSetupInstrument(ch, ins); - } else { - adlibSetupPercussion(channel, ins); - } - adlibSetupNote(ch, note - 13, velocity); - _adlibChannels[ch].ch = channel; - _adlibChannels[ch].note = note; - _adlibChannels[ch].lt = 0; -} - -void AdlibMidiDriver::adlibSetupInstrument(int channel, const AdlibInstrument &ins) { - adlibWrite(0x20 + _adlibOperatorsTable[channel], ins.chr[kAdlibCarrier]); - adlibWrite(0x23 + _adlibOperatorsTable[channel], ins.chr[kAdlibModulator]); - adlibWrite(0x40 + _adlibOperatorsTable[channel], ins.scale[kAdlibCarrier]); - if ((ins.feedback & 1) == 0) { - adlibWrite(0x43 + _adlibOperatorsTable[channel], ins.scale[kAdlibModulator]); - } else { - adlibWrite(0x43 + _adlibOperatorsTable[channel], 0); - } - adlibWrite(0x60 + _adlibOperatorsTable[channel], ins.attack[kAdlibCarrier]); - adlibWrite(0x63 + _adlibOperatorsTable[channel], ins.attack[kAdlibModulator]); - adlibWrite(0x80 + _adlibOperatorsTable[channel], ins.sustain[kAdlibCarrier]); - adlibWrite(0x83 + _adlibOperatorsTable[channel], ins.sustain[kAdlibModulator]); - adlibWrite(0xE0 + _adlibOperatorsTable[channel], ins.waveSel[kAdlibCarrier]); - adlibWrite(0xE3 + _adlibOperatorsTable[channel], ins.waveSel[kAdlibModulator]); - adlibWrite(0xC0 + channel, ins.feedback); -} - -void AdlibMidiDriver::adlibSetupPercussion(int channel, const AdlibInstrument &ins) { - channel = _adlibChannelsMappingTable[channel - 12]; - adlibWrite(0x20 + channel, ins.chr[kAdlibCarrier]); - adlibWrite(0x40 + channel, ins.scale[kAdlibCarrier]); - adlibWrite(0x60 + channel, ins.attack[kAdlibCarrier]); - adlibWrite(0x80 + channel, ins.sustain[kAdlibCarrier]); - adlibWrite(0xE0 + channel, ins.waveSel[kAdlibCarrier]); - adlibWrite(0xC0 + channel, ins.feedback); -} - -void AdlibMidiDriver::adlibSetupNote(int channel, int note, int velocity) { - adlibSetVolume(channel, velocity); - int f = _adlibNoteFreqTable[note % 12]; - adlibWrite(0xA0 + channel, f); - int oct = note / 12; - int c = ((f & 0x300) >> 8) + (oct << 2); - if (!_adlibRhythmMode || channel < 6) { - c |= 0x20; - } - adlibWrite(0xB0 + channel, c); -} - -void AdlibMidiDriver::adlibEndNote(int channel) { - adlibWrite(0xB0 + channel, _adlibData[0xB0 + channel] & ~0x20); -} - -void AdlibMidiDriver::adlibSetVolume(int channel, int volume) { - volume = 63 - (volume >> 1); - if ((_adlibData[0xC0 + channel] & 1) == 1) { - adlibWrite(0x40 + _adlibOperatorsTable[channel], volume | (_adlibData[0x40 + _adlibOperatorsTable[channel]] & 0xC0)); - } - adlibWrite(0x43 + _adlibOperatorsTable[channel], volume | (_adlibData[0x43 + _adlibOperatorsTable[channel]] & 0xC0)); -} - -void AdlibMidiDriver::adlibControlChange(int channel, int control, int param) { - switch (control) { - case 0x67: - _adlibRhythmMode = param != 0; - if (_adlibRhythmMode) { - adlibWrite(0xBD, _adlibData[0xBD] | 0x20); - } else { - adlibWrite(0xBD, _adlibData[0xBD] & ~0x20); - } - break; - case 0x7B: - adlibTurnNoteOff(channel, -1); - break; - default: - warning("Unhandled adlibControlChange 0x%X %d", control, param); - break; - } -} - -void AdlibMidiDriver::adlibProgramChange(int channel, int num) { - _adlibInstrumentsMappingTable[channel] = num; -} - -const uint8 AdlibMidiDriver::_adlibOperatorsTable[] = { 0, 1, 2, 8, 9, 10, 16, 17, 18 }; - -const uint8 AdlibMidiDriver::_adlibChannelsMappingTable[] = { 20, 18, 21, 17 }; - -const int16 AdlibMidiDriver::_adlibNoteFreqTable[] = { 363, 385, 408, 432, 458, 485, 514, 544, 577, 611, 647, 686 }; - -const uint8 AdlibMidiDriver::_adlibPercussionsMappingTable[] = { 6, 7, 8, 8, 7 }; - -MidiPlayer::MidiPlayer(IgorEngine *vm) : _isPlaying(false) { - _driver = new AdlibMidiDriver(vm->_mixer); - _driver->open(); - _parser = new MidiParser_CTMF; - _parser->setMidiDriver(_driver); - _parser->setTimerRate(_driver->getBaseTempo()); - _driver->setTimerCallback(this, &MidiPlayer::updateTimerCallback); -} - -MidiPlayer::~MidiPlayer() { - stopMusic(); - _driver->setTimerCallback(0, 0); - _driver->close(); - delete _parser; - delete _driver; -} - -void MidiPlayer::playMusic(uint8 *data, uint32 size) { - stopMusic(); - _mutex.lock(); - _isPlaying = true; - _parser->loadMusic(data, size); - _parser->setTrack(0); - _driver->setInstruments(&_parser->_instruments[0]); - _mutex.unlock(); -} - -void MidiPlayer::stopMusic() { - _mutex.lock(); - if (_isPlaying) { - _isPlaying = false; - _parser->unloadMusic(); - } - _mutex.unlock(); -} - -void MidiPlayer::updateTimer() { - _mutex.lock(); - if (_isPlaying) { - _parser->onTimer(); - } - _mutex.unlock(); -} - -} // namespace Igor diff --git a/engines/igor/midi.h b/engines/igor/midi.h deleted file mode 100644 index c61ddd9eed..0000000000 --- a/engines/igor/midi.h +++ /dev/null @@ -1,167 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#ifndef IGOR_MIDI_H -#define IGOR_MIDI_H - -#include "common/util.h" -#include "common/mutex.h" - -#include "sound/fmopl.h" -#include "sound/mididrv.h" -#include "sound/midiparser.h" -#include "sound/softsynth/emumidi.h" - -namespace Igor { - -enum { - kAdlibCarrier = 0, - kAdlibModulator -}; - -struct AdlibInstrument { - uint8 chr[2]; - uint8 scale[2]; - uint8 attack[2]; - uint8 sustain[2]; - uint8 waveSel[2]; - uint8 feedback; -}; - -class MidiParser_CTMF : public MidiParser { -public: - - enum { - kMaxInstruments = 16 - }; - - MidiParser_CTMF(); - ~MidiParser_CTMF() {} - - bool loadMusic(byte *data, uint32 size); - - AdlibInstrument _instruments[kMaxInstruments]; - int _instrumentsCount; - -protected: - - void decodeHeader(const uint8 *p); - void decodeAdlibInstrument(struct AdlibInstrument *ins, const uint8 *p); - - void parseNextEvent(EventInfo &info); - -private: - - int _instrumentsDataOffset; - int _midiDataOffset; - int _ticksPerQuarter; - int _ticksPerSecond; - int _basicTempo; -}; - -class AdlibMidiDriver : public MidiDriver_Emulated { -public: - - enum { - kAdlibChannelsCount = 18 - }; - - AdlibMidiDriver(Audio::Mixer *mixer) : MidiDriver_Emulated(mixer) {} - ~AdlibMidiDriver() {} - - // MidiDriver - int open(); - void close(); - void send(uint32 b); - void metaEvent(byte type, byte *data, uint16 length) {} - void sysEx(const byte *msg, uint16 length) {} - MidiChannel *allocateChannel() { return 0; } - MidiChannel *getPercussionChannel() { return 0; } - - // AudioStream - bool isStereo() const { return false; } - int getRate() const { return _mixer->getOutputRate(); } - - // MidiDriver_Emulated - void generateSamples(int16 *buf, int len); - - void setInstruments(AdlibInstrument *i) { _adlibInstruments = i; } - -private: - - void adlibWrite(int port, int value); - void adlibSetupCard(); - void adlibTurnNoteOff(int channel, int note); - void adlibTurnNoteOn(int channel, int note, int velocity); - void adlibSetupInstrument(int channel, const AdlibInstrument &ins); - void adlibSetupPercussion(int channel, const AdlibInstrument &ins); - void adlibSetupNote(int channel, int note, int velocity); - void adlibEndNote(int channel); - void adlibSetVolume(int channel, int volume); - void adlibControlChange(int channel, int control, int param); - void adlibProgramChange(int channel, int num); - - FM_OPL *_opl; - uint8 _adlibData[256]; - bool _adlibRhythmMode; - struct { - int ch; - int note; - int lt; - } _adlibChannels[kAdlibChannelsCount]; - int _adlibInstrumentsMappingTable[kAdlibChannelsCount]; - AdlibInstrument *_adlibInstruments; - - static const uint8 _adlibOperatorsTable[]; - static const uint8 _adlibChannelsMappingTable[]; - static const int16 _adlibNoteFreqTable[]; - static const uint8 _adlibPercussionsMappingTable[]; -}; - -class IgorEngine; - -class MidiPlayer { -public: - - MidiPlayer(IgorEngine *vm); - ~MidiPlayer(); - - void playMusic(uint8 *data, uint32 size); - void stopMusic(); - -private: - - void updateTimer(); - static void updateTimerCallback(void *p) { ((MidiPlayer *)p)->updateTimer(); } - - MidiParser_CTMF *_parser; - AdlibMidiDriver *_driver; - Common::Mutex _mutex; - bool _isPlaying; -}; - -} // namespace Igor - -#endif diff --git a/engines/igor/module.mk b/engines/igor/module.mk deleted file mode 100644 index 48ef4e951c..0000000000 --- a/engines/igor/module.mk +++ /dev/null @@ -1,46 +0,0 @@ -MODULE := engines/igor - -MODULE_OBJS := \ - detection.o \ - igor.o \ - menu.o \ - midi.o \ - saveload.o \ - staticres.o \ - parts/part_04.o \ - parts/part_05.o \ - parts/part_06.o \ - parts/part_12.o \ - parts/part_13.o \ - parts/part_14.o \ - parts/part_15.o \ - parts/part_16.o \ - parts/part_17.o \ - parts/part_18.o \ - parts/part_19.o \ - parts/part_21.o \ - parts/part_22.o \ - parts/part_23.o \ - parts/part_24.o \ - parts/part_25.o \ - parts/part_26.o \ - parts/part_27.o \ - parts/part_28.o \ - parts/part_30.o \ - parts/part_31.o \ - parts/part_33.o \ - parts/part_36.o \ - parts/part_37.o \ - parts/part_75.o \ - parts/part_85.o \ - parts/part_90.o \ - parts/part_95.o \ - parts/part_main.o - -# This module can be built as a plugin -ifeq ($(ENABLE_IGOR), DYNAMIC_PLUGIN) -PLUGIN := 1 -endif - -# Include common rules -include $(srcdir)/rules.mk diff --git a/engines/igor/parts/part_04.cpp b/engines/igor/parts/part_04.cpp deleted file mode 100644 index 0c41843180..0000000000 --- a/engines/igor/parts/part_04.cpp +++ /dev/null @@ -1,125 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_04_EXEC_ACTION(int action) { - debugC(9, kDebugGame, "PART_04_EXEC_ACTION %d", action); - if (_game.flags & kFlagDemo) { - if (action == 102 || action == 103 || action == 104) { - ADD_DIALOGUE_TEXT(102, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - } - switch (action) { - case 101: - _currentPart = 120; - break; - case 102: - _currentPart = 0; - break; - case 103: - _currentPart = 350; - break; - case 104: - _currentPart = 100; - break; - case 105: - if (_objectsState[111] == 0) { - _currentPart = 170; - } else { - _currentPart = 770; - } - break; - case 106: - _currentPart = 50; - break; - default: - error("PART_04_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_04_CLEAR_OBJECT_STATE_84(int num) { - _objectsState[84] = 0; -} - -void IgorEngine::PART_04() { - if (_objectsState[106] == 1) { - _currentPart = 730; - playMusic(1); - return; - } - if (_objectsState[107] == 1) { - _objectsState[107] = 0; - _currentPart = 750; - playMusic(1); - return; - } - _gameState.enableLight = 1; - loadRoomData(PAL_Map, IMG_Map, BOX_Map, MSK_Map, TXT_Map); - loadActionData(DAT_Map); - _roomDataOffsets = PART_04_ROOM_DATA_OFFSETS; - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_04_EXEC_ACTION); - PART_04_CLEAR_OBJECT_STATE_84(255); - memcpy(_screenVGA, _screenLayer1, 46080); - fadeInPalette(768); - _currentAction.verb = kVerbWalk; - if (_gameState.musicNum != 2) { - playMusic(2); - } - _walkData[0].x = 160; - _walkData[0].y = 133; - _walkData[0].scaleWidth = 49; - _walkData[0].scaleHeight = 49; - _walkDataLastIndex = 1; - _walkDataCurrentIndex = 1; - enterPartLoop(); - while (_currentPart == 40) { - handleRoomInput(); - if (compareGameTick(19, 32)) { - handleRoomDialogue(); - } - if (compareGameTick(4, 8)) { - handleRoomInventoryScroll(); - } - scrollPalette(200, 207); - setPaletteRange(200, 207); - if (compareGameTick(1)) { - handleRoomLight(); - } - scrollPalette(184, 199); - setPaletteRange(184, 199); - waitForTimer(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_05.cpp b/engines/igor/parts/part_05.cpp deleted file mode 100644 index a336468a11..0000000000 --- a/engines/igor/parts/part_05.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "common/system.h" - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_05_EXEC_ACTION(int action) { - debugC(9, kDebugGame, "PART_05_EXEC_ACTION %d", action); - switch (action) { - case 101: - ADD_DIALOGUE_TEXT(201, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 102: - PART_05_ACTION_102(); - break; - case 103: - PART_05_ACTION_103(); - break; - case 104: - ADD_DIALOGUE_TEXT(203, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 105: - _currentPart = 40; - break; - default: - error("PART_05_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_05_ACTION_102() { - uint8 *walkTable3 = loadData(WLK_Bridge3); - uint8 *walkTable4 = loadData(WLK_Bridge4); - int xPos = 220; - int yPos = 0; - int i = 1; - do { - if (compareGameTick(1, 16)) { - for (int y = 0; y <= 143; ++y) { - memcpy(_screenLayer2 + y * 320, _screenLayer1 + y * 320 + i * 8, 320 - i * 8); - memcpy(_screenLayer2 + y * 320 + 320 - i * 8, _animFramesBuffer + y * 224, i * 8); - } - if (i < 15) { - xPos += _walkScaleTable[0x8F9 + _walkCurrentFrame]; - assert(xPos >= 205); - yPos = walkTable3[xPos - 205]; - WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame); - } else { - _walkCurrentFrame = 0; - } - int yOffset = (yPos - 50) * 320 + xPos - 15 - i * 8; - for (_gameState.counter[1] = 0; _gameState.counter[1] <= 49; ++_gameState.counter[1]) { - yOffset += 320; - _gameState.counter[0] = yPos - 49 + _gameState.counter[1]; - for (_gameState.counter[2] = 0; _gameState.counter[2] <= 29; ++_gameState.counter[2]) { - _gameState.counter[3] = xPos - 15 + _gameState.counter[2]; - const int offset = _gameState.counter[0] * 134 + _gameState.counter[3]; - if (_gameState.counter[0] >= 92 && _gameState.counter[0] <= 110 && offset >= 12533 && walkTable4[offset - 12533] == 1) { - continue; - } - uint8 color = _facingIgorFrames[kFacingPositionRight - 1][_walkCurrentFrame * 1500 + _gameState.counter[1] * 30 + _gameState.counter[2]]; - if (color != 0) { - _screenLayer2[yOffset + _gameState.counter[2]] = color; - } - } - } - memcpy(_screenVGA, _screenLayer2, 46080); - ++i; - } - PART_05_UPDATE_ROOM_BACKGROUND(); - waitForTimer(); - } while (i != 29); - free(walkTable3); - free(walkTable4); - WalkData *wd = &_walkData[0]; - wd->setPos(xPos - 224, yPos, 2, 0); - wd->setDefaultScale(); - _currentPart = 60; -} - -void IgorEngine::PART_05_ACTION_103() { - int i = 0; - do { - if (compareGameTick(1)) { - const int offset = 27526; - for (int j = 0; j <= 48; ++j) { - const uint8 *src = _animFramesBuffer + 0x7E18 + i * 1470 + j * 30; - memcpy(_screenVGA + j * 320 + offset, src, 30); - } - ++i; - } - PART_05_UPDATE_ROOM_BACKGROUND(); - waitForTimer(); - } while (i != 3); - addObjectToInventory(21, 56); - _objectsState[60] = 1; - if (_game.version == kIdEngDemo110) { - ++_demoActionsCounter; - } - PART_05_HELPER_4(255); -} - -void IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND() { - if (compareGameTick(61)) { - scrollPalette(160, 167); - setPaletteRange(160, 167); - } - if (compareGameTick(2, 8)) { - scrollPalette(168, 178); - setPaletteRange(168, 178); - } - if (compareGameTick(13, 16)) { - scrollPalette(179, 184); - setPaletteRange(179, 184); - } - if (compareGameTick(5, 32)) { - scrollPalette(185, 191); - setPaletteRange(185, 191); - } - if (compareGameTick(1)) { - switch (getRandomNumber(200)) { - case 0: - playSound(18, 1); - break; - case 3: - playSound(21, 1); - break; - case 9: - playSound(22, 1); - break; - case 17: - playSound(23, 1); - break; - } - } - if (_gameState.talkMode == kTalkModeTextOnly || !_gameState.dialogueTextRunning) { - playSound(17, 1); - } -} - -void IgorEngine::PART_05_HELPER_1() { - const int offset = 23521; - for (int i = 0; i <= 48; ++i) { - memcpy(_animFramesBuffer + 0xDEA8 + i * 23 - 1, _screenLayer1 + i * 320 + offset, 23); - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + 0x95C7 + i * 23, 23); - } -} - -void IgorEngine::PART_05_HELPER_2() { - const int offset = 28668; - for (int i = 0; i <= 32; ++i) { - const uint8 *src = _animFramesBuffer + 0x7E54 + i * 23; - memcpy(_screenLayer1 + i * 320 + offset, src, 23); - } -} - -void IgorEngine::PART_05_HELPER_3(int frame) { - const int offset = 26756; - for (int i = 0; i <= 5; ++i) { - const uint8 *src = _animFramesBuffer + 0x7E00 + frame * 42 + i * 7; - memcpy(_screenLayer1 + i * 320 + offset, src, 7); - } -} - -void IgorEngine::PART_05_HELPER_4(int num) { - if (_objectsState[60] == 0) { - PART_05_HELPER_5(0); - return; - } - PART_05_HELPER_5(1); - _roomObjectAreasTable[24].object = 0; - for (int i = 27; i <= 29; ++i) { - _roomObjectAreasTable[i].object = 0; - } -} - -void IgorEngine::PART_05_HELPER_5(int frame) { - const int offset = 41926; - for (int i = 0; i <= 2; ++i) { - const uint8 *src = _animFramesBuffer + 0x7E00 + frame * 12 + i * 4; - memcpy(_screenLayer1 + i * 320 + offset, src, 4); - } -} - -void IgorEngine::PART_05_HELPER_6() { - _walkData[0].setPos(0, 141, 2, 0); - _walkData[0].setDefaultScale(); - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPath(0, 141, 51, 123); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_05() { - _gameState.enableLight = 1; - loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock); - SET_PAL_240_48_1(); - static const int anm2[] = { FRM_SpringRock1, FRM_SpringRock2, 0 }; - loadAnimData(anm2, 0x7E00); - static const int anm3[] = { FRM_SpringRock3, FRM_SpringRock4, 0 }; - loadAnimData(anm3, 0x81AE); - static const int anm4[] = { FRM_SpringRock5, FRM_SpringRock6, 0 }; - loadAnimData(anm4, 0xA763); - if (_objectsState[61] != 0) { - PART_05_HELPER_1(); - } - if (_objectsState[63] != 0) { - PART_05_HELPER_2(); - } - if (_objectsState[62] != 0) { - PART_05_HELPER_3(0); - } - for (int i = 0; i <= 143; ++i) { - memcpy(_animFramesBuffer + i * 224, _screenLayer1 + i * 320 + 96, 224); - } - loadRoomData(PAL_SpringBridge, IMG_SpringBridge, BOX_SpringBridge, MSK_SpringBridge, TXT_SpringBridge); - static const int anm1[] = { FRM_SpringBridge1, FRM_SpringBridge2, 0 }; - loadAnimData(anm1, 0x7E00); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_05_EXEC_ACTION); - _updateRoomBackground = &IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND; - PART_05_HELPER_4(255); - loadActionData(DAT_SpringRock); - _roomDataOffsets = PART_05_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 319, 143); - _walkDataLastIndex = 1; - _walkDataCurrentIndex = 1; - if (_currentPart == 50) { - PART_05_HELPER_6(); - } - enterPartLoop(); - while (_currentPart >= 50 && _currentPart <= 52) { - runPartLoop(); - } - leavePartLoop(); - stopSound(); - if (_currentPart == 255) { - fadeOutPalette(768); - } else if (_currentPart != 60) { - if (_objectsState[63] == 0) { - _objectsState[61] = _objectsState[62] = _objectsState[63] = 1; - } - memcpy(_currentPalette, _paletteBuffer, 624); - fadeOutPalette(624); - } -} - -} // namespace Igor diff --git a/engines/igor/parts/part_06.cpp b/engines/igor/parts/part_06.cpp deleted file mode 100644 index dc5e33be17..0000000000 --- a/engines/igor/parts/part_06.cpp +++ /dev/null @@ -1,418 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "common/system.h" - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_06_EXEC_ACTION(int action) { - debugC(9, kDebugGame, "PART_06_EXEC_ACTION %d", action); - switch (action) { - case 101: - ADD_DIALOGUE_TEXT(201, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 102: - PART_06_ACTION_102(); - break; - case 103: - PART_06_ACTION_103(); - break; - case 104: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 105: - PART_06_ACTION_105(); - break; - case 106: - ADD_DIALOGUE_TEXT(204, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 107: - PART_06_ACTION_107(); - break; - case 108: - PART_06_ACTION_108(); - break; - default: - error("PART_06_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_06_ACTION_102() { - uint8 *walkTable1 = loadData(WLK_Bridge1); - uint8 *walkTable2 = loadData(WLK_Bridge2); - int xPos = 323; - int yPos = 0; - int i = 1; - do { - if (compareGameTick(1, 16)) { - for (int y = 0; y <= 143; ++y) { - memcpy(_screenLayer2 + y * 320 + i * 8, _screenLayer1 + y * 320, 320 - i * 8); - memcpy(_screenLayer2 + y * 320, _animFramesBuffer + y * 224 + 224 - i * 8, i * 8); - } - if (i < 15) { - xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame]; - assert(xPos >= 205); - yPos = walkTable1[xPos - 205]; - WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame); - } else { - _walkCurrentFrame = 0; - } - int yOffset = (yPos - 50) * 320 + xPos - 239 + i * 8; - for (_gameState.counter[1] = 0; _gameState.counter[1] <= 49; ++_gameState.counter[1]) { - yOffset += 320; - _gameState.counter[0] = yPos - 49 + _gameState.counter[1]; - for (_gameState.counter[2] = 0; _gameState.counter[2] <= 29; ++_gameState.counter[2]) { - _gameState.counter[3] = xPos - 15 + _gameState.counter[2]; - const int offset = _gameState.counter[0] * 134 + _gameState.counter[3]; - if (_gameState.counter[0] >= 92 && _gameState.counter[0] <= 110 && offset >= 12533 && walkTable2[offset - 12533] == 1) { - continue; - } - uint8 color = _facingIgorFrames[kFacingPositionLeft - 1][_walkCurrentFrame * 1500 + _gameState.counter[1] * 30 + _gameState.counter[2]]; - if (color != 0) { - _screenLayer2[yOffset + _gameState.counter[2]] = color; - } - } - } - memcpy(_screenVGA, _screenLayer2, 46080); - ++i; - } - PART_06_UPDATE_ROOM_BACKGROUND(); - waitForTimer(); - } while (i != 29); - free(walkTable1); - free(walkTable2); - WalkData *wd = &_walkData[0]; - wd->setPos(xPos, yPos, 4, 0); - wd->setDefaultScale(); - _currentPart = 51; -} - -void IgorEngine::PART_06_ACTION_103() { - ADD_DIALOGUE_TEXT(215, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - PART_06_HELPER_8(0); - ADD_DIALOGUE_TEXT(216, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(170, 69, 55, 37, 63); - waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63); - PART_06_HANDLE_DIALOGUE_PHOTOGRAPHER(); - PART_06_HELPER_6(255); -} - -void IgorEngine::PART_06_ACTION_105() { - _gameTicks = 0; - for (int i = 0; i <= 3; ++i) { - if (compareGameTick(1)) { - const int offset = 22568; - for (int j = 0; j <= 48; ++j) { - const uint8 *src = _animFramesBuffer + 0x81AE + i * 1715 + j * 35; - memcpy(_screenVGA + 320 * j + offset, src, 35); - } - } - PART_06_UPDATE_ROOM_BACKGROUND(); - waitForTimer(); - } - addObjectToInventory(36, 71); - _objectsState[62] = 0; - PART_06_HELPER_6(255); -} - -void IgorEngine::PART_06_ACTION_107() { - PART_06_HELPER_8(0); - ADD_DIALOGUE_TEXT(205, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(206, 2); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(170, 69, 55, 37, 63); - waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63); -} - -void IgorEngine::PART_06_ACTION_108() { - PART_06_HELPER_8(0); - ADD_DIALOGUE_TEXT(208, 2); - ADD_DIALOGUE_TEXT(210, 2); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(212, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(170, 69, 55, 37, 63); - waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63); - int i = 7; - _gameTicks = 0; - do { - if (compareGameTick(1, 32)) { - const uint8 *src = _animFramesBuffer + 0xA763 + READ_LE_UINT16(_animFramesBuffer + 0xDB95 + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - ++i; - } - PART_06_UPDATE_ROOM_BACKGROUND(); - if (i == 7) { - stopSound(); - playSound(19, 1); - } - waitForTimer(); - } while (i != 28); - removeObjectFromInventory(61); - _objectsState[61] = 0; - PART_06_HELPER_6(255); - _gameState.unkF = false; - ADD_DIALOGUE_TEXT(213, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); -} - -void IgorEngine::PART_06_UPDATE_DIALOGUE_PHOTOGRAPHER(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_06_HELPER_7(1); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_06_HELPER_7(getRandomNumber(6) + 1); - break; - case kUpdateDialogueAnimStanding: - PART_06_HELPER_7(1); - break; - } -} - -void IgorEngine::PART_06_HANDLE_DIALOGUE_PHOTOGRAPHER() { - loadDialogueData(DLG_SpringPhotographer); - _updateDialogue = &IgorEngine::PART_06_UPDATE_DIALOGUE_PHOTOGRAPHER; - handleDialogue(170, 69, 55, 37, 63); - _updateDialogue = 0; -} - -void IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND() { - if (compareGameTick(61)) { - scrollPalette(160, 167); - setPaletteRange(160, 167); - } - if (compareGameTick(2, 8)) { - scrollPalette(168, 178); - setPaletteRange(168, 178); - } - if (compareGameTick(13, 16)) { - scrollPalette(179, 184); - setPaletteRange(179, 184); - } - if (compareGameTick(5, 32)) { - scrollPalette(185, 191); - setPaletteRange(185, 191); - } - if (compareGameTick(1)) { - switch (getRandomNumber(20)) { - case 0: - playSound(18, 1); - break; - case 3: - playSound(21, 1); - break; - case 9: - playSound(22, 1); - break; - case 17: - playSound(23, 1); - break; - } - } -} - -void IgorEngine::PART_06_HELPER_1(int frame) { - const int offset = 41926; - for (int i = 0; i <= 2; ++i) { - const uint8 *src = _animFramesBuffer + 0x7E00 + frame * 12 + i * 4; - memcpy(_screenLayer1 + i * 320 + offset, src, 4); - } -} - -void IgorEngine::PART_06_HELPER_2() { - const int offset = 23521; - for (int i = 0; i <= 48; ++i) { - const uint8 *src = _screenLayer1 + i * 320 + offset; - memcpy(_animFramesBuffer + 0xDEA8 + i * 23 - 1, src, 23); - } -} - -void IgorEngine::PART_06_HELPER_3() { - const int offset = 28668; - for (int i = 0; i <= 32; ++i) { - const uint8 *src = _animFramesBuffer + 0x7E54 + i * 23; - memcpy(_screenLayer1 + i * 320 + offset, src, 23); - memcpy(_screenVGA + i * 320 + offset, src, 23); - } -} - -void IgorEngine::PART_06_HELPER_6(int num) { - if (num == 2 || num == 255) { - if (_objectsState[61] == 1) { - PART_06_HELPER_14(); - _roomObjectAreasTable[3].object = 0; - _roomObjectAreasTable[13].area = 0; - _roomObjectAreasTable[15].area = 0; - _roomObjectAreasTable[17].area = 0; - _roomObjectAreasTable[18].area = 0; - } else { - PART_06_HELPER_12(); - _roomObjectAreasTable[2].object = 0; - _roomObjectAreasTable[15].object = 0; - _roomObjectAreasTable[18].object = 0; - _roomObjectAreasTable[3].object = 0; - _roomObjectAreasTable[13].area = 3; - _roomObjectAreasTable[15].area = 3; - _roomObjectAreasTable[17].area = 3; - _roomObjectAreasTable[18].area = 3; - } - } - if (num == 3 || num == 255) { - if (_objectsState[62] == 1) { - PART_06_HELPER_13(0); - } else { - PART_06_HELPER_13(1); - _roomObjectAreasTable[3].object = 0; - } - } -} - -void IgorEngine::PART_06_HELPER_7(int frame) { - const uint8 *src = _animFramesBuffer + 0xA763 + READ_LE_UINT16(_animFramesBuffer + 0xDB95 + frame * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); -} - -void IgorEngine::PART_06_HELPER_8(int frame) { - const int offset = 23521; - for (int i = 0; i <= 48; ++i) { - const uint8 *src = _animFramesBuffer + 0x95C7 + i * 23 + frame * 1127; - memcpy(_screenVGA + i * 320 + offset, src, 23); - } -} - -void IgorEngine::PART_06_HELPER_12() { - const int offset = 23521; - for (int i = 0; i <= 48; ++i) { - const uint8 *src = _animFramesBuffer + 0xDEA7 + i * 23; - memcpy(_screenLayer1 + i * 320 + offset, src, 23); - } -} - -void IgorEngine::PART_06_HELPER_13(int frame) { - const int offset = 26756; - for (int i = 0; i <= 5; ++i) { - const uint8 *src = _animFramesBuffer + 0x7E00 + frame * 42 + i * 7; - memcpy(_screenLayer1 + i * 320 + offset, src, 7); - } -} - -void IgorEngine::PART_06_HELPER_14() { - const int offset = 23521; - for (int i = 0; i <= 48; ++i) { - const uint8 *src = _animFramesBuffer + 0x95C7 + i * 23; - memcpy(_screenLayer1 + i * 320 + offset, src, 23); - } -} - -void IgorEngine::PART_06_HELPER_15(int frame) { - const uint8 *src = _animFramesBuffer + 0xA763 + READ_LE_UINT16(_animFramesBuffer + 0xDB95 + frame * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); -} - -void IgorEngine::PART_06() { - _gameState.enableLight = 1; - loadRoomData(PAL_SpringBridge, IMG_SpringBridge, BOX_SpringBridge, MSK_SpringBridge, TXT_SpringBridge); - static const int anm1[] = { FRM_SpringBridge1, FRM_SpringBridge2, 0 }; - loadAnimData(anm1, 0x7E00); - if (_objectsState[60] == 0) { - PART_06_HELPER_1(0); - } - for (int i = 0; i <= 143; ++i) { - memcpy(_animFramesBuffer + i * 224, _screenLayer1 + i * 320, 224); - } - loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock); - SET_PAL_240_48_1(); - static const int anm2[] = { FRM_SpringRock1, FRM_SpringRock2, 0 }; - loadAnimData(anm2, 0x7E00); - static const int anm3[] = { FRM_SpringRock3, FRM_SpringRock4, 0 }; - loadAnimData(anm3, 0x81AE); - static const int anm4[] = { FRM_SpringRock5, FRM_SpringRock6, 0 }; - loadAnimData(anm4, 0xA763); - PART_06_HELPER_2(); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_06_EXEC_ACTION); - _updateRoomBackground = &IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND; - PART_06_HELPER_6(255); - if (_objectsState[63] == 1) { - PART_06_HELPER_3(); - } - if (_currentPart == 61) { - SET_PAL_208_96_1(); - drawVerbsPanel(); - drawInventory(1, 0); - _currentAction.verb = kVerbWalk; - memcpy(_paletteBuffer, _currentPalette, 624); - fadeInPalette(768); - } - loadActionData(DAT_SpringBridge); - _roomDataOffsets = PART_06_ROOM_DATA_OFFSETS; - _walkDataLastIndex = 1; - _walkDataCurrentIndex = 1; - _gameState.unkF = (_objectsState[61] == 1); - enterPartLoop(); - while (_currentPart >= 60 && _currentPart <= 61) { - setRoomWalkBounds(0, 0, _objectsState[61] == 0 ? 234 : 142, 143); - handleRoomInput(); - if (compareGameTick(1, 16)) { - handleRoomIgorWalk(); - } - if (compareGameTick(19, 32)) { - handleRoomDialogue(); - } - if (compareGameTick(4, 8)) { - handleRoomInventoryScroll(); - } - if (compareGameTick(1)) { - handleRoomLight(); - } - PART_06_UPDATE_ROOM_BACKGROUND(); - if (compareGameTick(61) && _gameState.unkF && getRandomNumber(10) == 0) { - PART_06_HELPER_8(getRandomNumber(4)); - } - waitForTimer(); - } - leavePartLoop(); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp deleted file mode 100644 index e421782902..0000000000 --- a/engines/igor/parts/part_12.cpp +++ /dev/null @@ -1,568 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static const uint8 PART_12_DATA_ANIM_1[10] = { 0, 1, 2, 1, 2, 1, 2, 1, 2, 3 }; - -static const uint8 PART_12_DATA_ANIM_2[16] = { 0, 1, 2, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 5, 6, 7 }; - -void IgorEngine::PART_12_EXEC_ACTION(int action) { - debugC(9, kDebugGame, "PART_12_EXEC_ACTION %d", action); - switch (action) { - case 101: - PART_12_ACTION_101(); - break; - case 102: - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 103: - if (_objectsState[44] == 0) { - ADD_DIALOGUE_TEXT(203, 2); - } else { - ADD_DIALOGUE_TEXT(205, 1); - } - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 104: - PART_12_ACTION_104(); - break; - case 105: - PART_12_ACTION_105(); - break; - case 106: - ADD_DIALOGUE_TEXT(207, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 107: - ADD_DIALOGUE_TEXT(206, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 108: - PART_12_ACTION_108(); - break; - default: - error("PART_12_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_12_ACTION_101() { - for (int i = 9; i <= 10; ++i) { - _roomObjectAreasTable[i].area = 3; - } - --_walkDataLastIndex; - buildWalkPath(272, 94, 196, 64); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - _gameState.unk10 = 1; - _gameTicks = 0; - do { - if (compareGameTick(1, 16)) { - if (_walkDataCurrentIndex > _walkDataLastIndex) { - _gameState.igorMoving = false; - _walkDataLastIndex = _walkDataCurrentIndex; - } - if (_gameState.igorMoving) { - moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum); - ++_walkDataCurrentIndex; - } - } - if (compareGameTick(2, 32) && _gameState.unk10 < 8) { - if (_objectsState[44] == 0) { - const uint8 *src = _animFramesBuffer + 0x761 + READ_LE_UINT16(_animFramesBuffer + 0x1107 + _gameState.unk10 * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - } - ++_gameState.unk10; - } - waitForTimer(); - } while (_gameState.igorMoving || _gameState.unk10 != 8); - _currentPart = 40; -} - -void IgorEngine::PART_12_ACTION_104() { - _walkCurrentFrame = 2; - --_walkDataLastIndex; - _roomObjectAreasTable[_screenLayer2[33390]].area = _roomObjectAreasTable[_screenLayer2[34686]].area; - buildWalkPath(126, 108, 110, 104); - _roomObjectAreasTable[_screenLayer2[33390]].area = 0; - _walkDataCurrentIndex = 1; - moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum); - waitForTimer(35); - playSound(13, 1); - _walkDataCurrentIndex = _walkDataLastIndex; - const uint8 *src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA444) - 1; - decodeAnimFrame(src, _screenVGA); - decodeAnimFrame(src, _screenLayer1); - moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum); - waitForTimer(35); - _walkDataCurrentIndex = _walkDataLastIndex - 1; - src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA446) - 1; - decodeAnimFrame(src, _screenVGA); - decodeAnimFrame(src, _screenLayer1); - _walkData[_walkDataCurrentIndex].xPosChanged = 1; - _walkData[_walkDataCurrentIndex].yPosChanged = 1; - moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum); - waitForTimer(35); - _walkData[0].setPos(127, 108, 4, 0); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 30; - _walkData[0].scaleWidth = 50; - _walkData[0].xPosChanged = 1; - _walkData[0].dxPos = 10; - _walkData[0].yPosChanged = 1; - _walkData[0].dyPos = 3; - _walkData[0].scaleHeight = 50; - _walkDataCurrentIndex = 0; - _walkDataLastIndex = 1; - src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA448) - 1; - decodeAnimFrame(src, _screenVGA); - decodeAnimFrame(src, _screenLayer1); - moveIgor(4, 0); - PART_12_HANDLE_DIALOGUE_CHURCHMAN(); - for (int i = 4; i >= 1; --i) { - src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + i * 2) - 1; - decodeAnimFrame(src, _screenVGA); - if (i > 1) { - waitForTimer(35); - } else { - playSound(14, 1); - } - } - src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA440) - 1; - decodeAnimFrame(src, _screenVGA); - PART_12_HELPER_1(255); -} - -void IgorEngine::PART_12_ACTION_105() { - if (_objectsState[44] == 1) { - ADD_DIALOGUE_TEXT(216, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - memset(_screenVGA + 46080, 0, 17920); - _inventoryInfo[_inventoryInfo[62] - 1] = 0; - _inventoryInfo[62] = 0; - packInventory(); - if (_inventoryInfo[72] > _inventoryInfo[73]) { - _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7]; - } - const int animOffset = (_objectsState[45] == 0) ? 0x2543 : 0xBF1E; - for (int i = 1; i <= 9; ++i) { - const int offset = 30149; - for (int j = 0; j <= 48; ++j) { - const uint8 *src = _animFramesBuffer + animOffset + PART_12_DATA_ANIM_1[i] * 1715 + j * 35 + 0xF94C; - memcpy(_screenVGA + j * 320 + offset, src, 35); - } - waitForTimer(30); - } - ADD_DIALOGUE_TEXT(209, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - for (int i = 9; i <= 10; ++i) { - _roomObjectAreasTable[i].area = 3; - } - --_walkDataLastIndex; - buildWalkPath(95, 142, 196, 64); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _gameState.unk10 = 1; - _gameTicks = 0; - do { - if (compareGameTick(2, 32) && _gameState.unk10 < 8) { - const uint8 *src = _animFramesBuffer + 0x761 + READ_LE_UINT16(_animFramesBuffer + 0x1107 + _gameState.unk10 * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - ++_gameState.unk10; - } - waitForTimer(); - } while (_gameState.unk10 != 8); - --_walkDataLastIndex; - buildWalkPath(196, 64, 95, 142); - PART_12_HELPER_2(); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - _gameTicks = 0; - do { - if (compareGameTick(1, 16)) { - if (_walkDataCurrentIndex > _walkDataLastIndex) { - _gameState.igorMoving = false; - _walkDataLastIndex = _walkDataCurrentIndex; - } - if (_gameState.igorMoving) { - moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum); - ++_walkDataCurrentIndex; - } - } - if (compareGameTick(2, 32)) { - _gameState.unk10 = getRandomNumber(2) + 7; - const uint8 *src = _animFramesBuffer + 0x761 + READ_LE_UINT16(_animFramesBuffer + 0x1107 + _gameState.unk10 * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - } - waitForTimer(); - } while (_gameState.igorMoving); - decodeAnimFrame(_animFramesBuffer + 0x761 + READ_LE_UINT16(_animFramesBuffer + 0x1117) - 1, _screenVGA, true); - if (_objectsState[45] == 0) { - for (int i = 1; i <= 15; ++i) { - const uint8 *src = _animFramesBuffer + 0x1119 + READ_LE_UINT16(_animFramesBuffer + 0x2532 + PART_12_DATA_ANIM_2[i] * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - waitForTimer(45); - } - } else { - for (int i = 1; i <= 15; ++i) { - const uint8 *src = _animFramesBuffer + 0xA47A + READ_LE_UINT16(_animFramesBuffer + 0xBF0D + PART_12_DATA_ANIM_2[i] * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - waitForTimer(45); - } - } - drawVerbsPanel(); - redrawVerb(kVerbWalk, true); - _currentAction.verb = kVerbWalk; - addObjectToInventory(24, 59); - _objectsState[44] = 1; - PART_12_HELPER_1(255); - ADD_DIALOGUE_TEXT(211, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); -} - -void IgorEngine::PART_12_ACTION_108() { - _walkCurrentFrame = 2; - --_walkDataLastIndex; - _roomObjectAreasTable[_screenLayer2[28555]].area = _roomObjectAreasTable[_screenLayer2[34686]].area; - buildWalkPath(126, 108, 75, 89); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - _gameState.unk10 = 1; - _gameTicks = 0; - do { - if (compareGameTick(1, 16)) { - if (_walkDataCurrentIndex > _walkDataLastIndex) { - _gameState.igorMoving = false; - _walkDataLastIndex = _walkDataCurrentIndex; - } - if (_gameState.igorMoving) { - moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum); - ++_walkDataCurrentIndex; - } - } - if (compareGameTick(2, 32) && _gameState.unk10 < 8) { - if (_objectsState[44] == 0) { - const uint8 *src = _animFramesBuffer + 0x761 + READ_LE_UINT16(_animFramesBuffer + 0x1107 + _gameState.unk10 * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - } - ++_gameState.unk10; - } - waitForTimer(); - } while (_gameState.igorMoving || _gameState.unk10 != 8); - _currentPart = 130; -} - -void IgorEngine::PART_12_UPDATE_ROOM_BACKGROUND() { - if (compareGameTick(1) && getRandomNumber(15) == 0) { - switch (getRandomNumber(4)) { - case 0: - playSound(21, 1); - break; - case 1: - playSound(22, 1); - break; - case 2: - playSound(23, 1); - break; - case 3: - playSound(18, 1); - break; - } - } -} - -void IgorEngine::PART_12_UPDATE_DIALOGUE_CHURCHMAN(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_12_HELPER_8(); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_12_HELPER_10(6 + getRandomNumber(6)); - break; - case kUpdateDialogueAnimStanding: - PART_12_HELPER_8(); - break; - } -} - -void IgorEngine::PART_12_HANDLE_DIALOGUE_CHURCHMAN() { - loadDialogueData(DLG_OutsideChurch); - _updateDialogue = &IgorEngine::PART_12_UPDATE_DIALOGUE_CHURCHMAN; - handleDialogue(95, 55, 51, 28, 63); - _updateDialogue = 0; -} - -void IgorEngine::PART_12_HELPER_1(int num) { - if (num == 2 || num == 255) { - if (_objectsState[45] == 0) { - _roomActionsTable[169] = 104; - _roomActionsTable[175] = 104; - _roomActionsTable[177] = 104; - _roomActionsTable[179] = 104; - _roomActionsTable[181] = 104; - _roomActionsTable[185] = 104; - _roomActionsTable[187] = 104; - _roomActionsTable[170] = 3; - _roomActionsTable[176] = 3; - _roomActionsTable[178] = 3; - _roomActionsTable[180] = 3; - _roomActionsTable[182] = 3; - _roomActionsTable[186] = 3; - _roomActionsTable[188] = 3; - } else { - PART_12_HELPER_9(); - _roomActionsTable[169] = 108; - _roomActionsTable[175] = 106; - _roomActionsTable[177] = 2; - _roomActionsTable[179] = 11; - _roomActionsTable[181] = 107; - _roomActionsTable[185] = 35; - _roomActionsTable[187] = 35; - _roomActionsTable[170] = 1; - _roomActionsTable[176] = 1; - _roomActionsTable[178] = 1; - _roomActionsTable[180] = 1; - _roomActionsTable[182] = 1; - _roomActionsTable[186] = 1; - _roomActionsTable[188] = 1; - } - } -} - -void IgorEngine::PART_12_HELPER_2() { - for (int i = 9; i <= 10; ++i) { - _roomObjectAreasTable[i].area = 0; - } -} - -void IgorEngine::PART_12_HELPER_3() { - decodeAnimFrame(_animFramesBuffer, _screenVGA, true); -} - -void IgorEngine::PART_12_HELPER_4() { - SET_PAL_240_48_1(); - SET_PAL_208_96_1(); - fadeInPalette(768); - playSound(13, 1); - for (int i = 1; i <= 5; ++i) { - const uint8 *src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - if (_objectsState[44] == 0) { - src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x74B + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - } - waitForTimer(30); - } - if (_objectsState[44] == 0) { - for (int i = 6; i <= 10; ++i) { - const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x74B + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - waitForTimer(30); - } - } - ADD_DIALOGUE_TEXT(212, 2); - ADD_DIALOGUE_TEXT(214, 1); - ADD_DIALOGUE_TEXT(215, 1); - SET_DIALOGUE_TEXT(1, 3); - _updateDialogue = &IgorEngine::PART_12_UPDATE_DIALOGUE_CHURCHMAN; - startCutsceneDialogue(95, 55, 51, 28, 63); - waitForEndOfCutsceneDialogue(95, 55, 51, 28, 63); - _updateDialogue = 0; - for (int i = 12; i <= 29; ++i){ - const uint8 *src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - waitForTimer(30); - } - if (_objectsState[44] == 0) { - for (int i = 1; i <= 8; ++i) { - const uint8 *src = _animFramesBuffer + 0x761 + READ_LE_UINT16(_animFramesBuffer + 0x1107 + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - waitForTimer(30); - } - } - waitForTimer(255); - fadeOutPalette(768); - _objectsState[45] = 1; - drawVerbsPanel(); - drawInventory(_inventoryInfo[72], 0); - _currentPart = 40; -} - -void IgorEngine::PART_12_HELPER_5() { - _walkData[0].setPos(196, 64, 2, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 30; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPath(196, 64, 238, 104); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - _gameState.unk10 = 1; - waitForTimer(15); - _gameTicks = 0; - do { - if (compareGameTick(1, 16)) { - if (_walkDataCurrentIndex > _walkDataLastIndex) { - _gameState.igorMoving = false; - _walkDataLastIndex = _walkDataCurrentIndex; - } - if (_gameState.igorMoving) { - moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum); - ++_walkDataCurrentIndex; - } - } - if (compareGameTick(2, 32) && _gameState.unk10 < 11) { - if (_objectsState[44] == 0) { - const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x74B + _gameState.unk10 * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - } - ++_gameState.unk10; - } - waitForTimer(); - } while (_gameState.igorMoving || _gameState.unk10 != 11); -} - -void IgorEngine::PART_12_HELPER_6() { - playMusic(2); - PART_12_HELPER_1(255); - _walkData[0].setPos(75, 89, 2, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 30; - _roomObjectAreasTable[_screenLayer2[28555]].area = _roomObjectAreasTable[_screenLayer2[34686]].area; - buildWalkPath(75, 89, 126, 108); - _roomObjectAreasTable[_screenLayer2[28555]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - _gameState.unk10 = 1; - waitForTimer(15); - _gameTicks = 0; - do { - if (compareGameTick(1, 16)) { - if (_walkDataCurrentIndex > _walkDataLastIndex) { - _gameState.igorMoving = false; - _walkDataLastIndex = _walkDataCurrentIndex; - } - if (_gameState.igorMoving) { - moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum); - ++_walkDataCurrentIndex; - } - } - if (compareGameTick(2, 32) && _gameState.unk10 < 11) { - if (_objectsState[44] == 0) { - const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x74B + _gameState.unk10 * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - } - ++_gameState.unk10; - } - waitForTimer(); - } while (_gameState.igorMoving || _gameState.unk10 != 11); -} - -void IgorEngine::PART_12_HELPER_8() { - decodeAnimFrame(_animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA454) - 1, _screenVGA, true); -} - -void IgorEngine::PART_12_HELPER_9() { - decodeAnimFrame(_animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA442) - 1, _screenLayer1, true); -} - -void IgorEngine::PART_12_HELPER_10(int frame) { - decodeAnimFrame(_animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + frame * 2) - 1, _screenVGA, true); -} - -void IgorEngine::PART_12() { - _gameState.enableLight = 1; - loadRoomData(PAL_OutsideChurch, IMG_OutsideChurch, BOX_OutsideChurch, MSK_OutsideChurch, TXT_OutsideChurch); - static const int anm[] = { FRM_OutsideChurch1, FRM_OutsideChurch2, FRM_OutsideChurch3, FRM_OutsideChurch4, FRM_OutsideChurch5, FRM_OutsideChurch6, FRM_OutsideChurch7, FRM_OutsideChurch8, FRM_OutsideChurch9, FRM_OutsideChurch10, FRM_OutsideChurch11, FRM_OutsideChurch12, 0 }; - loadAnimData(anm); - loadActionData(DAT_OutsideChurch); - _roomDataOffsets = PART_12_ROOM_DATA_OFFSETS; - setRoomWalkBounds(89, 0, 275, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_12_EXEC_ACTION); - _updateRoomBackground = &IgorEngine::PART_12_UPDATE_ROOM_BACKGROUND; - PART_12_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - if (_objectsState[44] == 0) { - PART_12_HELPER_3(); - } - if (_currentPart == 122) { - PART_12_HELPER_4(); - return; - } - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - if (_currentPart == 120) { - PART_12_HELPER_5(); - } - if (_currentPart == 121) { - PART_12_HELPER_6(); - if (_objectsState[106] == 1) { - ADD_DIALOGUE_TEXT(216, 2); - ADD_DIALOGUE_TEXT(218, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - --_walkDataLastIndex; - buildWalkPath(126, 108, 196, 64); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 40; - goto PART_12_EXIT; - } - } - PART_12_HELPER_2(); - enterPartLoop(); - while (_currentPart >= 120 && _currentPart <= 122) { - runPartLoop(); - } -PART_12_EXIT: - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_13.cpp b/engines/igor/parts/part_13.cpp deleted file mode 100644 index b004f7034c..0000000000 --- a/engines/igor/parts/part_13.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_13_EXEC_ACTION(int action) { - debugC(9, kDebugGame, "PART_13_EXEC_ACTION %d", action); - switch (action) { - case 101: - PART_13_ACTION_101_103(); - break; - case 102: - ADD_DIALOGUE_TEXT(201, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 103: - PART_13_ACTION_101_103(); - break; - case 104: - PART_13_ACTION_104(); - break; - case 105: - _currentPart = 140; - break; - default: - error("PART_13_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_13_ACTION_101_103() { - waitForTimer(255); - _walkDataCurrentIndex = 0; - _walkCurrentFrame = 1; - for (int i = 0; i <= 4; ++i) { - WalkData *wd = &_walkData[0]; - if (i == 4) { - _walkCurrentFrame = 0; - } - wd->setPos(52 + i * 5, 88, 2, _walkCurrentFrame); - WalkData::setNextFrame(2, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 24; - wd->scaleWidth = 40; - wd->xPosChanged = 1; - wd->dxPos = 5; - wd->yPosChanged = 1; - wd->dyPos = 0; - wd->scaleHeight = 40; - moveIgor(wd->posNum, wd->frameNum); - waitForTimer(30); - } - _walkDataLastIndex = 1; - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - _walkData[0].posNum = 3; - moveIgor(_walkData[0].posNum, _walkData[0].frameNum); - waitForTimer(30); - _walkCurrentFrame = 1; - for (int i = 4; i >= 0; --i) { - WalkData *wd = &_walkData[0]; - if (i == 0) { - _walkCurrentFrame = 0; - } - wd->setPos(52 + i * 5, 88, 4, _walkCurrentFrame); - WalkData::setNextFrame(4, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 24; - wd->scaleWidth = 40; - wd->xPosChanged = 1; - wd->dxPos = 5; - wd->yPosChanged = 1; - wd->dyPos = 0; - wd->scaleHeight = 40; - moveIgor(wd->posNum, wd->frameNum); - waitForTimer(30); - } - waitForTimer(255); - WalkData *wd = &_walkData[0]; - wd->setPos(70, 127, 2, 0); - wd->clipSkipX = 1; - wd->clipWidth = 13; - wd->scaleWidth = 22; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 0; - wd->scaleHeight = 22; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPath(70, 127, 92, 127); - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - _gameState.unk10 = 1; - _gameTicks = 0; - do { - if (compareGameTick(1, 16)) { - if (_walkDataCurrentIndex > _walkDataLastIndex) { - _gameState.igorMoving = false; - _walkDataLastIndex = _walkDataCurrentIndex; - } - if (_gameState.igorMoving) { - moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum); - ++_walkDataCurrentIndex; - } - } - waitForTimer(); - } while (_gameState.igorMoving); -} - -void IgorEngine::PART_13_ACTION_104() { - _walkDataCurrentIndex = 0; - _walkCurrentFrame = 1; - for (int i = 9; i >= 0; --i) { - if (i == 9) { - _walkCurrentFrame = 0; - } - _walkData[0].setPos(189, 143, 3, _walkCurrentFrame); - WalkData::setNextFrame(3, _walkCurrentFrame); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 13; - _walkData[0].scaleWidth = 13 + i; - _walkData[0].xPosChanged = 1; - _walkData[0].dxPos = 0; - _walkData[0].yPosChanged = 1; - _walkData[0].dyPos = 3; - _walkData[0].scaleHeight = 22; - moveIgor(_walkData[0].posNum, _walkData[0].frameNum); - waitForTimer(15); - } - _currentPart = 121; -} - -void IgorEngine::PART_13_HELPER_1(int num) { -} - -void IgorEngine::PART_13_HELPER_2() { - WalkData *wd = &_walkData[0]; - wd->setPos(314, 127, 4, 0); - wd->clipSkipX = 1; - wd->clipWidth = 13; - wd->scaleWidth = 22; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 0; - wd->scaleHeight = 22; - _walkDataLastIndex = 0; - buildWalkPath(314, 127, 288, 127); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_13_HELPER_3() { - playMusic(4); - PART_13_HELPER_1(255); - _walkDataCurrentIndex = 0; - _walkCurrentFrame = 1; - for (int i = 0; i <= 9; ++i) { - WalkData *wd = &_walkData[0]; - if (i == 9) { - _walkCurrentFrame = 0; - } - wd->setPos(189, 143, 1, _walkCurrentFrame); - WalkData::setNextFrame(1, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 13; - wd->scaleWidth = i + 13; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 0; - wd->scaleHeight = 22; - moveIgor(wd->posNum, wd->frameNum); - waitForTimer(15); - } - _walkDataLastIndex = 1; - _walkDataCurrentIndex = 1; -} - -void IgorEngine::PART_13() { - _gameState.enableLight = 1; - loadRoomData(PAL_InsideChurch, IMG_InsideChurch, BOX_InsideChurch, MSK_InsideChurch, TXT_InsideChurch); - loadActionData(DAT_InsideChurch); - _roomDataOffsets = PART_13_ROOM_DATA_OFFSETS; - setRoomWalkBounds(92, 0, 288, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_13_EXEC_ACTION); - PART_13_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - if (_currentPart == 130) { - PART_13_HELPER_3(); - } else { - PART_13_HELPER_2(); - } - enterPartLoop(); - while (_currentPart >= 130 && _currentPart <= 131) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp deleted file mode 100644 index 65361593b9..0000000000 --- a/engines/igor/parts/part_14.cpp +++ /dev/null @@ -1,602 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static const uint8 PART_14_ANIM_DATA_1[6] = { 0, 2, 5, 1, 8, 3 }; - -static int VAR_NEW_CHURCH_MOSAIC_STONE; -static int VAR_CURRENT_CHURCH_MOSAIC_STONE; - -void IgorEngine::PART_14_EXEC_ACTION(int action) { - debugC(9, kDebugGame, "PART_14_EXEC_ACTION %d", action); - switch (action) { - case 101: - PART_14_ACTION_101(); - break; - case 102: - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 103: - PART_14_ACTION_103(); - break; - case 104: - ADD_DIALOGUE_TEXT(202, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 105: - PART_14_ACTION_105(); - break; - case 106: - PART_14_ACTION_106(); - break; - case 107: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 108: - PART_14_ACTION_108(); - break; - default: - error("PART_14_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_14_ACTION_101() { - _roomObjectAreasTable[_screenLayer2[22156]].area = 1; - _roomObjectAreasTable[_screenLayer2[27895]].area = 1; - --_walkDataLastIndex; - buildWalkPath(50, 103, 55, 87); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - for (int i = 192 * 3; i <= 207 * 3; ++i) { - if (_paletteBuffer[i] > 5) { - _currentPalette[i] -= 5; - } else { - _currentPalette[i] = 0; - } - } - setPaletteRange(192, 207); - --_walkDataLastIndex; - buildWalkPath(55, 87, 76, 69); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 220; -} - -void IgorEngine::PART_14_ACTION_103() { - fadeOutPalette(768); - PART_14_HELPER_9(); - loadResourceData__ROOM_ChurchPuzzle(); - memset(_screenVGA + 46080, 0, 17920); - drawVerbsPanel(); - drawInventory(_inventoryInfo[72], 0); - fadeInPalette(768); - if (_currentPart == 145) { - for (int i = 1; i <= 10; ++i) { - const uint8 *src = _animFramesBuffer + 0x9486 + READ_LE_UINT16(_animFramesBuffer + 0xCCE4 + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - waitForTimer(60); - } - stopSound(); - _objectsState[50] = 1; - } - PART_14_HELPER_1(255); - _currentPart = 140; -} - -void IgorEngine::PART_14_ACTION_105() { - _walkDataCurrentIndex = 0; - for (int i = 9; i >= 0; --i) { - WalkData *wd = &_walkData[0]; - if (i == 9) { - _walkCurrentFrame = 0; - } - wd->setPos(182, 143, 3, _walkCurrentFrame); - WalkData::setNextFrame(3, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 30; - wd->scaleWidth = 23 + i * 3; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 3; - wd->scaleHeight = 50; - moveIgor(wd->posNum, wd->frameNum); - waitForTimer(15); - } - _currentPart = 131; -} - -void IgorEngine::PART_14_ACTION_106() { - --_walkDataLastIndex; - _roomObjectAreasTable[_screenLayer2[35684]].area = 2; - buildWalkPath(164, 126, 164, 111); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - for (int i = 192 * 3; i <= 207 * 3; ++i) { - if (_paletteBuffer[i] > 5) { - _currentPalette[i] -= 5; - } else { - _currentPalette[i] = 0; - } - } - setPaletteRange(192, 207); - _walkDataCurrentIndex = 0; - for (int i = 9; i >= 0; --i) { - WalkData *wd = &_walkData[0]; - if (i == 9) { - _walkCurrentFrame = 0; - } - wd->setPos(164, 111, 1, _walkCurrentFrame); - WalkData::setNextFrame(1, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 30; - wd->scaleWidth = 23 + i * 3; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 3; - wd->scaleHeight = 50; - moveIgor(wd->posNum, wd->frameNum); - waitForTimer(15); - } - _objectsState[71] = 0; - _currentPart = 670; -} - -void IgorEngine::PART_14_ACTION_108() { - _gameState.unkF = false; - _updateRoomBackground = &IgorEngine::PART_14_UPDATE_ROOM_BACKGROUND_ACTION_108; - ADD_DIALOGUE_TEXT(226, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - removeObjectFromInventory(43); - for (int i = 1; i <= 3; ++i) { - const uint8 *src = _animFramesBuffer + 0x2AAA + READ_LE_UINT16(_animFramesBuffer + 0x940C + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - waitForTimer(60); - } - _gameState.unkF = true; - playSound(33, 1); - PART_14_HELPER_8(4, 24); - stopSound(); - ADD_DIALOGUE_TEXT(205, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(221, 85, 12, 33, 63); - waitForEndOfCutsceneDialogue(221, 85, 12, 33, 63); - PART_14_HELPER_8(25, 26); - PART_14_HELPER_8(60, 60); - WalkData *wd = &_walkData[_walkDataLastIndex - 1]; - wd->x = 250; - wd->y = 138; - wd->posNum = 4; - ADD_DIALOGUE_TEXT(206, 1); - ADD_DIALOGUE_TEXT(207, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(208, 2); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(221, 85, 12, 33, 63); - waitForEndOfCutsceneDialogue(221, 85, 12, 33, 63); - ADD_DIALOGUE_TEXT(210, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(211, 2); - ADD_DIALOGUE_TEXT(213, 3); - ADD_DIALOGUE_TEXT(216, 1); - SET_DIALOGUE_TEXT(1, 3); - startCutsceneDialogue(221, 85, 12, 33, 63); - waitForEndOfCutsceneDialogue(221, 85, 12, 33, 63); - for (int i = 33; i <= 35; ++i) { - const uint8 *src = _animFramesBuffer + 0x2AAA + READ_LE_UINT16(_animFramesBuffer + 0x940C + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - waitForTimer(60); - } - addObjectToInventory(28, 63); - ADD_DIALOGUE_TEXT(217, 1); - ADD_DIALOGUE_TEXT(218, 1); - ADD_DIALOGUE_TEXT(219, 1); - SET_DIALOGUE_TEXT(1, 3); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(220, 2); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(221, 85, 12, 33, 63); - waitForEndOfCutsceneDialogue(221, 85, 12, 33, 63); - PART_14_HELPER_7(0); - _gameState.unkF = false; - _screenVGA[32865] = _screenLayer1[32865]; - playSound(33, 1); - PART_14_HELPER_8(36, 60); - stopSound(); - ADD_DIALOGUE_TEXT(222, 1); - ADD_DIALOGUE_TEXT(223, 1); - ADD_DIALOGUE_TEXT(224, 1); - ADD_DIALOGUE_TEXT(225, 1); - SET_DIALOGUE_TEXT(1, 4); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - PART_14_HELPER_1(255); - _updateRoomBackground = 0; -} - -void IgorEngine::PART_14_UPDATE_ROOM_BACKGROUND_ACTION_108() { - if (compareGameTick(2, 16) && _gameState.unkF) { - PART_14_HELPER_7(getRandomNumber(2) + 1); - } -} - -void IgorEngine::PART_14_HELPER_1(int num) { - if (num == 1 || num == 255) { - if (_objectsState[50] == 1) { - PART_14_HELPER_6(); - _roomObjectAreasTable[3].object = 5; - _roomObjectAreasTable[4].object = 5; - _roomObjectAreasTable[7].object = 5; - _roomObjectAreasTable[8].object = 5; - } else { - _roomObjectAreasTable[3].object = 0; - _roomObjectAreasTable[4].object = 2; - _roomObjectAreasTable[7].object = 0; - _roomObjectAreasTable[8].object = 2; - } - } -} - -void IgorEngine::PART_14_HELPER_2() { - _walkDataCurrentIndex = 0; - _walkCurrentFrame = 1; - for (int i = 0; i <= 9; ++i) { - WalkData *wd = &_walkData[0]; - if (i == 9) { - _walkCurrentFrame = 0; - } - wd->setPos(182, 143, 1, _walkCurrentFrame); - WalkData::setNextFrame(1, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 30; - wd->scaleWidth = 23 + i * 3; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 3; - wd->scaleHeight = 32; - moveIgor(wd->posNum, wd->frameNum); - waitForTimer(15); - } - _walkDataLastIndex = 1; - _walkDataCurrentIndex = 1; - buildWalkPath(182, 143, 162, 138); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_14_HELPER_3() { - for (int i = 192 * 3; i <= 207 * 3; ++i) { - if (_paletteBuffer[i] > 5) { - _currentPalette[i] -= 5; - } else { - _currentPalette[i] = 0; - } - } - setPaletteRange(192, 207); - WalkData *wd = &_walkData[0]; - wd->setPos(76, 69, 4, 0); - wd->clipSkipX = 1; - wd->clipWidth = 24; - wd->scaleWidth = 40; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 0; - wd->scaleHeight = 40; - _walkDataLastIndex = 0; - _roomObjectAreasTable[_screenLayer2[22156]].area = 1; - _roomObjectAreasTable[_screenLayer2[27895]].area = 1; - buildWalkPath(76, 69, 55, 87); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - for (int i = 192 * 3; i <= 207 * 3; ++i) { - _currentPalette[i] = _paletteBuffer[i]; - } - setPaletteRange(192, 207); - --_walkDataLastIndex; - buildWalkPath(55, 87, 50, 103); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _roomObjectAreasTable[_screenLayer2[22156]].area = 0; - _roomObjectAreasTable[_screenLayer2[27895]].area = 0; -} - -void IgorEngine::PART_14_HELPER_4() { - playMusic(4); - PART_14_HELPER_1(255); - for (int i = 192 * 3; i <= 207 * 3; ++i) { - if (_paletteBuffer[i] > 5) { - _currentPalette[i] -= 5; - } else { - _currentPalette[i] = 0; - } - } - setPaletteRange(192, 207); - _walkDataCurrentIndex = 0; - _walkCurrentFrame = 1; - _walkCurrentPos = 3; - for (int i = 0; i <= 9; ++i) { - WalkData *wd = &_walkData[0]; - if (i == 9) { - _walkCurrentFrame = 0; - } - wd->setPos(164, 111, 3, _walkCurrentFrame); - WalkData::setNextFrame(3, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 30; - wd->scaleWidth = 23 + i * 3; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 3; - wd->scaleHeight = 50; - moveIgor(3, wd->frameNum); - waitForTimer(15); - } - for (int i = 192 * 3; i <= 207 * 3; ++i) { - _currentPalette[i] = _paletteBuffer[i]; - } - setPaletteRange(192, 207); - _walkDataLastIndex = 0; - _roomObjectAreasTable[_screenLayer2[35684]].area = 2; - buildWalkPath(164, 111, 164, 126); - _roomObjectAreasTable[_screenLayer2[35684]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_14_HELPER_6() { - const int offset = 18382; - for (int i = 0; i <= 65; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + 0xD5BA + i * 44, 44); - } -} - -void IgorEngine::PART_14_HELPER_7(int frame) { - const int offset = 38038; - for (int i = 0; i <= 1; ++i) { - memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + 0x2AA4 + frame * 2 + i, 1); - } -} - -void IgorEngine::PART_14_HELPER_8(int start, int end) { - _gameState.counter[0] = start - 1; - do { - if (compareGameTick(1, 16)) { - ++_gameState.counter[0]; - const uint8 *src = _animFramesBuffer + 0x2AAA + READ_LE_UINT16(_animFramesBuffer + 0x940C + _gameState.counter[0] * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - } - if (compareGameTick(2, 16) && _gameState.unkF) { - PART_14_HELPER_7(getRandomNumber(2) + 1); - } - waitForTimer(); - } while (_gameState.counter[0] != end); -} - -void IgorEngine::PART_14_HELPER_9() { - PART_14_HELPER_10(); - memcpy(_screenTextLayer, _screenVGA, 46080); - memcpy(_screenVGA, _screenLayer1, 46080); - memcpy(_screenLayer1, _screenTextLayer, 46080); - memset(_screenVGA + 46080, 0, 17920); - fadeInPalette(768); - _inputVars[kInputCursorXPos] = 160; - _inputVars[kInputCursorYPos] = 72; - showCursor(); - _gameState.counter[4] = 0; - _currentPart = 145; - _dialogueEnded = false; - VAR_CURRENT_CHURCH_MOSAIC_STONE = 255; - do { - int area = _screenLayer2[_inputVars[kInputCursorYPos] * 320 + _inputVars[kInputCursorXPos]]; - if (area == 0) { - VAR_NEW_CHURCH_MOSAIC_STONE = 1; - } else if (area >= 1 && area <= 8) { - VAR_NEW_CHURCH_MOSAIC_STONE = 2; - } else if (area == 9) { - VAR_NEW_CHURCH_MOSAIC_STONE = 3; - } - if (VAR_NEW_CHURCH_MOSAIC_STONE != VAR_CURRENT_CHURCH_MOSAIC_STONE) { - switch (VAR_NEW_CHURCH_MOSAIC_STONE) { - case 1: - drawActionSentence("", 253); - break; - case 2: - drawActionSentence(getString(STR_PushStone), 253); - break; - case 3: - drawActionSentence(getString(STR_Exit), 253); - break; - } - VAR_CURRENT_CHURCH_MOSAIC_STONE = VAR_NEW_CHURCH_MOSAIC_STONE; - } - if (_inputVars[kInputClick]) { - _inputVars[kInputClick] = 0; - _dialogueEnded = area == 0; - if (area == 9) { - _currentPart = 146; - } - if (area >= 1 && area <= 8) { - drawActionSentence(getString(STR_PushStone), 251); - hideCursor(); - playSound(34, 1); - switch (area) { - case 1: - PART_14_PUSH_STONE(33359, 28, 34, 0); - break; - case 2: - PART_14_PUSH_STONE(22800, 27, 34, 0x3D4); - break; - case 3: - PART_14_PUSH_STONE(10642, 39, 45, 0x785); - break; - case 4: - PART_14_PUSH_STONE(3624, 56, 39, 0xCCFA); - break; - case 5: - PART_14_PUSH_STONE(3679, 54, 38, 0xE87); - break; - case 6: - PART_14_PUSH_STONE(11077, 35, 35, 0x1D8F); - break; - case 7: - PART_14_PUSH_STONE(20688, 28, 36, 0x227B); - break; - case 8: - PART_14_PUSH_STONE(31889, 27, 38, 0x2687); - break; - } - } - stopSound(); - drawActionSentence("Push stone", 253); - showCursor(); - _dialogueEnded = false; - ++_gameState.counter[4]; - if (_objectsState[2] == 0 || PART_14_ANIM_DATA_1[_gameState.counter[4]] != area) { - _currentPart = 0; - } - if (_gameState.counter[4] == 5) { - if (_currentPart == 145) { - _dialogueEnded = true; - } else { - _currentPart = 145; - _gameState.counter[4] = 0; - ADD_DIALOGUE_TEXT(204, 1); - SET_DIALOGUE_TEXT(1, 1); - playSound(35, 1); - waitForTimer(255); - stopSound(); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - } - } - } - if (_inputVars[kInputEscape]) { - _inputVars[kInputEscape] = 0; - _currentPart = 146; - _dialogueEnded = true; - } - } while (_currentPart >= 145 && _currentPart <= 146 && !_dialogueEnded); - drawActionSentence("", 253); - hideCursor(); - if (_currentPart == 145) { - playSound(35, 1); - } - fadeOutPalette(768); - memcpy(_screenVGA, _screenLayer1, 46080); - SET_PAL_208_96_1(); -} - -void IgorEngine::PART_14_HELPER_10() { - loadData(PAL_ChurchMosaic, _paletteBuffer); - loadData(IMG_ChurchMosaic, _screenLayer1); - uint8 *p = loadData(MSK_ChurchMosaic); - decodeRoomMask(p); - free(p); -} - -void IgorEngine::PART_14_PUSH_STONE(int screenOffset, int w, int h, int animOffset) { - for (int i = 0; i <= h; ++i) { - memcpy(_screenTempLayer + i * 100, _screenVGA + i * 320 + animOffset, w); - memcpy(_screenVGA + i * 320 + screenOffset, _animFramesBuffer + i * w, w); - } - waitForTimer(127); - for (int i = 0; i <= h; ++i) { - memcpy(_screenVGA + i * 320 + screenOffset, _screenTempLayer + i * 100, 28); - } -} - -void IgorEngine::PART_14() { - _gameState.enableLight = 1; - loadResourceData__ROOM_ChurchPuzzle(); - loadResourceData__ANIM_ChurchPuzzle(); - loadActionData(DAT_ChurchPuzzle); - _roomDataOffsets = PART_14_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 256, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_14_EXEC_ACTION); - PART_14_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - if (_currentPart == 140) { - PART_14_HELPER_2(); - } - if (_currentPart == 141) { - PART_14_HELPER_3(); - } - if (_currentPart == 142) { - PART_14_HELPER_4(); - } - enterPartLoop(); - while (_currentPart >= 140 && _currentPart <= 142) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -void IgorEngine::loadResourceData__ROOM_ChurchPuzzle() { - loadRoomData(PAL_ChurchPuzzle, IMG_ChurchPuzzle, BOX_ChurchPuzzle, MSK_ChurchPuzzle, TXT_ChurchPuzzle); -} - -void IgorEngine::loadResourceData__ANIM_ChurchPuzzle() { - static const int anm1[] = { FRM_ChurchPuzzle1, FRM_ChurchPuzzle2, FRM_ChurchPuzzle3, FRM_ChurchPuzzle4, 0 }; - loadAnimData(anm1, 0); - static const int anm2[] = { FRM_ChurchPuzzle5, FRM_ChurchPuzzle6, FRM_ChurchPuzzle7, FRM_ChurchPuzzle8, FRM_ChurchPuzzle9, FRM_ChurchPuzzle10, FRM_ChurchPuzzle11, FRM_ChurchPuzzle12, 0 }; - loadAnimData(anm2, 0x1D8F); - static const int anm3[] = { FRM_ChurchPuzzle13, FRM_ChurchPuzzle14, 0 }; - loadAnimData(anm3, 0xCCE6); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp deleted file mode 100644 index 70f759f7e7..0000000000 --- a/engines/igor/parts/part_15.cpp +++ /dev/null @@ -1,511 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static const uint8 PART_15_ANIM_DATA_1[8] = { 5, 6, 0, 3, 3, 0, 0, 1 }; - -static const uint8 PART_15_ANIM_DATA_2[8] = { 0, 1, 2, 3, 4, 3, 5, 6 }; - -static const uint8 PART_15_ANIM_DATA_3[12] = { 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 3 }; - -static const uint8 PART_15_ANIM_DATA_4[8] = { 0, 7, 8, 3, 4, 3, 5, 6 }; - -static const uint8 PART_15_ANIM_DATA_5[12] = { 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 3 }; - -void IgorEngine::PART_15_EXEC_ACTION(int action) { - switch (action) { - case 101: - PART_15_ACTION_101(); - break; - case 102: - ADD_DIALOGUE_TEXT(204, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 103: - ADD_DIALOGUE_TEXT(205, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 104: - ADD_DIALOGUE_TEXT(207, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 105: - ADD_DIALOGUE_TEXT(205, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 106: - ADD_DIALOGUE_TEXT(205, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 107: - PART_15_ACTION_107(); - break; - case 108: - ADD_DIALOGUE_TEXT(208, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 109: - ADD_DIALOGUE_TEXT(201, 1); - ADD_DIALOGUE_TEXT(202, 2); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 110: - ADD_DIALOGUE_TEXT(234, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 111: - ADD_DIALOGUE_TEXT(235, 1); - ADD_DIALOGUE_TEXT(236, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 112: - ADD_DIALOGUE_TEXT(237, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 113: - ADD_DIALOGUE_TEXT(235, 1); - ADD_DIALOGUE_TEXT(236, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 114: - ADD_DIALOGUE_TEXT(240, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 115: - PART_15_ACTION_115(); - break; - case 116: - PART_15_ACTION_116(); - break; - default: - error("PART_15_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_15_ACTION_101() { - --_walkDataLastIndex; - _roomObjectAreasTable[_screenLayer2[34560]].area = 1; - buildWalkPathSimple(34, 108, 0, 108); - _roomObjectAreasTable[_screenLayer2[34560]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 271; -} - -void IgorEngine::PART_15_ACTION_107() { - if (_gameState.counter[3] == 1) { - do { - PART_15_HELPER_3(); - waitForTimer(); - } while (_gameState.counter[3] != 0); - } - PART_15_HELPER_7(6); - PART_15_HANDLE_DIALOGUE_TOBIAS(); -} - -void IgorEngine::PART_15_ACTION_115() { - if (_gameState.counter[3] == 1) { - do { - PART_15_HELPER_3(); - waitForTimer(); - } while (_gameState.counter[3] != 0); - } - PART_15_HELPER_7(6); - ADD_DIALOGUE_TEXT(209, 1); - ADD_DIALOGUE_TEXT(210, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(212, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; - ADD_DIALOGUE_TEXT(213, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(214, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; - for (int i = 1; i <= 11; ++i) { - PART_15_HELPER_9(PART_15_ANIM_DATA_3[i]); - waitForTimer(60); - } - PART_15_HELPER_7(6); - if (_objectsState[37] == 0) { - ADD_DIALOGUE_TEXT(215, 2); - ADD_DIALOGUE_TEXT(217, 1); - } else { - ADD_DIALOGUE_TEXT(218, 2); - ADD_DIALOGUE_TEXT(223, 1); - } - SET_DIALOGUE_TEXT(1, 2); - startCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; - if (_objectsState[37] == 0) { - return; - } - for (int i = 1; i <= 7; ++i) { - PART_15_HELPER_7(PART_15_ANIM_DATA_2[i]); - waitForTimer(40); - } - removeObjectFromInventory(70); - _objectsState[46] = 1; - if (_objectsState[47] == 0) { - ADD_DIALOGUE_TEXT(221, 2); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; - return; - } - ADD_DIALOGUE_TEXT(226, 2); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; - ADD_DIALOGUE_TEXT(228, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(229, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; - ADD_DIALOGUE_TEXT(230, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - _currentPart = 780; -} - -void IgorEngine::PART_15_ACTION_116() { - if (_gameState.counter[3] == 1) { - do { - PART_15_HELPER_3(); - waitForTimer(); - } while (_gameState.counter[3] != 0); - } - PART_15_HELPER_7(6); - ADD_DIALOGUE_TEXT(209, 1); - ADD_DIALOGUE_TEXT(211, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(212, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; - ADD_DIALOGUE_TEXT(213, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(214, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; - for (int i = 1; i <= 11; ++i) { - PART_15_HELPER_9(PART_15_ANIM_DATA_5[i]); - waitForTimer(60); - } - PART_15_HELPER_7(6); - if (_objectsState[37] == 0) { - ADD_DIALOGUE_TEXT(215, 2); - ADD_DIALOGUE_TEXT(217, 1); - } else { - ADD_DIALOGUE_TEXT(218, 2); - ADD_DIALOGUE_TEXT(223, 1); - } - SET_DIALOGUE_TEXT(1, 2); - startCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; - if (_objectsState[37] == 0) { - return; - } - for (int i = 1; i <= 7; ++i) { - PART_15_HELPER_7(PART_15_ANIM_DATA_4[i]); - waitForTimer(40); - } - removeObjectFromInventory(60); - _objectsState[47] = 1; - if (_objectsState[46] == 0) { - ADD_DIALOGUE_TEXT(224, 2); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; - return; - } - ADD_DIALOGUE_TEXT(226, 2); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; - ADD_DIALOGUE_TEXT(228, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(229, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; - ADD_DIALOGUE_TEXT(230, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - _currentPart = 780; -} - -void IgorEngine::PART_15_UPDATE_ROOM_BACKGROUND() { - PART_15_HELPER_5(); - if (_gameTicks == 38 || _gameTicks == 60) { - if (_objectsState[48] != 1 && getRandomNumber(200) == 0 && _gameState.counter[3] == 0) { - _gameState.counter[3] = 1; - } - } - PART_15_HELPER_3(); -} - -void IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_15_HELPER_8(0); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_15_HELPER_8(getRandomNumber(5)); - break; - case kUpdateDialogueAnimStanding: - PART_15_HELPER_8(0); - break; - } -} - -void IgorEngine::PART_15_HANDLE_DIALOGUE_TOBIAS() { - loadDialogueData(DLG_TobiasOffice); - _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS; - handleDialogue(133, 67, 0, 63, 19); - _updateDialogue = 0; -} - -void IgorEngine::PART_15_HELPER_1(int num) { -} - -void IgorEngine::PART_15_HELPER_2() { - _walkData[0].setPos(0, 108, 2, 0); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 15; - _walkData[0].scaleWidth = 25; - _walkData[0].xPosChanged = 1; - _walkData[0].dxPos = 0; - _walkData[0].yPosChanged = 1; - _walkData[0].dyPos = 0; - _walkData[0].scaleHeight = 25; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - _roomObjectAreasTable[_screenLayer2[34560]].area = 1; - buildWalkPathSimple(0, 108, 34, 108); - _roomObjectAreasTable[_screenLayer2[34560]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_15_HELPER_3() { - if (compareGameTick(38) || compareGameTick(60)) { - if (_objectsState[48] != 1 && _gameState.counter[3] == 1) { - if (_gameState.unk11 == 0) { - _objectsState[48] = 1; - _objectsState[49] = 1; - _gameState.counter[3] = 0; - } else { - PART_15_HELPER_6(_gameState.unk11); - } - if (_gameState.unk11 == 7) { - _objectsState[49] = 2; - } - if (_objectsState[49] == 2) { - if (_gameState.counter[4] == 0) { - playSound(54, 1); - } - ++_gameState.counter[4]; - if (_gameState.unk11 == 7) { - _gameState.unk11 = 6; - } else { - _gameState.unk11 = 7; - } - if (_gameState.counter[4] > 15) { - _objectsState[49] = 3; - _gameState.unk11 = 6; - } - } else if (_objectsState[49] == 1) { - ++_gameState.unk11; - } else { - --_gameState.unk11; - } - } - } -} - -void IgorEngine::PART_15_HELPER_5() { - if (compareGameTick(7) || compareGameTick(29) || compareGameTick(61)) { - if (_gameState.unk10 >= 3) { - PART_15_HELPER_9(PART_15_ANIM_DATA_1[_gameState.unk10]); - ++_gameState.unk10; - if (_gameState.unk10 == 8) { - _gameState.unk10 = 1; - } - } - } - if (compareGameTick(5)) { - if (_gameState.unk10 >= 1 && _gameState.unk10 <= 2) { - PART_15_HELPER_9(_gameState.unk10); - if (_gameState.unk10 == 1 && getRandomNumber(10) == 0) { - _gameState.unk10 = 2; - } else { - _gameState.unk10 = 1; - } - if (getRandomNumber(30) == 0) { - _gameState.unk10 = 3; - } - } - } -} - -void IgorEngine::PART_15_HELPER_6(int frame) { - _roomCursorOn = false; - for (int i = 0; i <= 17; ++i) { - for (int j = 0; j <= 52; ++j) { - int offset = (i + 23) * 320 + j + 18; - uint8 color = _screenVGA[offset]; - if (color < 0xF0 || color > 0xF1) { - color = _animFramesBuffer[0x4B8C + frame * 954 + i * 53 + j]; - } - _screenTempLayer[i * 100 + j] = color; - } - } - int offset = 7378; - for (int i = 0; i <= 17; ++i) { - memcpy(_screenVGA + i * 320 + offset, _screenTempLayer + i * 100, 53); - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + 0x4B8C + frame * 954 + i * 53, 53); - } - if (_gameState.dialogueTextRunning) { - memcpy(_screenTextLayer + 23040, _screenLayer1 + _dialogueDirtyRectY, _dialogueDirtyRectSize); - } - if (_dialogueCursorOn) { - _roomCursorOn = true; - } -} - -void IgorEngine::PART_15_HELPER_7(int frame) { - int offset = 20887; - for (int i = 0; i <= 35; ++i) { - memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + 0x49A + frame * 2124 + i * 59, 59); - } -} - -void IgorEngine::PART_15_HELPER_8(int frame) { - int offset = 22847; - for (int i = 0; i <= 12; ++i) { - memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + 0x958 + frame * 182 + i * 14, 14); - } -} - -void IgorEngine::PART_15_HELPER_9(int frame) { - int offset = 22835; - for (int i = 0; i <= 22; ++i) { - memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + frame * 598 + i * 26, 26); - } -} - -void IgorEngine::PART_15() { - _gameState.enableLight = 2; - loadRoomData(PAL_TobiasOffice, IMG_TobiasOffice, BOX_TobiasOffice, MSK_TobiasOffice, TXT_TobiasOffice); - static const int anm[] = { ANM_TobiasOffice1, AOF_TobiasOffice1, ANM_TobiasOffice2, AOF_TobiasOffice2, 0 }; - loadAnimData(anm); - loadActionData(DAT_TobiasOffice); - _roomDataOffsets = PART_15_ROOM_DATA_OFFSETS; - setRoomWalkBounds(28, 0, 96, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_15_EXEC_ACTION); - _updateRoomBackground = &IgorEngine::PART_15_UPDATE_ROOM_BACKGROUND; - PART_15_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - _gameState.unk10 = 1; - _gameState.unk11 = 2; - _gameState.counter[3] = 0; - _gameState.counter[4] = 0; - PART_15_HELPER_2(); - enterPartLoop(); - while (_currentPart == 150) { - runPartLoop(); - } - leavePartLoop(); - if (_objectsState[48] == 1) { - _objectsState[48] = 2; - } - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp deleted file mode 100644 index 39856d321f..0000000000 --- a/engines/igor/parts/part_16.cpp +++ /dev/null @@ -1,294 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static int VAR_CURRENT_TALKING_ACTOR; - -void IgorEngine::PART_16_EXEC_ACTION(int action) { - debugC(9, kDebugGame, "PART_16_EXEC_ACTION %d", action); - switch (action) { - case 101: - PART_16_ACTION_101(); - break; - case 102: - ADD_DIALOGUE_TEXT(208, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 103: - _currentPart = 261; - break; - default: - error("PART_16_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_16_ACTION_101() { - if (_objectsState[52] == 1) { - ADD_DIALOGUE_TEXT(207, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - ADD_DIALOGUE_TEXT(201, 1); - ADD_DIALOGUE_TEXT(202, 2); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - for (int i = 1; i <= 2; ++i) { - int offset = 20332; - for (int j = 0; j <= 48; ++j) { - const uint8 *src = _animFramesBuffer + j * 23 + (i - 1) * 1127; - memcpy(_screenVGA + j * 320 + offset, src, 23); - } - waitForTimer(120); - } - addObjectToInventory(20, 55); - _objectsState[52] = 1; - if (_game.version == kIdEngDemo110) { - ++_demoActionsCounter; - } - ADD_DIALOGUE_TEXT(204, 3); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); -} - -void IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET_HARRISON(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_16_HELPER_6((VAR_CURRENT_TALKING_ACTOR == 0) ? 34 : 48); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_16_HELPER_6((VAR_CURRENT_TALKING_ACTOR == 0) ? getRandomNumber(5) + 30 : getRandomNumber(5) + 44); - break; - } -} - -void IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_16_HELPER_6(49); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_16_HELPER_6(getRandomNumber(4) + 49); - break; - } -} - -void IgorEngine::PART_16_HELPER_1(int num) { -} - -void IgorEngine::PART_16_HELPER_2() { - WalkData *wd = &_walkData[0]; - wd->setPos(0, 135, 2, 0); - wd->clipSkipX = 1; - wd->clipWidth = 30; - wd->scaleWidth = 50; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 0; - wd->scaleHeight = 50; - _walkDataLastIndex = 0; - buildWalkPath(0, 135, 90, 135); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_16_HELPER_3() { - memset(_screenVGA + 46080, 0, 17920); - ADD_DIALOGUE_TEXT(210, 1); - ADD_DIALOGUE_TEXT(211, 1); - ADD_DIALOGUE_TEXT(212, 1); - ADD_DIALOGUE_TEXT(213, 2); - SET_DIALOGUE_TEXT(1, 4); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - --_walkDataLastIndex; - buildWalkPath(90, 135, 200, 143); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _walkDataCurrentIndex = 0; - for (int i = 15; i >= 0; --i) { - if (i == 15) { - _walkCurrentFrame = 0; - } - _walkData[0].setPos(200, 143, 3, _walkCurrentFrame); - WalkData::setNextFrame(3, _walkCurrentFrame); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 30; - _walkData[0].scaleWidth = i * 3 + 5; - _walkData[0].xPosChanged = 1; - _walkData[0].dxPos = 0; - _walkData[0].yPosChanged = 1; - _walkData[0].dyPos = 3; - _walkData[0].scaleHeight = 50; - moveIgor(_walkData[0].posNum, _walkData[0].frameNum); - waitForTimer(15); - } - fadeOutPalette(768); - _currentPart = 331; - PART_33(); - memset(_currentPalette, 0, 768); - setPaletteRange(208, 255); - do { - PART_MARGARET_ROOM_CUTSCENE(); - } while (_objectsState[110] != 9); - setupDefaultPalette(); - SET_PAL_240_48_1(); - SET_PAL_208_96_1(); - loadResourceData__ROOM_Laboratory(); - loadResourceData__ANIM_Laboratory(); - memcpy(_screenVGA, _screenLayer1, 46080); - PART_16_HELPER_1(255); - fadeInPalette(768); - waitForTimer(255); - for (int i = 1; i <= 29; ++i) { - decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true); - waitForTimer(25); - } - ADD_DIALOGUE_TEXT(215, 1); - ADD_DIALOGUE_TEXT(216, 1); - ADD_DIALOGUE_TEXT(217, 1); - SET_DIALOGUE_TEXT(1, 3); - startCutsceneDialogue(175, 78, 0, 58, 40); - VAR_CURRENT_TALKING_ACTOR = 0; - _updateDialogue = &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET_HARRISON; - waitForEndOfCutsceneDialogue(175, 78, 0, 58, 40); - _updateDialogue = 0; - for (int i = 35; i <= 41; ++i) { - decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true); - waitForTimer(35); - } - ADD_DIALOGUE_TEXT(218, 2); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(88, 69, 63, 32, 0); - _updateDialogue = &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET; - waitForEndOfCutsceneDialogue(88, 69, 63, 32, 0); - _updateDialogue = 0; - for (int i = 42; i <= 43; ++i) { - decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true); - waitForTimer(35); - } - ADD_DIALOGUE_TEXT(220, 1); - ADD_DIALOGUE_TEXT(221, 1); - SET_DIALOGUE_TEXT(1, 2); - startCutsceneDialogue(175, 78, 0, 58, 40); - VAR_CURRENT_TALKING_ACTOR = 1; - _updateDialogue = &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET_HARRISON; - waitForEndOfCutsceneDialogue(175, 78, 0, 58, 40); - _updateDialogue = 0; - ADD_DIALOGUE_TEXT(222, 2); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(88, 69, 63, 32, 0); - _updateDialogue = &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET; - waitForEndOfCutsceneDialogue(88, 69, 63, 32, 0); - _updateDialogue = 0; - playSound(26, 1); - for (int i = 53; i <= 61; ++i) { - decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true); - waitForTimer(35); - } - playSound(25, 1); - for (int i = 1; i <= 20; ++i) { - int frame = getRandomNumber(4) + 61; - decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + frame * 2) - 1, _screenVGA, true); - waitForTimer(15); - } - playSound(27, 1); - PART_16_HELPER_5(); - for (int i = 1; i <= 3; ++i) { - waitForTimer(255); - } - PART_16_HELPER_1(255); - addObjectToInventory(19, 54); - _objectsState[53] = 1; - _objectsState[65] = 3; - playMusic(3); - _currentPart = 261; -} - -void IgorEngine::PART_16_HELPER_5() { - memset(&_currentPalette[3], 63, 621); - setPaletteRange(1, 207); - loadData(IMG_PhotoHarrisonMargaret, _screenVGA); - loadData(PAL_PhotoHarrisonMargaret, _paletteBuffer); - for (int m = 1; m <= 63; ++m) { - for (int i = 3; i <= 207 * 3; ++i) { - if (_paletteBuffer[i] <= m && _paletteBuffer[i] >= _currentPalette[i]) { - --_currentPalette[i]; - } - } - setPaletteRange(1, 207); - waitForTimer(); - } -} - -void IgorEngine::PART_16_HELPER_6(int frame) { - const uint8 *src = _animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + frame * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); -} - -void IgorEngine::PART_16() { - _gameState.enableLight = 1; - loadResourceData__ROOM_Laboratory(); - loadResourceData__ANIM_Laboratory(); - loadActionData(DAT_Laboratory); - _roomDataOffsets = PART_16_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 248, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_16_EXEC_ACTION); - PART_16_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - PART_16_HELPER_2(); - if (_objectsState[65] == 2 && _inventoryInfo[71] != 0 && _objectsState[76] == 1) { - PART_16_HELPER_3(); - } - enterPartLoop(); - while (_currentPart == 160) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -void IgorEngine::loadResourceData__ROOM_Laboratory() { - loadRoomData(PAL_Laboratory, IMG_Laboratory, BOX_Laboratory, MSK_Laboratory, TXT_Laboratory); -} - -void IgorEngine::loadResourceData__ANIM_Laboratory() { - static const int anm[] = { FRM_Laboratory1, FRM_Laboratory2, FRM_Laboratory3, 0 }; - loadAnimData(anm); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp deleted file mode 100644 index e4b227307e..0000000000 --- a/engines/igor/parts/part_17.cpp +++ /dev/null @@ -1,517 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static int VAR_CURRENT_TALKING_ACTOR; - -void IgorEngine::PART_17_EXEC_ACTION(int action) { - debugC(9, kDebugGame, "PART_17_EXEC_ACTION %d", action); - switch (action) { - case 101: - PART_17_ACTION_101(); - break; - case 102: - ADD_DIALOGUE_TEXT(225, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 103: - PART_17_ACTION_103(); - break; - case 104: - ADD_DIALOGUE_TEXT(220, 3); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 105: - PART_17_ACTION_105(); - break; - case 106: - PART_17_ACTION_106(); - break; - default: - error("PART_17_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_17_ACTION_101() { - _roomObjectAreasTable[_screenLayer2[22034]].area = 8; - _roomObjectAreasTable[_screenLayer2[23923]].area = 8; - --_walkDataLastIndex; - buildWalkPath(243, 77, 243, 74); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - buildWalkPath(243, 74, 274, 68); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 302; -} - -void IgorEngine::PART_17_ACTION_103() { - PART_17_HELPER_8(0); - if (_gameState.counter[4] == 1) { - ADD_DIALOGUE_TEXT(201, 2); - } else if (_gameState.counter[4] == 2) { - ADD_DIALOGUE_TEXT(206, 2); - } else if (_gameState.counter[4] == 3) { - ADD_DIALOGUE_TEXT(210, 2); - } - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(156, 32, 35, 38, 47); - _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP; - waitForEndOfCutsceneDialogue(156, 32, 35, 38, 47); - _updateDialogue = 0; - if (_gameState.counter[4] == 1) { - ADD_DIALOGUE_TEXT(203, 1); - ADD_DIALOGUE_TEXT(204, 2); - SET_DIALOGUE_TEXT(1, 2); - } else if (_gameState.counter[4] == 2) { - ADD_DIALOGUE_TEXT(208, 2); - SET_DIALOGUE_TEXT(1, 1); - } else if (_gameState.counter[4] == 3) { - ADD_DIALOGUE_TEXT(212, 2); - ADD_DIALOGUE_TEXT(214, 1); - SET_DIALOGUE_TEXT(1, 2); - } - startCutsceneDialogue(135, 33, 63, 63, 0); - VAR_CURRENT_TALKING_ACTOR = 0; - _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP_JIMMY; - waitForEndOfCutsceneDialogue(135, 33, 63, 63, 0); - _updateDialogue = 0; - PART_17_HELPER_11(0); - waitForTimer(255); - ADD_DIALOGUE_TEXT(215 + getRandomNumber(4), 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(135, 33, 63, 63, 0); - VAR_CURRENT_TALKING_ACTOR = 1; - _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP_JIMMY; - waitForEndOfCutsceneDialogue(135, 33, 63, 63, 0); - _updateDialogue = 0; - PART_17_HANDLE_DIALOGUE_PHILIP(); - PART_17_HELPER_1(255); - PART_17_HELPER_8(0); - --_walkDataLastIndex; - buildWalkPath(104, 87, 143, 123); - _walkDataCurrentIndex = 1; - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); - ADD_DIALOGUE_TEXT(219, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - if (_gameState.counter[4] == 3) { - _gameState.counter[4] = 1; - } else { - ++_gameState.counter[4]; - } -} - -void IgorEngine::PART_17_ACTION_105() { - _roomObjectAreasTable[5].area = 1; - _roomObjectAreasTable[10].area = 2; - _roomObjectAreasTable[11].area = 2; - _roomObjectAreasTable[13].area = 2; - _roomObjectAreasTable[16].area = 3; - _roomObjectAreasTable[17].area = 4; - _roomObjectAreasTable[26].area = 4; - _roomObjectAreasTable[28].area = 4; - --_walkDataLastIndex; - buildWalkPath(45, 95, 41, 86); - _walkDataCurrentIndex = 1; - _walkData[_walkDataLastIndex].frameNum = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - PART_17_HELPER_5(143); - --_walkDataLastIndex; - _roomObjectAreasTable[_screenLayer2[44836]].area = 4; - buildWalkPath(41, 86, 36, 143); - _roomObjectAreasTable[_screenLayer2[44836]].area = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - for (int i = _walkDataCurrentIndex; i <= _walkDataLastIndex; ++i) { - _walkData[i].posNum = kFacingPositionBack; - } - waitForIgorMove(); - for (int i = 17; i <= 85; ++i) { - _walkYScaleRoom[i] = ((i - 13) / 4) + 5; - } - for (int i = 86; i <= 135; ++i) { - _walkYScaleRoom[i] = 23; - } - _walkData[0].setPos(65, 115, 1, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 14; - _walkData[0].scaleWidth = 23; - _walkData[0].scaleHeight = 23; - _walkDataLastIndex = 0; - _roomObjectAreasTable[_screenLayer2[36865]].area = 4; - buildWalkPath(65, 115, 21, 17); - _roomObjectAreasTable[_screenLayer2[36865]].area = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 40; -} - -void IgorEngine::PART_17_ACTION_106() { - if (_objectsState[55] == 1) { - ADD_DIALOGUE_TEXT(226, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - playSound(24, 1); - for (int i = 0; i <= 8; ++i) { - int offset = 12575; - for (int j = 0; j <= 27; ++j) { - memcpy(_screenVGA + offset + i * 320, _animFramesBuffer + 0x1E6E + j * 40 + i * 1120, 40); - } - waitForTimer(30); - } - int offset = 12575; - for (int i = 0; i <= 27; ++i) { - memcpy(_screenVGA + offset + i * 320, _animFramesBuffer + 0x1E6E + i * 40, 40); - } - _objectsState[55] = 1; - _objectsState[3] = 1; - PART_17_HELPER_1(255); - UPDATE_OBJECT_STATE(4); - if (_game.version == kIdEngDemo110) { - ++_demoActionsCounter; - } - --_walkDataLastIndex; - buildWalkPath(104, 87, 143, 123); - _walkDataCurrentIndex = 1; - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); - ADD_DIALOGUE_TEXT(223, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); -} - -void IgorEngine::PART_17_HANDLE_DIALOGUE_PHILIP() { - loadDialogueData(DLG_OutsideCollege); - warning("PART_17_HANDLE_DIALOGUE_PHILIP unimplemented"); -} - -void IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_17_HELPER_9(0); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_17_HELPER_9(getRandomNumber(7)); - break; - } -} - -void IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP_JIMMY(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - if (VAR_CURRENT_TALKING_ACTOR == 0) { - PART_17_HELPER_8(0); - } else { - PART_17_HELPER_11(0); - } - break; - case kUpdateDialogueAnimMiddleOfSentence: - if (VAR_CURRENT_TALKING_ACTOR == 0) { - PART_17_HELPER_8(getRandomNumber(7)); - } else { - PART_17_HELPER_11(getRandomNumber(6)); - } - break; - } -} - -void IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND() { - if (compareGameTick(3, 32) && _gameState.unkF) { - switch (_gameState.unk10 / 16) { - case 0: - PART_17_HELPER_8(0); - PART_17_HELPER_9(getRandomNumber(7)); - break; - case 1: - PART_17_HELPER_8(getRandomNumber(7)); - PART_17_HELPER_9(0); - } - if (_gameState.unk10 == 31) { - _gameState.unk10 = 0; - } else { - ++_gameState.unk10; - } - } -} - -void IgorEngine::PART_17_HELPER_1(int num) { - if (num == 1 || num == 255) { - if (_objectsState[54] == 0) { - _gameState.unkF = false; - } else { - PART_17_HELPER_3(0); - _gameState.unkF = true; - } - } - if (num == 2 || num == 255) { - if (_objectsState[55] == 1) { - _roomActionsTable[2698] = 0; - } - } - if (num == 3 || num == 255) { - if (_objectsState[56] == 1) { - _gameState.unkF = false; - PART_17_HELPER_3(6); - } - } -} - -void IgorEngine::PART_17_HELPER_2() { - for (int i = 17; i <= 85; ++i) { - _walkYScaleRoom[i] = ((i - 13) / 4) + 5; - } - for (int i = 86; i <= 135; ++i) { - _walkYScaleRoom[i] = 23; - } - WalkData *wd = &_walkData[0]; - wd->setPos(21, 17, 3, 0); - wd->clipSkipX = 1; - wd->clipWidth = 4; - wd->scaleWidth = 6; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 0; - wd->scaleHeight = 6; - _walkDataLastIndex = 0; - _roomObjectAreasTable[_screenLayer2[36865]].area = 4; - buildWalkPath(21, 17, 65, 115); - _roomObjectAreasTable[_screenLayer2[36865]].area = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - for (int i = 17; i <= 135; ++i) { - _walkYScaleRoom[i] = 50; - } - _walkData[0].setPos(36, 140, 3, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 30; - _walkDataLastIndex = 0; - _roomObjectAreasTable[_screenLayer2[44836]].area = 4; - buildWalkPath(36, 143, 41, 86); - _roomObjectAreasTable[_screenLayer2[44836]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - for (int i = _walkDataCurrentIndex; i <= _walkDataLastIndex; ++i) { - _walkData[i].posNum = kFacingPositionFront; - } - waitForIgorMove(); - PART_17_HELPER_5(0); - --_walkDataLastIndex; - buildWalkPath(41, 86, 45, 95); - _walkDataCurrentIndex = 2; - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); - _roomObjectAreasTable[5].area = 0; - _roomObjectAreasTable[10].area = 0; - _roomObjectAreasTable[11].area = 0; - _roomObjectAreasTable[13].area = 0; - _roomObjectAreasTable[16].area = 0; - _roomObjectAreasTable[17].area = 0; - _roomObjectAreasTable[26].area = 0; - _roomObjectAreasTable[28].area = 0; -} - -void IgorEngine::PART_17_HELPER_3(int lum) { - _roomObjectAreasTable[18].y1Lum = lum; - _roomObjectAreasTable[19].y1Lum = lum; - _roomObjectAreasTable[20].y1Lum = lum; -} - -void IgorEngine::PART_17_HELPER_4() { - int offset = 11642; - for (int i = 0; i <= 48; ++i) { - memcpy(_screenLayer1 + offset + i * 320, _animFramesBuffer + i * 44, 44); - memcpy(_screenVGA + offset + i * 320, _animFramesBuffer + i * 44, 44); - } -} - -void IgorEngine::PART_17_HELPER_5(int lum) { - _roomObjectAreasTable[23].y1Lum = lum; - _roomObjectAreasTable[26].y1Lum = lum; - _roomObjectAreasTable[27].y1Lum = lum; - _roomObjectAreasTable[32].y1Lum = lum; -} - -void IgorEngine::PART_17_HELPER_6() { - playMusic(2); - PART_17_HELPER_1(255); - fadeInPalette(768); - _walkData[0].setPos(274, 68, 4, 1); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 30; - _walkCurrentFrame = 1; - _walkDataCurrentIndex = 0; - _walkDataLastIndex = 0; - _roomObjectAreasTable[_screenLayer2[22034]].area = 8; - _roomObjectAreasTable[_screenLayer2[23923]].area = 8; - buildWalkPath(274, 68, 243, 74); - _roomObjectAreasTable[_screenLayer2[22034]].area = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - --_walkDataLastIndex; - buildWalkPath(243, 74, 205, 124); - _roomObjectAreasTable[_screenLayer2[23923]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - PART_17_HELPER_5(0); - _roomObjectAreasTable[5].area = 0; - _roomObjectAreasTable[10].area = 0; - _roomObjectAreasTable[11].area = 0; - _roomObjectAreasTable[13].area = 0; - _roomObjectAreasTable[16].area = 0; - _roomObjectAreasTable[17].area = 0; - _roomObjectAreasTable[26].area = 0; - _roomObjectAreasTable[28].area = 0; -} - -void IgorEngine::PART_17_HELPER_8(int num) { - for (int i = 0; i <= 8; ++i) { - for (int j = 0; j <= 10; ++j) { - int offset = (36 + i) * 320 + 130 + j; - uint8 color = _screenVGA[offset]; - if (color >= 0xF0 && color <= 0xF1) { - _screenTempLayer[i * 100 + j] = _screenVGA[offset]; - } else { - _screenTempLayer[i * 100 + j] = _animFramesBuffer[num * 99 + i * 11 + j + 0x1967]; - } - } - } - int offset = 11650; - for (int i = 0; i <= 8; ++i) { - memcpy(_screenVGA + i * 320 + offset, _screenTempLayer + i * 100, 11); - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + num * 99 + i * 11 + 0x1967, 11); - } -} - -void IgorEngine::PART_17_HELPER_9(int num) { - for (int i = 0; i <= 26; ++i) { - for (int j = 0; j <= 22; ++j) { - int offset = (36 + i) * 320 + 143 + j; - uint8 color = _screenVGA[offset]; - if ((color >= 0xC0 && color <= 0xCF) || (color >= 0xF0 && color <= 0xF1)) { - _screenTempLayer[i * 100 + j] = _screenVGA[offset]; - } else { - _screenTempLayer[i * 100 + j] = _animFramesBuffer[num * 621 + i * 23 + j + 0x86C]; - } - } - } - int offset = 11663; - for (int i = 0; i <= 26; ++i) { - memcpy(_screenVGA + i * 320 + offset, _screenTempLayer + i * 100, 23); - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + num * 621 + i * 23 + 0x86C, 23); - } -} - -void IgorEngine::PART_17_HELPER_11(int frame) { - for (int i = 0; i <= 8; ++i) { - for (int j = 0; j <= 10; ++j) { - int offset = (i + 36) * 320 + j + 130; - uint8 color = _screenVGA[offset]; - if (color != 0 && color != 240) { - color = _animFramesBuffer[0x1C1C + frame * 99 + i * 11 + j]; - } - _screenTempLayer[100 * i + j] = color; - } - } - for (int i = 0; i <= 8; ++i) { - const int offset = i * 320 + 11650; - memcpy(_screenVGA + offset, _screenTempLayer + i * 100, 11); - memcpy(_screenLayer1 + offset, _animFramesBuffer + 0x1C1C + frame * 99 + i * 11, 11); - } -} - -void IgorEngine::PART_17() { - _gameState.enableLight = 1; - loadRoomData(PAL_OutsideCollege, IMG_OutsideCollege, BOX_OutsideCollege, MSK_OutsideCollege, TXT_OutsideCollege); - static const int anm[] = { FRM_OutsideCollege1, FRM_OutsideCollege2, FRM_OutsideCollege3, FRM_OutsideCollege4, FRM_OutsideCollege5, 0 }; - loadAnimData(anm); - loadActionData(DAT_OutsideCollege); - _roomDataOffsets = PART_17_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 286, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_17_EXEC_ACTION); - _updateRoomBackground = &IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND; - PART_17_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - if (_objectsState[56] == 1) { - _gameState.unkF = false; - PART_17_HELPER_3(6); - _roomObjectAreasTable[14].object = 0; - _roomObjectAreasTable[15].object = 0; - _roomObjectAreasTable[19].object = 0; - } else if (_gameState.unkF) { - PART_17_HELPER_4(); - _gameState.counter[4] = 1; - } else { - _roomObjectAreasTable[14].object = 0; - _roomObjectAreasTable[15].object = 0; - _roomObjectAreasTable[19].object = 0; - } - _currentAction.verb = kVerbWalk; - if (_currentPart == 170) { - fadeInPalette(768); - PART_17_HELPER_2(); - } else if (_currentPart == 171) { - PART_17_HELPER_6(); - } - enterPartLoop(); - while (_currentPart >= 170 && _currentPart <= 171) { - runPartLoop(); - } - leavePartLoop(); - if (_objectsState[55] == 1) { - _objectsState[56] = 1; - } - if (_objectsState[54] == 0) { - _objectsState[54] = 1; - } - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp deleted file mode 100644 index 560ee35ccd..0000000000 --- a/engines/igor/parts/part_18.cpp +++ /dev/null @@ -1,202 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_18_EXEC_ACTION(int action) { - switch (action) { - case 101: - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 102: - ADD_DIALOGUE_TEXT(202, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 103: - ADD_DIALOGUE_TEXT(205, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(99, 54, 43, 63, 0); - waitForEndOfCutsceneDialogue(99, 54, 43, 63, 0); - break; - case 104: - ADD_DIALOGUE_TEXT(206, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(132, 55, 63, 42, 0); - waitForEndOfCutsceneDialogue(132, 55, 63, 42, 0); - break; - case 105: - ADD_DIALOGUE_TEXT(207, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(167, 56, 0, 42, 42); - waitForEndOfCutsceneDialogue(167, 56, 0, 42, 42); - break; - case 106: - ADD_DIALOGUE_TEXT(208, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 107: - ADD_DIALOGUE_TEXT(209, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 108: - ADD_DIALOGUE_TEXT(210, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 109: - PART_18_ACTION_109(); - break; - case 110: - _currentPart = 252; - break; - case 111: - PART_18_ACTION_111(); - break; - default: - error("PART_18_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_18_ACTION_109() { - const int offset = 29480; - for (int i = 1; i <= 2; ++i) { - for (int j = 1; j <= 48; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + (i - 1) * 1519 + j * 31, 31); - } - waitForTimer(120); - } - int part = _currentPart; - _currentPart = 191; - fadeOutPalette(768); - PART_19(); - memcpy(_screenVGA, _screenLayer2, 46080); - loadResourceData__ROOM_MenToilets(); - loadResourceData__ANIM_MenToilets(); - loadActionData(DAT_MenToilets); - _roomDataOffsets = PART_18_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 319, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_18_EXEC_ACTION); - PART_18_HELPER_1(255); - memset(_screenVGA + 46080, 0, 17920); - drawVerbsPanel(); - removeObjectFromInventory(53); - fadeInPalette(768); - _currentPart = part; - ADD_DIALOGUE_TEXT(215, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); -} - -void IgorEngine::PART_18_ACTION_111() { - if (_objectsState[0] == 0) { - ADD_DIALOGUE_TEXT(211, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - if (_objectsState[0] == 2) { - ADD_DIALOGUE_TEXT(212, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - const int offset = 26798; - for (int i = 0; i <= 28; ++i) { - memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 28 + 0xF0A, 28); - } - playSound(47, 1); - for (int i = 1; i <= 2; ++i) { - waitForTimer(200); - } - for (int i = 0; i <= 28; ++i) { - memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 28 + 0xBDE, 28); - } - ADD_DIALOGUE_TEXT(213, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - _objectsState[0] = 2; - UPDATE_OBJECT_STATE(1); -} - -void IgorEngine::PART_18_HELPER_1(int num) { -} - -void IgorEngine::PART_18_HELPER_2() { - _walkData[0].setPos(319, 142, 4, 0); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 15; - _walkData[0].scaleWidth = 50; - _walkData[0].xPosChanged = 1; - _walkData[0].dxPos = 0; - _walkData[0].yPosChanged = 1; - _walkData[0].dyPos = 0; - _walkData[0].scaleHeight = 50; - _walkDataLastIndex = 0; - buildWalkPath(319, 142, 295, 142); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_18() { - _gameState.enableLight = 1; - loadResourceData__ROOM_MenToilets(); - loadResourceData__ANIM_MenToilets(); - loadActionData(DAT_MenToilets); - _roomDataOffsets = PART_18_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 319, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_18_EXEC_ACTION); - PART_18_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - PART_18_HELPER_2(); - enterPartLoop(); - while (_currentPart == 180) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -void IgorEngine::loadResourceData__ROOM_MenToilets() { - loadRoomData(PAL_MenToilets, IMG_MenToilets, BOX_MenToilets, MSK_MenToilets, TXT_MenToilets); -} - -void IgorEngine::loadResourceData__ANIM_MenToilets() { - static const int anm[] = { FRM_MenToilets1, FRM_MenToilets2, 0 }; - loadAnimData(anm); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp deleted file mode 100644 index 26cbea9d83..0000000000 --- a/engines/igor/parts/part_19.cpp +++ /dev/null @@ -1,323 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static int VAR_CURRENT_TALKING_ACTOR; - -void IgorEngine::PART_19_EXEC_ACTION(int action) { - switch (action) { - case 101: - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 102: - ADD_DIALOGUE_TEXT(202, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(99, 54, 43, 63, 0); - waitForEndOfCutsceneDialogue(99, 54, 43, 63, 0); - break; - case 103: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(132, 55, 63, 42, 0); - waitForEndOfCutsceneDialogue(132, 55, 63, 42, 0); - break; - case 104: - ADD_DIALOGUE_TEXT(204, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(167, 56, 0, 42, 42); - waitForEndOfCutsceneDialogue(167, 56, 0, 42, 42); - break; - case 105: - ADD_DIALOGUE_TEXT(205, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 106: - _currentPart = 232; - break; - case 107: - PART_19_ACTION_107(); - break; - case 108: - ADD_DIALOGUE_TEXT(208, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 109: - PART_19_ACTION_109(); - break; - default: - error("PART_19_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_19_ACTION_107() { - if (_objectsState[58] == 1) { - ADD_DIALOGUE_TEXT(211, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - ADD_DIALOGUE_TEXT(206, 1); - ADD_DIALOGUE_TEXT(207, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - for (int i = 1; i <= 2; ++i) { - const int offset = 27110; - for (int j = 0; j <= 48; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + i * 1372 + j * 28 - 506, 28); - waitForTimer(120); - } - } - addObjectToInventory(12, 47); - _objectsState[58] = 1; - PART_19_HELPER_1(255); -} - -void IgorEngine::PART_19_ACTION_109() { - if (_objectsState[2] == 1) { - ADD_DIALOGUE_TEXT(210, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - for (int i = 1; i <= 4; ++i) { - const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x354 + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - waitForTimer(45); - } - decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x35E) - 1, _screenVGA, true); - playSound(45, 1); - PART_19_HELPER_5(); - PART_19_HELPER_1(255); - stopSound(); - decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x360) - 1, _screenVGA, true); - ADD_DIALOGUE_TEXT(209, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); -} - -void IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_19_HELPER_7((VAR_CURRENT_TALKING_ACTOR == 0) ? 35 : 40); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_19_HELPER_7((VAR_CURRENT_TALKING_ACTOR == 0) ? 35 + getRandomNumber(5) : 40 + getRandomNumber(5)); - break; - } -} - -void IgorEngine::PART_19_UPDATE_BACKGROUND_HELPER_9() { - if (compareGameTick(3, 64) && _gameState.counter[1] <= 34) { - const uint8 *src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x404F + _gameState.counter[1] * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - ++_gameState.counter[1]; - } -} - -void IgorEngine::PART_19_HELPER_1(int num) { - if (num == 2 || num == 255) { - if (_objectsState[59] == 0) { - decodeAnimFrame(_animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x4051) - 1, _screenLayer1, true); - } - } -} - -void IgorEngine::PART_19_HELPER_2() { - int talkSpeed = _gameState.talkSpeed; - _gameState.talkSpeed = 5; - memcpy(_screenLayer2, _screenVGA, 46080); - memcpy(_screenVGA, _screenLayer1, 46080); - const uint8 *src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x4051) - 1; - decodeAnimFrame(src, _screenVGA, true); - memcpy(_screenLayer1, _screenVGA, 46080); - fadeInPalette(624); - ADD_DIALOGUE_TEXT(212, 3); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(243, 92, 63, 23, 33); - VAR_CURRENT_TALKING_ACTOR = 0; - _updateDialogue = &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN; - waitForEndOfCutsceneDialogue(243, 92, 63, 23, 33); - _updateDialogue = 0; - for (int i = 2; i <= 9; ++i) { - src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x404F + i * 2) - 1; - waitForTimer(60); - } - ADD_DIALOGUE_TEXT(215, 1); - ADD_DIALOGUE_TEXT(216, 2); - SET_DIALOGUE_TEXT(1, 2); - startCutsceneDialogue(227, 91, 0, 63, 63); - _gameState.counter[1] = 10; - VAR_CURRENT_TALKING_ACTOR = 1; - _updateRoomBackground = &IgorEngine::PART_19_UPDATE_BACKGROUND_HELPER_9; - waitForEndOfCutsceneDialogue(227, 91, 0, 63, 63); - _updateRoomBackground = 0; - while (_gameState.counter[1] != 35) { - PART_19_UPDATE_BACKGROUND_HELPER_9(); - } - for (int i = 47; i <= 48; ++i) { - src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x404F + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - waitForTimer(30); - } - for (int i = 1; i <= 3; ++i) { - for (int j = 49; j <= 50; ++j) { - src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x404F + j * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - waitForTimer(30); - if (j == 50) { - playSound(46, 1); - } - } - } - src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x40B5) - 1; - decodeAnimFrame(src, _screenVGA, true); - waitForTimer(30); - ADD_DIALOGUE_TEXT(218, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(243, 92, 63, 23, 33); - VAR_CURRENT_TALKING_ACTOR = 0; - _updateDialogue = &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN; - waitForEndOfCutsceneDialogue(243, 92, 63, 23, 33); - _updateDialogue = 0; - ADD_DIALOGUE_TEXT(219, 2); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(227, 91, 0, 63, 63); - VAR_CURRENT_TALKING_ACTOR = 1; - _updateDialogue = &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN; - waitForEndOfCutsceneDialogue(227, 91, 0, 63, 63); - _updateDialogue = 0; - ADD_DIALOGUE_TEXT(221, 2); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(243, 92, 63, 23, 33); - VAR_CURRENT_TALKING_ACTOR = 0; - _updateDialogue = &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN; - waitForEndOfCutsceneDialogue(243, 92, 63, 23, 33); - _updateDialogue = 0; - ADD_DIALOGUE_TEXT(223, 2); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(227, 91, 0, 63, 63); - VAR_CURRENT_TALKING_ACTOR = 1; - _updateDialogue = &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN; - waitForEndOfCutsceneDialogue(227, 91, 0, 63, 63); - _updateDialogue = 0; - _objectsState[59] = 1; - fadeOutPalette(624); - _gameState.talkSpeed = talkSpeed; -} - -void IgorEngine::PART_19_HELPER_3() { - _walkData[0].setPos(319, 142, 1, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - buildWalkPath(319, 142, 295, 142); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_19_HELPER_4() { - decodeAnimFrame(_animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x40AB) - 1, _screenVGA, true); - waitForTimer(60); - ADD_DIALOGUE_TEXT(225, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - --_walkDataLastIndex; - buildWalkPath(295, 142, 319, 142); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 232; -} - -void IgorEngine::PART_19_HELPER_5() { - fadeOutPalette(624); - uint8 *tmp = (uint8 *)malloc(64000 + 768); - if (tmp) { - memcpy(tmp, _screenVGA, 64000); - memcpy(tmp + 64000, _paletteBuffer, 768); - } - loadData(IMG_RomanNumbersPaper, _screenVGA); - loadData(PAL_RomanNumbersPaper, _paletteBuffer); - fadeInPalette(624); - PART_UPDATE_FIGURES_ON_PAPER(60); - _objectsState[2] = 1; - waitForTimer(255); - if (tmp) { - memcpy(_screenVGA, tmp, 64000); - memcpy(_paletteBuffer, tmp + 64000, 768); - free(tmp); - } -} - -void IgorEngine::PART_19_HELPER_7(int frame) { - const uint8 *src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x404F + frame * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); -} - -void IgorEngine::PART_19() { - _gameState.enableLight = 1; - loadRoomData(PAL_WomenToilets, IMG_WomenToilets, BOX_WomenToilets, MSK_WomenToilets, TXT_WomenToilets); - static const int anm[] = { FRM_WomenToilets1, FRM_WomenToilets2, FRM_WomenToilets3, FRM_WomenToilets4, FRM_WomenToilets5, 0 }; - loadAnimData(anm); - loadActionData(DAT_WomenToilets); - _roomDataOffsets = PART_19_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 319, 143); - if (_currentPart == 191) { - PART_19_HELPER_2(); - } else { - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_19_EXEC_ACTION); - PART_19_HELPER_1(255); - } - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - PART_19_HELPER_3(); - if (_objectsState[59] == 0) { - PART_19_HELPER_4(); - } else { - enterPartLoop(); - while (_currentPart == 190) { - runPartLoop(); - } - leavePartLoop(); - } - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp deleted file mode 100644 index ef284208a8..0000000000 --- a/engines/igor/parts/part_21.cpp +++ /dev/null @@ -1,480 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static const uint8 PART_21_ANIM_DATA_1[7] = { 0, 11, 12, 13, 20, 21, 14 }; - -static const uint8 PART_21_ANIM_DATA_2[11] = { 0, 4, 5, 4, 5, 4, 5, 4, 5, 6, 0 }; - -static bool IN_ACTION_111; - -void IgorEngine::PART_21_EXEC_ACTION(int action) { - switch (action) { - case 101: - PART_21_ACTION_101(); - break; - case 102: - PART_21_ACTION_102(); - break; - case 103: - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 104: - ADD_DIALOGUE_TEXT(202, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 105: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 106: - ADD_DIALOGUE_TEXT(204, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 107: - PART_21_ACTION_107(); - break; - case 108: - PART_21_ACTION_108(); - break; - case 109: - ADD_DIALOGUE_TEXT(205, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 110: - PART_21_ACTION_110(); - break; - case 111: - PART_21_ACTION_111(); - break; - case 112: - ADD_DIALOGUE_TEXT(222, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 113: - PART_21_ACTION_113(); - break; - default: - error("PART_21_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_21_ACTION_101() { - if (_objectsState[65] == 1) { - const int offset = 29440; - for (int i = 0; i <= 50; ++i) { - memcpy(_screenVGA + i * 320 + offset, _screenLayer1 + i * 320 + offset, 20); - } - PART_21_HELPER_10(); - } - _currentPart = 303; -} - -void IgorEngine::PART_21_ACTION_102() { - PART_21_HELPER_6(1); - ADD_DIALOGUE_TEXT(226, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(227, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(76, 87, 63, 32, 0); - _updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_2; - waitForEndOfCutsceneDialogue(76, 87, 63, 32, 0); - _updateDialogue = 0; - PART_21_HANDLE_DIALOGUE_MARGARET(); - PART_21_HELPER_1(255); -} - -void IgorEngine::PART_21_ACTION_107() { - if (_objectsState[64] == 1) { - EXEC_MAIN_ACTION(11); - return; - } - for (int i = 2; i <= 3; ++i) { - const int offset = 21902; - for (int j = 0; j <= 53; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + (i - 1) * 1782 + j * 33, 33); - } - if (i == 3) { - playSound(13, 1); - } else { - waitForTimer(100); - } - } - _objectsState[64] = 1; - PART_21_HELPER_1(1); -} - -void IgorEngine::PART_21_ACTION_108() { - if (_objectsState[64] == 0) { - EXEC_MAIN_ACTION(14); - return; - } - for (int i = 2; i >= 1; --i) { - const int offset = 21902; - for (int j = 0; j <= 53; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + (i - 1) * 1782 + j * 33, 33); - } - if (i == 2) { - playSound(14, 1); - waitForTimer(100); - } - } - _objectsState[64] = 0; - PART_21_HELPER_1(1); -} - -void IgorEngine::PART_21_ACTION_110() { - if (_objectsState[65] == 1) { - const int offset = 27180; - for (int i = 0; i <= 50; ++i) { - memcpy(_screenVGA + i * 320 + offset, _screenLayer1 + i * 320 + offset, 20); - } - PART_21_HELPER_10(); - } - _currentPart = 270; -} - -void IgorEngine::PART_21_ACTION_111() { - if (_inventoryInfo[65] == 0) { - ADD_DIALOGUE_TEXT(223, 2); - ADD_DIALOGUE_TEXT(225, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - return; - } - IN_ACTION_111 = true; - ADD_DIALOGUE_TEXT(208, 1); - ADD_DIALOGUE_TEXT(209, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - const int offset = 28183; - for (int i = 0; i <= 49; ++i) { - memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + 0xCBE1 + i * 26, 26); - } - waitForTimer(100); - int k = 1; - do { - if (compareGameTick(3, 24)) { - for (int j = 0; j <= 49; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + 0xBCA5 + PART_21_ANIM_DATA_2[k] * 1300 + j * 26, 26); - } - ++k; - } - PART_21_UPDATE_ROOM_BACKGROUND(); - waitForTimer(); - } while (k != 10); - IN_ACTION_111 = false; - removeObjectFromInventory(56); - _objectsState[65] = 1; - PART_21_HELPER_1(255); - if (_game.version == kIdEngDemo110) { - ++_demoActionsCounter; - } - ADD_DIALOGUE_TEXT(210, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); -} - -void IgorEngine::PART_21_ACTION_113() { - if (_objectsState[64] != 0) { - _roomObjectAreasTable[_screenLayer2[34679]].area = 1; - --_walkDataLastIndex; - buildWalkPathSimple(165, 126, 119, 108); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - if (_objectsState[65] == 1) { - PART_21_HELPER_10(); - } - _currentPart = 370; - } -} - -void IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_1(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_21_HELPER_11(6); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_21_HELPER_11(getRandomNumber(5) + 6); - break; - case kUpdateDialogueAnimStanding: - PART_21_HELPER_11(1); - break; - } -} - -void IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_2(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_21_HELPER_6(6); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_21_HELPER_6(getRandomNumber(5) + 6); - break; - } -} - -void IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_3(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_21_HELPER_6(15); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_21_HELPER_6(getRandomNumber(5) + 15); - break; - } -} - -void IgorEngine::PART_21_HANDLE_DIALOGUE_MARGARET() { - loadDialogueData(DLG_CollegeCorridorMargaret); - _updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_1; - handleDialogue(81, 76, 63, 32, 0); - _updateDialogue = 0; -} - -void IgorEngine::PART_21_HELPER_1(int num) { - if (num == 1 || num == 255) { - if (_objectsState[64] == 0) { - PART_21_HELPER_7(); - _roomActionsTable[4] = 6; - } else { - PART_21_HELPER_8(); - _roomActionsTable[4] = 7; - } - } - if (num == 2 || num == 255) { - if (_objectsState[65] > 1) { - PART_21_HELPER_9(); - } - if (_objectsState[65] == 2 || _objectsState[65] == 4) { - _roomObjectAreasTable[9].object = 0; - _roomObjectAreasTable[10].object = 0; - } - } -} - -void IgorEngine::PART_21_HELPER_2() { - _walkData[0].setPos(0, 141, 2, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 15; - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - buildWalkPathSimple(0, 141, 32, 137); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_21_HELPER_3() { - _walkData[0].setPos(319, 133, 4, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - buildWalkPathSimple(319, 133, 239, 133); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_21_HELPER_4() { - _walkData[0].setPos(119, 108, 2, 0); - _walkData[0].setDefaultScale(); - _walkDataLastIndex = 0; - _roomObjectAreasTable[_screenLayer2[34679]].area = 1; - buildWalkPathSimple(119, 108, 175, 130); - _roomObjectAreasTable[_screenLayer2[34679]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_21_HELPER_6(int frame) { - _roomCursorOn = false; - for (int i = 0; i <= 42; ++i) { - for (int j = 0; j <= 48; ++j) { - int offset = (i + 89) * 320 + j + 40; - uint8 color = _screenVGA[offset]; - if ((color >= 192 && color <= 207) || color == 240 || color == 241) { - _screenTempLayer[i * 100 + j] = _screenVGA[offset]; - } else { - _screenTempLayer[i * 100 + j] = _animFramesBuffer[frame * 2107 + i * 49 + j + 0xCA7]; - } - } - } - int offset = 28520; - for (int i = 0; i <= 42; ++i) { - memcpy(_screenVGA + i * 320 + offset, _screenTempLayer + i * 100, 49); - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + frame * 2107 + i * 49 + 0xCA7, 49); - } - if (_dialogueCursorOn) { - _roomCursorOn = true; - } -} - -void IgorEngine::PART_21_HELPER_7() { - const int offset = 21901; - for (int i = 0; i <= 53; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 33 + 0xE031, 33); - } -} - -void IgorEngine::PART_21_HELPER_8() { - const int offset = 21901; - for (int i = 0; i <= 53; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 33 + 0xE727, 33); - } -} - -void IgorEngine::PART_21_HELPER_9() { - const int offset = 21901; - for (int i = 0; i <= 42; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 49 + 0x14E2, 49); - } -} - -void IgorEngine::PART_21_HELPER_10() { - PART_21_HELPER_6(1); - memset(_screenVGA + 46080, 0, 17920); - waitForTimer(120); - for (int i = 1; i <= 6; ++i) { - PART_21_HELPER_6(PART_21_ANIM_DATA_1[i]); - if (i < 6) { - waitForTimer(100); - } - } - ADD_DIALOGUE_TEXT(212, 1); - ADD_DIALOGUE_TEXT(213, 1); - ADD_DIALOGUE_TEXT(214, 1); - ADD_DIALOGUE_TEXT(215, 2); - ADD_DIALOGUE_TEXT(217, 2); - SET_DIALOGUE_TEXT(1, 5); - startCutsceneDialogue(76, 87, 63, 32, 0); - _updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_3; - waitForEndOfCutsceneDialogue(76, 87, 63, 32, 0); - _updateDialogue = 0; - ADD_DIALOGUE_TEXT(219, 1); - ADD_DIALOGUE_TEXT(220, 1); - ADD_DIALOGUE_TEXT(221, 1); - SET_DIALOGUE_TEXT(1, 3); - startCutsceneDialogue(76, 87, 63, 32, 0); - _updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_3; - waitForEndOfCutsceneDialogue(76, 87, 63, 32, 0); - _updateDialogue = 0; - _objectsState[65] = 2; - drawVerbsPanel(); - _currentAction.verb = kVerbWalk; - drawInventory(_inventoryInfo[72], 0); - PART_21_HELPER_1(255); - _objectsState[110] = 1; -} - -void IgorEngine::PART_21_HELPER_11(int frame) { - const int offset = 28520; - for (int i = 0; i <= 42; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + frame * 2107 + i * 49 + 0xCA7, 49); - } -} - -void IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND() { - if (IN_ACTION_111 && compareGameTick(3, 24)) { - const int offset = 28183; - int i = getRandomNumber(2) + 1; - for (int j = 0; j <= 49; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + 0xBCA5 + i * 1300 + j * 26, 26); - } - ++i; - } - if (compareGameTick(61) && _objectsState[65] <= 1) { - if (_gameState.unk10 > 2) { - PART_21_HELPER_6(_gameState.unk10); - ++_gameState.unk10; - if (_gameState.unk10 == 6) { - ++_gameState.counter[4]; - if (_gameState.counter[4] < 2) { - _gameState.unk10 = 4; - } else { - _gameState.counter[4] = 0; - _gameState.unk10 = 1; - } - } - } else { - PART_21_HELPER_6(_gameState.unk10); - ++_gameState.unk10; - if (_gameState.unk10 == 3 && getRandomNumber(6) != 0) { - _gameState.unk10 = 1; - } - } - } -} - -void IgorEngine::PART_21() { - _gameState.enableLight = 2; - loadRoomData(PAL_CollegeCorridorMargaret, IMG_CollegeCorridorMargaret, BOX_CollegeCorridorMargaret, MSK_CollegeCorridorMargaret, TXT_CollegeCorridorMargaret); - static const int anm[] = { FRM_CollegeCorridorMargaret1, FRM_CollegeCorridorMargaret2, FRM_CollegeCorridorMargaret3, FRM_CollegeCorridorMargaret4, 0 }; - loadAnimData(anm); - loadActionData(DAT_CollegeCorridorMargaret); - _roomDataOffsets = PART_21_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 319, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_21_EXEC_ACTION); - _updateRoomBackground = &IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND; - PART_21_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - _gameState.unk10 = 1; - fadeInPalette(768); - if (_currentPart == 210) { - PART_21_HELPER_2(); - } else if (_currentPart == 211) { - PART_21_HELPER_3(); - } else if (_currentPart == 212) { - PART_21_HELPER_4(); - } - enterPartLoop(); - while (_currentPart >= 210 && _currentPart <= 212) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp deleted file mode 100644 index 7a7c26d477..0000000000 --- a/engines/igor/parts/part_22.cpp +++ /dev/null @@ -1,175 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static const uint8 PART_22_ANIM_DATA_1[4] = { 0, 1, 2, 1 }; - -void IgorEngine::PART_22_EXEC_ACTION(int action) { - switch (action) { - case 101: - PART_22_ACTION_101(); - break; - case 102: - PART_22_ACTION_102(); - break; - default: - error("PART_22_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_22_ACTION_101() { - if (_objectsState[78] == 1 && _inventoryInfo[64] == 0) { - ADD_DIALOGUE_TEXT(203, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - for (int i = 1; i <= 3; ++i) { - const int offset = 24141; - for (int j = 0; j <= 29; ++j) { - const uint8 *src = _animFramesBuffer + 0xA0E6 + PART_22_ANIM_DATA_1[i] * 1050 + j * 35; - memcpy(_screenVGA + j * 320 + offset, src, 35); - } - waitForTimer(60); - } - addObjectToInventory(29, 64); - PART_22_HELPER_1(255); - ADD_DIALOGUE_TEXT(205, 1); - ADD_DIALOGUE_TEXT(206, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - _objectsState[105] = 1; - } else { - ADD_DIALOGUE_TEXT(201, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - } -} - -void IgorEngine::PART_22_ACTION_102() { - _walkDataCurrentIndex = 0; - _walkCurrentFrame = 1; - int i = 0; - - for (i = 9; i >= 0; --i) { - WalkData *wd = &_walkData[0]; - wd->setPos(138, 123, 1, _walkCurrentFrame); - WalkData::setNextFrame(1, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 30; - wd->scaleWidth = 23 + i * 3; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 3; - wd->scaleHeight = 50; - moveIgor(wd->posNum, wd->frameNum); - waitForTimer(15); - } - i = 16; - do { - if (compareGameTick(1, 16)) { - memcpy(_screenTextLayer + (i * 8 + 16) * 320, _screenLayer1 + (128 - i * 8) * 320, (i * 8 + 16) * 320); - memcpy(_screenTextLayer + (i * 8 + 16) * 320, _animFramesBuffer, (128 - i * 8) * 320); - memcpy(_screenVGA, _screenTextLayer, 46080); - if (i == 0) { - i = 255; - } else { - --i; - } - } - waitForTimer(); - } while (i != 255); - _currentPart = 141; -} - -void IgorEngine::PART_22_HELPER_1(int num) { -} - -void IgorEngine::PART_22_HELPER_2() { - int i = 16; - do { - if (compareGameTick(1, 16)) { - memcpy(_screenTextLayer, _screenLayer1 + (128 - i * 8) * 320, (i * 8 + 16) * 320); - memcpy(_screenTextLayer + (128 - i * 8) * 320, _animFramesBuffer, (i * 8 + 16) * 320); - memcpy(_screenVGA, _screenTextLayer, 46080); - ++i; - } - waitForTimer(); - } while (i != 17); - _walkDataCurrentIndex = 0; - _walkCurrentFrame = 1; - for ( i = 0; i <= 9; ++i) { - WalkData *wd = &_walkData[0]; - if (i == 9) { - _walkCurrentFrame = 0; - } - wd->setPos(138, 123, 3, _walkCurrentFrame); - WalkData::setNextFrame(3, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 30; - wd->scaleWidth = 23 + i * 3; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 3; - wd->scaleHeight = 50; - moveIgor(3, wd->frameNum); - waitForTimer(15); - } - _walkDataLastIndex = 0; - buildWalkPathSimple(138, 123, 150, 123); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_22() { - _gameState.enableLight = 1; - loadRoomData(PAL_BellChurch, IMG_BellChurch, BOX_BellChurch, MSK_BellChurch, TXT_BellChurch); - static const int anm[] = { FRM_BellChurch1, FRM_BellChurch2, 0 }; - loadAnimData(anm); - loadActionData(DAT_BellChurch); - _roomDataOffsets = PART_22_ROOM_DATA_OFFSETS; - setRoomWalkBounds(126, 123, 193, 123); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_22_EXEC_ACTION); - PART_22_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - PART_22_HELPER_2(); - enterPartLoop(); - while (_currentPart == 220) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_23.cpp b/engines/igor/parts/part_23.cpp deleted file mode 100644 index 70d3646a01..0000000000 --- a/engines/igor/parts/part_23.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static const uint8 PART_23_ANIM_DATA_1[4] = { 0, 4, 1, 11 }; - -void IgorEngine::PART_23_EXEC_ACTION(int action) { - switch (action) { - case 101: - _currentPart = 280; - break; - case 102: - ADD_DIALOGUE_TEXT(201, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 105: - PART_23_ACTION_105(); - break; - case 106: - ADD_DIALOGUE_TEXT(205, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 107: - PART_23_ACTION_107(); - break; - case 108: - PART_23_ACTION_108(); - break; - case 109: - _currentPart = 300; - break; - case 110: - ADD_DIALOGUE_TEXT(203, 1); - ADD_DIALOGUE_TEXT(204, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 111: - ADD_DIALOGUE_TEXT(208, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 112: - ADD_DIALOGUE_TEXT(210, 1); - ADD_DIALOGUE_TEXT(211, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 113: - ADD_DIALOGUE_TEXT(212, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - default: - error("PART_23_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_23_ACTION_105() { - if (_objectsState[66] != 0) { - _roomObjectAreasTable[_screenLayer2[38633]].area = 1; - --_walkDataLastIndex; - buildWalkPathSimple(233, 132, 233, 120); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 190; - } -} - -void IgorEngine::PART_23_ACTION_107() { - if (_objectsState[66] == 1) { - EXEC_MAIN_ACTION(11); - } else { - const int offset = 23901; - for (int i = 2; i <= 3; ++i) { - for (int j = 0; j <= 53; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + i * 1620 + j * 30 + 0x895, 30); - } - } - playSound(13, 1); - waitForTimer(100); - _objectsState[66] = 1; - PART_23_HELPER_1(1); - } -} - -void IgorEngine::PART_23_ACTION_108() { - if (_objectsState[66] == 0) { - EXEC_MAIN_ACTION(14); - } else { - const int offset = 23901; - for (int i = 2; i <= 3; ++i) { - for (int j = 0; j <= 53; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + PART_23_ANIM_DATA_1[i] * 1620 + j * 30 + 0x895, 30); - } - } - playSound(14, 1); - waitForTimer(100); - _objectsState[66] = 0; - PART_23_HELPER_1(1); - } -} - -void IgorEngine::PART_23_UPDATE_ROOM_BACKGROUND() { - if (compareGameTick(29) || compareGameTick(61)) { - int rnd = getRandomNumber(11); - if (rnd <= 4) { - _gameState.unk10 = 1; - } else if (rnd <= 9) { - _gameState.unk10 = 2; - } else if (rnd == 10) { - if (_gameState.unk10 < 3) { - _gameState.unk10 = getRandomNumber(2) + 3; - } else { - _gameState.unk10 = getRandomNumber(2) + 1; - } - } - PART_23_HELPER_7(_gameState.unk10); - } -} - -void IgorEngine::PART_23_HELPER_1(int num) { - if (num == 1 || num == 255) { - if (_objectsState[66] == 0) { - PART_23_HELPER_2(1); - _roomActionsTable[4] = 6; - } else { - PART_23_HELPER_2(2); - _roomActionsTable[4] = 7; - } - } - PART_23_HELPER_3(); -} - -void IgorEngine::PART_23_HELPER_2(int frame) { - const int offset = 23907; - for (int i = 0; i <= 53; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + (frame - 1) * 1296 + i * 24, 24); - } -} - -void IgorEngine::PART_23_HELPER_3() { - const int offset = 25763; - for (int i = 0; i <= 48; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 25 + 0xA20, 25); - } -} - -void IgorEngine::PART_23_HELPER_4() { - _walkData[0].setPos(233, 120, 3, 0); - _walkData[0].setDefaultScale(); - _walkDataLastIndex = 0; - _roomObjectAreasTable[_screenLayer2[38633]].area = 1; - buildWalkPathSimple(233, 120, 233, 137); - _roomObjectAreasTable[_screenLayer2[38633]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - if (_objectsState[59] == 0) { - for (int i = 0; i <= 53; ++i) { - for (int j = 0; j <= 23; ++j) { - uint8 color = _screenVGA[(i + 74) * 320 + j + 227]; - if (color >= 0xC0 && color <= 0xCF) { - _screenTempLayer[i * 100 + j] = color; - } else { - _screenTempLayer[i * 100 + j] = _animFramesBuffer[i * 24 + j]; - } - } - } - for (int i = 0; i <= 53; ++i) { - memcpy(_screenVGA + i * 320 + 23907, _screenTempLayer + i * 100, 24); - } - playSound(14, 1); - _objectsState[66] = 0; - PART_23_HELPER_1(1); - ADD_DIALOGUE_TEXT(206, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - } -} - -void IgorEngine::PART_23_HELPER_5() { - _walkData[0].setPos(0, 134, 2, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 15; - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPathSimple(0, 134, 100, 140); - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_23_HELPER_6() { - _walkData[0].setPos(319, 134, 4, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPathSimple(319, 134, 289, 134); - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_23_HELPER_7(int frame) { - _roomCursorOn = false; - for (int i = 0; i <= 18; ++i) { - for (int j = 0; j <= 14; ++j) { - int offset = (i + 80) * 320 + j + 162; - uint8 color = _screenVGA[offset]; - if ((color >= 192 && color <= 207) || color == 240 || color == 241) { - _screenTempLayer[i * 100 + j] = color; - } else { - _screenTempLayer[i * 100 + j] = _animFramesBuffer[frame * 285 + i * 15 + j + 0x271C]; - } - } - } - int offset = 25762; - for (int i = 0; i <= 18; ++i) { - memcpy(_screenVGA + i * 320 + offset, _screenTempLayer + i * 100, 15); - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + frame * 285 + i * 15 + 0x271C, 15); - } - if (_dialogueCursorOn) { - _roomCursorOn = true; - } -} - -void IgorEngine::PART_23() { - _gameState.enableLight = 2; - loadRoomData(PAL_CollegeCorridorLucas, IMG_CollegeCorridorLucas, BOX_CollegeCorridorLucas, MSK_CollegeCorridorLucas, TXT_CollegeCorridorLucas); - static const int anm[] = { FRM_CollegeCorridorLucas1, FRM_CollegeCorridorLucas2, FRM_CollegeCorridorLucas3, FRM_CollegeCorridorLucas4, 0 }; - loadAnimData(anm); - loadActionData(DAT_CollegeCorridorLucas); - _roomDataOffsets = PART_23_ROOM_DATA_OFFSETS; - setRoomWalkBounds(15, 0, 319, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_23_EXEC_ACTION); - _updateRoomBackground = &IgorEngine::PART_23_UPDATE_ROOM_BACKGROUND; - PART_23_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - if (_currentPart == 230) { - PART_23_HELPER_5(); - } else if (_currentPart == 231) { - PART_23_HELPER_6(); - } else if (_currentPart == 232) { - PART_23_HELPER_4(); - } - enterPartLoop(); - while (_currentPart >= 230 && _currentPart <= 232) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp deleted file mode 100644 index d6855bab21..0000000000 --- a/engines/igor/parts/part_24.cpp +++ /dev/null @@ -1,325 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_24_EXEC_ACTION(int action) { - switch (action) { - case 101: - _currentPart = 313; - break; - case 102: - PART_24_ACTION_102(); - break; - case 103: - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 104: - PART_24_ACTION_104(); - break; - case 105: - PART_24_ACTION_105(); - break; - case 106: - ADD_DIALOGUE_TEXT(202, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 107: - PART_24_ACTION_107(); - break; - case 108: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 109: - ADD_DIALOGUE_TEXT(204, 1); - ADD_DIALOGUE_TEXT(205, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 110: - ADD_DIALOGUE_TEXT(206, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 111: - ADD_DIALOGUE_TEXT(208, 2); - ADD_DIALOGUE_TEXT(210, 2); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 112: - ADD_DIALOGUE_TEXT(212, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - default: - error("PART_24_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_24_ACTION_102() { - if (_objectsState[67] != 0) { - _roomObjectAreasTable[_screenLayer2[37188]].area = 1; - --_walkDataLastIndex; - buildWalkPathSimple(76, 128, 68, 116); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 360; - } -} - -void IgorEngine::PART_24_ACTION_104() { - if (_objectsState[67] == 1) { - executeAction(11); - return; - } - for (int i = 1; i <= 2; ++i) { - const int offset = 23104; - for (int j = 0; j <= 56; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + i * 1938 + j * 34 + 0x69C, 34); - } - if (i == 2) { - playSound(13, 1); - } else if (i == 1) { - waitForTimer(100); - } - } - _objectsState[67] = 1; - PART_24_HELPER_1(1); -} - -void IgorEngine::PART_24_ACTION_105() { - if (_objectsState[67] == 0) { - executeAction(14); - return; - } - for (int i = 3; i <= 4; ++i) { - const int offset = 23104; - for (int j = 0; j <= 56; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + i * 1938 + j * 34 + 0x69C, 34); - } - if (i == 4) { - playSound(14, 1); - } else if (i == 3) { - waitForTimer(100); - } - } - _objectsState[67] = 0; - PART_24_HELPER_1(1); -} - -void IgorEngine::PART_24_ACTION_107() { - _roomObjectAreasTable[_screenLayer2[38719]].area = 1; - --_walkDataLastIndex; - buildWalkPathSimple(266, 123, 319, 120); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 330; -} - -void IgorEngine::PART_24_UPDATE_ROOM_BACKGROUND() { - if (compareGameTick(29) || compareGameTick(61)) { - if (_gameState.unk10 == _gameState.counter[4]) { - _gameState.counter[4] = getRandomNumber(90) + 10; - _gameState.unk10 = 0; - if (_gameState.unkF) { - PART_24_HELPER_3(1); - } else { - PART_24_HELPER_3(2); - } - _gameState.unkF = !_gameState.unkF; - } else { - ++_gameState.unk10; - } - if (_gameState.unkF) { - PART_24_HELPER_3(getRandomNumber(6) + 1); - } else { - PART_24_HELPER_2(getRandomNumber(6) + 1); - } - } -} - -void IgorEngine::PART_24_HELPER_1(int num) { - if (num == 1 || num == 255) { - if (_objectsState[67] == 0) { - PART_24_HELPER_4(); - _roomActionsTable[2] = 6; - } else { - PART_24_HELPER_5(); - _roomActionsTable[2] = 7; - } - } -} - -void IgorEngine::PART_24_HELPER_2(int frame) { - _roomCursorOn = false; - for (int i = 0; i <= 48; ++i) { - for (int j = 0; j <= 22; ++j) { - int offset = (i + 76) * 320 + j + 149; - uint8 color = _screenVGA[offset]; - if ((color >= 192 && color <= 207) || color == 240 || color == 241) { - _screenTempLayer[i * 100 + j] = _screenVGA[offset]; - } else { - _screenTempLayer[i * 100 + j] = _animFramesBuffer[frame * 1127 + i * 23 + j + 0x3E3B]; - } - } - } - int offset = 24469; - for (int i = 0; i <= 48; ++i) { - memcpy(_screenVGA + i * 320 + offset, _screenTempLayer + i * 100, 23); - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + frame * 1127 + i * 23 + 0x3E3B, 23); - } - if (_gameState.dialogueTextRunning) { - memcpy(_screenTextLayer + 23040, _screenLayer1 + _dialogueDirtyRectY, _dialogueDirtyRectSize); - } - if (_dialogueCursorOn) { - _roomCursorOn = true; - } -} - -void IgorEngine::PART_24_HELPER_3(int frame) { - _roomCursorOn = false; - for (int i = 0; i <= 42; ++i) { - for (int j = 0; j <= 21; ++j) { - int offset = (i + 80) * 320 + j + 173; - uint8 color = _screenVGA[offset]; - if ((color >= 192 && color <= 207) || color == 240 || color == 241) { - _screenTempLayer[i * 100 + j] = _screenVGA[offset]; - } else { - _screenTempLayer[i * 100 + j] = _animFramesBuffer[frame * 946 + i * 22 + j + 0x28C4]; - } - } - } - int offset = 25773; - for (int i = 0; i <= 42; ++i) { - memcpy(_screenVGA + i * 320 + offset, _screenTempLayer + i * 100, 22); - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + frame * 946 + i * 22 + 0x28C4, 22); - } - if (_gameState.dialogueTextRunning) { - memcpy(_screenTextLayer + 23040, _screenLayer1 + _dialogueDirtyRectY, _dialogueDirtyRectSize); - } - if (_dialogueCursorOn) { - _roomCursorOn = true; - } -} - -void IgorEngine::PART_24_HELPER_4() { - const int offset = 22785; - for (int i = 0; i <= 54; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 33, 33); - } -} - -void IgorEngine::PART_24_HELPER_5() { - const int offset = 22785; - for (int i = 0; i <= 54; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 33 + 0x717, 33); - } -} - -void IgorEngine::PART_24_HELPER_7() { - _walkData[0].setPos(0, 138, 2, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 15; - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPathSimple(0, 138, 30, 140); - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_24_HELPER_8() { - _walkData[0].setPos(319, 123, 4, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - _roomObjectAreasTable[_screenLayer2[39679]].area = 1; - buildWalkPathSimple(319, 123, 260, 123); - _roomObjectAreasTable[_screenLayer2[39679]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_24_HELPER_9() { - _walkData[0].setPos(68, 116, 3, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 30; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - _roomObjectAreasTable[_screenLayer2[37188]].area = 1; - buildWalkPathSimple(68, 116, 78, 130); - _roomObjectAreasTable[_screenLayer2[37188]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_24() { - _gameState.enableLight = 2; - loadRoomData(PAL_CollegeCorridorSharonMichael, IMG_CollegeCorridorSharonMichael, BOX_CollegeCorridorSharonMichael, MSK_CollegeCorridorSharonMichael, TXT_CollegeCorridorSharonMichael); - static const int anm[] = { FRM_CollegeCorridorSharonMichael1, FRM_CollegeCorridorSharonMichael2, FRM_CollegeCorridorSharonMichael3, FRM_CollegeCorridorSharonMichael4, 0 }; - loadAnimData(anm); - loadActionData(DAT_CollegeCorridorSharonMichael); - _roomDataOffsets = PART_24_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 319, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_24_EXEC_ACTION); - _updateRoomBackground = &IgorEngine::PART_24_UPDATE_ROOM_BACKGROUND; - PART_24_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - if (_currentPart == 240) { - PART_24_HELPER_7(); - } else if (_currentPart == 241) { - PART_24_HELPER_8(); - } else if (_currentPart == 242) { - PART_24_HELPER_9(); - } - enterPartLoop(); - while (_currentPart >= 240 && _currentPart <= 242) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp deleted file mode 100644 index c8f395ce9f..0000000000 --- a/engines/igor/parts/part_25.cpp +++ /dev/null @@ -1,243 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_25_EXEC_ACTION(int action) { - switch (action) { - case 101: - _currentPart = 260; - break; - case 102: - switch (getRandomNumber(3) + 1) { - case 1: - ADD_DIALOGUE_TEXT(204, 2); - ADD_DIALOGUE_TEXT(206, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 2: - ADD_DIALOGUE_TEXT(207, 1); - ADD_DIALOGUE_TEXT(208, 1); - ADD_DIALOGUE_TEXT(209, 1); - ADD_DIALOGUE_TEXT(206, 1); - SET_DIALOGUE_TEXT(1, 4); - startIgorDialogue(); - break; - case 3: - ADD_DIALOGUE_TEXT(210, 1); - ADD_DIALOGUE_TEXT(211, 1); - ADD_DIALOGUE_TEXT(206, 1); - SET_DIALOGUE_TEXT(1, 3); - startIgorDialogue(); - break; - } - break; - case 103: - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 104: - ADD_DIALOGUE_TEXT(212, 1); - ADD_DIALOGUE_TEXT(213, 1); - ADD_DIALOGUE_TEXT(214, 1); - ADD_DIALOGUE_TEXT(215, 1); - ADD_DIALOGUE_TEXT(216, 2); - SET_DIALOGUE_TEXT(1, 5); - startIgorDialogue(); - break; - case 105: - PART_25_ACTION_105(); - break; - case 106: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 107: - PART_25_ACTION_107(); - break; - case 108: - PART_25_ACTION_108(); - break; - case 109: - _currentPart = 310; - break; - default: - error("PART_25_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_25_ACTION_105() { - if (_objectsState[68] != 0) { - _roomObjectAreasTable[_screenLayer2[34370]].area = 1; - --_walkDataLastIndex; - buildWalkPath(133, 123, 130, 107); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 180; - } -} - -void IgorEngine::PART_25_ACTION_107() { - if (_objectsState[68] == 1) { - EXEC_MAIN_ACTION(11); - return; - } - for (int i = 1; i <= 2; ++i) { - const int offset = 21881; - for (int j = 0; j <= 55; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + i * 1736 + j * 31 + 0x290, 31); - if (i == 2) { - playSound(13, 1); - } - if (i == 1) { - waitForTimer(100); - } - } - } - _objectsState[68] = 1; - PART_25_HELPER_1(1); -} - -void IgorEngine::PART_25_ACTION_108() { - if (_objectsState[68] == 0) { - EXEC_MAIN_ACTION(14); - return; - } - for (int i = 3; i <= 4; ++i) { - const int offset = 21881; - for (int j = 0; j <= 55; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + i * 1736 + j * 31 + 0x290, 31); - if (i == 4) { - playSound(14, 1); - } - if (i == 3) { - waitForTimer(100); - } - } - } - _objectsState[68] = 0; - PART_25_HELPER_1(1); -} - -void IgorEngine::PART_25_HELPER_1(int num) { - if (num == 1 || num == 255) { - if (_objectsState[68] == 0) { - PART_25_HELPER_5(); - _roomActionsTable[31] = 6; - } else { - PART_25_HELPER_7(); - _roomActionsTable[31] = 7; - } - } -} - -void IgorEngine::PART_25_HELPER_2() { - _walkData[0].setPos(0, 130, 2, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 15; - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPath(0, 130, 60, 135); - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_25_HELPER_3() { - _walkData[0].setPos(319, 138, 4, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPath(319, 138, 289, 142); - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_25_HELPER_4() { - _walkData[0].setPos(130, 107, 3, 0); - _walkData[0].setDefaultScale(); - _walkDataLastIndex = 0; - _roomObjectAreasTable[_screenLayer2[34370]].area = 1; - buildWalkPath(130, 107, 135, 125); - _roomObjectAreasTable[_screenLayer2[34370]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_25_HELPER_5() { - const int offset = 22208; - for (int i = 0; i <= 51; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 23, 23); - } -} - -void IgorEngine::PART_25_HELPER_7() { - const int offset = 22208; - for (int i = 0; i <= 51; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + 0x4AC + i * 23, 23); - } -} - -void IgorEngine::PART_25() { - _gameState.enableLight = 2; - loadRoomData(PAL_CollegeCorridorAnnouncementBoard, IMG_CollegeCorridorAnnouncementBoard, BOX_CollegeCorridorAnnouncementBoard, MSK_CollegeCorridorAnnouncementBoard, TXT_CollegeCorridorAnnouncementBoard); - static const int anm[] = { FRM_CollegeCorridorAnnouncementBoard1, FRM_CollegeCorridorAnnouncementBoard2, 0 }; - loadAnimData(anm); - loadActionData(DAT_CollegeCorridorAnnouncementBoard); - _roomDataOffsets = PART_25_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 319, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_25_EXEC_ACTION); - PART_25_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - if (_currentPart == 250) { - PART_25_HELPER_2(); - } else if (_currentPart == 251) { - PART_25_HELPER_3(); - } else if (_currentPart == 252) { - PART_25_HELPER_4(); - } - enterPartLoop(); - while (_currentPart >= 250 && _currentPart <= 252) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp deleted file mode 100644 index 8791e12b63..0000000000 --- a/engines/igor/parts/part_26.cpp +++ /dev/null @@ -1,282 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static const uint8 PART_26_ANIM_DATA_1[12] = { 6, 0, 2, 3, 4, 5, 6, 5, 4, 3, 2, 0 }; - -void IgorEngine::PART_26_EXEC_ACTION(int action) { - switch (action) { - case 101: - ADD_DIALOGUE_TEXT(202, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 102: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 103: - PART_26_ACTION_103(); - break; - case 104: - PART_26_ACTION_104(); - break; - case 105: - ADD_DIALOGUE_TEXT(224, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 106: - _currentPart = 250; - break; - case 107: - PART_26_ACTION_107(); - break; - case 108: - ADD_DIALOGUE_TEXT(216, 2); - ADD_DIALOGUE_TEXT(218, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 109: - ADD_DIALOGUE_TEXT(219, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 110: - ADD_DIALOGUE_TEXT(220, 2); - ADD_DIALOGUE_TEXT(222, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 111: - ADD_DIALOGUE_TEXT(223, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - default: - error("PART_26_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_26_ACTION_103() { - if (_objectsState[69] == 1) { - EXEC_MAIN_ACTION(11); - return; - } - for (int i = 1; i <= 2; ++i) { - const int offset = 19870; - for (int j = 0; j <= 65; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + 0x16C0 + i * 2706 + j * 41, 41); - } - if (i == 2) { - playSound(13, 1); - } else if (i == 1) { - waitForTimer(100); - } - } - _objectsState[69] = 1; - PART_25_HELPER_1(1); -} - -void IgorEngine::PART_26_ACTION_104() { - if (_objectsState[69] == 0) { - EXEC_MAIN_ACTION(14); - return; - } - for (int i = 3; i <= 4; ++i) { - const int offset = 19870; - for (int j = 0; j <= 65; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + i * 2706 + j * 41 + 0x16C0, 41); - if (i == 4) { - playSound(14, 1); - } - if (i == 3) { - waitForTimer(100); - } - } - } - _objectsState[69] = 0; - PART_25_HELPER_1(1); -} - -void IgorEngine::PART_26_ACTION_107() { - if (_objectsState[69] != 0) { - _roomObjectAreasTable[_screenLayer2[36800]].area = 1; - --_walkDataLastIndex; - buildWalkPath(62, 127, 0, 115); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 160; - } -} - -void IgorEngine::PART_26_UPDATE_ROOM_BACKGROUND() { - if (compareGameTick(29) || compareGameTick(61)) { - if (_gameState.unk10 > 2) { - if (_gameState.unk10 == 11) { - _gameState.unk10 = 2; - } - PART_26_HELPER_7(PART_26_ANIM_DATA_1[_gameState.unk10]); - if (_gameState.unk10 > 2) { - ++_gameState.unk10; - } - } else if (_gameState.unk10 == 1) { - _gameState.unk10 = 2; - PART_26_HELPER_7(_gameState.unk10); - } else if (getRandomNumber(25) == 0) { - _gameState.unk10 = 1; - PART_26_HELPER_7(_gameState.unk10); - } else if (getRandomNumber(30) == 0) { - _gameState.unk10 = 3; - } - } -} - -void IgorEngine::PART_26_HELPER_1(int num) { - if (num == 1 || num == 255) { - if (_objectsState[69] == 0) { - PART_26_HELPER_2(); - _roomActionsTable[0x1E] = 6; - } else { - PART_26_HELPER_3(); - _roomActionsTable[0x1E] = 7; - } - } -} - -void IgorEngine::PART_26_HELPER_2() { - const int offset = 19870; - for (int i = 0; i <= 64; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 25, 25); - } -} - -void IgorEngine::PART_26_HELPER_3() { - const int offset = 19870; - for (int i = 0; i <= 64; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + 0x659 + i * 25, 25); - } -} - -void IgorEngine::PART_26_HELPER_4() { - _walkData[0].setPos(319, 125, 4, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPathSimple(319, 125, 269, 140); - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_26_HELPER_5() { - _walkData[0].setPos(0, 115, 3, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 2; - _walkData[0].clipWidth = 30; - _walkDataLastIndex = 0; - _roomObjectAreasTable[_screenLayer2[36800]].area = 1; - buildWalkPath(0, 115, 70, 127); - _roomObjectAreasTable[_screenLayer2[36800]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - if (_objectsState[65] == 3) { - ADD_DIALOGUE_TEXT(212, 1); - ADD_DIALOGUE_TEXT(213, 2); - ADD_DIALOGUE_TEXT(215, 1); - SET_DIALOGUE_TEXT(1, 3); - startIgorDialogue(); - _objectsState[65] = 4; - drawVerbsPanel(); - redrawVerb(kVerbWalk, true); - _currentAction.verb = kVerbWalk; - drawInventory(_inventoryInfo[72], 0); - playSound(51, 1); - PART_26_HELPER_1(255); - } -} - -void IgorEngine::PART_26_HELPER_7(int frame) { - _roomCursorOn = false; - for (int i = 0; i <= 39; ++i) { - for (int j = 0; j <= 21; ++j) { - int offset = (i + 91) * 320 + j + 169; - uint8 color = _screenVGA[offset]; - if (color < 192 || (color > 207 && color != 240 && color != 241)) { - color = _animFramesBuffer[0x942 + frame * 880 + i * 22 + j]; - } - _screenTempLayer[100 * i + j] = color; - } - } - for (int i = 0; i <= 39; ++i) { - const int offset = i * 320 + 29289; - memcpy(_screenVGA + offset, _screenTempLayer + i * 100, 22); - memcpy(_screenLayer1 + offset, _animFramesBuffer + 0x942 + frame * 880 + i * 22, 22); - } - if (_dialogueCursorOn) { - _roomCursorOn = true; - } -} - -void IgorEngine::PART_26() { - _gameState.enableLight = 1; - loadRoomData(PAL_CollegeCorridorMissBarrymore, IMG_CollegeCorridorMissBarrymore, BOX_CollegeCorridorMissBarrymore, MSK_CollegeCorridorMissBarrymore, TXT_CollegeCorridorMissBarrymore); - static const int anm[] = { FRM_CollegeCorridorMissBarrymore1, FRM_CollegeCorridorMissBarrymore2, FRM_CollegeCorridorMissBarrymore3, 0 }; - loadAnimData(anm); - loadActionData(DAT_CollegeCorridorMissBarrymore); - _roomDataOffsets = PART_26_ROOM_DATA_OFFSETS; - setRoomWalkBounds(14, 0, 319, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_26_EXEC_ACTION); - _updateRoomBackground = &IgorEngine::PART_26_UPDATE_ROOM_BACKGROUND; - PART_26_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - _gameState.unk10 = true; - fadeInPalette(768); - if (_currentPart == 260) { - PART_26_HELPER_4(); - } else { - PART_26_HELPER_5(); - } - enterPartLoop(); - while (_currentPart >= 260 && _currentPart <= 261) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp deleted file mode 100644 index fa228e2701..0000000000 --- a/engines/igor/parts/part_27.cpp +++ /dev/null @@ -1,289 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_27_EXEC_ACTION(int action) { - switch (action) { - case 101: - _currentPart = 231; - break; - case 102: - if (_objectsState[85] == 0) { - ADD_DIALOGUE_TEXT(216, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - _objectsState[85] = 1; - PART_27_HELPER_1(255); - } else { - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - } - break; - case 103: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 104: - ADD_DIALOGUE_TEXT(204, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 105: - ADD_DIALOGUE_TEXT(205, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 106: - PART_27_ACTION_106(); - break; - case 107: - PART_27_ACTION_107(); - break; - case 108: - PART_27_ACTION_108(); - break; - case 109: - ADD_DIALOGUE_TEXT(215, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 110: - PART_27_ACTION_110(); - break; - case 111: - ADD_DIALOGUE_TEXT(222, 1); - ADD_DIALOGUE_TEXT(223, 2); - ADD_DIALOGUE_TEXT(225, 4); - SET_DIALOGUE_TEXT(1, 3); - startIgorDialogue(); - break; - case 112: - ADD_DIALOGUE_TEXT(221, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 113: - _currentPart = 150; - break; - default: - error("PART_27_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_27_ACTION_106() { - if (_objectsState[84] == 1) { - EXEC_MAIN_ACTION(11); - return; - } - if (_objectsState[5] == 0) { - ADD_DIALOGUE_TEXT(206, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - if (_objectsState[5] == 1) { - ADD_DIALOGUE_TEXT(209, 3); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - _objectsState[5] = 2; - return; - } - const int offset = 21810; - for (int i = 2; i <= 3; ++i) { - for (int j = 0; j <= 48; ++j) { - memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + 0x3A0 + i * 1568 + j * 32, 32); - } - if (i == 3) { - playSound(3, 1); - } - if (i == 2) { - waitForTimer(100); - } - } - _objectsState[84] = 1; - PART_27_HELPER_1(1); -} - -void IgorEngine::PART_27_ACTION_107() { - if (_objectsState[84] == 0) { - EXEC_MAIN_ACTION(14); - return; - } - const int offset = 21810; - for (int i = 2; i >= 1; --i) { - for (int j = 0; j <= 48; ++j) { - memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + 0x3A0 + i * 1568 + j * 32, 32); - } - if (i == 2) { - playSound(14, 1); - waitForTimer(100); - } - } - _objectsState[84] = 0; - PART_27_HELPER_1(1); -} - -void IgorEngine::PART_27_ACTION_108() { - if (_inventoryInfo[58] > 0 || _objectsState[42] == 2) { - ADD_DIALOGUE_TEXT(208, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - ADD_DIALOGUE_TEXT(207, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - const int offset = 25012; - for (int i = 1; i <= 2; ++i) { - for (int j = 0; j <= 29; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + i * 630 + j * 21 + 0x19AA, 21); - } - if (i == 1) { - waitForTimer(100); - } - } - addObjectToInventory(23, 58); - PART_27_HELPER_1(1); - if (_game.version == kIdEngDemo110) { - ++_demoActionsCounter; - } -} - -void IgorEngine::PART_27_ACTION_110() { - ADD_DIALOGUE_TEXT(212, 1); - ADD_DIALOGUE_TEXT(213, 2); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - const int offset = 25012; - for (int i = 1; i <= 2; ++i) { - for (int j = 0; j <= 48; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + 0x19AA + i * 630 + j * 21, 21); - } - if (i == 1) { - waitForTimer(100); - } - } - removeObjectFromInventory(55); - PART_27_HELPER_1(255); - _objectsState[107] = 1; - if (_game.version == kIdEngDemo110) { - ++_demoActionsCounter; - } -} - -void IgorEngine::PART_27_HELPER_1(int num) { - if (num == 1 || num == 255) { - if (_objectsState[84] == 0) { - PART_27_HELPER_3(); - _roomActionsTable[3] = 6; - _roomObjectAreasTable[6].object = 3; - } else { - PART_27_HELPER_4(); - _roomActionsTable[3] = 7; - _roomObjectAreasTable[6].object = 4; - } - } - if (num == 2 || num == 255) { - if (_objectsState[85] == 0) { - _roomObjectAreasTable[5].object = 2; - _roomObjectAreasTable[6].object = 2; - } else { - _roomObjectAreasTable[5].object = 3; - } - } -} - -void IgorEngine::PART_27_HELPER_2() { - _walkData[0].setPos(0, 132, 2, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPathSimple(0, 132, 30, 132); - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_27_HELPER_3() { - const int offset = 21816; - for (int i = 0; i <= 47; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 26, 26); - } -} - -void IgorEngine::PART_27_HELPER_4() { - const int offset = 21816; - for (int i = 0; i <= 47; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 26 + 0x4E0, 26); - } -} - -void IgorEngine::PART_27_HELPER_5() { - _walkData[0].setPos(270, 134, 4, 0); - _walkData[0].setDefaultScale(); - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPathSimple(270, 134, 140, 134); - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_27() { - _gameState.enableLight = 1; - loadRoomData(PAL_CollegeLockers, IMG_CollegeLockers, BOX_CollegeLockers, MSK_CollegeLockers, TXT_CollegeLockers); - static const int anm[] = { FRM_CollegeLockers1, FRM_CollegeLockers2, FRM_CollegeLockers3, 0 }; - loadAnimData(anm); - loadActionData(DAT_CollegeLockers); - _roomDataOffsets = PART_27_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 319, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_27_EXEC_ACTION); - PART_27_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - if (_currentPart == 270) { - PART_27_HELPER_2(); - } else { - PART_27_HELPER_5(); - } - enterPartLoop(); - while (_currentPart == 270 || _currentPart == 271) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp deleted file mode 100644 index 397c8e9ddd..0000000000 --- a/engines/igor/parts/part_28.cpp +++ /dev/null @@ -1,357 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_28_EXEC_ACTION(int action) { - switch (action) { - case 101: - _currentPart = 230; - break; - case 102: - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 103: - ADD_DIALOGUE_TEXT(202, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 104: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 105: - ADD_DIALOGUE_TEXT(204, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 106: - if (_objectsState[111] == 0) { - ADD_DIALOGUE_TEXT(205, 1); - ADD_DIALOGUE_TEXT(206, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - } else { - ADD_DIALOGUE_TEXT(234, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - } - break; - case 107: - ADD_DIALOGUE_TEXT(237, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 108: - PART_28_ACTION_108(); - break; - case 109: - PART_28_ACTION_109(); - break; - case 110: - ADD_DIALOGUE_TEXT(228, 1); - ADD_DIALOGUE_TEXT(229, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 111: - if (_objectsState[3] == 0) { - ADD_DIALOGUE_TEXT(226, 1); - SET_DIALOGUE_TEXT(1, 1); - } else { - ADD_DIALOGUE_TEXT(227, 1); - SET_DIALOGUE_TEXT(1, 1); - } - startIgorDialogue(); - break; - case 112: - ADD_DIALOGUE_TEXT(235, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 113: - ADD_DIALOGUE_TEXT(236, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - default: - error("PART_28_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_28_ACTION_108() { - if (_objectsState[111] == 1) { - ADD_DIALOGUE_TEXT(218, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(211, 1); - ADD_DIALOGUE_TEXT(212, 1); - ADD_DIALOGUE_TEXT(213, 2); - ADD_DIALOGUE_TEXT(215, 1); - ADD_DIALOGUE_TEXT(216, 1); - SET_DIALOGUE_TEXT(1, 5); - startCutsceneDialogue(182, 81, 63, 17, 17); - _updateDialogue = &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE; - waitForEndOfCutsceneDialogue(182, 81, 63, 17, 17); - ADD_DIALOGUE_TEXT(217, 1); - SET_DIALOGUE_TEXT(1, 5); - startCutsceneDialogue(182, 81, 63, 17, 17); - waitForEndOfCutsceneDialogue(182, 81, 63, 17, 17); - _updateDialogue = 0; - --_walkDataLastIndex; - buildWalkPath(213, 131, 160, 140); - _walkDataCurrentIndex = 1; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkData[_walkDataLastIndex].posNum = 3; - _gameState.igorMoving = true; - waitForIgorMove(); - ADD_DIALOGUE_TEXT(222, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - if (_objectsState[87] < 2) { - ADD_DIALOGUE_TEXT(207, 1); - SET_DIALOGUE_TEXT(1, 1); - } else { - ADD_DIALOGUE_TEXT(218, 1); - SET_DIALOGUE_TEXT(1, 1); - } - startIgorDialogue(); - waitForEndOfIgorDialogue(); - if (_objectsState[87] < 2) { - ADD_DIALOGUE_TEXT(208, 1); - SET_DIALOGUE_TEXT(1, 1); - } else { - ADD_DIALOGUE_TEXT(219, 2); - ADD_DIALOGUE_TEXT(221, 1); - SET_DIALOGUE_TEXT(1, 2); - } - startCutsceneDialogue(182, 81, 63, 17, 17); - _updateDialogue = &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE; - waitForEndOfCutsceneDialogue(182, 81, 63, 17, 17); - _updateDialogue = 0; -} - -void IgorEngine::PART_28_ACTION_109() { - for (int i = 1; i <= 7; ++i) { - const int offset = 25067; - for (int j = 0; j <= 34; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + i * 1085 + j * 31 + 0x5EC9, 31); - } - if (i < 7) { - waitForTimer(45); - } - } - addObjectToInventory(22, 57); - _objectsState[87] = 1; - PART_28_HELPER_1(255); - ADD_DIALOGUE_TEXT(230, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - if (_game.version == kIdEngDemo110) { - ++_demoActionsCounter; - } -} - -void IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_28_HELPER_5(7); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_28_HELPER_5(getRandomNumber(5) + 7); - break; - } -} - -void IgorEngine::PART_28_UPDATE_ROOM_BACKGROUND() { - if (compareGameTick(61)) { - if (_gameState.unk10 > 2) { - PART_28_HELPER_5(_gameState.unk10); - if (_gameState.unk10 < 6) { - ++_gameState.unk10; - } else { - _gameState.unk10 = 1; - } - } else { - PART_28_HELPER_5(_gameState.unk10); - if (_gameState.unk10 == 1) { - _gameState.unk10 = 2; - } else { - _gameState.unk10 = 1; - } - if (getRandomNumber(8) == 0) { - _gameState.unk10 = 3; - } - } - } -} - -void IgorEngine::PART_28_HELPER_1(int num) { - WRITE_LE_UINT16(_roomActionsTable + 0x56, 42133); - if (num == 2 || num == 255) { - if (_objectsState[87] == 0) { - PART_28_HELPER_8(1); - } else { - PART_28_HELPER_8(0); - _roomObjectAreasTable[7].object = 0; - } - } -} - -void IgorEngine::PART_28_HELPER_2() { - const int offset = 27374; - for (int i = 0; i <= 43; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 30, 30); - } -} - -void IgorEngine::PART_28_HELPER_3() { - _walkData[0].setPos(319, 142, 4, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPathSimple(319, 142, 289, 142); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_28_HELPER_5(int frame) { - _roomCursorOn = false; - for (int i = 0; i <= 43; ++i) { - for (int j = 0; j <= 29; ++j) { - int offset = (i + 85) * 320 + j + 174; - uint8 color = _screenVGA[offset]; - if ((color >= 192 && color <= 207) || color == 240 || color == 241) { - _screenTempLayer[i * 100 + j] = _screenVGA[offset]; - } else { - _screenTempLayer[i * 100 + j] = _animFramesBuffer[(frame - 1) * 1320 + i * 30 + j]; - } - } - } - int offset = 27374; - for (int i = 0; i <= 43; ++i) { - memcpy(_screenVGA + i * 320 + offset, _screenTempLayer + i * 100, 30); - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + (frame - 1) * 1320 + i * 30, 30); - } - if (_gameState.dialogueTextRunning) { - memcpy(_screenTextLayer + 23040, _screenLayer1 + _dialogueDirtyRectY, _dialogueDirtyRectSize); - } - if (_dialogueCursorOn) { - _roomCursorOn = true; - } -} - -void IgorEngine::PART_28_HELPER_6() { - setupDefaultPalette(); - SET_PAL_240_48_1(); - SET_PAL_208_96_1(); - drawVerbsPanel(); - drawInventory(_inventoryInfo[72], 0); - PART_28_HELPER_1(255); - fadeInPalette(768); - _walkData[0].setPos(319, 142, 4, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPath(319, 142, 214, 130); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkData[_walkDataLastIndex].posNum = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - ADD_DIALOGUE_TEXT(209, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - waitForTimer(255); - ADD_DIALOGUE_TEXT(231, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - --_walkDataLastIndex; - buildWalkPath(214, 130, 214, 140); - _walkDataCurrentIndex = 1; - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); - ADD_DIALOGUE_TEXT(224, 2); - ADD_DIALOGUE_TEXT(232, 2); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); -} - -void IgorEngine::PART_28_HELPER_8(int frame) { - const int offset = 33387; - for (int i = 0; i <= 8; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + frame * 135 + i * 15 + 0x61F8, 15); - } -} - -void IgorEngine::PART_28() { - _gameState.enableLight = 2; - loadRoomData(PAL_CollegeCorridorCaroline, IMG_CollegeCorridorCaroline, BOX_CollegeCorridorCaroline, MSK_CollegeCorridorCaroline, TXT_CollegeCorridorCaroline); - static const int anm[] = { FRM_CollegeCorridorCaroline1, FRM_CollegeCorridorCaroline2, FRM_CollegeCorridorCaroline3, 0 }; - loadAnimData(anm); - loadActionData(DAT_CollegeCorridorCaroline); - _roomDataOffsets = PART_28_ROOM_DATA_OFFSETS; - setRoomWalkBounds(15, 0, 319, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_28_EXEC_ACTION); - _updateRoomBackground = &IgorEngine::PART_28_UPDATE_ROOM_BACKGROUND; - PART_28_HELPER_2(); - PART_28_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - if (_currentPart == 280) { - fadeInPalette(768); - PART_28_HELPER_3(); - } else if (_currentPart == 281) { - PART_28_HELPER_6(); - } - enterPartLoop(); - while (_currentPart == 280 || _currentPart == 281) { - runPartLoop(); - } - if (_objectsState[87] == 1) { - _objectsState[87] = 2; - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp deleted file mode 100644 index 507d88f1c5..0000000000 --- a/engines/igor/parts/part_30.cpp +++ /dev/null @@ -1,310 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_30_EXEC_ACTION(int action) { - switch (action) { - case 101: - _currentPart = 231; - break; - case 102: - PART_30_ACTION_102(); - break; - case 103: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 104: - PART_30_ACTION_104(); - break; - case 105: - ADD_DIALOGUE_TEXT(202, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 106: - _currentPart = 210; - break; - default: - error("PART_30_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_30_ACTION_102() { - _roomObjectAreasTable[_screenLayer2[24108]].area = 2; - --_walkDataLastIndex; - buildWalkPath(99, 119, 108, 75); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _roomObjectAreasTable[_screenLayer2[24170]].area = 0; - --_walkDataLastIndex; - buildWalkPath(108, 75, 170, 75); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 312; -} - -void IgorEngine::PART_30_ACTION_104() { - --_walkDataLastIndex; - _roomObjectAreasTable[_screenLayer2[36318]].area = 2; - buildWalkPath(158, 119, 158, 113); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _walkDataCurrentIndex = 0; - for (int i = 9; i >= 0; --i) { - if (i == 9) { - _walkCurrentFrame = 0; - } - _walkData[0].setPos(158, 113, 1, _walkCurrentFrame); - WalkData::setNextFrame(1, _walkCurrentFrame); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 1; - _walkData[0].clipWidth = 30; - _walkData[0].dyPos = 3; - _walkData[0].scaleWidth = i * 3 + 23; - moveIgor(_walkData[0].posNum, _walkData[0].frameNum); - waitForTimer(15); - } - _currentPart = (_objectsState[111] == 0) ? 171 : 771; -} - -void IgorEngine::PART_30_UPDATE_DIALOGUE_LAURA(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_30_HELPER_9(42); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_30_HELPER_9(getRandomNumber(9) + 42); - break; - case kUpdateDialogueAnimStanding: - PART_30_HELPER_9(33); - break; - } -} - -void IgorEngine::PART_30_HANDLE_DIALOGUE_LAURA() { - loadDialogueData(DLG_CollegeStairsFirstFloor); - _updateDialogue = &IgorEngine::PART_30_UPDATE_DIALOGUE_LAURA; - handleDialogue(201, 85, 63, 0, 38); - _updateDialogue = 0; -} - -void IgorEngine::PART_30_HELPER_1(int num) { -} - -void IgorEngine::PART_30_HELPER_2() { - _walkData[0].setPos(0, 138, 2, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPath(0, 138, 30, 138); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_30_HELPER_3() { - _roomObjectAreasTable[_screenLayer2[24170]].area = 2; - _walkData[0].setPos(170, 75, 4, 0); - _walkData[0].setDefaultScale(); - _walkDataLastIndex = 0; - _roomObjectAreasTable[_screenLayer2[24108]].area = 2; - buildWalkPath(170, 75, 108, 75); - _roomObjectAreasTable[_screenLayer2[24170]].area = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - --_walkDataLastIndex; - buildWalkPath(108, 75, 99, 119); - _roomObjectAreasTable[_screenLayer2[24108]].area = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - --_walkDataLastIndex; - buildWalkPath(99, 119, 128, 123); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_30_HELPER_4() { - _walkDataCurrentIndex = 0; - _walkCurrentFrame = 1; - _walkCurrentPos = 3; - for (int i = 0; i <= 9; ++i) { - if (i == 9) { - _walkCurrentFrame = 0; - } - _walkData[0].setPos(158, 113, 3, _walkCurrentFrame); - WalkData::setNextFrame(3, _walkCurrentFrame); - _walkData[0].setDefaultScale(); - _walkData[0].scaleWidth = i * 3 + 23; - moveIgor(_walkData[0].posNum, _walkData[0].frameNum); - waitForTimer(15); - } - _walkDataLastIndex = 1; - _walkDataCurrentIndex = 1; - _roomObjectAreasTable[_screenLayer2[36318]].area = 2; - --_walkDataLastIndex; - buildWalkPath(158, 113, 128, 123); - _roomObjectAreasTable[_screenLayer2[36318]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_30_HELPER_5() { - _walkData[0].setPos(319, 138, 4, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkDataCurrentIndex = 1; - buildWalkPath(319, 138, 289, 138); - _walkData[_walkDataLastIndex].frameNum = 0; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_30_HELPER_8() { - playMusic(3); - memset(_screenVGA + 46080, 0, 17920); - fadeInPalette(768); - for (int i = 1; i <= 40; ++i) { - const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0xBE94 + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - if (i < 34) { - waitForTimer(25); - } else { - waitForTimer(15); - } - } - _walkData[0].setPos(172, 134, 2, 0); - _walkData[0].setDefaultScale(); - _walkDataLastIndex = 1; - _walkDataCurrentIndex = 1; - _updateDialogue = &IgorEngine::PART_30_UPDATE_DIALOGUE_LAURA; - ADD_DIALOGUE_TEXT(203, 1); - ADD_DIALOGUE_TEXT(204, 1); - ADD_DIALOGUE_TEXT(205, 1); - SET_DIALOGUE_TEXT(1, 3); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(206, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(201, 85, 63, 0, 38); - waitForEndOfCutsceneDialogue(201, 85, 63, 0, 38); - decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0xBEE6) - 1, _screenVGA, true); - for (int i = 1; i <= 41; ++i) { - const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0xBE94 + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - } - PART_30_HANDLE_DIALOGUE_LAURA(); - ADD_DIALOGUE_TEXT(207, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(208, 1); - ADD_DIALOGUE_TEXT(209, 1); - SET_DIALOGUE_TEXT(1, 2); - startCutsceneDialogue(201, 85, 63, 0, 38); - waitForEndOfCutsceneDialogue(201, 85, 63, 0, 38); - _updateDialogue = 0; - for (int i = 51; i <= 70; ++i) { - const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0xBE94 + i * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); - if (i < 68) { - waitForTimer(25); - } - } - _walkData[0].setPos(164, 135, 3, 0); - _walkData[0].setDefaultScale(); - _walkDataLastIndex = 1; - ADD_DIALOGUE_TEXT(210, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - memset(_screenVGA + 46080, 0, 17920); - drawVerbsPanel(); - drawInventory(_inventoryInfo[72], 0); - _currentAction.verb = kVerbWalk; - _objectsState[73] = 1; - PART_30_HELPER_1(255); -} - -void IgorEngine::PART_30_HELPER_9(int frame) { - const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0xBE94 + frame * 2) - 1; - decodeAnimFrame(src, _screenVGA, true); -} - -void IgorEngine::PART_30() { - _gameState.enableLight = 2; - loadRoomData(PAL_CollegeStairsFirstFloor, IMG_CollegeStairsFirstFloor, BOX_CollegeStairsFirstFloor, MSK_CollegeStairsFirstFloor, TXT_CollegeStairsFirstFloor); - static const int anm[] = { FRM_CollegeStairsFirstFloor1, FRM_CollegeStairsFirstFloor2, 0 }; - loadAnimData(anm); - loadActionData(DAT_CollegeStairsFirstFloor); - _roomDataOffsets = PART_30_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 319, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_30_EXEC_ACTION); - PART_30_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - if (_objectsState[73] == 0) { - PART_30_HELPER_8(); - } else { - if (_currentPart != 302) { - fadeInPalette(768); - } - if (_currentPart == 300) { - PART_30_HELPER_2(); - } else if (_currentPart == 301) { - PART_30_HELPER_3(); - } else if (_currentPart == 302) { - playMusic(3); - fadeInPalette(768); - PART_30_HELPER_4(); - } else if (_currentPart == 303) { - PART_30_HELPER_5(); - } - } - enterPartLoop(); - while (_currentPart >= 300 && _currentPart <= 303) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp deleted file mode 100644 index ca4f598daf..0000000000 --- a/engines/igor/parts/part_31.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static const uint8 PART_31_ANIM_DATA_1[] = { 0, 4, 5, 4, 5, 4, 5, 4, 5, 6 }; - -static const uint8 PART_31_ANIM_DATA_2[] = { 0, 4, 5, 4, 5, 4, 5, 1, 2, 3 }; - -void IgorEngine::PART_31_EXEC_ACTION(int action) { - switch (action) { - case 101: - _currentPart = 251; - break; - case 102: - PART_31_ACTION_102(); - break; - case 103: - PART_31_ACTION_103(); - break; - case 104: - if (_objectsState[72] == 0) { - EXEC_MAIN_ACTION(14); - } else { - ADD_DIALOGUE_TEXT(205, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - } - break; - case 105: - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 106: - PART_31_ACTION_106(); - break; - case 107: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 108: - _currentPart = 240; - break; - case 109: - ADD_DIALOGUE_TEXT(204, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 110: - PART_31_ACTION_110(); - break; - case 111: - ADD_DIALOGUE_TEXT(206, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 112: - ADD_DIALOGUE_TEXT(208, 1); - ADD_DIALOGUE_TEXT(209, 2); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 113: - ADD_DIALOGUE_TEXT(211, 1); - ADD_DIALOGUE_TEXT(212, 1); - ADD_DIALOGUE_TEXT(213, 1); - SET_DIALOGUE_TEXT(1, 3); - startIgorDialogue(); - break; - case 114: - ADD_DIALOGUE_TEXT(214, 1); - ADD_DIALOGUE_TEXT(215, 1); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 115: - ADD_DIALOGUE_TEXT(220, 3); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 116: - ADD_DIALOGUE_TEXT(218, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - default: - error("PART_31_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_31_ACTION_102() { - if (_objectsState[72] == 0) { - return; - } - _roomObjectAreasTable[_screenLayer2[33712]].area = 2; - --_walkDataLastIndex; - buildWalkPath(102, 120, 112, 105); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _roomObjectAreasTable[_screenLayer2[20207]].area = 2; - --_walkDataLastIndex; - buildWalkPath(112, 105, 47, 63); - for (int i = 1; i <= _walkDataLastIndex; ++i) { - _walkData[i].posNum = i; - } - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _currentPart = 320; -} - -void IgorEngine::PART_31_ACTION_103() { - if (_objectsState[72] == 1) { - EXEC_MAIN_ACTION(11); - return; - } - playSound(49, 1); - const int offset = 20250; - for (int i = 1; i <= 9; ++i) { - for (int j = 0; j <= 57; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + PART_31_ANIM_DATA_1[i] * 1856 + j * 32 + 0x384, 32); - } - if (i < 9) { - waitForTimer(30); - } - } - ADD_DIALOGUE_TEXT(202, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); -} - -void IgorEngine::PART_31_ACTION_106() { - --_walkDataLastIndex; - _roomObjectAreasTable[_screenLayer2[36326]].area = 2; - buildWalkPath(166, 120, 166, 113); - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - _walkDataCurrentIndex = 0; - for (int i = 9; i >= 0; --i) { - if (i == 9) { - _walkCurrentFrame = 0; - } - WalkData *wd = &_walkData[0]; - wd->setPos(166, 113, 1, _walkCurrentFrame); - WalkData::setNextFrame(1, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 30; - wd->scaleWidth = i * 3 + 23; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 3; - wd->scaleHeight = 50; - moveIgor(wd->posNum, wd->frameNum); - waitForTimer(15); - } - _currentPart = 301; -} - -void IgorEngine::PART_31_ACTION_110() { - if (_objectsState[72] == 1) { - EXEC_MAIN_ACTION(11); - return; - } - const int offset = 20250; - for (int i = 1; i <= 9; ++i) { - for (int j = 0; j <= 57; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + PART_31_ANIM_DATA_2[i] * 1856 + j * 32 + 0x384, 32); - } - if (i == 9) { - playSound(13, 1); - } else if (i < 8) { - waitForTimer(30); - } else if (i == 8) { - waitForTimer(10); - } - } - _objectsState[72] = 1; - PART_31_HELPER_1(1); -} - -void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() { - int xPos, pos; - if (_gameState.igorMoving) { - xPos = _walkData[_walkDataCurrentIndex - 1].x; - pos = _walkData[_walkDataCurrentIndex - 1].posNum; - } else { - xPos = _walkData[_walkDataLastIndex - 1].x; - pos = _walkData[_walkDataLastIndex - 1].posNum; - } - if (xPos < 160 && compareGameTick(3, 8)) { - if (pos == 2) { - if (_gameState.igorMoving) { - if (_gameState.unk10 == 1 || _gameState.unk10 == 2) { - _gameState.unk10 = 3; - PART_31_HELPER_2(_gameState.unk10); - return; - } else if (_gameState.unk10 == 3) { - _gameState.unk10 = 4; - PART_31_HELPER_2(_gameState.unk10); - return; - } else if (_gameState.unk10 == 4) { - if (getRandomNumber(30) == 0) { - _gameState.unk10 = 5; - PART_31_HELPER_2(_gameState.unk10); - _gameState.counter[4] = 0; - return; - } - } else if (_gameState.unk10 == 5) { - if (_gameState.counter[4] == 20) { - _gameState.unk10 = 4; - PART_31_HELPER_2(_gameState.unk10); - return; - } else { - ++_gameState.counter[4]; - } - } - } - } else { - if (_gameState.unk10 == 4 || _gameState.unk10 == 5) { - _gameState.unk10 = 3; - PART_31_HELPER_2(_gameState.unk10); - return; - } - if (_gameState.unk10 == 1 || _gameState.unk10 == 3) { - _gameState.unk10 = 2; - PART_31_HELPER_2(_gameState.unk10); - return; - } - } - } - if (xPos > 159 && xPos < 251) { - if (compareGameTick(3, 32)) { - if (_gameState.unk10 == 2) { - _gameState.unk10 = 1; - } else { - _gameState.unk10 = 2; - } - PART_31_HELPER_2(_gameState.unk10); - return; - } - } - if (xPos > 250 && compareGameTick(3, 16)) { - if (_gameState.unk10 == 1) { - _gameState.unk10 = 2; - } else { - _gameState.unk10 = 1; - } - PART_31_HELPER_2(_gameState.unk10); - } -} - -void IgorEngine::PART_31_HELPER_1(int num) { - if (num == 1 || num == 255) { - if (_objectsState[72] == 0) { - _roomActionsTable[74] = 6; - } else { - PART_31_HELPER_9(); - _roomActionsTable[74] = 7; - } - } -} - -void IgorEngine::PART_31_HELPER_2(int frame) { - _roomCursorOn = false; - for (int i = 0; i <= 42; ++i) { - for (int j = 0; j <= 30; ++j) { - int offset = (i + 88) * 320 + j + 288; - uint8 color = _screenVGA[offset]; - if (color < 192 || (color > 207 && color != 240 && color != 241)) { - color = _animFramesBuffer[0x310F + frame * 1333 + i * 31 + j]; - } - _screenTempLayer[100 * i + j] = color; - } - } - for (int i = 0; i <= 42; ++i) { - const int offset = i * 320 + 28448; - memcpy(_screenVGA + offset, _screenTempLayer + i * 100, 31); - memcpy(_screenLayer1 + offset, _animFramesBuffer + 0x310F + frame * 1333 + i * 31, 31); - } - if (_dialogueCursorOn) { - _roomCursorOn = true; - } -} - -void IgorEngine::PART_31_HELPER_3() { - _walkData[0].setPos(0, 137, 2, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 15; - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - buildWalkPath(0, 137, 30, 137); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_31_HELPER_4() { - _walkData[0].setPos(47, 63, 2, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipWidth = 30; - _walkDataLastIndex = 0; - _roomObjectAreasTable[_screenLayer2[20207]].area = 2; - _roomObjectAreasTable[_screenLayer2[33712]].area = 2; - buildWalkPath(47, 63, 112, 105); - for (int i = 1; i <= _walkDataCurrentIndex; ++i) { - _walkData[i].posNum = 2; - } - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); - buildWalkPath(112, 105, 102, 125); - _roomObjectAreasTable[_screenLayer2[20207]].area = 0; - _roomObjectAreasTable[_screenLayer2[33712]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_31_HELPER_5() { - _walkDataCurrentIndex = 0; - _walkCurrentFrame = 1; - _walkCurrentPos = 3; - for (int i = 0; i <= 9; ++i) { - WalkData *wd = &_walkData[0]; - if (i == 9) { - _walkCurrentFrame = 0; - } - wd->setPos(166, 113, 3, _walkCurrentFrame); - WalkData::setNextFrame(3, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 30; - wd->scaleWidth = i * 3 + 23; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 3; - wd->scaleHeight = 50; - moveIgor(wd->posNum, wd->frameNum); - waitForTimer(15); - } - _walkDataLastIndex = 1; - _walkDataCurrentIndex = 1; - _roomObjectAreasTable[_screenLayer2[36326]].area = 2; - --_walkDataLastIndex; - buildWalkPath(166, 113, 140, 123); - _roomObjectAreasTable[_screenLayer2[36326]].area = 0; - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_31_HELPER_6() { - _walkData[0].setPos(319, 138, 4, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - buildWalkPath(319, 138, 289, 138); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_31_HELPER_9() { - const int offset = 20256; - for (int i = 0; i <= 52; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 26 + 0x562, 26); - } -} - -void IgorEngine::PART_31() { - _gameState.enableLight = 2; - loadRoomData(PAL_CollegeStairsSecondFloor, IMG_CollegeStairsSecondFloor, BOX_CollegeStairsSecondFloor, MSK_CollegeStairsSecondFloor, TXT_CollegeStairsSecondFloor); - static const int anm[] = { FRM_CollegeStairsSecondFloor1, FRM_CollegeStairsSecondFloor2, FRM_CollegeStairsSecondFloor3, 0 }; - loadAnimData(anm); - loadActionData(DAT_CollegeStairsSecondFloor); - _roomDataOffsets = PART_31_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 319, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_31_EXEC_ACTION); - _updateRoomBackground = &IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND; - PART_31_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - _gameState.unk10 = 4; - PART_31_HELPER_2(_gameState.unk10); - fadeInPalette(768); - if (_currentPart == 310) { - PART_31_HELPER_3(); - } else if (_currentPart == 311) { - PART_31_HELPER_4(); - } else if (_currentPart == 312) { - PART_31_HELPER_5(); - } else if (_currentPart == 313) { - PART_31_HELPER_6(); - } - enterPartLoop(); - while (_currentPart >= 310 && _currentPart <= 313) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp deleted file mode 100644 index 25137c1d9a..0000000000 --- a/engines/igor/parts/part_33.cpp +++ /dev/null @@ -1,508 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static const uint8 PART_33_ANIM_DATA_4[4] = { 0, 1, 2, 1 }; - -static const uint8 PART_33_ANIM_DATA_5[5] = { 0, 6, 7, 8, 1 }; - -void IgorEngine::PART_33_EXEC_ACTION(int action) { - switch (action) { - case 101: - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 102: - ADD_DIALOGUE_TEXT(202, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 103: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 104: - ADD_DIALOGUE_TEXT(204, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 105: - ADD_DIALOGUE_TEXT(205, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 106: - ADD_DIALOGUE_TEXT(206, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 107: - ADD_DIALOGUE_TEXT(207, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 108: - ADD_DIALOGUE_TEXT(208, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 109: - PART_33_ACTION_109(); - break; - case 110: - ADD_DIALOGUE_TEXT(209, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 111: - PART_33_ACTION_111(); - break; - case 112: - ADD_DIALOGUE_TEXT(213, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 113: - PART_33_ACTION_113(); - break; - case 114: - PART_33_ACTION_114(); - break; - case 115: - PART_33_ACTION_115(); - break; - default: - error("PART_33_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_33_ACTION_109() { - if (_objectsState[4] == 0) { - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - if (_objectsState[74] == 1) { - ADD_DIALOGUE_TEXT(222, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - for (int i = 1; i <= 3; ++i) { - for (int j = 0; j <= 48; ++j) { - memcpy(_screenVGA + j * 320 + 23448, _animFramesBuffer + 0x467 * (PART_33_ANIM_DATA_4[i] - 1) + j * 23, 23); - waitForTimer(120); - } - } - addObjectToInventory(31, 66); - _objectsState[74] = 1; - PART_33_HELPER_1(255); - ADD_DIALOGUE_TEXT(210, 1); - ADD_DIALOGUE_TEXT(211, 2); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); -} - -void IgorEngine::PART_33_ACTION_111() { - if (_objectsState[75] == 1) { - PART_33_HELPER_9(); - PART_33_HELPER_1(255); - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(202, 2); - ADD_DIALOGUE_TEXT(204, 2); - SET_DIALOGUE_TEXT(1, 2); - _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2; - startCutsceneDialogue(47, 82, 0, 58, 40); - waitForEndOfCutsceneDialogue(47, 82, 0, 58, 40); - _updateDialogue = 0; - loadResourceData__ROOM_Library(); - PART_33_HELPER_1(255); - } else { - PART_33_HANDLE_DIALOGUE_HARRISON(); - PART_33_HELPER_1(255); - } -} - -void IgorEngine::PART_33_ACTION_113() { - _walkDataCurrentIndex = 0; - for (int i = 9; i >= 0; --i) { - if (i == 9) { - _walkCurrentFrame = 0; - } - WalkData *wd = &_walkData[0]; - wd->setPos(207, 143, 3, _walkCurrentFrame); - WalkData::setNextFrame(3, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 30; - wd->scaleWidth = i * 3 + 23; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 3; - wd->scaleHeight = 50; - moveIgor(wd->posNum, wd->frameNum); - waitForTimer(15); - } - _currentPart = 241; -} - -void IgorEngine::PART_33_ACTION_114() { - for (int i = 0; i <= 28; ++i) { - memcpy(_screenVGA + i * 320 + 26279, _animFramesBuffer + i * 63 + 0x5827, 62); - } - ADD_DIALOGUE_TEXT(223, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(224, 1); - SET_DIALOGUE_TEXT(1, 1); - _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2; - startCutsceneDialogue(47, 82, 0, 58, 40); - waitForEndOfCutsceneDialogue(47, 82, 0, 58, 40); - _updateDialogue = 0; - for (int i = 2; i <= 5; ++i) { - for (int j = 0; j <= 28; ++j) { - memcpy(_screenVGA + j * 320 + 26279, _animFramesBuffer + i * 1827 + j * 63 + 0x5104, 62); - } - waitForTimer(60); - } - removeObjectFromInventory(54); - ADD_DIALOGUE_TEXT(225, 1); - SET_DIALOGUE_TEXT(1, 1); - _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2; - startCutsceneDialogue(47, 82, 0, 58, 40); - waitForEndOfCutsceneDialogue(47, 82, 0, 58, 40); - _updateDialogue = 0; - for (int i = 0; i <= 28; ++i) { - memcpy(_screenVGA + i * 320 + 26279, _animFramesBuffer + i * 63 + 0x5827, 62); - } - ADD_DIALOGUE_TEXT(226, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(227, 1); - SET_DIALOGUE_TEXT(1, 1); - _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2; - startCutsceneDialogue(47, 82, 0, 58, 40); - waitForEndOfCutsceneDialogue(47, 82, 0, 58, 40); - _updateDialogue = 0; - ADD_DIALOGUE_TEXT(228, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - ADD_DIALOGUE_TEXT(229, 2); - ADD_DIALOGUE_TEXT(231, 2); - SET_DIALOGUE_TEXT(1, 2); - _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2; - startCutsceneDialogue(47, 82, 0, 58, 40); - waitForEndOfCutsceneDialogue(47, 82, 0, 58, 40); - _updateDialogue = 0; - for (int i = 1; i <= 4; ++i) { - for (int j = 0; j <= 28; ++j) { - memcpy(_screenVGA + j * 320 + 26279, _animFramesBuffer + PART_33_ANIM_DATA_5[i] * 1827 + j * 63 + 0x5104, 62); - } - waitForTimer(60); - } - addObjectToInventory(35, 70); - PART_33_HELPER_1(255); - ADD_DIALOGUE_TEXT(233, 2); - SET_DIALOGUE_TEXT(1, 1); - _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2; - startCutsceneDialogue(47, 82, 0, 58, 40); - waitForEndOfCutsceneDialogue(47, 82, 0, 58, 40); - _updateDialogue = 0; - _objectsState[75] = 1; -} - -void IgorEngine::PART_33_ACTION_115() { - const int offset = 26279; - for (int i = 0; i <= 28; ++i) { - memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 63 + 0x5827, 62); - } - waitForTimer(60); - ADD_DIALOGUE_TEXT(215, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - for (int i = 2; i <= 5; ++i) { - for (int j = 0; j <= 28; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + i * 1827 + j * 63 + 0x5104, 62); - } - waitForTimer(60); - } - removeObjectFromInventory(67); - PART_33_HELPER_1(255); - if (_game.version == kIdEngDemo110) { - ++_demoActionsCounter; - } - ADD_DIALOGUE_TEXT(217, 2); - SET_DIALOGUE_TEXT(1, 1); - _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2; - startCutsceneDialogue(47, 82, 0, 58, 40); - waitForEndOfCutsceneDialogue(47, 82, 0, 58, 40); - _updateDialogue = 0; - for (int i = 0; i <= 28; ++i) { - memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 63 + 0x5827, 62); - } - ADD_DIALOGUE_TEXT(219, 1); - SET_DIALOGUE_TEXT(1, 1); - _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2; - startCutsceneDialogue(47, 82, 0, 58, 40); - waitForEndOfCutsceneDialogue(47, 82, 0, 58, 40); - _updateDialogue = 0; - for (int i = 0; i <= 28; ++i) { - memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 63 + 0x5827, 62); - } - _objectsState[76] = 1; -} - -void IgorEngine::PART_33_HANDLE_DIALOGUE_HARRISON() { - loadDialogueData(DLG_Library); - _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_3; - handleDialogue(47, 82, 0, 58, 40); - _updateDialogue = 0; -} - -void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_1(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_33_HELPER_4(1); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_33_HELPER_4(getRandomNumber(4) + 2); - break; - } -} - -void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_33_HELPER_8(4); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_33_HELPER_8(4 + getRandomNumber(3)); - break; - } -} - -void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_3(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_33_HELPER_5(4); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_33_HELPER_5(4 + getRandomNumber(3)); - break; - case kUpdateDialogueAnimStanding: - PART_33_HELPER_5(4); - break; - } -} - -void IgorEngine::PART_33_UPDATE_ROOM_BACKGROUND() { - if (compareGameTick(61) && _objectsState[75] != 2) { - PART_33_HELPER_8(_gameState.unk10); - _gameState.unk10 = getRandomNumber(4) + 1; - if (_gameState.unk10 >= 1 && _gameState.unk10 <= 2) { - _gameState.unk10 = 1; - } else { - _gameState.unk10 = 2; - } - } -} - -void IgorEngine::PART_33_HELPER_1(int num) { - if (num == 2 || num == 255) { - if (_objectsState[75] <= 1) { - PART_33_HELPER_3(); - } else { - _roomObjectAreasTable[27].object = 0; - } - } -} - -void IgorEngine::PART_33_HELPER_2() { - playMusic(11); - memcpy(_screenLayer2, _screenVGA, 46080); - memcpy(_screenVGA, _screenLayer1, 46080); - decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5255) - 1, _screenVGA, true); - memcpy(_screenLayer1, _screenVGA, 46080); - fadeInPalette(624); - ADD_DIALOGUE_TEXT(220, 1); - ADD_DIALOGUE_TEXT(221, 1); - SET_DIALOGUE_TEXT(1, 2); - _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_1; - startCutsceneDialogue(92, 79, 0, 58, 40); - waitForEndOfCutsceneDialogue(92, 79, 0, 58, 40); - _updateDialogue = 0; - for (int i = 6; i <= 25; ++i) { - decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5253 + i * 2) - 1, _screenVGA, true); - waitForTimer(30); - } - fadeOutPalette(624); -} - -void IgorEngine::PART_33_HELPER_3() { - const int offset = 29479; - for (int i = 0; i <= 14; ++i) { - memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + 0x5287 + i * 16, 16); - } -} - -void IgorEngine::PART_33_HELPER_4(int frame) { - decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5253 + frame * 2) - 1, _screenVGA, true); -} - -void IgorEngine::PART_33_HELPER_5(int frame) { - _roomCursorOn = false; - for (int i = 0; i <= 14; ++i) { - for (int j = 0; j <= 15; ++j) { - int offset = (i + 92) * 320 + j + 39; - uint8 color = _screenVGA[offset]; - if (color < 192 || (color > 207 && color != 240 && color != 241)) { - color = _animFramesBuffer[0x5197 + frame * 240 + i * 16 + j]; - } - _screenTempLayer[100 * i + j] = color; - } - } - for (int i = 0; i <= 14; ++i) { - const int offset = i * 320 + 29479; - memcpy(_screenVGA + offset, _screenTempLayer + i * 100, 16); - memcpy(_screenLayer1 + offset, _animFramesBuffer + 0x5197 + frame * 240 + i * 16, 16); - } - if (_dialogueCursorOn) { - _roomCursorOn = true; - } -} - -void IgorEngine::PART_33_HELPER_7() { - _walkDataCurrentIndex = 0; - _walkCurrentFrame = 1; - _walkCurrentPos = 1; - for (int i = 0; i <= 9; ++i) { - WalkData *wd = &_walkData[0]; - wd->setPos(207, 143, 1, _walkCurrentFrame); - WalkData::setNextFrame(1, _walkCurrentFrame); - wd->clipSkipX = 1; - wd->clipWidth = 30; - wd->scaleWidth = 23 + i * 3; - wd->xPosChanged = 1; - wd->dxPos = 0; - wd->yPosChanged = 1; - wd->dyPos = 3; - wd->scaleHeight = 50; - moveIgor(wd->posNum, wd->frameNum); - waitForTimer(15); - } - _walkDataLastIndex = 1; - _walkDataCurrentIndex = 1; - --_walkDataLastIndex; - buildWalkPath(207, 143, 187, 138); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_33_HELPER_8(int frame) { - _roomCursorOn = false; - for (int i = 0; i <= 14; ++i) { - for (int j = 0; j <= 15; ++j) { - int offset = (i + 92) * 320 + j + 39; - uint8 color = _screenVGA[offset]; - if (color < 192 || (color > 207 && color != 240 && color != 241)) { - color = _animFramesBuffer[0x5197 + frame * 240 + i * 16 + j]; - } - _screenTempLayer[100 * i + j] = color; - } - } - for (int i = 0; i <= 14; ++i) { - const int offset = i * 320 + 29479; - memcpy(_screenVGA + offset, _screenTempLayer + i * 100, 16); - memcpy(_screenLayer1 + offset, _animFramesBuffer + 0x5197 + frame * 240 + i * 16, 16); - } - if (_dialogueCursorOn) { - _roomCursorOn = true; - } -} - -void IgorEngine::PART_33_HELPER_9() { - uint8 *p = loadData(TXT_Library2); - decodeRoomStrings(p, true); - free(p); -} - -void IgorEngine::PART_33() { - _gameState.enableLight = 1; - _gameState.unk10 = 1; - loadResourceData__ROOM_Library(); - loadResourceData__ANIM_Library(); - loadActionData(DAT_Library); - _roomDataOffsets = PART_33_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 276, 143); - if (_currentPart == 331) { - PART_33_HELPER_2(); - return; - } - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_33_EXEC_ACTION); - _updateRoomBackground = &IgorEngine::PART_33_UPDATE_ROOM_BACKGROUND; - PART_33_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - PART_33_HELPER_7(); - enterPartLoop(); - while (_currentPart == 330) { - runPartLoop(); - } - leavePartLoop(); - if (_objectsState[75] == 1) { - _objectsState[75] = 2; - } - fadeOutPalette(624); - _updateRoomBackground = 0; -} - -void IgorEngine::loadResourceData__ROOM_Library() { - loadRoomData(PAL_Library, IMG_Library, BOX_Library, MSK_Library, TXT_Library); -} - -void IgorEngine::loadResourceData__ANIM_Library() { - static const int anm[] = { FRM_Library1, FRM_Library2, FRM_Library3, FRM_Library4, FRM_Library5, 0 }; - loadAnimData(anm); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp deleted file mode 100644 index 0f33b31bed..0000000000 --- a/engines/igor/parts/part_36.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_36_EXEC_ACTION(int action) { - switch (action) { - case 101: - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 102: - PART_36_ACTION_102(); - break; - case 103: - ADD_DIALOGUE_TEXT(202, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 104: - ADD_DIALOGUE_TEXT(203, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 105: - ADD_DIALOGUE_TEXT(204, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 106: - ADD_DIALOGUE_TEXT(209, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 107: - ADD_DIALOGUE_TEXT(206, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 108: - ADD_DIALOGUE_TEXT(208, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 109: - _currentPart = 242; - break; - default: - error("PART_36_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_36_ACTION_102() { - for (int i = 1; i >= 0; --i) { - for (int j = 0; j <= 48; ++j) { - for (int k = 0; k <= 33; ++k) { - uint8 color = _animFramesBuffer[14 + i * 1666 + j * 34 + k]; - int offset = (j + 74) * 320 + k + 70; - if (color < 192 || color > 207) { - _screenTempLayer[100 * j + k] = color; - continue; - } - RoomObjectArea *roa = &_roomObjectAreasTable[_screenLayer2[offset]]; - if (roa->y1Lum > 0) { - _screenTempLayer[100 * j + k] = _screenLayer1[offset]; - } else { - if (roa->y2Lum > 0) { - color -= roa->deltaLum; - } - _screenTempLayer[100 * j + k] = color; - } - } - } - for (int j = 0; j <= 48; ++j) { - memcpy(_screenVGA + j * 320 + 23750, _screenTempLayer + j * 100, 34); - } - waitForTimer(45); - } - addObjectToInventory(30, 65); - _objectsState[88] = 1; - PART_36_HELPER_1(255); - if (_game.version == kIdEngDemo110) { - ++_demoActionsCounter; - } -} - -void IgorEngine::PART_36_HELPER_1(int num) { - if (num == 1 || num == 255) { - if (_objectsState[88] == 0) { - PART_36_HELPER_4(1); - } else { - PART_36_HELPER_4(0); - _roomObjectAreasTable[6].object = 1; - _roomObjectAreasTable[7].object = 1; - } - } -} - -void IgorEngine::PART_36_HELPER_2() { - _walkData[0].setPos(319, 143, 4, 0); - _walkData[0].setDefaultScale(); - _walkDataLastIndex = 0; - _walkCurrentFrame = 1; - buildWalkPath(319, 143, 259, 143); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_36_HELPER_4(int frame) { - if (frame == 0) { - memcpy(_screenLayer1 + 31430, _animFramesBuffer, 7); - } else if (frame == 1) { - memcpy(_screenLayer1 + 31430, _animFramesBuffer + 7, 7); - } -} - -void IgorEngine::PART_36() { - _gameState.enableLight = 1; - loadRoomData(PAL_ChemistryClassroom, IMG_ChemistryClassroom, BOX_ChemistryClassroom, MSK_ChemistryClassroom, TXT_ChemistryClassroom); - static const int anm[] = { FRM_ChemistryClassroom1, FRM_ChemistryClassroom2, 0 }; - loadAnimData(anm); - loadActionData(DAT_ChemistryClassroom); - _roomDataOffsets = PART_36_ROOM_DATA_OFFSETS; - setRoomWalkBounds(90, 0, 319, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_36_EXEC_ACTION); - PART_36_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - PART_36_HELPER_2(); - enterPartLoop(); - while (_currentPart == 360) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_37.cpp b/engines/igor/parts/part_37.cpp deleted file mode 100644 index 3c0bc3f9b6..0000000000 --- a/engines/igor/parts/part_37.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_37_EXEC_ACTION(int action) { - switch (action) { - case 101: - _currentPart = 212; - break; - case 102: - PART_37_ACTION_102(); - break; - case 103: - ADD_DIALOGUE_TEXT(203, 2); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 104: - ADD_DIALOGUE_TEXT(205, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 105: - ADD_DIALOGUE_TEXT(207, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 106: - ADD_DIALOGUE_TEXT(206, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - default: - error("PART_37_EXEC_ACTION unhandled action %d", action); - break; - } -} - -void IgorEngine::PART_37_ACTION_102() { - if (_objectsState[89] == 1) { - ADD_DIALOGUE_TEXT(202, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - return; - } - ADD_DIALOGUE_TEXT(201, 1); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - for (int i = 1; i >= 0; --i) { - int offset = 16423; - for (int j = 0; j <= 49; ++j) { - memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + i * 1550 + j * 31, 31); - } - waitForTimer(60); - } - addObjectToInventory(32, 67); - _objectsState[89] = 1; - PART_37_HELPER_1(255); - if (_game.version == kIdEngDemo110) { - ++_demoActionsCounter; - } -} - -void IgorEngine::PART_37_HELPER_1(int num) { -} - -void IgorEngine::PART_37_HELPER_2() { - _walkData[0].setPos(0, 143, 2, 0); - _walkData[0].setDefaultScale(); - _walkData[0].clipSkipX = 16; - _walkData[0].clipWidth = 15; - _walkDataLastIndex = 0; - _walkCurrentFrame = 1; - buildWalkPath(0, 143, 60, 143); - _walkData[_walkDataLastIndex].frameNum = 0; - _walkDataCurrentIndex = 1; - _gameState.igorMoving = true; - waitForIgorMove(); -} - -void IgorEngine::PART_37() { - _gameState.enableLight = 1; - loadRoomData(PAL_PhysicsClassroom, IMG_PhysicsClassroom, BOX_PhysicsClassroom, MSK_PhysicsClassroom, TXT_PhysicsClassroom); - static const int anm[] = { FRM_PhysicsClassroom1, 0 }; - loadAnimData(anm); - loadActionData(DAT_PhysicsClassroom); - _roomDataOffsets = PART_37_ROOM_DATA_OFFSETS; - setRoomWalkBounds(0, 0, 228, 143); - SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_37_EXEC_ACTION); - PART_37_HELPER_1(255); - memcpy(_screenVGA, _screenLayer1, 46080); - _currentAction.verb = kVerbWalk; - fadeInPalette(768); - PART_37_HELPER_2(); - enterPartLoop(); - while (_currentPart == 370) { - runPartLoop(); - } - leavePartLoop(); - fadeOutPalette(624); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_75.cpp b/engines/igor/parts/part_75.cpp deleted file mode 100644 index d263fc8d99..0000000000 --- a/engines/igor/parts/part_75.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -static const uint8 PART_75_ANIM_DATA_1[18] = { - 0, 8, 9, 8, 9, 8, 9, 8, 9, 8, 9, 10, 11, 12, 13, 14, 15, 16 -}; - -static const uint8 PART_75_ANIM_DATA_2[37] = { - 0, 31, 32, 33, 34, 31, 32, 33, 34, 31, 32, 33, 34, 31, 32, 33, 34, 31, 32, - 33, 34, 31, 32, 33, 34, 31, 32, 33, 34, 31, 32, 33, 34, 31, 32, 33, 34 -}; - -void IgorEngine::PART_75_UPDATE_DIALOGUE_PHILIP(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_75_HELPER_1(2); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_75_HELPER_1(getRandomNumber(5) + 2); - break; - } -} - -void IgorEngine::PART_75_HELPER_1(int frame) { - const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x5E6D + frame * 2) - 1; - decodeAnimFrame(src, _screenVGA); -} - -void IgorEngine::PART_75() { - PART_MEANWHILE(); - _gameState.enableLight = 1; - loadRoomData(PAL_PhilipRoom, IMG_PhilipRoom, BOX_PhilipRoom, MSK_PhilipRoom, TXT_PhilipRoom); - static const int anm[] = { ANM_PhilipVodka, AOF_PhilipVodka, 0 }; - loadAnimData(anm); - memcpy(_screenVGA, _screenLayer1, 46080); - _updateDialogue = &IgorEngine::PART_75_UPDATE_DIALOGUE_PHILIP; - PART_75_HELPER_1(1); - PART_75_HELPER_1(7); - memset(_currentPalette, 0, 768); - fadeInPalette(768); - _gameState.igorMoving = false; - ADD_DIALOGUE_TEXT(201, 1, 1156); - ADD_DIALOGUE_TEXT(202, 2, 1157); - ADD_DIALOGUE_TEXT(204, 1, 1158); - SET_DIALOGUE_TEXT(1, 3); - startCutsceneDialogue(187, 82, 63, 63, 0); - waitForEndOfCutsceneDialogue(187, 82, 63, 63, 0); - for (int i = 1; i <= 17; ++i) { - PART_75_HELPER_1(PART_75_ANIM_DATA_1[i]); - waitForTimer(30); - } - ADD_DIALOGUE_TEXT(205, 1, 1159); - ADD_DIALOGUE_TEXT(206, 1, 1160); - SET_DIALOGUE_TEXT(1, 2); - startCutsceneDialogue(187, 82, 63, 63, 0); - waitForEndOfCutsceneDialogue(187, 82, 63, 63, 0); - for (int i = 17; i <= 30; ++i) { - PART_75_HELPER_1(i); - waitForTimer(15); - } - ADD_DIALOGUE_TEXT(208, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(187, 82, 63, 63, 0); - playSound(62, 1); - for (int i = 1; i <= 36; ++i) { - PART_75_HELPER_1(PART_75_ANIM_DATA_2[i]); - waitForTimer(15); - } - memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize); - ADD_DIALOGUE_TEXT(209, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(187, 82, 63, 63, 0); - PART_75_HELPER_1(35); - waitForTimer(255); - PART_75_HELPER_1(36); - waitForTimer(140); - memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize); - ADD_DIALOGUE_TEXT(210, 1); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(187, 82, 63, 63, 0); - waitForEndOfCutsceneDialogue(187, 82, 63, 63, 0); - for (int i = 1; i <= 40; ++i) { - PART_75_HELPER_1(getRandomNumber(4) + 37); - waitForTimer(30); - } - memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize); - _gameState.dialogueTextRunning = false; - _updateDialogue = 0; - _currentPart = 122; - fadeOutPalette(768); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_85.cpp b/engines/igor/parts/part_85.cpp deleted file mode 100644 index cf685b13a3..0000000000 --- a/engines/igor/parts/part_85.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "common/system.h" - -#include "igor/igor.h" - -namespace Igor { - -static bool VAR_WATER_SOUND_PLAYING; -static int VAR_CURRENT_TALKING_ACTOR; - -void IgorEngine::PART_85_UPDATE_ROOM_BACKGROUND() { - if (compareGameTick(61)) { - scrollPalette(160, 167); - setPaletteRange(160, 167); - } - if (compareGameTick(2, 8)) { - scrollPalette(168, 178); - setPaletteRange(168, 178); - } - if (compareGameTick(13, 16)) { - scrollPalette(179, 184); - setPaletteRange(179, 184); - } - if (compareGameTick(5, 32)) { - scrollPalette(185, 191); - setPaletteRange(185, 191); - } - if (!VAR_WATER_SOUND_PLAYING) { - return; - } - if (_gameState.talkMode == kTalkModeTextOnly || !_gameState.dialogueTextRunning) { - playSound(17, 1); - } -} - -void IgorEngine::PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - decodeAnimFrame(_animFramesBuffer - 1 + READ_LE_UINT16(_animFramesBuffer + 0x7480), _screenVGA, true); - break; - case kUpdateDialogueAnimMiddleOfSentence: - if (VAR_CURRENT_TALKING_ACTOR != 0) { - _gameState.counter[0] = getRandomNumber(5) + 8; - } else { - _gameState.counter[0] = getRandomNumber(5) + 13; - } - decodeAnimFrame(getAnimFrame(0, 0x7480, _gameState.counter[0]), _screenVGA, true); - break; - } -} - -void IgorEngine::PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay) { - do { - if (compareGameTick(0, delay)) { - decodeAnimFrame(_animFramesBuffer + frameOffset2 - 1 + READ_LE_UINT16(_animFramesBuffer + frameOffset1 + firstFrame * 2 - 3), _screenVGA, true); - ++firstFrame; - } - PART_85_UPDATE_ROOM_BACKGROUND(); - if (_inputVars[kInputEscape]) return; - waitForTimer(); - } while (firstFrame <= lastFrame); -} - -void IgorEngine::PART_85_HELPER_2() { - int x = 1; - do { - if (compareGameTick(0, 16)) { - for (int y = 0; y <= 143; ++y) { - memcpy(_screenTextLayer + y * 320, _screenLayer1 + y * 320 + x * 8, 320 - x * 8); - memcpy(_screenTextLayer + y * 320 + 320 - x * 8, _screenLayer2 + y * 320 + 96, x * 8); - } - memcpy(_screenVGA, _screenTextLayer, 46080); - ++x; - } - PART_85_UPDATE_ROOM_BACKGROUND(); - waitForTimer(); - } while (x != 29 && !_inputVars[kInputEscape]); -} - -void IgorEngine::PART_85_HELPER_6(int frame) { - const int offset = (_walkCurrentPos == 4) ? 24564 : 22643; - copyArea(_screenVGA, offset, 320, _screenLayer2 + offset, 320, 14, 8); - copyArea(_screenVGA, offset, 320, _igorHeadFrames + (_walkCurrentPos - 1) * 924 + frame * 154, 14, 14, 8, true); -} - -void IgorEngine::PART_85() { - playMusic(2); - loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock); - memcpy(_screenLayer2, _screenLayer1, 46080); - loadRoomData(PAL_SpringBridgeIntro, IMG_SpringBridgeIntro, 0, 0, TXT_SpringBridgeIntro); - static const int anm[] = { ANM_PhilipLauraIntro, AOF_PhilipLauraIntro, ANM_LauraIntro, AOF_LauraIntro, 0 }; - loadAnimData(anm); - memcpy(_screenVGA, _screenLayer1, 46080); - _updateDialogue = &IgorEngine::PART_85_UPDATE_DIALOGUE_PHILIP_LAURA; - _updateRoomBackground = &IgorEngine::PART_85_UPDATE_ROOM_BACKGROUND; - VAR_WATER_SOUND_PLAYING = true; - playSound(17, 1); - decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true); - fadeInPalette(768); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - PART_85_HELPER_1(0, 0x7481, 2, 7, 32); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - ADD_DIALOGUE_TEXT(201, 3, 545); - ADD_DIALOGUE_TEXT(204, 1, 546); - SET_DIALOGUE_TEXT(1, 2); - startCutsceneDialogue(89, 56, 63, 63, 0); - VAR_CURRENT_TALKING_ACTOR = 0; - waitForEndOfCutsceneDialogue(89, 56, 63, 63, 0); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - ADD_DIALOGUE_TEXT(205, 3, 547); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(113, 59, 63, 0, 38); - VAR_CURRENT_TALKING_ACTOR = 1; - waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - ADD_DIALOGUE_TEXT(208, 1, 548); - SET_DIALOGUE_TEXT(1, 1); - startCutsceneDialogue(89, 56, 63, 63, 0); - VAR_CURRENT_TALKING_ACTOR = 0; - waitForEndOfCutsceneDialogue(89, 56, 63, 63, 0); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - ADD_DIALOGUE_TEXT(209, 2, 549); - ADD_DIALOGUE_TEXT(211, 1, 550); - ADD_DIALOGUE_TEXT(212, 1, 551); - ADD_DIALOGUE_TEXT(213, 1, 552); - ADD_DIALOGUE_TEXT(214, 1, 553); - SET_DIALOGUE_TEXT(1, 5); - startCutsceneDialogue(113, 59, 63, 0, 38); - VAR_CURRENT_TALKING_ACTOR = 1; - waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - PART_85_HELPER_1(0, 0x7481, 2, 7, 32); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - ADD_DIALOGUE_TEXT(215, 1, 554); - ADD_DIALOGUE_TEXT(216, 2, 555); - ADD_DIALOGUE_TEXT(218, 1, 556); - SET_DIALOGUE_TEXT(1, 3); - startCutsceneDialogue(89, 56, 63, 63, 0); - VAR_CURRENT_TALKING_ACTOR = 0; - waitForEndOfCutsceneDialogue(89, 56, 63, 63, 0); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - ADD_DIALOGUE_TEXT(219, 2, 557); - ADD_DIALOGUE_TEXT(221, 2, 558); - SET_DIALOGUE_TEXT(1, 2); - startCutsceneDialogue(113, 59, 63, 0, 38); - VAR_CURRENT_TALKING_ACTOR = 1; - waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true); - PART_85_HELPER_1(0, 0x7481, 2, 7, 32); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - PART_85_HELPER_1(0, 0x7481, 18, 37, 20); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - PART_85_HELPER_2(); - VAR_WATER_SOUND_PLAYING = false; - stopSound(); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - PART_85_HELPER_1(0x74CA, 0xA6C4, 1, 6, 32); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - for (int i = 0; i <= 200 / kTimerTicksCount; ++i) { - PART_85_UPDATE_ROOM_BACKGROUND(); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - waitForTimer(); - } - _walkData[0].x = 251; - _walkData[0].y = 125; - _walkData[0].scaleWidth = 50; - _walkDataLastIndex = 1; - _walkCurrentPos = 4; - ADD_DIALOGUE_TEXT(223, 2, 559); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - PART_85_HELPER_1(0x74CA, 0xA6C4, 7, 9, 32); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - _walkData[0].x = 250; - _walkData[0].y = 119; - _walkCurrentPos = 3; - ADD_DIALOGUE_TEXT(225, 2, 560); - ADD_DIALOGUE_TEXT(227, 3, 561); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - if (_inputVars[kInputEscape]) goto PART_85_EXIT; - PART_85_HELPER_1(0x74CA, 0xA6C4, 10, 24, 16); - -PART_85_EXIT: - stopSound(); - _gameState.dialogueTextRunning = false; - _inputVars[kInputEscape] = 0; - _walkData[0].setPos(155, 121, 4, 0); - _walkData[0].setDefaultScale(); - copyArea(_screenLayer2, 23180, 320, _facingIgorFrames[3], 30, 30, 50, true); - memcpy(_screenVGA, _screenLayer2, 46080); - memset(_currentPalette + 0x270, 0, 0x8D); - setPaletteRange(208, 254); - _currentPart = 61; - _updateDialogue = 0; - _updateRoomBackground = 0; -} - -} // namespace Igor diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp deleted file mode 100644 index 70caf47f6c..0000000000 --- a/engines/igor/parts/part_90.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::PART_90() { - const char *str; - - memset(_currentPalette, 0, 768); - setPaletteRange(0, 255); - switch (_currentPart) { - case 900: - loadData(PAL_OptikSoftware, _paletteBuffer); - loadData(IMG_OptikSoftware, _screenVGA); - break; - case 901: - loadData(PAL_Presents, _paletteBuffer); - loadData(IMG_Presents, _screenVGA); - break; - case 902: - loadData(PAL_GraphicAdventure, _paletteBuffer); - loadData(IMG_GraphicAdventure, _screenVGA); - break; - case 903: - loadData(PAL_PenduloStudios, _paletteBuffer); - loadData(IMG_PenduloStudios, _screenVGA); - break; - case 904: - loadData(PAL_TitleScreen, _paletteBuffer); - loadData(IMG_TitleScreen, _screenVGA); - str = (_game.version == kIdEngDemo110) ? getString(STR_Copyright1994) : getString(STR_Copyright1995); - drawString(_screenVGA, str, 2, 187, 0xF5, 0, 0); - break; - } - fadeInPalette(768); - while (!_inputVars[kInputEscape]) { - waitForTimer(); - if (_inputVars[kInputOptions]) { - _inputVars[kInputOptions] = 0; - handleOptionsMenu(); - break; - } - } - _inputVars[kInputEscape] = 0; - fadeOutPalette(768); - if (_currentPart != kInvalidPart) { - ++_currentPart; - if ((_game.version == kIdSpaCD && _currentPart == 904) || _currentPart == 905) { - _currentPart = 850; - } - } -} - -} // namespace Igor diff --git a/engines/igor/parts/part_95.cpp b/engines/igor/parts/part_95.cpp deleted file mode 100644 index 2fbebf2cc0..0000000000 --- a/engines/igor/parts/part_95.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -struct SharewareScreenString { - uint8 color; - int y; - int strId; -}; - -static const SharewareScreenString STR_SHAREWARE[] = { - // 950 - { 255, 30, STR_IgorObjectiveUikokahonia }, - { 228, 70, STR_SharewareText1 }, - { 228, 81, STR_SharewareText2 }, - { 228, 96, STR_SharewareText3 }, - { 228, 107, STR_SharewareText4 }, - { 228, 122, STR_SharewareText5 }, - { 228, 161, STR_SharewarePlaceOrder }, - // 951 - { 255, 30, STR_IgorObjectiveUikokahonia }, - { 228, 42, STR_SharewareVersion }, - { 228, 85, STR_SharewareOrder1 }, - { 228, 96, STR_SharewareOrder2 }, - { 228, 107, STR_SharewareOrder3 }, - { 228, 161, STR_SharewareOrder4 }, - // 952 - { 255, 30, STR_IgorObjectiveUikokahonia }, - { 228, 42, STR_SharewareVersion }, - { 228, 70, STR_SharewareShipping1 }, - { 228, 85, STR_SharewareShipping2 }, - { 228, 96, STR_SharewareShipping3 }, - { 228, 111, STR_SharewareShipping4 }, - { 228, 122, STR_SharewareShipping5 }, - { 228, 161, STR_SharewarePlaceOrder }, - // 953 - { 255, 30, STR_IgorObjectiveUikokahonia }, - { 228, 42, STR_SharewareVersion }, - { 228, 70, STR_SharewareShipping6 }, - { 228, 85, STR_SharewareShipping7 }, - { 228, 96, STR_SharewareShipping8 }, - { 228, 110, STR_SharewareShipping9 }, - { 228, 121, STR_SharewareShipping10 }, - { 228, 161, STR_SharewarePlaceOrder }, - // 954 - { 255, 30, STR_IgorObjectiveUikokahonia }, - { 228, 42, STR_SharewareVersion }, - { 228, 74, STR_SharewareOptikAddress1 }, - { 228, 85, STR_SharewareOptikAddress2 }, - { 228, 96, STR_SharewareOptikAddress3 }, - { 228, 107, STR_SharewareOptikAddress4 }, - { 228, 118, STR_SharewareOptikAddress5 }, - { 228, 161, STR_SharewarePlaceOrder }, - // 955 - { 255, 30, STR_IgorObjectiveUikokahonia }, - { 240, 42, STR_SharewareVersion }, - { 240, 79, STR_SharewareOptikAddress6 }, - { 240, 90, STR_SharewareOptikAddress7 }, - { 240, 101, STR_SharewareOptikAddress8 }, - { 240, 112, STR_SharewareOptikAddress9 }, - { 240, 161, STR_SharewarePlaceOrder }, - // 956 - { 255, 30, STR_IgorObjectiveUikokahonia }, - { 228, 42, STR_SharewareVersion }, - { 228, 64, STR_SharewarePenduloAddress1 }, - { 228, 80, STR_SharewarePenduloAddress2 }, - { 228, 91, STR_SharewarePenduloAddress3 }, - { 228, 102, STR_SharewarePenduloAddress4 }, - { 228, 113, STR_SharewarePenduloAddress5 }, - { 228, 128, STR_SharewarePenduloAddress6 }, - { 228, 161, STR_SharewarePlaceOrder }, -}; - -void IgorEngine::PART_95() { - hideCursor(); - memset(_currentPalette, 0, 768); - setPaletteRange(0, 255); - memset(_screenVGA, 0, 64000); - int startStr = -1, endStr = -1; - switch (_currentPart) { - case 950: - loadData(PAL_Shareware1, _paletteBuffer); - loadData(IMG_Shareware1, _screenVGA); - if (_game.version == kIdEngDemo110) { - startStr = 0; - endStr = 6; - } - break; - case 951: - loadData(PAL_Shareware2, _paletteBuffer); - loadData(IMG_Shareware2, _screenVGA); - if (_game.version == kIdEngDemo110) { - startStr = 7; - endStr = 12; - } - break; - case 952: - loadData(PAL_Shareware3, _paletteBuffer); - loadData(IMG_Shareware3, _screenVGA); - if (_game.version == kIdEngDemo110) { - startStr = 13; - endStr = 19; - } - break; - case 953: - loadData(PAL_Shareware4, _paletteBuffer); - loadData(IMG_Shareware4, _screenVGA); - if (_game.version == kIdEngDemo110) { - startStr = 20; - endStr = 27; - } - break; - case 954: - loadData(PAL_Shareware5, _paletteBuffer); - loadData(IMG_Shareware5, _screenVGA); - if (_game.version == kIdEngDemo110) { - startStr = 28; - endStr = 35; - } - break; - case 955: - loadData(PAL_Shareware6, _paletteBuffer); - loadData(IMG_Shareware6, _screenVGA); - if (_game.version == kIdEngDemo110) { - startStr = 36; - endStr = 42; - } - break; - case 956: - loadData(PAL_Shareware7, _paletteBuffer); - loadData(IMG_Shareware7, _screenVGA); - if (_game.version == kIdEngDemo110) { - startStr = 43; - endStr = 51; - } - break; - } - if (startStr != -1) { - for (int i = startStr; i <= endStr; ++i) { - const SharewareScreenString *s = &STR_SHAREWARE[i]; - const char *str = getString(s->strId); - drawString(_screenVGA, str, (320 - getStringWidth(str)) / 2, s->y, s->color, 0, 0); - } - } - fadeInPalette(768); - for (int i = 0; !_inputVars[kInputEscape] && i < 3000; ++i) { - waitForTimer(); - } - _inputVars[kInputEscape] = 0; - fadeOutPalette(768); -} - -} // namespace Igor diff --git a/engines/igor/parts/part_main.cpp b/engines/igor/parts/part_main.cpp deleted file mode 100644 index 16f983e448..0000000000 --- a/engines/igor/parts/part_main.cpp +++ /dev/null @@ -1,990 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "common/system.h" - -#include "igor/igor.h" - -namespace Igor { - -void IgorEngine::ADD_DIALOGUE_TEXT(int num, int count, int sound) { - assert(_dialogueTextsCount < MAX_DIALOGUE_TEXTS); - DialogueText *dt = &_dialogueTextsTable[_dialogueTextsCount]; - dt->num = num; - dt->count = count; - dt->sound = sound; - ++_dialogueTextsCount; -} - -void IgorEngine::SET_DIALOGUE_TEXT(int start, int count) { - _dialogueTextsStart = start - 1; - _dialogueTextsCount = count; -} - -void IgorEngine::SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p) { - switch (i) { - case 0: - _executeMainAction = p; - break; - case 1: - _executeRoomAction = p; - break; - } -} - -void IgorEngine::EXEC_MAIN_ACTION(int action) { - switch (action) { - case 0: - case 1: - break; - case 2: { - int num, rnd = getRandomNumber(100); - if (rnd < 34) { - num = 11; - } else if (rnd < 69) { - num = 12; - } else if (rnd < 94) { - num = 13; - } else { - num = 14; - } - ADD_DIALOGUE_TEXT(num, 1, num); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - } - break; - case 3: - ADD_DIALOGUE_TEXT(15, 1, 15); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 4: - ADD_DIALOGUE_TEXT(10, 1, 10); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 5: - ADD_DIALOGUE_TEXT(9, 1, 9); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 6: - ADD_DIALOGUE_TEXT(8, 1, 8); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 7: - ADD_DIALOGUE_TEXT(6, 1, 6); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 8: - ADD_DIALOGUE_TEXT(7, 1, 7); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 9: { - int num = 16 + getRandomNumber(2); - ADD_DIALOGUE_TEXT(num, 1, num); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - } - break; - case 10: - ADD_DIALOGUE_TEXT(18, 1, 18); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 11: - ADD_DIALOGUE_TEXT(19, 1, 19); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 12: { - int num = 20 + getRandomNumber(2); - ADD_DIALOGUE_TEXT(num, 1, num); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - } - break; - case 13: - ADD_DIALOGUE_TEXT(22, 1, 22); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 14: - ADD_DIALOGUE_TEXT(23, 1, 23); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 15: - ADD_DIALOGUE_TEXT(24, 1, 24); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 16: - ADD_DIALOGUE_TEXT(25, 1, 25); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 17: { - int num = 26 + getRandomNumber(2); - ADD_DIALOGUE_TEXT(num, 1, num); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - } - break; - case 18: - ADD_DIALOGUE_TEXT(28, 1, 28); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 19: - ADD_DIALOGUE_TEXT(4, 1, 4); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 20: - ADD_DIALOGUE_TEXT(5, 1, 5); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 21: { - int num = 1 + getRandomNumber(3); - ADD_DIALOGUE_TEXT(num, 1, num); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - } - break; - case 22: - ADD_DIALOGUE_TEXT(51, 1, 32); - ADD_DIALOGUE_TEXT(52, 1, 33); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 23: - ADD_DIALOGUE_TEXT(53, 1, 34); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 24: - ADD_DIALOGUE_TEXT(54, 1, 35); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 25: - ADD_DIALOGUE_TEXT(55, 3, 36); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 26: - ADD_DIALOGUE_TEXT(58, 1, 37); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 27: - ADD_DIALOGUE_TEXT(59, 2, 38); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 28: - ADD_DIALOGUE_TEXT(61, 1, 39); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 29: - ADD_DIALOGUE_TEXT(62, 1, 40); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 30: - ADD_DIALOGUE_TEXT(64, 1, 42); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 31: - ADD_DIALOGUE_TEXT(63, 1, 41); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 32: - ADD_DIALOGUE_TEXT(65, 1, 43); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 33: - ADD_DIALOGUE_TEXT(66, 1, 44); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 34: - ADD_DIALOGUE_TEXT(30, 1, 30); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 35: - ADD_DIALOGUE_TEXT(29, 1, 29); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 36: - ADD_DIALOGUE_TEXT(67, 2, 45); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 37: - ADD_DIALOGUE_TEXT(69, 1, 46); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 38: - EXEC_MAIN_ACTION_38(); - break; - case 39: - ADD_DIALOGUE_TEXT(70, 1, 47); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 40: - ADD_DIALOGUE_TEXT(71, 1, 48); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 41: - ADD_DIALOGUE_TEXT(72, 1, 49); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 42: - ADD_DIALOGUE_TEXT(73, 1, 50); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 43: - EXEC_MAIN_ACTION_43(); - break; - case 44: - ADD_DIALOGUE_TEXT(156, 1, 80); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 45: - ADD_DIALOGUE_TEXT(92, 1, 64); - ADD_DIALOGUE_TEXT(93, 3, 65); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 46: - if (_objectsState[3] == 0) { - ADD_DIALOGUE_TEXT(85, 1, 60); - } else { - ADD_DIALOGUE_TEXT(86, 2, 61); - } - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - break; - case 48: - ADD_DIALOGUE_TEXT(77 + _objectsState[0], 1, 53 + _objectsState[0]); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - case 50: - if (_objectsState[1] == 0) { - ADD_DIALOGUE_TEXT(80, 1, 56); - ADD_DIALOGUE_TEXT(81, 1, 57); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - } else { - ADD_DIALOGUE_TEXT(82, 1, 58); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - } - break; - case 51: - if (_objectsState[7] == 0) { - ADD_DIALOGUE_TEXT(157, 1, 81); - } else { - ADD_DIALOGUE_TEXT(158, 1, 82); - } - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 52: - ADD_DIALOGUE_TEXT(89, 2, 63); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 53: - ADD_DIALOGUE_TEXT(88, 1, 62); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 54: - EXEC_MAIN_ACTION_54(); - break; - case 55: - ADD_DIALOGUE_TEXT(159, 1, 83); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 56: - ADD_DIALOGUE_TEXT(160, 1, 84); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 57: - ADD_DIALOGUE_TEXT(31, 1, 31); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 58: - ADD_DIALOGUE_TEXT(140, 1, 70); - ADD_DIALOGUE_TEXT(141, 1, 71); - ADD_DIALOGUE_TEXT(142, 1, 72); - ADD_DIALOGUE_TEXT(143, 1, 73); - SET_DIALOGUE_TEXT(1, 4); - startIgorDialogue(); - _objectsState[4] = 2; - break; - case 59: - ADD_DIALOGUE_TEXT(97, 2, 67); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 60: - ADD_DIALOGUE_TEXT(161, 1, 85); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 61: - if (_inventoryInfo[51] != 0) { - ADD_DIALOGUE_TEXT(76, 1, 52); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - } else { - ADD_DIALOGUE_TEXT(74, 2, 51); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - addObjectToInventory(16, 51); - } - break; - case 62: - _inventoryImages[_inventoryInfo[52] - 1] = 0; - _inventoryInfo[52] = 0; - packInventory(); - _inventoryImages[_inventoryInfo[59] - 1] = 0; - _inventoryInfo[59] = 0; - packInventory(); - _objectsState[1] = 1; - UPDATE_OBJECT_STATE(2); - addObjectToInventory(24, 59); - ADD_DIALOGUE_TEXT(169, 1, 93); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 63: - ADD_DIALOGUE_TEXT(170, 1, 94); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - _inventoryImages[_inventoryInfo[68] - 1] = 0; - _inventoryInfo[68] = 0; - packInventory(); - _inventoryImages[_inventoryInfo[69] - 1] = 0; - _inventoryInfo[69] = 0; - packInventory(); - _objectsState[6] = 1; - UPDATE_OBJECT_STATE(7); - addObjectToInventory(34, 69); - break; - case 64: - if (_objectsState[6] == 0) { - ADD_DIALOGUE_TEXT(162, 1, 86); - } else if (_objectsState[6] == 1) { - ADD_DIALOGUE_TEXT(163, 1, 87); - } else if (_objectsState[6] == 2) { - ADD_DIALOGUE_TEXT(164, 1, 88); - } - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 65: - ADD_DIALOGUE_TEXT(165, 1, 89); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 66: - ADD_DIALOGUE_TEXT(166, 1, 90); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 67: - ADD_DIALOGUE_TEXT(167, 1, 91); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 68: - ADD_DIALOGUE_TEXT(168, 1, 92); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - case 69: - ADD_DIALOGUE_TEXT(96, 1, 66); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - break; - default: - warning("EXEC_MAIN_ACTION() Unhandled action %d", action); - break; - } -} - -void IgorEngine::EXEC_MAIN_ACTION_38() { - memcpy(_paletteBuffer, _currentPalette, 624); - fadeOutPalette(624); - uint8 *tmp = (uint8 *)malloc(64000 + 768); - if (tmp) { - memcpy(tmp, _screenVGA, 64000); - memcpy(tmp + 64000, _paletteBuffer, 768); - } - loadData(IMG_NewsPaper, _screenVGA); - loadData(PAL_NewsPaper, _paletteBuffer); - fadeInPalette(624); - WalkData *wd = &_walkData[_walkDataLastIndex - 1]; - int _walkDataCurrentPosX2 = wd->x; - int _walkDataCurrentPosY2 = wd->y; - int _walkDataCurrentWScale = wd->scaleWidth; - wd->x = 80; - wd->y = 130; - wd->scaleWidth = 50; - ADD_DIALOGUE_TEXT(144, 1, 74); - ADD_DIALOGUE_TEXT(145, 3, 75); - ADD_DIALOGUE_TEXT(148, 2, 76); - ADD_DIALOGUE_TEXT(150, 2, 77); - SET_DIALOGUE_TEXT(1, 4); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - wd->x = 240; - wd->y = 130; - ADD_DIALOGUE_TEXT(152, 1, 78); - ADD_DIALOGUE_TEXT(153, 3, 79); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - wd->x = _walkDataCurrentPosX2; - wd->y = _walkDataCurrentPosY2; - wd->scaleWidth = _walkDataCurrentWScale; - fadeOutPalette(624); - if (tmp) { - memcpy(_screenVGA, tmp, 64000); - memcpy(_paletteBuffer, tmp + 64000, 768); - free(tmp); - } - fadeInPalette(624); - _objectsState[2] = 1; -} - -void IgorEngine::EXEC_MAIN_ACTION_43() { - memcpy(_paletteBuffer, _currentPalette, 624); - fadeOutPalette(624); - uint8 *tmp = (uint8 *)malloc(64000 + 768); - if (tmp) { - memcpy(tmp, _screenVGA, 64000); - memcpy(tmp + 64000, _paletteBuffer, 768); - } - loadData(IMG_PhotoHarrisonMargaret, _screenVGA); - loadData(PAL_PhotoHarrisonMargaret, _paletteBuffer); - fadeInPalette(624); - WalkData *wd = &_walkData[_walkDataLastIndex - 1]; - int _walkDataCurrentPosX2 = wd->x; - int _walkDataCurrentPosY2 = wd->y; - int _walkDataCurrentWScale = wd->scaleWidth; - wd->x = 160; - wd->y = 130; - wd->scaleWidth = 50; - ADD_DIALOGUE_TEXT(83, 2, 59); - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - _currentAction.object1Num = 0; - wd->x = _walkDataCurrentPosX2; - wd->y = _walkDataCurrentPosY2; - wd->scaleWidth = _walkDataCurrentWScale; - fadeOutPalette(624); - if (tmp) { - memcpy(_screenVGA, tmp, 64000); - memcpy(_paletteBuffer, tmp + 64000, 768); - free(tmp); - } - fadeInPalette(624); -} - -void IgorEngine::EXEC_MAIN_ACTION_54() { - memcpy(_paletteBuffer, _currentPalette, 624); - fadeOutPalette(624); - uint8 *tmp = (uint8 *)malloc(64000 + 768); - if (tmp) { - memcpy(tmp, _screenVGA, 64000); - memcpy(tmp + 64000, _paletteBuffer, 768); - } - loadData(IMG_RomanNumbersPaper, _screenVGA); - loadData(PAL_RomanNumbersPaper, _paletteBuffer); - PART_UPDATE_FIGURES_ON_PAPER(0); - fadeInPalette(624); - WalkData *wd = &_walkData[_walkDataLastIndex - 1]; - int _walkDataCurrentPosX2 = wd->x; - int _walkDataCurrentPosY2 = wd->y; - int _walkDataCurrentWScale = wd->scaleWidth; - wd->x = 160; - wd->y = 130; - wd->scaleWidth = 50; - if (_objectsState[2] == 0) { - ADD_DIALOGUE_TEXT(99, 1, 68); - } else { - ADD_DIALOGUE_TEXT(100, 2, 69); - } - SET_DIALOGUE_TEXT(1, 1); - startIgorDialogue(); - waitForEndOfIgorDialogue(); - wd->x = _walkDataCurrentPosX2; - wd->y = _walkDataCurrentPosY2; - wd->scaleWidth = _walkDataCurrentWScale; - fadeOutPalette(624); - if (tmp) { - memcpy(_screenVGA, tmp, 64000); - memcpy(_paletteBuffer, tmp + 64000, 768); - free(tmp); - } - fadeInPalette(624); -} - -void IgorEngine::CHECK_FOR_END_OF_DEMO() { - if (_demoActionsCounter >= 10) { - ADD_DIALOGUE_TEXT(104, 2); - ADD_DIALOGUE_TEXT(106, 2); - SET_DIALOGUE_TEXT(1, 2); - startIgorDialogue(); - } -} - -void IgorEngine::SET_PAL_208_96_1() { - memcpy(_paletteBuffer + 208 * 3, PAL_96_1, 96); -} - -void IgorEngine::SET_PAL_240_48_1() { - memcpy(_paletteBuffer + 240 * 3, PAL_48_1, 48); -} - -void IgorEngine::UPDATE_OBJECT_STATE(int num) { - if (num == 1 || num == 255) { - switch (_objectsState[0]) { - case 0: - strcpy(_globalObjectNames[23], getString(STR_BottleOfWhisky)); - break; - case 1: - strcpy(_globalObjectNames[23], getString(STR_EmptyBottle)); - break; - case 2: - strcpy(_globalObjectNames[23], getString(STR_BottleOfWater)); - break; - } - } - if (num == 2 || num == 255) { - switch (_objectsState[1]) { - case 0: - _inventoryImages[23] = 27; - strcpy(_globalObjectNames[24], getString(STR_Lizard)); - break; - default: - _inventoryImages[23] = 35; - strcpy(_globalObjectNames[24], getString(STR_FatLizard)); - break; - } - } - if (num == 4 || num == 255) { - switch (_objectsState[3]) { - case 0: - strcpy(_globalObjectNames[22], getString(STR_CarolineFolder)); - break; - case 1: - strcpy(_globalObjectNames[22], getString(STR_PhilipFolder)); - break; - } - } - if (num == 7 || num == 255) { - switch (_objectsState[6]) { - case 0: - _inventoryImages[33] = 21; - break; - case 1: - _inventoryImages[33] = 14; - break; - case 2: - _inventoryImages[33] = 7; - break; - } - } - if (num == 8 || num == 255) { - if (_objectsState[7] == 0) { - strcpy(_globalObjectNames[25], getString(STR_Statuette)); - _inventoryImages[24] = 29; - } else { - strcpy(_globalObjectNames[25], getString(STR_Reward)); - _inventoryImages[24] = 39; - } - } -} - -void IgorEngine::PART_MEANWHILE() { - hideCursor(); - memset(_currentPalette, 0, 768); - setPaletteRange(208, 255); - loadData(IMG_Meanwhile, _screenVGA); - _paletteBuffer[3] = 63; - _paletteBuffer[4] = 32; - _paletteBuffer[5] = 0; - _paletteBuffer[6] = 44; - _paletteBuffer[7] = 12; - _paletteBuffer[8] = 0; - fadeInPalette(9); - for (int i = 0; i <= 5 && !_inputVars[kInputEscape]; ++i) { - waitForTimer(250); - } - _inputVars[kInputEscape] = 0; - fadeOutPalette(9); -} - -static int VAR_MARGARET_ROOM_ANIM_COUNTER; - -void IgorEngine::PART_MARGARET_ROOM_CUTSCENE_HELPER_1() { - const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x2A63 + VAR_MARGARET_ROOM_ANIM_COUNTER * 2) - 1; - decodeAnimFrame(src, _screenVGA); -} - -void IgorEngine::PART_MARGARET_ROOM_CUTSCENE_HELPER_2(int frame) { - const int offset = ((VAR_MARGARET_ROOM_ANIM_COUNTER - 1) * 5 + frame) * 2; - const uint8 *src = _animFramesBuffer + 0x2A75 + READ_LE_UINT16(_animFramesBuffer + offset + 0xD887) - 1; - decodeAnimFrame(src, _screenVGA); -} - -void IgorEngine::PART_MARGARET_ROOM_CUTSCENE_UPDATE_DIALOGUE_MARGARET(int action) { - switch (action) { - case kUpdateDialogueAnimEndOfSentence: - PART_MARGARET_ROOM_CUTSCENE_HELPER_2(1); - break; - case kUpdateDialogueAnimMiddleOfSentence: - PART_MARGARET_ROOM_CUTSCENE_HELPER_2(getRandomNumber(5) + 1); - break; - } -} - -void IgorEngine::PART_MARGARET_ROOM_CUTSCENE() { - _gameState.enableLight = 1; - VAR_MARGARET_ROOM_ANIM_COUNTER = _objectsState[110] + 1; - if (VAR_MARGARET_ROOM_ANIM_COUNTER == 9) { - VAR_MARGARET_ROOM_ANIM_COUNTER = 1; - } - loadRoomData(PAL_MargaretRoom, IMG_MargaretRoom, BOX_MargaretRoom, MSK_MargaretRoom, TXT_MargaretRoom); - static const int anm[] = { FRM_MargaretRoom1, FRM_MargaretRoom2, FRM_MargaretRoom3, FRM_MargaretRoom4, 0 }; - loadAnimData(anm); - memcpy(_screenVGA, _screenLayer1, 46080); - _updateDialogue = &IgorEngine::PART_MARGARET_ROOM_CUTSCENE_UPDATE_DIALOGUE_MARGARET; - PART_MARGARET_ROOM_CUTSCENE_HELPER_1(); - memset(_currentPalette, 0, 768); - fadeInPalette(768); - _gameState.igorMoving = false; - switch (VAR_MARGARET_ROOM_ANIM_COUNTER) { - case 1: - ADD_DIALOGUE_TEXT(223, 1, 1118); - ADD_DIALOGUE_TEXT(224, 1, 1119); - ADD_DIALOGUE_TEXT(225, 1, 1120); - break; - case 2: - ADD_DIALOGUE_TEXT(201, 1, 1097); - ADD_DIALOGUE_TEXT(202, 1, 1098); - ADD_DIALOGUE_TEXT(203, 1, 1099); - break; - case 3: - ADD_DIALOGUE_TEXT(204, 1, 1100); - ADD_DIALOGUE_TEXT(205, 1, 1101); - ADD_DIALOGUE_TEXT(206, 1, 1102); - break; - case 4: - ADD_DIALOGUE_TEXT(207, 1, 1103); - ADD_DIALOGUE_TEXT(208, 1, 1104); - ADD_DIALOGUE_TEXT(209, 1, 1105); - break; - case 5: - ADD_DIALOGUE_TEXT(210, 1, 1106); - ADD_DIALOGUE_TEXT(211, 1, 1107); - ADD_DIALOGUE_TEXT(212, 1, 1108); - break; - case 6: - ADD_DIALOGUE_TEXT(213, 2, 1109); - ADD_DIALOGUE_TEXT(215, 1, 1110); - ADD_DIALOGUE_TEXT(216, 1, 1111); - break; - case 7: - ADD_DIALOGUE_TEXT(217, 1, 1112); - ADD_DIALOGUE_TEXT(218, 1, 1113); - ADD_DIALOGUE_TEXT(219, 1, 1114); - break; - case 8: - ADD_DIALOGUE_TEXT(220, 1, 1115); - ADD_DIALOGUE_TEXT(221, 1, 1116); - ADD_DIALOGUE_TEXT(222, 1, 1117); - break; - } - SET_DIALOGUE_TEXT(1, 3); - startCutsceneDialogue(200, 73, 63, 32, 0); - waitForEndOfCutsceneDialogue(200, 73, 63, 32, 0); - waitForTimer(255); - _updateDialogue = 0; - ++_objectsState[110]; - memcpy(_paletteBuffer, _currentPalette, 768); - fadeOutPalette(768); - memset(_screenVGA, 0, 46080); - if (_objectsState[110] < 9 && _currentPart != 331) { - setupDefaultPalette(); - SET_PAL_240_48_1(); - SET_PAL_208_96_1(); - drawVerbsPanel(); - drawInventory(_inventoryInfo[72], 0); - } -} - -void IgorEngine::PART_UPDATE_FIGURES_ON_PAPER(int delay) { - uint8 *framesData = loadData(FRM_NumbersPaper1); - uint8 *framesOffsets = loadData(FRM_NumbersPaper2); - for (int i = 1; i <= 20; ++i) { - const uint8 *p = framesData + READ_LE_UINT16(framesOffsets + (i - 1) * 2) - 1; - decodeAnimFrame(p, _screenVGA, true); - waitForTimer(delay); - } - free(framesData); - free(framesOffsets); -} - -void IgorEngine::PART_MAIN() { - SET_EXEC_ACTION_FUNC(0, &IgorEngine::EXEC_MAIN_ACTION); - memset(_objectsState, 0, 112); - _objectsState[21] = 1; - _objectsState[49] = 1; - memset(_inventoryInfo, 0, 36); - _inventoryInfo[0] = 1; // ordering - _inventoryInfo[1] = 2; - _inventoryInfo[2] = 4; - _inventoryInfo[36] = 1; - _inventoryInfo[37] = 2; - _inventoryInfo[39] = 3; - _inventoryInfo[72] = 1; // first object - _inventoryInfo[73] = 3; // last object - UPDATE_OBJECT_STATE(255); - if (_currentPart != kStartupPart) { // boot param - SET_PAL_208_96_1(); - SET_PAL_240_48_1(); - drawVerbsPanel(); - drawInventory(1, 0); - } - do { - debugC(9, kDebugGame, "PART_MAIN _currentPart %d", _currentPart); - switch (_currentPart) { - case 40: - PART_04(); - break; - case 50: - case 51: - case 52: - PART_05(); - break; - case 60: - case 61: - case 62: - PART_06(); - break; - case 120: - case 121: - case 122: - PART_12(); - break; - case 130: - case 131: - PART_13(); - break; - case 140: - case 141: - case 142: - PART_14(); - break; - case 150: - PART_15(); - break; - case 160: - PART_16(); - break; - case 170: - case 171: - PART_17(); - break; - case 180: - case 181: - PART_18(); - break; - case 190: - case 191: - PART_19(); - break; - case 210: - case 211: - case 212: - PART_21(); - break; - case 220: - case 221: - PART_22(); - break; - case 230: - case 231: - case 232: - PART_23(); - break; - case 240: - case 241: - case 242: - PART_24(); - break; - case 250: - case 251: - case 252: - PART_25(); - break; - case 260: - case 261: - PART_26(); - break; - case 270: - case 271: - PART_27(); - break; - case 280: - case 281: - PART_28(); - break; - case 300: - case 301: - case 302: - case 303: - PART_30(); - break; - case 310: - case 311: - case 312: - case 313: - PART_31(); - break; - case 330: - case 331: - PART_33(); - break; - case 360: - PART_36(); - break; - case 370: - PART_37(); - break; - case 750: - PART_75(); - break; - case 850: - memset(_screenVGA, 0, 64000); - _screenVGAVOffset = 24; - _system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, _screenVGAVOffset); - PART_85(); - memset(_screenVGA + 46080, 0, 17920); - _nextTimer = _system->getMillis() + 1000 / 60; - for (int y = _screenVGAVOffset; y >= 0; --y) { - _system->copyRectToScreen(_screenVGA, 320, 0, y, 320, 145); - _system->updateScreen(); - int diff = _nextTimer - _system->getMillis(); - if (diff > 0) { - _system->delayMillis(diff); - } - _nextTimer = _system->getMillis() + 1000 / 60; - } - _screenVGAVOffset = 0; - _inputVars[kInputCursorXPos] = 160; - _inputVars[kInputCursorYPos] = 72; - _system->warpMouse(_inputVars[kInputCursorXPos], _inputVars[kInputCursorYPos]); - break; - case 900: - case 901: - case 902: - case 903: - case 904: - PART_90(); - break; - default: - warning("PART_MAIN() Unhandled part %d", _currentPart); - _currentPart = kInvalidPart; - break; - } - if (_currentPart >= 10) { - if (_currentPart <= 24 || _currentPart == 51) { - continue; - } - if (_currentPart == 60 || _currentPart == 102 || _currentPart == 110) { - continue; - } - } - if (_currentPart == 340 || _currentPart == 351 || _currentPart == 750) { - continue; - } - if (_currentPart == 122 || _currentPart == 255) { - continue; - } - if (_objectsState[110] < 1 || _objectsState[110] > 7) { - continue; - } - if (_gameState.nextMusicCounter != 5) { - ++_gameState.nextMusicCounter; - } else { - if (_gameState.musicNum != 11) { - _previousMusic = _gameState.musicNum; - playMusic(11); - } - PART_MEANWHILE(); - PART_MARGARET_ROOM_CUTSCENE(); - if (_previousMusic != 11) { - playMusic(_previousMusic); - } - _gameState.nextMusicCounter = 0; - } - } while (_currentPart != kInvalidPart && !_eventQuitGame); - if (_game.flags & kFlagDemo) { - for (_currentPart = kSharewarePart; !_eventQuitGame && _currentPart <= kSharewarePart + 6; ++_currentPart) { - PART_95(); - } - } -} - -} // namespace Igor diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h deleted file mode 100644 index 583570224a..0000000000 --- a/engines/igor/resource_ids.h +++ /dev/null @@ -1,478 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#ifndef IGOR_RESOURCE_IDS -#define IGOR_RESOURCE_IDS - -#define FNT_Dialogue 1 -#define ANM_PhilipVodka 2 -#define AOF_PhilipVodka 3 -#define TXT_PhilipRoom 4 -#define IMG_PhilipRoom 5 -#define PAL_PhilipRoom 6 -#define MSK_PhilipRoom 7 -#define BOX_PhilipRoom 8 -#define DAT_PhysicsClassroom 9 -#define FRM_PhysicsClassroom1 10 -#define TXT_PhysicsClassroom 11 -#define IMG_PhysicsClassroom 12 -#define PAL_PhysicsClassroom 13 -#define MSK_PhysicsClassroom 14 -#define BOX_PhysicsClassroom 15 -#define DAT_ChemistryClassroom 16 -#define FRM_ChemistryClassroom1 17 -#define FRM_ChemistryClassroom2 18 -#define TXT_ChemistryClassroom 19 -#define IMG_ChemistryClassroom 20 -#define PAL_ChemistryClassroom 21 -#define MSK_ChemistryClassroom 22 -#define BOX_ChemistryClassroom 23 -#define DAT_CollegeStairsSecondFloor 24 -#define FRM_CollegeStairsSecondFloor1 25 -#define FRM_CollegeStairsSecondFloor2 26 -#define FRM_CollegeStairsSecondFloor3 27 -#define TXT_CollegeStairsSecondFloor 28 -#define IMG_CollegeStairsSecondFloor 29 -#define PAL_CollegeStairsSecondFloor 30 -#define MSK_CollegeStairsSecondFloor 31 -#define BOX_CollegeStairsSecondFloor 32 -#define DAT_CollegeStairsFirstFloor 33 -#define DLG_CollegeStairsFirstFloor 34 -#define FRM_CollegeStairsFirstFloor1 35 -#define FRM_CollegeStairsFirstFloor2 36 -#define TXT_CollegeStairsFirstFloor 37 -#define IMG_CollegeStairsFirstFloor 38 -#define PAL_CollegeStairsFirstFloor 39 -#define MSK_CollegeStairsFirstFloor 40 -#define BOX_CollegeStairsFirstFloor 41 -#define DAT_CollegeCorridorMissBarrymore 42 -#define FRM_CollegeCorridorMissBarrymore1 43 -#define FRM_CollegeCorridorMissBarrymore2 44 -#define FRM_CollegeCorridorMissBarrymore3 45 -#define TXT_CollegeCorridorMissBarrymore 46 -#define IMG_CollegeCorridorMissBarrymore 47 -#define PAL_CollegeCorridorMissBarrymore 48 -#define MSK_CollegeCorridorMissBarrymore 49 -#define BOX_CollegeCorridorMissBarrymore 50 -#define DAT_CollegeCorridorAnnouncementBoard 51 -#define FRM_CollegeCorridorAnnouncementBoard1 52 -#define FRM_CollegeCorridorAnnouncementBoard2 53 -#define TXT_CollegeCorridorAnnouncementBoard 54 -#define IMG_CollegeCorridorAnnouncementBoard 55 -#define PAL_CollegeCorridorAnnouncementBoard 56 -#define MSK_CollegeCorridorAnnouncementBoard 57 -#define BOX_CollegeCorridorAnnouncementBoard 58 -#define DAT_CollegeCorridorSharonMichael 59 -#define FRM_CollegeCorridorSharonMichael1 60 -#define FRM_CollegeCorridorSharonMichael2 61 -#define FRM_CollegeCorridorSharonMichael3 62 -#define FRM_CollegeCorridorSharonMichael4 63 -#define TXT_CollegeCorridorSharonMichael 64 -#define IMG_CollegeCorridorSharonMichael 65 -#define PAL_CollegeCorridorSharonMichael 66 -#define MSK_CollegeCorridorSharonMichael 67 -#define BOX_CollegeCorridorSharonMichael 68 -#define DAT_CollegeCorridorCaroline 69 -#define FRM_CollegeCorridorCaroline1 70 -#define FRM_CollegeCorridorCaroline3 71 -#define FRM_CollegeCorridorCaroline2 72 -#define TXT_CollegeCorridorCaroline 73 -#define IMG_CollegeCorridorCaroline 74 -#define PAL_CollegeCorridorCaroline 75 -#define MSK_CollegeCorridorCaroline 76 -#define BOX_CollegeCorridorCaroline 77 -#define DAT_CollegeCorridorLucas 78 -#define FRM_CollegeCorridorLucas1 79 -#define FRM_CollegeCorridorLucas2 80 -#define FRM_CollegeCorridorLucas3 81 -#define FRM_CollegeCorridorLucas4 82 -#define TXT_CollegeCorridorLucas 83 -#define IMG_CollegeCorridorLucas 84 -#define PAL_CollegeCorridorLucas 85 -#define MSK_CollegeCorridorLucas 86 -#define BOX_CollegeCorridorLucas 87 -#define DAT_CollegeCorridorMargaret 88 -#define DLG_CollegeCorridorMargaret 89 -#define FRM_CollegeCorridorMargaret1 90 -#define FRM_CollegeCorridorMargaret2 91 -#define FRM_CollegeCorridorMargaret3 92 -#define FRM_CollegeCorridorMargaret4 93 -#define TXT_CollegeCorridorMargaret 94 -#define IMG_CollegeCorridorMargaret 95 -#define PAL_CollegeCorridorMargaret 96 -#define MSK_CollegeCorridorMargaret 97 -#define BOX_CollegeCorridorMargaret 98 -#define DAT_CollegeLockers 99 -#define FRM_CollegeLockers1 100 -#define FRM_CollegeLockers2 101 -#define FRM_CollegeLockers3 102 -#define TXT_CollegeLockers 103 -#define IMG_CollegeLockers 104 -#define PAL_CollegeLockers 105 -#define MSK_CollegeLockers 106 -#define BOX_CollegeLockers 107 -#define DAT_MenToilets 108 -#define DAT_WomenToilets 109 -#define FRM_WomenToilets1 110 -#define FRM_WomenToilets2 111 -#define FRM_WomenToilets3 112 -#define FRM_WomenToilets4 113 -#define FRM_WomenToilets5 114 -#define TXT_WomenToilets 115 -#define IMG_WomenToilets 116 -#define PAL_WomenToilets 117 -#define MSK_WomenToilets 118 -#define BOX_WomenToilets 119 -#define FRM_MenToilets1 120 -#define FRM_MenToilets2 121 -#define TXT_MenToilets 122 -#define IMG_MenToilets 123 -#define PAL_MenToilets 124 -#define MSK_MenToilets 125 -#define BOX_MenToilets 126 -#define DAT_OutsideCollege 127 -#define DLG_OutsideCollege 128 -#define FRM_OutsideCollege1 129 -#define FRM_OutsideCollege2 130 -#define FRM_OutsideCollege3 131 -#define FRM_OutsideCollege4 132 -#define FRM_OutsideCollege5 133 -#define TXT_OutsideCollege 134 -#define IMG_OutsideCollege 135 -#define PAL_OutsideCollege 136 -#define MSK_OutsideCollege 137 -#define BOX_OutsideCollege 138 -#define DAT_Laboratory 139 -#define FRM_Laboratory1 140 -#define FRM_Laboratory2 141 -#define FRM_Laboratory3 142 -#define TXT_Laboratory 143 -#define IMG_Laboratory 144 -#define PAL_Laboratory 145 -#define MSK_Laboratory 146 -#define BOX_Laboratory 147 -#define FRM_MargaretRoom1 148 -#define FRM_MargaretRoom2 149 -#define FRM_MargaretRoom3 150 -#define FRM_MargaretRoom4 151 -#define TXT_MargaretRoom 152 -#define IMG_MargaretRoom 153 -#define PAL_MargaretRoom 154 -#define MSK_MargaretRoom 155 -#define BOX_MargaretRoom 156 -#define DAT_Map 157 -#define TXT_Map 158 -#define IMG_Map 159 -#define PAL_Map 160 -#define MSK_Map 161 -#define BOX_Map 162 -#define DAT_TobiasOffice 163 -#define DLG_TobiasOffice 164 -#define ANM_TobiasOffice1 165 -#define AOF_TobiasOffice1 166 -#define ANM_TobiasOffice2 167 -#define AOF_TobiasOffice2 168 -#define TXT_TobiasOffice 169 -#define IMG_TobiasOffice 170 -#define PAL_TobiasOffice 171 -#define MSK_TobiasOffice 172 -#define BOX_TobiasOffice 173 -#define DAT_BellChurch 174 -#define FRM_BellChurch1 175 -#define FRM_BellChurch2 176 -#define TXT_BellChurch 177 -#define IMG_BellChurch 178 -#define PAL_BellChurch 179 -#define MSK_BellChurch 180 -#define BOX_BellChurch 181 -#define DAT_ChurchPuzzle 182 -#define IMG_ChurchMosaic 183 -#define PAL_ChurchMosaic 184 -#define MSK_ChurchMosaic 185 -#define FRM_ChurchPuzzle1 186 -#define FRM_ChurchPuzzle2 187 -#define FRM_ChurchPuzzle3 188 -#define FRM_ChurchPuzzle13 189 -#define FRM_ChurchPuzzle4 190 -#define FRM_ChurchPuzzle5 191 -#define FRM_ChurchPuzzle6 192 -#define FRM_ChurchPuzzle7 193 -#define FRM_ChurchPuzzle8 194 -#define FRM_ChurchPuzzle9 195 -#define FRM_ChurchPuzzle10 196 -#define FRM_ChurchPuzzle11 197 -#define FRM_ChurchPuzzle12 198 -#define FRM_ChurchPuzzle14 199 -#define TXT_ChurchPuzzle 200 -#define IMG_ChurchPuzzle 201 -#define PAL_ChurchPuzzle 202 -#define MSK_ChurchPuzzle 203 -#define BOX_ChurchPuzzle 204 -#define DAT_InsideChurch 205 -#define TXT_InsideChurch 206 -#define IMG_InsideChurch 207 -#define PAL_InsideChurch 208 -#define MSK_InsideChurch 209 -#define BOX_InsideChurch 210 -#define DAT_OutsideChurch 211 -#define DLG_OutsideChurch 212 -#define FRM_OutsideChurch8 213 -#define FRM_OutsideChurch9 214 -#define FRM_OutsideChurch1 215 -#define FRM_OutsideChurch2 216 -#define FRM_OutsideChurch3 217 -#define FRM_OutsideChurch4 218 -#define FRM_OutsideChurch5 219 -#define FRM_OutsideChurch6 220 -#define FRM_OutsideChurch7 221 -#define FRM_OutsideChurch10 222 -#define FRM_OutsideChurch11 223 -#define FRM_OutsideChurch12 224 -#define TXT_OutsideChurch 225 -#define IMG_OutsideChurch 226 -#define PAL_OutsideChurch 227 -#define MSK_OutsideChurch 228 -#define BOX_OutsideChurch 229 -#define DAT_SpringBridge 230 -#define WLK_Bridge1 231 -#define WLK_Bridge2 232 -#define DLG_SpringPhotographer 233 -#define DAT_SpringRock 234 -#define WLK_Bridge3 235 -#define WLK_Bridge4 236 -#define FRM_SpringRock1 237 -#define FRM_SpringRock2 238 -#define FRM_SpringRock3 239 -#define FRM_SpringRock4 240 -#define FRM_SpringRock5 241 -#define FRM_SpringRock6 242 -#define FRM_SpringBridge1 243 -#define FRM_SpringBridge2 244 -#define TXT_SpringBridge 245 -#define IMG_SpringBridge 246 -#define PAL_SpringBridge 247 -#define MSK_SpringBridge 248 -#define BOX_SpringBridge 249 -#define DAT_Library 250 -#define DLG_Library 251 -#define FRM_Library1 252 -#define FRM_Library2 253 -#define FRM_Library3 254 -#define FRM_Library4 255 -#define FRM_Library5 256 -#define TXT_Library2 257 -#define TXT_Library 258 -#define IMG_Library 259 -#define PAL_Library 260 -#define MSK_Library 261 -#define BOX_Library 262 -#define ANM_PhilipLauraIntro 263 -#define AOF_PhilipLauraIntro 264 -#define ANM_LauraIntro 265 -#define AOF_LauraIntro 266 -#define TXT_SpringBridgeIntro 267 -#define IMG_SpringBridgeIntro 268 -#define PAL_SpringBridgeIntro 269 -#define TXT_SpringRock 270 -#define IMG_SpringRock 271 -#define PAL_SpringRock 272 -#define MSK_SpringRock 273 -#define BOX_SpringRock 274 -#define PAL_Shareware7 275 -#define IMG_Shareware7 276 -#define PAL_Shareware6 277 -#define IMG_Shareware6 278 -#define PAL_Shareware5 279 -#define IMG_Shareware5 280 -#define PAL_Shareware4 281 -#define IMG_Shareware4 282 -#define PAL_Shareware3 283 -#define IMG_Shareware3 284 -#define PAL_Shareware2 285 -#define IMG_Shareware2 286 -#define PAL_Shareware1 287 -#define IMG_Shareware1 288 -#define PAL_TitleScreen 289 -#define IMG_TitleScreen 290 -#define PAL_PenduloStudios 291 -#define IMG_PenduloStudios 292 -#define PAL_GraphicAdventure 293 -#define IMG_GraphicAdventure 294 -#define PAL_Presents 295 -#define IMG_Presents 296 -#define PAL_OptikSoftware 297 -#define IMG_OptikSoftware 298 -#define IMG_Meanwhile 299 -#define IMG_OptionsButton 300 -#define IMG_OptionsMenu 301 -#define CMF_8 302 -#define CMF_9 303 -#define CMF_10 304 -#define CMF_11 305 -#define CMF_12 306 -#define CMF_2_1 307 -#define CMF_2_2 308 -#define CMF_2_3 309 -#define CMF_2_4 310 -#define CMF_3 311 -#define CMF_4 312 -#define CMF_7_1 313 -#define CMF_7_2 314 -#define CMF_7_3 315 -#define CMF_7_4 316 -#define FRM_IgorDirBack 317 -#define FRM_IgorDirRight 318 -#define FRM_IgorDirFront 319 -#define FRM_IgorDirLeft 320 -#define FRM_IgorHead 321 -#define IMG_VerbsPanel 322 -#define TXT_MainTable 323 -#define IMG_RomanNumbersPaper 324 -#define PAL_RomanNumbersPaper 325 -#define FRM_NumbersPaper1 326 -#define FRM_NumbersPaper2 327 -#define IMG_NewsPaper 328 -#define PAL_NewsPaper 329 -#define IMG_PhotoHarrisonMargaret 330 -#define PAL_PhotoHarrisonMargaret 331 -#define IMG_InventoryPanel 332 -#define IMG_Objects 333 -#define DAT_Physicsclassroom 334 -#define DAT_ParkRight 335 -#define DAT_ParkLeft 336 -#define FRM_Park1 337 -#define FRM_Park2 338 -#define FRM_Park3 339 -#define FRM_Park4 340 -#define TXT_Park 341 -#define IMG_Park 342 -#define PAL_Park 343 -#define MSK_Park 344 -#define BOX_Park 345 -#define DAT_OutsideAdministrationBuilding 346 -#define FRM_OutsideAdministrationBuilding1 347 -#define FRM_OutsideAdministrationBuilding2 348 -#define FRM_OutsideAdministrationBuilding3 349 -#define FRM_OutsideAdministrationBuilding4 350 -#define FRM_OutsideAdministrationBuilding5 351 -#define DAT_DeanPepperOffice 352 -#define DAT_AdministrationSecretaryRoom 353 -#define TXT_AdministrationSecretaryRoom 354 -#define IMG_AdministrationSecretaryRoom 355 -#define PAL_AdministrationSecretaryRoom 356 -#define MSK_AdministrationSecretaryRoom 357 -#define BOX_AdministrationSecretaryRoom 358 -#define FRM_DeanPepperOffice1 359 -#define FRM_DeanPepperOffice2 360 -#define FRM_DeanPepperOffice3 361 -#define FRM_DeanPepperOffice4 362 -#define FRM_DeanPepperOffice5 363 -#define FRM_DeanPepperOffice6 364 -#define FRM_DeanPepperOffice7 365 -#define FRM_DeanPepperOffice8 366 -#define FRM_DeanPepperOffice9 367 -#define FRM_DeanPepperOffice10 368 -#define FRM_DeanPepperOffice11 369 -#define FRM_DeanPepperOffice12 370 -#define FRM_DeanPepperOffice13 371 -#define FRM_DeanPepperOffice14 372 -#define FRM_DeanPepperOffice15 373 -#define FRM_DeanPepperOffice16 374 -#define TXT_DeanPepperOffice 375 -#define IMG_DeanPepperOffice 376 -#define PAL_DeanPepperOffice 377 -#define MSK_DeanPepperOffice 378 -#define BOX_DeanPepperOffice 379 -#define DAT_StudentDormitoryRoom 380 -#define TXT_StudentDormitoryRoom 381 -#define IMG_StudentDormitoryRoom 382 -#define PAL_StudentDormitoryRoom 383 -#define MSK_StudentDormitoryRoom 384 -#define BOX_StudentDormitoryRoom 385 -#define FRM_IgorDirBack2 386 -#define FRM_IgorDirRight2 387 -#define FRM_IgorDirFront2 388 -#define FRM_IgorDirLeft2 389 -#define FRM_IgorHead2 390 -#define STR_Copyright1995 391 -#define STR_Copyright1994 392 -#define STR_BottleOfWhisky 393 -#define STR_EmptyBottle 394 -#define STR_BottleOfWater 395 -#define STR_Lizard 396 -#define STR_FatLizard 397 -#define STR_CarolineFolder 398 -#define STR_PhilipFolder 399 -#define STR_Statuette 400 -#define STR_Reward 401 -#define STR_Talk 402 -#define STR_Take 403 -#define STR_Look 404 -#define STR_Use 405 -#define STR_Open 406 -#define STR_Close 407 -#define STR_Give 408 -#define STR_PushStone 409 -#define STR_Exit 410 -#define STR_GamePaused 411 -#define STR_IgorObjectiveUikokahonia 412 -#define STR_SharewareVersion 413 -#define STR_SharewarePlaceOrder 414 -#define STR_SharewareText1 415 -#define STR_SharewareText2 416 -#define STR_SharewareText3 417 -#define STR_SharewareText4 418 -#define STR_SharewareText5 419 -#define STR_SharewareOrder1 420 -#define STR_SharewareOrder2 421 -#define STR_SharewareOrder3 422 -#define STR_SharewareOrder4 423 -#define STR_SharewareShipping1 424 -#define STR_SharewareShipping2 425 -#define STR_SharewareShipping3 426 -#define STR_SharewareShipping4 427 -#define STR_SharewareShipping5 428 -#define STR_SharewareShipping6 429 -#define STR_SharewareShipping7 430 -#define STR_SharewareShipping8 431 -#define STR_SharewareShipping9 432 -#define STR_SharewareShipping10 433 -#define STR_SharewareOptikAddress1 434 -#define STR_SharewareOptikAddress2 435 -#define STR_SharewareOptikAddress3 436 -#define STR_SharewareOptikAddress4 437 -#define STR_SharewareOptikAddress5 438 -#define STR_SharewareOptikAddress6 439 -#define STR_SharewareOptikAddress7 440 -#define STR_SharewareOptikAddress8 441 -#define STR_SharewareOptikAddress9 442 -#define STR_SharewarePenduloAddress1 443 -#define STR_SharewarePenduloAddress2 444 -#define STR_SharewarePenduloAddress3 445 -#define STR_SharewarePenduloAddress4 446 -#define STR_SharewarePenduloAddress5 447 -#define STR_SharewarePenduloAddress6 448 - -#endif diff --git a/engines/igor/saveload.cpp b/engines/igor/saveload.cpp deleted file mode 100644 index cbae77a343..0000000000 --- a/engines/igor/saveload.cpp +++ /dev/null @@ -1,201 +0,0 @@ - -#include "common/savefile.h" -#include "common/system.h" - -#include "igor/igor.h" - -namespace Igor { - -class TypeSerializer { -public: - - TypeSerializer(Common::ReadStream *s) : _readStr(s), _writeStr(0), _saving(false) {} - TypeSerializer(Common::WriteStream *s) : _readStr(0), _writeStr(s), _saving(true) {} - -#define SAVEORLOAD_BASIC_TYPE(T, N, S) \ - void saveOrLoad ## N (T &t) { \ - if (_saving) { \ - _writeStr->write ## S (t); \ - } else { \ - t = _readStr->read ## S (); \ - } \ - } - - SAVEORLOAD_BASIC_TYPE(int8, Byte, Byte) - SAVEORLOAD_BASIC_TYPE(uint8, Byte, Byte) - SAVEORLOAD_BASIC_TYPE(int16, Int16, Uint16LE) - SAVEORLOAD_BASIC_TYPE(uint16, Int16, Uint16LE) - - void saveOrLoadBool(bool &b) { - if (_saving) { - _writeStr->writeByte(b ? 1 : 0); - } else { - b = _readStr->readByte() != 0; - } - } - - void saveOrLoadPad(int sz) { - if (_saving) { - while (sz--) { - _writeStr->writeByte(0); - } - } else { - while (sz--) { - _readStr->readByte(); - } - } - } - - void saveOrLoadPascalString(char *str) { - if (_saving) { - int len = strlen(str); - assert(len < 100); - _writeStr->writeByte(len); - _writeStr->write(str, len); - for (; len < 100; ++len) { - _writeStr->writeByte(' '); - } - } else { - int len = _readStr->readByte(); - assert(len < 100); - _readStr->read(str, len); - str[len] = 0; - for (; len < 100; ++len) { - _readStr->readByte(); - } - } - } - - void saveOrLoadWalkData(WalkData &wd) { - saveOrLoadPad(2); - saveOrLoadInt16(wd.x); - saveOrLoadInt16(wd.y); - saveOrLoadByte(wd.posNum); - saveOrLoadByte(wd.frameNum); - saveOrLoadByte(wd.clipSkipX); - saveOrLoadInt16(wd.clipWidth); - saveOrLoadInt16(wd.scaleWidth); - saveOrLoadByte(wd.xPosChanged); - saveOrLoadInt16(wd.dxPos); - saveOrLoadByte(wd.yPosChanged); - saveOrLoadInt16(wd.dyPos); - saveOrLoadByte(wd.scaleHeight); - } - - void saveOrLoadAction(Action &a) { - saveOrLoadByte(a.verb); - saveOrLoadByte(a.object1Num); - saveOrLoadByte(a.object1Type); - saveOrLoadByte(a.verbType); - saveOrLoadByte(a.object2Num); - saveOrLoadByte(a.object2Type); - } - - void saveOrLoadGameState(GameStateData &gs) { - saveOrLoadByte(gs.enableLight); - saveOrLoadByte(gs.colorLum); - for (int i = 0; i < 5; ++i) { - saveOrLoadInt16(gs.counter[i]); - } - saveOrLoadBool(gs.igorMoving); - saveOrLoadBool(gs.dialogueTextRunning); - saveOrLoadBool(gs.updateLight); - saveOrLoadBool(gs.unkF); - saveOrLoadByte(gs.unk10); - saveOrLoadByte(gs.unk11); - saveOrLoadBool(gs.dialogueStarted); - saveOrLoadPad(1); - for (int i = 0; i < 500; ++i) { - saveOrLoadByte(gs.dialogueData[i]); - } - saveOrLoadByte(gs.dialogueChoiceStart); - saveOrLoadByte(gs.dialogueChoiceCount); - saveOrLoadPad(2); - saveOrLoadByte(gs.nextMusicCounter); - saveOrLoadBool(gs.jumpToNextMusic); - saveOrLoadByte(gs.configSoundEnabled); - saveOrLoadByte(gs.talkSpeed); - saveOrLoadByte(gs.talkMode); - saveOrLoadPad(3); - saveOrLoadByte(gs.musicNum); - saveOrLoadByte(gs.musicSequenceIndex); - } - -private: - - bool _saving; - Common::ReadStream *_readStr; - Common::WriteStream *_writeStr; -}; - -void IgorEngine::saveOrLoadGameState(TypeSerializer &typeSerializer) { - for (int i = 0; i < 100; ++i) { - typeSerializer.saveOrLoadWalkData(_walkData[i]); - } - typeSerializer.saveOrLoadPad(20); - typeSerializer.saveOrLoadByte(_walkDataCurrentIndex); - typeSerializer.saveOrLoadByte(_walkDataLastIndex); - typeSerializer.saveOrLoadByte(_walkCurrentFrame); - typeSerializer.saveOrLoadByte(_walkCurrentPos); - typeSerializer.saveOrLoadPad(23); - typeSerializer.saveOrLoadAction(_currentAction); - typeSerializer.saveOrLoadPad(10); - typeSerializer.saveOrLoadInt16(_currentPart); - typeSerializer.saveOrLoadPad(8); - typeSerializer.saveOrLoadByte(_actionCode); - typeSerializer.saveOrLoadByte(_actionWalkPoint); - typeSerializer.saveOrLoadPad(2); - typeSerializer.saveOrLoadInt16(_inputVars[kInputCursorXPos]); - typeSerializer.saveOrLoadInt16(_inputVars[kInputCursorYPos]); - typeSerializer.saveOrLoadGameState(_gameState); - for (int i = 0; i < 112; ++i) { - typeSerializer.saveOrLoadByte(_objectsState[i]); - } - for (int i = 0; i < 74; ++i) { - typeSerializer.saveOrLoadByte(_inventoryInfo[i]); - } -} - -Common::Error IgorEngine::loadGameState(int slot) { - char name[64]; - generateGameStateFileName(slot, name, 63); - Common::InSaveFile *isf = _saveFileMan->openForLoading(name); - if (isf) { - TypeSerializer ts(isf); - ts.saveOrLoadPascalString(_saveStateDescriptions[slot]); - saveOrLoadGameState(ts); - delete isf; - - memcpy(_igorPalette, (_currentPart == 760) ? PAL_IGOR_2 : PAL_IGOR_1, 48); - UPDATE_OBJECT_STATE(255); - playMusic(_gameState.musicNum); - _system->warpMouse(_inputVars[kInputCursorXPos], _inputVars[kInputCursorYPos]); - if (_currentPart < 900) { - showCursor(); - } - debug(0, "Loaded state, current part %d", _currentPart); - } - - return Common::kNoError; // TODO: return success/failure -} - -Common::Error IgorEngine::saveGameState(int slot) { - char name[64]; - generateGameStateFileName(slot, name, 63); - Common::OutSaveFile *osf = _saveFileMan->openForSaving(name); - if (osf) { - TypeSerializer ts(osf); - ts.saveOrLoadPascalString(_saveStateDescriptions[slot]); - saveOrLoadGameState(ts); - delete osf; - } - - return Common::kNoError; // TODO: return success/failure -} - -void IgorEngine::generateGameStateFileName(int num, char *dst, int len) const { - snprintf(dst, len, "%s.%d", _targetName.c_str(), num); - dst[len] = 0; -} - -} // namespace Igor diff --git a/engines/igor/staticres.cpp b/engines/igor/staticres.cpp deleted file mode 100644 index ef19d7033f..0000000000 --- a/engines/igor/staticres.cpp +++ /dev/null @@ -1,606 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -#include "igor/igor.h" - -namespace Igor { - -const uint8 IgorEngine::_dialogueColor[] = { 0x3F, 0x3F, 0x3F }; - -const uint8 IgorEngine::_sentenceColorIndex[]= { 0xFD, 0xFB, 0xF1 }; - -const uint8 IgorEngine::_fontCharIndex[] = { - 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, - 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, - 0x5F, 0x53, 0x51, 0x59, 0x5D, 0x5A, 0x5C, 0x63, 0x44, 0x45, 0x63, 0x47, 0x4D, 0x46, 0x4F, 0x4B, - 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0x42, 0x43, 0x50, 0x4E, 0x49, 0x48, 0x4A, 0x55, - 0x5B, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, - 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x57, 0x4C, 0x58, 0x63, 0x63, - 0x63, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x29, - 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x63, 0x63, 0x63, 0x63, 0x63, - 0x63, 0x63, 0x36, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, - 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, - 0x35, 0x37, 0x38, 0x39, 0x28, 0x56, 0x63, 0x63, 0x54, 0x63, 0x63, 0x63, 0x63, 0x52, 0x63, 0x63, - 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, - 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, - 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, - 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, - 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x5E, 0x63, 0x63, 0x63, 0x63, 0x63 -}; - -const uint8 IgorEngine::_fontCharWidth[] = { - 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, - 0x07, 0x08, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x07, 0x08, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x06, 0x05, 0x06, 0x07, 0x05, 0x08, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, - 0x06, 0x08, 0x08, 0x06, 0x07, 0x06, 0x06, 0x05, 0x06, 0x06, 0x08, 0x07, 0x07, 0x07, 0x08, 0x07, - 0x07, 0x07, 0x07, 0x07, 0x05, 0x05, 0x07, 0x07, 0x07, 0x06, 0x06, 0x07, 0x07, 0x04, 0x04, 0x03, - 0x03, 0x06, 0x03, 0x03, 0x07, 0x07, 0x08, 0x05, 0x05, 0x08, 0x04, 0x06, 0x08, 0x07, 0x08, 0x00, - 0x00, 0x00, 0x00, 0x00 -}; - -const uint32 IgorEngine::_fontData[] = { - 0x000000, 0x000AA0, 0x002968, 0x00A55A, 0x0097D6, 0x00D6D6, 0x00D556, 0x00D7D6, 0x00D6D6, 0x00FAFA, - 0x000000, 0x000000, 0x00AAAA, 0x029556, 0x025F5A, 0x035B58, 0x03D558, 0x025F58, 0x035B5A, 0x03D556, - 0x00FFFA, 0x000000, 0x000000, 0x00AAA8, 0x02955A, 0x025FD6, 0x03E8D6, 0x0000D6, 0x02A8D6, 0x025AD6, - 0x03D55A, 0x00FFE8, 0x000000, 0x000000, 0x002AAA, 0x00A556, 0x02975A, 0x025B58, 0x035B58, 0x035B58, - 0x03D75A, 0x00F556, 0x003FFA, 0x000000, 0x000000, 0x02AAAA, 0x025556, 0x037F5A, 0x03A758, 0x003558, - 0x02B758, 0x027B5A, 0x035556, 0x03FFFA, 0x000000, 0x000000, 0x02AAAA, 0x025556, 0x037F5A, 0x03A758, - 0x003558, 0x003758, 0x003B5A, 0x000956, 0x000FFA, 0x000000, 0x000000, 0x00AAA0, 0x029568, 0x025F5A, - 0x03EBD6, 0x02AAD6, 0x0256D6, 0x035A5A, 0x035568, 0x03FFA0, 0x000000, 0x000000, 0x00AAAA, 0x009696, - 0x00D6D6, 0x00D6D6, 0x00D556, 0x00D7D6, 0x00D6D6, 0x00D6D6, 0x00FAFA, 0x000000, 0x000000, 0x00AAAA, - 0x009556, 0x00FD7A, 0x000D60, 0x000D60, 0x000D60, 0x00AD6A, 0x009556, 0x00FFFA, 0x000000, 0x000000, - 0x02AA80, 0x025580, 0x03D680, 0x00D600, 0x00D6AA, 0x00D696, 0x00D6D6, 0x00F55A, 0x003FE8, 0x000000, - 0x000000, 0x02AAAA, 0x025A56, 0x035B5A, 0x03D758, 0x00F558, 0x029758, 0x025B5A, 0x035B56, 0x03EBFA, - 0x000000, 0x000000, 0x000AAA, 0x000956, 0x000F5A, 0x000358, 0x02A358, 0x026B58, 0x035B5A, 0x035556, - 0x03FFFA, 0x000000, 0x000000, 0x02A8AA, 0x025A96, 0x035656, 0x035556, 0x035556, 0x035DD6, 0x035ED6, - 0x0358D6, 0x03E8FA, 0x000000, 0x000000, 0x02A8AA, 0x025A96, 0x035A56, 0x035956, 0x0355D6, 0x0356D6, - 0x035AD6, 0x0358D6, 0x03E8FA, 0x000000, 0x000000, 0x002AA0, 0x00A568, 0x02975A, 0x025BD6, 0x0358D6, - 0x035AD6, 0x03D65A, 0x00F568, 0x003FA0, 0x000000, 0x000000, 0x00AAAA, 0x029556, 0x025F5A, 0x035B58, - 0x03D558, 0x00FF58, 0x000B5A, 0x000956, 0x000FFA, 0x000000, 0x000000, 0x002AA8, 0x00A55A, 0x0097D6, - 0x00D6D6, 0x00D6D6, 0x00D6D6, 0x00D5D6, 0x00F55A, 0x0095E8, 0x00FE80, 0x000000, 0x00AAAA, 0x029556, - 0x025F5A, 0x035B58, 0x03D558, 0x025F58, 0x035B5A, 0x035B56, 0x03EBFA, 0x000000, 0x000000, 0x002AA8, - 0x00A55A, 0x0097D6, 0x00FAD6, 0x00A55A, 0x0097EA, 0x00D696, 0x00F55A, 0x003FE8, 0x000000, 0x000000, - 0x00AAAA, 0x009556, 0x00DD76, 0x00ED7A, 0x000D60, 0x000D60, 0x002D68, 0x002558, 0x003FE8, 0x000000, - 0x000000, 0x00AAAA, 0x009696, 0x00D6D6, 0x00D6D6, 0x00D6D6, 0x00D6D6, 0x00D6D6, 0x00F55A, 0x003FE8, - 0x000000, 0x000000, 0x00AAAA, 0x009696, 0x00D6D6, 0x00D6D6, 0x00D6D6, 0x00D6D6, 0x00F55A, 0x003D68, - 0x000FA0, 0x000000, 0x000000, 0x02A8AA, 0x025896, 0x0358D6, 0x035AD6, 0x0359D6, 0x035556, 0x035756, - 0x03DBDA, 0x00E8E8, 0x000000, 0x000000, 0x02A8AA, 0x025896, 0x035AD6, 0x03D65A, 0x00F568, 0x02975A, - 0x025BD6, 0x0358D6, 0x03E8FA, 0x000000, 0x000000, 0x00AAAA, 0x009696, 0x00D6D6, 0x00D6D6, 0x00F55A, - 0x003D68, 0x002D68, 0x002558, 0x003FE8, 0x000000, 0x000000, 0x02AAAA, 0x025556, 0x0357D6, 0x03D5F6, - 0x02F57A, 0x027D5A, 0x035F56, 0x035556, 0x03FFFA, 0x000000, 0x000000, 0x000000, 0x000000, 0x000AA8, - 0x002958, 0x0025E8, 0x00355A, 0x0035D6, 0x00355A, 0x003FE8, 0x000000, 0x000000, 0x0000AA, 0x000096, - 0x000AD6, 0x002956, 0x0025D6, 0x0035D6, 0x0035D6, 0x003D56, 0x000FFA, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000AA8, 0x00295A, 0x0025D6, 0x003ED6, 0x0025D6, 0x003D5A, 0x000FE8, 0x000000, 0x000000, - 0x002A80, 0x002580, 0x0035A8, 0x00355A, 0x0035D6, 0x0035D6, 0x0035D6, 0x00355A, 0x003FE8, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000AA8, 0x00295A, 0x0025D6, 0x003556, 0x003FD6, 0x00255A, 0x003FE8, - 0x000000, 0x000000, 0x002AA0, 0x002568, 0x003F58, 0x000B5A, 0x000956, 0x000F5A, 0x000B5A, 0x000956, - 0x000FFA, 0x000000, 0x000000, 0x000000, 0x000000, 0x002AA8, 0x00255A, 0x0035D6, 0x0035D6, 0x00355A, - 0x0035EA, 0x003D56, 0x000FFA, 0x000000, 0x0000AA, 0x000096, 0x000AD6, 0x002956, 0x0025D6, 0x0035D6, - 0x0035D6, 0x0035D6, 0x003EFA, 0x000000, 0x000000, 0x0002A8, 0x000258, 0x0003EA, 0x000256, 0x00035A, - 0x000358, 0x000B5A, 0x000956, 0x000FFA, 0x000000, 0x000000, 0x002A80, 0x002580, 0x003E80, 0x002580, - 0x003580, 0x0035AA, 0x003596, 0x0035D6, 0x003D5A, 0x000FE8, 0x000000, 0x0000AA, 0x000096, 0x00AAD6, - 0x0096D6, 0x00F5D6, 0x003D56, 0x00A5D6, 0x0096D6, 0x00FAFA, 0x000000, 0x000000, 0x0002AA, 0x000256, - 0x00035A, 0x000358, 0x000358, 0x000358, 0x000B5A, 0x000956, 0x000FFA, 0x000000, 0x000000, 0x000000, - 0x000000, 0x00AAAA, 0x029656, 0x025556, 0x035DD6, 0x035DD6, 0x035ED6, 0x03E8FA, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000AAA, 0x002956, 0x0025D6, 0x0035D6, 0x0035D6, 0x0035D6, 0x003EFA, 0x000000, - 0x000000, 0x000AAA, 0x000956, 0x000FFA, 0x002956, 0x0025D6, 0x0035D6, 0x0035D6, 0x0035D6, 0x003EFA, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000AA8, 0x00295A, 0x0025D6, 0x0035D6, 0x0035D6, 0x003D5A, - 0x000FE8, 0x000000, 0x000000, 0x000000, 0x000000, 0x000AAA, 0x002956, 0x0025D6, 0x0035D6, 0x003D56, - 0x000FD6, 0x0000D6, 0x0000FA, 0x000000, 0x000000, 0x000000, 0x002AA8, 0x00255A, 0x0035D6, 0x0035D6, - 0x00355A, 0x0035E8, 0x003580, 0x003E80, 0x000000, 0x000000, 0x000000, 0x002AAA, 0x002596, 0x003D5A, - 0x000F58, 0x000B5A, 0x000956, 0x000FFA, 0x000000, 0x000000, 0x000000, 0x000000, 0x002AA8, 0x00255A, - 0x003FD6, 0x00295A, 0x0025EA, 0x003D56, 0x000FFA, 0x000000, 0x000000, 0x0002A0, 0x000268, 0x002B5A, - 0x002556, 0x003F5A, 0x000358, 0x002B58, 0x002568, 0x003FA0, 0x000000, 0x000000, 0x000000, 0x000000, - 0x002AAA, 0x002596, 0x0035D6, 0x0035D6, 0x0035D6, 0x003D5A, 0x000FE8, 0x000000, 0x000000, 0x000000, - 0x000000, 0x002AAA, 0x002596, 0x0035D6, 0x0035D6, 0x003D5A, 0x000F68, 0x0003A0, 0x000000, 0x000000, - 0x000000, 0x000000, 0x02A8AA, 0x025A96, 0x0359D6, 0x035DD6, 0x035556, 0x03D75A, 0x00FBE8, 0x000000, - 0x000000, 0x000000, 0x000000, 0x02A8AA, 0x025A96, 0x03D65A, 0x00F568, 0x02975A, 0x025BD6, 0x03E8FA, - 0x000000, 0x000000, 0x000000, 0x000000, 0x002AAA, 0x002596, 0x0035D6, 0x0035D6, 0x00355A, 0x0035EA, - 0x003D56, 0x000FFA, 0x000000, 0x000000, 0x000000, 0x00AAAA, 0x009556, 0x00F5F6, 0x00BD7A, 0x009F5A, - 0x00D556, 0x00FFFA, 0x000000, 0x002A80, 0x0025A0, 0x003D60, 0x000FA8, 0x002958, 0x0025E8, 0x00355A, - 0x0035D6, 0x00355A, 0x003FE8, 0x000000, 0x002A80, 0x0025A0, 0x003D60, 0x000FA8, 0x00295A, 0x0025D6, - 0x003556, 0x003FD6, 0x00255A, 0x003FE8, 0x000000, 0x000AA0, 0x000968, 0x000F58, 0x0003EA, 0x000256, - 0x00035A, 0x000358, 0x000B5A, 0x000956, 0x000FFA, 0x000000, 0x002A80, 0x0025A0, 0x003D60, 0x000FA8, - 0x00295A, 0x0025D6, 0x0035D6, 0x0035D6, 0x003D5A, 0x000FE8, 0x000000, 0x002A80, 0x0025A0, 0x003D60, - 0x002FAA, 0x002596, 0x0035D6, 0x0035D6, 0x0035D6, 0x003D5A, 0x000FE8, 0x000000, 0x000000, 0x00AAA8, - 0x02955A, 0x025FD6, 0x0358D6, 0x0358D6, 0x0358D6, 0x035AD6, 0x03D55A, 0x00FFE8, 0x000000, 0x000000, - 0x000AA0, 0x000968, 0x000D58, 0x000D68, 0x000D60, 0x000D60, 0x00AD6A, 0x009556, 0x00FFFA, 0x000000, - 0x000000, 0x002AA8, 0x00A55A, 0x0097D6, 0x00D6FA, 0x00F568, 0x00BF5A, 0x0097D6, 0x00D556, 0x00FFFA, - 0x000000, 0x000000, 0x002AA8, 0x00A55A, 0x0097D6, 0x00D6FA, 0x00F560, 0x0097AA, 0x00D696, 0x00F55A, - 0x003FE8, 0x000000, 0x000000, 0x00AA80, 0x0095A0, 0x00D568, 0x00D75A, 0x02D7D6, 0x025556, 0x03D7FA, - 0x025580, 0x03FE80, 0x000000, 0x000000, 0x00AAAA, 0x009556, 0x00FFD6, 0x00A556, 0x0097FA, 0x00D6AA, - 0x00D696, 0x00F55A, 0x003FE8, 0x000000, 0x000000, 0x002AA0, 0x002568, 0x003F5A, 0x002BD6, 0x00A556, - 0x0097D6, 0x00D6D6, 0x00F55A, 0x003FE8, 0x000000, 0x000000, 0x00AAAA, 0x009556, 0x00D7D6, 0x00D6FA, - 0x00F5A0, 0x003D60, 0x000D60, 0x000D60, 0x000FA0, 0x000000, 0x000000, 0x002AA8, 0x00A55A, 0x0097D6, - 0x00D6D6, 0x00F55A, 0x0097D6, 0x00D6D6, 0x00F55A, 0x003FE8, 0x000000, 0x000000, 0x002AA8, 0x00A55A, - 0x0097D6, 0x00D6D6, 0x00D55A, 0x00D7E8, 0x00F5A8, 0x003D58, 0x000FE8, 0x000000, 0x000AA0, 0x000968, - 0x000F5A, 0x0003D6, 0x0000D6, 0x0000D6, 0x0000D6, 0x0002D6, 0x000A5A, 0x000968, 0x000FA0, 0x0000AA, - 0x000296, 0x000A5A, 0x000968, 0x000D60, 0x000D60, 0x000D60, 0x000D68, 0x000F5A, 0x0003D6, 0x0000FA, - 0x000000, 0x000000, 0x000000, 0x000000, 0x00AAAA, 0x009556, 0x00FFFA, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000AA0, 0x000960, 0x00AD6A, 0x009556, 0x00FD7A, 0x000D60, 0x000FA0, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x00AAAA, 0x009556, 0x00FFFA, 0x009556, 0x00FFFA, - 0x000000, 0x000000, 0x000000, 0x000000, 0x002A80, 0x0025A0, 0x003D68, 0x000F5A, 0x0003D6, 0x000A5A, - 0x002968, 0x0025A0, 0x003E80, 0x000000, 0x000000, 0x0000AA, 0x000296, 0x000A5A, 0x002968, 0x0025A0, - 0x003D68, 0x000F5A, 0x0003D6, 0x0000FA, 0x000000, 0x000000, 0x00A800, 0x009A00, 0x00D680, 0x00F5A0, - 0x003D68, 0x000F5A, 0x0003D6, 0x0000F6, 0x00003A, 0x000000, 0x000000, 0x00002A, 0x0000A6, 0x000296, - 0x000A5A, 0x002968, 0x00A5A0, 0x009680, 0x00DA00, 0x00E800, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x0002A8, 0x000258, 0x00035A, 0x0003D6, 0x0000FA, 0x000000, 0x000000, - 0x000000, 0x0002A8, 0x000258, 0x000358, 0x0003E8, 0x000258, 0x00035A, 0x0003D6, 0x0000FA, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0000AA, 0x000096, 0x0000D6, 0x0000FA, 0x000000, - 0x000000, 0x000000, 0x000000, 0x0000AA, 0x000096, 0x0000D6, 0x0000FA, 0x000096, 0x0000D6, 0x0000FA, - 0x000000, 0x002AAA, 0x002596, 0x0035D6, 0x0035D6, 0x003EFA, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x0000AA, 0x000096, 0x0000FA, 0x000096, 0x0000D6, 0x0000D6, 0x0000D6, - 0x0000D6, 0x0000FA, 0x000000, 0x000000, 0x0000AA, 0x000096, 0x0000D6, 0x0000D6, 0x0000D6, 0x0000D6, - 0x0000FA, 0x000096, 0x0000FA, 0x000000, 0x000000, 0x000AA0, 0x000960, 0x000FA0, 0x000968, 0x000F5A, - 0x00ABD6, 0x0096D6, 0x00F55A, 0x003FE8, 0x000000, 0x000000, 0x002AA8, 0x00A55A, 0x0097D6, 0x00D6FA, - 0x00F5A0, 0x003D60, 0x000FA0, 0x000960, 0x000FA0, 0x000000, 0x02AAAA, 0x025556, 0x03FFFA, 0x025A96, - 0x035A56, 0x035956, 0x0355D6, 0x0356D6, 0x035AD6, 0x03E8FA, 0x000000, 0x000AAA, 0x000956, 0x000FD6, - 0x0000D6, 0x0000D6, 0x0000D6, 0x0000D6, 0x0000D6, 0x000AD6, 0x000956, 0x000FFA, 0x000AAA, 0x000956, - 0x000D7A, 0x000D60, 0x000D60, 0x000D60, 0x000D60, 0x000D60, 0x000D6A, 0x000D56, 0x000FFA, 0x000000, - 0x000000, 0x02AAAA, 0x02965A, 0x025556, 0x03D75A, 0x025556, 0x03D75A, 0x02FBEA, 0x000000, 0x000000, - 0x0002A8, 0x000258, 0x00035A, 0x0003D6, 0x0000FA, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, - 0x000000, 0x000000, 0x000000, 0x000000, 0x0002AA, 0x000256, 0x000356, 0x000356, 0x0003FA, 0x000000, - 0x000000, 0x000000, 0x000000, 0x002AA0, 0x00A568, 0x009758, 0x02F568, 0x025D5A, 0x03D5D6, 0x02D6D6, - 0x02595A, 0x03EFE8, 0x000000, 0x000A80, 0x0029A8, 0x00A55A, 0x0097D6, 0x00FAD6, 0x00A55A, 0x0097EA, - 0x00D696, 0x00F55A, 0x003DE8, 0x000E80, 0x000000, 0x00AAA8, 0x02955A, 0x025FD6, 0x0355D6, 0x0355D6, - 0x0355D6, 0x03FED6, 0x00A55A, 0x003FE8, 0x000000 -}; - -const uint8 IgorEngine::_talkDelays[] = { 0, 27, 22, 17, 12, 7, 0 }; - -const uint8 IgorEngine::_inventoryOffsetTable[] = { 1, 8, 15, 22, 29, 36, 42, 0 }; - -const uint8 IgorEngine::_inventoryActionsTable[] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x16, 0x00, 0x01, 0x00, 0x09, 0x00, - 0x0C, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x17, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x18, 0x00, 0x6A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x19, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x1A, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x1B, 0x00, - 0x01, 0x00, 0x09, 0x00, 0x0C, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x1C, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x1D, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x1E, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x1F, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x20, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x24, 0x00, 0x01, 0x00, 0x3D, 0x01, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x25, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x26, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x27, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x28, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x00, 0x08, 0x00, 0x2A, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x2B, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x2C, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x2D, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x2E, 0x00, - 0x01, 0x00, 0x2E, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x30, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x32, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x33, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x34, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x35, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x36, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x37, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x38, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x3A, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x3B, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x41, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x40, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x42, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x45, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00 -}; - -const uint8 IgorEngine::_walkWidthScaleTable[] = { - 0x01, 0x01, 0x02, 0x02, 0x03, 0x04, 0x04, 0x05, 0x05, 0x06, 0x07, 0x07, 0x08, 0x08, 0x09, 0x0A, - 0x0A, 0x0B, 0x0B, 0x0C, 0x0D, 0x0D, 0x0E, 0x0E, 0x0F, 0x10, 0x10, 0x11, 0x11, 0x12, 0x13, 0x13, - 0x14, 0x14, 0x15, 0x16, 0x16, 0x17, 0x17, 0x18, 0x19, 0x19, 0x1A, 0x1A, 0x1B, 0x1C, 0x1C, 0x1D, - 0x1D, 0x1E -}; - -const float IgorEngine::_walkScaleSpeedTable[] = { - 0.6250f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.1250f, 1.3750f, 1.6250f, 1.6250f, - 1.6250f, 1.6250f, 2.0000f, 2.1250f, 2.3750f, 2.3750f, 2.6250f, 2.6250f, 2.7500f, 2.7500f, - 2.7500f, 3.0000f, 3.0000f, 3.0000f, 3.0000f, 3.6250f, 3.6250f, 3.6250f, 3.8750f, 3.8750f, - 3.8750f, 4.0000f, 4.0000f, 4.3750f, 4.3750f, 4.6250f, 4.6250f, 5.0000f, 5.0000f, 5.0000f, - 5.0000f, 5.2500f, 5.5000f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f -}; - -const uint8 IgorEngine::_walkScaleTable[] = { - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, - 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, - 0x30, 0x31, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, - 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, - 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, - 0x2E, 0x2F, 0x30, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, - 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, - 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, - 0x2E, 0x2F, 0x30, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, - 0x0D, 0x0E, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, - 0x1E, 0x1F, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, - 0x2F, 0x30, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0D, 0x0E, 0x0F, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, - 0x21, 0x22, 0x23, 0x24, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x31, - 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, - 0x11, 0x12, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1E, 0x1F, 0x20, 0x21, 0x22, - 0x23, 0x24, 0x25, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x31, 0x00, 0x01, 0x02, - 0x03, 0x04, 0x05, 0x06, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x10, 0x11, 0x12, 0x13, 0x14, - 0x15, 0x16, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, - 0x27, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x15, 0x16, 0x17, 0x18, 0x19, - 0x1A, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x2A, 0x2B, 0x2C, - 0x2D, 0x2E, 0x2F, 0x30, 0x00, 0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0C, 0x0D, - 0x0E, 0x0F, 0x10, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1F, 0x20, - 0x21, 0x22, 0x23, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x00, 0x01, - 0x02, 0x03, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0B, 0x0C, 0x0D, 0x0E, 0x10, 0x11, 0x12, 0x13, 0x14, - 0x16, 0x17, 0x18, 0x19, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x21, 0x22, 0x23, 0x24, 0x26, 0x27, 0x28, - 0x29, 0x2A, 0x2C, 0x2D, 0x2E, 0x2F, 0x30, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x09, 0x0A, - 0x0B, 0x0C, 0x0E, 0x0F, 0x10, 0x11, 0x13, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1A, 0x1B, 0x1D, 0x1E, - 0x1F, 0x20, 0x22, 0x23, 0x24, 0x25, 0x27, 0x28, 0x29, 0x2A, 0x2C, 0x2D, 0x2E, 0x2F, 0x31, 0x00, - 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x0B, 0x0D, 0x0E, 0x0F, 0x10, 0x12, 0x13, 0x14, - 0x16, 0x17, 0x18, 0x19, 0x1B, 0x1C, 0x1D, 0x1F, 0x20, 0x21, 0x22, 0x24, 0x25, 0x26, 0x28, 0x29, - 0x2A, 0x2B, 0x2D, 0x2E, 0x2F, 0x31, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x08, 0x09, 0x0A, 0x0C, - 0x0D, 0x0E, 0x10, 0x11, 0x12, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1A, 0x1B, 0x1D, 0x1E, 0x1F, 0x21, - 0x22, 0x23, 0x25, 0x26, 0x27, 0x29, 0x2A, 0x2B, 0x2D, 0x2E, 0x2F, 0x31, 0x00, 0x01, 0x03, 0x04, - 0x05, 0x07, 0x08, 0x09, 0x0B, 0x0C, 0x0D, 0x0F, 0x10, 0x11, 0x13, 0x14, 0x15, 0x17, 0x18, 0x1A, - 0x1B, 0x1C, 0x1E, 0x1F, 0x20, 0x22, 0x23, 0x24, 0x26, 0x27, 0x28, 0x2A, 0x2B, 0x2C, 0x2E, 0x2F, - 0x31, 0x00, 0x01, 0x03, 0x04, 0x05, 0x07, 0x08, 0x0A, 0x0B, 0x0C, 0x0E, 0x0F, 0x11, 0x12, 0x13, - 0x15, 0x16, 0x18, 0x19, 0x1A, 0x1C, 0x1D, 0x1E, 0x20, 0x21, 0x23, 0x24, 0x25, 0x27, 0x28, 0x2A, - 0x2B, 0x2C, 0x2E, 0x2F, 0x30, 0x00, 0x01, 0x03, 0x04, 0x06, 0x07, 0x09, 0x0A, 0x0B, 0x0D, 0x0E, - 0x10, 0x11, 0x12, 0x14, 0x15, 0x17, 0x18, 0x1A, 0x1B, 0x1C, 0x1E, 0x1F, 0x21, 0x22, 0x24, 0x25, - 0x26, 0x28, 0x29, 0x2B, 0x2C, 0x2E, 0x2F, 0x31, 0x00, 0x01, 0x03, 0x04, 0x06, 0x07, 0x09, 0x0A, - 0x0C, 0x0D, 0x0F, 0x10, 0x12, 0x13, 0x15, 0x16, 0x17, 0x19, 0x1A, 0x1C, 0x1D, 0x1F, 0x20, 0x22, - 0x23, 0x25, 0x26, 0x28, 0x29, 0x2B, 0x2C, 0x2E, 0x2F, 0x30, 0x00, 0x02, 0x03, 0x05, 0x06, 0x08, - 0x09, 0x0B, 0x0C, 0x0E, 0x0F, 0x11, 0x12, 0x14, 0x15, 0x17, 0x18, 0x1A, 0x1B, 0x1D, 0x1E, 0x20, - 0x21, 0x23, 0x24, 0x26, 0x27, 0x29, 0x2A, 0x2C, 0x2D, 0x2F, 0x31, 0x00, 0x02, 0x03, 0x05, 0x06, - 0x08, 0x09, 0x0B, 0x0D, 0x0E, 0x10, 0x11, 0x13, 0x14, 0x16, 0x18, 0x19, 0x1B, 0x1C, 0x1E, 0x1F, - 0x21, 0x22, 0x24, 0x26, 0x27, 0x29, 0x2A, 0x2C, 0x2D, 0x2F, 0x31, 0x00, 0x02, 0x03, 0x05, 0x07, - 0x08, 0x0A, 0x0B, 0x0D, 0x0F, 0x10, 0x12, 0x13, 0x15, 0x17, 0x18, 0x1A, 0x1C, 0x1D, 0x1F, 0x20, - 0x22, 0x24, 0x25, 0x27, 0x28, 0x2A, 0x2C, 0x2D, 0x2F, 0x30, 0x00, 0x02, 0x04, 0x05, 0x07, 0x09, - 0x0A, 0x0C, 0x0D, 0x0F, 0x11, 0x13, 0x14, 0x16, 0x18, 0x19, 0x1B, 0x1D, 0x1E, 0x20, 0x22, 0x23, - 0x25, 0x27, 0x28, 0x2A, 0x2B, 0x2D, 0x2F, 0x30, 0x00, 0x02, 0x04, 0x05, 0x07, 0x09, 0x0B, 0x0C, - 0x0E, 0x10, 0x11, 0x13, 0x15, 0x17, 0x18, 0x1A, 0x1C, 0x1E, 0x1F, 0x21, 0x23, 0x24, 0x26, 0x28, - 0x2A, 0x2B, 0x2D, 0x2F, 0x31, 0x00, 0x02, 0x04, 0x06, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x10, 0x12, - 0x14, 0x16, 0x17, 0x19, 0x1B, 0x1D, 0x1F, 0x20, 0x22, 0x24, 0x26, 0x28, 0x29, 0x2B, 0x2D, 0x2F, - 0x30, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0B, 0x0D, 0x0F, 0x11, 0x13, 0x15, 0x17, 0x18, 0x1A, - 0x1C, 0x1E, 0x20, 0x22, 0x24, 0x25, 0x27, 0x29, 0x2B, 0x2D, 0x2F, 0x31, 0x00, 0x02, 0x04, 0x06, - 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x14, 0x16, 0x18, 0x19, 0x1B, 0x1D, 0x1F, 0x21, 0x23, 0x25, - 0x27, 0x29, 0x2B, 0x2D, 0x2F, 0x30, 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x11, 0x13, - 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x1F, 0x21, 0x23, 0x25, 0x27, 0x29, 0x2B, 0x2D, 0x2F, 0x31, 0x01, - 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x11, 0x13, 0x15, 0x18, 0x1A, 0x1C, 0x1E, 0x20, 0x22, - 0x24, 0x26, 0x28, 0x2A, 0x2C, 0x2E, 0x31, 0x01, 0x03, 0x05, 0x07, 0x09, 0x0C, 0x0E, 0x10, 0x12, - 0x14, 0x16, 0x19, 0x1B, 0x1D, 0x1F, 0x21, 0x23, 0x26, 0x28, 0x2A, 0x2C, 0x2E, 0x31, 0x01, 0x03, - 0x05, 0x08, 0x0A, 0x0C, 0x0E, 0x11, 0x13, 0x15, 0x18, 0x1A, 0x1C, 0x1E, 0x21, 0x23, 0x25, 0x27, - 0x2A, 0x2C, 0x2E, 0x31, 0x01, 0x03, 0x06, 0x08, 0x0A, 0x0D, 0x0F, 0x12, 0x14, 0x16, 0x19, 0x1B, - 0x1D, 0x20, 0x22, 0x25, 0x27, 0x29, 0x2C, 0x2E, 0x31, 0x01, 0x04, 0x06, 0x09, 0x0B, 0x0E, 0x10, - 0x13, 0x15, 0x18, 0x1A, 0x1D, 0x1F, 0x22, 0x24, 0x27, 0x29, 0x2C, 0x2E, 0x31, 0x01, 0x04, 0x06, - 0x09, 0x0C, 0x0E, 0x11, 0x14, 0x16, 0x19, 0x1B, 0x1E, 0x21, 0x23, 0x26, 0x29, 0x2B, 0x2E, 0x31, - 0x01, 0x04, 0x07, 0x0A, 0x0C, 0x0F, 0x12, 0x15, 0x18, 0x1A, 0x1D, 0x20, 0x23, 0x25, 0x28, 0x2B, - 0x2E, 0x31, 0x01, 0x04, 0x07, 0x0A, 0x0D, 0x10, 0x13, 0x16, 0x19, 0x1C, 0x1F, 0x22, 0x25, 0x28, - 0x2B, 0x2E, 0x31, 0x02, 0x05, 0x08, 0x0B, 0x0E, 0x11, 0x14, 0x18, 0x1B, 0x1E, 0x21, 0x24, 0x27, - 0x2A, 0x2D, 0x31, 0x02, 0x05, 0x09, 0x0C, 0x0F, 0x13, 0x16, 0x19, 0x1D, 0x20, 0x23, 0x27, 0x2A, - 0x2D, 0x31, 0x02, 0x06, 0x09, 0x0D, 0x10, 0x14, 0x18, 0x1B, 0x1F, 0x22, 0x26, 0x29, 0x2D, 0x31, - 0x02, 0x06, 0x0A, 0x0E, 0x12, 0x16, 0x19, 0x1D, 0x21, 0x25, 0x29, 0x2D, 0x31, 0x03, 0x07, 0x0B, - 0x0F, 0x13, 0x18, 0x1C, 0x20, 0x24, 0x28, 0x2C, 0x31, 0x03, 0x08, 0x0C, 0x11, 0x15, 0x1A, 0x1E, - 0x23, 0x27, 0x2C, 0x31, 0x04, 0x09, 0x0E, 0x13, 0x18, 0x1D, 0x22, 0x27, 0x2C, 0x31, 0x04, 0x0A, - 0x0F, 0x15, 0x1A, 0x20, 0x25, 0x2B, 0x31, 0x05, 0x0B, 0x11, 0x18, 0x1E, 0x24, 0x2A, 0x31, 0x06, - 0x0D, 0x14, 0x1B, 0x22, 0x29, 0x31, 0x07, 0x0F, 0x18, 0x20, 0x28, 0x31, 0x09, 0x13, 0x1D, 0x27, - 0x31, 0x0B, 0x18, 0x24, 0x31, 0x0F, 0x20, 0x31, 0x18, 0x31, 0x31, 0x00, 0x00, 0x01, 0x02, 0x03, - 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, - 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, - 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, - 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1D, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, - 0x1A, 0x1B, 0x1D, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x0A, 0x0B, 0x0C, 0x0D, - 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x00, 0x01, - 0x02, 0x03, 0x04, 0x05, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0F, 0x10, 0x11, 0x12, 0x13, - 0x14, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x00, 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x08, - 0x09, 0x0A, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x12, 0x13, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1A, 0x1B, - 0x1C, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x07, 0x09, 0x0A, 0x0B, 0x0C, 0x0E, 0x0F, 0x10, 0x11, - 0x13, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1A, 0x1B, 0x1D, 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x08, - 0x09, 0x0A, 0x0C, 0x0D, 0x0E, 0x0F, 0x11, 0x12, 0x13, 0x15, 0x16, 0x17, 0x19, 0x1A, 0x1B, 0x1D, - 0x00, 0x01, 0x03, 0x04, 0x05, 0x07, 0x08, 0x09, 0x0B, 0x0C, 0x0D, 0x0F, 0x10, 0x12, 0x13, 0x14, - 0x16, 0x17, 0x18, 0x1A, 0x1B, 0x1C, 0x00, 0x01, 0x03, 0x04, 0x06, 0x07, 0x09, 0x0A, 0x0B, 0x0D, - 0x0E, 0x10, 0x11, 0x12, 0x14, 0x15, 0x17, 0x18, 0x1A, 0x1B, 0x1C, 0x00, 0x02, 0x03, 0x05, 0x06, - 0x08, 0x09, 0x0B, 0x0C, 0x0E, 0x0F, 0x11, 0x12, 0x14, 0x15, 0x17, 0x18, 0x1A, 0x1B, 0x1D, 0x00, - 0x02, 0x03, 0x05, 0x06, 0x08, 0x0A, 0x0B, 0x0D, 0x0E, 0x10, 0x11, 0x13, 0x15, 0x16, 0x18, 0x19, - 0x1B, 0x1C, 0x00, 0x02, 0x04, 0x05, 0x07, 0x09, 0x0A, 0x0C, 0x0D, 0x0F, 0x11, 0x13, 0x14, 0x16, - 0x18, 0x19, 0x1B, 0x1D, 0x00, 0x02, 0x04, 0x06, 0x07, 0x09, 0x0B, 0x0D, 0x0E, 0x10, 0x12, 0x14, - 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x0F, 0x11, 0x13, - 0x15, 0x17, 0x19, 0x1B, 0x1D, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x14, - 0x16, 0x18, 0x1A, 0x1C, 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0E, 0x10, 0x12, 0x14, 0x16, 0x18, - 0x1A, 0x1D, 0x01, 0x03, 0x05, 0x08, 0x0A, 0x0C, 0x0F, 0x11, 0x13, 0x16, 0x18, 0x1A, 0x1D, 0x01, - 0x04, 0x06, 0x09, 0x0B, 0x0E, 0x10, 0x13, 0x15, 0x18, 0x1A, 0x1D, 0x01, 0x04, 0x07, 0x09, 0x0C, - 0x0F, 0x12, 0x14, 0x17, 0x1A, 0x1D, 0x02, 0x05, 0x08, 0x0B, 0x0E, 0x11, 0x14, 0x17, 0x1A, 0x1D, - 0x02, 0x05, 0x09, 0x0C, 0x0F, 0x13, 0x16, 0x19, 0x1D, 0x02, 0x06, 0x0A, 0x0E, 0x11, 0x15, 0x19, - 0x1D, 0x03, 0x07, 0x0B, 0x10, 0x14, 0x18, 0x1D, 0x04, 0x09, 0x0E, 0x13, 0x18, 0x1D, 0x05, 0x0B, - 0x11, 0x17, 0x1D, 0x06, 0x0E, 0x15, 0x1D, 0x09, 0x13, 0x1D, 0x0E, 0x1D, 0x1D, 0x00, 0xFB, 0x04, - 0xFA, 0x04, 0xF8, 0x04, 0xF5, 0x04, 0xF1, 0x04, 0xEC, 0x04, 0xE6, 0x04, 0xDF, 0x04, 0xD7, 0x04, - 0xCE, 0x04, 0xC4, 0x04, 0xB9, 0x04, 0xAD, 0x04, 0xA0, 0x04, 0x92, 0x04, 0x83, 0x04, 0x73, 0x04, - 0x62, 0x04, 0x50, 0x04, 0x3D, 0x04, 0x29, 0x04, 0x14, 0x04, 0xFE, 0x03, 0xE7, 0x03, 0xCF, 0x03, - 0xB6, 0x03, 0x9C, 0x03, 0x81, 0x03, 0x65, 0x03, 0x48, 0x03, 0x2A, 0x03, 0x0B, 0x03, 0xEB, 0x02, - 0xCA, 0x02, 0xA8, 0x02, 0x85, 0x02, 0x61, 0x02, 0x3C, 0x02, 0x16, 0x02, 0xEF, 0x01, 0xC7, 0x01, - 0x9E, 0x01, 0x74, 0x01, 0x49, 0x01, 0x1D, 0x01, 0xF0, 0x00, 0xC2, 0x00, 0x93, 0x00, 0x63, 0x00, - 0x32, 0x00, 0x00, 0x00, 0xD1, 0x01, 0xD0, 0x01, 0xCE, 0x01, 0xCB, 0x01, 0xC7, 0x01, 0xC2, 0x01, - 0xBC, 0x01, 0xB5, 0x01, 0xAD, 0x01, 0xA4, 0x01, 0x9A, 0x01, 0x8F, 0x01, 0x83, 0x01, 0x76, 0x01, - 0x68, 0x01, 0x59, 0x01, 0x49, 0x01, 0x38, 0x01, 0x26, 0x01, 0x13, 0x01, 0xFF, 0x00, 0xEA, 0x00, - 0xD4, 0x00, 0xBD, 0x00, 0xA5, 0x00, 0x8C, 0x00, 0x72, 0x00, 0x57, 0x00, 0x3B, 0x00, 0x1E, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x01, 0x02, 0x02, - 0x01, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, - 0x01, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, - 0x01, 0x01, 0x02, 0x02, 0x02, 0x01, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, 0x03, 0x03, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x02, 0x03, 0x03, 0x02, 0x02, 0x03, 0x03, 0x03, 0x02, 0x03, 0x03, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x02, 0x04, 0x03, 0x02, 0x02, 0x03, 0x03, 0x03, 0x02, 0x04, 0x03, - 0x02, 0x02, 0x03, 0x03, 0x03, 0x02, 0x04, 0x03, 0x02, 0x02, 0x03, 0x03, 0x04, 0x02, 0x04, 0x04, - 0x02, 0x02, 0x03, 0x03, 0x04, 0x02, 0x04, 0x04, 0x02, 0x02, 0x03, 0x03, 0x04, 0x02, 0x04, 0x04, - 0x02, 0x02, 0x04, 0x04, 0x05, 0x03, 0x05, 0x05, 0x03, 0x03, 0x04, 0x04, 0x04, 0x02, 0x05, 0x04, - 0x03, 0x03, 0x04, 0x04, 0x04, 0x02, 0x05, 0x04, 0x03, 0x03, 0x04, 0x04, 0x04, 0x02, 0x05, 0x04, - 0x03, 0x03, 0x04, 0x04, 0x05, 0x02, 0x05, 0x05, 0x03, 0x03, 0x04, 0x04, 0x05, 0x02, 0x05, 0x05, - 0x03, 0x03, 0x04, 0x04, 0x05, 0x02, 0x05, 0x05, 0x03, 0x03, 0x04, 0x04, 0x05, 0x02, 0x06, 0x05, - 0x03, 0x03, 0x04, 0x04, 0x05, 0x02, 0x06, 0x05, 0x03, 0x03, 0x05, 0x05, 0x05, 0x03, 0x06, 0x05, - 0x03, 0x03, 0x05, 0x05, 0x05, 0x03, 0x06, 0x05, 0x03, 0x03, 0x05, 0x05, 0x06, 0x03, 0x06, 0x06, - 0x03, 0x03, 0x05, 0x05, 0x06, 0x03, 0x06, 0x06, 0x03, 0x03, 0x05, 0x05, 0x06, 0x03, 0x07, 0x06, - 0x04, 0x04, 0x05, 0x05, 0x06, 0x03, 0x07, 0x06, 0x04, 0x04, 0x06, 0x06, 0x07, 0x04, 0x08, 0x07, - 0x04, 0x04, 0x07, 0x07, 0x08, 0x05, 0x09, 0x08, 0x05, 0x05, 0x07, 0x07, 0x08, 0x05, 0x09, 0x08, - 0x05, 0x05, 0x07, 0x07, 0x08, 0x05, 0x09, 0x08, 0x05, 0x05, 0x07, 0x07, 0x08, 0x05, 0x09, 0x08, - 0x05, 0x05, 0x07, 0x07, 0x08, 0x05, 0x09, 0x08, 0x05, 0x05, 0x07, 0x07, 0x08, 0x05, 0x09, 0x08, - 0x05, 0x05, 0x08, 0x08, 0x09, 0x05, 0x0A, 0x09, 0x06, 0x06, 0x08, 0x08, 0x09, 0x05, 0x0A, 0x09, - 0x06, 0x06, 0x08, 0x08, 0x09, 0x05, 0x0A, 0x09, 0x06, 0x06, 0x08, 0x08, 0x09, 0x05, 0x0A, 0x09, - 0x06, 0x06, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, - 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, - 0x03, 0x03, 0x03, 0x03 -}; - -const uint8 IgorEngine::_mouseCursorMask[] = { - 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, - 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, - 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00 -}; - -const uint8 IgorEngine::_mouseCursorData[] = { - 0x00, 0xFC, 0x00, 0x04, 0xFD, 0x00, 0x03, 0xFE, 0x02, 0xFB, 0xFC, 0xFD, 0x03, 0x04, 0x05, 0xFE, - 0x02, 0xFD, 0x00, 0x03, 0xFC, 0x00, 0x04, 0x00, 0xFB, 0xFC, 0xFC, 0xFC, 0xFD, 0xFD, 0xFD, 0xFE, - 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05 -}; - -const uint8 IgorEngine::PAL_48_1[] = { - 0x2D, 0x16, 0x00, 0x3D, 0x26, 0x01, 0x32, 0x32, 0x24, 0x16, 0x1D, 0x16, 0x12, 0x19, 0x12, 0x0B, - 0x12, 0x0B, 0x32, 0x32, 0x24, 0x16, 0x1D, 0x16, 0x12, 0x19, 0x12, 0x0B, 0x12, 0x0B, 0x3D, 0x3D, - 0x3D, 0x3D, 0x26, 0x01, 0x36, 0x1F, 0x01, 0x2D, 0x16, 0x00, 0x0F, 0x08, 0x00, 0x3F, 0x3F, 0x3F -}; - -const uint8 IgorEngine::PAL_96_1[] = { - 0x00, 0x00, 0x00, 0x18, 0x00, 0x19, 0x00, 0x00, 0x1D, 0x00, 0x03, 0x21, 0x00, 0x09, 0x26, 0x00, - 0x11, 0x2B, 0x00, 0x00, 0x32, 0x00, 0x16, 0x00, 0x03, 0x1F, 0x00, 0x00, 0x21, 0x0C, 0x14, 0x23, - 0x00, 0x00, 0x27, 0x19, 0x18, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x26, 0x00, 0x00, 0x30, 0x00, 0x00, - 0x32, 0x0D, 0x00, 0x32, 0x19, 0x00, 0x33, 0x21, 0x00, 0x32, 0x28, 0x00, 0x3F, 0x3A, 0x18, 0x3F, - 0x3F, 0x33, 0x38, 0x38, 0x38, 0x2E, 0x2E, 0x2E, 0x1C, 0x1C, 0x1C, 0x12, 0x12, 0x12, 0x06, 0x06, - 0x06, 0x0E, 0x05, 0x00, 0x1D, 0x0D, 0x02, 0x2A, 0x17, 0x00, 0x2A, 0x1E, 0x16, 0x31, 0x27, 0x23 -}; - -const uint8 IgorEngine::PAL_IGOR_1[] = { - 0x35, 0x1F, 0x17, 0x30, 0x19, 0x10, 0x25, 0x13, 0x0B, 0x1D, 0x0E, 0x05, 0x06, 0x06, 0x06, 0x3E, - 0x3E, 0x3E, 0x27, 0x1A, 0x00, 0x35, 0x27, 0x06, 0x2B, 0x26, 0x23, 0x25, 0x20, 0x1D, 0x1D, 0x1A, - 0x17, 0x06, 0x0B, 0x14, 0x04, 0x08, 0x0E, 0x02, 0x05, 0x09, 0x01, 0x02, 0x04, 0x25, 0x05, 0x05 -}; - -const uint8 IgorEngine::PAL_IGOR_2[] = { - 0x34, 0x1F, 0x17, 0x30, 0x19, 0x11, 0x25, 0x13, 0x0B, 0x1D, 0x0E, 0x05, 0x06, 0x06, 0x06, 0x3D, - 0x3D, 0x3D, 0x27, 0x1A, 0x00, 0x1C, 0x0F, 0x00, 0x2B, 0x26, 0x23, 0x25, 0x20, 0x1D, 0x1D, 0x19, - 0x17, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 -}; - -const uint8 IgorEngine::INVENTORY_IMG_INIT[] = { - 1, 2, 40, 4, 5, 6, 8, 9, 10, 11, 12, 13, 15, 16, 17, 18, 19, 20, 22, 23, 24, 25, 26, 27, 29, 30, - 31, 32, 33, 34, 36, 37, 28, 21, 38, 3 -}; - -const RoomDataOffsets IgorEngine::PART_04_ROOM_DATA_OFFSETS = { - { 0, 0, 0, 0 }, - { 0, 0 }, - { 23, 231, 3247, 127, 203, 84 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_05_ROOM_DATA_OFFSETS = { - { 125, 5, 20, 4 }, - { 253, 262 }, - { 265, 437, 3313, 329, 405, 80 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_06_ROOM_DATA_OFFSETS = { - { 45, 3, 6, 2 }, - { 75, 84 }, - { 87, 259, 3135, 151, 227, 80 }, - { 135, 30, 5158, 100, 60 } -}; - -const RoomDataOffsets IgorEngine::PART_12_ROOM_DATA_OFFSETS = { - { 45, 3, 6, 2 }, - { 75, 84 }, - { 87, 259, 3135, 151, 227, 80 }, - { -85, 15, 2478, 25, 30 } -}; - -const RoomDataOffsets IgorEngine::PART_13_ROOM_DATA_OFFSETS = { - { 20, 2, 2, 1 }, - { 31, 40 }, - { 43, 215, 3091, 107, 183, 80 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_14_ROOM_DATA_OFFSETS = { - { 20, 2, 2, 1 }, - { 32, 43 }, - { 47, 237, 3183, 131, 207, 82 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_15_ROOM_DATA_OFFSETS = { - { 0, 0, 0, 0 }, - { 3, 12 }, - { 15, 187, 3063, 79, 155, 80 }, - { 45, 22, 3756, 66, 60 } -}; - -const RoomDataOffsets IgorEngine::PART_16_ROOM_DATA_OFFSETS = { - { 20, 2, 2, 1 }, - { 29, 34 }, - { 35, 171, 2907, 59, 135, 76 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_17_ROOM_DATA_OFFSETS = { - { 320, 8, 56, 7 }, - { 835, 844 }, - { 847, 1019, 3895, 911, 987, 80 }, - { -174, 5, 257, 1, 30 } -}; - -const RoomDataOffsets IgorEngine::PART_18_ROOM_DATA_OFFSETS = { - { 20, 2, 2, 1 }, - { 34, 49 }, - { 55, 281, 3367, 179, 255, 86 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_19_ROOM_DATA_OFFSETS = { - { 20, 2, 2, 1 }, - { 33, 46 }, - { 51, 259, 3359, 155, 231, 84 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_21_ROOM_DATA_OFFSETS = { - { 0, 0, 0, 0 }, - { 5, 18 }, - { 23, 231, 3247, 127, 203, 84 }, - { -85, 10, 1658, 50, 30 } -}; - -const RoomDataOffsets IgorEngine::PART_22_ROOM_DATA_OFFSETS = { - { 0, 0, 0, 0 }, - { 1, 6 }, - { 7, 143, 2879, 31, 107, 76 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_23_ROOM_DATA_OFFSETS = { - { 0, 0, 0, 0 }, - { 4, 15 }, - { 19, 209, 3155, 103, 179, 82 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_24_ROOM_DATA_OFFSETS = { - { 0, 0, 0, 0 }, - { 5, 18 }, - { 23, 235, 3111, 127, 203, 80 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_25_ROOM_DATA_OFFSETS = { - { 20, 2, 2, 1 }, - { 31, 40 }, - { 43, 215, 3091, 107, 183, 80 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_26_ROOM_DATA_OFFSETS = { - { 20, 2, 2, 1 }, - { 32, 43 }, - { 47, 237, 3183, 131, 207, 82 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_27_ROOM_DATA_OFFSETS = { - { 0, 0, 0, 0 }, - { 6, 21 }, - { 27, 253, 3339, 151, 227, 86 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_28_ROOM_DATA_OFFSETS = { - { 45, 3, 6, 2 }, - { 78, 93 }, - { 99, 325, 3411, 223, 299, 86 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_30_ROOM_DATA_OFFSETS = { - { 45, 3, 6, 2 }, - { 75, 84 }, - { 87, 259, 3135, 151, 227, 80 }, - { -90, 9, 1489, 11, 30 } -}; - -const RoomDataOffsets IgorEngine::PART_31_ROOM_DATA_OFFSETS = { - { 45, 3, 6, 2 }, - { 79, 96 }, - { 103, 351, 3367, 247, 323, 84 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_33_ROOM_DATA_OFFSETS = { - { 180, 6, 30, 5 }, - { 405, 426 }, - { 435, 715, 4011, 619, 695, 92 }, - { -46, 9, 1533, 19, 60 } -}; - -const RoomDataOffsets IgorEngine::PART_36_ROOM_DATA_OFFSETS = { - { 45, 3, 6, 2 }, - { 77, 90 }, - { 95, 303, 3319, 199, 275, 84 }, - { 0, 0, 0, 0, 0 } -}; - -const RoomDataOffsets IgorEngine::PART_37_ROOM_DATA_OFFSETS = { - { 45, 3, 6, 2 }, - { 75, 84 }, - { 87, 259, 3135, 151, 227, 80 }, - { 0, 0, 0, 0, 0 } -}; - -} // namespace Igor diff --git a/sound/voc.h b/sound/voc.h index c696afb0c8..1f8d041405 100644 --- a/sound/voc.h +++ b/sound/voc.h @@ -27,7 +27,6 @@ * Sound decoder used in engines: * - agos * - drascula - * - igor * - kyra * - made * - saga diff --git a/tools/README b/tools/README index 8d71a6c014..6e95d7def2 100644 --- a/tools/README +++ b/tools/README @@ -40,11 +40,6 @@ create_drascula and Italian. This tool is used to create the drascula.dat file. -create_igortbl (cyx) --------------- - This tool generates the "IGOR.TBL" file. - - create_kyradat (LordHoto, athrxx) -------------- Extracts various static data from the original game executables. diff --git a/tools/create_igortbl/create_igortbl.cpp b/tools/create_igortbl/create_igortbl.cpp deleted file mode 100644 index a5d31f929a..0000000000 --- a/tools/create_igortbl/create_igortbl.cpp +++ /dev/null @@ -1,290 +0,0 @@ -/* ScummVM Tools - * Copyright (C) 2007 The ScummVM project - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * $URL$ - * $Id$ - * - */ - -// HACK to allow building with the SDL backend on MinGW -// see bug #1800764 "TOOLS: MinGW tools building broken" -#ifdef main -#undef main -#endif // main - -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <assert.h> -#include "../../engines/igor/resource_ids.h" - -/* - uint32 : 'ITBL' - uint32 : version/tag - uint32 : offset to strings table - uint8 : number of game versions - repeat (number of game versions) { - uint32 : borland overlay size - uint32 : offset to resources table - uint32 : offset to sounds table - } - repeat (number of resources tables) { - uint16 : number of entries - repeat (number of entries) { - uint16 : id - uint32 : offset - uint32 : length - } - } - repeat (number of sounds tables) { - uint16 : number of entries - repeat (number of entries) { - uint32 : offset - } - } - uint16 : number of strings - repeat (number of strings) { - uint8 : id - uint8 : language (0:any, 1:english, 2:spanish) - uint8 : strlen - char[] : string - } -*/ - -#define MAX_TABLES 10 -#define TABLE_SIZE(x) (sizeof(x)/sizeof(x[0])) - -typedef unsigned char uint8; -typedef unsigned short uint16; -typedef unsigned int uint32; - -struct ResourceEntry { - int id; - uint32 offs; - uint32 size; -}; - -static struct ResourceEntry _resourceEntriesEngDemo100[] = { -#include "resource_en_demo100.h" -}; - -static struct ResourceEntry _resourceEntriesEngDemo110[] = { -#include "resource_en_demo110.h" -}; - -static struct ResourceEntry _resourceEntriesSpaCd[] = { -#include "resource_sp_cdrom.h" -}; - -static struct { - struct ResourceEntry *p; - int count; -} _resourceEntriesList[] = { - { _resourceEntriesEngDemo100, TABLE_SIZE(_resourceEntriesEngDemo100) }, - { _resourceEntriesEngDemo110, TABLE_SIZE(_resourceEntriesEngDemo110) }, - { _resourceEntriesSpaCd, TABLE_SIZE(_resourceEntriesSpaCd) }, - { 0, 0 } -}; - -static const uint32 _soundEntriesEngDemo[] = { -#include "fsd_en_demo.h" -}; - -static const uint32 _soundEntriesSpaCd[] = { -#include "fsd_sp_cdrom.h" -}; - -static struct { - const uint32 *p; - int count; -} _soundEntriesList[] = { - { _soundEntriesEngDemo, TABLE_SIZE(_soundEntriesEngDemo) }, - { _soundEntriesSpaCd, TABLE_SIZE(_soundEntriesSpaCd) }, - { 0, 0 } -}; - -enum { - STR_LANG_ANY = 0, - STR_LANG_ENG = 1, - STR_LANG_SPA = 2 -}; - -struct StringEntry { - int id; - uint8 language; - const char *str; -}; - -static struct StringEntry _stringEntries[] = { -#include "strings.h" -}; - -struct GameVersion { - uint32 borlandOverlaySize; - struct ResourceEntry *resourceEntries; - const uint32 *soundEntries; -}; - -static const struct GameVersion _gameVersions[] = { - { 4086790, _resourceEntriesEngDemo100, _soundEntriesEngDemo }, - { 4094103, _resourceEntriesEngDemo110, _soundEntriesEngDemo }, - { 9115648, _resourceEntriesSpaCd, _soundEntriesSpaCd } -}; - -static const uint32 ITBL_TAG = 0x4954424C; -static const uint32 CURRENT_VERSION = 4; -static const uint32 DEFAULT_OFFSET = 0x12345678; - -struct TablePtrOffset { - const void *p; - uint32 offset; -}; - -static int _tablePtrOffsetCount = 0; -struct TablePtrOffset _tablePtrOffset[MAX_TABLES]; - -static void addPtrOffset(FILE *fp, const void *p) { - assert(_tablePtrOffsetCount < MAX_TABLES); - _tablePtrOffset[_tablePtrOffsetCount].p = p; - _tablePtrOffset[_tablePtrOffsetCount].offset = ftell(fp); - ++_tablePtrOffsetCount; -} - -static uint32 getPtrOffset(const void *p) { - int i; - uint32 fileOffset = 0; - - for (i = 0; i < _tablePtrOffsetCount; ++i) { - if (_tablePtrOffset[i].p == p) { - fileOffset = _tablePtrOffset[i].offset; - break; - } - } - assert(fileOffset != 0); - return fileOffset; -} - -static void writeByte(FILE *fp, uint8 b) { - fwrite(&b, 1, 1, fp); -} - -static void writeUint16BE(FILE *fp, uint16 value) { - writeByte(fp, (uint8)(value >> 8)); - writeByte(fp, (uint8)(value & 0xFF)); -} - -static void writeUint32BE(FILE *fp, uint32 value) { - writeUint16BE(fp, (uint16)(value >> 16)); - writeUint16BE(fp, (uint16)(value & 0xFFFF)); -} - -int compareResourceEntry(const void *a, const void *b) { - return ((struct ResourceEntry *)a)->id - ((struct ResourceEntry *)b)->id; -} - -static void writeResourceEntriesTable(FILE *fp, struct ResourceEntry *re, int count) { - int i; - - qsort(re, count, sizeof(struct ResourceEntry), compareResourceEntry); - writeUint16BE(fp, count); - for (i = 0; i < count; ++i, ++re) { - writeUint16BE(fp, re->id); - writeUint32BE(fp, re->offs); - writeUint32BE(fp, re->size); - } -} - -static void writeSoundEntriesTable(FILE *fp, const uint32 *fsd, int count) { - int i; - - writeUint16BE(fp, count); - for (i = 0; i < count; ++i) { - writeUint32BE(fp, fsd[i]); - } -} - -int compareStringEntry(const void *a, const void *b) { - return ((struct StringEntry *)a)->id - ((struct StringEntry *)b)->id; -} - -static void writeStringEntriesTable(FILE *fp, struct StringEntry *se, int count) { - int i, len; - - qsort(se, count, sizeof(struct StringEntry), compareStringEntry); - writeUint16BE(fp, count); - for (i = 0; i < count; ++i, ++se) { - writeUint16BE(fp, se->id); - writeByte(fp, se->language); - len = strlen(se->str); - assert(len < 256); - writeByte(fp, len); - fwrite(se->str, 1, len, fp); - } -} - -static void createTableFile(FILE *fp) { - int i, gameVersionsCount; - - gameVersionsCount = TABLE_SIZE(_gameVersions); - - /* header */ - writeUint32BE(fp, ITBL_TAG); - writeUint32BE(fp, CURRENT_VERSION); - writeUint32BE(fp, DEFAULT_OFFSET); /* strings table offset */ - writeByte(fp, gameVersionsCount); - - /* game versions */ - for (i = 0; i < gameVersionsCount; ++i) { - writeUint32BE(fp, _gameVersions[i].borlandOverlaySize); - writeUint32BE(fp, DEFAULT_OFFSET); /* resource table offset */ - writeUint32BE(fp, DEFAULT_OFFSET); /* sound table offset */ - } - - /* resources tables */ - for (i = 0; _resourceEntriesList[i].p; ++i) { - addPtrOffset(fp, _resourceEntriesList[i].p); - writeResourceEntriesTable(fp, _resourceEntriesList[i].p, _resourceEntriesList[i].count); - } - - /* sounds tables */ - for (i = 0; _soundEntriesList[i].p; ++i) { - addPtrOffset(fp, _soundEntriesList[i].p); - writeSoundEntriesTable(fp, _soundEntriesList[i].p, _soundEntriesList[i].count); - } - - /* strings table */ - addPtrOffset(fp, _stringEntries); - writeStringEntriesTable(fp, _stringEntries, TABLE_SIZE(_stringEntries)); - - /* fix offsets */ - fseek(fp, 8, SEEK_SET); - writeUint32BE(fp, getPtrOffset(_stringEntries)); - for (i = 0; i < gameVersionsCount; ++i) { - fseek(fp, 17 + i * 12, SEEK_SET); - writeUint32BE(fp, getPtrOffset(_gameVersions[i].resourceEntries)); - writeUint32BE(fp, getPtrOffset(_gameVersions[i].soundEntries)); - } -} - -int main(int argc, char *argv[]) { - FILE *fp = fopen("IGOR.TBL", "wb"); - if (fp) { - createTableFile(fp); - fclose(fp); - } - return 0; -} diff --git a/tools/create_igortbl/fsd_en_demo.h b/tools/create_igortbl/fsd_en_demo.h deleted file mode 100644 index 5f05495446..0000000000 --- a/tools/create_igortbl/fsd_en_demo.h +++ /dev/null @@ -1,8 +0,0 @@ -0x000000, 0x000001, 0x000002, 0x0018E4, 0x003301, 0x003302, 0x003303, 0x003304, -0x003305, 0x003306, 0x003307, 0x003308, 0x003309, 0x003EEB, 0x005908, 0x005909, -0x00590A, 0x01542C, 0x016418, 0x016419, 0x01D37F, 0x01E4A1, 0x01F42C, 0x01F95F, -0x026B80, 0x026B81, 0x026B82, 0x026B83, 0x026B84, 0x026B85, 0x026B86, 0x026B87, -0x026B88, 0x02CA59, 0x02DD76, 0x02ED6A, 0x02ED6B, 0x02ED6C, 0x02ED6D, 0x02ED6E, -0x02ED6F, 0x02ED70, 0x02ED71, 0x02ED72, 0x02ED73, 0x047F4F, 0x047F50, 0x04AC64, -0x04EFC5, 0x052755, 0x052756, 0x052988, 0x058119, 0x05811A, 0x06202A, 0x06202B, -0x06202C, 0x06202D, 0x06202E, 0x06202F, 0x062030, 0x062031, 0x070CB2 diff --git a/tools/create_igortbl/fsd_sp_cdrom.h b/tools/create_igortbl/fsd_sp_cdrom.h deleted file mode 100644 index ab4cec62b8..0000000000 --- a/tools/create_igortbl/fsd_sp_cdrom.h +++ /dev/null @@ -1,175 +0,0 @@ -0x00000000, 0x0000389B, 0x00007136, 0x0000A62E, 0x0000D14D, 0x0000ED67, 0x00010EF1, 0x00015FE9, -0x00019BED, 0x0001B9B5, 0x0001EEBF, 0x0002D8AB, 0x0003E6A9, 0x0003F28B, 0x0003FA71, 0x000421D8, -0x00049770, 0x00049770, 0x0004DEAA, 0x0005799A, 0x0005799A, 0x0005C030, 0x0005FB21, 0x00064019, -0x000721AE, 0x00075C75, 0x00086004, 0x000882A3, 0x0008EC00, 0x000947B7, 0x000AA97E, 0x000AC589, -0x000B3710, 0x000BFC96, 0x000C3185, 0x000D3F38, 0x000DEFB2, 0x000F7BE5, 0x000FE9BF, 0x0010279A, -0x00108F55, 0x0010F750, 0x00137731, 0x0015218E, 0x0017109E, 0x00195C3C, 0x00198865, 0x001B2083, -0x001B5622, 0x001BAE8D, 0x001BAE8D, 0x001BB2DA, 0x001BB2DA, 0x001BB2DA, 0x001C51F6, 0x001E3AC6, -0x001ED144, 0x0020494C, 0x002151AC, 0x0021DC41, 0x00223F69, 0x0022DFF7, 0x0023CC8A, 0x0023D0D7, -0x0024CC0F, 0x0024EF89, 0x00250225, 0x0025236A, 0x002562EB, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, -0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x002562EB, 0x00258EEA, 0x0025CC76, -0x0025F1E8, 0x00263739, 0x00267E3B, 0x0026D886, 0x00271B45, 0x00275A31, 0x0027AE2A, 0x00281B73, -0x00286C0F, 0x0028CC11, 0x00294F29, 0x0029AB14, 0x002A13B7, 0x002A7F7F, 0x002ADDCA, 0x002B2B99, -0x002B80D1, 0x002BFDDE, 0x002C5ACA, 0x002CA9D6, 0x002CF42C, 0x002D2C03, 0x002D68C3, 0x002DBD34, -0x002DE990, 0x002E256B, 0x002ECCAF, 0x002F2E45, 0x002F84C1, 0x00302DC1, 0x0030AB58, 0x00315870, -0x0031EE0C, 0x00337507, 0x0033F4EF, 0x0034D167, 0x00357F2D, 0x00361D73, 0x0036A623, 0x003738EB, -0x0037AF74, 0x003847D3, 0x00397260, 0x0039B53F, 0x003A860D, 0x003B12E2, 0x003B8051, 0x003C0167, -0x003CF502, 0x003D3CFC, 0x003DD257, 0x003E13A5, 0x003E795F, 0x003F2953, 0x003FD007, 0x004098A6, -0x00415A31, 0x00420B57, 0x0043BA62, 0x00441D94, 0x0044E70D, 0x0045180F, 0x0046B5DE, 0x00476CAB, -0x00487702, 0x00492A30, 0x004A385F, 0x004AC5CE, 0x004BE57B, 0x004C99AF, 0x004D68BD, 0x004E0724, -0x005007EA, 0x00519053, 0x0052CFAF, 0x0053E712, 0x00556525, 0x00563841, 0x00571D85, 0x0057CCA8, -0x0058A3F2, 0x00590D15, 0x0059725A, 0x0059D8F5, 0x005A77CE, 0x005B09FE, 0x005B997F, 0x005C4845, -0x005CC6B5, 0x005CF32B, 0x005D683C, 0x005DCD10, 0x005EAC1D, 0x005F1FDA, 0x005F5C7A, 0x005FC681, -0x0060AF8F, 0x00620A08, 0x00626B46, 0x006347DD, 0x0064699E, 0x0064CD27, 0x00657491, 0x00667D74, -0x0066E840, 0x00674296, 0x0067C0A1, 0x00683E1C, 0x0068AF93, 0x00694B3B, 0x006A1038, 0x006AAE76, -0x006B4A7B, 0x006BFF65, 0x006CB30E, 0x006D5D2F, 0x006E0E2C, 0x006EA6C4, 0x006F491F, 0x006FB4BC, -0x006FF055, 0x0070D348, 0x00715808, 0x0071BBFA, 0x007200D6, 0x00752FD2, 0x0075AC0A, 0x0075E845, -0x0076BC42, 0x00776E7A, 0x00781DCE, 0x0078AD3B, 0x0079EF4B, 0x007AD5EC, 0x007B14EA, 0x007B8F1F, -0x007CB7D3, 0x007D5C61, 0x007E39EA, 0x007E8D0A, 0x007EC07D, 0x00803525, 0x0082BE8A, 0x0083072A, -0x00849330, 0x00854E38, 0x0085CC2C, 0x0086176D, 0x008693CF, 0x0086E743, 0x00879CE9, 0x0088527C, -0x00892786, 0x0089ED3B, 0x008A6238, 0x008B9093, 0x008C172A, 0x008D14AC, 0x008D8F27, 0x008E4D2F, -0x008EA409, 0x008FA528, 0x0090365B, 0x00906E9A, 0x00910D3F, 0x009186F9, 0x00922546, 0x0092D6B0, -0x009378CF, 0x009413D2, 0x0094913D, 0x0094E41E, 0x0095555C, 0x0095C3FC, 0x0096398E, 0x0096AC28, -0x00972761, 0x0097EA93, 0x009881AC, 0x009953CE, 0x009A438D, 0x009AD86F, 0x009B2E9C, 0x009B88BA, -0x009BC845, 0x009CC44A, 0x009D5150, 0x009DBF5C, 0x009E515B, 0x009EA1B4, 0x009F2C02, 0x009F9B60, -0x00A0495C, 0x00A0EB51, 0x00A19E57, 0x00A2876C, 0x00A39882, 0x00A41678, 0x00A4641A, 0x00A500A9, -0x00A58786, 0x00A5F2D0, 0x00A78A9E, 0x00A87B53, 0x00A95618, 0x00AA353F, 0x00AB993F, 0x00ABC3A5, -0x00AC62A5, 0x00ACF4E2, 0x00ADB3B2, 0x00AEA445, 0x00B081E1, 0x00B11E8D, 0x00B38EDA, 0x00B486A8, -0x00B5C455, 0x00BA8DC1, 0x00BCC7EF, 0x00BE8202, 0x00BEE81E, 0x00BFCEF8, 0x00C0014F, 0x00C1963F, -0x00C20C86, 0x00C2604D, 0x00C32159, 0x00C3E694, 0x00C49BE5, 0x00C5E5B7, 0x00C68631, 0x00C74AF9, -0x00C7DA16, 0x00C868E5, 0x00C934FC, 0x00C9976F, 0x00CA3E80, 0x00CAA292, 0x00CAEB0D, 0x00CB4B8B, -0x00CC2F5B, 0x00CCADB0, 0x00CD3693, 0x00CDD1EE, 0x00CE2359, 0x00CED11F, 0x00CF3DCD, 0x00CFB443, -0x00D04753, 0x00D12989, 0x00D1F5F4, 0x00D2C157, 0x00D33A71, 0x00D42E5A, 0x00D46B32, 0x00D4D4F8, -0x00D56C11, 0x00D6101F, 0x00D68CBA, 0x00D73BB4, 0x00D78291, 0x00D7F628, 0x00D883D9, 0x00D8C30F, -0x00D94181, 0x00D9B768, 0x00DA2F85, 0x00DAB2AA, 0x00DB260F, 0x00DB6299, 0x00DC3976, 0x00DD45BB, -0x00DE8FD5, 0x00DFCDEF, 0x00E040F0, 0x00E0D080, 0x00E14243, 0x00E1BC26, 0x00E271D6, 0x00E33059, -0x00E3B378, 0x00E420CC, 0x00E48D52, 0x00E5A1C7, 0x00E69C6A, 0x00E6F237, 0x00E77128, 0x00E7AF6E, -0x00E825D3, 0x00E8A059, 0x00E8FCB3, 0x00E99589, 0x00EB31DB, 0x00EB9202, 0x00EC3B10, 0x00ECADE9, -0x00ED90B0, 0x00EE7657, 0x00EF092F, 0x00EF6C99, 0x00EF9E43, 0x00F057B3, 0x00F222B0, 0x00F2EBAB, -0x00F3415C, 0x00F3A96D, 0x00F4709A, 0x00F55514, 0x00F61228, 0x00F6E246, 0x00F77081, 0x00F7D383, -0x00F8881B, 0x00FA2559, 0x00FB4F2B, 0x00FBF49D, 0x00FD1566, 0x00FE30F9, 0x00FEF9A9, 0x00FF98DC, -0x0100BDB7, 0x01011DB0, 0x0101DAB2, 0x0102970E, 0x0102CA15, 0x01030E27, 0x0103B1FA, 0x01046827, -0x01051282, 0x01055FDF, 0x0105D177, 0x010741C8, 0x0107C01F, 0x01091815, 0x01097C92, 0x010A8E18, -0x010AD64E, 0x010C1C94, 0x010DCEAB, 0x010E9E0A, 0x010F68A8, 0x0110213D, 0x0110BA7F, 0x01112247, -0x0111BB13, 0x01129C45, 0x01134C76, 0x01140640, 0x0114CDBC, 0x01153E40, 0x0115E155, 0x01162D73, -0x0116C108, 0x01172275, 0x0117BC59, 0x011839CE, 0x0118CEAA, 0x01197CD9, 0x011A40B3, 0x011B456E, -0x011C0FAF, 0x011CD84B, 0x011DD309, 0x011E623B, 0x011F00BF, 0x011F6A0A, 0x012029CD, 0x0120C9B7, -0x01219EE9, 0x01221674, 0x012266FD, 0x0124A3A8, 0x0125A235, 0x012606E0, 0x01274253, 0x0128A9BA, -0x012A4BDB, 0x012C4BDD, 0x0130382B, 0x01308697, 0x013211CE, 0x0132CB15, 0x01333993, 0x013419A0, -0x01349D9C, 0x01355C72, 0x01367450, 0x01374FC1, 0x0139CFAA, 0x013A7B93, 0x013DC4F0, 0x013E7BED, -0x013F1605, 0x013FBB12, 0x01403274, 0x0140A7BD, 0x014121CC, 0x0141B0B5, 0x01423B22, 0x0142A176, -0x014334E4, 0x0143C963, 0x01448943, 0x01457F98, 0x01463FD6, 0x01471CE2, 0x0148DBCF, 0x01497123, -0x014A6291, 0x014B0486, 0x014B83FC, 0x014C1BC4, 0x014C560C, 0x014D03C9, 0x014DC603, 0x014EDCB8, -0x014F7052, 0x0151325C, 0x01530305, 0x01548FB3, 0x01553071, 0x0155D421, 0x0156521D, 0x0156DDA1, -0x01579F80, 0x01582C70, 0x0158A3DC, 0x0159232D, 0x0159A2C2, 0x015A6B2C, 0x015B194C, 0x015BE013, -0x015C1B93, 0x015CA329, 0x015D18C4, 0x015DDAE8, 0x015E720A, 0x015EFD3D, 0x015FAB3A, 0x0160371A, -0x016095E1, 0x016147E0, 0x0161F4F1, 0x0162CF2E, 0x016317E1, 0x0163E7D2, 0x01652C0B, 0x0165AC19, -0x01663C7F, 0x0166C0DB, 0x01671F31, 0x01677503, 0x01681221, 0x0168A31E, 0x016923EC, 0x0169A911, -0x0169FCD7, 0x016AA95A, 0x016BB4B8, 0x016C1862, 0x016CF45C, 0x016D859B, 0x016E23A2, 0x016F01DF, -0x016F65C5, 0x016FFBF7, 0x01702D63, 0x0170F542, 0x0171E8A4, 0x017273C7, 0x017333D7, 0x0173AC69, -0x01741DB2, 0x0174723C, 0x01752C05, 0x017613B3, 0x0177194F, 0x0177CC16, 0x017854A7, 0x017905A1, -0x017987E6, 0x017A7B8C, 0x017B6C86, 0x017C2C5E, 0x017D0D6F, 0x017E1CBF, 0x017E5A7A, 0x017E8A6F, -0x017EDDE2, 0x017F4FBF, 0x017FB374, 0x01802970, 0x01806C0E, 0x0180EC03, 0x0181417E, 0x01819E60, -0x0182213B, 0x01828E4D, 0x0182CF0A, 0x01832B53, 0x018365C4, 0x0183C4D1, 0x01842220, 0x01845CCA, -0x0184CFFB, 0x0185AD72, 0x0186449C, 0x018681D4, 0x01872E14, 0x0187FDA3, 0x0188B9E3, 0x0188FA10, -0x01896B51, 0x0189DFCE, 0x018A9965, 0x018B70CF, 0x018C25E7, 0x018CA9CE, 0x018CFF5D, 0x018D5A6A, -0x018D8FEE, 0x018DAD66, 0x018DFEC8, 0x018E45EF, 0x018E6790, 0x018F22DC, 0x01900277, 0x0190D186, -0x0191A385, 0x0192653F, 0x0192B2EE, 0x01934F4D, 0x0193FE64, 0x0194ED24, 0x01955CD4, 0x0195979F, -0x019623B0, 0x01972FE0, 0x0197B7E9, 0x019824C5, 0x01984433, 0x01987C94, 0x019A9057, 0x019B4A20, -0x019D06BB, 0x019DC68B, 0x019E9F06, 0x019F13CA, 0x019F9A47, 0x01A02FC4, 0x01A0B4EB, 0x01A14A5F, -0x01A273D5, 0x01A33BF0, 0x01A4352F, 0x01A55A5D, 0x01A6B328, 0x01A7B512, 0x01A95149, 0x01AA2B8C, -0x01AB21DE, 0x01AB99BC, 0x01AC27A1, 0x01AD0577, 0x01AD8DF3, 0x01AE6E03, 0x01AFE2CE, 0x01B147C4, -0x01B21E4D, 0x01B30AA8, 0x01B563F7, 0x01B8AD9F, 0x01BA1B2C, 0x01BC734F, 0x01BCC36C, 0x01BF8F29, -0x01C04A7C, 0x01C0956F, 0x01C0D5EC, 0x01C18F59, 0x01C23DD5, 0x01C290F4, 0x01C326F3, 0x01C4B707, -0x01C6EAAA, 0x01C82FDF, 0x01C8F5B5, 0x01CA0C3A, 0x01CB67C4, 0x01CC43F5, 0x01CC9F20, 0x01CD119F, -0x01CD7672, 0x01CDF9A2, 0x01CE891A, 0x01CF36E0, 0x01D01C05, 0x01D0554F, 0x01D0EB0C, 0x01D147B0, -0x01D17F16, 0x01D1D74B, 0x01D29987, 0x01D361DE, 0x01D41796, 0x01D4B527, 0x01D56640, 0x01D5F471, -0x01D6D273, 0x01D746CC, 0x01D8146F, 0x01D8783D, 0x01D91939, 0x01D9C78F, 0x01DA8693, 0x01DB37A9, -0x01DB841E, 0x01DBFEE9, 0x01DC659C, 0x01DCDB21, 0x01DD6345, 0x01DDE3DF, 0x01DE3FBA, 0x01DE8C25, -0x01DF3F76, 0x01DFEE1D, 0x01E0368F, 0x01E091F6, 0x01E11C14, 0x01E17F1C, 0x01E2329B, 0x01E2929D, -0x01E3A16C, 0x01E4CDE0, 0x01E61880, 0x01E6C219, 0x01E81112, 0x01E8D86B, 0x01E95E62, 0x01EA0312, -0x01EA8D5B, 0x01EB3E78, 0x01EBE1B6, 0x01EDDBB6, 0x01EE6489, 0x01EF004D, 0x01EF8226, 0x01F06640, -0x01F12647, 0x01F1CCE6, 0x01F2C8B3, 0x01F34FDD, 0x01F3AC85, 0x01F46D6D, 0x01F4EA3B, 0x01F5B4DB, -0x01F6B62B, 0x01F72E1A, 0x01F7AFB1, 0x01F82601, 0x01F87BE8, 0x01F9AF24, 0x01FA1630, 0x01FA8433, -0x01FB0131, 0x01FB66B4, 0x01FBBCD6, 0x01FC369F, 0x01FD535B, 0x01FED07B, 0x01FF7C14, 0x020108F8, -0x020193D3, 0x0201F609, 0x0202C410, 0x02039781, 0x0203F529, 0x02049C13, 0x0204D48F, 0x02055FB9, -0x02068E92, 0x0206EE85, 0x02073D55, 0x020770E3, 0x02081FDC, 0x02089A31, 0x02092945, 0x020A1178, -0x020AAFD2, 0x020B354D, 0x020BE79E, 0x020C3E2D, 0x020CF672, 0x020DF203, 0x020E33C4, 0x020ECA26, -0x020FD673, 0x02103CBA, 0x0210F178, 0x021179EA, 0x02125446, 0x021307CA, 0x0213FF71, 0x02148B68, -0x02153D18, 0x0215CCFB, 0x021694AC, 0x02176970, 0x0217E0FE, 0x021854A4, 0x0218D096, 0x021915F5, -0x02198172, 0x0219B930, 0x021A29D0, 0x021A8BBB, 0x021B22D1, 0x021BDA2F, 0x021CDA50, 0x021D5171, -0x021DF008, 0x021EFBA3, 0x021F9AB7, 0x021FDD32, 0x0220E271, 0x0223001C, 0x02238AC0, 0x0224631B, -0x0224A565, 0x022542A5, 0x02260BD5, 0x0226DDB8, 0x02273044, 0x022780F4, 0x0227FF6A, 0x0229676C, -0x02299ACA, 0x022A1EF6, 0x022B6695, 0x022C6F14, 0x022D2465, 0x022E2503, 0x022E666C, 0x022E9814, -0x022F33E9, 0x022FE3E0, 0x0230267D, 0x02309AA5, 0x023123F6, 0x0231D227, 0x02329C30, 0x023320A3, -0x0233955A, 0x02345590, 0x0234FAA7, 0x0235F540, 0x02361E59, 0x02365A4E, 0x0236AFEB, 0x02377334, -0x0238751A, 0x023960E3, 0x023A431E, 0x023B149B, 0x023BB74F, 0x023C5028, 0x023D809C, 0x023E8FEE, -0x023F20ED, 0x023FED33, 0x0240B61F, 0x0241C490, 0x02427199, 0x02436945, 0x02446F5C, 0x02449917, -0x0244EA60, 0x0245351D, 0x02458A26, 0x02462C58, 0x0246483B, 0x024667CE, 0x0246B66C, 0x02473FDC, -0x02475F2A, 0x0248037E, 0x024905AE, 0x024995CC, 0x024A4478, 0x024AC460, 0x024B69A3, 0x024C7989, -0x024D15B0, 0x024E6987, 0x024F312E, 0x024FF7AB, 0x0250C6BD, 0x02519535, 0x02522492, 0x0252B5B8, -0x02537EB5, 0x0253E015, 0x02542CA2, 0x025521E3, 0x0255CC75, 0x02569ABF, 0x0257AA4A, 0x02583AAD, -0x02595045, 0x025AA5DA, 0x025B9C9B, 0x025C802B, 0x025D5C2C, 0x025DAA3F, 0x025ED273, 0x02603727, -0x02614F13, 0x02635C7B, 0x02652951, 0x026677EC, 0x0267F189, 0x0268CB37, 0x0269BFA4, 0x026ADA78, -0x026C2754, 0x026CAFD8, 0x026DAF9D, 0x026EAE12, 0x026FF698, 0x02708762, 0x02710F9A, 0x0271E22F, -0x02733BBB, 0x0273F98E, 0x0274D94A, 0x0275397A, 0x02765E58, 0x0276E66D, 0x0277BE78, 0x0278897F, -0x0278EA4E, 0x0279DC65, 0x027B17A2, 0x027BD0B9, 0x027CFE22, 0x027E343E, 0x027F04AB, 0x02803B7A, -0x0281129C, 0x0281F59D, 0x028281FF, 0x02839721, 0x02847BE3, 0x0285367B, 0x0285C3B8, 0x0286755A, -0x0286F716, 0x02876BAE, 0x0287D763, 0x02884A52, 0x0288C975, 0x02891022, 0x02898301, 0x0289B9A7, -0x028B27CC, 0x028B8F8A, 0x028DB6D9, 0x02905423, 0x029125D6, 0x02915320, 0x0291777F, 0x0291D75A, -0x02935ABF, 0x0293D317, 0x02945FBA, 0x02950462, 0x0295787D, 0x029607BF, 0x0296C3AE, 0x029728C8, -0x0297B33F, 0x02982CDE, 0x0298B805, 0x029A7345, 0x029AF080, 0x029C2347, 0x029C9652, 0x029CDCBC, -0x029D394B, 0x029DCDF6, 0x029E4203, 0x029F2EB2, 0x02A07209, 0x02A11B6A, 0x02A1A75A, 0x02A21ACF, -0x02A2830C, 0x02A2D7CF, 0x02A32984, 0x02A378F8, 0x02A40A4D, 0x02A4792A, 0x02A5513C, 0x02A5AC34, -0x02A6737E, 0x02A72E9C, 0x02A7AC77, 0x02A7FE07, 0x02A86486, 0x02A8C2E1, 0x02A922E6, 0x02A9905F, -0x02AA5BDC, 0x02AAB91A, 0x02AB7DD9, 0x02ABF2FD, 0x02AC7221, 0x02AEC7D4, 0x02AF833F, 0x02B09CEA, -0x02B16679, 0x02B247B6, 0x02B374E0, 0x02B4761E, 0x02B50BE5, 0x02B6991F, 0x02B6F4D1, 0x02B83B46, -0x02B982BA, 0x02BA6E2F, 0x02BB3FC0, 0x02BBAB63, 0x02BC7E16, 0x02BCF984, 0x02BDE5D8, 0x02BE8C9B, -0x02BEF31A, 0x02BFA865, 0x02BFF484, 0x02C08864, 0x02C16B17, 0x02C1D56D, 0x02C26DA8, 0x02C32129, -0x02C3C7E6, 0x02C43BCB, 0x02C4BAD4, 0x02C509A8, 0x02C5E4E1, 0x02C69201, 0x02C7D26F, 0x02C8A8E2, -0x02C97226, 0x02C9D855, 0x02CA4881, 0x02CB185E, 0x02CBCCB5, 0x02CC12C9, 0x02CC8C05, 0x02CD3600, -0x02CF2B8B, 0x02D05BCD, 0x02D11FEE, 0x02D23CEF, 0x02D3673E, 0x02D55953, 0x02D5F6D3, 0x02D6513B, -0x02D69333, 0x02D731B3, 0x02D7EED3, 0x02D8D0CC, 0x02D93499, 0x02D9F1AB, 0x02DAA7B7, 0x02DB28AB, -0x02DB87E0, 0x02DC91AC, 0x02DD2817, 0x02DE494A, 0x02DFA60F, 0x02E096E1, 0x02E1CAD2, 0x02E2E803, -0x02E381B3, 0x02E42949, 0x02E4C396, 0x02E5A366, 0x02E5FCA7, 0x02E6C16B, 0x02E74B79, 0x02E869C6, -0x02E90719, 0x02EAABAC, 0x02EB034D, 0x02EB8453, 0x02EC1112, 0x02EC72CC, 0x02ED9EBC, 0x02EE181D, -0x02EE78CA, 0x02EF4686, 0x02F04E10, 0x02F11E1B, 0x02F176D6, 0x02F22796, 0x02F2DDC5, 0x02F3951E, -0x02F429E2, 0x02F48FB9, 0x02F536CA, 0x02F5D15E, 0x02F69932, 0x02F764D1, 0x02F8186A, 0x02F8E6EF, -0x02F99E7B, 0x02F9EC4D, 0x02FA57F3, 0x02FB2C78, 0x02FBB66C, 0x02FC5F7C, 0x02FD00BC, 0x02FDABDF, -0x02FE2E89, 0x02FEFFDF, 0x02FF94A9, 0x02FFD5FB, 0x03005F21, 0x0300C1B6, 0x03012E9D, 0x030198CB, -0x0301F4BE, 0x0302594C, 0x0302B864, 0x03031F36, 0x0303803F, 0x0303D40A, 0x0304394E, 0x03049D46, -0x03050804, 0x03055479, 0x0305B53C, 0x03063476, 0x0306977F, 0x0306F2CB, 0x03079DAD, 0x0308328D, -0x0308CC43, 0x03095169, 0x0309D62B, 0x030A4FAC, 0x030AC090, 0x030B6F48, 0x030C2B03, 0x030CD10C, -0x030D6F76, 0x030E0892, 0x030EE5BD, 0x030F84B7, 0x03108C22, 0x0311224D, 0x03117972, 0x0311F52D, -0x03126566, 0x0312D507, 0x03136F50, 0x031427F5, 0x031516D4, 0x0315B519, 0x03167812, 0x03171EF2, -0x0317EDFD, 0x0318B191, 0x031954B4, 0x0319E6BC, 0x031A5986, 0x031B3405, 0x031BDD69, 0x031CCE81, -0x031D524F, 0x031E437C, 0x031EF761, 0x031FB008, 0x0320BD69, 0x0321FC07, 0x03229992, 0x03239570, -0x032440FE, 0x032513A2, 0x0325C205, 0x03263BBA, 0x0326FC95, 0x0327D2B9, 0x03288EC2, 0x03295398, -0x032A015A, 0x032A6383, 0x032B3C73, 0x032BEF25, 0x032C9531, 0x032D570B, 0x032E13C9, 0x032EC9EC, -0x032F56F1, 0x033010BF, 0x0330FABD, 0x03315260, 0x0331C9F3, 0x03329A01, 0x033397DA, 0x03342635, -0x033466AA, 0x033564FA, 0x03362F5F, 0x03367432, 0x03370CC6, 0x0337C9A2, 0x03388450, 0x03398DE0, -0x033AA843, 0x033B429F, 0x033C00BA, 0x033D5895, 0x033EADA3, 0x033F3F44, 0x03402E86, 0x03412F18, -0x0342D61C, 0x03433558, 0x03442648, 0x034443FA, 0x0344B0DE, 0x0344E4CF, 0x0345AF5E, 0x0345EFEE, -0x03465E91, 0x0346EA4D, 0x034797EB, 0x0348DDCD, 0x0349335C, 0x0349C9C1, 0x034A7167, 0x034AA3BC, -0x034ADF3D, 0x034B1C86, 0x034BC9FC, 0x034C4053, 0x034D4C72, 0x034E7513, 0x034F2C86, 0x034FF2AF, -0x0350DC18, 0x0351290B, 0x0351F343, 0x03529835, 0x03538765, 0x0353BEC8, 0x0353EBB3, 0x03547235, -0x03551655, 0x0355956D, 0x03567B40, 0x035710F2, 0x0357A5BF, 0x0358584D, 0x03596C6B, 0x0359F993, -0x035AD493, 0x035BAE2D, 0x035CD255, 0x035DA892, 0x035DE230, 0x035E3296, 0x035ECA66, 0x035F2D99, -0x035FB284, 0x03605391, 0x0360B211, 0x0361129B, 0x0361AD95, 0x03623915, 0x0362E3CE, 0x036397B3, -0x03647C45, 0x0365051B, 0x036540AD, 0x03667677, 0x03674BD2, 0x03677BC1, 0x0367D1F6, 0x03687B22, -0x03691655, 0x036A5A00, 0x036A9F70, 0x036B152B, 0x036B4847, 0x036BE804, 0x036C666F, 0x036CD9CD, -0x036D5D73, 0x036E67FE, 0x036EF80C, 0x036F85C3, 0x037028CC, 0x03719A74, 0x0372CF5D, 0x0373E91E, -0x03745C12, 0x037509F0, 0x03758F54, 0x03769982, 0x03775F3B, 0x037800AC, 0x03796D3F, 0x0379FB7B, -0x037A99DE, 0x037B514D, 0x037C2C5F, 0x037D197F, 0x037D7251, 0x037E1164, 0x037EC658, 0x037F1E9D, -0x037FB90E, 0x03805AF1, 0x0380F25C, 0x0381994C, 0x0381C203, 0x0381FF6E, 0x0382B850, 0x0383BF3E, -0x0384687C, 0x0384CB15, 0x0385AC30, 0x03861A0C, 0x038696B2, 0x03874D73, 0x0387B53A, 0x03895F1C, -0x038A1039, 0x038AF204, 0x038C7F6D, 0x038D48A2, 0x038DE58F, 0x038E76D7, 0x038F6255, 0x03900188, -0x0390A632, 0x03922200, 0x03935472, 0x0393A890, 0x0394801C, 0x03950A6F, 0x03959A22, 0x0395F6F1, -0x03964BBC, 0x0396B5BE, 0x03974B4E, 0x03984580, 0x039929FA, 0x039A679E, 0x039B5769, 0x039BD9D2, -0x039C504A, 0x039CCE46, 0x039DE754, 0x039F51DE, 0x039FD198, 0x03A066FC, 0x03A185F3, 0x03A1EAD3, -0x03A2282C, 0x03A28D9C, 0x03A32AD7, 0x03A3B1BE, 0x03A3FAF0, 0x03A46FA7, 0x03A513CC, 0x03A617CD, -0x03A6DB16, 0x03A81798, 0x03A85846, 0x03A90222, 0x03A9F226, 0x03AA4DF3, 0x03AA8AB9, 0x03ABDE84, -0x03AC9DF3, 0x03AD341F, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 diff --git a/tools/create_igortbl/module.mk b/tools/create_igortbl/module.mk deleted file mode 100644 index bd5a7176f1..0000000000 --- a/tools/create_igortbl/module.mk +++ /dev/null @@ -1,13 +0,0 @@ -# $URL: https://scummvm.svn.sourceforge.net/svnroot/scummvm/tools/trunk/Makefile $ -# $Id: Makefile 30664 2008-01-27 19:47:41Z jvprat $ - -MODULE := tools/create_igortbl - -MODULE_OBJS := \ - create_igortbl.o - -# Set the name of the executable -TOOL_EXECUTABLE := create_igortbl - -# Include common rules -include $(srcdir)/rules.mk diff --git a/tools/create_igortbl/resource_en_demo100.h b/tools/create_igortbl/resource_en_demo100.h deleted file mode 100644 index b94036c9c8..0000000000 --- a/tools/create_igortbl/resource_en_demo100.h +++ /dev/null @@ -1,333 +0,0 @@ -{ FNT_Dialogue, 0xb09, 9306 }, -{ ANM_PhilipVodka, 0x300d, 24175 }, -{ AOF_PhilipVodka, 0x8e7c, 80 }, -{ TXT_PhilipRoom, 0x9580, 1164 }, -{ IMG_PhilipRoom, 0x9a0c, 46080 }, -{ PAL_PhilipRoom, 0x14e0c, 768 }, -{ MSK_PhilipRoom, 0x1510c, 3 }, -{ BOX_PhilipRoom, 0x1510f, 1280 }, -{ DAT_PhysicsClassroom, 0x18d44, 6017 }, -{ FRM_PhysicsClassroom1, 0x1a70d, 3100 }, -{ TXT_PhysicsClassroom, 0x1ba08, 1145 }, -{ IMG_PhysicsClassroom, 0x1be81, 46080 }, -{ PAL_PhysicsClassroom, 0x27281, 624 }, -{ MSK_PhysicsClassroom, 0x274f1, 1557 }, -{ BOX_PhysicsClassroom, 0x27b06, 1280 }, -{ DAT_ChemistryClassroom, 0x2b988, 6345 }, -{ FRM_ChemistryClassroom1, 0x2d4e1, 14 }, -{ FRM_ChemistryClassroom2, 0x2d4ef, 3332 }, -{ TXT_ChemistryClassroom, 0x2e8d6, 1226 }, -{ IMG_ChemistryClassroom, 0x2eda0, 46080 }, -{ PAL_ChemistryClassroom, 0x3a1a0, 624 }, -{ MSK_ChemistryClassroom, 0x3a410, 1980 }, -{ BOX_ChemistryClassroom, 0x3abcc, 1280 }, -{ DAT_CollegeStairsSecondFloor, 0x3f4bf, 6393 }, -{ FRM_CollegeStairsSecondFloor1, 0x410b8, 2756 }, -{ FRM_CollegeStairsSecondFloor2, 0x41b7c, 11136 }, -{ FRM_CollegeStairsSecondFloor3, 0x446fc, 6665 }, -{ TXT_CollegeStairsSecondFloor, 0x467ff, 1559 }, -{ IMG_CollegeStairsSecondFloor, 0x46e16, 46080 }, -{ PAL_CollegeStairsSecondFloor, 0x52216, 624 }, -{ MSK_CollegeStairsSecondFloor, 0x52486, 4128 }, -{ BOX_CollegeStairsSecondFloor, 0x534a6, 1280 }, -{ DAT_CollegeStairsFirstFloor, 0x579a5, 6017 }, -{ DLG_CollegeStairsFirstFloor, 0x5a3e8, 2713 }, -{ FRM_CollegeStairsFirstFloor1, 0x5af95, 48790 }, -{ FRM_CollegeStairsFirstFloor2, 0x66e2b, 140 }, -{ TXT_CollegeStairsFirstFloor, 0x675ad, 1228 }, -{ IMG_CollegeStairsFirstFloor, 0x67a79, 46080 }, -{ PAL_CollegeStairsFirstFloor, 0x72e79, 624 }, -{ MSK_CollegeStairsFirstFloor, 0x730e9, 2934 }, -{ BOX_CollegeStairsFirstFloor, 0x73c5f, 1280 }, -{ DAT_CollegeCorridorMissBarrymore, 0x77fa3, 6137 }, -{ FRM_CollegeCorridorMissBarrymore1, 0x79a88, 3250 }, -{ FRM_CollegeCorridorMissBarrymore2, 0x7a73a, 5280 }, -{ FRM_CollegeCorridorMissBarrymore3, 0x7bbda, 10824 }, -{ TXT_CollegeCorridorMissBarrymore, 0x7ed09, 1412 }, -{ IMG_CollegeCorridorMissBarrymore, 0x7f28d, 46080 }, -{ PAL_CollegeCorridorMissBarrymore, 0x8a68d, 624 }, -{ MSK_CollegeCorridorMissBarrymore, 0x8a8fd, 2484 }, -{ BOX_CollegeCorridorMissBarrymore, 0x8b2b1, 1280 }, -{ DAT_CollegeCorridorAnnouncementBoard, 0x8f34f, 5973 }, -{ FRM_CollegeCorridorAnnouncementBoard1, 0x90d44, 2392 }, -{ FRM_CollegeCorridorAnnouncementBoard2, 0x9169c, 6944 }, -{ TXT_CollegeCorridorAnnouncementBoard, 0x9389f, 1238 }, -{ IMG_CollegeCorridorAnnouncementBoard, 0x93d75, 46080 }, -{ PAL_CollegeCorridorAnnouncementBoard, 0x9f175, 624 }, -{ MSK_CollegeCorridorAnnouncementBoard, 0x9f3e5, 3117 }, -{ BOX_CollegeCorridorAnnouncementBoard, 0xa0012, 1280 }, -{ DAT_CollegeCorridorSharonMichael, 0xa3544, 5993 }, -{ FRM_CollegeCorridorSharonMichael1, 0xa4f4d, 3630 }, -{ FRM_CollegeCorridorSharonMichael2, 0xa5d7b, 7752 }, -{ FRM_CollegeCorridorSharonMichael3, 0xa7bc3, 5676 }, -{ FRM_CollegeCorridorSharonMichael4, 0xa91ef, 6762 }, -{ TXT_CollegeCorridorSharonMichael, 0xab344, 1387 }, -{ IMG_CollegeCorridorSharonMichael, 0xab8af, 46080 }, -{ PAL_CollegeCorridorSharonMichael, 0xb6caf, 624 }, -{ MSK_CollegeCorridorSharonMichael, 0xb6f1f, 3144 }, -{ BOX_CollegeCorridorSharonMichael, 0xb7b67, 1280 }, -{ DAT_CollegeCorridorCaroline, 0xbc49a, 6509 }, -{ FRM_CollegeCorridorCaroline1, 0xbe139, 25080 }, -{ FRM_CollegeCorridorCaroline3, 0xc4331, 7595 }, -{ FRM_CollegeCorridorCaroline2, 0xc60dc, 270 }, -{ TXT_CollegeCorridorCaroline, 0xc68e4, 2037 }, -{ IMG_CollegeCorridorCaroline, 0xc70d9, 46080 }, -{ PAL_CollegeCorridorCaroline, 0xd24d9, 624 }, -{ MSK_CollegeCorridorCaroline, 0xd2749, 2151 }, -{ BOX_CollegeCorridorCaroline, 0xd2fb0, 1280 }, -{ DAT_CollegeCorridorLucas, 0xd6381, 6109 }, -{ FRM_CollegeCorridorLucas1, 0xd7df4, 2592 }, -{ FRM_CollegeCorridorLucas2, 0xd8814, 1225 }, -{ FRM_CollegeCorridorLucas3, 0xd8cdd, 6480 }, -{ FRM_CollegeCorridorLucas4, 0xda62d, 1140 }, -{ TXT_CollegeCorridorLucas, 0xdb18c, 1387 }, -{ IMG_CollegeCorridorLucas, 0xdb6f7, 46080 }, -{ PAL_CollegeCorridorLucas, 0xe6af7, 624 }, -{ MSK_CollegeCorridorLucas, 0xe6d67, 3297 }, -{ BOX_CollegeCorridorLucas, 0xe7a48, 1280 }, -{ DAT_CollegeCorridorMargaret, 0xeb74f, 6273 }, -{ DLG_CollegeCorridorMargaret, 0xee325, 6860 }, -{ FRM_CollegeCorridorMargaret1, 0xeff79, 5346 }, -{ FRM_CollegeCorridorMargaret2, 0xf145b, 44247 }, -{ FRM_CollegeCorridorMargaret3, 0xfc132, 7800 }, -{ FRM_CollegeCorridorMargaret4, 0xfdfaa, 3564 }, -{ TXT_CollegeCorridorMargaret, 0xff494, 1642 }, -{ IMG_CollegeCorridorMargaret, 0xffafe, 46080 }, -{ PAL_CollegeCorridorMargaret, 0x10aefe, 624 }, -{ MSK_CollegeCorridorMargaret, 0x10b16e, 3690 }, -{ BOX_CollegeCorridorMargaret, 0x10bfd8, 1280 }, -{ DAT_CollegeLockers, 0x10f230, 6437 }, -{ FRM_CollegeLockers1, 0x110dcb, 2496 }, -{ FRM_CollegeLockers2, 0x11178b, 4704 }, -{ FRM_CollegeLockers3, 0x1129eb, 1260 }, -{ TXT_CollegeLockers, 0x1135be, 1812 }, -{ IMG_CollegeLockers, 0x113cd2, 46080 }, -{ PAL_CollegeLockers, 0x11f0d2, 624 }, -{ MSK_CollegeLockers, 0x11f342, 2235 }, -{ BOX_CollegeLockers, 0x11fbfd, 1280 }, -{ DAT_MenToilets, 0x123cd7, 6465 }, -{ DAT_WomenToilets, 0x129cd1, 6385 }, -{ FRM_WomenToilets1, 0x12b96a, 854 }, -{ FRM_WomenToilets2, 0x12bcc0, 12 }, -{ FRM_WomenToilets3, 0x12bccc, 2744 }, -{ FRM_WomenToilets4, 0x12c784, 12855 }, -{ FRM_WomenToilets5, 0x12f9bb, 102 }, -{ TXT_WomenToilets, 0x130110, 1637 }, -{ IMG_WomenToilets, 0x130775, 46080 }, -{ PAL_WomenToilets, 0x13bb75, 624 }, -{ MSK_WomenToilets, 0x13bde5, 2022 }, -{ BOX_WomenToilets, 0x13c5cb, 1280 }, -{ FRM_MenToilets1, 0x13cb79, 3038 }, -{ FRM_MenToilets2, 0x13d757, 1624 }, -{ TXT_MenToilets, 0x13e492, 1322 }, -{ IMG_MenToilets, 0x13e9bc, 46080 }, -{ PAL_MenToilets, 0x149dbc, 624 }, -{ MSK_MenToilets, 0x14a02c, 1980 }, -{ BOX_MenToilets, 0x14a7e8, 1280 }, -{ DAT_OutsideCollege, 0x14fe08, 6777 }, -{ DLG_OutsideCollege, 0x152677, 953 }, -{ FRM_OutsideCollege1, 0x152bb8, 2156 }, -{ FRM_OutsideCollege2, 0x153424, 4347 }, -{ FRM_OutsideCollege3, 0x15451f, 693 }, -{ FRM_OutsideCollege4, 0x1547d4, 594 }, -{ FRM_OutsideCollege5, 0x154a26, 10080 }, -{ TXT_OutsideCollege, 0x157875, 1741 }, -{ IMG_OutsideCollege, 0x157f42, 46080 }, -{ PAL_OutsideCollege, 0x163342, 624 }, -{ MSK_OutsideCollege, 0x1635b2, 4974 }, -{ BOX_OutsideCollege, 0x164920, 1280 }, -{ DAT_Laboratory, 0x168d8d, 5645 }, -{ FRM_Laboratory1, 0x16a6a2, 2254 }, -{ FRM_Laboratory2, 0x16af70, 26218 }, -{ FRM_Laboratory3, 0x1715da, 128 }, -{ TXT_Laboratory, 0x171d41, 1527 }, -{ IMG_Laboratory, 0x172338, 46080 }, -{ PAL_Laboratory, 0x17d738, 624 }, -{ MSK_Laboratory, 0x17d9a8, 2130 }, -{ BOX_Laboratory, 0x17e1fa, 1280 }, -{ FRM_MargaretRoom1, 0x181864, 10853 }, -{ FRM_MargaretRoom2, 0x1842c9, 16 }, -{ FRM_MargaretRoom3, 0x1842d9, 44564 }, -{ FRM_MargaretRoom4, 0x18f0ed, 80 }, -{ TXT_MargaretRoom, 0x18f7f9, 1707 }, -{ IMG_MargaretRoom, 0x18fea4, 46080 }, -{ PAL_MargaretRoom, 0x19b2a4, 768 }, -{ MSK_MargaretRoom, 0x19b5a4, 3 }, -{ BOX_MargaretRoom, 0x19b5a7, 1280 }, -{ DAT_Map, 0x19e0b8, 6273 }, -{ TXT_Map, 0x1a0184, 1023 }, -{ IMG_Map, 0x1a0583, 46080 }, -{ PAL_Map, 0x1ab983, 624 }, -{ MSK_Map, 0x1abbf3, 1809 }, -{ BOX_Map, 0x1ac304, 1280 }, -{ DAT_TobiasOffice, 0x1b0072, 5945 }, -{ DLG_TobiasOffice, 0x1b2ab1, 10590 }, -{ ANM_TobiasOffice1, 0x1b5595, 2392 }, -{ AOF_TobiasOffice1, 0x1b5eed, 910 }, -{ ANM_TobiasOffice2, 0x1b627b, 16992 }, -{ AOF_TobiasOffice2, 0x1ba4db, 6678 }, -{ TXT_TobiasOffice, 0x1bc5dc, 2086 }, -{ IMG_TobiasOffice, 0x1bce02, 46080 }, -{ PAL_TobiasOffice, 0x1c8202, 624 }, -{ MSK_TobiasOffice, 0x1c8472, 1455 }, -{ BOX_TobiasOffice, 0x1c8a21, 1280 }, -{ DAT_BellChurch, 0x1cb75d, 5617 }, -{ FRM_BellChurch1, 0x1ccf40, 42240 }, -{ FRM_BellChurch2, 0x1d6f40, 2100 }, -{ TXT_BellChurch, 0x1d7e57, 1158 }, -{ IMG_BellChurch, 0x1d82dd, 46080 }, -{ PAL_BellChurch, 0x1e36dd, 624 }, -{ MSK_BellChurch, 0x1e394d, 861 }, -{ BOX_BellChurch, 0x1e3caa, 1280 }, -{ DAT_ChurchPuzzle, 0x1e8cb7, 6137 }, -{ IMG_ChurchMosaic, 0x1eb513, 46080 }, -{ PAL_ChurchMosaic, 0x1f6913, 720 }, -{ MSK_ChurchMosaic, 0x1f6be3, 2445 }, -{ FRM_ChurchPuzzle1, 0x1f7862, 980 }, -{ FRM_ChurchPuzzle2, 0x1f7c36, 945 }, -{ FRM_ChurchPuzzle3, 0x1f7fe7, 1794 }, -{ FRM_ChurchPuzzle13, 0x1f86e9, 2240 }, -{ FRM_ChurchPuzzle4, 0x1f8fa9, 2106 }, -{ FRM_ChurchPuzzle5, 0x1f97e3, 1260 }, -{ FRM_ChurchPuzzle6, 0x1f9ccf, 1036 }, -{ FRM_ChurchPuzzle7, 0x1fa0db, 1053 }, -{ FRM_ChurchPuzzle8, 0x1fa4f8, 6 }, -{ FRM_ChurchPuzzle9, 0x1fa4fe, 26980 }, -{ FRM_ChurchPuzzle10, 0x200e62, 120 }, -{ FRM_ChurchPuzzle11, 0x200eda, 11607 }, -{ FRM_ChurchPuzzle12, 0x203c31, 20 }, -{ FRM_ChurchPuzzle14, 0x203c45, 2904 }, -{ TXT_ChurchPuzzle, 0x204eb0, 1587 }, -{ IMG_ChurchPuzzle, 0x2054e3, 46080 }, -{ PAL_ChurchPuzzle, 0x2108e3, 624 }, -{ MSK_ChurchPuzzle, 0x210b53, 1992 }, -{ BOX_ChurchPuzzle, 0x21131b, 1280 }, -{ DAT_InsideChurch, 0x2151fd, 5973 }, -{ TXT_InsideChurch, 0x217231, 1070 }, -{ IMG_InsideChurch, 0x21765f, 46080 }, -{ PAL_InsideChurch, 0x222a5f, 624 }, -{ MSK_InsideChurch, 0x222ccf, 2352 }, -{ BOX_InsideChurch, 0x2235ff, 1280 }, -{ DAT_OutsideChurch, 0x228b56, 6017 }, -{ DLG_OutsideChurch, 0x22b768, 5130 }, -{ FRM_OutsideChurch8, 0x22ceb2, 27365 }, -{ FRM_OutsideChurch9, 0x233997, 58 }, -{ FRM_OutsideChurch1, 0x2339d1, 1869 }, -{ FRM_OutsideChurch2, 0x23411e, 20 }, -{ FRM_OutsideChurch3, 0x234132, 2472 }, -{ FRM_OutsideChurch4, 0x234ada, 16 }, -{ FRM_OutsideChurch5, 0x234aea, 5147 }, -{ FRM_OutsideChurch6, 0x235f05, 14 }, -{ FRM_OutsideChurch7, 0x235f13, 5145 }, -{ FRM_OutsideChurch10, 0x23732c, 6805 }, -{ FRM_OutsideChurch11, 0x238dc1, 14 }, -{ FRM_OutsideChurch12, 0x238dcf, 5145 }, -{ TXT_OutsideChurch, 0x23a8bc, 1427 }, -{ IMG_OutsideChurch, 0x23ae4f, 46080 }, -{ PAL_OutsideChurch, 0x24624f, 624 }, -{ MSK_OutsideChurch, 0x2464bf, 3264 }, -{ BOX_OutsideChurch, 0x24717f, 1280 }, -{ DAT_SpringBridge, 0x24bdb6, 6017 }, -{ WLK_Bridge1, 0x24d537, 134 }, -{ WLK_Bridge2, 0x24d5bd, 2546 }, -{ DLG_SpringPhotographer, 0x24f896, 15460 }, -{ DAT_SpringRock, 0x257596, 6195 }, -{ WLK_Bridge3, 0x258dc9, 134 }, -{ WLK_Bridge4, 0x258e4f, 2546 }, -{ FRM_SpringRock1, 0x259bc1, 84 }, -{ FRM_SpringRock2, 0x259c15, 759 }, -{ FRM_SpringRock3, 0x259f0c, 5145 }, -{ FRM_SpringRock4, 0x25b325, 4508 }, -{ FRM_SpringRock5, 0x25c4c1, 13364 }, -{ FRM_SpringRock6, 0x25f8f5, 54 }, -{ FRM_SpringBridge1, 0x25f9b9, 24 }, -{ FRM_SpringBridge2, 0x25f9d1, 4410 }, -{ TXT_SpringBridge, 0x2611ee, 1071 }, -{ IMG_SpringBridge, 0x26161d, 46080 }, -{ PAL_SpringBridge, 0x26ca1d, 720 }, -{ MSK_SpringBridge, 0x26cced, 3936 }, -{ BOX_SpringBridge, 0x26dc4d, 1280 }, -{ DAT_Library, 0x272a7f, 7325 }, -{ DLG_Library, 0x275c55, 3573 }, -{ FRM_Library1, 0x276c08, 2254 }, -{ FRM_Library2, 0x2774d6, 18823 }, -{ FRM_Library3, 0x27be5d, 50 }, -{ FRM_Library4, 0x27be8f, 1440 }, -{ FRM_Library5, 0x27c42f, 14616 }, -{ TXT_Library2, 0x27ffad, 237 }, -{ TXT_Library, 0x280794, 2024 }, -{ IMG_Library, 0x280f7c, 46080 }, -{ PAL_Library, 0x28c37c, 624 }, -{ MSK_Library, 0x28c5ec, 2217 }, -{ BOX_Library, 0x28ce95, 1280 }, -{ ANM_PhilipLauraIntro, 0x28e5ac, 29824 }, -{ AOF_PhilipLauraIntro, 0x295a2c, 74 }, -{ ANM_LauraIntro, 0x295a76, 12793 }, -{ AOF_LauraIntro, 0x298c6f, 48 }, -{ TXT_SpringBridgeIntro, 0x299249, 1846 }, -{ IMG_SpringBridgeIntro, 0x29997f, 46080 }, -{ PAL_SpringBridgeIntro, 0x2a4d7f, 720 }, -{ TXT_SpringRock, 0x2a5756, 1374 }, -{ IMG_SpringRock, 0x2a5cb4, 46080 }, -{ PAL_SpringRock, 0x2b10b4, 720 }, -{ MSK_SpringRock, 0x2b1384, 3117 }, -{ BOX_SpringRock, 0x2b1fb1, 1280 }, -{ PAL_Shareware7, 0x2b2790, 768 }, -{ IMG_Shareware7, 0x2b2a90, 46080 }, -{ PAL_Shareware6, 0x2bdf09, 768 }, -{ IMG_Shareware6, 0x2be209, 46080 }, -{ PAL_Shareware5, 0x2c9682, 768 }, -{ IMG_Shareware5, 0x2c9982, 46080 }, -{ PAL_Shareware4, 0x2d4dfb, 768 }, -{ IMG_Shareware4, 0x2d50fb, 46080 }, -{ PAL_Shareware3, 0x2e0574, 768 }, -{ IMG_Shareware3, 0x2e0874, 46080 }, -{ PAL_Shareware2, 0x2ebced, 768 }, -{ IMG_Shareware2, 0x2ebfed, 46080 }, -{ PAL_Shareware1, 0x2f7466, 768 }, -{ IMG_Shareware1, 0x2f7766, 46080 }, -{ PAL_TitleScreen, 0x302ec8, 768 }, -{ IMG_TitleScreen, 0x3031c8, 64000 }, -{ PAL_PenduloStudios, 0x312c40, 768 }, -{ IMG_PenduloStudios, 0x312f40, 64000 }, -{ PAL_GraphicAdventure, 0x3229b8, 768 }, -{ IMG_GraphicAdventure, 0x322cb8, 64000 }, -{ PAL_Presents, 0x332730, 768 }, -{ IMG_Presents, 0x332a30, 64000 }, -{ PAL_OptikSoftware, 0x3424a8, 768 }, -{ IMG_OptikSoftware, 0x3427a8, 64000 }, -{ IMG_Meanwhile, 0x352279, 46080 }, -{ IMG_OptionsButton, 0x36b111, 2106 }, -{ IMG_OptionsMenu, 0x36b94b, 36800 }, -{ CMF_8, 0x374cfc, 4926 }, -{ CMF_9, 0x37603a, 6249 }, -{ CMF_10, 0x3778a3, 5982 }, -{ CMF_11, 0x379001, 12793 }, -{ CMF_12, 0x37c1fa, 22275 }, -{ CMF_2_1, 0x381b77, 4111 }, -{ CMF_2_2, 0x382b86, 4303 }, -{ CMF_2_3, 0x383c55, 4343 }, -{ CMF_2_4, 0x384d4c, 5943 }, -{ CMF_3, 0x386483, 5898 }, -{ CMF_4, 0x387b8d, 3133 }, -{ CMF_7_1, 0x3887ca, 4671 }, -{ CMF_7_2, 0x389a09, 646 }, -{ CMF_7_3, 0x389c8f, 2014 }, -{ CMF_7_4, 0x38a46d, 1369 }, -{ FRM_IgorDirBack, 0x38abb8, 10500 }, -{ FRM_IgorDirRight, 0x38d4bc, 13500 }, -{ FRM_IgorDirFront, 0x390978, 10500 }, -{ FRM_IgorDirLeft, 0x39327c, 13500 }, -{ FRM_IgorHead, 0x396738, 3696 }, -{ IMG_VerbsPanel, 0x39fd50, 3840 }, -{ TXT_MainTable, 0x3a0c50, 28028 }, -{ IMG_RomanNumbersPaper, 0x3a7e14, 46080 }, -{ PAL_RomanNumbersPaper, 0x3b3214, 624 }, -{ FRM_NumbersPaper1, 0x3b36ae, 51163 }, -{ FRM_NumbersPaper2, 0x3bfe89, 40 }, -{ IMG_NewsPaper, 0x3c017f, 46080 }, -{ PAL_NewsPaper, 0x3cb57f, 624 }, -{ IMG_PhotoHarrisonMargaret, 0x3cbcf9, 46080 }, -{ PAL_PhotoHarrisonMargaret, 0x3d70f9, 624 }, -{ IMG_InventoryPanel, 0x3d7a76, 9600 }, -{ IMG_Objects, 0x3d9ff6, 48000 }, diff --git a/tools/create_igortbl/resource_en_demo110.h b/tools/create_igortbl/resource_en_demo110.h deleted file mode 100644 index 78c1a14592..0000000000 --- a/tools/create_igortbl/resource_en_demo110.h +++ /dev/null @@ -1,333 +0,0 @@ -{ FNT_Dialogue, 0xb09, 9405 }, -{ ANM_PhilipVodka, 0x3070, 24175 }, -{ AOF_PhilipVodka, 0x8edf, 80 }, -{ TXT_PhilipRoom, 0x95e3, 1164 }, -{ IMG_PhilipRoom, 0x9a6f, 46080 }, -{ PAL_PhilipRoom, 0x14e6f, 768 }, -{ MSK_PhilipRoom, 0x1516f, 3 }, -{ BOX_PhilipRoom, 0x15172, 1280 }, -{ DAT_PhysicsClassroom, 0x18db5, 6017 }, -{ FRM_PhysicsClassroom1, 0x1a782, 3100 }, -{ TXT_PhysicsClassroom, 0x1ba7d, 1145 }, -{ IMG_PhysicsClassroom, 0x1bef6, 46080 }, -{ PAL_PhysicsClassroom, 0x272f6, 624 }, -{ MSK_PhysicsClassroom, 0x27566, 1557 }, -{ BOX_PhysicsClassroom, 0x27b7b, 1280 }, -{ DAT_ChemistryClassroom, 0x2ba0b, 6345 }, -{ FRM_ChemistryClassroom1, 0x2d568, 14 }, -{ FRM_ChemistryClassroom2, 0x2d576, 3332 }, -{ TXT_ChemistryClassroom, 0x2e95d, 1226 }, -{ IMG_ChemistryClassroom, 0x2ee27, 46080 }, -{ PAL_ChemistryClassroom, 0x3a227, 624 }, -{ MSK_ChemistryClassroom, 0x3a497, 1980 }, -{ BOX_ChemistryClassroom, 0x3ac53, 1280 }, -{ DAT_CollegeStairsSecondFloor, 0x3f551, 6393 }, -{ FRM_CollegeStairsSecondFloor1, 0x4114e, 2756 }, -{ FRM_CollegeStairsSecondFloor2, 0x41c12, 11136 }, -{ FRM_CollegeStairsSecondFloor3, 0x44792, 6665 }, -{ TXT_CollegeStairsSecondFloor, 0x46895, 1559 }, -{ IMG_CollegeStairsSecondFloor, 0x46eac, 46080 }, -{ PAL_CollegeStairsSecondFloor, 0x522ac, 624 }, -{ MSK_CollegeStairsSecondFloor, 0x5251c, 4128 }, -{ BOX_CollegeStairsSecondFloor, 0x5353c, 1280 }, -{ DAT_CollegeStairsFirstFloor, 0x57a45, 6017 }, -{ DLG_CollegeStairsFirstFloor, 0x5a48c, 2713 }, -{ FRM_CollegeStairsFirstFloor1, 0x5b039, 48790 }, -{ FRM_CollegeStairsFirstFloor2, 0x66ecf, 140 }, -{ TXT_CollegeStairsFirstFloor, 0x67651, 1228 }, -{ IMG_CollegeStairsFirstFloor, 0x67b1d, 46080 }, -{ PAL_CollegeStairsFirstFloor, 0x72f1d, 624 }, -{ MSK_CollegeStairsFirstFloor, 0x7318d, 2934 }, -{ BOX_CollegeStairsFirstFloor, 0x73d03, 1280 }, -{ DAT_CollegeCorridorMissBarrymore, 0x78051, 6137 }, -{ FRM_CollegeCorridorMissBarrymore1, 0x79b3a, 3250 }, -{ FRM_CollegeCorridorMissBarrymore2, 0x7a7ec, 5280 }, -{ FRM_CollegeCorridorMissBarrymore3, 0x7bc8c, 10824 }, -{ TXT_CollegeCorridorMissBarrymore, 0x7edbb, 1412 }, -{ IMG_CollegeCorridorMissBarrymore, 0x7f33f, 46080 }, -{ PAL_CollegeCorridorMissBarrymore, 0x8a73f, 624 }, -{ MSK_CollegeCorridorMissBarrymore, 0x8a9af, 2484 }, -{ BOX_CollegeCorridorMissBarrymore, 0x8b363, 1280 }, -{ DAT_CollegeCorridorAnnouncementBoard, 0x8f40b, 5973 }, -{ FRM_CollegeCorridorAnnouncementBoard1, 0x90e04, 2392 }, -{ FRM_CollegeCorridorAnnouncementBoard2, 0x9175c, 6944 }, -{ TXT_CollegeCorridorAnnouncementBoard, 0x9395f, 1238 }, -{ IMG_CollegeCorridorAnnouncementBoard, 0x93e35, 46080 }, -{ PAL_CollegeCorridorAnnouncementBoard, 0x9f235, 624 }, -{ MSK_CollegeCorridorAnnouncementBoard, 0x9f4a5, 3117 }, -{ BOX_CollegeCorridorAnnouncementBoard, 0xa00d2, 1280 }, -{ DAT_CollegeCorridorSharonMichael, 0xa360e, 5993 }, -{ FRM_CollegeCorridorSharonMichael1, 0xa501b, 3630 }, -{ FRM_CollegeCorridorSharonMichael2, 0xa5e49, 7752 }, -{ FRM_CollegeCorridorSharonMichael3, 0xa7c91, 5676 }, -{ FRM_CollegeCorridorSharonMichael4, 0xa92bd, 6762 }, -{ TXT_CollegeCorridorSharonMichael, 0xab412, 1387 }, -{ IMG_CollegeCorridorSharonMichael, 0xab97d, 46080 }, -{ PAL_CollegeCorridorSharonMichael, 0xb6d7d, 624 }, -{ MSK_CollegeCorridorSharonMichael, 0xb6fed, 3144 }, -{ BOX_CollegeCorridorSharonMichael, 0xb7c35, 1280 }, -{ DAT_CollegeCorridorCaroline, 0xbc575, 6509 }, -{ FRM_CollegeCorridorCaroline1, 0xbe216, 25080 }, -{ FRM_CollegeCorridorCaroline3, 0xc440e, 7595 }, -{ FRM_CollegeCorridorCaroline2, 0xc61b9, 270 }, -{ TXT_CollegeCorridorCaroline, 0xc69c1, 2037 }, -{ IMG_CollegeCorridorCaroline, 0xc71b6, 46080 }, -{ PAL_CollegeCorridorCaroline, 0xd25b6, 624 }, -{ MSK_CollegeCorridorCaroline, 0xd2826, 2151 }, -{ BOX_CollegeCorridorCaroline, 0xd308d, 1280 }, -{ DAT_CollegeCorridorLucas, 0xd6468, 6109 }, -{ FRM_CollegeCorridorLucas1, 0xd7edf, 2592 }, -{ FRM_CollegeCorridorLucas2, 0xd88ff, 1225 }, -{ FRM_CollegeCorridorLucas3, 0xd8dc8, 6480 }, -{ FRM_CollegeCorridorLucas4, 0xda718, 1140 }, -{ TXT_CollegeCorridorLucas, 0xdb277, 1387 }, -{ IMG_CollegeCorridorLucas, 0xdb7e2, 46080 }, -{ PAL_CollegeCorridorLucas, 0xe6be2, 624 }, -{ MSK_CollegeCorridorLucas, 0xe6e52, 3297 }, -{ BOX_CollegeCorridorLucas, 0xe7b33, 1280 }, -{ DAT_CollegeCorridorMargaret, 0xeb848, 6273 }, -{ DLG_CollegeCorridorMargaret, 0xee422, 6860 }, -{ FRM_CollegeCorridorMargaret1, 0xf0076, 5346 }, -{ FRM_CollegeCorridorMargaret2, 0xf1558, 44247 }, -{ FRM_CollegeCorridorMargaret3, 0xfc22f, 7800 }, -{ FRM_CollegeCorridorMargaret4, 0xfe0a7, 3564 }, -{ TXT_CollegeCorridorMargaret, 0xff591, 1642 }, -{ IMG_CollegeCorridorMargaret, 0xffbfb, 46080 }, -{ PAL_CollegeCorridorMargaret, 0x10affb, 624 }, -{ MSK_CollegeCorridorMargaret, 0x10b26b, 3690 }, -{ BOX_CollegeCorridorMargaret, 0x10c0d5, 1280 }, -{ DAT_CollegeLockers, 0x10f33f, 6437 }, -{ FRM_CollegeLockers1, 0x110ede, 2496 }, -{ FRM_CollegeLockers2, 0x11189e, 4704 }, -{ FRM_CollegeLockers3, 0x112afe, 1260 }, -{ TXT_CollegeLockers, 0x1136d1, 1812 }, -{ IMG_CollegeLockers, 0x113de5, 46080 }, -{ PAL_CollegeLockers, 0x11f1e5, 624 }, -{ MSK_CollegeLockers, 0x11f455, 2235 }, -{ BOX_CollegeLockers, 0x11fd10, 1280 }, -{ DAT_MenToilets, 0x123df4, 6465 }, -{ DAT_WomenToilets, 0x129df2, 6385 }, -{ FRM_WomenToilets1, 0x12ba8b, 854 }, -{ FRM_WomenToilets2, 0x12bde1, 12 }, -{ FRM_WomenToilets3, 0x12bded, 2744 }, -{ FRM_WomenToilets4, 0x12c8a5, 12855 }, -{ FRM_WomenToilets5, 0x12fadc, 102 }, -{ TXT_WomenToilets, 0x130231, 1637 }, -{ IMG_WomenToilets, 0x130896, 46080 }, -{ PAL_WomenToilets, 0x13bc96, 624 }, -{ MSK_WomenToilets, 0x13bf06, 2022 }, -{ BOX_WomenToilets, 0x13c6ec, 1280 }, -{ FRM_MenToilets1, 0x13cc9a, 3038 }, -{ FRM_MenToilets2, 0x13d878, 1624 }, -{ TXT_MenToilets, 0x13e5b3, 1322 }, -{ IMG_MenToilets, 0x13eadd, 46080 }, -{ PAL_MenToilets, 0x149edd, 624 }, -{ MSK_MenToilets, 0x14a14d, 1980 }, -{ BOX_MenToilets, 0x14a909, 1280 }, -{ DAT_OutsideCollege, 0x14ff37, 6777 }, -{ DLG_OutsideCollege, 0x1527aa, 953 }, -{ FRM_OutsideCollege1, 0x152ceb, 2156 }, -{ FRM_OutsideCollege2, 0x153557, 4347 }, -{ FRM_OutsideCollege3, 0x154652, 693 }, -{ FRM_OutsideCollege4, 0x154907, 594 }, -{ FRM_OutsideCollege5, 0x154b59, 10080 }, -{ TXT_OutsideCollege, 0x1579a8, 1741 }, -{ IMG_OutsideCollege, 0x158075, 46080 }, -{ PAL_OutsideCollege, 0x163475, 624 }, -{ MSK_OutsideCollege, 0x1636e5, 4974 }, -{ BOX_OutsideCollege, 0x164a53, 1280 }, -{ DAT_Laboratory, 0x168ece, 5645 }, -{ FRM_Laboratory1, 0x16a7e7, 2254 }, -{ FRM_Laboratory2, 0x16b0b5, 26218 }, -{ FRM_Laboratory3, 0x17171f, 128 }, -{ TXT_Laboratory, 0x171e86, 1527 }, -{ IMG_Laboratory, 0x17247d, 46080 }, -{ PAL_Laboratory, 0x17d87d, 624 }, -{ MSK_Laboratory, 0x17daed, 2130 }, -{ BOX_Laboratory, 0x17e33f, 1280 }, -{ FRM_MargaretRoom1, 0x181a0c, 10853 }, -{ FRM_MargaretRoom2, 0x184471, 16 }, -{ FRM_MargaretRoom3, 0x184481, 44564 }, -{ FRM_MargaretRoom4, 0x18f295, 80 }, -{ TXT_MargaretRoom, 0x18f9a1, 1707 }, -{ IMG_MargaretRoom, 0x19004c, 46080 }, -{ PAL_MargaretRoom, 0x19b44c, 768 }, -{ MSK_MargaretRoom, 0x19b74c, 3 }, -{ BOX_MargaretRoom, 0x19b74f, 1280 }, -{ DAT_Map, 0x19e26b, 6273 }, -{ TXT_Map, 0x1a033b, 1023 }, -{ IMG_Map, 0x1a073a, 46080 }, -{ PAL_Map, 0x1abb3a, 624 }, -{ MSK_Map, 0x1abdaa, 1809 }, -{ BOX_Map, 0x1ac4bb, 1280 }, -{ DAT_TobiasOffice, 0x1b0233, 5945 }, -{ DLG_TobiasOffice, 0x1b2c76, 10590 }, -{ ANM_TobiasOffice1, 0x1b575a, 2392 }, -{ AOF_TobiasOffice1, 0x1b60b2, 910 }, -{ ANM_TobiasOffice2, 0x1b6440, 16992 }, -{ AOF_TobiasOffice2, 0x1ba6a0, 6678 }, -{ TXT_TobiasOffice, 0x1bc7a1, 2086 }, -{ IMG_TobiasOffice, 0x1bcfc7, 46080 }, -{ PAL_TobiasOffice, 0x1c83c7, 624 }, -{ MSK_TobiasOffice, 0x1c8637, 1455 }, -{ BOX_TobiasOffice, 0x1c8be6, 1280 }, -{ DAT_BellChurch, 0x1cb92d, 5617 }, -{ FRM_BellChurch1, 0x1cd114, 40960 }, -{ FRM_BellChurch2, 0x1d7114, 2100 }, -{ TXT_BellChurch, 0x1d802b, 1158 }, -{ IMG_BellChurch, 0x1d84b1, 46080 }, -{ PAL_BellChurch, 0x1e38b1, 624 }, -{ MSK_BellChurch, 0x1e3b21, 861 }, -{ BOX_BellChurch, 0x1e3e7e, 1280 }, -{ DAT_ChurchPuzzle, 0x1e8e94, 6137 }, -{ IMG_ChurchMosaic, 0x1eb6f2, 46080 }, -{ PAL_ChurchMosaic, 0x1f6af2, 720 }, -{ MSK_ChurchMosaic, 0x1f6dc2, 2445 }, -{ FRM_ChurchPuzzle1, 0x1f7a41, 980 }, -{ FRM_ChurchPuzzle2, 0x1f7e15, 945 }, -{ FRM_ChurchPuzzle3, 0x1f81c6, 1794 }, -{ FRM_ChurchPuzzle13, 0x1f88c8, 2240 }, -{ FRM_ChurchPuzzle4, 0x1f9188, 2106 }, -{ FRM_ChurchPuzzle5, 0x1f99c2, 1260 }, -{ FRM_ChurchPuzzle6, 0x1f9eae, 1036 }, -{ FRM_ChurchPuzzle7, 0x1fa2ba, 1053 }, -{ FRM_ChurchPuzzle8, 0x1fa6d7, 6 }, -{ FRM_ChurchPuzzle9, 0x1fa6dd, 26980 }, -{ FRM_ChurchPuzzle10, 0x201041, 120 }, -{ FRM_ChurchPuzzle11, 0x2010b9, 11607 }, -{ FRM_ChurchPuzzle12, 0x203e10, 20 }, -{ FRM_ChurchPuzzle14, 0x203e24, 2904 }, -{ TXT_ChurchPuzzle, 0x20508f, 1587 }, -{ IMG_ChurchPuzzle, 0x2056c2, 46080 }, -{ PAL_ChurchPuzzle, 0x210ac2, 624 }, -{ MSK_ChurchPuzzle, 0x210d32, 1992 }, -{ BOX_ChurchPuzzle, 0x2114fa, 1280 }, -{ DAT_InsideChurch, 0x2153e6, 5973 }, -{ TXT_InsideChurch, 0x21741e, 1070 }, -{ IMG_InsideChurch, 0x21784c, 46080 }, -{ PAL_InsideChurch, 0x222c4c, 624 }, -{ MSK_InsideChurch, 0x222ebc, 2352 }, -{ BOX_InsideChurch, 0x2237ec, 1280 }, -{ DAT_OutsideChurch, 0x228d4d, 6017 }, -{ DLG_OutsideChurch, 0x22b963, 5130 }, -{ FRM_OutsideChurch8, 0x22d0ad, 27365 }, -{ FRM_OutsideChurch9, 0x233b92, 58 }, -{ FRM_OutsideChurch1, 0x233bcc, 1869 }, -{ FRM_OutsideChurch2, 0x234319, 20 }, -{ FRM_OutsideChurch3, 0x23432d, 2472 }, -{ FRM_OutsideChurch4, 0x234cd5, 16 }, -{ FRM_OutsideChurch5, 0x234ce5, 5147 }, -{ FRM_OutsideChurch6, 0x236100, 14 }, -{ FRM_OutsideChurch7, 0x23610e, 5145 }, -{ FRM_OutsideChurch10, 0x237527, 6805 }, -{ FRM_OutsideChurch11, 0x238fbc, 14 }, -{ FRM_OutsideChurch12, 0x238fca, 5145 }, -{ TXT_OutsideChurch, 0x23aab7, 1427 }, -{ IMG_OutsideChurch, 0x23b04a, 46080 }, -{ PAL_OutsideChurch, 0x24644a, 624 }, -{ MSK_OutsideChurch, 0x2466ba, 3264 }, -{ BOX_OutsideChurch, 0x24737a, 1280 }, -{ DAT_SpringBridge, 0x24bfba, 6017 }, -{ WLK_Bridge1, 0x24d73b, 134 }, -{ WLK_Bridge2, 0x24d7c1, 2546 }, -{ DLG_SpringPhotographer, 0x24fa9c, 15460 }, -{ DAT_SpringRock, 0x2577aa, 6195 }, -{ WLK_Bridge3, 0x258fdd, 134 }, -{ WLK_Bridge4, 0x259063, 2546 }, -{ FRM_SpringRock1, 0x259dd9, 84 }, -{ FRM_SpringRock2, 0x259e2d, 759 }, -{ FRM_SpringRock3, 0x25a124, 5145 }, -{ FRM_SpringRock4, 0x25b53d, 4508 }, -{ FRM_SpringRock5, 0x25c6d9, 13364 }, -{ FRM_SpringRock6, 0x25fb0d, 54 }, -{ FRM_SpringBridge1, 0x25fbd1, 24 }, -{ FRM_SpringBridge2, 0x25fbe9, 4410 }, -{ TXT_SpringBridge, 0x261406, 1071 }, -{ IMG_SpringBridge, 0x261835, 46080 }, -{ PAL_SpringBridge, 0x26cc35, 720 }, -{ MSK_SpringBridge, 0x26cf05, 3936 }, -{ BOX_SpringBridge, 0x26de65, 1280 }, -{ DAT_Library, 0x272ca5, 7325 }, -{ DLG_Library, 0x275e7f, 3573 }, -{ FRM_Library1, 0x276e32, 2254 }, -{ FRM_Library2, 0x277700, 18823 }, -{ FRM_Library3, 0x27c087, 50 }, -{ FRM_Library4, 0x27c0b9, 1440 }, -{ FRM_Library5, 0x27c659, 14616 }, -{ TXT_Library2, 0x2801d7, 237 }, -{ TXT_Library, 0x2809be, 2024 }, -{ IMG_Library, 0x2811a6, 46080 }, -{ PAL_Library, 0x28c5a6, 624 }, -{ MSK_Library, 0x28c816, 2217 }, -{ BOX_Library, 0x28d0bf, 1280 }, -{ ANM_PhilipLauraIntro, 0x28e7d6, 29824 }, -{ AOF_PhilipLauraIntro, 0x295c56, 74 }, -{ ANM_LauraIntro, 0x295ca0, 12793 }, -{ AOF_LauraIntro, 0x298e99, 48 }, -{ TXT_SpringBridgeIntro, 0x299473, 1846 }, -{ IMG_SpringBridgeIntro, 0x299ba9, 46080 }, -{ PAL_SpringBridgeIntro, 0x2a4fa9, 720 }, -{ TXT_SpringRock, 0x2a5980, 1374 }, -{ IMG_SpringRock, 0x2a5ede, 46080 }, -{ PAL_SpringRock, 0x2b12de, 720 }, -{ MSK_SpringRock, 0x2b15ae, 3117 }, -{ BOX_SpringRock, 0x2b21db, 1280 }, -{ PAL_Shareware7, 0x2b2cb1, 768 }, -{ IMG_Shareware7, 0x2b2fb1, 46080 }, -{ PAL_Shareware6, 0x2be7f6, 768 }, -{ IMG_Shareware6, 0x2beaf6, 46080 }, -{ PAL_Shareware5, 0x2ca27c, 768 }, -{ IMG_Shareware5, 0x2ca57c, 46080 }, -{ PAL_Shareware4, 0x2d5e8f, 768 }, -{ IMG_Shareware4, 0x2d618f, 46080 }, -{ PAL_Shareware3, 0x2e1981, 768 }, -{ IMG_Shareware3, 0x2e1c81, 46080 }, -{ PAL_Shareware2, 0x2ed5d7, 768 }, -{ IMG_Shareware2, 0x2ed8d7, 46080 }, -{ PAL_Shareware1, 0x2f9069, 768 }, -{ IMG_Shareware1, 0x2f9369, 46080 }, -{ PAL_TitleScreen, 0x304b59, 768 }, -{ IMG_TitleScreen, 0x304e59, 64000 }, -{ PAL_PenduloStudios, 0x3148d1, 768 }, -{ IMG_PenduloStudios, 0x314bd1, 64000 }, -{ PAL_GraphicAdventure, 0x324649, 768 }, -{ IMG_GraphicAdventure, 0x324949, 64000 }, -{ PAL_Presents, 0x3343c1, 768 }, -{ IMG_Presents, 0x3346c1, 64000 }, -{ PAL_OptikSoftware, 0x344139, 768 }, -{ IMG_OptikSoftware, 0x344439, 64000 }, -{ IMG_Meanwhile, 0x353f0a, 46080 }, -{ IMG_OptionsButton, 0x36cda2, 2106 }, -{ IMG_OptionsMenu, 0x36d5dc, 36800 }, -{ CMF_8, 0x37698d, 4926 }, -{ CMF_9, 0x377ccb, 6249 }, -{ CMF_10, 0x379534, 5982 }, -{ CMF_11, 0x37ac92, 12793 }, -{ CMF_12, 0x37de8b, 22275 }, -{ CMF_2_1, 0x383808, 4111 }, -{ CMF_2_2, 0x384817, 4303 }, -{ CMF_2_3, 0x3858e6, 4343 }, -{ CMF_2_4, 0x3869dd, 5943 }, -{ CMF_3, 0x388114, 5898 }, -{ CMF_4, 0x38981e, 3133 }, -{ CMF_7_1, 0x38a45b, 4671 }, -{ CMF_7_2, 0x38b69a, 646 }, -{ CMF_7_3, 0x38b920, 2014 }, -{ CMF_7_4, 0x38c0fe, 1369 }, -{ FRM_IgorDirBack, 0x38c849, 10500 }, -{ FRM_IgorDirRight, 0x38f14d, 13500 }, -{ FRM_IgorDirFront, 0x392609, 10500 }, -{ FRM_IgorDirLeft, 0x394f0d, 13500 }, -{ FRM_IgorHead, 0x3983c9, 3696 }, -{ IMG_VerbsPanel, 0x3a19e1, 3840 }, -{ TXT_MainTable, 0x3a28e1, 28028 }, -{ IMG_RomanNumbersPaper, 0x3a9aa5, 46080 }, -{ PAL_RomanNumbersPaper, 0x3b4ea5, 624 }, -{ FRM_NumbersPaper1, 0x3b533f, 51163 }, -{ FRM_NumbersPaper2, 0x3c1b1a, 40 }, -{ IMG_NewsPaper, 0x3c1e10, 46080 }, -{ PAL_NewsPaper, 0x3cd210, 624 }, -{ IMG_PhotoHarrisonMargaret, 0x3cd98a, 46080 }, -{ PAL_PhotoHarrisonMargaret, 0x3d8d8a, 624 }, -{ IMG_InventoryPanel, 0x3d9707, 9600 }, -{ IMG_Objects, 0x3dbc87, 48000 }, diff --git a/tools/create_igortbl/resource_sp_cdrom.h b/tools/create_igortbl/resource_sp_cdrom.h deleted file mode 100644 index 1f3f8b2511..0000000000 --- a/tools/create_igortbl/resource_sp_cdrom.h +++ /dev/null @@ -1,276 +0,0 @@ -{ FRM_PhysicsClassroom1, 0x19d541, 3100 }, -{ ANM_PhilipVodka, 0x19e46f, 24175 }, -{ AOF_PhilipVodka, 0x1a42de, 80 }, -{ TXT_PhilipRoom, 0x1a4a75, 1191 }, -{ IMG_PhilipRoom, 0x1a4f1c, 46080 }, -{ PAL_PhilipRoom, 0x1b031c, 768 }, -{ MSK_PhilipRoom, 0x1b061c, 3 }, -{ BOX_PhilipRoom, 0x1b061f, 1280 }, -{ FRM_ChemistryClassroom1, 0x1d1191, 14 }, -{ FRM_ChemistryClassroom2, 0x1d119f, 3332 }, -{ DAT_Physicsclassroom, 0x3a1960, 6017 }, -{ TXT_PhysicsClassroom, 0x3a55a2, 1141 }, -{ IMG_PhysicsClassroom, 0x3a5a17, 46080 }, -{ PAL_PhysicsClassroom, 0x3b0e17, 624 }, -{ MSK_PhysicsClassroom, 0x3b1087, 1557 }, -{ BOX_PhysicsClassroom, 0x3b169c, 1280 }, -{ DAT_ChemistryClassroom, 0x3b4d8b, 6345 }, -{ TXT_ChemistryClassroom, 0x3b8ca2, 1233 }, -{ IMG_ChemistryClassroom, 0x3b9173, 46080 }, -{ PAL_ChemistryClassroom, 0x3c4573, 624 }, -{ MSK_ChemistryClassroom, 0x3c47e3, 1980 }, -{ BOX_ChemistryClassroom, 0x3c4f9f, 1280 }, -{ DAT_ParkRight, 0x3c7add, 6133 }, -{ DAT_ParkLeft, 0x3cdf98, 5969 }, -{ FRM_MenToilets1, 0x3d4159, 3038 }, -{ FRM_MenToilets2, 0x3d4d37, 1624 }, -{ FRM_Park1, 0x3ed1d9, 30376 }, -{ FRM_Park2, 0x3f4881, 62 }, -{ FRM_Park3, 0x3f48bf, 3969 }, -{ FRM_Park4, 0x3f5840, 3150 }, -{ TXT_Park, 0x3f6ba2, 1691 }, -{ IMG_Park, 0x3f723d, 46080 }, -{ PAL_Park, 0x40263d, 624 }, -{ MSK_Park, 0x4028ad, 4728 }, -{ BOX_Park, 0x403b25, 1280 }, -{ DAT_CollegeStairsSecondFloor, 0x407c47, 6393 }, -{ FRM_CollegeStairsSecondFloor1, 0x40b7a3, 2756 }, -{ FRM_CollegeStairsSecondFloor2, 0x40c267, 11136 }, -{ FRM_CollegeStairsSecondFloor3, 0x40ede7, 6665 }, -{ TXT_CollegeStairsSecondFloor, 0x410fb3, 1564 }, -{ IMG_CollegeStairsSecondFloor, 0x4115cf, 46080 }, -{ PAL_CollegeStairsSecondFloor, 0x41c9cf, 624 }, -{ MSK_CollegeStairsSecondFloor, 0x41cc3f, 4128 }, -{ BOX_CollegeStairsSecondFloor, 0x41dc5f, 1280 }, -{ DAT_CollegeStairsFirstFloor, 0x4219b4, 6017 }, -{ FRM_CollegeStairsFirstFloor1, 0x428c70, 48790 }, -{ FRM_CollegeStairsFirstFloor2, 0x434b06, 140 }, -{ TXT_CollegeStairsFirstFloor, 0x4352b3, 1226 }, -{ IMG_CollegeStairsFirstFloor, 0x43577d, 46080 }, -{ PAL_CollegeStairsFirstFloor, 0x440b7d, 624 }, -{ MSK_CollegeStairsFirstFloor, 0x440ded, 2934 }, -{ BOX_CollegeStairsFirstFloor, 0x441963, 1280 }, -{ DAT_CollegeCorridorMissBarrymore, 0x4454c7, 6137 }, -{ FRM_CollegeCorridorMissBarrymore1, 0x448da3, 3250 }, -{ FRM_CollegeCorridorMissBarrymore2, 0x449a55, 5280 }, -{ FRM_CollegeCorridorMissBarrymore3, 0x44aef5, 10824 }, -{ TXT_CollegeCorridorMissBarrymore, 0x44e0a2, 1405 }, -{ IMG_CollegeCorridorMissBarrymore, 0x44e61f, 46080 }, -{ PAL_CollegeCorridorMissBarrymore, 0x459a1f, 624 }, -{ MSK_CollegeCorridorMissBarrymore, 0x459c8f, 2484 }, -{ BOX_CollegeCorridorMissBarrymore, 0x45a643, 1280 }, -{ DAT_CollegeCorridorAnnouncementBoard, 0x45de90, 5973 }, -{ FRM_CollegeCorridorAnnouncementBoard1, 0x461570, 2392 }, -{ FRM_CollegeCorridorAnnouncementBoard2, 0x461ec8, 6944 }, -{ TXT_CollegeCorridorAnnouncementBoard, 0x465ba2, 1216 }, -{ IMG_CollegeCorridorAnnouncementBoard, 0x466062, 46080 }, -{ PAL_CollegeCorridorAnnouncementBoard, 0x471462, 624 }, -{ MSK_CollegeCorridorAnnouncementBoard, 0x4716d2, 3117 }, -{ BOX_CollegeCorridorAnnouncementBoard, 0x4722ff, 1280 }, -{ DAT_CollegeCorridorSharonMichael, 0x4752aa, 5993 }, -{ FRM_CollegeCorridorSharonMichael1, 0x4789d6, 3630 }, -{ FRM_CollegeCorridorSharonMichael2, 0x479804, 7752 }, -{ FRM_CollegeCorridorSharonMichael3, 0x47b64c, 5676 }, -{ FRM_CollegeCorridorSharonMichael4, 0x47cc78, 6762 }, -{ TXT_CollegeCorridorSharonMichael, 0x47eea2, 1331 }, -{ IMG_CollegeCorridorSharonMichael, 0x47f3d5, 46080 }, -{ PAL_CollegeCorridorSharonMichael, 0x48a7d5, 624 }, -{ MSK_CollegeCorridorSharonMichael, 0x48aa45, 3144 }, -{ BOX_CollegeCorridorSharonMichael, 0x48b68d, 1280 }, -{ DAT_CollegeCorridorCaroline, 0x48f747, 6509 }, -{ FRM_CollegeCorridorCaroline1, 0x4934a3, 25080 }, -{ FRM_CollegeCorridorCaroline3, 0x49969b, 7595 }, -{ FRM_CollegeCorridorCaroline2, 0x49b446, 270 }, -{ TXT_CollegeCorridorCaroline, 0x49bcb3, 2026 }, -{ IMG_CollegeCorridorCaroline, 0x49c49d, 46080 }, -{ PAL_CollegeCorridorCaroline, 0x4a789d, 624 }, -{ MSK_CollegeCorridorCaroline, 0x4a7b0d, 2151 }, -{ DAT_CollegeCorridorLucas, 0x4ab255, 6109 }, -{ FRM_SpringBridge1, 0x4b16f4, 24 }, -{ FRM_SpringBridge2, 0x4b170c, 4410 }, -{ TXT_CollegeCorridorLucas, 0x4b2fa2, 1333 }, -{ IMG_CollegeCorridorLucas, 0x4b34d7, 46080 }, -{ PAL_CollegeCorridorLucas, 0x4be8d7, 624 }, -{ MSK_CollegeCorridorLucas, 0x4beb47, 3297 }, -{ BOX_CollegeCorridorLucas, 0x4bf828, 1280 }, -{ DAT_CollegeCorridorMargaret, 0x4c2ff1, 6273 }, -{ FRM_CollegeCorridorMargaret1, 0x4cb3d6, 5346 }, -{ FRM_CollegeCorridorMargaret2, 0x4cc8b8, 44247 }, -{ FRM_CollegeCorridorMargaret3, 0x4d758f, 7800 }, -{ FRM_CollegeCorridorMargaret4, 0x4d9407, 3564 }, -{ TXT_CollegeCorridorMargaret, 0x4da9b3, 1559 }, -{ IMG_CollegeCorridorMargaret, 0x4dafca, 46080 }, -{ PAL_CollegeCorridorMargaret, 0x4e63ca, 624 }, -{ MSK_CollegeCorridorMargaret, 0x4e663a, 3690 }, -{ BOX_CollegeCorridorMargaret, 0x4e74a4, 1280 }, -{ DAT_CollegeLockers, 0x4ea1c7, 6437 }, -{ FRM_CollegeLockers1, 0x4edba3, 2496 }, -{ FRM_CollegeLockers2, 0x4ee563, 4704 }, -{ FRM_CollegeLockers3, 0x4ef7c3, 1260 }, -{ TXT_CollegeLockers, 0x4f17a2, 1561 }, -{ IMG_CollegeLockers, 0x4f1dbb, 46080 }, -{ PAL_CollegeLockers, 0x4fd1bb, 624 }, -{ MSK_CollegeLockers, 0x4fd42b, 2235 }, -{ BOX_CollegeLockers, 0x4fdce6, 1280 }, -{ DAT_MenToilets, 0x5015d7, 6465 }, -{ DAT_WomenToilets, 0x508bfe, 6385 }, -{ FRM_WomenToilets1, 0x50c907, 854 }, -{ FRM_WomenToilets2, 0x50cc5d, 12 }, -{ FRM_WomenToilets3, 0x50cc69, 2744 }, -{ FRM_WomenToilets4, 0x50d721, 12855 }, -{ FRM_WomenToilets5, 0x510958, 102 }, -{ TXT_WomenToilets, 0x5111a2, 1666 }, -{ IMG_WomenToilets, 0x511824, 46080 }, -{ PAL_WomenToilets, 0x51cc24, 624 }, -{ MSK_WomenToilets, 0x51ce94, 2022 }, -{ BOX_WomenToilets, 0x51d67a, 1280 }, -{ TXT_MenToilets, 0x51e3a2, 1346 }, -{ IMG_MenToilets, 0x51e8e4, 46080 }, -{ PAL_MenToilets, 0x529ce4, 624 }, -{ MSK_MenToilets, 0x529f54, 1980 }, -{ BOX_MenToilets, 0x52a710, 1280 }, -{ DAT_OutsideCollege, 0x52f49f, 6777 }, -{ FRM_OutsideCollege1, 0x533609, 2156 }, -{ FRM_OutsideCollege2, 0x533e75, 4347 }, -{ FRM_OutsideCollege3, 0x534f70, 693 }, -{ FRM_OutsideCollege4, 0x535225, 594 }, -{ FRM_OutsideCollege5, 0x535477, 10080 }, -{ TXT_OutsideCollege, 0x5383a2, 1824 }, -{ IMG_OutsideCollege, 0x538ac2, 46080 }, -{ PAL_OutsideCollege, 0x543ec2, 624 }, -{ MSK_OutsideCollege, 0x544132, 4974 }, -{ BOX_OutsideCollege, 0x5454a0, 1280 }, -{ DAT_Laboratory, 0x54915f, 5645 }, -{ FRM_MargaretRoom1, 0x5509d4, 10853 }, -{ FRM_MargaretRoom2, 0x553439, 16 }, -{ FRM_MargaretRoom3, 0x553449, 44564 }, -{ FRM_MargaretRoom4, 0x55e25d, 80 }, -{ TXT_MargaretRoom, 0x55e975, 1709 }, -{ IMG_MargaretRoom, 0x55f022, 46080 }, -{ PAL_MargaretRoom, 0x56a422, 768 }, -{ MSK_MargaretRoom, 0x56a722, 3 }, -{ BOX_MargaretRoom, 0x56a725, 1280 }, -{ IMG_Meanwhile, 0x56aeb7, 46080 }, -{ FRM_Laboratory1, 0x5763a3, 2254 }, -{ FRM_Laboratory2, 0x576c71, 26218 }, -{ FRM_Laboratory3, 0x57d2db, 128 }, -{ TXT_Laboratory, 0x57daa2, 1482 }, -{ IMG_Laboratory, 0x57e06c, 46080 }, -{ PAL_Laboratory, 0x58946c, 624 }, -{ MSK_Laboratory, 0x5896dc, 2130 }, -{ BOX_Laboratory, 0x589f2e, 1280 }, -{ DAT_Map, 0x58c60b, 6273 }, -{ TXT_Map, 0x5902a2, 1023 }, -{ IMG_Map, 0x5906a1, 46080 }, -{ PAL_Map, 0x59baa1, 624 }, -{ MSK_Map, 0x59bd11, 1809 }, -{ BOX_Map, 0x59c422, 1280 }, -{ DAT_TobiasOffice, 0x59fc28, 5945 }, -{ ANM_TobiasOffice1, 0x5a9ad6, 2392 }, -{ AOF_TobiasOffice1, 0x5aa42e, 910 }, -{ ANM_TobiasOffice2, 0x5aa7bc, 16992 }, -{ AOF_TobiasOffice2, 0x5aea1c, 6678 }, -{ TXT_TobiasOffice, 0x5b0ba2, 2084 }, -{ IMG_TobiasOffice, 0x5b13c6, 46080 }, -{ PAL_TobiasOffice, 0x5bc7c6, 624 }, -{ MSK_TobiasOffice, 0x5bca36, 1455 }, -{ BOX_TobiasOffice, 0x5bcfe5, 1280 }, -{ DAT_BellChurch, 0x5bf85c, 5617 }, -{ FRM_BellChurch1, 0x5c2a70, 40960 }, -{ FRM_BellChurch2, 0x5cca70, 2100 }, -{ TXT_BellChurch, 0x5cd9a2, 1154 }, -{ IMG_BellChurch, 0x5cde24, 46080 }, -{ PAL_BellChurch, 0x5d9224, 624 }, -{ MSK_BellChurch, 0x5d9494, 861 }, -{ BOX_BellChurch, 0x5d97f1, 1280 }, -{ DAT_OutsideAdministrationBuilding, 0x67949c, 6345 }, -{ FRM_OutsideAdministrationBuilding1, 0x683f0d, 2058 }, -{ FRM_OutsideAdministrationBuilding2, 0x684717, 2520 }, -{ FRM_OutsideAdministrationBuilding3, 0x6850ef, 420 }, -{ FRM_OutsideAdministrationBuilding4, 0x685293, 296 }, -{ FRM_OutsideAdministrationBuilding5, 0x6853bb, 2520 }, -{ DAT_SpringBridge, 0x6a54a6, 6017 }, -{ WLK_Bridge1, 0x6a83a8, 134 }, -{ WLK_Bridge2, 0x6a842e, 2546 }, -{ DAT_SpringRock, 0x6b60ed, 6195 }, -{ WLK_Bridge3, 0x6b9153, 134 }, -{ WLK_Bridge4, 0x6b91d9, 2546 }, -{ FRM_SpringRock1, 0x6ba53e, 84 }, -{ FRM_SpringRock2, 0x6ba592, 759 }, -{ FRM_SpringRock3, 0x6ba889, 5145 }, -{ FRM_SpringRock4, 0x6bbca2, 4508 }, -{ FRM_SpringRock5, 0x6bce3e, 13364 }, -{ FRM_SpringRock6, 0x6c0272, 54 }, -{ TXT_SpringBridge, 0x6c0aa2, 1080 }, -{ IMG_SpringBridge, 0x6c0eda, 46080 }, -{ PAL_SpringBridge, 0x6cc2da, 624 }, -{ MSK_SpringBridge, 0x6cc5aa, 3936 }, -{ BOX_SpringBridge, 0x6cd50a, 1280 }, -{ DAT_DeanPepperOffice, 0x6f3a2e, 6417 }, -{ DAT_AdministrationSecretaryRoom, 0x6fb56a, 6417 }, -{ TXT_AdministrationSecretaryRoom, 0x713da2, 1624 }, -{ IMG_AdministrationSecretaryRoom, 0x7143fa, 46080 }, -{ PAL_AdministrationSecretaryRoom, 0x71f7fa, 624 }, -{ MSK_AdministrationSecretaryRoom, 0x71fa6a, 2400 }, -{ BOX_AdministrationSecretaryRoom, 0x7203ca, 1280 }, -{ FRM_DeanPepperOffice1, 0x729b38, 2448 }, -{ FRM_DeanPepperOffice2, 0x72a4c8, 2254 }, -{ FRM_DeanPepperOffice3, 0x72ad96, 2744 }, -{ FRM_DeanPepperOffice4, 0x72b84e, 2652 }, -{ FRM_DeanPepperOffice5, 0x72c2aa, 2842 }, -{ FRM_DeanPepperOffice6, 0x72cdc4, 2842 }, -{ FRM_DeanPepperOffice7, 0x72d8de, 4293 }, -{ FRM_DeanPepperOffice8, 0x72e9a3, 3850 }, -{ FRM_DeanPepperOffice9, 0x72f8ad, 4704 }, -{ FRM_DeanPepperOffice10, 0x730b0d, 1800 }, -{ FRM_DeanPepperOffice11, 0x731215, 3480 }, -{ FRM_DeanPepperOffice12, 0x731fad, 20 }, -{ FRM_DeanPepperOffice13, 0x731fc1, 5075 }, -{ FRM_DeanPepperOffice14, 0x733394, 620 }, -{ FRM_DeanPepperOffice15, 0x733600, 18298 }, -{ FRM_DeanPepperOffice16, 0x737d7a, 38 }, -{ TXT_DeanPepperOffice, 0x7385a2, 1708 }, -{ IMG_DeanPepperOffice, 0x738c4e, 46080 }, -{ PAL_DeanPepperOffice, 0x74404e, 624 }, -{ MSK_DeanPepperOffice, 0x7442be, 2745 }, -{ BOX_DeanPepperOffice, 0x744d77, 1280 }, -{ DAT_StudentDormitoryRoom, 0x7a446d, 6673 }, -{ TXT_StudentDormitoryRoom, 0x7b18a2, 1476 }, -{ IMG_StudentDormitoryRoom, 0x7b1e66, 46080 }, -{ PAL_StudentDormitoryRoom, 0x7bd266, 624 }, -{ MSK_StudentDormitoryRoom, 0x7bd566, 6699 }, -{ BOX_StudentDormitoryRoom, 0x7bef91, 1280 }, -{ ANM_PhilipLauraIntro, 0x7cb4d4, 29824 }, -{ AOF_PhilipLauraIntro, 0x7d2954, 74 }, -{ ANM_LauraIntro, 0x7d299e, 12793 }, -{ AOF_LauraIntro, 0x7d5b97, 48 }, -{ TXT_SpringBridgeIntro, 0x7d6264, 1835 }, -{ IMG_SpringBridgeIntro, 0x7d698f, 46080 }, -{ PAL_SpringBridgeIntro, 0x7e1d8f, 720 }, -{ TXT_SpringRock, 0x7e28a2, 1348 }, -{ IMG_SpringRock, 0x7e2de6, 46080 }, -{ PAL_SpringRock, 0x7ee1e6, 720 }, -{ MSK_SpringRock, 0x7ee4b6, 3117 }, -{ BOX_SpringRock, 0x7ef0e3, 1280 }, -{ PAL_PenduloStudios, 0x7ef76e, 768 }, -{ IMG_PenduloStudios, 0x7efa6e, 64000 }, -{ PAL_GraphicAdventure, 0x7ff56e, 768 }, -{ IMG_GraphicAdventure, 0x7ff86e, 64000 }, -{ PAL_Presents, 0x80f36e, 768 }, -{ IMG_Presents, 0x80f66e, 64000 }, -{ PAL_OptikSoftware, 0x81f16e, 768 }, -{ IMG_OptikSoftware, 0x81f46e, 64000 }, -{ FRM_IgorDirBack2, 0x82f0c3, 10500 }, -{ FRM_IgorDirRight2, 0x8319c7, 13500 }, -{ FRM_IgorDirFront2, 0x834e83, 10500 }, -{ FRM_IgorDirLeft2, 0x837787, 13500 }, -{ FRM_IgorHead2, 0x83ac43, 3696 }, -{ FRM_IgorDirBack, 0x83bdc3, 10500 }, -{ FRM_IgorDirRight, 0x83e6c7, 13500 }, -{ FRM_IgorDirFront, 0x841b83, 10500 }, -{ FRM_IgorDirLeft, 0x844487, 13500 }, -{ FRM_IgorHead, 0x847943, 3696 }, -{ IMG_VerbsPanel, 0x848ae0, 3840 }, -{ TXT_MainTable, 0x8499e0, 28028 }, -{ IMG_InventoryPanel, 0x89a298, 9600 }, -{ IMG_Objects, 0x89c818, 48000 }, diff --git a/tools/create_igortbl/strings.h b/tools/create_igortbl/strings.h deleted file mode 100644 index d42ac1eb2b..0000000000 --- a/tools/create_igortbl/strings.h +++ /dev/null @@ -1,78 +0,0 @@ -{ STR_Copyright1995, STR_LANG_ANY, "(C) 1995 Optik Software. All rights reserved." }, -{ STR_Copyright1994, STR_LANG_ANY, "(C) 1994 PENDULO STUDIOS. All rights reserved." }, - -{ STR_BottleOfWhisky, STR_LANG_ENG, " bottle of whisky" }, -{ STR_EmptyBottle, STR_LANG_ENG, " empty bottle" }, -{ STR_BottleOfWater, STR_LANG_ENG, " bottle of water" }, -{ STR_Lizard, STR_LANG_ENG, " lizard" }, -{ STR_FatLizard, STR_LANG_ENG, " fat lizard" }, -{ STR_CarolineFolder, STR_LANG_ENG, " Caroline%s folder" }, -{ STR_PhilipFolder, STR_LANG_ENG, " Philip%s folder" }, -{ STR_Statuette, STR_LANG_ENG, " statuette" }, -{ STR_Reward, STR_LANG_ENG, " reward" }, - -{ STR_BottleOfWhisky, STR_LANG_SPA, " botella de whisky" }, -{ STR_EmptyBottle, STR_LANG_SPA, " botella vacía" }, -{ STR_BottleOfWater, STR_LANG_SPA, " botella con agua" }, -{ STR_Lizard, STR_LANG_SPA, " lagarto" }, -{ STR_FatLizard, STR_LANG_SPA, " lagarto cebado" }, -{ STR_CarolineFolder, STR_LANG_SPA, " carpeta de Caroline" }, -{ STR_PhilipFolder, STR_LANG_SPA, " carpeta de Philip" }, -{ STR_Statuette, STR_LANG_SPA, " estatuilla" }, -{ STR_Reward, STR_LANG_SPA, " recompensa" }, - -{ STR_Talk, STR_LANG_SPA, "Hablar" }, -{ STR_Take, STR_LANG_SPA, "Coger" }, -{ STR_Look, STR_LANG_SPA, "Mirar" }, -{ STR_Use, STR_LANG_SPA, "Usar" }, -{ STR_Open, STR_LANG_SPA, "Abrir" }, -{ STR_Close, STR_LANG_SPA, "Cerrar" }, -{ STR_Give, STR_LANG_SPA, "Dar" }, - -{ STR_PushStone, STR_LANG_ENG, "Push stone" }, -{ STR_Exit, STR_LANG_ENG, "Exit" }, - -{ STR_GamePaused, STR_LANG_ENG, "GAME PAUSED" }, - -{ STR_IgorObjectiveUikokahonia, STR_LANG_ENG, "\"Igor. Objective Uikokahonia\"" }, -{ STR_SharewareVersion, STR_LANG_ENG, "Shareware version" }, -{ STR_SharewarePlaceOrder, STR_LANG_ENG, "To place an order: 1-800-OPTIK-99" }, - -{ STR_SharewareText1, STR_LANG_ENG, "This is SHAREWARE!" }, -{ STR_SharewareText2, STR_LANG_ENG, "You can copy this version!" }, -{ STR_SharewareText3, STR_LANG_ENG, "Pass it around, give it to your friends, family," }, -{ STR_SharewareText4, STR_LANG_ENG, "colleagues and upload it to your favorite BBS." }, -{ STR_SharewareText5, STR_LANG_ENG, "Let everyone enjoy IGOR!" }, - -{ STR_SharewareOrder1, STR_LANG_ENG, "Order the full IGOR game for only $34.99 US." }, -{ STR_SharewareOrder2, STR_LANG_ENG, "$5.00 for shipping and handling (US & CANADA)." }, -{ STR_SharewareOrder3, STR_LANG_ENG, "Please add $3.00 for international shipping." }, -{ STR_SharewareOrder4, STR_LANG_ENG, "To place an order: 1-800-OPTIK-99" }, - -{ STR_SharewareShipping1, STR_LANG_ENG, "90 day limited warranty." }, -{ STR_SharewareShipping2, STR_LANG_ENG, "Please allow 2-4 days for delivery (US only)." }, -{ STR_SharewareShipping3, STR_LANG_ENG, "Elsewhere, up to a week or two..." }, -{ STR_SharewareShipping4, STR_LANG_ENG, "Overnight/second day shipping available an" }, -{ STR_SharewareShipping5, STR_LANG_ENG, "aditional change. Please call for exact pricing." }, -{ STR_SharewareShipping6, STR_LANG_ENG, "Three easy ways to order:" }, -{ STR_SharewareShipping7, STR_LANG_ENG, "- Call 1-800-678-4599 (orders only) and use" }, -{ STR_SharewareShipping8, STR_LANG_ENG, "Your Visa, Mastercard or Discover card." }, -{ STR_SharewareShipping9, STR_LANG_ENG, "- Fax your order (please include credit card" }, -{ STR_SharewareShipping10, STR_LANG_ENG, "information) to (412) 381-1031" }, - -{ STR_SharewareOptikAddress1, STR_LANG_ENG, "- Mail a check or money order to:" }, -{ STR_SharewareOptikAddress2, STR_LANG_ENG, "Optik Software Inc." }, -{ STR_SharewareOptikAddress3, STR_LANG_ENG, "1000 Napor Boulevard" }, -{ STR_SharewareOptikAddress4, STR_LANG_ENG, "Pittsburgh, PA. 15205" }, -{ STR_SharewareOptikAddress5, STR_LANG_ENG, "USA" }, -{ STR_SharewareOptikAddress6, STR_LANG_ENG, "Optik Software Inc." }, -{ STR_SharewareOptikAddress7, STR_LANG_ENG, "Orders only: 1-800-OPTIK-99 (67845-99)" }, -{ STR_SharewareOptikAddress8, STR_LANG_ENG, "Fax: (412) 381-1031" }, -{ STR_SharewareOptikAddress9, STR_LANG_ENG, "E-mail: optiksoft\xFA""aol.com" }, - -{ STR_SharewarePenduloAddress1, STR_LANG_ENG, "A game by" }, -{ STR_SharewarePenduloAddress2, STR_LANG_ENG, "PENDULO STUDIOS" }, -{ STR_SharewarePenduloAddress3, STR_LANG_ENG, "P.O. Box 21091" }, -{ STR_SharewarePenduloAddress4, STR_LANG_ENG, "28009 Madrid" }, -{ STR_SharewarePenduloAddress5, STR_LANG_ENG, "Spain" }, -{ STR_SharewarePenduloAddress6, STR_LANG_ENG, "E-mail: 100641.1737\xFA""compuserve.com" }, |