[Scummvm-git-logs] scummvm master -> 828d4565a41d8d01340d287363a0fa63c963bd71
sev-
noreply at scummvm.org
Sun Nov 15 14:11:32 UTC 2026
This automated email contains information about 330 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
b8d036238b IGOR: Engine skeleton, first screen displayed
9fd522a123 IGOR: Load room metadata, palette animations
6758d62aad IGOR: fade in scene
83575e9ff1 IGOR: Walk algo, draw igor
aad783fb20 IGOR: Show cursor
6bff495532 IGOR: Reading main texts
703f7f3152 IGOR: draw verb panel
08e869ffa2 IGOR: Intro logos
c73da9dcec IGOR: Refactor into multiple files
e985af043b IGOR: Turn font into a Graphics::Font
411a70b957 IGOR: Load GUI palette
97012120df IGOR: Animations
3e8cc7ab38 IGOR: Display text
42266f4b3c IGOR: Fixes text not clearing properly
549ff2b17e IGOR: Skip dialog
be47bec5d2 IGOR: Plays sound and speech (bugged)
8a3da3fd33 IGOR: Part 6
fe98022576 IGOR: Preparing code for actions
c6fdcdfb4f IGOR: Walking
c17fc6c25f IGOR: Scrolling on first scene
fec2aa4301 IGOR: Igor talking
45ecc389c0 IGOR: Implements map (part 4)
b2e7a1750b IGOR: fixes click to skip on talkie mode
b74fa07aba IGOR: Debug layers
2ce1680a35 IGOR: Part 100
ece5beb79f IGOR: Scrolls to 101
bebb50b47a IGOR: Part 110
5c3660716b IGOR: Fix part 110 not being interactive
854cfcd440 IGOR: CD Music
0d9d172250 IGOR: intro LOGO
4c0311702f IGOR: Fix random number generations
4b9d02c512 IGOR: Renamings and docs
d8f1e509fe IGOR: Draw Inventory
977035dd6f IGOR: Part 70
97acff8711 IGOR: Room light & inventory scroll
5e7828fe3b IGOR: Complete actions on part6
d544d9d0a8 IGOR: Fix igor clipping through the edge of the screen in part 100
173f10a4cc IGOR: Proper part names
0613ed6c48 IGOR: Dialogue handling code
4754c4ab49 IGOR: Fix speech being overlapped by SFX
88e553c62b IGOR: Fix walking algorithm
a8c4a7e2b2 IGOR: Fixes pickup animation when picking up hamburger
6fd1a77e18 IGOR: Part 12 from legacy fork
ae1b522d90 IGOR: Import data offsets from previous implementations
f17670b302 IGOR: Adds part 17 from legacy code, new parts 34-35
3ad35a491c IGOR: Fix palette rotation
51e43233f7 IGOR: Dialogue with photographer in part 6
a41503c792 IGOR: Fix crash during part 6 dialog
7ee3e7caab IGOR: Consolidate common functions in part 5 and 6
b819985850 IGOR: Consolidate functions in parts 10 & 11
ff167ccfbc IGOR: Consolidate constants in parts 10 & 11
5a84f4e03a Igor: touches on part 7
13163bc963 IGOR: Retouch parts 10 and 11
3f9e6d72be IGOR: add debug functions for room change and inventory addition
329ba8154a IGOR: Room 8 and 9
bc89699db2 IGOR: Adding part 23
2b81141193 IGOR: Complete part 8
5465f3e853 IGOR: Fix crash when entering college for the second time
66362b26fa IGOR: Basic inventory descriptions as per legacy engine attempt
fbb901d6a0 IGOR: Fix random range in rooms 17 and 23
2559edf243 IGOR: Part 30 as coming from the legacy engine
778456cc8e IGOR: Add debug render for lum values
7db20381ef IGOR: Fix crash when entering college
563669bcb0 IGOR: Part 30, encounter with Laura
cc3faf0cba IGOR: Parts 21 and 28 as coming from the legacy engine
661100f32a IGOR: Fix crash in dialogue with Philip in part 17
0bb1a3def9 IGOR: Implement fast mode
a9db2bbeea IGOR: Speech indices for room 23, 28 and 30
9a89115c3c IGOR: Improvements on speech advancement & click dismissal
19d44c1bd4 IGOR: Allows using object + object
3b9338981f IGOR: Fixes folder swapping animation
747de7e054 IGOR: Fix object state indices
37812ed132 IGOR: Restore two-object interaction walking
89c1005fdb IGOR: Amend unnecessary comments
285d6d3a7a IGOR: Part 0
6ef3e392fc IGOR: Options menu
89da410939 IGOR: Enter part 0 from map
c61dd101ef IGOR: Replace menu texts
59f44ef6a4 IGOR: Fix open/close window animation
c153b331e2 IGOR: Fix crash when walking to certain points
cbe4ea6759 IGOR: Saving and restoring
2a7b495ca2 IGOR: Use action with no second pairing
9e7f8b47b3 IGOR: Rooms 1 and 2
5a1fa8e34c IGOR: Add parts 18 and 19 as coming from the legacy engine
c20c705d98 IGOR: Fix part 1 walkable areas
f3858d76ed IGOR: Add speech indices to parts 18 and 19
f992136198 IGOR: adds clamping of y axis on walk bounds
55137e22eb IGOR: Complete part2 set of actions
902e0fb56c IGOR: Fixes cutscene with pigeons in room 1
5c60edd659 IGOR: Fix inventory slots being orphaned
9e3348ddc6 IGOR: Fix issue where two speech lines could overlap and crash the game
e671c833a3 IGOR: Explosion cutscene
87758b814e IGOR: Final animation of igor stunned after explosion
ddb465d6df IGOR: Part 17 dialogue
eb3f81ff9b IGOR: Import part 24 as it was in the legacy engine
2f8936de5d IGOR: Import parts 25-27 from legacy engine
4ee3400b1c IGOR: Fixes animation bug in Part 17
d5e49e9853 IGOR: Fixes issue with persistent ESCAPE key
77e4deac3c IGOR: Speech index refs for parts 24-27
b9cceed014 IGOR: Fix early appearance of UI in cutscene with Laura
2910a34121 IGOR: Move parts into dedicated folder
b3bee97b6e IGOR: Fix dean drinkin animation glitch
8d66181fd2 IGOR: Implement Part 9 secretary dialogue
c37f33a906 IGOR: Fix dialogue crash with secretary
cb6d6f4efc IGOR: Right click verb selection logic
3300974eca IGOR: Play music only if the same music isnt already playing
8500b0de1d IGOR: Fixes igor positioning when looking at things while already standing next to them
6fb24eaaf9 IGOR: Fixes locker animation in room 27
7914ce6b15 IGOR: Fixes conversation with margaret and using an object with itself
89ddceac59 IGOR: Fix crash in walk path when going upstairs
e72e186844 IGOR: Complete actions in Park scene
e24a4b82cf IGOR: Imports rooms 31 and 33 from legacy engine
5e79a62dc2 IGOR: Fix problem with toilets in which exiting would leave igor in shades
1dd5eb87b5 IGOR: Fix speech in dean peppers office
500509351b IGOR: Fixes walk path in part 11
1f018a964e IGOR: Fixes priest being misplaced when dialogue happens
38cd98d001 IGOR: Fixes inventory combinations that changed the wrong array
c86da79127 IGOR: Fixes camera not becoming a hotspot after getting rid of photographer
5e97e8d27c IGOR: Add console command to execute actions
9242fd1f58 IGOR: Fixes door animations in part 23 and 26
8bbbe307a0 IGOR: Fixes message board description in room 27
0a4594010e IGOR: Adds speech indices for room 31
170c0bf183 IGOR: Fixes non-existing lines in room 25
dd03a3f868 IGOR: import parts 35 and 36 from the legacy engine
fcec6b8aa0 IGOR: account for igors sprites being out of bounds
da7ab8cfc6 IGOR: Fix talking animations in room 33 and room 9
870a371838 IGOR: Import part 15 from legacy engine
2a2bf1925d IGOR: Adds parts 13, 14, 16, and Margaret cutscenes from legacy engine
4fc8c4c1f9 IGOR: Adds speech indices for rooms 13, 14, 16
d811513c8d IGOR: Import part 22 from legacy code
a86926da41 IGOR: Implements looking at papyrus
b894b426e6 IGOR: Fix cutscene with slug
14094684f5 IGOR: Part 67
68a663322a IGOR: Resources for maze
06b399ba6e IGOR: Import part 75 from legacy engine
efa60cb2c2 IGOR: Fixes wrong colors in part 75
3a319d4964 IGOR: Initial maze implementation
5044c168fc IGOR: Fixes palette issue on rooms 6 and 5
2a1790bac6 IGOR: ESC to skip igor walking in room 17
887d13f5c1 IGOR: Fixes Margaret animation on cutscenes
f2fa77b785 IGOR: Adds photo screen
ecf54a740f IGOR: Fix slow animation in part 19
ba031765d1 IGOR: Fix photo cutscene in part16
9fa96f1db2 IGOR: Fix music in existing parts
372d507e7e IGOR: Introduces part 50
a16217fb0d IGOR: Fix animation error when Margaret picks burger
60fd5fa698 IGOR: Fix walkable areas in deans office
4e994e21e6 IGOR: make sure to save messageboard state in administrative office
df704bdb7e IGOR: Save secretary dismissed flag
eda5295ddc IGOR: Simplify dialog functions
2212efb80e IGOR: Refactor draw routines to reuse code
a22719e300 IGOR: Implement part 70 (map of second area)
340d1822bb IGOR: PART 72
c0a7586ec1 IGOR: Fixes stone slab puzzle crashes
0d3940973e IGOR: Look at newspaper full screen scene
23b4b301fc IGOR: Part 68
ab331f1f9a IGOR: Part 81
95252663d9 IGOR: Fixes shading of igor
8660dd46f5 IGOR: Part 71
51b27926b9 IGOR: Refactor inventory removal
f53bb8d945 IGOR: Implements part 69
7e0786c10b IGOR: Rename of functions in part14
c64f02698b IGOR: Fix cuckoo animation in part 15
f085b57468 IGOR: Renames in part12
c9f603eb01 IGOR: Renames on parts 16,17,18,19
b1c22540b6 IGOR: Part 32
a43732591a IGOR: Renames on parts 24 - 27
c15a777914 IGOR: Fixes Caroline talking animation fighting her idle animation
b215bc1f11 IGOR: Implements parts 77 and 78
b5ed8d27ff IGOR: Renames on parts 33, 34, 35
19acaea4fb IGOR: Implements part 73
675f23c1c2 IGOR: Implements part 76
ab6164a5df IGOR: Implements part 79
c096c32c33 IGOR: Implements credits
03a6ebb9c2 IGOR: Fix missing dialogue in part 8
85fe89ae6a IGOR: Fix crash when entering astronomy lab
bdeb56a532 IGOR: Fix exiting astronomy lab
196330850e IGOR: Fixes not being able to pick astronomy book
20c5e2a8ae IGOR: Fixes not being able to pick vase
7799a6e2c3 IGOR: Fix pickup animation speed in library
2d5baf06ea IGOR: Fixes crash in lighthouse animation
5f896103a8 IGOR: Used igor's beach sprite on the plane
59029a5361 IGOR: Fix error when looking at window outsides of administrative building
efd41ac04a IGOR: Fix small igor appearing outside of the church after coming from indoor
3d5f1ec3a8 IGOR: Fixes weird Igor pose after entering park
8f298a8c76 IGOR: Fix johnny never revealing his face again
1eff602ef2 IGOR: Fix papyrus dismissed with a single click
a42c2811c0 IGOR: Fix wrong order of lines in part 2
0bdeb546ea IGOR: add missing line in part 14 when solving church puzzle
1772d58b7d IGOR: Fix missing animation in womens toilet cutscene
ef52dd24c0 IGOR: Use correct sound when closing locker
fe88e27a48 IGOR: Fix animation of putting flask in locker
ed0ff172b8 IGOR: Fix gating meanwhile inserts on scrollable areas
63fe994063 IGOR: Fix music in margaret inserts
c0181c8bb0 IGOR: Fix splash logos with the right timer
8649d0bf9b IGOR: fix scene transition between 8 and 9
50acc39383 IGOR: Pause while menu is open
7fbb14cb56 IGOR: Add savegame load for all rooms
ddb80c0529 IGOR: Allows start of music during save game load
ebb18b3577 IGOR: Implements scummvm save/load menus
0e0ffb760f IGOR: Refactor darken palette function
77917e710d IGOR: renaming part 72
56918ad737 IGOR: Renamings of parts 70, 72, 73, 74, 75, 76, 78
cee9e3e869 IGOR: Allow exiting scummVM without artifacts
f81e1e2573 IGOR: Fix animations being visible through full screen objects
4e856f33ac IGOR: Hook options menu to original resources (rather than hardcoded text)
35ab57216d IGOR: Hook game parameters through detection
1c2420536e IGOR: Consolidate common functions in parts 17 and 77
874d76502b IGOR: Sound and text speed options
b0d7010534 IGOR: Fix hotspot naming in lighthouse scene
d666e3b7b1 IGOR: Fix timing in igor splash logo
0209e75fda IGOR: fix speech sound 999 not playing, renaming stuff in the process
67c947bba5 IGOR: Rename missing function in chemistry entrance
803f847446 IGOR: name global state constants
6233c908a5 IGOR: Inventory item numbers as constants
f3d0addc93 IGOR: Renames in astronomy lab
406ee79608 IGOR: Make bottle not play shatter sound when net is placed
d7f55af9e1 IGOR: Consolidate a naming convention for parts
93e7a2b420 IGOR: Reutilize drawing functions where possible
a6bdf04b4e IGOR: Take screenshot before saving so the menu isnt visible
fecaed5199 IGOR: Disallow saving during cutscenes
f62b986b9b IGOR: Spacing fixes, licence fixes
40f69aba10 IGOR: Prevent pause on Igor CD
096f138d58 IGOR: Detect English demos and limit map access
8d4017eb15 IGOR: Import midi player from legacy engine
cbe4de8b04 IGOR: Selected the right music for demo
d110d4127b IGOR: Implements demo options menu
b7ffbd4926 IGOR: For non-talkies, skip non-existant speech tables to avoid a crash
9220f015f3 IGOR: Add action counter for demo 1.10
1ccbf371b4 IGOR: Bring in shareware slideshow from legacy engine
d65eb2a178 IGOR: Fix palette issue on the demo map
139647dfdd IGOR: Remove debug overlays
35fc27f700 IGOR: Fix small isue in part 81 with hotspot names
c08071a876 IGOR: Make music work in English floppy
edc4fc2b8a IGOR: Do not trigger Margaret cutscenes right after loading a game
e25e151c5b IGOR: Fix double entry animation in room 0
fc4e5e7616 IGOR: Allow skipping splash screens in floppy version
7619a86f43 IGOR: Fix sound indices above 63 on floppy version
679f1d8642 IGOR: Proper detection name
6d053b0223 IGOR: Fix The End inserts broken on floppy versions
b2fcb20a68 IGOR: Rework credits scene so it fits both CD and floppy
308da477a8 IGOR: Reorder walk code
a902366016 IGOR: Consolidate statics
08002411c7 IGOR: Last minute renames
13e9972231 IGOR: Restructure code
674445bf45 IGOR: Have midi employ configured OPL emulator
ae6e36e476 IGOR: Fix midi music scheduling
e0d7236a86 IGOR: Floppy version does not enforce first visit bulletin board read
3c4d18aa36 IGOR: Fix lack of dialog when using resin on stone for the second time
7a5f429f3c IGOR: Fix line not being split in floppy vs. CD
cb65587e51 IGOR: Add Spanish floppy fonts
8eeeed0b84 IGOR: remove the need for IGOR.FSD in spanish floppy
9ec43030a3 IGOR: Unpacker and loading main texts in Spanish floppy version
dab277fac8 IGOR: Fix floppy version verb panels and inventory
24b6839722 IGOR: Replace inventoryInfo special indices with constants
d71e8487c8 IGOR: Restore MIDI music in Spanish floppy
c39876259b IGOR: Implement Splash logos on Spanish floppy
9c7db9f5c0 IGOR: Implements part 30 for the floppy version
15c2bea46c IGOR: Implement room 21 for Spanish floppy
1b00c90bb7 IGOR: Use small font for dialogue options
c1847d8250 IGOR: Implemented part 15 for Spanish floppy
822a854ca7 IGOR: Implement Spanish Floppy room 31
b0296807dd IGOR: Implements part 20 in Spanish floppy
25fd02a846 IGOR: Color spanish floppy dialogue options
923207a7ce IGOR: Spanish floppy options menu
4ca680a5e2 IGOR: Implements part 24 in the Spanish floppy version
0f64925943 IGOR: Part 23 for the Spanish floppy
f41a0d51f2 IGOR: Room 28 on the Spanish Floppy
cb672b328f IGOR: Implement part 25
5044fa8745 IGOR: Implements part 26 in Spanish floppy
e15513059a IGOR: Spanish floppy part 27
0f59c74bbf IGOR: Do not trigger fist visit action on administration lobby on the floppy versions
04795288a0 IGOR: Small fixes to adjust the Spanish floppy version
15a8584f87 IGOR: Fix select timing issues in the Spanish floppy
6af9bf4190 IGOR: Fix ending on Spanish floppy
2cdf080b7b IGOR: Fix credits for Spanish floppy version
5739884c88 IGOR: Fixes margaret scenes in Spanish floppy
74ac3adfbf IGOR: Remove wait for the lighthouse scene in the Spanish floppy
c6333fc5ed IGOR: Music adjustments for Spanish floppy
eff2463357 IGOR: Fix error in Dean Peeper's office
e5ced6ecec IGOR: Hover default verb on hotspots for Spanish floppy
eb631b5660 IGOR: Right click directly selects default action in Spanish version
21abac5c4b IGOR: Correct sound indices in Spanish floppy version
26ba9c36b1 IGOR: Let player move cursor with keys in Spanish floppy version
4b5bedd16b IGOR: Select look when no default action is present
240f4ddb61 IGOR: Wait for click on photo & papyrus fullscreen views
b0bf952bdf IGOR: Fix sentence text color in church puzzle for the Spanish floppy version
4eba82202d IGOR: Fix missing sounds in room 32 for the Spanish floppy
9727162d0a IGOR: Save issues when saving while Igor was walking
8394cb3635 IGOR: Fix verbs panel showing up during intercom cutscene
781597f1fd IGOR: Disallow saving when characters speak lines
f07f631ef0 IGOR: Save during dialogue
f41c75f7d7 IGOR: load from dialogue options in rooms 33, 81 and 9
133381f35c IGOR: Allow saving during dialogue in parts 15 and 21
c19f596e51 IGOR: Allow saving in dialogue in part 6
323bf4678b IGOR: Have parts 12, 17 and 34 allow saving during dialogue
310840c73f IGOR: Fix handling of empty dialogue lines
a051e5e063 IGOR: Correct glitches in room 30 and 34 after loading within a dialogue
f8a0a9fc3a IGOR: Implement copy protection UI in Spanish floppy
a0045bd130 IGOR: Implements copy protection logic, gates behind config
37a093709c IGOR: scope part 2 case 23 to fix windows compilation
d85c18f02c IGOR: Fix compilation warnings
0e2cf56adb IGOR: Implement original save/load menu
13ba30a7d1 IGOR: Embed Floppy binary data in TBL file
eb25b0fc26 IGOR: Fix credits
89505984e4 IGOR: Sort header declarations
a4778fbf8a IGOR: Disallow loading when saving is not allowed (except splash screen and credits)
2d1487c653 IGOR: Add devtool to generate IGOR.TBL
235c0e960d IGOR: Rename verb and inventory palette functions
43d90e796f IGOR: Consolidate decodeRoomString into one definition
0f65c76e53 IGOR: Remove unused symbols
a07b284c5f IGOR: Split igor.h declarations into per-context files
34ad0c993e IGOR: Support return to Launcher
c7fc4ad0d9 IGOR: Remove unused midi controller
09582b2f0b IGOR: Adds keymapper support
9890457026 IGOR: Use ManagedSurfaces instead of pixel buffers where it makes sense
9fabb6d736 IGOR: Remove unnecessary static from copy protection
7cfadf6d4d IGOR: Remove statics from floppy menu
7affd33497 IGOR: Turn igor's frames into ManagedSurfaces
0b8b60b040 IGOR: Remove static modifier to variables that dont really need it
6a86fe60f3 IGOR: Sort MODULE_OBJS list alphabetically
af6ff7e6cd IGOR: Fix unfreed resources
adc80868b8 IGOR: Prevent out-of-bounds save slot in the original save/load page
45a541fa6d IGOR: Skip sentinel sound entry in create_tbl
81dcffd50a IGOR: Add exit condition on pause loop
f81d54b002 IGOR: Fix incorrect syncing of walkData and dialogueData
4e2eba2af1 IGOR: Preload inventory icons and panel
e74477e3ca IGOR: Fix black bar when opening options menu during splash screen
d6a7291cfa IGOR: Avoid walk table overrun and playSound asserts
828d4565a4 IGOR: Optimize by having IGOR.TBL always open
Commit: b8d036238b8e08dae48006b9bdcc9345bee8b1d1
https://github.com/scummvm/scummvm/commit/b8d036238b8e08dae48006b9bdcc9345bee8b1d1
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:40+01:00
Commit Message:
IGOR: Engine skeleton, first screen displayed
Changed paths:
A engines/igor/POTFILES
A engines/igor/configure.engine
A engines/igor/console.cpp
A engines/igor/console.h
A engines/igor/credits.pl
A engines/igor/detection.cpp
A engines/igor/detection.h
A engines/igor/detection_tables.h
A engines/igor/igor.cpp
A engines/igor/igor.h
A engines/igor/metaengine.cpp
A engines/igor/metaengine.h
A engines/igor/module.mk
A engines/igor/resource_ids.h
diff --git a/engines/igor/POTFILES b/engines/igor/POTFILES
new file mode 100644
index 00000000000..494161ca3d6
--- /dev/null
+++ b/engines/igor/POTFILES
@@ -0,0 +1 @@
+engines/igor/metaengine.cpp
diff --git a/engines/igor/configure.engine b/engines/igor/configure.engine
new file mode 100644
index 00000000000..6030f42a432
--- /dev/null
+++ b/engines/igor/configure.engine
@@ -0,0 +1,3 @@
+# This file is included from the main "configure" script
+# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps] [components]
+add_engine igor "Igor" no "" "" "" ""
diff --git a/engines/igor/console.cpp b/engines/igor/console.cpp
new file mode 100644
index 00000000000..1756c02e608
--- /dev/null
+++ b/engines/igor/console.cpp
@@ -0,0 +1,38 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/console.h"
+
+namespace Igor {
+
+Console::Console() : GUI::Debugger() {
+ registerCmd("test", WRAP_METHOD(Console, Cmd_test));
+}
+
+Console::~Console() {
+}
+
+bool Console::Cmd_test(int argc, const char **argv) {
+ debugPrintf("Test\n");
+ return true;
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/console.h b/engines/igor/console.h
new file mode 100644
index 00000000000..dfe75742095
--- /dev/null
+++ b/engines/igor/console.h
@@ -0,0 +1,40 @@
+
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_CONSOLE_H
+#define IGOR_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Igor {
+
+class Console : public GUI::Debugger {
+private:
+ bool Cmd_test(int argc, const char **argv);
+public:
+ Console();
+ ~Console() override;
+};
+
+} // End of namespace Igor
+
+#endif // IGOR_CONSOLE_H
diff --git a/engines/igor/credits.pl b/engines/igor/credits.pl
new file mode 100644
index 00000000000..2f061d84faa
--- /dev/null
+++ b/engines/igor/credits.pl
@@ -0,0 +1,3 @@
+begin_section("Igor");
+ add_person("Name 1", "Handle 1", "");
+end_section();
diff --git a/engines/igor/detection.cpp b/engines/igor/detection.cpp
new file mode 100644
index 00000000000..c851282636e
--- /dev/null
+++ b/engines/igor/detection.cpp
@@ -0,0 +1,45 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "base/plugins.h"
+#include "common/config-manager.h"
+#include "common/file.h"
+#include "common/md5.h"
+#include "common/str-array.h"
+#include "common/translation.h"
+#include "common/util.h"
+#include "igor/detection.h"
+#include "igor/detection_tables.h"
+
+const DebugChannelDef IgorMetaEngineDetection::debugFlagList[] = {
+ { Igor::kDebugGraphics, "Graphics", "Graphics debug level" },
+ { Igor::kDebugPath, "Path", "Pathfinding debug level" },
+ { Igor::kDebugFilePath, "FilePath", "File path debug level" },
+ { Igor::kDebugScan, "Scan", "Scan for unrecognised games" },
+ { Igor::kDebugScript, "Script", "Enable debug script dump" },
+ DEBUG_CHANNEL_END
+};
+
+IgorMetaEngineDetection::IgorMetaEngineDetection() : AdvancedMetaEngineDetection(
+ Igor::gameDescriptions, Igor::igorGames) {
+}
+
+REGISTER_PLUGIN_STATIC(IGOR_DETECTION, PLUGIN_TYPE_ENGINE_DETECTION, IgorMetaEngineDetection);
diff --git a/engines/igor/detection.h b/engines/igor/detection.h
new file mode 100644
index 00000000000..b1306e00f60
--- /dev/null
+++ b/engines/igor/detection.h
@@ -0,0 +1,69 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_DETECTION_H
+#define IGOR_DETECTION_H
+
+#include "engines/advancedDetector.h"
+
+namespace Igor {
+
+enum IgorDebugChannels {
+ kDebugGraphics = 1,
+ kDebugPath,
+ kDebugScan,
+ kDebugFilePath,
+ kDebugScript,
+};
+
+extern const PlainGameDescriptor igorGames[];
+
+extern const ADGameDescription gameDescriptions[];
+
+#define GAMEOPTION_ORIGINAL_SAVELOAD GUIO_GAMEOPTIONS1
+
+} // End of namespace Igor
+
+class IgorMetaEngineDetection : public AdvancedMetaEngineDetection<ADGameDescription> {
+ static const DebugChannelDef debugFlagList[];
+
+public:
+ IgorMetaEngineDetection();
+ ~IgorMetaEngineDetection() override {}
+
+ const char *getName() const override {
+ return "igor";
+ }
+
+ const char *getEngineName() const override {
+ return "Igor";
+ }
+
+ const char *getOriginalCopyright() const override {
+ return "Igor (C)";
+ }
+
+ const DebugChannelDef *getDebugChannels() const override {
+ return debugFlagList;
+ }
+};
+
+#endif // IGOR_DETECTION_H
diff --git a/engines/igor/detection_tables.h b/engines/igor/detection_tables.h
new file mode 100644
index 00000000000..627304c3fa4
--- /dev/null
+++ b/engines/igor/detection_tables.h
@@ -0,0 +1,47 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace Igor {
+
+const PlainGameDescriptor igorGames[] = {
+ { "igor", "Igor" },
+ { 0, 0 }
+};
+
+const ADGameDescription gameDescriptions[] = {
+ {
+ "igor",
+ nullptr,
+ AD_ENTRY2s(
+ "IGOR.DAT", "b4ba3ec480ec66a2fa456265ab51f5f6", 61682719,
+ "IGOR.EXE", "70f49859d1defddda140d144e1eb90b1", 9115648
+ ),
+
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ ADGF_UNSTABLE,
+ GUIO1(GUIO_NONE)
+ },
+
+ AD_TABLE_END_MARKER
+};
+
+} // End of namespace Igor
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
new file mode 100644
index 00000000000..47ac8e42e0f
--- /dev/null
+++ b/engines/igor/igor.cpp
@@ -0,0 +1,417 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+#include "graphics/framelimiter.h"
+#include "igor/detection.h"
+#include "igor/console.h"
+#include "common/scummsys.h"
+#include "common/config-manager.h"
+#include "common/debug-channels.h"
+#include "common/events.h"
+#include "common/system.h"
+#include "engines/util.h"
+#include "graphics/paletteman.h"
+#include "graphics/cursorman.h"
+
+#include "audio/mixer.h"
+
+namespace Igor {
+
+IgorEngine *g_engine;
+
+IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst),
+ _gameDescription(gameDesc), _randomSource("Igor") {
+ g_engine = this;
+
+
+ _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);
+
+ { // hardcoded now
+ _game.ovlFileName = "igor.exe";
+ _game.sfxFileName = "igor.dat";
+ _currentPart = 50;
+ }
+
+ // if (_game.flags & kFlagFloppy) {
+ // _midiPlayer = new Midi(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;
+ delete _screen;
+}
+
+uint32 IgorEngine::getFeatures() const {
+ return _gameDescription->flags;
+}
+
+Common::String IgorEngine::getGameId() const {
+ return _gameDescription->gameId;
+}
+
+Common::Error IgorEngine::run() {
+ // Initialize 320x200 paletted graphics mode
+ initGraphics(320, 200);
+ _screen = new Graphics::Screen();
+
+ // Set the engine's debugger console
+ setDebugger(new Console());
+
+ restart();
+ setupDefaultPalette();
+
+ if (!_ovlFile.open(_game.ovlFileName)) {
+ error("Unable to open '%s'", _game.ovlFileName);
+ }
+
+ readTableFile();
+ loadMainTexts();
+ loadIgorFrames();
+ // If a savegame was selected from the launcher, load it
+ int saveSlot = ConfMan.getInt("save_slot");
+ if (saveSlot != -1)
+ (void)loadGameState(saveSlot);
+
+
+ _eventQuitGame = false;
+ PART_MAIN();
+ _ovlFile.close();
+ // _sndFile.close();
+
+ return Common::kNoError;
+}
+
+void IgorEngine::restart() {
+ _nextTimer = 0;
+}
+
+void IgorEngine::setupDefaultPalette() {
+ memset(_currentPalette, 0, 255 * 3);
+ memset(&_currentPalette[255 * 3], 63, 3);
+ g_system->getPaletteManager()->setPalette(_currentPalette, 0, 256);
+}
+
+void IgorEngine::readTableFile() {
+ Common::File tblFile;
+ uint32 stringsEntriesOffset = 0, resourcesEntriesOffset = 0, soundEntriesOffset = 0;
+ if (tblFile.open("IGOR.TBL") && tblFile.readUint32BE() == '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'");
+}
+
+void IgorEngine::loadMainTexts() {
+}
+
+void IgorEngine::loadIgorFrames() {
+}
+
+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;
+}
+
+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);
+ // }
+
+ {
+ g_system->getPaletteManager()->setPalette(_paletteBuffer, 0, 256);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ }
+}
+
+void IgorEngine::PART_05() {
+ loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
+
+
+
+ enterPartLoop();
+ while (_currentPart >= 50 && _currentPart <= 52) {
+ runPartLoop();
+ }
+ leavePartLoop();
+
+}
+
+
+void IgorEngine::enterPartLoop() {
+ CursorMan.showMouse(true);
+ // 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;
+ CursorMan.showMouse(false);
+}
+
+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();
+}
+
+void IgorEngine::waitForTimer(int ticks) {
+ _system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, 200);
+ _system->updateScreen();
+ debug("Screen updated!");
+ 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;
+ }
+ debug("Waiting for timer: %d ms left", endTicks - _system->getMillis());
+ } while (true);
+ _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::PART_MAIN() {
+ while (!g_engine->shouldQuit() && !_eventQuitGame) {
+ switch (_currentPart) {
+
+ case 50:
+ PART_05(); // SpringRock
+ break;
+
+ default:
+ error("Unknown or unhandled room part %d", _currentPart);
+ break;
+ }
+ }
+}
+
+
+void IgorEngine::handleRoomInput() {
+
+}
+
+Common::Error IgorEngine::syncGame(Common::Serializer &s) {
+ // The Serializer has methods isLoading() and isSaving()
+ // if you need to specific steps; for example setting
+ // an array size after reading it's length, whereas
+ // for saving it would write the existing array's length
+ int dummy = 0;
+ s.syncAsUint32LE(dummy);
+
+ return Common::kNoError;
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
new file mode 100644
index 00000000000..aaea1ebdf59
--- /dev/null
+++ b/engines/igor/igor.h
@@ -0,0 +1,211 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_H
+#define IGOR_H
+
+#include "common/scummsys.h"
+#include "common/system.h"
+#include "common/error.h"
+#include "common/file.h"
+#include "common/fs.h"
+#include "common/hash-str.h"
+#include "common/random.h"
+#include "common/serializer.h"
+#include "common/util.h"
+#include "engines/engine.h"
+#include "engines/savestate.h"
+#include "graphics/screen.h"
+
+#include "audio/mididrv_ms.h"
+#include "audio/midiparser.h"
+
+#include "igor/detection.h"
+#include "igor/resource_ids.h"
+
+namespace Igor {
+
+struct IgorGameDescription;
+
+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
+};
+
+struct DetectedGameVersion {
+ int version;
+ int flags;
+ Common::Language language;
+ const char *ovlFileName;
+ const char *sfxFileName;
+};
+
+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) {}
+};
+
+class IgorEngine : public Engine {
+private:
+ const ADGameDescription *_gameDescription;
+ Common::RandomSource _randomSource;
+ // MidiPlayer *_midiPlayer;
+
+
+ Common::File _ovlFile;
+
+ uint8 *_screenVGA;
+ uint8 *_facingIgorFrames[4];
+ uint8 *_screenLayer1;
+ uint8 *_screenLayer2;
+ uint8 *_screenTextLayer;
+ uint8 *_screenTempLayer;
+ uint8 *_igorHeadFrames;
+ uint8 *_animFramesBuffer;
+ uint8 *_inventoryPanelBuffer;
+ uint8 *_inventoryImagesBuffer;
+ uint8 *_verbsPanelBuffer;
+
+ bool _eventQuitGame;
+ uint32 _nextTimer;
+
+
+ DetectedGameVersion _game;
+
+
+ int16 _currentPart;
+ uint8 _currentPalette[768];
+ uint8 _paletteBuffer[768];
+
+ int _gameTicks;
+ int _resourceEntriesCount;
+ int _soundOffsetsCount;
+ uint32 *_soundOffsets;
+
+ ResourceEntry *_resourceEntries;
+ Common::Array<StringEntry> _stringEntries;
+
+
+ void restart();
+ void setupDefaultPalette();
+
+ void readTableFile();
+ void loadMainTexts();
+ void loadIgorFrames();
+
+ void PART_MAIN();
+ void PART_05();
+
+ void handleRoomInput();
+
+ void enterPartLoop();
+ void leavePartLoop();
+ void runPartLoop();
+
+ void waitForTimer(int ticks = -1);
+
+ ResourceEntry *findData(int num);
+ uint8 *loadData(int num, uint8 *dst = 0, int *size = 0);
+ void loadRoomData(int pal, int img, int box, int msk, int txt);
+
+
+protected:
+ // Engine APIs
+ Common::Error run() override;
+public:
+ Graphics::Screen *_screen = nullptr;
+public:
+ IgorEngine(OSystem *syst, const ADGameDescription *gameDesc);
+ ~IgorEngine() override;
+
+ uint32 getFeatures() const;
+
+ /**
+ * Returns the game Id
+ */
+ Common::String getGameId() const;
+
+ /**
+ * Gets a random number
+ */
+ uint32 getRandomNumber(uint maxNum) {
+ return _randomSource.getRandomNumber(maxNum);
+ }
+
+ bool hasFeature(EngineFeature f) const override {
+ return
+ (f == kSupportsLoadingDuringRuntime) ||
+ (f == kSupportsSavingDuringRuntime) ||
+ (f == kSupportsReturnToLauncher);
+ };
+
+ bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override {
+ return true;
+ }
+ bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override {
+ return true;
+ }
+
+ /**
+ * Uses a serializer to allow implementing savegame
+ * loading and saving using a single method
+ */
+ Common::Error syncGame(Common::Serializer &s);
+
+ Common::Error saveGameStream(Common::WriteStream *stream, bool isAutosave = false) override {
+ Common::Serializer s(nullptr, stream);
+ return syncGame(s);
+ }
+ Common::Error loadGameStream(Common::SeekableReadStream *stream) override {
+ Common::Serializer s(stream, nullptr);
+ return syncGame(s);
+ }
+};
+
+extern IgorEngine *g_engine;
+#define SHOULD_QUIT ::Igor::g_engine->shouldQuit()
+
+} // End of namespace Igor
+
+#endif // IGOR_H
diff --git a/engines/igor/metaengine.cpp b/engines/igor/metaengine.cpp
new file mode 100644
index 00000000000..f0ea197abd1
--- /dev/null
+++ b/engines/igor/metaengine.cpp
@@ -0,0 +1,69 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/translation.h"
+
+#include "igor/metaengine.h"
+#include "igor/detection.h"
+#include "igor/igor.h"
+
+namespace Igor {
+
+static const ADExtraGuiOptionsMap optionsList[] = {
+ {
+ GAMEOPTION_ORIGINAL_SAVELOAD,
+ {
+ _s("Use original save/load screens"),
+ _s("Use the original save/load screens instead of the ScummVM ones"),
+ "original_menus",
+ false,
+ 0,
+ 0
+ }
+ },
+ AD_EXTRA_GUI_OPTIONS_TERMINATOR
+};
+
+} // End of namespace Igor
+
+const char *IgorMetaEngine::getName() const {
+ return "igor";
+}
+
+const ADExtraGuiOptionsMap *IgorMetaEngine::getAdvancedExtraGuiOptions() const {
+ return Igor::optionsList;
+}
+
+Common::Error IgorMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
+ *engine = new Igor::IgorEngine(syst, desc);
+ return Common::kNoError;
+}
+
+bool IgorMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return checkExtendedSaves(f) ||
+ (f == kSupportsLoadingDuringStartup);
+}
+
+#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/metaengine.h b/engines/igor/metaengine.h
new file mode 100644
index 00000000000..59b163242cd
--- /dev/null
+++ b/engines/igor/metaengine.h
@@ -0,0 +1,43 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_METAENGINE_H
+#define IGOR_METAENGINE_H
+
+#include "engines/advancedDetector.h"
+
+class IgorMetaEngine : public AdvancedMetaEngine<ADGameDescription> {
+public:
+ const char *getName() const override;
+
+ Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
+
+ /**
+ * Determine whether the engine supports the specified MetaEngine feature.
+ *
+ * Used by e.g. the launcher to determine whether to enable the Load button.
+ */
+ bool hasFeature(MetaEngineFeature f) const override;
+
+ const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override;
+};
+
+#endif // IGOR_METAENGINE_H
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
new file mode 100644
index 00000000000..39aa4282280
--- /dev/null
+++ b/engines/igor/module.mk
@@ -0,0 +1,17 @@
+MODULE := engines/igor
+
+MODULE_OBJS = \
+ igor.o \
+ console.o \
+ metaengine.o
+
+# This module can be built as a plugin
+ifeq ($(ENABLE_IGOR), DYNAMIC_PLUGIN)
+PLUGIN := 1
+endif
+
+# Include common rules
+include $(srcdir)/rules.mk
+
+# Detection objects
+DETECT_OBJS += $(MODULE)/detection.o
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
new file mode 100644
index 00000000000..e2c29d1ade8
--- /dev/null
+++ b/engines/igor/resource_ids.h
@@ -0,0 +1,35 @@
+/* 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 TXT_SpringRock 270
+#define IMG_SpringRock 271
+#define PAL_SpringRock 272
+#define MSK_SpringRock 273
+#define BOX_SpringRock 274
+
+#endif // IGOR_RESOURCE_IDS
Commit: 9fd522a123df93a636933fb21ca93be72eb7942b
https://github.com/scummvm/scummvm/commit/9fd522a123df93a636933fb21ca93be72eb7942b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:40+01:00
Commit Message:
IGOR: Load room metadata, palette animations
Changed paths:
A engines/igor/static.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 47ac8e42e0f..c2dd2d554a5 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -20,17 +20,17 @@
*/
#include "igor/igor.h"
-#include "graphics/framelimiter.h"
-#include "igor/detection.h"
-#include "igor/console.h"
-#include "common/scummsys.h"
#include "common/config-manager.h"
#include "common/debug-channels.h"
#include "common/events.h"
+#include "common/scummsys.h"
#include "common/system.h"
#include "engines/util.h"
-#include "graphics/paletteman.h"
#include "graphics/cursorman.h"
+#include "graphics/framelimiter.h"
+#include "graphics/paletteman.h"
+#include "igor/console.h"
+#include "igor/detection.h"
#include "audio/mixer.h"
@@ -39,12 +39,11 @@ namespace Igor {
IgorEngine *g_engine;
IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst),
- _gameDescription(gameDesc), _randomSource("Igor") {
+ _gameDescription(gameDesc), _randomSource("Igor") {
g_engine = this;
-
_screenVGA = (uint8 *)malloc(320 * 200);
- for(int i = 0; i < 4; i++) {
+ for (int i = 0; i < 4; i++) {
_facingIgorFrames[i] = (uint8 *)malloc(13500);
}
_screenLayer1 = (uint8 *)malloc(320 * 144);
@@ -71,7 +70,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
}
IgorEngine::~IgorEngine() {
- // free(_resourceEntries);
+ free(_resourceEntries);
// free(_soundOffsets);
free(_screenVGA);
for (int i = 0; i < 4; ++i) {
@@ -101,6 +100,77 @@ Common::String IgorEngine::getGameId() const {
return _gameDescription->gameId;
}
+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() {
// Initialize 320x200 paletted graphics mode
initGraphics(320, 200);
@@ -124,7 +194,6 @@ Common::Error IgorEngine::run() {
if (saveSlot != -1)
(void)loadGameState(saveSlot);
-
_eventQuitGame = false;
PART_MAIN();
_ovlFile.close();
@@ -133,9 +202,6 @@ Common::Error IgorEngine::run() {
return Common::kNoError;
}
-void IgorEngine::restart() {
- _nextTimer = 0;
-}
void IgorEngine::setupDefaultPalette() {
memset(_currentPalette, 0, 255 * 3);
@@ -200,6 +266,12 @@ void IgorEngine::loadMainTexts() {
}
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);
}
static int compareResourceEntry(const void *a, const void *b) {
@@ -238,44 +310,82 @@ void IgorEngine::loadRoomData(int pal, int img, int box, int msk, int txt) {
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);
- // }
-
- {
- g_system->getPaletteManager()->setPalette(_paletteBuffer, 0, 256);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ 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::PART_05() {
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
-
+ //Enforce display of room
+ {
+ // g_system->getPaletteManager()->setPalette(_paletteBuffer, 0, 256);
+ memcpy(_currentPalette, _paletteBuffer, 768);
+ updatePalette(768);
+ // fadeInPalette(768);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ }
enterPartLoop();
while (_currentPart >= 50 && _currentPart <= 52) {
runPartLoop();
}
leavePartLoop();
-
}
+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::enterPartLoop() {
CursorMan.showMouse(true);
@@ -312,11 +422,95 @@ void IgorEngine::runPartLoop() {
// if (_updateRoomBackground) {
// (this->*_updateRoomBackground)();
// }
+ {
+ PART_05_UPDATE_ROOM_BACKGROUND();
+ }
waitForTimer();
}
+void IgorEngine::scrollPalette(int startColor, int 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::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::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;
+ g_system->getPaletteManager()->setPalette(pal, index, 1);
+}
+
+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;
+ // }
+ }
+ g_system->getPaletteManager()->setPalette(pal, 0, count / 3);
+}
+
+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::waitForTimer(int ticks) {
- _system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, 200);
+ _system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
_system->updateScreen();
debug("Screen updated!");
uint32 endTicks = (ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay;
@@ -329,32 +523,32 @@ void IgorEngine::waitForTimer(int ticks) {
_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;
+ // 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;
}
@@ -382,25 +576,135 @@ void IgorEngine::waitForTimer(int ticks) {
}
}
+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::PART_MAIN() {
- while (!g_engine->shouldQuit() && !_eventQuitGame) {
- switch (_currentPart) {
+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;
+ }
+}
- case 50:
- PART_05(); // SpringRock
- break;
+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;
+ }
+}
- default:
- error("Unknown or unhandled room part %d", _currentPart);
- break;
- }
- }
+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::handleRoomInput() {
+void IgorEngine::PART_MAIN() {
+ while (!g_engine->shouldQuit() && !_eventQuitGame) {
+ switch (_currentPart) {
+
+ case 50:
+ PART_05(); // SpringRock
+ break;
+ default:
+ error("Unknown or unhandled room part %d", _currentPart);
+ break;
+ }
+ }
+}
+
+void IgorEngine::handleRoomInput() {
}
Common::Error IgorEngine::syncGame(Common::Serializer &s) {
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index aaea1ebdf59..fe9f4abea5c 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -22,14 +22,14 @@
#ifndef IGOR_H
#define IGOR_H
-#include "common/scummsys.h"
-#include "common/system.h"
#include "common/error.h"
#include "common/file.h"
#include "common/fs.h"
#include "common/hash-str.h"
#include "common/random.h"
+#include "common/scummsys.h"
#include "common/serializer.h"
+#include "common/system.h"
#include "common/util.h"
#include "engines/engine.h"
#include "engines/savestate.h"
@@ -46,7 +46,7 @@ namespace Igor {
struct IgorGameDescription;
enum {
- kFlagDemo = 1 << 0,
+ kFlagDemo = 1 << 0,
kFlagFloppy = 1 << 1,
kFlagTalkie = 1 << 2
};
@@ -64,6 +64,16 @@ enum {
kNoSpeechSound = 999
};
+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
+};
+
struct DetectedGameVersion {
int version;
int flags;
@@ -86,13 +96,20 @@ struct StringEntry {
StringEntry(int i, const char *s) : id(i), str(s) {}
};
+struct RoomObjectArea {
+ uint8 area;
+ uint8 object;
+ uint8 y1Lum;
+ uint8 y2Lum;
+ uint8 deltaLum;
+};
+
class IgorEngine : public Engine {
private:
const ADGameDescription *_gameDescription;
Common::RandomSource _randomSource;
// MidiPlayer *_midiPlayer;
-
Common::File _ovlFile;
uint8 *_screenVGA;
@@ -106,17 +123,24 @@ private:
uint8 *_inventoryPanelBuffer;
uint8 *_inventoryImagesBuffer;
uint8 *_verbsPanelBuffer;
+ int _screenVGAVOffset;
bool _eventQuitGame;
uint32 _nextTimer;
-
DetectedGameVersion _game;
+ char _globalDialogueTexts[300][MAX_DIALOGUE_TEXT_LENGTH];
+ char _roomObjectNames[20][MAX_OBJECT_NAME_LENGTH];
+ uint8 _walkXScaleRoom[320];
+ uint8 _walkYScaleRoom[144 * 3];
+ RoomObjectArea _roomObjectAreasTable[MAX_ROOM_OBJECT_AREAS];
+
int16 _currentPart;
uint8 _currentPalette[768];
uint8 _paletteBuffer[768];
+ uint8 _igorPalette[48];
int _gameTicks;
int _resourceEntriesCount;
@@ -126,7 +150,6 @@ private:
ResourceEntry *_resourceEntries;
Common::Array<StringEntry> _stringEntries;
-
void restart();
void setupDefaultPalette();
@@ -136,6 +159,7 @@ private:
void PART_MAIN();
void PART_05();
+ void PART_05_UPDATE_ROOM_BACKGROUND();
void handleRoomInput();
@@ -143,18 +167,32 @@ private:
void leavePartLoop();
void runPartLoop();
+
+ void scrollPalette(int startColor, int endColor);
+ void setPaletteColor(uint8 index, uint8 r, uint8 g, uint8 b);
+ void setPaletteRange(int startColor, int endColor);
+ void updatePalette(int count);
+
+ void fadeInPalette(int count);
+ void fadeOutPalette(int count);
+
+ 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);
+
+ 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; }
+
void waitForTimer(int ticks = -1);
ResourceEntry *findData(int num);
uint8 *loadData(int num, uint8 *dst = 0, int *size = 0);
void loadRoomData(int pal, int img, int box, int msk, int txt);
-
-protected:
- // Engine APIs
- Common::Error run() override;
public:
Graphics::Screen *_screen = nullptr;
+
public:
IgorEngine(OSystem *syst, const ADGameDescription *gameDesc);
~IgorEngine() override;
@@ -174,10 +212,9 @@ public:
}
bool hasFeature(EngineFeature f) const override {
- return
- (f == kSupportsLoadingDuringRuntime) ||
- (f == kSupportsSavingDuringRuntime) ||
- (f == kSupportsReturnToLauncher);
+ return (f == kSupportsLoadingDuringRuntime) ||
+ (f == kSupportsSavingDuringRuntime) ||
+ (f == kSupportsReturnToLauncher);
};
bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override {
@@ -201,6 +238,13 @@ public:
Common::Serializer s(stream, nullptr);
return syncGame(s);
}
+protected:
+ // Engine APIs
+ Common::Error run() override;
+ static const uint8 PAL_48_1[];
+ static const uint8 PAL_96_1[];
+ static const uint8 PAL_IGOR_1[];
+ static const uint8 PAL_IGOR_2[];
};
extern IgorEngine *g_engine;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 39aa4282280..bf57917a6ee 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -3,7 +3,8 @@ MODULE := engines/igor
MODULE_OBJS = \
igor.o \
console.o \
- metaengine.o
+ metaengine.o \
+ static.o
# This module can be built as a plugin
ifeq ($(ENABLE_IGOR), DYNAMIC_PLUGIN)
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index e2c29d1ade8..421cf92feb2 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -4,28 +4,31 @@
* 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 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 3 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$
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef IGOR_RESOURCE_IDS
#define IGOR_RESOURCE_IDS
+
+#define FRM_IgorDirBack 317
+#define FRM_IgorDirRight 318
+#define FRM_IgorDirFront 319
+#define FRM_IgorDirLeft 320
+#define FRM_IgorHead 321
+
#define TXT_SpringRock 270
#define IMG_SpringRock 271
#define PAL_SpringRock 272
diff --git a/engines/igor/static.cpp b/engines/igor/static.cpp
new file mode 100644
index 00000000000..862f0867ee9
--- /dev/null
+++ b/engines/igor/static.cpp
@@ -0,0 +1,39 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+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
+};
+
+
+} // End of namespace Igor
Commit: 6758d62aadf09d9539848eb10a52b8392809038a
https://github.com/scummvm/scummvm/commit/6758d62aadf09d9539848eb10a52b8392809038a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:41+01:00
Commit Message:
IGOR: fade in scene
Changed paths:
engines/igor/igor.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index c2dd2d554a5..bb41f3ffe1b 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -206,7 +206,8 @@ Common::Error IgorEngine::run() {
void IgorEngine::setupDefaultPalette() {
memset(_currentPalette, 0, 255 * 3);
memset(&_currentPalette[255 * 3], 63, 3);
- g_system->getPaletteManager()->setPalette(_currentPalette, 0, 256);
+ updatePalette(768);
+ // g_system->getPaletteManager()->setPalette(_currentPalette, 0, 256);
}
void IgorEngine::readTableFile() {
@@ -336,10 +337,13 @@ void IgorEngine::PART_05() {
//Enforce display of room
{
// g_system->getPaletteManager()->setPalette(_paletteBuffer, 0, 256);
- memcpy(_currentPalette, _paletteBuffer, 768);
- updatePalette(768);
+ // memcpy(_currentPalette, _paletteBuffer, 768);
+ // updatePalette(768);
// fadeInPalette(768);
+
memcpy(_screenVGA, _screenLayer1, 46080);
+ fadeInPalette(768);
+
}
enterPartLoop();
@@ -347,6 +351,15 @@ void IgorEngine::PART_05() {
runPartLoop();
}
leavePartLoop();
+ 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);
+ }
}
void IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND() {
Commit: 83575e9ff1060066c6637eb9b9688e25ef6df894
https://github.com/scummvm/scummvm/commit/83575e9ff1060066c6637eb9b9688e25ef6df894
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:41+01:00
Commit Message:
IGOR: Walk algo, draw igor
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/resource_ids.h
engines/igor/static.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index bb41f3ffe1b..d8706aae390 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -103,17 +103,17 @@ Common::String IgorEngine::getGameId() const {
void IgorEngine::restart() {
_screenVGAVOffset = 0;
- // memset(&_gameState, 0, sizeof(_gameState));
+ 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(_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;
@@ -143,7 +143,7 @@ void IgorEngine::restart() {
// memset(_verbsName, 0, sizeof(_verbsName));
memset(_roomObjectNames, 0, sizeof(_roomObjectNames));
- // _igorTempFrames = _facingIgorFrames[0] + 10500;
+ _igorTempFrames = _facingIgorFrames[0] + 10500;
memset(_roomObjectAreasTable, 0, sizeof(_roomObjectAreasTable));
// memset(_roomActionsTable, 0, sizeof(_roomActionsTable));
@@ -159,7 +159,7 @@ void IgorEngine::restart() {
// _currentCursor = 0;
// _dialogueCursorOn = true;
// _updateDialogue = 0;
- // _updateRoomBackground = 0;
+ _updateRoomBackground = 0;
_resourceEntriesCount = 0;
_resourceEntries = 0;
@@ -189,6 +189,9 @@ Common::Error IgorEngine::run() {
readTableFile();
loadMainTexts();
loadIgorFrames();
+ _gameState.talkMode = kTalkModeTextOnly;
+ _gameState.talkSpeed = 3;
+
// If a savegame was selected from the launcher, load it
int saveSlot = ConfMan.getInt("save_slot");
if (saveSlot != -1)
@@ -332,8 +335,13 @@ void IgorEngine::loadRoomData(int pal, int img, int box, int msk, int txt) {
}
void IgorEngine::PART_05() {
+ _gameState.enableLight = 1;
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
+
+ loadRoomData(PAL_SpringBridge, IMG_SpringBridge, BOX_SpringBridge, MSK_SpringBridge, TXT_SpringBridge);
+ _updateRoomBackground = &IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND;
+
//Enforce display of room
{
// g_system->getPaletteManager()->setPalette(_paletteBuffer, 0, 256);
@@ -346,6 +354,22 @@ void IgorEngine::PART_05() {
}
+ setRoomWalkBounds(0, 0, 319, 143);
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+
+ {
+ _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();
+ }
+
enterPartLoop();
while (_currentPart >= 50 && _currentPart <= 52) {
runPartLoop();
@@ -362,6 +386,44 @@ void IgorEngine::PART_05() {
}
}
+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::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::PART_05_UPDATE_ROOM_BACKGROUND() {
if (compareGameTick(61)) {
scrollPalette(160, 167);
@@ -415,14 +477,14 @@ void IgorEngine::leavePartLoop() {
// hideCursor();
// SET_EXEC_ACTION_FUNC(1, 0);
// _updateRoomBackground = 0;
- CursorMan.showMouse(false);
+
}
void IgorEngine::runPartLoop() {
handleRoomInput();
- // if (compareGameTick(1, 16)) {
- // handleRoomIgorWalk();
- // }
+ if (compareGameTick(1, 16)) {
+ handleRoomIgorWalk();
+ }
// if (compareGameTick(19, 32)) {
// handleRoomDialogue();
// }
@@ -432,15 +494,964 @@ void IgorEngine::runPartLoop() {
// if (compareGameTick(1)) {
// handleRoomLight();
// }
- // if (_updateRoomBackground) {
- // (this->*_updateRoomBackground)();
- // }
- {
- PART_05_UPDATE_ROOM_BACKGROUND();
+ 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::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::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::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::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::scrollPalette(int startColor, int endColor) {
uint8 c[3];
memcpy(c, &_currentPalette[startColor * 3], 3);
@@ -718,6 +1729,26 @@ void IgorEngine::PART_MAIN() {
}
void IgorEngine::handleRoomInput() {
+
+}
+
+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;
+ }
}
Common::Error IgorEngine::syncGame(Common::Serializer &s) {
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index fe9f4abea5c..1ae29216d59 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -74,6 +74,24 @@ enum {
MAX_DIALOGUE_REPLIES = 70
};
+enum FacingPosition {
+ kFacingPositionBack = 1,
+ kFacingPositionRight = 2,
+ kFacingPositionFront = 3,
+ kFacingPositionLeft = 4
+};
+
+enum {
+ kTalkModeSpeechOnly = 0,
+ kTalkModeSpeechAndText = 1,
+ kTalkModeTextOnly = 2
+};
+
+struct RoomWalkBounds {
+ int x1, y1;
+ int x2, y2;
+};
+
struct DetectedGameVersion {
int version;
int flags;
@@ -104,7 +122,95 @@ struct RoomObjectArea {
uint8 deltaLum;
};
+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 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;
+ }
+ }
+};
+
+
class IgorEngine : public Engine {
+public:
+
+ typedef void (IgorEngine::*UpdateRoomBackgroundProc)();
private:
const ADGameDescription *_gameDescription;
Common::RandomSource _randomSource;
@@ -126,6 +232,7 @@ private:
int _screenVGAVOffset;
bool _eventQuitGame;
+ GameStateData _gameState;
uint32 _nextTimer;
DetectedGameVersion _game;
@@ -137,10 +244,22 @@ private:
uint8 _walkYScaleRoom[144 * 3];
RoomObjectArea _roomObjectAreasTable[MAX_ROOM_OBJECT_AREAS];
+
+ WalkData _walkData[100];
+ uint8 _walkCurrentPos;
+ uint8 _walkDataLastIndex;
+ uint8 _walkDataCurrentIndex;
+ uint8 _walkCurrentFrame;
+ int _walkDataCurrentPosX, _walkDataCurrentPosY;
+ int _walkToObjectPosX, _walkToObjectPosY;
+
int16 _currentPart;
uint8 _currentPalette[768];
uint8 _paletteBuffer[768];
uint8 _igorPalette[48];
+ uint8 *_igorTempFrames;
+
+ RoomWalkBounds _roomWalkBounds;
int _gameTicks;
int _resourceEntriesCount;
@@ -150,6 +269,12 @@ private:
ResourceEntry *_resourceEntries;
Common::Array<StringEntry> _stringEntries;
+ UpdateRoomBackgroundProc _updateRoomBackground;
+
+ static const uint8 _walkWidthScaleTable[];
+ static const uint8 _walkScaleTable[];
+ static const float _walkScaleSpeedTable[];
+
void restart();
void setupDefaultPalette();
@@ -159,14 +284,30 @@ private:
void PART_MAIN();
void PART_05();
+
void PART_05_UPDATE_ROOM_BACKGROUND();
void handleRoomInput();
+ void handleRoomIgorWalk();
void enterPartLoop();
void leavePartLoop();
void runPartLoop();
+ int lookupScale(int xOffset, int yOffset, int h) const;
+ void lookupScale(int curX, int curY, uint8 &scale, uint8 &xScale, uint8 &yScale) const;
+
+ 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 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 moveIgor(int pos, int frame);
+
void scrollPalette(int startColor, int endColor);
void setPaletteColor(uint8 index, uint8 r, uint8 g, uint8 b);
@@ -190,6 +331,10 @@ private:
uint8 *loadData(int num, uint8 *dst = 0, int *size = 0);
void loadRoomData(int pal, int img, int box, int msk, int txt);
+ void setRoomWalkBounds(int x1, int y1, int x2, int y2);
+
+ void buildWalkPath(int srcX, int srcY, int dstX, int dstY);
+
public:
Graphics::Screen *_screen = nullptr;
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 421cf92feb2..0e139e50cfa 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -29,6 +29,13 @@
#define FRM_IgorDirLeft 320
#define FRM_IgorHead 321
+
+#define TXT_SpringBridge 245
+#define IMG_SpringBridge 246
+#define PAL_SpringBridge 247
+#define MSK_SpringBridge 248
+#define BOX_SpringBridge 249
+
#define TXT_SpringRock 270
#define IMG_SpringRock 271
#define PAL_SpringRock 272
diff --git a/engines/igor/static.cpp b/engines/igor/static.cpp
index 862f0867ee9..ad10a588839 100644
--- a/engines/igor/static.cpp
+++ b/engines/igor/static.cpp
@@ -35,5 +35,171 @@ const uint8 IgorEngine::PAL_IGOR_2[] = {
0x17, 0x33, 0x33, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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 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 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
+};
+
} // End of namespace Igor
Commit: aad783fb206da9ccfe5cb753d93ab9ab86f4ccda
https://github.com/scummvm/scummvm/commit/aad783fb206da9ccfe5cb753d93ab9ab86f4ccda
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:41+01:00
Commit Message:
IGOR: Show cursor
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/static.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index d8706aae390..e141867edb2 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -56,6 +56,13 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_inventoryImagesBuffer = (uint8 *)malloc(48000);
_verbsPanelBuffer = (uint8 *)malloc(3840);
+ DebugMan.addDebugChannel(kDebugEngine, "Engine", "Engine debug level");
+ DebugMan.addDebugChannel(kDebugResource, "Resource", "Resource debug level");
+ DebugMan.addDebugChannel(kDebugScreen, "Screen", "Screen debug level");
+ DebugMan.addDebugChannel(kDebugWalk, "Walk", "Walk debug level");
+ DebugMan.addDebugChannel(kDebugGame, "Game", "Game debug level");
+
+
{ // hardcoded now
_game.ovlFileName = "igor.exe";
_game.sfxFileName = "igor.dat";
@@ -86,7 +93,7 @@ IgorEngine::~IgorEngine() {
free(_inventoryImagesBuffer);
free(_verbsPanelBuffer);
- // Common::clearAllDebugChannels();
+ // DebugMan.clearAllDebugChannels();
// delete _midiPlayer;
delete _screen;
@@ -156,7 +163,7 @@ void IgorEngine::restart() {
// memset(_inputVars, 0, sizeof(_inputVars));
// _scrollInventory = false;
// _roomCursorOn = true;
- // _currentCursor = 0;
+ _currentCursor = 0;
// _dialogueCursorOn = true;
// _updateDialogue = 0;
_updateRoomBackground = 0;
@@ -291,7 +298,7 @@ ResourceEntry *IgorEngine::findData(int id) {
}
uint8 *IgorEngine::loadData(int id, uint8 *dst, int *size) {
- // debugC(9, kDebugResource, "loadData() id %d", id);
+ debugC(9, kDebugResource, "loadData() id %d", id);
ResourceEntry *re = findData(id);
if (!dst) {
dst = (uint8 *)malloc(re->size);
@@ -400,19 +407,19 @@ void IgorEngine::buildWalkPath(int srcX, int srcY, int dstX, int dstY) {
_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);
+ 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);
+ // 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);
+ // 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;
@@ -421,7 +428,7 @@ void IgorEngine::buildWalkPath(int srcX, int srcY, int dstX, int dstY) {
buildWalkPathArea(srcX, srcY, dstX, dstY);
--_walkDataLastIndex;
}
- // debugC(9, kDebugWalk, "buildWalkPath() end _walkDataLastIndex %d", _walkDataLastIndex);
+ debugC(9, kDebugWalk, "buildWalkPath() end _walkDataLastIndex %d", _walkDataLastIndex);
}
void IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND() {
@@ -463,11 +470,11 @@ void IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND() {
}
void IgorEngine::enterPartLoop() {
- CursorMan.showMouse(true);
- // if (!_gameState.dialogueTextRunning) {
- // showCursor();
- // }
- // _gameState.igorMoving = false;
+ // CursorMan.showMouse(true);
+ if (!_gameState.dialogueTextRunning) {
+ showCursor();
+ }
+ _gameState.igorMoving = false;
// if (_game.version == kIdEngDemo110) {
// CHECK_FOR_END_OF_DEMO();
// }
@@ -518,7 +525,7 @@ void IgorEngine::lookupScale(int curX, int curY, uint8 &scale, uint8 &xScale, ui
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);
+ 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;
@@ -644,11 +651,33 @@ void IgorEngine::moveIgor(int pos, int frame) {
}
}
+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() {
+ CursorMan.showMouse(true);
+}
+
+void IgorEngine::hideCursor() {
+ CursorMan.showMouse(false);
+
+}
+
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);
+ 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) {
@@ -676,7 +705,7 @@ static int16 truncReal(float f) {
int IgorEngine::getVerticalStepsCount(int minX, int minY, int maxX, int maxY) {
- // debugC(9, kDebugWalk, "getVerticalStepsCount() %d %d %d %d", minX, minY, maxX, 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];
@@ -702,7 +731,7 @@ int IgorEngine::getHorizontalStepsCount(int minX, int minY, int maxX, int 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);
+ 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;
@@ -1460,7 +1489,7 @@ void IgorEngine::scrollPalette(int startColor, int endColor) {
}
void IgorEngine::setPaletteRange(int startColor, int endColor) {
- // debugC(9, kDebugScreen, "setPaletteRange(%d, %d)", startColor, 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]);
@@ -1489,7 +1518,7 @@ void IgorEngine::updatePalette(int count) {
}
void IgorEngine::fadeInPalette(int count) {
- // debugC(9, kDebugScreen, "fadeInPalette(%d)", count);
+ debugC(9, kDebugScreen, "fadeInPalette(%d)", count);
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
int m = 66;
do {
@@ -1510,7 +1539,7 @@ void IgorEngine::fadeInPalette(int count) {
}
void IgorEngine::fadeOutPalette(int count) {
- // debugC(9, kDebugScreen, "fadeOutPalette(%d)", count);
+ debugC(9, kDebugScreen, "fadeOutPalette(%d)", count);
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
memcpy(_paletteBuffer, _currentPalette, 768);
int m = 0;
@@ -1536,7 +1565,7 @@ void IgorEngine::fadeOutPalette(int count) {
void IgorEngine::waitForTimer(int ticks) {
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
_system->updateScreen();
- debug("Screen updated!");
+
uint32 endTicks = (ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay;
do {
Common::Event ev;
@@ -1581,17 +1610,17 @@ void IgorEngine::waitForTimer(int ticks) {
if (_system->getMillis() >= endTicks) {
break;
}
- debug("Waiting for timer: %d ms left", endTicks - _system->getMillis());
+
} while (true);
_nextTimer = _system->getMillis() + kTimerTicksCount * 1000 / kTickDelay;
if (ticks != -1) {
return;
}
_gameTicks += kTimerTicksCount;
- // if ((_gameTicks & 31) == 0) {
- // setCursor(_currentCursor);
- // _currentCursor = (_currentCursor + 1) & 3;
- // }
+ if ((_gameTicks & 31) == 0) {
+ setCursor(_currentCursor);
+ _currentCursor = (_currentCursor + 1) & 3;
+ }
// if (_game.flags & kFlagFloppy) {
// updateMusic();
// }
@@ -1679,7 +1708,7 @@ void IgorEngine::decodeRoomStrings(const uint8 *p, bool skipObjectNames) {
decodeRoomString(p, _roomObjectNames[index], len);
p += len;
_roomObjectNames[index][len] = '\0';
- // debugC(9, kDebugResource, "decodeRoomStrings() _roomObjectNames[%d] '%s'", index, _roomObjectNames[index]);
+ debugC(9, kDebugResource, "decodeRoomStrings() _roomObjectNames[%d] '%s'", index, _roomObjectNames[index]);
}
code = *p++;
}
@@ -1698,14 +1727,14 @@ void IgorEngine::decodeRoomStrings(const uint8 *p, bool skipObjectNames) {
decodeRoomString(p, _globalDialogueTexts[index], len);
p += len;
_globalDialogueTexts[index][len] = '\0';
- // debugC(9, kDebugResource, "decodeRoomStrings() _globalDialogueTexts[%d] '%s'", index, _globalDialogueTexts[index]);
+ debugC(9, kDebugResource, "decodeRoomStrings() _globalDialogueTexts[%d] '%s'", index, _globalDialogueTexts[index]);
}
code = *p++;
}
}
void IgorEngine::decodeRoomText(const uint8 *p) {
- // debugC(9, kDebugResource, "decodeRoomText()");
+ debugC(9, kDebugResource, "decodeRoomText()");
memcpy(_walkXScaleRoom, p, 320);
p += 320;
memcpy(_walkYScaleRoom, p, 432);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 1ae29216d59..f78a4da5057 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -45,6 +45,14 @@ namespace Igor {
struct IgorGameDescription;
+enum {
+ kDebugEngine = 400 << 1,
+ kDebugResource = 400 << 2,
+ kDebugScreen = 400 << 3,
+ kDebugWalk = 400 << 4,
+ kDebugGame = 400 << 5
+};
+
enum {
kFlagDemo = 1 << 0,
kFlagFloppy = 1 << 1,
@@ -236,7 +244,7 @@ private:
uint32 _nextTimer;
DetectedGameVersion _game;
-
+ int _currentCursor;
char _globalDialogueTexts[300][MAX_DIALOGUE_TEXT_LENGTH];
char _roomObjectNames[20][MAX_OBJECT_NAME_LENGTH];
@@ -274,6 +282,8 @@ private:
static const uint8 _walkWidthScaleTable[];
static const uint8 _walkScaleTable[];
static const float _walkScaleSpeedTable[];
+ static const uint8 _mouseCursorMask[];
+ static const uint8 _mouseCursorData[];
void restart();
void setupDefaultPalette();
@@ -308,6 +318,9 @@ private:
void moveIgor(int pos, int frame);
+ void setCursor(int num);
+ void showCursor();
+ void hideCursor();
void scrollPalette(int startColor, int endColor);
void setPaletteColor(uint8 index, uint8 r, uint8 g, uint8 b);
diff --git a/engines/igor/static.cpp b/engines/igor/static.cpp
index ad10a588839..e62fb3216e7 100644
--- a/engines/igor/static.cpp
+++ b/engines/igor/static.cpp
@@ -201,5 +201,19 @@ const float IgorEngine::_walkScaleSpeedTable[] = {
5.0000f, 5.2500f, 5.5000f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f
};
+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
+};
} // End of namespace Igor
Commit: 6bff495532d804f7a1d497168dd6135b8e513702
https://github.com/scummvm/scummvm/commit/6bff495532d804f7a1d497168dd6135b8e513702
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:42+01:00
Commit Message:
IGOR: Reading main texts
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/resource_ids.h
engines/igor/static.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index e141867edb2..c8c61adfddd 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -66,6 +66,8 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
{ // hardcoded now
_game.ovlFileName = "igor.exe";
_game.sfxFileName = "igor.dat";
+ _game.version = kIdSpaCD;
+ _game.language = Common::ES_ESP; // Assuming 0 represents the default language
_currentPart = 50;
}
@@ -113,7 +115,7 @@ void IgorEngine::restart() {
memset(&_gameState, 0, sizeof(_gameState));
_nextTimer = 0;
// _fastMode = false;
- // _language = 0;
+ _language = 0;
memset(_walkData, 0, sizeof(_walkData));
_walkCurrentPos = 0;
@@ -122,12 +124,11 @@ void IgorEngine::restart() {
_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;
+ memset(&_currentAction, 0, sizeof(_currentAction));
+ _currentAction.verb = kVerbWalk;
+ _actionCode = 0;
+ _actionWalkPoint = 0;
+ memset(_inputVars, 0, sizeof(_inputVars));
// _talkDelay = _talkSpeechCounter = _talkDelayCounter = 0;
// memset(_dialogueTextsTable, 0, sizeof(_dialogueTextsTable));
@@ -144,25 +145,22 @@ void IgorEngine::restart() {
// 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(_verbPrepositions, 0, sizeof(_verbPrepositions));
+ memset(_globalObjectNames, 0, sizeof(_globalObjectNames));
memset(_globalDialogueTexts, 0, sizeof(_globalDialogueTexts));
- // memset(_verbsName, 0, sizeof(_verbsName));
+ memset(_verbsName, 0, sizeof(_verbsName));
memset(_roomObjectNames, 0, sizeof(_roomObjectNames));
_igorTempFrames = _facingIgorFrames[0] + 10500;
memset(_roomObjectAreasTable, 0, sizeof(_roomObjectAreasTable));
- // memset(_roomActionsTable, 0, sizeof(_roomActionsTable));
+ 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;
+ _roomCursorOn = true;
_currentCursor = 0;
// _dialogueCursorOn = true;
// _updateDialogue = 0;
@@ -273,7 +271,73 @@ void IgorEngine::readTableFile() {
error("Unable to read 'IGOR.TBL'");
}
+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);
+}
+
+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::loadIgorFrames() {
@@ -665,11 +729,15 @@ void IgorEngine::setCursor(int num) {
}
void IgorEngine::showCursor() {
- CursorMan.showMouse(true);
+ debugC(9, kDebugEngine, "showCursor()");
+ _roomCursorOn = true;
+ CursorMan.showMouse(_roomCursorOn);
}
void IgorEngine::hideCursor() {
- CursorMan.showMouse(false);
+ debugC(9, kDebugEngine, "hideCursor()");
+ _roomCursorOn = false;
+ CursorMan.showMouse(_roomCursorOn);
}
@@ -1507,7 +1575,7 @@ void IgorEngine::setPaletteColor(uint8 index, uint8 r, uint8 g, uint8 b) {
void IgorEngine::updatePalette(int count) {
assert(count <= 768);
- uint8 pal[1024];
+ uint8 pal[768];
for (int j = 0, i = 0; i < count; ++i) {
pal[j++] = (_currentPalette[i] << 2);// | (_currentPalette[i] >> 4);
// if (((i + 1) % 3) == 0) {
@@ -1572,36 +1640,37 @@ void IgorEngine::waitForTimer(int ticks) {
while (_eventMan->pollEvent(ev)) {
switch (ev.type) {
case Common::EVENT_QUIT:
- // _inputVars[kInputEscape] = 1;
+ _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;
+ 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;
}
@@ -1629,6 +1698,201 @@ void IgorEngine::waitForTimer(int ticks) {
}
}
+
+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[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;
+ }
+
+ if (_inputVars[kInputCursorYPos] >= 170 && _inputVars[kInputCursorYPos] <= 199) {
+
+ } 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;
+ }
+
+}
+
+void IgorEngine::formatActionSentence(uint8 color) {
+ char actionSentence[512];
+ if (_currentAction.verb == kVerbWalk && _inputVars[kInputCursorYPos] > 143) {
+ _currentAction.object1Num = 0;
+ }
+
+ Common::strlcpy(actionSentence, _verbsName[_currentAction.verb], sizeof(actionSentence));
+ if (_currentAction.object1Num != 0) {
+ if (_currentAction.object1Type == kObjectTypeInventory) {
+ Common::strlcat(actionSentence, _globalObjectNames[_currentAction.object1Num], sizeof(actionSentence));
+ } else {
+ Common::strlcat(actionSentence, _roomObjectNames[_currentAction.object1Num], sizeof(actionSentence));
+ }
+ if (_currentAction.verbType != 0) {
+ Common::strlcat(actionSentence, _verbPrepositions[_currentAction.verbType], sizeof(actionSentence));
+ if (_currentAction.object2Num != 0) {
+ if (_currentAction.object2Type == kObjectTypeInventory) {
+ Common::strlcat(actionSentence, _globalObjectNames[_currentAction.object2Num], sizeof(actionSentence));
+ } else {
+ Common::strlcat(actionSentence, _roomObjectNames[_currentAction.object2Num], sizeof(actionSentence));
+ }
+ }
+ }
+ }
+ drawActionSentence(actionSentence, _sentenceColorIndex[color]);
+}
+
+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::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];
+ }
+ }
+}
+
+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::decodeRoomAreas(const uint8 *p, int count) {
for (int i = 0; i < count; ++i) {
RoomObjectArea *roa = &_roomObjectAreasTable[i];
@@ -1757,10 +2021,6 @@ void IgorEngine::PART_MAIN() {
}
}
-void IgorEngine::handleRoomInput() {
-
-}
-
void IgorEngine::handleRoomIgorWalk() {
if (_walkDataCurrentIndex > _walkDataLastIndex) {
_gameState.igorMoving = false;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index f78a4da5057..dec0f8b357e 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -95,6 +95,17 @@ enum {
kTalkModeTextOnly = 2
};
+enum InputVar {
+ kInputSkipDialogue = 0,
+ kInputCursorXPos,
+ kInputCursorYPos,
+ kInputClick,
+ kInputEscape,
+ kInputPause,
+ kInputOptions,
+ kInputVarCount
+};
+
struct RoomWalkBounds {
int x1, y1;
int x2, y2;
@@ -156,6 +167,69 @@ struct GameStateData {
uint8 musicSequenceIndex;
};
+struct Action {
+ uint8 verb;
+ uint8 object1Num;
+ uint8 object1Type;
+ uint8 verbType; // 1:use,2:give
+ uint8 object2Num;
+ uint8 object2Type;
+};
+
+
+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;
+};
+
+enum ObjectType {
+ kObjectTypeInventory = 1,
+ kObjectTypeRoom = 2
+};
+
+enum Verb {
+ kVerbWalk = 1,
+ kVerbTalk,
+ kVerbTake,
+ kVerbLook,
+ kVerbUse,
+ kVerbOpen,
+ kVerbClose,
+ kVerbGive
+};
+
+enum {
+ kIdEngDemo100,
+ kIdEngDemo110,
+ kIdEngFloppy,
+ kIdSpaFloppy,
+ kIdEngCD,
+ kIdSpaCD
+};
+
struct WalkData {
int16 x, y;
uint8 posNum;
@@ -243,16 +317,23 @@ private:
GameStateData _gameState;
uint32 _nextTimer;
+ int _language;
DetectedGameVersion _game;
int _currentCursor;
+ bool _roomCursorOn;
char _globalDialogueTexts[300][MAX_DIALOGUE_TEXT_LENGTH];
- char _roomObjectNames[20][MAX_OBJECT_NAME_LENGTH];
uint8 _walkXScaleRoom[320];
uint8 _walkYScaleRoom[144 * 3];
RoomObjectArea _roomObjectAreasTable[MAX_ROOM_OBJECT_AREAS];
+ uint8 _roomActionsTable[0x2000];
+ Action _currentAction;
+ uint8 _actionCode;
+ uint8 _actionWalkPoint;
+
+ int16 _inputVars[kInputVarCount];
WalkData _walkData[100];
uint8 _walkCurrentPos;
uint8 _walkDataLastIndex;
@@ -262,12 +343,21 @@ private:
int _walkToObjectPosX, _walkToObjectPosY;
int16 _currentPart;
+
+
+ char _verbPrepositions[3][7];
+ char _roomObjectNames[20][MAX_OBJECT_NAME_LENGTH];
+ char _globalObjectNames[35][MAX_OBJECT_NAME_LENGTH];
+ char _verbsName[9][MAX_VERB_NAME_LENGTH];
+
uint8 _currentPalette[768];
uint8 _paletteBuffer[768];
uint8 _igorPalette[48];
uint8 *_igorTempFrames;
RoomWalkBounds _roomWalkBounds;
+ RoomDataOffsets _roomDataOffsets;
+ UpdateRoomBackgroundProc _updateRoomBackground;
int _gameTicks;
int _resourceEntriesCount;
@@ -277,8 +367,10 @@ private:
ResourceEntry *_resourceEntries;
Common::Array<StringEntry> _stringEntries;
- UpdateRoomBackgroundProc _updateRoomBackground;
-
+ static const uint8 _sentenceColorIndex[];
+ static const uint8 _fontCharIndex[];
+ static const uint8 _fontCharWidth[];
+ static const uint32 _fontData[];
static const uint8 _walkWidthScaleTable[];
static const uint8 _walkScaleTable[];
static const float _walkScaleSpeedTable[];
@@ -290,6 +382,7 @@ private:
void readTableFile();
void loadMainTexts();
+ const char *getString(int id) const;
void loadIgorFrames();
void PART_MAIN();
@@ -298,6 +391,11 @@ private:
void PART_05_UPDATE_ROOM_BACKGROUND();
void handleRoomInput();
+ void formatActionSentence(uint8 color);
+ int getStringWidth(const char *s) const;
+ void drawActionSentence(const char *sentence, uint8 color);
+ void drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2, int color3);
+ void drawChar(uint8 *dst, int chr, int x, int y, int color1, int color2, int color3);
void handleRoomIgorWalk();
void enterPartLoop();
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 0e139e50cfa..0676ce185f3 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -23,11 +23,6 @@
#define IGOR_RESOURCE_IDS
-#define FRM_IgorDirBack 317
-#define FRM_IgorDirRight 318
-#define FRM_IgorDirFront 319
-#define FRM_IgorDirLeft 320
-#define FRM_IgorHead 321
#define TXT_SpringBridge 245
@@ -42,4 +37,20 @@
#define MSK_SpringRock 273
#define BOX_SpringRock 274
+#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 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
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static.cpp b/engines/igor/static.cpp
index e62fb3216e7..b874755222c 100644
--- a/engines/igor/static.cpp
+++ b/engines/igor/static.cpp
@@ -216,4 +216,143 @@ const uint8 IgorEngine::_mouseCursorData[] = {
0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05
};
+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 uint8 IgorEngine::_sentenceColorIndex[]= { 0xFD, 0xFB, 0xF1 };
+
+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
+};
+
} // End of namespace Igor
Commit: 703f7f3152ab47b7c399537ff7cf14b9805492bc
https://github.com/scummvm/scummvm/commit/703f7f3152ab47b7c399537ff7cf14b9805492bc
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:42+01:00
Commit Message:
IGOR: draw verb panel
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index c8c61adfddd..537a41dcdcf 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -194,6 +194,11 @@ Common::Error IgorEngine::run() {
readTableFile();
loadMainTexts();
loadIgorFrames();
+
+ drawVerbsPanel();
+ g_engine->_screen->markAllDirty();
+ g_engine->_screen->update();
+
_gameState.talkMode = kTalkModeTextOnly;
_gameState.talkSpeed = 3;
@@ -285,6 +290,7 @@ static void decodeMainString(const uint8 *src, char *dst) {
void IgorEngine::loadMainTexts() {
loadData(IMG_VerbsPanel, _verbsPanelBuffer);
+ debugC(9, kDebugResource, "loadMainTexts()");
if (_game.version == kIdSpaCD) {
const struct {
int strId;
@@ -415,16 +421,12 @@ void IgorEngine::PART_05() {
//Enforce display of room
{
- // g_system->getPaletteManager()->setPalette(_paletteBuffer, 0, 256);
- // memcpy(_currentPalette, _paletteBuffer, 768);
- // updatePalette(768);
- // fadeInPalette(768);
-
memcpy(_screenVGA, _screenLayer1, 46080);
- fadeInPalette(768);
-
+ drawVerbsPanel();
+ fadeInPalette(720);
}
+
setRoomWalkBounds(0, 0, 319, 143);
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
@@ -720,8 +722,8 @@ void IgorEngine::setCursor(int num) {
memset(cursor, 0, 11 * 11);
const uint8 *mask = &_mouseCursorMask[num * 24];
for (int i = 0; i < 24; ++i) {
+ const int offset = ((int8)_mouseCursorData[i + 24] + 5) * 11 + ((int8)_mouseCursorData[i] + 5);
if (mask[i]) {
- const int offset = ((int8)_mouseCursorData[i + 24] + 5) * 11 + ((int8)_mouseCursorData[i] + 5);
cursor[offset] = 255;
}
}
@@ -1698,6 +1700,28 @@ void IgorEngine::waitForTimer(int ticks) {
}
}
+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::handleRoomInput() {
if (_inputVars[kInputPause]) {
@@ -1720,6 +1744,43 @@ void IgorEngine::handleRoomInput() {
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) {
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index dec0f8b357e..0c3c95d73ce 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -398,6 +398,12 @@ private:
void drawChar(uint8 *dst, int chr, int x, int y, int color1, int color2, int color3);
void handleRoomIgorWalk();
+ void drawVerbsPanel();
+ void redrawVerb(uint8 verb, bool highlight);
+ int getVerbUnderCursor(int x) const { return ((x % 46) < 44) ? (kVerbTalk + x / 46) : 0; }
+
+
+
void enterPartLoop();
void leavePartLoop();
void runPartLoop();
Commit: 08e869ffa2eda7b145f6411607c33ef432c1aa06
https://github.com/scummvm/scummvm/commit/08e869ffa2eda7b145f6411607c33ef432c1aa06
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:42+01:00
Commit Message:
IGOR: Intro logos
Changed paths:
A engines/igor/part_85.cpp
A engines/igor/part_90.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 537a41dcdcf..fd3490f71a0 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -68,7 +68,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.sfxFileName = "igor.dat";
_game.version = kIdSpaCD;
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- _currentPart = 50;
+ _currentPart = 900;
}
// if (_game.flags & kFlagFloppy) {
@@ -288,6 +288,23 @@ static void decodeMainString(const uint8 *src, char *dst) {
dst[sz] = '\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;
+ }
+}
+
void IgorEngine::loadMainTexts() {
loadData(IMG_VerbsPanel, _verbsPanelBuffer);
debugC(9, kDebugResource, "loadMainTexts()");
@@ -2071,9 +2088,19 @@ void IgorEngine::PART_MAIN() {
while (!g_engine->shouldQuit() && !_eventQuitGame) {
switch (_currentPart) {
- case 50:
+ case 61:
PART_05(); // SpringRock
break;
+ case 850:
+ PART_85();
+ break;
+ case 900:
+ case 901:
+ case 902:
+ case 903:
+ case 904:
+ PART_90();
+ break;
default:
error("Unknown or unhandled room part %d", _currentPart);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 0c3c95d73ce..57caacda494 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -381,12 +381,15 @@ private:
void setupDefaultPalette();
void readTableFile();
+ void copyArea(uint8 *dst, int dstOffset, int dstPitch, const uint8 *src, int srcPitch, int w, int h, bool transparent);
void loadMainTexts();
const char *getString(int id) const;
void loadIgorFrames();
void PART_MAIN();
void PART_05();
+ void PART_85();
+ void PART_90();
void PART_05_UPDATE_ROOM_BACKGROUND();
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index bf57917a6ee..97c1eb6748b 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -4,7 +4,9 @@ MODULE_OBJS = \
igor.o \
console.o \
metaengine.o \
- static.o
+ static.o \
+ part_85.o \
+ part_90.o
# This module can be built as a plugin
ifeq ($(ENABLE_IGOR), DYNAMIC_PLUGIN)
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
new file mode 100644
index 00000000000..4dccb549f06
--- /dev/null
+++ b/engines/igor/part_85.cpp
@@ -0,0 +1,49 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+void IgorEngine::PART_85() {
+ loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
+ memcpy(_screenLayer2, _screenLayer1, 46080);
+ loadRoomData(PAL_SpringBridgeIntro, IMG_SpringBridgeIntro, 0, 0, TXT_SpringBridgeIntro);
+
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ fadeInPalette(768);
+ if (_inputVars[kInputEscape])
+ goto PART_85_EXIT;
+
+PART_85_EXIT:
+ // stopSound();
+ _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;
+ _updateRoomBackground = 0;
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_90.cpp b/engines/igor/part_90.cpp
new file mode 100644
index 00000000000..bfd1153f544
--- /dev/null
+++ b/engines/igor/part_90.cpp
@@ -0,0 +1,73 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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;
+ }
+ }
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 0676ce185f3..5a2816bc1cb 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -22,21 +22,322 @@
#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
@@ -44,7 +345,84 @@
#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
@@ -52,5 +430,45 @@
#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 // IGOR_RESOURCE_IDS
Commit: c73da9dcece676b790bc3e5541c9edb6e1494fbc
https://github.com/scummvm/scummvm/commit/c73da9dcece676b790bc3e5541c9edb6e1494fbc
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:43+01:00
Commit Message:
IGOR: Refactor into multiple files
Changed paths:
A engines/igor/input.cpp
A engines/igor/palette.cpp
A engines/igor/resource.cpp
A engines/igor/room.cpp
A engines/igor/static_cursor.cpp
A engines/igor/static_font.cpp
A engines/igor/static_walk.cpp
A engines/igor/text.cpp
A engines/igor/walk.cpp
R engines/igor/static.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index fd3490f71a0..542fd9da933 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -22,13 +22,9 @@
#include "igor/igor.h"
#include "common/config-manager.h"
#include "common/debug-channels.h"
-#include "common/events.h"
#include "common/scummsys.h"
#include "common/system.h"
#include "engines/util.h"
-#include "graphics/cursorman.h"
-#include "graphics/framelimiter.h"
-#include "graphics/paletteman.h"
#include "igor/console.h"
#include "igor/detection.h"
@@ -215,219 +211,6 @@ Common::Error IgorEngine::run() {
return Common::kNoError;
}
-
-void IgorEngine::setupDefaultPalette() {
- memset(_currentPalette, 0, 255 * 3);
- memset(&_currentPalette[255 * 3], 63, 3);
- updatePalette(768);
- // g_system->getPaletteManager()->setPalette(_currentPalette, 0, 256);
-}
-
-void IgorEngine::readTableFile() {
- Common::File tblFile;
- uint32 stringsEntriesOffset = 0, resourcesEntriesOffset = 0, soundEntriesOffset = 0;
- if (tblFile.open("IGOR.TBL") && tblFile.readUint32BE() == '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'");
-}
-
-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::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;
- }
-}
-
-void IgorEngine::loadMainTexts() {
- loadData(IMG_VerbsPanel, _verbsPanelBuffer);
- debugC(9, kDebugResource, "loadMainTexts()");
- 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);
-}
-
-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::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);
-}
-
-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;
-}
-
-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::PART_05() {
_gameState.enableLight = 1;
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
@@ -476,44 +259,6 @@ void IgorEngine::PART_05() {
}
}
-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::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::PART_05_UPDATE_ROOM_BACKGROUND() {
if (compareGameTick(61)) {
scrollPalette(160, 167);
@@ -591,1499 +336,6 @@ void IgorEngine::runPartLoop() {
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::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::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::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) {
- const int offset = ((int8)_mouseCursorData[i + 24] + 5) * 11 + ((int8)_mouseCursorData[i] + 5);
- if (mask[i]) {
- 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::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::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::scrollPalette(int startColor, int 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::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::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;
- g_system->getPaletteManager()->setPalette(pal, index, 1);
-}
-
-void IgorEngine::updatePalette(int count) {
- assert(count <= 768);
- uint8 pal[768];
- 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;
- // }
- }
- g_system->getPaletteManager()->setPalette(pal, 0, count / 3);
-}
-
-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::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 (true);
- _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::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::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;
- }
-
- if (_inputVars[kInputCursorYPos] >= 170 && _inputVars[kInputCursorYPos] <= 199) {
-
- } 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;
- }
-
-}
-
-void IgorEngine::formatActionSentence(uint8 color) {
- char actionSentence[512];
- if (_currentAction.verb == kVerbWalk && _inputVars[kInputCursorYPos] > 143) {
- _currentAction.object1Num = 0;
- }
-
- Common::strlcpy(actionSentence, _verbsName[_currentAction.verb], sizeof(actionSentence));
- if (_currentAction.object1Num != 0) {
- if (_currentAction.object1Type == kObjectTypeInventory) {
- Common::strlcat(actionSentence, _globalObjectNames[_currentAction.object1Num], sizeof(actionSentence));
- } else {
- Common::strlcat(actionSentence, _roomObjectNames[_currentAction.object1Num], sizeof(actionSentence));
- }
- if (_currentAction.verbType != 0) {
- Common::strlcat(actionSentence, _verbPrepositions[_currentAction.verbType], sizeof(actionSentence));
- if (_currentAction.object2Num != 0) {
- if (_currentAction.object2Type == kObjectTypeInventory) {
- Common::strlcat(actionSentence, _globalObjectNames[_currentAction.object2Num], sizeof(actionSentence));
- } else {
- Common::strlcat(actionSentence, _roomObjectNames[_currentAction.object2Num], sizeof(actionSentence));
- }
- }
- }
- }
- drawActionSentence(actionSentence, _sentenceColorIndex[color]);
-}
-
-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::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];
- }
- }
-}
-
-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::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;
- }
-}
-
-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::PART_MAIN() {
while (!g_engine->shouldQuit() && !_eventQuitGame) {
switch (_currentPart) {
@@ -2109,25 +361,6 @@ void IgorEngine::PART_MAIN() {
}
}
-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;
- }
-}
-
Common::Error IgorEngine::syncGame(Common::Serializer &s) {
// The Serializer has methods isLoading() and isSaving()
// if you need to specific steps; for example setting
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 57caacda494..0f0b329a965 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -367,17 +367,8 @@ private:
ResourceEntry *_resourceEntries;
Common::Array<StringEntry> _stringEntries;
- static const uint8 _sentenceColorIndex[];
- static const uint8 _fontCharIndex[];
- static const uint8 _fontCharWidth[];
- static const uint32 _fontData[];
- static const uint8 _walkWidthScaleTable[];
- static const uint8 _walkScaleTable[];
- static const float _walkScaleSpeedTable[];
- static const uint8 _mouseCursorMask[];
- static const uint8 _mouseCursorData[];
-
void restart();
+
void setupDefaultPalette();
void readTableFile();
@@ -405,8 +396,6 @@ private:
void redrawVerb(uint8 verb, bool highlight);
int getVerbUnderCursor(int x) const { return ((x % 46) < 44) ? (kVerbTalk + x / 46) : 0; }
-
-
void enterPartLoop();
void leavePartLoop();
void runPartLoop();
@@ -506,15 +495,23 @@ public:
protected:
// Engine APIs
Common::Error run() override;
- static const uint8 PAL_48_1[];
- static const uint8 PAL_96_1[];
- static const uint8 PAL_IGOR_1[];
- static const uint8 PAL_IGOR_2[];
};
extern IgorEngine *g_engine;
#define SHOULD_QUIT ::Igor::g_engine->shouldQuit()
+// Static data tables (defined in static_font.cpp, static_walk.cpp, static_cursor.cpp)
+extern const uint8 _fontCharIndex[];
+extern const uint8 _fontCharWidth[];
+extern const uint32 _fontData[];
+extern const uint8 _sentenceColorIndex[];
+extern const uint8 _walkWidthScaleTable[];
+extern const uint8 _walkScaleTable[];
+extern const float _walkScaleSpeedTable[];
+extern const uint8 _mouseCursorMask[];
+extern const uint8 _mouseCursorData[];
+extern const uint8 PAL_IGOR_1[];
+
} // End of namespace Igor
#endif // IGOR_H
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
new file mode 100644
index 00000000000..72681b4cb37
--- /dev/null
+++ b/engines/igor/input.cpp
@@ -0,0 +1,314 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+#include "common/debug-channels.h"
+#include "common/events.h"
+#include "common/system.h"
+#include "graphics/cursorman.h"
+
+namespace Igor {
+
+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 (true);
+ _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::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) {
+ const int offset = ((int8)_mouseCursorData[i + 24] + 5) * 11 + ((int8)_mouseCursorData[i] + 5);
+ if (mask[i]) {
+ 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::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::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;
+ }
+
+ if (_inputVars[kInputCursorYPos] >= 170 && _inputVars[kInputCursorYPos] <= 199) {
+
+ } 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;
+ }
+
+}
+
+void IgorEngine::formatActionSentence(uint8 color) {
+ char actionSentence[512];
+ if (_currentAction.verb == kVerbWalk && _inputVars[kInputCursorYPos] > 143) {
+ _currentAction.object1Num = 0;
+ }
+
+ Common::strlcpy(actionSentence, _verbsName[_currentAction.verb], sizeof(actionSentence));
+ if (_currentAction.object1Num != 0) {
+ if (_currentAction.object1Type == kObjectTypeInventory) {
+ Common::strlcat(actionSentence, _globalObjectNames[_currentAction.object1Num], sizeof(actionSentence));
+ } else {
+ Common::strlcat(actionSentence, _roomObjectNames[_currentAction.object1Num], sizeof(actionSentence));
+ }
+ if (_currentAction.verbType != 0) {
+ Common::strlcat(actionSentence, _verbPrepositions[_currentAction.verbType], sizeof(actionSentence));
+ if (_currentAction.object2Num != 0) {
+ if (_currentAction.object2Type == kObjectTypeInventory) {
+ Common::strlcat(actionSentence, _globalObjectNames[_currentAction.object2Num], sizeof(actionSentence));
+ } else {
+ Common::strlcat(actionSentence, _roomObjectNames[_currentAction.object2Num], sizeof(actionSentence));
+ }
+ }
+ }
+ }
+ drawActionSentence(actionSentence, _sentenceColorIndex[color]);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 97c1eb6748b..0a681f8a38e 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -4,7 +4,15 @@ MODULE_OBJS = \
igor.o \
console.o \
metaengine.o \
- static.o \
+ walk.o \
+ palette.o \
+ text.o \
+ room.o \
+ resource.o \
+ input.o \
+ static_font.o \
+ static_walk.o \
+ static_cursor.o \
part_85.o \
part_90.o
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
new file mode 100644
index 00000000000..6a0782e1bcd
--- /dev/null
+++ b/engines/igor/palette.cpp
@@ -0,0 +1,117 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+#include "common/debug-channels.h"
+#include "common/system.h"
+#include "graphics/paletteman.h"
+
+namespace Igor {
+
+void IgorEngine::setupDefaultPalette() {
+ memset(_currentPalette, 0, 255 * 3);
+ memset(&_currentPalette[255 * 3], 63, 3);
+ updatePalette(768);
+ // g_system->getPaletteManager()->setPalette(_currentPalette, 0, 256);
+}
+
+void IgorEngine::scrollPalette(int startColor, int 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::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::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;
+ g_system->getPaletteManager()->setPalette(pal, index, 1);
+}
+
+void IgorEngine::updatePalette(int count) {
+ assert(count <= 768);
+ uint8 pal[768];
+ 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;
+ // }
+ }
+ g_system->getPaletteManager()->setPalette(pal, 0, count / 3);
+}
+
+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);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
new file mode 100644
index 00000000000..3fca0ba27c8
--- /dev/null
+++ b/engines/igor/resource.cpp
@@ -0,0 +1,188 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+#include "common/debug-channels.h"
+
+namespace Igor {
+
+void IgorEngine::readTableFile() {
+ Common::File tblFile;
+ uint32 stringsEntriesOffset = 0, resourcesEntriesOffset = 0, soundEntriesOffset = 0;
+ if (tblFile.open("IGOR.TBL") && tblFile.readUint32BE() == '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'");
+}
+
+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);
+ debugC(9, kDebugResource, "loadMainTexts()");
+ 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);
+}
+
+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::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);
+}
+
+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;
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/room.cpp b/engines/igor/room.cpp
new file mode 100644
index 00000000000..62b845a52a9
--- /dev/null
+++ b/engines/igor/room.cpp
@@ -0,0 +1,184 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+#include "common/debug-channels.h"
+
+namespace Igor {
+
+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;
+ }
+}
+
+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;
+ }
+}
+
+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::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);
+ }
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/static_cursor.cpp b/engines/igor/static_cursor.cpp
new file mode 100644
index 00000000000..21d7535a9e2
--- /dev/null
+++ b/engines/igor/static_cursor.cpp
@@ -0,0 +1,47 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+const uint8 _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 _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 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
+};
+
+} // End of namespace Igor
diff --git a/engines/igor/static_font.cpp b/engines/igor/static_font.cpp
new file mode 100644
index 00000000000..07046802045
--- /dev/null
+++ b/engines/igor/static_font.cpp
@@ -0,0 +1,165 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+const uint8 _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 _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 uint8 _sentenceColorIndex[] = { 0xFD, 0xFB, 0xF1 };
+
+const uint32 _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
+};
+
+} // End of namespace Igor
diff --git a/engines/igor/static.cpp b/engines/igor/static_walk.cpp
similarity index 52%
rename from engines/igor/static.cpp
rename to engines/igor/static_walk.cpp
index b874755222c..6a096abb963 100644
--- a/engines/igor/static.cpp
+++ b/engines/igor/static_walk.cpp
@@ -23,26 +23,14 @@
namespace Igor {
-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::_walkWidthScaleTable[] = {
+const uint8 _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 uint8 IgorEngine::_walkScaleTable[] = {
+const uint8 _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,
@@ -193,7 +181,7 @@ const uint8 IgorEngine::_walkScaleTable[] = {
0x03, 0x03, 0x03, 0x03
};
-const float IgorEngine::_walkScaleSpeedTable[] = {
+const float _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,
@@ -201,158 +189,4 @@ const float IgorEngine::_walkScaleSpeedTable[] = {
5.0000f, 5.2500f, 5.5000f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f
};
-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::_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 uint8 IgorEngine::_sentenceColorIndex[]= { 0xFD, 0xFB, 0xF1 };
-
-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
-};
-
} // End of namespace Igor
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
new file mode 100644
index 00000000000..eb1c1cde1a1
--- /dev/null
+++ b/engines/igor/text.cpp
@@ -0,0 +1,90 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+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::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];
+ }
+ }
+}
+
+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;
+ }
+ }
+ }
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
new file mode 100644
index 00000000000..93db53b9033
--- /dev/null
+++ b/engines/igor/walk.cpp
@@ -0,0 +1,1031 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+static int16 roundReal(float f) {
+ return (int16)(f + .5);
+}
+
+static int16 truncReal(float f) {
+ return (int16)f;
+}
+
+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::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);
+ // 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);
+}
+
+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::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::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::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);
+ }
+ }
+ }
+}
+
+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::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::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;
+ }
+}
+
+} // End of namespace Igor
Commit: e985af043b0db9fe1af523f7df4f3b4713957d90
https://github.com/scummvm/scummvm/commit/e985af043b0db9fe1af523f7df4f3b4713957d90
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:43+01:00
Commit Message:
IGOR: Turn font into a Graphics::Font
Changed paths:
A engines/igor/font.cpp
A engines/igor/font.h
R engines/igor/static_font.cpp
R engines/igor/text.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/module.mk
engines/igor/part_90.cpp
engines/igor/resource.cpp
diff --git a/engines/igor/static_font.cpp b/engines/igor/font.cpp
similarity index 86%
rename from engines/igor/static_font.cpp
rename to engines/igor/font.cpp
index 07046802045..fb1a2f68180 100644
--- a/engines/igor/static_font.cpp
+++ b/engines/igor/font.cpp
@@ -19,11 +19,14 @@
*
*/
-#include "igor/igor.h"
+#include "igor/font.h"
+#include "graphics/surface.h"
namespace Igor {
-const uint8 _fontCharIndex[] = {
+// Static font data
+
+const uint8 Font::_charIndex[] = {
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,
@@ -42,7 +45,7 @@ const uint8 _fontCharIndex[] = {
0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x5E, 0x63, 0x63, 0x63, 0x63, 0x63
};
-const uint8 _fontCharWidth[] = {
+const uint8 Font::_charWidth[] = {
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,
@@ -52,9 +55,7 @@ const uint8 _fontCharWidth[] = {
0x00, 0x00, 0x00, 0x00
};
-const uint8 _sentenceColorIndex[] = { 0xFD, 0xFB, 0xF1 };
-
-const uint32 _fontData[] = {
+const uint32 Font::_charData[] = {
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,
@@ -162,4 +163,98 @@ const uint32 _fontData[] = {
0x0355D6, 0x03FED6, 0x00A55A, 0x003FE8, 0x000000
};
+Font::Font() {
+}
+
+int Font::getCharWidth(uint32 chr) const {
+ if (chr == ' ') {
+ return 5;
+ }
+ if (chr >= 256) {
+ return 0;
+ }
+ int idx = _charIndex[chr];
+ if (idx == 99) {
+ return 0;
+ }
+ return _charWidth[idx];
+}
+
+void Font::drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const {
+ if (!dst || dst->format.bytesPerPixel != 1 || chr >= 256) {
+ return;
+ }
+ int glyph = _charIndex[chr];
+ if (glyph == 99) {
+ return;
+ }
+ for (int j = 0; j < kFontHeight; ++j) {
+ uint32 chrLineMask = _charData[glyph * kFontHeight + j];
+ for (int i = 0; i < kMaxCharWidth; ++i, chrLineMask >>= 2) {
+ if ((chrLineMask & 3) != 0 && x + i >= 0 && y + j >= 0 && x + i < dst->w && y + j < dst->h) {
+ ((byte *)dst->getBasePtr(x + i, y + j))[0] = (byte)color;
+ }
+ }
+ }
+}
+
+int Font::getStringWidth(const char *s) const {
+ int w = 0;
+ for (; *s; ++s) {
+ if (*s == ' ') {
+ w += 5;
+ } else {
+ int chr = _charIndex[(uint8)*s];
+ if (chr == 99) {
+ continue;
+ }
+ w += _charWidth[chr];
+ }
+ }
+ return w;
+}
+
+void Font::drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2, int color3) const {
+ for (; *s; ++s) {
+ if (*s == ' ') {
+ x += 5;
+ } else {
+ int chr = _charIndex[(uint8)*s];
+ if (chr == 99) {
+ continue;
+ }
+ if (x + _charWidth[chr] > 320) {
+ break;
+ }
+ drawChar(dst, chr, x, y, color1, color2, color3);
+ x += _charWidth[chr];
+ }
+ }
+}
+
+void Font::drawChar(uint8 *dst, int chr, int x, int y, int color1, int color2, int color3) const {
+ dst += y * 320 + x;
+ for (int j = 0; j < kFontHeight; ++j, dst += 320) {
+ uint32 chrLineMask = _charData[chr * kFontHeight + j];
+ for (int i = 0; i < kMaxCharWidth; ++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;
+ }
+ }
+ }
+}
+
} // End of namespace Igor
+
diff --git a/engines/igor/font.h b/engines/igor/font.h
new file mode 100644
index 00000000000..4fedb37e24e
--- /dev/null
+++ b/engines/igor/font.h
@@ -0,0 +1,55 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_FONT_H
+#define IGOR_FONT_H
+
+#include "graphics/font.h"
+
+namespace Igor {
+
+class Font : public Graphics::Font {
+public:
+ Font();
+
+ int getFontHeight() const override { return kFontHeight; }
+ int getMaxCharWidth() const override { return kMaxCharWidth; }
+ int getCharWidth(uint32 chr) const override;
+ void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const override;
+
+ // Engine-specific: raw buffer rendering with shadow/highlight colors
+ using Graphics::Font::drawChar;
+ void drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2, int color3) const;
+ void drawChar(uint8 *dst, int chr, int x, int y, int color1, int color2, int color3) const;
+ int getStringWidth(const char *s) const;
+
+private:
+ static const int kFontHeight = 11;
+ static const int kMaxCharWidth = 9;
+
+ static const uint8 _charIndex[];
+ static const uint8 _charWidth[];
+ static const uint32 _charData[];
+};
+
+} // End of namespace Igor
+
+#endif // IGOR_FONT_H
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 0f0b329a965..6b8f57c99ee 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -39,6 +39,7 @@
#include "audio/midiparser.h"
#include "igor/detection.h"
+#include "igor/font.h"
#include "igor/resource_ids.h"
namespace Igor {
@@ -364,6 +365,8 @@ private:
int _soundOffsetsCount;
uint32 *_soundOffsets;
+ Font _font;
+
ResourceEntry *_resourceEntries;
Common::Array<StringEntry> _stringEntries;
@@ -386,10 +389,7 @@ private:
void handleRoomInput();
void formatActionSentence(uint8 color);
- int getStringWidth(const char *s) const;
void drawActionSentence(const char *sentence, uint8 color);
- void drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2, int color3);
- void drawChar(uint8 *dst, int chr, int x, int y, int color1, int color2, int color3);
void handleRoomIgorWalk();
void drawVerbsPanel();
@@ -500,11 +500,7 @@ protected:
extern IgorEngine *g_engine;
#define SHOULD_QUIT ::Igor::g_engine->shouldQuit()
-// Static data tables (defined in static_font.cpp, static_walk.cpp, static_cursor.cpp)
-extern const uint8 _fontCharIndex[];
-extern const uint8 _fontCharWidth[];
-extern const uint32 _fontData[];
-extern const uint8 _sentenceColorIndex[];
+// Static data tables (defined in static_walk.cpp, static_cursor.cpp)
extern const uint8 _walkWidthScaleTable[];
extern const uint8 _walkScaleTable[];
extern const float _walkScaleSpeedTable[];
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 72681b4cb37..c102c15b2f7 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -27,6 +27,8 @@
namespace Igor {
+static const uint8 kSentenceColorIndex[] = { 0xFD, 0xFB, 0xF1 };
+
void IgorEngine::waitForTimer(int ticks) {
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
_system->updateScreen();
@@ -308,7 +310,15 @@ void IgorEngine::formatActionSentence(uint8 color) {
}
}
}
- drawActionSentence(actionSentence, _sentenceColorIndex[color]);
+ drawActionSentence(actionSentence, kSentenceColorIndex[color]);
+}
+
+void IgorEngine::drawActionSentence(const char *sentence, uint8 color) {
+ memset(_screenVGA + 144 * 320, 0, 11 * 320);
+ int w = _font.getStringWidth(sentence);
+ int x = (320 - w) / 2;
+ _font.drawString(_screenVGA, sentence, x, 144, color, 0, 0);
}
} // End of namespace Igor
+
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 0a681f8a38e..075bb1eb1ad 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -6,11 +6,10 @@ MODULE_OBJS = \
metaengine.o \
walk.o \
palette.o \
- text.o \
+ font.o \
room.o \
resource.o \
input.o \
- static_font.o \
static_walk.o \
static_cursor.o \
part_85.o \
diff --git a/engines/igor/part_90.cpp b/engines/igor/part_90.cpp
index bfd1153f544..c5c5945a13a 100644
--- a/engines/igor/part_90.cpp
+++ b/engines/igor/part_90.cpp
@@ -48,7 +48,7 @@ void IgorEngine::PART_90() {
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);
+ _font.drawString(_screenVGA, str, 2, 187, 0xF5, 0, 0);
break;
}
fadeInPalette(768);
@@ -71,3 +71,4 @@ void IgorEngine::PART_90() {
}
} // End of namespace Igor
+
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 3fca0ba27c8..7767840c7bf 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -107,8 +107,8 @@ void IgorEngine::loadMainTexts() {
};
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 x = verbTexts[i].x - _font.getStringWidth(s) / 2;
+ _font.drawString(_verbsPanelBuffer, s, x, 0, 0xF2, -1, 0);
}
}
int dataSize;
@@ -186,3 +186,4 @@ uint8 *IgorEngine::loadData(int id, uint8 *dst, int *size) {
}
} // End of namespace Igor
+
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
deleted file mode 100644
index eb1c1cde1a1..00000000000
--- a/engines/igor/text.cpp
+++ /dev/null
@@ -1,90 +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 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "igor/igor.h"
-
-namespace Igor {
-
-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::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];
- }
- }
-}
-
-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;
- }
- }
- }
-}
-
-} // End of namespace Igor
Commit: 411a70b957b0032ca3a94f9cf0f6d75f659346e5
https://github.com/scummvm/scummvm/commit/411a70b957b0032ca3a94f9cf0f6d75f659346e5
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:43+01:00
Commit Message:
IGOR: Load GUI palette
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/palette.cpp
engines/igor/part_85.cpp
engines/igor/static_cursor.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 542fd9da933..b229f2c1e08 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -214,7 +214,7 @@ Common::Error IgorEngine::run() {
void IgorEngine::PART_05() {
_gameState.enableLight = 1;
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
-
+ SET_PAL_240_48_1();
loadRoomData(PAL_SpringBridge, IMG_SpringBridge, BOX_SpringBridge, MSK_SpringBridge, TXT_SpringBridge);
_updateRoomBackground = &IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND;
@@ -248,15 +248,15 @@ void IgorEngine::PART_05() {
runPartLoop();
}
leavePartLoop();
- 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);
- }
+ // 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);
+ // }
}
void IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND() {
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 6b8f57c99ee..8bf227f55ad 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -422,6 +422,7 @@ private:
void setPaletteColor(uint8 index, uint8 r, uint8 g, uint8 b);
void setPaletteRange(int startColor, int endColor);
void updatePalette(int count);
+ void SET_PAL_240_48_1();
void fadeInPalette(int count);
void fadeOutPalette(int count);
@@ -507,6 +508,7 @@ extern const float _walkScaleSpeedTable[];
extern const uint8 _mouseCursorMask[];
extern const uint8 _mouseCursorData[];
extern const uint8 PAL_IGOR_1[];
+extern const uint8 PAL_48_1[];
} // End of namespace Igor
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index 6a0782e1bcd..5fea913a241 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -69,6 +69,18 @@ void IgorEngine::updatePalette(int count) {
g_system->getPaletteManager()->setPalette(pal, 0, count / 3);
}
+void IgorEngine::SET_PAL_240_48_1() {
+
+ uint8 pal[48];
+ for (int j = 0, i = 0; i < 48; ++i) {
+ pal[j++] = (PAL_48_1[i] << 2);// | (_currentPalette[i] >> 4);
+ // // if (((i + 1) % 3) == 0) {
+ // // pal[j++] = 0;
+ // // }
+ }
+ g_system->getPaletteManager()->setPalette(pal, 240, 16);
+}
+
void IgorEngine::fadeInPalette(int count) {
debugC(9, kDebugScreen, "fadeInPalette(%d)", count);
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index 4dccb549f06..dfcba8e65e8 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -23,6 +23,7 @@
namespace Igor {
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);
diff --git a/engines/igor/static_cursor.cpp b/engines/igor/static_cursor.cpp
index 21d7535a9e2..1e0f4c1ba99 100644
--- a/engines/igor/static_cursor.cpp
+++ b/engines/igor/static_cursor.cpp
@@ -44,4 +44,10 @@ const uint8 PAL_IGOR_1[] = {
0x17, 0x06, 0x0B, 0x14, 0x04, 0x08, 0x0E, 0x02, 0x05, 0x09, 0x01, 0x02, 0x04, 0x25, 0x05, 0x05
};
+const uint8 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
+};
+
} // End of namespace Igor
Commit: 97012120dfcf81bdac33b1eaf25764872f0abf99
https://github.com/scummvm/scummvm/commit/97012120dfcf81bdac33b1eaf25764872f0abf99
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:44+01:00
Commit Message:
IGOR: Animations
Changed paths:
A engines/igor/part_5.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_85.cpp
engines/igor/resource.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index b229f2c1e08..e66a69071e1 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -191,10 +191,6 @@ Common::Error IgorEngine::run() {
loadMainTexts();
loadIgorFrames();
- drawVerbsPanel();
- g_engine->_screen->markAllDirty();
- g_engine->_screen->update();
-
_gameState.talkMode = kTalkModeTextOnly;
_gameState.talkSpeed = 3;
@@ -211,91 +207,6 @@ Common::Error IgorEngine::run() {
return Common::kNoError;
}
-void IgorEngine::PART_05() {
- _gameState.enableLight = 1;
- loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
- SET_PAL_240_48_1();
-
- loadRoomData(PAL_SpringBridge, IMG_SpringBridge, BOX_SpringBridge, MSK_SpringBridge, TXT_SpringBridge);
- _updateRoomBackground = &IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND;
-
- //Enforce display of room
- {
- memcpy(_screenVGA, _screenLayer1, 46080);
- drawVerbsPanel();
- fadeInPalette(720);
- }
-
-
- setRoomWalkBounds(0, 0, 319, 143);
- _walkDataLastIndex = 1;
- _walkDataCurrentIndex = 1;
-
- {
- _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();
- }
-
- enterPartLoop();
- while (_currentPart >= 50 && _currentPart <= 52) {
- runPartLoop();
- }
- leavePartLoop();
- // 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);
- // }
-}
-
-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::enterPartLoop() {
// CursorMan.showMouse(true);
@@ -343,10 +254,11 @@ void IgorEngine::PART_MAIN() {
case 61:
PART_05(); // SpringRock
break;
- case 850:
+
+ case 850: // Intro cutscene
PART_85();
break;
- case 900:
+ case 900: // Logo slideshow
case 901:
case 902:
case 903:
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 8bf227f55ad..006ac3d3540 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -382,10 +382,14 @@ private:
void PART_MAIN();
void PART_05();
+ void PART_05_UPDATE_ROOM_BACKGROUND();
+
void PART_85();
+ void PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
+ void PART_85_UPDATE_ROOM_BACKGROUND();
+
void PART_90();
- void PART_05_UPDATE_ROOM_BACKGROUND();
void handleRoomInput();
void formatActionSentence(uint8 color);
@@ -439,7 +443,10 @@ private:
ResourceEntry *findData(int num);
uint8 *loadData(int num, uint8 *dst = 0, int *size = 0);
+ void loadAnimData(const int *anm, int loadOffset = 0);
void loadRoomData(int pal, int img, int box, int msk, int txt);
+ const uint8 *getAnimFrame(int baseOffset, int tableOffset, int frame);
+ void decodeAnimFrame(const uint8 *src, uint8 *dst, bool preserveText = false);
void setRoomWalkBounds(int x1, int y1, int x2, int y2);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 075bb1eb1ad..7e975e31244 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -12,6 +12,7 @@ MODULE_OBJS = \
input.o \
static_walk.o \
static_cursor.o \
+ part_5.o \
part_85.o \
part_90.o
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
new file mode 100644
index 00000000000..211dd1acb4a
--- /dev/null
+++ b/engines/igor/part_5.cpp
@@ -0,0 +1,111 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+void IgorEngine::PART_05() {
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
+ SET_PAL_240_48_1();
+
+ loadRoomData(PAL_SpringBridge, IMG_SpringBridge, BOX_SpringBridge, MSK_SpringBridge, TXT_SpringBridge);
+ _updateRoomBackground = &IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND;
+
+ //Enforce display of room
+ {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ drawVerbsPanel();
+ fadeInPalette(720);
+ }
+
+
+ setRoomWalkBounds(0, 0, 319, 143);
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+
+ {
+ _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();
+ }
+
+ enterPartLoop();
+ while (_currentPart >= 50 && _currentPart <= 52) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ // 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);
+ // }
+}
+
+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);
+ // }
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index dfcba8e65e8..9a14ba9f246 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -27,9 +27,18 @@ void IgorEngine::PART_85() {
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);
+
+ decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true);
+
fadeInPalette(768);
+ if (_inputVars[kInputEscape]) goto PART_85_EXIT;
+ // Laura touching her hair
+ PART_85_HELPER_1(0, 0x7481, 2, 7, 32);
+ if (_inputVars[kInputEscape]) goto PART_85_EXIT;
+
if (_inputVars[kInputEscape])
goto PART_85_EXIT;
@@ -47,4 +56,41 @@ PART_85_EXIT:
_updateRoomBackground = 0;
}
+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_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);
+ // }
+}
+
} // End of namespace Igor
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 7767840c7bf..b10ee974906 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -185,5 +185,63 @@ uint8 *IgorEngine::loadData(int id, uint8 *dst, int *size) {
return dst;
}
+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;
+ }
+}
+
+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;
+ }
+}
+
} // End of namespace Igor
Commit: 3e8cc7ab389fd02da1a1f918741aa94be46e048a
https://github.com/scummvm/scummvm/commit/3e8cc7ab389fd02da1a1f918741aa94be46e048a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:44+01:00
Commit Message:
IGOR: Display text
Changed paths:
A engines/igor/part_main.cpp
A engines/igor/text.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_85.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index e66a69071e1..1661369072e 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -64,7 +64,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.sfxFileName = "igor.dat";
_game.version = kIdSpaCD;
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- _currentPart = 900;
+ _currentPart = 850;
}
// if (_game.flags & kFlagFloppy) {
@@ -126,12 +126,12 @@ void IgorEngine::restart() {
_actionWalkPoint = 0;
memset(_inputVars, 0, sizeof(_inputVars));
- // _talkDelay = _talkSpeechCounter = _talkDelayCounter = 0;
- // memset(_dialogueTextsTable, 0, sizeof(_dialogueTextsTable));
- // _dialogueTextsStart = 0;
- // _dialogueTextsCount = 0;
- // _dialogueDirtyRectY = 0;
- // _dialogueDirtyRectSize = 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;
@@ -247,31 +247,6 @@ void IgorEngine::runPartLoop() {
waitForTimer();
}
-void IgorEngine::PART_MAIN() {
- while (!g_engine->shouldQuit() && !_eventQuitGame) {
- switch (_currentPart) {
-
- case 61:
- PART_05(); // SpringRock
- break;
-
- case 850: // Intro cutscene
- PART_85();
- break;
- case 900: // Logo slideshow
- case 901:
- case 902:
- case 903:
- case 904:
- PART_90();
- break;
-
- default:
- error("Unknown or unhandled room part %d", _currentPart);
- break;
- }
- }
-}
Common::Error IgorEngine::syncGame(Common::Serializer &s) {
// The Serializer has methods isLoading() and isSaving()
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 006ac3d3540..8bd062fafbe 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -205,6 +205,11 @@ struct RoomDataOffsets {
int matSize;
} dlg;
};
+enum {
+ kUpdateDialogueAnimEndOfSentence = 1,
+ kUpdateDialogueAnimMiddleOfSentence,
+ kUpdateDialogueAnimStanding
+};
enum ObjectType {
kObjectTypeInventory = 1,
@@ -231,6 +236,12 @@ enum {
kIdSpaCD
};
+struct DialogueText {
+ int num;
+ int count;
+ int sound;
+};
+
struct WalkData {
int16 x, y;
uint8 posNum;
@@ -294,6 +305,7 @@ class IgorEngine : public Engine {
public:
typedef void (IgorEngine::*UpdateRoomBackgroundProc)();
+ typedef void (IgorEngine::*UpdateDialogueProc)(int action);
private:
const ADGameDescription *_gameDescription;
Common::RandomSource _randomSource;
@@ -344,6 +356,14 @@ private:
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 _verbPrepositions[3][7];
@@ -358,6 +378,7 @@ private:
RoomWalkBounds _roomWalkBounds;
RoomDataOffsets _roomDataOffsets;
+ UpdateDialogueProc _updateDialogue;
UpdateRoomBackgroundProc _updateRoomBackground;
int _gameTicks;
@@ -380,6 +401,14 @@ private:
const char *getString(int id) const;
void loadIgorFrames();
+
+ void ADD_DIALOGUE_TEXT(int num, int count, int sound = kNoSpeechSound);
+ void SET_DIALOGUE_TEXT(int start, int count);
+ 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 PART_MAIN();
void PART_05();
void PART_05_UPDATE_ROOM_BACKGROUND();
@@ -512,6 +541,7 @@ extern IgorEngine *g_engine;
extern const uint8 _walkWidthScaleTable[];
extern const uint8 _walkScaleTable[];
extern const float _walkScaleSpeedTable[];
+extern const uint8 _talkDelays[];
extern const uint8 _mouseCursorMask[];
extern const uint8 _mouseCursorData[];
extern const uint8 PAL_IGOR_1[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 7e975e31244..fe61ed1a33d 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -14,7 +14,9 @@ MODULE_OBJS = \
static_cursor.o \
part_5.o \
part_85.o \
- part_90.o
+ part_90.o \
+ text.o \
+ part_main.o \
# This module can be built as a plugin
ifeq ($(ENABLE_IGOR), DYNAMIC_PLUGIN)
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index 9a14ba9f246..840fd4595d6 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -22,6 +22,9 @@
namespace Igor {
+static int VAR_CURRENT_TALKING_ACTOR;
+
+
void IgorEngine::PART_85() {
// playMusic(2);
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
@@ -38,6 +41,12 @@ void IgorEngine::PART_85() {
// Laura touching her hair
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;
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
new file mode 100644
index 00000000000..c7c879f67ce
--- /dev/null
+++ b/engines/igor/part_main.cpp
@@ -0,0 +1,56 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+void IgorEngine::PART_MAIN() {
+ while (!g_engine->shouldQuit() && !_eventQuitGame) {
+ switch (_currentPart) {
+
+ case 50:
+ case 51:
+ case 52:
+ PART_05();
+ break;
+ case 61:
+ PART_05(); // SpringRock
+ break;
+
+ case 850: // Intro cutscene
+ PART_85();
+ break;
+ case 900: // Logo slideshow
+ case 901:
+ case 902:
+ case 903:
+ case 904:
+ PART_90();
+ break;
+
+ default:
+ error("Unknown or unhandled room part %d", _currentPart);
+ break;
+ }
+ }
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
new file mode 100644
index 00000000000..b73c344682f
--- /dev/null
+++ b/engines/igor/text.cpp
@@ -0,0 +1,162 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+const uint8 _talkDelays[] = { 0, 27, 22, 17, 12, 7, 0 };
+
+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::fixDialogueTextPosition(int num, int count, int *x, int *y) {
+ int textLineWidth = 0;
+ for (int i = 0; i < count; ++i) {
+ int w = _font.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 = _font.getStringWidth(textLine);;
+ int textX = talkX - textLineWidth / 2;
+ int textY = i * 10;
+ _font.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);
+}
+
+} // End of namespace Igor
Commit: 42266f4b3c6b8a54704ad710793fea2b857bf324
https://github.com/scummvm/scummvm/commit/42266f4b3c6b8a54704ad710793fea2b857bf324
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:44+01:00
Commit Message:
IGOR: Fixes text not clearing properly
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/palette.cpp
engines/igor/part_5.cpp
engines/igor/part_85.cpp
engines/igor/part_main.cpp
engines/igor/static_cursor.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 1661369072e..90083c40cf9 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -193,13 +193,14 @@ Common::Error IgorEngine::run() {
_gameState.talkMode = kTalkModeTextOnly;
_gameState.talkSpeed = 3;
+ _talkSpeechCounter = 5;
+ _eventQuitGame = false;
// If a savegame was selected from the launcher, load it
int saveSlot = ConfMan.getInt("save_slot");
if (saveSlot != -1)
(void)loadGameState(saveSlot);
- _eventQuitGame = false;
PART_MAIN();
_ovlFile.close();
// _sndFile.close();
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 8bd062fafbe..7c4fb48fffa 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -366,6 +366,7 @@ private:
int _dialogueDirtyRectSize;
+ uint8 _objectsState[112];
char _verbPrepositions[3][7];
char _roomObjectNames[20][MAX_OBJECT_NAME_LENGTH];
char _globalObjectNames[35][MAX_OBJECT_NAME_LENGTH];
@@ -413,8 +414,10 @@ private:
void PART_05();
void PART_05_UPDATE_ROOM_BACKGROUND();
+
void PART_85();
void PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
+ void PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action);
void PART_85_UPDATE_ROOM_BACKGROUND();
void PART_90();
@@ -455,6 +458,7 @@ private:
void setPaletteColor(uint8 index, uint8 r, uint8 g, uint8 b);
void setPaletteRange(int startColor, int endColor);
void updatePalette(int count);
+ void SET_PAL_208_96_1();
void SET_PAL_240_48_1();
void fadeInPalette(int count);
@@ -546,6 +550,7 @@ extern const uint8 _mouseCursorMask[];
extern const uint8 _mouseCursorData[];
extern const uint8 PAL_IGOR_1[];
extern const uint8 PAL_48_1[];
+extern const uint8 PAL_96_1[];
} // End of namespace Igor
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index 5fea913a241..12dcb34d898 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -69,16 +69,13 @@ void IgorEngine::updatePalette(int count) {
g_system->getPaletteManager()->setPalette(pal, 0, count / 3);
}
-void IgorEngine::SET_PAL_240_48_1() {
- uint8 pal[48];
- for (int j = 0, i = 0; i < 48; ++i) {
- pal[j++] = (PAL_48_1[i] << 2);// | (_currentPalette[i] >> 4);
- // // if (((i + 1) % 3) == 0) {
- // // pal[j++] = 0;
- // // }
- }
- g_system->getPaletteManager()->setPalette(pal, 240, 16);
+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::fadeInPalette(int count) {
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 211dd1acb4a..67a1adfd89c 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -25,7 +25,6 @@ namespace Igor {
void IgorEngine::PART_05() {
_gameState.enableLight = 1;
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
- SET_PAL_240_48_1();
loadRoomData(PAL_SpringBridge, IMG_SpringBridge, BOX_SpringBridge, MSK_SpringBridge, TXT_SpringBridge);
_updateRoomBackground = &IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND;
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index 840fd4595d6..f35e43a13d0 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -25,6 +25,23 @@ namespace Igor {
static int VAR_CURRENT_TALKING_ACTOR;
+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() {
// playMusic(2);
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
@@ -33,12 +50,13 @@ void IgorEngine::PART_85() {
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;
- // Laura touching her hair
PART_85_HELPER_1(0, 0x7481, 2, 7, 32);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
ADD_DIALOGUE_TEXT(201, 3, 545);
@@ -47,14 +65,89 @@ void IgorEngine::PART_85() {
startCutsceneDialogue(89, 56, 63, 63, 0);
VAR_CURRENT_TALKING_ACTOR = 0;
waitForEndOfCutsceneDialogue(89, 56, 63, 63, 0);
-
- if (_inputVars[kInputEscape])
- goto PART_85_EXIT;
+ 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);
@@ -62,6 +155,7 @@ PART_85_EXIT:
memset(_currentPalette + 0x270, 0, 0x8D);
setPaletteRange(208, 254);
_currentPart = 61;
+ _updateDialogue = 0;
_updateRoomBackground = 0;
}
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index c7c879f67ce..27a0215b2d5 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -23,20 +23,50 @@
namespace Igor {
void IgorEngine::PART_MAIN() {
- while (!g_engine->shouldQuit() && !_eventQuitGame) {
+ memset(_objectsState, 0, 112);
+ _objectsState[21] = 1;
+ _objectsState[49] = 1;
+
+ if (_currentPart != kStartupPart) { // boot param
+ SET_PAL_208_96_1();
+ SET_PAL_240_48_1();
+ drawVerbsPanel();
+ // drawInventory(1, 0);
+ }
+ do {
switch (_currentPart) {
case 50:
case 51:
case 52:
- PART_05();
+ PART_05();// SpringRock
break;
+ case 60:
case 61:
- PART_05(); // SpringRock
+ case 62:
+ PART_05();
break;
case 850: // Intro cutscene
+ 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: // Logo slideshow
case 901:
@@ -50,7 +80,7 @@ void IgorEngine::PART_MAIN() {
error("Unknown or unhandled room part %d", _currentPart);
break;
}
- }
+ } while (_currentPart != kInvalidPart && !_eventQuitGame);
}
} // End of namespace Igor
diff --git a/engines/igor/static_cursor.cpp b/engines/igor/static_cursor.cpp
index 1e0f4c1ba99..adda5f65ad9 100644
--- a/engines/igor/static_cursor.cpp
+++ b/engines/igor/static_cursor.cpp
@@ -44,6 +44,15 @@ const uint8 PAL_IGOR_1[] = {
0x17, 0x06, 0x0B, 0x14, 0x04, 0x08, 0x0E, 0x02, 0x05, 0x09, 0x01, 0x02, 0x04, 0x25, 0x05, 0x05
};
+const uint8 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 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,
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index b73c344682f..ce5a2665d76 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -24,6 +24,10 @@ namespace Igor {
const uint8 _talkDelays[] = { 0, 27, 22, 17, 12, 7, 0 };
+/**
+ * appends one DialogueText{num, count, sound} record into _dialogueTextsTable[] at index _dialogueTextsCount, then increments it.
+ * MAX_DIALOGUE_TEXTS = 6
+ */
void IgorEngine::ADD_DIALOGUE_TEXT(int num, int count, int sound) {
assert(_dialogueTextsCount < MAX_DIALOGUE_TEXTS);
DialogueText *dt = &_dialogueTextsTable[_dialogueTextsCount];
@@ -78,8 +82,13 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
_dialogueDirtyRectY = talkY * 320;
_dialogueDirtyRectSize = dt->count * 11 * 320;
assert(_dialogueDirtyRectSize < 320 * 72);
+
+ /**
+ * Clear previous text line
+ */
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];
Commit: 549ff2b17ec846dc117b0851ee9b0e393a454e0a
https://github.com/scummvm/scummvm/commit/549ff2b17ec846dc117b0851ee9b0e393a454e0a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:45+01:00
Commit Message:
IGOR: Skip dialog
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_85.cpp
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 90083c40cf9..3eae7652869 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -210,7 +210,6 @@ Common::Error IgorEngine::run() {
void IgorEngine::enterPartLoop() {
- // CursorMan.showMouse(true);
if (!_gameState.dialogueTextRunning) {
showCursor();
}
@@ -221,9 +220,9 @@ void IgorEngine::enterPartLoop() {
}
void IgorEngine::leavePartLoop() {
- // hideCursor();
+ hideCursor();
// SET_EXEC_ACTION_FUNC(1, 0);
- // _updateRoomBackground = 0;
+ _updateRoomBackground = 0;
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 7c4fb48fffa..4691fd11997 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -417,6 +417,7 @@ private:
void PART_85();
void PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
+ void PART_85_HELPER_2();
void PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action);
void PART_85_UPDATE_ROOM_BACKGROUND();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index c102c15b2f7..a14c68ca934 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -156,12 +156,12 @@ void IgorEngine::handleRoomInput() {
// handleOptionsMenu();
}
if (_inputVars[kInputSkipDialogue] && _gameState.dialogueTextRunning) {
- // _talkDelayCounter = _talkDelay;
- // if (_gameState.talkMode != kTalkModeTextOnly && _talkSpeechCounter > 2) {
- // stopSound();
- // _talkSpeechCounter = -1;
- // }
- // _inputVars[kInputSkipDialogue] = 0;
+ _talkDelayCounter = _talkDelay;
+ if (_gameState.talkMode != kTalkModeTextOnly && _talkSpeechCounter > 2) {
+ // stopSound();
+ _talkSpeechCounter = -1;
+ }
+ _inputVars[kInputSkipDialogue] = 0;
}
if (!_roomCursorOn || _gameState.dialogueTextRunning /*|| _scrollInventory*/) {
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index f35e43a13d0..3ebedf5baa1 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -110,7 +110,7 @@ void IgorEngine::PART_85() {
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();
+ PART_85_HELPER_2();
// VAR_WATER_SOUND_PLAYING = false;
// stopSound();
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
@@ -171,6 +171,22 @@ void IgorEngine::PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstF
} 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_UPDATE_ROOM_BACKGROUND() {
if (compareGameTick(61)) {
scrollPalette(160, 167);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 27a0215b2d5..2e6212e0e93 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -48,10 +48,13 @@ void IgorEngine::PART_MAIN() {
break;
case 850: // Intro cutscene
+ // Clear the entire screen buffer before starting the intro cutscene
memset(_screenVGA, 0, 64000);
_screenVGAVOffset = 24;
+ // copy the initial portion of the screen to the display, with the vertical offset
_system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, _screenVGAVOffset);
PART_85();
+ // Clears the bottom portion of the screen
memset(_screenVGA + 46080, 0, 17920);
_nextTimer = _system->getMillis() + 1000 / 60;
for (int y = _screenVGAVOffset; y >= 0; --y) {
Commit: be47bec5d219b5656833c0275be06a76753b8ebc
https://github.com/scummvm/scummvm/commit/be47bec5d219b5656833c0275be06a76753b8ebc
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:45+01:00
Commit Message:
IGOR: Plays sound and speech (bugged)
Changed paths:
A engines/igor/sound.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/palette.cpp
engines/igor/part_5.cpp
engines/igor/part_85.cpp
engines/igor/part_90.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 3eae7652869..fbb61181f07 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -63,6 +63,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.ovlFileName = "igor.exe";
_game.sfxFileName = "igor.dat";
_game.version = kIdSpaCD;
+
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
_currentPart = 850;
}
@@ -76,7 +77,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
IgorEngine::~IgorEngine() {
free(_resourceEntries);
- // free(_soundOffsets);
+ free(_soundOffsets);
free(_screenVGA);
for (int i = 0; i < 4; ++i) {
free(_facingIgorFrames[i]);
@@ -138,7 +139,7 @@ void IgorEngine::restart() {
// _dialogueChoiceSelected = 0;
// memset(_dialogueInfo, 0, sizeof(_dialogueInfo));
- // memset(_objectsState, 0, sizeof(_objectsState));
+ memset(_objectsState, 0, sizeof(_objectsState));
// memcpy(_inventoryImages, INVENTORY_IMG_INIT, 36);
// memset(_inventoryInfo, 0, sizeof(_inventoryInfo));
memset(_verbPrepositions, 0, sizeof(_verbPrepositions));
@@ -159,7 +160,7 @@ void IgorEngine::restart() {
_roomCursorOn = true;
_currentCursor = 0;
// _dialogueCursorOn = true;
- // _updateDialogue = 0;
+ _updateDialogue = 0;
_updateRoomBackground = 0;
_resourceEntriesCount = 0;
@@ -187,11 +188,15 @@ Common::Error IgorEngine::run() {
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.talkMode = kTalkModeSpeechAndText;
_gameState.talkSpeed = 3;
_talkSpeechCounter = 5;
_eventQuitGame = false;
@@ -203,7 +208,7 @@ Common::Error IgorEngine::run() {
PART_MAIN();
_ovlFile.close();
- // _sndFile.close();
+ _sndFile.close();
return Common::kNoError;
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 4691fd11997..0ace83c53e9 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -37,6 +37,7 @@
#include "audio/mididrv_ms.h"
#include "audio/midiparser.h"
+#include "audio/mixer.h"
#include "igor/detection.h"
#include "igor/font.h"
@@ -312,6 +313,10 @@ private:
// MidiPlayer *_midiPlayer;
Common::File _ovlFile;
+ Common::File _sndFile;
+
+ Audio::SoundHandle _sfxHandle;
+ Audio::SoundHandle _speechHandle;
uint8 *_screenVGA;
uint8 *_facingIgorFrames[4];
@@ -400,8 +405,13 @@ private:
void copyArea(uint8 *dst, int dstOffset, int dstPitch, const uint8 *src, int srcPitch, int w, int h, bool transparent);
void loadMainTexts();
const char *getString(int id) const;
- void loadIgorFrames();
+ void startMusic(int cmf);
+ void playMusic(int num);
+ void updateMusic();
+ void playSound(int num, int type);
+ void stopSound();
+ void loadIgorFrames();
void ADD_DIALOGUE_TEXT(int num, int count, int sound = kNoSpeechSound);
void SET_DIALOGUE_TEXT(int start, int count);
@@ -409,7 +419,6 @@ private:
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 PART_MAIN();
void PART_05();
void PART_05_UPDATE_ROOM_BACKGROUND();
@@ -462,7 +471,7 @@ private:
void SET_PAL_208_96_1();
void SET_PAL_240_48_1();
- void fadeInPalette(int count);
+ void fadeIn(int count);
void fadeOutPalette(int count);
void decodeRoomStrings(const uint8 *p, bool skipObjectNames = false);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index fe61ed1a33d..bdd7d947a7d 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -17,6 +17,7 @@ MODULE_OBJS = \
part_90.o \
text.o \
part_main.o \
+ sound.o
# This module can be built as a plugin
ifeq ($(ENABLE_IGOR), DYNAMIC_PLUGIN)
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index 12dcb34d898..7aa8c01af2a 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -78,7 +78,7 @@ void IgorEngine::SET_PAL_240_48_1() {
memcpy(_paletteBuffer + 240 * 3, PAL_48_1, 48);
}
-void IgorEngine::fadeInPalette(int count) {
+void IgorEngine::fadeIn(int count) {
debugC(9, kDebugScreen, "fadeInPalette(%d)", count);
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
int m = 66;
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 67a1adfd89c..5ae8e8112bd 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -33,7 +33,7 @@ void IgorEngine::PART_05() {
{
memcpy(_screenVGA, _screenLayer1, 46080);
drawVerbsPanel();
- fadeInPalette(720);
+ fadeIn(720);
}
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index 3ebedf5baa1..bac13b9ef6a 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -23,6 +23,7 @@
namespace Igor {
static int VAR_CURRENT_TALKING_ACTOR;
+static bool VAR_WATER_SOUND_PLAYING;
void IgorEngine::PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action) {
@@ -43,7 +44,7 @@ void IgorEngine::PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action) {
void IgorEngine::PART_85() {
- // playMusic(2);
+ 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);
@@ -52,10 +53,10 @@ void IgorEngine::PART_85() {
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);
+ VAR_WATER_SOUND_PLAYING = true;
+ playSound(17, 1);
decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true);
- fadeInPalette(768);
+ fadeIn(768);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
PART_85_HELPER_1(0, 0x7481, 2, 7, 32);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
@@ -111,8 +112,8 @@ void IgorEngine::PART_85() {
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();
+ 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;
@@ -145,7 +146,7 @@ void IgorEngine::PART_85() {
PART_85_HELPER_1(0x74CA, 0xA6C4, 10, 24, 16);
PART_85_EXIT:
- // stopSound();
+ stopSound();
_gameState.dialogueTextRunning = false;
_inputVars[kInputEscape] = 0;
_walkData[0].setPos(155, 121, 4, 0);
@@ -204,12 +205,12 @@ void IgorEngine::PART_85_UPDATE_ROOM_BACKGROUND() {
scrollPalette(185, 191);
setPaletteRange(185, 191);
}
- // if (!VAR_WATER_SOUND_PLAYING) {
- // return;
- // }
- // if (_gameState.talkMode == kTalkModeTextOnly || !_gameState.dialogueTextRunning) {
- // playSound(17, 1);
- // }
+ if (!VAR_WATER_SOUND_PLAYING) {
+ return;
+ }
+ if (_gameState.talkMode == kTalkModeTextOnly || !_gameState.dialogueTextRunning) {
+ playSound(17, 1);
+ }
}
} // End of namespace Igor
diff --git a/engines/igor/part_90.cpp b/engines/igor/part_90.cpp
index c5c5945a13a..4adf5d114b4 100644
--- a/engines/igor/part_90.cpp
+++ b/engines/igor/part_90.cpp
@@ -51,7 +51,7 @@ void IgorEngine::PART_90() {
_font.drawString(_screenVGA, str, 2, 187, 0xF5, 0, 0);
break;
}
- fadeInPalette(768);
+ fadeIn(768);
while (!_inputVars[kInputEscape]) {
waitForTimer();
if (_inputVars[kInputOptions]) {
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
new file mode 100644
index 00000000000..c5e72e0be65
--- /dev/null
+++ b/engines/igor/sound.cpp
@@ -0,0 +1,78 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "audio/decoders/raw.h"
+#include "audio/decoders/voc.h"
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+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::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::FLAG_UNSIGNED);
+ if (stream) {
+ _mixer->playStream(soundType, soundHandle, stream);
+ }
+}
+
+void IgorEngine::stopSound() {
+ _mixer->stopHandle(_sfxHandle);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index ce5a2665d76..ee7f73b7a3f 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -109,9 +109,9 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
_talkDelay = -1;
_talkDelayCounter = 0;
}
- // if (_gameState.talkMode == kTalkModeTextOnly) {
- // playSound(24, 0);
- // }
+ if (_gameState.talkMode != kTalkModeTextOnly) {
+ playSound(dt->sound, 0);
+ }
_gameState.dialogueTextRunning = true;
_inputVars[kInputSkipDialogue] = 0;
}
Commit: 8a3da3fd33b3ccf7235e51ec9f0413fdd27c9d36
https://github.com/scummvm/scummvm/commit/8a3da3fd33b3ccf7235e51ec9f0413fdd27c9d36
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:45+01:00
Commit Message:
IGOR: Part 6
Changed paths:
A engines/igor/part_6.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index fbb61181f07..910ab4e9d71 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -196,7 +196,7 @@ Common::Error IgorEngine::run() {
loadMainTexts();
loadIgorFrames();
- _gameState.talkMode = kTalkModeSpeechAndText;
+ _gameState.talkMode = kTalkModeTextOnly;
_gameState.talkSpeed = 3;
_talkSpeechCounter = 5;
_eventQuitGame = false;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 0ace83c53e9..2b39f1e43c4 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -424,6 +424,17 @@ private:
void PART_05_UPDATE_ROOM_BACKGROUND();
+ void PART_06();
+ void PART_06_UPDATE_ROOM_BACKGROUND();
+
+ void PART_06_HELPER_2();
+
+ void PART_06_HELPER_3();
+
+ void PART_06_HELPER_6(int num);
+
+ void PART_06_HELPER_1(int frame);
+
void PART_85();
void PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
void PART_85_HELPER_2();
@@ -546,6 +557,7 @@ public:
protected:
// Engine APIs
Common::Error run() override;
+ static const RoomDataOffsets PART_06_ROOM_DATA_OFFSETS;
};
extern IgorEngine *g_engine;
@@ -562,6 +574,7 @@ extern const uint8 PAL_IGOR_1[];
extern const uint8 PAL_48_1[];
extern const uint8 PAL_96_1[];
+
} // End of namespace Igor
#endif // IGOR_H
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index bdd7d947a7d..73addcd5d80 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -15,6 +15,7 @@ MODULE_OBJS = \
part_5.o \
part_85.o \
part_90.o \
+ part_6.o \
text.o \
part_main.o \
sound.o
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
new file mode 100644
index 00000000000..a60a82fdc1d
--- /dev/null
+++ b/engines/igor/part_6.cpp
@@ -0,0 +1,153 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+
+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() {
+ _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);
+ fadeIn(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();
+}
+
+
+} // End of namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 2e6212e0e93..4f1eef3d052 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -44,7 +44,7 @@ void IgorEngine::PART_MAIN() {
case 60:
case 61:
case 62:
- PART_05();
+ PART_06();
break;
case 850: // Intro cutscene
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 6a096abb963..fcecd986d08 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -189,4 +189,12 @@ const float _walkScaleSpeedTable[] = {
5.0000f, 5.2500f, 5.5000f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f
};
+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 }
+};
+
+
} // End of namespace Igor
Commit: fe98022576e69c9da5cd83c91c049705e4c586fb
https://github.com/scummvm/scummvm/commit/fe98022576e69c9da5cd83c91c049705e4c586fb
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:46+01:00
Commit Message:
IGOR: Preparing code for actions
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_6.cpp
engines/igor/part_main.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 910ab4e9d71..d0d3d5495f8 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -152,8 +152,8 @@ void IgorEngine::restart() {
memset(_roomObjectAreasTable, 0, sizeof(_roomObjectAreasTable));
memset(_roomActionsTable, 0, sizeof(_roomActionsTable));
- // _executeMainAction = 0;
- // _executeRoomAction = 0;
+ _executeMainAction = 0;
+ _executeRoomAction = 0;
// _previousMusic = 0;
// _musicData = 0;
// _scrollInventory = false;
@@ -226,7 +226,7 @@ void IgorEngine::enterPartLoop() {
void IgorEngine::leavePartLoop() {
hideCursor();
- // SET_EXEC_ACTION_FUNC(1, 0);
+ SET_EXEC_ACTION_FUNC(1, 0);
_updateRoomBackground = 0;
}
@@ -252,6 +252,24 @@ void IgorEngine::runPartLoop() {
waitForTimer();
}
+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::handlePause() {
+ drawActionSentence(getString(STR_GamePaused), 0xFB);
+ do {
+ waitForTimer();
+ } while (!_inputVars[kInputPause]);
+ memset(_inputVars, 0, sizeof(_inputVars));
+}
Common::Error IgorEngine::syncGame(Common::Serializer &s) {
// The Serializer has methods isLoading() and isSaving()
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 2b39f1e43c4..86db8a2972f 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -305,6 +305,7 @@ struct WalkData {
class IgorEngine : public Engine {
public:
+ typedef void (IgorEngine::*ExecuteActionProc)(int action);
typedef void (IgorEngine::*UpdateRoomBackgroundProc)();
typedef void (IgorEngine::*UpdateDialogueProc)(int action);
private:
@@ -346,6 +347,8 @@ private:
RoomObjectArea _roomObjectAreasTable[MAX_ROOM_OBJECT_AREAS];
uint8 _roomActionsTable[0x2000];
+ ExecuteActionProc _executeMainAction;
+ ExecuteActionProc _executeRoomAction;
Action _currentAction;
uint8 _actionCode;
@@ -415,11 +418,14 @@ private:
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 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 PART_MAIN();
+ void EXEC_MAIN_ACTION(int action);
void PART_05();
void PART_05_UPDATE_ROOM_BACKGROUND();
@@ -431,6 +437,8 @@ private:
void PART_06_HELPER_3();
+ void PART_06_HELPER_8(int frame);
+
void PART_06_HELPER_6(int num);
void PART_06_HELPER_1(int frame);
@@ -445,6 +453,9 @@ private:
void handleRoomInput();
+
+ void executeAction(int action);
+ void clearAction();
void formatActionSentence(uint8 color);
void drawActionSentence(const char *sentence, uint8 color);
void handleRoomIgorWalk();
@@ -460,6 +471,7 @@ private:
int lookupScale(int xOffset, int yOffset, int h) const;
void lookupScale(int curX, int curY, uint8 &scale, uint8 &xScale, uint8 &yScale) const;
+ void buildWalkPathSimple(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);
@@ -490,6 +502,7 @@ private:
void decodeRoomAreas(const uint8 *p, int count);
void decodeRoomMask(const uint8 *p);
+ int getPart() const { return _currentPart / 10; }
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; }
@@ -503,6 +516,7 @@ private:
void decodeAnimFrame(const uint8 *src, uint8 *dst, bool preserveText = false);
void setRoomWalkBounds(int x1, int y1, int x2, int y2);
+ void fixWalkPosition(int *x, int *y);
void buildWalkPath(int srcX, int srcY, int dstX, int dstY);
@@ -540,6 +554,8 @@ public:
return true;
}
+ void handlePause();
+
/**
* Uses a serializer to allow implementing savegame
* loading and saving using a single method
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index a14c68ca934..6b8f8f76a62 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -149,7 +149,7 @@ void IgorEngine::redrawVerb(uint8 verb, bool highlight) {
void IgorEngine::handleRoomInput() {
if (_inputVars[kInputPause]) {
_inputVars[kInputPause] = 0;
- // handlePause();
+ handlePause();
}
if (_inputVars[kInputOptions]) {
_inputVars[kInputOptions] = 0;
@@ -158,7 +158,7 @@ void IgorEngine::handleRoomInput() {
if (_inputVars[kInputSkipDialogue] && _gameState.dialogueTextRunning) {
_talkDelayCounter = _talkDelay;
if (_gameState.talkMode != kTalkModeTextOnly && _talkSpeechCounter > 2) {
- // stopSound();
+ stopSound();
_talkSpeechCounter = -1;
}
_inputVars[kInputSkipDialogue] = 0;
@@ -227,8 +227,31 @@ void IgorEngine::handleRoomInput() {
return;
}
- if (_inputVars[kInputCursorYPos] >= 170 && _inputVars[kInputCursorYPos] <= 199) {
+ //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;
@@ -283,7 +306,81 @@ void IgorEngine::handleRoomInput() {
_actionCode = 0;
return;
}
+ 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::clearAction() {
+ redrawVerb(_currentAction.verb, false);
+ memset(&_currentAction, 0, sizeof(_currentAction));
+ _currentAction.verb = kVerbWalk;
+ _actionCode = 0;
+ _actionWalkPoint = 0;
}
void IgorEngine::formatActionSentence(uint8 color) {
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index a60a82fdc1d..7d0baa7d777 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -84,6 +84,13 @@ void IgorEngine::PART_06_HELPER_3() {
}
}
+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() {
_gameState.enableLight = 1;
@@ -141,9 +148,9 @@ void IgorEngine::PART_06() {
// handleRoomLight();
// }
PART_06_UPDATE_ROOM_BACKGROUND();
- // if (compareGameTick(61) && _gameState.unkF && getRandomNumber(10) == 0) {
- // PART_06_HELPER_8(getRandomNumber(4));
- // }
+ if (compareGameTick(61) && _gameState.unkF && getRandomNumber(10) == 0) {
+ PART_06_HELPER_8(getRandomNumber(4));
+ }
waitForTimer();
}
leavePartLoop();
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 4f1eef3d052..3b4d9e020b5 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -21,8 +21,30 @@
#include "igor/igor.h"
namespace Igor {
+void IgorEngine::EXEC_MAIN_ACTION(int action) {
+ switch (action) {
+ case 0:
+ case 1:
+ break;
+ default:
+ warning("EXEC_MAIN_ACTION() Unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p) {
+ switch (i) {
+ case 0:
+ _executeMainAction = p;
+ break;
+ case 1:
+ _executeRoomAction = p;
+ break;
+ }
+}
void IgorEngine::PART_MAIN() {
+ SET_EXEC_ACTION_FUNC(0, &IgorEngine::EXEC_MAIN_ACTION);
memset(_objectsState, 0, 112);
_objectsState[21] = 1;
_objectsState[49] = 1;
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 93db53b9033..6ede848f896 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1028,4 +1028,59 @@ void IgorEngine::handleRoomIgorWalk() {
}
}
+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::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;
+}
+
} // End of namespace Igor
Commit: c6fdcdfb4fd011e0845a0170cfa0a30fe4cf72ba
https://github.com/scummvm/scummvm/commit/c6fdcdfb4fd011e0845a0170cfa0a30fe4cf72ba
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:46+01:00
Commit Message:
IGOR: Walking
Changed paths:
engines/igor/detection.cpp
engines/igor/detection.h
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_5.cpp
engines/igor/part_6.cpp
engines/igor/part_85.cpp
engines/igor/part_main.cpp
engines/igor/resource.cpp
engines/igor/static_walk.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/detection.cpp b/engines/igor/detection.cpp
index c851282636e..089c39d9b39 100644
--- a/engines/igor/detection.cpp
+++ b/engines/igor/detection.cpp
@@ -30,6 +30,11 @@
#include "igor/detection_tables.h"
const DebugChannelDef IgorMetaEngineDetection::debugFlagList[] = {
+ { Igor::kDebugEngine, "Engine", "Engine debug level" },
+ { Igor::kDebugResource, "Resource", "Resource debug level" },
+ { Igor::kDebugScreen, "Screen", "Screen debug level" },
+ { Igor::kDebugWalk, "Walk", "Walk debug level" },
+ { Igor::kDebugGame, "Game", "Game debug level" },
{ Igor::kDebugGraphics, "Graphics", "Graphics debug level" },
{ Igor::kDebugPath, "Path", "Pathfinding debug level" },
{ Igor::kDebugFilePath, "FilePath", "File path debug level" },
diff --git a/engines/igor/detection.h b/engines/igor/detection.h
index b1306e00f60..a05dfa1515c 100644
--- a/engines/igor/detection.h
+++ b/engines/igor/detection.h
@@ -32,6 +32,12 @@ enum IgorDebugChannels {
kDebugScan,
kDebugFilePath,
kDebugScript,
+
+ kDebugEngine = 400 << 1,
+ kDebugResource = 400 << 2,
+ kDebugScreen = 400 << 3,
+ kDebugWalk = 400 << 4,
+ kDebugGame = 400 << 5,
};
extern const PlainGameDescriptor igorGames[];
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index d0d3d5495f8..733b7f0e242 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -52,20 +52,14 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_inventoryImagesBuffer = (uint8 *)malloc(48000);
_verbsPanelBuffer = (uint8 *)malloc(3840);
- DebugMan.addDebugChannel(kDebugEngine, "Engine", "Engine debug level");
- DebugMan.addDebugChannel(kDebugResource, "Resource", "Resource debug level");
- DebugMan.addDebugChannel(kDebugScreen, "Screen", "Screen debug level");
- DebugMan.addDebugChannel(kDebugWalk, "Walk", "Walk debug level");
- DebugMan.addDebugChannel(kDebugGame, "Game", "Game debug level");
-
-
{ // hardcoded now
_game.ovlFileName = "igor.exe";
_game.sfxFileName = "igor.dat";
_game.version = kIdSpaCD;
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- _currentPart = 850;
+ // _currentPart = 850;
+ _currentPart = 51;
}
// if (_game.flags & kFlagFloppy) {
@@ -178,6 +172,8 @@ Common::Error IgorEngine::run() {
initGraphics(320, 200);
_screen = new Graphics::Screen();
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
+
// Set the engine's debugger console
setDebugger(new Console());
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 86db8a2972f..01eef3c9614 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -47,14 +47,6 @@ namespace Igor {
struct IgorGameDescription;
-enum {
- kDebugEngine = 400 << 1,
- kDebugResource = 400 << 2,
- kDebugScreen = 400 << 3,
- kDebugWalk = 400 << 4,
- kDebugGame = 400 << 5
-};
-
enum {
kFlagDemo = 1 << 0,
kFlagFloppy = 1 << 1,
@@ -432,6 +424,7 @@ private:
void PART_06();
void PART_06_UPDATE_ROOM_BACKGROUND();
+ void PART_06_EXEC_ACTION(int action);
void PART_06_HELPER_2();
@@ -511,6 +504,7 @@ private:
ResourceEntry *findData(int num);
uint8 *loadData(int num, uint8 *dst = 0, int *size = 0);
void loadAnimData(const int *anm, int loadOffset = 0);
+ void loadActionData(int act);
void loadRoomData(int pal, int img, int box, int msk, int txt);
const uint8 *getAnimFrame(int baseOffset, int tableOffset, int frame);
void decodeAnimFrame(const uint8 *src, uint8 *dst, bool preserveText = false);
@@ -573,6 +567,7 @@ public:
protected:
// Engine APIs
Common::Error run() override;
+ static const RoomDataOffsets PART_05_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_06_ROOM_DATA_OFFSETS;
};
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 6b8f8f76a62..ab83b5520ea 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -220,6 +220,7 @@ void IgorEngine::handleRoomInput() {
// }
// _inputVars[kInputClick] = 0;
// }
+
bool actionHovering = !_inputVars[kInputClick];
_inputVars[kInputClick] = 0;
@@ -258,20 +259,20 @@ void IgorEngine::handleRoomInput() {
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;
- // }
+ 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;
@@ -281,13 +282,13 @@ void IgorEngine::handleRoomInput() {
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 == 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;
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 5ae8e8112bd..94e1eb74a03 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -40,6 +40,8 @@ void IgorEngine::PART_05() {
setRoomWalkBounds(0, 0, 319, 143);
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
+ loadActionData(DAT_SpringRock);
+ _roomDataOffsets = PART_05_ROOM_DATA_OFFSETS;
{
_walkData[0].setPos(0, 141, 2, 0);
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 7d0baa7d777..b9da4642faf 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -92,6 +92,15 @@ void IgorEngine::PART_06_HELPER_8(int frame) {
}
}
+void IgorEngine::PART_06_EXEC_ACTION(int action) {
+debugC(9, kDebugGame, "PART_06_EXEC_ACTION %d", action);
+ switch (action) {
+ default:
+ error("PART_06_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
void IgorEngine::PART_06() {
_gameState.enableLight = 1;
loadRoomData(PAL_SpringBridge, IMG_SpringBridge, BOX_SpringBridge, MSK_SpringBridge, TXT_SpringBridge);
@@ -112,7 +121,7 @@ void IgorEngine::PART_06() {
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);
+ 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) {
@@ -126,7 +135,7 @@ void IgorEngine::PART_06() {
memcpy(_paletteBuffer, _currentPalette, 624);
fadeIn(768);
}
- // loadActionData(DAT_SpringBridge);
+ loadActionData(DAT_SpringBridge);
_roomDataOffsets = PART_06_ROOM_DATA_OFFSETS;
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index bac13b9ef6a..c988476d7fd 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -48,72 +48,72 @@ void IgorEngine::PART_85() {
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);
+ // 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;
+ // _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);
+ // VAR_WATER_SOUND_PLAYING = true;
+ // playSound(17, 1);
+ // decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true);
fadeIn(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(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;
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 3b4d9e020b5..af95a5431e5 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -49,6 +49,7 @@ void IgorEngine::PART_MAIN() {
_objectsState[21] = 1;
_objectsState[49] = 1;
+ // UPDATE_OBJECT_STATE(255);
if (_currentPart != kStartupPart) { // boot param
SET_PAL_208_96_1();
SET_PAL_240_48_1();
@@ -56,6 +57,7 @@ void IgorEngine::PART_MAIN() {
// drawInventory(1, 0);
}
do {
+ debugC(9, kDebugGame, "PART_MAIN _currentPart %d", _currentPart);
switch (_currentPart) {
case 50:
@@ -102,7 +104,7 @@ void IgorEngine::PART_MAIN() {
break;
default:
- error("Unknown or unhandled room part %d", _currentPart);
+ error("PART_MAIN() Unhandled part %d", _currentPart);
break;
}
} while (_currentPart != kInvalidPart && !_eventQuitGame);
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index b10ee974906..092f797d964 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -185,6 +185,13 @@ uint8 *IgorEngine::loadData(int id, uint8 *dst, int *size) {
return dst;
}
+void IgorEngine::loadActionData(int act) {
+ if (act != 0) {
+ assert(findData(act)->size <= 0x2000);
+ loadData(act, _roomActionsTable);
+ }
+}
+
void IgorEngine::loadAnimData(const int *anm, int loadOffset) {
if (loadOffset == 0) {
memset(_animFramesBuffer, 0, 65535);
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index fcecd986d08..ea0c97c72b3 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -189,6 +189,13 @@ const float _walkScaleSpeedTable[] = {
5.0000f, 5.2500f, 5.5000f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f
};
+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 },
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 6ede848f896..fb10a2e9186 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1013,14 +1013,14 @@ void IgorEngine::handleRoomIgorWalk() {
if (_walkDataCurrentIndex > _walkDataLastIndex) {
_gameState.igorMoving = false;
_walkDataLastIndex = _walkDataCurrentIndex;
- // if (_actionCode > 0) {
- // hideCursor();
- // executeAction(_actionCode);
- // if (!_gameState.dialogueTextRunning) {
- // showCursor();
- // }
- // clearAction();
- // }
+ if (_actionCode > 0) {
+ hideCursor();
+ executeAction(_actionCode);
+ if (!_gameState.dialogueTextRunning) {
+ showCursor();
+ }
+ clearAction();
+ }
}
if (_gameState.igorMoving) {
moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
Commit: c17fc6c25f986b8100bbf120b1a4c9cda3a0680c
https://github.com/scummvm/scummvm/commit/c17fc6c25f986b8100bbf120b1a4c9cda3a0680c
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:46+01:00
Commit Message:
IGOR: Scrolling on first scene
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/part_5.cpp
engines/igor/part_6.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 733b7f0e242..20c3b4e9e63 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -58,8 +58,8 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.version = kIdSpaCD;
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- // _currentPart = 850;
- _currentPart = 51;
+ _currentPart = 850;
+ // _currentPart = 61;
}
// if (_game.flags & kFlagFloppy) {
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 01eef3c9614..cc350ba7f8b 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -418,14 +418,19 @@ private:
void PART_MAIN();
void EXEC_MAIN_ACTION(int action);
+ void PART_05_HELPER_4(int num);
+ void PART_05_HELPER_5(int frame);
void PART_05();
+ void PART_05_EXEC_ACTION(int action);
+ void PART_05_ACTION_102();
void PART_05_UPDATE_ROOM_BACKGROUND();
-
void PART_06();
void PART_06_UPDATE_ROOM_BACKGROUND();
void PART_06_EXEC_ACTION(int action);
+ void PART_06_ACTION_102();
+
void PART_06_HELPER_2();
void PART_06_HELPER_3();
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 94e1eb74a03..9020ca8e59d 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -22,55 +22,159 @@
namespace Igor {
+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() {
_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);
+ 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;
-
- //Enforce display of room
- {
- memcpy(_screenVGA, _screenLayer1, 46080);
- drawVerbsPanel();
- fadeIn(720);
- }
-
-
+ PART_05_HELPER_4(255);
+ loadActionData(DAT_SpringRock);
+ _roomDataOffsets = PART_05_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
- loadActionData(DAT_SpringRock);
- _roomDataOffsets = PART_05_ROOM_DATA_OFFSETS;
- {
- _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();
- }
+ // {
+ // _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();
+ // }
enterPartLoop();
while (_currentPart >= 50 && _currentPart <= 52) {
runPartLoop();
}
leavePartLoop();
- // 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);
- // }
+ 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);
+ }
}
+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:
+ //scrolling action for Igor on the bridge
+ 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_UPDATE_ROOM_BACKGROUND() {
if (compareGameTick(61)) {
scrollPalette(160, 167);
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index b9da4642faf..9a29a0ed091 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -95,12 +95,65 @@ void IgorEngine::PART_06_HELPER_8(int frame) {
void IgorEngine::PART_06_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_06_EXEC_ACTION %d", action);
switch (action) {
+ case 102: // scroll right?
+ PART_06_ACTION_102();
+ 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() {
_gameState.enableLight = 1;
loadRoomData(PAL_SpringBridge, IMG_SpringBridge, BOX_SpringBridge, MSK_SpringBridge, TXT_SpringBridge);
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index fb10a2e9186..7111a73db31 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1015,6 +1015,7 @@ void IgorEngine::handleRoomIgorWalk() {
_walkDataLastIndex = _walkDataCurrentIndex;
if (_actionCode > 0) {
hideCursor();
+ debugC(9, kDebugEngine, "Executing action code %d", _actionCode);
executeAction(_actionCode);
if (!_gameState.dialogueTextRunning) {
showCursor();
Commit: fec2aa43011dc504a2061af325c5c71c91fb26ef
https://github.com/scummvm/scummvm/commit/fec2aa43011dc504a2061af325c5c71c91fb26ef
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:47+01:00
Commit Message:
IGOR: Igor talking
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/part_5.cpp
engines/igor/part_85.cpp
engines/igor/room.cpp
engines/igor/sound.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 20c3b4e9e63..1c116e8f274 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -192,7 +192,9 @@ Common::Error IgorEngine::run() {
loadMainTexts();
loadIgorFrames();
- _gameState.talkMode = kTalkModeTextOnly;
+ // _gameState.talkMode = kTalkModeTextOnly;
+ // _gameState.talkMode = kTalkModeSpeechOnly;
+ _gameState.talkMode = kTalkModeSpeechAndText;
_gameState.talkSpeed = 3;
_talkSpeechCounter = 5;
_eventQuitGame = false;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index cc350ba7f8b..9eb35f50adf 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -397,7 +397,8 @@ private:
void setupDefaultPalette();
void readTableFile();
- void copyArea(uint8 *dst, int dstOffset, int dstPitch, const uint8 *src, int srcPitch, int w, int h, bool transparent);
+ void copyArea(uint8 *dst, int dstOffset, int dstPitch, const uint8 *src, int srcPitch, int w, int h, bool transparent = false);
+
void loadMainTexts();
const char *getString(int id) const;
@@ -412,6 +413,10 @@ private:
void SET_DIALOGUE_TEXT(int start, int count);
void SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p);
+ void animateIgorTalking(int frame);
+ void fixIgorDialogueTextPosition(int num, int count, int *x, int *y);
+ void startIgorDialogue();
+ void waitForEndOfIgorDialogue();
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);
@@ -447,6 +452,8 @@ private:
void PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action);
void PART_85_UPDATE_ROOM_BACKGROUND();
+ void PART_85_HELPER_6(int frame);
+
void PART_90();
@@ -519,6 +526,10 @@ private:
void buildWalkPath(int srcX, int srcY, int dstX, int dstY);
+
+ static const uint8 _dialogueColor[];
+ static const uint8 _sentenceColorIndex[];
+
public:
Graphics::Screen *_screen = nullptr;
@@ -580,6 +591,7 @@ extern IgorEngine *g_engine;
#define SHOULD_QUIT ::Igor::g_engine->shouldQuit()
// Static data tables (defined in static_walk.cpp, static_cursor.cpp)
+
extern const uint8 _walkWidthScaleTable[];
extern const uint8 _walkScaleTable[];
extern const float _walkScaleSpeedTable[];
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 9020ca8e59d..f4f7e2e490d 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -193,24 +193,24 @@ void IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND() {
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;
- // }
+ 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);
}
- // if (_gameState.talkMode == kTalkModeTextOnly || !_gameState.dialogueTextRunning) {
- // playSound(17, 1);
- // }
}
} // End of namespace Igor
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index c988476d7fd..7e298f1e5c7 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -48,72 +48,72 @@ void IgorEngine::PART_85() {
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);
+ 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;
+ _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);
+ VAR_WATER_SOUND_PLAYING = true;
+ playSound(17, 1);
+ decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true);
fadeIn(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(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;
@@ -129,8 +129,8 @@ void IgorEngine::PART_85() {
_walkCurrentPos = 4;
ADD_DIALOGUE_TEXT(223, 2, 559);
SET_DIALOGUE_TEXT(1, 1);
- // startIgorDialogue();
- // waitForEndOfIgorDialogue();
+ 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;
@@ -140,8 +140,8 @@ void IgorEngine::PART_85() {
ADD_DIALOGUE_TEXT(225, 2, 560);
ADD_DIALOGUE_TEXT(227, 3, 561);
SET_DIALOGUE_TEXT(1, 2);
- // startIgorDialogue();
- // waitForEndOfIgorDialogue();
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
PART_85_HELPER_1(0x74CA, 0xA6C4, 10, 24, 16);
@@ -213,4 +213,28 @@ void IgorEngine::PART_85_UPDATE_ROOM_BACKGROUND() {
}
}
+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::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;
+ }
+}
+
} // End of namespace Igor
diff --git a/engines/igor/room.cpp b/engines/igor/room.cpp
index 62b845a52a9..c7fbd2b3497 100644
--- a/engines/igor/room.cpp
+++ b/engines/igor/room.cpp
@@ -24,23 +24,6 @@
namespace Igor {
-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;
- }
-}
-
void IgorEngine::decodeRoomAreas(const uint8 *p, int count) {
for (int i = 0; i < count; ++i) {
RoomObjectArea *roa = &_roomObjectAreasTable[i];
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index c5e72e0be65..6f2a81f7464 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -40,7 +40,7 @@ void IgorEngine::playMusic(int num) {
void IgorEngine::playSound(int num, int type) {
debugC(9, kDebugEngine, "playSound() %d", num);
- --num;
+ // --num;
int soundOffset = -1;
Audio::Mixer::SoundType soundType;
Audio::SoundHandle *soundHandle = 0;
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index ee7f73b7a3f..535dfca9bb1 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -24,6 +24,10 @@ namespace Igor {
const uint8 _talkDelays[] = { 0, 27, 22, 17, 12, 7, 0 };
+const uint8 IgorEngine::_dialogueColor[] = { 0x3F, 0x3F, 0x3F };
+
+const uint8 IgorEngine::_sentenceColorIndex[]= { 0xFD, 0xFB, 0xF1 };
+
/**
* appends one DialogueText{num, count, sound} record into _dialogueTextsTable[] at index _dialogueTextsCount, then increments it.
* MAX_DIALOGUE_TEXTS = 6
@@ -168,4 +172,155 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
} 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 = _font.getStringWidth(textLine);
+ int textX = talkX - textLineWidth / 2;
+ int textY = i * 10;
+ _font.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(dt->num, 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);
+}
+
+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;
+ }
+ }
+ }
+}
+
} // End of namespace Igor
Commit: 45ecc389c008ea30ce653d1c5e2d26df48bffbdb
https://github.com/scummvm/scummvm/commit/45ecc389c008ea30ce653d1c5e2d26df48bffbdb
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:47+01:00
Commit Message:
IGOR: Implements map (part 4)
Changed paths:
A engines/igor/part_4.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/module.mk
engines/igor/palette.cpp
engines/igor/part_5.cpp
engines/igor/part_90.cpp
engines/igor/part_main.cpp
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 9eb35f50adf..bd5995b651f 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -423,6 +423,13 @@ private:
void PART_MAIN();
void EXEC_MAIN_ACTION(int action);
+
+ void PART_04_EXEC_ACTION(int action);
+
+ void PART_04_CLEAR_OBJECT_STATE_84(int num);
+
+ void PART_04();
+
void PART_05_HELPER_4(int num);
void PART_05_HELPER_5(int frame);
void PART_05();
@@ -500,7 +507,7 @@ private:
void SET_PAL_240_48_1();
void fadeIn(int count);
- void fadeOutPalette(int count);
+ void fadeOut(int count);
void decodeRoomStrings(const uint8 *p, bool skipObjectNames = false);
void decodeRoomText(const uint8 *p);
@@ -583,6 +590,7 @@ public:
protected:
// Engine APIs
Common::Error run() override;
+ static const RoomDataOffsets PART_04_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_05_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_06_ROOM_DATA_OFFSETS;
};
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index ab83b5520ea..16ac4c9b45d 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -366,7 +366,7 @@ void IgorEngine::handleRoomInput() {
}
}
hideCursor();
- // executeAction(_actionCode);
+ executeAction(_actionCode);
if (!_gameState.dialogueTextRunning) {
showCursor();
}
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 73addcd5d80..6d1a9d239cd 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -12,6 +12,7 @@ MODULE_OBJS = \
input.o \
static_walk.o \
static_cursor.o \
+ part_4.o \
part_5.o \
part_85.o \
part_90.o \
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index 7aa8c01af2a..50a4b060f46 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -41,7 +41,7 @@ void IgorEngine::scrollPalette(int startColor, int endColor) {
}
void IgorEngine::setPaletteRange(int startColor, int endColor) {
- debugC(9, kDebugScreen, "setPaletteRange(%d, %d)", startColor, 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]);
@@ -99,7 +99,7 @@ void IgorEngine::fadeIn(int count) {
} while (m > 0);
}
-void IgorEngine::fadeOutPalette(int count) {
+void IgorEngine::fadeOut(int count) {
debugC(9, kDebugScreen, "fadeOutPalette(%d)", count);
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
memcpy(_paletteBuffer, _currentPalette, 768);
diff --git a/engines/igor/part_4.cpp b/engines/igor/part_4.cpp
new file mode 100644
index 00000000000..2e5ac79c003
--- /dev/null
+++ b/engines/igor/part_4.cpp
@@ -0,0 +1,111 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+void IgorEngine::PART_04_EXEC_ACTION(int action) {
+ debugC(9, kDebugGame, "PART_04_EXEC_ACTION %d", action);
+ 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);
+ fadeIn(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();
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index f4f7e2e490d..c82a3ea36db 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -85,13 +85,13 @@ void IgorEngine::PART_05() {
}
leavePartLoop();
if (_currentPart == 255) {
- fadeOutPalette(768);
+ fadeOut(768);
} else if (_currentPart != 60) {
// if (_objectsState[63] == 0) {
// _objectsState[61] = _objectsState[62] = _objectsState[63] = 1;
// }
memcpy(_currentPalette, _paletteBuffer, 624);
- fadeOutPalette(624);
+ fadeOut(624);
}
}
@@ -115,9 +115,9 @@ void IgorEngine::PART_05_EXEC_ACTION(int action) {
// SET_DIALOGUE_TEXT(1, 1);
// startIgorDialogue();
// break;
- // case 105:
- // _currentPart = 40;
- // break;
+ case 105:
+ _currentPart = 40;
+ break;
default:
error("PART_05_EXEC_ACTION unhandled action %d", action);
break;
diff --git a/engines/igor/part_90.cpp b/engines/igor/part_90.cpp
index 4adf5d114b4..a1f32467aa0 100644
--- a/engines/igor/part_90.cpp
+++ b/engines/igor/part_90.cpp
@@ -61,7 +61,7 @@ void IgorEngine::PART_90() {
}
}
_inputVars[kInputEscape] = 0;
- fadeOutPalette(768);
+ fadeOut(768);
if (_currentPart != kInvalidPart) {
++_currentPart;
if ((_game.version == kIdSpaCD && _currentPart == 904) || _currentPart == 905) {
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index af95a5431e5..52c3b1f612c 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -60,15 +60,18 @@ void IgorEngine::PART_MAIN() {
debugC(9, kDebugGame, "PART_MAIN _currentPart %d", _currentPart);
switch (_currentPart) {
+ case 40:
+ PART_04(); // Map
+ break;
case 50:
case 51:
case 52:
- PART_05();// SpringRock
+ PART_05(); // SpringRock
break;
case 60:
case 61:
case 62:
- PART_06();
+ PART_06(); // Spring
break;
case 850: // Intro cutscene
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index ea0c97c72b3..ae3c7c4b826 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -203,5 +203,13 @@ const RoomDataOffsets IgorEngine::PART_06_ROOM_DATA_OFFSETS = {
{ 135, 30, 5158, 100, 60 }
};
+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 }
+};
+
+
} // End of namespace Igor
Commit: b2e7a1750bdfd895d1f5e802751ff5a37e54fbc9
https://github.com/scummvm/scummvm/commit/b2e7a1750bdfd895d1f5e802751ff5a37e54fbc9
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:47+01:00
Commit Message:
IGOR: fixes click to skip on talkie mode
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/sound.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 1c116e8f274..9068df00a1b 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -56,6 +56,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.ovlFileName = "igor.exe";
_game.sfxFileName = "igor.dat";
_game.version = kIdSpaCD;
+ _game.flags = kFlagTalkie;
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
_currentPart = 850;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index bd5995b651f..08fa075c4bb 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -421,6 +421,8 @@ private:
void startCutsceneDialogue(int x, int y, int r, int g, int b);
void waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b);
+ bool isDialogueSpeechPlaying() const;
+
void PART_MAIN();
void EXEC_MAIN_ACTION(int action);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 16ac4c9b45d..d73286c7c96 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -69,6 +69,9 @@ void IgorEngine::waitForTimer(int ticks) {
_inputVars[kInputClick] = 1;
_inputVars[kInputCursorXPos] = ev.mouse.x;
_inputVars[kInputCursorYPos] = ev.mouse.y;
+ if (_gameState.dialogueTextRunning) {
+ _inputVars[kInputSkipDialogue] = 1;
+ }
break;
default:
break;
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 6f2a81f7464..4582f5e34aa 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -39,12 +39,13 @@ void IgorEngine::playMusic(int num) {
}
void IgorEngine::playSound(int num, int type) {
- debugC(9, kDebugEngine, "playSound() %d", num);
- // --num;
+
+ --num;
int soundOffset = -1;
Audio::Mixer::SoundType soundType;
Audio::SoundHandle *soundHandle = 0;
if (type == 1) {
+ debugC(9, kDebugEngine, "playSound() %d -> sfx offset %d", num + 1, num);
if (_mixer->isSoundHandleActive(_sfxHandle)) {
return;
}
@@ -53,10 +54,15 @@ void IgorEngine::playSound(int num, int type) {
soundType = Audio::Mixer::kSFXSoundType;
soundHandle = &_sfxHandle;
} else if (type == 0 && (_game.flags & kFlagTalkie) != 0 && num != kNoSpeechSound) {
+ debugC(9, kDebugEngine, "playSound() %d on speech handle", num);
if (_mixer->isSoundHandleActive(_speechHandle)) {
+ debugC(9, kDebugEngine, "stopping previous handle");
_mixer->stopHandle(_speechHandle);
}
- num += 100;
+ if (_mixer->isSoundHandleActive(_sfxHandle)) {
+ _mixer->stopHandle(_sfxHandle);
+ }
+ num += 101;
assert(num >= 0 && num < _soundOffsetsCount);
soundOffset = _soundOffsets[num];
soundType = Audio::Mixer::kSpeechSoundType;
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 535dfca9bb1..523554dc53c 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -123,10 +123,13 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b) {
do {
if (_gameState.dialogueTextRunning && _inputVars[kInputSkipDialogue]) {
+ if (_mixer->isSoundHandleActive(_speechHandle)) {
+ _mixer->stopHandle(_speechHandle);
+ }
_talkDelayCounter = _talkDelay;
_inputVars[kInputSkipDialogue] = 0;
}
- if (compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
+ if (!isDialogueSpeechPlaying() && compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
if (_talkSpeechCounter > 2) {
if (_gameState.talkMode != kTalkModeTextOnly) {
_talkDelayCounter = _talkDelay;
@@ -179,6 +182,10 @@ void IgorEngine::fixIgorDialogueTextPosition(int num, int count, int *x, int *y)
fixDialogueTextPosition(num, count, x, y);
}
+bool IgorEngine::isDialogueSpeechPlaying() const {
+ return _gameState.talkMode != kTalkModeTextOnly && _mixer->isSoundHandleActive(_speechHandle);
+}
+
void IgorEngine::startIgorDialogue() {
debugC(9, kDebugEngine, "startIgorDialogue()");
--_dialogueTextsCount;
@@ -221,7 +228,7 @@ void IgorEngine::startIgorDialogue() {
_talkDelayCounter = 0;
}
if (_gameState.talkMode != kTalkModeTextOnly) {
- playSound(dt->num, 0);
+ playSound(dt->sound, 0);
}
_gameState.dialogueTextRunning = true;
_inputVars[kInputSkipDialogue] = 0;
@@ -230,10 +237,13 @@ void IgorEngine::startIgorDialogue() {
void IgorEngine::waitForEndOfIgorDialogue() {
do {
if (_gameState.dialogueTextRunning && _inputVars[kInputSkipDialogue]) {
+ if (_mixer->isSoundHandleActive(_speechHandle)) {
+ _mixer->stopHandle(_speechHandle);
+ }
_talkDelayCounter = _talkDelay;
_inputVars[kInputSkipDialogue] = 0;
}
- if (compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
+ if (!isDialogueSpeechPlaying() && compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
if (_talkSpeechCounter > 2) {
if (_gameState.talkMode != kTalkModeTextOnly) {
_talkDelayCounter = _talkDelay;
Commit: b74fa07aba3be3d30d1004f676e480b83ea95a4f
https://github.com/scummvm/scummvm/commit/b74fa07aba3be3d30d1004f676e480b83ea95a4f
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:48+01:00
Commit Message:
IGOR: Debug layers
Changed paths:
A engines/igor/debug.cpp
engines/igor/console.cpp
engines/igor/console.h
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/module.mk
engines/igor/part_5.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/console.cpp b/engines/igor/console.cpp
index 1756c02e608..746fa8cd935 100644
--- a/engines/igor/console.cpp
+++ b/engines/igor/console.cpp
@@ -20,11 +20,15 @@
*/
#include "igor/console.h"
+#include "igor/igor.h"
namespace Igor {
Console::Console() : GUI::Debugger() {
registerCmd("test", WRAP_METHOD(Console, Cmd_test));
+ registerCmd("paint_walk", WRAP_METHOD(Console, Cmd_paintWalk));
+ registerCmd("paint_hotspots", WRAP_METHOD(Console, Cmd_paintHotspots));
+ registerCmd("paint_off", WRAP_METHOD(Console, Cmd_paintOff));
}
Console::~Console() {
@@ -35,4 +39,34 @@ bool Console::Cmd_test(int argc, const char **argv) {
return true;
}
+bool Console::Cmd_paintWalk(int argc, const char **argv) {
+ if (!g_engine) {
+ debugPrintf("Engine not running\n");
+ return true;
+ }
+ debugPrintf("Overlay: walk areas (BOX .area != 0); colours are the area id\n");
+ g_engine->debugPaintWalkAreas();
+ return true;
+}
+
+bool Console::Cmd_paintHotspots(int argc, const char **argv) {
+ if (!g_engine) {
+ debugPrintf("Engine not running\n");
+ return true;
+ }
+ debugPrintf("Overlay: hotspots (BOX .object != 0); colours are the object id\n");
+ g_engine->debugPaintHotspots();
+ return true;
+}
+
+bool Console::Cmd_paintOff(int argc, const char **argv) {
+ if (!g_engine) {
+ debugPrintf("Engine not running\n");
+ return true;
+ }
+ g_engine->debugClearOverlay();
+ debugPrintf("Overlay off\n");
+ return true;
+}
+
} // End of namespace Igor
diff --git a/engines/igor/console.h b/engines/igor/console.h
index dfe75742095..8ec2edf6474 100644
--- a/engines/igor/console.h
+++ b/engines/igor/console.h
@@ -30,6 +30,9 @@ namespace Igor {
class Console : public GUI::Debugger {
private:
bool Cmd_test(int argc, const char **argv);
+ bool Cmd_paintWalk(int argc, const char **argv);
+ bool Cmd_paintHotspots(int argc, const char **argv);
+ bool Cmd_paintOff(int argc, const char **argv);
public:
Console();
~Console() override;
diff --git a/engines/igor/debug.cpp b/engines/igor/debug.cpp
new file mode 100644
index 00000000000..b56d18a5a61
--- /dev/null
+++ b/engines/igor/debug.cpp
@@ -0,0 +1,99 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+#include "common/system.h"
+#include "graphics/paletteman.h"
+
+namespace Igor {
+
+// Debug overlays for the scene mask.
+//
+// The decoded MSK (kept in _screenLayer2, see SCENE_LAYERS_MASK_AREAS.md) holds
+// a region id per pixel; that id indexes _roomObjectAreasTable (the BOX table).
+// These overlays recolour the regions so the data is visible on screen:
+//
+// debugPaintWalkAreas() -> regions whose BOX record has area != 0
+// debugPaintHotspots() -> regions whose BOX record has object != 0
+//
+// Each region/object id gets a distinct colour from the 16-entry ramp written
+// to palette entries 240..255, so different walk areas (and different objects)
+// are told apart. debugClearOverlay() restores those palette entries from
+// _currentPalette.
+//
+// The overlay is (re)applied by debugApplyOverlay(), called from waitForTimer()
+// right before the frame is presented, so it survives scene redraws and Igor
+// movement. It composites onto _screenVGA's top 144 rows into a scratch buffer;
+// _screenVGA itself is left untouched.
+
+static const uint8 kDebugOverlayPalette[16 * 3] = {
+ 63, 0, 0, 63, 32, 0, 63, 63, 0, 32, 63, 0,
+ 0, 63, 0, 0, 63, 32, 0, 63, 63, 0, 32, 63,
+ 0, 0, 63, 32, 0, 63, 63, 0, 63, 63, 0, 32,
+ 63, 63, 63, 32, 32, 32, 63, 32, 32, 32, 63, 32
+};
+
+void IgorEngine::debugPaintWalkAreas() {
+ _debugOverlayMode = kOverlayWalkAreas;
+ debugApplyOverlay();
+}
+
+void IgorEngine::debugPaintHotspots() {
+ _debugOverlayMode = kOverlayHotspots;
+ debugApplyOverlay();
+}
+
+void IgorEngine::debugClearOverlay() {
+ _debugOverlayMode = kOverlayOff;
+ // Undo the palette ramp written by debugApplyOverlay().
+ setPaletteRange(240, 255);
+}
+
+void IgorEngine::debugApplyOverlay() {
+ if (_debugOverlayMode == kOverlayOff) {
+ return;
+ }
+
+ // Recolour palette entries 240..255 (6-bit -> 8-bit, same expansion as
+ // updatePalette()) so each id is a distinct colour.
+ uint8 pal[16 * 3];
+ for (int i = 0; i < 16 * 3; ++i) {
+ uint8 v = kDebugOverlayPalette[i];
+ pal[i] = (v << 2) | (v >> 4);
+ }
+ _system->getPaletteManager()->setPalette(pal, 240, 16);
+
+ memcpy(_debugOverlayBuffer, _screenVGA, 320 * 144);
+ for (int y = 0; y < 144; ++y) {
+ const uint8 *mask = _screenLayer2 + y * 320;
+ uint8 *dst = _debugOverlayBuffer + y * 320;
+ for (int x = 0; x < 320; ++x) {
+ const RoomObjectArea &roa = _roomObjectAreasTable[mask[x]];
+ uint8 id = (_debugOverlayMode == kOverlayWalkAreas) ? roa.area : roa.object;
+ if (id != 0) {
+ dst[x] = 240 + (id & 0x0F);
+ }
+ }
+ }
+ _system->copyRectToScreen(_debugOverlayBuffer, 320, 0, _screenVGAVOffset, 320, 144);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 9068df00a1b..18fdf1556a1 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -51,6 +51,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_inventoryPanelBuffer = (uint8 *)malloc(9600 * 2);
_inventoryImagesBuffer = (uint8 *)malloc(48000);
_verbsPanelBuffer = (uint8 *)malloc(3840);
+ _debugOverlayBuffer = (uint8 *)malloc(320 * 144);
{ // hardcoded now
_game.ovlFileName = "igor.exe";
@@ -59,8 +60,9 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.flags = kFlagTalkie;
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- _currentPart = 850;
+ // _currentPart = 850;
// _currentPart = 61;
+ _currentPart = 40;
}
// if (_game.flags & kFlagFloppy) {
@@ -86,6 +88,7 @@ IgorEngine::~IgorEngine() {
free(_inventoryPanelBuffer);
free(_inventoryImagesBuffer);
free(_verbsPanelBuffer);
+ free(_debugOverlayBuffer);
// DebugMan.clearAllDebugChannels();
@@ -103,6 +106,7 @@ Common::String IgorEngine::getGameId() const {
void IgorEngine::restart() {
_screenVGAVOffset = 0;
+ _debugOverlayMode = kOverlayOff;
memset(&_gameState, 0, sizeof(_gameState));
_nextTimer = 0;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 08fa075c4bb..70978f0d0be 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -220,6 +220,12 @@ enum Verb {
kVerbGive
};
+enum DebugOverlay {
+ kOverlayOff = 0,
+ kOverlayWalkAreas,
+ kOverlayHotspots
+};
+
enum {
kIdEngDemo100,
kIdEngDemo110,
@@ -324,6 +330,9 @@ private:
uint8 *_verbsPanelBuffer;
int _screenVGAVOffset;
+ uint8 *_debugOverlayBuffer;
+ int _debugOverlayMode;
+
bool _eventQuitGame;
GameStateData _gameState;
uint32 _nextTimer;
@@ -442,19 +451,17 @@ private:
void PART_06();
void PART_06_UPDATE_ROOM_BACKGROUND();
void PART_06_EXEC_ACTION(int action);
-
void PART_06_ACTION_102();
-
void PART_06_HELPER_2();
-
void PART_06_HELPER_3();
-
void PART_06_HELPER_8(int frame);
-
void PART_06_HELPER_6(int num);
-
void PART_06_HELPER_1(int frame);
+
+ void PART_100();
+ void PART_100_DRAW_IGOR();
+
void PART_85();
void PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
void PART_85_HELPER_2();
@@ -516,6 +523,8 @@ private:
void decodeRoomAreas(const uint8 *p, int count);
void decodeRoomMask(const uint8 *p);
+ void debugApplyOverlay();
+
int getPart() const { return _currentPart / 10; }
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; }
@@ -575,6 +584,13 @@ public:
void handlePause();
+ // Debug overlays (console: paint_walk / paint_hotspots / paint_off).
+ // Paint the mask regions whose BOX record has a non-zero walk area or
+ // object; applied on top of the presented frame until cleared.
+ void debugPaintWalkAreas();
+ void debugPaintHotspots();
+ void debugClearOverlay();
+
/**
* Uses a serializer to allow implementing savegame
* loading and saving using a single method
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index d73286c7c96..f12fc78bcb6 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -31,6 +31,9 @@ static const uint8 kSentenceColorIndex[] = { 0xFD, 0xFB, 0xF1 };
void IgorEngine::waitForTimer(int ticks) {
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
+ if (_debugOverlayMode != kOverlayOff) {
+ debugApplyOverlay();
+ }
_system->updateScreen();
uint32 endTicks = (ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 6d1a9d239cd..109be934d53 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -3,6 +3,7 @@ MODULE := engines/igor
MODULE_OBJS = \
igor.o \
console.o \
+ debug.o \
metaengine.o \
walk.o \
palette.o \
@@ -17,6 +18,7 @@ MODULE_OBJS = \
part_85.o \
part_90.o \
part_6.o \
+ part_100.o \
text.o \
part_main.o \
sound.o
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index c82a3ea36db..0d78741b457 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -67,17 +67,6 @@ void IgorEngine::PART_05() {
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
- // {
- // _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();
- // }
enterPartLoop();
while (_currentPart >= 50 && _currentPart <= 52) {
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 5a2816bc1cb..b93d012b517 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -367,12 +367,12 @@
#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_Decanato 346
+#define FRM_Decanato1 347
+#define FRM_Decanato2 348
+#define FRM_Decanato3 349
+#define FRM_Decanato4 350
+#define FRM_Decanato5 351
#define DAT_DeanPepperOffice 352
#define DAT_AdministrationSecretaryRoom 353
#define TXT_AdministrationSecretaryRoom 354
@@ -471,4 +471,24 @@
#define STR_SharewarePenduloAddress5 447
#define STR_SharewarePenduloAddress6 448
+// OutsideAdministrationBuilding street panels. Not in the original CD table (it
+// jumps from FRM_OutsideAdministrationBuilding5=351 straight to
+// DAT_DeanPepperOffice=352). They are added to the generator's CD catalog
+// (reference/scummvm-create-igortbl/resource_sp_cdrom.h) and shipped inside
+// IGOR.TBL, so the engine loads them through the regular findData()/loadData()
+// path like every other room. The ids are far above the original max (~448) so
+// they can never collide with a real table id.
+// A = left panel, PART100_bg (scrolled in towards the map; ANM slot 0x0)
+// B = right panel, C1 arrival (what part 100 shows on entry)
+#define PAL_DecanatoA 900
+#define IMG_DecanatoA 901
+#define MSK_DecanatoA 902
+#define BOX_DecanatoA 903
+#define PAL_DecanatoB 904
+#define IMG_DecanatoB 905
+#define MSK_DecanatoB 906
+#define BOX_DecanatoB 907
+#define TXT_DecanatoA 908
+#define TXT_DecanatoB 909
+
#endif // IGOR_RESOURCE_IDS
Commit: 2ce1680a35d478a448adda5d68248758af7dae23
https://github.com/scummvm/scummvm/commit/2ce1680a35d478a448adda5d68248758af7dae23
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:48+01:00
Commit Message:
IGOR: Part 100
Changed paths:
A engines/igor/part_100.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 70978f0d0be..a22f9e93045 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -460,7 +460,8 @@ private:
void PART_100();
- void PART_100_DRAW_IGOR();
+ void PART_100_EXEC_ACTION(int action);
+ void PART_100_SCROLL_LEFT();
void PART_85();
void PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
@@ -611,6 +612,7 @@ protected:
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_100_ROOM_DATA_OFFSETS;
};
extern IgorEngine *g_engine;
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index f12fc78bcb6..1925117d250 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -294,6 +294,12 @@ void IgorEngine::handleRoomInput() {
// } else {
_actionCode = _roomActionsTable[_roomDataOffsets.action.defaultVerb + _currentAction.verb * 2 + _currentAction.object1Num * 20];
// }
+ // The original only exposes a room object when this action byte is
+ // non-zero; otherwise hover text is verb-only. cseg175:2C8B-2CBC.
+ if (_currentPart >= 100 && _currentPart <= 102 && // cseg175:29AA-29B5
+ _actionCode == 0 && _currentAction.object1Type == kObjectTypeRoom) {
+ _currentAction.object1Num = 0;
+ }
}
if (_currentAction.verbType == 1) {
diff --git a/engines/igor/part_100.cpp b/engines/igor/part_100.cpp
new file mode 100644
index 00000000000..e3565f1cab0
--- /dev/null
+++ b/engines/igor/part_100.cpp
@@ -0,0 +1,266 @@
+/* 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 3 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+namespace {
+
+const uint32 kPart100PanelLeft = 0x0000; // cseg175:2809-2818
+const uint32 kPart100Frm1 = 0xB400; // cseg177:0002
+const uint32 kPart100Frm2 = 0xBC0A; // cseg177:0002
+const uint32 kPart100Frm3 = 0xC5E2; // cseg177:0002
+const uint32 kPart100Frm4 = 0xC786; // cseg177:0002
+const uint32 kPart100Frm5 = 0xC8AE; // cseg177:0002
+
+} // End of anonymous namespace
+
+void IgorEngine::PART_100_EXEC_ACTION(int action) {
+ // The action-to-function table is constructed at cseg175:08B2-09EA;
+ // its order differs from the disassembler's function listing order.
+ switch (action) {
+ case 101: // cseg175:08BC-08DA -> sub_175_00F2
+ ADD_DIALOGUE_TEXT(201, 1, 626);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 102:
+ // TODO: port the scripted door exit from cseg175:0770-087C.
+ // Its dispatch-table assignment is cseg175:08DE-08FC.
+ warning("PART_100 action 102 is not implemented (cseg175:0770-087C)");
+ break;
+ case 103: // cseg175:0900-091E -> sub_175_011F
+ ADD_DIALOGUE_TEXT(202, 1, 627);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 104:
+ // TODO: port the state-dependent bin animation exactly from
+ // cseg175:014C-026E. It must remain disabled until the s3:0x862
+ // object-state mapping and all four FRM1 frames are wired. Its
+ // dispatch-table assignment is cseg175:0922-0940.
+ warning("PART_100 action 104 is not implemented (cseg175:014C-026E)");
+ break;
+ case 105: // cseg175:0944-0962 -> sub_175_026F
+ ADD_DIALOGUE_TEXT(206, 1, 630);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 106: // cseg175:0966-0984 -> sub_175_02C9
+ ADD_DIALOGUE_TEXT(208, 1, 632);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 107: // cseg175:0988-09A6 -> sub_175_029C
+ ADD_DIALOGUE_TEXT(207, 1, 631);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 108:
+ // TODO: port the 41-step, eight-pixels-per-step horizontal pan and
+ // Igor compositing from cseg175:02F6-055A. Its dispatch assignment
+ // is cseg175:09AA-09C8. Do not jump to part 110 without the pan.
+ warning("PART_100 action 108 is not implemented (cseg175:02F6-055A)");
+ break;
+ case 109: // cseg175:09CC-09EA -> sub_175_055B
+ _currentPart = 40;
+ break;
+ default:
+ warning("PART_100_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+
+// Scroll to the LEFT: the left panel (PART100_bg) slides in from the left edge,
+// the active right panel (C1) exits right. Mirrors PART_06_ACTION_102
+// (part_6.cpp); the incoming strip is read straight from the stashed left panel
+// in the ANM buffer (row stride 320). layer1 is untouched by the pan, so it
+// still holds the outgoing right panel afterwards and can be kept for a later
+// scroll back.
+// void IgorEngine::PART_100_SCROLL_LEFT_ACTION() {
+// for (int i = 1; i < 29; ++i) {
+// 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 + ANM_PANEL_A + y * 320, i * 8);
+// }
+// memcpy(_screenVGA, _screenLayer2, 46080);
+// }
+// // PART_100_UPDATE_ROOM_BACKGROUND();
+// waitForTimer();
+// }
+// // Cut over: the left panel becomes the active room (sub_175_066B position).
+// PART_100_STASH_FAR_PANEL(); // keep the outgoing right panel for the way back
+// _currentPart = 101;
+// loadRoomData(PAL_OutsideAdministrationBuildingA, IMG_OutsideAdministrationBuildingA,
+// BOX_OutsideAdministrationBuildingA, MSK_OutsideAdministrationBuildingA, 0);
+// _walkDataCurrentIndex = 1;
+// _walkDataLastIndex = 1;
+// _walkData[1].setPos(136, 86, kFacingPositionRight, 0);
+// _walkData[1].setDefaultScale();
+// memcpy(_screenVGA, _screenLayer1, 46080);
+// PART_100_DRAW_IGOR();
+// }
+
+// // Scroll to the RIGHT (back to C1 / the arrival panel): the active left panel
+// // slides left while the right panel's strip enters from the right edge (mirrors
+// // PART_05_ACTION_102, part_5.cpp), sourced from the stashed far panel.
+// void IgorEngine::PART_100_SCROLL_RIGHT_ACTION() {
+// for (int i = 1; i < 29; ++i) {
+// 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, g_part100FarPanel + y * 320 + 320 - i * 8, i * 8);
+// }
+// memcpy(_screenVGA, _screenLayer2, 46080);
+// }
+// PART_100_UPDATE_ROOM_BACKGROUND();
+// waitForTimer();
+// }
+// // Cut over: back on the arrival panel (sub_175_056D position).
+// _currentPart = 100;
+// loadRoomData(PAL_OutsideAdministrationBuildingB, IMG_OutsideAdministrationBuildingB,
+// BOX_OutsideAdministrationBuildingB, MSK_OutsideAdministrationBuildingB, 0);
+// _walkDataCurrentIndex = 1;
+// _walkDataLastIndex = 1;
+// _walkData[1].setPos(319, 79, kFacingPositionLeft, 0);
+// _walkData[1].setDefaultScale();
+// memcpy(_screenVGA, _screenLayer1, 46080);
+// PART_100_DRAW_IGOR();
+// }
+void IgorEngine::PART_100_SCROLL_LEFT() {
+ uint8 *walkTable3 = loadData(WLK_);
+ 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_100() {
+ _gameState.enableLight = 1;
+
+ // cseg175:27C3-27D6 copies the 0x18C9-byte DAT; cseg175:27DB then
+ // loads the left panel, and cseg175:27E0 loads all five frame blobs.
+ loadActionData(DAT_Decanato);
+ loadRoomData(PAL_DecanatoA, IMG_DecanatoA, BOX_DecanatoA, MSK_DecanatoA, TXT_DecanatoA);
+ static const int frames1[] = { FRM_Decanato1, 0 };
+ static const int frames2[] = { FRM_Decanato2, 0 };
+ static const int frames3[] = { FRM_Decanato3, 0 };
+ static const int frames4[] = { FRM_Decanato4, 0 };
+ static const int frames5[] = { FRM_Decanato5, 0 };
+ loadAnimData(frames1, kPart100Frm1);
+ loadAnimData(frames2, kPart100Frm2);
+ loadAnimData(frames3, kPart100Frm3);
+ loadAnimData(frames4, kPart100Frm4);
+ loadAnimData(frames5, kPart100Frm5);
+
+ // Preserve the complete left panel at ANM+0, then make the right panel
+ // active. This load order is unconditional in cseg175:27DB-2845.
+ memcpy(_animFramesBuffer + kPart100PanelLeft, _screenLayer1, 46080); // cseg175:2809-2818
+ loadRoomData(PAL_DecanatoB, IMG_DecanatoB, BOX_DecanatoB, MSK_DecanatoB, TXT_DecanatoB);
+
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
+
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_100_EXEC_ACTION);
+ _roomDataOffsets = PART_100_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143); // cseg175 room mask is 320x144
+
+ memcpy(_screenVGA, _screenLayer1, 46080); // cseg175:28EA-28F9
+ _currentAction.verb = kVerbWalk; // cseg175:2944-2952
+ _walkDataLastIndex = 1; // cseg175:295F
+ _walkDataCurrentIndex = 1; // cseg175:2964
+ fadeIn(768); // cseg175:2957-295A
+
+ if (_currentPart == 100) {
+ // sub_175_056D: enter at (319,79), facing left, walk to (288,84).
+ _walkData[0].setPos(319, 79, kFacingPositionLeft, 0); // cseg175:0580-05B2
+ _walkData[0].setDefaultScale();
+ _walkDataLastIndex = 0;
+ buildWalkPath(319, 79, 288, 84); // cseg175:05C1-05CB
+ _walkData[_walkDataLastIndex].frameNum = 0; // cseg175:05D0-05DB
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true; // cseg175:05E2
+ waitForIgorMove();
+ } else if (_currentPart == 101) {
+ // sub_175_066B: enter at (136,86), facing right, walk to (171,97).
+ _walkData[0].setPos(136, 86, kFacingPositionRight, 0); // cseg175:0686-06B7
+ _walkData[0].setDefaultScale();
+ _walkDataLastIndex = 0;
+ buildWalkPath(136, 86, 171, 97); // cseg175:06C6-06D0
+ _walkData[_walkDataLastIndex].frameNum = 0; // cseg175:06D5-06E0
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true; // cseg175:06E7
+ waitForIgorMove();
+ } else {
+ // Part 102 deliberately has no entry-position assignment in
+ // cseg175:2969-297C; it reuses the existing walk state.
+ moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
+ }
+
+ enterPartLoop();
+ while (_currentPart >= 100 && _currentPart <= 102) { // cseg175:29AA-29B5
+ runPartLoop();
+ }
+ leavePartLoop();
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 52c3b1f612c..cf02ae22615 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -74,6 +74,12 @@ void IgorEngine::PART_MAIN() {
PART_06(); // Spring
break;
+ case 100:
+ case 101:
+ case 102:
+ PART_100(); // OutsideAdministrationBuilding street
+ break;
+
case 850: // Intro cutscene
// Clear the entire screen buffer before starting the intro cutscene
memset(_screenVGA, 0, 64000);
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index b93d012b517..3ee0fb1fa97 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -480,6 +480,8 @@
// they can never collide with a real table id.
// A = left panel, PART100_bg (scrolled in towards the map; ANM slot 0x0)
// B = right panel, C1 arrival (what part 100 shows on entry)
+// TXT A/B include the original walk-scale tables, names, and dialogue strings
+// loaded by cseg179:0002 and cseg178:0002 respectively.
#define PAL_DecanatoA 900
#define IMG_DecanatoA 901
#define MSK_DecanatoA 902
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index ae3c7c4b826..a6e7cf8c013 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -210,6 +210,11 @@ const RoomDataOffsets IgorEngine::PART_04_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0 }
};
-
+const RoomDataOffsets IgorEngine::PART_100_ROOM_DATA_OFFSETS = {
+ { 45, 3, 6, 2 }, // cseg175:17F9-1829: DAT+45, 3 records, 6-byte source, 2-byte destination
+ { 77, 90 }, // cseg175:1E22-1E68 and cseg175:1FBB-1FD3
+ { 95, 303, 3319, 199, 275, 84 }, // cseg175:1C41-1CA7, 1CE9-1D4F, 2C8B-2DEA
+ { 0, 0, 0, 0, 0 }
+};
} // End of namespace Igor
Commit: ece5beb79f9dcf9e041f7291b860c293fcb744e7
https://github.com/scummvm/scummvm/commit/ece5beb79f9dcf9e041f7291b860c293fcb744e7
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:48+01:00
Commit Message:
IGOR: Scrolls to 101
Changed paths:
engines/igor/igor.h
engines/igor/part_100.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index a22f9e93045..e3b015487cd 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -461,7 +461,7 @@ private:
void PART_100();
void PART_100_EXEC_ACTION(int action);
- void PART_100_SCROLL_LEFT();
+ void PART_100_ACTION_108();
void PART_85();
void PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
diff --git a/engines/igor/part_100.cpp b/engines/igor/part_100.cpp
index e3565f1cab0..6730b70bbc7 100644
--- a/engines/igor/part_100.cpp
+++ b/engines/igor/part_100.cpp
@@ -71,11 +71,8 @@ void IgorEngine::PART_100_EXEC_ACTION(int action) {
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 108:
- // TODO: port the 41-step, eight-pixels-per-step horizontal pan and
- // Igor compositing from cseg175:02F6-055A. Its dispatch assignment
- // is cseg175:09AA-09C8. Do not jump to part 110 without the pan.
- warning("PART_100 action 108 is not implemented (cseg175:02F6-055A)");
+ case 108: // cseg175:09AA-09C8 -> sub_175_02F6
+ PART_100_ACTION_108();
break;
case 109: // cseg175:09CC-09EA -> sub_175_055B
_currentPart = 40;
@@ -144,54 +141,51 @@ void IgorEngine::PART_100_EXEC_ACTION(int action) {
// memcpy(_screenVGA, _screenLayer1, 46080);
// PART_100_DRAW_IGOR();
// }
-void IgorEngine::PART_100_SCROLL_LEFT() {
- uint8 *walkTable3 = loadData(WLK_);
- uint8 *walkTable4 = loadData(WLK_Bridge4);
- int xPos = 220;
+void IgorEngine::PART_100_ACTION_108() {
+ // sub_175_02F6 (cseg175:02F6-055A): the 41-step, eight-pixels-per-step
+ // horizontal pan that carries Igor leftward out of the decanato street and
+ // into part 110. Mirrors PART_06_ACTION_102 (part_6.cpp); the composite has
+ // no occlusion check and the incoming strip is read from the stashed left
+ // panel in the ANM buffer with a 320-pixel row stride.
+ uint8 *walkTable = loadData(WLK_DecanatoA); // cseg175:03E7-0409 walk line
+ int xPos = 329; // cseg175:030C r5-2 = 0x149
int yPos = 0;
- int i = 1;
+ int i = 1; // cseg175:0310 r5-7
do {
- if (compareGameTick(1, 16)) {
+ if (compareGameTick(1, 16)) { // cseg175:031B frame gate ((EACA+1) % 16 == 0)
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);
+ memcpy(_screenLayer2 + y * 320 + i * 8, _screenLayer1 + y * 320, 320 - i * 8);
+ // blit2: cseg175:0353 src = ANM + kPart100PanelLeft + y*320 + (0x140 - i*8)
+ memcpy(_screenLayer2 + y * 320, _animFramesBuffer + kPart100PanelLeft + y * 320 + 320 - i * 8, i * 8);
}
- if (i < 15) {
- xPos += _walkScaleTable[0x8F9 + _walkCurrentFrame];
- assert(xPos >= 205);
- yPos = walkTable3[xPos - 205];
- WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame);
+ if (i < 9) { // cseg175:03C7-03CB, walk update while i < 9
+ xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame]; // cseg175:03CD-03E1 (s3:0x121D+frame)
+ assert(xPos >= 260);
+ yPos = walkTable[xPos - 260]; // cseg175:03E7-0409 (index base 0x104)
+ WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame); // cseg175:0413-0421 (wrap 8 -> 1)
} else {
- _walkCurrentFrame = 0;
+ _walkCurrentFrame = 0; // cseg175:0427
}
- int yOffset = (yPos - 50) * 320 + xPos - 15 - i * 8;
- for (_gameState.counter[1] = 0; _gameState.counter[1] <= 49; ++_gameState.counter[1]) {
+ int yOffset = (yPos - 50) * 320 + xPos - 330 + i * 8; // cseg175:042C (r5-6)
+ for (int row = 0; row <= 49; ++row) {
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]];
+ for (int col = 0; col <= 29; ++col) {
+ uint8 color = _facingIgorFrames[kFacingPositionLeft - 1][_walkCurrentFrame * 1500 + row * 30 + col];
if (color != 0) {
- _screenLayer2[yOffset + _gameState.counter[2]] = color;
+ _screenLayer2[yOffset + col] = color;
}
}
}
- memcpy(_screenVGA, _screenLayer2, 46080);
+ memcpy(_screenVGA, _screenLayer2, 46080); // cseg175:04D6-04E0 repz movsw (see part_05/06)
++i;
}
- PART_05_UPDATE_ROOM_BACKGROUND();
- waitForTimer();
- } while (i != 29);
- free(walkTable3);
- free(walkTable4);
+ waitForTimer(); // cseg175:04E6-04F5 busy wait + EACA wrap
+ } while (i != 41); // cseg175:0507 exit when i == 0x29
+ free(walkTable);
WalkData *wd = &_walkData[0];
- wd->setPos(xPos - 224, yPos, 2, 0);
+ wd->setPos(xPos + 5, yPos, kFacingPositionLeft, 0); // cseg175:0513-0538 (D168 = xPos+5, D16A = yPos, D16C = 4)
wd->setDefaultScale();
- _currentPart = 60;
+ _currentPart = 101; // cseg175:0543-054B (s3:0x321A = 0x6E)
}
void IgorEngine::PART_100() {
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 3ee0fb1fa97..ede30e0c723 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -492,5 +492,11 @@
#define BOX_DecanatoB 907
#define TXT_DecanatoA 908
#define TXT_DecanatoB 909
+// Pan walk line used by sub_175_02F6 (cseg175:03E7-0409) and the part 110 pan
+// (cseg176:05A6): yPos = line[xPos - 260]. Recovered from the uncatalogued
+// CD gap between DAT_OutsideAdministrationBuilding and FRM_..._1; see the
+// resource_sp_cdrom.h rows for the byte sources (A/B are byte-identical).
+#define WLK_DecanatoA 910
+#define WLK_DecanatoB 911
#endif // IGOR_RESOURCE_IDS
Commit: bebb50b47ab6988777e72ac98601b170e2295b87
https://github.com/scummvm/scummvm/commit/bebb50b47ab6988777e72ac98601b170e2295b87
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:49+01:00
Commit Message:
IGOR: Part 110
Changed paths:
A engines/igor/part_110.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_100.cpp
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index e3b015487cd..7fc992b7fc3 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -462,6 +462,13 @@ private:
void PART_100();
void PART_100_EXEC_ACTION(int action);
void PART_100_ACTION_108();
+ void PART_110();
+ void PART_110_EXEC_ACTION(int action);
+ void PART_110_ACTION_105();
+ void PART_110_ACTION_107();
+ void PART_110_ACTION_108();
+ void PART_110_ACTION_112();
+ void PART_110_APPLY_OBJECT_STATE(int num);
void PART_85();
void PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
@@ -613,6 +620,7 @@ protected:
static const RoomDataOffsets PART_05_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_06_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_100_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_110_ROOM_DATA_OFFSETS;
};
extern IgorEngine *g_engine;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 109be934d53..679efd758b9 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -19,6 +19,7 @@ MODULE_OBJS = \
part_90.o \
part_6.o \
part_100.o \
+ part_110.o \
text.o \
part_main.o \
sound.o
diff --git a/engines/igor/part_100.cpp b/engines/igor/part_100.cpp
index 6730b70bbc7..03cf838bc34 100644
--- a/engines/igor/part_100.cpp
+++ b/engines/igor/part_100.cpp
@@ -142,50 +142,42 @@ void IgorEngine::PART_100_EXEC_ACTION(int action) {
// PART_100_DRAW_IGOR();
// }
void IgorEngine::PART_100_ACTION_108() {
- // sub_175_02F6 (cseg175:02F6-055A): the 41-step, eight-pixels-per-step
- // horizontal pan that carries Igor leftward out of the decanato street and
- // into part 110. Mirrors PART_06_ACTION_102 (part_6.cpp); the composite has
- // no occlusion check and the incoming strip is read from the stashed left
- // panel in the ANM buffer with a 320-pixel row stride.
- uint8 *walkTable = loadData(WLK_DecanatoA); // cseg175:03E7-0409 walk line
- int xPos = 329; // cseg175:030C r5-2 = 0x149
+ uint8 *walkTable = loadData(WLK_DecanatoA); // cseg175:03E7-0409
+ int xPos = 329; // cseg175:030D
int yPos = 0;
- int i = 1; // cseg175:0310 r5-7
+ int i = 1; // cseg175:0312
do {
- if (compareGameTick(1, 16)) { // cseg175:031B frame gate ((EACA+1) % 16 == 0)
- for (int y = 0; y <= 143; ++y) {
+ if (compareGameTick(1, 16)) { // cseg175:0316-032C
+ for (int y = 0; y <= 143; ++y) { // cseg175:032F-03C4
memcpy(_screenLayer2 + y * 320 + i * 8, _screenLayer1 + y * 320, 320 - i * 8);
- // blit2: cseg175:0353 src = ANM + kPart100PanelLeft + y*320 + (0x140 - i*8)
memcpy(_screenLayer2 + y * 320, _animFramesBuffer + kPart100PanelLeft + y * 320 + 320 - i * 8, i * 8);
}
- if (i < 9) { // cseg175:03C7-03CB, walk update while i < 9
- xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame]; // cseg175:03CD-03E1 (s3:0x121D+frame)
+ if (i < 9) { // cseg175:03C7-0421
+ xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame];
assert(xPos >= 260);
- yPos = walkTable[xPos - 260]; // cseg175:03E7-0409 (index base 0x104)
- WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame); // cseg175:0413-0421 (wrap 8 -> 1)
+ yPos = walkTable[xPos - 260];
+ WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame);
} else {
- _walkCurrentFrame = 0; // cseg175:0427
+ _walkCurrentFrame = 0; // cseg175:0427
}
- int yOffset = (yPos - 50) * 320 + xPos - 330 + i * 8; // cseg175:042C (r5-6)
- for (int row = 0; row <= 49; ++row) {
- yOffset += 320;
+ int dstOffset = (yPos - 50) * 320 + xPos - 330 + i * 8; // cseg175:042C-0448
+ for (int row = 0; row <= 49; ++row) { // cseg175:044B-04CB
+ dstOffset += 320;
for (int col = 0; col <= 29; ++col) {
- uint8 color = _facingIgorFrames[kFacingPositionLeft - 1][_walkCurrentFrame * 1500 + row * 30 + col];
- if (color != 0) {
- _screenLayer2[yOffset + col] = color;
- }
+ const uint8 color = _facingIgorFrames[kFacingPositionLeft - 1][_walkCurrentFrame * 1500 + row * 30 + col];
+ if (color != 0)
+ _screenLayer2[dstOffset + col] = color;
}
}
- memcpy(_screenVGA, _screenLayer2, 46080); // cseg175:04D6-04E0 repz movsw (see part_05/06)
+ memcpy(_screenVGA, _screenLayer2, 46080); // cseg175:04CD-04E2
++i;
}
- waitForTimer(); // cseg175:04E6-04F5 busy wait + EACA wrap
- } while (i != 41); // cseg175:0507 exit when i == 0x29
+ waitForTimer(); // cseg175:04E6-0505
+ } while (i != 41); // cseg175:0507-050D
free(walkTable);
- WalkData *wd = &_walkData[0];
- wd->setPos(xPos + 5, yPos, kFacingPositionLeft, 0); // cseg175:0513-0538 (D168 = xPos+5, D16A = yPos, D16C = 4)
- wd->setDefaultScale();
- _currentPart = 101; // cseg175:0543-054B (s3:0x321A = 0x6E)
+ _walkData[0].setPos(xPos + 5, yPos, kFacingPositionLeft, 0); // cseg175:0510-053A
+ _walkData[0].setDefaultScale();
+ _currentPart = 110; // cseg175:0553
}
void IgorEngine::PART_100() {
@@ -205,6 +197,17 @@ void IgorEngine::PART_100() {
loadAnimData(frames3, kPart100Frm3);
loadAnimData(frames4, kPart100Frm4);
loadAnimData(frames5, kPart100Frm5);
+ if (_objectsState[67] == 1) { // cseg175:27E5-27EC; s3:0x865
+ for (int y = 0; y <= 7; ++y)
+ memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart100Frm4 + y * 37, 37); // cseg175:0002-0051
+ }
+ if (_objectsState[68] == 1) { // cseg175:27F1-27F8; s3:0x866
+ for (int y = 0; y <= 14; ++y)
+ memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart100Frm3 + y * 14, 14); // cseg175:0052-00A1
+ } else if (_objectsState[68] == 2) { // cseg175:27FD-2804
+ for (int y = 0; y <= 14; ++y)
+ memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart100Frm3 + 210 + y * 14, 14); // cseg175:00A2-00F1
+ }
// Preserve the complete left panel at ANM+0, then make the right panel
// active. This load order is unconditional in cseg175:27DB-2845.
diff --git a/engines/igor/part_110.cpp b/engines/igor/part_110.cpp
new file mode 100644
index 00000000000..a67565d7d3e
--- /dev/null
+++ b/engines/igor/part_110.cpp
@@ -0,0 +1,249 @@
+/* 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 3 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+namespace {
+
+const uint32 kPart110PanelRight = 0x0000; // cseg176:288C-289B
+const uint32 kPart110Frm1 = 0xB400; // cseg177:0002
+const uint32 kPart110Frm2 = 0xBC0A; // cseg177:0002
+const uint32 kPart110Frm3 = 0xC5E2; // cseg177:0002
+const uint32 kPart110Frm4 = 0xC786; // cseg177:0002
+const uint32 kPart110Frm5 = 0xC8AE; // cseg177:0002
+
+} // End of anonymous namespace
+
+void IgorEngine::PART_110_APPLY_OBJECT_STATE(int num) {
+ if (num == 1 || num == 255) // cseg176:09B3-09BD
+ _roomObjectAreasTable[13].object = _objectsState[66] == 0 ? 4 : 3; // cseg176:09BF-09D2; s3:0xDC98 = object field 13
+
+ if (num == 2 || num == 255) { // cseg176:09D2-09DC
+ if (_objectsState[67] == 1) { // cseg176:09DE-0A0E; s3:0x865
+ for (int y = 0; y <= 7; ++y)
+ memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart110Frm4 + y * 37, 37); // cseg176:0002-0051
+ _roomObjectAreasTable[11].object = 7;
+ } else {
+ _roomObjectAreasTable[11].object = 0;
+ }
+ }
+
+ if (num == 3 || num == 255) { // cseg176:0A34-0A3E
+ if (_objectsState[68] == 1) { // cseg176:0A40-0AAA; s3:0x866
+ for (int y = 0; y <= 14; ++y)
+ memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart110Frm3 + y * 14, 14); // cseg176:0052-00A1
+ _roomObjectAreasTable[8].object = 6;
+ } else if (_objectsState[68] == 2) {
+ for (int y = 0; y <= 14; ++y)
+ memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart110Frm3 + 210 + y * 14, 14); // cseg176:00A2-00F1
+ } else {
+ _roomObjectAreasTable[8].object = 0;
+ }
+ _roomObjectAreasTable[7].object = 6; // cseg176:0AA5; s3:0xDC7A = object field 7
+ _roomObjectAreasTable[8].object = 8; // cseg176:0AAA; s3:0xDC7F = object field 8
+ }
+}
+
+void IgorEngine::PART_110_ACTION_105() {
+ for (int frame = 0; frame <= 1; ++frame) { // cseg176:06F8-076D
+ for (int y = 0; y <= 48; ++y)
+ memcpy(_screenVGA + 0x6167 + y * 320, _animFramesBuffer + kPart110Frm1 + frame * 0x405 + y * 21, 21);
+ waitForTimer(127); // cseg176:075C-0766
+ }
+ // TODO: add inventory object 18 at slot 0x90F; the fork has no inventory-state API (cseg176:076F-07A9).
+ playSound(51, 1); // cseg176:07A5-07A9
+ _objectsState[66] = 1; // cseg176:07B3; s3:0x864
+ PART_110_APPLY_OBJECT_STATE(255); // cseg176:07B8-07BA
+}
+
+void IgorEngine::PART_110_ACTION_107() {
+ for (int frame = 0; frame <= 2; ++frame) { // cseg176:01C7-023C
+ for (int y = 0; y <= 27; ++y)
+ memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart110Frm5 + frame * 0x348 + y * 30, 30);
+ waitForTimer(61); // cseg176:022B-0235
+ }
+ // TODO: remove the inventory object indexed by s3:0x904; the fork has no inventory-state API (cseg176:023E-0281).
+ playSound(63, 1); // cseg176:027D-0281
+ _objectsState[68] = 1; // cseg176:0286; s3:0x866
+ PART_110_APPLY_OBJECT_STATE(255); // cseg176:0290-0292
+}
+
+void IgorEngine::PART_110_ACTION_108() {
+ uint8 *walkTable = loadData(WLK_DecanatoB); // cseg176:0584-05A6
+ int xPos = 310; // cseg176:04AE
+ int yPos = 0;
+ int i = 1; // cseg176:04B3
+ do {
+ if (compareGameTick(1, 16)) { // cseg176:04B7-04CD
+ for (int y = 0; y <= 143; ++y) { // cseg176:04D0-0565
+ memcpy(_screenLayer2 + y * 320, _screenLayer1 + y * 320 + i * 8, 320 - i * 8);
+ memcpy(_screenLayer2 + y * 320 + 320 - i * 8, _animFramesBuffer + kPart110PanelRight + y * 320, i * 8);
+ }
+ if (i < 9) { // cseg176:0568-05BE
+ xPos += _walkScaleTable[0x8F9 + _walkCurrentFrame];
+ assert(xPos >= 260);
+ yPos = walkTable[xPos - 260];
+ WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame);
+ } else {
+ _walkCurrentFrame = 0; // cseg176:05C4
+ }
+ int dstOffset = (yPos - 50) * 320 + xPos - 10 - i * 8; // cseg176:05C9-05E5
+ for (int row = 0; row <= 49; ++row) { // cseg176:05E8-0668
+ dstOffset += 320;
+ for (int col = 0; col <= 29; ++col) {
+ const uint8 color = _facingIgorFrames[kFacingPositionRight - 1][_walkCurrentFrame * 1500 + row * 30 + col];
+ if (color != 0)
+ _screenLayer2[dstOffset + col] = color;
+ }
+ }
+ memcpy(_screenVGA, _screenLayer2, 46080); // cseg176:066A-067F
+ ++i;
+ }
+ waitForTimer(); // cseg176:0683-06A2
+ } while (i != 41); // cseg176:06A4-06AA
+ free(walkTable);
+ _walkData[0].setPos(xPos - 315, yPos, kFacingPositionRight, 0); // cseg176:06AD-06EB
+ _walkData[0].setDefaultScale();
+ _currentPart = 102; // cseg176:06F0
+}
+
+void IgorEngine::PART_110_ACTION_112() {
+ for (int frame = 0; frame <= 2; ++frame) { // cseg176:00F2-0167
+ for (int y = 0; y <= 27; ++y)
+ memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart110Frm2 + frame * 0x348 + y * 30, 30);
+ waitForTimer(61); // cseg176:0156-0160
+ }
+ // TODO: add inventory object 23 at slot 0x914; the fork has no inventory-state API (cseg176:0169-01A3).
+ playSound(51, 1); // cseg176:019F-01A3
+ _objectsState[68] = 1; // cseg176:01AD; s3:0x866
+ _objectsState[26] = 1; // cseg176:01B9; s3:0x83C
+ PART_110_APPLY_OBJECT_STATE(3); // cseg176:01B2-01B4
+}
+
+void IgorEngine::PART_110_EXEC_ACTION(int action) {
+ switch (action) { // cseg176:07C1-09A8
+ case 101: // sub_176_0362
+ ADD_DIALOGUE_TEXT(201, 2, 616); // cseg176:036C-0388
+ SET_DIALOGUE_TEXT(1, 2);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 102: // sub_176_038F
+ ADD_DIALOGUE_TEXT(29, 1, 29); // cseg176:0399-03B5
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 103: // sub_176_03BC
+ ADD_DIALOGUE_TEXT(_objectsState[66] == 0 ? 203 : 204, 1, _objectsState[66] == 0 ? 617 : 618); // cseg176:03C6-03F7
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 104: // sub_176_03FE
+ ADD_DIALOGUE_TEXT(205, 1, 619); // cseg176:0408-0436
+ ADD_DIALOGUE_TEXT(206, 1, 620);
+ SET_DIALOGUE_TEXT(1, 2);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 105:
+ PART_110_ACTION_105();
+ break;
+ case 106: // sub_176_043D
+ ADD_DIALOGUE_TEXT(73, 1, 50); // cseg176:0447-0463
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 107:
+ PART_110_ACTION_107();
+ break;
+ case 108:
+ PART_110_ACTION_108();
+ break;
+ case 109: // sub_176_046A
+ ADD_DIALOGUE_TEXT(207, 1, 621); // cseg176:0474-0490
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 110: // sub_176_0299
+ ADD_DIALOGUE_TEXT(_objectsState[68] == 1 ? 208 : 209, 1, _objectsState[68] == 1 ? 622 : 623); // cseg176:02A3-02D4
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 111: // sub_176_0308
+ ADD_DIALOGUE_TEXT(210, 1, 624); // cseg176:0312-032E
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 112:
+ PART_110_ACTION_112();
+ break;
+ case 113: // sub_176_0335
+ ADD_DIALOGUE_TEXT(211, 1, 625); // cseg176:033F-035B
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 114: // sub_176_02DB
+ ADD_DIALOGUE_TEXT(29, 1, 29); // cseg176:02E5-0301
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ default:
+ warning("PART_110_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::PART_110() {
+ _gameState.enableLight = 1;
+ loadActionData(DAT_DecanatoPart110); // cseg176:286F-2882
+ loadRoomData(PAL_DecanatoB, IMG_DecanatoB, BOX_DecanatoB, MSK_DecanatoB, TXT_DecanatoB); // cseg176:2887
+ memcpy(_animFramesBuffer + kPart110PanelRight, _screenLayer1, 46080); // cseg176:288C-289B
+ loadRoomData(PAL_DecanatoA, IMG_DecanatoA, BOX_DecanatoA, MSK_DecanatoA, TXT_DecanatoA); // cseg176:28C8
+
+ static const int frames1[] = { FRM_Decanato1, 0 };
+ static const int frames2[] = { FRM_Decanato2, 0 };
+ static const int frames3[] = { FRM_Decanato3, 0 };
+ static const int frames4[] = { FRM_Decanato4, 0 };
+ static const int frames5[] = { FRM_Decanato5, 0 };
+ loadAnimData(frames1, kPart110Frm1); // cseg176:28CD; cseg177:0002
+ loadAnimData(frames2, kPart110Frm2);
+ loadAnimData(frames3, kPart110Frm3);
+ loadAnimData(frames4, kPart110Frm4);
+ loadAnimData(frames5, kPart110Frm5);
+
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_110_EXEC_ACTION); // cseg176:28D2; sub_176_07C1
+ _roomDataOffsets = PART_110_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143); // cseg176 room mask is 320x144
+ PART_110_APPLY_OBJECT_STATE(255); // cseg176:28D7-28D9; sub_176_09A9(-1)
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
+ _walkDataLastIndex = 1; // cseg176:29B6
+ _walkDataCurrentIndex = 1; // cseg176:29BB
+
+ enterPartLoop();
+ while (_currentPart == 110) { // cseg176:29DF-29E6
+ runPartLoop();
+ }
+ leavePartLoop();
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index cf02ae22615..d81f99ddef1 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -79,6 +79,9 @@ void IgorEngine::PART_MAIN() {
case 102:
PART_100(); // OutsideAdministrationBuilding street
break;
+ case 110:
+ PART_110(); // OutsideAdministrationBuilding street, left panel
+ break;
case 850: // Intro cutscene
// Clear the entire screen buffer before starting the intro cutscene
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index ede30e0c723..6ebcf48e624 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -498,5 +498,6 @@
// resource_sp_cdrom.h rows for the byte sources (A/B are byte-identical).
#define WLK_DecanatoA 910
#define WLK_DecanatoB 911
+#define DAT_DecanatoPart110 912 // cseg176:286F-2882; IGOR.EXE:0x68049B, size 0x1841
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index a6e7cf8c013..ba38d764e20 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -217,4 +217,11 @@ const RoomDataOffsets IgorEngine::PART_100_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_110_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 }, // cseg176 routes walks through the room mask; no area matrix
+ { 35, 52 }, // cseg176:1EE5-1F15, 207C
+ { 60, 309, 3255, 203, 279, 82 }, // cseg176:1E7B, 2DA6, 2E16, 2D60, 2D8A
+ { 0, 0, 0, 0, 0 }
+};
+
} // End of namespace Igor
Commit: 5c3660716bb72f42aa7510210ac1a3c12fd9b24d
https://github.com/scummvm/scummvm/commit/5c3660716bb72f42aa7510210ac1a3c12fd9b24d
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:49+01:00
Commit Message:
IGOR: Fix part 110 not being interactive
Changed paths:
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_100.cpp
engines/igor/part_110.cpp
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 7fc992b7fc3..21e1921ab81 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -461,6 +461,7 @@ private:
void PART_100();
void PART_100_EXEC_ACTION(int action);
+ void PART_100_ACTION_104();
void PART_100_ACTION_108();
void PART_110();
void PART_110_EXEC_ACTION(int action);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 1925117d250..d3cbe1c3b13 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -295,8 +295,10 @@ void IgorEngine::handleRoomInput() {
_actionCode = _roomActionsTable[_roomDataOffsets.action.defaultVerb + _currentAction.verb * 2 + _currentAction.object1Num * 20];
// }
// The original only exposes a room object when this action byte is
- // non-zero; otherwise hover text is verb-only. cseg175:2C8B-2CBC.
- if (_currentPart >= 100 && _currentPart <= 102 && // cseg175:29AA-29B5
+ // non-zero; otherwise hover text is verb-only. cseg175:2C8B-2CBC;
+ // cseg176:2CBC-2CED.
+ if (((_currentPart >= 100 && _currentPart <= 102) || // cseg175:29AA-29B5
+ _currentPart == 110) && // cseg176:29DF-29E6
_actionCode == 0 && _currentAction.object1Type == kObjectTypeRoom) {
_currentAction.object1Num = 0;
}
@@ -431,4 +433,3 @@ void IgorEngine::drawActionSentence(const char *sentence, uint8 color) {
}
} // End of namespace Igor
-
diff --git a/engines/igor/part_100.cpp b/engines/igor/part_100.cpp
index 03cf838bc34..2bdb2e9c2aa 100644
--- a/engines/igor/part_100.cpp
+++ b/engines/igor/part_100.cpp
@@ -36,9 +36,16 @@ void IgorEngine::PART_100_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 102:
- // TODO: port the scripted door exit from cseg175:0770-087C.
- // Its dispatch-table assignment is cseg175:08DE-08FC.
- warning("PART_100 action 102 is not implemented (cseg175:0770-087C)");
+ _roomObjectAreasTable[7].deltaLum = 3; // cseg175:077A; s3:0xDC7E
+ for (int area = 11; area <= 12; ++area)
+ _roomObjectAreasTable[area].area = 3; // cseg175:077F-07A1; s3:[area*5-9130]
+ --_walkDataLastIndex; // cseg175:07CA
+ buildWalkPath(170, 97, 100, 73); // cseg175:07CE-07D7
+ _walkData[_walkDataLastIndex].frameNum = 0; // cseg175:07DC-07E7
+ _walkDataCurrentIndex = 1; // cseg175:07E9
+ _gameState.igorMoving = true; // cseg175:07EE
+ waitForIgorMove(); // cseg175:07F3-0873
+ _currentPart = 70; // cseg175:0875
break;
case 103: // cseg175:0900-091E -> sub_175_011F
ADD_DIALOGUE_TEXT(202, 1, 627);
@@ -47,11 +54,7 @@ void IgorEngine::PART_100_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 104:
- // TODO: port the state-dependent bin animation exactly from
- // cseg175:014C-026E. It must remain disabled until the s3:0x862
- // object-state mapping and all four FRM1 frames are wired. Its
- // dispatch-table assignment is cseg175:0922-0940.
- warning("PART_100 action 104 is not implemented (cseg175:014C-026E)");
+ PART_100_ACTION_104(); // cseg175:0922-0940 -> sub_175_014C
break;
case 105: // cseg175:0944-0962 -> sub_175_026F
ADD_DIALOGUE_TEXT(206, 1, 630);
@@ -83,6 +86,36 @@ void IgorEngine::PART_100_EXEC_ACTION(int action) {
}
}
+void IgorEngine::PART_100_ACTION_104() {
+ if (_objectsState[64] == 1) { // cseg175:015A; s3:0x862
+ ADD_DIALOGUE_TEXT(205, 1, 629); // cseg175:0161-017D
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ return;
+ }
+
+ ADD_DIALOGUE_TEXT(203, 2, 628); // cseg175:0185-01A1
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue(); // cseg175:01A6
+
+ static const uint8 frameSelectors[] = { 0, 1, 0, 2 }; // cseg175:01CE-01D8; s3:0x1D2-0x1D5
+ for (int frame = 0; frame < 4; ++frame) { // cseg175:01AB-021B
+ for (int y = 0; y < 49; ++y) { // cseg175:01BC-0208
+ memcpy(_screenVGA + 0x595F + y * 320, // cseg175:01B7-01F7
+ _animFramesBuffer + kPart100Frm1 + frameSelectors[frame] * 0x682 + y * 34, // cseg175:01C7-01E4
+ 34); // cseg175:01FC-01FE
+ }
+ waitForTimer(31); // cseg175:020A-0214
+ }
+
+ // TODO: add inventory object 17 at slot s3:0x90E; the fork has no
+ // inventory-state API (cseg175:021D-024E).
+ playSound(51, 1); // cseg175:0253-0257
+ _objectsState[64] = 1; // cseg175:0261; s3:0x862
+}
+
// Scroll to the LEFT: the left panel (PART100_bg) slides in from the left edge,
// the active right panel (C1) exits right. Mirrors PART_06_ACTION_102
@@ -221,11 +254,17 @@ void IgorEngine::PART_100() {
_roomDataOffsets = PART_100_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143); // cseg175 room mask is 320x144
- memcpy(_screenVGA, _screenLayer1, 46080); // cseg175:28EA-28F9
- _currentAction.verb = kVerbWalk; // cseg175:2944-2952
+ // A normal entry presents the freshly loaded right panel. On the part 102
+ // handoff, the original jumps directly to the walk-index setup instead,
+ // preserving the completed pan (including Igor) already in screen VGA.
+ // cseg175:285B-2869, cseg175:295F.
+ if (_currentPart != 102) {
+ memcpy(_screenVGA, _screenLayer1, 46080); // cseg175:28EA-28F9
+ _currentAction.verb = kVerbWalk; // cseg175:2944-2952
+ fadeIn(768); // cseg175:2957-295A
+ }
_walkDataLastIndex = 1; // cseg175:295F
_walkDataCurrentIndex = 1; // cseg175:2964
- fadeIn(768); // cseg175:2957-295A
if (_currentPart == 100) {
// sub_175_056D: enter at (319,79), facing left, walk to (288,84).
@@ -247,11 +286,14 @@ void IgorEngine::PART_100() {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true; // cseg175:06E7
waitForIgorMove();
- } else {
- // Part 102 deliberately has no entry-position assignment in
- // cseg175:2969-297C; it reuses the existing walk state.
- moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
}
+ // Part 102 deliberately performs no entry redraw: the completed pan has
+ // already drawn Igor and stored his state in walk record 0.
+ // cseg175:2969-2981; cseg176:06AD-06F0.
+
+ _roomObjectAreasTable[7].deltaLum = 0; // cseg175:087D-0887; s3:0xDC7E
+ for (int area = 11; area <= 12; ++area)
+ _roomObjectAreasTable[area].area = 0; // cseg175:088C-08AE; s3:[area*5-9130]
enterPartLoop();
while (_currentPart >= 100 && _currentPart <= 102) { // cseg175:29AA-29B5
diff --git a/engines/igor/part_110.cpp b/engines/igor/part_110.cpp
index a67565d7d3e..02578a26175 100644
--- a/engines/igor/part_110.cpp
+++ b/engines/igor/part_110.cpp
@@ -33,25 +33,29 @@ void IgorEngine::PART_110_APPLY_OBJECT_STATE(int num) {
if (_objectsState[67] == 1) { // cseg176:09DE-0A0E; s3:0x865
for (int y = 0; y <= 7; ++y)
memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart110Frm4 + y * 37, 37); // cseg176:0002-0051
- _roomObjectAreasTable[11].object = 7;
+ for (int area = 10; area <= 11; ++area)
+ _roomObjectAreasTable[area].object = 7; // cseg176:09EA-0A0C; s3:[area*5-9129]
} else {
- _roomObjectAreasTable[11].object = 0;
+ for (int area = 10; area <= 11; ++area)
+ _roomObjectAreasTable[area].object = 0; // cseg176:0A10-0A32; s3:[area*5-9129]
}
}
if (num == 3 || num == 255) { // cseg176:0A34-0A3E
- if (_objectsState[68] == 1) { // cseg176:0A40-0AAA; s3:0x866
+ if (_objectsState[68] == 0) { // cseg176:0A40-0A6B; s3:0x866
+ for (int area = 7; area <= 8; ++area)
+ _roomObjectAreasTable[area].object = 0; // cseg176:0A47-0A69; s3:[area*5-9129]
+ } else if (_objectsState[68] == 1) { // cseg176:0A6D-0A9A
for (int y = 0; y <= 14; ++y)
memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart110Frm3 + y * 14, 14); // cseg176:0052-00A1
- _roomObjectAreasTable[8].object = 6;
+ for (int area = 7; area <= 8; ++area)
+ _roomObjectAreasTable[area].object = 6; // cseg176:0A76-0A98; s3:[area*5-9129]
} else if (_objectsState[68] == 2) {
for (int y = 0; y <= 14; ++y)
memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart110Frm3 + 210 + y * 14, 14); // cseg176:00A2-00F1
- } else {
- _roomObjectAreasTable[8].object = 0;
+ _roomObjectAreasTable[7].object = 6; // cseg176:0AA5; s3:0xDC7A
+ _roomObjectAreasTable[8].object = 8; // cseg176:0AAA; s3:0xDC7F
}
- _roomObjectAreasTable[7].object = 6; // cseg176:0AA5; s3:0xDC7A = object field 7
- _roomObjectAreasTable[8].object = 8; // cseg176:0AAA; s3:0xDC7F = object field 8
}
}
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index ba38d764e20..f81a5e5fa6e 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -220,7 +220,7 @@ const RoomDataOffsets IgorEngine::PART_100_ROOM_DATA_OFFSETS = {
const RoomDataOffsets IgorEngine::PART_110_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 }, // cseg176 routes walks through the room mask; no area matrix
{ 35, 52 }, // cseg176:1EE5-1F15, 207C
- { 60, 309, 3255, 203, 279, 82 }, // cseg176:1E7B, 2DA6, 2E16, 2D60, 2D8A
+ { 59, 309, 3255, 203, 279, 82 }, // cseg176:2CBC-2CE5 (action); +60 is its walk behavior at 1E7B,2026,2061
{ 0, 0, 0, 0, 0 }
};
Commit: 854cfcd440a4513258028bdd78720ef78db313e3
https://github.com/scummvm/scummvm/commit/854cfcd440a4513258028bdd78720ef78db313e3
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:50+01:00
Commit Message:
IGOR: CD Music
Changed paths:
engines/igor/igor.cpp
engines/igor/part_85.cpp
engines/igor/sound.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 18fdf1556a1..2d0d900176a 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -60,9 +60,9 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.flags = kFlagTalkie;
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- // _currentPart = 850;
+ _currentPart = 850;
// _currentPart = 61;
- _currentPart = 40;
+ // _currentPart = 40;
}
// if (_game.flags & kFlagFloppy) {
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index 7e298f1e5c7..f1ec6afb65e 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -44,7 +44,9 @@ void IgorEngine::PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action) {
void IgorEngine::PART_85() {
- playMusic(2);
+ if(_game.flags & kFlagFloppy) {
+ playMusic(2);
+ } else playMusic(11);
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
memcpy(_screenLayer2, _screenLayer1, 46080);
loadRoomData(PAL_SpringBridgeIntro, IMG_SpringBridgeIntro, 0, 0, TXT_SpringBridgeIntro);
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 4582f5e34aa..db9447d3a48 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -20,6 +20,7 @@
*/
#include "audio/decoders/raw.h"
#include "audio/decoders/voc.h"
+#include "backends/audiocd/audiocd.h"
#include "igor/igor.h"
@@ -35,6 +36,8 @@ void IgorEngine::playMusic(int num) {
// startMusic(cmf[num]);
} else {
// TODO: play CD track
+ g_system->getAudioCDManager()->stop();
+ g_system->getAudioCDManager()->play(num, -1, 0, 0);
}
}
Commit: 0d9d1722501847fca60ec6515eca6d59efa0006e
https://github.com/scummvm/scummvm/commit/0d9d1722501847fca60ec6515eca6d59efa0006e
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:50+01:00
Commit Message:
IGOR: intro LOGO
Changed paths:
engines/igor/igor.h
engines/igor/part_85.cpp
engines/igor/resource_ids.h
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 21e1921ab81..102d0fa6525 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -474,6 +474,7 @@ private:
void PART_85();
void PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
void PART_85_HELPER_2();
+ void displayLogo();
void PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action);
void PART_85_UPDATE_ROOM_BACKGROUND();
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index f1ec6afb65e..5cac7b9c217 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -56,63 +56,63 @@ void IgorEngine::PART_85() {
_updateDialogue = &IgorEngine::PART_85_UPDATE_DIALOGUE_PHILIP_LAURA;
_updateRoomBackground = &IgorEngine::PART_85_UPDATE_ROOM_BACKGROUND;
VAR_WATER_SOUND_PLAYING = true;
- playSound(17, 1);
+ // playSound(17, 1);
decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true);
fadeIn(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;
+ // 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();
@@ -146,6 +146,9 @@ void IgorEngine::PART_85() {
waitForEndOfIgorDialogue();
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
PART_85_HELPER_1(0x74CA, 0xA6C4, 10, 24, 16);
+ if (_game.version == kIdSpaCD) {
+ displayLogo(); // cseg209:0x12B5
+ }
PART_85_EXIT:
stopSound();
@@ -162,6 +165,85 @@ PART_85_EXIT:
_updateRoomBackground = 0;
}
+void IgorEngine::displayLogo() {
+ // The CD executable preserves the last intro frame while it displays a
+ // 320x122 title card, then restores that frame before entering part 61.
+ memcpy(_screenTextLayer, _screenVGA, 46080); // cseg209:0x03EE-0x0400
+ playSound(65, 1); // cseg209:0x041C-0x0420
+
+ memcpy(_paletteBuffer, _currentPalette, 768); // cseg209:0x0425-0x0432
+ loadData(PAL_IgorIntroLogo, _currentPalette); // cseg209:0x0437-0x0460
+ _currentPalette[765] = 63; // cseg209:0x0465
+ _currentPalette[766] = 63; // cseg209:0x046A
+ _currentPalette[767] = 63; // cseg209:0x046F
+ updatePalette(768); // cseg209:0x0474-0x0486
+ loadData(IMG_IgorIntroLogo, _screenVGA); // cseg209:0x048B-0x04B8
+
+ for (int i = 0; i <= 200 / kTimerTicksCount; ++i) { // cseg209:0x04BD-0x04F2
+ PART_85_UPDATE_ROOM_BACKGROUND();
+ waitForTimer();
+ }
+
+ uint8 *subtitle = loadData(FRM_IgorIntroLogo); // cseg209:0x0002
+ for (int y = 0; y < 13; ++y) {
+ for (int x = 0; x < 206; ++x) {
+ const uint8 color = subtitle[y * 206 + x];
+ if (color != 255) {
+ _screenVGA[(130 + y) * 320 + 57 + x] = (color == 241) ? 0 : 255;
+ }
+ }
+ }
+ free(subtitle);
+
+ // Update the stored palette while exposing only color 255 to VGA.
+ // cseg209:0x04F9-0x05CB
+ for (int threshold = 63; threshold >= 0; threshold -= 3) {
+ for (int i = 0; i < 768; ++i) {
+ if (_paletteBuffer[i] >= threshold) {
+ const int color = _currentPalette[i] + 3;
+ _currentPalette[i] = MIN<int>(color, _paletteBuffer[i]);
+ }
+ }
+ setPaletteRange(255, 255); // cseg209:0x05BB-0x05BF
+ waitForTimer();
+ }
+
+ // The original counter runs in DOS timer units; waitForTimer() advances by
+ // kTimerTicksCount units. cseg209:0x05CE-0x0635
+ for (int i = 0; i <= 1500 / kTimerTicksCount; ++i) {
+ PART_85_UPDATE_ROOM_BACKGROUND();
+ waitForTimer();
+ if (_inputVars[kInputClick] || _inputVars[kInputEscape] || _inputVars[kInputOptions]) {
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputEscape] = 0;
+ _inputVars[kInputOptions] = 0;
+ break;
+ }
+ }
+
+ memcpy(_screenVGA, _screenTextLayer, 39040); // cseg209:0x0637-0x0649
+ memcpy(_currentPalette, _paletteBuffer, 765); // cseg209:0x064E-0x065B
+ setPaletteRange(0, 255); // cseg209:0x0660-0x0664
+
+ // // The original updates only color 255 here. The other palette changes stay
+ // // internal and therefore do not produce a visible fade. cseg209:0x0669-0x0705
+ // for (int threshold = 0; threshold <= 63; threshold += 3) {
+ // for (int i = 0; i < 768; ++i) {
+ // if (_paletteBuffer[i] >= threshold) {
+ // _currentPalette[i] = (_currentPalette[i] < 3) ? 0 : _currentPalette[i] - 3;
+ // }
+ // }
+ // setPaletteRange(255, 255); // cseg209:0x06F0-0x06F4
+ // waitForTimer();
+ // }
+
+ memcpy(_screenVGA, _screenTextLayer, 46080); // cseg209:0x0708-0x071A
+ _currentPalette[765] = 63; // cseg209:0x071F
+ _currentPalette[766] = 63; // cseg209:0x0724
+ _currentPalette[767] = 63; // cseg209:0x0729
+ setPaletteRange(255, 255); // cseg209:0x072E-0x0740
+}
+
void IgorEngine::PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay) {
do {
if (compareGameTick(0, delay)) {
@@ -210,7 +292,7 @@ void IgorEngine::PART_85_UPDATE_ROOM_BACKGROUND() {
if (!VAR_WATER_SOUND_PLAYING) {
return;
}
- if (_gameState.talkMode == kTalkModeTextOnly || !_gameState.dialogueTextRunning) {
+ if (_gameState.talkMode == kTalkModeTextOnly /*|| !_gameState.dialogueTextRunning*/) {
playSound(17, 1);
}
}
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 6ebcf48e624..83fcd9ca74f 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -500,4 +500,10 @@
#define WLK_DecanatoB 911
#define DAT_DecanatoPart110 912 // cseg176:286F-2882; IGOR.EXE:0x68049B, size 0x1841
+// CD-only end card shown by part 850. All three resources are contiguous in
+// NE segment 209 immediately after the intro code.
+#define FRM_IgorIntroLogo 913 // cseg209:13BE; IGOR.EXE:0x7C09BE, 206x13
+#define IMG_IgorIntroLogo 914 // cseg209:1E34; IGOR.EXE:0x7C1434, 320x122
+#define PAL_IgorIntroLogo 915 // cseg209:B6B4; IGOR.EXE:0x7CACB4, 768 bytes
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 523554dc53c..42640ba80ca 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -129,11 +129,13 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
_talkDelayCounter = _talkDelay;
_inputVars[kInputSkipDialogue] = 0;
}
- if (!isDialogueSpeechPlaying() && compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
- if (_talkSpeechCounter > 2) {
- if (_gameState.talkMode != kTalkModeTextOnly) {
+ // Speech completion ends the sentence; active speech does not suspend
+ // character animation. See cseg209:0x0802-0x0843.
+ if (_gameState.dialogueTextRunning && _gameState.talkMode != kTalkModeTextOnly && !isDialogueSpeechPlaying()) {
_talkDelayCounter = _talkDelay;
}
+ if (compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
+ if (_talkSpeechCounter > 2) {
if (_talkDelay == _talkDelayCounter) {
if (_updateDialogue) {
(this->*_updateDialogue)(kUpdateDialogueAnimEndOfSentence);
@@ -243,11 +245,13 @@ void IgorEngine::waitForEndOfIgorDialogue() {
_talkDelayCounter = _talkDelay;
_inputVars[kInputSkipDialogue] = 0;
}
- if (!isDialogueSpeechPlaying() && compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
- if (_talkSpeechCounter > 2) {
- if (_gameState.talkMode != kTalkModeTextOnly) {
+ // Speech completion ends the sentence; active speech does not suspend
+ // Igor's head animation. See cseg209:0x0B3D-0x0B7E.
+ if (_gameState.dialogueTextRunning && _gameState.talkMode != kTalkModeTextOnly && !isDialogueSpeechPlaying()) {
_talkDelayCounter = _talkDelay;
}
+ if (compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
+ if (_talkSpeechCounter > 2) {
if (_talkDelay == _talkDelayCounter) {
animateIgorTalking(0);
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
@@ -267,7 +271,7 @@ void IgorEngine::waitForEndOfIgorDialogue() {
}
}
} else {
- animateIgorTalking(getRandomNumber(6));
+ animateIgorTalking(getRandomNumber(5));
++_talkDelayCounter;
}
} else {
Commit: 4c0311702f836a86d9f30a1df8e3878c91ebcc71
https://github.com/scummvm/scummvm/commit/4c0311702f836a86d9f30a1df8e3878c91ebcc71
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:50+01:00
Commit Message:
IGOR: Fix random number generations
Changed paths:
engines/igor/part_5.cpp
engines/igor/part_6.cpp
engines/igor/part_85.cpp
engines/igor/text.cpp
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 0d78741b457..513715f6c43 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -182,7 +182,7 @@ void IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND() {
setPaletteRange(185, 191);
}
if (compareGameTick(1)) {
- switch (getRandomNumber(200)) {
+ switch (getRandomNumber(199)) {
case 0:
playSound(18, 1);
break;
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 9a29a0ed091..05e560170e5 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -41,7 +41,7 @@ void IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND() {
setPaletteRange(185, 191);
}
if (compareGameTick(1)) {
- switch (getRandomNumber(20)) {
+ switch (getRandomNumber(19)) {
case 0:
playSound(18, 1);
break;
@@ -210,8 +210,8 @@ void IgorEngine::PART_06() {
// handleRoomLight();
// }
PART_06_UPDATE_ROOM_BACKGROUND();
- if (compareGameTick(61) && _gameState.unkF && getRandomNumber(10) == 0) {
- PART_06_HELPER_8(getRandomNumber(4));
+ if (compareGameTick(61) && _gameState.unkF && getRandomNumber(9) == 0) {
+ PART_06_HELPER_8(getRandomNumber(3));
}
waitForTimer();
}
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index 5cac7b9c217..63f9a59c9f9 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -33,9 +33,9 @@ void IgorEngine::PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action) {
break;
case kUpdateDialogueAnimMiddleOfSentence:
if (VAR_CURRENT_TALKING_ACTOR != 0) {
- _gameState.counter[0] = getRandomNumber(5) + 8;
+ _gameState.counter[0] = getRandomNumber(4) + 8;
} else {
- _gameState.counter[0] = getRandomNumber(5) + 13;
+ _gameState.counter[0] = getRandomNumber(4) + 13;
}
decodeAnimFrame(getAnimFrame(0, 0x7480, _gameState.counter[0]), _screenVGA, true);
break;
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 42640ba80ca..b09e13ce743 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -132,8 +132,8 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
// Speech completion ends the sentence; active speech does not suspend
// character animation. See cseg209:0x0802-0x0843.
if (_gameState.dialogueTextRunning && _gameState.talkMode != kTalkModeTextOnly && !isDialogueSpeechPlaying()) {
- _talkDelayCounter = _talkDelay;
- }
+ _talkDelayCounter = _talkDelay;
+ }
if (compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
if (_talkSpeechCounter > 2) {
if (_talkDelay == _talkDelayCounter) {
@@ -248,8 +248,8 @@ void IgorEngine::waitForEndOfIgorDialogue() {
// Speech completion ends the sentence; active speech does not suspend
// Igor's head animation. See cseg209:0x0B3D-0x0B7E.
if (_gameState.dialogueTextRunning && _gameState.talkMode != kTalkModeTextOnly && !isDialogueSpeechPlaying()) {
- _talkDelayCounter = _talkDelay;
- }
+ _talkDelayCounter = _talkDelay;
+ }
if (compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
if (_talkSpeechCounter > 2) {
if (_talkDelay == _talkDelayCounter) {
@@ -290,6 +290,7 @@ void IgorEngine::waitForEndOfIgorDialogue() {
}
void IgorEngine::animateIgorTalking(int frame) {
+ debug("Animating Igor talking with frame: %d", frame);
if (getPart() == 4) {
return;
}
Commit: 4b9d02c5121a7150952c309dea0190a5fb921483
https://github.com/scummvm/scummvm/commit/4b9d02c5121a7150952c309dea0190a5fb921483
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:51+01:00
Commit Message:
IGOR: Renamings and docs
Changed paths:
engines/igor/igor.h
engines/igor/part_85.cpp
engines/igor/part_main.cpp
engines/igor/resource.cpp
engines/igor/room.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 102d0fa6525..043ed68470d 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -433,6 +433,7 @@ private:
bool isDialogueSpeechPlaying() const;
void PART_MAIN();
+ void moveScreenUp(int offset);
void EXEC_MAIN_ACTION(int action);
void PART_04_EXEC_ACTION(int action);
@@ -472,8 +473,8 @@ private:
void PART_110_APPLY_OBJECT_STATE(int num);
void PART_85();
- void PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
- void PART_85_HELPER_2();
+ void PART_85_HELPER_1_PLAY_ANIM(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
+ void PART_85_HELPER_2_SCROLL_RIGHT();
void displayLogo();
void PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action);
void PART_85_UPDATE_ROOM_BACKGROUND();
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index 63f9a59c9f9..3421511358f 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -47,77 +47,91 @@ void IgorEngine::PART_85() {
if(_game.flags & kFlagFloppy) {
playMusic(2);
} else playMusic(11);
+ // loads part5 room into memory
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
+ // copies current screenLayer1 into screenLayer2 to hold a copy
memcpy(_screenLayer2, _screenLayer1, 46080);
+ // loads part6 room into memory, intro starts there
loadRoomData(PAL_SpringBridgeIntro, IMG_SpringBridgeIntro, 0, 0, TXT_SpringBridgeIntro);
static const int anm[] = { ANM_PhilipLauraIntro, AOF_PhilipLauraIntro, ANM_LauraIntro, AOF_LauraIntro, 0 };
loadAnimData(anm);
+ // copies part6 into screen buffer
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);
+ // In the CD version the water sound is embedded in the CD track
+ if(_game.flags & kFlagFloppy) {
+ VAR_WATER_SOUND_PLAYING = true;
+ playSound(17, 1);
+ }
fadeIn(768);
+ //decode first frame and paint it
+ decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true);
+
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();
+ //Laura does her hair
+ PART_85_HELPER_1_PLAY_ANIM(0, 0x7481, 2, 7, 32);
+ if (_inputVars[kInputEscape]) goto PART_85_EXIT;
+
+ // 3 lines of text
+ ADD_DIALOGUE_TEXT(201, 3, 545);
+ // 1 line in a new screen
+ ADD_DIALOGUE_TEXT(204, 1, 546);
+ SET_DIALOGUE_TEXT(1, 2);
+ startCutsceneDialogue(89, 56, 63, 63, 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_PLAY_ANIM(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_PLAY_ANIM(0, 0x7481, 2, 7, 32);
+ if (_inputVars[kInputEscape]) goto PART_85_EXIT;
+ PART_85_HELPER_1_PLAY_ANIM(0, 0x7481, 18, 37, 20);
+ if (_inputVars[kInputEscape]) goto PART_85_EXIT;
+ PART_85_HELPER_2_SCROLL_RIGHT();
VAR_WATER_SOUND_PLAYING = false;
stopSound();
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
- PART_85_HELPER_1(0x74CA, 0xA6C4, 1, 6, 32);
+ PART_85_HELPER_1_PLAY_ANIM(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();
@@ -133,8 +147,8 @@ void IgorEngine::PART_85() {
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[kInputEscapae]) goto PART_85_EXIT;
+ PART_85_HELPER_1_PLAY_ANIM(0x74CA, 0xA6C4, 7, 9, 32);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
_walkData[0].x = 250;
_walkData[0].y = 119;
@@ -145,7 +159,7 @@ void IgorEngine::PART_85() {
startIgorDialogue();
waitForEndOfIgorDialogue();
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
- PART_85_HELPER_1(0x74CA, 0xA6C4, 10, 24, 16);
+ PART_85_HELPER_1_PLAY_ANIM(0x74CA, 0xA6C4, 10, 24, 16);
if (_game.version == kIdSpaCD) {
displayLogo(); // cseg209:0x12B5
}
@@ -244,7 +258,7 @@ void IgorEngine::displayLogo() {
setPaletteRange(255, 255); // cseg209:0x072E-0x0740
}
-void IgorEngine::PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay) {
+void IgorEngine::PART_85_HELPER_1_PLAY_ANIM(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);
@@ -256,7 +270,7 @@ void IgorEngine::PART_85_HELPER_1(int frameOffset2, int frameOffset1, int firstF
} while (firstFrame <= lastFrame);
}
-void IgorEngine::PART_85_HELPER_2() {
+void IgorEngine::PART_85_HELPER_2_SCROLL_RIGHT() {
int x = 1;
do {
if (compareGameTick(0, 16)) {
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index d81f99ddef1..f576c830c19 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -86,23 +86,16 @@ void IgorEngine::PART_MAIN() {
case 850: // Intro cutscene
// Clear the entire screen buffer before starting the intro cutscene
memset(_screenVGA, 0, 64000);
+ g_engine->_screen->updateScreen();
_screenVGAVOffset = 24;
// copy the initial portion of the screen to the display, with the vertical offset
_system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, _screenVGAVOffset);
+ g_engine->_screen->updateScreen();
PART_85();
// Clears the bottom portion of the screen
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;
+ moveScreenUp(_screenVGAVOffset);
+ _screenVGAVOffset = 0;
_inputVars[kInputCursorXPos] = 160;
_inputVars[kInputCursorYPos] = 72;
_system->warpMouse(_inputVars[kInputCursorXPos], _inputVars[kInputCursorYPos]);
@@ -122,4 +115,20 @@ void IgorEngine::PART_MAIN() {
} while (_currentPart != kInvalidPart && !_eventQuitGame);
}
+/**
+ * Moves the screen up line by line from the selected offset down to 0
+ */
+void IgorEngine::moveScreenUp(int offset) {
+ _nextTimer = _system->getMillis() + 1000 / 60;
+ for (int y = offset; 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;
+ }
+}
+
} // End of namespace Igor
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 092f797d964..738025a6b41 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -168,6 +168,10 @@ ResourceEntry *IgorEngine::findData(int id) {
return re;
}
+/**
+ * Will load resource identified with id from the contents of IGOR.TBL.
+ * IGOR.TBL is produced externally using the same ids pointing to a given resource.
+ */
uint8 *IgorEngine::loadData(int id, uint8 *dst, int *size) {
debugC(9, kDebugResource, "loadData() id %d", id);
ResourceEntry *re = findData(id);
@@ -194,6 +198,8 @@ void IgorEngine::loadActionData(int act) {
void IgorEngine::loadAnimData(const int *anm, int loadOffset) {
if (loadOffset == 0) {
+ //clears the entire animation buffer which is big enough to hold screen
+ //and animations
memset(_animFramesBuffer, 0, 65535);
}
while (*anm) {
@@ -210,6 +216,9 @@ const uint8 *IgorEngine::getAnimFrame(int baseOffset, int tableOffset, int frame
return src + frameOffset - 1;
}
+/**
+ * extracts from src a frame and draws it into dst, optionally preserving text
+ */
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;
diff --git a/engines/igor/room.cpp b/engines/igor/room.cpp
index c7fbd2b3497..f5173a38236 100644
--- a/engines/igor/room.cpp
+++ b/engines/igor/room.cpp
@@ -137,6 +137,11 @@ void IgorEngine::decodeRoomText(const uint8 *p) {
decodeRoomStrings(p);
}
+/**
+ * Loads room palette into _paletteBuffer, pixels into _screenLayer1, boxes into
+ * _roomObjectAreasTable, mask into _screenLayer2, text into (_walkXScaleRoom, _walkYScaleRoom)
+ * _roomObjectNames & _globalDialogueTexts.
+ */
void IgorEngine::loadRoomData(int pal, int img, int box, int msk, int txt) {
if (pal != 0) {
loadData(pal, _paletteBuffer);
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index b09e13ce743..4b372b9714b 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -31,6 +31,10 @@ const uint8 IgorEngine::_sentenceColorIndex[]= { 0xFD, 0xFB, 0xF1 };
/**
* appends one DialogueText{num, count, sound} record into _dialogueTextsTable[] at index _dialogueTextsCount, then increments it.
* MAX_DIALOGUE_TEXTS = 6
+ * Game accumulates texts in _dialogeTextsTable, then displays them during dialogues.
+ *
+ * each call to ADD_DIALOGUE_TEXT is one screen of dialogue. Each dialogue
+ * can have multiple lines.
*/
void IgorEngine::ADD_DIALOGUE_TEXT(int num, int count, int sound) {
assert(_dialogueTextsCount < MAX_DIALOGUE_TEXTS);
@@ -41,11 +45,18 @@ void IgorEngine::ADD_DIALOGUE_TEXT(int num, int count, int sound) {
++_dialogueTextsCount;
}
+/**
+ * Set start and end of dialogue to be displayed
+ * start page of dialogues, count of dialogue screens
+ */
void IgorEngine::SET_DIALOGUE_TEXT(int start, int count) {
_dialogueTextsStart = start - 1;
_dialogueTextsCount = count;
}
+/**
+ * sets the positional state of the text to be displayed
+ */
void IgorEngine::fixDialogueTextPosition(int num, int count, int *x, int *y) {
int textLineWidth = 0;
for (int i = 0; i < count; ++i) {
@@ -76,6 +87,9 @@ void IgorEngine::fixDialogueTextPosition(int num, int count, int *x, int *y) {
*y = textY;
}
+/**
+ * Paints the text on the screen buffer
+ */
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;
@@ -88,7 +102,8 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
assert(_dialogueDirtyRectSize < 320 * 72);
/**
- * Clear previous text line
+ * Clear previous text line from the screen text layer by copying the corresponding
+ * portion from the VGA screen buffer.
*/
memcpy(_screenTextLayer, _screenVGA + _dialogueDirtyRectY, _dialogueDirtyRectSize);
memcpy(_screenTextLayer + 320 * 72, _screenVGA + _dialogueDirtyRectY, _dialogueDirtyRectSize);
@@ -103,9 +118,11 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
}
setPaletteColor(kTalkColor, r, g, b);
setPaletteColor(kTalkShadowColor, 0, 0, 0);
+ // Only update the VGA screen buffer if not in spech-only mode
if (_gameState.talkMode != kTalkModeSpeechOnly) {
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer, _dialogueDirtyRectSize);
}
+ // If on text mode, the game has a text delay
if (_gameState.talkMode == kTalkModeTextOnly) {
_talkDelay = (2 * dt->count) * _talkDelays[_gameState.talkSpeed];
_talkDelayCounter = 0;
@@ -114,14 +131,19 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
_talkDelayCounter = 0;
}
if (_gameState.talkMode != kTalkModeTextOnly) {
+ // Play speech
playSound(dt->sound, 0);
}
_gameState.dialogueTextRunning = true;
_inputVars[kInputSkipDialogue] = 0;
}
+/**
+ * Loop for character talking
+ */
void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b) {
do {
+ // stop speech if skip dialogue hit
if (_gameState.dialogueTextRunning && _inputVars[kInputSkipDialogue]) {
if (_mixer->isSoundHandleActive(_speechHandle)) {
_mixer->stopHandle(_speechHandle);
Commit: d8f1e509fe5f2f0117e8810f8c89325538a4402a
https://github.com/scummvm/scummvm/commit/d8f1e509fe5f2f0117e8810f8c89325538a4402a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:51+01:00
Commit Message:
IGOR: Draw Inventory
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/palette.cpp
engines/igor/part_5.cpp
engines/igor/part_6.cpp
engines/igor/part_85.cpp
engines/igor/part_main.cpp
engines/igor/sound.cpp
engines/igor/static_cursor.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 2d0d900176a..a2ee2c34554 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -139,8 +139,8 @@ void IgorEngine::restart() {
// memset(_dialogueInfo, 0, sizeof(_dialogueInfo));
memset(_objectsState, 0, sizeof(_objectsState));
- // memcpy(_inventoryImages, INVENTORY_IMG_INIT, 36);
- // memset(_inventoryInfo, 0, sizeof(_inventoryInfo));
+ 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));
@@ -155,7 +155,7 @@ void IgorEngine::restart() {
_executeRoomAction = 0;
// _previousMusic = 0;
// _musicData = 0;
- // _scrollInventory = false;
+ _scrollInventory = false;
_roomCursorOn = true;
_currentCursor = 0;
// _dialogueCursorOn = true;
@@ -255,6 +255,99 @@ void IgorEngine::runPartLoop() {
waitForTimer();
}
+
+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;
+ // Paint inventory icons
+ 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;
+ }
+ // Hide arrows
+ 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::executeAction(int action) {
debugC(9, kDebugEngine, "executeAction %d", action);
assert(action < 200);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 043ed68470d..2364e796658 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -356,6 +356,9 @@ private:
uint8 _actionWalkPoint;
int16 _inputVars[kInputVarCount];
+
+ bool _scrollInventory;
+ int _scrollInventoryStartY, _scrollInventoryEndY, _scrollInventoryDy;
WalkData _walkData[100];
uint8 _walkCurrentPos;
uint8 _walkDataLastIndex;
@@ -376,6 +379,8 @@ private:
uint8 _objectsState[112];
+ uint8 _inventoryImages[36];
+ uint8 _inventoryInfo[74];
char _verbPrepositions[3][7];
char _roomObjectNames[20][MAX_OBJECT_NAME_LENGTH];
char _globalObjectNames[35][MAX_OBJECT_NAME_LENGTH];
@@ -422,6 +427,8 @@ private:
void SET_DIALOGUE_TEXT(int start, int count);
void SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p);
+ void UPDATE_OBJECT_STATE(int num);
+
void animateIgorTalking(int frame);
void fixIgorDialogueTextPosition(int num, int count, int *x, int *y);
void startIgorDialogue();
@@ -454,10 +461,10 @@ private:
void PART_06_EXEC_ACTION(int action);
void PART_06_ACTION_102();
void PART_06_HELPER_2();
- void PART_06_HELPER_3();
- void PART_06_HELPER_8(int frame);
+ void PART_06_HELPER_3_drawTripod();
+ void PART_06_HELPER_8_animatePhotographer(int frame);
void PART_06_HELPER_6(int num);
- void PART_06_HELPER_1(int frame);
+ void PART_06_HELPER_1_drawPieceOfPaper(int frame);
void PART_100();
@@ -479,7 +486,7 @@ private:
void PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action);
void PART_85_UPDATE_ROOM_BACKGROUND();
- void PART_85_HELPER_6(int frame);
+ void PART_85_HELPER_6_animateIgorHead(int frame);
void PART_90();
@@ -495,6 +502,7 @@ private:
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 enterPartLoop();
void leavePartLoop();
@@ -624,6 +632,7 @@ protected:
static const RoomDataOffsets PART_06_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_100_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_110_ROOM_DATA_OFFSETS;
+ static const uint8 INVENTORY_IMG_INIT[];
};
extern IgorEngine *g_engine;
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index 50a4b060f46..255550f84f7 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -61,10 +61,7 @@ void IgorEngine::updatePalette(int count) {
assert(count <= 768);
uint8 pal[768];
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;
- // }
+ pal[j++] = (_currentPalette[i] << 2);
}
g_system->getPaletteManager()->setPalette(pal, 0, count / 3);
}
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 513715f6c43..a81e74109b8 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -197,7 +197,7 @@ void IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND() {
break;
}
}
- if (_gameState.talkMode == kTalkModeTextOnly || !_gameState.dialogueTextRunning) {
+ if (_game.flags & kFlagFloppy) {
playSound(17, 1);
}
}
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 05e560170e5..1d2de9a9d08 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -58,7 +58,7 @@ void IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND() {
}
}
-void IgorEngine::PART_06_HELPER_1(int frame) {
+void IgorEngine::PART_06_HELPER_1_drawPieceOfPaper(int frame) {
const int offset = 41926;
for (int i = 0; i <= 2; ++i) {
const uint8 *src = _animFramesBuffer + 0x7E00 + frame * 12 + i * 4;
@@ -75,7 +75,7 @@ void IgorEngine::PART_06_HELPER_2() {
}
-void IgorEngine::PART_06_HELPER_3() {
+void IgorEngine::PART_06_HELPER_3_drawTripod() {
const int offset = 28668;
for (int i = 0; i <= 32; ++i) {
const uint8 *src = _animFramesBuffer + 0x7E54 + i * 23;
@@ -84,7 +84,7 @@ void IgorEngine::PART_06_HELPER_3() {
}
}
-void IgorEngine::PART_06_HELPER_8(int frame) {
+void IgorEngine::PART_06_HELPER_8_animatePhotographer(int frame) {
const int offset = 23521;
for (int i = 0; i <= 48; ++i) {
const uint8 *src = _animFramesBuffer + 0x95C7 + i * 23 + frame * 1127;
@@ -92,6 +92,10 @@ void IgorEngine::PART_06_HELPER_8(int frame) {
}
}
+// void IgorEngine::PART_06_HELPER_6(int num) {
+
+// }
+
void IgorEngine::PART_06_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_06_EXEC_ACTION %d", action);
switch (action) {
@@ -158,32 +162,39 @@ 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};
+ // loads from offset 32256
loadAnimData(anm1, 0x7E00);
if (_objectsState[60] == 0) {
- PART_06_HELPER_1(0);
+ PART_06_HELPER_1_drawPieceOfPaper(0);
}
+ // copying a patch of 224 pixels width and 144 height into the backup buffer for later scroll
+ // then it loads the actual current scene, SpringRock
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();
+ PART_06_HELPER_3_drawTripod();
}
+
if (_currentPart == 61) {
SET_PAL_208_96_1();
drawVerbsPanel();
- // drawInventory(1, 0);
+ drawInventory(1, 0);
_currentAction.verb = kVerbWalk;
memcpy(_paletteBuffer, _currentPalette, 624);
fadeIn(768);
@@ -211,7 +222,7 @@ void IgorEngine::PART_06() {
// }
PART_06_UPDATE_ROOM_BACKGROUND();
if (compareGameTick(61) && _gameState.unkF && getRandomNumber(9) == 0) {
- PART_06_HELPER_8(getRandomNumber(3));
+ PART_06_HELPER_8_animatePhotographer(getRandomNumber(3));
}
waitForTimer();
}
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index 3421511358f..8b666ff60f1 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -147,7 +147,7 @@ void IgorEngine::PART_85() {
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- if (_inputVars[kInputEscapae]) goto PART_85_EXIT;
+ if (_inputVars[kInputEscape]) goto PART_85_EXIT;
PART_85_HELPER_1_PLAY_ANIM(0x74CA, 0xA6C4, 7, 9, 32);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
_walkData[0].x = 250;
@@ -172,6 +172,7 @@ PART_85_EXIT:
_walkData[0].setDefaultScale();
copyArea(_screenLayer2, 23180, 320, _facingIgorFrames[3], 30, 30, 50, true);
memcpy(_screenVGA, _screenLayer2, 46080);
+ // sets all colors after 624 as black
memset(_currentPalette + 0x270, 0, 0x8D);
setPaletteRange(208, 254);
_currentPart = 61;
@@ -239,16 +240,16 @@ void IgorEngine::displayLogo() {
memcpy(_currentPalette, _paletteBuffer, 765); // cseg209:0x064E-0x065B
setPaletteRange(0, 255); // cseg209:0x0660-0x0664
- // // The original updates only color 255 here. The other palette changes stay
- // // internal and therefore do not produce a visible fade. cseg209:0x0669-0x0705
+ // The original updates only color 255 here. The other palette changes stay
+ // internal and therefore do not produce a visible fade. cseg209:0x0669-0x0705
// for (int threshold = 0; threshold <= 63; threshold += 3) {
- // for (int i = 0; i < 768; ++i) {
- // if (_paletteBuffer[i] >= threshold) {
- // _currentPalette[i] = (_currentPalette[i] < 3) ? 0 : _currentPalette[i] - 3;
- // }
- // }
- // setPaletteRange(255, 255); // cseg209:0x06F0-0x06F4
- // waitForTimer();
+ // // for (int i = 0; i < 768; ++i) {
+ // // if (_paletteBuffer[i] >= threshold) {
+ // // _currentPalette[i] = (_currentPalette[i] < 3) ? 0 : _currentPalette[i] - 3;
+ // // }
+ // // }
+ // // setPaletteRange(255, 255); // cseg209:0x06F0-0x06F4
+ // // waitForTimer();
// }
memcpy(_screenVGA, _screenTextLayer, 46080); // cseg209:0x0708-0x071A
@@ -306,13 +307,14 @@ void IgorEngine::PART_85_UPDATE_ROOM_BACKGROUND() {
if (!VAR_WATER_SOUND_PLAYING) {
return;
}
- if (_gameState.talkMode == kTalkModeTextOnly /*|| !_gameState.dialogueTextRunning*/) {
+ if (_game.flags & kFlagFloppy /*|| !_gameState.dialogueTextRunning*/) {
playSound(17, 1);
}
}
-void IgorEngine::PART_85_HELPER_6(int frame) {
+void IgorEngine::PART_85_HELPER_6_animateIgorHead(int frame) {
const int offset = (_walkCurrentPos == 4) ? 24564 : 22643;
+ // Animate Igor's head by copying the relevant area from the screen and overlaying the head frame.
copyArea(_screenVGA, offset, 320, _screenLayer2 + offset, 320, 14, 8);
copyArea(_screenVGA, offset, 320, _igorHeadFrames + (_walkCurrentPos - 1) * 924 + frame * 154, 14, 14, 8, true);
}
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index f576c830c19..c95468d27d5 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -43,18 +43,86 @@ void IgorEngine::SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p) {
}
}
+void IgorEngine::UPDATE_OBJECT_STATE(int num) {
+ if (num == 1 || num == 255) {
+ switch (_objectsState[0]) {
+ case 0:
+ Common::strlcpy(_globalObjectNames[23], getString(STR_BottleOfWhisky),sizeof(_globalObjectNames[23]));
+ break;
+ case 1:
+ Common::strlcpy(_globalObjectNames[23], getString(STR_EmptyBottle),sizeof(_globalObjectNames[23]));
+ break;
+ case 2:
+ Common::strlcpy(_globalObjectNames[23], getString(STR_BottleOfWater),sizeof(_globalObjectNames[23]));
+ break;
+ }
+ }
+ if (num == 2 || num == 255) {
+ switch (_objectsState[1]) {
+ case 0:
+ _inventoryImages[23] = 27;
+ Common::strlcpy(_globalObjectNames[24], getString(STR_Lizard), sizeof(_globalObjectNames[24]));
+ break;
+ default:
+ _inventoryImages[23] = 35;
+ Common::strlcpy(_globalObjectNames[24], getString(STR_FatLizard), sizeof(_globalObjectNames[24]));
+ break;
+ }
+ }
+ if (num == 4 || num == 255) {
+ switch (_objectsState[3]) {
+ case 0:
+ Common::strlcpy(_globalObjectNames[22], getString(STR_CarolineFolder), sizeof(_globalObjectNames[22]));
+ break;
+ case 1:
+ Common::strlcpy(_globalObjectNames[22], getString(STR_PhilipFolder), sizeof(_globalObjectNames[22]));
+ 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) {
+ Common::strlcpy(_globalObjectNames[25], getString(STR_Statuette), sizeof(_globalObjectNames[25]));
+ _inventoryImages[24] = 29;
+ } else {
+ Common::strlcpy(_globalObjectNames[25], getString(STR_Reward), sizeof(_globalObjectNames[25]));
+ _inventoryImages[24] = 39;
+ }
+ }
+}
+
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);
+ drawInventory(1, 0);
}
do {
debugC(9, kDebugGame, "PART_MAIN _currentPart %d", _currentPart);
@@ -66,12 +134,12 @@ void IgorEngine::PART_MAIN() {
case 50:
case 51:
case 52:
- PART_05(); // SpringRock
+ PART_05(); // SpringBridge
break;
case 60:
case 61:
case 62:
- PART_06(); // Spring
+ PART_06(); // SpringRock
break;
case 100:
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index db9447d3a48..8fd87c6a994 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -82,6 +82,7 @@ void IgorEngine::playSound(int num, int type) {
void IgorEngine::stopSound() {
_mixer->stopHandle(_sfxHandle);
+ _mixer->stopHandle(_speechHandle);
}
} // End of namespace Igor
diff --git a/engines/igor/static_cursor.cpp b/engines/igor/static_cursor.cpp
index adda5f65ad9..09a29a8a817 100644
--- a/engines/igor/static_cursor.cpp
+++ b/engines/igor/static_cursor.cpp
@@ -59,4 +59,9 @@ const uint8 PAL_48_1[] = {
0x3D, 0x3D, 0x26, 0x01, 0x36, 0x1F, 0x01, 0x2D, 0x16, 0x00, 0x0F, 0x08, 0x00, 0x3F, 0x3F, 0x3F
};
+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
+};
+
} // End of namespace Igor
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 4b372b9714b..8206476fe68 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -317,7 +317,7 @@ void IgorEngine::animateIgorTalking(int frame) {
return;
}
if (getPart() == 85) {
- PART_85_HELPER_6(frame);
+ PART_85_HELPER_6_animateIgorHead(frame);
return;
}
WalkData *wd = &_walkData[_walkDataLastIndex - 1];
Commit: 977035dd6f2aa27b244080e97fc6c862553a1fdb
https://github.com/scummvm/scummvm/commit/977035dd6f2aa27b244080e97fc6c862553a1fdb
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:51+01:00
Commit Message:
IGOR: Part 70
Changed paths:
A engines/igor/part_70.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index a2ee2c34554..779e11de5ce 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -139,6 +139,7 @@ void IgorEngine::restart() {
// memset(_dialogueInfo, 0, sizeof(_dialogueInfo));
memset(_objectsState, 0, sizeof(_objectsState));
+ _part70FirstVisitDone = false; // cseg197:0795-0845; original global s3:0xED2E
memcpy(_inventoryImages, INVENTORY_IMG_INIT, 36);
memset(_inventoryInfo, 0, sizeof(_inventoryInfo));
memset(_verbPrepositions, 0, sizeof(_verbPrepositions));
@@ -305,11 +306,11 @@ void IgorEngine::drawInventory(int start, int mode) {
}
}
switch (mode) {
- case 0:
+ case 0: // normal inventory rendering
memcpy(_screenVGA + 54400, _inventoryPanelBuffer, 9600);
_scrollInventory = false;
break;
- case 1:
+ case 1: // animation scrolling up
for (y = 0; y <= 11; ++y) {
for (x = 0; x <= 14; ++x) {
uint8 *p = _screenVGA + x + y * 320 + 59520;
@@ -327,7 +328,7 @@ void IgorEngine::drawInventory(int start, int mode) {
_scrollInventoryDy = 6;
_scrollInventory = true;
break;
- case 2:
+ case 2: // animation scrolling down
for (y = 0; y <= 11; ++y) {
for (x = 0; x <= 14; ++x) {
uint8 *p = _screenVGA + x + y * 320 + 55040;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 2364e796658..9a86f66cbe7 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -379,6 +379,7 @@ private:
uint8 _objectsState[112];
+ bool _part70FirstVisitDone; // cseg197:0795-0845; original global s3:0xED2E
uint8 _inventoryImages[36];
uint8 _inventoryInfo[74];
char _verbPrepositions[3][7];
@@ -471,6 +472,13 @@ private:
void PART_100_EXEC_ACTION(int action);
void PART_100_ACTION_104();
void PART_100_ACTION_108();
+ void PART_70();
+ void PART_70_EXEC_ACTION(int action);
+ void PART_70_DRAW_DOOR_STATE(int num);
+ void PART_70_ANIMATE_DOOR(int door, bool open);
+ void PART_70_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame, int dyPos);
+ void PART_70_ENTER_FROM_OUTSIDE();
+ void PART_70_EXIT_TO_OUTSIDE();
void PART_110();
void PART_110_EXEC_ACTION(int action);
void PART_110_ACTION_105();
@@ -630,6 +638,7 @@ protected:
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_70_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_100_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_110_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index d3cbe1c3b13..f38da6f99b4 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -170,7 +170,7 @@ void IgorEngine::handleRoomInput() {
_inputVars[kInputSkipDialogue] = 0;
}
- if (!_roomCursorOn || _gameState.dialogueTextRunning /*|| _scrollInventory*/) {
+ if (!_roomCursorOn || _gameState.dialogueTextRunning || _scrollInventory) {
return;
}
if (_inputVars[kInputCursorYPos] >= 156 && _inputVars[kInputCursorYPos] <= 167) {
@@ -190,42 +190,28 @@ void IgorEngine::handleRoomInput() {
}
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;
- // }
+ // Inventory arrows
+ 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;
+ }
+ // Inventory arrows
+ 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;
+ }
bool actionHovering = !_inputVars[kInputClick];
_inputVars[kInputClick] = 0;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 679efd758b9..d4a76a41745 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -18,6 +18,7 @@ MODULE_OBJS = \
part_85.o \
part_90.o \
part_6.o \
+ part_70.o \
part_100.o \
part_110.o \
text.o \
diff --git a/engines/igor/part_70.cpp b/engines/igor/part_70.cpp
new file mode 100644
index 00000000000..1388ac27cea
--- /dev/null
+++ b/engines/igor/part_70.cpp
@@ -0,0 +1,271 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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 3 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+namespace {
+
+const uint32 kDoor1Closed = 0x2175; // cseg197:007B
+const uint32 kDoor1Open = 0x23F1; // cseg197:002B
+const uint32 kDoor2Closed = 0x266D; // cseg197:011B
+const uint32 kDoor2Open = 0x28DD; // cseg197:00CB
+
+} // End of anonymous namespace
+
+void IgorEngine::PART_70_DRAW_DOOR_STATE(int num) {
+ _roomActionsTable[297] = 109; // cseg197:0B0C-0B17
+ if (num == 1 || num == 255) { // cseg197:0B1D-0B27
+ const uint32 srcOffset = _objectsState[52] == 0 ? kDoor1Closed : kDoor1Open; // cseg197:0B29-0B58; s3:0x856
+ for (int y = 0; y <= 52; ++y) // cseg197:0052-00A1 and cseg197:0002-0051
+ memcpy(_screenLayer1 + 0x4DB8 + y * 320, _animFramesBuffer + srcOffset + y * 12, 12);
+ _roomActionsTable[146] = _objectsState[52] == 0 ? 6 : 7; // cseg197:0B35-0B58
+ }
+ if (num == 2 || num == 255) { // cseg197:0B5E-0B68
+ const uint32 srcOffset = _objectsState[53] == 0 ? kDoor2Closed : kDoor2Open; // cseg197:0B6A-0B99; s3:0x857
+ for (int y = 0; y <= 51; ++y) // cseg197:00F2-0141 and cseg197:00A2-00F1
+ memcpy(_screenLayer1 + 0x4E1A + y * 320, _animFramesBuffer + srcOffset + y * 12, 12);
+ _roomActionsTable[147] = _objectsState[53] == 0 ? 6 : 7; // cseg197:0B76-0B99
+ }
+}
+
+void IgorEngine::PART_70_ANIMATE_DOOR(int door, bool open) {
+ const int stateIndex = door == 1 ? 52 : 53; // cseg197:0150 and cseg197:029E; s3:0x856-0x857
+ if ((_objectsState[stateIndex] != 0) == open) {
+ const int text = open ? 19 : 23; // cseg222:2C5A-2C86 and cseg222:2CF6-2D22
+ ADD_DIALOGUE_TEXT(text, 1, text);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ return;
+ }
+
+ const int lastFrame = open ? 2 : 0; // cseg197:01B1-01D9 and cseg197:0258-0280
+ const int step = open ? 1 : -1; // cseg197:0166 and cseg197:020D
+ for (int frame = 1;; frame += step) { // cseg197:015E and cseg197:0205
+ if (door == 1) {
+ for (int y = 0; y <= 52; ++y) // cseg197:016A-01AF and cseg197:0211-0256
+ memcpy(_screenVGA + 0x4DB8 + y * 320, _animFramesBuffer + frame * 0x636 + y * 30, 30);
+ } else {
+ for (int y = 0; y <= 54; ++y) // cseg197:02B8-0301 and cseg197:0363-03AC
+ memcpy(_screenVGA + 0x4E0F + y * 320, _animFramesBuffer + 0x12A2 + frame * 0x4F1 + y * 23, 23);
+ }
+ if ((open && frame == 2) || (!open && frame == 1))
+ playSound(open ? 13 : 14, 1); // cseg197:01B1-01BC,0264-026A,0303-030E,03B5-03C0
+ if (frame == lastFrame)
+ break;
+ waitForTimer(127); // cseg197:01C8-01D2,026F-0279,031A-0324,03C5-03CF (wait while tick <= 0x7E)
+ }
+ _objectsState[stateIndex] = open ? 1 : 0; // cseg197:01DB,0282,032D,03D8
+ PART_70_DRAW_DOOR_STATE(door); // cseg197:01E0-01E2,0287-0289,0332-0334,03DD-03DF
+}
+
+void IgorEngine::PART_70_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame, int dyPos) {
+ WalkData &wd = _walkData[0]; // cseg197:06F6 and cseg197:0884; s3:0xD94A = 0
+ wd.setPos(109, 143, facing, frame); // cseg197:070B-071F and cseg197:089A-08BA
+ wd.clipSkipX = 1; // cseg197:0734 and cseg197:08CF
+ wd.clipWidth = 30; // cseg197:0739 and cseg197:08D4
+ wd.scaleWidth = 23 + scaleStep * 3; // cseg197:073F-074B and cseg197:08DA-08E6
+ wd.xPosChanged = 1; // cseg197:074E and cseg197:08E9
+ wd.dxPos = 0; // cseg197:0753-0755 and cseg197:08EE-08F0
+ wd.yPosChanged = 1; // cseg197:0758 and cseg197:08F3
+ wd.dyPos = dyPos; // cseg197:075D-075F and cseg197:08F8
+ wd.scaleHeight = 50; // cseg197:0762 and cseg197:08FE
+ _walkDataCurrentIndex = 0; // cseg197:06F6 and cseg197:0884
+ moveIgor(facing, frame); // cseg197:0767-076F and cseg197:0903-090B
+}
+
+void IgorEngine::PART_70_ENTER_FROM_OUTSIDE() {
+ PART_70_DRAW_DOOR_STATE(255); // cseg197:06EA-06EC
+ for (int area = 11; area <= 13; ++area)
+ _roomObjectAreasTable[area].area = 0; // cseg197:092E-095D
+
+ int frame = 1; // cseg197:06FB
+ for (int step = 0; step <= 9; ++step) { // cseg197:0700-0785
+ PART_70_DRAW_SCALED_IGOR(step, kFacingPositionBack, frame, 0);
+ frame = frame == 6 ? 1 : frame + 1; // cseg197:0722-0730
+ waitForTimer(15); // cseg197:0774-077E
+ }
+
+ _walkDataLastIndex = 0; // cseg197:0787-0791
+ if (!_part70FirstVisitDone) { // cseg197:0795; s3:0xED2E
+ buildWalkPath(109, 143, 180, 129); // cseg197:079F-07D5; DAT+161 = 0xA1F4
+ _walkData[_walkDataLastIndex].frameNum = 0; // cseg197:07DA-07E2
+ _walkData[_walkDataLastIndex].posNum = kFacingPositionRight; // cseg197:07E7-07FF; DAT+173 = 2
+ _walkDataCurrentIndex = 1; // cseg197:0803
+ _gameState.igorMoving = true; // cseg197:0808
+ waitForIgorMove(); // cseg197:080D
+ ADD_DIALOGUE_TEXT(206, 2, 144); // cseg197:0812-081E
+ ADD_DIALOGUE_TEXT(208, 4, 145); // cseg197:0824-0830
+ SET_DIALOGUE_TEXT(1, 2); // cseg197:0836-083B
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ _part70FirstVisitDone = true; // cseg197:0845; s3:0xED2E
+ } else {
+ buildWalkPath(109, 143, 129, 138); // cseg197:084C-0857
+ _walkData[_walkDataLastIndex].frameNum = 0; // cseg197:085C-0864
+ _walkDataCurrentIndex = 1; // cseg197:0869
+ _gameState.igorMoving = true; // cseg197:086E
+ waitForIgorMove(); // cseg197:0873
+ }
+}
+
+void IgorEngine::PART_70_EXIT_TO_OUTSIDE() {
+ int frame = 1; // cseg197:0889
+ for (int step = 9; step >= 0; --step) { // cseg197:088E-0923
+ if (step == 9)
+ frame = 0; // cseg197:08AB-08B2
+ PART_70_DRAW_SCALED_IGOR(step, kFacingPositionFront, frame, 3);
+ frame = frame == 6 ? 1 : frame + 1; // cseg197:08BD-08CB
+ waitForTimer(15); // cseg197:0910-091A
+ }
+ _currentPart = 101; // cseg197:0926
+}
+
+void IgorEngine::PART_70_EXEC_ACTION(int action) {
+ switch (action) { // cseg197:095E-0B01
+ case 101:
+ ADD_DIALOGUE_TEXT(201, 1, 140); // cseg197:03F0-03FC
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 102:
+ ADD_DIALOGUE_TEXT(202, 2, 141); // cseg197:041D-0429
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 103:
+ PART_70_ANIMATE_DOOR(1, true); // cseg197:09AC-09CA
+ break;
+ case 104:
+ PART_70_ANIMATE_DOOR(1, false); // cseg197:09CE-09EC
+ break;
+ case 105:
+ PART_70_ANIMATE_DOOR(2, true); // cseg197:09F0-0A0E
+ break;
+ case 106:
+ PART_70_ANIMATE_DOOR(2, false); // cseg197:0A12-0A30
+ break;
+ case 107:
+ ADD_DIALOGUE_TEXT(204, 1, 142); // cseg197:044A-0456
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 108:
+ // The active fork's wrapper is inclusive; 2 therefore reproduces the
+ // original random(3), whose result is 0..2 (cseg230:1558).
+ switch (getRandomNumber(2)) { // cseg197:047B-048B
+ case 0:
+ ADD_DIALOGUE_TEXT(205, 1, 143); // cseg197:048D-0499
+ ADD_DIALOGUE_TEXT(206, 2, 144); // cseg197:049F-04AB
+ ADD_DIALOGUE_TEXT(208, 4, 145); // cseg197:04B1-04BD
+ SET_DIALOGUE_TEXT(1, 3); // cseg197:04C3-04C8
+ break;
+ case 1:
+ ADD_DIALOGUE_TEXT(213, 2, 147); // cseg197:04D9-04E5
+ SET_DIALOGUE_TEXT(1, 1); // cseg197:04EB-04F0
+ break;
+ case 2:
+ ADD_DIALOGUE_TEXT(215, 1, 148); // cseg197:0500-050C
+ ADD_DIALOGUE_TEXT(216, 1, 149); // cseg197:0512-051E
+ ADD_DIALOGUE_TEXT(217, 1, 150); // cseg197:0524-0530
+ ADD_DIALOGUE_TEXT(218, 1, 151); // cseg197:0536-0542
+ ADD_DIALOGUE_TEXT(219, 1, 152); // cseg197:0548-0554
+ SET_DIALOGUE_TEXT(1, 5); // cseg197:055A-055F
+ break;
+ }
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 109:
+ ADD_DIALOGUE_TEXT(212, 1, 146); // cseg197:0575-0581
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 110:
+ PART_70_EXIT_TO_OUTSIDE(); // cseg197:0A9A-0AB8
+ break;
+ case 111:
+ if (_objectsState[52] != 0) { // cseg197:05A2-05A9; s3:0x856
+ for (int area = 11; area <= 13; ++area)
+ _roomObjectAreasTable[area].area = 3; // cseg197:05AC-05CE
+ --_walkDataLastIndex; // cseg197:05D0
+ buildWalkPath(77, 114, 46, 111); // cseg197:05D4-05DC
+ _walkDataCurrentIndex = 1; // cseg197:05E1
+ _gameState.igorMoving = true; // cseg197:05E6
+ waitForIgorMove(); // cseg197:05EB-066B
+ _currentPart = 80; // cseg197:066D
+ }
+ break;
+ case 112:
+ if (_objectsState[53] != 0) { // cseg197:067F-0686; s3:0x857
+ WalkData &wd = _walkData[0]; // cseg197:06CA; s3:0xD94A = 0
+ wd.setPos(156, 113, kFacingPositionBack, 1); // cseg197:0688-0699
+ wd.setDefaultScale(); // cseg197:069E-06C5
+ wd.dxPos = 4; // cseg197:06B4-06BA
+ wd.yPosChanged = 0; // cseg197:06BA
+ wd.dyPos = 3; // cseg197:06BF
+ _walkDataCurrentIndex = 0; // cseg197:06CA
+ moveIgor(kFacingPositionBack, 1); // cseg197:06CF-06D3
+ _currentPart = 90; // cseg197:06D8
+ }
+ break;
+ default:
+ warning("PART_70_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::PART_70() {
+ _gameState.enableLight = 1; // cseg197:290F
+ loadActionData(DAT_AdministrationCorridor); // cseg197:2920-2943
+ loadRoomData(PAL_AdministrationCorridor, IMG_AdministrationCorridor,
+ BOX_AdministrationCorridor, MSK_AdministrationCorridor, TXT_AdministrationCorridor); // cseg199:0002-06A0
+ static const int anim[] = { ANM_AdministrationCorridor, 0 }; // cseg198:0002-00D5
+ loadAnimData(anim);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_70_EXEC_ACTION); // cseg197:095E-0B01
+ _roomDataOffsets = PART_70_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143); // cseg199 room mask is 320x144
+ PART_70_DRAW_DOOR_STATE(255); // cseg197:2957-2959
+ memcpy(_screenVGA, _screenLayer1, 46080); // cseg197:295E-2970
+ SET_PAL_240_48_1(); // cseg197:29F0-29F4
+ SET_PAL_208_96_1(); // cseg197:29F9-29FF
+ for (int area = 11; area <= 13; ++area)
+ _roomObjectAreasTable[area].area = 0; // cseg197:2A37; sub_197_092E
+ _currentAction.verb = kVerbWalk; // cseg197:2A3C-2A4A
+
+ if (_currentPart == 71) {
+ _walkData[0].setPos(78, 114, kFacingPositionRight, 0); // cseg197:2A56-2A67
+ _walkData[0].setDefaultScale(); // cseg197:2A6C-2A91
+ _walkDataCurrentIndex = 0; // cseg197:2A96
+ moveIgor(kFacingPositionRight, 0); // cseg197:2A9B-2A9F
+ } else if (_currentPart == 72) {
+ _walkData[0].setPos(153, 116, kFacingPositionFront, 0); // cseg197:2AB5-2AC6
+ _walkData[0].setDefaultScale(); // cseg197:2ACB-2AF0
+ _walkDataCurrentIndex = 0; // cseg197:2AF5
+ moveIgor(kFacingPositionFront, 0); // cseg197:2AFA-2AFE
+ }
+ _walkDataLastIndex = 1; // cseg197:2AA4 and cseg197:2B03
+ _walkDataCurrentIndex = 1; // cseg197:2AA9 and cseg197:2B08
+ fadeIn(768); // cseg197:2B0D-2B10
+ if (_currentPart == 70)
+ PART_70_ENTER_FROM_OUTSIDE(); // cseg197:2B15-2B1C
+
+ enterPartLoop();
+ while (_currentPart >= 70 && _currentPart <= 72) // cseg197:2B4C-2B55
+ runPartLoop();
+ leavePartLoop();
+ fadeOut(624); // cseg197:371E-3721
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index c95468d27d5..ab22e3e550e 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -141,6 +141,11 @@ void IgorEngine::PART_MAIN() {
case 62:
PART_06(); // SpringRock
break;
+ case 70:
+ case 71:
+ case 72:
+ PART_70(); // Administration corridor; cseg197:28D4
+ break;
case 100:
case 101:
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 83fcd9ca74f..6d650b7c021 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -506,4 +506,14 @@
#define IMG_IgorIntroLogo 914 // cseg209:1E34; IGOR.EXE:0x7C1434, 320x122
#define PAL_IgorIntroLogo 915 // cseg209:B6B4; IGOR.EXE:0x7CACB4, 768 bytes
+// Administration corridor used by parts 70-72. These CD resources live in
+// NE segments 197-199 and were absent from the historical TBL catalog.
+#define DAT_AdministrationCorridor 916 // cseg197:3732; IGOR.EXE:0x748B32, 0x1A59 bytes
+#define ANM_AdministrationCorridor 917 // cseg198:00D6; IGOR.EXE:0x74C8D6, 0x2B4D bytes
+#define TXT_AdministrationCorridor 918 // cseg199:06A2; IGOR.EXE:0x74FBA2, 0x5EE bytes
+#define IMG_AdministrationCorridor 919 // cseg199:0C90; IGOR.EXE:0x750190, 0xB400 bytes
+#define PAL_AdministrationCorridor 920 // cseg199:C090; IGOR.EXE:0x75B590, 0x270 bytes
+#define MSK_AdministrationCorridor 921 // cseg199:C300; IGOR.EXE:0x75B800, 0x954 bytes
+#define BOX_AdministrationCorridor 922 // cseg199:CC54; IGOR.EXE:0x75C154, 0x500 bytes
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index f81a5e5fa6e..1ab9df2e00f 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -203,6 +203,13 @@ const RoomDataOffsets IgorEngine::PART_06_ROOM_DATA_OFFSETS = {
{ 135, 30, 5158, 100, 60 }
};
+const RoomDataOffsets IgorEngine::PART_70_ROOM_DATA_OFFSETS = {
+ { 80, 4, 12, 3 }, // cseg197:194E-199C; DAT+80, 4 records, 12-byte source, 3-byte destination
+ { 161, 173 }, // cseg197:07AF-07F2 and cseg197:2E1D-2E24
+ { 175, 419, 3575, 319, 395, 88 }, // cseg197:2E4C-2F19 and cseg197:2F23-2F62
+ { 0, 0, 0, 0, 0 } // cseg197 has no room-specific question/reply matrix
+};
+
const RoomDataOffsets IgorEngine::PART_04_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 },
{ 0, 0 },
Commit: 97acff8711956e4b633dfdec300a8f8c29ccab2d
https://github.com/scummvm/scummvm/commit/97acff8711956e4b633dfdec300a8f8c29ccab2d
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:52+01:00
Commit Message:
IGOR: Room light & inventory scroll
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 779e11de5ce..8d31e4cdbad 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -243,12 +243,12 @@ void IgorEngine::runPartLoop() {
// if (compareGameTick(19, 32)) {
// handleRoomDialogue();
// }
- // if (compareGameTick(4, 8)) {
- // handleRoomInventoryScroll();
- // }
- // if (compareGameTick(1)) {
- // handleRoomLight();
- // }
+ if (compareGameTick(4, 8)) {
+ handleRoomInventoryScroll();
+ }
+ if (compareGameTick(1)) {
+ handleRoomLight();
+ }
if (_updateRoomBackground) {
(this->*_updateRoomBackground)();
}
@@ -256,6 +256,89 @@ void IgorEngine::runPartLoop() {
waitForTimer();
}
+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::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::handleRoomInventoryScroll() {
+ if (_scrollInventory) {
+ scrollInventory();
+ }
+}
+
+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::drawInventory(int start, int mode) {
loadData(IMG_InventoryPanel, _inventoryPanelBuffer);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 9a86f66cbe7..81ebfb2753a 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -510,12 +510,18 @@ private:
void drawVerbsPanel();
void redrawVerb(uint8 verb, bool highlight);
int getVerbUnderCursor(int x) const { return ((x % 46) < 44) ? (kVerbTalk + x / 46) : 0; }
+ void handleRoomInventoryScroll();
+ void scrollInventory();
void drawInventory(int start, int mode);
void enterPartLoop();
void leavePartLoop();
void runPartLoop();
+ void handleRoomLight();
+
+ void updateRoomLight(int fl);
+
int lookupScale(int xOffset, int yOffset, int h) const;
void lookupScale(int curX, int curY, uint8 &scale, uint8 &xScale, uint8 &yScale) const;
Commit: 5e7828fe3b551da026ff92ec23bce816bdc713a4
https://github.com/scummvm/scummvm/commit/5e7828fe3b551da026ff92ec23bce816bdc713a4
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:52+01:00
Commit Message:
IGOR: Complete actions on part6
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_6.cpp
engines/igor/static_cursor.cpp
engines/igor/static_walk.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 8d31e4cdbad..2a203b4df1b 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -432,6 +432,42 @@ void IgorEngine::drawInventory(int start, int mode) {
}
}
+
+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::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::executeAction(int action) {
debugC(9, kDebugEngine, "executeAction %d", action);
assert(action < 200);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 81ebfb2753a..d4aa7da6927 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -170,7 +170,6 @@ struct Action {
uint8 object2Type;
};
-
struct RoomDataOffsets {
struct {
int box;
@@ -299,13 +298,12 @@ struct WalkData {
}
};
-
class IgorEngine : public Engine {
public:
-
typedef void (IgorEngine::*ExecuteActionProc)(int action);
typedef void (IgorEngine::*UpdateRoomBackgroundProc)();
typedef void (IgorEngine::*UpdateDialogueProc)(int action);
+
private:
const ADGameDescription *_gameDescription;
Common::RandomSource _randomSource;
@@ -377,7 +375,6 @@ private:
int _dialogueDirtyRectY;
int _dialogueDirtyRectSize;
-
uint8 _objectsState[112];
bool _part70FirstVisitDone; // cseg197:0795-0845; original global s3:0xED2E
uint8 _inventoryImages[36];
@@ -460,14 +457,21 @@ private:
void PART_06();
void PART_06_UPDATE_ROOM_BACKGROUND();
void PART_06_EXEC_ACTION(int action);
+ void PART_06_ACTION_103();
+ void PART_06_ACTION_105();
+ void PART_06_ACTION_107();
+ void PART_06_ACTION_108();
void PART_06_ACTION_102();
void PART_06_HELPER_2();
void PART_06_HELPER_3_drawTripod();
- void PART_06_HELPER_8_animatePhotographer(int frame);
void PART_06_HELPER_6(int num);
+ void PART_06_HELPER_8_animatePhotographer(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_HELPER_1_drawPieceOfPaper(int frame);
-
void PART_100();
void PART_100_EXEC_ACTION(int action);
void PART_100_ACTION_104();
@@ -498,7 +502,6 @@ private:
void PART_90();
-
void handleRoomInput();
void executeAction(int action);
@@ -513,6 +516,10 @@ private:
void handleRoomInventoryScroll();
void scrollInventory();
void drawInventory(int start, int mode);
+ void addObjectToInventory(int object, int index);
+ void removeObjectFromInventory(int index);
+
+ void packInventory();
void enterPartLoop();
void leavePartLoop();
@@ -560,7 +567,7 @@ private:
int getPart() const { return _currentPart / 10; }
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; }
+ bool compareGameTick(int eq) const { return _gameTicks == (eq & ~7); } // { return _gameTicks == eq; }
void waitForTimer(int ticks = -1);
@@ -577,7 +584,6 @@ private:
void buildWalkPath(int srcX, int srcY, int dstX, int dstY);
-
static const uint8 _dialogueColor[];
static const uint8 _sentenceColorIndex[];
@@ -638,6 +644,7 @@ public:
Common::Serializer s(stream, nullptr);
return syncGame(s);
}
+
protected:
// Engine APIs
Common::Error run() override;
@@ -648,6 +655,18 @@ protected:
static const RoomDataOffsets PART_100_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_110_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
+ static const uint8 _inventoryOffsetTable[];
+ static const uint8 _inventoryActionsTable[];
+
+ static const uint8 _walkWidthScaleTable[];
+ static const uint8 _walkScaleTable[];
+ static const float _walkScaleSpeedTable[];
+ static const uint8 _talkDelays[];
+ static const uint8 _mouseCursorMask[];
+ static const uint8 _mouseCursorData[];
+ static const uint8 PAL_IGOR_1[];
+ static const uint8 PAL_48_1[];
+ static const uint8 PAL_96_1[];
};
extern IgorEngine *g_engine;
@@ -655,17 +674,6 @@ extern IgorEngine *g_engine;
// Static data tables (defined in static_walk.cpp, static_cursor.cpp)
-extern const uint8 _walkWidthScaleTable[];
-extern const uint8 _walkScaleTable[];
-extern const float _walkScaleSpeedTable[];
-extern const uint8 _talkDelays[];
-extern const uint8 _mouseCursorMask[];
-extern const uint8 _mouseCursorData[];
-extern const uint8 PAL_IGOR_1[];
-extern const uint8 PAL_48_1[];
-extern const uint8 PAL_96_1[];
-
-
} // End of namespace Igor
#endif // IGOR_H
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index f38da6f99b4..edbcef1fbc1 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -19,23 +19,27 @@
*
*/
-#include "igor/igor.h"
#include "common/debug-channels.h"
#include "common/events.h"
#include "common/system.h"
#include "graphics/cursorman.h"
+#include "igor/igor.h"
namespace Igor {
-static const uint8 kSentenceColorIndex[] = { 0xFD, 0xFB, 0xF1 };
+static const uint8 kSentenceColorIndex[] = {0xFD, 0xFB, 0xF1};
void IgorEngine::waitForTimer(int ticks) {
+
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
+
if (_debugOverlayMode != kOverlayOff) {
debugApplyOverlay();
}
+
_system->updateScreen();
+ // wait till next timer if no param is passed, ticks if not
uint32 endTicks = (ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay;
do {
Common::Event ev;
@@ -46,36 +50,38 @@ void IgorEngine::waitForTimer(int ticks) {
_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;
- if (_gameState.dialogueTextRunning) {
- _inputVars[kInputSkipDialogue] = 1;
- }
- 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:
+ if (_gameState.dialogueTextRunning) {
+ _inputVars[kInputSkipDialogue] = 1;
+ }
+ break;
+ case Common::EVENT_LBUTTONDOWN:
+ _inputVars[kInputClick] = 1;
+ _inputVars[kInputCursorXPos] = ev.mouse.x;
+ _inputVars[kInputCursorYPos] = ev.mouse.y;
+ if (_gameState.dialogueTextRunning) {
+ _inputVars[kInputSkipDialogue] = 1;
+ }
+ break;
default:
break;
}
@@ -91,6 +97,8 @@ void IgorEngine::waitForTimer(int ticks) {
return;
}
_gameTicks += kTimerTicksCount;
+
+ // Update cursor mask
if ((_gameTicks & 31) == 0) {
setCursor(_currentCursor);
_currentCursor = (_currentCursor + 1) & 3;
@@ -126,7 +134,6 @@ void IgorEngine::hideCursor() {
debugC(9, kDebugEngine, "hideCursor()");
_roomCursorOn = false;
CursorMan.showMouse(_roomCursorOn);
-
}
void IgorEngine::drawVerbsPanel() {
@@ -220,8 +227,7 @@ void IgorEngine::handleRoomInput() {
return;
}
-
- //Action previousAction = _currentAction;
+ // Action previousAction = _currentAction;
if (_inputVars[kInputCursorYPos] >= 170 && _inputVars[kInputCursorYPos] <= 199) {
// int object = getObjectFromInventory(_inputVars[kInputCursorXPos]);
// if (_currentAction.verbType == 0) {
@@ -269,8 +275,7 @@ void IgorEngine::handleRoomInput() {
_currentAction.object2Num = object;
_currentAction.object2Type = kObjectTypeRoom;
}
- }
- else {
+ } else {
return;
}
@@ -278,14 +283,15 @@ void IgorEngine::handleRoomInput() {
// 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];
+ _actionCode = _roomActionsTable[_roomDataOffsets.action.defaultVerb + _currentAction.verb * 2 + _currentAction.object1Num * 20];
// }
// The original only exposes a room object when this action byte is
// non-zero; otherwise hover text is verb-only. cseg175:2C8B-2CBC;
// cseg176:2CBC-2CED.
if (((_currentPart >= 100 && _currentPart <= 102) || // cseg175:29AA-29B5
- _currentPart == 110) && // cseg176:29DF-29E6
- _actionCode == 0 && _currentAction.object1Type == kObjectTypeRoom) {
+ _currentPart == 110) && // cseg176:29DF-29E6
+ _actionCode == 0 &&
+ _currentAction.object1Type == kObjectTypeRoom) {
_currentAction.object1Num = 0;
}
}
@@ -375,7 +381,6 @@ void IgorEngine::handleRoomInput() {
}
}
-
void IgorEngine::clearAction() {
redrawVerb(_currentAction.verb, false);
memset(&_currentAction, 0, sizeof(_currentAction));
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 1d2de9a9d08..5ef8ded1a74 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -22,7 +22,6 @@
namespace Igor {
-
void IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND() {
if (compareGameTick(61)) {
scrollPalette(160, 167);
@@ -74,7 +73,6 @@ void IgorEngine::PART_06_HELPER_2() {
}
}
-
void IgorEngine::PART_06_HELPER_3_drawTripod() {
const int offset = 28668;
for (int i = 0; i <= 32; ++i) {
@@ -92,20 +90,153 @@ void IgorEngine::PART_06_HELPER_8_animatePhotographer(int frame) {
}
}
-// void IgorEngine::PART_06_HELPER_6(int num) {
-
-// }
void IgorEngine::PART_06_EXEC_ACTION(int action) {
-debugC(9, kDebugGame, "PART_06_EXEC_ACTION %d", action);
+ debugC(9, kDebugGame, "PART_06_EXEC_ACTION %d", action);
switch (action) {
- case 102: // scroll right?
- PART_06_ACTION_102();
- break;
- default:
+ 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_103() {
+ ADD_DIALOGUE_TEXT(215, 1);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ PART_06_HELPER_8_animatePhotographer(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_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_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_animatePhotographer(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_animatePhotographer(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_ACTION_102() {
@@ -158,6 +289,36 @@ void IgorEngine::PART_06_ACTION_102() {
_currentPart = 51;
}
+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);
@@ -169,23 +330,23 @@ void IgorEngine::PART_06() {
}
// copying a patch of 224 pixels width and 144 height into the backup buffer for later scroll
// then it loads the actual current scene, SpringRock
- for (int i = 0; i <= 143; ++i) {
+ 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);
+ 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 };
+ static const int anm2[] = {FRM_SpringRock1, FRM_SpringRock2, 0};
loadAnimData(anm2, 0x7E00);
- static const int anm3[] = { FRM_SpringRock3, FRM_SpringRock4, 0 };
+ static const int anm3[] = {FRM_SpringRock3, FRM_SpringRock4, 0};
loadAnimData(anm3, 0x81AE);
- static const int anm4[] = { FRM_SpringRock5, FRM_SpringRock6, 0 };
+ 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);
+ // PART_06_HELPER_6(255);
if (_objectsState[63] == 1) {
PART_06_HELPER_3_drawTripod();
@@ -200,12 +361,13 @@ void IgorEngine::PART_06() {
fadeIn(768);
}
loadActionData(DAT_SpringBridge);
- _roomDataOffsets = PART_06_ROOM_DATA_OFFSETS;
+ _roomDataOffsets = PART_06_ROOM_DATA_OFFSETS;
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
_gameState.unkF = (_objectsState[61] == 1);
enterPartLoop();
- while (_currentPart >= 60 && _currentPart <= 61) {
+
+ while (_currentPart >= 60 && _currentPart <= 61) {
setRoomWalkBounds(0, 0, _objectsState[61] == 0 ? 234 : 142, 143);
handleRoomInput();
if (compareGameTick(1, 16)) {
@@ -214,20 +376,21 @@ void IgorEngine::PART_06() {
// if (compareGameTick(19, 32)) {
// handleRoomDialogue();
// }
- // if (compareGameTick(4, 8)) {
- // handleRoomInventoryScroll();
- // }
- // if (compareGameTick(1)) {
- // handleRoomLight();
- // }
+ if (compareGameTick(4, 8)) {
+ handleRoomInventoryScroll();
+ }
+ if (compareGameTick(1)) {
+ handleRoomLight();
+ }
PART_06_UPDATE_ROOM_BACKGROUND();
+
if (compareGameTick(61) && _gameState.unkF && getRandomNumber(9) == 0) {
PART_06_HELPER_8_animatePhotographer(getRandomNumber(3));
}
+
waitForTimer();
}
leavePartLoop();
}
-
} // End of namespace Igor
diff --git a/engines/igor/static_cursor.cpp b/engines/igor/static_cursor.cpp
index 09a29a8a817..0fd9edbadda 100644
--- a/engines/igor/static_cursor.cpp
+++ b/engines/igor/static_cursor.cpp
@@ -23,7 +23,7 @@
namespace Igor {
-const uint8 _mouseCursorMask[] = {
+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,
@@ -32,19 +32,19 @@ const uint8 _mouseCursorMask[] = {
0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00
};
-const uint8 _mouseCursorData[] = {
+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 PAL_IGOR_1[] = {
+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 PAL_96_1[] = {
+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,
@@ -53,7 +53,7 @@ const uint8 PAL_96_1[] = {
0x06, 0x0E, 0x05, 0x00, 0x1D, 0x0D, 0x02, 0x2A, 0x17, 0x00, 0x2A, 0x1E, 0x16, 0x31, 0x27, 0x23
};
-const uint8 PAL_48_1[] = {
+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
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 1ab9df2e00f..b87d8f5cfe1 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -23,14 +23,14 @@
namespace Igor {
-const uint8 _walkWidthScaleTable[] = {
+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 uint8 _walkScaleTable[] = {
+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,
@@ -181,7 +181,7 @@ const uint8 _walkScaleTable[] = {
0x03, 0x03, 0x03, 0x03
};
-const float _walkScaleSpeedTable[] = {
+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,
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 8206476fe68..647acbd3ddb 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -22,7 +22,9 @@
namespace Igor {
-const uint8 _talkDelays[] = { 0, 27, 22, 17, 12, 7, 0 };
+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::_dialogueColor[] = { 0x3F, 0x3F, 0x3F };
Commit: d544d9d0a8c75c75f0e1d7f0439a3813cd432ab5
https://github.com/scummvm/scummvm/commit/d544d9d0a8c75c75f0e1d7f0439a3813cd432ab5
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:52+01:00
Commit Message:
IGOR: Fix igor clipping through the edge of the screen in part 100
Changed paths:
engines/igor/part_100.cpp
engines/igor/static_walk.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/part_100.cpp b/engines/igor/part_100.cpp
index 2bdb2e9c2aa..b7d89752042 100644
--- a/engines/igor/part_100.cpp
+++ b/engines/igor/part_100.cpp
@@ -270,6 +270,7 @@ void IgorEngine::PART_100() {
// sub_175_056D: enter at (319,79), facing left, walk to (288,84).
_walkData[0].setPos(319, 79, kFacingPositionLeft, 0); // cseg175:0580-05B2
_walkData[0].setDefaultScale();
+ _walkData[0].clipWidth = 15; // cseg175:058D-0598; clip the off-screen half at x=319
_walkDataLastIndex = 0;
buildWalkPath(319, 79, 288, 84); // cseg175:05C1-05CB
_walkData[_walkDataLastIndex].frameNum = 0; // cseg175:05D0-05DB
@@ -300,6 +301,8 @@ void IgorEngine::PART_100() {
runPartLoop();
}
leavePartLoop();
+ if (_currentPart != 110)
+ fadeOut(624); // cseg175:356A-3595; Part 110 keeps the completed pan palette
}
} // End of namespace Igor
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index b87d8f5cfe1..98225a37491 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -205,7 +205,7 @@ const RoomDataOffsets IgorEngine::PART_06_ROOM_DATA_OFFSETS = {
const RoomDataOffsets IgorEngine::PART_70_ROOM_DATA_OFFSETS = {
{ 80, 4, 12, 3 }, // cseg197:194E-199C; DAT+80, 4 records, 12-byte source, 3-byte destination
- { 161, 173 }, // cseg197:07AF-07F2 and cseg197:2E1D-2E24
+ { 151, 168 }, // cseg197:1F87-1FCF and cseg197:2124-213D
{ 175, 419, 3575, 319, 395, 88 }, // cseg197:2E4C-2F19 and cseg197:2F23-2F62
{ 0, 0, 0, 0, 0 } // cseg197 has no room-specific question/reply matrix
};
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 7111a73db31..cbda2e3be3e 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -127,7 +127,7 @@ void IgorEngine::moveIgor(int pos, int frame) {
}
uint16 screenIgorDrawOffset = _walkDataDrawOffset;
uint16 igorScaledWidth = _walkDxPos + _walkClipWidth;
- uint16 igorScaledHeight = _walkHeightScale + _walkDyPos;
+ uint16 igorScaledHeight = _walkScaleWidth + _walkDyPos; // cseg229:4B48-4B4F
uint16 igorBodyScanLine = 0;
if (_walkYPosChanged != 0) {
for (int i = 1; i <= _walkDyPos; ++i) {
@@ -705,7 +705,7 @@ void IgorEngine::buildWalkPathAreaRightDirection(int srcX, int srcY, int dstX, i
wd->setScale(scale, scale);
wd->yPosChanged = 0;
wd->dyPos = _walkData[_walkDataLastIndex - 1].y - wd->y;
- int x = xScale - xScale / 2 - 1;
+ int x = xScale - xScale / 2 + dstX - 1; // cseg229:0A49-0A78
if (x > 319) {
wd->clipSkipX = 1;
wd->clipWidth = 319 - (x - xScale);
Commit: 173f10a4cc80a807ef8aae76510d23c8ef7afbf6
https://github.com/scummvm/scummvm/commit/173f10a4cc80a807ef8aae76510d23c8ef7afbf6
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:53+01:00
Commit Message:
IGOR: Proper part names
Changed paths:
A engines/igor/part_10.cpp
A engines/igor/part_11.cpp
A engines/igor/part_7.cpp
R engines/igor/part_100.cpp
R engines/igor/part_110.cpp
R engines/igor/part_70.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 2a203b4df1b..f63ec22b671 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -139,7 +139,7 @@ void IgorEngine::restart() {
// memset(_dialogueInfo, 0, sizeof(_dialogueInfo));
memset(_objectsState, 0, sizeof(_objectsState));
- _part70FirstVisitDone = false; // cseg197:0795-0845; original global s3:0xED2E
+ _part07FirstVisitDone = false; // cseg197:0795-0845; original global s3:0xED2E
memcpy(_inventoryImages, INVENTORY_IMG_INIT, 36);
memset(_inventoryInfo, 0, sizeof(_inventoryInfo));
memset(_verbPrepositions, 0, sizeof(_verbPrepositions));
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index d4aa7da6927..12209343ac4 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -376,7 +376,7 @@ private:
int _dialogueDirtyRectSize;
uint8 _objectsState[112];
- bool _part70FirstVisitDone; // cseg197:0795-0845; original global s3:0xED2E
+ bool _part07FirstVisitDone; // cseg197:0795-0845; original global s3:0xED2E
uint8 _inventoryImages[36];
uint8 _inventoryInfo[74];
char _verbPrepositions[3][7];
@@ -472,24 +472,24 @@ private:
void PART_06_HELPER_15(int frame);
void PART_06_HELPER_1_drawPieceOfPaper(int frame);
- void PART_100();
- void PART_100_EXEC_ACTION(int action);
- void PART_100_ACTION_104();
- void PART_100_ACTION_108();
- void PART_70();
- void PART_70_EXEC_ACTION(int action);
- void PART_70_DRAW_DOOR_STATE(int num);
- void PART_70_ANIMATE_DOOR(int door, bool open);
- void PART_70_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame, int dyPos);
- void PART_70_ENTER_FROM_OUTSIDE();
- void PART_70_EXIT_TO_OUTSIDE();
- void PART_110();
- void PART_110_EXEC_ACTION(int action);
- void PART_110_ACTION_105();
- void PART_110_ACTION_107();
- void PART_110_ACTION_108();
- void PART_110_ACTION_112();
- void PART_110_APPLY_OBJECT_STATE(int num);
+ void PART_07();
+ void PART_07_EXEC_ACTION(int action);
+ void PART_07_DRAW_DOOR_STATE(int num);
+ void PART_07_ANIMATE_DOOR(int door, bool open);
+ void PART_07_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame, int dyPos);
+ void PART_07_ENTER_FROM_OUTSIDE();
+ void PART_07_EXIT_TO_OUTSIDE();
+ void PART_10();
+ void PART_10_EXEC_ACTION(int action);
+ void PART_10_ACTION_104();
+ void PART_10_ACTION_108();
+ void PART_11();
+ void PART_11_EXEC_ACTION(int action);
+ void PART_11_ACTION_105();
+ void PART_11_ACTION_107();
+ void PART_11_ACTION_108();
+ void PART_11_ACTION_112();
+ void PART_11_APPLY_OBJECT_STATE(int num);
void PART_85();
void PART_85_HELPER_1_PLAY_ANIM(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
@@ -651,9 +651,9 @@ protected:
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_70_ROOM_DATA_OFFSETS;
- static const RoomDataOffsets PART_100_ROOM_DATA_OFFSETS;
- static const RoomDataOffsets PART_110_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_07_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_10_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_11_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
static const uint8 _inventoryOffsetTable[];
static const uint8 _inventoryActionsTable[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index d4a76a41745..bee7bc9b522 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -18,9 +18,9 @@ MODULE_OBJS = \
part_85.o \
part_90.o \
part_6.o \
- part_70.o \
- part_100.o \
- part_110.o \
+ part_7.o \
+ part_10.o \
+ part_11.o \
text.o \
part_main.o \
sound.o
diff --git a/engines/igor/part_100.cpp b/engines/igor/part_10.cpp
similarity index 82%
rename from engines/igor/part_100.cpp
rename to engines/igor/part_10.cpp
index b7d89752042..4d0d7b16f88 100644
--- a/engines/igor/part_100.cpp
+++ b/engines/igor/part_10.cpp
@@ -16,16 +16,16 @@ namespace Igor {
namespace {
-const uint32 kPart100PanelLeft = 0x0000; // cseg175:2809-2818
-const uint32 kPart100Frm1 = 0xB400; // cseg177:0002
-const uint32 kPart100Frm2 = 0xBC0A; // cseg177:0002
-const uint32 kPart100Frm3 = 0xC5E2; // cseg177:0002
-const uint32 kPart100Frm4 = 0xC786; // cseg177:0002
-const uint32 kPart100Frm5 = 0xC8AE; // cseg177:0002
+const uint32 kPart10PanelLeft = 0x0000; // cseg175:2809-2818
+const uint32 kPart10Frm1 = 0xB400; // cseg177:0002
+const uint32 kPart10Frm2 = 0xBC0A; // cseg177:0002
+const uint32 kPart10Frm3 = 0xC5E2; // cseg177:0002
+const uint32 kPart10Frm4 = 0xC786; // cseg177:0002
+const uint32 kPart10Frm5 = 0xC8AE; // cseg177:0002
} // End of anonymous namespace
-void IgorEngine::PART_100_EXEC_ACTION(int action) {
+void IgorEngine::PART_10_EXEC_ACTION(int action) {
// The action-to-function table is constructed at cseg175:08B2-09EA;
// its order differs from the disassembler's function listing order.
switch (action) {
@@ -54,7 +54,7 @@ void IgorEngine::PART_100_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 104:
- PART_100_ACTION_104(); // cseg175:0922-0940 -> sub_175_014C
+ PART_10_ACTION_104(); // cseg175:0922-0940 -> sub_175_014C
break;
case 105: // cseg175:0944-0962 -> sub_175_026F
ADD_DIALOGUE_TEXT(206, 1, 630);
@@ -75,18 +75,18 @@ void IgorEngine::PART_100_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 108: // cseg175:09AA-09C8 -> sub_175_02F6
- PART_100_ACTION_108();
+ PART_10_ACTION_108();
break;
case 109: // cseg175:09CC-09EA -> sub_175_055B
_currentPart = 40;
break;
default:
- warning("PART_100_EXEC_ACTION unhandled action %d", action);
+ warning("PART_10_EXEC_ACTION unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_100_ACTION_104() {
+void IgorEngine::PART_10_ACTION_104() {
if (_objectsState[64] == 1) { // cseg175:015A; s3:0x862
ADD_DIALOGUE_TEXT(205, 1, 629); // cseg175:0161-017D
SET_DIALOGUE_TEXT(1, 1);
@@ -104,7 +104,7 @@ void IgorEngine::PART_100_ACTION_104() {
for (int frame = 0; frame < 4; ++frame) { // cseg175:01AB-021B
for (int y = 0; y < 49; ++y) { // cseg175:01BC-0208
memcpy(_screenVGA + 0x595F + y * 320, // cseg175:01B7-01F7
- _animFramesBuffer + kPart100Frm1 + frameSelectors[frame] * 0x682 + y * 34, // cseg175:01C7-01E4
+ _animFramesBuffer + kPart10Frm1 + frameSelectors[frame] * 0x682 + y * 34, // cseg175:01C7-01E4
34); // cseg175:01FC-01FE
}
waitForTimer(31); // cseg175:020A-0214
@@ -117,13 +117,13 @@ void IgorEngine::PART_100_ACTION_104() {
}
-// Scroll to the LEFT: the left panel (PART100_bg) slides in from the left edge,
+// Scroll to the LEFT: the left panel (PART10_bg) slides in from the left edge,
// the active right panel (C1) exits right. Mirrors PART_06_ACTION_102
// (part_6.cpp); the incoming strip is read straight from the stashed left panel
// in the ANM buffer (row stride 320). layer1 is untouched by the pan, so it
// still holds the outgoing right panel afterwards and can be kept for a later
// scroll back.
-// void IgorEngine::PART_100_SCROLL_LEFT_ACTION() {
+// void IgorEngine::PART_10_SCROLL_LEFT_ACTION() {
// for (int i = 1; i < 29; ++i) {
// if (compareGameTick(1, 16)) {
// for (int y = 0; y <= 143; ++y) {
@@ -132,11 +132,11 @@ void IgorEngine::PART_100_ACTION_104() {
// }
// memcpy(_screenVGA, _screenLayer2, 46080);
// }
-// // PART_100_UPDATE_ROOM_BACKGROUND();
+// // PART_10_UPDATE_ROOM_BACKGROUND();
// waitForTimer();
// }
// // Cut over: the left panel becomes the active room (sub_175_066B position).
-// PART_100_STASH_FAR_PANEL(); // keep the outgoing right panel for the way back
+// PART_10_STASH_FAR_PANEL(); // keep the outgoing right panel for the way back
// _currentPart = 101;
// loadRoomData(PAL_OutsideAdministrationBuildingA, IMG_OutsideAdministrationBuildingA,
// BOX_OutsideAdministrationBuildingA, MSK_OutsideAdministrationBuildingA, 0);
@@ -145,22 +145,22 @@ void IgorEngine::PART_100_ACTION_104() {
// _walkData[1].setPos(136, 86, kFacingPositionRight, 0);
// _walkData[1].setDefaultScale();
// memcpy(_screenVGA, _screenLayer1, 46080);
-// PART_100_DRAW_IGOR();
+// PART_10_DRAW_IGOR();
// }
// // Scroll to the RIGHT (back to C1 / the arrival panel): the active left panel
// // slides left while the right panel's strip enters from the right edge (mirrors
// // PART_05_ACTION_102, part_5.cpp), sourced from the stashed far panel.
-// void IgorEngine::PART_100_SCROLL_RIGHT_ACTION() {
+// void IgorEngine::PART_10_SCROLL_RIGHT_ACTION() {
// for (int i = 1; i < 29; ++i) {
// 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, g_part100FarPanel + y * 320 + 320 - i * 8, i * 8);
+// memcpy(_screenLayer2 + y * 320 + 320 - i * 8, g_part10FarPanel + y * 320 + 320 - i * 8, i * 8);
// }
// memcpy(_screenVGA, _screenLayer2, 46080);
// }
-// PART_100_UPDATE_ROOM_BACKGROUND();
+// PART_10_UPDATE_ROOM_BACKGROUND();
// waitForTimer();
// }
// // Cut over: back on the arrival panel (sub_175_056D position).
@@ -172,9 +172,9 @@ void IgorEngine::PART_100_ACTION_104() {
// _walkData[1].setPos(319, 79, kFacingPositionLeft, 0);
// _walkData[1].setDefaultScale();
// memcpy(_screenVGA, _screenLayer1, 46080);
-// PART_100_DRAW_IGOR();
+// PART_10_DRAW_IGOR();
// }
-void IgorEngine::PART_100_ACTION_108() {
+void IgorEngine::PART_10_ACTION_108() {
uint8 *walkTable = loadData(WLK_DecanatoA); // cseg175:03E7-0409
int xPos = 329; // cseg175:030D
int yPos = 0;
@@ -183,7 +183,7 @@ void IgorEngine::PART_100_ACTION_108() {
if (compareGameTick(1, 16)) { // cseg175:0316-032C
for (int y = 0; y <= 143; ++y) { // cseg175:032F-03C4
memcpy(_screenLayer2 + y * 320 + i * 8, _screenLayer1 + y * 320, 320 - i * 8);
- memcpy(_screenLayer2 + y * 320, _animFramesBuffer + kPart100PanelLeft + y * 320 + 320 - i * 8, i * 8);
+ memcpy(_screenLayer2 + y * 320, _animFramesBuffer + kPart10PanelLeft + y * 320 + 320 - i * 8, i * 8);
}
if (i < 9) { // cseg175:03C7-0421
xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame];
@@ -213,7 +213,7 @@ void IgorEngine::PART_100_ACTION_108() {
_currentPart = 110; // cseg175:0553
}
-void IgorEngine::PART_100() {
+void IgorEngine::PART_10() {
_gameState.enableLight = 1;
// cseg175:27C3-27D6 copies the 0x18C9-byte DAT; cseg175:27DB then
@@ -225,36 +225,36 @@ void IgorEngine::PART_100() {
static const int frames3[] = { FRM_Decanato3, 0 };
static const int frames4[] = { FRM_Decanato4, 0 };
static const int frames5[] = { FRM_Decanato5, 0 };
- loadAnimData(frames1, kPart100Frm1);
- loadAnimData(frames2, kPart100Frm2);
- loadAnimData(frames3, kPart100Frm3);
- loadAnimData(frames4, kPart100Frm4);
- loadAnimData(frames5, kPart100Frm5);
+ loadAnimData(frames1, kPart10Frm1);
+ loadAnimData(frames2, kPart10Frm2);
+ loadAnimData(frames3, kPart10Frm3);
+ loadAnimData(frames4, kPart10Frm4);
+ loadAnimData(frames5, kPart10Frm5);
if (_objectsState[67] == 1) { // cseg175:27E5-27EC; s3:0x865
for (int y = 0; y <= 7; ++y)
- memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart100Frm4 + y * 37, 37); // cseg175:0002-0051
+ memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart10Frm4 + y * 37, 37); // cseg175:0002-0051
}
if (_objectsState[68] == 1) { // cseg175:27F1-27F8; s3:0x866
for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart100Frm3 + y * 14, 14); // cseg175:0052-00A1
+ memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart10Frm3 + y * 14, 14); // cseg175:0052-00A1
} else if (_objectsState[68] == 2) { // cseg175:27FD-2804
for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart100Frm3 + 210 + y * 14, 14); // cseg175:00A2-00F1
+ memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart10Frm3 + 210 + y * 14, 14); // cseg175:00A2-00F1
}
// Preserve the complete left panel at ANM+0, then make the right panel
// active. This load order is unconditional in cseg175:27DB-2845.
- memcpy(_animFramesBuffer + kPart100PanelLeft, _screenLayer1, 46080); // cseg175:2809-2818
+ memcpy(_animFramesBuffer + kPart10PanelLeft, _screenLayer1, 46080); // cseg175:2809-2818
loadRoomData(PAL_DecanatoB, IMG_DecanatoB, BOX_DecanatoB, MSK_DecanatoB, TXT_DecanatoB);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_100_EXEC_ACTION);
- _roomDataOffsets = PART_100_ROOM_DATA_OFFSETS;
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_10_EXEC_ACTION);
+ _roomDataOffsets = PART_10_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143); // cseg175 room mask is 320x144
- // A normal entry presents the freshly loaded right panel. On the part 102
+ // A normal entry presents the freshly loaded right panel. On state 102
// handoff, the original jumps directly to the walk-index setup instead,
// preserving the completed pan (including Igor) already in screen VGA.
// cseg175:285B-2869, cseg175:295F.
@@ -288,7 +288,7 @@ void IgorEngine::PART_100() {
_gameState.igorMoving = true; // cseg175:06E7
waitForIgorMove();
}
- // Part 102 deliberately performs no entry redraw: the completed pan has
+ // State 102 deliberately performs no entry redraw: the completed pan has
// already drawn Igor and stored his state in walk record 0.
// cseg175:2969-2981; cseg176:06AD-06F0.
@@ -302,7 +302,7 @@ void IgorEngine::PART_100() {
}
leavePartLoop();
if (_currentPart != 110)
- fadeOut(624); // cseg175:356A-3595; Part 110 keeps the completed pan palette
+ fadeOut(624); // cseg175:356A-3595; PART_11 state 110 keeps the completed pan palette
}
} // End of namespace Igor
diff --git a/engines/igor/part_110.cpp b/engines/igor/part_11.cpp
similarity index 79%
rename from engines/igor/part_110.cpp
rename to engines/igor/part_11.cpp
index 02578a26175..692910da978 100644
--- a/engines/igor/part_110.cpp
+++ b/engines/igor/part_11.cpp
@@ -16,23 +16,23 @@ namespace Igor {
namespace {
-const uint32 kPart110PanelRight = 0x0000; // cseg176:288C-289B
-const uint32 kPart110Frm1 = 0xB400; // cseg177:0002
-const uint32 kPart110Frm2 = 0xBC0A; // cseg177:0002
-const uint32 kPart110Frm3 = 0xC5E2; // cseg177:0002
-const uint32 kPart110Frm4 = 0xC786; // cseg177:0002
-const uint32 kPart110Frm5 = 0xC8AE; // cseg177:0002
+const uint32 kPart11PanelRight = 0x0000; // cseg176:288C-289B
+const uint32 kPart11Frm1 = 0xB400; // cseg177:0002
+const uint32 kPart11Frm2 = 0xBC0A; // cseg177:0002
+const uint32 kPart11Frm3 = 0xC5E2; // cseg177:0002
+const uint32 kPart11Frm4 = 0xC786; // cseg177:0002
+const uint32 kPart11Frm5 = 0xC8AE; // cseg177:0002
} // End of anonymous namespace
-void IgorEngine::PART_110_APPLY_OBJECT_STATE(int num) {
+void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) // cseg176:09B3-09BD
_roomObjectAreasTable[13].object = _objectsState[66] == 0 ? 4 : 3; // cseg176:09BF-09D2; s3:0xDC98 = object field 13
if (num == 2 || num == 255) { // cseg176:09D2-09DC
if (_objectsState[67] == 1) { // cseg176:09DE-0A0E; s3:0x865
for (int y = 0; y <= 7; ++y)
- memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart110Frm4 + y * 37, 37); // cseg176:0002-0051
+ memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart11Frm4 + y * 37, 37); // cseg176:0002-0051
for (int area = 10; area <= 11; ++area)
_roomObjectAreasTable[area].object = 7; // cseg176:09EA-0A0C; s3:[area*5-9129]
} else {
@@ -47,43 +47,43 @@ void IgorEngine::PART_110_APPLY_OBJECT_STATE(int num) {
_roomObjectAreasTable[area].object = 0; // cseg176:0A47-0A69; s3:[area*5-9129]
} else if (_objectsState[68] == 1) { // cseg176:0A6D-0A9A
for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart110Frm3 + y * 14, 14); // cseg176:0052-00A1
+ memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart11Frm3 + y * 14, 14); // cseg176:0052-00A1
for (int area = 7; area <= 8; ++area)
_roomObjectAreasTable[area].object = 6; // cseg176:0A76-0A98; s3:[area*5-9129]
} else if (_objectsState[68] == 2) {
for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart110Frm3 + 210 + y * 14, 14); // cseg176:00A2-00F1
+ memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart11Frm3 + 210 + y * 14, 14); // cseg176:00A2-00F1
_roomObjectAreasTable[7].object = 6; // cseg176:0AA5; s3:0xDC7A
_roomObjectAreasTable[8].object = 8; // cseg176:0AAA; s3:0xDC7F
}
}
}
-void IgorEngine::PART_110_ACTION_105() {
+void IgorEngine::PART_11_ACTION_105() {
for (int frame = 0; frame <= 1; ++frame) { // cseg176:06F8-076D
for (int y = 0; y <= 48; ++y)
- memcpy(_screenVGA + 0x6167 + y * 320, _animFramesBuffer + kPart110Frm1 + frame * 0x405 + y * 21, 21);
+ memcpy(_screenVGA + 0x6167 + y * 320, _animFramesBuffer + kPart11Frm1 + frame * 0x405 + y * 21, 21);
waitForTimer(127); // cseg176:075C-0766
}
// TODO: add inventory object 18 at slot 0x90F; the fork has no inventory-state API (cseg176:076F-07A9).
playSound(51, 1); // cseg176:07A5-07A9
_objectsState[66] = 1; // cseg176:07B3; s3:0x864
- PART_110_APPLY_OBJECT_STATE(255); // cseg176:07B8-07BA
+ PART_11_APPLY_OBJECT_STATE(255); // cseg176:07B8-07BA
}
-void IgorEngine::PART_110_ACTION_107() {
+void IgorEngine::PART_11_ACTION_107() {
for (int frame = 0; frame <= 2; ++frame) { // cseg176:01C7-023C
for (int y = 0; y <= 27; ++y)
- memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart110Frm5 + frame * 0x348 + y * 30, 30);
+ memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart11Frm5 + frame * 0x348 + y * 30, 30);
waitForTimer(61); // cseg176:022B-0235
}
// TODO: remove the inventory object indexed by s3:0x904; the fork has no inventory-state API (cseg176:023E-0281).
playSound(63, 1); // cseg176:027D-0281
_objectsState[68] = 1; // cseg176:0286; s3:0x866
- PART_110_APPLY_OBJECT_STATE(255); // cseg176:0290-0292
+ PART_11_APPLY_OBJECT_STATE(255); // cseg176:0290-0292
}
-void IgorEngine::PART_110_ACTION_108() {
+void IgorEngine::PART_11_ACTION_108() {
uint8 *walkTable = loadData(WLK_DecanatoB); // cseg176:0584-05A6
int xPos = 310; // cseg176:04AE
int yPos = 0;
@@ -92,7 +92,7 @@ void IgorEngine::PART_110_ACTION_108() {
if (compareGameTick(1, 16)) { // cseg176:04B7-04CD
for (int y = 0; y <= 143; ++y) { // cseg176:04D0-0565
memcpy(_screenLayer2 + y * 320, _screenLayer1 + y * 320 + i * 8, 320 - i * 8);
- memcpy(_screenLayer2 + y * 320 + 320 - i * 8, _animFramesBuffer + kPart110PanelRight + y * 320, i * 8);
+ memcpy(_screenLayer2 + y * 320 + 320 - i * 8, _animFramesBuffer + kPart11PanelRight + y * 320, i * 8);
}
if (i < 9) { // cseg176:0568-05BE
xPos += _walkScaleTable[0x8F9 + _walkCurrentFrame];
@@ -122,20 +122,20 @@ void IgorEngine::PART_110_ACTION_108() {
_currentPart = 102; // cseg176:06F0
}
-void IgorEngine::PART_110_ACTION_112() {
+void IgorEngine::PART_11_ACTION_112() {
for (int frame = 0; frame <= 2; ++frame) { // cseg176:00F2-0167
for (int y = 0; y <= 27; ++y)
- memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart110Frm2 + frame * 0x348 + y * 30, 30);
+ memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart11Frm2 + frame * 0x348 + y * 30, 30);
waitForTimer(61); // cseg176:0156-0160
}
// TODO: add inventory object 23 at slot 0x914; the fork has no inventory-state API (cseg176:0169-01A3).
playSound(51, 1); // cseg176:019F-01A3
_objectsState[68] = 1; // cseg176:01AD; s3:0x866
_objectsState[26] = 1; // cseg176:01B9; s3:0x83C
- PART_110_APPLY_OBJECT_STATE(3); // cseg176:01B2-01B4
+ PART_11_APPLY_OBJECT_STATE(3); // cseg176:01B2-01B4
}
-void IgorEngine::PART_110_EXEC_ACTION(int action) {
+void IgorEngine::PART_11_EXEC_ACTION(int action) {
switch (action) { // cseg176:07C1-09A8
case 101: // sub_176_0362
ADD_DIALOGUE_TEXT(201, 2, 616); // cseg176:036C-0388
@@ -163,7 +163,7 @@ void IgorEngine::PART_110_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 105:
- PART_110_ACTION_105();
+ PART_11_ACTION_105();
break;
case 106: // sub_176_043D
ADD_DIALOGUE_TEXT(73, 1, 50); // cseg176:0447-0463
@@ -172,10 +172,10 @@ void IgorEngine::PART_110_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 107:
- PART_110_ACTION_107();
+ PART_11_ACTION_107();
break;
case 108:
- PART_110_ACTION_108();
+ PART_11_ACTION_108();
break;
case 109: // sub_176_046A
ADD_DIALOGUE_TEXT(207, 1, 621); // cseg176:0474-0490
@@ -196,7 +196,7 @@ void IgorEngine::PART_110_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 112:
- PART_110_ACTION_112();
+ PART_11_ACTION_112();
break;
case 113: // sub_176_0335
ADD_DIALOGUE_TEXT(211, 1, 625); // cseg176:033F-035B
@@ -211,16 +211,16 @@ void IgorEngine::PART_110_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
default:
- warning("PART_110_EXEC_ACTION unhandled action %d", action);
+ warning("PART_11_EXEC_ACTION unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_110() {
+void IgorEngine::PART_11() {
_gameState.enableLight = 1;
- loadActionData(DAT_DecanatoPart110); // cseg176:286F-2882
+ loadActionData(DAT_DecanatoPart11); // cseg176:286F-2882
loadRoomData(PAL_DecanatoB, IMG_DecanatoB, BOX_DecanatoB, MSK_DecanatoB, TXT_DecanatoB); // cseg176:2887
- memcpy(_animFramesBuffer + kPart110PanelRight, _screenLayer1, 46080); // cseg176:288C-289B
+ memcpy(_animFramesBuffer + kPart11PanelRight, _screenLayer1, 46080); // cseg176:288C-289B
loadRoomData(PAL_DecanatoA, IMG_DecanatoA, BOX_DecanatoA, MSK_DecanatoA, TXT_DecanatoA); // cseg176:28C8
static const int frames1[] = { FRM_Decanato1, 0 };
@@ -228,16 +228,16 @@ void IgorEngine::PART_110() {
static const int frames3[] = { FRM_Decanato3, 0 };
static const int frames4[] = { FRM_Decanato4, 0 };
static const int frames5[] = { FRM_Decanato5, 0 };
- loadAnimData(frames1, kPart110Frm1); // cseg176:28CD; cseg177:0002
- loadAnimData(frames2, kPart110Frm2);
- loadAnimData(frames3, kPart110Frm3);
- loadAnimData(frames4, kPart110Frm4);
- loadAnimData(frames5, kPart110Frm5);
-
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_110_EXEC_ACTION); // cseg176:28D2; sub_176_07C1
- _roomDataOffsets = PART_110_ROOM_DATA_OFFSETS;
+ loadAnimData(frames1, kPart11Frm1); // cseg176:28CD; cseg177:0002
+ loadAnimData(frames2, kPart11Frm2);
+ loadAnimData(frames3, kPart11Frm3);
+ loadAnimData(frames4, kPart11Frm4);
+ loadAnimData(frames5, kPart11Frm5);
+
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_11_EXEC_ACTION); // cseg176:28D2; sub_176_07C1
+ _roomDataOffsets = PART_11_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143); // cseg176 room mask is 320x144
- PART_110_APPLY_OBJECT_STATE(255); // cseg176:28D7-28D9; sub_176_09A9(-1)
+ PART_11_APPLY_OBJECT_STATE(255); // cseg176:28D7-28D9; sub_176_09A9(-1)
SET_PAL_240_48_1();
SET_PAL_208_96_1();
_walkDataLastIndex = 1; // cseg176:29B6
diff --git a/engines/igor/part_70.cpp b/engines/igor/part_7.cpp
similarity index 88%
rename from engines/igor/part_70.cpp
rename to engines/igor/part_7.cpp
index 1388ac27cea..9461f542d22 100644
--- a/engines/igor/part_70.cpp
+++ b/engines/igor/part_7.cpp
@@ -19,7 +19,7 @@ const uint32 kDoor2Open = 0x28DD; // cseg197:00CB
} // End of anonymous namespace
-void IgorEngine::PART_70_DRAW_DOOR_STATE(int num) {
+void IgorEngine::PART_07_DRAW_DOOR_STATE(int num) {
_roomActionsTable[297] = 109; // cseg197:0B0C-0B17
if (num == 1 || num == 255) { // cseg197:0B1D-0B27
const uint32 srcOffset = _objectsState[52] == 0 ? kDoor1Closed : kDoor1Open; // cseg197:0B29-0B58; s3:0x856
@@ -35,7 +35,7 @@ void IgorEngine::PART_70_DRAW_DOOR_STATE(int num) {
}
}
-void IgorEngine::PART_70_ANIMATE_DOOR(int door, bool open) {
+void IgorEngine::PART_07_ANIMATE_DOOR(int door, bool open) {
const int stateIndex = door == 1 ? 52 : 53; // cseg197:0150 and cseg197:029E; s3:0x856-0x857
if ((_objectsState[stateIndex] != 0) == open) {
const int text = open ? 19 : 23; // cseg222:2C5A-2C86 and cseg222:2CF6-2D22
@@ -63,10 +63,10 @@ void IgorEngine::PART_70_ANIMATE_DOOR(int door, bool open) {
waitForTimer(127); // cseg197:01C8-01D2,026F-0279,031A-0324,03C5-03CF (wait while tick <= 0x7E)
}
_objectsState[stateIndex] = open ? 1 : 0; // cseg197:01DB,0282,032D,03D8
- PART_70_DRAW_DOOR_STATE(door); // cseg197:01E0-01E2,0287-0289,0332-0334,03DD-03DF
+ PART_07_DRAW_DOOR_STATE(door); // cseg197:01E0-01E2,0287-0289,0332-0334,03DD-03DF
}
-void IgorEngine::PART_70_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame, int dyPos) {
+void IgorEngine::PART_07_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame, int dyPos) {
WalkData &wd = _walkData[0]; // cseg197:06F6 and cseg197:0884; s3:0xD94A = 0
wd.setPos(109, 143, facing, frame); // cseg197:070B-071F and cseg197:089A-08BA
wd.clipSkipX = 1; // cseg197:0734 and cseg197:08CF
@@ -81,20 +81,20 @@ void IgorEngine::PART_70_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame,
moveIgor(facing, frame); // cseg197:0767-076F and cseg197:0903-090B
}
-void IgorEngine::PART_70_ENTER_FROM_OUTSIDE() {
- PART_70_DRAW_DOOR_STATE(255); // cseg197:06EA-06EC
+void IgorEngine::PART_07_ENTER_FROM_OUTSIDE() {
+ PART_07_DRAW_DOOR_STATE(255); // cseg197:06EA-06EC
for (int area = 11; area <= 13; ++area)
_roomObjectAreasTable[area].area = 0; // cseg197:092E-095D
int frame = 1; // cseg197:06FB
for (int step = 0; step <= 9; ++step) { // cseg197:0700-0785
- PART_70_DRAW_SCALED_IGOR(step, kFacingPositionBack, frame, 0);
+ PART_07_DRAW_SCALED_IGOR(step, kFacingPositionBack, frame, 0);
frame = frame == 6 ? 1 : frame + 1; // cseg197:0722-0730
waitForTimer(15); // cseg197:0774-077E
}
_walkDataLastIndex = 0; // cseg197:0787-0791
- if (!_part70FirstVisitDone) { // cseg197:0795; s3:0xED2E
+ if (!_part07FirstVisitDone) { // cseg197:0795; s3:0xED2E
buildWalkPath(109, 143, 180, 129); // cseg197:079F-07D5; DAT+161 = 0xA1F4
_walkData[_walkDataLastIndex].frameNum = 0; // cseg197:07DA-07E2
_walkData[_walkDataLastIndex].posNum = kFacingPositionRight; // cseg197:07E7-07FF; DAT+173 = 2
@@ -106,7 +106,7 @@ void IgorEngine::PART_70_ENTER_FROM_OUTSIDE() {
SET_DIALOGUE_TEXT(1, 2); // cseg197:0836-083B
startIgorDialogue();
waitForEndOfIgorDialogue();
- _part70FirstVisitDone = true; // cseg197:0845; s3:0xED2E
+ _part07FirstVisitDone = true; // cseg197:0845; s3:0xED2E
} else {
buildWalkPath(109, 143, 129, 138); // cseg197:084C-0857
_walkData[_walkDataLastIndex].frameNum = 0; // cseg197:085C-0864
@@ -116,19 +116,19 @@ void IgorEngine::PART_70_ENTER_FROM_OUTSIDE() {
}
}
-void IgorEngine::PART_70_EXIT_TO_OUTSIDE() {
+void IgorEngine::PART_07_EXIT_TO_OUTSIDE() {
int frame = 1; // cseg197:0889
for (int step = 9; step >= 0; --step) { // cseg197:088E-0923
if (step == 9)
frame = 0; // cseg197:08AB-08B2
- PART_70_DRAW_SCALED_IGOR(step, kFacingPositionFront, frame, 3);
+ PART_07_DRAW_SCALED_IGOR(step, kFacingPositionFront, frame, 3);
frame = frame == 6 ? 1 : frame + 1; // cseg197:08BD-08CB
waitForTimer(15); // cseg197:0910-091A
}
_currentPart = 101; // cseg197:0926
}
-void IgorEngine::PART_70_EXEC_ACTION(int action) {
+void IgorEngine::PART_07_EXEC_ACTION(int action) {
switch (action) { // cseg197:095E-0B01
case 101:
ADD_DIALOGUE_TEXT(201, 1, 140); // cseg197:03F0-03FC
@@ -143,16 +143,16 @@ void IgorEngine::PART_70_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 103:
- PART_70_ANIMATE_DOOR(1, true); // cseg197:09AC-09CA
+ PART_07_ANIMATE_DOOR(1, true); // cseg197:09AC-09CA
break;
case 104:
- PART_70_ANIMATE_DOOR(1, false); // cseg197:09CE-09EC
+ PART_07_ANIMATE_DOOR(1, false); // cseg197:09CE-09EC
break;
case 105:
- PART_70_ANIMATE_DOOR(2, true); // cseg197:09F0-0A0E
+ PART_07_ANIMATE_DOOR(2, true); // cseg197:09F0-0A0E
break;
case 106:
- PART_70_ANIMATE_DOOR(2, false); // cseg197:0A12-0A30
+ PART_07_ANIMATE_DOOR(2, false); // cseg197:0A12-0A30
break;
case 107:
ADD_DIALOGUE_TEXT(204, 1, 142); // cseg197:044A-0456
@@ -193,7 +193,7 @@ void IgorEngine::PART_70_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 110:
- PART_70_EXIT_TO_OUTSIDE(); // cseg197:0A9A-0AB8
+ PART_07_EXIT_TO_OUTSIDE(); // cseg197:0A9A-0AB8
break;
case 111:
if (_objectsState[52] != 0) { // cseg197:05A2-05A9; s3:0x856
@@ -221,22 +221,22 @@ void IgorEngine::PART_70_EXEC_ACTION(int action) {
}
break;
default:
- warning("PART_70_EXEC_ACTION unhandled action %d", action);
+ warning("PART_07_EXEC_ACTION unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_70() {
+void IgorEngine::PART_07() {
_gameState.enableLight = 1; // cseg197:290F
loadActionData(DAT_AdministrationCorridor); // cseg197:2920-2943
loadRoomData(PAL_AdministrationCorridor, IMG_AdministrationCorridor,
BOX_AdministrationCorridor, MSK_AdministrationCorridor, TXT_AdministrationCorridor); // cseg199:0002-06A0
static const int anim[] = { ANM_AdministrationCorridor, 0 }; // cseg198:0002-00D5
loadAnimData(anim);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_70_EXEC_ACTION); // cseg197:095E-0B01
- _roomDataOffsets = PART_70_ROOM_DATA_OFFSETS;
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_07_EXEC_ACTION); // cseg197:095E-0B01
+ _roomDataOffsets = PART_07_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143); // cseg199 room mask is 320x144
- PART_70_DRAW_DOOR_STATE(255); // cseg197:2957-2959
+ PART_07_DRAW_DOOR_STATE(255); // cseg197:2957-2959
memcpy(_screenVGA, _screenLayer1, 46080); // cseg197:295E-2970
SET_PAL_240_48_1(); // cseg197:29F0-29F4
SET_PAL_208_96_1(); // cseg197:29F9-29FF
@@ -259,7 +259,7 @@ void IgorEngine::PART_70() {
_walkDataCurrentIndex = 1; // cseg197:2AA9 and cseg197:2B08
fadeIn(768); // cseg197:2B0D-2B10
if (_currentPart == 70)
- PART_70_ENTER_FROM_OUTSIDE(); // cseg197:2B15-2B1C
+ PART_07_ENTER_FROM_OUTSIDE(); // cseg197:2B15-2B1C
enterPartLoop();
while (_currentPart >= 70 && _currentPart <= 72) // cseg197:2B4C-2B55
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index ab22e3e550e..965f8fe1be3 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -144,16 +144,16 @@ void IgorEngine::PART_MAIN() {
case 70:
case 71:
case 72:
- PART_70(); // Administration corridor; cseg197:28D4
+ PART_07(); // Administration corridor; cseg197:28D4
break;
case 100:
case 101:
case 102:
- PART_100(); // OutsideAdministrationBuilding street
+ PART_10(); // OutsideAdministrationBuilding street
break;
case 110:
- PART_110(); // OutsideAdministrationBuilding street, left panel
+ PART_11(); // OutsideAdministrationBuilding street, left panel
break;
case 850: // Intro cutscene
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 6d650b7c021..2b642fc96d6 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -471,17 +471,8 @@
#define STR_SharewarePenduloAddress5 447
#define STR_SharewarePenduloAddress6 448
-// OutsideAdministrationBuilding street panels. Not in the original CD table (it
-// jumps from FRM_OutsideAdministrationBuilding5=351 straight to
-// DAT_DeanPepperOffice=352). They are added to the generator's CD catalog
-// (reference/scummvm-create-igortbl/resource_sp_cdrom.h) and shipped inside
-// IGOR.TBL, so the engine loads them through the regular findData()/loadData()
-// path like every other room. The ids are far above the original max (~448) so
-// they can never collide with a real table id.
-// A = left panel, PART100_bg (scrolled in towards the map; ANM slot 0x0)
-// B = right panel, C1 arrival (what part 100 shows on entry)
-// TXT A/B include the original walk-scale tables, names, and dialogue strings
-// loaded by cseg179:0002 and cseg178:0002 respectively.
+
+// Decanato panels
#define PAL_DecanatoA 900
#define IMG_DecanatoA 901
#define MSK_DecanatoA 902
@@ -492,21 +483,18 @@
#define BOX_DecanatoB 907
#define TXT_DecanatoA 908
#define TXT_DecanatoB 909
-// Pan walk line used by sub_175_02F6 (cseg175:03E7-0409) and the part 110 pan
-// (cseg176:05A6): yPos = line[xPos - 260]. Recovered from the uncatalogued
-// CD gap between DAT_OutsideAdministrationBuilding and FRM_..._1; see the
-// resource_sp_cdrom.h rows for the byte sources (A/B are byte-identical).
+// Walk line used for scroll
#define WLK_DecanatoA 910
#define WLK_DecanatoB 911
-#define DAT_DecanatoPart110 912 // cseg176:286F-2882; IGOR.EXE:0x68049B, size 0x1841
+#define DAT_DecanatoPart11 912 // cseg176:286F-2882; IGOR.EXE:0x68049B, size 0x1841
-// CD-only end card shown by part 850. All three resources are contiguous in
+// CD-only intro card shown by state 850. All three resources are contiguous in
// NE segment 209 immediately after the intro code.
#define FRM_IgorIntroLogo 913 // cseg209:13BE; IGOR.EXE:0x7C09BE, 206x13
#define IMG_IgorIntroLogo 914 // cseg209:1E34; IGOR.EXE:0x7C1434, 320x122
#define PAL_IgorIntroLogo 915 // cseg209:B6B4; IGOR.EXE:0x7CACB4, 768 bytes
-// Administration corridor used by parts 70-72. These CD resources live in
+// Administration corridor used by PART_07 states 70-72. These CD resources live in
// NE segments 197-199 and were absent from the historical TBL catalog.
#define DAT_AdministrationCorridor 916 // cseg197:3732; IGOR.EXE:0x748B32, 0x1A59 bytes
#define ANM_AdministrationCorridor 917 // cseg198:00D6; IGOR.EXE:0x74C8D6, 0x2B4D bytes
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 98225a37491..0e3aef673e9 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -203,7 +203,7 @@ const RoomDataOffsets IgorEngine::PART_06_ROOM_DATA_OFFSETS = {
{ 135, 30, 5158, 100, 60 }
};
-const RoomDataOffsets IgorEngine::PART_70_ROOM_DATA_OFFSETS = {
+const RoomDataOffsets IgorEngine::PART_07_ROOM_DATA_OFFSETS = {
{ 80, 4, 12, 3 }, // cseg197:194E-199C; DAT+80, 4 records, 12-byte source, 3-byte destination
{ 151, 168 }, // cseg197:1F87-1FCF and cseg197:2124-213D
{ 175, 419, 3575, 319, 395, 88 }, // cseg197:2E4C-2F19 and cseg197:2F23-2F62
@@ -217,14 +217,14 @@ const RoomDataOffsets IgorEngine::PART_04_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0 }
};
-const RoomDataOffsets IgorEngine::PART_100_ROOM_DATA_OFFSETS = {
+const RoomDataOffsets IgorEngine::PART_10_ROOM_DATA_OFFSETS = {
{ 45, 3, 6, 2 }, // cseg175:17F9-1829: DAT+45, 3 records, 6-byte source, 2-byte destination
{ 77, 90 }, // cseg175:1E22-1E68 and cseg175:1FBB-1FD3
{ 95, 303, 3319, 199, 275, 84 }, // cseg175:1C41-1CA7, 1CE9-1D4F, 2C8B-2DEA
{ 0, 0, 0, 0, 0 }
};
-const RoomDataOffsets IgorEngine::PART_110_ROOM_DATA_OFFSETS = {
+const RoomDataOffsets IgorEngine::PART_11_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 }, // cseg176 routes walks through the room mask; no area matrix
{ 35, 52 }, // cseg176:1EE5-1F15, 207C
{ 59, 309, 3255, 203, 279, 82 }, // cseg176:2CBC-2CE5 (action); +60 is its walk behavior at 1E7B,2026,2061
Commit: 0613ed6c48ecbcce00450c87b927e8a1a64a63c9
https://github.com/scummvm/scummvm/commit/0613ed6c48ecbcce00450c87b927e8a1a64a63c9
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:53+01:00
Commit Message:
IGOR: Dialogue handling code
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index f63ec22b671..a6bada35c91 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -240,9 +240,9 @@ void IgorEngine::runPartLoop() {
if (compareGameTick(1, 16)) {
handleRoomIgorWalk();
}
- // if (compareGameTick(19, 32)) {
- // handleRoomDialogue();
- // }
+ if (compareGameTick(19, 32)) {
+ handleRoomDialogue();
+ }
if (compareGameTick(4, 8)) {
handleRoomInventoryScroll();
}
@@ -256,6 +256,26 @@ void IgorEngine::runPartLoop() {
waitForTimer();
}
+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::handleRoomLight() {
if (_gameState.dialogueTextRunning || _gameState.igorMoving) {
_gameState.updateLight = false;
@@ -453,6 +473,16 @@ void IgorEngine::removeObjectFromInventory(int index) {
playSound(63, 1);
}
+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;
+}
+
void IgorEngine::packInventory() {
for (int i = 1; i <= _inventoryInfo[73]; ++i) {
if (_inventoryImages[i - 1] != 0) {
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 12209343ac4..2ca9b30d54e 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -518,6 +518,7 @@ private:
void drawInventory(int start, int mode);
void addObjectToInventory(int object, int index);
void removeObjectFromInventory(int index);
+ int getObjectFromInventory(int x) const;
void packInventory();
@@ -525,6 +526,8 @@ private:
void leavePartLoop();
void runPartLoop();
+ void handleRoomDialogue();
+
void handleRoomLight();
void updateRoomLight(int fl);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index edbcef1fbc1..79319e946b1 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -229,28 +229,28 @@ void IgorEngine::handleRoomInput() {
// 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;
- // }
+ 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;
@@ -280,11 +280,11 @@ void IgorEngine::handleRoomInput() {
}
if (_currentAction.verbType == 0) {
- // if (_currentAction.object1Type == kObjectTypeInventory) {
- // _actionCode = _inventoryActionsTable[(_currentAction.verb - 1) * 2 + _currentAction.object1Num * 20];
- // } else {
+ 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];
- // }
+ }
// The original only exposes a room object when this action byte is
// non-zero; otherwise hover text is verb-only. cseg175:2C8B-2CBC;
// cseg176:2CBC-2CED.
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 647acbd3ddb..58b95f84cf1 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -26,6 +26,56 @@ 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::_dialogueColor[] = { 0x3F, 0x3F, 0x3F };
const uint8 IgorEngine::_sentenceColorIndex[]= { 0xFD, 0xFB, 0xF1 };
Commit: 4754c4ab49cee89c69c1f5a08ad423c3e2dd29ac
https://github.com/scummvm/scummvm/commit/4754c4ab49cee89c69c1f5a08ad423c3e2dd29ac
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:53+01:00
Commit Message:
IGOR: Fix speech being overlapped by SFX
Changed paths:
engines/igor/igor.h
engines/igor/part_5.cpp
engines/igor/part_6.cpp
engines/igor/sound.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 2ca9b30d54e..36930173ab9 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -421,7 +421,7 @@ private:
void stopSound();
void loadIgorFrames();
- void ADD_DIALOGUE_TEXT(int num, int count, int sound = kNoSpeechSound);
+ 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);
@@ -451,7 +451,8 @@ private:
void PART_05_HELPER_5(int frame);
void PART_05();
void PART_05_EXEC_ACTION(int action);
- void PART_05_ACTION_102();
+ void PART_05_ACTION_103_pickPaper();
+ void PART_05_ACTION_102_scrollRight();
void PART_05_UPDATE_ROOM_BACKGROUND();
void PART_06();
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index a81e74109b8..a1add9b7288 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -22,6 +22,36 @@
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, 478); // cseg182:0552-055E (sub_182_0548)
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ }
+ case 102:
+ //scrolling action for Igor on the bridge
+ PART_05_ACTION_102_scrollRight();
+ break;
+ case 103:
+ PART_05_ACTION_103_pickPaper();
+ break;
+ case 104:
+ ADD_DIALOGUE_TEXT(203, 2, 479); // cseg182:0575-058B (sub_182_0575)
+ 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_HELPER_4(int num) {
if (_objectsState[60] == 0) {
PART_05_HELPER_5(0);
@@ -76,44 +106,39 @@ void IgorEngine::PART_05() {
if (_currentPart == 255) {
fadeOut(768);
} else if (_currentPart != 60) {
- // if (_objectsState[63] == 0) {
- // _objectsState[61] = _objectsState[62] = _objectsState[63] = 1;
- // }
+ if (_objectsState[63] == 0) {
+ _objectsState[61] = _objectsState[62] = _objectsState[63] = 1;
+ }
memcpy(_currentPalette, _paletteBuffer, 624);
fadeOut(624);
}
}
-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:
- //scrolling action for Igor on the bridge
- 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_103_pickPaper() {
+ 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_ACTION_102() {
+void IgorEngine::PART_05_ACTION_102_scrollRight() {
uint8 *walkTable3 = loadData(WLK_Bridge3);
uint8 *walkTable4 = loadData(WLK_Bridge4);
int xPos = 220;
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 5ef8ded1a74..41889e9e2bb 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -95,7 +95,7 @@ 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);
+ ADD_DIALOGUE_TEXT(201, 1, 480); // cseg180:05B6-05CC (sub_180_05B6)
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -106,7 +106,7 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
PART_06_ACTION_103();
break;
case 104:
- ADD_DIALOGUE_TEXT(203, 1);
+ ADD_DIALOGUE_TEXT(203, 1, 481); // cseg180:05E3-05F9 (sub_180_05E3)
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -114,7 +114,7 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
PART_06_ACTION_105();
break;
case 106:
- ADD_DIALOGUE_TEXT(204, 1);
+ ADD_DIALOGUE_TEXT(204, 1, 482); // cseg180:0610-0626 (sub_180_0610)
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -130,12 +130,12 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
}
}
void IgorEngine::PART_06_ACTION_103() {
- ADD_DIALOGUE_TEXT(215, 1);
+ ADD_DIALOGUE_TEXT(215, 1, 489); // cseg180:0D10-0D26 (sub_180_0D10)
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
PART_06_HELPER_8_animatePhotographer(0);
- ADD_DIALOGUE_TEXT(216, 1);
+ ADD_DIALOGUE_TEXT(216, 1, 490); // cseg180:0D40-0D53 (sub_180_0D10)
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(170, 69, 55, 37, 63);
waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63);
@@ -194,11 +194,11 @@ void IgorEngine::PART_06_ACTION_105() {
void IgorEngine::PART_06_ACTION_107() {
PART_06_HELPER_8_animatePhotographer(0);
- ADD_DIALOGUE_TEXT(205, 1);
+ ADD_DIALOGUE_TEXT(205, 1, 483); // cseg180:0D90-0DAD (sub_180_0D90)
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(206, 2);
+ ADD_DIALOGUE_TEXT(206, 2, 484); // cseg180:0DC2-0DD3 (sub_180_0D90)
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(170, 69, 55, 37, 63);
waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63);
@@ -206,12 +206,12 @@ void IgorEngine::PART_06_ACTION_107() {
void IgorEngine::PART_06_ACTION_108() {
PART_06_HELPER_8_animatePhotographer(0);
- ADD_DIALOGUE_TEXT(208, 2);
- ADD_DIALOGUE_TEXT(210, 2);
+ ADD_DIALOGUE_TEXT(208, 2, 485); // cseg180:0E09-0E1C (sub_180_0DFF)
+ ADD_DIALOGUE_TEXT(210, 2, 486); // cseg180:0E22-0E2E (sub_180_0DFF)
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(212, 1);
+ ADD_DIALOGUE_TEXT(212, 1, 487); // cseg180:0E43-0E54 (sub_180_0DFF)
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(170, 69, 55, 37, 63);
waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63);
@@ -234,7 +234,7 @@ void IgorEngine::PART_06_ACTION_108() {
_objectsState[61] = 0;
PART_06_HELPER_6(255);
_gameState.unkF = false;
- ADD_DIALOGUE_TEXT(213, 2);
+ ADD_DIALOGUE_TEXT(213, 2, 488); // cseg180:1240-1256 (sub_180_0DFF)
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 8fd87c6a994..90f69d8e08f 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -73,8 +73,17 @@ void IgorEngine::playSound(int num, int type) {
} else {
return;
}
- _sndFile.seek(soundOffset);
- Audio::AudioStream *stream = Audio::makeVOCStream(&_sndFile, Audio::FLAG_UNSIGNED);
+
+ // two streams must never share one Common::File: the second stream's seek would
+ // clobber the first one's cursor and the running sound would come out as
+ // noise. Give each stream its own handle and let the stream dispose of it.
+ Common::File *sndFile = new Common::File;
+ if (!sndFile->open(_game.sfxFileName)) {
+ delete sndFile;
+ return;
+ }
+ sndFile->seek(soundOffset);
+ Audio::AudioStream *stream = Audio::makeVOCStream(sndFile, Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
if (stream) {
_mixer->playStream(soundType, soundHandle, stream);
}
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 58b95f84cf1..a40a6ae1745 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -304,6 +304,7 @@ void IgorEngine::startIgorDialogue() {
_talkDelayCounter = 0;
}
if (_gameState.talkMode != kTalkModeTextOnly) {
+ debug("Playing sound for igor dialogue text: %d", dt->sound);
playSound(dt->sound, 0);
}
_gameState.dialogueTextRunning = true;
Commit: 88e553c62b99d03f0acc6ebbda66ac0b2ddc3050
https://github.com/scummvm/scummvm/commit/88e553c62b99d03f0acc6ebbda66ac0b2ddc3050
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:54+01:00
Commit Message:
IGOR: Fix walking algorithm
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_5.cpp
engines/igor/part_6.cpp
engines/igor/part_85.cpp
engines/igor/resource.cpp
engines/igor/sound.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index a6bada35c91..277e2162c6d 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -269,7 +269,7 @@ void IgorEngine::handleRoomDialogue() {
startIgorDialogue();
}
} else {
- animateIgorTalking(getRandomNumber(6));
+ animateIgorTalking(getRandomNumber(5));
++_talkDelayCounter;
}
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 36930173ab9..0e1504fb056 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -533,6 +533,9 @@ private:
void updateRoomLight(int fl);
+ 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);
+
int lookupScale(int xOffset, int yOffset, int h) const;
void lookupScale(int curX, int curY, uint8 &scale, uint8 &xScale, uint8 &yScale) const;
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 79319e946b1..c7e17c89f95 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -220,6 +220,21 @@ void IgorEngine::handleRoomInput() {
return;
}
+ if (_inputVars[kInputClick] && _gameState.igorMoving) {
+ _walkDataCurrentPosX = _walkData[_walkDataCurrentIndex - 1].x;
+ _walkDataCurrentPosY = _walkData[_walkDataCurrentIndex - 1].y;
+ if (_roomObjectAreasTable[_screenLayer2[_walkDataCurrentPosY * 320 + _walkDataCurrentPosX]].area == 0) {
+ // cseg180:0x23B2-0x23F8 / cseg182:0x1A10-0x1A56
+ return;
+ }
+ _walkDataCurrentPosX = _walkData[_walkDataCurrentIndex + 1].x;
+ _walkDataCurrentPosY = _walkData[_walkDataCurrentIndex + 1].y;
+ if (_roomObjectAreasTable[_screenLayer2[_walkDataCurrentPosY * 320 + _walkDataCurrentPosX]].area == 0) {
+ // cseg180:0x23FB-0x2441 / cseg182:0x1A59-0x1A9F
+ return;
+ }
+ }
+
bool actionHovering = !_inputVars[kInputClick];
_inputVars[kInputClick] = 0;
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index a1add9b7288..7097e225ef5 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -26,6 +26,7 @@ namespace Igor {
debugC(9, kDebugGame, "PART_05_EXEC_ACTION %d", action);
switch (action) {
case 101: {
+ // Look at water
ADD_DIALOGUE_TEXT(201, 2, 478); // cseg182:0552-055E (sub_182_0548)
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -39,11 +40,13 @@ namespace Igor {
PART_05_ACTION_103_pickPaper();
break;
case 104:
+ // Look at photographers
ADD_DIALOGUE_TEXT(203, 2, 479); // cseg182:0575-058B (sub_182_0575)
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 105:
+ // go to map
_currentPart = 40;
break;
default:
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 41889e9e2bb..4ee86e93aea 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -95,7 +95,8 @@ 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, 1, 480); // cseg180:05B6-05CC (sub_180_05B6)
+ //Look at water
+ ADD_DIALOGUE_TEXT(201, 2, 480); // cseg180:05B6-05CC (sub_180_05B6)
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -346,7 +347,7 @@ void IgorEngine::PART_06() {
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);
+ PART_06_HELPER_6(255);
if (_objectsState[63] == 1) {
PART_06_HELPER_3_drawTripod();
@@ -373,9 +374,9 @@ void IgorEngine::PART_06() {
if (compareGameTick(1, 16)) {
handleRoomIgorWalk();
}
- // if (compareGameTick(19, 32)) {
- // handleRoomDialogue();
- // }
+ if (compareGameTick(19, 32)) {
+ handleRoomDialogue();
+ }
if (compareGameTick(4, 8)) {
handleRoomInventoryScroll();
}
diff --git a/engines/igor/part_85.cpp b/engines/igor/part_85.cpp
index 8b666ff60f1..ed32c50acaf 100644
--- a/engines/igor/part_85.cpp
+++ b/engines/igor/part_85.cpp
@@ -191,6 +191,9 @@ void IgorEngine::displayLogo() {
_currentPalette[765] = 63; // cseg209:0x0465
_currentPalette[766] = 63; // cseg209:0x046A
_currentPalette[767] = 63; // cseg209:0x046F
+ uint8 logoColor255[3];
+ memcpy(logoColor255, _currentPalette + 765, 3);
+ memset(_currentPalette + 765, 0, 3); // cseg209:0x0474-0x047D
updatePalette(768); // cseg209:0x0474-0x0486
loadData(IMG_IgorIntroLogo, _screenVGA); // cseg209:0x048B-0x04B8
@@ -210,13 +213,12 @@ void IgorEngine::displayLogo() {
}
free(subtitle);
- // Update the stored palette while exposing only color 255 to VGA.
- // cseg209:0x04F9-0x05CB
+ // Fade color 255 from black to the logo's white. cseg209:0x04F9-0x05CB
for (int threshold = 63; threshold >= 0; threshold -= 3) {
- for (int i = 0; i < 768; ++i) {
- if (_paletteBuffer[i] >= threshold) {
+ for (int i = 765; i < 768; ++i) { // cseg209:0x0504-0x05B8
+ if (logoColor255[i - 765] >= threshold) {
const int color = _currentPalette[i] + 3;
- _currentPalette[i] = MIN<int>(color, _paletteBuffer[i]);
+ _currentPalette[i] = MIN<int>(color, logoColor255[i - 765]);
}
}
setPaletteRange(255, 255); // cseg209:0x05BB-0x05BF
@@ -240,17 +242,17 @@ void IgorEngine::displayLogo() {
memcpy(_currentPalette, _paletteBuffer, 765); // cseg209:0x064E-0x065B
setPaletteRange(0, 255); // cseg209:0x0660-0x0664
- // The original updates only color 255 here. The other palette changes stay
- // internal and therefore do not produce a visible fade. cseg209:0x0669-0x0705
- // for (int threshold = 0; threshold <= 63; threshold += 3) {
- // // for (int i = 0; i < 768; ++i) {
- // // if (_paletteBuffer[i] >= threshold) {
- // // _currentPalette[i] = (_currentPalette[i] < 3) ? 0 : _currentPalette[i] - 3;
- // // }
- // // }
- // // setPaletteRange(255, 255); // cseg209:0x06F0-0x06F4
- // // waitForTimer();
- // }
+ // Fade the subtitle, which remains below the 122 restored rows and uses
+ // palette color 255. cseg209:0x0669-0x0705
+ for (int threshold = 0; threshold <= 63; threshold += 3) {
+ for (int i = 765; i < 768; ++i) { // cseg209:0x066E-0x06E6
+ if (logoColor255[i - 765] >= threshold) {
+ _currentPalette[i] = (_currentPalette[i] < 3) ? 0 : _currentPalette[i] - 3;
+ }
+ }
+ setPaletteRange(255, 255); // cseg209:0x06F0-0x06F4
+ waitForTimer();
+ }
memcpy(_screenVGA, _screenTextLayer, 46080); // cseg209:0x0708-0x071A
_currentPalette[765] = 63; // cseg209:0x071F
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 738025a6b41..bffbb07c3fe 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -173,7 +173,7 @@ ResourceEntry *IgorEngine::findData(int id) {
* IGOR.TBL is produced externally using the same ids pointing to a given resource.
*/
uint8 *IgorEngine::loadData(int id, uint8 *dst, int *size) {
- debugC(9, kDebugResource, "loadData() id %d", id);
+ // debugC(9, kDebugResource, "loadData() id %d", id);
ResourceEntry *re = findData(id);
if (!dst) {
dst = (uint8 *)malloc(re->size);
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 90f69d8e08f..e40fa77b38e 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -48,7 +48,7 @@ void IgorEngine::playSound(int num, int type) {
Audio::Mixer::SoundType soundType;
Audio::SoundHandle *soundHandle = 0;
if (type == 1) {
- debugC(9, kDebugEngine, "playSound() %d -> sfx offset %d", num + 1, num);
+ // debugC(9, kDebugEngine, "playSound() %d -> sfx offset %d", num + 1, num);
if (_mixer->isSoundHandleActive(_sfxHandle)) {
return;
}
@@ -57,14 +57,11 @@ void IgorEngine::playSound(int num, int type) {
soundType = Audio::Mixer::kSFXSoundType;
soundHandle = &_sfxHandle;
} else if (type == 0 && (_game.flags & kFlagTalkie) != 0 && num != kNoSpeechSound) {
- debugC(9, kDebugEngine, "playSound() %d on speech handle", num);
+ // debugC(9, kDebugEngine, "playSound() %d on speech handle", num);
if (_mixer->isSoundHandleActive(_speechHandle)) {
debugC(9, kDebugEngine, "stopping previous handle");
_mixer->stopHandle(_speechHandle);
}
- if (_mixer->isSoundHandleActive(_sfxHandle)) {
- _mixer->stopHandle(_sfxHandle);
- }
num += 101;
assert(num >= 0 && num < _soundOffsetsCount);
soundOffset = _soundOffsets[num];
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index cbda2e3be3e..b22c75647df 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -46,28 +46,72 @@ void IgorEngine::buildWalkPath(int srcX, int srcY, int dstX, int dstY) {
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);
- // 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;
- // }
+ 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::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);
+}
+
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];
Commit: a8c4a7e2b2b4f7fe0df3ab2a7700cb7b8b19bf1b
https://github.com/scummvm/scummvm/commit/a8c4a7e2b2b4f7fe0df3ab2a7700cb7b8b19bf1b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:54+01:00
Commit Message:
IGOR: Fixes pickup animation when picking up hamburger
Changed paths:
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_10.cpp
engines/igor/part_11.cpp
engines/igor/part_5.cpp
engines/igor/part_6.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 0e1504fb056..35524ec6fb1 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -482,7 +482,7 @@ private:
void PART_07_EXIT_TO_OUTSIDE();
void PART_10();
void PART_10_EXEC_ACTION(int action);
- void PART_10_ACTION_104();
+ void PART_10_ACTION_104_pickHamburger();
void PART_10_ACTION_108();
void PART_11();
void PART_11_EXEC_ACTION(int action);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index c7e17c89f95..f041df4e76d 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -220,17 +220,16 @@ void IgorEngine::handleRoomInput() {
return;
}
+ // If current area results in zero just ignore click
if (_inputVars[kInputClick] && _gameState.igorMoving) {
_walkDataCurrentPosX = _walkData[_walkDataCurrentIndex - 1].x;
_walkDataCurrentPosY = _walkData[_walkDataCurrentIndex - 1].y;
if (_roomObjectAreasTable[_screenLayer2[_walkDataCurrentPosY * 320 + _walkDataCurrentPosX]].area == 0) {
- // cseg180:0x23B2-0x23F8 / cseg182:0x1A10-0x1A56
return;
}
_walkDataCurrentPosX = _walkData[_walkDataCurrentIndex + 1].x;
_walkDataCurrentPosY = _walkData[_walkDataCurrentIndex + 1].y;
if (_roomObjectAreasTable[_screenLayer2[_walkDataCurrentPosY * 320 + _walkDataCurrentPosX]].area == 0) {
- // cseg180:0x23FB-0x2441 / cseg182:0x1A59-0x1A9F
return;
}
}
diff --git a/engines/igor/part_10.cpp b/engines/igor/part_10.cpp
index 4d0d7b16f88..e507c416e01 100644
--- a/engines/igor/part_10.cpp
+++ b/engines/igor/part_10.cpp
@@ -14,70 +14,70 @@
namespace Igor {
+// Ground truth: code/175_2767.asm, cseg175:0002-3595, cseg177:0002 and cseg134:21AF.
namespace {
-const uint32 kPart10PanelLeft = 0x0000; // cseg175:2809-2818
-const uint32 kPart10Frm1 = 0xB400; // cseg177:0002
-const uint32 kPart10Frm2 = 0xBC0A; // cseg177:0002
-const uint32 kPart10Frm3 = 0xC5E2; // cseg177:0002
-const uint32 kPart10Frm4 = 0xC786; // cseg177:0002
-const uint32 kPart10Frm5 = 0xC8AE; // cseg177:0002
+const uint32 kPart10PanelLeft = 0x0000;
+const uint32 kPart10Frm1 = 0xB400;
+const uint32 kPart10Frm2 = 0xBC0A;
+const uint32 kPart10Frm3 = 0xC5E2;
+const uint32 kPart10Frm4 = 0xC786;
+const uint32 kPart10Frm5 = 0xC8AE;
} // End of anonymous namespace
void IgorEngine::PART_10_EXEC_ACTION(int action) {
- // The action-to-function table is constructed at cseg175:08B2-09EA;
- // its order differs from the disassembler's function listing order.
+ // The action table order differs from the function listing order.
switch (action) {
- case 101: // cseg175:08BC-08DA -> sub_175_00F2
+ case 101:
ADD_DIALOGUE_TEXT(201, 1, 626);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
case 102:
- _roomObjectAreasTable[7].deltaLum = 3; // cseg175:077A; s3:0xDC7E
+ _roomObjectAreasTable[7].deltaLum = 3;
for (int area = 11; area <= 12; ++area)
- _roomObjectAreasTable[area].area = 3; // cseg175:077F-07A1; s3:[area*5-9130]
- --_walkDataLastIndex; // cseg175:07CA
- buildWalkPath(170, 97, 100, 73); // cseg175:07CE-07D7
- _walkData[_walkDataLastIndex].frameNum = 0; // cseg175:07DC-07E7
- _walkDataCurrentIndex = 1; // cseg175:07E9
- _gameState.igorMoving = true; // cseg175:07EE
- waitForIgorMove(); // cseg175:07F3-0873
- _currentPart = 70; // cseg175:0875
+ _roomObjectAreasTable[area].area = 3;
+ --_walkDataLastIndex;
+ buildWalkPath(170, 97, 100, 73);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _currentPart = 70;
break;
- case 103: // cseg175:0900-091E -> sub_175_011F
+ case 103:
ADD_DIALOGUE_TEXT(202, 1, 627);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
case 104:
- PART_10_ACTION_104(); // cseg175:0922-0940 -> sub_175_014C
+ PART_10_ACTION_104_pickHamburger();
break;
- case 105: // cseg175:0944-0962 -> sub_175_026F
+ case 105:
ADD_DIALOGUE_TEXT(206, 1, 630);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 106: // cseg175:0966-0984 -> sub_175_02C9
+ case 106:
ADD_DIALOGUE_TEXT(208, 1, 632);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 107: // cseg175:0988-09A6 -> sub_175_029C
+ case 107:
ADD_DIALOGUE_TEXT(207, 1, 631);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 108: // cseg175:09AA-09C8 -> sub_175_02F6
+ case 108:
PART_10_ACTION_108();
break;
- case 109: // cseg175:09CC-09EA -> sub_175_055B
+ case 109:
_currentPart = 40;
break;
default:
@@ -86,115 +86,55 @@ void IgorEngine::PART_10_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_10_ACTION_104() {
- if (_objectsState[64] == 1) { // cseg175:015A; s3:0x862
- ADD_DIALOGUE_TEXT(205, 1, 629); // cseg175:0161-017D
+void IgorEngine::PART_10_ACTION_104_pickHamburger() {
+ if (_objectsState[64] == 1) {
+ ADD_DIALOGUE_TEXT(205, 1, 629);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
return;
}
- ADD_DIALOGUE_TEXT(203, 2, 628); // cseg175:0185-01A1
+ ADD_DIALOGUE_TEXT(203, 2, 628);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
- waitForEndOfIgorDialogue(); // cseg175:01A6
-
- static const uint8 frameSelectors[] = { 0, 1, 0, 2 }; // cseg175:01CE-01D8; s3:0x1D2-0x1D5
- for (int frame = 0; frame < 4; ++frame) { // cseg175:01AB-021B
- for (int y = 0; y < 49; ++y) { // cseg175:01BC-0208
- memcpy(_screenVGA + 0x595F + y * 320, // cseg175:01B7-01F7
- _animFramesBuffer + kPart10Frm1 + frameSelectors[frame] * 0x682 + y * 34, // cseg175:01C7-01E4
- 34); // cseg175:01FC-01FE
+ waitForEndOfIgorDialogue();
+
+ static const uint8 frameSelectors[] = { 0, 1, 0, 2 };
+ for (int frame = 0; frame < 4; ++frame) {
+ for (int y = 0; y < 49; ++y) {
+ memcpy(_screenVGA + 0x595F + y * 320,
+ _animFramesBuffer + kPart10Frm1 + frameSelectors[frame] * 0x682 + y * 34,
+ 34);
}
- waitForTimer(31); // cseg175:020A-0214
+ waitForTimer(31);
}
- // TODO: add inventory object 17 at slot s3:0x90E; the fork has no
- // inventory-state API (cseg175:021D-024E).
- playSound(51, 1); // cseg175:0253-0257
- _objectsState[64] = 1; // cseg175:0261; s3:0x862
+ addObjectToInventory(17, 52);
+ _objectsState[64] = 1;
}
-
-// Scroll to the LEFT: the left panel (PART10_bg) slides in from the left edge,
-// the active right panel (C1) exits right. Mirrors PART_06_ACTION_102
-// (part_6.cpp); the incoming strip is read straight from the stashed left panel
-// in the ANM buffer (row stride 320). layer1 is untouched by the pan, so it
-// still holds the outgoing right panel afterwards and can be kept for a later
-// scroll back.
-// void IgorEngine::PART_10_SCROLL_LEFT_ACTION() {
-// for (int i = 1; i < 29; ++i) {
-// 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 + ANM_PANEL_A + y * 320, i * 8);
-// }
-// memcpy(_screenVGA, _screenLayer2, 46080);
-// }
-// // PART_10_UPDATE_ROOM_BACKGROUND();
-// waitForTimer();
-// }
-// // Cut over: the left panel becomes the active room (sub_175_066B position).
-// PART_10_STASH_FAR_PANEL(); // keep the outgoing right panel for the way back
-// _currentPart = 101;
-// loadRoomData(PAL_OutsideAdministrationBuildingA, IMG_OutsideAdministrationBuildingA,
-// BOX_OutsideAdministrationBuildingA, MSK_OutsideAdministrationBuildingA, 0);
-// _walkDataCurrentIndex = 1;
-// _walkDataLastIndex = 1;
-// _walkData[1].setPos(136, 86, kFacingPositionRight, 0);
-// _walkData[1].setDefaultScale();
-// memcpy(_screenVGA, _screenLayer1, 46080);
-// PART_10_DRAW_IGOR();
-// }
-
-// // Scroll to the RIGHT (back to C1 / the arrival panel): the active left panel
-// // slides left while the right panel's strip enters from the right edge (mirrors
-// // PART_05_ACTION_102, part_5.cpp), sourced from the stashed far panel.
-// void IgorEngine::PART_10_SCROLL_RIGHT_ACTION() {
-// for (int i = 1; i < 29; ++i) {
-// 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, g_part10FarPanel + y * 320 + 320 - i * 8, i * 8);
-// }
-// memcpy(_screenVGA, _screenLayer2, 46080);
-// }
-// PART_10_UPDATE_ROOM_BACKGROUND();
-// waitForTimer();
-// }
-// // Cut over: back on the arrival panel (sub_175_056D position).
-// _currentPart = 100;
-// loadRoomData(PAL_OutsideAdministrationBuildingB, IMG_OutsideAdministrationBuildingB,
-// BOX_OutsideAdministrationBuildingB, MSK_OutsideAdministrationBuildingB, 0);
-// _walkDataCurrentIndex = 1;
-// _walkDataLastIndex = 1;
-// _walkData[1].setPos(319, 79, kFacingPositionLeft, 0);
-// _walkData[1].setDefaultScale();
-// memcpy(_screenVGA, _screenLayer1, 46080);
-// PART_10_DRAW_IGOR();
-// }
void IgorEngine::PART_10_ACTION_108() {
- uint8 *walkTable = loadData(WLK_DecanatoA); // cseg175:03E7-0409
- int xPos = 329; // cseg175:030D
+ uint8 *walkTable = loadData(WLK_DecanatoA);
+ int xPos = 329;
int yPos = 0;
- int i = 1; // cseg175:0312
+ int i = 1;
do {
- if (compareGameTick(1, 16)) { // cseg175:0316-032C
- for (int y = 0; y <= 143; ++y) { // cseg175:032F-03C4
+ 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 + kPart10PanelLeft + y * 320 + 320 - i * 8, i * 8);
}
- if (i < 9) { // cseg175:03C7-0421
+ if (i < 9) {
xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame];
assert(xPos >= 260);
yPos = walkTable[xPos - 260];
WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame);
} else {
- _walkCurrentFrame = 0; // cseg175:0427
+ _walkCurrentFrame = 0;
}
- int dstOffset = (yPos - 50) * 320 + xPos - 330 + i * 8; // cseg175:042C-0448
- for (int row = 0; row <= 49; ++row) { // cseg175:044B-04CB
+ int dstOffset = (yPos - 50) * 320 + xPos - 330 + i * 8;
+ for (int row = 0; row <= 49; ++row) {
dstOffset += 320;
for (int col = 0; col <= 29; ++col) {
const uint8 color = _facingIgorFrames[kFacingPositionLeft - 1][_walkCurrentFrame * 1500 + row * 30 + col];
@@ -202,22 +142,20 @@ void IgorEngine::PART_10_ACTION_108() {
_screenLayer2[dstOffset + col] = color;
}
}
- memcpy(_screenVGA, _screenLayer2, 46080); // cseg175:04CD-04E2
+ memcpy(_screenVGA, _screenLayer2, 46080);
++i;
}
- waitForTimer(); // cseg175:04E6-0505
- } while (i != 41); // cseg175:0507-050D
+ waitForTimer();
+ } while (i != 41);
free(walkTable);
- _walkData[0].setPos(xPos + 5, yPos, kFacingPositionLeft, 0); // cseg175:0510-053A
+ _walkData[0].setPos(xPos + 5, yPos, kFacingPositionLeft, 0);
_walkData[0].setDefaultScale();
- _currentPart = 110; // cseg175:0553
+ _currentPart = 110;
}
void IgorEngine::PART_10() {
_gameState.enableLight = 1;
- // cseg175:27C3-27D6 copies the 0x18C9-byte DAT; cseg175:27DB then
- // loads the left panel, and cseg175:27E0 loads all five frame blobs.
loadActionData(DAT_Decanato);
loadRoomData(PAL_DecanatoA, IMG_DecanatoA, BOX_DecanatoA, MSK_DecanatoA, TXT_DecanatoA);
static const int frames1[] = { FRM_Decanato1, 0 };
@@ -230,79 +168,80 @@ void IgorEngine::PART_10() {
loadAnimData(frames3, kPart10Frm3);
loadAnimData(frames4, kPart10Frm4);
loadAnimData(frames5, kPart10Frm5);
- if (_objectsState[67] == 1) { // cseg175:27E5-27EC; s3:0x865
+ if (_objectsState[67] == 1) {
for (int y = 0; y <= 7; ++y)
- memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart10Frm4 + y * 37, 37); // cseg175:0002-0051
+ memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart10Frm4 + y * 37, 37);
}
- if (_objectsState[68] == 1) { // cseg175:27F1-27F8; s3:0x866
+ if (_objectsState[68] == 1) {
for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart10Frm3 + y * 14, 14); // cseg175:0052-00A1
- } else if (_objectsState[68] == 2) { // cseg175:27FD-2804
+ memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart10Frm3 + y * 14, 14);
+ } else if (_objectsState[68] == 2) {
for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart10Frm3 + 210 + y * 14, 14); // cseg175:00A2-00F1
+ memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart10Frm3 + 210 + y * 14, 14);
}
// Preserve the complete left panel at ANM+0, then make the right panel
- // active. This load order is unconditional in cseg175:27DB-2845.
- memcpy(_animFramesBuffer + kPart10PanelLeft, _screenLayer1, 46080); // cseg175:2809-2818
+ // active. The original load order is unconditional.
+ memcpy(_animFramesBuffer + kPart10PanelLeft, _screenLayer1, 46080);
loadRoomData(PAL_DecanatoB, IMG_DecanatoB, BOX_DecanatoB, MSK_DecanatoB, TXT_DecanatoB);
+ static const int hamburgerAnimation[] = { ANM_DecanatoHamburger, 0 };
+ loadAnimData(hamburgerAnimation, kPart10Frm1);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_10_EXEC_ACTION);
_roomDataOffsets = PART_10_ROOM_DATA_OFFSETS;
- setRoomWalkBounds(0, 0, 319, 143); // cseg175 room mask is 320x144
+ setRoomWalkBounds(0, 0, 319, 143);
// A normal entry presents the freshly loaded right panel. On state 102
// handoff, the original jumps directly to the walk-index setup instead,
// preserving the completed pan (including Igor) already in screen VGA.
- // cseg175:285B-2869, cseg175:295F.
+
if (_currentPart != 102) {
- memcpy(_screenVGA, _screenLayer1, 46080); // cseg175:28EA-28F9
- _currentAction.verb = kVerbWalk; // cseg175:2944-2952
- fadeIn(768); // cseg175:2957-295A
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
}
- _walkDataLastIndex = 1; // cseg175:295F
- _walkDataCurrentIndex = 1; // cseg175:2964
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
if (_currentPart == 100) {
- // sub_175_056D: enter at (319,79), facing left, walk to (288,84).
- _walkData[0].setPos(319, 79, kFacingPositionLeft, 0); // cseg175:0580-05B2
+ // Enter at the right edge and walk left into the room.
+ _walkData[0].setPos(319, 79, kFacingPositionLeft, 0);
_walkData[0].setDefaultScale();
- _walkData[0].clipWidth = 15; // cseg175:058D-0598; clip the off-screen half at x=319
+ _walkData[0].clipWidth = 15;
_walkDataLastIndex = 0;
- buildWalkPath(319, 79, 288, 84); // cseg175:05C1-05CB
- _walkData[_walkDataLastIndex].frameNum = 0; // cseg175:05D0-05DB
+ buildWalkPath(319, 79, 288, 84);
+ _walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
- _gameState.igorMoving = true; // cseg175:05E2
+ _gameState.igorMoving = true;
waitForIgorMove();
} else if (_currentPart == 101) {
- // sub_175_066B: enter at (136,86), facing right, walk to (171,97).
- _walkData[0].setPos(136, 86, kFacingPositionRight, 0); // cseg175:0686-06B7
+ // Enter from the adjacent panel and walk right into the room.
+ _walkData[0].setPos(136, 86, kFacingPositionRight, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 0;
- buildWalkPath(136, 86, 171, 97); // cseg175:06C6-06D0
- _walkData[_walkDataLastIndex].frameNum = 0; // cseg175:06D5-06E0
+ buildWalkPath(136, 86, 171, 97);
+ _walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
- _gameState.igorMoving = true; // cseg175:06E7
+ _gameState.igorMoving = true;
waitForIgorMove();
}
// State 102 deliberately performs no entry redraw: the completed pan has
// already drawn Igor and stored his state in walk record 0.
- // cseg175:2969-2981; cseg176:06AD-06F0.
- _roomObjectAreasTable[7].deltaLum = 0; // cseg175:087D-0887; s3:0xDC7E
+ _roomObjectAreasTable[7].deltaLum = 0;
for (int area = 11; area <= 12; ++area)
- _roomObjectAreasTable[area].area = 0; // cseg175:088C-08AE; s3:[area*5-9130]
+ _roomObjectAreasTable[area].area = 0;
enterPartLoop();
- while (_currentPart >= 100 && _currentPart <= 102) { // cseg175:29AA-29B5
+ while (_currentPart >= 100 && _currentPart <= 102) {
runPartLoop();
}
leavePartLoop();
if (_currentPart != 110)
- fadeOut(624); // cseg175:356A-3595; PART_11 state 110 keeps the completed pan palette
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/part_11.cpp b/engines/igor/part_11.cpp
index 692910da978..4ed83ce5380 100644
--- a/engines/igor/part_11.cpp
+++ b/engines/igor/part_11.cpp
@@ -14,96 +14,95 @@
namespace Igor {
+// Ground truth: code/176_2813.asm, cseg176:00F2-29E6 and cseg177:0002.
namespace {
-const uint32 kPart11PanelRight = 0x0000; // cseg176:288C-289B
-const uint32 kPart11Frm1 = 0xB400; // cseg177:0002
-const uint32 kPart11Frm2 = 0xBC0A; // cseg177:0002
-const uint32 kPart11Frm3 = 0xC5E2; // cseg177:0002
-const uint32 kPart11Frm4 = 0xC786; // cseg177:0002
-const uint32 kPart11Frm5 = 0xC8AE; // cseg177:0002
+const uint32 kPart11PanelRight = 0x0000;
+const uint32 kPart11Frm1 = 0xB400;
+const uint32 kPart11Frm2 = 0xBC0A;
+const uint32 kPart11Frm3 = 0xC5E2;
+const uint32 kPart11Frm4 = 0xC786;
+const uint32 kPart11Frm5 = 0xC8AE;
} // End of anonymous namespace
void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
- if (num == 1 || num == 255) // cseg176:09B3-09BD
- _roomObjectAreasTable[13].object = _objectsState[66] == 0 ? 4 : 3; // cseg176:09BF-09D2; s3:0xDC98 = object field 13
+ if (num == 1 || num == 255)
+ _roomObjectAreasTable[13].object = _objectsState[66] == 0 ? 4 : 3;
- if (num == 2 || num == 255) { // cseg176:09D2-09DC
- if (_objectsState[67] == 1) { // cseg176:09DE-0A0E; s3:0x865
+ if (num == 2 || num == 255) {
+ if (_objectsState[67] == 1) {
for (int y = 0; y <= 7; ++y)
- memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart11Frm4 + y * 37, 37); // cseg176:0002-0051
+ memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart11Frm4 + y * 37, 37);
for (int area = 10; area <= 11; ++area)
- _roomObjectAreasTable[area].object = 7; // cseg176:09EA-0A0C; s3:[area*5-9129]
+ _roomObjectAreasTable[area].object = 7;
} else {
for (int area = 10; area <= 11; ++area)
- _roomObjectAreasTable[area].object = 0; // cseg176:0A10-0A32; s3:[area*5-9129]
+ _roomObjectAreasTable[area].object = 0;
}
}
- if (num == 3 || num == 255) { // cseg176:0A34-0A3E
- if (_objectsState[68] == 0) { // cseg176:0A40-0A6B; s3:0x866
+ if (num == 3 || num == 255) {
+ if (_objectsState[68] == 0) {
for (int area = 7; area <= 8; ++area)
- _roomObjectAreasTable[area].object = 0; // cseg176:0A47-0A69; s3:[area*5-9129]
- } else if (_objectsState[68] == 1) { // cseg176:0A6D-0A9A
+ _roomObjectAreasTable[area].object = 0;
+ } else if (_objectsState[68] == 1) {
for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart11Frm3 + y * 14, 14); // cseg176:0052-00A1
+ memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart11Frm3 + y * 14, 14);
for (int area = 7; area <= 8; ++area)
- _roomObjectAreasTable[area].object = 6; // cseg176:0A76-0A98; s3:[area*5-9129]
+ _roomObjectAreasTable[area].object = 6;
} else if (_objectsState[68] == 2) {
for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart11Frm3 + 210 + y * 14, 14); // cseg176:00A2-00F1
- _roomObjectAreasTable[7].object = 6; // cseg176:0AA5; s3:0xDC7A
- _roomObjectAreasTable[8].object = 8; // cseg176:0AAA; s3:0xDC7F
+ memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart11Frm3 + 210 + y * 14, 14);
+ _roomObjectAreasTable[7].object = 6;
+ _roomObjectAreasTable[8].object = 8;
}
}
}
void IgorEngine::PART_11_ACTION_105() {
- for (int frame = 0; frame <= 1; ++frame) { // cseg176:06F8-076D
+ for (int frame = 0; frame <= 1; ++frame) {
for (int y = 0; y <= 48; ++y)
memcpy(_screenVGA + 0x6167 + y * 320, _animFramesBuffer + kPart11Frm1 + frame * 0x405 + y * 21, 21);
- waitForTimer(127); // cseg176:075C-0766
+ waitForTimer(127);
}
- // TODO: add inventory object 18 at slot 0x90F; the fork has no inventory-state API (cseg176:076F-07A9).
- playSound(51, 1); // cseg176:07A5-07A9
- _objectsState[66] = 1; // cseg176:07B3; s3:0x864
- PART_11_APPLY_OBJECT_STATE(255); // cseg176:07B8-07BA
+ addObjectToInventory(18, 53);
+ _objectsState[66] = 1;
+ PART_11_APPLY_OBJECT_STATE(255);
}
void IgorEngine::PART_11_ACTION_107() {
- for (int frame = 0; frame <= 2; ++frame) { // cseg176:01C7-023C
+ for (int frame = 0; frame <= 2; ++frame) {
for (int y = 0; y <= 27; ++y)
memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart11Frm5 + frame * 0x348 + y * 30, 30);
- waitForTimer(61); // cseg176:022B-0235
+ waitForTimer(61);
}
- // TODO: remove the inventory object indexed by s3:0x904; the fork has no inventory-state API (cseg176:023E-0281).
- playSound(63, 1); // cseg176:027D-0281
- _objectsState[68] = 1; // cseg176:0286; s3:0x866
- PART_11_APPLY_OBJECT_STATE(255); // cseg176:0290-0292
+ removeObjectFromInventory(42);
+ _objectsState[68] = 1;
+ PART_11_APPLY_OBJECT_STATE(255);
}
void IgorEngine::PART_11_ACTION_108() {
- uint8 *walkTable = loadData(WLK_DecanatoB); // cseg176:0584-05A6
- int xPos = 310; // cseg176:04AE
+ uint8 *walkTable = loadData(WLK_DecanatoB);
+ int xPos = 310;
int yPos = 0;
- int i = 1; // cseg176:04B3
+ int i = 1;
do {
- if (compareGameTick(1, 16)) { // cseg176:04B7-04CD
- for (int y = 0; y <= 143; ++y) { // cseg176:04D0-0565
+ 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 + kPart11PanelRight + y * 320, i * 8);
}
- if (i < 9) { // cseg176:0568-05BE
+ if (i < 9) {
xPos += _walkScaleTable[0x8F9 + _walkCurrentFrame];
assert(xPos >= 260);
yPos = walkTable[xPos - 260];
WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame);
} else {
- _walkCurrentFrame = 0; // cseg176:05C4
+ _walkCurrentFrame = 0;
}
- int dstOffset = (yPos - 50) * 320 + xPos - 10 - i * 8; // cseg176:05C9-05E5
- for (int row = 0; row <= 49; ++row) { // cseg176:05E8-0668
+ int dstOffset = (yPos - 50) * 320 + xPos - 10 - i * 8;
+ for (int row = 0; row <= 49; ++row) {
dstOffset += 320;
for (int col = 0; col <= 29; ++col) {
const uint8 color = _facingIgorFrames[kFacingPositionRight - 1][_walkCurrentFrame * 1500 + row * 30 + col];
@@ -111,52 +110,52 @@ void IgorEngine::PART_11_ACTION_108() {
_screenLayer2[dstOffset + col] = color;
}
}
- memcpy(_screenVGA, _screenLayer2, 46080); // cseg176:066A-067F
+ memcpy(_screenVGA, _screenLayer2, 46080);
++i;
}
- waitForTimer(); // cseg176:0683-06A2
- } while (i != 41); // cseg176:06A4-06AA
+ waitForTimer();
+ } while (i != 41);
free(walkTable);
- _walkData[0].setPos(xPos - 315, yPos, kFacingPositionRight, 0); // cseg176:06AD-06EB
+ _walkData[0].setPos(xPos - 315, yPos, kFacingPositionRight, 0);
_walkData[0].setDefaultScale();
- _currentPart = 102; // cseg176:06F0
+ _currentPart = 102;
}
void IgorEngine::PART_11_ACTION_112() {
- for (int frame = 0; frame <= 2; ++frame) { // cseg176:00F2-0167
+ for (int frame = 0; frame <= 2; ++frame) {
for (int y = 0; y <= 27; ++y)
memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart11Frm2 + frame * 0x348 + y * 30, 30);
- waitForTimer(61); // cseg176:0156-0160
+ waitForTimer(61);
}
- // TODO: add inventory object 23 at slot 0x914; the fork has no inventory-state API (cseg176:0169-01A3).
- playSound(51, 1); // cseg176:019F-01A3
- _objectsState[68] = 1; // cseg176:01AD; s3:0x866
- _objectsState[26] = 1; // cseg176:01B9; s3:0x83C
- PART_11_APPLY_OBJECT_STATE(3); // cseg176:01B2-01B4
+ addObjectToInventory(23, 58);
+ _objectsState[68] = 1;
+ PART_11_APPLY_OBJECT_STATE(3);
+ _objectsState[26] = 1;
+ UPDATE_OBJECT_STATE(1);
}
void IgorEngine::PART_11_EXEC_ACTION(int action) {
- switch (action) { // cseg176:07C1-09A8
- case 101: // sub_176_0362
- ADD_DIALOGUE_TEXT(201, 2, 616); // cseg176:036C-0388
+ switch (action) {
+ case 101:
+ ADD_DIALOGUE_TEXT(201, 2, 616);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 102: // sub_176_038F
- ADD_DIALOGUE_TEXT(29, 1, 29); // cseg176:0399-03B5
+ case 102:
+ ADD_DIALOGUE_TEXT(29, 1, 29);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 103: // sub_176_03BC
- ADD_DIALOGUE_TEXT(_objectsState[66] == 0 ? 203 : 204, 1, _objectsState[66] == 0 ? 617 : 618); // cseg176:03C6-03F7
+ case 103:
+ ADD_DIALOGUE_TEXT(_objectsState[66] == 0 ? 203 : 204, 1, _objectsState[66] == 0 ? 617 : 618);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 104: // sub_176_03FE
- ADD_DIALOGUE_TEXT(205, 1, 619); // cseg176:0408-0436
+ case 104:
+ ADD_DIALOGUE_TEXT(205, 1, 619);
ADD_DIALOGUE_TEXT(206, 1, 620);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
@@ -165,8 +164,8 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
case 105:
PART_11_ACTION_105();
break;
- case 106: // sub_176_043D
- ADD_DIALOGUE_TEXT(73, 1, 50); // cseg176:0447-0463
+ case 106:
+ ADD_DIALOGUE_TEXT(73, 1, 50);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -177,20 +176,20 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
case 108:
PART_11_ACTION_108();
break;
- case 109: // sub_176_046A
- ADD_DIALOGUE_TEXT(207, 1, 621); // cseg176:0474-0490
+ case 109:
+ ADD_DIALOGUE_TEXT(207, 1, 621);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 110: // sub_176_0299
- ADD_DIALOGUE_TEXT(_objectsState[68] == 1 ? 208 : 209, 1, _objectsState[68] == 1 ? 622 : 623); // cseg176:02A3-02D4
+ case 110:
+ ADD_DIALOGUE_TEXT(_objectsState[68] == 1 ? 208 : 209, 1, _objectsState[68] == 1 ? 622 : 623);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 111: // sub_176_0308
- ADD_DIALOGUE_TEXT(210, 1, 624); // cseg176:0312-032E
+ case 111:
+ ADD_DIALOGUE_TEXT(210, 1, 624);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -198,14 +197,14 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
case 112:
PART_11_ACTION_112();
break;
- case 113: // sub_176_0335
- ADD_DIALOGUE_TEXT(211, 1, 625); // cseg176:033F-035B
+ case 113:
+ ADD_DIALOGUE_TEXT(211, 1, 625);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 114: // sub_176_02DB
- ADD_DIALOGUE_TEXT(29, 1, 29); // cseg176:02E5-0301
+ case 114:
+ ADD_DIALOGUE_TEXT(29, 1, 29);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -218,33 +217,33 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
void IgorEngine::PART_11() {
_gameState.enableLight = 1;
- loadActionData(DAT_DecanatoPart11); // cseg176:286F-2882
- loadRoomData(PAL_DecanatoB, IMG_DecanatoB, BOX_DecanatoB, MSK_DecanatoB, TXT_DecanatoB); // cseg176:2887
- memcpy(_animFramesBuffer + kPart11PanelRight, _screenLayer1, 46080); // cseg176:288C-289B
- loadRoomData(PAL_DecanatoA, IMG_DecanatoA, BOX_DecanatoA, MSK_DecanatoA, TXT_DecanatoA); // cseg176:28C8
+ loadActionData(DAT_DecanatoPart11);
+ loadRoomData(PAL_DecanatoB, IMG_DecanatoB, BOX_DecanatoB, MSK_DecanatoB, TXT_DecanatoB);
+ memcpy(_animFramesBuffer + kPart11PanelRight, _screenLayer1, 46080);
+ loadRoomData(PAL_DecanatoA, IMG_DecanatoA, BOX_DecanatoA, MSK_DecanatoA, TXT_DecanatoA);
static const int frames1[] = { FRM_Decanato1, 0 };
static const int frames2[] = { FRM_Decanato2, 0 };
static const int frames3[] = { FRM_Decanato3, 0 };
static const int frames4[] = { FRM_Decanato4, 0 };
static const int frames5[] = { FRM_Decanato5, 0 };
- loadAnimData(frames1, kPart11Frm1); // cseg176:28CD; cseg177:0002
+ loadAnimData(frames1, kPart11Frm1);
loadAnimData(frames2, kPart11Frm2);
loadAnimData(frames3, kPart11Frm3);
loadAnimData(frames4, kPart11Frm4);
loadAnimData(frames5, kPart11Frm5);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_11_EXEC_ACTION); // cseg176:28D2; sub_176_07C1
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_11_EXEC_ACTION);
_roomDataOffsets = PART_11_ROOM_DATA_OFFSETS;
- setRoomWalkBounds(0, 0, 319, 143); // cseg176 room mask is 320x144
- PART_11_APPLY_OBJECT_STATE(255); // cseg176:28D7-28D9; sub_176_09A9(-1)
+ setRoomWalkBounds(0, 0, 319, 143);
+ PART_11_APPLY_OBJECT_STATE(255);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
- _walkDataLastIndex = 1; // cseg176:29B6
- _walkDataCurrentIndex = 1; // cseg176:29BB
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
enterPartLoop();
- while (_currentPart == 110) { // cseg176:29DF-29E6
+ while (_currentPart == 110) {
runPartLoop();
}
leavePartLoop();
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 7097e225ef5..92793108004 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -27,7 +27,7 @@ namespace Igor {
switch (action) {
case 101: {
// Look at water
- ADD_DIALOGUE_TEXT(201, 2, 478); // cseg182:0552-055E (sub_182_0548)
+ ADD_DIALOGUE_TEXT(201, 2, 478);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -40,8 +40,8 @@ namespace Igor {
PART_05_ACTION_103_pickPaper();
break;
case 104:
- // Look at photographers
- ADD_DIALOGUE_TEXT(203, 2, 479); // cseg182:0575-058B (sub_182_0575)
+ // Look at photographer
+ ADD_DIALOGUE_TEXT(203, 2, 479);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -74,6 +74,7 @@ void IgorEngine::PART_05_HELPER_5(int frame) {
memcpy(_screenLayer1 + i * 320 + offset, src, 4);
}
}
+
void IgorEngine::PART_05() {
_gameState.enableLight = 1;
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
@@ -88,6 +89,7 @@ void IgorEngine::PART_05() {
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);
@@ -100,7 +102,6 @@ void IgorEngine::PART_05() {
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
-
enterPartLoop();
while (_currentPart >= 50 && _currentPart <= 52) {
runPartLoop();
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 4ee86e93aea..33005e4863e 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -96,7 +96,7 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
switch (action) {
case 101:
//Look at water
- ADD_DIALOGUE_TEXT(201, 2, 480); // cseg180:05B6-05CC (sub_180_05B6)
+ ADD_DIALOGUE_TEXT(201, 2, 480);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -107,7 +107,7 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
PART_06_ACTION_103();
break;
case 104:
- ADD_DIALOGUE_TEXT(203, 1, 481); // cseg180:05E3-05F9 (sub_180_05E3)
+ ADD_DIALOGUE_TEXT(203, 1, 481);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -115,7 +115,7 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
PART_06_ACTION_105();
break;
case 106:
- ADD_DIALOGUE_TEXT(204, 1, 482); // cseg180:0610-0626 (sub_180_0610)
+ ADD_DIALOGUE_TEXT(204, 1, 482);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -131,12 +131,12 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
}
}
void IgorEngine::PART_06_ACTION_103() {
- ADD_DIALOGUE_TEXT(215, 1, 489); // cseg180:0D10-0D26 (sub_180_0D10)
+ ADD_DIALOGUE_TEXT(215, 1, 489);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
PART_06_HELPER_8_animatePhotographer(0);
- ADD_DIALOGUE_TEXT(216, 1, 490); // cseg180:0D40-0D53 (sub_180_0D10)
+ ADD_DIALOGUE_TEXT(216, 1, 490);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(170, 69, 55, 37, 63);
waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63);
@@ -195,11 +195,11 @@ void IgorEngine::PART_06_ACTION_105() {
void IgorEngine::PART_06_ACTION_107() {
PART_06_HELPER_8_animatePhotographer(0);
- ADD_DIALOGUE_TEXT(205, 1, 483); // cseg180:0D90-0DAD (sub_180_0D90)
+ ADD_DIALOGUE_TEXT(205, 1, 483);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(206, 2, 484); // cseg180:0DC2-0DD3 (sub_180_0D90)
+ ADD_DIALOGUE_TEXT(206, 2, 484);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(170, 69, 55, 37, 63);
waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63);
@@ -207,12 +207,12 @@ void IgorEngine::PART_06_ACTION_107() {
void IgorEngine::PART_06_ACTION_108() {
PART_06_HELPER_8_animatePhotographer(0);
- ADD_DIALOGUE_TEXT(208, 2, 485); // cseg180:0E09-0E1C (sub_180_0DFF)
- ADD_DIALOGUE_TEXT(210, 2, 486); // cseg180:0E22-0E2E (sub_180_0DFF)
+ ADD_DIALOGUE_TEXT(208, 2, 485);
+ ADD_DIALOGUE_TEXT(210, 2, 486);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(212, 1, 487); // cseg180:0E43-0E54 (sub_180_0DFF)
+ ADD_DIALOGUE_TEXT(212, 1, 487);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(170, 69, 55, 37, 63);
waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63);
@@ -235,7 +235,7 @@ void IgorEngine::PART_06_ACTION_108() {
_objectsState[61] = 0;
PART_06_HELPER_6(255);
_gameState.unkF = false;
- ADD_DIALOGUE_TEXT(213, 2, 488); // cseg180:1240-1256 (sub_180_0DFF)
+ ADD_DIALOGUE_TEXT(213, 2, 488);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 2b642fc96d6..9ef354500f2 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -504,4 +504,7 @@
#define MSK_AdministrationCorridor 921 // cseg199:C300; IGOR.EXE:0x75B800, 0x954 bytes
#define BOX_AdministrationCorridor 922 // cseg199:CC54; IGOR.EXE:0x75C154, 0x500 bytes
+// Hamburger pickup animation loaded over ANM+0xB400 in PART_10.
+#define ANM_DecanatoHamburger 932 // cseg134:21AF-21ED; IGOR.EXE:0x4EFCEE, 0x1386 bytes
+
#endif // IGOR_RESOURCE_IDS
Commit: 6fd1a77e186cfe144bf451cd18d3d228d000e275
https://github.com/scummvm/scummvm/commit/6fd1a77e186cfe144bf451cd18d3d228d000e275
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:54+01:00
Commit Message:
IGOR: Part 12 from legacy fork
Changed paths:
A engines/igor/part_12.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource.cpp
engines/igor/static_walk.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 35524ec6fb1..534ee4bcdcc 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -374,6 +374,13 @@ private:
int _dialogueTextsCount;
int _dialogueDirtyRectY;
int _dialogueDirtyRectSize;
+ char _dialogueQuestions[MAX_DIALOGUE_QUESTIONS][2][41];
+ uint16 _dialogueQuestionSounds[MAX_DIALOGUE_QUESTIONS]; // cseg172:043B-0460
+ char _dialogueReplies[MAX_DIALOGUE_REPLIES][51];
+ uint16 _dialogueReplySounds[MAX_DIALOGUE_REPLIES]; // cseg172:0A59-0A82
+ bool _dialogueEnded;
+ int _dialogueChoiceSelected;
+ uint8 _dialogueInfo[6];
uint8 _objectsState[112];
bool _part07FirstVisitDone; // cseg197:0795-0845; original global s3:0xED2E
@@ -411,6 +418,8 @@ private:
void readTableFile();
void copyArea(uint8 *dst, int dstOffset, int dstPitch, const uint8 *src, int srcPitch, int w, int h, bool transparent = false);
+
+ void loadDialogueData(int dlg);
void loadMainTexts();
const char *getString(int id) const;
@@ -441,12 +450,12 @@ private:
void moveScreenUp(int offset);
void EXEC_MAIN_ACTION(int action);
+ // map
void PART_04_EXEC_ACTION(int action);
-
void PART_04_CLEAR_OBJECT_STATE_84(int num);
-
void PART_04();
+ // spring bridge
void PART_05_HELPER_4(int num);
void PART_05_HELPER_5(int frame);
void PART_05();
@@ -455,6 +464,7 @@ private:
void PART_05_ACTION_102_scrollRight();
void PART_05_UPDATE_ROOM_BACKGROUND();
+ // spring rock
void PART_06();
void PART_06_UPDATE_ROOM_BACKGROUND();
void PART_06_EXEC_ACTION(int action);
@@ -480,10 +490,14 @@ private:
void PART_07_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame, int dyPos);
void PART_07_ENTER_FROM_OUTSIDE();
void PART_07_EXIT_TO_OUTSIDE();
+
+ // Decanato right
void PART_10();
void PART_10_EXEC_ACTION(int action);
void PART_10_ACTION_104_pickHamburger();
void PART_10_ACTION_108();
+
+ // Decanato left
void PART_11();
void PART_11_EXEC_ACTION(int action);
void PART_11_ACTION_105();
@@ -492,6 +506,26 @@ private:
void PART_11_ACTION_112();
void PART_11_APPLY_OBJECT_STATE(int num);
+ // 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();
+
void PART_85();
void PART_85_HELPER_1_PLAY_ANIM(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
void PART_85_HELPER_2_SCROLL_RIGHT();
@@ -588,6 +622,12 @@ private:
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 buildWalkPath(int srcX, int srcY, int dstX, int dstY);
@@ -661,6 +701,7 @@ protected:
static const RoomDataOffsets PART_07_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_10_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_11_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_12_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
static const uint8 _inventoryOffsetTable[];
static const uint8 _inventoryActionsTable[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index bee7bc9b522..bbfb2ecfec3 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -21,6 +21,7 @@ MODULE_OBJS = \
part_7.o \
part_10.o \
part_11.o \
+ part_12.o \
text.o \
part_main.o \
sound.o
diff --git a/engines/igor/part_12.cpp b/engines/igor/part_12.cpp
new file mode 100644
index 00000000000..c9709c70489
--- /dev/null
+++ b/engines/igor/part_12.cpp
@@ -0,0 +1,563 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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, 789); // cseg171:003C-0058
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 103:
+ if (_objectsState[44] == 0) {
+ ADD_DIALOGUE_TEXT(203, 2, 790); // cseg171:0070-0082
+ } else {
+ ADD_DIALOGUE_TEXT(205, 1, 791); // cseg171:0084-00A0
+ }
+ 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, 793); // cseg171:00B1-00CD
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 107:
+ ADD_DIALOGUE_TEXT(206, 1, 792); // cseg171:00DE-00FA
+ 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(219, 1, 801); // cseg171:09A1-09C4
+ 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, 794); // cseg171:0AA0-0ABC
+ 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, 795); // cseg171:0EBF-0EDB
+ 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();
+ fadeIn(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, 796); // cseg171:120C-1218
+ ADD_DIALOGUE_TEXT(214, 1, 797); // cseg171:121E-122A
+ ADD_DIALOGUE_TEXT(215, 1, 798); // cseg171:1230-123C
+ 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);
+ fadeOut(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;
+ fadeIn(768);
+ if (_currentPart == 120) {
+ PART_12_HELPER_5();
+ }
+ if (_currentPart == 121) {
+ PART_12_HELPER_6();
+ if (_objectsState[106] == 1) {
+ ADD_DIALOGUE_TEXT(216, 2, 799); // cseg171:3766-3772
+ ADD_DIALOGUE_TEXT(218, 1, 800); // cseg171:3778-3784
+ 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();
+ fadeOut(624);
+}
+
+} // namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 965f8fe1be3..aa366873c76 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -155,7 +155,11 @@ void IgorEngine::PART_MAIN() {
case 110:
PART_11(); // OutsideAdministrationBuilding street, left panel
break;
-
+ case 120:
+ case 121:
+ case 122:
+ PART_12(); // outside church
+ break;
case 850: // Intro cutscene
// Clear the entire screen buffer before starting the intro cutscene
memset(_screenVGA, 0, 64000);
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index bffbb07c3fe..64e0f0307da 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -89,6 +89,87 @@ static void decodeMainString(const uint8 *src, char *dst) {
dst[sz] = '\0';
}
+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::loadDialogueData(int dlg) {
+ int dataSize;
+ uint8 *p = loadData(dlg, 0, &dataSize);
+ int dialogueDataSize = _roomDataOffsets.dlg.questionsOffset + 164 + 41;
+ assert(dialogueDataSize <= 500);
+ memcpy(_gameState.dialogueData, p, dialogueDataSize);
+ assert(_roomDataOffsets.dlg.questionsSize <= MAX_DIALOGUE_QUESTIONS);
+ // The original keeps both 1-based speech tables at the end of the DLG
+ // resource. Part 12 loads 0x14C2 bytes and indexes its question table at
+ // DLG+5230+question*2. See cseg172:0D41-0D54 and cseg172:043B-0452.
+ const int questionSoundsOffset = dataSize - (_roomDataOffsets.dlg.questionsSize + _roomDataOffsets.dlg.repliesSize + 2) * 2;
+ assert(questionSoundsOffset >= 0);
+ for (int i = 0; i < _roomDataOffsets.dlg.questionsSize; ++i) {
+ _dialogueQuestionSounds[i] = READ_LE_UINT16(p + questionSoundsOffset + (i + 1) * 2);
+ }
+ const int replySoundsOffset = questionSoundsOffset + (_roomDataOffsets.dlg.questionsSize + 1) * 2;
+ assert(_roomDataOffsets.dlg.repliesSize <= MAX_DIALOGUE_REPLIES);
+ for (int i = 0; i < _roomDataOffsets.dlg.repliesSize; ++i) {
+ _dialogueReplySounds[i] = READ_LE_UINT16(p + replySoundsOffset + (i + 1) * 2); // cseg172:0A59-0A82
+ }
+ 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';
+ }
+ }
+ }
+ 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);
+}
+
void IgorEngine::loadMainTexts() {
loadData(IMG_VerbsPanel, _verbsPanelBuffer);
debugC(9, kDebugResource, "loadMainTexts()");
@@ -260,4 +341,3 @@ void IgorEngine::decodeAnimFrame(const uint8 *src, uint8 *dst, bool preserveText
}
} // End of namespace Igor
-
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 0e3aef673e9..bedc3b85f70 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -231,4 +231,11 @@ const RoomDataOffsets IgorEngine::PART_11_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0 }
};
+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 }
+};
+
} // End of namespace Igor
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index a40a6ae1745..e62b81ebf53 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -22,9 +22,9 @@
namespace Igor {
-const uint8 IgorEngine::_talkDelays[] = { 0, 27, 22, 17, 12, 7, 0 };
+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::_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,
@@ -73,12 +73,11 @@ const uint8 IgorEngine::_inventoryActionsTable[] = {
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
-};
+ 0x00, 0x00, 0x00, 0x00};
-const uint8 IgorEngine::_dialogueColor[] = { 0x3F, 0x3F, 0x3F };
+const uint8 IgorEngine::_dialogueColor[] = {0x3F, 0x3F, 0x3F};
-const uint8 IgorEngine::_sentenceColorIndex[]= { 0xFD, 0xFB, 0xF1 };
+const uint8 IgorEngine::_sentenceColorIndex[] = {0xFD, 0xFB, 0xF1};
/**
* appends one DialogueText{num, count, sound} record into _dialogueTextsTable[] at index _dialogueTextsCount, then increments it.
@@ -110,7 +109,7 @@ void IgorEngine::SET_DIALOGUE_TEXT(int start, int count) {
* sets the positional state of the text to be displayed
*/
void IgorEngine::fixDialogueTextPosition(int num, int count, int *x, int *y) {
- int textLineWidth = 0;
+ int textLineWidth = 0;
for (int i = 0; i < count; ++i) {
int w = _font.getStringWidth(_globalDialogueTexts[num + i]);
if (w > textLineWidth) {
@@ -163,7 +162,8 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
for (int i = 0; i < dt->count; ++i) {
const char *textLine = _globalDialogueTexts[dt->num + i];
- int textLineWidth = _font.getStringWidth(textLine);;
+ int textLineWidth = _font.getStringWidth(textLine);
+ ;
int textX = talkX - textLineWidth / 2;
int textY = i * 10;
_font.drawString(_screenTextLayer, textLine, textX, textY, kTalkColor, kTalkShadowColor, kTalkShadowColor);
@@ -246,7 +246,8 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
if (_updateRoomBackground) {
(this->*_updateRoomBackground)();
}
- if (_inputVars[kInputEscape]) return;
+ if (_inputVars[kInputEscape])
+ return;
waitForTimer();
} while (_gameState.dialogueTextRunning);
}
@@ -359,7 +360,8 @@ void IgorEngine::waitForEndOfIgorDialogue() {
if (_updateRoomBackground) {
(this->*_updateRoomBackground)();
}
- if (_inputVars[kInputEscape]) return;
+ if (_inputVars[kInputEscape])
+ return;
waitForTimer();
} while (_gameState.dialogueTextRunning);
}
@@ -413,4 +415,185 @@ void IgorEngine::animateIgorTalking(int frame) {
}
}
+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];
+ snprintf(questionText, sizeof(questionText), "@%s %s", _dialogueQuestions[num][0], _dialogueQuestions[num][1]);
+ _font.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;
+ const int question = _gameState.dialogueData[offset + 3];
+ int num = question - 1;
+ const int sound = _dialogueQuestionSounds[question - 1]; // cseg172:043B-0460, 0B34-0B43
+ if (getPart() == 17) {
+ num = 5;
+ }
+ debugC(9, kDebugEngine, "dialogueAskQuestion() num %d offset %d", num, offset);
+ Common::strlcpy(_globalDialogueTexts[250], _dialogueQuestions[num][0], sizeof(_globalDialogueTexts[250]));
+ Common::strlcpy(_globalDialogueTexts[251], _dialogueQuestions[num][1], sizeof(_globalDialogueTexts[251]));
+ if (_globalDialogueTexts[251][0]) {
+ ADD_DIALOGUE_TEXT(250, 2, sound);
+ } else {
+ ADD_DIALOGUE_TEXT(250, 1, sound);
+ }
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+}
+
+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::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, _dialogueReplySounds[num]); // cseg172:0A59-0A82
+ for (int j = 0; j < len; ++j) {
+ Common::strlcpy(_globalDialogueTexts[dialogueIndex], _dialogueReplies[num + j], sizeof(_globalDialogueTexts[dialogueIndex]));
+ ++dialogueIndex;
+ }
+ offset += 2;
+ }
+ SET_DIALOGUE_TEXT(1, count);
+ startCutsceneDialogue(x, y, r, g, b);
+ waitForEndOfCutsceneDialogue(x, y, r, g, b);
+}
+
} // End of namespace Igor
Commit: ae1b522d9090cb1c4af0d0a248267d02596db659
https://github.com/scummvm/scummvm/commit/ae1b522d9090cb1c4af0d0a248267d02596db659
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:55+01:00
Commit Message:
IGOR: Import data offsets from previous implementations
Changed paths:
engines/igor/igor.h
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 534ee4bcdcc..bf1f6566ce2 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -702,6 +702,26 @@ protected:
static const RoomDataOffsets PART_10_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_11_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;
static const uint8 INVENTORY_IMG_INIT[];
static const uint8 _inventoryOffsetTable[];
static const uint8 _inventoryActionsTable[];
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index bedc3b85f70..8fccc7352dc 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -238,4 +238,144 @@ const RoomDataOffsets IgorEngine::PART_12_ROOM_DATA_OFFSETS = {
{ -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 }
+};
+
} // End of namespace Igor
Commit: f17670b302ef7f9a3939287297ce3f111c668349
https://github.com/scummvm/scummvm/commit/f17670b302ef7f9a3939287297ce3f111c668349
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:55+01:00
Commit Message:
IGOR: Adds part 17 from legacy code, new parts 34-35
Changed paths:
A engines/igor/part_17.cpp
A engines/igor/part_34.cpp
A engines/igor/part_35.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_4.cpp
engines/igor/part_5.cpp
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 277e2162c6d..516e8f19c5e 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -128,15 +128,16 @@ void IgorEngine::restart() {
_talkDelay = _talkSpeechCounter = _talkDelayCounter = 0;
memset(_dialogueTextsTable, 0, sizeof(_dialogueTextsTable));
+ _dialogueTextsBuildCount = 0;
_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(_dialogueQuestions, 0, sizeof(_dialogueQuestions));
+ memset(_dialogueReplies, 0, sizeof(_dialogueReplies));
+ _dialogueEnded = false;
+ _dialogueChoiceSelected = 0;
+ memset(_dialogueInfo, 0, sizeof(_dialogueInfo));
memset(_objectsState, 0, sizeof(_objectsState));
_part07FirstVisitDone = false; // cseg197:0795-0845; original global s3:0xED2E
@@ -159,7 +160,7 @@ void IgorEngine::restart() {
_scrollInventory = false;
_roomCursorOn = true;
_currentCursor = 0;
- // _dialogueCursorOn = true;
+ _dialogueCursorOn = true;
_updateDialogue = 0;
_updateRoomBackground = 0;
@@ -168,7 +169,7 @@ void IgorEngine::restart() {
_soundOffsetsCount = 0;
_soundOffsets = 0;
- // _demoActionsCounter = 0;
+ _demoActionsCounter = 0;
_gameTicks = 0;
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index bf1f6566ce2..ded02f15c5a 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -339,6 +339,7 @@ private:
DetectedGameVersion _game;
int _currentCursor;
bool _roomCursorOn;
+ bool _dialogueCursorOn;
char _globalDialogueTexts[300][MAX_DIALOGUE_TEXT_LENGTH];
uint8 _walkXScaleRoom[320];
@@ -370,6 +371,7 @@ private:
int _talkSpeechCounter;
int _talkDelayCounter;
DialogueText _dialogueTextsTable[MAX_DIALOGUE_TEXTS];
+ int _dialogueTextsBuildCount;
int _dialogueTextsStart;
int _dialogueTextsCount;
int _dialogueDirtyRectY;
@@ -400,7 +402,7 @@ private:
RoomDataOffsets _roomDataOffsets;
UpdateDialogueProc _updateDialogue;
UpdateRoomBackgroundProc _updateRoomBackground;
-
+ int _demoActionsCounter;
int _gameTicks;
int _resourceEntriesCount;
int _soundOffsetsCount;
@@ -430,7 +432,7 @@ private:
void stopSound();
void loadIgorFrames();
- void ADD_DIALOGUE_TEXT(int num, int count, int sound /*= kNoSpeechSound*/);
+ 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);
@@ -526,6 +528,39 @@ private:
void PART_12_HELPER_10(int frame);
void PART_12();
+ // 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();
+
+ // park
+ void PART_34();
+ void PART_34_EXEC_ACTION(int action);
+ void PART_34_ACTION_109_SCROLL_RIGHT();
+ void PART_34_APPLY_OBJECT_STATE(int num);
+ void PART_35();
+ void PART_35_EXEC_ACTION(int action);
+ void PART_35_ACTION_106_EXIT_TO_MAP();
+ void PART_35_ACTION_107_SCROLL_LEFT();
+ void PART_35_APPLY_OBJECT_STATE(int num);
+
void PART_85();
void PART_85_HELPER_1_PLAY_ANIM(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
void PART_85_HELPER_2_SCROLL_RIGHT();
@@ -720,6 +755,8 @@ protected:
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_34_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_35_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_36_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_37_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index bbfb2ecfec3..7387d43bcc6 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -22,6 +22,9 @@ MODULE_OBJS = \
part_10.o \
part_11.o \
part_12.o \
+ part_17.o \
+ part_34.o \
+ part_35.o \
text.o \
part_main.o \
sound.o
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
new file mode 100644
index 00000000000..73b9d848d34
--- /dev/null
+++ b/engines/igor/part_17.cpp
@@ -0,0 +1,513 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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, 648); // cseg141:09EC-09F8
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 103:
+ PART_17_ACTION_103();
+ break;
+ case 104:
+ ADD_DIALOGUE_TEXT(220, 3, 646); // cseg141:0A19-0A25
+ 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, 633); // cseg141:07FA-0800
+ } else if (_gameState.counter[4] == 2) {
+ ADD_DIALOGUE_TEXT(206, 2, 636); // cseg141:080D-0813
+ } else if (_gameState.counter[4] == 3) {
+ ADD_DIALOGUE_TEXT(210, 2, 638); // cseg141:0820-082C
+ }
+ 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, 634); // cseg141:085E-086A
+ ADD_DIALOGUE_TEXT(204, 2, 635); // cseg141:0870-087C
+ SET_DIALOGUE_TEXT(1, 2);
+ } else if (_gameState.counter[4] == 2) {
+ ADD_DIALOGUE_TEXT(208, 2, 637); // cseg141:088E-089A
+ SET_DIALOGUE_TEXT(1, 1);
+ } else if (_gameState.counter[4] == 3) {
+ ADD_DIALOGUE_TEXT(212, 2, 639); // cseg141:08AC-08B8
+ ADD_DIALOGUE_TEXT(214, 1, 640); // cseg141:08BE-08CA
+ 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);
+ const int randomDialogue = getRandomNumber(4); // cseg141:0910-0917
+ ADD_DIALOGUE_TEXT(215 + randomDialogue, 1, 641 + randomDialogue); // cseg141:091A-092C
+ 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, 645); // cseg141:09AC-09B8
+ 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, 649); // cseg141:0A51-0A5D
+ 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, 647); // cseg141:0B75-0B81
+ 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);
+ fadeIn(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) {
+ fadeIn(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;
+ }
+ fadeOut(624);
+}
+
+} // namespace Igor
diff --git a/engines/igor/part_34.cpp b/engines/igor/part_34.cpp
new file mode 100644
index 00000000000..f480c95a0b8
--- /dev/null
+++ b/engines/igor/part_34.cpp
@@ -0,0 +1,148 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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 3 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+void IgorEngine::PART_34_EXEC_ACTION(int action) {
+ debugC(9, kDebugGame, "PART_34_EXEC_ACTION %d", action);
+ switch (action) {
+ case 101:
+ ADD_DIALOGUE_TEXT(201, 2, 562); // cseg101:0AC4-0AEA
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 102:
+ ADD_DIALOGUE_TEXT(203, 2, 563); // cseg101:0AF1-0B17
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ _objectsState[88] = 1; // cseg101:0B1C
+ PART_34_APPLY_OBJECT_STATE(3);
+ break;
+ case 103:
+ // TODO: transcribe the inventory acquisition sequence from cseg101:018D-0284.
+ warning("PART_34_EXEC_ACTION action 103 unimplemented");
+ break;
+ case 104:
+ ADD_DIALOGUE_TEXT(205, 1, 564); // cseg101:0B2A-0B50
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 105:
+ // TODO: transcribe the park conversation from cseg101:0A9B-0AC3 and cseg094:2498-280D.
+ warning("PART_34_EXEC_ACTION action 105 unimplemented");
+ break;
+ case 106:
+ ADD_DIALOGUE_TEXT(206, 2, 565); // cseg101:0B57-0B7D
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 107:
+ ADD_DIALOGUE_TEXT(208, 2, 566); // cseg101:0B84-0BAA
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 108:
+ // TODO: transcribe the multi-actor park sequence from cseg101:04B7-0A9A.
+ warning("PART_34_EXEC_ACTION action 108 unimplemented");
+ break;
+ case 109:
+ PART_34_ACTION_109_SCROLL_RIGHT();
+ break;
+ default:
+ warning("PART_34_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::PART_34_ACTION_109_SCROLL_RIGHT() {
+ int xPos = 240; // cseg101:0BC8
+ const int yPos = 124; // cseg101:0C9B
+ int step = 1; // cseg101:0BCD
+ _gameTicks = 8; // original counter 15 normalized to 8-tick engine units; cseg101:0BD1-0BE7
+ do {
+ if (compareGameTick(1, 16)) { // cseg101:0BD6-0BE7
+ for (int y = 0; y <= 143; ++y) { // cseg101:0BEA-0C7F
+ memcpy(_screenLayer2 + y * 320,
+ _screenLayer1 + y * 320 + step * 8, 320 - step * 8);
+ memcpy(_screenLayer2 + y * 320 + 320 - step * 8,
+ _animFramesBuffer + y * 160, step * 8); // cseg101:0C36-0C74
+ }
+ if (step < 15) { // cseg101:0C82-0CB2
+ xPos += _walkScaleTable[0x8F9 + _walkCurrentFrame]; // s3:4637; cseg101:0C88-0C98
+ WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame);
+ } else {
+ _walkCurrentFrame = 0;
+ }
+ int dstOffset = (yPos - 50) * 320 + xPos - 15 - step * 8; // cseg101:0CB9-0CD5
+ for (int row = 0; row <= 49; ++row) { // cseg101:0CD8-0D58
+ dstOffset += 320;
+ for (int col = 0; col <= 29; ++col) {
+ const uint8 color = _facingIgorFrames[kFacingPositionRight - 1]
+ [_walkCurrentFrame * 1500 + row * 30 + col];
+ if (color != 0) {
+ _screenLayer2[dstOffset + col] = color;
+ }
+ }
+ }
+ memcpy(_screenVGA, _screenLayer2, 46080); // cseg101:0D5A-0D6F
+ ++step;
+ }
+ waitForTimer(); // cseg101:0D73-0D90
+ } while (step != 21); // cseg101:0D94-0D9A
+
+ _walkData[0].setPos(xPos - 160, yPos, kFacingPositionRight, 0); // cseg101:0D9D-0DB1
+ _walkData[0].setDefaultScale(); // cseg101:0DB6-0DDB
+ _currentPart = 351; // cseg101:0DE0
+}
+
+void IgorEngine::PART_34_APPLY_OBJECT_STATE(int num) {
+ if (num == 1 || num == 255) {
+ if (!(_objectsState[86] == 0 && _objectsState[79] == 1)) {
+ _roomObjectAreasTable[2].area = 0; // cseg101:0F3C-0F80; table byte at s3:DC70
+ } else {
+ // TODO: draw the state-dependent frame from FRM_Park1; cseg101:0F4A-0F79.
+ }
+ }
+ if (num == 3 || num == 255) {
+ _roomObjectAreasTable[1].area = (_objectsState[88] == 0) ? 2 : 3; // cseg101:0F85-0FA4
+ }
+}
+
+void IgorEngine::PART_34() {
+ _gameState.enableLight = 1; // cseg101:1FC0
+ loadActionData(DAT_ParkLeft); // cseg101:1FD6-1FF9; resource 101
+ loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight,
+ TXT_ParkRight); // right panel snapshot source; cseg101:1FFE; cseg104:0002-0D20
+ for (int y = 0; y <= 143; ++y) {
+ memcpy(_animFramesBuffer + y * 160, _screenLayer1 + y * 320 + 160, 160); // cseg101:2003-2040
+ }
+ loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // active left panel; cseg101:2045-206A; cseg106:0002-06A1
+ static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
+ loadAnimData(frames, 0x5A00); // cseg105:0002-00D8
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_34_EXEC_ACTION);
+ _roomDataOffsets = PART_34_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143); // cseg101:1F85-2E97; full park viewport
+ PART_34_APPLY_OBJECT_STATE(255);
+
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ enterPartLoop();
+ while (_currentPart == 340) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (_currentPart == kInvalidPart) {
+ fadeOut(768); // cseg101:2E7F-2E91
+ }
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_35.cpp b/engines/igor/part_35.cpp
new file mode 100644
index 00000000000..ef501637fce
--- /dev/null
+++ b/engines/igor/part_35.cpp
@@ -0,0 +1,172 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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 3 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+void IgorEngine::PART_35_EXEC_ACTION(int action) {
+ debugC(9, kDebugGame, "PART_35_EXEC_ACTION %d", action);
+ switch (action) {
+ case 101:
+ ADD_DIALOGUE_TEXT(201, 2, 611); // cseg100:0042-0068
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ _objectsState[88] = 1; // cseg100:006D
+ PART_35_APPLY_OBJECT_STATE(3);
+ break;
+ case 102:
+ // TODO: transcribe the inventory acquisition sequence from cseg100:0102-01F9.
+ warning("PART_35_EXEC_ACTION action 102 unimplemented");
+ break;
+ case 103:
+ ADD_DIALOGUE_TEXT(203, 1, 612); // cseg100:007B-00A1
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 104:
+ ADD_DIALOGUE_TEXT(204, 1, 613); // cseg100:00A8-00CE
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 105:
+ ADD_DIALOGUE_TEXT(205, 1, 614); // cseg100:00D5-00FB
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 106:
+ PART_35_ACTION_106_EXIT_TO_MAP();
+ break;
+ case 107:
+ PART_35_ACTION_107_SCROLL_LEFT();
+ break;
+ default:
+ warning("PART_35_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::PART_35_ACTION_107_SCROLL_LEFT() {
+ int xPos = 183; // cseg100:0211
+ const int yPos = 124; // cseg100:02E8
+ int step = 1; // cseg100:0216
+ _gameTicks = 8; // original counter 15 normalized to 8-tick engine units; cseg100:021A-0230
+ do {
+ if (compareGameTick(1, 16)) { // cseg100:021F-0230
+ for (int y = 0; y <= 143; ++y) { // cseg100:0233-02C8
+ memcpy(_screenLayer2 + y * 320 + step * 8,
+ _screenLayer1 + y * 320, 320 - step * 8);
+ memcpy(_screenLayer2 + y * 320,
+ _animFramesBuffer + y * 160 + 160 - step * 8, step * 8);
+ }
+ if (step < 5) { // cseg100:02CB-02FF
+ xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame]; // s3:4637; cseg100:02D1-02E5
+ WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame);
+ } else {
+ _walkCurrentFrame = 0;
+ }
+ int dstOffset = (yPos - 50) * 320 + xPos - 175 + step * 8; // cseg100:0306-0322
+ for (int row = 0; row <= 49; ++row) { // cseg100:0325-03A5
+ dstOffset += 320;
+ for (int col = 0; col <= 29; ++col) {
+ const uint8 color = _facingIgorFrames[kFacingPositionLeft - 1]
+ [_walkCurrentFrame * 1500 + row * 30 + col];
+ if (color != 0) {
+ _screenLayer2[dstOffset + col] = color;
+ }
+ }
+ }
+ memcpy(_screenVGA, _screenLayer2, 46080); // cseg100:03A7-03BD
+ ++step;
+ }
+ waitForTimer(); // cseg100:03C0-03DD
+ } while (step != 21); // cseg100:03E1-03E7
+
+ _walkData[0].setPos(xPos, yPos, kFacingPositionLeft, 0); // cseg100:03EA-03FB
+ _walkData[0].setDefaultScale(); // cseg100:0400-0425
+ _currentPart = 340; // cseg100:042A
+}
+
+void IgorEngine::PART_35_ACTION_106_EXIT_TO_MAP() {
+ --_walkDataLastIndex; // cseg100:0432
+ const uint8 area = _screenLayer2[10879]; // (319, 33); cseg100:0440-0455
+ _roomObjectAreasTable[area].area = 1;
+ buildWalkPath(242, 111, 319, 33); // cseg100:045A-0464
+ _roomObjectAreasTable[area].area = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove(); // cseg100:0469-0473
+ _currentPart = 40; // cseg100:0478
+}
+
+void IgorEngine::PART_35_APPLY_OBJECT_STATE(int num) {
+ if (num == 3 || num == 255) {
+ _roomObjectAreasTable[4].area = (_objectsState[88] == 0) ? 1 : 2; // cseg100:0634-0653; s3:DC7A
+ }
+}
+
+void IgorEngine::PART_35() {
+ _gameState.enableLight = 1; // cseg100:167F
+ loadActionData(DAT_ParkRight); // cseg100:1690-16B3; resource 100
+ loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // left panel; cseg106:0002-06A1
+ static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
+ loadAnimData(frames, 0x5A00); // cseg105:0002-00D8
+ for (int y = 0; y <= 143; ++y) {
+ memcpy(_animFramesBuffer + y * 160, _screenLayer1 + y * 320, 160); // cseg100:16D5-170F
+ }
+ loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight,
+ TXT_ParkRight); // active right panel; cseg100:1714-1739; cseg104:0002-0D20
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_35_EXEC_ACTION);
+ _roomDataOffsets = PART_35_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 281, 143); // cseg100:0657-06C1; rightmost walkable column is 281
+ PART_35_APPLY_OBJECT_STATE(255);
+
+ if (_currentPart != 351) {
+ memcpy(_screenVGA, _screenLayer1, 46080); // cseg100:175A-176C
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768); // cseg100:183C-1848
+ }
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+
+ if (_currentPart == 350) {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(319, 33, kFacingPositionFront, 1); // cseg100:048A-049B
+ wd->clipSkipX = 1; // cseg100:04A0
+ wd->clipWidth = 10; // cseg100:04A5
+ wd->scaleWidth = 34; // cseg100:04AB
+ wd->xPosChanged = 1; // cseg100:04B1
+ wd->dxPos = 0; // cseg100:04B6-04B8
+ wd->yPosChanged = 1; // cseg100:04BB
+ wd->dyPos = 0; // cseg100:04C0-04C2
+ wd->scaleHeight = 34; // cseg100:04C5
+ _walkDataLastIndex = 0;
+ const uint8 area = _screenLayer2[10879]; // (319, 33); cseg100:04CF-04E4
+ _roomObjectAreasTable[area].area = 1;
+ buildWalkPath(319, 33, 242, 111); // cseg100:04E9-04F3
+ _roomObjectAreasTable[area].area = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove(); // cseg100:0512-0529
+ }
+
+ enterPartLoop();
+ while (_currentPart == 350 || _currentPart == 351) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (_currentPart == kInvalidPart) {
+ fadeOut(768); // cseg100:2491-24A3
+ } else if (_currentPart != 340) {
+ fadeOut(624); // cseg100:24AA-24D6
+ }
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_4.cpp b/engines/igor/part_4.cpp
index 2e5ac79c003..4d9363155d6 100644
--- a/engines/igor/part_4.cpp
+++ b/engines/igor/part_4.cpp
@@ -25,20 +25,21 @@ namespace Igor {
void IgorEngine::PART_04_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_04_EXEC_ACTION %d", action);
switch (action) {
- case 101:
+ case 101: // church
_currentPart = 120;
break;
- case 102:
+ case 102: // students room
_currentPart = 0;
break;
- case 103:
+ case 103: // park
_currentPart = 350;
break;
- case 104:
+ case 104: // decanato
_currentPart = 100;
break;
case 105:
if (_objectsState[111] == 0) {
+ // college entrance
_currentPart = 170;
} else {
_currentPart = 770;
@@ -56,6 +57,9 @@ void IgorEngine::PART_04_CLEAR_OBJECT_STATE_84(int num) {
_objectsState[84] = 0;
}
+/**
+ * MAP
+ * */
void IgorEngine::PART_04() {
if (_objectsState[106] == 1) {
_currentPart = 730;
@@ -75,6 +79,7 @@ void IgorEngine::PART_04() {
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_04_EXEC_ACTION);
PART_04_CLEAR_OBJECT_STATE_84(255);
memcpy(_screenVGA, _screenLayer1, 46080);
+
fadeIn(768);
_currentAction.verb = kVerbWalk;
if (_gameState.musicNum != 2) {
@@ -89,17 +94,17 @@ void IgorEngine::PART_04() {
enterPartLoop();
while (_currentPart == 40) {
handleRoomInput();
- // if (compareGameTick(19, 32)) {
- // handleRoomDialogue();
- // }
- // if (compareGameTick(4, 8)) {
- // handleRoomInventoryScroll();
- // }
+ if (compareGameTick(19, 32)) {
+ handleRoomDialogue();
+ }
+ if (compareGameTick(4, 8)) {
+ handleRoomInventoryScroll();
+ }
scrollPalette(200, 207);
setPaletteRange(200, 207);
- // if (compareGameTick(1)) {
- // handleRoomLight();
- // }
+ if (compareGameTick(1)) {
+ handleRoomLight();
+ }
scrollPalette(184, 199);
setPaletteRange(184, 199);
waitForTimer();
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 92793108004..51858450f4a 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -136,9 +136,9 @@ void IgorEngine::PART_05_ACTION_103_pickPaper() {
} while (i != 3);
addObjectToInventory(21, 56);
_objectsState[60] = 1;
- // if (_game.version == kIdEngDemo110) {
- // ++_demoActionsCounter;
- // }
+ if (_game.version == kIdEngDemo110) {
+ ++_demoActionsCounter;
+ }
PART_05_HELPER_4(255);
}
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index aa366873c76..e501dd81001 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -160,6 +160,17 @@ void IgorEngine::PART_MAIN() {
case 122:
PART_12(); // outside church
break;
+ case 170:
+ case 171:
+ PART_17();
+ break;
+ case 340:
+ PART_34(); // Park, left panel; cseg101:1F85
+ break;
+ case 350:
+ case 351:
+ PART_35(); // Park, right panel; cseg100:1644
+ break;
case 850: // Intro cutscene
// Clear the entire screen buffer before starting the intro cutscene
memset(_screenVGA, 0, 64000);
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 9ef354500f2..02910f151a0 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -507,4 +507,12 @@
// Hamburger pickup animation loaded over ANM+0xB400 in PART_10.
#define ANM_DecanatoHamburger 932 // cseg134:21AF-21ED; IGOR.EXE:0x4EFCEE, 0x1386 bytes
+// Right park panel. The historical catalog only exposed cseg106's left panel;
+// these resources are cseg104's independently loaded room data.
+#define TXT_ParkRight 933 // cseg104:01AB-0244; IGOR.EXE:0x3DFFA2, 0x488 bytes
+#define IMG_ParkRight 934 // cseg104:006B-0095; IGOR.EXE:0x3E042A, 0xB400 bytes
+#define PAL_ParkRight 935 // cseg104:0010-0039; IGOR.EXE:0x3EB82A, 0x270 bytes
+#define MSK_ParkRight 936 // cseg104:00D7-01A8; IGOR.EXE:0x3EBA9A, 0xF84 bytes
+#define BOX_ParkRight 937 // cseg104:009A-00C3; IGOR.EXE:0x3ECA1E, 0x500 bytes
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 8fccc7352dc..6a2c71be3a9 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -364,6 +364,20 @@ const RoomDataOffsets IgorEngine::PART_33_ROOM_DATA_OFFSETS = {
{ -46, 9, 1533, 19, 60 }
};
+const RoomDataOffsets IgorEngine::PART_34_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 }, // cseg101:1765-1775 calls the direct room walk builder cseg101:1006
+ { 4, 15 }, // cseg101:1645-168B (walk points); cseg101:17DE-17F6 (facing)
+ { 19, 211, 3087, 103, 179, 80 }, // cseg101:142D,14CB,1572,1486,14AF
+ { 0, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_35_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 }, // cseg100:0E23-0E33 calls the direct room walk builder cseg100:06C4
+ { 5, 18 }, // cseg100:0D03-0D49 (walk points); cseg100:0E9C-0EB4 (facing)
+ { 23, 233, 3179, 127, 203, 82 }, // cseg100:0AEB,0B89,0C30,0B44,0B6D
+ { 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_36_ROOM_DATA_OFFSETS = {
{ 45, 3, 6, 2 },
{ 77, 90 },
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index e62b81ebf53..7d240301dd8 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -80,7 +80,7 @@ const uint8 IgorEngine::_dialogueColor[] = {0x3F, 0x3F, 0x3F};
const uint8 IgorEngine::_sentenceColorIndex[] = {0xFD, 0xFB, 0xF1};
/**
- * appends one DialogueText{num, count, sound} record into _dialogueTextsTable[] at index _dialogueTextsCount, then increments it.
+ * appends one DialogueText{num, count, sound} record to the batch being built.
* MAX_DIALOGUE_TEXTS = 6
* Game accumulates texts in _dialogeTextsTable, then displays them during dialogues.
*
@@ -88,12 +88,12 @@ const uint8 IgorEngine::_sentenceColorIndex[] = {0xFD, 0xFB, 0xF1};
* can have multiple lines.
*/
void IgorEngine::ADD_DIALOGUE_TEXT(int num, int count, int sound) {
- assert(_dialogueTextsCount < MAX_DIALOGUE_TEXTS);
- DialogueText *dt = &_dialogueTextsTable[_dialogueTextsCount];
+ assert(_dialogueTextsBuildCount < MAX_DIALOGUE_TEXTS);
+ DialogueText *dt = &_dialogueTextsTable[_dialogueTextsBuildCount];
dt->num = num;
dt->count = count;
dt->sound = sound;
- ++_dialogueTextsCount;
+ ++_dialogueTextsBuildCount;
}
/**
@@ -101,6 +101,9 @@ void IgorEngine::ADD_DIALOGUE_TEXT(int num, int count, int sound) {
* start page of dialogues, count of dialogue screens
*/
void IgorEngine::SET_DIALOGUE_TEXT(int start, int count) {
+ // The original writes each new batch directly from slot 0 before setting the
+ // independent playback range at 0x31D4/0x31D5. See cseg209:0x0EE0-0x0F09.
+ _dialogueTextsBuildCount = 0;
_dialogueTextsStart = start - 1;
_dialogueTextsCount = count;
}
Commit: 3ad35a491c5849043aac32513824bc67814bcd03
https://github.com/scummvm/scummvm/commit/3ad35a491c5849043aac32513824bc67814bcd03
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:55+01:00
Commit Message:
IGOR: Fix palette rotation
Changed paths:
engines/igor/igor.h
engines/igor/palette.cpp
engines/igor/part_4.cpp
engines/igor/part_5.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index ded02f15c5a..b286781dcc2 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -458,8 +458,12 @@ private:
void PART_04();
// spring bridge
- void PART_05_HELPER_4(int num);
- void PART_05_HELPER_5(int frame);
+ void PART_05_HELPER_4_drawPaperOrNot(int num);
+ void PART_05_HELPER_5_drawPaper(int frame);
+ void PART_05_HELPER_3_drawCamera(int frame);
+ void PART_05_HELPER_6();
+ void PART_05_HELPER_1_drawPhotographer();
+ void PART_05_HELPER_2_drawTripod();
void PART_05();
void PART_05_EXEC_ACTION(int action);
void PART_05_ACTION_103_pickPaper();
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index 255550f84f7..22594988f56 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -35,9 +35,11 @@ void IgorEngine::setupDefaultPalette() {
void IgorEngine::scrollPalette(int startColor, int 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);
+ // Rotate toward higher indices: save the last color, shift the range right,
+ // and wrap the saved color to the start. cseg182:0016-00A1
+ memcpy(c, &_currentPalette[endColor * 3], 3);
+ memmove(&_currentPalette[(startColor + 1) * 3], &_currentPalette[startColor * 3], (endColor - startColor) * 3);
+ memcpy(&_currentPalette[startColor * 3], c, 3);
}
void IgorEngine::setPaletteRange(int startColor, int endColor) {
diff --git a/engines/igor/part_4.cpp b/engines/igor/part_4.cpp
index 4d9363155d6..4551ff4925b 100644
--- a/engines/igor/part_4.cpp
+++ b/engines/igor/part_4.cpp
@@ -46,6 +46,7 @@ void IgorEngine::PART_04_EXEC_ACTION(int action) {
}
break;
case 106:
+ // SpringBridge
_currentPart = 50;
break;
default:
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 51858450f4a..3fd5b64af0c 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -55,19 +55,23 @@ namespace Igor {
}
}
-void IgorEngine::PART_05_HELPER_4(int num) {
+void IgorEngine::PART_05_HELPER_4_drawPaperOrNot(int num) {
+
if (_objectsState[60] == 0) {
- PART_05_HELPER_5(0);
+ // paper not taken, paint "frame 0"
+ PART_05_HELPER_5_drawPaper(0);
return;
}
- PART_05_HELPER_5(1);
+ // paper taken, paint "frame 1"
+ PART_05_HELPER_5_drawPaper(1);
+ // disable object
_roomObjectAreasTable[24].object = 0;
for (int i = 27; i <= 29; ++i) {
_roomObjectAreasTable[i].object = 0;
}
}
-void IgorEngine::PART_05_HELPER_5(int frame) {
+void IgorEngine::PART_05_HELPER_5_drawPaper(int frame) {
const int offset = 41926;
for (int i = 0; i <= 2; ++i) {
const uint8 *src = _animFramesBuffer + 0x7E00 + frame * 12 + i * 4;
@@ -75,6 +79,43 @@ void IgorEngine::PART_05_HELPER_5(int frame) {
}
}
+void IgorEngine::PART_05_HELPER_1_drawPhotographer() {
+ 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_drawTripod() {
+ 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_drawCamera(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_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);
@@ -86,6 +127,17 @@ void IgorEngine::PART_05() {
static const int anm4[] = {FRM_SpringRock5, FRM_SpringRock6, 0};
loadAnimData(anm4, 0xA763);
+ // Draws photographer and objects before copying the screenLayer
+ if (_objectsState[61] != 0) {
+ PART_05_HELPER_1_drawPhotographer();
+ }
+ if (_objectsState[63] != 0) {
+ PART_05_HELPER_2_drawTripod();
+ }
+ if (_objectsState[62] != 0) {
+ PART_05_HELPER_3_drawCamera(0);
+ }
+
for (int i = 0; i <= 143; ++i) {
memcpy(_animFramesBuffer + i * 224, _screenLayer1 + i * 320 + 96, 224);
}
@@ -95,18 +147,24 @@ void IgorEngine::PART_05() {
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);
+ PART_05_HELPER_4_drawPaperOrNot(255);
loadActionData(DAT_SpringRock);
_roomDataOffsets = PART_05_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
+ if (_currentPart == 50) {
+ debug("Entering PART_05_HELPER_6");
+ PART_05_HELPER_6();
+ }
+
enterPartLoop();
while (_currentPart >= 50 && _currentPart <= 52) {
runPartLoop();
}
leavePartLoop();
+ stopSound();
if (_currentPart == 255) {
fadeOut(768);
} else if (_currentPart != 60) {
@@ -118,8 +176,6 @@ void IgorEngine::PART_05() {
}
}
-
-
void IgorEngine::PART_05_ACTION_103_pickPaper() {
int i = 0;
do {
@@ -139,7 +195,7 @@ void IgorEngine::PART_05_ACTION_103_pickPaper() {
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
- PART_05_HELPER_4(255);
+ PART_05_HELPER_4_drawPaperOrNot(255);
}
void IgorEngine::PART_05_ACTION_102_scrollRight() {
@@ -192,7 +248,6 @@ void IgorEngine::PART_05_ACTION_102_scrollRight() {
_currentPart = 60;
}
-
void IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND() {
if (compareGameTick(61)) {
scrollPalette(160, 167);
Commit: 51e43233f7380581f3eab84732776adcc15204ec
https://github.com/scummvm/scummvm/commit/51e43233f7380581f3eab84732776adcc15204ec
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:56+01:00
Commit Message:
IGOR: Dialogue with photographer in part 6
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/part_10.cpp
engines/igor/part_11.cpp
engines/igor/part_5.cpp
engines/igor/part_6.cpp
engines/igor/part_main.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 516e8f19c5e..3f4264d30bc 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -60,8 +60,11 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.flags = kFlagTalkie;
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- _currentPart = 850;
- // _currentPart = 61;
+
+
+ // _currentPart = 850;
+ _currentPart = 100;
+ // _currentPart = 62;
// _currentPart = 40;
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index b286781dcc2..aea0029acb9 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -73,7 +73,7 @@ enum {
MAX_VERB_NAME_LENGTH = 12,
MAX_ROOM_OBJECT_AREAS = 256,
MAX_DIALOGUE_QUESTIONS = 30,
- MAX_DIALOGUE_REPLIES = 70
+ MAX_DIALOGUE_REPLIES = 100 // cseg181:12B1-12C0
};
enum FacingPosition {
@@ -461,7 +461,7 @@ private:
void PART_05_HELPER_4_drawPaperOrNot(int num);
void PART_05_HELPER_5_drawPaper(int frame);
void PART_05_HELPER_3_drawCamera(int frame);
- void PART_05_HELPER_6();
+ void PART_05_HELPER_6_walkIgorToScene();
void PART_05_HELPER_1_drawPhotographer();
void PART_05_HELPER_2_drawTripod();
void PART_05();
@@ -474,17 +474,20 @@ private:
void PART_06();
void PART_06_UPDATE_ROOM_BACKGROUND();
void PART_06_EXEC_ACTION(int action);
- void PART_06_ACTION_103();
+ void PART_06_ACTION_103_talkToPhotographer();
+ void PART_06_HANDLE_DIALOGUE_PHOTOGRAPHER();
+ void PART_06_UPDATE_DIALOGUE_PHOTOGRAPHER(int action);
+ void PART_06_HELPER_7_decodePhotographerTalkingFrame(int frame);
void PART_06_ACTION_105();
void PART_06_ACTION_107();
void PART_06_ACTION_108();
- void PART_06_ACTION_102();
- void PART_06_HELPER_2();
+ void PART_06_ACTION_102_scrollLeft();
+ void PART_06_HELPER_2_drawPhotographer();
void PART_06_HELPER_3_drawTripod();
- void PART_06_HELPER_6(int num);
+ void PART_06_HELPER_6_setPhotographerState(int num);
void PART_06_HELPER_8_animatePhotographer(int frame);
void PART_06_HELPER_12();
- void PART_06_HELPER_13(int frame);
+ void PART_06_HELPER_13_drawCamera(int frame);
void PART_06_HELPER_14();
void PART_06_HELPER_15(int frame);
void PART_06_HELPER_1_drawPieceOfPaper(int frame);
@@ -512,6 +515,7 @@ private:
void PART_11_ACTION_112();
void PART_11_APPLY_OBJECT_STATE(int num);
+
// outside church
void PART_12_EXEC_ACTION(int action);
void PART_12_ACTION_101();
diff --git a/engines/igor/part_10.cpp b/engines/igor/part_10.cpp
index e507c416e01..1443a951d52 100644
--- a/engines/igor/part_10.cpp
+++ b/engines/igor/part_10.cpp
@@ -115,7 +115,7 @@ void IgorEngine::PART_10_ACTION_104_pickHamburger() {
}
void IgorEngine::PART_10_ACTION_108() {
- uint8 *walkTable = loadData(WLK_DecanatoA);
+ uint8 *walkTable = loadData(WLK_DecanatoLeft);
int xPos = 329;
int yPos = 0;
int i = 1;
@@ -157,7 +157,7 @@ void IgorEngine::PART_10() {
_gameState.enableLight = 1;
loadActionData(DAT_Decanato);
- loadRoomData(PAL_DecanatoA, IMG_DecanatoA, BOX_DecanatoA, MSK_DecanatoA, TXT_DecanatoA);
+ loadRoomData(PAL_DecanatoLeft, IMG_DecanatoLeft, BOX_DecanatoLeft, MSK_DecanatoLeft, TXT_DecanatoLeft);
static const int frames1[] = { FRM_Decanato1, 0 };
static const int frames2[] = { FRM_Decanato2, 0 };
static const int frames3[] = { FRM_Decanato3, 0 };
@@ -168,6 +168,8 @@ void IgorEngine::PART_10() {
loadAnimData(frames3, kPart10Frm3);
loadAnimData(frames4, kPart10Frm4);
loadAnimData(frames5, kPart10Frm5);
+
+ // Paint glass shards
if (_objectsState[67] == 1) {
for (int y = 0; y <= 7; ++y)
memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart10Frm4 + y * 37, 37);
@@ -183,7 +185,9 @@ void IgorEngine::PART_10() {
// Preserve the complete left panel at ANM+0, then make the right panel
// active. The original load order is unconditional.
memcpy(_animFramesBuffer + kPart10PanelLeft, _screenLayer1, 46080);
- loadRoomData(PAL_DecanatoB, IMG_DecanatoB, BOX_DecanatoB, MSK_DecanatoB, TXT_DecanatoB);
+
+
+ loadRoomData(PAL_DecanatoRight, IMG_DecanatoRight, BOX_DecanatoRight, MSK_DecanatoRight, TXT_DecanatoRight);
static const int hamburgerAnimation[] = { ANM_DecanatoHamburger, 0 };
loadAnimData(hamburgerAnimation, kPart10Frm1);
diff --git a/engines/igor/part_11.cpp b/engines/igor/part_11.cpp
index 4ed83ce5380..9ddd484022a 100644
--- a/engines/igor/part_11.cpp
+++ b/engines/igor/part_11.cpp
@@ -32,11 +32,14 @@ void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
if (num == 2 || num == 255) {
if (_objectsState[67] == 1) {
+ // paint glass shards
for (int y = 0; y <= 7; ++y)
memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart11Frm4 + y * 37, 37);
+ // make area selectable
for (int area = 10; area <= 11; ++area)
_roomObjectAreasTable[area].object = 7;
} else {
+ // make area not selectable
for (int area = 10; area <= 11; ++area)
_roomObjectAreasTable[area].object = 0;
}
@@ -83,7 +86,7 @@ void IgorEngine::PART_11_ACTION_107() {
}
void IgorEngine::PART_11_ACTION_108() {
- uint8 *walkTable = loadData(WLK_DecanatoB);
+ uint8 *walkTable = loadData(WLK_DecanatoRight);
int xPos = 310;
int yPos = 0;
int i = 1;
@@ -218,9 +221,9 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
void IgorEngine::PART_11() {
_gameState.enableLight = 1;
loadActionData(DAT_DecanatoPart11);
- loadRoomData(PAL_DecanatoB, IMG_DecanatoB, BOX_DecanatoB, MSK_DecanatoB, TXT_DecanatoB);
+ loadRoomData(PAL_DecanatoRight, IMG_DecanatoRight, BOX_DecanatoRight, MSK_DecanatoRight, TXT_DecanatoRight);
memcpy(_animFramesBuffer + kPart11PanelRight, _screenLayer1, 46080);
- loadRoomData(PAL_DecanatoA, IMG_DecanatoA, BOX_DecanatoA, MSK_DecanatoA, TXT_DecanatoA);
+ loadRoomData(PAL_DecanatoLeft, IMG_DecanatoLeft, BOX_DecanatoLeft, MSK_DecanatoLeft, TXT_DecanatoLeft);
static const int frames1[] = { FRM_Decanato1, 0 };
static const int frames2[] = { FRM_Decanato2, 0 };
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 3fd5b64af0c..3244dfe7e7d 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -103,7 +103,7 @@ void IgorEngine::PART_05_HELPER_3_drawCamera(int frame) {
}
}
-void IgorEngine::PART_05_HELPER_6() {
+void IgorEngine::PART_05_HELPER_6_walkIgorToScene() {
_walkData[0].setPos(0, 141, 2, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 0;
@@ -115,7 +115,6 @@ void IgorEngine::PART_05_HELPER_6() {
waitForIgorMove();
}
-
void IgorEngine::PART_05() {
_gameState.enableLight = 1;
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
@@ -138,6 +137,8 @@ void IgorEngine::PART_05() {
PART_05_HELPER_3_drawCamera(0);
}
+ // copying a patch of 224 pixels width and 144 height into the backup buffer for later scroll
+ // then it loads the actual current scene, SpringBridge
for (int i = 0; i <= 143; ++i) {
memcpy(_animFramesBuffer + i * 224, _screenLayer1 + i * 320 + 96, 224);
}
@@ -154,9 +155,14 @@ void IgorEngine::PART_05() {
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
+ // Part 50: Arriving from the map, Igor should walk in
+ // Part 51: Arriving from SpringRock through scroll
+ // Part 52: ?
if (_currentPart == 50) {
debug("Entering PART_05_HELPER_6");
- PART_05_HELPER_6();
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ fadeIn(768);
+ PART_05_HELPER_6_walkIgorToScene();
}
enterPartLoop();
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 33005e4863e..4be87abec04 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -65,7 +65,7 @@ void IgorEngine::PART_06_HELPER_1_drawPieceOfPaper(int frame) {
}
}
-void IgorEngine::PART_06_HELPER_2() {
+void IgorEngine::PART_06_HELPER_2_drawPhotographer() {
const int offset = 23521;
for (int i = 0; i <= 48; ++i) {
const uint8 *src = _screenLayer1 + i * 320 + offset;
@@ -101,10 +101,10 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
startIgorDialogue();
break;
case 102:
- PART_06_ACTION_102();
+ PART_06_ACTION_102_scrollLeft();
break;
case 103:
- PART_06_ACTION_103();
+ PART_06_ACTION_103_talkToPhotographer();
break;
case 104:
ADD_DIALOGUE_TEXT(203, 1, 481);
@@ -130,7 +130,7 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
break;
}
}
-void IgorEngine::PART_06_ACTION_103() {
+void IgorEngine::PART_06_ACTION_103_talkToPhotographer() {
ADD_DIALOGUE_TEXT(215, 1, 489);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -140,11 +140,38 @@ void IgorEngine::PART_06_ACTION_103() {
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);
+ PART_06_HANDLE_DIALOGUE_PHOTOGRAPHER();
+ PART_06_HELPER_6_setPhotographerState(255);
}
-void IgorEngine::PART_06_HELPER_6(int num) {
+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_DIALOGUE_PHOTOGRAPHER(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_06_HELPER_7_decodePhotographerTalkingFrame(1);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_06_HELPER_7_decodePhotographerTalkingFrame(getRandomNumber(5) + 1);
+ break;
+ case kUpdateDialogueAnimStanding:
+ PART_06_HELPER_7_decodePhotographerTalkingFrame(1);
+ break;
+ }
+}
+
+void IgorEngine::PART_06_HELPER_7_decodePhotographerTalkingFrame(int frame) {
+ const uint8 *src = _animFramesBuffer + 0xA763 + READ_LE_UINT16(_animFramesBuffer + 0xDB95 + frame * 2) - 1;
+ decodeAnimFrame(src, _screenVGA, true);
+}
+
+void IgorEngine::PART_06_HELPER_6_setPhotographerState(int num) {
if (num == 2 || num == 255) {
if (_objectsState[61] == 1) {
PART_06_HELPER_14();
@@ -167,9 +194,9 @@ void IgorEngine::PART_06_HELPER_6(int num) {
}
if (num == 3 || num == 255) {
if (_objectsState[62] == 1) {
- PART_06_HELPER_13(0);
+ PART_06_HELPER_13_drawCamera(0);
} else {
- PART_06_HELPER_13(1);
+ PART_06_HELPER_13_drawCamera(1);
_roomObjectAreasTable[3].object = 0;
}
}
@@ -190,7 +217,7 @@ void IgorEngine::PART_06_ACTION_105() {
}
addObjectToInventory(36, 71);
_objectsState[62] = 0;
- PART_06_HELPER_6(255);
+ PART_06_HELPER_6_setPhotographerState(255);
}
void IgorEngine::PART_06_ACTION_107() {
@@ -233,14 +260,14 @@ void IgorEngine::PART_06_ACTION_108() {
} while (i != 28);
removeObjectFromInventory(61);
_objectsState[61] = 0;
- PART_06_HELPER_6(255);
+ PART_06_HELPER_6_setPhotographerState(255);
_gameState.unkF = false;
ADD_DIALOGUE_TEXT(213, 2, 488);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
-void IgorEngine::PART_06_ACTION_102() {
+void IgorEngine::PART_06_ACTION_102_scrollLeft() {
uint8 *walkTable1 = loadData(WLK_Bridge1);
uint8 *walkTable2 = loadData(WLK_Bridge2);
int xPos = 323;
@@ -299,7 +326,7 @@ void IgorEngine::PART_06_HELPER_12() {
}
}
-void IgorEngine::PART_06_HELPER_13(int frame) {
+void IgorEngine::PART_06_HELPER_13_drawCamera(int frame) {
const int offset = 26756;
for (int i = 0; i <= 5; ++i) {
const uint8 *src = _animFramesBuffer + 0x7E00 + frame * 42 + i * 7;
@@ -321,7 +348,9 @@ void IgorEngine::PART_06_HELPER_15(int frame) {
}
void IgorEngine::PART_06() {
+ debug("Entering 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};
// loads from offset 32256
@@ -344,10 +373,10 @@ void IgorEngine::PART_06() {
static const int anm4[] = {FRM_SpringRock5, FRM_SpringRock6, 0};
loadAnimData(anm4, 0xA763);
- PART_06_HELPER_2();
+ PART_06_HELPER_2_drawPhotographer();
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_06_EXEC_ACTION);
_updateRoomBackground = &IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND;
- PART_06_HELPER_6(255);
+ PART_06_HELPER_6_setPhotographerState(255);
if (_objectsState[63] == 1) {
PART_06_HELPER_3_drawTripod();
@@ -359,6 +388,7 @@ void IgorEngine::PART_06() {
drawInventory(1, 0);
_currentAction.verb = kVerbWalk;
memcpy(_paletteBuffer, _currentPalette, 624);
+ // Part 61 is arriving from intro so it doesnt need to copy the screen buffer
fadeIn(768);
}
loadActionData(DAT_SpringBridge);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index e501dd81001..f1418d21466 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -117,13 +117,14 @@ void IgorEngine::PART_MAIN() {
_inventoryInfo[39] = 3;
_inventoryInfo[72] = 1; // first object
_inventoryInfo[73] = 3; // last object
- // UPDATE_OBJECT_STATE(255);
+ 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) {
@@ -131,14 +132,13 @@ void IgorEngine::PART_MAIN() {
case 40:
PART_04(); // Map
break;
- case 50:
- case 51:
+ case 50: // arrive from map
+ case 51: // arrive from SpringRock through scroll
case 52:
PART_05(); // SpringBridge
break;
- case 60:
- case 61:
- case 62:
+ case 60: // arrive through scroll
+ case 61: // arrive from intro
PART_06(); // SpringRock
break;
case 70:
@@ -146,11 +146,10 @@ void IgorEngine::PART_MAIN() {
case 72:
PART_07(); // Administration corridor; cseg197:28D4
break;
-
- case 100:
+ case 100: // enter from map
case 101:
case 102:
- PART_10(); // OutsideAdministrationBuilding street
+ PART_10(); // OutsideAdministrationBuilding street, right panel
break;
case 110:
PART_11(); // OutsideAdministrationBuilding street, left panel
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 02910f151a0..2de9082c2ff 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -473,19 +473,19 @@
// Decanato panels
-#define PAL_DecanatoA 900
-#define IMG_DecanatoA 901
-#define MSK_DecanatoA 902
-#define BOX_DecanatoA 903
-#define PAL_DecanatoB 904
-#define IMG_DecanatoB 905
-#define MSK_DecanatoB 906
-#define BOX_DecanatoB 907
-#define TXT_DecanatoA 908
-#define TXT_DecanatoB 909
+#define PAL_DecanatoLeft 900
+#define IMG_DecanatoLeft 901
+#define MSK_DecanatoLeft 902
+#define BOX_DecanatoLeft 903
+#define TXT_DecanatoLeft 908
+#define PAL_DecanatoRight 904
+#define IMG_DecanatoRight 905
+#define MSK_DecanatoRight 906
+#define BOX_DecanatoRight 907
+#define TXT_DecanatoRight 909
// Walk line used for scroll
-#define WLK_DecanatoA 910
-#define WLK_DecanatoB 911
+#define WLK_DecanatoLeft 910
+#define WLK_DecanatoRight 911
#define DAT_DecanatoPart11 912 // cseg176:286F-2882; IGOR.EXE:0x68049B, size 0x1841
// CD-only intro card shown by state 850. All three resources are contiguous in
Commit: a41503c79238a5c30417e71f9409a5906b9a520a
https://github.com/scummvm/scummvm/commit/a41503c79238a5c30417e71f9409a5906b9a520a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:56+01:00
Commit Message:
IGOR: Fix crash during part 6 dialog
Changed paths:
engines/igor/igor.h
engines/igor/resource.cpp
engines/igor/static_walk.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index aea0029acb9..556fa0b6bfe 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -170,6 +170,18 @@ struct Action {
uint8 object2Type;
};
+struct DialogueDataOffsets {
+ int questionsOffset;
+ int questionsSize;
+ int repliesOffset;
+ int repliesSize;
+ int matSize;
+ int replyDataOffset;
+ int questionSoundsOffset;
+ int replySoundsOffset;
+ int replySoundsSize;
+};
+
struct RoomDataOffsets {
struct {
int box;
@@ -189,13 +201,7 @@ struct RoomDataOffsets {
int object1;
int objectSize;
} action;
- struct {
- int questionsOffset;
- int questionsSize;
- int repliesOffset;
- int repliesSize;
- int matSize;
- } dlg;
+ DialogueDataOffsets dlg;
};
enum {
kUpdateDialogueAnimEndOfSentence = 1,
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 64e0f0307da..9d4190309b9 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -130,17 +130,24 @@ void IgorEngine::loadDialogueData(int dlg) {
assert(dialogueDataSize <= 500);
memcpy(_gameState.dialogueData, p, dialogueDataSize);
assert(_roomDataOffsets.dlg.questionsSize <= MAX_DIALOGUE_QUESTIONS);
- // The original keeps both 1-based speech tables at the end of the DLG
- // resource. Part 12 loads 0x14C2 bytes and indexes its question table at
- // DLG+5230+question*2. See cseg172:0D41-0D54 and cseg172:043B-0452.
- const int questionSoundsOffset = dataSize - (_roomDataOffsets.dlg.questionsSize + _roomDataOffsets.dlg.repliesSize + 2) * 2;
+ // A zero speech layout retains the legacy packed-tail layout for dialogue
+ // rooms that have not yet had their original offsets added to RoomDataOffsets.
+ int questionSoundsOffset = _roomDataOffsets.dlg.questionSoundsOffset;
+ int replySoundsOffset = _roomDataOffsets.dlg.replySoundsOffset;
+ int replySoundsSize = _roomDataOffsets.dlg.replySoundsSize;
+ if (questionSoundsOffset == 0) {
+ questionSoundsOffset = dataSize - (_roomDataOffsets.dlg.questionsSize + _roomDataOffsets.dlg.repliesSize + 2) * 2;
+ replySoundsOffset = questionSoundsOffset + (_roomDataOffsets.dlg.questionsSize + 1) * 2;
+ replySoundsSize = _roomDataOffsets.dlg.repliesSize;
+ }
assert(questionSoundsOffset >= 0);
+ assert(questionSoundsOffset + (_roomDataOffsets.dlg.questionsSize + 1) * 2 <= dataSize);
for (int i = 0; i < _roomDataOffsets.dlg.questionsSize; ++i) {
_dialogueQuestionSounds[i] = READ_LE_UINT16(p + questionSoundsOffset + (i + 1) * 2);
}
- const int replySoundsOffset = questionSoundsOffset + (_roomDataOffsets.dlg.questionsSize + 1) * 2;
assert(_roomDataOffsets.dlg.repliesSize <= MAX_DIALOGUE_REPLIES);
- for (int i = 0; i < _roomDataOffsets.dlg.repliesSize; ++i) {
+ assert(replySoundsOffset + (replySoundsSize + 1) * 2 <= dataSize);
+ for (int i = 0; i < replySoundsSize; ++i) {
_dialogueReplySounds[i] = READ_LE_UINT16(p + replySoundsOffset + (i + 1) * 2); // cseg172:0A59-0A82
}
for (int i = 0; i < _roomDataOffsets.dlg.questionsSize; ++i) {
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 6a2c71be3a9..f645bde2696 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -193,203 +193,215 @@ 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 }
+ { 0, 0, 0, 0, 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 }
+ {
+ 135, 30, 5158, 100, 60,
+ 240, // cseg181:0F2F-0F41
+ 15458, // cseg181:0771-0783
+ 15518, // cseg181:0FCE-0FEF
+ 35 // cseg181:11CB; (0x3CE6 - 15518) / 2 - 1
+ }
};
const RoomDataOffsets IgorEngine::PART_07_ROOM_DATA_OFFSETS = {
{ 80, 4, 12, 3 }, // cseg197:194E-199C; DAT+80, 4 records, 12-byte source, 3-byte destination
{ 151, 168 }, // cseg197:1F87-1FCF and cseg197:2124-213D
{ 175, 419, 3575, 319, 395, 88 }, // cseg197:2E4C-2F19 and cseg197:2F23-2F62
- { 0, 0, 0, 0, 0 } // cseg197 has no room-specific question/reply matrix
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // cseg197 has no room-specific question/reply matrix
};
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 }
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
const RoomDataOffsets IgorEngine::PART_10_ROOM_DATA_OFFSETS = {
{ 45, 3, 6, 2 }, // cseg175:17F9-1829: DAT+45, 3 records, 6-byte source, 2-byte destination
{ 77, 90 }, // cseg175:1E22-1E68 and cseg175:1FBB-1FD3
{ 95, 303, 3319, 199, 275, 84 }, // cseg175:1C41-1CA7, 1CE9-1D4F, 2C8B-2DEA
- { 0, 0, 0, 0, 0 }
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
const RoomDataOffsets IgorEngine::PART_11_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 }, // cseg176 routes walks through the room mask; no area matrix
{ 35, 52 }, // cseg176:1EE5-1F15, 207C
{ 59, 309, 3255, 203, 279, 82 }, // cseg176:2CBC-2CE5 (action); +60 is its walk behavior at 1E7B,2026,2061
- { 0, 0, 0, 0, 0 }
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
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 }
+ {
+ -85, 15, 2478, 25, 30,
+ 60, // cseg172:09C5-09D6
+ 5230, // cseg172:043B-0452
+ 5260, // cseg172:0A59-0A82
+ 25 // cseg172:0A4A-0A92
+ }
};
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 }
+ { 0, 0, 0, 0, 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 }
+ { 0, 0, 0, 0, 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 }
+ { 45, 22, 3756, 66, 60, 0, 0, 0, 0 }
};
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 }
+ { 0, 0, 0, 0, 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 }
+ { -174, 5, 257, 1, 30, 0, 0, 0, 0 }
};
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 }
+ { 0, 0, 0, 0, 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 }
+ { 0, 0, 0, 0, 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 }
+ { -85, 10, 1658, 50, 30, 0, 0, 0, 0 }
};
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 }
+ { 0, 0, 0, 0, 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 }
+ { 0, 0, 0, 0, 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 }
+ { 0, 0, 0, 0, 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 }
+ { 0, 0, 0, 0, 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 }
+ { 0, 0, 0, 0, 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 }
+ { 0, 0, 0, 0, 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 }
+ { 0, 0, 0, 0, 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 }
+ { -90, 9, 1489, 11, 30, 0, 0, 0, 0 }
};
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 }
+ { 0, 0, 0, 0, 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 }
+ { -46, 9, 1533, 19, 60, 0, 0, 0, 0 }
};
const RoomDataOffsets IgorEngine::PART_34_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 }, // cseg101:1765-1775 calls the direct room walk builder cseg101:1006
{ 4, 15 }, // cseg101:1645-168B (walk points); cseg101:17DE-17F6 (facing)
{ 19, 211, 3087, 103, 179, 80 }, // cseg101:142D,14CB,1572,1486,14AF
- { 0, 0, 0, 0, 0 }
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
const RoomDataOffsets IgorEngine::PART_35_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 }, // cseg100:0E23-0E33 calls the direct room walk builder cseg100:06C4
{ 5, 18 }, // cseg100:0D03-0D49 (walk points); cseg100:0E9C-0EB4 (facing)
{ 23, 233, 3179, 127, 203, 82 }, // cseg100:0AEB,0B89,0C30,0B44,0B6D
- { 0, 0, 0, 0, 0 }
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
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 }
+ { 0, 0, 0, 0, 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 }
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
} // End of namespace Igor
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 7d240301dd8..3f94db5143e 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -580,7 +580,10 @@ void IgorEngine::dialogueReplyToQuestion(int x, int y, int r, int g, int b, int
return;
}
}
- int offset = 30 + _roomDataOffsets.dlg.matSize + reply;
+ const int repliesDataOffset = _roomDataOffsets.dlg.replyDataOffset != 0
+ ? _roomDataOffsets.dlg.replyDataOffset
+ : 30 + _roomDataOffsets.dlg.matSize;
+ int offset = repliesDataOffset + reply;
int count = _gameState.dialogueData[offset - 1];
int dialogueIndex = 250;
for (int i = 0; i < count; ++i) {
Commit: 7ee3e7caab8b5a251b69dc25530f6907cb8706f9
https://github.com/scummvm/scummvm/commit/7ee3e7caab8b5a251b69dc25530f6907cb8706f9
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:56+01:00
Commit Message:
IGOR: Consolidate common functions in part 5 and 6
Changed paths:
engines/igor/igor.h
engines/igor/part_5.cpp
engines/igor/part_6.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 556fa0b6bfe..9a1a99cbcf5 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -465,11 +465,12 @@ private:
// spring bridge
void PART_05_HELPER_4_drawPaperOrNot(int num);
- void PART_05_HELPER_5_drawPaper(int frame);
- void PART_05_HELPER_3_drawCamera(int frame);
void PART_05_HELPER_6_walkIgorToScene();
- void PART_05_HELPER_1_drawPhotographer();
- void PART_05_HELPER_2_drawTripod();
+ void PART_05_06_DRAW_PAPER(int frame);
+ void PART_05_06_SAVE_PHOTOGRAPHER_BACKGROUND();
+ void PART_05_06_DRAW_PHOTOGRAPHER();
+ void PART_05_06_DRAW_CAMERA(int frame);
+ void PART_05_06_DRAW_TRIPOD(bool drawToScreen);
void PART_05();
void PART_05_EXEC_ACTION(int action);
void PART_05_ACTION_103_pickPaper();
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 3244dfe7e7d..3e16801fbc1 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -59,11 +59,11 @@ void IgorEngine::PART_05_HELPER_4_drawPaperOrNot(int num) {
if (_objectsState[60] == 0) {
// paper not taken, paint "frame 0"
- PART_05_HELPER_5_drawPaper(0);
+ PART_05_06_DRAW_PAPER(0);
return;
}
// paper taken, paint "frame 1"
- PART_05_HELPER_5_drawPaper(1);
+ PART_05_06_DRAW_PAPER(1);
// disable object
_roomObjectAreasTable[24].object = 0;
for (int i = 27; i <= 29; ++i) {
@@ -71,7 +71,8 @@ void IgorEngine::PART_05_HELPER_4_drawPaperOrNot(int num) {
}
}
-void IgorEngine::PART_05_HELPER_5_drawPaper(int frame) {
+void IgorEngine::PART_05_06_DRAW_PAPER(int frame) {
+
const int offset = 41926;
for (int i = 0; i <= 2; ++i) {
const uint8 *src = _animFramesBuffer + 0x7E00 + frame * 12 + i * 4;
@@ -79,23 +80,33 @@ void IgorEngine::PART_05_HELPER_5_drawPaper(int frame) {
}
}
-void IgorEngine::PART_05_HELPER_1_drawPhotographer() {
+void IgorEngine::PART_05_06_SAVE_PHOTOGRAPHER_BACKGROUND() {
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_drawTripod() {
+void IgorEngine::PART_05_06_DRAW_PHOTOGRAPHER() {
+ const int offset = 23521;
+ for (int i = 0; i <= 48; ++i)
+ memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + 0x95C7 + i * 23, 23);
+}
+
+void IgorEngine::PART_05_06_DRAW_TRIPOD(bool drawToScreen) {
+ // Layer-1 blit: cseg182:047C-04CB; the active-pane copy is
+ // cseg180:03E9-0462.
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);
+ if (drawToScreen)
+ memcpy(_screenVGA + i * 320 + offset, src, 23);
}
}
-void IgorEngine::PART_05_HELPER_3_drawCamera(int frame) {
+void IgorEngine::PART_05_06_DRAW_CAMERA(int frame) {
+ // cseg180:038B-03E6; duplicated at cseg182:041E-0479.
const int offset = 26756;
for (int i = 0; i <= 5; ++i) {
const uint8 *src = _animFramesBuffer + 0x7E00 + frame * 42 + i * 7;
@@ -128,13 +139,14 @@ void IgorEngine::PART_05() {
// Draws photographer and objects before copying the screenLayer
if (_objectsState[61] != 0) {
- PART_05_HELPER_1_drawPhotographer();
+ PART_05_06_SAVE_PHOTOGRAPHER_BACKGROUND();
+ PART_05_06_DRAW_PHOTOGRAPHER();
}
if (_objectsState[63] != 0) {
- PART_05_HELPER_2_drawTripod();
+ PART_05_06_DRAW_TRIPOD(false);
}
if (_objectsState[62] != 0) {
- PART_05_HELPER_3_drawCamera(0);
+ PART_05_06_DRAW_CAMERA(0);
}
// copying a patch of 224 pixels width and 144 height into the backup buffer for later scroll
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 4be87abec04..51341d50f72 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -57,31 +57,6 @@ void IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND() {
}
}
-void IgorEngine::PART_06_HELPER_1_drawPieceOfPaper(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_drawPhotographer() {
- 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_drawTripod() {
- 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_8_animatePhotographer(int frame) {
const int offset = 23521;
for (int i = 0; i <= 48; ++i) {
@@ -174,7 +149,7 @@ void IgorEngine::PART_06_HELPER_7_decodePhotographerTalkingFrame(int frame) {
void IgorEngine::PART_06_HELPER_6_setPhotographerState(int num) {
if (num == 2 || num == 255) {
if (_objectsState[61] == 1) {
- PART_06_HELPER_14();
+ PART_05_06_DRAW_PHOTOGRAPHER();
_roomObjectAreasTable[3].object = 0;
_roomObjectAreasTable[13].area = 0;
_roomObjectAreasTable[15].area = 0;
@@ -194,9 +169,9 @@ void IgorEngine::PART_06_HELPER_6_setPhotographerState(int num) {
}
if (num == 3 || num == 255) {
if (_objectsState[62] == 1) {
- PART_06_HELPER_13_drawCamera(0);
+ PART_05_06_DRAW_CAMERA(0);
} else {
- PART_06_HELPER_13_drawCamera(1);
+ PART_05_06_DRAW_CAMERA(1);
_roomObjectAreasTable[3].object = 0;
}
}
@@ -326,22 +301,6 @@ void IgorEngine::PART_06_HELPER_12() {
}
}
-void IgorEngine::PART_06_HELPER_13_drawCamera(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);
@@ -356,7 +315,7 @@ void IgorEngine::PART_06() {
// loads from offset 32256
loadAnimData(anm1, 0x7E00);
if (_objectsState[60] == 0) {
- PART_06_HELPER_1_drawPieceOfPaper(0);
+ PART_05_06_DRAW_PAPER(0);
}
// copying a patch of 224 pixels width and 144 height into the backup buffer for later scroll
// then it loads the actual current scene, SpringRock
@@ -373,13 +332,13 @@ void IgorEngine::PART_06() {
static const int anm4[] = {FRM_SpringRock5, FRM_SpringRock6, 0};
loadAnimData(anm4, 0xA763);
- PART_06_HELPER_2_drawPhotographer();
+ PART_05_06_SAVE_PHOTOGRAPHER_BACKGROUND();
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_06_EXEC_ACTION);
_updateRoomBackground = &IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND;
PART_06_HELPER_6_setPhotographerState(255);
if (_objectsState[63] == 1) {
- PART_06_HELPER_3_drawTripod();
+ PART_05_06_DRAW_TRIPOD(true);
}
if (_currentPart == 61) {
Commit: b8199858501978266a548768e0bcc5419eb79e28
https://github.com/scummvm/scummvm/commit/b8199858501978266a548768e0bcc5419eb79e28
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:57+01:00
Commit Message:
IGOR: Consolidate functions in parts 10 & 11
Changed paths:
engines/igor/igor.h
engines/igor/part_10.cpp
engines/igor/part_11.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 9a1a99cbcf5..2849d461d81 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -489,15 +489,10 @@ private:
void PART_06_ACTION_107();
void PART_06_ACTION_108();
void PART_06_ACTION_102_scrollLeft();
- void PART_06_HELPER_2_drawPhotographer();
- void PART_06_HELPER_3_drawTripod();
void PART_06_HELPER_6_setPhotographerState(int num);
void PART_06_HELPER_8_animatePhotographer(int frame);
void PART_06_HELPER_12();
- void PART_06_HELPER_13_drawCamera(int frame);
- void PART_06_HELPER_14();
void PART_06_HELPER_15(int frame);
- void PART_06_HELPER_1_drawPieceOfPaper(int frame);
void PART_07();
void PART_07_EXEC_ACTION(int action);
@@ -512,6 +507,7 @@ private:
void PART_10_EXEC_ACTION(int action);
void PART_10_ACTION_104_pickHamburger();
void PART_10_ACTION_108();
+ void PART_10_11_DRAW_OBJECT_STATE(int num);
// Decanato left
void PART_11();
diff --git a/engines/igor/part_10.cpp b/engines/igor/part_10.cpp
index 1443a951d52..121cbd2c528 100644
--- a/engines/igor/part_10.cpp
+++ b/engines/igor/part_10.cpp
@@ -26,6 +26,28 @@ const uint32 kPart10Frm5 = 0xC8AE;
} // End of anonymous namespace
+void IgorEngine::PART_10_11_DRAW_OBJECT_STATE(int num) {
+ // These three original blitters are byte-for-byte duplicates in the two
+ // halves of the room: cseg175:0002-00F1 and cseg176:0002-00F1.
+ if ((num == 2 || num == 255) && _objectsState[67] == 1) {
+ for (int y = 0; y <= 7; ++y)
+ memcpy(_screenLayer1 + 0x7DA1 + y * 320,
+ _animFramesBuffer + 0xC786 + y * 37, 37); // cseg175/cseg176:0002-0051
+ }
+
+ if (num == 3 || num == 255) {
+ if (_objectsState[68] == 1) {
+ for (int y = 0; y <= 14; ++y)
+ memcpy(_screenLayer1 + 0x4E32 + y * 320,
+ _animFramesBuffer + 0xC5E2 + y * 14, 14); // cseg175/cseg176:0052-00A1
+ } else if (_objectsState[68] == 2) {
+ for (int y = 0; y <= 14; ++y)
+ memcpy(_screenLayer1 + 0x4E32 + y * 320,
+ _animFramesBuffer + 0xC6B4 + y * 14, 14); // cseg175/cseg176:00A2-00F1
+ }
+ }
+}
+
void IgorEngine::PART_10_EXEC_ACTION(int action) {
// The action table order differs from the function listing order.
switch (action) {
@@ -169,18 +191,7 @@ void IgorEngine::PART_10() {
loadAnimData(frames4, kPart10Frm4);
loadAnimData(frames5, kPart10Frm5);
- // Paint glass shards
- if (_objectsState[67] == 1) {
- for (int y = 0; y <= 7; ++y)
- memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart10Frm4 + y * 37, 37);
- }
- if (_objectsState[68] == 1) {
- for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart10Frm3 + y * 14, 14);
- } else if (_objectsState[68] == 2) {
- for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart10Frm3 + 210 + y * 14, 14);
- }
+ PART_10_11_DRAW_OBJECT_STATE(255);
// Preserve the complete left panel at ANM+0, then make the right panel
// active. The original load order is unconditional.
diff --git a/engines/igor/part_11.cpp b/engines/igor/part_11.cpp
index 9ddd484022a..75f5272d8fd 100644
--- a/engines/igor/part_11.cpp
+++ b/engines/igor/part_11.cpp
@@ -27,14 +27,13 @@ const uint32 kPart11Frm5 = 0xC8AE;
} // End of anonymous namespace
void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
+ PART_10_11_DRAW_OBJECT_STATE(num);
+
if (num == 1 || num == 255)
_roomObjectAreasTable[13].object = _objectsState[66] == 0 ? 4 : 3;
if (num == 2 || num == 255) {
if (_objectsState[67] == 1) {
- // paint glass shards
- for (int y = 0; y <= 7; ++y)
- memcpy(_screenLayer1 + 0x7DA1 + y * 320, _animFramesBuffer + kPart11Frm4 + y * 37, 37);
// make area selectable
for (int area = 10; area <= 11; ++area)
_roomObjectAreasTable[area].object = 7;
@@ -50,13 +49,9 @@ void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
for (int area = 7; area <= 8; ++area)
_roomObjectAreasTable[area].object = 0;
} else if (_objectsState[68] == 1) {
- for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart11Frm3 + y * 14, 14);
for (int area = 7; area <= 8; ++area)
_roomObjectAreasTable[area].object = 6;
} else if (_objectsState[68] == 2) {
- for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320, _animFramesBuffer + kPart11Frm3 + 210 + y * 14, 14);
_roomObjectAreasTable[7].object = 6;
_roomObjectAreasTable[8].object = 8;
}
Commit: ff167ccfbc6e08451283b046d0b5594f20c64463
https://github.com/scummvm/scummvm/commit/ff167ccfbc6e08451283b046d0b5594f20c64463
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:57+01:00
Commit Message:
IGOR: Consolidate constants in parts 10 & 11
Changed paths:
A engines/igor/statics.h
engines/igor/igor.h
engines/igor/part_10.cpp
engines/igor/part_11.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 2849d461d81..d9988e0411a 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -519,6 +519,8 @@ private:
void PART_11_APPLY_OBJECT_STATE(int num);
+
+
// outside church
void PART_12_EXEC_ACTION(int action);
void PART_12_ACTION_101();
diff --git a/engines/igor/part_10.cpp b/engines/igor/part_10.cpp
index 121cbd2c528..34d481c30c5 100644
--- a/engines/igor/part_10.cpp
+++ b/engines/igor/part_10.cpp
@@ -11,20 +11,16 @@
*/
#include "igor/igor.h"
+#include "igor/statics.h"
namespace Igor {
-// Ground truth: code/175_2767.asm, cseg175:0002-3595, cseg177:0002 and cseg134:21AF.
-namespace {
+// // Ground truth: code/175_2767.asm, cseg175:0002-3595, cseg177:0002 and cseg134:21AF.
+// namespace {
const uint32 kPart10PanelLeft = 0x0000;
-const uint32 kPart10Frm1 = 0xB400;
-const uint32 kPart10Frm2 = 0xBC0A;
-const uint32 kPart10Frm3 = 0xC5E2;
-const uint32 kPart10Frm4 = 0xC786;
-const uint32 kPart10Frm5 = 0xC8AE;
-} // End of anonymous namespace
+
void IgorEngine::PART_10_11_DRAW_OBJECT_STATE(int num) {
// These three original blitters are byte-for-byte duplicates in the two
@@ -126,7 +122,7 @@ void IgorEngine::PART_10_ACTION_104_pickHamburger() {
for (int frame = 0; frame < 4; ++frame) {
for (int y = 0; y < 49; ++y) {
memcpy(_screenVGA + 0x595F + y * 320,
- _animFramesBuffer + kPart10Frm1 + frameSelectors[frame] * 0x682 + y * 34,
+ _animFramesBuffer + kPart10_11_Frm1 + frameSelectors[frame] * 0x682 + y * 34,
34);
}
waitForTimer(31);
@@ -185,11 +181,11 @@ void IgorEngine::PART_10() {
static const int frames3[] = { FRM_Decanato3, 0 };
static const int frames4[] = { FRM_Decanato4, 0 };
static const int frames5[] = { FRM_Decanato5, 0 };
- loadAnimData(frames1, kPart10Frm1);
- loadAnimData(frames2, kPart10Frm2);
- loadAnimData(frames3, kPart10Frm3);
- loadAnimData(frames4, kPart10Frm4);
- loadAnimData(frames5, kPart10Frm5);
+ loadAnimData(frames1, kPart10_11_Frm1);
+ loadAnimData(frames2, kPart10_11_Frm2);
+ loadAnimData(frames3, kPart10_11_Frm3);
+ loadAnimData(frames4, kPart10_11_Frm4);
+ loadAnimData(frames5, kPart10_11_Frm5);
PART_10_11_DRAW_OBJECT_STATE(255);
@@ -200,7 +196,7 @@ void IgorEngine::PART_10() {
loadRoomData(PAL_DecanatoRight, IMG_DecanatoRight, BOX_DecanatoRight, MSK_DecanatoRight, TXT_DecanatoRight);
static const int hamburgerAnimation[] = { ANM_DecanatoHamburger, 0 };
- loadAnimData(hamburgerAnimation, kPart10Frm1);
+ loadAnimData(hamburgerAnimation, kPart10_11_Frm1);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
diff --git a/engines/igor/part_11.cpp b/engines/igor/part_11.cpp
index 75f5272d8fd..d0825f6ceb5 100644
--- a/engines/igor/part_11.cpp
+++ b/engines/igor/part_11.cpp
@@ -11,20 +11,16 @@
*/
#include "igor/igor.h"
+#include "igor/statics.h"
namespace Igor {
// Ground truth: code/176_2813.asm, cseg176:00F2-29E6 and cseg177:0002.
-namespace {
+// namespace {
const uint32 kPart11PanelRight = 0x0000;
-const uint32 kPart11Frm1 = 0xB400;
-const uint32 kPart11Frm2 = 0xBC0A;
-const uint32 kPart11Frm3 = 0xC5E2;
-const uint32 kPart11Frm4 = 0xC786;
-const uint32 kPart11Frm5 = 0xC8AE;
-} // End of anonymous namespace
+
void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
PART_10_11_DRAW_OBJECT_STATE(num);
@@ -61,7 +57,7 @@ void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
void IgorEngine::PART_11_ACTION_105() {
for (int frame = 0; frame <= 1; ++frame) {
for (int y = 0; y <= 48; ++y)
- memcpy(_screenVGA + 0x6167 + y * 320, _animFramesBuffer + kPart11Frm1 + frame * 0x405 + y * 21, 21);
+ memcpy(_screenVGA + 0x6167 + y * 320, _animFramesBuffer + kPart10_11_Frm1 + frame * 0x405 + y * 21, 21);
waitForTimer(127);
}
addObjectToInventory(18, 53);
@@ -72,7 +68,7 @@ void IgorEngine::PART_11_ACTION_105() {
void IgorEngine::PART_11_ACTION_107() {
for (int frame = 0; frame <= 2; ++frame) {
for (int y = 0; y <= 27; ++y)
- memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart11Frm5 + frame * 0x348 + y * 30, 30);
+ memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart10_11_Frm5 + frame * 0x348 + y * 30, 30);
waitForTimer(61);
}
removeObjectFromInventory(42);
@@ -122,7 +118,7 @@ void IgorEngine::PART_11_ACTION_108() {
void IgorEngine::PART_11_ACTION_112() {
for (int frame = 0; frame <= 2; ++frame) {
for (int y = 0; y <= 27; ++y)
- memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart11Frm2 + frame * 0x348 + y * 30, 30);
+ memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart10_11_Frm2 + frame * 0x348 + y * 30, 30);
waitForTimer(61);
}
addObjectToInventory(23, 58);
@@ -225,11 +221,11 @@ void IgorEngine::PART_11() {
static const int frames3[] = { FRM_Decanato3, 0 };
static const int frames4[] = { FRM_Decanato4, 0 };
static const int frames5[] = { FRM_Decanato5, 0 };
- loadAnimData(frames1, kPart11Frm1);
- loadAnimData(frames2, kPart11Frm2);
- loadAnimData(frames3, kPart11Frm3);
- loadAnimData(frames4, kPart11Frm4);
- loadAnimData(frames5, kPart11Frm5);
+ loadAnimData(frames1, kPart10_11_Frm1);
+ loadAnimData(frames2, kPart10_11_Frm2);
+ loadAnimData(frames3, kPart10_11_Frm3);
+ loadAnimData(frames4, kPart10_11_Frm4);
+ loadAnimData(frames5, kPart10_11_Frm5);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_11_EXEC_ACTION);
_roomDataOffsets = PART_11_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/statics.h b/engines/igor/statics.h
new file mode 100644
index 00000000000..6f4cf2e5970
--- /dev/null
+++ b/engines/igor/statics.h
@@ -0,0 +1,39 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_STATICS_H
+#define IGOR_STATICS_H
+
+#include "common/scummsys.h"
+
+namespace Igor {
+
+// Shared animation frame buffer offsets for Part 10 & Part 11
+// Ground truth: code/175_2767.asm cseg175:2815, cseg177:0064, cseg177:0097, cseg177:00CA, cseg177:00FD
+const uint32 kPart10_11_Frm1 = 0xB400; // cseg175:2815
+const uint32 kPart10_11_Frm2 = 0xBC0A; // cseg177:0064
+const uint32 kPart10_11_Frm3 = 0xC5E2; // cseg177:0097
+const uint32 kPart10_11_Frm4 = 0xC786; // cseg177:00CA
+const uint32 kPart10_11_Frm5 = 0xC8AE; // cseg177:00FD
+
+} // End of namespace Igor
+
+#endif // IGOR_STATICS_H
Commit: 5a84f4e03a7431f46db5785fed74c032e26b765b
https://github.com/scummvm/scummvm/commit/5a84f4e03a7431f46db5785fed74c032e26b765b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:57+01:00
Commit Message:
Igor: touches on part 7
Changed paths:
engines/igor/igor.cpp
engines/igor/part_7.cpp
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 3f4264d30bc..30919899828 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -63,7 +63,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
// _currentPart = 850;
- _currentPart = 100;
+ _currentPart = 70;
// _currentPart = 62;
// _currentPart = 40;
}
diff --git a/engines/igor/part_7.cpp b/engines/igor/part_7.cpp
index 9461f542d22..5229d6566b9 100644
--- a/engines/igor/part_7.cpp
+++ b/engines/igor/part_7.cpp
@@ -10,35 +10,31 @@
namespace Igor {
-namespace {
-
const uint32 kDoor1Closed = 0x2175; // cseg197:007B
const uint32 kDoor1Open = 0x23F1; // cseg197:002B
const uint32 kDoor2Closed = 0x266D; // cseg197:011B
const uint32 kDoor2Open = 0x28DD; // cseg197:00CB
-} // End of anonymous namespace
-
void IgorEngine::PART_07_DRAW_DOOR_STATE(int num) {
- _roomActionsTable[297] = 109; // cseg197:0B0C-0B17
- if (num == 1 || num == 255) { // cseg197:0B1D-0B27
- const uint32 srcOffset = _objectsState[52] == 0 ? kDoor1Closed : kDoor1Open; // cseg197:0B29-0B58; s3:0x856
- for (int y = 0; y <= 52; ++y) // cseg197:0052-00A1 and cseg197:0002-0051
+ _roomActionsTable[297] = 109;
+ if (num == 1 || num == 255) {
+ const uint32 srcOffset = _objectsState[52] == 0 ? kDoor1Closed : kDoor1Open;
+ for (int y = 0; y <= 52; ++y)
memcpy(_screenLayer1 + 0x4DB8 + y * 320, _animFramesBuffer + srcOffset + y * 12, 12);
- _roomActionsTable[146] = _objectsState[52] == 0 ? 6 : 7; // cseg197:0B35-0B58
+ _roomActionsTable[146] = _objectsState[52] == 0 ? 6 : 7;
}
- if (num == 2 || num == 255) { // cseg197:0B5E-0B68
- const uint32 srcOffset = _objectsState[53] == 0 ? kDoor2Closed : kDoor2Open; // cseg197:0B6A-0B99; s3:0x857
- for (int y = 0; y <= 51; ++y) // cseg197:00F2-0141 and cseg197:00A2-00F1
+ if (num == 2 || num == 255) {
+ const uint32 srcOffset = _objectsState[53] == 0 ? kDoor2Closed : kDoor2Open;
+ for (int y = 0; y <= 51; ++y)
memcpy(_screenLayer1 + 0x4E1A + y * 320, _animFramesBuffer + srcOffset + y * 12, 12);
- _roomActionsTable[147] = _objectsState[53] == 0 ? 6 : 7; // cseg197:0B76-0B99
+ _roomActionsTable[147] = _objectsState[53] == 0 ? 6 : 7;
}
}
void IgorEngine::PART_07_ANIMATE_DOOR(int door, bool open) {
- const int stateIndex = door == 1 ? 52 : 53; // cseg197:0150 and cseg197:029E; s3:0x856-0x857
+ const int stateIndex = door == 1 ? 52 : 53;
if ((_objectsState[stateIndex] != 0) == open) {
- const int text = open ? 19 : 23; // cseg222:2C5A-2C86 and cseg222:2CF6-2D22
+ const int text = open ? 19 : 23;
ADD_DIALOGUE_TEXT(text, 1, text);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -46,178 +42,177 @@ void IgorEngine::PART_07_ANIMATE_DOOR(int door, bool open) {
return;
}
- const int lastFrame = open ? 2 : 0; // cseg197:01B1-01D9 and cseg197:0258-0280
- const int step = open ? 1 : -1; // cseg197:0166 and cseg197:020D
- for (int frame = 1;; frame += step) { // cseg197:015E and cseg197:0205
+ const int lastFrame = open ? 2 : 0;
+ const int step = open ? 1 : -1;
+ for (int frame = 1;; frame += step) {
if (door == 1) {
- for (int y = 0; y <= 52; ++y) // cseg197:016A-01AF and cseg197:0211-0256
+ for (int y = 0; y <= 52; ++y)
memcpy(_screenVGA + 0x4DB8 + y * 320, _animFramesBuffer + frame * 0x636 + y * 30, 30);
} else {
- for (int y = 0; y <= 54; ++y) // cseg197:02B8-0301 and cseg197:0363-03AC
+ for (int y = 0; y <= 54; ++y)
memcpy(_screenVGA + 0x4E0F + y * 320, _animFramesBuffer + 0x12A2 + frame * 0x4F1 + y * 23, 23);
}
if ((open && frame == 2) || (!open && frame == 1))
- playSound(open ? 13 : 14, 1); // cseg197:01B1-01BC,0264-026A,0303-030E,03B5-03C0
+ playSound(open ? 13 : 14, 1);
if (frame == lastFrame)
break;
- waitForTimer(127); // cseg197:01C8-01D2,026F-0279,031A-0324,03C5-03CF (wait while tick <= 0x7E)
+ waitForTimer(127);
}
- _objectsState[stateIndex] = open ? 1 : 0; // cseg197:01DB,0282,032D,03D8
- PART_07_DRAW_DOOR_STATE(door); // cseg197:01E0-01E2,0287-0289,0332-0334,03DD-03DF
+ _objectsState[stateIndex] = open ? 1 : 0;
+ PART_07_DRAW_DOOR_STATE(door);
}
void IgorEngine::PART_07_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame, int dyPos) {
- WalkData &wd = _walkData[0]; // cseg197:06F6 and cseg197:0884; s3:0xD94A = 0
- wd.setPos(109, 143, facing, frame); // cseg197:070B-071F and cseg197:089A-08BA
- wd.clipSkipX = 1; // cseg197:0734 and cseg197:08CF
- wd.clipWidth = 30; // cseg197:0739 and cseg197:08D4
- wd.scaleWidth = 23 + scaleStep * 3; // cseg197:073F-074B and cseg197:08DA-08E6
- wd.xPosChanged = 1; // cseg197:074E and cseg197:08E9
- wd.dxPos = 0; // cseg197:0753-0755 and cseg197:08EE-08F0
- wd.yPosChanged = 1; // cseg197:0758 and cseg197:08F3
- wd.dyPos = dyPos; // cseg197:075D-075F and cseg197:08F8
- wd.scaleHeight = 50; // cseg197:0762 and cseg197:08FE
- _walkDataCurrentIndex = 0; // cseg197:06F6 and cseg197:0884
- moveIgor(facing, frame); // cseg197:0767-076F and cseg197:0903-090B
+ WalkData &wd = _walkData[0];
+ wd.setPos(109, 143, facing, frame);
+ wd.clipSkipX = 1;
+ wd.clipWidth = 30;
+ wd.scaleWidth = 23 + scaleStep * 3;
+ wd.xPosChanged = 1;
+ wd.dxPos = 0;
+ wd.yPosChanged = 1;
+ wd.dyPos = dyPos;
+ wd.scaleHeight = 50;
+ _walkDataCurrentIndex = 0;
+ moveIgor(facing, frame);
}
void IgorEngine::PART_07_ENTER_FROM_OUTSIDE() {
- PART_07_DRAW_DOOR_STATE(255); // cseg197:06EA-06EC
+ PART_07_DRAW_DOOR_STATE(255);
for (int area = 11; area <= 13; ++area)
- _roomObjectAreasTable[area].area = 0; // cseg197:092E-095D
+ _roomObjectAreasTable[area].area = 0;
- int frame = 1; // cseg197:06FB
- for (int step = 0; step <= 9; ++step) { // cseg197:0700-0785
+ int frame = 1;
+ for (int step = 0; step <= 9; ++step) {
PART_07_DRAW_SCALED_IGOR(step, kFacingPositionBack, frame, 0);
- frame = frame == 6 ? 1 : frame + 1; // cseg197:0722-0730
- waitForTimer(15); // cseg197:0774-077E
+ frame = frame == 6 ? 1 : frame + 1;
+ waitForTimer(15);
}
- _walkDataLastIndex = 0; // cseg197:0787-0791
- if (!_part07FirstVisitDone) { // cseg197:0795; s3:0xED2E
- buildWalkPath(109, 143, 180, 129); // cseg197:079F-07D5; DAT+161 = 0xA1F4
- _walkData[_walkDataLastIndex].frameNum = 0; // cseg197:07DA-07E2
- _walkData[_walkDataLastIndex].posNum = kFacingPositionRight; // cseg197:07E7-07FF; DAT+173 = 2
- _walkDataCurrentIndex = 1; // cseg197:0803
- _gameState.igorMoving = true; // cseg197:0808
- waitForIgorMove(); // cseg197:080D
- ADD_DIALOGUE_TEXT(206, 2, 144); // cseg197:0812-081E
- ADD_DIALOGUE_TEXT(208, 4, 145); // cseg197:0824-0830
- SET_DIALOGUE_TEXT(1, 2); // cseg197:0836-083B
+ _walkDataLastIndex = 0;
+ if (!_part07FirstVisitDone) {
+ buildWalkPath(109, 143, 180, 129);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkData[_walkDataLastIndex].posNum = kFacingPositionRight;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ ADD_DIALOGUE_TEXT(206, 2, 144);
+ ADD_DIALOGUE_TEXT(208, 4, 145);
+ SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue();
- _part07FirstVisitDone = true; // cseg197:0845; s3:0xED2E
+ _part07FirstVisitDone = true;
} else {
- buildWalkPath(109, 143, 129, 138); // cseg197:084C-0857
- _walkData[_walkDataLastIndex].frameNum = 0; // cseg197:085C-0864
- _walkDataCurrentIndex = 1; // cseg197:0869
- _gameState.igorMoving = true; // cseg197:086E
- waitForIgorMove(); // cseg197:0873
+ buildWalkPath(109, 143, 129, 138);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
}
}
void IgorEngine::PART_07_EXIT_TO_OUTSIDE() {
- int frame = 1; // cseg197:0889
- for (int step = 9; step >= 0; --step) { // cseg197:088E-0923
+ int frame = 1;
+ for (int step = 9; step >= 0; --step) {
if (step == 9)
- frame = 0; // cseg197:08AB-08B2
+ frame = 0;
PART_07_DRAW_SCALED_IGOR(step, kFacingPositionFront, frame, 3);
- frame = frame == 6 ? 1 : frame + 1; // cseg197:08BD-08CB
- waitForTimer(15); // cseg197:0910-091A
+ frame = frame == 6 ? 1 : frame + 1;
+ waitForTimer(15);
}
- _currentPart = 101; // cseg197:0926
+ _currentPart = 101;
}
void IgorEngine::PART_07_EXEC_ACTION(int action) {
- switch (action) { // cseg197:095E-0B01
- case 101:
- ADD_DIALOGUE_TEXT(201, 1, 140); // cseg197:03F0-03FC
+ switch (action) {
+ case 101: // Look at dean's plaque
+ ADD_DIALOGUE_TEXT(201, 1, 140);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 102:
- ADD_DIALOGUE_TEXT(202, 2, 141); // cseg197:041D-0429
+ case 102: // Look at dean's door
+ ADD_DIALOGUE_TEXT(202, 2, 141);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
case 103:
- PART_07_ANIMATE_DOOR(1, true); // cseg197:09AC-09CA
+ PART_07_ANIMATE_DOOR(1, true);
break;
case 104:
- PART_07_ANIMATE_DOOR(1, false); // cseg197:09CE-09EC
+ PART_07_ANIMATE_DOOR(1, false);
break;
case 105:
- PART_07_ANIMATE_DOOR(2, true); // cseg197:09F0-0A0E
+ PART_07_ANIMATE_DOOR(2, true);
break;
case 106:
- PART_07_ANIMATE_DOOR(2, false); // cseg197:0A12-0A30
+ PART_07_ANIMATE_DOOR(2, false);
break;
- case 107:
- ADD_DIALOGUE_TEXT(204, 1, 142); // cseg197:044A-0456
+ case 107: // Secretary's plaque
+ ADD_DIALOGUE_TEXT(204, 1, 142);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 108:
- // The active fork's wrapper is inclusive; 2 therefore reproduces the
- // original random(3), whose result is 0..2 (cseg230:1558).
- switch (getRandomNumber(2)) { // cseg197:047B-048B
+ case 108: // Look at messageboard
+ switch (getRandomNumber(2)) {
case 0:
- ADD_DIALOGUE_TEXT(205, 1, 143); // cseg197:048D-0499
- ADD_DIALOGUE_TEXT(206, 2, 144); // cseg197:049F-04AB
- ADD_DIALOGUE_TEXT(208, 4, 145); // cseg197:04B1-04BD
- SET_DIALOGUE_TEXT(1, 3); // cseg197:04C3-04C8
+ ADD_DIALOGUE_TEXT(205, 1, 143);
+ ADD_DIALOGUE_TEXT(206, 2, 144);
+ ADD_DIALOGUE_TEXT(208, 4, 145);
+ SET_DIALOGUE_TEXT(1, 3);
break;
case 1:
- ADD_DIALOGUE_TEXT(213, 2, 147); // cseg197:04D9-04E5
- SET_DIALOGUE_TEXT(1, 1); // cseg197:04EB-04F0
+ ADD_DIALOGUE_TEXT(213, 2, 147);
+ SET_DIALOGUE_TEXT(1, 1);
break;
case 2:
- ADD_DIALOGUE_TEXT(215, 1, 148); // cseg197:0500-050C
- ADD_DIALOGUE_TEXT(216, 1, 149); // cseg197:0512-051E
- ADD_DIALOGUE_TEXT(217, 1, 150); // cseg197:0524-0530
- ADD_DIALOGUE_TEXT(218, 1, 151); // cseg197:0536-0542
- ADD_DIALOGUE_TEXT(219, 1, 152); // cseg197:0548-0554
- SET_DIALOGUE_TEXT(1, 5); // cseg197:055A-055F
+ ADD_DIALOGUE_TEXT(215, 1, 148);
+ ADD_DIALOGUE_TEXT(216, 1, 149);
+ ADD_DIALOGUE_TEXT(217, 1, 150);
+ ADD_DIALOGUE_TEXT(218, 1, 151);
+ ADD_DIALOGUE_TEXT(219, 1, 152);
+ SET_DIALOGUE_TEXT(1, 5);
break;
}
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 109:
- ADD_DIALOGUE_TEXT(212, 1, 146); // cseg197:0575-0581
+ case 109: // Look at stairs
+ ADD_DIALOGUE_TEXT(212, 1, 146);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
case 110:
- PART_07_EXIT_TO_OUTSIDE(); // cseg197:0A9A-0AB8
+ PART_07_EXIT_TO_OUTSIDE();
break;
- case 111:
- if (_objectsState[52] != 0) { // cseg197:05A2-05A9; s3:0x856
- for (int area = 11; area <= 13; ++area)
- _roomObjectAreasTable[area].area = 3; // cseg197:05AC-05CE
- --_walkDataLastIndex; // cseg197:05D0
- buildWalkPath(77, 114, 46, 111); // cseg197:05D4-05DC
- _walkDataCurrentIndex = 1; // cseg197:05E1
- _gameState.igorMoving = true; // cseg197:05E6
- waitForIgorMove(); // cseg197:05EB-066B
- _currentPart = 80; // cseg197:066D
+ case 111: // Go through dean's door
+ if (_objectsState[52] != 0) {
+ for (int area = 11; area <= 13; ++area) {
+ _roomObjectAreasTable[area].area = 3;
+ }
+ --_walkDataLastIndex;
+ buildWalkPath(77, 114, 46, 111);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _currentPart = 80;
}
break;
- case 112:
- if (_objectsState[53] != 0) { // cseg197:067F-0686; s3:0x857
- WalkData &wd = _walkData[0]; // cseg197:06CA; s3:0xD94A = 0
- wd.setPos(156, 113, kFacingPositionBack, 1); // cseg197:0688-0699
- wd.setDefaultScale(); // cseg197:069E-06C5
- wd.dxPos = 4; // cseg197:06B4-06BA
- wd.yPosChanged = 0; // cseg197:06BA
- wd.dyPos = 3; // cseg197:06BF
- _walkDataCurrentIndex = 0; // cseg197:06CA
- moveIgor(kFacingPositionBack, 1); // cseg197:06CF-06D3
- _currentPart = 90; // cseg197:06D8
+ case 112: // Go through secretary's door
+ if (_objectsState[53] != 0) {
+ WalkData &wd = _walkData[0];
+ wd.setPos(156, 113, kFacingPositionBack, 1);
+ wd.setDefaultScale();
+ wd.dxPos = 4;
+ wd.yPosChanged = 0;
+ wd.dyPos = 3;
+ _walkDataCurrentIndex = 0;
+ moveIgor(kFacingPositionBack, 1);
+ _currentPart = 90;
}
break;
default:
@@ -227,45 +222,48 @@ void IgorEngine::PART_07_EXEC_ACTION(int action) {
}
void IgorEngine::PART_07() {
- _gameState.enableLight = 1; // cseg197:290F
- loadActionData(DAT_AdministrationCorridor); // cseg197:2920-2943
+ _gameState.enableLight = 1;
+ loadActionData(DAT_AdministrationCorridor);
loadRoomData(PAL_AdministrationCorridor, IMG_AdministrationCorridor,
- BOX_AdministrationCorridor, MSK_AdministrationCorridor, TXT_AdministrationCorridor); // cseg199:0002-06A0
- static const int anim[] = { ANM_AdministrationCorridor, 0 }; // cseg198:0002-00D5
+ BOX_AdministrationCorridor, MSK_AdministrationCorridor,
+ TXT_AdministrationCorridor);
+ static const int anim[] = {ANM_AdministrationCorridor, 0};
loadAnimData(anim);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_07_EXEC_ACTION); // cseg197:095E-0B01
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_07_EXEC_ACTION);
_roomDataOffsets = PART_07_ROOM_DATA_OFFSETS;
- setRoomWalkBounds(0, 0, 319, 143); // cseg199 room mask is 320x144
- PART_07_DRAW_DOOR_STATE(255); // cseg197:2957-2959
- memcpy(_screenVGA, _screenLayer1, 46080); // cseg197:295E-2970
- SET_PAL_240_48_1(); // cseg197:29F0-29F4
- SET_PAL_208_96_1(); // cseg197:29F9-29FF
- for (int area = 11; area <= 13; ++area)
- _roomObjectAreasTable[area].area = 0; // cseg197:2A37; sub_197_092E
- _currentAction.verb = kVerbWalk; // cseg197:2A3C-2A4A
+ setRoomWalkBounds(0, 0, 319, 143);
+ PART_07_DRAW_DOOR_STATE(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
+ for (int area = 11; area <= 13; ++area) {
+ _roomObjectAreasTable[area].area = 0;
+ }
+ _currentAction.verb = kVerbWalk;
- if (_currentPart == 71) {
- _walkData[0].setPos(78, 114, kFacingPositionRight, 0); // cseg197:2A56-2A67
- _walkData[0].setDefaultScale(); // cseg197:2A6C-2A91
- _walkDataCurrentIndex = 0; // cseg197:2A96
- moveIgor(kFacingPositionRight, 0); // cseg197:2A9B-2A9F
- } else if (_currentPart == 72) {
- _walkData[0].setPos(153, 116, kFacingPositionFront, 0); // cseg197:2AB5-2AC6
- _walkData[0].setDefaultScale(); // cseg197:2ACB-2AF0
- _walkDataCurrentIndex = 0; // cseg197:2AF5
- moveIgor(kFacingPositionFront, 0); // cseg197:2AFA-2AFE
+ if (_currentPart == 71) { // enter from dean's door
+ _walkData[0].setPos(78, 114, kFacingPositionRight, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataCurrentIndex = 0;
+ moveIgor(kFacingPositionRight, 0);
+ } else if (_currentPart == 72) { // enter from secretary's door
+ _walkData[0].setPos(153, 116, kFacingPositionFront, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataCurrentIndex = 0;
+ moveIgor(kFacingPositionFront, 0);
}
- _walkDataLastIndex = 1; // cseg197:2AA4 and cseg197:2B03
- _walkDataCurrentIndex = 1; // cseg197:2AA9 and cseg197:2B08
- fadeIn(768); // cseg197:2B0D-2B10
- if (_currentPart == 70)
- PART_07_ENTER_FROM_OUTSIDE(); // cseg197:2B15-2B1C
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ fadeIn(768);
+ if (_currentPart == 70) { // enter from outside
+ PART_07_ENTER_FROM_OUTSIDE();
+ }
enterPartLoop();
- while (_currentPart >= 70 && _currentPart <= 72) // cseg197:2B4C-2B55
+ while (_currentPart >= 70 && _currentPart <= 72)
runPartLoop();
leavePartLoop();
- fadeOut(624); // cseg197:371E-3721
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index f1418d21466..a4079744762 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -141,9 +141,9 @@ void IgorEngine::PART_MAIN() {
case 61: // arrive from intro
PART_06(); // SpringRock
break;
- case 70:
- case 71:
- case 72:
+ case 70: // enter from outside the administration corridor
+ case 71: // enter from deans door
+ case 72: // enter from secretary
PART_07(); // Administration corridor; cseg197:28D4
break;
case 100: // enter from map
Commit: 13163bc9638866c5553ce5812c6312c95cca781c
https://github.com/scummvm/scummvm/commit/13163bc9638866c5553ce5812c6312c95cca781c
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:58+01:00
Commit Message:
IGOR: Retouch parts 10 and 11
Changed paths:
engines/igor/igor.h
engines/igor/part_10.cpp
engines/igor/part_11.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index d9988e0411a..8a7f8bcf5af 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -506,7 +506,7 @@ private:
void PART_10();
void PART_10_EXEC_ACTION(int action);
void PART_10_ACTION_104_pickHamburger();
- void PART_10_ACTION_108();
+ void PART_10_ACTION_108_scrollLeft();
void PART_10_11_DRAW_OBJECT_STATE(int num);
// Decanato left
@@ -514,7 +514,7 @@ private:
void PART_11_EXEC_ACTION(int action);
void PART_11_ACTION_105();
void PART_11_ACTION_107();
- void PART_11_ACTION_108();
+ void PART_11_ACTION_108_scrollRight();
void PART_11_ACTION_112();
void PART_11_APPLY_OBJECT_STATE(int num);
diff --git a/engines/igor/part_10.cpp b/engines/igor/part_10.cpp
index 34d481c30c5..5e3e7934f85 100644
--- a/engines/igor/part_10.cpp
+++ b/engines/igor/part_10.cpp
@@ -15,45 +15,41 @@
namespace Igor {
-// // Ground truth: code/175_2767.asm, cseg175:0002-3595, cseg177:0002 and cseg134:21AF.
-// namespace {
const uint32 kPart10PanelLeft = 0x0000;
-
-
void IgorEngine::PART_10_11_DRAW_OBJECT_STATE(int num) {
// These three original blitters are byte-for-byte duplicates in the two
- // halves of the room: cseg175:0002-00F1 and cseg176:0002-00F1.
+ // halves of the room
+
if ((num == 2 || num == 255) && _objectsState[67] == 1) {
for (int y = 0; y <= 7; ++y)
memcpy(_screenLayer1 + 0x7DA1 + y * 320,
- _animFramesBuffer + 0xC786 + y * 37, 37); // cseg175/cseg176:0002-0051
+ _animFramesBuffer + 0xC786 + y * 37, 37);
}
if (num == 3 || num == 255) {
if (_objectsState[68] == 1) {
for (int y = 0; y <= 14; ++y)
memcpy(_screenLayer1 + 0x4E32 + y * 320,
- _animFramesBuffer + 0xC5E2 + y * 14, 14); // cseg175/cseg176:0052-00A1
+ _animFramesBuffer + 0xC5E2 + y * 14, 14);
} else if (_objectsState[68] == 2) {
for (int y = 0; y <= 14; ++y)
memcpy(_screenLayer1 + 0x4E32 + y * 320,
- _animFramesBuffer + 0xC6B4 + y * 14, 14); // cseg175/cseg176:00A2-00F1
+ _animFramesBuffer + 0xC6B4 + y * 14, 14);
}
}
}
void IgorEngine::PART_10_EXEC_ACTION(int action) {
- // The action table order differs from the function listing order.
switch (action) {
- case 101:
+ case 101: // look at plaque
ADD_DIALOGUE_TEXT(201, 1, 626);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 102:
+ case 102: //enter door
_roomObjectAreasTable[7].deltaLum = 3;
for (int area = 11; area <= 12; ++area)
_roomObjectAreasTable[area].area = 3;
@@ -65,13 +61,13 @@ void IgorEngine::PART_10_EXEC_ACTION(int action) {
waitForIgorMove();
_currentPart = 70;
break;
- case 103:
+ case 103: //look at door
ADD_DIALOGUE_TEXT(202, 1, 627);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 104:
+ case 104: // pick burger
PART_10_ACTION_104_pickHamburger();
break;
case 105:
@@ -80,22 +76,22 @@ void IgorEngine::PART_10_EXEC_ACTION(int action) {
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 106:
+ case 106: // walk at zebra crossing
ADD_DIALOGUE_TEXT(208, 1, 632);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 107:
+ case 107: // look at zebra crossing
ADD_DIALOGUE_TEXT(207, 1, 631);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
case 108:
- PART_10_ACTION_108();
+ PART_10_ACTION_108_scrollLeft();
break;
- case 109:
+ case 109: // back to map
_currentPart = 40;
break;
default:
@@ -105,7 +101,7 @@ void IgorEngine::PART_10_EXEC_ACTION(int action) {
}
void IgorEngine::PART_10_ACTION_104_pickHamburger() {
- if (_objectsState[64] == 1) {
+ if (_objectsState[64] == 1) { // already picked hamburger
ADD_DIALOGUE_TEXT(205, 1, 629);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -132,7 +128,7 @@ void IgorEngine::PART_10_ACTION_104_pickHamburger() {
_objectsState[64] = 1;
}
-void IgorEngine::PART_10_ACTION_108() {
+void IgorEngine::PART_10_ACTION_108_scrollLeft() {
uint8 *walkTable = loadData(WLK_DecanatoLeft);
int xPos = 329;
int yPos = 0;
@@ -239,12 +235,10 @@ void IgorEngine::PART_10() {
_gameState.igorMoving = true;
waitForIgorMove();
}
- // State 102 deliberately performs no entry redraw: the completed pan has
- // already drawn Igor and stored his state in walk record 0.
-
_roomObjectAreasTable[7].deltaLum = 0;
- for (int area = 11; area <= 12; ++area)
+ for (int area = 11; area <= 12; ++area) {
_roomObjectAreasTable[area].area = 0;
+ }
enterPartLoop();
while (_currentPart >= 100 && _currentPart <= 102) {
diff --git a/engines/igor/part_11.cpp b/engines/igor/part_11.cpp
index d0825f6ceb5..175ac758e02 100644
--- a/engines/igor/part_11.cpp
+++ b/engines/igor/part_11.cpp
@@ -15,13 +15,8 @@
namespace Igor {
-// Ground truth: code/176_2813.asm, cseg176:00F2-29E6 and cseg177:0002.
-// namespace {
-
const uint32 kPart11PanelRight = 0x0000;
-
-
void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
PART_10_11_DRAW_OBJECT_STATE(num);
@@ -76,7 +71,7 @@ void IgorEngine::PART_11_ACTION_107() {
PART_11_APPLY_OBJECT_STATE(255);
}
-void IgorEngine::PART_11_ACTION_108() {
+void IgorEngine::PART_11_ACTION_108_scrollRight() {
uint8 *walkTable = loadData(WLK_DecanatoRight);
int xPos = 310;
int yPos = 0;
@@ -130,7 +125,7 @@ void IgorEngine::PART_11_ACTION_112() {
void IgorEngine::PART_11_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // look at window
ADD_DIALOGUE_TEXT(201, 2, 616);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
@@ -142,13 +137,13 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 103:
+ case 103: // look at pipe
ADD_DIALOGUE_TEXT(_objectsState[66] == 0 ? 203 : 204, 1, _objectsState[66] == 0 ? 617 : 618);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 104:
+ case 104: // look at snail
ADD_DIALOGUE_TEXT(205, 1, 619);
ADD_DIALOGUE_TEXT(206, 1, 620);
SET_DIALOGUE_TEXT(1, 2);
@@ -168,21 +163,21 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
PART_11_ACTION_107();
break;
case 108:
- PART_11_ACTION_108();
+ PART_11_ACTION_108_scrollRight();
break;
- case 109:
+ case 109: // Look at hole
ADD_DIALOGUE_TEXT(207, 1, 621);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 110:
+ case 110: // Look at butterfly net
ADD_DIALOGUE_TEXT(_objectsState[68] == 1 ? 208 : 209, 1, _objectsState[68] == 1 ? 622 : 623);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 111:
+ case 111: // look at glass shards
ADD_DIALOGUE_TEXT(210, 1, 624);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
Commit: 3f9e6d72beeac158806f43ce037857efd2871314
https://github.com/scummvm/scummvm/commit/3f9e6d72beeac158806f43ce037857efd2871314
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:58+01:00
Commit Message:
IGOR: add debug functions for room change and inventory addition
Changed paths:
engines/igor/console.cpp
engines/igor/console.h
engines/igor/igor.cpp
engines/igor/igor.h
diff --git a/engines/igor/console.cpp b/engines/igor/console.cpp
index 746fa8cd935..57dec4b3be5 100644
--- a/engines/igor/console.cpp
+++ b/engines/igor/console.cpp
@@ -29,6 +29,8 @@ Console::Console() : GUI::Debugger() {
registerCmd("paint_walk", WRAP_METHOD(Console, Cmd_paintWalk));
registerCmd("paint_hotspots", WRAP_METHOD(Console, Cmd_paintHotspots));
registerCmd("paint_off", WRAP_METHOD(Console, Cmd_paintOff));
+ registerCmd("changePart", WRAP_METHOD(Console, Cmd_changePart));
+ registerCmd("addObjectToInventory", WRAP_METHOD(Console, Cmd_addObjectToInventory));
}
Console::~Console() {
@@ -69,4 +71,37 @@ bool Console::Cmd_paintOff(int argc, const char **argv) {
return true;
}
+bool Console::Cmd_changePart(int argc, const char **argv) {
+ if (argc != 2) {
+ debugPrintf("Usage: %s <state code>\n", argv[0]);
+ return true;
+ }
+
+ const int state = atoi(argv[1]);
+ if (state <= 0 || state > 999) {
+ debugPrintf("Invalid state code '%s'\n", argv[1]);
+ return true;
+ }
+
+ g_engine->debugChangePart(state);
+ debugPrintf("Changing to part state %d\n", state);
+ return false;
+}
+
+bool Console::Cmd_addObjectToInventory(int argc, const char **argv) {
+ if (argc != 2) {
+ debugPrintf("Usage: %s <object ID>\n", argv[0]);
+ return true;
+ }
+
+ const int object = atoi(argv[1]);
+ if (!g_engine->debugAddObjectToInventory(object)) {
+ debugPrintf("Cannot add object %d (valid IDs are 1-36, and it must not already be held)\n", object);
+ return true;
+ }
+
+ debugPrintf("Added object %d to the inventory\n", object);
+ return true;
+}
+
} // End of namespace Igor
diff --git a/engines/igor/console.h b/engines/igor/console.h
index 8ec2edf6474..ad21f7e602e 100644
--- a/engines/igor/console.h
+++ b/engines/igor/console.h
@@ -33,6 +33,8 @@ private:
bool Cmd_paintWalk(int argc, const char **argv);
bool Cmd_paintHotspots(int argc, const char **argv);
bool Cmd_paintOff(int argc, const char **argv);
+ bool Cmd_changePart(int argc, const char **argv);
+ bool Cmd_addObjectToInventory(int argc, const char **argv);
public:
Console();
~Console() override;
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 30919899828..86702475ae2 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -466,6 +466,24 @@ void IgorEngine::addObjectToInventory(int object, int index) {
playSound(51, 1);
}
+void IgorEngine::debugChangePart(int state) {
+ _currentPart = state;
+}
+
+bool IgorEngine::debugAddObjectToInventory(int object) {
+ if (object < 1 || object > (int)ARRAYSIZE(_inventoryImages)) {
+ return false;
+ }
+
+ const int index = object + ARRAYSIZE(_inventoryImages) - 1;
+ if (_inventoryInfo[index] != 0 || _inventoryInfo[73] >= ARRAYSIZE(_inventoryImages)) {
+ return false;
+ }
+
+ addObjectToInventory(object, index);
+ return true;
+}
+
void IgorEngine::removeObjectFromInventory(int index) {
_inventoryInfo[_inventoryInfo[index] - 1] = 0;
_inventoryInfo[index] = 0;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 8a7f8bcf5af..905ff90d1e8 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -724,6 +724,8 @@ public:
void debugPaintWalkAreas();
void debugPaintHotspots();
void debugClearOverlay();
+ void debugChangePart(int state);
+ bool debugAddObjectToInventory(int object);
/**
* Uses a serializer to allow implementing savegame
Commit: 329ba8154a3ea464477536a19843a06deb27548b
https://github.com/scummvm/scummvm/commit/329ba8154a3ea464477536a19843a06deb27548b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:58+01:00
Commit Message:
IGOR: Room 8 and 9
Changed paths:
A engines/igor/part_8.cpp
A engines/igor/part_9.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 86702475ae2..f8648537ef7 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -38,7 +38,10 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_gameDescription(gameDesc), _randomSource("Igor") {
g_engine = this;
- _screenVGA = (uint8 *)malloc(320 * 200);
+ // The original draws the fifth Dean dialogue choice at y=190 into the
+ // 64-KiB mode-13h VGA segment; its 11th font row is outside the visible
+ // 320x200 area but still inside that segment. cseg194:047F-04F1.
+ _screenVGA = (uint8 *)malloc(65536);
for (int i = 0; i < 4; i++) {
_facingIgorFrames[i] = (uint8 *)malloc(13500);
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 905ff90d1e8..0dd1422f728 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -502,6 +502,23 @@ private:
void PART_07_ENTER_FROM_OUTSIDE();
void PART_07_EXIT_TO_OUTSIDE();
+
+ void PART_08();
+ void PART_08_EXEC_ACTION(int action);
+ void PART_08_APPLY_OBJECT_STATE(int num);
+ void PART_08_ANIMATE_DOOR(bool open);
+ void PART_08_ACTION_105();
+ void PART_08_ACTION_103_TALK_TO_DEAN();
+ void PART_08_ACTION_114();
+ void PART_08_HANDLE_DIALOGUE_DEAN();
+ void PART_08_DRAW_DEAN();
+ void PART_08_DRAW_DEAN_DIALOGUE_FRAME(int frame);
+ void PART_08_UPDATE_DIALOGUE_DEAN(int action);
+ void PART_09();
+ void PART_09_EXEC_ACTION(int action);
+ void PART_09_APPLY_OBJECT_STATE(int num);
+ void PART_09_ANIMATE_DOOR(bool open);
+
// Decanato right
void PART_10();
void PART_10_EXEC_ACTION(int action);
@@ -749,6 +766,8 @@ protected:
static const RoomDataOffsets PART_05_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_06_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_07_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_08_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_09_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_10_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_11_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_12_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 7387d43bcc6..fb4215b8e12 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -19,6 +19,8 @@ MODULE_OBJS = \
part_90.o \
part_6.o \
part_7.o \
+ part_8.o \
+ part_9.o \
part_10.o \
part_11.o \
part_12.o \
diff --git a/engines/igor/part_8.cpp b/engines/igor/part_8.cpp
new file mode 100644
index 00000000000..532d63e7664
--- /dev/null
+++ b/engines/igor/part_8.cpp
@@ -0,0 +1,362 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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 3 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
+ if (num == 1 || num == 255) {
+ const uint32 srcOffset = _objectsState[52] == 0 ? 0 : 0x4C8;
+ for (int y = 0; y <= 50; ++y)
+ memcpy(_screenLayer1 + 0x572C + y * 320, _animFramesBuffer + srcOffset + y * 24, 24);
+ _roomActionsTable[150] = _objectsState[52] == 0 ? 6 : 7;
+ }
+ if (num == 2 || num == 255) {
+ // TODO: map the independent s3:0x8AB flag used by cseg189:16EF.
+ uint32 srcOffset;
+ int dstOffset;
+ int rows;
+ int width;
+ if (_objectsState[55] == 0) {
+ srcOffset = 0x208A;
+ dstOffset = 0x6BC3;
+ rows = 26;
+ width = 34;
+ _roomObjectAreasTable[8].object = 0;
+ } else {
+ srcOffset = _objectsState[57] == 0 ? 0x9992 : 0x985C;
+ dstOffset = 0x7FC8;
+ rows = 10;
+ width = 31;
+ _roomObjectAreasTable[8].object = _objectsState[57] == 0 ? 3 : 0;
+ }
+ for (int y = 0; y < rows; ++y) {
+ const uint8 *src = _animFramesBuffer + srcOffset + y * width;
+ memcpy(_screenVGA + dstOffset + y * 320, src, width);
+ memcpy(_screenLayer1 + dstOffset + y * 320, src, width);
+ }
+ _roomActionsTable[146] = 4;
+ }
+}
+
+void IgorEngine::PART_08_ANIMATE_DOOR(bool open) {
+ if ((_objectsState[52] != 0) == open) {
+ const int text = open ? 19 : 23;
+ ADD_DIALOGUE_TEXT(text, 1, text);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ return;
+ }
+
+ const int lastFrame = open ? 2 : 0;
+ const int step = open ? 1 : -1;
+ for (int frame = 1;; frame += step) {
+ for (int y = 0; y <= 52; ++y)
+ memcpy(_screenVGA + 0x5729 + y * 320,
+ _animFramesBuffer + 0x3DA6 + frame * 0x597 + y * 27, 27);
+ if ((open && frame == 2) || (!open && frame == 1))
+ playSound(open ? 13 : 14, 1);
+ if (frame == lastFrame)
+ break;
+ waitForTimer(127);
+ }
+ _objectsState[52] = open ? 1 : 0;
+ PART_08_APPLY_OBJECT_STATE(1);
+}
+
+void IgorEngine::PART_08_DRAW_DEAN() {
+ for (int y = 0; y <= 25; ++y) { // cseg189:08D3-093B
+ const uint8 *src = _animFramesBuffer + 0x23FE + y * 34; // cseg189:08E3-08EE
+ memcpy(_screenVGA + 0x6BC3 + y * 320, src, 34); // cseg189:08D3-0908
+ memcpy(_screenLayer1 + 0x6BC3 + y * 320, src, 34); // cseg189:090D-0931
+ }
+}
+
+void IgorEngine::PART_08_DRAW_DEAN_DIALOGUE_FRAME(int frame) {
+ for (int y = 0; y <= 21; ++y) { // cseg189:093F-09CF
+ const uint8 *src = _animFramesBuffer + 0x4E6B + frame * 0x226 + y * 25; // cseg189:095D-0975
+ memcpy(_screenVGA + 0x6BC6 + y * 320, src, 25); // cseg189:094D-098F
+ memcpy(_screenLayer1 + 0x6BC6 + y * 320, src, 25); // cseg189:0994-09C5
+ }
+}
+
+void IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ case kUpdateDialogueAnimStanding:
+ PART_08_DRAW_DEAN_DIALOGUE_FRAME(0); // cseg194:0B8F-0BAF
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_08_DRAW_DEAN_DIALOGUE_FRAME(getRandomNumber(6)); // cseg194:0C33-0C3B
+ break;
+ }
+}
+
+void IgorEngine::PART_08_ACTION_105() {
+ for (int frame = 0; frame <= 1; ++frame) { // cseg189:062A-0698
+ for (int y = 0; y <= 48; ++y) { // cseg189:0635-067E
+ const uint8 *src = _animFramesBuffer + 0x125E + frame * 0x55C + y * 28; // cseg189:0645-065A
+ memcpy(_screenVGA + 0x66E3 + y * 320, src, 28); // cseg189:0635-0674
+ }
+ if (frame == 0)
+ waitForTimer(127); // cseg189:0680-0691
+ }
+ addObjectToInventory(15, 50); // cseg189:069A-06D4; inventory object 15 is slot 50
+ _objectsState[57] = 1; // cseg189:06DE
+ PART_08_APPLY_OBJECT_STATE(255); // cseg189:06D9-06E5
+}
+
+void IgorEngine::PART_08_HANDLE_DIALOGUE_DEAN() {
+ loadDialogueData(DLG_DeanPepperOffice); // cseg194:0CD4-0CF7
+ _updateDialogue = &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN;
+ handleDialogue(78, 75, 26, 58, 0); // cseg194:0AD5-0AF0
+ _updateDialogue = 0;
+}
+
+void IgorEngine::PART_08_ACTION_103_TALK_TO_DEAN() {
+ if (_objectsState[55] == 1) { // cseg189:128F-12B7
+ ADD_DIALOGUE_TEXT(223, 1, 169); // cseg189:1296-12A2
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ return;
+ }
+
+ if (_objectsState[52] == 1) { // cseg189:12BA-12C4
+ PART_08_DRAW_DEAN(); // cseg189:12C4
+ ADD_DIALOGUE_TEXT(220, 1, 166); // cseg189:12C9-1328
+ ADD_DIALOGUE_TEXT(221, 1, 167); // cseg189:12C9-1328
+ SET_DIALOGUE_TEXT(1, 2); // cseg189:132A-132F
+ _updateDialogue = &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN;
+ startCutsceneDialogue(78, 75, 26, 58, 0); // cseg189:1334-1343
+ waitForEndOfCutsceneDialogue(78, 75, 26, 58, 0); // cseg189:1348-14BA
+ _updateDialogue = 0;
+ return; // cseg189:14BD jumps to the function epilogue at 14D0
+ }
+
+ PART_08_HANDLE_DIALOGUE_DEAN(); // cseg189:14BF
+ PART_08_APPLY_OBJECT_STATE(255); // cseg189:14C4-14CB
+}
+
+void IgorEngine::PART_08_ACTION_114() {
+ if (_objectsState[55] == 1) { // cseg189:09E3-0A0B
+ ADD_DIALOGUE_TEXT(227, 1, 172); // cseg189:09EA-09F6
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ return;
+ }
+ if (_objectsState[26] == 1) { // cseg189:0A0E-0A36; s3:0x83C maps to object state 26
+ ADD_DIALOGUE_TEXT(226, 1, 171); // cseg189:0A15-0A21
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ return;
+ }
+
+ PART_08_DRAW_DEAN(); // cseg189:0A39
+ ADD_DIALOGUE_TEXT(210, 2, 158); // cseg189:0A3E-0A4A
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+
+ static const uint8 deanFrames[] = { 1, 2, 3, 0 }; // dseg231:0x01DE,0x01E0,0x01E2,0x01E4
+ static const uint8 igorFrames[] = { 0, 1, 2, 3 }; // dseg231:0x01DF,0x01E1,0x01E3,0x01E5
+ for (int step = 0; step < 4; ++step) { // cseg189:0A64-0B48
+ if (deanFrames[step] != 0) {
+ for (int y = 0; y <= 48; ++y) { // cseg189:0A7D-0AD1
+ const uint8 *src = _animFramesBuffer + 0x5755 + deanFrames[step] * 0x620 + y * 32; // cseg189:0A8D-0AAD
+ memcpy(_screenVGA + 0x6463 + y * 320, src, 32); // cseg189:0A7D-0AC7
+ }
+ }
+ if (igorFrames[step] != 0) {
+ for (int y = 0; y <= 24; ++y) { // cseg189:0AE0-0B33
+ const uint8 *src = _animFramesBuffer + 0x6D7D + igorFrames[step] * 0x258 + y * 24; // cseg189:0AF0-0B0F
+ memcpy(_screenVGA + 0x6D06 + y * 320, src, 24); // cseg189:0AE0-0B29
+ }
+ }
+ waitForTimer(41); // cseg189:0B35-0B3F
+ }
+
+ // The original removes object slot 58 here and plays sound 63 only after
+ // the conversation has completed. cseg189:0B4B-0B7C,0D86-0D95.
+ if (_inventoryInfo[58] != 0) {
+ _inventoryInfo[_inventoryInfo[58] - 1] = 0;
+ _inventoryInfo[58] = 0;
+ packInventory();
+ if (_inventoryInfo[72] > _inventoryInfo[73])
+ _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
+ drawInventory(_inventoryInfo[72], 0);
+ }
+
+ ADD_DIALOGUE_TEXT(216, 1, 162); // cseg189:0B7F-0BDE
+ ADD_DIALOGUE_TEXT(217, 1, 163); // cseg189:0B7F-0BDE
+ ADD_DIALOGUE_TEXT(218, 1, 164); // cseg189:0B7F-0BDE
+ ADD_DIALOGUE_TEXT(219, 1, 165); // cseg189:0B7F-0BDE
+ SET_DIALOGUE_TEXT(1, 4); // cseg189:0BE0-0BE5
+ _updateDialogue = &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN;
+ startCutsceneDialogue(78, 75, 26, 58, 0); // cseg189:0BEA-0BF9
+ waitForEndOfCutsceneDialogue(78, 75, 26, 58, 0); // cseg189:0BFE-0D70
+ _updateDialogue = 0;
+ _objectsState[56] = _objectsState[26] < 2 ? 1 : 2; // cseg189:0D73-0D81
+ drawInventory(_inventoryInfo[72], 0); // cseg189:0D86-0D8C
+ playSound(63, 1); // cseg189:0D91-0D95
+ PART_08_APPLY_OBJECT_STATE(255); // cseg189:0D9A-0DA1
+}
+
+void IgorEngine::PART_08_EXEC_ACTION(int action) {
+ switch (action) {
+ case 101:
+ if (_objectsState[52] == 0) { // cseg189:10D6-10DD,1229
+ _currentPart = 71;
+ break;
+ }
+ if (_objectsState[52] != 0) {
+ for (int area = 10; area <= 11; ++area)
+ _roomObjectAreasTable[area].area = 4;
+ for (int area = 13; area <= 14; ++area)
+ _roomObjectAreasTable[area].area = 4;
+ --_walkDataLastIndex;
+ buildWalkPath(242, 121, 270, 108);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ if (_objectsState[56] != 0) {
+ // TODO: translate cseg189:11C7-1224 before enabling the Dean's post-exit sequence.
+ break;
+ }
+ _currentPart = 71;
+ }
+ break;
+ case 102:
+ ADD_DIALOGUE_TEXT(202, 1, 153);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 104:
+ if (_objectsState[55] == 1)
+ ADD_DIALOGUE_TEXT(222, 1, 168);
+ else
+ ADD_DIALOGUE_TEXT(203, 2, 154);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 106:
+ case 107: // Action 107 maps to sub_189_0E2C. cseg189:1586-15A4
+ ADD_DIALOGUE_TEXT(205, 2, 155);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 110:
+ ADD_DIALOGUE_TEXT(207, 2, 156);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 111:
+ ADD_DIALOGUE_TEXT(209, 1, 157);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 105:
+ PART_08_ACTION_105();
+ break;
+ case 103:
+ PART_08_ACTION_103_TALK_TO_DEAN();
+ break;
+ case 108:
+ if (_objectsState[55] == 0) { // cseg189:0704-072C
+ ADD_DIALOGUE_TEXT(212, 1, 159); // cseg189:070B-0717
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ } else if (_objectsState[58] == 1) { // cseg189:072F-0757; s3:0x85C maps to object state 58
+ ADD_DIALOGUE_TEXT(224, 2, 170); // cseg189:0736-0742
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ } else {
+ // TODO: translate cseg189:075A-08BE (secretary-room transition sequence).
+ }
+ break;
+ case 109:
+ if (_objectsState[55] == 0) { // cseg189:0406-042E
+ ADD_DIALOGUE_TEXT(213, 2, 160); // cseg189:040D-0419
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ } else if (_objectsState[54] == 1) { // cseg189:0431-0459; s3:0x858 maps to object state 54
+ ADD_DIALOGUE_TEXT(215, 1, 161); // cseg189:0438-0444
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ } else {
+ // TODO: translate cseg189:045C-0615 (palette-aware pickup animation).
+ }
+ break;
+ case 114:
+ PART_08_ACTION_114();
+ break;
+ case 112:
+ PART_08_ANIMATE_DOOR(true);
+ break;
+ case 113:
+ PART_08_ANIMATE_DOOR(false);
+ break;
+ default:
+ warning("PART_08_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::PART_08() {
+ _gameState.enableLight = 1;
+ loadActionData(DAT_DeanPepperOffice); // static resource: cseg189:34D7-34FA
+ loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice,
+ BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice); // static resources: cseg195/cseg196
+ static const int anim[] = {
+ FRM_DeanPepperOffice1, FRM_DeanPepperOffice2,
+ FRM_DeanPepperOffice3, FRM_DeanPepperOffice4,
+ FRM_DeanPepperOffice5, FRM_DeanPepperOffice6,
+ FRM_DeanPepperOffice7, FRM_DeanPepperOffice8,
+ FRM_DeanPepperOffice9, FRM_DeanPepperOffice10,
+ FRM_DeanPepperOffice11, FRM_DeanPepperOffice12,
+ FRM_DeanPepperOffice13, FRM_DeanPepperOffice14,
+ FRM_DeanPepperOffice15, FRM_DeanPepperOffice16, 0
+ }; // static resources: cseg195:0002-0337
+ loadAnimData(anim);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_08_EXEC_ACTION);
+ _roomDataOffsets = PART_08_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143);
+ PART_08_APPLY_OBJECT_STATE(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
+ _currentAction.verb = kVerbWalk;
+ _walkData[0].setPos(241, 121, kFacingPositionLeft, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataCurrentIndex = 0;
+ moveIgor(kFacingPositionLeft, 0);
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ fadeIn(768);
+
+ enterPartLoop();
+ while (_currentPart == 80)
+ runPartLoop();
+ leavePartLoop();
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_9.cpp b/engines/igor/part_9.cpp
new file mode 100644
index 00000000000..3ddbeae5ea3
--- /dev/null
+++ b/engines/igor/part_9.cpp
@@ -0,0 +1,155 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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 3 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+void IgorEngine::PART_09_APPLY_OBJECT_STATE(int num) {
+ if (num == 1 || num == 255) {
+ const uint32 srcOffset = _objectsState[53] == 0 ? 0x5D0B : 0x61A3;
+ for (int y = 0; y <= 48; ++y)
+ memcpy(_screenLayer1 + 0x46C2 + y * 320, _animFramesBuffer + srcOffset + y * 24, 24);
+ _roomActionsTable[150] = _objectsState[53] == 0 ? 6 : 7;
+ }
+ if (num == 2 || num == 255) {
+ const uint32 srcOffset = _objectsState[60] == 0 ? 0x663B : 0x6A23;
+ for (int y = 0; y <= 49; ++y)
+ memcpy(_screenLayer1 + 0x48E6 + y * 320, _animFramesBuffer + srcOffset + y * 20, 20);
+ _roomObjectAreasTable[4].object = (_objectsState[60] == 0 || _objectsState[62] != 0) ? 3 : 5;
+ }
+}
+
+void IgorEngine::PART_09_ANIMATE_DOOR(bool open) {
+ if ((_objectsState[53] != 0) == open) {
+ const int text = open ? 19 : 23;
+ ADD_DIALOGUE_TEXT(text, 1, text);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ return;
+ }
+
+ static const uint8 openFrames[] = { 3, 0 }; // static frame selectors: s3:0x202-0x203
+ for (int i = 0; i < 2; ++i) {
+ const int frame = open ? openFrames[i] : i + 1;
+ for (int y = 0; y <= 52; ++y)
+ memcpy(_screenVGA + 0x46C2 + y * 320,
+ _animFramesBuffer + 0x86EF + frame * 0x52D + y * 25, 25);
+ if (i == 1)
+ playSound(open ? 13 : 14, 1);
+ waitForTimer(127);
+ }
+ _objectsState[53] = open ? 1 : 0;
+ PART_09_APPLY_OBJECT_STATE(1);
+}
+
+void IgorEngine::PART_09_EXEC_ACTION(int action) {
+ switch (action) {
+ case 102:
+ ADD_DIALOGUE_TEXT(201, 2, 234);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 104:
+ ADD_DIALOGUE_TEXT(203, 2, 235);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 108:
+ ADD_DIALOGUE_TEXT(207, 1, 237);
+ ADD_DIALOGUE_TEXT(208, 1, 238);
+ SET_DIALOGUE_TEXT(1, 2);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 109:
+ if (_objectsState[61] == 0)
+ ADD_DIALOGUE_TEXT(216, 1, 244);
+ else
+ ADD_DIALOGUE_TEXT(224, 1, 252);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 111:
+ ADD_DIALOGUE_TEXT(211, 1, 240);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ case 115:
+ if (_objectsState[53] != 0) {
+ _walkData[0].setPos(207, 106, kFacingPositionBack, 1);
+ _walkData[0].setDefaultScale();
+ _walkDataCurrentIndex = 0;
+ moveIgor(kFacingPositionBack, 1);
+ _currentPart = 72;
+ }
+ break;
+ case 112:
+ PART_09_ANIMATE_DOOR(true);
+ break;
+ case 113:
+ PART_09_ANIMATE_DOOR(false);
+ break;
+ case 101:
+ case 103:
+ case 105:
+ case 106:
+ case 107:
+ case 110:
+ case 114:
+ // TODO: translate the corresponding cseg190 action routine exactly.
+ break;
+ default:
+ warning("PART_09_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::PART_09() {
+ _gameState.enableLight = 1;
+ loadActionData(DAT_AdministrationSecretaryRoom); // static resource: cseg190:2F69-2F8C
+ loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom,
+ BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom,
+ TXT_AdministrationSecretaryRoom); // static resources: cseg192/cseg193
+ static const int anim[] = {
+ ANM_AdministrationSecretaryRoom1, ANM_AdministrationSecretaryRoom2,
+ ANM_AdministrationSecretaryRoom3, ANM_AdministrationSecretaryRoom4,
+ ANM_AdministrationSecretaryRoom5, ANM_AdministrationSecretaryRoom6,
+ ANM_AdministrationSecretaryRoom7, ANM_AdministrationSecretaryRoom8,
+ ANM_AdministrationSecretaryRoom9, 0
+ }; // static resources: cseg192:0002-01D4
+ loadAnimData(anim);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_09_EXEC_ACTION);
+ _roomDataOffsets = PART_09_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143);
+ PART_09_APPLY_OBJECT_STATE(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
+ _currentAction.verb = kVerbWalk;
+ _walkData[0].setPos(206, 109, kFacingPositionFront, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataCurrentIndex = 0;
+ moveIgor(kFacingPositionFront, 0);
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ fadeIn(768);
+
+ enterPartLoop();
+ while (_currentPart == 90)
+ runPartLoop();
+ leavePartLoop();
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index a4079744762..b5a7f2c4c40 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -144,8 +144,15 @@ void IgorEngine::PART_MAIN() {
case 70: // enter from outside the administration corridor
case 71: // enter from deans door
case 72: // enter from secretary
- PART_07(); // Administration corridor; cseg197:28D4
+ PART_07(); // Administration corridor
break;
+ case 80:
+ PART_08(); // Dean Pepper office
+ break;
+ case 90:
+ PART_09(); // Administration secretary room
+ break;
+
case 100: // enter from map
case 101:
case 102:
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 2de9082c2ff..0b5682ecb85 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -515,4 +515,18 @@
#define MSK_ParkRight 936 // cseg104:00D7-01A8; IGOR.EXE:0x3EBA9A, 0xF84 bytes
#define BOX_ParkRight 937 // cseg104:009A-00C3; IGOR.EXE:0x3ECA1E, 0x500 bytes
+// Dean Peeper's conversation data block from NE segment 194.
+#define DLG_DeanPepperOffice 938 // cseg194:0CD4-0CF7; IGOR.EXE:0x7256FE, 0x3D86 bytes
+
+// Administration secretary-room animation blocks copied by cseg192:0002-01D4.
+#define ANM_AdministrationSecretaryRoom1 923 // cseg192:01D5; IGOR.EXE:0x7057D5, 0xD38 bytes
+#define ANM_AdministrationSecretaryRoom2 924 // cseg192:0F0D; IGOR.EXE:0x70650D, 0x1FB bytes
+#define ANM_AdministrationSecretaryRoom3 925 // cseg192:1108; IGOR.EXE:0x706708, 0x4DD8 bytes
+#define ANM_AdministrationSecretaryRoom4 926 // cseg192:5EE0; IGOR.EXE:0x70B4E0, 0x930 bytes
+#define ANM_AdministrationSecretaryRoom5 927 // cseg192:6810; IGOR.EXE:0x70BE10, 0x7D0 bytes
+#define ANM_AdministrationSecretaryRoom6 928 // cseg192:6FE0; IGOR.EXE:0x70C5E0, 0x18E4 bytes
+#define ANM_AdministrationSecretaryRoom7 929 // cseg192:88C4; IGOR.EXE:0x70DEC4, 0x14B4 bytes
+#define ANM_AdministrationSecretaryRoom8 930 // cseg192:9D78; IGOR.EXE:0x70F378, 0x870 bytes
+#define ANM_AdministrationSecretaryRoom9 931 // cseg192:A5E8; IGOR.EXE:0x70FBE8, 0x399D bytes
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index f645bde2696..82c47cb9719 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -216,6 +216,28 @@ const RoomDataOffsets IgorEngine::PART_07_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 } // cseg197 has no room-specific question/reply matrix
};
+const RoomDataOffsets IgorEngine::PART_08_ROOM_DATA_OFFSETS = {
+ { 80, 4, 12, 3 }, // cseg189:250F-2542; transition table at DAT+80, four areas, strides 12 and 3
+ { 149, 162 },
+ { 167, 385, 3401, 271, 347, 84 },
+ {
+ 165, 30, // cseg194:0002-0151; question text base and count
+ 5188, 100, // cseg194:0154-0269; reply text base and count
+ 90, // cseg194:0DB0-0DBD; dialogue matrix page stride
+ 270, // cseg194:09E1-0A4D
+ 15548, // cseg194:0A78-0A92
+ 15488, // cseg194:043D-0454
+ 30 // cseg194:0002-026D; reply table has 30 sound entries
+ }
+};
+
+const RoomDataOffsets IgorEngine::PART_09_ROOM_DATA_OFFSETS = {
+ { 80, 4, 12, 3 }, // cseg190:1FA1-1FD4; transition table at DAT+80, four areas, strides 12 and 3
+ { 149, 162 },
+ { 167, 385, 3401, 271, 347, 84 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_04_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 },
{ 0, 0 },
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 3f94db5143e..bee8559e495 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -370,7 +370,6 @@ void IgorEngine::waitForEndOfIgorDialogue() {
}
void IgorEngine::animateIgorTalking(int frame) {
- debug("Animating Igor talking with frame: %d", frame);
if (getPart() == 4) {
return;
}
Commit: bc89699db28851f19034430b16e03356ceac4dbb
https://github.com/scummvm/scummvm/commit/bc89699db28851f19034430b16e03356ceac4dbb
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:59+01:00
Commit Message:
IGOR: Adding part 23
Changed paths:
A engines/igor/part_23.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_10.cpp
engines/igor/part_11.cpp
engines/igor/part_12.cpp
engines/igor/part_17.cpp
engines/igor/part_6.cpp
engines/igor/part_7.cpp
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index f8648537ef7..a37a70fffdd 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -66,7 +66,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
// _currentPart = 850;
- _currentPart = 70;
+ _currentPart = 170;
// _currentPart = 62;
// _currentPart = 40;
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 0dd1422f728..142e76265b2 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -486,8 +486,8 @@ private:
void PART_06_UPDATE_DIALOGUE_PHOTOGRAPHER(int action);
void PART_06_HELPER_7_decodePhotographerTalkingFrame(int frame);
void PART_06_ACTION_105();
- void PART_06_ACTION_107();
- void PART_06_ACTION_108();
+ void PART_06_ACTION_107_giveAnythingToPhotographer();
+ void PART_06_ACTION_108_giveRocketToPhotographer();
void PART_06_ACTION_102_scrollLeft();
void PART_06_HELPER_6_setPhotographerState(int num);
void PART_06_HELPER_8_animatePhotographer(int frame);
@@ -497,7 +497,7 @@ private:
void PART_07();
void PART_07_EXEC_ACTION(int action);
void PART_07_DRAW_DOOR_STATE(int num);
- void PART_07_ANIMATE_DOOR(int door, bool open);
+ void PART_07_openCloseDoor(int door, bool open);
void PART_07_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame, int dyPos);
void PART_07_ENTER_FROM_OUTSIDE();
void PART_07_EXIT_TO_OUTSIDE();
@@ -560,7 +560,7 @@ private:
// outside college
void PART_17_EXEC_ACTION(int action);
- void PART_17_ACTION_101();
+ void PART_17_ACTION_101_walkIn();
void PART_17_ACTION_103();
void PART_17_ACTION_105();
void PART_17_ACTION_106();
@@ -580,6 +580,22 @@ private:
void PART_17_HELPER_11(int frame);
void PART_17();
+ // 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();
+
// park
void PART_34();
void PART_34_EXEC_ACTION(int action);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index fb4215b8e12..c7bd2cbbb09 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -25,6 +25,7 @@ MODULE_OBJS = \
part_11.o \
part_12.o \
part_17.o \
+ part_23.o \
part_34.o \
part_35.o \
text.o \
diff --git a/engines/igor/part_10.cpp b/engines/igor/part_10.cpp
index 5e3e7934f85..b0f24c013f8 100644
--- a/engines/igor/part_10.cpp
+++ b/engines/igor/part_10.cpp
@@ -8,6 +8,15 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
+ *
*/
#include "igor/igor.h"
@@ -70,7 +79,7 @@ void IgorEngine::PART_10_EXEC_ACTION(int action) {
case 104: // pick burger
PART_10_ACTION_104_pickHamburger();
break;
- case 105:
+ case 105: // use anything with paperbin
ADD_DIALOGUE_TEXT(206, 1, 630);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
diff --git a/engines/igor/part_11.cpp b/engines/igor/part_11.cpp
index 175ac758e02..8e0ef76ddf1 100644
--- a/engines/igor/part_11.cpp
+++ b/engines/igor/part_11.cpp
@@ -8,6 +8,15 @@
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 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, see <http://www.gnu.org/licenses/>.
+ *
*/
#include "igor/igor.h"
diff --git a/engines/igor/part_12.cpp b/engines/igor/part_12.cpp
index c9709c70489..ce70cbd64c6 100644
--- a/engines/igor/part_12.cpp
+++ b/engines/igor/part_12.cpp
@@ -33,15 +33,15 @@ void IgorEngine::PART_12_EXEC_ACTION(int action) {
PART_12_ACTION_101();
break;
case 102:
- ADD_DIALOGUE_TEXT(201, 1, 789); // cseg171:003C-0058
+ ADD_DIALOGUE_TEXT(201, 1, 789);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 103:
if (_objectsState[44] == 0) {
- ADD_DIALOGUE_TEXT(203, 2, 790); // cseg171:0070-0082
+ ADD_DIALOGUE_TEXT(203, 2, 790);
} else {
- ADD_DIALOGUE_TEXT(205, 1, 791); // cseg171:0084-00A0
+ ADD_DIALOGUE_TEXT(205, 1, 791);
}
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -53,12 +53,12 @@ void IgorEngine::PART_12_EXEC_ACTION(int action) {
PART_12_ACTION_105();
break;
case 106:
- ADD_DIALOGUE_TEXT(207, 2, 793); // cseg171:00B1-00CD
+ ADD_DIALOGUE_TEXT(207, 2, 793);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 107:
- ADD_DIALOGUE_TEXT(206, 1, 792); // cseg171:00DE-00FA
+ ADD_DIALOGUE_TEXT(206, 1, 792);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -395,9 +395,10 @@ void IgorEngine::PART_12_HELPER_4() {
waitForTimer(30);
}
}
- ADD_DIALOGUE_TEXT(212, 2, 796); // cseg171:120C-1218
- ADD_DIALOGUE_TEXT(214, 1, 797); // cseg171:121E-122A
- ADD_DIALOGUE_TEXT(215, 1, 798); // cseg171:1230-123C
+ ADD_DIALOGUE_TEXT(212, 2, 796);
+ ADD_DIALOGUE_TEXT(213, 2, 796);
+ ADD_DIALOGUE_TEXT(214, 1, 797);
+ ADD_DIALOGUE_TEXT(215, 1, 798);
SET_DIALOGUE_TEXT(1, 3);
_updateDialogue = &IgorEngine::PART_12_UPDATE_DIALOGUE_CHURCHMAN;
startCutsceneDialogue(95, 55, 51, 28, 63);
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index 73b9d848d34..642ee71a141 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -27,26 +27,26 @@ 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();
+ case 101: // walk to door
+ PART_17_ACTION_101_walkIn();
break;
- case 102:
- ADD_DIALOGUE_TEXT(225, 1, 648); // cseg141:09EC-09F8
+ case 102: // look at door
+ ADD_DIALOGUE_TEXT(225, 1, 648);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 103:
PART_17_ACTION_103();
break;
- case 104:
- ADD_DIALOGUE_TEXT(220, 3, 646); // cseg141:0A19-0A25
+ case 104: // look at file
+ ADD_DIALOGUE_TEXT(220, 3, 646);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 105:
PART_17_ACTION_105();
break;
- case 106:
+ case 106: // exchange files
PART_17_ACTION_106();
break;
default:
@@ -55,7 +55,7 @@ void IgorEngine::PART_17_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_17_ACTION_101() {
+void IgorEngine::PART_17_ACTION_101_walkIn() {
_roomObjectAreasTable[_screenLayer2[22034]].area = 8;
_roomObjectAreasTable[_screenLayer2[23923]].area = 8;
--_walkDataLastIndex;
@@ -85,15 +85,15 @@ void IgorEngine::PART_17_ACTION_103() {
waitForEndOfCutsceneDialogue(156, 32, 35, 38, 47);
_updateDialogue = 0;
if (_gameState.counter[4] == 1) {
- ADD_DIALOGUE_TEXT(203, 1, 634); // cseg141:085E-086A
- ADD_DIALOGUE_TEXT(204, 2, 635); // cseg141:0870-087C
+ ADD_DIALOGUE_TEXT(203, 1, 634);
+ ADD_DIALOGUE_TEXT(204, 2, 635);
SET_DIALOGUE_TEXT(1, 2);
} else if (_gameState.counter[4] == 2) {
- ADD_DIALOGUE_TEXT(208, 2, 637); // cseg141:088E-089A
+ ADD_DIALOGUE_TEXT(208, 2, 637);
SET_DIALOGUE_TEXT(1, 1);
} else if (_gameState.counter[4] == 3) {
- ADD_DIALOGUE_TEXT(212, 2, 639); // cseg141:08AC-08B8
- ADD_DIALOGUE_TEXT(214, 1, 640); // cseg141:08BE-08CA
+ ADD_DIALOGUE_TEXT(212, 2, 639);
+ ADD_DIALOGUE_TEXT(214, 1, 640);
SET_DIALOGUE_TEXT(1, 2);
}
startCutsceneDialogue(135, 33, 63, 63, 0);
@@ -507,6 +507,7 @@ void IgorEngine::PART_17() {
if (_objectsState[54] == 0) {
_objectsState[54] = 1;
}
+ debug("Current part: %d", _currentPart);
fadeOut(624);
}
diff --git a/engines/igor/part_23.cpp b/engines/igor/part_23.cpp
new file mode 100644
index 00000000000..948590b2054
--- /dev/null
+++ b/engines/igor/part_23.cpp
@@ -0,0 +1,285 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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;
+ fadeIn(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();
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 51341d50f72..f1b6a1c4ab9 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -81,7 +81,7 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
case 103:
PART_06_ACTION_103_talkToPhotographer();
break;
- case 104:
+ case 104: // look at photographer
ADD_DIALOGUE_TEXT(203, 1, 481);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -89,16 +89,16 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
case 105:
PART_06_ACTION_105();
break;
- case 106:
+ case 106: // Look at camera
ADD_DIALOGUE_TEXT(204, 1, 482);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 107:
- PART_06_ACTION_107();
+ PART_06_ACTION_107_giveAnythingToPhotographer();
break;
case 108:
- PART_06_ACTION_108();
+ PART_06_ACTION_108_giveRocketToPhotographer();
break;
default:
error("PART_06_EXEC_ACTION unhandled action %d", action);
@@ -195,7 +195,7 @@ void IgorEngine::PART_06_ACTION_105() {
PART_06_HELPER_6_setPhotographerState(255);
}
-void IgorEngine::PART_06_ACTION_107() {
+void IgorEngine::PART_06_ACTION_107_giveAnythingToPhotographer() {
PART_06_HELPER_8_animatePhotographer(0);
ADD_DIALOGUE_TEXT(205, 1, 483);
SET_DIALOGUE_TEXT(1, 1);
@@ -207,7 +207,7 @@ void IgorEngine::PART_06_ACTION_107() {
waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63);
}
-void IgorEngine::PART_06_ACTION_108() {
+void IgorEngine::PART_06_ACTION_108_giveRocketToPhotographer() {
PART_06_HELPER_8_animatePhotographer(0);
ADD_DIALOGUE_TEXT(208, 2, 485);
ADD_DIALOGUE_TEXT(210, 2, 486);
diff --git a/engines/igor/part_7.cpp b/engines/igor/part_7.cpp
index 5229d6566b9..627f40783a8 100644
--- a/engines/igor/part_7.cpp
+++ b/engines/igor/part_7.cpp
@@ -31,7 +31,7 @@ void IgorEngine::PART_07_DRAW_DOOR_STATE(int num) {
}
}
-void IgorEngine::PART_07_ANIMATE_DOOR(int door, bool open) {
+void IgorEngine::PART_07_openCloseDoor(int door, bool open) {
const int stateIndex = door == 1 ? 52 : 53;
if ((_objectsState[stateIndex] != 0) == open) {
const int text = open ? 19 : 23;
@@ -139,16 +139,16 @@ void IgorEngine::PART_07_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 103:
- PART_07_ANIMATE_DOOR(1, true);
+ PART_07_openCloseDoor(1, true);
break;
case 104:
- PART_07_ANIMATE_DOOR(1, false);
+ PART_07_openCloseDoor(1, false);
break;
case 105:
- PART_07_ANIMATE_DOOR(2, true);
+ PART_07_openCloseDoor(2, true);
break;
case 106:
- PART_07_ANIMATE_DOOR(2, false);
+ PART_07_openCloseDoor(2, false);
break;
case 107: // Secretary's plaque
ADD_DIALOGUE_TEXT(204, 1, 142);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index b5a7f2c4c40..f3d4d669360 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -170,6 +170,11 @@ void IgorEngine::PART_MAIN() {
case 171:
PART_17();
break;
+ case 230:
+ case 231:
+ case 232:
+ PART_23();
+ break;
case 340:
PART_34(); // Park, left panel; cseg101:1F85
break;
Commit: 2b811411939972e111d8bcdaf43378afe1b7bb8a
https://github.com/scummvm/scummvm/commit/2b811411939972e111d8bcdaf43378afe1b7bb8a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:59+01:00
Commit Message:
IGOR: Complete part 8
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/part_8.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index a37a70fffdd..95e99873ce0 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -40,7 +40,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
// The original draws the fifth Dean dialogue choice at y=190 into the
// 64-KiB mode-13h VGA segment; its 11th font row is outside the visible
- // 320x200 area but still inside that segment. cseg194:047F-04F1.
+ // 320x200 area but still inside that segment.
_screenVGA = (uint8 *)malloc(65536);
for (int i = 0; i < 4; i++) {
_facingIgorFrames[i] = (uint8 *)malloc(13500);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 142e76265b2..3220ae0e276 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -508,12 +508,18 @@ private:
void PART_08_APPLY_OBJECT_STATE(int num);
void PART_08_ANIMATE_DOOR(bool open);
void PART_08_ACTION_105();
+ void PART_08_ACTION_108();
+ void PART_08_ACTION_109();
void PART_08_ACTION_103_TALK_TO_DEAN();
void PART_08_ACTION_114();
+ void PART_08_DEAN_LEAVES();
+ void PART_08_DEAN_DRINKS();
void PART_08_HANDLE_DIALOGUE_DEAN();
void PART_08_DRAW_DEAN();
void PART_08_DRAW_DEAN_DIALOGUE_FRAME(int frame);
void PART_08_UPDATE_DIALOGUE_DEAN(int action);
+ void PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(int frame);
+ void PART_08_UPDATE_DIALOGUE_SECRETARY(int action);
void PART_09();
void PART_09_EXEC_ACTION(int action);
void PART_09_APPLY_OBJECT_STATE(int num);
diff --git a/engines/igor/part_8.cpp b/engines/igor/part_8.cpp
index 532d63e7664..40addf36b3f 100644
--- a/engines/igor/part_8.cpp
+++ b/engines/igor/part_8.cpp
@@ -18,7 +18,7 @@ void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
_roomActionsTable[150] = _objectsState[52] == 0 ? 6 : 7;
}
if (num == 2 || num == 255) {
- // TODO: map the independent s3:0x8AB flag used by cseg189:16EF.
+ // TODO: map the independent s3:0x8AB flag.
uint32 srcOffset;
int dstOffset;
int rows;
@@ -72,18 +72,18 @@ void IgorEngine::PART_08_ANIMATE_DOOR(bool open) {
}
void IgorEngine::PART_08_DRAW_DEAN() {
- for (int y = 0; y <= 25; ++y) { // cseg189:08D3-093B
- const uint8 *src = _animFramesBuffer + 0x23FE + y * 34; // cseg189:08E3-08EE
- memcpy(_screenVGA + 0x6BC3 + y * 320, src, 34); // cseg189:08D3-0908
- memcpy(_screenLayer1 + 0x6BC3 + y * 320, src, 34); // cseg189:090D-0931
+ for (int y = 0; y <= 25; ++y) {
+ const uint8 *src = _animFramesBuffer + 0x23FE + y * 34;
+ memcpy(_screenVGA + 0x6BC3 + y * 320, src, 34);
+ memcpy(_screenLayer1 + 0x6BC3 + y * 320, src, 34);
}
}
void IgorEngine::PART_08_DRAW_DEAN_DIALOGUE_FRAME(int frame) {
- for (int y = 0; y <= 21; ++y) { // cseg189:093F-09CF
- const uint8 *src = _animFramesBuffer + 0x4E6B + frame * 0x226 + y * 25; // cseg189:095D-0975
- memcpy(_screenVGA + 0x6BC6 + y * 320, src, 25); // cseg189:094D-098F
- memcpy(_screenLayer1 + 0x6BC6 + y * 320, src, 25); // cseg189:0994-09C5
+ for (int y = 0; y <= 21; ++y) {
+ const uint8 *src = _animFramesBuffer + 0x4E6B + frame * 0x226 + y * 25;
+ memcpy(_screenVGA + 0x6BC6 + y * 320, src, 25);
+ memcpy(_screenLayer1 + 0x6BC6 + y * 320, src, 25);
}
}
@@ -91,102 +91,252 @@ void IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PART_08_DRAW_DEAN_DIALOGUE_FRAME(0); // cseg194:0B8F-0BAF
+ PART_08_DRAW_DEAN_DIALOGUE_FRAME(0);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_08_DRAW_DEAN_DIALOGUE_FRAME(getRandomNumber(6)); // cseg194:0C33-0C3B
+ PART_08_DRAW_DEAN_DIALOGUE_FRAME(getRandomNumber(6));
break;
}
}
void IgorEngine::PART_08_ACTION_105() {
- for (int frame = 0; frame <= 1; ++frame) { // cseg189:062A-0698
- for (int y = 0; y <= 48; ++y) { // cseg189:0635-067E
- const uint8 *src = _animFramesBuffer + 0x125E + frame * 0x55C + y * 28; // cseg189:0645-065A
- memcpy(_screenVGA + 0x66E3 + y * 320, src, 28); // cseg189:0635-0674
+ for (int frame = 0; frame <= 1; ++frame) {
+ for (int y = 0; y <= 48; ++y) {
+ const uint8 *src = _animFramesBuffer + 0x125E + frame * 0x55C + y * 28;
+ memcpy(_screenVGA + 0x66E3 + y * 320, src, 28);
}
if (frame == 0)
- waitForTimer(127); // cseg189:0680-0691
+ waitForTimer(127);
+ }
+ addObjectToInventory(15, 50);
+ _objectsState[57] = 1;
+ PART_08_APPLY_OBJECT_STATE(255);
+}
+
+void IgorEngine::PART_08_ACTION_109() {
+ for (int frame = 0; frame <= 1; ++frame) {
+ for (int y = 0; y <= 48; ++y) {
+ for (int x = 0; x <= 22; ++x) {
+ const int dstOffset = 0x4F77 + y * 320 + x;
+ uint8 color = _animFramesBuffer[2448 + frame * 1127 + y * 23 + x];
+ if (color >= 0xC0 && color <= 0xCF) {
+ const RoomObjectArea &area = _roomObjectAreasTable[_screenLayer2[dstOffset]];
+ if (area.y1Lum > 0)
+ color = _screenLayer1[dstOffset];
+ else if (area.y2Lum > 0)
+ color -= area.deltaLum;
+ }
+ _screenTempLayer[y * 100 + x] = color;
+ }
+ }
+ for (int y = 0; y <= 48; ++y)
+ memcpy(_screenVGA + 0x4F77 + y * 320, _screenTempLayer + y * 100, 23);
+ if (frame == 0)
+ waitForTimer(127);
+ }
+
+ addObjectToInventory(13, 48);
+ PART_08_APPLY_OBJECT_STATE(255);
+ _objectsState[54] = 1;
+}
+
+void IgorEngine::PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(int frame) {
+ const uint16 frameOffset = READ_LE_UINT16(_animFramesBuffer + 0xE240 + frame * 2);
+ decodeAnimFrame(_animFramesBuffer + 0x9AC8 + frameOffset - 1, _screenVGA, true);
+}
+
+void IgorEngine::PART_08_UPDATE_DIALOGUE_SECRETARY(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ case kUpdateDialogueAnimStanding:
+ PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(1);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(getRandomNumber(2) + 2);
+ break;
+ }
+}
+
+void IgorEngine::PART_08_ACTION_108() {
+ const int currentPart = _currentPart;
+ const int actionFrameOffset = _objectsState[57] == 0 ? 0x2773 : 0x328D;
+ playSound(60, 1);
+ for (int frame = 0; frame <= 1; ++frame) {
+ for (int y = 0; y <= 48; ++y)
+ memcpy(_screenVGA + 0x6D1E + y * 320,
+ _animFramesBuffer + actionFrameOffset - 1 + frame * 0x58D + y * 29, 29);
+ if (frame == 0)
+ waitForTimer(127);
+ }
+
+ _currentPart = 91;
+ fadeOut(768);
+ loadActionData(DAT_AdministrationSecretaryRoom);
+ loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom,
+ BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom,
+ TXT_AdministrationSecretaryRoom);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(1);
+ memcpy(_screenLayer1, _screenVGA, 46080);
+ fadeIn(624);
+
+ ADD_DIALOGUE_TEXT(226, 1, 254);
+ SET_DIALOGUE_TEXT(1, 1);
+ _updateDialogue = &IgorEngine::PART_08_UPDATE_DIALOGUE_SECRETARY;
+ startCutsceneDialogue(65, 70, 0, 59, 63);
+ waitForEndOfCutsceneDialogue(65, 70, 0, 59, 63);
+ _updateDialogue = 0;
+
+ for (int frame = 5; frame <= 19; ++frame) {
+ PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(frame);
+ if (frame < 19)
+ waitForTimer(31);
+ else
+ playSound(14, 1);
+ }
+ waitForTimer(255);
+ fadeOut(624);
+ _objectsState[53] = 0;
+ _objectsState[61] = 1;
+
+ loadActionData(DAT_DeanPepperOffice);
+ loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice,
+ BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice);
+ _roomDataOffsets = PART_08_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143);
+ PART_08_APPLY_OBJECT_STATE(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
+ drawInventory(_inventoryInfo[72], 0);
+ fadeIn(768);
+ _currentPart = currentPart;
+ _objectsState[58] = 1;
+}
+
+void IgorEngine::PART_08_DEAN_LEAVES() {
+ static const uint8 frames[] = {
+ 3, 1, 2, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5,
+ 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 7, 8, 9
+ };
+ PART_08_DRAW_DEAN();
+ for (uint i = 0; i < ARRAYSIZE(frames); ++i) {
+ decodeAnimFrame(getAnimFrame(0x76DD, 0x8475, frames[i]), _screenVGA, true);
+ waitForTimer(31);
}
- addObjectToInventory(15, 50); // cseg189:069A-06D4; inventory object 15 is slot 50
- _objectsState[57] = 1; // cseg189:06DE
- PART_08_APPLY_OBJECT_STATE(255); // cseg189:06D9-06E5
+}
+
+void IgorEngine::PART_08_DEAN_DRINKS() {
+ const uint8 savedTalkMode = _gameState.talkMode;
+ _gameState.talkMode = kTalkModeTextOnly;
+ waitForTimer(255);
+
+ ADD_DIALOGUE_TEXT(229, 1, 0);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(78, 75, 26, 58, 0);
+ playSound(61, 1);
+
+ for (int step = 1; step <= 20; ++step) {
+ const int frame = getRandomNumber(5);
+ for (int y = 0; y <= 28; ++y)
+ memcpy(_screenVGA + 0x6806 + y * 320,
+ _animFramesBuffer + 0x8489 + frame * 0x2D5 + y * 25, 25);
+ waitForTimer(61);
+
+ if (step == 10) {
+ memcpy(_screenVGA + _dialogueDirtyRectY,
+ _screenTextLayer + 320 * 72, _dialogueDirtyRectSize);
+ ADD_DIALOGUE_TEXT(230, 1, 0);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(78, 75, 26, 58, 0);
+ }
+ }
+
+ memcpy(_screenVGA + _dialogueDirtyRectY,
+ _screenTextLayer + 320 * 72, _dialogueDirtyRectSize);
+ _gameState.dialogueTextRunning = false;
+ playSound(15, 1);
+ for (int y = 0; y <= 28; ++y)
+ memcpy(_screenVGA + 0x6806 + y * 320,
+ _animFramesBuffer + 0x9587 + y * 25, 25);
+ waitForTimer(255);
+ _gameState.talkMode = savedTalkMode;
}
void IgorEngine::PART_08_HANDLE_DIALOGUE_DEAN() {
- loadDialogueData(DLG_DeanPepperOffice); // cseg194:0CD4-0CF7
+ loadDialogueData(DLG_DeanPepperOffice);
_updateDialogue = &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN;
- handleDialogue(78, 75, 26, 58, 0); // cseg194:0AD5-0AF0
+ handleDialogue(78, 75, 26, 58, 0);
_updateDialogue = 0;
}
void IgorEngine::PART_08_ACTION_103_TALK_TO_DEAN() {
- if (_objectsState[55] == 1) { // cseg189:128F-12B7
- ADD_DIALOGUE_TEXT(223, 1, 169); // cseg189:1296-12A2
+ if (_objectsState[55] == 1) {
+ ADD_DIALOGUE_TEXT(223, 1, 169);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
return;
}
- if (_objectsState[52] == 1) { // cseg189:12BA-12C4
- PART_08_DRAW_DEAN(); // cseg189:12C4
- ADD_DIALOGUE_TEXT(220, 1, 166); // cseg189:12C9-1328
- ADD_DIALOGUE_TEXT(221, 1, 167); // cseg189:12C9-1328
- SET_DIALOGUE_TEXT(1, 2); // cseg189:132A-132F
+ if (_objectsState[52] == 1) { // door open
+ PART_08_DRAW_DEAN();
+ ADD_DIALOGUE_TEXT(220, 1, 166);
+ ADD_DIALOGUE_TEXT(221, 1, 167);
+ SET_DIALOGUE_TEXT(1, 2);
_updateDialogue = &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN;
- startCutsceneDialogue(78, 75, 26, 58, 0); // cseg189:1334-1343
- waitForEndOfCutsceneDialogue(78, 75, 26, 58, 0); // cseg189:1348-14BA
+ startCutsceneDialogue(78, 75, 26, 58, 0);
+ waitForEndOfCutsceneDialogue(78, 75, 26, 58, 0);
_updateDialogue = 0;
- return; // cseg189:14BD jumps to the function epilogue at 14D0
+ return;
}
- PART_08_HANDLE_DIALOGUE_DEAN(); // cseg189:14BF
- PART_08_APPLY_OBJECT_STATE(255); // cseg189:14C4-14CB
+ PART_08_HANDLE_DIALOGUE_DEAN();
+ PART_08_APPLY_OBJECT_STATE(255);
}
void IgorEngine::PART_08_ACTION_114() {
- if (_objectsState[55] == 1) { // cseg189:09E3-0A0B
- ADD_DIALOGUE_TEXT(227, 1, 172); // cseg189:09EA-09F6
+ if (_objectsState[55] == 1) {
+ ADD_DIALOGUE_TEXT(227, 1, 172);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
return;
}
- if (_objectsState[26] == 1) { // cseg189:0A0E-0A36; s3:0x83C maps to object state 26
- ADD_DIALOGUE_TEXT(226, 1, 171); // cseg189:0A15-0A21
+ if (_objectsState[26] == 1) {
+ ADD_DIALOGUE_TEXT(226, 1, 171);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
return;
}
- PART_08_DRAW_DEAN(); // cseg189:0A39
- ADD_DIALOGUE_TEXT(210, 2, 158); // cseg189:0A3E-0A4A
+ PART_08_DRAW_DEAN();
+ ADD_DIALOGUE_TEXT(210, 2, 158);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
static const uint8 deanFrames[] = { 1, 2, 3, 0 }; // dseg231:0x01DE,0x01E0,0x01E2,0x01E4
static const uint8 igorFrames[] = { 0, 1, 2, 3 }; // dseg231:0x01DF,0x01E1,0x01E3,0x01E5
- for (int step = 0; step < 4; ++step) { // cseg189:0A64-0B48
+ for (int step = 0; step < 4; ++step) {
if (deanFrames[step] != 0) {
- for (int y = 0; y <= 48; ++y) { // cseg189:0A7D-0AD1
- const uint8 *src = _animFramesBuffer + 0x5755 + deanFrames[step] * 0x620 + y * 32; // cseg189:0A8D-0AAD
- memcpy(_screenVGA + 0x6463 + y * 320, src, 32); // cseg189:0A7D-0AC7
+ for (int y = 0; y <= 48; ++y) {
+ const uint8 *src = _animFramesBuffer + 0x5755 + deanFrames[step] * 0x620 + y * 32;
+ memcpy(_screenVGA + 0x6463 + y * 320, src, 32);
}
}
if (igorFrames[step] != 0) {
- for (int y = 0; y <= 24; ++y) { // cseg189:0AE0-0B33
- const uint8 *src = _animFramesBuffer + 0x6D7D + igorFrames[step] * 0x258 + y * 24; // cseg189:0AF0-0B0F
- memcpy(_screenVGA + 0x6D06 + y * 320, src, 24); // cseg189:0AE0-0B29
+ for (int y = 0; y <= 24; ++y) {
+ const uint8 *src = _animFramesBuffer + 0x6D7D + igorFrames[step] * 0x258 + y * 24;
+ memcpy(_screenVGA + 0x6D06 + y * 320, src, 24);
}
}
- waitForTimer(41); // cseg189:0B35-0B3F
+ waitForTimer(41);
}
// The original removes object slot 58 here and plays sound 63 only after
- // the conversation has completed. cseg189:0B4B-0B7C,0D86-0D95.
+ // the conversation has completed.
if (_inventoryInfo[58] != 0) {
_inventoryInfo[_inventoryInfo[58] - 1] = 0;
_inventoryInfo[58] = 0;
@@ -196,25 +346,25 @@ void IgorEngine::PART_08_ACTION_114() {
drawInventory(_inventoryInfo[72], 0);
}
- ADD_DIALOGUE_TEXT(216, 1, 162); // cseg189:0B7F-0BDE
- ADD_DIALOGUE_TEXT(217, 1, 163); // cseg189:0B7F-0BDE
- ADD_DIALOGUE_TEXT(218, 1, 164); // cseg189:0B7F-0BDE
- ADD_DIALOGUE_TEXT(219, 1, 165); // cseg189:0B7F-0BDE
- SET_DIALOGUE_TEXT(1, 4); // cseg189:0BE0-0BE5
+ ADD_DIALOGUE_TEXT(216, 1, 162);
+ ADD_DIALOGUE_TEXT(217, 1, 163);
+ ADD_DIALOGUE_TEXT(218, 1, 164);
+ ADD_DIALOGUE_TEXT(219, 1, 165);
+ SET_DIALOGUE_TEXT(1, 4);
_updateDialogue = &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN;
- startCutsceneDialogue(78, 75, 26, 58, 0); // cseg189:0BEA-0BF9
- waitForEndOfCutsceneDialogue(78, 75, 26, 58, 0); // cseg189:0BFE-0D70
+ startCutsceneDialogue(78, 75, 26, 58, 0);
+ waitForEndOfCutsceneDialogue(78, 75, 26, 58, 0);
_updateDialogue = 0;
- _objectsState[56] = _objectsState[26] < 2 ? 1 : 2; // cseg189:0D73-0D81
- drawInventory(_inventoryInfo[72], 0); // cseg189:0D86-0D8C
- playSound(63, 1); // cseg189:0D91-0D95
- PART_08_APPLY_OBJECT_STATE(255); // cseg189:0D9A-0DA1
+ _objectsState[56] = _objectsState[26] < 2 ? 1 : 2;
+ drawInventory(_inventoryInfo[72], 0);
+ playSound(63, 1);
+ PART_08_APPLY_OBJECT_STATE(255);
}
void IgorEngine::PART_08_EXEC_ACTION(int action) {
switch (action) {
case 101:
- if (_objectsState[52] == 0) { // cseg189:10D6-10DD,1229
+ if (_objectsState[52] == 0) {
_currentPart = 71;
break;
}
@@ -229,8 +379,19 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
_gameState.igorMoving = true;
waitForIgorMove();
if (_objectsState[56] != 0) {
- // TODO: translate cseg189:11C7-1224 before enabling the Dean's post-exit sequence.
- break;
+ waitForTimer(251);
+ PART_08_DEAN_LEAVES();
+ if (_objectsState[68] == 1)
+ _objectsState[68] = 2;
+ else
+ _objectsState[67] = 1;
+ waitForTimer(101);
+ playSound(16, 1);
+ if (_objectsState[56] == 2) {
+ PART_08_DEAN_DRINKS();
+ _objectsState[55] = 1;
+ }
+ _objectsState[56] = 0;
}
_currentPart = 71;
}
@@ -250,8 +411,7 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 106:
- case 107: // Action 107 maps to sub_189_0E2C. cseg189:1586-15A4
+ case 107:
ADD_DIALOGUE_TEXT(205, 2, 155);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -276,33 +436,33 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
PART_08_ACTION_103_TALK_TO_DEAN();
break;
case 108:
- if (_objectsState[55] == 0) { // cseg189:0704-072C
- ADD_DIALOGUE_TEXT(212, 1, 159); // cseg189:070B-0717
+ if (_objectsState[55] == 0) {
+ ADD_DIALOGUE_TEXT(212, 1, 159);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- } else if (_objectsState[58] == 1) { // cseg189:072F-0757; s3:0x85C maps to object state 58
- ADD_DIALOGUE_TEXT(224, 2, 170); // cseg189:0736-0742
+ } else if (_objectsState[58] == 1) {
+ ADD_DIALOGUE_TEXT(224, 2, 170);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
} else {
- // TODO: translate cseg189:075A-08BE (secretary-room transition sequence).
+ PART_08_ACTION_108();
}
break;
case 109:
- if (_objectsState[55] == 0) { // cseg189:0406-042E
- ADD_DIALOGUE_TEXT(213, 2, 160); // cseg189:040D-0419
+ if (_objectsState[55] == 0) {
+ ADD_DIALOGUE_TEXT(213, 2, 160);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- } else if (_objectsState[54] == 1) { // cseg189:0431-0459; s3:0x858 maps to object state 54
- ADD_DIALOGUE_TEXT(215, 1, 161); // cseg189:0438-0444
+ } else if (_objectsState[54] == 1) {
+ ADD_DIALOGUE_TEXT(215, 1, 161);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
} else {
- // TODO: translate cseg189:045C-0615 (palette-aware pickup animation).
+ PART_08_ACTION_109();
}
break;
case 114:
@@ -322,9 +482,9 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
void IgorEngine::PART_08() {
_gameState.enableLight = 1;
- loadActionData(DAT_DeanPepperOffice); // static resource: cseg189:34D7-34FA
+ loadActionData(DAT_DeanPepperOffice);
loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice,
- BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice); // static resources: cseg195/cseg196
+ BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice);
static const int anim[] = {
FRM_DeanPepperOffice1, FRM_DeanPepperOffice2,
FRM_DeanPepperOffice3, FRM_DeanPepperOffice4,
@@ -334,7 +494,7 @@ void IgorEngine::PART_08() {
FRM_DeanPepperOffice11, FRM_DeanPepperOffice12,
FRM_DeanPepperOffice13, FRM_DeanPepperOffice14,
FRM_DeanPepperOffice15, FRM_DeanPepperOffice16, 0
- }; // static resources: cseg195:0002-0337
+ };
loadAnimData(anim);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_08_EXEC_ACTION);
_roomDataOffsets = PART_08_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 0b5682ecb85..9e380dea57b 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -516,7 +516,7 @@
#define BOX_ParkRight 937 // cseg104:009A-00C3; IGOR.EXE:0x3ECA1E, 0x500 bytes
// Dean Peeper's conversation data block from NE segment 194.
-#define DLG_DeanPepperOffice 938 // cseg194:0CD4-0CF7; IGOR.EXE:0x7256FE, 0x3D86 bytes
+#define DLG_DeanPepperOffice 938
// Administration secretary-room animation blocks copied by cseg192:0002-01D4.
#define ANM_AdministrationSecretaryRoom1 923 // cseg192:01D5; IGOR.EXE:0x7057D5, 0xD38 bytes
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 82c47cb9719..32521135fa8 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -217,17 +217,17 @@ const RoomDataOffsets IgorEngine::PART_07_ROOM_DATA_OFFSETS = {
};
const RoomDataOffsets IgorEngine::PART_08_ROOM_DATA_OFFSETS = {
- { 80, 4, 12, 3 }, // cseg189:250F-2542; transition table at DAT+80, four areas, strides 12 and 3
+ { 80, 4, 12, 3 },
{ 149, 162 },
{ 167, 385, 3401, 271, 347, 84 },
{
- 165, 30, // cseg194:0002-0151; question text base and count
- 5188, 100, // cseg194:0154-0269; reply text base and count
- 90, // cseg194:0DB0-0DBD; dialogue matrix page stride
- 270, // cseg194:09E1-0A4D
- 15548, // cseg194:0A78-0A92
- 15488, // cseg194:043D-0454
- 30 // cseg194:0002-026D; reply table has 30 sound entries
+ 165, 30,
+ 5188, 100,
+ 90,
+ 270,
+ 15548,
+ 15488,
+ 30
}
};
Commit: 5465f3e853f47caf1f70008471bfa8c88c60c355
https://github.com/scummvm/scummvm/commit/5465f3e853f47caf1f70008471bfa8c88c60c355
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:05:59+01:00
Commit Message:
IGOR: Fix crash when entering college for the second time
Changed paths:
engines/igor/igor.h
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 3220ae0e276..f323b19f4a1 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -364,7 +364,7 @@ private:
bool _scrollInventory;
int _scrollInventoryStartY, _scrollInventoryEndY, _scrollInventoryDy;
- WalkData _walkData[100];
+ WalkData _walkData[101];
uint8 _walkCurrentPos;
uint8 _walkDataLastIndex;
uint8 _walkDataCurrentIndex;
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index f3d4d669360..3602566bde1 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -25,11 +25,27 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
switch (action) {
case 0:
case 1:
- break;
- default:
+ 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;
+
+ default:
warning("EXEC_MAIN_ACTION() Unhandled action %d", action);
break;
- }
+ }
}
void IgorEngine::SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p) {
@@ -47,13 +63,13 @@ void IgorEngine::UPDATE_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
switch (_objectsState[0]) {
case 0:
- Common::strlcpy(_globalObjectNames[23], getString(STR_BottleOfWhisky),sizeof(_globalObjectNames[23]));
+ Common::strlcpy(_globalObjectNames[23], getString(STR_BottleOfWhisky), sizeof(_globalObjectNames[23]));
break;
case 1:
- Common::strlcpy(_globalObjectNames[23], getString(STR_EmptyBottle),sizeof(_globalObjectNames[23]));
+ Common::strlcpy(_globalObjectNames[23], getString(STR_EmptyBottle), sizeof(_globalObjectNames[23]));
break;
case 2:
- Common::strlcpy(_globalObjectNames[23], getString(STR_BottleOfWater),sizeof(_globalObjectNames[23]));
+ Common::strlcpy(_globalObjectNames[23], getString(STR_BottleOfWater), sizeof(_globalObjectNames[23]));
break;
}
}
@@ -117,33 +133,33 @@ void IgorEngine::PART_MAIN() {
_inventoryInfo[39] = 3;
_inventoryInfo[72] = 1; // first object
_inventoryInfo[73] = 3; // last object
- UPDATE_OBJECT_STATE(255);
- if (_currentPart != kStartupPart) { // boot param
+ 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);
+ do {
+ debugC(9, kDebugGame, "PART_MAIN _currentPart %d", _currentPart);
switch (_currentPart) {
- case 40:
- PART_04(); // Map
- break;
- case 50: // arrive from map
- case 51: // arrive from SpringRock through scroll
- case 52:
- PART_05(); // SpringBridge
- break;
- case 60: // arrive through scroll
- case 61: // arrive from intro
+ case 40:
+ PART_04(); // Map
+ break;
+ case 50: // arrive from map
+ case 51: // arrive from SpringRock through scroll
+ case 52:
+ PART_05(); // SpringBridge
+ break;
+ case 60: // arrive through scroll
+ case 61: // arrive from intro
PART_06(); // SpringRock
break;
- case 70: // enter from outside the administration corridor
- case 71: // enter from deans door
- case 72: // enter from secretary
+ case 70: // enter from outside the administration corridor
+ case 71: // enter from deans door
+ case 72: // enter from secretary
PART_07(); // Administration corridor
break;
case 80:
@@ -183,16 +199,16 @@ void IgorEngine::PART_MAIN() {
PART_35(); // Park, right panel; cseg100:1644
break;
case 850: // Intro cutscene
- // Clear the entire screen buffer before starting the intro cutscene
- memset(_screenVGA, 0, 64000);
+ // Clear the entire screen buffer before starting the intro cutscene
+ memset(_screenVGA, 0, 64000);
g_engine->_screen->updateScreen();
- _screenVGAVOffset = 24;
- // copy the initial portion of the screen to the display, with the vertical offset
+ _screenVGAVOffset = 24;
+ // copy the initial portion of the screen to the display, with the vertical offset
_system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, _screenVGAVOffset);
g_engine->_screen->updateScreen();
PART_85();
- // Clears the bottom portion of the screen
- memset(_screenVGA + 46080, 0, 17920);
+ // Clears the bottom portion of the screen
+ memset(_screenVGA + 46080, 0, 17920);
moveScreenUp(_screenVGAVOffset);
_screenVGAVOffset = 0;
_inputVars[kInputCursorXPos] = 160;
Commit: 66362b26fa4f65294e1db436f9d2f4fcfe61f427
https://github.com/scummvm/scummvm/commit/66362b26fa4f65294e1db436f9d2f4fcfe61f427
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:00+01:00
Commit Message:
IGOR: Basic inventory descriptions as per legacy engine attempt
Changed paths:
engines/igor/part_main.cpp
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 3602566bde1..4130168509d 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -41,6 +41,384 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
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);
Commit: fbb901d6a03d8229e6dc58c20f0e56aefd58bf79
https://github.com/scummvm/scummvm/commit/fbb901d6a03d8229e6dc58c20f0e56aefd58bf79
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:00+01:00
Commit Message:
IGOR: Fix random range in rooms 17 and 23
Changed paths:
engines/igor/igor.cpp
engines/igor/part_17.cpp
engines/igor/part_23.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 95e99873ce0..dafeea79316 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -65,8 +65,8 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- // _currentPart = 850;
- _currentPart = 170;
+ _currentPart = 850;
+ // _currentPart = 170;
// _currentPart = 62;
// _currentPart = 40;
}
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index 642ee71a141..5592008eb79 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -35,7 +35,7 @@ void IgorEngine::PART_17_EXEC_ACTION(int action) {
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 103:
+ case 103: // look at phillip and jimmy
PART_17_ACTION_103();
break;
case 104: // look at file
@@ -73,17 +73,18 @@ void IgorEngine::PART_17_ACTION_101_walkIn() {
void IgorEngine::PART_17_ACTION_103() {
PART_17_HELPER_8(0);
if (_gameState.counter[4] == 1) {
- ADD_DIALOGUE_TEXT(201, 2, 633); // cseg141:07FA-0800
+ ADD_DIALOGUE_TEXT(201, 2, 633);
} else if (_gameState.counter[4] == 2) {
- ADD_DIALOGUE_TEXT(206, 2, 636); // cseg141:080D-0813
+ ADD_DIALOGUE_TEXT(206, 2, 636);
} else if (_gameState.counter[4] == 3) {
- ADD_DIALOGUE_TEXT(210, 2, 638); // cseg141:0820-082C
+ ADD_DIALOGUE_TEXT(210, 2, 638);
}
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, 634);
ADD_DIALOGUE_TEXT(204, 2, 635);
@@ -102,9 +103,10 @@ void IgorEngine::PART_17_ACTION_103() {
waitForEndOfCutsceneDialogue(135, 33, 63, 63, 0);
_updateDialogue = 0;
PART_17_HELPER_11(0);
+
waitForTimer(255);
- const int randomDialogue = getRandomNumber(4); // cseg141:0910-0917
- ADD_DIALOGUE_TEXT(215 + randomDialogue, 1, 641 + randomDialogue); // cseg141:091A-092C
+ const int randomDialogue = getRandomNumber(3);
+ ADD_DIALOGUE_TEXT(215 + randomDialogue, 1, 641 + randomDialogue);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(135, 33, 63, 63, 0);
VAR_CURRENT_TALKING_ACTOR = 1;
@@ -120,7 +122,7 @@ void IgorEngine::PART_17_ACTION_103() {
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
waitForIgorMove();
- ADD_DIALOGUE_TEXT(219, 1, 645); // cseg141:09AC-09B8
+ ADD_DIALOGUE_TEXT(219, 1, 645);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
if (_gameState.counter[4] == 3) {
@@ -226,7 +228,7 @@ void IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP(int action) {
PART_17_HELPER_9(0);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_17_HELPER_9(getRandomNumber(7));
+ PART_17_HELPER_9(getRandomNumber(6));
break;
}
}
@@ -242,9 +244,9 @@ void IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP_JIMMY(int action) {
break;
case kUpdateDialogueAnimMiddleOfSentence:
if (VAR_CURRENT_TALKING_ACTOR == 0) {
- PART_17_HELPER_8(getRandomNumber(7));
+ PART_17_HELPER_8(getRandomNumber(6));
} else {
- PART_17_HELPER_11(getRandomNumber(6));
+ PART_17_HELPER_11(getRandomNumber(5));
}
break;
}
@@ -252,13 +254,15 @@ void IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP_JIMMY(int action) {
void IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND() {
if (compareGameTick(3, 32) && _gameState.unkF) {
+ // Counter (unk10) values 0 through 15 animate one character while holding the other on its resting frame.
+ // Counter (unk10) values 16 through 31 animate the other character.
switch (_gameState.unk10 / 16) {
- case 0:
+ case 0: // animate jimmy
PART_17_HELPER_8(0);
- PART_17_HELPER_9(getRandomNumber(7));
+ PART_17_HELPER_9(getRandomNumber(6));
break;
- case 1:
- PART_17_HELPER_8(getRandomNumber(7));
+ case 1: // animate philip
+ PART_17_HELPER_8(getRandomNumber(6));
PART_17_HELPER_9(0);
}
if (_gameState.unk10 == 31) {
@@ -270,6 +274,7 @@ void IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND() {
}
void IgorEngine::PART_17_HELPER_1(int num) {
+ // Enable or disable phillip and jimmy animation
if (num == 1 || num == 255) {
if (_objectsState[54] == 0) {
_gameState.unkF = false;
@@ -278,6 +283,7 @@ void IgorEngine::PART_17_HELPER_1(int num) {
_gameState.unkF = true;
}
}
+
if (num == 2 || num == 255) {
if (_objectsState[55] == 1) {
_roomActionsTable[2698] = 0;
@@ -469,11 +475,15 @@ void IgorEngine::PART_17() {
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;
diff --git a/engines/igor/part_23.cpp b/engines/igor/part_23.cpp
index 948590b2054..b24f7a066ef 100644
--- a/engines/igor/part_23.cpp
+++ b/engines/igor/part_23.cpp
@@ -128,16 +128,16 @@ void IgorEngine::PART_23_ACTION_108() {
void IgorEngine::PART_23_UPDATE_ROOM_BACKGROUND() {
if (compareGameTick(29) || compareGameTick(61)) {
- int rnd = getRandomNumber(11);
+ int rnd = getRandomNumber(10);
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;
+ _gameState.unk10 = getRandomNumber(1) + 3;
} else {
- _gameState.unk10 = getRandomNumber(2) + 1;
+ _gameState.unk10 = getRandomNumber(1) + 1;
}
}
PART_23_HELPER_7(_gameState.unk10);
Commit: 2559edf24387a88a631dc4de3560a47359ad031b
https://github.com/scummvm/scummvm/commit/2559edf24387a88a631dc4de3560a47359ad031b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:00+01:00
Commit Message:
IGOR: Part 30 as coming from the legacy engine
Changed paths:
A engines/igor/part_30.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_17.cpp
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index f323b19f4a1..d37a6e1e666 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -575,15 +575,15 @@ private:
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_2_walkFromMap();
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_4_paintFirsFrameOfPhilipAndJimmy();
+ void PART_17_HELPER_5_changeZindexOfPath(int lum);
+ void PART_17_HELPER_6_walkFromCollege();
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_HELPER_11_PhillipHeadTurned(int frame);
void PART_17();
// college corridor lucas
@@ -602,6 +602,21 @@ private:
void PART_23_HELPER_8(int frame);
void PART_23();
+ // 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();
+
// park
void PART_34();
void PART_34_EXEC_ACTION(int action);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index c7bd2cbbb09..c516e311e1b 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -26,6 +26,7 @@ MODULE_OBJS = \
part_12.o \
part_17.o \
part_23.o \
+ part_30.o \
part_34.o \
part_35.o \
text.o \
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index 5592008eb79..1d74d6aa613 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -35,7 +35,7 @@ void IgorEngine::PART_17_EXEC_ACTION(int action) {
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 103: // look at phillip and jimmy
+ case 103: // talk to philip and jimmy
PART_17_ACTION_103();
break;
case 104: // look at file
@@ -102,7 +102,7 @@ void IgorEngine::PART_17_ACTION_103() {
_updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP_JIMMY;
waitForEndOfCutsceneDialogue(135, 33, 63, 63, 0);
_updateDialogue = 0;
- PART_17_HELPER_11(0);
+ PART_17_HELPER_11_PhillipHeadTurned(0);
waitForTimer(255);
const int randomDialogue = getRandomNumber(3);
@@ -147,7 +147,7 @@ void IgorEngine::PART_17_ACTION_105() {
_walkData[_walkDataLastIndex].frameNum = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- PART_17_HELPER_5(143);
+ PART_17_HELPER_5_changeZindexOfPath(143);
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[44836]].area = 4;
buildWalkPath(41, 86, 36, 143);
@@ -218,7 +218,16 @@ void IgorEngine::PART_17_ACTION_106() {
}
void IgorEngine::PART_17_HANDLE_DIALOGUE_PHILIP() {
- loadDialogueData(DLG_OutsideCollege);
+ // cseg141:0955 -> call cseg111:0x2CB2
+ // TODO: derive from cseg111:0x2CB2 (cseg111 is only dumped up to 0x0ECC, so the
+ // callee is not in code/110_28A6.asm). Two things are unverified and must stay
+ // disabled until that segment is disassembled:
+ // 1) the resource id it loads -- DLG_OutsideCollege (128) is a hole in the
+ // SPA-CD table of IGOR.TBL, so loadDialogueData() aborts in findData();
+ // 2) the DialogueDataOffsets it uses. PART_17_ROOM_DATA_OFFSETS.dlg is
+ // inherited from the historical reference and is self-contradictory:
+ // question 4 lands at p+687..727 while reply 0 lands at p+359..459, so the
+ // two ranges overlap and loadDialogueData() would decode garbage.
warning("PART_17_HANDLE_DIALOGUE_PHILIP unimplemented");
}
@@ -239,14 +248,14 @@ void IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP_JIMMY(int action) {
if (VAR_CURRENT_TALKING_ACTOR == 0) {
PART_17_HELPER_8(0);
} else {
- PART_17_HELPER_11(0);
+ PART_17_HELPER_11_PhillipHeadTurned(0);
}
break;
case kUpdateDialogueAnimMiddleOfSentence:
if (VAR_CURRENT_TALKING_ACTOR == 0) {
PART_17_HELPER_8(getRandomNumber(6));
} else {
- PART_17_HELPER_11(getRandomNumber(5));
+ PART_17_HELPER_11_PhillipHeadTurned(getRandomNumber(5));
}
break;
}
@@ -297,7 +306,7 @@ void IgorEngine::PART_17_HELPER_1(int num) {
}
}
-void IgorEngine::PART_17_HELPER_2() {
+void IgorEngine::PART_17_HELPER_2_walkFromMap() {
for (int i = 17; i <= 85; ++i) {
_walkYScaleRoom[i] = ((i - 13) / 4) + 5;
}
@@ -339,7 +348,8 @@ void IgorEngine::PART_17_HELPER_2() {
_walkData[i].posNum = kFacingPositionFront;
}
waitForIgorMove();
- PART_17_HELPER_5(0);
+ PART_17_HELPER_5_changeZindexOfPath(0);
+
--_walkDataLastIndex;
buildWalkPath(41, 86, 45, 95);
_walkDataCurrentIndex = 2;
@@ -362,7 +372,7 @@ void IgorEngine::PART_17_HELPER_3(int lum) {
_roomObjectAreasTable[20].y1Lum = lum;
}
-void IgorEngine::PART_17_HELPER_4() {
+void IgorEngine::PART_17_HELPER_4_paintFirsFrameOfPhilipAndJimmy() {
int offset = 11642;
for (int i = 0; i <= 48; ++i) {
memcpy(_screenLayer1 + offset + i * 320, _animFramesBuffer + i * 44, 44);
@@ -370,14 +380,14 @@ void IgorEngine::PART_17_HELPER_4() {
}
}
-void IgorEngine::PART_17_HELPER_5(int lum) {
+void IgorEngine::PART_17_HELPER_5_changeZindexOfPath(int lum) {
_roomObjectAreasTable[23].y1Lum = lum;
_roomObjectAreasTable[26].y1Lum = lum;
_roomObjectAreasTable[27].y1Lum = lum;
_roomObjectAreasTable[32].y1Lum = lum;
}
-void IgorEngine::PART_17_HELPER_6() {
+void IgorEngine::PART_17_HELPER_6_walkFromCollege() {
playMusic(2);
PART_17_HELPER_1(255);
fadeIn(768);
@@ -402,7 +412,7 @@ void IgorEngine::PART_17_HELPER_6() {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- PART_17_HELPER_5(0);
+ PART_17_HELPER_5_changeZindexOfPath(0);
_roomObjectAreasTable[5].area = 0;
_roomObjectAreasTable[10].area = 0;
_roomObjectAreasTable[11].area = 0;
@@ -451,7 +461,7 @@ void IgorEngine::PART_17_HELPER_9(int num) {
}
}
-void IgorEngine::PART_17_HELPER_11(int frame) {
+void IgorEngine::PART_17_HELPER_11_PhillipHeadTurned(int frame) {
for (int i = 0; i <= 8; ++i) {
for (int j = 0; j <= 10; ++j) {
int offset = (i + 36) * 320 + j + 130;
@@ -485,6 +495,8 @@ void IgorEngine::PART_17() {
PART_17_HELPER_1(255);
memcpy(_screenVGA, _screenLayer1, 46080);
+
+ _objectsState[56] = 1;
if (_objectsState[56] == 1) {
_gameState.unkF = false;
PART_17_HELPER_3(6);
@@ -492,19 +504,22 @@ void IgorEngine::PART_17() {
_roomObjectAreasTable[15].object = 0;
_roomObjectAreasTable[19].object = 0;
} else if (_gameState.unkF) {
- PART_17_HELPER_4();
+ PART_17_HELPER_4_paintFirsFrameOfPhilipAndJimmy();
_gameState.counter[4] = 1;
} else {
_roomObjectAreasTable[14].object = 0;
_roomObjectAreasTable[15].object = 0;
_roomObjectAreasTable[19].object = 0;
}
+
_currentAction.verb = kVerbWalk;
if (_currentPart == 170) {
+ // from map
fadeIn(768);
- PART_17_HELPER_2();
+ PART_17_HELPER_2_walkFromMap();
} else if (_currentPart == 171) {
- PART_17_HELPER_6();
+ // from inside college
+ PART_17_HELPER_6_walkFromCollege();
}
enterPartLoop();
while (_currentPart >= 170 && _currentPart <= 171) {
@@ -517,7 +532,6 @@ void IgorEngine::PART_17() {
if (_objectsState[54] == 0) {
_objectsState[54] = 1;
}
- debug("Current part: %d", _currentPart);
fadeOut(624);
}
diff --git a/engines/igor/part_30.cpp b/engines/igor/part_30.cpp
new file mode 100644
index 00000000000..490116bb459
--- /dev/null
+++ b/engines/igor/part_30.cpp
@@ -0,0 +1,307 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#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(8) + 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);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 4130168509d..ae3780bd993 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -569,6 +569,12 @@ void IgorEngine::PART_MAIN() {
case 232:
PART_23();
break;
+ case 300:
+ case 301:
+ case 302:
+ case 303:
+ PART_30();
+ break;
case 340:
PART_34(); // Park, left panel; cseg101:1F85
break;
Commit: 778456cc8e3841cfaf6dd9724a07fe4344cf7ac1
https://github.com/scummvm/scummvm/commit/778456cc8e3841cfaf6dd9724a07fe4344cf7ac1
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:01+01:00
Commit Message:
IGOR: Add debug render for lum values
Changed paths:
engines/igor/console.cpp
engines/igor/console.h
engines/igor/debug.cpp
engines/igor/igor.h
engines/igor/part_30.cpp
diff --git a/engines/igor/console.cpp b/engines/igor/console.cpp
index 57dec4b3be5..b7f4aa3b2de 100644
--- a/engines/igor/console.cpp
+++ b/engines/igor/console.cpp
@@ -28,6 +28,9 @@ Console::Console() : GUI::Debugger() {
registerCmd("test", WRAP_METHOD(Console, Cmd_test));
registerCmd("paint_walk", WRAP_METHOD(Console, Cmd_paintWalk));
registerCmd("paint_hotspots", WRAP_METHOD(Console, Cmd_paintHotspots));
+ registerCmd("paint_y1lum", WRAP_METHOD(Console, Cmd_paintY1Lum));
+ registerCmd("paint_y2lum", WRAP_METHOD(Console, Cmd_paintY2Lum));
+ registerCmd("paint_deltalum", WRAP_METHOD(Console, Cmd_paintDeltaLum));
registerCmd("paint_off", WRAP_METHOD(Console, Cmd_paintOff));
registerCmd("changePart", WRAP_METHOD(Console, Cmd_changePart));
registerCmd("addObjectToInventory", WRAP_METHOD(Console, Cmd_addObjectToInventory));
@@ -61,6 +64,36 @@ bool Console::Cmd_paintHotspots(int argc, const char **argv) {
return true;
}
+bool Console::Cmd_paintY1Lum(int argc, const char **argv) {
+ if (!g_engine) {
+ debugPrintf("Engine not running\n");
+ return true;
+ }
+ debugPrintf("Overlay: y1Lum (BOX .y1Lum != 0); colour index is value / 16\n");
+ g_engine->debugPaintY1Lum();
+ return true;
+}
+
+bool Console::Cmd_paintY2Lum(int argc, const char **argv) {
+ if (!g_engine) {
+ debugPrintf("Engine not running\n");
+ return true;
+ }
+ debugPrintf("Overlay: y2Lum (BOX .y2Lum != 0); colour index is value / 16\n");
+ g_engine->debugPaintY2Lum();
+ return true;
+}
+
+bool Console::Cmd_paintDeltaLum(int argc, const char **argv) {
+ if (!g_engine) {
+ debugPrintf("Engine not running\n");
+ return true;
+ }
+ debugPrintf("Overlay: deltaLum (BOX .deltaLum != 0); colour index is value & 0x0F\n");
+ g_engine->debugPaintDeltaLum();
+ return true;
+}
+
bool Console::Cmd_paintOff(int argc, const char **argv) {
if (!g_engine) {
debugPrintf("Engine not running\n");
diff --git a/engines/igor/console.h b/engines/igor/console.h
index ad21f7e602e..3fd8aedbb01 100644
--- a/engines/igor/console.h
+++ b/engines/igor/console.h
@@ -32,6 +32,9 @@ private:
bool Cmd_test(int argc, const char **argv);
bool Cmd_paintWalk(int argc, const char **argv);
bool Cmd_paintHotspots(int argc, const char **argv);
+ bool Cmd_paintY1Lum(int argc, const char **argv);
+ bool Cmd_paintY2Lum(int argc, const char **argv);
+ bool Cmd_paintDeltaLum(int argc, const char **argv);
bool Cmd_paintOff(int argc, const char **argv);
bool Cmd_changePart(int argc, const char **argv);
bool Cmd_addObjectToInventory(int argc, const char **argv);
diff --git a/engines/igor/debug.cpp b/engines/igor/debug.cpp
index b56d18a5a61..a05bb37c93c 100644
--- a/engines/igor/debug.cpp
+++ b/engines/igor/debug.cpp
@@ -33,7 +33,17 @@ namespace Igor {
//
// debugPaintWalkAreas() -> regions whose BOX record has area != 0
// debugPaintHotspots() -> regions whose BOX record has object != 0
+// debugPaintY1Lum() -> regions whose BOX record has y1Lum != 0
+// debugPaintY2Lum() -> regions whose BOX record has y2Lum != 0
+// debugPaintDeltaLum() -> regions whose BOX record has deltaLum != 0
//
+// y1Lum / y2Lum are the depth thresholds of the enableLight == 1 shading
+// (`wd->y > y1Lum && wd->y <= y2Lum`, see ROOM_LIGHTING.md) and are compared
+// against Igor's scanline, so they are quantised into 16 buckets of 16 lines
+// (value >> 4). deltaLum is the amount subtracted from the pixel colour, whose
+// observed range is 0..15 (e.g. part_10.cpp:62 sets 3), so its low nibble is
+// painted directly. Regions with a zero value are left untouched, which also
+// means "no threshold" and "no darkening" show up as background.
// Each region/object id gets a distinct colour from the 16-entry ramp written
// to palette entries 240..255, so different walk areas (and different objects)
// are told apart. debugClearOverlay() restores those palette entries from
@@ -61,6 +71,21 @@ void IgorEngine::debugPaintHotspots() {
debugApplyOverlay();
}
+void IgorEngine::debugPaintY1Lum() {
+ _debugOverlayMode = kOverlayY1Lum;
+ debugApplyOverlay();
+}
+
+void IgorEngine::debugPaintY2Lum() {
+ _debugOverlayMode = kOverlayY2Lum;
+ debugApplyOverlay();
+}
+
+void IgorEngine::debugPaintDeltaLum() {
+ _debugOverlayMode = kOverlayDeltaLum;
+ debugApplyOverlay();
+}
+
void IgorEngine::debugClearOverlay() {
_debugOverlayMode = kOverlayOff;
// Undo the palette ramp written by debugApplyOverlay().
@@ -87,7 +112,24 @@ void IgorEngine::debugApplyOverlay() {
uint8 *dst = _debugOverlayBuffer + y * 320;
for (int x = 0; x < 320; ++x) {
const RoomObjectArea &roa = _roomObjectAreasTable[mask[x]];
- uint8 id = (_debugOverlayMode == kOverlayWalkAreas) ? roa.area : roa.object;
+ uint8 id;
+ switch (_debugOverlayMode) {
+ case kOverlayWalkAreas:
+ id = roa.area;
+ break;
+ case kOverlayHotspots:
+ id = roa.object;
+ break;
+ case kOverlayY1Lum:
+ id = roa.y1Lum >> 4;
+ break;
+ case kOverlayY2Lum:
+ id = roa.y2Lum >> 4;
+ break;
+ default:
+ id = roa.deltaLum & 0x0F;
+ break;
+ }
if (id != 0) {
dst[x] = 240 + (id & 0x0F);
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index d37a6e1e666..461059964da 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -228,7 +228,10 @@ enum Verb {
enum DebugOverlay {
kOverlayOff = 0,
kOverlayWalkAreas,
- kOverlayHotspots
+ kOverlayHotspots,
+ kOverlayY1Lum,
+ kOverlayY2Lum,
+ kOverlayDeltaLum
};
enum {
@@ -772,11 +775,16 @@ public:
void handlePause();
- // Debug overlays (console: paint_walk / paint_hotspots / paint_off).
+ // Debug overlays (console: paint_walk / paint_hotspots / paint_y1lum /
+ // paint_y2lum / paint_deltalum / paint_off).
// Paint the mask regions whose BOX record has a non-zero walk area or
- // object; applied on top of the presented frame until cleared.
+ // object, or whose y1Lum / y2Lum / deltaLum threshold is set; applied on
+ // top of the presented frame until cleared.
void debugPaintWalkAreas();
void debugPaintHotspots();
+ void debugPaintY1Lum();
+ void debugPaintY2Lum();
+ void debugPaintDeltaLum();
void debugClearOverlay();
void debugChangePart(int state);
bool debugAddObjectToInventory(int object);
diff --git a/engines/igor/part_30.cpp b/engines/igor/part_30.cpp
index 490116bb459..63b438a67ea 100644
--- a/engines/igor/part_30.cpp
+++ b/engines/igor/part_30.cpp
@@ -199,7 +199,7 @@ void IgorEngine::PART_30_HELPER_5() {
void IgorEngine::PART_30_HELPER_8() {
playMusic(3);
memset(_screenVGA + 46080, 0, 17920);
- fadeInPalette(768);
+ fadeIn(768);
for (int i = 1; i <= 40; ++i) {
const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0xBE94 + i * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
@@ -282,7 +282,7 @@ void IgorEngine::PART_30() {
PART_30_HELPER_8();
} else {
if (_currentPart != 302) {
- fadeInPalette(768);
+ fadeIn(768);
}
if (_currentPart == 300) {
PART_30_HELPER_2();
@@ -290,7 +290,7 @@ void IgorEngine::PART_30() {
PART_30_HELPER_3();
} else if (_currentPart == 302) {
playMusic(3);
- fadeInPalette(768);
+ fadeIn(768);
PART_30_HELPER_4();
} else if (_currentPart == 303) {
PART_30_HELPER_5();
@@ -301,7 +301,7 @@ void IgorEngine::PART_30() {
runPartLoop();
}
leavePartLoop();
- fadeOutPalette(624);
+ fadeOut(624);
}
} // End of namespace Igor
Commit: 7db20381ef7edcce7059300fd5537ec9ba886938
https://github.com/scummvm/scummvm/commit/7db20381ef7edcce7059300fd5537ec9ba886938
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:01+01:00
Commit Message:
IGOR: Fix crash when entering college
Changed paths:
engines/igor/part_17.cpp
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index 1d74d6aa613..3cab772b0f6 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -63,6 +63,8 @@ void IgorEngine::PART_17_ACTION_101_walkIn() {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
+ // Added this line compared to the 2009 version to correct the walk path origin.
+ --_walkDataLastIndex;
buildWalkPath(243, 74, 274, 68);
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
@@ -218,16 +220,7 @@ void IgorEngine::PART_17_ACTION_106() {
}
void IgorEngine::PART_17_HANDLE_DIALOGUE_PHILIP() {
- // cseg141:0955 -> call cseg111:0x2CB2
- // TODO: derive from cseg111:0x2CB2 (cseg111 is only dumped up to 0x0ECC, so the
- // callee is not in code/110_28A6.asm). Two things are unverified and must stay
- // disabled until that segment is disassembled:
- // 1) the resource id it loads -- DLG_OutsideCollege (128) is a hole in the
- // SPA-CD table of IGOR.TBL, so loadDialogueData() aborts in findData();
- // 2) the DialogueDataOffsets it uses. PART_17_ROOM_DATA_OFFSETS.dlg is
- // inherited from the historical reference and is self-contradictory:
- // question 4 lands at p+687..727 while reply 0 lands at p+359..459, so the
- // two ranges overlap and loadDialogueData() would decode garbage.
+ loadDialogueData(DLG_OutsideCollege);
warning("PART_17_HANDLE_DIALOGUE_PHILIP unimplemented");
}
@@ -496,7 +489,6 @@ void IgorEngine::PART_17() {
memcpy(_screenVGA, _screenLayer1, 46080);
- _objectsState[56] = 1;
if (_objectsState[56] == 1) {
_gameState.unkF = false;
PART_17_HELPER_3(6);
Commit: 563669bcb07f8b043401ca3c4e8f135f72f8a36e
https://github.com/scummvm/scummvm/commit/563669bcb07f8b043401ca3c4e8f135f72f8a36e
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:01+01:00
Commit Message:
IGOR: Part 30, encounter with Laura
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/part_17.cpp
engines/igor/part_30.cpp
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index dafeea79316..98d6d6a3b83 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -65,8 +65,9 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- _currentPart = 850;
- // _currentPart = 170;
+ // _currentPart = 850;
+
+ _currentPart = 300;
// _currentPart = 62;
// _currentPart = 40;
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 461059964da..0c17df8258e 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -607,17 +607,20 @@ private:
// 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_ACTION_102_goUpstairs();
+ void PART_30_ACTION_104_goDownstairs();
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_HELPER_2_walkInFromLeft();
+ void PART_30_HELPER_3_walkInFromUpstairs();
+ void PART_30_HELPER_2_walkInFromOutside();
+ void PART_30_HELPER_5_walkInFromRight();
+ void PART_30_HELPER_8_LauraCutscene();
+ void lauraAndIgorBumpIntoEachOther();
+ void igorCrossesArms();
+ void lauraLeaves();
+ void PART_30_HELPER_9_setLauraFrame(int frame);
void PART_30();
// park
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index 3cab772b0f6..fda00928e8d 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -65,6 +65,7 @@ void IgorEngine::PART_17_ACTION_101_walkIn() {
waitForIgorMove();
// Added this line compared to the 2009 version to correct the walk path origin.
--_walkDataLastIndex;
+
buildWalkPath(243, 74, 274, 68);
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
diff --git a/engines/igor/part_30.cpp b/engines/igor/part_30.cpp
index 63b438a67ea..9d37eb59ac2 100644
--- a/engines/igor/part_30.cpp
+++ b/engines/igor/part_30.cpp
@@ -30,15 +30,15 @@ void IgorEngine::PART_30_EXEC_ACTION(int action) {
_currentPart = 231;
break;
case 102:
- PART_30_ACTION_102();
+ PART_30_ACTION_102_goUpstairs();
break;
case 103:
- ADD_DIALOGUE_TEXT(203, 1);
+ ADD_DIALOGUE_TEXT(201, 1);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 104:
- PART_30_ACTION_104();
+ PART_30_ACTION_104_goDownstairs();
break;
case 105:
ADD_DIALOGUE_TEXT(202, 1);
@@ -54,7 +54,7 @@ void IgorEngine::PART_30_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_30_ACTION_102() {
+void IgorEngine::PART_30_ACTION_102_goUpstairs() {
_roomObjectAreasTable[_screenLayer2[24108]].area = 2;
--_walkDataLastIndex;
buildWalkPath(99, 119, 108, 75);
@@ -70,7 +70,7 @@ void IgorEngine::PART_30_ACTION_102() {
_currentPart = 312;
}
-void IgorEngine::PART_30_ACTION_104() {
+void IgorEngine::PART_30_ACTION_104_goDownstairs() {
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[36318]].area = 2;
buildWalkPath(158, 119, 158, 113);
@@ -98,28 +98,28 @@ void IgorEngine::PART_30_ACTION_104() {
void IgorEngine::PART_30_UPDATE_DIALOGUE_LAURA(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_30_HELPER_9(42);
+ PART_30_HELPER_9_setLauraFrame(42);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_30_HELPER_9(getRandomNumber(8) + 42);
+ PART_30_HELPER_9_setLauraFrame(getRandomNumber(8) + 42);
break;
case kUpdateDialogueAnimStanding:
- PART_30_HELPER_9(33);
+ PART_30_HELPER_9_setLauraFrame(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;
+ // 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() {
+void IgorEngine::PART_30_HELPER_2_walkInFromLeft() {
_walkData[0].setPos(0, 138, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -132,7 +132,7 @@ void IgorEngine::PART_30_HELPER_2() {
waitForIgorMove();
}
-void IgorEngine::PART_30_HELPER_3() {
+void IgorEngine::PART_30_HELPER_3_walkInFromUpstairs() {
_roomObjectAreasTable[_screenLayer2[24170]].area = 2;
_walkData[0].setPos(170, 75, 4, 0);
_walkData[0].setDefaultScale();
@@ -157,7 +157,7 @@ void IgorEngine::PART_30_HELPER_3() {
waitForIgorMove();
}
-void IgorEngine::PART_30_HELPER_4() {
+void IgorEngine::PART_30_HELPER_2_walkInFromOutside() {
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
_walkCurrentPos = 3;
@@ -184,7 +184,7 @@ void IgorEngine::PART_30_HELPER_4() {
waitForIgorMove();
}
-void IgorEngine::PART_30_HELPER_5() {
+void IgorEngine::PART_30_HELPER_5_walkInFromRight() {
_walkData[0].setPos(319, 138, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -196,19 +196,11 @@ void IgorEngine::PART_30_HELPER_5() {
waitForIgorMove();
}
-void IgorEngine::PART_30_HELPER_8() {
+void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
playMusic(3);
memset(_screenVGA + 46080, 0, 17920);
fadeIn(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);
- }
- }
+ lauraAndIgorBumpIntoEachOther();
_walkData[0].setPos(172, 134, 2, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 1;
@@ -224,32 +216,29 @@ void IgorEngine::PART_30_HELPER_8() {
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);
- }
+ // igor crosses arms
+ igorCrossesArms();
+ // real dialogue
+
PART_30_HANDLE_DIALOGUE_LAURA();
+ // "Nunca me habian descrito tan bien"
ADD_DIALOGUE_TEXT(207, 1);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
+ // at least you're funny
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);
- }
- }
+ // Laura leaves
+ lauraLeaves();
_walkData[0].setPos(164, 135, 3, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 1;
+ // Que caracter
ADD_DIALOGUE_TEXT(210, 1);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -261,7 +250,38 @@ void IgorEngine::PART_30_HELPER_8() {
PART_30_HELPER_1(255);
}
-void IgorEngine::PART_30_HELPER_9(int frame) {
+void IgorEngine::lauraAndIgorBumpIntoEachOther() {
+// they both walk in
+ 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);
+ }
+ }
+}
+
+void IgorEngine::igorCrossesArms() {
+ 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);
+ }
+}
+
+void IgorEngine::lauraLeaves() {
+ 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);
+ }
+ }
+}
+
+void IgorEngine::PART_30_HELPER_9_setLauraFrame(int frame) {
const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0xBE94 + frame * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
@@ -278,22 +298,23 @@ void IgorEngine::PART_30() {
PART_30_HELPER_1(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
+
if (_objectsState[73] == 0) {
- PART_30_HELPER_8();
+ PART_30_HELPER_8_LauraCutscene();
} else {
if (_currentPart != 302) {
fadeIn(768);
}
- if (_currentPart == 300) {
- PART_30_HELPER_2();
+ if (_currentPart == 300) { // enter from outside
+ PART_30_HELPER_2_walkInFromLeft();
} else if (_currentPart == 301) {
- PART_30_HELPER_3();
+ PART_30_HELPER_3_walkInFromUpstairs();
} else if (_currentPart == 302) {
playMusic(3);
fadeIn(768);
- PART_30_HELPER_4();
+ PART_30_HELPER_2_walkInFromOutside();
} else if (_currentPart == 303) {
- PART_30_HELPER_5();
+ PART_30_HELPER_5_walkInFromRight();
}
}
enterPartLoop();
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 32521135fa8..d7764c427ee 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -381,7 +381,25 @@ 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, 0, 0, 0, 0 }
+ {
+ // Spanish DLG_CollegeStairsFirstFloor (TBL id 34, 0x426040, 2753 bytes) stores its
+ // question cells at blob offset 0, with no leading dialogue matrix. The sound
+ // tables use the same layout proven for part 12 and part 17: questionSoundsOffset
+ // points at a non-indexed residue word, entry i is read at + (i + 1) * 2, and
+ // replySoundsOffset == questionSoundsOffset + questionsSize * 2.
+ // TODO: derive from cseg110 handleDialogue call site (cseg110:018E-019E) where the
+ // original sources room 30's reply graph -- the 115 bytes trailing the sound table
+ // (blob offset 2638..2753) look like it, but that is not yet proven.
+ -205, // -(164 + 41): question 0 line 0 lands on blob offset 0
+ 9, // 9 question cells of 164 bytes, two 41-byte lines each
+ 1374, // = 1476 - 102: reply 0 lands at blob offset 1476 = 9 * 164
+ 11, // 11 reply cells of 102 bytes
+ 30,
+ 0,
+ 2596, // residue word 64760 at blob+2596
+ 2614, // = 2596 + 9 * 2, shares question 8's word as its own residue
+ 11 // reply 10 reads 477 at blob+2636, leaving 115 trailing bytes
+ }
};
const RoomDataOffsets IgorEngine::PART_31_ROOM_DATA_OFFSETS = {
Commit: cc3faf0cba7208139916580957c273c6ebfa37e8
https://github.com/scummvm/scummvm/commit/cc3faf0cba7208139916580957c273c6ebfa37e8
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:02+01:00
Commit Message:
IGOR: Parts 21 and 28 as coming from the legacy engine
Changed paths:
A engines/igor/part_21.cpp
A engines/igor/part_28.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 0c17df8258e..64a07e5a9a2 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -589,6 +589,32 @@ private:
void PART_17_HELPER_11_PhillipHeadTurned(int frame);
void PART_17();
+ // 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();
+
// college corridor lucas
void PART_23_EXEC_ACTION(int action);
void PART_23_ACTION_105();
@@ -605,6 +631,21 @@ private:
void PART_23_HELPER_8(int frame);
void PART_23();
+
+ // 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_goUpstairs();
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index c516e311e1b..1763f14c470 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -25,7 +25,9 @@ MODULE_OBJS = \
part_11.o \
part_12.o \
part_17.o \
+ part_21.o \
part_23.o \
+ part_28.o \
part_30.o \
part_34.o \
part_35.o \
diff --git a/engines/igor/part_21.cpp b/engines/igor/part_21.cpp
new file mode 100644
index 00000000000..43c1619ec25
--- /dev/null
+++ b/engines/igor/part_21.cpp
@@ -0,0 +1,475 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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(4) + 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(4) + 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(4) + 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(1) + 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(5) != 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;
+ fadeIn(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();
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_28.cpp b/engines/igor/part_28.cpp
new file mode 100644
index 00000000000..2634270aa2d
--- /dev/null
+++ b/engines/igor/part_28.cpp
@@ -0,0 +1,353 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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(4) + 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(7) == 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);
+ fadeIn(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) {
+ fadeIn(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();
+ fadeOut(624);
+}
+} // End of namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index ae3780bd993..8b1c98b12bd 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -564,11 +564,20 @@ void IgorEngine::PART_MAIN() {
case 171:
PART_17();
break;
+ case 210:
+ case 211:
+ case 212:
+ PART_21();
+ break;
case 230:
case 231:
case 232:
PART_23();
break;
+ case 280:
+ case 281:
+ PART_28();
+ break;
case 300:
case 301:
case 302:
Commit: 661100f32aabf953c9d08abbf87f273a0f1874ec
https://github.com/scummvm/scummvm/commit/661100f32aabf953c9d08abbf87f273a0f1874ec
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:02+01:00
Commit Message:
IGOR: Fix crash in dialogue with Philip in part 17
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/part_17.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 98d6d6a3b83..08f0358e8f7 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -67,7 +67,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
// _currentPart = 850;
- _currentPart = 300;
+ _currentPart = 171;
// _currentPart = 62;
// _currentPart = 40;
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 64a07e5a9a2..f4679b256e5 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -570,12 +570,12 @@ private:
// outside college
void PART_17_EXEC_ACTION(int action);
void PART_17_ACTION_101_walkIn();
- void PART_17_ACTION_103();
+ void PART_17_ACTION_103_talkPhilipJimmy();
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_DIALOGUE_Jimmy(int action);
+ void PART_17_UPDATE_DIALOGUE_Philip(int action);
void PART_17_UPDATE_ROOM_BACKGROUND();
void PART_17_HELPER_1(int num);
void PART_17_HELPER_2_walkFromMap();
@@ -583,10 +583,10 @@ private:
void PART_17_HELPER_4_paintFirsFrameOfPhilipAndJimmy();
void PART_17_HELPER_5_changeZindexOfPath(int lum);
void PART_17_HELPER_6_walkFromCollege();
- void PART_17_HELPER_8(int num);
- void PART_17_HELPER_9(int num);
+ void PART_17_HELPER_8_PhillipToJimmyAnimFrame(int num);
+ void PART_17_HELPER_9_JimmyTalkingAnimFrame(int num);
void PART_17_HELPER_10();
- void PART_17_HELPER_11_PhillipHeadTurned(int frame);
+ void PART_17_HELPER_11_PhillipToIgor(int frame);
void PART_17();
// college corridor margaret
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index fda00928e8d..89c7a7cfb5b 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -36,7 +36,7 @@ void IgorEngine::PART_17_EXEC_ACTION(int action) {
startIgorDialogue();
break;
case 103: // talk to philip and jimmy
- PART_17_ACTION_103();
+ PART_17_ACTION_103_talkPhilipJimmy();
break;
case 104: // look at file
ADD_DIALOGUE_TEXT(220, 3, 646);
@@ -73,8 +73,9 @@ void IgorEngine::PART_17_ACTION_101_walkIn() {
_currentPart = 302;
}
-void IgorEngine::PART_17_ACTION_103() {
- PART_17_HELPER_8(0);
+void IgorEngine::PART_17_ACTION_103_talkPhilipJimmy() {
+ PART_17_HELPER_8_PhillipToJimmyAnimFrame(0);
+
if (_gameState.counter[4] == 1) {
ADD_DIALOGUE_TEXT(201, 2, 633);
} else if (_gameState.counter[4] == 2) {
@@ -84,28 +85,32 @@ void IgorEngine::PART_17_ACTION_103() {
}
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(156, 32, 35, 38, 47);
- _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP;
+ _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_Jimmy;
waitForEndOfCutsceneDialogue(156, 32, 35, 38, 47);
_updateDialogue = 0;
if (_gameState.counter[4] == 1) {
+ debug("PART_17_ACTION_103_talkPhilipJimmy: counter[4] == 1");
ADD_DIALOGUE_TEXT(203, 1, 634);
ADD_DIALOGUE_TEXT(204, 2, 635);
SET_DIALOGUE_TEXT(1, 2);
} else if (_gameState.counter[4] == 2) {
+ debug("PART_17_ACTION_103_talkPhilipJimmy: counter[4] == 2");
ADD_DIALOGUE_TEXT(208, 2, 637);
SET_DIALOGUE_TEXT(1, 1);
} else if (_gameState.counter[4] == 3) {
+ debug("PART_17_ACTION_103_talkPhilipJimmy: counter[4] == 3");
ADD_DIALOGUE_TEXT(212, 2, 639);
ADD_DIALOGUE_TEXT(214, 1, 640);
SET_DIALOGUE_TEXT(1, 2);
}
startCutsceneDialogue(135, 33, 63, 63, 0);
VAR_CURRENT_TALKING_ACTOR = 0;
- _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP_JIMMY;
+ _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip;
waitForEndOfCutsceneDialogue(135, 33, 63, 63, 0);
_updateDialogue = 0;
- PART_17_HELPER_11_PhillipHeadTurned(0);
+
+ PART_17_HELPER_11_PhillipToIgor(0);
waitForTimer(255);
const int randomDialogue = getRandomNumber(3);
@@ -113,12 +118,14 @@ void IgorEngine::PART_17_ACTION_103() {
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(135, 33, 63, 63, 0);
VAR_CURRENT_TALKING_ACTOR = 1;
- _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP_JIMMY;
+ _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip;
waitForEndOfCutsceneDialogue(135, 33, 63, 63, 0);
_updateDialogue = 0;
+
PART_17_HANDLE_DIALOGUE_PHILIP();
PART_17_HELPER_1(255);
- PART_17_HELPER_8(0);
+ PART_17_HELPER_8_PhillipToJimmyAnimFrame(0);
+
--_walkDataLastIndex;
buildWalkPath(104, 87, 143, 123);
_walkDataCurrentIndex = 1;
@@ -128,6 +135,7 @@ void IgorEngine::PART_17_ACTION_103() {
ADD_DIALOGUE_TEXT(219, 1, 645);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
+ waitForEndOfIgorDialogue();
if (_gameState.counter[4] == 3) {
_gameState.counter[4] = 1;
} else {
@@ -225,31 +233,34 @@ void IgorEngine::PART_17_HANDLE_DIALOGUE_PHILIP() {
warning("PART_17_HANDLE_DIALOGUE_PHILIP unimplemented");
}
-void IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP(int action) {
+void IgorEngine::PART_17_UPDATE_DIALOGUE_Jimmy(int action) {
+ debug("PART_17_UPDATE_DIALOGUE_Jimmy action: %d", action);
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_17_HELPER_9(0);
+ PART_17_HELPER_9_JimmyTalkingAnimFrame(0);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_17_HELPER_9(getRandomNumber(6));
+ PART_17_HELPER_9_JimmyTalkingAnimFrame(getRandomNumber(6));
break;
}
}
-void IgorEngine::PART_17_UPDATE_DIALOGUE_PHILIP_JIMMY(int action) {
+void IgorEngine::PART_17_UPDATE_DIALOGUE_Philip(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
if (VAR_CURRENT_TALKING_ACTOR == 0) {
- PART_17_HELPER_8(0);
+ PART_17_HELPER_8_PhillipToJimmyAnimFrame(0);
} else {
- PART_17_HELPER_11_PhillipHeadTurned(0);
+ PART_17_HELPER_11_PhillipToIgor(0);
}
break;
case kUpdateDialogueAnimMiddleOfSentence:
if (VAR_CURRENT_TALKING_ACTOR == 0) {
- PART_17_HELPER_8(getRandomNumber(6));
+ debug("PART_17_HELPER_8_PhillipToJimmyAnimFrame");
+ PART_17_HELPER_8_PhillipToJimmyAnimFrame(getRandomNumber(6));
} else {
- PART_17_HELPER_11_PhillipHeadTurned(getRandomNumber(5));
+ debug("PART_17_HELPER_11_PhillipToIgor");
+ PART_17_HELPER_11_PhillipToIgor(getRandomNumber(5));
}
break;
}
@@ -261,12 +272,12 @@ void IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND() {
// Counter (unk10) values 16 through 31 animate the other character.
switch (_gameState.unk10 / 16) {
case 0: // animate jimmy
- PART_17_HELPER_8(0);
- PART_17_HELPER_9(getRandomNumber(6));
+ PART_17_HELPER_8_PhillipToJimmyAnimFrame(0);
+ PART_17_HELPER_9_JimmyTalkingAnimFrame(getRandomNumber(6));
break;
case 1: // animate philip
- PART_17_HELPER_8(getRandomNumber(6));
- PART_17_HELPER_9(0);
+ PART_17_HELPER_8_PhillipToJimmyAnimFrame(getRandomNumber(6));
+ PART_17_HELPER_9_JimmyTalkingAnimFrame(0);
}
if (_gameState.unk10 == 31) {
_gameState.unk10 = 0;
@@ -417,7 +428,7 @@ void IgorEngine::PART_17_HELPER_6_walkFromCollege() {
_roomObjectAreasTable[28].area = 0;
}
-void IgorEngine::PART_17_HELPER_8(int num) {
+void IgorEngine::PART_17_HELPER_8_PhillipToJimmyAnimFrame(int num) {
for (int i = 0; i <= 8; ++i) {
for (int j = 0; j <= 10; ++j) {
int offset = (36 + i) * 320 + 130 + j;
@@ -436,7 +447,7 @@ void IgorEngine::PART_17_HELPER_8(int num) {
}
}
-void IgorEngine::PART_17_HELPER_9(int num) {
+void IgorEngine::PART_17_HELPER_9_JimmyTalkingAnimFrame(int num) {
for (int i = 0; i <= 26; ++i) {
for (int j = 0; j <= 22; ++j) {
int offset = (36 + i) * 320 + 143 + j;
@@ -455,7 +466,7 @@ void IgorEngine::PART_17_HELPER_9(int num) {
}
}
-void IgorEngine::PART_17_HELPER_11_PhillipHeadTurned(int frame) {
+void IgorEngine::PART_17_HELPER_11_PhillipToIgor(int frame) {
for (int i = 0; i <= 8; ++i) {
for (int j = 0; j <= 10; ++j) {
int offset = (i + 36) * 320 + j + 130;
@@ -489,7 +500,7 @@ void IgorEngine::PART_17() {
PART_17_HELPER_1(255);
memcpy(_screenVGA, _screenLayer1, 46080);
-
+ _gameState.unkF = true;
if (_objectsState[56] == 1) {
_gameState.unkF = false;
PART_17_HELPER_3(6);
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index bee8559e495..3f1f1d30f52 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -112,6 +112,7 @@ void IgorEngine::SET_DIALOGUE_TEXT(int start, int count) {
* sets the positional state of the text to be displayed
*/
void IgorEngine::fixDialogueTextPosition(int num, int count, int *x, int *y) {
+ debugC(9, kDebugEngine, "fixDialogueTextPosition() for line %s, count %d, x %d, y %d", _globalDialogueTexts[num], count, *x, *y);
int textLineWidth = 0;
for (int i = 0; i < count; ++i) {
int w = _font.getStringWidth(_globalDialogueTexts[num + i]);
Commit: 0bb1a3def9d28fd0b4a8d7429edad898b77915f2
https://github.com/scummvm/scummvm/commit/0bb1a3def9d28fd0b4a8d7429edad898b77915f2
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:02+01:00
Commit Message:
IGOR: Implement fast mode
Changed paths:
engines/igor/console.cpp
engines/igor/console.h
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
diff --git a/engines/igor/console.cpp b/engines/igor/console.cpp
index b7f4aa3b2de..fc1c027fd76 100644
--- a/engines/igor/console.cpp
+++ b/engines/igor/console.cpp
@@ -32,6 +32,7 @@ Console::Console() : GUI::Debugger() {
registerCmd("paint_y2lum", WRAP_METHOD(Console, Cmd_paintY2Lum));
registerCmd("paint_deltalum", WRAP_METHOD(Console, Cmd_paintDeltaLum));
registerCmd("paint_off", WRAP_METHOD(Console, Cmd_paintOff));
+ registerCmd("fast_mode", WRAP_METHOD(Console, Cmd_fastMode));
registerCmd("changePart", WRAP_METHOD(Console, Cmd_changePart));
registerCmd("addObjectToInventory", WRAP_METHOD(Console, Cmd_addObjectToInventory));
}
@@ -45,65 +46,64 @@ bool Console::Cmd_test(int argc, const char **argv) {
}
bool Console::Cmd_paintWalk(int argc, const char **argv) {
- if (!g_engine) {
- debugPrintf("Engine not running\n");
- return true;
- }
debugPrintf("Overlay: walk areas (BOX .area != 0); colours are the area id\n");
g_engine->debugPaintWalkAreas();
return true;
}
bool Console::Cmd_paintHotspots(int argc, const char **argv) {
- if (!g_engine) {
- debugPrintf("Engine not running\n");
- return true;
- }
debugPrintf("Overlay: hotspots (BOX .object != 0); colours are the object id\n");
g_engine->debugPaintHotspots();
return true;
}
bool Console::Cmd_paintY1Lum(int argc, const char **argv) {
- if (!g_engine) {
- debugPrintf("Engine not running\n");
- return true;
- }
debugPrintf("Overlay: y1Lum (BOX .y1Lum != 0); colour index is value / 16\n");
g_engine->debugPaintY1Lum();
return true;
}
bool Console::Cmd_paintY2Lum(int argc, const char **argv) {
- if (!g_engine) {
- debugPrintf("Engine not running\n");
- return true;
- }
+
debugPrintf("Overlay: y2Lum (BOX .y2Lum != 0); colour index is value / 16\n");
g_engine->debugPaintY2Lum();
return true;
}
bool Console::Cmd_paintDeltaLum(int argc, const char **argv) {
- if (!g_engine) {
- debugPrintf("Engine not running\n");
- return true;
- }
+
debugPrintf("Overlay: deltaLum (BOX .deltaLum != 0); colour index is value & 0x0F\n");
g_engine->debugPaintDeltaLum();
return true;
}
bool Console::Cmd_paintOff(int argc, const char **argv) {
- if (!g_engine) {
- debugPrintf("Engine not running\n");
- return true;
- }
g_engine->debugClearOverlay();
debugPrintf("Overlay off\n");
return true;
}
+bool Console::Cmd_fastMode(int argc, const char **argv) {
+
+ if (argc != 2) {
+ debugPrintf("Usage: %s <factor>\n", argv[0]);
+ debugPrintf(" 1 = original speed (%d ms per tick), higher is faster; Ctrl+F toggles 1/%d\n",
+ kTimerTicksCount * 1000 / kTickDelay, kFastModeFactor);
+ debugPrintf(" Current factor: %d\n", g_engine->debugGetFastMode());
+ return true;
+ }
+
+ const int factor = atoi(argv[1]);
+ if (factor < 1 || factor > kFastModeMaxFactor) {
+ debugPrintf("Invalid factor '%s' (valid range 1-%d)\n", argv[1], kFastModeMaxFactor);
+ return true;
+ }
+
+ g_engine->debugSetFastMode(factor);
+ debugPrintf("Speed factor %d (%d ms per tick)\n", factor, kTimerTicksCount * 1000 / kTickDelay / factor);
+ return true;
+}
+
bool Console::Cmd_changePart(int argc, const char **argv) {
if (argc != 2) {
debugPrintf("Usage: %s <state code>\n", argv[0]);
diff --git a/engines/igor/console.h b/engines/igor/console.h
index 3fd8aedbb01..04f0d9f8083 100644
--- a/engines/igor/console.h
+++ b/engines/igor/console.h
@@ -36,6 +36,7 @@ private:
bool Cmd_paintY2Lum(int argc, const char **argv);
bool Cmd_paintDeltaLum(int argc, const char **argv);
bool Cmd_paintOff(int argc, const char **argv);
+ bool Cmd_fastMode(int argc, const char **argv);
bool Cmd_changePart(int argc, const char **argv);
bool Cmd_addObjectToInventory(int argc, const char **argv);
public:
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 08f0358e8f7..14a64304b0c 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -77,6 +77,8 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
// } else {
// _midiPlayer = 0;
// }
+
+ _fastMode = 1;
}
IgorEngine::~IgorEngine() {
@@ -117,7 +119,7 @@ void IgorEngine::restart() {
memset(&_gameState, 0, sizeof(_gameState));
_nextTimer = 0;
- // _fastMode = false;
+ _fastMode = 1;
_language = 0;
memset(_walkData, 0, sizeof(_walkData));
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index f4679b256e5..5c74772b96e 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -61,6 +61,8 @@ enum {
kTalkShadowColor = 241,
kTickDelay = 1193180 / 4096,
kTimerTicksCount = 8,
+ kFastModeFactor = 4,
+ kFastModeMaxFactor = 16,
kQuickSaveSlot = 0,
kMaxSaveStates = 10,
kNoSpeechSound = 999
@@ -344,6 +346,12 @@ private:
GameStateData _gameState;
uint32 _nextTimer;
+ // Speed multiplier, 1 = original timing. Divides the millisecond
+ // deadlines in waitForTimer();
+ // Toggled with Ctrl+F (1 <-> kFastModeFactor), or set to any 1..kFastModeMaxFactor
+ // with the console's fast_mode command.
+ int _fastMode;
+
int _language;
DetectedGameVersion _game;
int _currentCursor;
@@ -830,6 +838,8 @@ public:
void debugPaintY2Lum();
void debugPaintDeltaLum();
void debugClearOverlay();
+ void debugSetFastMode(int factor) { _fastMode = factor; }
+ int debugGetFastMode() const { return _fastMode; }
void debugChangePart(int state);
bool debugAddObjectToInventory(int object);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index f041df4e76d..feee49e9f85 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -40,7 +40,8 @@ void IgorEngine::waitForTimer(int ticks) {
_system->updateScreen();
// wait till next timer if no param is passed, ticks if not
- uint32 endTicks = (ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay;
+ // _fastMode divides the wall-clock deadlines
+ uint32 endTicks = (ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay / _fastMode;
do {
Common::Event ev;
while (_eventMan->pollEvent(ev)) {
@@ -51,7 +52,11 @@ void IgorEngine::waitForTimer(int ticks) {
_eventQuitGame = true;
break;
case Common::EVENT_KEYDOWN:
- if (ev.kbd.keycode == Common::KEYCODE_ESCAPE) {
+ if (ev.kbd.keycode == Common::KEYCODE_f && (ev.kbd.flags & Common::KBD_CTRL)) {
+ _fastMode = (_fastMode == 1) ? kFastModeFactor : 1;
+ debugC(1, kDebugEngine, "Ctrl+F: fast mode %d (%d ms per tick)",
+ _fastMode, kTimerTicksCount * 1000 / kTickDelay / _fastMode);
+ } else if (ev.kbd.keycode == Common::KEYCODE_ESCAPE) {
_inputVars[kInputEscape] = 1;
} else if (ev.kbd.keycode == Common::KEYCODE_SPACE) {
_inputVars[kInputOptions] = 1;
@@ -86,13 +91,15 @@ void IgorEngine::waitForTimer(int ticks) {
break;
}
}
- _system->delayMillis(10);
+ // Keep the poll granularity proportional, otherwise a 10 ms sleep
+ // overshoots the shortened deadline at high factors.
+ _system->delayMillis(MAX(1, 10 / _fastMode));
if (_system->getMillis() >= endTicks) {
break;
}
} while (true);
- _nextTimer = _system->getMillis() + kTimerTicksCount * 1000 / kTickDelay;
+ _nextTimer = _system->getMillis() + kTimerTicksCount * 1000 / kTickDelay / _fastMode;
if (ticks != -1) {
return;
}
@@ -175,6 +182,7 @@ void IgorEngine::handleRoomInput() {
_talkSpeechCounter = -1;
}
_inputVars[kInputSkipDialogue] = 0;
+
}
if (!_roomCursorOn || _gameState.dialogueTextRunning || _scrollInventory) {
Commit: a9db2bbeea5cfb2d0499d28050537128b47412ca
https://github.com/scummvm/scummvm/commit/a9db2bbeea5cfb2d0499d28050537128b47412ca
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:03+01:00
Commit Message:
IGOR: Speech indices for room 23, 28 and 30
Changed paths:
engines/igor/igor.h
engines/igor/part_23.cpp
engines/igor/part_28.cpp
engines/igor/part_30.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 5c74772b96e..c772868e008 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -625,16 +625,16 @@ private:
// 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_ACTION_105_enterLadiesRoom();
+ void PART_23_ACTION_107_openDoor();
+ void PART_23_ACTION_108_closeDoor();
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_4_walkFromDoor();
+ void PART_23_HELPER_5_walkFromLeft();
+ void PART_23_HELPER_6_walkFromRight();
void PART_23_HELPER_7(int frame);
void PART_23_HELPER_8(int frame);
void PART_23();
diff --git a/engines/igor/part_23.cpp b/engines/igor/part_23.cpp
index b24f7a066ef..71de7ac73f5 100644
--- a/engines/igor/part_23.cpp
+++ b/engines/igor/part_23.cpp
@@ -30,47 +30,47 @@ void IgorEngine::PART_23_EXEC_ACTION(int action) {
case 101:
_currentPart = 280;
break;
- case 102:
- ADD_DIALOGUE_TEXT(201, 2);
+ case 102: // look at portrait
+ ADD_DIALOGUE_TEXT(201, 2, 1217);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 105:
- PART_23_ACTION_105();
+ PART_23_ACTION_105_enterLadiesRoom();
break;
- case 106:
- ADD_DIALOGUE_TEXT(205, 1);
+ case 106: // look at door
+ ADD_DIALOGUE_TEXT(205, 1, 1220);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 107:
- PART_23_ACTION_107();
+ case 107: // open door
+ PART_23_ACTION_107_openDoor();
break;
- case 108:
- PART_23_ACTION_108();
+ case 108: // close door
+ PART_23_ACTION_108_closeDoor();
break;
- case 109:
+ case 109: // go through right corridor
_currentPart = 300;
break;
- case 110:
- ADD_DIALOGUE_TEXT(203, 1);
- ADD_DIALOGUE_TEXT(204, 1);
+ case 110: // Look at Lucas
+ ADD_DIALOGUE_TEXT(203, 1, 1218);
+ ADD_DIALOGUE_TEXT(204, 1, 1219);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
break;
case 111:
- ADD_DIALOGUE_TEXT(208, 2);
+ ADD_DIALOGUE_TEXT(208, 2, 1222);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 112:
- ADD_DIALOGUE_TEXT(210, 1);
- ADD_DIALOGUE_TEXT(211, 1);
+ ADD_DIALOGUE_TEXT(210, 1, 1223);
+ ADD_DIALOGUE_TEXT(211, 1, 1224);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
break;
case 113:
- ADD_DIALOGUE_TEXT(212, 1);
+ ADD_DIALOGUE_TEXT(212, 1, 1225);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -80,7 +80,7 @@ void IgorEngine::PART_23_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_23_ACTION_105() {
+void IgorEngine::PART_23_ACTION_105_enterLadiesRoom() {
if (_objectsState[66] != 0) {
_roomObjectAreasTable[_screenLayer2[38633]].area = 1;
--_walkDataLastIndex;
@@ -92,7 +92,7 @@ void IgorEngine::PART_23_ACTION_105() {
}
}
-void IgorEngine::PART_23_ACTION_107() {
+void IgorEngine::PART_23_ACTION_107_openDoor() {
if (_objectsState[66] == 1) {
EXEC_MAIN_ACTION(11);
} else {
@@ -109,7 +109,7 @@ void IgorEngine::PART_23_ACTION_107() {
}
}
-void IgorEngine::PART_23_ACTION_108() {
+void IgorEngine::PART_23_ACTION_108_closeDoor() {
if (_objectsState[66] == 0) {
EXEC_MAIN_ACTION(14);
} else {
@@ -171,7 +171,7 @@ void IgorEngine::PART_23_HELPER_3() {
}
}
-void IgorEngine::PART_23_HELPER_4() {
+void IgorEngine::PART_23_HELPER_4_walkFromDoor() {
_walkData[0].setPos(233, 120, 3, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 0;
@@ -199,13 +199,13 @@ void IgorEngine::PART_23_HELPER_4() {
playSound(14, 1);
_objectsState[66] = 0;
PART_23_HELPER_1(1);
- ADD_DIALOGUE_TEXT(206, 2);
+ ADD_DIALOGUE_TEXT(206, 2, 1221);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
}
-void IgorEngine::PART_23_HELPER_5() {
+void IgorEngine::PART_23_HELPER_5_walkFromLeft() {
_walkData[0].setPos(0, 134, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 15;
@@ -218,7 +218,7 @@ void IgorEngine::PART_23_HELPER_5() {
waitForIgorMove();
}
-void IgorEngine::PART_23_HELPER_6() {
+void IgorEngine::PART_23_HELPER_6_walkFromRight() {
_walkData[0].setPos(319, 134, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -261,18 +261,20 @@ void IgorEngine::PART_23() {
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;
fadeIn(768);
+
if (_currentPart == 230) {
- PART_23_HELPER_5();
+ PART_23_HELPER_5_walkFromLeft();
} else if (_currentPart == 231) {
- PART_23_HELPER_6();
+ PART_23_HELPER_6_walkFromRight();
} else if (_currentPart == 232) {
- PART_23_HELPER_4();
+ PART_23_HELPER_4_walkFromDoor();
}
enterPartLoop();
while (_currentPart >= 230 && _currentPart <= 232) {
diff --git a/engines/igor/part_28.cpp b/engines/igor/part_28.cpp
index 2634270aa2d..b8a672944d9 100644
--- a/engines/igor/part_28.cpp
+++ b/engines/igor/part_28.cpp
@@ -30,39 +30,39 @@ void IgorEngine::PART_28_EXEC_ACTION(int action) {
_currentPart = 230;
break;
case 102:
- ADD_DIALOGUE_TEXT(201, 1);
+ ADD_DIALOGUE_TEXT(201, 1, 1226);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 103:
- ADD_DIALOGUE_TEXT(202, 1);
+ ADD_DIALOGUE_TEXT(202, 1, 1227);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 104:
- ADD_DIALOGUE_TEXT(203, 1);
+ ADD_DIALOGUE_TEXT(203, 1, 1228);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 105:
- ADD_DIALOGUE_TEXT(204, 1);
+ ADD_DIALOGUE_TEXT(204, 1, 1229);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 106:
if (_objectsState[111] == 0) {
- ADD_DIALOGUE_TEXT(205, 1);
- ADD_DIALOGUE_TEXT(206, 1);
+ ADD_DIALOGUE_TEXT(205, 1, 1230);
+ ADD_DIALOGUE_TEXT(206, 1, 1231);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
} else {
- ADD_DIALOGUE_TEXT(234, 1);
+ ADD_DIALOGUE_TEXT(234, 1, 1253);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
break;
case 107:
- ADD_DIALOGUE_TEXT(237, 1);
+ ADD_DIALOGUE_TEXT(237, 1, 1256);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -73,28 +73,28 @@ void IgorEngine::PART_28_EXEC_ACTION(int action) {
PART_28_ACTION_109();
break;
case 110:
- ADD_DIALOGUE_TEXT(228, 1);
- ADD_DIALOGUE_TEXT(229, 1);
+ ADD_DIALOGUE_TEXT(228, 1, 1248);
+ ADD_DIALOGUE_TEXT(229, 1, 1249);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
break;
case 111:
if (_objectsState[3] == 0) {
- ADD_DIALOGUE_TEXT(226, 1);
+ ADD_DIALOGUE_TEXT(226, 1, 1246);
SET_DIALOGUE_TEXT(1, 1);
} else {
- ADD_DIALOGUE_TEXT(227, 1);
+ ADD_DIALOGUE_TEXT(227, 1, 1247);
SET_DIALOGUE_TEXT(1, 1);
}
startIgorDialogue();
break;
case 112:
- ADD_DIALOGUE_TEXT(235, 1);
+ ADD_DIALOGUE_TEXT(235, 1, 1254);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 113:
- ADD_DIALOGUE_TEXT(236, 1);
+ ADD_DIALOGUE_TEXT(236, 1, 1255);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -106,20 +106,20 @@ void IgorEngine::PART_28_EXEC_ACTION(int action) {
void IgorEngine::PART_28_ACTION_108() {
if (_objectsState[111] == 1) {
- ADD_DIALOGUE_TEXT(218, 1);
+ ADD_DIALOGUE_TEXT(218, 1, 1241);
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);
+ ADD_DIALOGUE_TEXT(211, 1, 1235);
+ ADD_DIALOGUE_TEXT(212, 1, 1236);
+ ADD_DIALOGUE_TEXT(213, 2, 1237);
+ ADD_DIALOGUE_TEXT(215, 1, 1238);
+ ADD_DIALOGUE_TEXT(216, 1, 1239);
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);
+ ADD_DIALOGUE_TEXT(217, 1, 1240);
SET_DIALOGUE_TEXT(1, 5);
startCutsceneDialogue(182, 81, 63, 17, 17);
waitForEndOfCutsceneDialogue(182, 81, 63, 17, 17);
@@ -131,26 +131,26 @@ void IgorEngine::PART_28_ACTION_108() {
_walkData[_walkDataLastIndex].posNum = 3;
_gameState.igorMoving = true;
waitForIgorMove();
- ADD_DIALOGUE_TEXT(222, 2);
+ ADD_DIALOGUE_TEXT(222, 2, 1244);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
}
if (_objectsState[87] < 2) {
- ADD_DIALOGUE_TEXT(207, 1);
+ ADD_DIALOGUE_TEXT(207, 1, 1232);
SET_DIALOGUE_TEXT(1, 1);
} else {
- ADD_DIALOGUE_TEXT(218, 1);
+ ADD_DIALOGUE_TEXT(218, 1, 1241);
SET_DIALOGUE_TEXT(1, 1);
}
startIgorDialogue();
waitForEndOfIgorDialogue();
if (_objectsState[87] < 2) {
- ADD_DIALOGUE_TEXT(208, 1);
+ ADD_DIALOGUE_TEXT(208, 1, 1233);
SET_DIALOGUE_TEXT(1, 1);
} else {
- ADD_DIALOGUE_TEXT(219, 2);
- ADD_DIALOGUE_TEXT(221, 1);
+ ADD_DIALOGUE_TEXT(219, 2, 1242);
+ ADD_DIALOGUE_TEXT(221, 1, 1243);
SET_DIALOGUE_TEXT(1, 2);
}
startCutsceneDialogue(182, 81, 63, 17, 17);
@@ -172,7 +172,7 @@ void IgorEngine::PART_28_ACTION_109() {
addObjectToInventory(22, 57);
_objectsState[87] = 1;
PART_28_HELPER_1(255);
- ADD_DIALOGUE_TEXT(230, 1);
+ ADD_DIALOGUE_TEXT(230, 1, 1250);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
if (_game.version == kIdEngDemo110) {
@@ -291,12 +291,12 @@ void IgorEngine::PART_28_HELPER_6() {
_walkData[_walkDataLastIndex].posNum = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- ADD_DIALOGUE_TEXT(209, 2);
+ ADD_DIALOGUE_TEXT(209, 2, 1234);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
waitForTimer(255);
- ADD_DIALOGUE_TEXT(231, 1);
+ ADD_DIALOGUE_TEXT(231, 1, 1251);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -306,8 +306,8 @@ void IgorEngine::PART_28_HELPER_6() {
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
waitForIgorMove();
- ADD_DIALOGUE_TEXT(224, 2);
- ADD_DIALOGUE_TEXT(232, 2);
+ ADD_DIALOGUE_TEXT(224, 2, 1245);
+ ADD_DIALOGUE_TEXT(232, 2, 1252);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -334,6 +334,13 @@ void IgorEngine::PART_28() {
PART_28_HELPER_1(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
+ // cseg123:2E04 -- the original's only write to the background-animation frame
+ // counter (s3:0xEB2C) is an unconditional set to 1 in this room's setup, made
+ // before the state dispatch below. PART_28_HELPER_5() forms its source address
+ // as animBase + frame * 1320 + i * 30 + j - 1320 (cseg123:0B7-0D5), so the frame
+ // is 1-based and a counter of 0 reads 1320 bytes before _animFramesBuffer.
+ // Without this the first background update reads out of bounds.
+ _gameState.unk10 = 1;
if (_currentPart == 280) {
fadeIn(768);
PART_28_HELPER_3();
diff --git a/engines/igor/part_30.cpp b/engines/igor/part_30.cpp
index 9d37eb59ac2..7c448771267 100644
--- a/engines/igor/part_30.cpp
+++ b/engines/igor/part_30.cpp
@@ -33,7 +33,7 @@ void IgorEngine::PART_30_EXEC_ACTION(int action) {
PART_30_ACTION_102_goUpstairs();
break;
case 103:
- ADD_DIALOGUE_TEXT(201, 1);
+ ADD_DIALOGUE_TEXT(201, 1, 450);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -41,7 +41,7 @@ void IgorEngine::PART_30_EXEC_ACTION(int action) {
PART_30_ACTION_104_goDownstairs();
break;
case 105:
- ADD_DIALOGUE_TEXT(202, 1);
+ ADD_DIALOGUE_TEXT(202, 1, 451);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -206,13 +206,13 @@ void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
_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);
+ ADD_DIALOGUE_TEXT(203, 1, 452);
+ ADD_DIALOGUE_TEXT(204, 1, 453);
+ ADD_DIALOGUE_TEXT(205, 1, 454);
SET_DIALOGUE_TEXT(1, 3);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(206, 1);
+ ADD_DIALOGUE_TEXT(206, 1, 455);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(201, 85, 63, 0, 38);
waitForEndOfCutsceneDialogue(201, 85, 63, 0, 38);
@@ -222,13 +222,13 @@ void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
PART_30_HANDLE_DIALOGUE_LAURA();
// "Nunca me habian descrito tan bien"
- ADD_DIALOGUE_TEXT(207, 1);
+ ADD_DIALOGUE_TEXT(207, 1, 456);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
// at least you're funny
- ADD_DIALOGUE_TEXT(208, 1);
- ADD_DIALOGUE_TEXT(209, 1);
+ ADD_DIALOGUE_TEXT(208, 1, 457);
+ ADD_DIALOGUE_TEXT(209, 1, 458);
SET_DIALOGUE_TEXT(1, 2);
startCutsceneDialogue(201, 85, 63, 0, 38);
waitForEndOfCutsceneDialogue(201, 85, 63, 0, 38);
@@ -239,7 +239,7 @@ void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
_walkData[0].setDefaultScale();
_walkDataLastIndex = 1;
// Que caracter
- ADD_DIALOGUE_TEXT(210, 1);
+ ADD_DIALOGUE_TEXT(210, 1, 459);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
memset(_screenVGA + 46080, 0, 17920);
Commit: 9a89115c3c5a8911f3b29eb0b591ceccc8c8a6dd
https://github.com/scummvm/scummvm/commit/9a89115c3c5a8911f3b29eb0b591ceccc8c8a6dd
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:03+01:00
Commit Message:
IGOR: Improvements on speech advancement & click dismissal
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/sound.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 14a64304b0c..3b3ce19637f 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -268,10 +268,18 @@ void IgorEngine::runPartLoop() {
void IgorEngine::handleRoomDialogue() {
if (_gameState.dialogueTextRunning) {
+ // Speech completion ends the sentence, exactly as in the two blocking
+ // dialogue loops. Without this the sentence only ever ends on a click:
+ if (_gameState.talkMode != kTalkModeTextOnly && !isDialogueSpeechPlaying()) {
+ _talkDelayCounter = _talkDelay;
+ }
if (_talkDelayCounter == _talkDelay) {
animateIgorTalking(0);
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
if (_dialogueTextsCount == 0) {
+ // Speech must stop with the last line, otherwise it keeps playing
+ // after the text is gone and nothing is left to stop it.
+ stopDialogueSpeech();
_gameState.dialogueTextRunning = false;
showCursor();
} else {
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index c772868e008..c40335c0682 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -464,6 +464,7 @@ private:
void waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b);
bool isDialogueSpeechPlaying() const;
+ void stopDialogueSpeech();
void PART_MAIN();
void moveScreenUp(int offset);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index feee49e9f85..be39f60a902 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -182,7 +182,9 @@ void IgorEngine::handleRoomInput() {
_talkSpeechCounter = -1;
}
_inputVars[kInputSkipDialogue] = 0;
-
+ // The click that dismissed the dialogue must not survive into the room
+ // handler: handleRoomInput()
+ _inputVars[kInputClick] = 0;
}
if (!_roomCursorOn || _gameState.dialogueTextRunning || _scrollInventory) {
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index e40fa77b38e..2f0bd2632c3 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -56,12 +56,14 @@ void IgorEngine::playSound(int num, int type) {
soundOffset = _soundOffsets[num];
soundType = Audio::Mixer::kSFXSoundType;
soundHandle = &_sfxHandle;
- } else if (type == 0 && (_game.flags & kFlagTalkie) != 0 && num != kNoSpeechSound) {
- // debugC(9, kDebugEngine, "playSound() %d on speech handle", num);
+ } else if (type == 0) {
if (_mixer->isSoundHandleActive(_speechHandle)) {
debugC(9, kDebugEngine, "stopping previous handle");
_mixer->stopHandle(_speechHandle);
}
+ if ((_game.flags & kFlagTalkie) == 0 || num == kNoSpeechSound) {
+ return;
+ }
num += 101;
assert(num >= 0 && num < _soundOffsetsCount);
soundOffset = _soundOffsets[num];
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 3f1f1d30f52..8f4c6dba2b9 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -201,9 +201,7 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
do {
// stop speech if skip dialogue hit
if (_gameState.dialogueTextRunning && _inputVars[kInputSkipDialogue]) {
- if (_mixer->isSoundHandleActive(_speechHandle)) {
- _mixer->stopHandle(_speechHandle);
- }
+ stopDialogueSpeech();
_talkDelayCounter = _talkDelay;
_inputVars[kInputSkipDialogue] = 0;
}
@@ -220,6 +218,7 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
}
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
if (_dialogueTextsCount == 0) {
+ stopDialogueSpeech();
_gameState.dialogueTextRunning = 0;
} else {
++_dialogueTextsStart;
@@ -267,6 +266,12 @@ bool IgorEngine::isDialogueSpeechPlaying() const {
return _gameState.talkMode != kTalkModeTextOnly && _mixer->isSoundHandleActive(_speechHandle);
}
+void IgorEngine::stopDialogueSpeech() {
+ if (_mixer->isSoundHandleActive(_speechHandle)) {
+ _mixer->stopHandle(_speechHandle);
+ }
+}
+
void IgorEngine::startIgorDialogue() {
debugC(9, kDebugEngine, "startIgorDialogue()");
--_dialogueTextsCount;
@@ -319,9 +324,7 @@ void IgorEngine::startIgorDialogue() {
void IgorEngine::waitForEndOfIgorDialogue() {
do {
if (_gameState.dialogueTextRunning && _inputVars[kInputSkipDialogue]) {
- if (_mixer->isSoundHandleActive(_speechHandle)) {
- _mixer->stopHandle(_speechHandle);
- }
+ stopDialogueSpeech();
_talkDelayCounter = _talkDelay;
_inputVars[kInputSkipDialogue] = 0;
}
@@ -336,6 +339,7 @@ void IgorEngine::waitForEndOfIgorDialogue() {
animateIgorTalking(0);
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
if (_dialogueTextsCount == 0) {
+ stopDialogueSpeech();
_gameState.dialogueTextRunning = 0;
} else {
++_dialogueTextsStart;
Commit: 19d44c1bd4b752c502802fa1ee7f861498c9a151
https://github.com/scummvm/scummvm/commit/19d44c1bd4b752c502802fa1ee7f861498c9a151
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:03+01:00
Commit Message:
IGOR: Allows using object + object
Changed paths:
engines/igor/console.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_17.cpp
diff --git a/engines/igor/console.cpp b/engines/igor/console.cpp
index fc1c027fd76..39d53cc4b1d 100644
--- a/engines/igor/console.cpp
+++ b/engines/igor/console.cpp
@@ -33,8 +33,8 @@ Console::Console() : GUI::Debugger() {
registerCmd("paint_deltalum", WRAP_METHOD(Console, Cmd_paintDeltaLum));
registerCmd("paint_off", WRAP_METHOD(Console, Cmd_paintOff));
registerCmd("fast_mode", WRAP_METHOD(Console, Cmd_fastMode));
- registerCmd("changePart", WRAP_METHOD(Console, Cmd_changePart));
- registerCmd("addObjectToInventory", WRAP_METHOD(Console, Cmd_addObjectToInventory));
+ registerCmd("room", WRAP_METHOD(Console, Cmd_changePart));
+ registerCmd("give", WRAP_METHOD(Console, Cmd_addObjectToInventory));
}
Console::~Console() {
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 3b3ce19637f..8c68425d4d8 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -472,6 +472,7 @@ void IgorEngine::drawInventory(int start, int mode) {
void IgorEngine::addObjectToInventory(int object, int index) {
+ debugC(9, kDebugEngine, "addObjectToInventory %d %d", object, index);
++_inventoryInfo[73];
_inventoryInfo[_inventoryInfo[73] - 1] = object;
_inventoryInfo[index] = _inventoryInfo[73];
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index c40335c0682..367b673e484 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -581,7 +581,7 @@ private:
void PART_17_ACTION_101_walkIn();
void PART_17_ACTION_103_talkPhilipJimmy();
void PART_17_ACTION_105();
- void PART_17_ACTION_106();
+ void PART_17_ACTION_106_swapFolders();
void PART_17_HANDLE_DIALOGUE_PHILIP();
void PART_17_UPDATE_DIALOGUE_Jimmy(int action);
void PART_17_UPDATE_DIALOGUE_Philip(int action);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index be39f60a902..6e7d70a568d 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -167,6 +167,7 @@ void IgorEngine::redrawVerb(uint8 verb, bool highlight) {
}
void IgorEngine::handleRoomInput() {
+ // ESCAPE for pause
if (_inputVars[kInputPause]) {
_inputVars[kInputPause] = 0;
handlePause();
@@ -175,6 +176,7 @@ void IgorEngine::handleRoomInput() {
_inputVars[kInputOptions] = 0;
// handleOptionsMenu();
}
+ // dialogue skip
if (_inputVars[kInputSkipDialogue] && _gameState.dialogueTextRunning) {
_talkDelayCounter = _talkDelay;
if (_gameState.talkMode != kTalkModeTextOnly && _talkSpeechCounter > 2) {
@@ -190,6 +192,7 @@ void IgorEngine::handleRoomInput() {
if (!_roomCursorOn || _gameState.dialogueTextRunning || _scrollInventory) {
return;
}
+ // verbs panel click
if (_inputVars[kInputCursorYPos] >= 156 && _inputVars[kInputCursorYPos] <= 167) {
if (_inputVars[kInputClick]) {
int verb = getVerbUnderCursor(_inputVars[kInputCursorXPos]);
@@ -252,6 +255,7 @@ void IgorEngine::handleRoomInput() {
}
// Action previousAction = _currentAction;
+ // Handle inventory and room object selection based on cursor position and clicks
if (_inputVars[kInputCursorYPos] >= 170 && _inputVars[kInputCursorYPos] <= 199) {
int object = getObjectFromInventory(_inputVars[kInputCursorXPos]);
if (_currentAction.verbType == 0) {
@@ -276,6 +280,7 @@ void IgorEngine::handleRoomInput() {
_currentAction.object2Type = kObjectTypeInventory;
}
} else if (_inputVars[kInputCursorYPos] < 144) {
+ // screen object under cursor
int area = _screenLayer2[_inputVars[kInputCursorYPos] * 320 + _inputVars[kInputCursorXPos]];
int object = _roomObjectAreasTable[area].object;
if (_currentAction.verbType == 0) {
@@ -289,6 +294,7 @@ void IgorEngine::handleRoomInput() {
return;
}
if (_currentAction.verb == kVerbGive && _roomActionsTable[_roomDataOffsets.action.giveVerb + 48 + _currentAction.object1Num] != 0) {
+
formatActionSentence(0);
if (!actionHovering) {
_currentAction.verbType = 2;
@@ -307,7 +313,7 @@ void IgorEngine::handleRoomInput() {
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];
+ _actionCode = _roomActionsTable[_roomDataOffsets.action.defaultVerb + _currentAction.verb * 2 + _currentAction.object1Num * 20];
}
// The original only exposes a room object when this action byte is
// non-zero; otherwise hover text is verb-only. cseg175:2C8B-2CBC;
@@ -337,7 +343,21 @@ void IgorEngine::handleRoomInput() {
_actionCode = 0;
return;
}
+ // verbatim from reference/scummvm-igor-engine/igor.cpp:1611
+ debugC(9, kDebugEngine, "handleRoomInput() actionCode %d", _actionCode);
+ // expanded: shows what the clicks resolved to and how the offset was built
+ debugC(9, kDebugEngine, " verb %d verbType %d | obj1: type %d num %d (row %d) | obj2: type %d num %d (col %d) | verbBase %d offset %d -> %d",
+ _currentAction.verb, _currentAction.verbType,
+ _currentAction.object1Type, _currentAction.object1Num,
+ _currentAction.object1Type == 0 ? -1 : _roomActionsTable[_roomDataOffsets.action.object1 + _currentAction.object1Num + _currentAction.object1Type * 38],
+ _currentAction.object2Type, _currentAction.object2Num,
+ _currentAction.object2Type == 0 ? -1 : _roomActionsTable[_roomDataOffsets.action.object2 + _currentAction.object2Num + _currentAction.object2Type * 38],
+ _currentAction.verbType == 1 ? _roomDataOffsets.action.useVerb : _roomDataOffsets.action.giveVerb,
+ (_roomActionsTable[_roomDataOffsets.action.object2 + _currentAction.object2Num + _currentAction.object2Type * 38] * 2) +
+ (_roomActionsTable[_roomDataOffsets.action.object1 + _currentAction.object1Num + _currentAction.object1Type * 38] * _roomDataOffsets.action.objectSize),
+ _actionCode);
if (_actionCode == 0) {
+ debugC(9, kDebugEngine, "handleRoomInput() actionCode is 0, clearing action");
clearAction();
return;
}
@@ -395,14 +415,16 @@ void IgorEngine::handleRoomInput() {
return;
}
}
- hideCursor();
- executeAction(_actionCode);
- if (!_gameState.dialogueTextRunning) {
- showCursor();
- }
- clearAction();
- return;
}
+
+ hideCursor();
+ debugC(9, kDebugEngine, "handleRoomInput() executing action with actionCode %d", _actionCode);
+ executeAction(_actionCode);
+ if (!_gameState.dialogueTextRunning) {
+ showCursor();
+ }
+ clearAction();
+ return;
}
void IgorEngine::clearAction() {
@@ -437,6 +459,7 @@ void IgorEngine::formatActionSentence(uint8 color) {
}
}
}
+
drawActionSentence(actionSentence, kSentenceColorIndex[color]);
}
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index 89c7a7cfb5b..7031430fd0c 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -47,7 +47,7 @@ void IgorEngine::PART_17_EXEC_ACTION(int action) {
PART_17_ACTION_105();
break;
case 106: // exchange files
- PART_17_ACTION_106();
+ PART_17_ACTION_106_swapFolders();
break;
default:
error("PART_17_EXEC_ACTION unhandled action %d", action);
@@ -191,9 +191,10 @@ void IgorEngine::PART_17_ACTION_105() {
_currentPart = 40;
}
-void IgorEngine::PART_17_ACTION_106() {
+void IgorEngine::PART_17_ACTION_106_swapFolders() {
+ // folder already exchanged
if (_objectsState[55] == 1) {
- ADD_DIALOGUE_TEXT(226, 1, 649); // cseg141:0A51-0A5D
+ ADD_DIALOGUE_TEXT(226, 1, 649);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
@@ -223,6 +224,7 @@ void IgorEngine::PART_17_ACTION_106() {
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
waitForIgorMove();
+ // Creo q no ha notado nada
ADD_DIALOGUE_TEXT(223, 2, 647); // cseg141:0B75-0B81
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
Commit: 3b9338981fd31d93f2519cfa71f91935c16bea21
https://github.com/scummvm/scummvm/commit/3b9338981fd31d93f2519cfa71f91935c16bea21
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:04+01:00
Commit Message:
IGOR: Fixes folder swapping animation
Changed paths:
engines/igor/part_17.cpp
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index 7031430fd0c..f858fe0cddb 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -200,17 +200,24 @@ void IgorEngine::PART_17_ACTION_106_swapFolders() {
return;
}
playSound(24, 1);
- for (int i = 0; i <= 8; ++i) {
+
+ for (int j = 0; j <= 8; ++j) { // 8 frames
int offset = 12575;
- for (int j = 0; j <= 27; ++j) {
- memcpy(_screenVGA + offset + i * 320, _animFramesBuffer + 0x1E6E + j * 40 + i * 1120, 40);
+ for (int i = 0; i <= 27; ++i) {
+ memcpy(_screenVGA + offset + i * 320, _animFramesBuffer + 0x1E6E + i * 40 + j * 1120, 40);
}
waitForTimer(30);
}
+
int offset = 12575;
for (int i = 0; i <= 27; ++i) {
memcpy(_screenVGA + offset + i * 320, _animFramesBuffer + 0x1E6E + i * 40, 40);
}
+
+ _system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
+ g_engine->_screen->updateScreen();
+
+
_objectsState[55] = 1;
_objectsState[3] = 1;
PART_17_HELPER_1(255);
@@ -219,6 +226,8 @@ void IgorEngine::PART_17_ACTION_106_swapFolders() {
++_demoActionsCounter;
}
--_walkDataLastIndex;
+ debugC(9, kDebugWalk, "PART_17_ACTION_106 walk: _walkDataLastIndex %d _walkData[%d] %d,%d",
+ _walkDataLastIndex, _walkDataLastIndex, _walkData[_walkDataLastIndex].x, _walkData[_walkDataLastIndex].y);
buildWalkPath(104, 87, 143, 123);
_walkDataCurrentIndex = 1;
_walkData[_walkDataLastIndex].frameNum = 0;
Commit: 747de7e05422455f65e38aee8f975929ed021667
https://github.com/scummvm/scummvm/commit/747de7e05422455f65e38aee8f975929ed021667
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:04+01:00
Commit Message:
IGOR: Fix object state indices
Changed paths:
engines/igor/part_10.cpp
engines/igor/part_11.cpp
engines/igor/part_34.cpp
engines/igor/part_35.cpp
engines/igor/part_7.cpp
engines/igor/part_8.cpp
engines/igor/part_9.cpp
diff --git a/engines/igor/part_10.cpp b/engines/igor/part_10.cpp
index b0f24c013f8..8f4b29682de 100644
--- a/engines/igor/part_10.cpp
+++ b/engines/igor/part_10.cpp
@@ -24,6 +24,10 @@
namespace Igor {
+// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
+// _objectsState[38] = s3:0x862 and [41..42] = s3:0x865..0x866;
+// cseg175:015A-27FD.
+
const uint32 kPart10PanelLeft = 0x0000;
@@ -31,18 +35,18 @@ void IgorEngine::PART_10_11_DRAW_OBJECT_STATE(int num) {
// These three original blitters are byte-for-byte duplicates in the two
// halves of the room
- if ((num == 2 || num == 255) && _objectsState[67] == 1) {
+ if ((num == 2 || num == 255) && _objectsState[41] == 1) {
for (int y = 0; y <= 7; ++y)
memcpy(_screenLayer1 + 0x7DA1 + y * 320,
_animFramesBuffer + 0xC786 + y * 37, 37);
}
if (num == 3 || num == 255) {
- if (_objectsState[68] == 1) {
+ if (_objectsState[42] == 1) {
for (int y = 0; y <= 14; ++y)
memcpy(_screenLayer1 + 0x4E32 + y * 320,
_animFramesBuffer + 0xC5E2 + y * 14, 14);
- } else if (_objectsState[68] == 2) {
+ } else if (_objectsState[42] == 2) {
for (int y = 0; y <= 14; ++y)
memcpy(_screenLayer1 + 0x4E32 + y * 320,
_animFramesBuffer + 0xC6B4 + y * 14, 14);
@@ -110,7 +114,7 @@ void IgorEngine::PART_10_EXEC_ACTION(int action) {
}
void IgorEngine::PART_10_ACTION_104_pickHamburger() {
- if (_objectsState[64] == 1) { // already picked hamburger
+ if (_objectsState[38] == 1) { // already picked hamburger
ADD_DIALOGUE_TEXT(205, 1, 629);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -134,7 +138,7 @@ void IgorEngine::PART_10_ACTION_104_pickHamburger() {
}
addObjectToInventory(17, 52);
- _objectsState[64] = 1;
+ _objectsState[38] = 1;
}
void IgorEngine::PART_10_ACTION_108_scrollLeft() {
diff --git a/engines/igor/part_11.cpp b/engines/igor/part_11.cpp
index 8e0ef76ddf1..f2b24e56c3d 100644
--- a/engines/igor/part_11.cpp
+++ b/engines/igor/part_11.cpp
@@ -24,16 +24,20 @@
namespace Igor {
+// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
+// _objectsState[0] = s3:0x83C and [40..42] = s3:0x864..0x866;
+// cseg176:01AD-0A40.
+
const uint32 kPart11PanelRight = 0x0000;
void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
PART_10_11_DRAW_OBJECT_STATE(num);
if (num == 1 || num == 255)
- _roomObjectAreasTable[13].object = _objectsState[66] == 0 ? 4 : 3;
+ _roomObjectAreasTable[13].object = _objectsState[40] == 0 ? 4 : 3;
if (num == 2 || num == 255) {
- if (_objectsState[67] == 1) {
+ if (_objectsState[41] == 1) {
// make area selectable
for (int area = 10; area <= 11; ++area)
_roomObjectAreasTable[area].object = 7;
@@ -45,13 +49,13 @@ void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
}
if (num == 3 || num == 255) {
- if (_objectsState[68] == 0) {
+ if (_objectsState[42] == 0) {
for (int area = 7; area <= 8; ++area)
_roomObjectAreasTable[area].object = 0;
- } else if (_objectsState[68] == 1) {
+ } else if (_objectsState[42] == 1) {
for (int area = 7; area <= 8; ++area)
_roomObjectAreasTable[area].object = 6;
- } else if (_objectsState[68] == 2) {
+ } else if (_objectsState[42] == 2) {
_roomObjectAreasTable[7].object = 6;
_roomObjectAreasTable[8].object = 8;
}
@@ -65,7 +69,7 @@ void IgorEngine::PART_11_ACTION_105() {
waitForTimer(127);
}
addObjectToInventory(18, 53);
- _objectsState[66] = 1;
+ _objectsState[40] = 1;
PART_11_APPLY_OBJECT_STATE(255);
}
@@ -76,7 +80,7 @@ void IgorEngine::PART_11_ACTION_107() {
waitForTimer(61);
}
removeObjectFromInventory(42);
- _objectsState[68] = 1;
+ _objectsState[42] = 1;
PART_11_APPLY_OBJECT_STATE(255);
}
@@ -126,9 +130,9 @@ void IgorEngine::PART_11_ACTION_112() {
waitForTimer(61);
}
addObjectToInventory(23, 58);
- _objectsState[68] = 1;
+ _objectsState[42] = 1;
PART_11_APPLY_OBJECT_STATE(3);
- _objectsState[26] = 1;
+ _objectsState[0] = 1;
UPDATE_OBJECT_STATE(1);
}
@@ -147,7 +151,7 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 103: // look at pipe
- ADD_DIALOGUE_TEXT(_objectsState[66] == 0 ? 203 : 204, 1, _objectsState[66] == 0 ? 617 : 618);
+ ADD_DIALOGUE_TEXT(_objectsState[40] == 0 ? 203 : 204, 1, _objectsState[40] == 0 ? 617 : 618);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -181,7 +185,7 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 110: // Look at butterfly net
- ADD_DIALOGUE_TEXT(_objectsState[68] == 1 ? 208 : 209, 1, _objectsState[68] == 1 ? 622 : 623);
+ ADD_DIALOGUE_TEXT(_objectsState[42] == 1 ? 208 : 209, 1, _objectsState[42] == 1 ? 622 : 623);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
diff --git a/engines/igor/part_34.cpp b/engines/igor/part_34.cpp
index f480c95a0b8..80e9d3147b4 100644
--- a/engines/igor/part_34.cpp
+++ b/engines/igor/part_34.cpp
@@ -10,6 +10,10 @@
namespace Igor {
+// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
+// _objectsState[73] = s3:0x885, [80] = s3:0x88C and [82] = s3:0x88E;
+// cseg101:0A17-0F91.
+
void IgorEngine::PART_34_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_34_EXEC_ACTION %d", action);
switch (action) {
@@ -22,7 +26,7 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
ADD_DIALOGUE_TEXT(203, 2, 563); // cseg101:0AF1-0B17
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
- _objectsState[88] = 1; // cseg101:0B1C
+ _objectsState[82] = 1; // cseg101:0B1C
PART_34_APPLY_OBJECT_STATE(3);
break;
case 103:
@@ -104,14 +108,14 @@ void IgorEngine::PART_34_ACTION_109_SCROLL_RIGHT() {
void IgorEngine::PART_34_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- if (!(_objectsState[86] == 0 && _objectsState[79] == 1)) {
- _roomObjectAreasTable[2].area = 0; // cseg101:0F3C-0F80; table byte at s3:DC70
+ if (!(_objectsState[80] == 0 && _objectsState[73] == 1)) {
+ _roomObjectAreasTable[5].object = 0; // s3:0xDC70; cseg101:0F3C-0F80
} else {
// TODO: draw the state-dependent frame from FRM_Park1; cseg101:0F4A-0F79.
}
}
if (num == 3 || num == 255) {
- _roomObjectAreasTable[1].area = (_objectsState[88] == 0) ? 2 : 3; // cseg101:0F85-0FA4
+ _roomObjectAreasTable[4].object = (_objectsState[82] == 0) ? 2 : 3; // s3:0xDC6B; cseg101:0F85-0FA4
}
}
diff --git a/engines/igor/part_35.cpp b/engines/igor/part_35.cpp
index ef501637fce..28f2bcddc73 100644
--- a/engines/igor/part_35.cpp
+++ b/engines/igor/part_35.cpp
@@ -10,6 +10,9 @@
namespace Igor {
+// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
+// _objectsState[82] = s3:0x88E; cseg100:006D-064E.
+
void IgorEngine::PART_35_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_35_EXEC_ACTION %d", action);
switch (action) {
@@ -17,7 +20,7 @@ void IgorEngine::PART_35_EXEC_ACTION(int action) {
ADD_DIALOGUE_TEXT(201, 2, 611); // cseg100:0042-0068
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
- _objectsState[88] = 1; // cseg100:006D
+ _objectsState[82] = 1; // cseg100:006D
PART_35_APPLY_OBJECT_STATE(3);
break;
case 102:
@@ -106,7 +109,7 @@ void IgorEngine::PART_35_ACTION_106_EXIT_TO_MAP() {
void IgorEngine::PART_35_APPLY_OBJECT_STATE(int num) {
if (num == 3 || num == 255) {
- _roomObjectAreasTable[4].area = (_objectsState[88] == 0) ? 1 : 2; // cseg100:0634-0653; s3:DC7A
+ _roomObjectAreasTable[7].object = (_objectsState[82] == 0) ? 1 : 2; // s3:0xDC7A; cseg100:0634-0653
}
}
diff --git a/engines/igor/part_7.cpp b/engines/igor/part_7.cpp
index 627f40783a8..b0bcb4ef22b 100644
--- a/engines/igor/part_7.cpp
+++ b/engines/igor/part_7.cpp
@@ -10,6 +10,9 @@
namespace Igor {
+// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
+// _objectsState[26] = s3:0x856 and [27] = s3:0x857; cseg197:0150-03D8.
+
const uint32 kDoor1Closed = 0x2175; // cseg197:007B
const uint32 kDoor1Open = 0x23F1; // cseg197:002B
const uint32 kDoor2Closed = 0x266D; // cseg197:011B
@@ -18,21 +21,21 @@ const uint32 kDoor2Open = 0x28DD; // cseg197:00CB
void IgorEngine::PART_07_DRAW_DOOR_STATE(int num) {
_roomActionsTable[297] = 109;
if (num == 1 || num == 255) {
- const uint32 srcOffset = _objectsState[52] == 0 ? kDoor1Closed : kDoor1Open;
+ const uint32 srcOffset = _objectsState[26] == 0 ? kDoor1Closed : kDoor1Open;
for (int y = 0; y <= 52; ++y)
memcpy(_screenLayer1 + 0x4DB8 + y * 320, _animFramesBuffer + srcOffset + y * 12, 12);
- _roomActionsTable[146] = _objectsState[52] == 0 ? 6 : 7;
+ _roomActionsTable[146] = _objectsState[26] == 0 ? 6 : 7;
}
if (num == 2 || num == 255) {
- const uint32 srcOffset = _objectsState[53] == 0 ? kDoor2Closed : kDoor2Open;
+ const uint32 srcOffset = _objectsState[27] == 0 ? kDoor2Closed : kDoor2Open;
for (int y = 0; y <= 51; ++y)
memcpy(_screenLayer1 + 0x4E1A + y * 320, _animFramesBuffer + srcOffset + y * 12, 12);
- _roomActionsTable[147] = _objectsState[53] == 0 ? 6 : 7;
+ _roomActionsTable[147] = _objectsState[27] == 0 ? 6 : 7;
}
}
void IgorEngine::PART_07_openCloseDoor(int door, bool open) {
- const int stateIndex = door == 1 ? 52 : 53;
+ const int stateIndex = door == 1 ? 26 : 27; // s3:0x856/0x857; cseg197:0150-03D8
if ((_objectsState[stateIndex] != 0) == open) {
const int text = open ? 19 : 23;
ADD_DIALOGUE_TEXT(text, 1, text);
@@ -190,7 +193,7 @@ void IgorEngine::PART_07_EXEC_ACTION(int action) {
PART_07_EXIT_TO_OUTSIDE();
break;
case 111: // Go through dean's door
- if (_objectsState[52] != 0) {
+ if (_objectsState[26] != 0) {
for (int area = 11; area <= 13; ++area) {
_roomObjectAreasTable[area].area = 3;
}
@@ -203,7 +206,7 @@ void IgorEngine::PART_07_EXEC_ACTION(int action) {
}
break;
case 112: // Go through secretary's door
- if (_objectsState[53] != 0) {
+ if (_objectsState[27] != 0) {
WalkData &wd = _walkData[0];
wd.setPos(156, 113, kFacingPositionBack, 1);
wd.setDefaultScale();
diff --git a/engines/igor/part_8.cpp b/engines/igor/part_8.cpp
index 40addf36b3f..4979d9d21f3 100644
--- a/engines/igor/part_8.cpp
+++ b/engines/igor/part_8.cpp
@@ -10,31 +10,41 @@
namespace Igor {
+// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
+// Indices are addresses relative to s3:0x83C: [0]=0x83C, [26]=0x856,
+// [28..32]=0x858..0x85C, [41..42]=0x865..0x866 and [111]=0x8AB;
+// cseg189:02B0-16EF.
+
void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- const uint32 srcOffset = _objectsState[52] == 0 ? 0 : 0x4C8;
+ const uint32 srcOffset = _objectsState[26] == 0 ? 0 : 0x4C8;
for (int y = 0; y <= 50; ++y)
memcpy(_screenLayer1 + 0x572C + y * 320, _animFramesBuffer + srcOffset + y * 24, 24);
- _roomActionsTable[150] = _objectsState[52] == 0 ? 6 : 7;
+ _roomActionsTable[150] = _objectsState[26] == 0 ? 6 : 7;
}
if (num == 2 || num == 255) {
- // TODO: map the independent s3:0x8AB flag.
+ if (_objectsState[111] == 1) { // s3:0x8AB; cseg189:16EF-1700
+ _roomObjectAreasTable[7].object = 0; // s3:0xDC7A; cseg189:16F6
+ _roomObjectAreasTable[8].object = 0; // s3:0xDC7F; cseg189:16FB
+ _roomActionsTable[146] = 4; // cseg189:1732-1743
+ return;
+ }
uint32 srcOffset;
int dstOffset;
int rows;
int width;
- if (_objectsState[55] == 0) {
+ if (_objectsState[29] == 0) {
srcOffset = 0x208A;
dstOffset = 0x6BC3;
rows = 26;
width = 34;
_roomObjectAreasTable[8].object = 0;
} else {
- srcOffset = _objectsState[57] == 0 ? 0x9992 : 0x985C;
+ srcOffset = _objectsState[31] == 0 ? 0x9992 : 0x985C;
dstOffset = 0x7FC8;
rows = 10;
width = 31;
- _roomObjectAreasTable[8].object = _objectsState[57] == 0 ? 3 : 0;
+ _roomObjectAreasTable[8].object = _objectsState[31] == 0 ? 3 : 0;
}
for (int y = 0; y < rows; ++y) {
const uint8 *src = _animFramesBuffer + srcOffset + y * width;
@@ -46,7 +56,7 @@ void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
}
void IgorEngine::PART_08_ANIMATE_DOOR(bool open) {
- if ((_objectsState[52] != 0) == open) {
+ if ((_objectsState[26] != 0) == open) {
const int text = open ? 19 : 23;
ADD_DIALOGUE_TEXT(text, 1, text);
SET_DIALOGUE_TEXT(1, 1);
@@ -67,7 +77,7 @@ void IgorEngine::PART_08_ANIMATE_DOOR(bool open) {
break;
waitForTimer(127);
}
- _objectsState[52] = open ? 1 : 0;
+ _objectsState[26] = open ? 1 : 0;
PART_08_APPLY_OBJECT_STATE(1);
}
@@ -109,7 +119,7 @@ void IgorEngine::PART_08_ACTION_105() {
waitForTimer(127);
}
addObjectToInventory(15, 50);
- _objectsState[57] = 1;
+ _objectsState[31] = 1;
PART_08_APPLY_OBJECT_STATE(255);
}
@@ -137,7 +147,7 @@ void IgorEngine::PART_08_ACTION_109() {
addObjectToInventory(13, 48);
PART_08_APPLY_OBJECT_STATE(255);
- _objectsState[54] = 1;
+ _objectsState[28] = 1;
}
void IgorEngine::PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(int frame) {
@@ -159,7 +169,7 @@ void IgorEngine::PART_08_UPDATE_DIALOGUE_SECRETARY(int action) {
void IgorEngine::PART_08_ACTION_108() {
const int currentPart = _currentPart;
- const int actionFrameOffset = _objectsState[57] == 0 ? 0x2773 : 0x328D;
+ const int actionFrameOffset = _objectsState[31] == 0 ? 0x2773 : 0x328D;
playSound(60, 1);
for (int frame = 0; frame <= 1; ++frame) {
for (int y = 0; y <= 48; ++y)
@@ -196,8 +206,10 @@ void IgorEngine::PART_08_ACTION_108() {
}
waitForTimer(255);
fadeOut(624);
- _objectsState[53] = 0;
- _objectsState[61] = 1;
+ // The two stores this port used to do here (_objectsState[53] = 0 and
+ // _objectsState[61] = 1) have no counterpart in cseg189, which writes only
+ // s3:0x856, s3:0x858-0x85C, s3:0x865 and s3:0x866. s3:0x879 (index 61) is
+ // part_5/part_6's flag, so that store was corrupting another room.
loadActionData(DAT_DeanPepperOffice);
loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice,
@@ -211,7 +223,7 @@ void IgorEngine::PART_08_ACTION_108() {
drawInventory(_inventoryInfo[72], 0);
fadeIn(768);
_currentPart = currentPart;
- _objectsState[58] = 1;
+ _objectsState[32] = 1;
}
void IgorEngine::PART_08_DEAN_LEAVES() {
@@ -271,7 +283,7 @@ void IgorEngine::PART_08_HANDLE_DIALOGUE_DEAN() {
}
void IgorEngine::PART_08_ACTION_103_TALK_TO_DEAN() {
- if (_objectsState[55] == 1) {
+ if (_objectsState[29] == 1) {
ADD_DIALOGUE_TEXT(223, 1, 169);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -279,7 +291,7 @@ void IgorEngine::PART_08_ACTION_103_TALK_TO_DEAN() {
return;
}
- if (_objectsState[52] == 1) { // door open
+ if (_objectsState[26] == 1) { // door open
PART_08_DRAW_DEAN();
ADD_DIALOGUE_TEXT(220, 1, 166);
ADD_DIALOGUE_TEXT(221, 1, 167);
@@ -296,14 +308,14 @@ void IgorEngine::PART_08_ACTION_103_TALK_TO_DEAN() {
}
void IgorEngine::PART_08_ACTION_114() {
- if (_objectsState[55] == 1) {
+ if (_objectsState[29] == 1) {
ADD_DIALOGUE_TEXT(227, 1, 172);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
return;
}
- if (_objectsState[26] == 1) {
+ if (_objectsState[0] == 1) {
ADD_DIALOGUE_TEXT(226, 1, 171);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -355,7 +367,7 @@ void IgorEngine::PART_08_ACTION_114() {
startCutsceneDialogue(78, 75, 26, 58, 0);
waitForEndOfCutsceneDialogue(78, 75, 26, 58, 0);
_updateDialogue = 0;
- _objectsState[56] = _objectsState[26] < 2 ? 1 : 2;
+ _objectsState[30] = _objectsState[0] < 2 ? 1 : 2;
drawInventory(_inventoryInfo[72], 0);
playSound(63, 1);
PART_08_APPLY_OBJECT_STATE(255);
@@ -364,11 +376,11 @@ void IgorEngine::PART_08_ACTION_114() {
void IgorEngine::PART_08_EXEC_ACTION(int action) {
switch (action) {
case 101:
- if (_objectsState[52] == 0) {
+ if (_objectsState[26] == 0) {
_currentPart = 71;
break;
}
- if (_objectsState[52] != 0) {
+ if (_objectsState[26] != 0) {
for (int area = 10; area <= 11; ++area)
_roomObjectAreasTable[area].area = 4;
for (int area = 13; area <= 14; ++area)
@@ -378,20 +390,20 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- if (_objectsState[56] != 0) {
+ if (_objectsState[30] != 0) {
waitForTimer(251);
PART_08_DEAN_LEAVES();
- if (_objectsState[68] == 1)
- _objectsState[68] = 2;
+ if (_objectsState[42] == 1)
+ _objectsState[42] = 2;
else
- _objectsState[67] = 1;
+ _objectsState[41] = 1;
waitForTimer(101);
playSound(16, 1);
- if (_objectsState[56] == 2) {
+ if (_objectsState[30] == 2) {
PART_08_DEAN_DRINKS();
- _objectsState[55] = 1;
+ _objectsState[29] = 1;
}
- _objectsState[56] = 0;
+ _objectsState[30] = 0;
}
_currentPart = 71;
}
@@ -403,7 +415,7 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 104:
- if (_objectsState[55] == 1)
+ if (_objectsState[29] == 1)
ADD_DIALOGUE_TEXT(222, 1, 168);
else
ADD_DIALOGUE_TEXT(203, 2, 154);
@@ -436,12 +448,12 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
PART_08_ACTION_103_TALK_TO_DEAN();
break;
case 108:
- if (_objectsState[55] == 0) {
+ if (_objectsState[29] == 0) {
ADD_DIALOGUE_TEXT(212, 1, 159);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- } else if (_objectsState[58] == 1) {
+ } else if (_objectsState[32] == 1) {
ADD_DIALOGUE_TEXT(224, 2, 170);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -451,12 +463,12 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
}
break;
case 109:
- if (_objectsState[55] == 0) {
+ if (_objectsState[29] == 0) {
ADD_DIALOGUE_TEXT(213, 2, 160);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- } else if (_objectsState[54] == 1) {
+ } else if (_objectsState[28] == 1) {
ADD_DIALOGUE_TEXT(215, 1, 161);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
diff --git a/engines/igor/part_9.cpp b/engines/igor/part_9.cpp
index 3ddbeae5ea3..581ebd3f554 100644
--- a/engines/igor/part_9.cpp
+++ b/engines/igor/part_9.cpp
@@ -10,23 +10,27 @@
namespace Igor {
+// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
+// _objectsState[27] = s3:0x857 and [34..36] = s3:0x85E..0x860;
+// cseg190:0288-112A.
+
void IgorEngine::PART_09_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- const uint32 srcOffset = _objectsState[53] == 0 ? 0x5D0B : 0x61A3;
+ const uint32 srcOffset = _objectsState[27] == 0 ? 0x5D0B : 0x61A3;
for (int y = 0; y <= 48; ++y)
memcpy(_screenLayer1 + 0x46C2 + y * 320, _animFramesBuffer + srcOffset + y * 24, 24);
- _roomActionsTable[150] = _objectsState[53] == 0 ? 6 : 7;
+ _roomActionsTable[150] = _objectsState[27] == 0 ? 6 : 7;
}
if (num == 2 || num == 255) {
- const uint32 srcOffset = _objectsState[60] == 0 ? 0x663B : 0x6A23;
+ const uint32 srcOffset = _objectsState[34] == 0 ? 0x663B : 0x6A23;
for (int y = 0; y <= 49; ++y)
memcpy(_screenLayer1 + 0x48E6 + y * 320, _animFramesBuffer + srcOffset + y * 20, 20);
- _roomObjectAreasTable[4].object = (_objectsState[60] == 0 || _objectsState[62] != 0) ? 3 : 5;
+ _roomObjectAreasTable[4].object = (_objectsState[34] == 0 || _objectsState[36] != 0) ? 3 : 5;
}
}
void IgorEngine::PART_09_ANIMATE_DOOR(bool open) {
- if ((_objectsState[53] != 0) == open) {
+ if ((_objectsState[27] != 0) == open) {
const int text = open ? 19 : 23;
ADD_DIALOGUE_TEXT(text, 1, text);
SET_DIALOGUE_TEXT(1, 1);
@@ -45,7 +49,7 @@ void IgorEngine::PART_09_ANIMATE_DOOR(bool open) {
playSound(open ? 13 : 14, 1);
waitForTimer(127);
}
- _objectsState[53] = open ? 1 : 0;
+ _objectsState[27] = open ? 1 : 0;
PART_09_APPLY_OBJECT_STATE(1);
}
@@ -71,7 +75,7 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 109:
- if (_objectsState[61] == 0)
+ if (_objectsState[35] == 0)
ADD_DIALOGUE_TEXT(216, 1, 244);
else
ADD_DIALOGUE_TEXT(224, 1, 252);
@@ -86,7 +90,7 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 115:
- if (_objectsState[53] != 0) {
+ if (_objectsState[27] != 0) {
_walkData[0].setPos(207, 106, kFacingPositionBack, 1);
_walkData[0].setDefaultScale();
_walkDataCurrentIndex = 0;
Commit: 37812ed1329cdd166b6abcf91acb9fc944868144
https://github.com/scummvm/scummvm/commit/37812ed1329cdd166b6abcf91acb9fc944868144
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:04+01:00
Commit Message:
IGOR: Restore two-object interaction walking
Changed paths:
engines/igor/input.cpp
engines/igor/part_17.cpp
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 6e7d70a568d..4e9def9015b 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -326,15 +326,13 @@ void IgorEngine::handleRoomInput() {
}
}
- 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];
+ int pairActionOffset = 0;
+ int pairVerbOffset = 0;
+ if (_currentAction.verbType != 0) {
+ pairActionOffset = _roomActionsTable[_roomDataOffsets.action.object2 + _currentAction.object2Num + _currentAction.object2Type * 38] * 2;
+ pairActionOffset += _roomActionsTable[_roomDataOffsets.action.object1 + _currentAction.object1Num + _currentAction.object1Type * 38] * _roomDataOffsets.action.objectSize;
+ pairVerbOffset = _currentAction.verbType == 1 ? _roomDataOffsets.action.useVerb : _roomDataOffsets.action.giveVerb;
+ _actionCode = _roomActionsTable[pairVerbOffset + pairActionOffset];
}
if (actionHovering) {
@@ -362,58 +360,69 @@ void IgorEngine::handleRoomInput() {
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;
+ int walkObjectNum = 0;
+ bool pairWalk = false;
+ if (_currentAction.verbType == 0 && _currentAction.object1Type == kObjectTypeRoom) {
+ walkObjectNum = _currentAction.object1Num;
+ _actionWalkPoint = _roomActionsTable[_roomDataOffsets.action.defaultVerb + _currentAction.verb * 2 + walkObjectNum * 20 + 1];
+ } else if (_currentAction.verbType != 0) {
+ // Pair records are two bytes. Byte 0 is the action and byte 1 selects
+ // the Action field containing the room object to approach. Values above
+ // one walk; for example 5 selects object2Num. cseg175:229F-246B.
+ _actionWalkPoint = _roomActionsTable[pairVerbOffset + pairActionOffset + 1];
+ if (_actionWalkPoint > 1 && _actionWalkPoint <= sizeof(Action)) {
+ const uint8 *actionFields = reinterpret_cast<const uint8 *>(&_currentAction);
+ walkObjectNum = actionFields[_actionWalkPoint - 1]; // cseg175:246E-2479
+ pairWalk = true;
+ }
+ }
+ if ((_currentAction.verbType == 0 && _actionWalkPoint > 0) || pairWalk) {
+ if (!pairWalk && walkObjectNum == 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 + walkObjectNum * 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 (pairWalk || _actionWalkPoint != 3) {
+ _walkCurrentFrame = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ }
+ if (pairWalk || _actionWalkPoint == 1) {
+ _walkCurrentPos = _roomActionsTable[_roomDataOffsets.obj.walkFacingPosition + walkObjectNum];
+ _walkData[_walkDataLastIndex].posNum = _walkCurrentPos;
+ }
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ return;
}
}
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index f858fe0cddb..47e320b23fe 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -201,15 +201,20 @@ void IgorEngine::PART_17_ACTION_106_swapFolders() {
}
playSound(24, 1);
- for (int j = 0; j <= 8; ++j) { // 8 frames
- int offset = 12575;
+ // The pair record for action 106 is { 106, 5 }; selector 5 makes the common
+ // input handler walk to object2, the room folder beside Philip and Jimmy,
+ // before dispatching this action. Its walk point is (104, 87). The action
+ // animation itself has the fixed destination 0x311F.
+ // DAT_OutsideCollege use matrix offset 0x68E; cseg141:0A89,0AEE.
+ const int offset = 0x311F;
+
+ for (int j = 0; j <= 8; ++j) { // frames 0..8; cseg141:0A7E-0AEC
for (int i = 0; i <= 27; ++i) {
memcpy(_screenVGA + offset + i * 320, _animFramesBuffer + 0x1E6E + i * 40 + j * 1120, 40);
}
waitForTimer(30);
}
- int offset = 12575;
for (int i = 0; i <= 27; ++i) {
memcpy(_screenVGA + offset + i * 320, _animFramesBuffer + 0x1E6E + i * 40, 40);
}
Commit: 89c1005fdbcc2d5de737a955834746f518db6eec
https://github.com/scummvm/scummvm/commit/89c1005fdbcc2d5de737a955834746f518db6eec
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:05+01:00
Commit Message:
IGOR: Amend unnecessary comments
Changed paths:
engines/igor/input.cpp
engines/igor/part_10.cpp
engines/igor/part_11.cpp
engines/igor/part_34.cpp
engines/igor/part_35.cpp
engines/igor/part_7.cpp
engines/igor/part_8.cpp
engines/igor/part_9.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 4e9def9015b..e3b055e5340 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -368,11 +368,11 @@ void IgorEngine::handleRoomInput() {
} else if (_currentAction.verbType != 0) {
// Pair records are two bytes. Byte 0 is the action and byte 1 selects
// the Action field containing the room object to approach. Values above
- // one walk; for example 5 selects object2Num. cseg175:229F-246B.
+ // one walk; for example 5 selects object2Num.
_actionWalkPoint = _roomActionsTable[pairVerbOffset + pairActionOffset + 1];
if (_actionWalkPoint > 1 && _actionWalkPoint <= sizeof(Action)) {
const uint8 *actionFields = reinterpret_cast<const uint8 *>(&_currentAction);
- walkObjectNum = actionFields[_actionWalkPoint - 1]; // cseg175:246E-2479
+ walkObjectNum = actionFields[_actionWalkPoint - 1];
pairWalk = true;
}
}
diff --git a/engines/igor/part_10.cpp b/engines/igor/part_10.cpp
index 8f4b29682de..3821a04e171 100644
--- a/engines/igor/part_10.cpp
+++ b/engines/igor/part_10.cpp
@@ -24,10 +24,6 @@
namespace Igor {
-// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
-// _objectsState[38] = s3:0x862 and [41..42] = s3:0x865..0x866;
-// cseg175:015A-27FD.
-
const uint32 kPart10PanelLeft = 0x0000;
diff --git a/engines/igor/part_11.cpp b/engines/igor/part_11.cpp
index f2b24e56c3d..68a779987d0 100644
--- a/engines/igor/part_11.cpp
+++ b/engines/igor/part_11.cpp
@@ -24,10 +24,6 @@
namespace Igor {
-// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
-// _objectsState[0] = s3:0x83C and [40..42] = s3:0x864..0x866;
-// cseg176:01AD-0A40.
-
const uint32 kPart11PanelRight = 0x0000;
void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
diff --git a/engines/igor/part_34.cpp b/engines/igor/part_34.cpp
index 80e9d3147b4..414e8f91468 100644
--- a/engines/igor/part_34.cpp
+++ b/engines/igor/part_34.cpp
@@ -10,23 +10,19 @@
namespace Igor {
-// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
-// _objectsState[73] = s3:0x885, [80] = s3:0x88C and [82] = s3:0x88E;
-// cseg101:0A17-0F91.
-
void IgorEngine::PART_34_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_34_EXEC_ACTION %d", action);
switch (action) {
case 101:
- ADD_DIALOGUE_TEXT(201, 2, 562); // cseg101:0AC4-0AEA
+ ADD_DIALOGUE_TEXT(201, 2, 562);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 102:
- ADD_DIALOGUE_TEXT(203, 2, 563); // cseg101:0AF1-0B17
+ ADD_DIALOGUE_TEXT(203, 2, 563);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
- _objectsState[82] = 1; // cseg101:0B1C
+ _objectsState[82] = 1;
PART_34_APPLY_OBJECT_STATE(3);
break;
case 103:
@@ -34,7 +30,7 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
warning("PART_34_EXEC_ACTION action 103 unimplemented");
break;
case 104:
- ADD_DIALOGUE_TEXT(205, 1, 564); // cseg101:0B2A-0B50
+ ADD_DIALOGUE_TEXT(205, 1, 564);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -43,12 +39,12 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
warning("PART_34_EXEC_ACTION action 105 unimplemented");
break;
case 106:
- ADD_DIALOGUE_TEXT(206, 2, 565); // cseg101:0B57-0B7D
+ ADD_DIALOGUE_TEXT(206, 2, 565);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 107:
- ADD_DIALOGUE_TEXT(208, 2, 566); // cseg101:0B84-0BAA
+ ADD_DIALOGUE_TEXT(208, 2, 566);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -66,26 +62,24 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
}
void IgorEngine::PART_34_ACTION_109_SCROLL_RIGHT() {
- int xPos = 240; // cseg101:0BC8
- const int yPos = 124; // cseg101:0C9B
- int step = 1; // cseg101:0BCD
+ int xPos = 240;
+ const int yPos = 124;
+ int step = 1;
_gameTicks = 8; // original counter 15 normalized to 8-tick engine units; cseg101:0BD1-0BE7
do {
- if (compareGameTick(1, 16)) { // cseg101:0BD6-0BE7
- for (int y = 0; y <= 143; ++y) { // cseg101:0BEA-0C7F
- memcpy(_screenLayer2 + y * 320,
- _screenLayer1 + y * 320 + step * 8, 320 - step * 8);
- memcpy(_screenLayer2 + y * 320 + 320 - step * 8,
- _animFramesBuffer + y * 160, step * 8); // cseg101:0C36-0C74
+ if (compareGameTick(1, 16)) {
+ for (int y = 0; y <= 143; ++y) {
+ memcpy(_screenLayer2 + y * 320, _screenLayer1 + y * 320 + step * 8, 320 - step * 8);
+ memcpy(_screenLayer2 + y * 320 + 320 - step * 8, _animFramesBuffer + y * 160, step * 8);
}
- if (step < 15) { // cseg101:0C82-0CB2
- xPos += _walkScaleTable[0x8F9 + _walkCurrentFrame]; // s3:4637; cseg101:0C88-0C98
+ if (step < 15) {
+ xPos += _walkScaleTable[0x8F9 + _walkCurrentFrame];
WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame);
} else {
_walkCurrentFrame = 0;
}
- int dstOffset = (yPos - 50) * 320 + xPos - 15 - step * 8; // cseg101:0CB9-0CD5
- for (int row = 0; row <= 49; ++row) { // cseg101:0CD8-0D58
+ int dstOffset = (yPos - 50) * 320 + xPos - 15 - step * 8;
+ for (int row = 0; row <= 49; ++row) {
dstOffset += 320;
for (int col = 0; col <= 29; ++col) {
const uint8 color = _facingIgorFrames[kFacingPositionRight - 1]
@@ -95,46 +89,45 @@ void IgorEngine::PART_34_ACTION_109_SCROLL_RIGHT() {
}
}
}
- memcpy(_screenVGA, _screenLayer2, 46080); // cseg101:0D5A-0D6F
+ memcpy(_screenVGA, _screenLayer2, 46080);
++step;
}
- waitForTimer(); // cseg101:0D73-0D90
- } while (step != 21); // cseg101:0D94-0D9A
+ waitForTimer();
+ } while (step != 21);
- _walkData[0].setPos(xPos - 160, yPos, kFacingPositionRight, 0); // cseg101:0D9D-0DB1
- _walkData[0].setDefaultScale(); // cseg101:0DB6-0DDB
- _currentPart = 351; // cseg101:0DE0
+ _walkData[0].setPos(xPos - 160, yPos, kFacingPositionRight, 0);
+ _walkData[0].setDefaultScale();
+ _currentPart = 351;
}
void IgorEngine::PART_34_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
if (!(_objectsState[80] == 0 && _objectsState[73] == 1)) {
- _roomObjectAreasTable[5].object = 0; // s3:0xDC70; cseg101:0F3C-0F80
+ _roomObjectAreasTable[5].object = 0;
} else {
// TODO: draw the state-dependent frame from FRM_Park1; cseg101:0F4A-0F79.
}
}
if (num == 3 || num == 255) {
- _roomObjectAreasTable[4].object = (_objectsState[82] == 0) ? 2 : 3; // s3:0xDC6B; cseg101:0F85-0FA4
+ _roomObjectAreasTable[4].object = (_objectsState[82] == 0) ? 2 : 3;
}
}
void IgorEngine::PART_34() {
- _gameState.enableLight = 1; // cseg101:1FC0
- loadActionData(DAT_ParkLeft); // cseg101:1FD6-1FF9; resource 101
- loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight,
- TXT_ParkRight); // right panel snapshot source; cseg101:1FFE; cseg104:0002-0D20
+ _gameState.enableLight = 1;
+ loadActionData(DAT_ParkLeft);
+ loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight, TXT_ParkRight);
for (int y = 0; y <= 143; ++y) {
- memcpy(_animFramesBuffer + y * 160, _screenLayer1 + y * 320 + 160, 160); // cseg101:2003-2040
+ memcpy(_animFramesBuffer + y * 160, _screenLayer1 + y * 320 + 160, 160);
}
- loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // active left panel; cseg101:2045-206A; cseg106:0002-06A1
+ loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // active left panel;
static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
- loadAnimData(frames, 0x5A00); // cseg105:0002-00D8
+ loadAnimData(frames, 0x5A00);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_34_EXEC_ACTION);
_roomDataOffsets = PART_34_ROOM_DATA_OFFSETS;
- setRoomWalkBounds(0, 0, 319, 143); // cseg101:1F85-2E97; full park viewport
+ setRoomWalkBounds(0, 0, 319, 143);
PART_34_APPLY_OBJECT_STATE(255);
_walkDataLastIndex = 1;
@@ -145,7 +138,7 @@ void IgorEngine::PART_34() {
}
leavePartLoop();
if (_currentPart == kInvalidPart) {
- fadeOut(768); // cseg101:2E7F-2E91
+ fadeOut(768);
}
}
diff --git a/engines/igor/part_35.cpp b/engines/igor/part_35.cpp
index 28f2bcddc73..aa03afd9307 100644
--- a/engines/igor/part_35.cpp
+++ b/engines/igor/part_35.cpp
@@ -10,17 +10,14 @@
namespace Igor {
-// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
-// _objectsState[82] = s3:0x88E; cseg100:006D-064E.
-
void IgorEngine::PART_35_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_35_EXEC_ACTION %d", action);
switch (action) {
case 101:
- ADD_DIALOGUE_TEXT(201, 2, 611); // cseg100:0042-0068
+ ADD_DIALOGUE_TEXT(201, 2, 611);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
- _objectsState[82] = 1; // cseg100:006D
+ _objectsState[82] = 1;
PART_35_APPLY_OBJECT_STATE(3);
break;
case 102:
@@ -28,17 +25,17 @@ void IgorEngine::PART_35_EXEC_ACTION(int action) {
warning("PART_35_EXEC_ACTION action 102 unimplemented");
break;
case 103:
- ADD_DIALOGUE_TEXT(203, 1, 612); // cseg100:007B-00A1
+ ADD_DIALOGUE_TEXT(203, 1, 612);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 104:
- ADD_DIALOGUE_TEXT(204, 1, 613); // cseg100:00A8-00CE
+ ADD_DIALOGUE_TEXT(204, 1, 613);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 105:
- ADD_DIALOGUE_TEXT(205, 1, 614); // cseg100:00D5-00FB
+ ADD_DIALOGUE_TEXT(205, 1, 614);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -55,26 +52,26 @@ void IgorEngine::PART_35_EXEC_ACTION(int action) {
}
void IgorEngine::PART_35_ACTION_107_SCROLL_LEFT() {
- int xPos = 183; // cseg100:0211
- const int yPos = 124; // cseg100:02E8
- int step = 1; // cseg100:0216
+ int xPos = 183;
+ const int yPos = 124;
+ int step = 1;
_gameTicks = 8; // original counter 15 normalized to 8-tick engine units; cseg100:021A-0230
do {
- if (compareGameTick(1, 16)) { // cseg100:021F-0230
- for (int y = 0; y <= 143; ++y) { // cseg100:0233-02C8
+ if (compareGameTick(1, 16)) {
+ for (int y = 0; y <= 143; ++y) {
memcpy(_screenLayer2 + y * 320 + step * 8,
_screenLayer1 + y * 320, 320 - step * 8);
memcpy(_screenLayer2 + y * 320,
_animFramesBuffer + y * 160 + 160 - step * 8, step * 8);
}
- if (step < 5) { // cseg100:02CB-02FF
+ if (step < 5) {
xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame]; // s3:4637; cseg100:02D1-02E5
WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame);
} else {
_walkCurrentFrame = 0;
}
- int dstOffset = (yPos - 50) * 320 + xPos - 175 + step * 8; // cseg100:0306-0322
- for (int row = 0; row <= 49; ++row) { // cseg100:0325-03A5
+ int dstOffset = (yPos - 50) * 320 + xPos - 175 + step * 8;
+ for (int row = 0; row <= 49; ++row) {
dstOffset += 320;
for (int col = 0; col <= 29; ++col) {
const uint8 color = _facingIgorFrames[kFacingPositionLeft - 1]
@@ -84,27 +81,27 @@ void IgorEngine::PART_35_ACTION_107_SCROLL_LEFT() {
}
}
}
- memcpy(_screenVGA, _screenLayer2, 46080); // cseg100:03A7-03BD
+ memcpy(_screenVGA, _screenLayer2, 46080);
++step;
}
- waitForTimer(); // cseg100:03C0-03DD
- } while (step != 21); // cseg100:03E1-03E7
+ waitForTimer();
+ } while (step != 21);
- _walkData[0].setPos(xPos, yPos, kFacingPositionLeft, 0); // cseg100:03EA-03FB
- _walkData[0].setDefaultScale(); // cseg100:0400-0425
- _currentPart = 340; // cseg100:042A
+ _walkData[0].setPos(xPos, yPos, kFacingPositionLeft, 0);
+ _walkData[0].setDefaultScale();
+ _currentPart = 340;
}
void IgorEngine::PART_35_ACTION_106_EXIT_TO_MAP() {
- --_walkDataLastIndex; // cseg100:0432
+ --_walkDataLastIndex;
const uint8 area = _screenLayer2[10879]; // (319, 33); cseg100:0440-0455
_roomObjectAreasTable[area].area = 1;
- buildWalkPath(242, 111, 319, 33); // cseg100:045A-0464
+ buildWalkPath(242, 111, 319, 33);
_roomObjectAreasTable[area].area = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove(); // cseg100:0469-0473
- _currentPart = 40; // cseg100:0478
+ waitForIgorMove();
+ _currentPart = 40;
}
void IgorEngine::PART_35_APPLY_OBJECT_STATE(int num) {
@@ -114,13 +111,13 @@ void IgorEngine::PART_35_APPLY_OBJECT_STATE(int num) {
}
void IgorEngine::PART_35() {
- _gameState.enableLight = 1; // cseg100:167F
- loadActionData(DAT_ParkRight); // cseg100:1690-16B3; resource 100
+ _gameState.enableLight = 1;
+ loadActionData(DAT_ParkRight); // resource 100
loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // left panel; cseg106:0002-06A1
static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
- loadAnimData(frames, 0x5A00); // cseg105:0002-00D8
+ loadAnimData(frames, 0x5A00);
for (int y = 0; y <= 143; ++y) {
- memcpy(_animFramesBuffer + y * 160, _screenLayer1 + y * 320, 160); // cseg100:16D5-170F
+ memcpy(_animFramesBuffer + y * 160, _screenLayer1 + y * 320, 160);
}
loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight,
TXT_ParkRight); // active right panel; cseg100:1714-1739; cseg104:0002-0D20
@@ -128,36 +125,36 @@ void IgorEngine::PART_35() {
SET_PAL_208_96_1();
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_35_EXEC_ACTION);
_roomDataOffsets = PART_35_ROOM_DATA_OFFSETS;
- setRoomWalkBounds(0, 0, 281, 143); // cseg100:0657-06C1; rightmost walkable column is 281
+ setRoomWalkBounds(0, 0, 281, 143); // rightmost walkable column is 281
PART_35_APPLY_OBJECT_STATE(255);
if (_currentPart != 351) {
- memcpy(_screenVGA, _screenLayer1, 46080); // cseg100:175A-176C
+ memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
- fadeIn(768); // cseg100:183C-1848
+ fadeIn(768);
}
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
if (_currentPart == 350) {
WalkData *wd = &_walkData[0];
- wd->setPos(319, 33, kFacingPositionFront, 1); // cseg100:048A-049B
- wd->clipSkipX = 1; // cseg100:04A0
- wd->clipWidth = 10; // cseg100:04A5
- wd->scaleWidth = 34; // cseg100:04AB
- wd->xPosChanged = 1; // cseg100:04B1
- wd->dxPos = 0; // cseg100:04B6-04B8
- wd->yPosChanged = 1; // cseg100:04BB
- wd->dyPos = 0; // cseg100:04C0-04C2
- wd->scaleHeight = 34; // cseg100:04C5
+ wd->setPos(319, 33, kFacingPositionFront, 1);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 10;
+ wd->scaleWidth = 34;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 34;
_walkDataLastIndex = 0;
const uint8 area = _screenLayer2[10879]; // (319, 33); cseg100:04CF-04E4
_roomObjectAreasTable[area].area = 1;
- buildWalkPath(319, 33, 242, 111); // cseg100:04E9-04F3
+ buildWalkPath(319, 33, 242, 111);
_roomObjectAreasTable[area].area = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove(); // cseg100:0512-0529
+ waitForIgorMove();
}
enterPartLoop();
@@ -166,9 +163,9 @@ void IgorEngine::PART_35() {
}
leavePartLoop();
if (_currentPart == kInvalidPart) {
- fadeOut(768); // cseg100:2491-24A3
+ fadeOut(768);
} else if (_currentPart != 340) {
- fadeOut(624); // cseg100:24AA-24D6
+ fadeOut(624);
}
}
diff --git a/engines/igor/part_7.cpp b/engines/igor/part_7.cpp
index b0bcb4ef22b..588fa07b861 100644
--- a/engines/igor/part_7.cpp
+++ b/engines/igor/part_7.cpp
@@ -10,13 +10,10 @@
namespace Igor {
-// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
-// _objectsState[26] = s3:0x856 and [27] = s3:0x857; cseg197:0150-03D8.
-
-const uint32 kDoor1Closed = 0x2175; // cseg197:007B
-const uint32 kDoor1Open = 0x23F1; // cseg197:002B
-const uint32 kDoor2Closed = 0x266D; // cseg197:011B
-const uint32 kDoor2Open = 0x28DD; // cseg197:00CB
+const uint32 kDoor1Closed = 0x2175;
+const uint32 kDoor1Open = 0x23F1;
+const uint32 kDoor2Closed = 0x266D;
+const uint32 kDoor2Open = 0x28DD;
void IgorEngine::PART_07_DRAW_DOOR_STATE(int num) {
_roomActionsTable[297] = 109;
diff --git a/engines/igor/part_8.cpp b/engines/igor/part_8.cpp
index 4979d9d21f3..bcb24c495c9 100644
--- a/engines/igor/part_8.cpp
+++ b/engines/igor/part_8.cpp
@@ -10,10 +10,6 @@
namespace Igor {
-// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
-// Indices are addresses relative to s3:0x83C: [0]=0x83C, [26]=0x856,
-// [28..32]=0x858..0x85C, [41..42]=0x865..0x866 and [111]=0x8AB;
-// cseg189:02B0-16EF.
void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
@@ -23,10 +19,10 @@ void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
_roomActionsTable[150] = _objectsState[26] == 0 ? 6 : 7;
}
if (num == 2 || num == 255) {
- if (_objectsState[111] == 1) { // s3:0x8AB; cseg189:16EF-1700
- _roomObjectAreasTable[7].object = 0; // s3:0xDC7A; cseg189:16F6
- _roomObjectAreasTable[8].object = 0; // s3:0xDC7F; cseg189:16FB
- _roomActionsTable[146] = 4; // cseg189:1732-1743
+ if (_objectsState[111] == 1) {
+ _roomObjectAreasTable[7].object = 0;
+ _roomObjectAreasTable[8].object = 0;
+ _roomActionsTable[146] = 4;
return;
}
uint32 srcOffset;
diff --git a/engines/igor/part_9.cpp b/engines/igor/part_9.cpp
index 581ebd3f554..4ef835022e3 100644
--- a/engines/igor/part_9.cpp
+++ b/engines/igor/part_9.cpp
@@ -10,10 +10,6 @@
namespace Igor {
-// _objectsState[] is a flat mirror of the original's s3:0x83C-based globals.
-// _objectsState[27] = s3:0x857 and [34..36] = s3:0x85E..0x860;
-// cseg190:0288-112A.
-
void IgorEngine::PART_09_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
const uint32 srcOffset = _objectsState[27] == 0 ? 0x5D0B : 0x61A3;
@@ -39,7 +35,8 @@ void IgorEngine::PART_09_ANIMATE_DOOR(bool open) {
return;
}
- static const uint8 openFrames[] = { 3, 0 }; // static frame selectors: s3:0x202-0x203
+ static const uint8 openFrames[] = { 3, 0 };
+
for (int i = 0; i < 2; ++i) {
const int frame = open ? openFrames[i] : i + 1;
for (int y = 0; y <= 52; ++y)
@@ -121,17 +118,17 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
void IgorEngine::PART_09() {
_gameState.enableLight = 1;
- loadActionData(DAT_AdministrationSecretaryRoom); // static resource: cseg190:2F69-2F8C
+ loadActionData(DAT_AdministrationSecretaryRoom);
loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom,
BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom,
- TXT_AdministrationSecretaryRoom); // static resources: cseg192/cseg193
+ TXT_AdministrationSecretaryRoom);
static const int anim[] = {
ANM_AdministrationSecretaryRoom1, ANM_AdministrationSecretaryRoom2,
ANM_AdministrationSecretaryRoom3, ANM_AdministrationSecretaryRoom4,
ANM_AdministrationSecretaryRoom5, ANM_AdministrationSecretaryRoom6,
ANM_AdministrationSecretaryRoom7, ANM_AdministrationSecretaryRoom8,
ANM_AdministrationSecretaryRoom9, 0
- }; // static resources: cseg192:0002-01D4
+ };
loadAnimData(anim);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_09_EXEC_ACTION);
_roomDataOffsets = PART_09_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index b22c75647df..0a3fbba0eaa 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -141,6 +141,12 @@ void IgorEngine::moveIgor(int pos, int frame) {
int16 _walkDataCurrentPosX2 = wd->x;
int16 _walkDataCurrentPosY2 = wd->y;
+ if (_walkDxPos <= 0) {
+ debugC(9, kDebugWalk, "moveIgor NEGATIVE dxPos: wd->dxPos %d _walkDxPos %d clipWidth %d wd->x %d wd->y %d _walkData[0] %d,%d idx %d",
+ wd->dxPos, _walkDxPos, _walkClipWidth, _walkDataCurrentPosX2, _walkDataCurrentPosY2,
+ _walkData[0].x, _walkData[0].y, _walkDataCurrentIndex);
+ }
+
uint16 _walkDataDrawOffset = (wd->y - wd->scaleWidth + 1) * 320;
int xPos = _walkWidthScaleTable[wd->scaleHeight - 1] / 2;
Commit: 285d6d3a7a544a8feef4f643e4360e1e09790496
https://github.com/scummvm/scummvm/commit/285d6d3a7a544a8feef4f643e4360e1e09790496
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:05+01:00
Commit Message:
IGOR: Part 0
Changed paths:
A engines/igor/part_0.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 367b673e484..60965386d38 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -474,6 +474,13 @@ private:
void PART_04_EXEC_ACTION(int action);
void PART_04_CLEAR_OBJECT_STATE_84(int num);
void PART_04();
+ void PART_00();
+ void PART_00_EXEC_ACTION(int action);
+ void PART_00_APPLY_OBJECT_STATE(int num);
+ void PART_00_DRAW_RAW_FRAME(int srcOffset, int frame, int frameSize, int width, int height, int dstOffset);
+ void PART_00_ANIMATE_RAW(int srcOffset, int firstFrame, int lastFrame, int frameSize, int width, int height, int dstOffset, int delay, int soundFrame, int sound);
+ void PART_00_ENTRY_ANIMATION();
+ void PART_00_WALK_IN();
// spring bridge
void PART_05_HELPER_4_drawPaperOrNot(int num);
@@ -863,6 +870,7 @@ protected:
// Engine APIs
Common::Error run() override;
static const RoomDataOffsets PART_04_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_00_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_05_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_06_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_07_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 1763f14c470..4326bcea4dc 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -13,6 +13,7 @@ MODULE_OBJS = \
input.o \
static_walk.o \
static_cursor.o \
+ part_0.o \
part_4.o \
part_5.o \
part_85.o \
diff --git a/engines/igor/part_0.cpp b/engines/igor/part_0.cpp
new file mode 100644
index 00000000000..2f83b1a3707
--- /dev/null
+++ b/engines/igor/part_0.cpp
@@ -0,0 +1,332 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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 3 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+void IgorEngine::PART_00_DRAW_RAW_FRAME(int srcOffset, int frame, int frameSize,
+ int width, int height, int dstOffset) {
+ // cseg206:00E0-01BF and the corresponding raw-frame loops through 14D5.
+ const uint8 *src = _animFramesBuffer + srcOffset + frame * frameSize;
+ for (int y = 0; y < height; ++y) {
+ for (int x = 0; x < width; ++x) {
+ const int dst = dstOffset + y * 320 + x;
+ uint8 color = src[y * width + x];
+ if (color >= 0xC0 && color <= 0xCF) {
+ const RoomObjectArea &area = _roomObjectAreasTable[_screenLayer2[dst]];
+ if (area.y1Lum > 0)
+ color = _screenLayer1[dst];
+ else if (area.y2Lum > 0)
+ color -= area.deltaLum;
+ }
+ _screenTempLayer[y * 100 + x] = color;
+ }
+ }
+ for (int y = 0; y < height; ++y)
+ memcpy(_screenVGA + dstOffset + y * 320, _screenTempLayer + y * 100, width);
+}
+
+void IgorEngine::PART_00_ANIMATE_RAW(int srcOffset, int firstFrame, int lastFrame,
+ int frameSize, int width, int height, int dstOffset, int delay,
+ int soundFrame, int sound) {
+ const int step = firstFrame <= lastFrame ? 1 : -1;
+ for (int frame = firstFrame;; frame += step) {
+ PART_00_DRAW_RAW_FRAME(srcOffset, frame, frameSize, width, height, dstOffset);
+ if (frame == soundFrame)
+ playSound(sound, 1);
+ if (frame != lastFrame)
+ waitForTimer(delay);
+ if (frame == lastFrame)
+ break;
+ }
+}
+
+void IgorEngine::PART_00_APPLY_OBJECT_STATE(int num) {
+ if (num == 1 || num == 255) {
+ const bool open = _objectsState[8] != 0; // s3:0844; cseg206:1AA8-1AF0
+ const int src = open ? 0x4CFA : 0x4C6A;
+ for (int y = 0; y < 9; ++y)
+ memcpy(_screenLayer1 + 0x8EBD + y * 320, _animFramesBuffer + src + y * 16, 16);
+ _roomActionsTable[74] = open ? 7 : 6;
+ _roomObjectAreasTable[13].object = open ? (_objectsState[9] == 0 ? 3 : 2) : 2;
+ }
+ if (num == 3 || num == 255) {
+ const bool open = _objectsState[10] != 0; // s3:0846; cseg206:1AFF-1B42
+ const int src = open ? 0x3900 : 0x3238;
+ for (int y = 0; y < 56; ++y)
+ memcpy(_screenLayer1 + 0x5572 + y * 320, _animFramesBuffer + src + y * 31, 31);
+ _roomActionsTable[76] = open ? 7 : 6;
+ _roomObjectAreasTable[3].object = (_objectsState[11] == 0) ? 4 : 5;
+ }
+ if (num == 6 || num == 255) {
+ // s3:0849 maps to _objectsState[13]; cseg206:1B51-1BBD.
+ const int state = _objectsState[13];
+ const int src = state == 1 ? 0x143C : 0x1200;
+ for (int y = 0; y < 22; ++y)
+ memcpy(_screenLayer1 + 0x6DB7 + y * 320, _animFramesBuffer + src + y * 26, 26);
+ _roomActionsTable[79] = state == 1 ? 7 : (state == 2 ? 6 : 4);
+ }
+}
+
+void IgorEngine::PART_00_EXEC_ACTION(int action) {
+ debugC(9, kDebugGame, "PART_00_EXEC_ACTION %d", action);
+ switch (action) {
+ case 101: // cseg206:00A2-0248
+ if (_objectsState[13] != 1) {
+ PART_00_ANIMATE_RAW(0x1200, 1, 3, 0x480, 36, 32, 0x6B2C, 62, 2, 1);
+ _objectsState[13] = 1;
+ PART_00_APPLY_OBJECT_STATE(6);
+ }
+ break;
+ case 102: // cseg206:0249-03F6
+ if (_objectsState[13] == 1) {
+ PART_00_ANIMATE_RAW(0x1200, 2, 0, 0x480, 36, 32, 0x6B2C, 62, 2, 2);
+ _objectsState[13] = 2;
+ PART_00_APPLY_OBJECT_STATE(6);
+ }
+ break;
+ case 103: // cseg206:159E-15CA
+ ADD_DIALOGUE_TEXT(201, 3, 95);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 104: // cseg206:132A-14E9
+ if (_objectsState[13] != 1)
+ break;
+ if (_objectsState[15] != 0) {
+ ADD_DIALOGUE_TEXT(212, 1, 101);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ }
+ PART_00_ANIMATE_RAW(0x4D8A, 0, 1, 0x5DC, 30, 50, 0x6B2C, 62, -1, 0);
+ _objectsState[13] = 2;
+ _objectsState[15] = 1;
+ _currentPart = 10;
+ break;
+ case 105: // cseg206:15CB-15F7
+ ADD_DIALOGUE_TEXT(204, 1, 96);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 106: // cseg206:088B-0A33
+ if (_objectsState[8] == 0) {
+ PART_00_ANIMATE_RAW(0x3FC8, 0, 2, 0x436, 22, 49, 0x693C, 126, 2, 6);
+ _objectsState[8] = 1;
+ PART_00_APPLY_OBJECT_STATE(1);
+ }
+ break;
+ case 107: // cseg206:0A34-0BDC
+ if (_objectsState[8] != 0) {
+ PART_00_ANIMATE_RAW(0x3FC8, 2, 0, 0x436, 22, 49, 0x693C, 126, 1, 6);
+ _objectsState[8] = 0;
+ PART_00_APPLY_OBJECT_STATE(1);
+ }
+ break;
+ case 108: // cseg206:15F8-1678
+ if (_objectsState[8] == 0)
+ ADD_DIALOGUE_TEXT(205, 1, 97);
+ else if (_objectsState[9] == 0)
+ ADD_DIALOGUE_TEXT(217, 1, 104);
+ else
+ ADD_DIALOGUE_TEXT(218, 1, 105);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 109: // cseg206:0FC7-1194
+ if (_objectsState[9] == 0) {
+ PART_00_ANIMATE_RAW(0x8410, 0, 1, 0x405, 21, 49, 0x693D, 126, -1, 0);
+ addObjectToInventory(6, 41); // s3:0903; cseg206:113C-1176
+ _objectsState[9] = 1;
+ PART_00_APPLY_OBJECT_STATE(1);
+ }
+ break;
+ case 110: // cseg206:0497-063F
+ if (_objectsState[10] == 0) {
+ PART_00_ANIMATE_RAW(0x1678, 0, 2, 0x940, 37, 64, 0x556C, 126, 2, 3);
+ _objectsState[10] = 1;
+ PART_00_APPLY_OBJECT_STATE(3);
+ }
+ break;
+ case 111: // cseg206:0640-07E8
+ if (_objectsState[10] != 0) {
+ PART_00_ANIMATE_RAW(0x1678, 2, 0, 0x940, 37, 64, 0x556C, 126, 1, 4);
+ _objectsState[10] = 0;
+ PART_00_APPLY_OBJECT_STATE(3);
+ }
+ break;
+ case 112: // cseg206:1679-16A5
+ ADD_DIALOGUE_TEXT(206, 1, 98);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 113: // cseg206:16A6-16D2
+ ADD_DIALOGUE_TEXT(207, 2, 99);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 114: // cseg206:1195-1329
+ if (_objectsState[10] == 0)
+ PART_00_EXEC_ACTION(110);
+ PART_00_ANIMATE_RAW(0x5942, 0, 2, 0x44C, 22, 50, 0x66EE, 30, -1, 0);
+ _currentPart = 24;
+ break;
+ case 115: // cseg206:16D3-16FF
+ ADD_DIALOGUE_TEXT(209, 3, 100);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 116: // cseg206:0DCE-0FC6
+ if (_objectsState[12] == 0) {
+ PART_00_ANIMATE_RAW(0x7C06, 0, 1, 0x405, 21, 49, 0x7146, 126, -1, 0);
+ addObjectToInventory(5, 40); // s3:0902; cseg206:0F75-0FAF
+ _objectsState[12] = 1;
+ PART_00_APPLY_OBJECT_STATE(255);
+ } else {
+ ADD_DIALOGUE_TEXT(213, 2, 102);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ }
+ break;
+ case 117: // cseg206:14EA-159D
+ {
+ int walkFrame = 1;
+ for (int i = 9; i >= 0; --i) {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(145, 143, kFacingPositionFront, i == 9 ? 0 : walkFrame);
+ if (i != 9)
+ walkFrame = walkFrame == 6 ? 1 : walkFrame + 1;
+ 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 = 40;
+ break;
+ case 118: // cseg206:1700-173E
+ ADD_DIALOGUE_TEXT(219, 1, 106);
+ ADD_DIALOGUE_TEXT(220, 1, 107);
+ SET_DIALOGUE_TEXT(1, 2);
+ startIgorDialogue();
+ break;
+ default:
+ error("PART_00_EXEC_ACTION unhandled action %d", action);
+ }
+}
+
+void IgorEngine::PART_00_ENTRY_ANIMATION() {
+ // cseg206:0BDD-0DCD.
+ waitForTimer(62);
+ if (_objectsState[10] == 0) {
+ for (int y = 0; y < 56; ++y)
+ memcpy(_screenVGA + 0x5572 + y * 320, _animFramesBuffer + 0x3900 + y * 31, 31);
+ _objectsState[10] = 1;
+ PART_00_APPLY_OBJECT_STATE(3);
+ playSound(3, 1);
+ waitForTimer(30);
+ }
+ PART_00_ANIMATE_RAW(0x6626, 0, 3, 0x578, 25, 56, 0x5F6E, 30, -1, 0);
+}
+
+void IgorEngine::PART_00_WALK_IN() {
+ // cseg206:3AB1-3B5C.
+ PART_00_ENTRY_ANIMATION();
+ WalkData *wd = &_walkData[0];
+ wd->setPos(120, 131, kFacingPositionFront, 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(120, 131, 120, 136);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ if (_objectsState[14] == 0) { // s3:084A; cseg206:3B2F-3B57
+ ADD_DIALOGUE_TEXT(215, 2, 103);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ _objectsState[14] = 1;
+ } else {
+ // cseg206:173F-1821: restore the room, scale Igor into view, then
+ // walk from the doorway to the room's normal entrance point.
+ PART_00_APPLY_OBJECT_STATE(255);
+ int walkFrame = 1;
+ for (int i = 0; i <= 9; ++i) {
+ WalkData *entry = &_walkData[0];
+ entry->setPos(145, 143, kFacingPositionBack, walkFrame);
+ walkFrame = walkFrame == 6 ? 1 : walkFrame + 1;
+ entry->clipSkipX = 1;
+ entry->clipWidth = 30;
+ entry->scaleWidth = i * 3 + 23;
+ entry->xPosChanged = 1;
+ entry->dxPos = 0;
+ entry->yPosChanged = 1;
+ entry->dyPos = 0;
+ entry->scaleHeight = 50;
+ moveIgor(entry->posNum, entry->frameNum);
+ waitForTimer(15);
+ }
+ _walkDataLastIndex = 0;
+ buildWalkPath(145, 143, 125, 138);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ }
+}
+
+void IgorEngine::PART_00() {
+ _gameState.enableLight = 1; // cseg206:3964
+ loadActionData(DAT_StudentDormitoryRoom); // cseg206:3975-3998
+ loadRoomData(PAL_StudentDormitoryRoom, IMG_StudentDormitoryRoom,
+ BOX_StudentDormitoryRoom, MSK_StudentDormitoryRoom,
+ TXT_StudentDormitoryRoom); // cseg208:0002
+ static const int animFrames[] = {
+ ANM_StudentDormitoryRoom1, ANM_StudentDormitoryRoom2,
+ ANM_StudentDormitoryRoom3, ANM_StudentDormitoryRoom4,
+ ANM_StudentDormitoryRoom5, ANM_StudentDormitoryRoom6,
+ ANM_StudentDormitoryRoom7, ANM_StudentDormitoryRoom8,
+ ANM_StudentDormitoryRoom9, ANM_StudentDormitoryRoom10,
+ ANM_StudentDormitoryRoom11, 0
+ };
+ loadAnimData(animFrames); // cseg207:0002-0239
+ _roomDataOffsets = PART_00_ROOM_DATA_OFFSETS;
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_00_EXEC_ACTION);
+ PART_00_APPLY_OBJECT_STATE(255);
+ memcpy(_screenVGA, _screenLayer1, 46080); // cseg206:39B3-39C5
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ PART_00_WALK_IN();
+
+ enterPartLoop();
+ while (_currentPart == 1)
+ runPartLoop();
+ leavePartLoop();
+ if (_currentPart == kInvalidPart)
+ fadeOut(768);
+ else
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 8b1c98b12bd..c41713f0ee4 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -522,6 +522,9 @@ void IgorEngine::PART_MAIN() {
do {
debugC(9, kDebugGame, "PART_MAIN _currentPart %d", _currentPart);
switch (_currentPart) {
+ case 1:
+ PART_00(); // Student dormitory; cseg001:08BA-08C1
+ break;
case 40:
PART_04(); // Map
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 9d4190309b9..2f8bd79aaac 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -136,8 +136,10 @@ void IgorEngine::loadDialogueData(int dlg) {
int replySoundsOffset = _roomDataOffsets.dlg.replySoundsOffset;
int replySoundsSize = _roomDataOffsets.dlg.replySoundsSize;
if (questionSoundsOffset == 0) {
- questionSoundsOffset = dataSize - (_roomDataOffsets.dlg.questionsSize + _roomDataOffsets.dlg.repliesSize + 2) * 2;
- replySoundsOffset = questionSoundsOffset + (_roomDataOffsets.dlg.questionsSize + 1) * 2;
+ // The packed tail shares the last question word with the reply table's
+ // leading residue word. cseg172:043B-0452,0A4A-0A92.
+ questionSoundsOffset = dataSize - (_roomDataOffsets.dlg.questionsSize + _roomDataOffsets.dlg.repliesSize + 1) * 2;
+ replySoundsOffset = questionSoundsOffset + _roomDataOffsets.dlg.questionsSize * 2;
replySoundsSize = _roomDataOffsets.dlg.repliesSize;
}
assert(questionSoundsOffset >= 0);
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 9e380dea57b..02d32eb2292 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -518,6 +518,19 @@
// Dean Peeper's conversation data block from NE segment 194.
#define DLG_DeanPepperOffice 938
+// Student dormitory animation blocks copied contiguously by cseg207:0002-0239.
+#define ANM_StudentDormitoryRoom1 939 // cseg207:023B; IGOR.EXE:0x7A843B, 0x1200 bytes
+#define ANM_StudentDormitoryRoom2 940 // cseg207:143B; IGOR.EXE:0x7A963B, 0x0478 bytes
+#define ANM_StudentDormitoryRoom3 941 // cseg207:18B3; IGOR.EXE:0x7A9AB3, 0x1BC0 bytes
+#define ANM_StudentDormitoryRoom4 942 // cseg207:3473; IGOR.EXE:0x7AB673, 0x0D90 bytes
+#define ANM_StudentDormitoryRoom5 943 // cseg207:4203; IGOR.EXE:0x7AC403, 0x0CA2 bytes
+#define ANM_StudentDormitoryRoom6 944 // cseg207:4EA5; IGOR.EXE:0x7AD0A5, 0x0120 bytes
+#define ANM_StudentDormitoryRoom7 945 // cseg207:4FC5; IGOR.EXE:0x7AD1C5, 0x0BB8 bytes
+#define ANM_StudentDormitoryRoom8 946 // cseg207:5B7D; IGOR.EXE:0x7ADD7D, 0x0CE4 bytes
+#define ANM_StudentDormitoryRoom9 947 // cseg207:6861; IGOR.EXE:0x7AEA61, 0x15E0 bytes
+#define ANM_StudentDormitoryRoom10 948 // cseg207:7E41; IGOR.EXE:0x7B0041, 0x080A bytes
+#define ANM_StudentDormitoryRoom11 949 // cseg207:864B; IGOR.EXE:0x7B084B, 0x080A bytes
+
// Administration secretary-room animation blocks copied by cseg192:0002-01D4.
#define ANM_AdministrationSecretaryRoom1 923 // cseg192:01D5; IGOR.EXE:0x7057D5, 0xD38 bytes
#define ANM_AdministrationSecretaryRoom2 924 // cseg192:0F0D; IGOR.EXE:0x70650D, 0x1FB bytes
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index d7764c427ee..68033b979a1 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -23,6 +23,13 @@
namespace Igor {
+const RoomDataOffsets IgorEngine::PART_00_ROOM_DATA_OFFSETS = {
+ { 45, 3, 6, 2 }, // cseg206:29BB-29EF
+ { 79, 96 }, // cseg206:2FF8-301F,3191-31B5
+ { 103, 347, 3503, 247, 323, 88 }, // cseg206:2DCA-2E69
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
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,
@@ -225,8 +232,8 @@ const RoomDataOffsets IgorEngine::PART_08_ROOM_DATA_OFFSETS = {
5188, 100,
90,
270,
- 15548,
- 15488,
+ 15488, // cseg195:4B98-4BC0
+ 15548, // cseg195:51AE-51D4
30
}
};
@@ -382,23 +389,15 @@ const RoomDataOffsets IgorEngine::PART_30_ROOM_DATA_OFFSETS = {
{ 75, 84 },
{ 87, 259, 3135, 151, 227, 80 },
{
- // Spanish DLG_CollegeStairsFirstFloor (TBL id 34, 0x426040, 2753 bytes) stores its
- // question cells at blob offset 0, with no leading dialogue matrix. The sound
- // tables use the same layout proven for part 12 and part 17: questionSoundsOffset
- // points at a non-indexed residue word, entry i is read at + (i + 1) * 2, and
- // replySoundsOffset == questionSoundsOffset + questionsSize * 2.
- // TODO: derive from cseg110 handleDialogue call site (cseg110:018E-019E) where the
- // original sources room 30's reply graph -- the 115 bytes trailing the sound table
- // (blob offset 2638..2753) look like it, but that is not yet proven.
- -205, // -(164 + 41): question 0 line 0 lands on blob offset 0
- 9, // 9 question cells of 164 bytes, two 41-byte lines each
- 1374, // = 1476 - 102: reply 0 lands at blob offset 1476 = 9 * 164
- 11, // 11 reply cells of 102 bytes
+ -90, // cseg110:018E-019E; first question at blob+115
+ 9,
+ 1489, // cseg110:018E-019E; first reply at blob+1591
+ 11,
30,
0,
- 2596, // residue word 64760 at blob+2596
- 2614, // = 2596 + 9 * 2, shares question 8's word as its own residue
- 11 // reply 10 reads 477 at blob+2636, leaving 115 trailing bytes
+ 2711, // cseg110:018E-019E; derived from the packed-tail layout
+ 2729,
+ 11
}
};
Commit: 6ef3e392fc54f11b7a51a43b7a1e1f0b4f8d2a65
https://github.com/scummvm/scummvm/commit/6ef3e392fc54f11b7a51a43b7a1e1f0b4f8d2a65
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:05+01:00
Commit Message:
IGOR: Options menu
Changed paths:
A engines/igor/options.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/module.mk
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 8c68425d4d8..af5e475f929 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -19,16 +19,17 @@
*
*/
-#include "igor/igor.h"
+#include "audio/mixer.h"
#include "common/config-manager.h"
#include "common/debug-channels.h"
#include "common/scummsys.h"
#include "common/system.h"
#include "engines/util.h"
+
+#include "igor/igor.h"
#include "igor/console.h"
#include "igor/detection.h"
-#include "audio/mixer.h"
namespace Igor {
@@ -65,9 +66,9 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- // _currentPart = 850;
+ _currentPart = 850;
- _currentPart = 171;
+ // _currentPart = 171;
// _currentPart = 62;
// _currentPart = 40;
}
@@ -555,12 +556,148 @@ void IgorEngine::handlePause() {
}
Common::Error IgorEngine::syncGame(Common::Serializer &s) {
- // The Serializer has methods isLoading() and isSaving()
- // if you need to specific steps; for example setting
- // an array size after reading it's length, whereas
- // for saving it would write the existing array's length
- int dummy = 0;
- s.syncAsUint32LE(dummy);
+ // Serialize in the same order as reference implementation
+
+ // 1. Walk data (100 entries)
+ for (int i = 0; i < 100; ++i) {
+ if (s.isSaving()) {
+ s.syncBytes(0, 2);
+ } else {
+ byte pad[2];
+ s.syncBytes(pad, 2);
+ }
+ s.syncAsSint16LE(_walkData[i].x);
+ s.syncAsSint16LE(_walkData[i].y);
+ s.syncAsByte(_walkData[i].posNum);
+ s.syncAsByte(_walkData[i].frameNum);
+ s.syncAsByte(_walkData[i].clipSkipX);
+ s.syncAsSint16LE(_walkData[i].clipWidth);
+ s.syncAsSint16LE(_walkData[i].scaleWidth);
+ s.syncAsByte(_walkData[i].xPosChanged);
+ s.syncAsSint16LE(_walkData[i].dxPos);
+ s.syncAsByte(_walkData[i].yPosChanged);
+ s.syncAsSint16LE(_walkData[i].dyPos);
+ s.syncAsByte(_walkData[i].scaleHeight);
+ }
+
+ // 2. Walk path state
+ if (s.isSaving()) {
+ s.syncBytes(0, 20);
+ } else {
+ byte pad[20];
+ s.syncBytes(pad, 20);
+ }
+ s.syncAsByte(_walkDataCurrentIndex);
+ s.syncAsByte(_walkDataLastIndex);
+ s.syncAsByte(_walkCurrentFrame);
+ s.syncAsByte(_walkCurrentPos);
+ if (s.isSaving()) {
+ s.syncBytes(0, 23);
+ } else {
+ byte pad[23];
+ s.syncBytes(pad, 23);
+ }
+
+ // 3. Current action
+ s.syncAsByte(_currentAction.verb);
+ s.syncAsByte(_currentAction.object1Num);
+ s.syncAsByte(_currentAction.object1Type);
+ s.syncAsByte(_currentAction.verbType);
+ s.syncAsByte(_currentAction.object2Num);
+ s.syncAsByte(_currentAction.object2Type);
+ if (s.isSaving()) {
+ s.syncBytes(0, 10);
+ } else {
+ byte pad[10];
+ s.syncBytes(pad, 10);
+ }
+
+ // 4. Part/state
+ s.syncAsSint16LE(_currentPart);
+ if (s.isSaving()) {
+ s.syncBytes(0, 8);
+ } else {
+ byte pad[8];
+ s.syncBytes(pad, 8);
+ }
+
+ // 5. Action state
+ s.syncAsByte(_actionCode);
+ s.syncAsByte(_actionWalkPoint);
+ if (s.isSaving()) {
+ s.syncBytes(0, 2);
+ } else {
+ byte pad[2];
+ s.syncBytes(pad, 2);
+ }
+
+ // 6. Cursor position
+ s.syncAsSint16LE(_inputVars[kInputCursorXPos]);
+ s.syncAsSint16LE(_inputVars[kInputCursorYPos]);
+
+ // 7. Game state
+ s.syncAsByte(_gameState.enableLight);
+ s.syncAsByte(_gameState.colorLum);
+ for (int i = 0; i < 5; ++i) {
+ s.syncAsSint16LE(_gameState.counter[i]);
+ }
+ { byte v = _gameState.igorMoving ? 1 : 0; s.syncAsByte(v); }
+ { byte v = _gameState.dialogueTextRunning ? 1 : 0; s.syncAsByte(v); }
+ { byte v = _gameState.updateLight ? 1 : 0; s.syncAsByte(v); }
+ { byte v = _gameState.unkF ? 1 : 0; s.syncAsByte(v); }
+ s.syncAsByte(_gameState.unk10);
+ s.syncAsByte(_gameState.unk11);
+ { byte v = _gameState.dialogueStarted ? 1 : 0; s.syncAsByte(v); }
+ if (s.isSaving()) {
+ s.syncBytes(0, 1);
+ } else {
+ byte pad[1];
+ s.syncBytes(pad, 1);
+ }
+ for (int i = 0; i < 500; ++i) {
+ s.syncAsByte(_gameState.dialogueData[i]);
+ }
+ s.syncAsByte(_gameState.dialogueChoiceStart);
+ s.syncAsByte(_gameState.dialogueChoiceCount);
+ if (s.isSaving()) {
+ s.syncBytes(0, 2);
+ } else {
+ byte pad[2];
+ s.syncBytes(pad, 2);
+ }
+ s.syncAsByte(_gameState.nextMusicCounter);
+ { byte v = _gameState.jumpToNextMusic ? 1 : 0; s.syncAsByte(v); }
+ s.syncAsByte(_gameState.configSoundEnabled);
+ s.syncAsByte(_gameState.talkSpeed);
+ s.syncAsByte(_gameState.talkMode);
+ if (s.isSaving()) {
+ s.syncBytes(0, 3);
+ } else {
+ byte pad[3];
+ s.syncBytes(pad, 3);
+ }
+ s.syncAsByte(_gameState.musicNum);
+ s.syncAsByte(_gameState.musicSequenceIndex);
+
+ // 8. Object states
+ for (int i = 0; i < 112; ++i) {
+ s.syncAsByte(_objectsState[i]);
+ }
+
+ // 9. Inventory
+ for (int i = 0; i < 74; ++i) {
+ s.syncAsByte(_inventoryInfo[i]);
+ }
+
+ if (s.isLoading()) {
+ memcpy(_igorPalette, (_currentPart == 760) ? PAL_IGOR_1 : PAL_IGOR_1, 48);
+ UPDATE_OBJECT_STATE(255);
+ playMusic(_gameState.musicNum);
+ _system->warpMouse(_inputVars[kInputCursorXPos], _inputVars[kInputCursorYPos]);
+ if (_currentPart < 900) {
+ showCursor();
+ }
+ }
return Common::kNoError;
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 60965386d38..d5e71bd7a72 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -429,6 +429,7 @@ private:
ResourceEntry *_resourceEntries;
Common::Array<StringEntry> _stringEntries;
+ char _saveStateDescriptions[kMaxSaveStates][100];
void restart();
@@ -714,6 +715,7 @@ private:
void redrawVerb(uint8 verb, bool highlight);
int getVerbUnderCursor(int x) const { return ((x % 46) < 44) ? (kVerbTalk + x / 46) : 0; }
void handleRoomInventoryScroll();
+ void handleOptionsMenu();
void scrollInventory();
void drawInventory(int start, int mode);
void addObjectToInventory(int object, int index);
@@ -802,6 +804,15 @@ private:
public:
Graphics::Screen *_screen = nullptr;
+ 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);
+
public:
IgorEngine(OSystem *syst, const ADGameDescription *gameDesc);
~IgorEngine() override;
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index e3b055e5340..8bc5cf8f7da 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -174,7 +174,7 @@ void IgorEngine::handleRoomInput() {
}
if (_inputVars[kInputOptions]) {
_inputVars[kInputOptions] = 0;
- // handleOptionsMenu();
+ handleOptionsMenu();
}
// dialogue skip
if (_inputVars[kInputSkipDialogue] && _gameState.dialogueTextRunning) {
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 4326bcea4dc..ceaaf35f277 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -13,6 +13,7 @@ MODULE_OBJS = \
input.o \
static_walk.o \
static_cursor.o \
+ options.o \
part_0.o \
part_4.o \
part_5.o \
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
new file mode 100644
index 00000000000..3970d2ce308
--- /dev/null
+++ b/engines/igor/options.cpp
@@ -0,0 +1,333 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "common/events.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 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() {
+ _font.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() {
+ _font.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() {
+ _font.drawString(_screenTextLayer, "Are you sure?", 120, 64 - 15, 0xF6, -1, 0);
+ _font.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);
+ _font.drawString(_screenTextLayer, textsStrTable1[i], textsPosTable1[i], 41 - 15, 0xF7, -1, 0);
+
+ redrawRect(_screenTextLayer, 2, false);
+ _font.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);
+ _font.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);
+ _font.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;
+}
+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;
+ }
+ }
+}
+
+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) {
+ _font.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);
+ }
+ _font.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();
+}
+
+} // End of namespace Igor
Commit: 89da410939827172301238225e10b34df8c01c77
https://github.com/scummvm/scummvm/commit/89da410939827172301238225e10b34df8c01c77
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:06+01:00
Commit Message:
IGOR: Enter part 0 from map
Changed paths:
engines/igor/igor.h
engines/igor/part_0.cpp
engines/igor/part_17.cpp
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index d5e71bd7a72..90867eff6fc 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -482,6 +482,7 @@ private:
void PART_00_ANIMATE_RAW(int srcOffset, int firstFrame, int lastFrame, int frameSize, int width, int height, int dstOffset, int delay, int soundFrame, int sound);
void PART_00_ENTRY_ANIMATION();
void PART_00_WALK_IN();
+ void PART_00_ENTER_FROM_BELOW();
// spring bridge
void PART_05_HELPER_4_drawPaperOrNot(int num);
diff --git a/engines/igor/part_0.cpp b/engines/igor/part_0.cpp
index 2f83b1a3707..0111a023176 100644
--- a/engines/igor/part_0.cpp
+++ b/engines/igor/part_0.cpp
@@ -1,13 +1,26 @@
/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
*/
-
#include "igor/igor.h"
+
namespace Igor {
void IgorEngine::PART_00_DRAW_RAW_FRAME(int srcOffset, int frame, int frameSize,
@@ -196,6 +209,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
break;
case 117: // cseg206:14EA-159D
{
+ _walkDataCurrentIndex = 0;
int walkFrame = 1;
for (int i = 9; i >= 0; --i) {
WalkData *wd = &_walkData[0];
@@ -266,34 +280,37 @@ void IgorEngine::PART_00_WALK_IN() {
startIgorDialogue();
_objectsState[14] = 1;
} else {
- // cseg206:173F-1821: restore the room, scale Igor into view, then
- // walk from the doorway to the room's normal entrance point.
- PART_00_APPLY_OBJECT_STATE(255);
- int walkFrame = 1;
- for (int i = 0; i <= 9; ++i) {
- WalkData *entry = &_walkData[0];
- entry->setPos(145, 143, kFacingPositionBack, walkFrame);
- walkFrame = walkFrame == 6 ? 1 : walkFrame + 1;
- entry->clipSkipX = 1;
- entry->clipWidth = 30;
- entry->scaleWidth = i * 3 + 23;
- entry->xPosChanged = 1;
- entry->dxPos = 0;
- entry->yPosChanged = 1;
- entry->dyPos = 0;
- entry->scaleHeight = 50;
- moveIgor(entry->posNum, entry->frameNum);
- waitForTimer(15);
- }
- _walkDataLastIndex = 0;
- buildWalkPath(145, 143, 125, 138);
- _walkData[_walkDataLastIndex].frameNum = 0;
- _walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- waitForIgorMove();
+ PART_00_ENTER_FROM_BELOW();
}
}
+void IgorEngine::PART_00_ENTER_FROM_BELOW() {
+ PART_00_APPLY_OBJECT_STATE(255);
+ _walkDataCurrentIndex = 0;
+ int walkFrame = 1;
+ for (int i = 0; i <= 9; ++i) {
+ WalkData *entry = &_walkData[0];
+ entry->setPos(145, 143, kFacingPositionBack, walkFrame);
+ walkFrame = walkFrame == 6 ? 1 : walkFrame + 1;
+ entry->clipSkipX = 1;
+ entry->clipWidth = 30;
+ entry->scaleWidth = i * 3 + 23;
+ entry->xPosChanged = 1;
+ entry->dxPos = 0;
+ entry->yPosChanged = 1;
+ entry->dyPos = 0;
+ entry->scaleHeight = 50;
+ moveIgor(entry->posNum, entry->frameNum);
+ waitForTimer(15);
+ }
+ _walkDataLastIndex = 0;
+ buildWalkPath(145, 143, 125, 138);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
void IgorEngine::PART_00() {
_gameState.enableLight = 1; // cseg206:3964
loadActionData(DAT_StudentDormitoryRoom); // cseg206:3975-3998
@@ -317,10 +334,13 @@ void IgorEngine::PART_00() {
fadeIn(768);
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
- PART_00_WALK_IN();
+ if (_currentPart == 1)
+ PART_00_WALK_IN();
+ else
+ PART_00_ENTER_FROM_BELOW();
enterPartLoop();
- while (_currentPart == 1)
+ while (_currentPart == 0 || _currentPart == 1)
runPartLoop();
leavePartLoop();
if (_currentPart == kInvalidPart)
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index 47e320b23fe..f484ead5fc0 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -516,7 +516,8 @@ void IgorEngine::PART_17() {
PART_17_HELPER_1(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- _gameState.unkF = true;
+
+
if (_objectsState[56] == 1) {
_gameState.unkF = false;
PART_17_HELPER_3(6);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index c41713f0ee4..fe2ad24e490 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -522,6 +522,7 @@ void IgorEngine::PART_MAIN() {
do {
debugC(9, kDebugGame, "PART_MAIN _currentPart %d", _currentPart);
switch (_currentPart) {
+ case 0:
case 1:
PART_00(); // Student dormitory; cseg001:08BA-08C1
break;
Commit: c61dd101efa11e7d2622f58ac5f637328712569e
https://github.com/scummvm/scummvm/commit/c61dd101efa11e7d2622f58ac5f637328712569e
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:06+01:00
Commit Message:
IGOR: Replace menu texts
Changed paths:
engines/igor/options.cpp
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 3970d2ce308..83fe46be7ba 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -69,31 +69,31 @@ struct Page {
static const Page pages[] = {
{
- { "SAVE", "Choose a position to SAVE to" },
- { 53, 75 },
+ { "Salvar", "Elige una posición donde salvar" },
+ { 50, 75 },
&IgorEngine::handleOptionsMenu_paintSave,
&IgorEngine::handleOptionsMenu_handleKeyDownSave
},
{
- { "LOAD", "Choose a game to load" },
- { 98, 93 },
+ { "Cargar", "Elige el juego que quieres cargar" },
+ { 95, 93 },
&IgorEngine::handleOptionsMenu_paintLoad,
&IgorEngine::handleOptionsMenu_handleKeyDownLoad
},
{
- { "QUIT", "QUIT" },
- { 146, 146 },
+ { "Salir", "Salir" },
+ { 145, 145 },
&IgorEngine::handleOptionsMenu_paintQuit,
&IgorEngine::handleOptionsMenu_handleKeyDownQuit
},
{
- { "CTRL", "Game CONTROLS" },
- { 190, 112 },
+ { "Opcion.", "Opciones" },
+ { 185, 112 },
&IgorEngine::handleOptionsMenu_paintCtrl,
&IgorEngine::handleOptionsMenu_handleKeyDownCtrl
},
{
- { "PLAY", 0 },
+ { "Jugar", 0 },
{ 237, 0 },
0,
0
Commit: 59f44ef6a48abbcb7fa942c5868e57631ae73ec4
https://github.com/scummvm/scummvm/commit/59f44ef6a48abbcb7fa942c5868e57631ae73ec4
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:06+01:00
Commit Message:
IGOR: Fix open/close window animation
Changed paths:
engines/igor/part_0.cpp
diff --git a/engines/igor/part_0.cpp b/engines/igor/part_0.cpp
index 0111a023176..9b971b2634f 100644
--- a/engines/igor/part_0.cpp
+++ b/engines/igor/part_0.cpp
@@ -90,16 +90,17 @@ void IgorEngine::PART_00_APPLY_OBJECT_STATE(int num) {
void IgorEngine::PART_00_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_00_EXEC_ACTION %d", action);
switch (action) {
- case 101: // cseg206:00A2-0248
+ case 101: // open window
if (_objectsState[13] != 1) {
- PART_00_ANIMATE_RAW(0x1200, 1, 3, 0x480, 36, 32, 0x6B2C, 62, 2, 1);
+
+ PART_00_ANIMATE_RAW(0, 1, 3, 0x480, 36, 32, 0x6B2C, 62, 2, 1);
_objectsState[13] = 1;
PART_00_APPLY_OBJECT_STATE(6);
}
break;
- case 102: // cseg206:0249-03F6
+ case 102: // close window
if (_objectsState[13] == 1) {
- PART_00_ANIMATE_RAW(0x1200, 2, 0, 0x480, 36, 32, 0x6B2C, 62, 2, 2);
+ PART_00_ANIMATE_RAW(0, 2, 0, 0x480, 36, 32, 0x6B2C, 62, 2, 2);
_objectsState[13] = 2;
PART_00_APPLY_OBJECT_STATE(6);
}
@@ -160,14 +161,14 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
PART_00_APPLY_OBJECT_STATE(1);
}
break;
- case 110: // cseg206:0497-063F
+ case 110: // open closet
if (_objectsState[10] == 0) {
PART_00_ANIMATE_RAW(0x1678, 0, 2, 0x940, 37, 64, 0x556C, 126, 2, 3);
_objectsState[10] = 1;
PART_00_APPLY_OBJECT_STATE(3);
}
break;
- case 111: // cseg206:0640-07E8
+ case 111: // close closet
if (_objectsState[10] != 0) {
PART_00_ANIMATE_RAW(0x1678, 2, 0, 0x940, 37, 64, 0x556C, 126, 1, 4);
_objectsState[10] = 0;
Commit: c153b331e26831809967c6b85c96ef929b01cb73
https://github.com/scummvm/scummvm/commit/c153b331e26831809967c6b85c96ef929b01cb73
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:07+01:00
Commit Message:
IGOR: Fix crash when walking to certain points
Changed paths:
engines/igor/input.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 8bc5cf8f7da..29967337ee4 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -63,12 +63,12 @@ void IgorEngine::waitForTimer(int ticks) {
} 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);
- // }
+ else if (ev.kbd.keycode == Common::KEYCODE_F1) {
+ debug("Quicksave part %d", _currentPart);
+ saveGameState(kQuickSaveSlot, "");
+ } else if (ev.kbd.keycode == Common::KEYCODE_F2) {
+ loadGameState(kQuickSaveSlot);
+ }
break;
case Common::EVENT_MOUSEMOVE:
_inputVars[kInputCursorXPos] = ev.mouse.x;
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 0a3fbba0eaa..22ede2dd36a 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1090,6 +1090,30 @@ void IgorEngine::buildWalkPathSimple(int srcX, int srcY, int dstX, int dstY) {
}
void IgorEngine::fixWalkPosition(int *x, int *y) {
+ if (getPart() == 0) {
+ int xPos = *x;
+ int yPos = *y;
+ if (yPos > 143)
+ yPos = 143;
+ if (xPos < 41) {
+ xPos = 41;
+ if (yPos < 141)
+ yPos = 141;
+ } else if (xPos > 253) {
+ xPos = 253;
+ if (yPos < 138)
+ yPos = 138;
+ } else {
+ do {
+ if (yPos >= 143)
+ break;
+ ++yPos;
+ } while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0);
+ }
+ *x = xPos;
+ *y = yPos;
+ return;
+ }
int xPos = *x;
if (xPos < _roomWalkBounds.x1) {
xPos = _roomWalkBounds.x1;
Commit: cbe4ea6759c73f86f69ccf8765e3c91763a6622f
https://github.com/scummvm/scummvm/commit/cbe4ea6759c73f86f69ccf8765e3c91763a6622f
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:07+01:00
Commit Message:
IGOR: Saving and restoring
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_0.cpp
engines/igor/part_10.cpp
engines/igor/part_11.cpp
engines/igor/part_12.cpp
engines/igor/part_17.cpp
engines/igor/part_21.cpp
engines/igor/part_23.cpp
engines/igor/part_28.cpp
engines/igor/part_30.cpp
engines/igor/part_34.cpp
engines/igor/part_35.cpp
engines/igor/part_4.cpp
engines/igor/part_5.cpp
engines/igor/part_6.cpp
engines/igor/part_7.cpp
engines/igor/part_8.cpp
engines/igor/part_9.cpp
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index af5e475f929..d3a1b42e0fa 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -66,7 +66,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- _currentPart = 850;
+ _currentPart = 0;
// _currentPart = 171;
// _currentPart = 62;
@@ -117,6 +117,7 @@ Common::String IgorEngine::getGameId() const {
void IgorEngine::restart() {
_screenVGAVOffset = 0;
_debugOverlayMode = kOverlayOff;
+ _gameStateLoaded = false;
memset(&_gameState, 0, sizeof(_gameState));
_nextTimer = 0;
@@ -239,6 +240,24 @@ void IgorEngine::enterPartLoop() {
// }
}
+bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
+ if (!_gameStateLoaded)
+ return false;
+
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ if (drawIgor) {
+ if (!_gameState.igorMoving)
+ _walkDataCurrentIndex = _walkDataLastIndex - 1;
+ WalkData *wd = &_walkData[_walkDataCurrentIndex];
+ moveIgor(wd->posNum, wd->frameNum);
+ _walkDataCurrentIndex = _walkDataLastIndex;
+ }
+ drawInventory(_inventoryInfo[72], 0);
+ fadeIn(768);
+ _gameStateLoaded = false;
+ return true;
+}
+
void IgorEngine::leavePartLoop() {
hideCursor();
SET_EXEC_ACTION_FUNC(1, 0);
@@ -560,12 +579,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
// 1. Walk data (100 entries)
for (int i = 0; i < 100; ++i) {
- if (s.isSaving()) {
- s.syncBytes(0, 2);
- } else {
- byte pad[2];
- s.syncBytes(pad, 2);
- }
+ s.skip(2);
s.syncAsSint16LE(_walkData[i].x);
s.syncAsSint16LE(_walkData[i].y);
s.syncAsByte(_walkData[i].posNum);
@@ -581,22 +595,12 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
}
// 2. Walk path state
- if (s.isSaving()) {
- s.syncBytes(0, 20);
- } else {
- byte pad[20];
- s.syncBytes(pad, 20);
- }
+ s.skip(20);
s.syncAsByte(_walkDataCurrentIndex);
s.syncAsByte(_walkDataLastIndex);
s.syncAsByte(_walkCurrentFrame);
s.syncAsByte(_walkCurrentPos);
- if (s.isSaving()) {
- s.syncBytes(0, 23);
- } else {
- byte pad[23];
- s.syncBytes(pad, 23);
- }
+ s.skip(23);
// 3. Current action
s.syncAsByte(_currentAction.verb);
@@ -605,31 +609,16 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
s.syncAsByte(_currentAction.verbType);
s.syncAsByte(_currentAction.object2Num);
s.syncAsByte(_currentAction.object2Type);
- if (s.isSaving()) {
- s.syncBytes(0, 10);
- } else {
- byte pad[10];
- s.syncBytes(pad, 10);
- }
+ s.skip(10);
// 4. Part/state
s.syncAsSint16LE(_currentPart);
- if (s.isSaving()) {
- s.syncBytes(0, 8);
- } else {
- byte pad[8];
- s.syncBytes(pad, 8);
- }
+ s.skip(8);
// 5. Action state
s.syncAsByte(_actionCode);
s.syncAsByte(_actionWalkPoint);
- if (s.isSaving()) {
- s.syncBytes(0, 2);
- } else {
- byte pad[2];
- s.syncBytes(pad, 2);
- }
+ s.skip(2);
// 6. Cursor position
s.syncAsSint16LE(_inputVars[kInputCursorXPos]);
@@ -641,41 +630,56 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
for (int i = 0; i < 5; ++i) {
s.syncAsSint16LE(_gameState.counter[i]);
}
- { byte v = _gameState.igorMoving ? 1 : 0; s.syncAsByte(v); }
- { byte v = _gameState.dialogueTextRunning ? 1 : 0; s.syncAsByte(v); }
- { byte v = _gameState.updateLight ? 1 : 0; s.syncAsByte(v); }
- { byte v = _gameState.unkF ? 1 : 0; s.syncAsByte(v); }
+ {
+ byte v = _gameState.igorMoving ? 1 : 0;
+ s.syncAsByte(v);
+ if (s.isLoading())
+ _gameState.igorMoving = v != 0;
+ }
+ {
+ byte v = _gameState.dialogueTextRunning ? 1 : 0;
+ s.syncAsByte(v);
+ if (s.isLoading())
+ _gameState.dialogueTextRunning = v != 0;
+ }
+ {
+ byte v = _gameState.updateLight ? 1 : 0;
+ s.syncAsByte(v);
+ if (s.isLoading())
+ _gameState.updateLight = v != 0;
+ }
+ {
+ byte v = _gameState.unkF ? 1 : 0;
+ s.syncAsByte(v);
+ if (s.isLoading())
+ _gameState.unkF = v != 0;
+ }
s.syncAsByte(_gameState.unk10);
s.syncAsByte(_gameState.unk11);
- { byte v = _gameState.dialogueStarted ? 1 : 0; s.syncAsByte(v); }
- if (s.isSaving()) {
- s.syncBytes(0, 1);
- } else {
- byte pad[1];
- s.syncBytes(pad, 1);
+ {
+ byte v = _gameState.dialogueStarted ? 1 : 0;
+ s.syncAsByte(v);
+ if (s.isLoading())
+ _gameState.dialogueStarted = v != 0;
}
+ s.skip(1);
for (int i = 0; i < 500; ++i) {
s.syncAsByte(_gameState.dialogueData[i]);
}
s.syncAsByte(_gameState.dialogueChoiceStart);
s.syncAsByte(_gameState.dialogueChoiceCount);
- if (s.isSaving()) {
- s.syncBytes(0, 2);
- } else {
- byte pad[2];
- s.syncBytes(pad, 2);
- }
+ s.skip(2);
s.syncAsByte(_gameState.nextMusicCounter);
- { byte v = _gameState.jumpToNextMusic ? 1 : 0; s.syncAsByte(v); }
+ {
+ byte v = _gameState.jumpToNextMusic ? 1 : 0;
+ s.syncAsByte(v);
+ if (s.isLoading())
+ _gameState.jumpToNextMusic = v != 0;
+ }
s.syncAsByte(_gameState.configSoundEnabled);
s.syncAsByte(_gameState.talkSpeed);
s.syncAsByte(_gameState.talkMode);
- if (s.isSaving()) {
- s.syncBytes(0, 3);
- } else {
- byte pad[3];
- s.syncBytes(pad, 3);
- }
+ s.skip(3);
s.syncAsByte(_gameState.musicNum);
s.syncAsByte(_gameState.musicSequenceIndex);
@@ -690,6 +694,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
}
if (s.isLoading()) {
+ _gameStateLoaded = true;
memcpy(_igorPalette, (_currentPart == 760) ? PAL_IGOR_1 : PAL_IGOR_1, 48);
UPDATE_OBJECT_STATE(255);
playMusic(_gameState.musicNum);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 90867eff6fc..18671664b87 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -63,7 +63,7 @@ enum {
kTimerTicksCount = 8,
kFastModeFactor = 4,
kFastModeMaxFactor = 16,
- kQuickSaveSlot = 0,
+ kQuickSaveSlot = 100,
kMaxSaveStates = 10,
kNoSpeechSound = 999
};
@@ -343,6 +343,7 @@ private:
int _debugOverlayMode;
bool _eventQuitGame;
+ bool _gameStateLoaded;
GameStateData _gameState;
uint32 _nextTimer;
@@ -728,6 +729,7 @@ private:
void enterPartLoop();
void leavePartLoop();
void runPartLoop();
+ bool restoreRoomAfterLoad(bool drawIgor = true);
void handleRoomDialogue();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 29967337ee4..484fca2652c 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -64,10 +64,14 @@ void IgorEngine::waitForTimer(int ticks) {
_inputVars[kInputPause] = 1;
}
else if (ev.kbd.keycode == Common::KEYCODE_F1) {
- debug("Quicksave part %d", _currentPart);
- saveGameState(kQuickSaveSlot, "");
+ const Common::String description = Common::String::format("Quicksave part %d", _currentPart);
+ const Common::Error err = saveGameState(kQuickSaveSlot, description);
+ if (err.getCode() != Common::kNoError)
+ warning("Unable to quick-save: %s", err.getDesc().c_str());
} else if (ev.kbd.keycode == Common::KEYCODE_F2) {
- loadGameState(kQuickSaveSlot);
+ const Common::Error err = loadGameState(kQuickSaveSlot);
+ if (err.getCode() != Common::kNoError)
+ warning("Unable to quick-load: %s", err.getDesc().c_str());
}
break;
case Common::EVENT_MOUSEMOVE:
diff --git a/engines/igor/part_0.cpp b/engines/igor/part_0.cpp
index 9b971b2634f..a2616901396 100644
--- a/engines/igor/part_0.cpp
+++ b/engines/igor/part_0.cpp
@@ -25,7 +25,7 @@ namespace Igor {
void IgorEngine::PART_00_DRAW_RAW_FRAME(int srcOffset, int frame, int frameSize,
int width, int height, int dstOffset) {
- // cseg206:00E0-01BF and the corresponding raw-frame loops through 14D5.
+
const uint8 *src = _animFramesBuffer + srcOffset + frame * frameSize;
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
@@ -62,7 +62,7 @@ void IgorEngine::PART_00_ANIMATE_RAW(int srcOffset, int firstFrame, int lastFram
void IgorEngine::PART_00_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- const bool open = _objectsState[8] != 0; // s3:0844; cseg206:1AA8-1AF0
+ const bool open = _objectsState[8] != 0;
const int src = open ? 0x4CFA : 0x4C6A;
for (int y = 0; y < 9; ++y)
memcpy(_screenLayer1 + 0x8EBD + y * 320, _animFramesBuffer + src + y * 16, 16);
@@ -78,7 +78,7 @@ void IgorEngine::PART_00_APPLY_OBJECT_STATE(int num) {
_roomObjectAreasTable[3].object = (_objectsState[11] == 0) ? 4 : 5;
}
if (num == 6 || num == 255) {
- // s3:0849 maps to _objectsState[13]; cseg206:1B51-1BBD.
+
const int state = _objectsState[13];
const int src = state == 1 ? 0x143C : 0x1200;
for (int y = 0; y < 22; ++y)
@@ -105,12 +105,12 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
PART_00_APPLY_OBJECT_STATE(6);
}
break;
- case 103: // cseg206:159E-15CA
+ case 103: // look at window
ADD_DIALOGUE_TEXT(201, 3, 95);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 104: // cseg206:132A-14E9
+ case 104: // go to window
if (_objectsState[13] != 1)
break;
if (_objectsState[15] != 0) {
@@ -124,7 +124,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
_objectsState[15] = 1;
_currentPart = 10;
break;
- case 105: // cseg206:15CB-15F7
+ case 105: // look at bed
ADD_DIALOGUE_TEXT(204, 1, 96);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -143,7 +143,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
PART_00_APPLY_OBJECT_STATE(1);
}
break;
- case 108: // cseg206:15F8-1678
+ case 108: // look bedside table
if (_objectsState[8] == 0)
ADD_DIALOGUE_TEXT(205, 1, 97);
else if (_objectsState[9] == 0)
@@ -153,7 +153,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 109: // cseg206:0FC7-1194
+ case 109: // take alarm clock
if (_objectsState[9] == 0) {
PART_00_ANIMATE_RAW(0x8410, 0, 1, 0x405, 21, 49, 0x693D, 126, -1, 0);
addObjectToInventory(6, 41); // s3:0903; cseg206:113C-1176
@@ -175,12 +175,12 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
PART_00_APPLY_OBJECT_STATE(3);
}
break;
- case 112: // cseg206:1679-16A5
+ case 112: // look at closet
ADD_DIALOGUE_TEXT(206, 1, 98);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 113: // cseg206:16A6-16D2
+ case 113: // look at hole
ADD_DIALOGUE_TEXT(207, 2, 99);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -191,12 +191,12 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
PART_00_ANIMATE_RAW(0x5942, 0, 2, 0x44C, 22, 50, 0x66EE, 30, -1, 0);
_currentPart = 24;
break;
- case 115: // cseg206:16D3-16FF
+ case 115: // look at records
ADD_DIALOGUE_TEXT(209, 3, 100);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 116: // cseg206:0DCE-0FC6
+ case 116: // take records
if (_objectsState[12] == 0) {
PART_00_ANIMATE_RAW(0x7C06, 0, 1, 0x405, 21, 49, 0x7146, 126, -1, 0);
addObjectToInventory(5, 40); // s3:0902; cseg206:0F75-0FAF
@@ -208,7 +208,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
startIgorDialogue();
}
break;
- case 117: // cseg206:14EA-159D
+ case 117: // exit to map
{
_walkDataCurrentIndex = 0;
int walkFrame = 1;
@@ -231,7 +231,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
}
_currentPart = 40;
break;
- case 118: // cseg206:1700-173E
+ case 118: // use bed
ADD_DIALOGUE_TEXT(219, 1, 106);
ADD_DIALOGUE_TEXT(220, 1, 107);
SET_DIALOGUE_TEXT(1, 2);
@@ -331,23 +331,27 @@ void IgorEngine::PART_00() {
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_00_EXEC_ACTION);
PART_00_APPLY_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080); // cseg206:39B3-39C5
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- _walkDataLastIndex = 1;
- _walkDataCurrentIndex = 1;
- if (_currentPart == 1)
- PART_00_WALK_IN();
- else
- PART_00_ENTER_FROM_BELOW();
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ if (_currentPart == 1)
+ PART_00_WALK_IN();
+ else
+ PART_00_ENTER_FROM_BELOW();
+ }
enterPartLoop();
- while (_currentPart == 0 || _currentPart == 1)
+ while ((_currentPart == 0 || _currentPart == 1) && !_gameStateLoaded)
runPartLoop();
leavePartLoop();
- if (_currentPart == kInvalidPart)
- fadeOut(768);
- else
- fadeOut(624);
+ if (!_gameStateLoaded) {
+ if (_currentPart == kInvalidPart)
+ fadeOut(768);
+ else
+ fadeOut(624);
+ }
}
} // End of namespace Igor
diff --git a/engines/igor/part_10.cpp b/engines/igor/part_10.cpp
index 3821a04e171..d716844fa4e 100644
--- a/engines/igor/part_10.cpp
+++ b/engines/igor/part_10.cpp
@@ -214,35 +214,36 @@ void IgorEngine::PART_10() {
// handoff, the original jumps directly to the walk-index setup instead,
// preserving the completed pan (including Igor) already in screen VGA.
- if (_currentPart != 102) {
+ if (_currentPart != 102 && !_gameStateLoaded) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
}
- _walkDataLastIndex = 1;
- _walkDataCurrentIndex = 1;
-
- if (_currentPart == 100) {
- // Enter at the right edge and walk left into the room.
- _walkData[0].setPos(319, 79, kFacingPositionLeft, 0);
- _walkData[0].setDefaultScale();
- _walkData[0].clipWidth = 15;
- _walkDataLastIndex = 0;
- buildWalkPath(319, 79, 288, 84);
- _walkData[_walkDataLastIndex].frameNum = 0;
+ if (!restoreRoomAfterLoad()) {
+ _walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- waitForIgorMove();
- } else if (_currentPart == 101) {
- // Enter from the adjacent panel and walk right into the room.
- _walkData[0].setPos(136, 86, kFacingPositionRight, 0);
- _walkData[0].setDefaultScale();
- _walkDataLastIndex = 0;
- buildWalkPath(136, 86, 171, 97);
- _walkData[_walkDataLastIndex].frameNum = 0;
- _walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- waitForIgorMove();
+ if (_currentPart == 100) {
+ // Enter at the right edge and walk left into the room.
+ _walkData[0].setPos(319, 79, kFacingPositionLeft, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPath(319, 79, 288, 84);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ } else if (_currentPart == 101) {
+ // Enter from the adjacent panel and walk right into the room.
+ _walkData[0].setPos(136, 86, kFacingPositionRight, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataLastIndex = 0;
+ buildWalkPath(136, 86, 171, 97);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ }
}
_roomObjectAreasTable[7].deltaLum = 0;
for (int area = 11; area <= 12; ++area) {
@@ -250,11 +251,11 @@ void IgorEngine::PART_10() {
}
enterPartLoop();
- while (_currentPart >= 100 && _currentPart <= 102) {
+ while (_currentPart >= 100 && _currentPart <= 102 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- if (_currentPart != 110)
+ if (_currentPart != 110 && !_gameStateLoaded)
fadeOut(624);
}
diff --git a/engines/igor/part_11.cpp b/engines/igor/part_11.cpp
index 68a779987d0..e20111e57a1 100644
--- a/engines/igor/part_11.cpp
+++ b/engines/igor/part_11.cpp
@@ -237,11 +237,13 @@ void IgorEngine::PART_11() {
PART_11_APPLY_OBJECT_STATE(255);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
- _walkDataLastIndex = 1;
- _walkDataCurrentIndex = 1;
+ if (!restoreRoomAfterLoad()) {
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ }
enterPartLoop();
- while (_currentPart == 110) {
+ while (_currentPart == 110 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
diff --git a/engines/igor/part_12.cpp b/engines/igor/part_12.cpp
index ce70cbd64c6..ec40e7d4302 100644
--- a/engines/igor/part_12.cpp
+++ b/engines/igor/part_12.cpp
@@ -524,41 +524,44 @@ void IgorEngine::PART_12() {
if (_objectsState[44] == 0) {
PART_12_HELPER_3();
}
- if (_currentPart == 122) {
+ if (_currentPart == 122 && !_gameStateLoaded) {
PART_12_HELPER_4();
return;
}
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- if (_currentPart == 120) {
- PART_12_HELPER_5();
- }
- if (_currentPart == 121) {
- PART_12_HELPER_6();
- if (_objectsState[106] == 1) {
- ADD_DIALOGUE_TEXT(216, 2, 799); // cseg171:3766-3772
- ADD_DIALOGUE_TEXT(218, 1, 800); // cseg171:3778-3784
- 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;
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 120) {
+ PART_12_HELPER_5();
+ }
+ if (_currentPart == 121) {
+ PART_12_HELPER_6();
+ if (_objectsState[106] == 1) {
+ ADD_DIALOGUE_TEXT(216, 2, 799); // cseg171:3766-3772
+ ADD_DIALOGUE_TEXT(218, 1, 800); // cseg171:3778-3784
+ 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) {
+ while (_currentPart >= 120 && _currentPart <= 122 && !_gameStateLoaded) {
runPartLoop();
}
PART_12_EXIT:
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // namespace Igor
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index f484ead5fc0..4e91d7f5383 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -533,27 +533,31 @@ void IgorEngine::PART_17() {
_roomObjectAreasTable[19].object = 0;
}
- _currentAction.verb = kVerbWalk;
- if (_currentPart == 170) {
- // from map
- fadeIn(768);
- PART_17_HELPER_2_walkFromMap();
- } else if (_currentPart == 171) {
- // from inside college
- PART_17_HELPER_6_walkFromCollege();
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ if (_currentPart == 170) {
+ // from map
+ fadeIn(768);
+ PART_17_HELPER_2_walkFromMap();
+ } else if (_currentPart == 171) {
+ // from inside college
+ PART_17_HELPER_6_walkFromCollege();
+ }
}
enterPartLoop();
- while (_currentPart >= 170 && _currentPart <= 171) {
+ while (_currentPart >= 170 && _currentPart <= 171 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- if (_objectsState[55] == 1) {
- _objectsState[56] = 1;
- }
- if (_objectsState[54] == 0) {
- _objectsState[54] = 1;
+ if (!_gameStateLoaded) {
+ if (_objectsState[55] == 1) {
+ _objectsState[56] = 1;
+ }
+ if (_objectsState[54] == 0) {
+ _objectsState[54] = 1;
+ }
+ fadeOut(624);
}
- fadeOut(624);
}
} // namespace Igor
diff --git a/engines/igor/part_21.cpp b/engines/igor/part_21.cpp
index 43c1619ec25..13fafe534f1 100644
--- a/engines/igor/part_21.cpp
+++ b/engines/igor/part_21.cpp
@@ -454,22 +454,25 @@ void IgorEngine::PART_21() {
_updateRoomBackground = &IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND;
PART_21_HELPER_1(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- _gameState.unk10 = 1;
- fadeIn(768);
- if (_currentPart == 210) {
- PART_21_HELPER_2();
- } else if (_currentPart == 211) {
- PART_21_HELPER_3();
- } else if (_currentPart == 212) {
- PART_21_HELPER_4();
+ if (!restoreRoomAfterLoad()) {
+ _gameState.unk10 = 1;
+ _currentAction.verb = kVerbWalk;
+ fadeIn(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) {
+ while (_currentPart >= 210 && _currentPart <= 212 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/part_23.cpp b/engines/igor/part_23.cpp
index 71de7ac73f5..6e6c61cca36 100644
--- a/engines/igor/part_23.cpp
+++ b/engines/igor/part_23.cpp
@@ -266,22 +266,24 @@ void IgorEngine::PART_23() {
_updateRoomBackground = &IgorEngine::PART_23_UPDATE_ROOM_BACKGROUND;
PART_23_HELPER_1(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
-
- if (_currentPart == 230) {
- PART_23_HELPER_5_walkFromLeft();
- } else if (_currentPart == 231) {
- PART_23_HELPER_6_walkFromRight();
- } else if (_currentPart == 232) {
- PART_23_HELPER_4_walkFromDoor();
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 230) {
+ PART_23_HELPER_5_walkFromLeft();
+ } else if (_currentPart == 231) {
+ PART_23_HELPER_6_walkFromRight();
+ } else if (_currentPart == 232) {
+ PART_23_HELPER_4_walkFromDoor();
+ }
}
enterPartLoop();
- while (_currentPart >= 230 && _currentPart <= 232) {
+ while (_currentPart >= 230 && _currentPart <= 232 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/part_28.cpp b/engines/igor/part_28.cpp
index b8a672944d9..77a350c0ce3 100644
--- a/engines/igor/part_28.cpp
+++ b/engines/igor/part_28.cpp
@@ -333,28 +333,31 @@ void IgorEngine::PART_28() {
PART_28_HELPER_2();
PART_28_HELPER_1(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
// cseg123:2E04 -- the original's only write to the background-animation frame
// counter (s3:0xEB2C) is an unconditional set to 1 in this room's setup, made
// before the state dispatch below. PART_28_HELPER_5() forms its source address
// as animBase + frame * 1320 + i * 30 + j - 1320 (cseg123:0B7-0D5), so the frame
// is 1-based and a counter of 0 reads 1320 bytes before _animFramesBuffer.
// Without this the first background update reads out of bounds.
- _gameState.unk10 = 1;
- if (_currentPart == 280) {
- fadeIn(768);
- PART_28_HELPER_3();
- } else if (_currentPart == 281) {
- PART_28_HELPER_6();
+ if (!restoreRoomAfterLoad()) {
+ _gameState.unk10 = 1;
+ _currentAction.verb = kVerbWalk;
+ if (_currentPart == 280) {
+ fadeIn(768);
+ PART_28_HELPER_3();
+ } else if (_currentPart == 281) {
+ PART_28_HELPER_6();
+ }
}
enterPartLoop();
- while (_currentPart == 280 || _currentPart == 281) {
+ while ((_currentPart == 280 || _currentPart == 281) && !_gameStateLoaded) {
runPartLoop();
}
- if (_objectsState[87] == 1) {
+ if (!_gameStateLoaded && _objectsState[87] == 1) {
_objectsState[87] = 2;
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/part_30.cpp b/engines/igor/part_30.cpp
index 7c448771267..a7e0abcb84a 100644
--- a/engines/igor/part_30.cpp
+++ b/engines/igor/part_30.cpp
@@ -297,32 +297,34 @@ void IgorEngine::PART_30() {
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_LauraCutscene();
- } else {
- if (_currentPart != 302) {
- fadeIn(768);
- }
- if (_currentPart == 300) { // enter from outside
- PART_30_HELPER_2_walkInFromLeft();
- } else if (_currentPart == 301) {
- PART_30_HELPER_3_walkInFromUpstairs();
- } else if (_currentPart == 302) {
- playMusic(3);
- fadeIn(768);
- PART_30_HELPER_2_walkInFromOutside();
- } else if (_currentPart == 303) {
- PART_30_HELPER_5_walkInFromRight();
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ if (_objectsState[73] == 0) {
+ PART_30_HELPER_8_LauraCutscene();
+ } else {
+ if (_currentPart != 302) {
+ fadeIn(768);
+ }
+ if (_currentPart == 300) { // enter from outside
+ PART_30_HELPER_2_walkInFromLeft();
+ } else if (_currentPart == 301) {
+ PART_30_HELPER_3_walkInFromUpstairs();
+ } else if (_currentPart == 302) {
+ playMusic(3);
+ fadeIn(768);
+ PART_30_HELPER_2_walkInFromOutside();
+ } else if (_currentPart == 303) {
+ PART_30_HELPER_5_walkInFromRight();
+ }
}
}
enterPartLoop();
- while (_currentPart >= 300 && _currentPart <= 303) {
+ while (_currentPart >= 300 && _currentPart <= 303 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/part_34.cpp b/engines/igor/part_34.cpp
index 414e8f91468..37913ee7c04 100644
--- a/engines/igor/part_34.cpp
+++ b/engines/igor/part_34.cpp
@@ -130,14 +130,16 @@ void IgorEngine::PART_34() {
setRoomWalkBounds(0, 0, 319, 143);
PART_34_APPLY_OBJECT_STATE(255);
- _walkDataLastIndex = 1;
- _walkDataCurrentIndex = 1;
+ if (!restoreRoomAfterLoad()) {
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ }
enterPartLoop();
- while (_currentPart == 340) {
+ while (_currentPart == 340 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- if (_currentPart == kInvalidPart) {
+ if (_currentPart == kInvalidPart && !_gameStateLoaded) {
fadeOut(768);
}
}
diff --git a/engines/igor/part_35.cpp b/engines/igor/part_35.cpp
index aa03afd9307..e3faf6b38cc 100644
--- a/engines/igor/part_35.cpp
+++ b/engines/igor/part_35.cpp
@@ -128,41 +128,44 @@ void IgorEngine::PART_35() {
setRoomWalkBounds(0, 0, 281, 143); // rightmost walkable column is 281
PART_35_APPLY_OBJECT_STATE(255);
- if (_currentPart != 351) {
+ if (_currentPart != 351 && !_gameStateLoaded) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
}
- _walkDataLastIndex = 1;
- _walkDataCurrentIndex = 1;
-
- if (_currentPart == 350) {
- WalkData *wd = &_walkData[0];
- wd->setPos(319, 33, kFacingPositionFront, 1);
- wd->clipSkipX = 1;
- wd->clipWidth = 10;
- wd->scaleWidth = 34;
- wd->xPosChanged = 1;
- wd->dxPos = 0;
- wd->yPosChanged = 1;
- wd->dyPos = 0;
- wd->scaleHeight = 34;
- _walkDataLastIndex = 0;
- const uint8 area = _screenLayer2[10879]; // (319, 33); cseg100:04CF-04E4
- _roomObjectAreasTable[area].area = 1;
- buildWalkPath(319, 33, 242, 111);
- _roomObjectAreasTable[area].area = 0;
+ if (!restoreRoomAfterLoad()) {
+ _walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- waitForIgorMove();
+ if (_currentPart == 350) {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(319, 33, kFacingPositionFront, 1);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 10;
+ wd->scaleWidth = 34;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 34;
+ _walkDataLastIndex = 0;
+ const uint8 area = _screenLayer2[10879]; // (319, 33); cseg100:04CF-04E4
+ _roomObjectAreasTable[area].area = 1;
+ buildWalkPath(319, 33, 242, 111);
+ _roomObjectAreasTable[area].area = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ }
}
enterPartLoop();
- while (_currentPart == 350 || _currentPart == 351) {
+ while ((_currentPart == 350 || _currentPart == 351) && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- if (_currentPart == kInvalidPart) {
+ if (_gameStateLoaded) {
+ return;
+ } else if (_currentPart == kInvalidPart) {
fadeOut(768);
} else if (_currentPart != 340) {
fadeOut(624);
diff --git a/engines/igor/part_4.cpp b/engines/igor/part_4.cpp
index 4551ff4925b..2cb8f7db3a5 100644
--- a/engines/igor/part_4.cpp
+++ b/engines/igor/part_4.cpp
@@ -81,19 +81,21 @@ void IgorEngine::PART_04() {
PART_04_CLEAR_OBJECT_STATE_84(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- fadeIn(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;
+ if (!restoreRoomAfterLoad(false)) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ _walkData[0].x = 160;
+ _walkData[0].y = 133;
+ _walkData[0].scaleWidth = 49;
+ _walkData[0].scaleHeight = 49;
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ }
enterPartLoop();
- while (_currentPart == 40) {
+ while (_currentPart == 40 && !_gameStateLoaded) {
handleRoomInput();
if (compareGameTick(19, 32)) {
handleRoomDialogue();
@@ -111,7 +113,8 @@ void IgorEngine::PART_04() {
waitForTimer();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 3e16801fbc1..15e0085681a 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -164,26 +164,30 @@ void IgorEngine::PART_05() {
loadActionData(DAT_SpringRock);
_roomDataOffsets = PART_05_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
- _walkDataLastIndex = 1;
- _walkDataCurrentIndex = 1;
// Part 50: Arriving from the map, Igor should walk in
// Part 51: Arriving from SpringRock through scroll
// Part 52: ?
- if (_currentPart == 50) {
- debug("Entering PART_05_HELPER_6");
- memcpy(_screenVGA, _screenLayer1, 46080);
- fadeIn(768);
- PART_05_HELPER_6_walkIgorToScene();
+ if (!restoreRoomAfterLoad()) {
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ if (_currentPart == 50) {
+ debug("Entering PART_05_HELPER_6");
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ fadeIn(768);
+ PART_05_HELPER_6_walkIgorToScene();
+ }
}
enterPartLoop();
- while (_currentPart >= 50 && _currentPart <= 52) {
+ while (_currentPart >= 50 && _currentPart <= 52 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
stopSound();
- if (_currentPart == 255) {
+ if (_gameStateLoaded) {
+ return;
+ } else if (_currentPart == 255) {
fadeOut(768);
} else if (_currentPart != 60) {
if (_objectsState[63] == 0) {
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index f1b6a1c4ab9..8c678dcb660 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -341,7 +341,7 @@ void IgorEngine::PART_06() {
PART_05_06_DRAW_TRIPOD(true);
}
- if (_currentPart == 61) {
+ if (_currentPart == 61 && !_gameStateLoaded) {
SET_PAL_208_96_1();
drawVerbsPanel();
drawInventory(1, 0);
@@ -352,12 +352,14 @@ void IgorEngine::PART_06() {
}
loadActionData(DAT_SpringBridge);
_roomDataOffsets = PART_06_ROOM_DATA_OFFSETS;
- _walkDataLastIndex = 1;
- _walkDataCurrentIndex = 1;
- _gameState.unkF = (_objectsState[61] == 1);
+ if (!restoreRoomAfterLoad()) {
+ _gameState.unkF = (_objectsState[61] == 1);
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ }
enterPartLoop();
- while (_currentPart >= 60 && _currentPart <= 61) {
+ while (_currentPart >= 60 && _currentPart <= 61 && !_gameStateLoaded) {
setRoomWalkBounds(0, 0, _objectsState[61] == 0 ? 234 : 142, 143);
handleRoomInput();
if (compareGameTick(1, 16)) {
diff --git a/engines/igor/part_7.cpp b/engines/igor/part_7.cpp
index 588fa07b861..1169e6f9a5c 100644
--- a/engines/igor/part_7.cpp
+++ b/engines/igor/part_7.cpp
@@ -239,31 +239,33 @@ void IgorEngine::PART_07() {
for (int area = 11; area <= 13; ++area) {
_roomObjectAreasTable[area].area = 0;
}
- _currentAction.verb = kVerbWalk;
-
- if (_currentPart == 71) { // enter from dean's door
- _walkData[0].setPos(78, 114, kFacingPositionRight, 0);
- _walkData[0].setDefaultScale();
- _walkDataCurrentIndex = 0;
- moveIgor(kFacingPositionRight, 0);
- } else if (_currentPart == 72) { // enter from secretary's door
- _walkData[0].setPos(153, 116, kFacingPositionFront, 0);
- _walkData[0].setDefaultScale();
- _walkDataCurrentIndex = 0;
- moveIgor(kFacingPositionFront, 0);
- }
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ if (_currentPart == 71) { // enter from dean's door
+ _walkData[0].setPos(78, 114, kFacingPositionRight, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataCurrentIndex = 0;
+ moveIgor(kFacingPositionRight, 0);
+ } else if (_currentPart == 72) { // enter from secretary's door
+ _walkData[0].setPos(153, 116, kFacingPositionFront, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataCurrentIndex = 0;
+ moveIgor(kFacingPositionFront, 0);
+ }
- _walkDataLastIndex = 1;
- _walkDataCurrentIndex = 1;
- fadeIn(768);
- if (_currentPart == 70) { // enter from outside
- PART_07_ENTER_FROM_OUTSIDE();
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ fadeIn(768);
+ if (_currentPart == 70) { // enter from outside
+ PART_07_ENTER_FROM_OUTSIDE();
+ }
}
enterPartLoop();
- while (_currentPart >= 70 && _currentPart <= 72)
+ while (_currentPart >= 70 && _currentPart <= 72 && !_gameStateLoaded)
runPartLoop();
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/part_8.cpp b/engines/igor/part_8.cpp
index bcb24c495c9..1f68ac2cc62 100644
--- a/engines/igor/part_8.cpp
+++ b/engines/igor/part_8.cpp
@@ -511,20 +511,23 @@ void IgorEngine::PART_08() {
memcpy(_screenVGA, _screenLayer1, 46080);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
- _currentAction.verb = kVerbWalk;
- _walkData[0].setPos(241, 121, kFacingPositionLeft, 0);
- _walkData[0].setDefaultScale();
- _walkDataCurrentIndex = 0;
- moveIgor(kFacingPositionLeft, 0);
- _walkDataLastIndex = 1;
- _walkDataCurrentIndex = 1;
- fadeIn(768);
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ _walkData[0].setPos(241, 121, kFacingPositionLeft, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataCurrentIndex = 0;
+ moveIgor(kFacingPositionLeft, 0);
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ fadeIn(768);
+ }
enterPartLoop();
- while (_currentPart == 80)
+ while (_currentPart == 80 && !_gameStateLoaded)
runPartLoop();
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/part_9.cpp b/engines/igor/part_9.cpp
index 4ef835022e3..ae50cb7b44f 100644
--- a/engines/igor/part_9.cpp
+++ b/engines/igor/part_9.cpp
@@ -137,20 +137,23 @@ void IgorEngine::PART_09() {
memcpy(_screenVGA, _screenLayer1, 46080);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
- _currentAction.verb = kVerbWalk;
- _walkData[0].setPos(206, 109, kFacingPositionFront, 0);
- _walkData[0].setDefaultScale();
- _walkDataCurrentIndex = 0;
- moveIgor(kFacingPositionFront, 0);
- _walkDataLastIndex = 1;
- _walkDataCurrentIndex = 1;
- fadeIn(768);
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ _walkData[0].setPos(206, 109, kFacingPositionFront, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataCurrentIndex = 0;
+ moveIgor(kFacingPositionFront, 0);
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ fadeIn(768);
+ }
enterPartLoop();
- while (_currentPart == 90)
+ while (_currentPart == 90 && !_gameStateLoaded)
runPartLoop();
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index fe2ad24e490..64beb38acc2 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -499,18 +499,20 @@ void IgorEngine::UPDATE_OBJECT_STATE(int num) {
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
+ if (!_gameStateLoaded) {
+ 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();
Commit: 2a7b495ca2b55b9b1c9aa3690cfc35abdd8dac3c
https://github.com/scummvm/scummvm/commit/2a7b495ca2b55b9b1c9aa3690cfc35abdd8dac3c
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:07+01:00
Commit Message:
IGOR: Use action with no second pairing
Changed paths:
engines/igor/input.cpp
engines/igor/part_0.cpp
engines/igor/part_main.cpp
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 484fca2652c..dcd04b906cc 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -257,6 +257,14 @@ void IgorEngine::handleRoomInput() {
if (actionHovering && _actionCode != 0) {
return;
}
+ // checks whether the specified verb-object pair action is available
+ // and thus doesnt move to the "use A with B" state.
+ auto hasPairAction = [this](int verbOffset, int objectNum, int objectType) {
+ const int offset = verbOffset +
+ (_roomDataOffsets.action.object1 - _roomDataOffsets.action.useVerb) +
+ objectType * 38 + objectNum;
+ return _roomActionsTable[offset] != 0;
+ };
// Action previousAction = _currentAction;
// Handle inventory and room object selection based on cursor position and clicks
@@ -265,14 +273,14 @@ void IgorEngine::handleRoomInput() {
if (_currentAction.verbType == 0) {
_currentAction.object1Num = object;
_currentAction.object1Type = kObjectTypeInventory;
- if (_currentAction.verb == kVerbUse && _roomActionsTable[_roomDataOffsets.action.useVerb + 10 + _currentAction.object1Num] != 0) {
+ if (_currentAction.verb == kVerbUse && hasPairAction(_roomDataOffsets.action.useVerb, _currentAction.object1Num, kObjectTypeInventory)) {
formatActionSentence(0);
if (!actionHovering) {
_currentAction.verbType = 1;
}
return;
}
- if (_currentAction.verb == kVerbGive && _roomActionsTable[_roomDataOffsets.action.giveVerb + 10 + _currentAction.object1Num] != 0) {
+ if (_currentAction.verb == kVerbGive && hasPairAction(_roomDataOffsets.action.giveVerb, _currentAction.object1Num, kObjectTypeInventory)) {
formatActionSentence(0);
if (!actionHovering) {
_currentAction.verbType = 2;
@@ -290,14 +298,14 @@ void IgorEngine::handleRoomInput() {
if (_currentAction.verbType == 0) {
_currentAction.object1Num = object;
_currentAction.object1Type = kObjectTypeRoom;
- if (_currentAction.verb == kVerbUse && _roomActionsTable[_roomDataOffsets.action.useVerb + 48 + _currentAction.object1Num] != 0) {
+ if (_currentAction.verb == kVerbUse && hasPairAction(_roomDataOffsets.action.useVerb, _currentAction.object1Num, kObjectTypeRoom)) {
formatActionSentence(0);
if (!actionHovering) {
_currentAction.verbType = 1;
}
return;
}
- if (_currentAction.verb == kVerbGive && _roomActionsTable[_roomDataOffsets.action.giveVerb + 48 + _currentAction.object1Num] != 0) {
+ if (_currentAction.verb == kVerbGive && hasPairAction(_roomDataOffsets.action.giveVerb, _currentAction.object1Num, kObjectTypeRoom)) {
formatActionSentence(0);
if (!actionHovering) {
diff --git a/engines/igor/part_0.cpp b/engines/igor/part_0.cpp
index a2616901396..9f1fbdfe473 100644
--- a/engines/igor/part_0.cpp
+++ b/engines/igor/part_0.cpp
@@ -185,7 +185,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 114: // cseg206:1195-1329
+ case 114: // go through hole
if (_objectsState[10] == 0)
PART_00_EXEC_ACTION(110);
PART_00_ANIMATE_RAW(0x5942, 0, 2, 0x44C, 22, 50, 0x66EE, 30, -1, 0);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 64beb38acc2..bfa27082014 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -587,7 +587,7 @@ void IgorEngine::PART_MAIN() {
case 300:
case 301:
case 302:
- case 303:
+ case 303: // college stairs first floor
PART_30();
break;
case 340:
Commit: 9e7f8b47b3cc9d592c0078eb605645233c98852a
https://github.com/scummvm/scummvm/commit/9e7f8b47b3cc9d592c0078eb605645233c98852a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:08+01:00
Commit Message:
IGOR: Rooms 1 and 2
Changed paths:
A engines/igor/part_1.cpp
A engines/igor/part_2.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_30.cpp
engines/igor/part_5.cpp
engines/igor/part_6.cpp
engines/igor/part_7.cpp
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 18671664b87..86db7d1db98 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -484,6 +484,13 @@ private:
void PART_00_ENTRY_ANIMATION();
void PART_00_WALK_IN();
void PART_00_ENTER_FROM_BELOW();
+ void PART_01();
+ void PART_01_EXEC_ACTION(int action);
+ void PART_01_CLOSE_WINDOW();
+ void PART_02();
+ void PART_02_EXEC_ACTION(int action);
+ void PART_02_APPLY_OBJECT_STATE(int num);
+ void PART_02_START_DIALOGUE(int text, int count, int sound);
// spring bridge
void PART_05_HELPER_4_drawPaperOrNot(int num);
@@ -885,6 +892,8 @@ protected:
Common::Error run() override;
static const RoomDataOffsets PART_04_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_00_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_01_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_02_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_05_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_06_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_07_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index ceaaf35f277..9eafc4d8a6e 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -15,6 +15,8 @@ MODULE_OBJS = \
static_cursor.o \
options.o \
part_0.o \
+ part_1.o \
+ part_2.o \
part_4.o \
part_5.o \
part_85.o \
diff --git a/engines/igor/part_1.cpp b/engines/igor/part_1.cpp
new file mode 100644
index 00000000000..30a41ca0edb
--- /dev/null
+++ b/engines/igor/part_1.cpp
@@ -0,0 +1,139 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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 3 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+void IgorEngine::PART_01_CLOSE_WINDOW() {
+ // s3:0230-0233 (IGOR.EXE:0x8B0230); selected at cseg200:0231-0249.
+ static const uint8 windowFrames[] = { 0, 1, 2, 1 };
+ for (int i = 0; i < 4; ++i) {
+ // cseg200:0226-035C: 28x43 raw frames at ANM offset 216,
+ // frame stride 1204, drawn at screen offset 0x5919.
+ PART_00_DRAW_RAW_FRAME(216, windowFrames[i], 1204, 28, 43, 0x5919);
+ if (i == 0)
+ playSound(2, 1); // cseg200:035E-0369
+ if (i != 3) {
+ // cseg200:0375-037D; ANM offset 0 contains four 9x6 frames.
+ const int backgroundFrame = getRandomNumber(3);
+ const uint8 *src = _animFramesBuffer + backgroundFrame * 54;
+ for (int y = 0; y < 6; ++y)
+ memcpy(_screenVGA + 0x8EA4 + y * 320, src + y * 9, 9);
+ waitForTimer(94); // cseg200:0382-038C
+ }
+ }
+
+ ADD_DIALOGUE_TEXT(203, 1, 132); // cseg200:0398-03AA
+ ADD_DIALOGUE_TEXT(204, 1, 133); // cseg200:03AA-03BC
+ SET_DIALOGUE_TEXT(1, 2); // cseg200:03BC-03C1
+ startIgorDialogue(); // cseg200:03C6
+ waitForEndOfIgorDialogue(); // cseg200:03CB
+}
+
+void IgorEngine::PART_01_EXEC_ACTION(int action) {
+ // Action-to-function mapping: cseg200:068A-079F.
+ debugC(9, kDebugGame, "PART_01_EXEC_ACTION %d", action);
+ switch (action) {
+ case 101:
+ ADD_DIALOGUE_TEXT(201, 2, 131); // cseg200:054F-0575
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 102:
+ // TODO: transcribe the roof-crossing animation from cseg200:03D2-054E.
+ // It ends in state 20 at cseg200:0547; do not skip observable behavior.
+ warning("PART_01_EXEC_ACTION action 102 is not yet transcribed");
+ break;
+ case 103:
+ ADD_DIALOGUE_TEXT(205, 1, 134); // cseg200:057C-05A2
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 104:
+ ADD_DIALOGUE_TEXT(206, 2, 135); // cseg200:05A9-05CF
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 105:
+ ADD_DIALOGUE_TEXT(208, 1, 136); // cseg200:05D6-05FC
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 106:
+ ADD_DIALOGUE_TEXT(209, 1, 137); // cseg200:0603-0629
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 107:
+ ADD_DIALOGUE_TEXT(210, 1, 138); // cseg200:0630-0656
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 108:
+ ADD_DIALOGUE_TEXT(211, 2, 139); // cseg200:065D-0683
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ default:
+ warning("PART_01_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::PART_01() {
+ _gameState.enableLight = 1; // cseg200:1836
+ loadActionData(DAT_OutsideStudentDormitory); // cseg200:1853-186A
+ loadRoomData(PAL_OutsideStudentDormitory, IMG_OutsideStudentDormitory,
+ BOX_OutsideStudentDormitory, MSK_OutsideStudentDormitory,
+ TXT_OutsideStudentDormitory); // cseg202:0002
+ static const int animFrames[] = {
+ ANM_OutsideStudentDormitory1, ANM_OutsideStudentDormitory2,
+ ANM_OutsideStudentDormitory3, ANM_OutsideStudentDormitory4,
+ ANM_OutsideStudentDormitory5, ANM_OutsideStudentDormitory6,
+ ANM_OutsideStudentDormitory7, ANM_OutsideStudentDormitory8, 0
+ };
+ loadAnimData(animFrames); // cseg201:0002-019F
+ _roomDataOffsets = PART_01_ROOM_DATA_OFFSETS;
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_01_EXEC_ACTION); // cseg200:068A-079F
+ memcpy(_screenVGA, _screenLayer1, 46080); // cseg200:187E-1890
+
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ if (_currentPart == 10) {
+ fadeIn(768); // cseg200:1AD2-1AD5
+ _walkData[0].setPos(108, 113, kFacingPositionRight, 0); // cseg200:1ADA-1AE6
+ _walkData[0].clipSkipX = 1; // cseg200:1AF0
+ _walkData[0].clipWidth = 24; // cseg200:1AF5
+ _walkData[0].scaleWidth = 40; // cseg200:1AFB
+ _walkData[0].xPosChanged = 1; // cseg200:1B01
+ _walkData[0].dxPos = 0; // cseg200:1B06-1B08
+ _walkData[0].yPosChanged = 1; // cseg200:1B0B
+ _walkData[0].dyPos = 0; // cseg200:1B10-1B12
+ _walkData[0].scaleHeight = 40; // cseg200:1B15
+ _walkDataCurrentIndex = 0;
+ moveIgor(_walkData[0].posNum, _walkData[0].frameNum);
+ _walkDataLastIndex = 1; // cseg200:1B1A
+ _walkDataCurrentIndex = 1; // cseg200:1B1F
+ PART_01_CLOSE_WINDOW(); // cseg200:1B24
+ } else {
+ // TODO: transcribe state 11 and 12 transition cutscenes from
+ // cseg200:1950-1AB0 before enabling their state changes to 22/23.
+ warning("PART_01 state %d entrance is not yet transcribed", _currentPart);
+ }
+ }
+
+ enterPartLoop();
+ while (_currentPart >= 10 && _currentPart <= 12 && !_gameStateLoaded)
+ runPartLoop();
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(_currentPart == kInvalidPart ? 768 : 624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_2.cpp b/engines/igor/part_2.cpp
new file mode 100644
index 00000000000..bd8e00f20ce
--- /dev/null
+++ b/engines/igor/part_2.cpp
@@ -0,0 +1,182 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * 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 3 of the License, or
+ * (at your option) any later version.
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+void IgorEngine::PART_02_START_DIALOGUE(int text, int count, int sound) {
+ ADD_DIALOGUE_TEXT(text, count, sound);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+}
+
+void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
+ if (num == 1 || num == 255)
+ _roomActionsTable[252] = _objectsState[16] == 0 ? 6 : 4; // cseg203:22CF-2303; s3:084C
+ if ((num == 2 || num == 255) && _objectsState[17] == 1) { // cseg203:2310-231C; s3:084D
+ _roomObjectAreasTable[17].object = 4; // s3:DCAC; (DCAC-DC56)/5 = 17, field 1
+ _roomObjectAreasTable[19].object = 4; // s3:DCB6; (DCB6-DC56)/5 = 19, field 1
+ }
+ if (num == 3 || num == 255)
+ _roomObjectAreasTable[9].object = _objectsState[18] == 0 ? 0 : 6; // cseg203:232D-2340; s3:084E/DC84
+ if (num == 4 || num == 255) {
+ if (_objectsState[19] == 0) // cseg203:2351-2372; s3:084F
+ _roomObjectAreasTable[12].object = _objectsState[18] == 1 ? 6 : 0; // s3:DC93
+ else
+ _roomObjectAreasTable[12].object = 7; // s3:DC93
+ }
+ if (num == 5 || num == 255) {
+ if (_objectsState[20] == 0) { // cseg203:2383-23AE; s3:0850
+ _roomObjectAreasTable[13].object = _objectsState[19] == 1 ? 7 : (_objectsState[18] == 1 ? 6 : 0); // s3:DC98
+ } else {
+ _roomObjectAreasTable[13].object = 8; // s3:DC98
+ }
+ }
+ if (num == 6 || num == 255) {
+ if (_objectsState[21] == 0) // cseg203:23B3-23E5; s3:0851
+ _roomObjectAreasTable[14].object = _objectsState[20] == 1 ? 8 : (_objectsState[19] == 1 ? 7 : (_objectsState[18] == 1 ? 6 : 0)); // s3:DC9D
+ }
+ if ((num == 8 || num == 255) && _objectsState[23] == 1)
+ _roomObjectAreasTable[13].object = 8; // cseg203:23EA-23FD; s3:0853/DC98
+}
+
+void IgorEngine::PART_02_EXEC_ACTION(int action) {
+ // Action-to-function mapping: cseg203:1FD9-22AE.
+ debugC(9, kDebugGame, "PART_02_EXEC_ACTION %d", action);
+ switch (action) {
+ case 105:
+ PART_02_START_DIALOGUE(209, 1, 115); // cseg203:1E87-1EB2
+ _objectsState[22] = 1; // s3:0852; cseg203:1EB2
+ break;
+ case 108:
+ PART_02_START_DIALOGUE(210, 1, 116); // cseg203:1EB9-1EE4
+ break;
+ case 109:
+ ADD_DIALOGUE_TEXT(225, 4, 128); // cseg203:1EE6-1F1E
+ ADD_DIALOGUE_TEXT(229, 1, 129); // cseg203:1F02-1F0E
+ SET_DIALOGUE_TEXT(1, 2);
+ startIgorDialogue();
+ break;
+ case 110:
+ PART_02_START_DIALOGUE(213, 1, 118); // cseg203:1F25-1F50
+ break;
+ case 111:
+ PART_02_START_DIALOGUE(214, 2, 119); // cseg203:1F52-1F7D
+ break;
+ case 112:
+ PART_02_START_DIALOGUE(216, 1, 120); // cseg203:1F7F-1FAA
+ break;
+ case 114:
+ PART_02_START_DIALOGUE(219, 1, 123); // cseg203:1FAC-1FD7
+ break;
+ case 115:
+ PART_02_START_DIALOGUE(217, 1, 121); // cseg203:0A2D-0A58
+ break;
+ case 116:
+ PART_02_START_DIALOGUE(218, 1, 122); // cseg203:0A5A-0A85
+ break;
+ case 118:
+ if (_objectsState[24] == 1) { // s3:0854; cseg203:1989-19AC
+ PART_02_START_DIALOGUE(220, 1, 124);
+ } else {
+ _objectsState[24] = 1; // cseg203:19B3
+ _currentPart = 11; // cseg203:19B8
+ }
+ break;
+ case 119:
+ // TODO: transcribe the exit animation from cseg203:1CF8-1E74.
+ // It ends in state 1 at cseg203:1E6D; do not skip observable behavior.
+ warning("PART_02_EXEC_ACTION action 119 is not yet transcribed");
+ break;
+ case 120:
+ _currentPart = 30; // cseg203:1E75-1E85
+ break;
+ case 101: case 102: case 103: case 104: case 106: case 107:
+ case 113: case 117: case 121:
+ // TODO: transcribe the corresponding function selected by
+ // cseg203:1FD9-22AE. Keeping these actions disabled avoids inventing
+ // animation/state behavior.
+ warning("PART_02_EXEC_ACTION action %d is not yet transcribed", action);
+ break;
+ default:
+ warning("PART_02_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::PART_02() {
+ _gameState.enableLight = 1; // cseg203:41D0
+ loadActionData(DAT_StudentDormitoryAttic); // cseg203:41ED-4204
+ loadRoomData(PAL_StudentDormitoryAttic, IMG_StudentDormitoryAttic,
+ BOX_StudentDormitoryAttic, MSK_StudentDormitoryAttic,
+ TXT_StudentDormitoryAttic); // cseg205:0002
+ static const int animFrames[] = {
+ ANM_StudentDormitoryAttic1, ANM_StudentDormitoryAttic2,
+ ANM_StudentDormitoryAttic3, ANM_StudentDormitoryAttic4,
+ ANM_StudentDormitoryAttic5, ANM_StudentDormitoryAttic6,
+ ANM_StudentDormitoryAttic7, ANM_StudentDormitoryAttic8,
+ ANM_StudentDormitoryAttic9, ANM_StudentDormitoryAttic10,
+ ANM_StudentDormitoryAttic11, ANM_StudentDormitoryAttic12,
+ ANM_StudentDormitoryAttic13, ANM_StudentDormitoryAttic14, 0
+ };
+ loadAnimData(animFrames); // cseg204:0002-02CC
+ _roomDataOffsets = PART_02_ROOM_DATA_OFFSETS;
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_02_EXEC_ACTION); // cseg203:1FD9-22AE
+ PART_02_APPLY_OBJECT_STATE(255); // cseg203:4213-421A
+ memcpy(_screenVGA, _screenLayer1, 46080); // cseg203:421F-4231
+
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ switch (_currentPart) {
+ case 20:
+ fadeIn(768); // cseg203:45AB-45AE
+ _walkData[0].setPos(57, 117, kFacingPositionRight, 0); // cseg203:45C9-45DA
+ break;
+ case 21:
+ fadeIn(768); // cseg203:463F-4642
+ _walkData[0].setPos(300, 136, kFacingPositionLeft, 0); // cseg203:4647-4658
+ break;
+ case 22:
+ _walkData[0].setPos(49, 118, kFacingPositionBack, 0); // cseg203:4337-4348
+ break;
+ case 23:
+ _walkData[0].setPos(215, 134, kFacingPositionRight, 0); // cseg203:4437-445E
+ break;
+ case 24:
+ _walkData[0].setPos(211, 120, kFacingPositionFront, 0); // cseg203:450E-451F
+ fadeIn(768); // cseg203:455C-455F
+ break;
+ }
+ _walkData[0].clipSkipX = 1; // cseg203:4524,45DF,465D
+ _walkData[0].clipWidth = 30; // cseg203:4529,45E4,4662
+ _walkData[0].scaleWidth = 50; // cseg203:452F,45EA,4668
+ _walkData[0].xPosChanged = 1; // cseg203:4535,45F0,466E
+ _walkData[0].dxPos = 0; // cseg203:453A-453C,45F5-45F7,4673-4675
+ _walkData[0].yPosChanged = 1; // cseg203:453F,45FA,4678
+ _walkData[0].dyPos = 0; // cseg203:4544-4546,45FF-4601,467D-467F
+ _walkData[0].scaleHeight = 50; // cseg203:4549,4604,4682
+ _walkDataCurrentIndex = 0;
+ moveIgor(_walkData[0].posNum, _walkData[0].frameNum);
+ _walkDataLastIndex = 1; // cseg203:4575,4609,4698
+ _walkDataCurrentIndex = 1; // cseg203:457A,460E,469D
+ if (_currentPart == 22)
+ PART_02_EXEC_ACTION(118); // cseg203:438B
+ // TODO: transcribe state-specific entrance animations from
+ // cseg203:42F8-46B0. Positions above are their exact final walk state.
+ }
+
+ enterPartLoop();
+ while (_currentPart >= 20 && _currentPart <= 24 && !_gameStateLoaded)
+ runPartLoop();
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(_currentPart == kInvalidPart ? 768 : 624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_30.cpp b/engines/igor/part_30.cpp
index a7e0abcb84a..4d3d7b05b3d 100644
--- a/engines/igor/part_30.cpp
+++ b/engines/igor/part_30.cpp
@@ -110,10 +110,10 @@ void IgorEngine::PART_30_UPDATE_DIALOGUE_LAURA(int action) {
}
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;
+ 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) {
diff --git a/engines/igor/part_5.cpp b/engines/igor/part_5.cpp
index 15e0085681a..2f694b53bb9 100644
--- a/engines/igor/part_5.cpp
+++ b/engines/igor/part_5.cpp
@@ -174,7 +174,7 @@ void IgorEngine::PART_05() {
if (_currentPart == 50) {
debug("Entering PART_05_HELPER_6");
memcpy(_screenVGA, _screenLayer1, 46080);
- fadeIn(768);
+ fadeIn(624);
PART_05_HELPER_6_walkIgorToScene();
}
}
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 8c678dcb660..130a1b0fb6a 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -348,7 +348,7 @@ void IgorEngine::PART_06() {
_currentAction.verb = kVerbWalk;
memcpy(_paletteBuffer, _currentPalette, 624);
// Part 61 is arriving from intro so it doesnt need to copy the screen buffer
- fadeIn(768);
+ fadeIn(624);
}
loadActionData(DAT_SpringBridge);
_roomDataOffsets = PART_06_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/part_7.cpp b/engines/igor/part_7.cpp
index 1169e6f9a5c..9a875a7ead3 100644
--- a/engines/igor/part_7.cpp
+++ b/engines/igor/part_7.cpp
@@ -32,7 +32,7 @@ void IgorEngine::PART_07_DRAW_DOOR_STATE(int num) {
}
void IgorEngine::PART_07_openCloseDoor(int door, bool open) {
- const int stateIndex = door == 1 ? 26 : 27; // s3:0x856/0x857; cseg197:0150-03D8
+ const int stateIndex = door == 1 ? 26 : 27;
if ((_objectsState[stateIndex] != 0) == open) {
const int text = open ? 19 : 23;
ADD_DIALOGUE_TEXT(text, 1, text);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index bfa27082014..7235ba02568 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -528,6 +528,18 @@ void IgorEngine::PART_MAIN() {
case 1:
PART_00(); // Student dormitory; cseg001:08BA-08C1
break;
+ case 10:
+ case 11:
+ case 12:
+ PART_01(); // Outside the dormitory window; cseg001:08C6-08D5
+ break;
+ case 20:
+ case 21:
+ case 22:
+ case 23:
+ case 24:
+ PART_02(); // Dormitory attic; cseg001:08DA-08F5
+ break;
case 40:
PART_04(); // Map
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 02d32eb2292..3162d5975d9 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -531,6 +531,44 @@
#define ANM_StudentDormitoryRoom10 948 // cseg207:7E41; IGOR.EXE:0x7B0041, 0x080A bytes
#define ANM_StudentDormitoryRoom11 949 // cseg207:864B; IGOR.EXE:0x7B084B, 0x080A bytes
+// Outside Igor's dormitory window (PART_01), from NE segments 200-202.
+#define DAT_OutsideStudentDormitory 950 // cseg200:278F; IGOR.EXE:0x75EF8F, 0x17DD bytes
+#define TXT_OutsideStudentDormitory 951 // cseg202:06AD; IGOR.EXE:0x76F9AD, 0x0549 bytes
+#define IMG_OutsideStudentDormitory 952 // cseg202:0BF6; IGOR.EXE:0x76FEF6, 0xB400 bytes
+#define PAL_OutsideStudentDormitory 953 // cseg202:BFF6; IGOR.EXE:0x77B2F6, 0x0270 bytes
+#define MSK_OutsideStudentDormitory 954 // cseg202:C266; IGOR.EXE:0x77B566, 0x05F4 bytes
+#define BOX_OutsideStudentDormitory 955 // cseg202:C85A; IGOR.EXE:0x77BB5A, 0x0500 bytes
+#define ANM_OutsideStudentDormitory1 956 // cseg201:01A1; IGOR.EXE:0x7627A1, 0x00D8 bytes
+#define ANM_OutsideStudentDormitory2 957 // cseg201:0279; IGOR.EXE:0x762879, 0x0E1C bytes
+#define ANM_OutsideStudentDormitory3 958 // cseg201:1095; IGOR.EXE:0x763695, 0x07B0 bytes
+#define ANM_OutsideStudentDormitory4 959 // cseg201:1845; IGOR.EXE:0x763E45, 0x01B5 bytes
+#define ANM_OutsideStudentDormitory5 960 // cseg201:19FA; IGOR.EXE:0x763FFA, 0x00D0 bytes
+#define ANM_OutsideStudentDormitory6 961 // cseg201:1ACA; IGOR.EXE:0x7640CA, 0x8E80 bytes
+#define ANM_OutsideStudentDormitory7 962 // cseg201:A94A; IGOR.EXE:0x76CF4A, 0x0050 bytes
+#define ANM_OutsideStudentDormitory8 963 // cseg201:A99A; IGOR.EXE:0x76CF9A, 0x2210 bytes
+
+// Dormitory attic/crawlspace (PART_02), from NE segments 203-205.
+#define DAT_StudentDormitoryAttic 964 // cseg203:52D7; IGOR.EXE:0x7814D7, 0x1EA3 bytes
+#define TXT_StudentDormitoryAttic 965 // cseg205:06A2; IGOR.EXE:0x7926A2, 0x0744 bytes
+#define IMG_StudentDormitoryAttic 966 // cseg205:0DE6; IGOR.EXE:0x792DE6, 0xB400 bytes
+#define PAL_StudentDormitoryAttic 967 // cseg205:C1E6; IGOR.EXE:0x79E1E6, 0x0270 bytes
+#define MSK_StudentDormitoryAttic 968 // cseg205:C456; IGOR.EXE:0x79E456, 0x11C1 bytes
+#define BOX_StudentDormitoryAttic 969 // cseg205:D617; IGOR.EXE:0x79F617, 0x0500 bytes
+#define ANM_StudentDormitoryAttic1 970 // cseg204:02D3; IGOR.EXE:0x7860D3, 0x02BC bytes
+#define ANM_StudentDormitoryAttic2 971 // cseg204:058F; IGOR.EXE:0x78638F, 0x00DC bytes
+#define ANM_StudentDormitoryAttic3 972 // cseg204:066B; IGOR.EXE:0x78646B, 0x0028 bytes
+#define ANM_StudentDormitoryAttic4 973 // cseg204:0693; IGOR.EXE:0x786493, 0x153F bytes
+#define ANM_StudentDormitoryAttic5 974 // cseg204:1BD2; IGOR.EXE:0x7879D2, 0x153F bytes
+#define ANM_StudentDormitoryAttic6 975 // cseg204:3111; IGOR.EXE:0x788F11, 0x057C bytes
+#define ANM_StudentDormitoryAttic7 976 // cseg204:368D; IGOR.EXE:0x78948D, 0x0E10 bytes
+#define ANM_StudentDormitoryAttic8 977 // cseg204:449D; IGOR.EXE:0x78A29D, 0x1308 bytes
+#define ANM_StudentDormitoryAttic9 978 // cseg204:57A5; IGOR.EXE:0x78B5A5, 0x080A bytes
+#define ANM_StudentDormitoryAttic10 979 // cseg204:5FAF; IGOR.EXE:0x78BDAF, 0x0CE4 bytes
+#define ANM_StudentDormitoryAttic11 980 // cseg204:6C93; IGOR.EXE:0x78CA93, 0x160B bytes
+#define ANM_StudentDormitoryAttic12 981 // cseg204:829E; IGOR.EXE:0x78E09E, 0x0240 bytes
+#define ANM_StudentDormitoryAttic13 982 // cseg204:84DE; IGOR.EXE:0x78E2DE, 0x327D bytes
+#define ANM_StudentDormitoryAttic14 983 // cseg204:B75B; IGOR.EXE:0x79155B, 0x0960 bytes
+
// Administration secretary-room animation blocks copied by cseg192:0002-01D4.
#define ANM_AdministrationSecretaryRoom1 923 // cseg192:01D5; IGOR.EXE:0x7057D5, 0xD38 bytes
#define ANM_AdministrationSecretaryRoom2 924 // cseg192:0F0D; IGOR.EXE:0x70650D, 0x1FB bytes
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 68033b979a1..dac815ac85d 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -30,6 +30,20 @@ const RoomDataOffsets IgorEngine::PART_00_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_01_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 }, // cseg200 has no area-transition table
+ { 4, 15 }, // cseg200:0EBA-0EF5 (walk points), 1067,1672 (facing)
+ { 19, 103, 3155, 209, 179, 82 }, // cseg200:1E43-1F88
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // cseg200 has no room-specific dialogue matrix
+};
+
+const RoomDataOffsets IgorEngine::PART_02_ROOM_DATA_OFFSETS = {
+ { 125, 5, 20, 4 }, // cseg203:323B-324D; five-area transition table
+ { 259, 280 }, // cseg203:385E-3884,39F9
+ { 289, 473, 4193, 565, 549, 96 }, // cseg203:49B1-4AF9
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // cseg203 has no room-specific dialogue matrix
+};
+
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,
@@ -394,7 +408,7 @@ const RoomDataOffsets IgorEngine::PART_30_ROOM_DATA_OFFSETS = {
1489, // cseg110:018E-019E; first reply at blob+1591
11,
30,
- 0,
+ 90, // seg111:0ECD+90; reply 4 starts at +94 (cseg111 dialogue matrix)
2711, // cseg110:018E-019E; derived from the packed-tail layout
2729,
11
Commit: 5a1fa8e34c3f614ee280aa5472e1239ccb001563
https://github.com/scummvm/scummvm/commit/5a1fa8e34c3f614ee280aa5472e1239ccb001563
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:08+01:00
Commit Message:
IGOR: Add parts 18 and 19 as coming from the legacy engine
Changed paths:
A engines/igor/part_18.cpp
A engines/igor/part_19.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_6.cpp
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 86db7d1db98..1b795af4f2a 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -456,6 +456,7 @@ private:
void SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p);
void UPDATE_OBJECT_STATE(int num);
+ void PART_UPDATE_FIGURES_ON_PAPER(int delay);
void animateIgorTalking(int frame);
void fixIgorDialogueTextPosition(int num, int count, int *x, int *y);
@@ -615,6 +616,30 @@ private:
void PART_17_HELPER_11_PhillipToIgor(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();
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 9eafc4d8a6e..5b36bf6c01d 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -29,6 +29,8 @@ MODULE_OBJS = \
part_11.o \
part_12.o \
part_17.o \
+ part_18.o \
+ part_19.o \
part_21.o \
part_23.o \
part_28.o \
diff --git a/engines/igor/part_18.cpp b/engines/igor/part_18.cpp
new file mode 100644
index 00000000000..a6b8051e855
--- /dev/null
+++ b/engines/igor/part_18.cpp
@@ -0,0 +1,197 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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;
+ fadeOut(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);
+ fadeIn(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;
+ fadeIn(768);
+ PART_18_HELPER_2();
+ enterPartLoop();
+ while (_currentPart == 180) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ fadeOut(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/part_19.cpp b/engines/igor/part_19.cpp
new file mode 100644
index 00000000000..954aa1805fa
--- /dev/null
+++ b/engines/igor/part_19.cpp
@@ -0,0 +1,318 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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(4) : 40 + getRandomNumber(4));
+ 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);
+ fadeIn(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;
+ fadeOut(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() {
+ fadeOut(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);
+ fadeIn(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;
+ fadeIn(768);
+ PART_19_HELPER_3();
+ if (_objectsState[59] == 0) {
+ PART_19_HELPER_4();
+ } else {
+ enterPartLoop();
+ while (_currentPart == 190) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ }
+ fadeOut(624);
+}
+
+} // namespace Igor
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 130a1b0fb6a..5dd75cd3ea0 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -105,6 +105,7 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
break;
}
}
+
void IgorEngine::PART_06_ACTION_103_talkToPhotographer() {
ADD_DIALOGUE_TEXT(215, 1, 489);
SET_DIALOGUE_TEXT(1, 1);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 7235ba02568..50a7160c827 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -582,6 +582,14 @@ void IgorEngine::PART_MAIN() {
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:
@@ -657,4 +665,16 @@ void IgorEngine::moveScreenUp(int offset) {
}
}
+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);
+}
+
} // End of namespace Igor
Commit: c20c705d98872fb95ad5e3e851ce674b293db4a1
https://github.com/scummvm/scummvm/commit/c20c705d98872fb95ad5e3e851ce674b293db4a1
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:08+01:00
Commit Message:
IGOR: Fix part 1 walkable areas
Changed paths:
engines/igor/part_1.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/part_1.cpp b/engines/igor/part_1.cpp
index 30a41ca0edb..da454c43b84 100644
--- a/engines/igor/part_1.cpp
+++ b/engines/igor/part_1.cpp
@@ -11,72 +11,73 @@
namespace Igor {
void IgorEngine::PART_01_CLOSE_WINDOW() {
- // s3:0230-0233 (IGOR.EXE:0x8B0230); selected at cseg200:0231-0249.
static const uint8 windowFrames[] = { 0, 1, 2, 1 };
for (int i = 0; i < 4; ++i) {
- // cseg200:0226-035C: 28x43 raw frames at ANM offset 216,
- // frame stride 1204, drawn at screen offset 0x5919.
PART_00_DRAW_RAW_FRAME(216, windowFrames[i], 1204, 28, 43, 0x5919);
if (i == 0)
- playSound(2, 1); // cseg200:035E-0369
+ playSound(2, 1);
if (i != 3) {
- // cseg200:0375-037D; ANM offset 0 contains four 9x6 frames.
+ // ANM offset 0 contains four 9x6 frames.
const int backgroundFrame = getRandomNumber(3);
const uint8 *src = _animFramesBuffer + backgroundFrame * 54;
for (int y = 0; y < 6; ++y)
memcpy(_screenVGA + 0x8EA4 + y * 320, src + y * 9, 9);
- waitForTimer(94); // cseg200:0382-038C
+ waitForTimer(94);
}
}
- ADD_DIALOGUE_TEXT(203, 1, 132); // cseg200:0398-03AA
- ADD_DIALOGUE_TEXT(204, 1, 133); // cseg200:03AA-03BC
- SET_DIALOGUE_TEXT(1, 2); // cseg200:03BC-03C1
- startIgorDialogue(); // cseg200:03C6
- waitForEndOfIgorDialogue(); // cseg200:03CB
+ ADD_DIALOGUE_TEXT(203, 1, 132);
+ ADD_DIALOGUE_TEXT(204, 1, 133);
+ SET_DIALOGUE_TEXT(1, 2);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
}
void IgorEngine::PART_01_EXEC_ACTION(int action) {
- // Action-to-function mapping: cseg200:068A-079F.
debugC(9, kDebugGame, "PART_01_EXEC_ACTION %d", action);
switch (action) {
case 101:
- ADD_DIALOGUE_TEXT(201, 2, 131); // cseg200:054F-0575
+ ADD_DIALOGUE_TEXT(201, 2, 131);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 102:
- // TODO: transcribe the roof-crossing animation from cseg200:03D2-054E.
- // It ends in state 20 at cseg200:0547; do not skip observable behavior.
- warning("PART_01_EXEC_ACTION action 102 is not yet transcribed");
+ // draws two 24x41 roof-crossing frames at screen
+ // waiting for the video update after each one, then
+ // changes to part 20.
+ for (int frame = 0; frame <= 1; ++frame) {
+ PART_00_DRAW_RAW_FRAME(0x0EF4, frame, 0x3D8, 24, 41, 0x51F4);
+ waitForTimer(); // video-update wait
+ }
+ _currentPart = 20;
break;
case 103:
- ADD_DIALOGUE_TEXT(205, 1, 134); // cseg200:057C-05A2
+ ADD_DIALOGUE_TEXT(205, 1, 134);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 104:
- ADD_DIALOGUE_TEXT(206, 2, 135); // cseg200:05A9-05CF
+ ADD_DIALOGUE_TEXT(206, 2, 135);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 105:
- ADD_DIALOGUE_TEXT(208, 1, 136); // cseg200:05D6-05FC
+ ADD_DIALOGUE_TEXT(208, 1, 136);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 106:
- ADD_DIALOGUE_TEXT(209, 1, 137); // cseg200:0603-0629
+ ADD_DIALOGUE_TEXT(209, 1, 137);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 107:
- ADD_DIALOGUE_TEXT(210, 1, 138); // cseg200:0630-0656
+ ADD_DIALOGUE_TEXT(210, 1, 138);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 108:
- ADD_DIALOGUE_TEXT(211, 2, 139); // cseg200:065D-0683
+ ADD_DIALOGUE_TEXT(211, 2, 139);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -87,40 +88,40 @@ void IgorEngine::PART_01_EXEC_ACTION(int action) {
}
void IgorEngine::PART_01() {
- _gameState.enableLight = 1; // cseg200:1836
- loadActionData(DAT_OutsideStudentDormitory); // cseg200:1853-186A
+ _gameState.enableLight = 1;
+ loadActionData(DAT_OutsideStudentDormitory);
loadRoomData(PAL_OutsideStudentDormitory, IMG_OutsideStudentDormitory,
BOX_OutsideStudentDormitory, MSK_OutsideStudentDormitory,
- TXT_OutsideStudentDormitory); // cseg202:0002
+ TXT_OutsideStudentDormitory);
static const int animFrames[] = {
ANM_OutsideStudentDormitory1, ANM_OutsideStudentDormitory2,
ANM_OutsideStudentDormitory3, ANM_OutsideStudentDormitory4,
ANM_OutsideStudentDormitory5, ANM_OutsideStudentDormitory6,
ANM_OutsideStudentDormitory7, ANM_OutsideStudentDormitory8, 0
};
- loadAnimData(animFrames); // cseg201:0002-019F
+ loadAnimData(animFrames);
_roomDataOffsets = PART_01_ROOM_DATA_OFFSETS;
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_01_EXEC_ACTION); // cseg200:068A-079F
- memcpy(_screenVGA, _screenLayer1, 46080); // cseg200:187E-1890
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_01_EXEC_ACTION);
+ memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
if (_currentPart == 10) {
- fadeIn(768); // cseg200:1AD2-1AD5
- _walkData[0].setPos(108, 113, kFacingPositionRight, 0); // cseg200:1ADA-1AE6
- _walkData[0].clipSkipX = 1; // cseg200:1AF0
- _walkData[0].clipWidth = 24; // cseg200:1AF5
- _walkData[0].scaleWidth = 40; // cseg200:1AFB
- _walkData[0].xPosChanged = 1; // cseg200:1B01
- _walkData[0].dxPos = 0; // cseg200:1B06-1B08
- _walkData[0].yPosChanged = 1; // cseg200:1B0B
- _walkData[0].dyPos = 0; // cseg200:1B10-1B12
- _walkData[0].scaleHeight = 40; // cseg200:1B15
+ fadeIn(768);
+ _walkData[0].setPos(108, 113, kFacingPositionRight, 0);
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 24;
+ _walkData[0].scaleWidth = 40;
+ _walkData[0].xPosChanged = 1;
+ _walkData[0].dxPos = 0;
+ _walkData[0].yPosChanged = 1;
+ _walkData[0].dyPos = 0;
+ _walkData[0].scaleHeight = 40;
_walkDataCurrentIndex = 0;
moveIgor(_walkData[0].posNum, _walkData[0].frameNum);
- _walkDataLastIndex = 1; // cseg200:1B1A
- _walkDataCurrentIndex = 1; // cseg200:1B1F
- PART_01_CLOSE_WINDOW(); // cseg200:1B24
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ PART_01_CLOSE_WINDOW();
} else {
// TODO: transcribe state 11 and 12 transition cutscenes from
// cseg200:1950-1AB0 before enabling their state changes to 22/23.
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 22ede2dd36a..07507d5ee79 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1114,6 +1114,39 @@ void IgorEngine::fixWalkPosition(int *x, int *y) {
*y = yPos;
return;
}
+ // Part 1 walks on the roof ledge, whose only walkable area
+ // (mask region 5) runs from (60,117) up to (276,98); both clamp values are
+ // that ledge's endpoints.
+ if (getPart() == 1) {
+ int xPos = *x;
+ int yPos = *y;
+ if (yPos > 143)
+ yPos = 143;
+ if (xPos < 60) {
+ xPos = 60;
+ yPos = 117;
+ } else if (xPos > 276) {
+ xPos = 276;
+ yPos = 98;
+ } else {
+ do {
+ if (yPos < 143)
+ ++yPos;
+ //
+ if (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area != 0)
+ break;
+ } while (yPos != 143);
+ if (yPos == 143) {
+ //
+ do {
+ --yPos;
+ } while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0);
+ }
+ }
+ *x = xPos;
+ *y = yPos;
+ return;
+ }
int xPos = *x;
if (xPos < _roomWalkBounds.x1) {
xPos = _roomWalkBounds.x1;
Commit: f3858d76edb7af5fca58f269a55857a541d99981
https://github.com/scummvm/scummvm/commit/f3858d76edb7af5fca58f269a55857a541d99981
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:09+01:00
Commit Message:
IGOR: Add speech indices to parts 18 and 19
Changed paths:
engines/igor/part_0.cpp
engines/igor/part_1.cpp
engines/igor/part_18.cpp
engines/igor/part_19.cpp
diff --git a/engines/igor/part_0.cpp b/engines/igor/part_0.cpp
index 9f1fbdfe473..e6263525260 100644
--- a/engines/igor/part_0.cpp
+++ b/engines/igor/part_0.cpp
@@ -129,14 +129,14 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 106: // cseg206:088B-0A33
+ case 106: // open bedside table
if (_objectsState[8] == 0) {
PART_00_ANIMATE_RAW(0x3FC8, 0, 2, 0x436, 22, 49, 0x693C, 126, 2, 6);
_objectsState[8] = 1;
PART_00_APPLY_OBJECT_STATE(1);
}
break;
- case 107: // cseg206:0A34-0BDC
+ case 107: // close bedside table
if (_objectsState[8] != 0) {
PART_00_ANIMATE_RAW(0x3FC8, 2, 0, 0x436, 22, 49, 0x693C, 126, 1, 6);
_objectsState[8] = 0;
@@ -243,7 +243,6 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
}
void IgorEngine::PART_00_ENTRY_ANIMATION() {
- // cseg206:0BDD-0DCD.
waitForTimer(62);
if (_objectsState[10] == 0) {
for (int y = 0; y < 56; ++y)
@@ -257,7 +256,6 @@ void IgorEngine::PART_00_ENTRY_ANIMATION() {
}
void IgorEngine::PART_00_WALK_IN() {
- // cseg206:3AB1-3B5C.
PART_00_ENTRY_ANIMATION();
WalkData *wd = &_walkData[0];
wd->setPos(120, 131, kFacingPositionFront, 0);
@@ -275,7 +273,7 @@ void IgorEngine::PART_00_WALK_IN() {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- if (_objectsState[14] == 0) { // s3:084A; cseg206:3B2F-3B57
+ if (_objectsState[14] == 0) {
ADD_DIALOGUE_TEXT(215, 2, 103);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
diff --git a/engines/igor/part_1.cpp b/engines/igor/part_1.cpp
index da454c43b84..a4ae4ed84f6 100644
--- a/engines/igor/part_1.cpp
+++ b/engines/igor/part_1.cpp
@@ -36,7 +36,7 @@ void IgorEngine::PART_01_CLOSE_WINDOW() {
void IgorEngine::PART_01_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_01_EXEC_ACTION %d", action);
switch (action) {
- case 101:
+ case 101: // walk past pigeon
ADD_DIALOGUE_TEXT(201, 2, 131);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -51,32 +51,32 @@ void IgorEngine::PART_01_EXEC_ACTION(int action) {
}
_currentPart = 20;
break;
- case 103:
+ case 103: // look at pigeon
ADD_DIALOGUE_TEXT(205, 1, 134);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 104:
+ case 104: // look at closed window
ADD_DIALOGUE_TEXT(206, 2, 135);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 105:
+ case 105: // look at other window
ADD_DIALOGUE_TEXT(208, 1, 136);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 106:
+ case 106: // close other window
ADD_DIALOGUE_TEXT(209, 1, 137);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 107:
+ case 107: // open window
ADD_DIALOGUE_TEXT(210, 1, 138);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 108:
+ case 108: // pick up pigeon
ADD_DIALOGUE_TEXT(211, 2, 139);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -90,9 +90,7 @@ void IgorEngine::PART_01_EXEC_ACTION(int action) {
void IgorEngine::PART_01() {
_gameState.enableLight = 1;
loadActionData(DAT_OutsideStudentDormitory);
- loadRoomData(PAL_OutsideStudentDormitory, IMG_OutsideStudentDormitory,
- BOX_OutsideStudentDormitory, MSK_OutsideStudentDormitory,
- TXT_OutsideStudentDormitory);
+ loadRoomData(PAL_OutsideStudentDormitory, IMG_OutsideStudentDormitory, BOX_OutsideStudentDormitory, MSK_OutsideStudentDormitory, TXT_OutsideStudentDormitory);
static const int animFrames[] = {
ANM_OutsideStudentDormitory1, ANM_OutsideStudentDormitory2,
ANM_OutsideStudentDormitory3, ANM_OutsideStudentDormitory4,
@@ -100,6 +98,7 @@ void IgorEngine::PART_01() {
ANM_OutsideStudentDormitory7, ANM_OutsideStudentDormitory8, 0
};
loadAnimData(animFrames);
+
_roomDataOffsets = PART_01_ROOM_DATA_OFFSETS;
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_01_EXEC_ACTION);
memcpy(_screenVGA, _screenLayer1, 46080);
diff --git a/engines/igor/part_18.cpp b/engines/igor/part_18.cpp
index a6b8051e855..3b22f4f6c6d 100644
--- a/engines/igor/part_18.cpp
+++ b/engines/igor/part_18.cpp
@@ -26,45 +26,45 @@ namespace Igor {
void IgorEngine::PART_18_EXEC_ACTION(int action) {
switch (action) {
case 101:
- ADD_DIALOGUE_TEXT(201, 1);
+ ADD_DIALOGUE_TEXT(201, 1, 896);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 102:
- ADD_DIALOGUE_TEXT(202, 1);
+ ADD_DIALOGUE_TEXT(202, 1, 897);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 103:
- ADD_DIALOGUE_TEXT(205, 1);
+ ADD_DIALOGUE_TEXT(205, 1, 899);
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);
+ ADD_DIALOGUE_TEXT(206, 1, 900);
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);
+ ADD_DIALOGUE_TEXT(207, 1, 901);
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);
+ ADD_DIALOGUE_TEXT(208, 1, 902);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 107:
- ADD_DIALOGUE_TEXT(209, 1);
+ ADD_DIALOGUE_TEXT(209, 1, 903);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 108:
- ADD_DIALOGUE_TEXT(210, 1);
+ ADD_DIALOGUE_TEXT(210, 1, 904);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -108,20 +108,20 @@ void IgorEngine::PART_18_ACTION_109() {
removeObjectFromInventory(53);
fadeIn(768);
_currentPart = part;
- ADD_DIALOGUE_TEXT(215, 1);
+ ADD_DIALOGUE_TEXT(215, 1, 908);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
void IgorEngine::PART_18_ACTION_111() {
if (_objectsState[0] == 0) {
- ADD_DIALOGUE_TEXT(211, 1);
+ ADD_DIALOGUE_TEXT(211, 1, 905);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
}
if (_objectsState[0] == 2) {
- ADD_DIALOGUE_TEXT(212, 1);
+ ADD_DIALOGUE_TEXT(212, 1, 906);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
@@ -137,7 +137,7 @@ void IgorEngine::PART_18_ACTION_111() {
for (int i = 0; i <= 28; ++i) {
memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 28 + 0xBDE, 28);
}
- ADD_DIALOGUE_TEXT(213, 2);
+ ADD_DIALOGUE_TEXT(213, 2, 907);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
_objectsState[0] = 2;
diff --git a/engines/igor/part_19.cpp b/engines/igor/part_19.cpp
index 954aa1805fa..e019e4f659b 100644
--- a/engines/igor/part_19.cpp
+++ b/engines/igor/part_19.cpp
@@ -27,30 +27,30 @@ static int VAR_CURRENT_TALKING_ACTOR;
void IgorEngine::PART_19_EXEC_ACTION(int action) {
switch (action) {
case 101:
- ADD_DIALOGUE_TEXT(201, 1);
+ ADD_DIALOGUE_TEXT(201, 1, 909);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 102:
- ADD_DIALOGUE_TEXT(202, 1);
+ ADD_DIALOGUE_TEXT(202, 1, 910);
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);
+ ADD_DIALOGUE_TEXT(203, 1, 911);
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);
+ ADD_DIALOGUE_TEXT(204, 1, 912);
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);
+ ADD_DIALOGUE_TEXT(205, 1, 913);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -61,7 +61,7 @@ void IgorEngine::PART_19_EXEC_ACTION(int action) {
PART_19_ACTION_107();
break;
case 108:
- ADD_DIALOGUE_TEXT(208, 1);
+ ADD_DIALOGUE_TEXT(208, 1, 916);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -74,15 +74,15 @@ void IgorEngine::PART_19_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_19_ACTION_107() {
+void IgorEngine::PART_19_ACTION_107() { // sub_137_02C7
if (_objectsState[58] == 1) {
- ADD_DIALOGUE_TEXT(211, 1);
+ ADD_DIALOGUE_TEXT(211, 1, 919);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
}
- ADD_DIALOGUE_TEXT(206, 1);
- ADD_DIALOGUE_TEXT(207, 1);
+ ADD_DIALOGUE_TEXT(206, 1, 914);
+ ADD_DIALOGUE_TEXT(207, 1, 915);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -98,9 +98,9 @@ void IgorEngine::PART_19_ACTION_107() {
PART_19_HELPER_1(255);
}
-void IgorEngine::PART_19_ACTION_109() {
+void IgorEngine::PART_19_ACTION_109() { // sub_137_0421
if (_objectsState[2] == 1) {
- ADD_DIALOGUE_TEXT(210, 1);
+ ADD_DIALOGUE_TEXT(210, 1, 918);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
@@ -116,7 +116,7 @@ void IgorEngine::PART_19_ACTION_109() {
PART_19_HELPER_1(255);
stopSound();
decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x360) - 1, _screenVGA, true);
- ADD_DIALOGUE_TEXT(209, 1);
+ ADD_DIALOGUE_TEXT(209, 1, 917);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -149,7 +149,7 @@ void IgorEngine::PART_19_HELPER_1(int num) {
}
}
-void IgorEngine::PART_19_HELPER_2() {
+void IgorEngine::PART_19_HELPER_2() { // sub_137_07AD
int talkSpeed = _gameState.talkSpeed;
_gameState.talkSpeed = 5;
memcpy(_screenLayer2, _screenVGA, 46080);
@@ -158,7 +158,7 @@ void IgorEngine::PART_19_HELPER_2() {
decodeAnimFrame(src, _screenVGA, true);
memcpy(_screenLayer1, _screenVGA, 46080);
fadeIn(624);
- ADD_DIALOGUE_TEXT(212, 3);
+ ADD_DIALOGUE_TEXT(212, 3, 920);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(243, 92, 63, 23, 33);
VAR_CURRENT_TALKING_ACTOR = 0;
@@ -169,8 +169,8 @@ void IgorEngine::PART_19_HELPER_2() {
src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x404F + i * 2) - 1;
waitForTimer(60);
}
- ADD_DIALOGUE_TEXT(215, 1);
- ADD_DIALOGUE_TEXT(216, 2);
+ ADD_DIALOGUE_TEXT(215, 1, 921);
+ ADD_DIALOGUE_TEXT(216, 2, 922);
SET_DIALOGUE_TEXT(1, 2);
startCutsceneDialogue(227, 91, 0, 63, 63);
_gameState.counter[1] = 10;
@@ -199,28 +199,28 @@ void IgorEngine::PART_19_HELPER_2() {
src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x40B5) - 1;
decodeAnimFrame(src, _screenVGA, true);
waitForTimer(30);
- ADD_DIALOGUE_TEXT(218, 1);
+ ADD_DIALOGUE_TEXT(218, 1, 923);
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);
+ ADD_DIALOGUE_TEXT(219, 2, 924);
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);
+ ADD_DIALOGUE_TEXT(221, 2, 925);
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);
+ ADD_DIALOGUE_TEXT(223, 2, 926);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(227, 91, 0, 63, 63);
VAR_CURRENT_TALKING_ACTOR = 1;
@@ -245,10 +245,10 @@ void IgorEngine::PART_19_HELPER_3() {
waitForIgorMove();
}
-void IgorEngine::PART_19_HELPER_4() {
+void IgorEngine::PART_19_HELPER_4() { // sub_137_0D7B
decodeAnimFrame(_animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x40AB) - 1, _screenVGA, true);
waitForTimer(60);
- ADD_DIALOGUE_TEXT(225, 1);
+ ADD_DIALOGUE_TEXT(225, 1, 927);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
Commit: f992136198c75bebaf01b35b1c3b4ad150d05aa1
https://github.com/scummvm/scummvm/commit/f992136198c75bebaf01b35b1c3b4ad150d05aa1
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:09+01:00
Commit Message:
IGOR: adds clamping of y axis on walk bounds
Changed paths:
engines/igor/igor.h
engines/igor/part_0.cpp
engines/igor/part_1.cpp
engines/igor/part_2.cpp
engines/igor/part_main.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 1b795af4f2a..f717226b192 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -105,6 +105,8 @@ enum InputVar {
struct RoomWalkBounds {
int x1, y1;
int x2, y2;
+ // Minimum y after clamping a click past the corresponding horizontal edge.
+ int x1MinY, x2MinY;
};
struct DetectedGameVersion {
@@ -488,6 +490,11 @@ private:
void PART_01();
void PART_01_EXEC_ACTION(int action);
void PART_01_CLOSE_WINDOW();
+ void PART_01_STATE_11_BLIT_0053();
+ void PART_01_STATE_11_BLIT_00A5();
+ void PART_01_STATE_11_BLIT_0153();
+ uint16 PART_01_STATE_11_DRAW_01B8(int index);
+ void PART_01_STATE_11();
void PART_02();
void PART_02_EXEC_ACTION(int action);
void PART_02_APPLY_OBJECT_STATE(int num);
@@ -822,7 +829,8 @@ private:
const uint8 *getAnimFrame(int baseOffset, int tableOffset, int frame);
void decodeAnimFrame(const uint8 *src, uint8 *dst, bool preserveText = false);
- void setRoomWalkBounds(int x1, int y1, int x2, int y2);
+ void setRoomWalkBounds(int x1, int y1, int x2, int y2,
+ int x1MinY = -1, int x2MinY = -1);
void fixWalkPosition(int *x, int *y);
void recolorDialogueChoice(int num, bool highlight);
void handleDialogue(int x, int y, int r, int g, int b);
diff --git a/engines/igor/part_0.cpp b/engines/igor/part_0.cpp
index e6263525260..8f103a4901c 100644
--- a/engines/igor/part_0.cpp
+++ b/engines/igor/part_0.cpp
@@ -326,6 +326,9 @@ void IgorEngine::PART_00() {
};
loadAnimData(animFrames); // cseg207:0002-0239
_roomDataOffsets = PART_00_ROOM_DATA_OFFSETS;
+ // clamps clicks to x 41..253 and y <= 143; clicks past the
+ // horizontal edges also clamp to y >= 141/138
+ setRoomWalkBounds(41, 0, 253, 143, 141, 138);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_00_EXEC_ACTION);
PART_00_APPLY_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080); // cseg206:39B3-39C5
diff --git a/engines/igor/part_1.cpp b/engines/igor/part_1.cpp
index a4ae4ed84f6..6f22fcb6963 100644
--- a/engines/igor/part_1.cpp
+++ b/engines/igor/part_1.cpp
@@ -100,6 +100,9 @@ void IgorEngine::PART_01() {
loadAnimData(animFrames);
_roomDataOffsets = PART_01_ROOM_DATA_OFFSETS;
+ // clamps clicks to x 60..276 and y <= 143 before consulting
+ // the room mask
+ setRoomWalkBounds(60, 0, 276, 143);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_01_EXEC_ACTION);
memcpy(_screenVGA, _screenLayer1, 46080);
diff --git a/engines/igor/part_2.cpp b/engines/igor/part_2.cpp
index bd8e00f20ce..fd711cc643a 100644
--- a/engines/igor/part_2.cpp
+++ b/engines/igor/part_2.cpp
@@ -125,11 +125,14 @@ void IgorEngine::PART_02() {
ANM_StudentDormitoryAttic11, ANM_StudentDormitoryAttic12,
ANM_StudentDormitoryAttic13, ANM_StudentDormitoryAttic14, 0
};
- loadAnimData(animFrames); // cseg204:0002-02CC
+ loadAnimData(animFrames);
_roomDataOffsets = PART_02_ROOM_DATA_OFFSETS;
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_02_EXEC_ACTION); // cseg203:1FD9-22AE
- PART_02_APPLY_OBJECT_STATE(255); // cseg203:4213-421A
- memcpy(_screenVGA, _screenLayer1, 46080); // cseg203:421F-4231
+ // clamps clicks to x 41..253 and y <= 143; clicks past the
+ // horizontal edges also clamp to y >= 141/138.
+ setRoomWalkBounds(41, 0, 253, 143, 141, 138);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_02_EXEC_ACTION);
+ PART_02_APPLY_OBJECT_STATE(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 50a7160c827..8402961d28f 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -526,19 +526,19 @@ void IgorEngine::PART_MAIN() {
switch (_currentPart) {
case 0:
case 1:
- PART_00(); // Student dormitory; cseg001:08BA-08C1
+ PART_00(); // Student dormitory
break;
case 10:
case 11:
case 12:
- PART_01(); // Outside the dormitory window; cseg001:08C6-08D5
+ PART_01(); // Outside the dormitory window
break;
case 20:
case 21:
case 22:
case 23:
case 24:
- PART_02(); // Dormitory attic; cseg001:08DA-08F5
+ PART_02(); // Dormitory attic
break;
case 40:
@@ -580,42 +580,42 @@ void IgorEngine::PART_MAIN() {
break;
case 170:
case 171:
- PART_17();
+ PART_17(); // College entrance
break;
case 180:
case 181:
- PART_18();
+ PART_18(); // men toilets
break;
case 190:
case 191:
- PART_19();
+ PART_19(); // women toilets
break;
case 210:
case 211:
case 212:
- PART_21();
+ PART_21(); //college corridor margaret
break;
case 230:
case 231:
case 232:
- PART_23();
+ PART_23(); // college corridor lucas
break;
case 280:
case 281:
- PART_28();
+ PART_28(); // college corridor caroline
break;
case 300:
case 301:
case 302:
- case 303: // college stairs first floor
- PART_30();
+ case 303:
+ PART_30(); // college stairs first floor
break;
case 340:
- PART_34(); // Park, left panel; cseg101:1F85
+ PART_34(); // Park, left panel
break;
case 350:
case 351:
- PART_35(); // Park, right panel; cseg100:1644
+ PART_35(); // Park, right panel
break;
case 850: // Intro cutscene
// Clear the entire screen buffer before starting the intro cutscene
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 07507d5ee79..91540f2d07c 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -31,12 +31,15 @@ static int16 truncReal(float f) {
return (int16)f;
}
-void IgorEngine::setRoomWalkBounds(int x1, int y1, int x2, int y2) {
+void IgorEngine::setRoomWalkBounds(int x1, int y1, int x2, int y2,
+ int x1MinY, int x2MinY) {
assert(x1 <= x2 && y1 <= y2);
_roomWalkBounds.x1 = x1;
_roomWalkBounds.x2 = x2;
_roomWalkBounds.y1 = y1;
_roomWalkBounds.y2 = y2;
+ _roomWalkBounds.x1MinY = x1MinY < 0 ? y1 : x1MinY;
+ _roomWalkBounds.x2MinY = x2MinY < 0 ? y1 : x2MinY;
}
void IgorEngine::buildWalkPath(int srcX, int srcY, int dstX, int dstY) {
@@ -1090,76 +1093,22 @@ void IgorEngine::buildWalkPathSimple(int srcX, int srcY, int dstX, int dstY) {
}
void IgorEngine::fixWalkPosition(int *x, int *y) {
- if (getPart() == 0) {
- int xPos = *x;
- int yPos = *y;
- if (yPos > 143)
- yPos = 143;
- if (xPos < 41) {
- xPos = 41;
- if (yPos < 141)
- yPos = 141;
- } else if (xPos > 253) {
- xPos = 253;
- if (yPos < 138)
- yPos = 138;
- } else {
- do {
- if (yPos >= 143)
- break;
- ++yPos;
- } while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0);
- }
- *x = xPos;
- *y = yPos;
- return;
- }
- // Part 1 walks on the roof ledge, whose only walkable area
- // (mask region 5) runs from (60,117) up to (276,98); both clamp values are
- // that ledge's endpoints.
- if (getPart() == 1) {
- int xPos = *x;
- int yPos = *y;
- if (yPos > 143)
- yPos = 143;
- if (xPos < 60) {
- xPos = 60;
- yPos = 117;
- } else if (xPos > 276) {
- xPos = 276;
- yPos = 98;
- } else {
- do {
- if (yPos < 143)
- ++yPos;
- //
- if (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area != 0)
- break;
- } while (yPos != 143);
- if (yPos == 143) {
- //
- do {
- --yPos;
- } while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0);
- }
- }
- *x = xPos;
- *y = yPos;
- return;
- }
int xPos = *x;
+ int edgeMinY = _roomWalkBounds.y1;
if (xPos < _roomWalkBounds.x1) {
xPos = _roomWalkBounds.x1;
+ edgeMinY = _roomWalkBounds.x1MinY;
}
if (xPos > _roomWalkBounds.x2) {
xPos = _roomWalkBounds.x2;
+ edgeMinY = _roomWalkBounds.x2MinY;
}
if (getPart() == 22) {
*x = xPos;
*y = _roomWalkBounds.y1;
return;
}
- int yPos = *y;
+ int yPos = MAX(MIN(*y, _roomWalkBounds.y2), edgeMinY);
if (getPart() == 13) {
if (xPos >= 92 && xPos <= 186 && yPos > 127) {
*x = xPos;
Commit: 55137e22eb6b9f00ce43375b81483ccf6edc9b3c
https://github.com/scummvm/scummvm/commit/55137e22eb6b9f00ce43375b81483ccf6edc9b3c
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:09+01:00
Commit Message:
IGOR: Complete part2 set of actions
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/part_1.cpp
engines/igor/part_2.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index d3a1b42e0fa..1b2d6007910 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -66,7 +66,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- _currentPart = 0;
+ _currentPart = 20;
// _currentPart = 171;
// _currentPart = 62;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index f717226b192..d8ac425873c 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -492,13 +492,14 @@ private:
void PART_01_CLOSE_WINDOW();
void PART_01_STATE_11_BLIT_0053();
void PART_01_STATE_11_BLIT_00A5();
- void PART_01_STATE_11_BLIT_0153();
- uint16 PART_01_STATE_11_DRAW_01B8(int index);
+ void PART_01_STATE_11_BLIT_0153(int frame);
+ void PART_01_STATE_11_DRAW_01B8(int index);
void PART_01_STATE_11();
void PART_02();
void PART_02_EXEC_ACTION(int action);
void PART_02_APPLY_OBJECT_STATE(int num);
void PART_02_START_DIALOGUE(int text, int count, int sound);
+ void PART_02_SEARCH_TRUNK();
// spring bridge
void PART_05_HELPER_4_drawPaperOrNot(int num);
diff --git a/engines/igor/part_1.cpp b/engines/igor/part_1.cpp
index 6f22fcb6963..387c45ebe1b 100644
--- a/engines/igor/part_1.cpp
+++ b/engines/igor/part_1.cpp
@@ -33,6 +33,82 @@ void IgorEngine::PART_01_CLOSE_WINDOW() {
waitForEndOfIgorDialogue();
}
+// sub_200_0053 (cseg200:0053-00A4): 13 rows of 16 bytes from the animation
+// buffer, source stride 16 (cseg200:0074-007D), to the screen with stride 320
+// (cseg200:0087-008D), 16 bytes per row (cseg200:0095). s3:0xEB20 is the loop
+// counter and runs until 0x0C (cseg200:0068-006D, 009C).
+void IgorEngine::PART_01_STATE_11_BLIT_0053() {
+ for (int i = 0; i < 13; ++i)
+ memcpy(_screenVGA + 0x5476 + i * 320, _animFramesBuffer + 0x1859 + i * 16, 16);
+}
+
+// sub_200_00A5 (cseg200:00A5-00F7): 40 rows of 218 bytes, source stride 0xDA
+// (cseg200:00C3), to the screen with stride 320 (cseg200:00D9-00DF), 0xDA bytes
+// per row (cseg200:00E7). Loop counter s3:0xEB20 until 0x27 (cseg200:00BF, 00EF).
+void IgorEngine::PART_01_STATE_11_BLIT_00A5() {
+ for (int i = 0; i < 40; ++i)
+ memcpy(_screenVGA + 0x118F + i * 320, _animFramesBuffer + 0xA7F9 + i * 0xDA, 0xDA);
+}
+
+// sub_200_0153 (cseg200:0153-01B5): one of five 5x4 pigeon frames. The frame
+// parameter is multiplied by 0x14 at cseg200:017E-018C; each row is five bytes
+// (cseg200:0171-017C), and the destination stride is 320 (cseg200:0198-01A6).
+void IgorEngine::PART_01_STATE_11_BLIT_0153(int frame) {
+ for (int i = 0; i < 4; ++i)
+ memcpy(_screenVGA + 0x55BB + i * 320,
+ _animFramesBuffer + 0xA7A9 + frame * 20 + i * 5, 5);
+}
+
+// sub_200_01B8 (cseg200:01B8-01F3): a single 0x2F80-byte copy from
+// _animFramesBuffer + 0x1929 + 0x2F80*index (cseg200:01CB-01DA) to
+// _screenVGA + 0x6F40 (cseg200:01C6, 01E4), 0x2F80 bytes per call
+// (cseg200:01EA).
+void IgorEngine::PART_01_STATE_11_DRAW_01B8(int index) {
+ memcpy(_screenVGA + 0x6F40, _animFramesBuffer + 0x1929 + index * 0x2F80, 0x2F80);
+}
+
+// State 11: the window-exit cutscene, cseg200:195A-19F0. It blits two regions,
+// restores the current palette from the saved one, then runs a 1000-tick
+// animation loop before handing over to state 22.
+void IgorEngine::PART_01_STATE_11() {
+ PART_01_STATE_11_BLIT_0053(); // cseg200:195A
+ PART_01_STATE_11_BLIT_00A5(); // cseg200:195F
+
+ // cseg200:1964-1971 copies 768 bytes with s3:0xE15E pushed first and
+ // s3:0xE45E second, so s3:0xE15E is the source. The inverse pair at
+ // cseg209:0425-0432 and cseg209:064E-065B pins s3:0xE15E to
+ // _paletteBuffer and s3:0xE45E to _currentPalette.
+ memcpy(_currentPalette, _paletteBuffer, 768);
+
+ // cseg221:0x21DA is setPalette(), as identified by the original-runtime
+ // trap table in reference/cyxx/igor/game.cpp and called at cseg200:1976.
+ updatePalette(768);
+
+ // s3:0xEACA is a 0..63 DOS-timer counter and s3:0xEB26 counts 1000
+ // iterations (cseg200:197B-1986,19CC-19E8). The EAC8/EAC9 spin at
+ // cseg200:19BD-19C9 waits for one DOS timer unit after every iteration.
+ uint8 eaca = 0;
+ for (int eb26 = 0; eb26 < 1000; ++eb26) { // cseg200:197B-197D, 19DE-19E8
+ if (eaca == 0x3D) { // cseg200:198B
+ // DOS random(4) returns 0..3; the C++ helper's bound is inclusive.
+ PART_01_STATE_11_BLIT_0153(getRandomNumber(3)); // cseg200:1992-199A
+ }
+ if (((eaca + 1) % 0x20) == 0) { // cseg200:199F-19B8
+ // DOS random(3) returns 0..2. ANM_OutsideStudentDormitory6 is
+ // exactly three 0x2F80-byte frames (0x8E80 bytes).
+ PART_01_STATE_11_DRAW_01B8(getRandomNumber(2));
+ }
+
+ waitForTimer(); // cseg200:19BD-19C9: one DOS timer unit
+
+ if (eaca == 0x3F) // cseg200:19CC-19D8
+ eaca = 0;
+ else
+ ++eaca; // cseg200:19DA
+ }
+ _currentPart = 22; // cseg200:19EA
+}
+
void IgorEngine::PART_01_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_01_EXEC_ACTION %d", action);
switch (action) {
@@ -125,9 +201,14 @@ void IgorEngine::PART_01() {
_walkDataCurrentIndex = 1;
PART_01_CLOSE_WINDOW();
} else {
- // TODO: transcribe state 11 and 12 transition cutscenes from
- // cseg200:1950-1AB0 before enabling their state changes to 22/23.
- warning("PART_01 state %d entrance is not yet transcribed", _currentPart);
+ if (_currentPart == 11) // cseg200:1950-195A
+ PART_01_STATE_11();
+ // TODO: transcribe the state 12 cutscene, cseg200:19FD-1AB0.
+ // It exits to 0x17 (23) at cseg200:1AD8 and ends in state 0x6C
+ // (108) at cseg200:1ADA. Its body repeats the same s3:0xE15E ->
+ // s3:0xE45E palette copy as state 11 (cseg200:19FD-1A0A).
+ else if (_currentPart == 12) // cseg200:19F3
+ warning("PART_01 state %d entrance is not yet transcribed", _currentPart);
}
}
diff --git a/engines/igor/part_2.cpp b/engines/igor/part_2.cpp
index fd711cc643a..7c7b5941df2 100644
--- a/engines/igor/part_2.cpp
+++ b/engines/igor/part_2.cpp
@@ -16,93 +16,257 @@ void IgorEngine::PART_02_START_DIALOGUE(int text, int count, int sound) {
startIgorDialogue();
}
+void IgorEngine::PART_02_SEARCH_TRUNK() {
+ for (int frame = 0; frame <= 2; ++frame) { // cseg203:04E8-0653
+ PART_00_ANIMATE_RAW(0x3C0 + frame * 0x715, 0, 0, 0x715,
+ 37, 49, 0x608C, 0, -1, 0); // cseg203:0509-0637
+ if (frame > 0)
+ waitForTimer(127); // cseg203:0639-064A
+ }
+}
+
void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
- if (num == 1 || num == 255)
- _roomActionsTable[252] = _objectsState[16] == 0 ? 6 : 4; // cseg203:22CF-2303; s3:084C
- if ((num == 2 || num == 255) && _objectsState[17] == 1) { // cseg203:2310-231C; s3:084D
- _roomObjectAreasTable[17].object = 4; // s3:DCAC; (DCAC-DC56)/5 = 17, field 1
- _roomObjectAreasTable[19].object = 4; // s3:DCB6; (DCB6-DC56)/5 = 19, field 1
+ if (num == 1 || num == 255) {
+ // s3:0x084C maps to _objectsState[16]. cseg203:22CF-2303
+ // redraws the closed/open trunk into the persistent room background.
+ const int srcOffset = _objectsState[16] == 0 ? 0x2E3E : 0x30FC;
+ for (int y = 0; y < 18; ++y) // cseg203:00EF-018E
+ memcpy(_screenLayer1 + 0x748A + y * 320,
+ _animFramesBuffer + srcOffset + y * 39, 39);
+ _roomActionsTable[252] = _objectsState[16] == 0 ? 6 : 4; // cseg203:22DB-2303
+ }
+ if ((num == 2 || num == 255) && _objectsState[17] == 1) {
+ _roomObjectAreasTable[17].object = 4; // s3:0xDCAC; cseg203:2317
+ _roomObjectAreasTable[19].object = 4; // s3:0xDCB6; cseg203:231C
+ }
+ if (num == 3 || num == 255) {
+ if (_objectsState[18] == 1) { // s3:0x084E; cseg203:232D-2340
+ for (int y = 0; y < 50; ++y) // cseg203:0002-004D
+ memcpy(_screenLayer1 + 0x50D6 + y * 320,
+ _animFramesBuffer + y * 14, 14);
+ }
+ _roomObjectAreasTable[9].object = _objectsState[18] == 0 ? 0 : 6; // s3:0xDC84
}
- if (num == 3 || num == 255)
- _roomObjectAreasTable[9].object = _objectsState[18] == 0 ? 0 : 6; // cseg203:232D-2340; s3:084E/DC84
if (num == 4 || num == 255) {
- if (_objectsState[19] == 0) // cseg203:2351-2372; s3:084F
- _roomObjectAreasTable[12].object = _objectsState[18] == 1 ? 6 : 0; // s3:DC93
- else
- _roomObjectAreasTable[12].object = 7; // s3:DC93
+ if (_objectsState[19] == 0) { // s3:0x084F; cseg203:2351-2372
+ _roomObjectAreasTable[12].object = _objectsState[18] == 1 ? 6 : 0; // s3:0xDC93
+ } else {
+ for (int y = 0; y < 22; ++y) // cseg203:004E-009D
+ memcpy(_screenLayer1 + 0x5357 + y * 320,
+ _animFramesBuffer + 0x2BC + y * 10, 10);
+ _roomObjectAreasTable[12].object = 7; // s3:0xDC93
+ }
}
if (num == 5 || num == 255) {
- if (_objectsState[20] == 0) { // cseg203:2383-23AE; s3:0850
- _roomObjectAreasTable[13].object = _objectsState[19] == 1 ? 7 : (_objectsState[18] == 1 ? 6 : 0); // s3:DC98
+ if (_objectsState[20] == 0) {
+ _roomObjectAreasTable[13].object = _objectsState[19] == 1 ? 7 : (_objectsState[18] == 1 ? 6 : 0);
} else {
- _roomObjectAreasTable[13].object = 8; // s3:DC98
+ for (int y = 0; y < 10; ++y) // cseg203:009E-00EE
+ memcpy(_screenLayer1 + 0x599B + y * 320,
+ _animFramesBuffer + 0x398 + y * 4, 4);
+ _roomObjectAreasTable[13].object = 8; // s3:0xDC98; cseg203:23A9-23AE
}
}
if (num == 6 || num == 255) {
- if (_objectsState[21] == 0) // cseg203:23B3-23E5; s3:0851
- _roomObjectAreasTable[14].object = _objectsState[20] == 1 ? 8 : (_objectsState[19] == 1 ? 7 : (_objectsState[18] == 1 ? 6 : 0)); // s3:DC9D
+ if (_objectsState[21] == 0)
+ _roomObjectAreasTable[14].object = _objectsState[20] == 1 ? 8 : (_objectsState[19] == 1 ? 7 : (_objectsState[18] == 1 ? 6 : 0));
}
if ((num == 8 || num == 255) && _objectsState[23] == 1)
- _roomObjectAreasTable[13].object = 8; // cseg203:23EA-23FD; s3:0853/DC98
+ _roomObjectAreasTable[13].object = 8;
}
void IgorEngine::PART_02_EXEC_ACTION(int action) {
- // Action-to-function mapping: cseg203:1FD9-22AE.
debugC(9, kDebugGame, "PART_02_EXEC_ACTION %d", action);
switch (action) {
- case 105:
- PART_02_START_DIALOGUE(209, 1, 115); // cseg203:1E87-1EB2
- _objectsState[22] = 1; // s3:0852; cseg203:1EB2
+ case 101: // open trunk; cseg203:018F-0337
+ if (_objectsState[16] == 1) { // s3:0x084C; cseg203:019D-01A8
+ PART_02_START_DIALOGUE(201, 1, 108); // indirect s3:0x5964
+ break;
+ }
+ PART_00_ANIMATE_RAW(0x18FF, 1, 2, 0x715, 37, 49, 0x608C,
+ 127, 1, 7); // cseg203:01AB-0327
+ _objectsState[16] = 1; // s3:0x084C; cseg203:032A
+ PART_02_APPLY_OBJECT_STATE(1); // cseg203:032F-0331
+ break;
+ case 102: // close trunk; cseg203:0338-04D9
+ if (_objectsState[16] == 0) { // s3:0x084C; cseg203:0346-0351
+ PART_02_START_DIALOGUE(201, 1, 108); // indirect s3:0x5970
+ break;
+ }
+ playSound(8, 1); // cseg203:0354-0358
+ PART_00_ANIMATE_RAW(0x18FF, 1, 0, 0x715, 37, 49, 0x608C,
+ 127, -1, 0); // cseg203:035D-04C9
+ _objectsState[16] = 0; // s3:0x084C; cseg203:04CC
+ PART_02_APPLY_OBJECT_STATE(1); // cseg203:04D1-04D3
+ break;
+ case 103: { // hammer the nail; cseg203:0658-0837
+ // The selector bytes at dseg231:0x0234-0x0248 alternate frames
+ // 0/1 and finish on frame 2 (indexed from s3:0x0233).
+ for (int step = 1; step <= 21; ++step) { // cseg203:0666-07FA
+ const int frame = step == 21 ? 2 : ((step + 1) & 1);
+ PART_00_ANIMATE_RAW(0x33BA + frame * 0x4B0, 0, 0, 0x4B0,
+ 24, 50, 0x5989, 0, -1, 0); // cseg203:0688-07BE
+ if ((step & 1) != 0 && step < 21)
+ playSound(9, 1); // cseg203:07C0-07E2
+ waitForTimer(63); // cseg203:07E7-07F1
+ }
+ _objectsState[20] = 1; // s3:0x0850; cseg203:07FD
+ _objectsState[21] = 0; // s3:0x0851; cseg203:0802
+ PART_02_APPLY_OBJECT_STATE(5); // cseg203:0807-0809
+ PART_02_APPLY_OBJECT_STATE(6); // cseg203:080E-0810
+ PART_02_START_DIALOGUE(217, 1, 121); // cseg203:0815-0831
+ break;
+ }
+ case 104: { // use the pick on the crack; cseg203:0838-0A2C
+ if (_objectsState[23] == 1) { // s3:0x0853; cseg203:0846-0851
+ EXEC_MAIN_ACTION(2); // s3:0x5944 = cseg222:2A76
+ break;
+ }
+ // The selector bytes at dseg231:0x024A-0x025E alternate frames
+ // 0/1 and finish on frame 2 (indexed from s3:0x0249).
+ for (int step = 1; step <= 21; ++step) { // cseg203:0854-09E8
+ const int frame = step == 21 ? 2 : ((step + 1) & 1);
+ PART_00_ANIMATE_RAW(0x41CA + frame * 0x658, 0, 0, 0x658,
+ 29, 56, 0x5349, 0, -1, 0); // cseg203:0876-09AC
+ if ((step & 1) != 0 && step < 21)
+ playSound(10, 1); // cseg203:09AE-09D0
+ waitForTimer(63); // cseg203:09D5-09DF
+ }
+ _objectsState[19] = 1; // s3:0x084F; cseg203:09EB
+ _objectsState[20] = 0; // s3:0x0850; cseg203:09F0
+ PART_02_APPLY_OBJECT_STATE(4); // cseg203:09F5-09F7
+ PART_02_APPLY_OBJECT_STATE(5); // cseg203:09FC-09FE
+ PART_02_APPLY_OBJECT_STATE(6); // cseg203:0A03-0A05
+ PART_02_START_DIALOGUE(218, 1, 122); // cseg203:0A0A-0A26
break;
- case 108:
- PART_02_START_DIALOGUE(210, 1, 116); // cseg203:1EB9-1EE4
+ }
+ case 105: // look at nail
+ PART_02_START_DIALOGUE(209, 1, 115);
+ _objectsState[22] = 1;
break;
- case 109:
- ADD_DIALOGUE_TEXT(225, 4, 128); // cseg203:1EE6-1F1E
- ADD_DIALOGUE_TEXT(229, 1, 129); // cseg203:1F02-1F0E
+ case 106: // look in trunk; cseg203:0A87-0D70
+ if (_objectsState[16] == 0) { // s3:0x084C; cseg203:0A91-0AB9
+ PART_02_START_DIALOGUE(201, 1, 108);
+ break;
+ }
+ if (_inventoryInfo[44] == 0 && _inventoryInfo[45] == 0) { // s3:0x0906/0907
+ if (_objectsState[22] == 0) { // s3:0x0852; cseg203:0AD0-0B0A
+ PART_02_START_DIALOGUE(202, 2, 109);
+ } else {
+ PART_02_SEARCH_TRUNK(); // cseg203:04DA-0657
+ PART_02_START_DIALOGUE(204, 1, 111); // cseg203:0B14-0B30
+ addObjectToInventory(9, 44); // s3:0x0906; cseg203:0B35-0B6F
+ PART_02_APPLY_OBJECT_STATE(255); // cseg203:0B74-0B7B
+ }
+ break;
+ }
+ if (_inventoryInfo[44] != 0 && _inventoryInfo[45] == 0) { // cseg203:0B83-0C71
+ if (_objectsState[20] == 0) { // s3:0x0850
+ PART_02_START_DIALOGUE(202, 2, 109);
+ } else {
+ PART_02_SEARCH_TRUNK(); // cseg203:0BD7
+ PART_02_START_DIALOGUE(205, 1, 112); // cseg203:0BDC-0BF8
+ removeObjectFromInventory(44); // s3:0x0906; cseg203:0BFD-0C17
+ playSound(63, 1); // cseg203:0C13-0C17
+ addObjectToInventory(10, 45); // s3:0x0907; cseg203:0C1C-0C60
+ PART_02_APPLY_OBJECT_STATE(255); // cseg203:0C65-0C6C
+ }
+ break;
+ }
+ if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 &&
+ _inventoryInfo[46] == 0 && _objectsState[23] == 0 &&
+ _objectsState[19] != 0) { // cseg203:0C74-0CD9; s3:0x0908/0853/084F
+ PART_02_SEARCH_TRUNK(); // cseg203:0CDB
+ PART_02_START_DIALOGUE(206, 1, 113); // cseg203:0CE0-0CFC
+ addObjectToInventory(11, 46); // s3:0x0908; cseg203:0D01-0D3B
+ PART_02_APPLY_OBJECT_STATE(255); // cseg203:0D40-0D47
+ } else if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 &&
+ _inventoryInfo[46] == 0 && _objectsState[23] == 0) {
+ PART_02_START_DIALOGUE(202, 2, 109); // cseg203:0CA3-0CD6
+ } else {
+ PART_02_START_DIALOGUE(207, 2, 114); // cseg203:0D4E-0D6A
+ }
+ break;
+ case 107: // take butterfly net; cseg203:0D71-0F3E
+ PART_00_ANIMATE_RAW(0x54D2, 0, 1, 0x405, 21, 49, 0x5A6D,
+ 127, -1, 0); // cseg203:0D7F-0EE3
+ waitForTimer(127); // cseg203:0ED0-0EDA
+ addObjectToInventory(7, 42); // s3:0x0904; cseg203:0EE6-0F20
+ _objectsState[17] = 1; // s3:0x084D; cseg203:0F31
+ PART_02_APPLY_OBJECT_STATE(2); // cseg203:0F36-0F38
+ break;
+ case 108: // Look at old junk
+ PART_02_START_DIALOGUE(210, 1, 116);
+ break;
+ case 109: // look at portrait
+ ADD_DIALOGUE_TEXT(225, 4, 128);
+ ADD_DIALOGUE_TEXT(229, 1, 129);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
break;
- case 110:
- PART_02_START_DIALOGUE(213, 1, 118); // cseg203:1F25-1F50
+ case 110: // look at hole
+ PART_02_START_DIALOGUE(213, 1, 118);
break;
case 111:
- PART_02_START_DIALOGUE(214, 2, 119); // cseg203:1F52-1F7D
+ PART_02_START_DIALOGUE(214, 2, 119);
break;
case 112:
- PART_02_START_DIALOGUE(216, 1, 120); // cseg203:1F7F-1FAA
+ PART_02_START_DIALOGUE(216, 1, 120);
+ break;
+ case 113: // place dynamite in the crack; cseg203:0FEB-11C1
+ PART_00_ANIMATE_RAW(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989,
+ 127, -1, 0); // cseg203:0FF9-115D
+ waitForTimer(127); // cseg203:114A-1154
+ _objectsState[23] = 1; // s3:0x0853; cseg203:1160
+ PART_02_APPLY_OBJECT_STATE(8); // cseg203:1165-1167
+ removeObjectFromInventory(46); // s3:0x0908; cseg203:116C-11A6
+ playSound(63, 1); // cseg203:11AB-11AF
+ PART_02_APPLY_OBJECT_STATE(255); // cseg203:11B4-11BB
break;
case 114:
- PART_02_START_DIALOGUE(219, 1, 123); // cseg203:1FAC-1FD7
+ PART_02_START_DIALOGUE(219, 1, 123);
break;
case 115:
- PART_02_START_DIALOGUE(217, 1, 121); // cseg203:0A2D-0A58
+ PART_02_START_DIALOGUE(217, 1, 121);
break;
case 116:
- PART_02_START_DIALOGUE(218, 1, 122); // cseg203:0A5A-0A85
+ PART_02_START_DIALOGUE(218, 1, 122);
break;
- case 118:
+ case 118: // exit through window
if (_objectsState[24] == 1) { // s3:0854; cseg203:1989-19AC
PART_02_START_DIALOGUE(220, 1, 124);
} else {
- _objectsState[24] = 1; // cseg203:19B3
- _currentPart = 11; // cseg203:19B8
+ _objectsState[24] = 1;
+ _currentPart = 11;
}
break;
case 119:
- // TODO: transcribe the exit animation from cseg203:1CF8-1E74.
- // It ends in state 1 at cseg203:1E6D; do not skip observable behavior.
- warning("PART_02_EXEC_ACTION action 119 is not yet transcribed");
+ PART_00_ANIMATE_RAW(0xB488, 0, 1, 0x4B0, 24, 50, 0x5988,
+ 64, -1, 0); // cseg203:1CF8-1E68
+ waitForTimer(64); // cseg203:1E57-1E61
+ _currentPart = 1; // cseg203:1E6D
break;
case 120:
- _currentPart = 30; // cseg203:1E75-1E85
+ _currentPart = 30;
break;
- case 101: case 102: case 103: case 104: case 106: case 107:
- case 113: case 117: case 121:
- // TODO: transcribe the corresponding function selected by
- // cseg203:1FD9-22AE. Keeping these actions disabled avoids inventing
- // animation/state behavior.
- warning("PART_02_EXEC_ACTION action %d is not yet transcribed", action);
+ case 121: // look at shelf / take matches; cseg203:0F3F-0FEA
+ if (_objectsState[25] == 1) { // s3:0x0855; cseg203:0F49
+ PART_02_START_DIALOGUE(230, 1, 130);
+ } else {
+ PART_02_START_DIALOGUE(211, 2, 117); // cseg203:0F73-0F8F
+ addObjectToInventory(8, 43); // s3:0x0905; cseg203:0F94-0FD3
+ _objectsState[25] = 1; // s3:0x0855; cseg203:0FE4
+ }
+ break;
+ case 117: // light the dynamite; cseg203:1447-197E
+ if (_objectsState[23] == 0) { // s3:0x0853; cseg203:1455-1460
+ EXEC_MAIN_ACTION(2); // s3:0x5944 = cseg222:2A76
+ } else {
+ // TODO: transcribe the explosion sequence from cseg203:1463-197E.
+ // Keeping it disabled avoids inventing its scrolling, palette, and
+ // state-12 handoff behavior.
+ warning("PART_02_EXEC_ACTION action 117 explosion is not yet transcribed");
+ }
break;
default:
warning("PART_02_EXEC_ACTION unhandled action %d", action);
@@ -111,11 +275,11 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
void IgorEngine::PART_02() {
- _gameState.enableLight = 1; // cseg203:41D0
- loadActionData(DAT_StudentDormitoryAttic); // cseg203:41ED-4204
+ _gameState.enableLight = 1;
+ loadActionData(DAT_StudentDormitoryAttic);
loadRoomData(PAL_StudentDormitoryAttic, IMG_StudentDormitoryAttic,
BOX_StudentDormitoryAttic, MSK_StudentDormitoryAttic,
- TXT_StudentDormitoryAttic); // cseg205:0002
+ TXT_StudentDormitoryAttic);
static const int animFrames[] = {
ANM_StudentDormitoryAttic1, ANM_StudentDormitoryAttic2,
ANM_StudentDormitoryAttic3, ANM_StudentDormitoryAttic4,
@@ -139,39 +303,52 @@ void IgorEngine::PART_02() {
switch (_currentPart) {
case 20:
fadeIn(768); // cseg203:45AB-45AE
- _walkData[0].setPos(57, 117, kFacingPositionRight, 0); // cseg203:45C9-45DA
+ // Igor climbs through the window on the first attic entrance. Three
+ // 33x57 frames at animation offset 0x69C0 are drawn at 0x4B26.
+ PART_00_ANIMATE_RAW(0x69C0, 0, 2, 0x759, 33, 57, 0x4B26,
+ 31, -1, 0); // cseg203:11C2-1338; called at cseg203:45C4
+ waitForTimer(31); // cseg203:1321-132B
+ _walkData[0].setPos(57, 117, kFacingPositionRight, 0);
break;
case 21:
- fadeIn(768); // cseg203:463F-4642
- _walkData[0].setPos(300, 136, kFacingPositionLeft, 0); // cseg203:4647-4658
+ fadeIn(768);
+ _walkData[0].setPos(300, 136, kFacingPositionLeft, 0);
break;
case 22:
+ // cseg203:4319-4332 restores the live palette from the saved one
+ // before the walk setup below, the same copy state 11 performs at
+ // cseg200:1964. Without it the part-1 fadeOut leaves the attic black.
+ memcpy(_currentPalette, _paletteBuffer, 768); // cseg203:4320-432D
+ // cseg221:0x21DA is setPalette(), as identified by the original-runtime
+ // trap table in reference/cyxx/igor/game.cpp; cseg203:4332.
+ updatePalette(768);
_walkData[0].setPos(49, 118, kFacingPositionBack, 0); // cseg203:4337-4348
break;
case 23:
- _walkData[0].setPos(215, 134, kFacingPositionRight, 0); // cseg203:4437-445E
+ _walkData[0].setPos(215, 134, kFacingPositionRight, 0);
break;
case 24:
- _walkData[0].setPos(211, 120, kFacingPositionFront, 0); // cseg203:450E-451F
- fadeIn(768); // cseg203:455C-455F
+ _walkData[0].setPos(211, 120, kFacingPositionFront, 0);
+ fadeIn(768);
break;
}
- _walkData[0].clipSkipX = 1; // cseg203:4524,45DF,465D
- _walkData[0].clipWidth = 30; // cseg203:4529,45E4,4662
- _walkData[0].scaleWidth = 50; // cseg203:452F,45EA,4668
- _walkData[0].xPosChanged = 1; // cseg203:4535,45F0,466E
- _walkData[0].dxPos = 0; // cseg203:453A-453C,45F5-45F7,4673-4675
- _walkData[0].yPosChanged = 1; // cseg203:453F,45FA,4678
- _walkData[0].dyPos = 0; // cseg203:4544-4546,45FF-4601,467D-467F
- _walkData[0].scaleHeight = 50; // cseg203:4549,4604,4682
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 30;
+ _walkData[0].scaleWidth = 50;
+ _walkData[0].xPosChanged = 1;
+ _walkData[0].dxPos = 0;
+ _walkData[0].yPosChanged = 1;
+ _walkData[0].dyPos = 0;
+ _walkData[0].scaleHeight = 50;
_walkDataCurrentIndex = 0;
moveIgor(_walkData[0].posNum, _walkData[0].frameNum);
- _walkDataLastIndex = 1; // cseg203:4575,4609,4698
- _walkDataCurrentIndex = 1; // cseg203:457A,460E,469D
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
if (_currentPart == 22)
PART_02_EXEC_ACTION(118); // cseg203:438B
- // TODO: transcribe state-specific entrance animations from
- // cseg203:42F8-46B0. Positions above are their exact final walk state.
+ // cseg222:0x2264 is showCursor() according to the original-runtime
+ // trap table in reference/cyxx/igor/game.cpp. enterPartLoop() below
+ // performs the equivalent shared-engine operation.
}
enterPartLoop();
Commit: 902e0fb56cc0bcdedde5ff8339bf77b11da887ce
https://github.com/scummvm/scummvm/commit/902e0fb56cc0bcdedde5ff8339bf77b11da887ce
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:10+01:00
Commit Message:
IGOR: Fixes cutscene with pigeons in room 1
Changed paths:
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_1.cpp
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index d8ac425873c..869ea3514e0 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -490,10 +490,10 @@ private:
void PART_01();
void PART_01_EXEC_ACTION(int action);
void PART_01_CLOSE_WINDOW();
- void PART_01_STATE_11_BLIT_0053();
+ void PART_01_STATE_11_BLIT_blitIgor();
void PART_01_STATE_11_BLIT_00A5();
- void PART_01_STATE_11_BLIT_0153(int frame);
- void PART_01_STATE_11_DRAW_01B8(int index);
+ void PART_01_STATE_11_BLIT_drawIgorsEyes(int frame);
+ void PART_01_STATE_11_DRAW_drawPigeons(int index);
void PART_01_STATE_11();
void PART_02();
void PART_02_EXEC_ACTION(int action);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index dcd04b906cc..e018f12b87e 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -84,23 +84,29 @@ void IgorEngine::waitForTimer(int ticks) {
}
break;
case Common::EVENT_LBUTTONDOWN:
- _inputVars[kInputClick] = 1;
_inputVars[kInputCursorXPos] = ev.mouse.x;
_inputVars[kInputCursorYPos] = ev.mouse.y;
if (_gameState.dialogueTextRunning) {
+ // Dialogue dismissal and room clicks are separate DOS flags;
+ // consuming this event here prevents it reaching the room loop.
+ _inputVars[kInputClick] = 0;
_inputVars[kInputSkipDialogue] = 1;
+ } else {
+ _inputVars[kInputClick] = 1;
}
break;
default:
break;
}
}
- // Keep the poll granularity proportional, otherwise a 10 ms sleep
- // overshoots the shortened deadline at high factors.
- _system->delayMillis(MAX(1, 10 / _fastMode));
- if (_system->getMillis() >= endTicks) {
+ const uint32 now = _system->getMillis();
+ if (now >= endTicks) {
break;
}
+ // Do not overshoot short explicit DOS-timer waits. One DOS timer unit
+ // is 1000 / kTickDelay ms; if requested delay is smaller then respect that
+ const uint32 pollDelay = MAX(1, 10 / _fastMode);
+ _system->delayMillis(MIN<uint32>(pollDelay, endTicks - now));
} while (true);
_nextTimer = _system->getMillis() + kTimerTicksCount * 1000 / kTickDelay / _fastMode;
@@ -328,12 +334,8 @@ void IgorEngine::handleRoomInput() {
_actionCode = _roomActionsTable[_roomDataOffsets.action.defaultVerb + _currentAction.verb * 2 + _currentAction.object1Num * 20];
}
// The original only exposes a room object when this action byte is
- // non-zero; otherwise hover text is verb-only. cseg175:2C8B-2CBC;
- // cseg176:2CBC-2CED.
- if (((_currentPart >= 100 && _currentPart <= 102) || // cseg175:29AA-29B5
- _currentPart == 110) && // cseg176:29DF-29E6
- _actionCode == 0 &&
- _currentAction.object1Type == kObjectTypeRoom) {
+ // non-zero; otherwise hover text is verb-only.
+ if (((_currentPart >= 100 && _currentPart <= 102) || _currentPart == 110) && _actionCode == 0 && _currentAction.object1Type == kObjectTypeRoom) {
_currentAction.object1Num = 0;
}
}
diff --git a/engines/igor/part_1.cpp b/engines/igor/part_1.cpp
index 387c45ebe1b..5ce7d20a503 100644
--- a/engines/igor/part_1.cpp
+++ b/engines/igor/part_1.cpp
@@ -33,80 +33,65 @@ void IgorEngine::PART_01_CLOSE_WINDOW() {
waitForEndOfIgorDialogue();
}
-// sub_200_0053 (cseg200:0053-00A4): 13 rows of 16 bytes from the animation
-// buffer, source stride 16 (cseg200:0074-007D), to the screen with stride 320
-// (cseg200:0087-008D), 16 bytes per row (cseg200:0095). s3:0xEB20 is the loop
-// counter and runs until 0x0C (cseg200:0068-006D, 009C).
-void IgorEngine::PART_01_STATE_11_BLIT_0053() {
+void IgorEngine::PART_01_STATE_11_BLIT_blitIgor() {
for (int i = 0; i < 13; ++i)
memcpy(_screenVGA + 0x5476 + i * 320, _animFramesBuffer + 0x1859 + i * 16, 16);
}
-// sub_200_00A5 (cseg200:00A5-00F7): 40 rows of 218 bytes, source stride 0xDA
-// (cseg200:00C3), to the screen with stride 320 (cseg200:00D9-00DF), 0xDA bytes
-// per row (cseg200:00E7). Loop counter s3:0xEB20 until 0x27 (cseg200:00BF, 00EF).
void IgorEngine::PART_01_STATE_11_BLIT_00A5() {
for (int i = 0; i < 40; ++i)
memcpy(_screenVGA + 0x118F + i * 320, _animFramesBuffer + 0xA7F9 + i * 0xDA, 0xDA);
}
-// sub_200_0153 (cseg200:0153-01B5): one of five 5x4 pigeon frames. The frame
-// parameter is multiplied by 0x14 at cseg200:017E-018C; each row is five bytes
-// (cseg200:0171-017C), and the destination stride is 320 (cseg200:0198-01A6).
-void IgorEngine::PART_01_STATE_11_BLIT_0153(int frame) {
+//
+void IgorEngine::PART_01_STATE_11_BLIT_drawIgorsEyes(int frame) {
for (int i = 0; i < 4; ++i)
memcpy(_screenVGA + 0x55BB + i * 320,
_animFramesBuffer + 0xA7A9 + frame * 20 + i * 5, 5);
}
-// sub_200_01B8 (cseg200:01B8-01F3): a single 0x2F80-byte copy from
-// _animFramesBuffer + 0x1929 + 0x2F80*index (cseg200:01CB-01DA) to
-// _screenVGA + 0x6F40 (cseg200:01C6, 01E4), 0x2F80 bytes per call
-// (cseg200:01EA).
-void IgorEngine::PART_01_STATE_11_DRAW_01B8(int index) {
+//
+void IgorEngine::PART_01_STATE_11_DRAW_drawPigeons(int index) {
memcpy(_screenVGA + 0x6F40, _animFramesBuffer + 0x1929 + index * 0x2F80, 0x2F80);
}
-// State 11: the window-exit cutscene, cseg200:195A-19F0. It blits two regions,
+// 11: the window-pigeons cutscene It blits two regions,
// restores the current palette from the saved one, then runs a 1000-tick
// animation loop before handing over to state 22.
void IgorEngine::PART_01_STATE_11() {
- PART_01_STATE_11_BLIT_0053(); // cseg200:195A
- PART_01_STATE_11_BLIT_00A5(); // cseg200:195F
+ PART_01_STATE_11_BLIT_blitIgor();
+ PART_01_STATE_11_BLIT_00A5();
- // cseg200:1964-1971 copies 768 bytes with s3:0xE15E pushed first and
- // s3:0xE45E second, so s3:0xE15E is the source. The inverse pair at
- // cseg209:0425-0432 and cseg209:064E-065B pins s3:0xE15E to
- // _paletteBuffer and s3:0xE45E to _currentPalette.
memcpy(_currentPalette, _paletteBuffer, 768);
-
- // cseg221:0x21DA is setPalette(), as identified by the original-runtime
- // trap table in reference/cyxx/igor/game.cpp and called at cseg200:1976.
updatePalette(768);
- // s3:0xEACA is a 0..63 DOS-timer counter and s3:0xEB26 counts 1000
- // iterations (cseg200:197B-1986,19CC-19E8). The EAC8/EAC9 spin at
- // cseg200:19BD-19C9 waits for one DOS timer unit after every iteration.
- uint8 eaca = 0;
- for (int eb26 = 0; eb26 < 1000; ++eb26) { // cseg200:197B-197D, 19DE-19E8
- if (eaca == 0x3D) { // cseg200:198B
- // DOS random(4) returns 0..3; the C++ helper's bound is inclusive.
- PART_01_STATE_11_BLIT_0153(getRandomNumber(3)); // cseg200:1992-199A
+ uint8 dosTimerPhase = 0;
+ int pendingTicks = 0;
+ // for 1000 ticks
+ for (int k = 0; k < 1000; ++k) {
+ const bool drawIgorsEyes = dosTimerPhase == 0x3D;
+ const bool drawPigeons = ((dosTimerPhase + 1) % 0x20) == 0;
+ if ((drawIgorsEyes || drawPigeons) && pendingTicks != 0) {
+ waitForTimer(pendingTicks);
+ pendingTicks = 0;
+ }
+ if (drawIgorsEyes) {
+ PART_01_STATE_11_BLIT_drawIgorsEyes(getRandomNumber(3)); // cseg200:1992-199A
}
- if (((eaca + 1) % 0x20) == 0) { // cseg200:199F-19B8
- // DOS random(3) returns 0..2. ANM_OutsideStudentDormitory6 is
- // exactly three 0x2F80-byte frames (0x8E80 bytes).
- PART_01_STATE_11_DRAW_01B8(getRandomNumber(2));
+ if (drawPigeons) {
+ PART_01_STATE_11_DRAW_drawPigeons(getRandomNumber(2));
}
- waitForTimer(); // cseg200:19BD-19C9: one DOS timer unit
+ ++pendingTicks;
- if (eaca == 0x3F) // cseg200:19CC-19D8
- eaca = 0;
+ if (dosTimerPhase == 0x3F)
+ dosTimerPhase = 0;
else
- ++eaca; // cseg200:19DA
+ ++dosTimerPhase;
}
- _currentPart = 22; // cseg200:19EA
+ if (pendingTicks != 0)
+ waitForTimer(pendingTicks);
+ _currentPart = 22;
}
void IgorEngine::PART_01_EXEC_ACTION(int action) {
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index dac815ac85d..9d7207a7c94 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -40,7 +40,9 @@ const RoomDataOffsets IgorEngine::PART_01_ROOM_DATA_OFFSETS = {
const RoomDataOffsets IgorEngine::PART_02_ROOM_DATA_OFFSETS = {
{ 125, 5, 20, 4 }, // cseg203:323B-324D; five-area transition table
{ 259, 280 }, // cseg203:385E-3884,39F9
- { 289, 473, 4193, 565, 549, 96 }, // cseg203:49B1-4AF9
+ // use matrix 565: cseg203:4A89; object2 map 473: cseg203:4A43;
+ // object1 map 549: cseg203:4A6D; row size 0x60: cseg203:4A74.
+ { 289, 565, 4193, 473, 549, 96 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 } // cseg203 has no room-specific dialogue matrix
};
Commit: 5c60edd6594196009f1f9bf868832bd1a1f81416
https://github.com/scummvm/scummvm/commit/5c60edd6594196009f1f9bf868832bd1a1f81416
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:10+01:00
Commit Message:
IGOR: Fix inventory slots being orphaned
Changed paths:
engines/igor/igor.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 1b2d6007910..ebbd7a7ce07 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -66,7 +66,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- _currentPart = 20;
+ _currentPart = 850;
// _currentPart = 171;
// _currentPart = 62;
@@ -402,7 +402,7 @@ void IgorEngine::drawInventory(int start, int mode) {
loadData(IMG_InventoryPanel, _inventoryPanelBuffer);
loadData(IMG_Objects, _inventoryImagesBuffer);
int y, i;
- int end = start + 6;
+ int end = start + 7; // seven slots
int x = 1;
// Paint inventory icons
for (y = start; y != end; ++y) {
@@ -542,15 +542,16 @@ int IgorEngine::getObjectFromInventory(int x) const {
void IgorEngine::packInventory() {
for (int i = 1; i <= _inventoryInfo[73]; ++i) {
- if (_inventoryImages[i - 1] != 0) {
+
+ if (_inventoryInfo[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;
+ _inventoryInfo[index - 1] = _inventoryInfo[index];
+ _inventoryInfo[_inventoryInfo[index - 1] + ARRAYSIZE(_inventoryImages) - 1] = index;
}
- _inventoryImages[_inventoryInfo[73] - 1] = 0;
+ _inventoryInfo[_inventoryInfo[73] - 1] = 0;
--_inventoryInfo[73];
}
}
Commit: 9e3348ddc629618ad0a5f8b3d5f64f859441f89c
https://github.com/scummvm/scummvm/commit/9e3348ddc629618ad0a5f8b3d5f64f859441f89c
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:10+01:00
Commit Message:
IGOR: Fix issue where two speech lines could overlap and crash the game
Changed paths:
engines/igor/text.cpp
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 8f4c6dba2b9..6608ce85856 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -101,11 +101,13 @@ void IgorEngine::ADD_DIALOGUE_TEXT(int num, int count, int sound) {
* start page of dialogues, count of dialogue screens
*/
void IgorEngine::SET_DIALOGUE_TEXT(int start, int count) {
- // The original writes each new batch directly from slot 0 before setting the
- // independent playback range at 0x31D4/0x31D5. See cseg209:0x0EE0-0x0F09.
_dialogueTextsBuildCount = 0;
_dialogueTextsStart = start - 1;
_dialogueTextsCount = count;
+ // _talkSpeechCounter is the engine-side state used only by the blocking
+ // dialogue loops to pause between pages. A skipped previous dialogue can
+ // leave it at -1
+ _talkSpeechCounter = 3;
}
/**
@@ -147,10 +149,22 @@ void IgorEngine::fixDialogueTextPosition(int num, int count, int *x, int *y) {
*/
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);
+ if (_dialogueTextsCount <= 0 || _dialogueTextsStart < 0 || _dialogueTextsStart >= MAX_DIALOGUE_TEXTS) {
+ warning("startCutsceneDialogue() invalid playback range start %d count %d", _dialogueTextsStart, _dialogueTextsCount);
+ stopDialogueSpeech();
+ _gameState.dialogueTextRunning = false;
+ return;
+ }
--_dialogueTextsCount;
int talkX = x;
int talkY = y;
const DialogueText *dt = &_dialogueTextsTable[_dialogueTextsStart];
+ if (dt->count <= 0 || dt->num < 0 || dt->num + dt->count > ARRAYSIZE(_globalDialogueTexts)) {
+ warning("startCutsceneDialogue() invalid text record num %d count %d", dt->num, dt->count);
+ stopDialogueSpeech();
+ _gameState.dialogueTextRunning = false;
+ return;
+ }
fixDialogueTextPosition(dt->num, dt->count, &talkX, &talkY);
_dialogueDirtyRectY = talkY * 320;
_dialogueDirtyRectSize = dt->count * 11 * 320;
@@ -274,9 +288,21 @@ void IgorEngine::stopDialogueSpeech() {
void IgorEngine::startIgorDialogue() {
debugC(9, kDebugEngine, "startIgorDialogue()");
+ if (_dialogueTextsCount <= 0 || _dialogueTextsStart < 0 || _dialogueTextsStart >= MAX_DIALOGUE_TEXTS) {
+ warning("startIgorDialogue() invalid playback range start %d count %d", _dialogueTextsStart, _dialogueTextsCount);
+ stopDialogueSpeech();
+ _gameState.dialogueTextRunning = false;
+ return;
+ }
--_dialogueTextsCount;
int talkX, talkY;
const DialogueText *dt = &_dialogueTextsTable[_dialogueTextsStart];
+ if (dt->count <= 0 || dt->num < 0 || dt->num + dt->count > ARRAYSIZE(_globalDialogueTexts)) {
+ warning("startIgorDialogue() invalid text record num %d count %d", dt->num, dt->count);
+ stopDialogueSpeech();
+ _gameState.dialogueTextRunning = false;
+ return;
+ }
fixIgorDialogueTextPosition(dt->num, dt->count, &talkX, &talkY);
_dialogueDirtyRectY = talkY * 320;
_dialogueDirtyRectSize = dt->count * 11 * 320;
Commit: e671c833a3b0863c46700c1e3711563a30296111
https://github.com/scummvm/scummvm/commit/e671c833a3b0863c46700c1e3711563a30296111
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:11+01:00
Commit Message:
IGOR: Explosion cutscene
Changed paths:
engines/igor/igor.h
engines/igor/part_0.cpp
engines/igor/part_1.cpp
engines/igor/part_2.cpp
engines/igor/part_6.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 869ea3514e0..c2786db51e1 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -494,12 +494,16 @@ private:
void PART_01_STATE_11_BLIT_00A5();
void PART_01_STATE_11_BLIT_drawIgorsEyes(int frame);
void PART_01_STATE_11_DRAW_drawPigeons(int index);
- void PART_01_STATE_11();
+ void PART_01_STATE_11_pigeonsCutscene();
+ void PART_01_STATE_12_explosion();
void PART_02();
void PART_02_EXEC_ACTION(int action);
void PART_02_APPLY_OBJECT_STATE(int num);
void PART_02_START_DIALOGUE(int text, int count, int sound);
void PART_02_SEARCH_TRUNK();
+ void PART_02_DRAW_FUSE_SPARK(int frame);
+ void PART_02_UPDATE_FUSE();
+ void PART_02_WALK_WITH_FUSE(int srcX, int srcY, int dstX, int dstY);
// spring bridge
void PART_05_HELPER_4_drawPaperOrNot(int num);
diff --git a/engines/igor/part_0.cpp b/engines/igor/part_0.cpp
index 8f103a4901c..25e1071aa6f 100644
--- a/engines/igor/part_0.cpp
+++ b/engines/igor/part_0.cpp
@@ -311,11 +311,9 @@ void IgorEngine::PART_00_ENTER_FROM_BELOW() {
}
void IgorEngine::PART_00() {
- _gameState.enableLight = 1; // cseg206:3964
- loadActionData(DAT_StudentDormitoryRoom); // cseg206:3975-3998
- loadRoomData(PAL_StudentDormitoryRoom, IMG_StudentDormitoryRoom,
- BOX_StudentDormitoryRoom, MSK_StudentDormitoryRoom,
- TXT_StudentDormitoryRoom); // cseg208:0002
+ _gameState.enableLight = 1;
+ loadActionData(DAT_StudentDormitoryRoom);
+ loadRoomData(PAL_StudentDormitoryRoom, IMG_StudentDormitoryRoom, BOX_StudentDormitoryRoom, MSK_StudentDormitoryRoom, TXT_StudentDormitoryRoom);
static const int animFrames[] = {
ANM_StudentDormitoryRoom1, ANM_StudentDormitoryRoom2,
ANM_StudentDormitoryRoom3, ANM_StudentDormitoryRoom4,
@@ -324,14 +322,14 @@ void IgorEngine::PART_00() {
ANM_StudentDormitoryRoom9, ANM_StudentDormitoryRoom10,
ANM_StudentDormitoryRoom11, 0
};
- loadAnimData(animFrames); // cseg207:0002-0239
+ loadAnimData(animFrames);
_roomDataOffsets = PART_00_ROOM_DATA_OFFSETS;
// clamps clicks to x 41..253 and y <= 143; clicks past the
// horizontal edges also clamp to y >= 141/138
setRoomWalkBounds(41, 0, 253, 143, 141, 138);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_00_EXEC_ACTION);
PART_00_APPLY_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080); // cseg206:39B3-39C5
+ memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
diff --git a/engines/igor/part_1.cpp b/engines/igor/part_1.cpp
index 5ce7d20a503..ea147b0e1a0 100644
--- a/engines/igor/part_1.cpp
+++ b/engines/igor/part_1.cpp
@@ -58,7 +58,7 @@ void IgorEngine::PART_01_STATE_11_DRAW_drawPigeons(int index) {
// 11: the window-pigeons cutscene It blits two regions,
// restores the current palette from the saved one, then runs a 1000-tick
// animation loop before handing over to state 22.
-void IgorEngine::PART_01_STATE_11() {
+void IgorEngine::PART_01_STATE_11_pigeonsCutscene() {
PART_01_STATE_11_BLIT_blitIgor();
PART_01_STATE_11_BLIT_00A5();
@@ -76,7 +76,7 @@ void IgorEngine::PART_01_STATE_11() {
pendingTicks = 0;
}
if (drawIgorsEyes) {
- PART_01_STATE_11_BLIT_drawIgorsEyes(getRandomNumber(3)); // cseg200:1992-199A
+ PART_01_STATE_11_BLIT_drawIgorsEyes(getRandomNumber(3));
}
if (drawPigeons) {
PART_01_STATE_11_DRAW_drawPigeons(getRandomNumber(2));
@@ -94,6 +94,20 @@ void IgorEngine::PART_01_STATE_11() {
_currentPart = 22;
}
+void IgorEngine::PART_01_STATE_12_explosion() {
+ int shakeY = 0;
+ int elapsed = 0;
+ for (int nextShake = 15; nextShake < 500; nextShake += 16) {
+ waitForTimer(nextShake - elapsed);
+ elapsed = nextShake;
+ shakeY ^= 1;
+ _system->setShakePos(0, shakeY);
+ }
+ waitForTimer(500 - elapsed);
+ _system->setShakePos(0, 0);
+ waitForTimer(16);
+}
+
void IgorEngine::PART_01_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_01_EXEC_ACTION %d", action);
switch (action) {
@@ -103,7 +117,7 @@ void IgorEngine::PART_01_EXEC_ACTION(int action) {
startIgorDialogue();
break;
case 102:
- // draws two 24x41 roof-crossing frames at screen
+ // draws two 24x41 roof-crossing frames at screen
// waiting for the video update after each one, then
// changes to part 20.
for (int frame = 0; frame <= 1; ++frame) {
@@ -186,14 +200,15 @@ void IgorEngine::PART_01() {
_walkDataCurrentIndex = 1;
PART_01_CLOSE_WINDOW();
} else {
- if (_currentPart == 11) // cseg200:1950-195A
- PART_01_STATE_11();
- // TODO: transcribe the state 12 cutscene, cseg200:19FD-1AB0.
- // It exits to 0x17 (23) at cseg200:1AD8 and ends in state 0x6C
- // (108) at cseg200:1ADA. Its body repeats the same s3:0xE15E ->
- // s3:0xE45E palette copy as state 11 (cseg200:19FD-1A0A).
- else if (_currentPart == 12) // cseg200:19F3
- warning("PART_01 state %d entrance is not yet transcribed", _currentPart);
+ if (_currentPart == 11)
+ PART_01_STATE_11_pigeonsCutscene();
+ else if (_currentPart == 12) {
+ memcpy(_currentPalette, _paletteBuffer, 768);
+ updatePalette(768);
+ playSound(12, 1);
+ PART_01_STATE_12_explosion();
+ _currentPart = 23;
+ }
}
}
diff --git a/engines/igor/part_2.cpp b/engines/igor/part_2.cpp
index 7c7b5941df2..a1b1c6c3f6c 100644
--- a/engines/igor/part_2.cpp
+++ b/engines/igor/part_2.cpp
@@ -17,104 +17,144 @@ void IgorEngine::PART_02_START_DIALOGUE(int text, int count, int sound) {
}
void IgorEngine::PART_02_SEARCH_TRUNK() {
- for (int frame = 0; frame <= 2; ++frame) { // cseg203:04E8-0653
- PART_00_ANIMATE_RAW(0x3C0 + frame * 0x715, 0, 0, 0x715,
- 37, 49, 0x608C, 0, -1, 0); // cseg203:0509-0637
+ for (int frame = 0; frame <= 2; ++frame) {
+ PART_00_ANIMATE_RAW(0x3C0 + frame * 0x715, 0, 0, 0x715, 37, 49, 0x608C, 0, -1, 0);
if (frame > 0)
- waitForTimer(127); // cseg203:0639-064A
+ waitForTimer(127);
}
}
+void IgorEngine::PART_02_DRAW_FUSE_SPARK(int frame) {
+ // Four 12x12 spark frames are stored at animation offset 0x7FCB and are
+ // composited over the fuse at screen offset 0x5996. cseg203:1339-1443
+ const uint8 *src = _animFramesBuffer + 0x7FCB + frame * 0x90;
+ for (int y = 0; y < 12; ++y) {
+ for (int x = 0; x < 12; ++x) {
+ const int dstOffset = 0x5996 + y * 320 + x;
+ const uint8 color = src[y * 12 + x];
+ if (_screenVGA[dstOffset] >= 0xA0 && _screenVGA[dstOffset] <= 0xAF)
+ _screenVGA[dstOffset] = 0xA0;
+ else
+ _screenVGA[dstOffset] = color == 0 ? _screenLayer1[dstOffset] : color;
+ }
+ }
+}
+
+void IgorEngine::PART_02_UPDATE_FUSE() {
+ // The DOS loop chooses a new spark every eight timer units. The engine's
+ // regular update step is exactly kTimerTicksCount (8) units.
+ PART_02_DRAW_FUSE_SPARK(getRandomNumber(3)); // DOS random(4);
+}
+
+void IgorEngine::PART_02_WALK_WITH_FUSE(int srcX, int srcY, int dstX, int dstY) {
+ --_walkDataLastIndex;
+ buildWalkPath(srcX, srcY, dstX, dstY);
+ _walkDataCurrentIndex = 1;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _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;
+ }
+ }
+ PART_02_UPDATE_FUSE();
+ waitForTimer();
+ } while (_gameState.igorMoving);
+}
+
void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- // s3:0x084C maps to _objectsState[16]. cseg203:22CF-2303
// redraws the closed/open trunk into the persistent room background.
const int srcOffset = _objectsState[16] == 0 ? 0x2E3E : 0x30FC;
- for (int y = 0; y < 18; ++y) // cseg203:00EF-018E
- memcpy(_screenLayer1 + 0x748A + y * 320,
- _animFramesBuffer + srcOffset + y * 39, 39);
- _roomActionsTable[252] = _objectsState[16] == 0 ? 6 : 4; // cseg203:22DB-2303
+ for (int y = 0; y < 18; ++y)
+ memcpy(_screenLayer1 + 0x748A + y * 320, _animFramesBuffer + srcOffset + y * 39, 39);
+ _roomActionsTable[252] = _objectsState[16] == 0 ? 6 : 4;
}
if ((num == 2 || num == 255) && _objectsState[17] == 1) {
- _roomObjectAreasTable[17].object = 4; // s3:0xDCAC; cseg203:2317
- _roomObjectAreasTable[19].object = 4; // s3:0xDCB6; cseg203:231C
+ _roomObjectAreasTable[17].object = 4;
+ _roomObjectAreasTable[19].object = 4;
}
if (num == 3 || num == 255) {
- if (_objectsState[18] == 1) { // s3:0x084E; cseg203:232D-2340
- for (int y = 0; y < 50; ++y) // cseg203:0002-004D
- memcpy(_screenLayer1 + 0x50D6 + y * 320,
- _animFramesBuffer + y * 14, 14);
+ if (_objectsState[18] == 1) {
+ for (int y = 0; y < 50; ++y)
+ memcpy(_screenLayer1 + 0x50D6 + y * 320, _animFramesBuffer + y * 14, 14);
}
- _roomObjectAreasTable[9].object = _objectsState[18] == 0 ? 0 : 6; // s3:0xDC84
+ _roomObjectAreasTable[9].object = _objectsState[18] == 0 ? 0 : 6;
}
if (num == 4 || num == 255) {
- if (_objectsState[19] == 0) { // s3:0x084F; cseg203:2351-2372
- _roomObjectAreasTable[12].object = _objectsState[18] == 1 ? 6 : 0; // s3:0xDC93
+ if (_objectsState[19] == 0) {
+ _roomObjectAreasTable[12].object = _objectsState[18] == 1 ? 6 : 0;
} else {
- for (int y = 0; y < 22; ++y) // cseg203:004E-009D
- memcpy(_screenLayer1 + 0x5357 + y * 320,
- _animFramesBuffer + 0x2BC + y * 10, 10);
- _roomObjectAreasTable[12].object = 7; // s3:0xDC93
+ for (int y = 0; y < 22; ++y)
+ memcpy(_screenLayer1 + 0x5357 + y * 320,_animFramesBuffer + 0x2BC + y * 10, 10);
+ _roomObjectAreasTable[12].object = 7;
}
}
if (num == 5 || num == 255) {
if (_objectsState[20] == 0) {
_roomObjectAreasTable[13].object = _objectsState[19] == 1 ? 7 : (_objectsState[18] == 1 ? 6 : 0);
} else {
- for (int y = 0; y < 10; ++y) // cseg203:009E-00EE
- memcpy(_screenLayer1 + 0x599B + y * 320,
- _animFramesBuffer + 0x398 + y * 4, 4);
- _roomObjectAreasTable[13].object = 8; // s3:0xDC98; cseg203:23A9-23AE
+ for (int y = 0; y < 10; ++y)
+ memcpy(_screenLayer1 + 0x599B + y * 320, _animFramesBuffer + 0x398 + y * 4, 4);
+ _roomObjectAreasTable[13].object = 8;
}
}
if (num == 6 || num == 255) {
if (_objectsState[21] == 0)
_roomObjectAreasTable[14].object = _objectsState[20] == 1 ? 8 : (_objectsState[19] == 1 ? 7 : (_objectsState[18] == 1 ? 6 : 0));
}
- if ((num == 8 || num == 255) && _objectsState[23] == 1)
+ if ((num == 8 || num == 255) && _objectsState[23] == 1) {
_roomObjectAreasTable[13].object = 8;
+ // Reuse the already-loaded
+ // localized inventory-object name for dynamite.
+ Common::strlcpy(_roomObjectNames[8], _globalObjectNames[11], sizeof(_roomObjectNames[8]));
+ _roomActionsTable[457] = 0x20;
+ }
}
void IgorEngine::PART_02_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_02_EXEC_ACTION %d", action);
switch (action) {
- case 101: // open trunk; cseg203:018F-0337
- if (_objectsState[16] == 1) { // s3:0x084C; cseg203:019D-01A8
- PART_02_START_DIALOGUE(201, 1, 108); // indirect s3:0x5964
+ case 101: // open trunk
+ if (_objectsState[16] == 1) {
+ PART_02_START_DIALOGUE(201, 1, 108);
break;
}
- PART_00_ANIMATE_RAW(0x18FF, 1, 2, 0x715, 37, 49, 0x608C,
- 127, 1, 7); // cseg203:01AB-0327
- _objectsState[16] = 1; // s3:0x084C; cseg203:032A
- PART_02_APPLY_OBJECT_STATE(1); // cseg203:032F-0331
+ PART_00_ANIMATE_RAW(0x18FF, 1, 2, 0x715, 37, 49, 0x608C, 127, 1, 7);
+ _objectsState[16] = 1;
+ PART_02_APPLY_OBJECT_STATE(1);
break;
- case 102: // close trunk; cseg203:0338-04D9
- if (_objectsState[16] == 0) { // s3:0x084C; cseg203:0346-0351
- PART_02_START_DIALOGUE(201, 1, 108); // indirect s3:0x5970
+ case 102: // close trunk
+ if (_objectsState[16] == 0) {
+ PART_02_START_DIALOGUE(201, 1, 108);
break;
}
- playSound(8, 1); // cseg203:0354-0358
- PART_00_ANIMATE_RAW(0x18FF, 1, 0, 0x715, 37, 49, 0x608C,
- 127, -1, 0); // cseg203:035D-04C9
- _objectsState[16] = 0; // s3:0x084C; cseg203:04CC
- PART_02_APPLY_OBJECT_STATE(1); // cseg203:04D1-04D3
+ playSound(8, 1);
+ PART_00_ANIMATE_RAW(0x18FF, 1, 0, 0x715, 37, 49, 0x608C, 127, -1, 0);
+ _objectsState[16] = 0;
+ PART_02_APPLY_OBJECT_STATE(1);
break;
- case 103: { // hammer the nail; cseg203:0658-0837
- // The selector bytes at dseg231:0x0234-0x0248 alternate frames
- // 0/1 and finish on frame 2 (indexed from s3:0x0233).
- for (int step = 1; step <= 21; ++step) { // cseg203:0666-07FA
+ case 103: { // hammer the nail
+ for (int step = 1; step <= 21; ++step) {
const int frame = step == 21 ? 2 : ((step + 1) & 1);
PART_00_ANIMATE_RAW(0x33BA + frame * 0x4B0, 0, 0, 0x4B0,
- 24, 50, 0x5989, 0, -1, 0); // cseg203:0688-07BE
+ 24, 50, 0x5989, 0, -1, 0);
if ((step & 1) != 0 && step < 21)
- playSound(9, 1); // cseg203:07C0-07E2
- waitForTimer(63); // cseg203:07E7-07F1
+ playSound(9, 1);
+ waitForTimer(63);
}
- _objectsState[20] = 1; // s3:0x0850; cseg203:07FD
- _objectsState[21] = 0; // s3:0x0851; cseg203:0802
- PART_02_APPLY_OBJECT_STATE(5); // cseg203:0807-0809
- PART_02_APPLY_OBJECT_STATE(6); // cseg203:080E-0810
- PART_02_START_DIALOGUE(217, 1, 121); // cseg203:0815-0831
+ _objectsState[20] = 1;
+ _objectsState[21] = 0;
+ PART_02_APPLY_OBJECT_STATE(5);
+ PART_02_APPLY_OBJECT_STATE(6);
+ PART_02_START_DIALOGUE(217, 1, 121);
break;
}
case 104: { // use the pick on the crack; cseg203:0838-0A2C
@@ -124,20 +164,20 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
// The selector bytes at dseg231:0x024A-0x025E alternate frames
// 0/1 and finish on frame 2 (indexed from s3:0x0249).
- for (int step = 1; step <= 21; ++step) { // cseg203:0854-09E8
+ for (int step = 1; step <= 21; ++step) {
const int frame = step == 21 ? 2 : ((step + 1) & 1);
PART_00_ANIMATE_RAW(0x41CA + frame * 0x658, 0, 0, 0x658,
- 29, 56, 0x5349, 0, -1, 0); // cseg203:0876-09AC
+ 29, 56, 0x5349, 0, -1, 0);
if ((step & 1) != 0 && step < 21)
- playSound(10, 1); // cseg203:09AE-09D0
- waitForTimer(63); // cseg203:09D5-09DF
+ playSound(10, 1);
+ waitForTimer(63);
}
_objectsState[19] = 1; // s3:0x084F; cseg203:09EB
_objectsState[20] = 0; // s3:0x0850; cseg203:09F0
- PART_02_APPLY_OBJECT_STATE(4); // cseg203:09F5-09F7
- PART_02_APPLY_OBJECT_STATE(5); // cseg203:09FC-09FE
- PART_02_APPLY_OBJECT_STATE(6); // cseg203:0A03-0A05
- PART_02_START_DIALOGUE(218, 1, 122); // cseg203:0A0A-0A26
+ PART_02_APPLY_OBJECT_STATE(4);
+ PART_02_APPLY_OBJECT_STATE(5);
+ PART_02_APPLY_OBJECT_STATE(6);
+ PART_02_START_DIALOGUE(218, 1, 122);
break;
}
case 105: // look at nail
@@ -153,47 +193,46 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
if (_objectsState[22] == 0) { // s3:0x0852; cseg203:0AD0-0B0A
PART_02_START_DIALOGUE(202, 2, 109);
} else {
- PART_02_SEARCH_TRUNK(); // cseg203:04DA-0657
- PART_02_START_DIALOGUE(204, 1, 111); // cseg203:0B14-0B30
+ PART_02_SEARCH_TRUNK();
+ PART_02_START_DIALOGUE(204, 1, 111);
addObjectToInventory(9, 44); // s3:0x0906; cseg203:0B35-0B6F
- PART_02_APPLY_OBJECT_STATE(255); // cseg203:0B74-0B7B
+ PART_02_APPLY_OBJECT_STATE(255);
}
break;
}
- if (_inventoryInfo[44] != 0 && _inventoryInfo[45] == 0) { // cseg203:0B83-0C71
+ if (_inventoryInfo[44] != 0 && _inventoryInfo[45] == 0) {
if (_objectsState[20] == 0) { // s3:0x0850
PART_02_START_DIALOGUE(202, 2, 109);
} else {
- PART_02_SEARCH_TRUNK(); // cseg203:0BD7
- PART_02_START_DIALOGUE(205, 1, 112); // cseg203:0BDC-0BF8
+ PART_02_SEARCH_TRUNK();
+ PART_02_START_DIALOGUE(205, 1, 112);
removeObjectFromInventory(44); // s3:0x0906; cseg203:0BFD-0C17
- playSound(63, 1); // cseg203:0C13-0C17
+ playSound(63, 1);
addObjectToInventory(10, 45); // s3:0x0907; cseg203:0C1C-0C60
- PART_02_APPLY_OBJECT_STATE(255); // cseg203:0C65-0C6C
+ PART_02_APPLY_OBJECT_STATE(255);
}
break;
}
if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 &&
_inventoryInfo[46] == 0 && _objectsState[23] == 0 &&
- _objectsState[19] != 0) { // cseg203:0C74-0CD9; s3:0x0908/0853/084F
- PART_02_SEARCH_TRUNK(); // cseg203:0CDB
- PART_02_START_DIALOGUE(206, 1, 113); // cseg203:0CE0-0CFC
+ _objectsState[19] != 0) {
+ PART_02_SEARCH_TRUNK();
+ PART_02_START_DIALOGUE(206, 1, 113);
addObjectToInventory(11, 46); // s3:0x0908; cseg203:0D01-0D3B
- PART_02_APPLY_OBJECT_STATE(255); // cseg203:0D40-0D47
+ PART_02_APPLY_OBJECT_STATE(255);
} else if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 &&
_inventoryInfo[46] == 0 && _objectsState[23] == 0) {
- PART_02_START_DIALOGUE(202, 2, 109); // cseg203:0CA3-0CD6
+ PART_02_START_DIALOGUE(202, 2, 109);
} else {
- PART_02_START_DIALOGUE(207, 2, 114); // cseg203:0D4E-0D6A
+ PART_02_START_DIALOGUE(207, 2, 114);
}
break;
case 107: // take butterfly net; cseg203:0D71-0F3E
- PART_00_ANIMATE_RAW(0x54D2, 0, 1, 0x405, 21, 49, 0x5A6D,
- 127, -1, 0); // cseg203:0D7F-0EE3
- waitForTimer(127); // cseg203:0ED0-0EDA
- addObjectToInventory(7, 42); // s3:0x0904; cseg203:0EE6-0F20
- _objectsState[17] = 1; // s3:0x084D; cseg203:0F31
- PART_02_APPLY_OBJECT_STATE(2); // cseg203:0F36-0F38
+ PART_00_ANIMATE_RAW(0x54D2, 0, 1, 0x405, 21, 49, 0x5A6D, 127, -1, 0);
+ waitForTimer(127);
+ addObjectToInventory(7, 42);
+ _objectsState[17] = 1;
+ PART_02_APPLY_OBJECT_STATE(2);
break;
case 108: // Look at old junk
PART_02_START_DIALOGUE(210, 1, 116);
@@ -213,15 +252,14 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
case 112:
PART_02_START_DIALOGUE(216, 1, 120);
break;
- case 113: // place dynamite in the crack; cseg203:0FEB-11C1
- PART_00_ANIMATE_RAW(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989,
- 127, -1, 0); // cseg203:0FF9-115D
- waitForTimer(127); // cseg203:114A-1154
- _objectsState[23] = 1; // s3:0x0853; cseg203:1160
- PART_02_APPLY_OBJECT_STATE(8); // cseg203:1165-1167
- removeObjectFromInventory(46); // s3:0x0908; cseg203:116C-11A6
- playSound(63, 1); // cseg203:11AB-11AF
- PART_02_APPLY_OBJECT_STATE(255); // cseg203:11B4-11BB
+ case 113: // place dynamite in the crack
+ PART_00_ANIMATE_RAW(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
+ waitForTimer(127);
+ _objectsState[23] = 1;
+ PART_02_APPLY_OBJECT_STATE(8);
+ removeObjectFromInventory(46);
+ playSound(63, 1);
+ PART_02_APPLY_OBJECT_STATE(255);
break;
case 114:
PART_02_START_DIALOGUE(219, 1, 123);
@@ -233,7 +271,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
PART_02_START_DIALOGUE(218, 1, 122);
break;
case 118: // exit through window
- if (_objectsState[24] == 1) { // s3:0854; cseg203:1989-19AC
+ if (_objectsState[24] == 1) {
PART_02_START_DIALOGUE(220, 1, 124);
} else {
_objectsState[24] = 1;
@@ -241,31 +279,79 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
break;
case 119:
- PART_00_ANIMATE_RAW(0xB488, 0, 1, 0x4B0, 24, 50, 0x5988,
- 64, -1, 0); // cseg203:1CF8-1E68
- waitForTimer(64); // cseg203:1E57-1E61
- _currentPart = 1; // cseg203:1E6D
+ PART_00_ANIMATE_RAW(0xB488, 0, 1, 0x4B0, 24, 50, 0x5988, 64, -1, 0);
+ waitForTimer(64);
+ _currentPart = 1;
break;
case 120:
_currentPart = 30;
break;
- case 121: // look at shelf / take matches; cseg203:0F3F-0FEA
+ case 121: // look at shelf / take matches
if (_objectsState[25] == 1) { // s3:0x0855; cseg203:0F49
PART_02_START_DIALOGUE(230, 1, 130);
} else {
- PART_02_START_DIALOGUE(211, 2, 117); // cseg203:0F73-0F8F
- addObjectToInventory(8, 43); // s3:0x0905; cseg203:0F94-0FD3
- _objectsState[25] = 1; // s3:0x0855; cseg203:0FE4
+ PART_02_START_DIALOGUE(211, 2, 117);
+ addObjectToInventory(8, 43);
+ _objectsState[25] = 1;
}
break;
- case 117: // light the dynamite; cseg203:1447-197E
- if (_objectsState[23] == 0) { // s3:0x0853; cseg203:1455-1460
- EXEC_MAIN_ACTION(2); // s3:0x5944 = cseg222:2A76
+ case 117: // light the dynamite
+ if (_objectsState[23] == 0) {
+ EXEC_MAIN_ACTION(2);
} else {
- // TODO: transcribe the explosion sequence from cseg203:1463-197E.
- // Keeping it disabled avoids inventing its scrolling, palette, and
- // state-12 handoff behavior.
- warning("PART_02_EXEC_ACTION action 117 explosion is not yet transcribed");
+ memset(_screenVGA + 0xB400, 0, 0x4BFF);
+ playSound(68, 1);
+ PART_00_ANIMATE_RAW(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
+ waitForTimer(127);
+ // formatActionSentence(0);
+
+ PART_02_START_DIALOGUE(221, 1, 125);
+ if (_gameState.talkMode == kTalkModeTextOnly)
+ playSound(11, 1);
+ _updateRoomBackground = &IgorEngine::PART_02_UPDATE_FUSE;
+ waitForEndOfIgorDialogue();
+ _updateRoomBackground = 0;
+
+ memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 320 * 72, _dialogueDirtyRectSize);
+ if (_gameState.talkMode != kTalkModeTextOnly)
+ playSound(11, 1);
+
+ PART_02_WALK_WITH_FUSE(211, 120, 0, 143);
+ for (int elapsed = 0; elapsed < 255; elapsed += kTimerTicksCount) {
+ PART_02_UPDATE_FUSE();
+ waitForTimer();
+ }
+ for (int y = 0; y < 12; ++y) {
+ memcpy(_screenVGA + 0x5996 + y * 320, _screenLayer1 + 0x5996 + y * 320, 12);
+ }
+ stopSound();
+ waitForTimer(5 * 255);
+
+ PART_02_START_DIALOGUE(222, 2, 126);
+ waitForEndOfIgorDialogue();
+ waitForTimer(2 * 255);
+ stopDialogueSpeech();
+
+ _gameState.dialogueTextRunning = false;
+
+ // Return from the left edge to the dynamite wall.
+ --_walkDataLastIndex;
+ buildWalkPath(0, 143, 211, 120);
+ _walkDataCurrentIndex = 1;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+
+ _objectsState[18] = 1;
+ _objectsState[19] = 0;
+ _objectsState[23] = 0;
+ _objectsState[11] = 1;
+ PART_02_APPLY_OBJECT_STATE(3);
+ PART_02_APPLY_OBJECT_STATE(4);
+ PART_02_APPLY_OBJECT_STATE(5);
+ memset(_currentPalette + 240 * 3, 0, 16 * 3);
+ setPaletteRange(240, 255);
+ _currentPart = 12;
}
break;
default:
@@ -277,9 +363,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
void IgorEngine::PART_02() {
_gameState.enableLight = 1;
loadActionData(DAT_StudentDormitoryAttic);
- loadRoomData(PAL_StudentDormitoryAttic, IMG_StudentDormitoryAttic,
- BOX_StudentDormitoryAttic, MSK_StudentDormitoryAttic,
- TXT_StudentDormitoryAttic);
+ loadRoomData(PAL_StudentDormitoryAttic, IMG_StudentDormitoryAttic, BOX_StudentDormitoryAttic, MSK_StudentDormitoryAttic, TXT_StudentDormitoryAttic);
static const int animFrames[] = {
ANM_StudentDormitoryAttic1, ANM_StudentDormitoryAttic2,
ANM_StudentDormitoryAttic3, ANM_StudentDormitoryAttic4,
@@ -302,12 +386,10 @@ void IgorEngine::PART_02() {
_currentAction.verb = kVerbWalk;
switch (_currentPart) {
case 20:
- fadeIn(768); // cseg203:45AB-45AE
- // Igor climbs through the window on the first attic entrance. Three
- // 33x57 frames at animation offset 0x69C0 are drawn at 0x4B26.
- PART_00_ANIMATE_RAW(0x69C0, 0, 2, 0x759, 33, 57, 0x4B26,
- 31, -1, 0); // cseg203:11C2-1338; called at cseg203:45C4
- waitForTimer(31); // cseg203:1321-132B
+ fadeIn(768);
+ // Igor climbs through the window on the first attic entrance.
+ PART_00_ANIMATE_RAW(0x69C0, 0, 2, 0x759, 33, 57, 0x4B26, 31, -1, 0);
+ waitForTimer(31);
_walkData[0].setPos(57, 117, kFacingPositionRight, 0);
break;
case 21:
@@ -315,16 +397,29 @@ void IgorEngine::PART_02() {
_walkData[0].setPos(300, 136, kFacingPositionLeft, 0);
break;
case 22:
- // cseg203:4319-4332 restores the live palette from the saved one
- // before the walk setup below, the same copy state 11 performs at
- // cseg200:1964. Without it the part-1 fadeOut leaves the attic black.
- memcpy(_currentPalette, _paletteBuffer, 768); // cseg203:4320-432D
- // cseg221:0x21DA is setPalette(), as identified by the original-runtime
- // trap table in reference/cyxx/igor/game.cpp; cseg203:4332.
+ // restores the live palette from the saved one
+ // before the walk setup below, the same copy state 11 happens
+ // Without it the part-1 fadeOut leaves the attic black.
+ memcpy(_currentPalette, _paletteBuffer, 768);
updatePalette(768);
- _walkData[0].setPos(49, 118, kFacingPositionBack, 0); // cseg203:4337-4348
+ _walkData[0].setPos(49, 118, kFacingPositionBack, 0);
break;
case 23:
+ // State 12 fades the outside scene to black before returning here.
+ // The original state-23 entrance clears the text/UI area and restores
+ // the attic palette before drawing its post-explosion frame.
+ memset(_screenVGA + 0xB400, 0, 0x4600);
+ memcpy(_currentPalette, _paletteBuffer, 768);
+ PART_00_DRAW_RAW_FRAME(0x820B, 0, 0xA19, 47, 55, 0x6C3B);
+ updatePalette(768);
+
+ // TODO: Port the remaining sequence once its undisassembled static
+ // selector table has been recovered. It selects the 20 animation
+ // frames and their exact delays; guessing would change DOS behavior.
+
+ // Rebuild the panels erased above.
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[72], 0);
_walkData[0].setPos(215, 134, kFacingPositionRight, 0);
break;
case 24:
@@ -345,18 +440,17 @@ void IgorEngine::PART_02() {
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
if (_currentPart == 22)
- PART_02_EXEC_ACTION(118); // cseg203:438B
- // cseg222:0x2264 is showCursor() according to the original-runtime
- // trap table in reference/cyxx/igor/game.cpp. enterPartLoop() below
- // performs the equivalent shared-engine operation.
+ PART_02_EXEC_ACTION(118);
}
enterPartLoop();
while (_currentPart >= 20 && _currentPart <= 24 && !_gameStateLoaded)
runPartLoop();
leavePartLoop();
- if (!_gameStateLoaded)
+ debug("Exiting part loop, currentPart=%d", _currentPart);
+ if (!_gameStateLoaded && !(_currentPart >= 10 && _currentPart <= 19)) {
fadeOut(_currentPart == kInvalidPart ? 768 : 624);
+ }
}
} // End of namespace Igor
diff --git a/engines/igor/part_6.cpp b/engines/igor/part_6.cpp
index 5dd75cd3ea0..f56c68bac73 100644
--- a/engines/igor/part_6.cpp
+++ b/engines/igor/part_6.cpp
@@ -349,7 +349,7 @@ void IgorEngine::PART_06() {
_currentAction.verb = kVerbWalk;
memcpy(_paletteBuffer, _currentPalette, 624);
// Part 61 is arriving from intro so it doesnt need to copy the screen buffer
- fadeIn(624);
+ fadeIn(768);
}
loadActionData(DAT_SpringBridge);
_roomDataOffsets = PART_06_ROOM_DATA_OFFSETS;
Commit: 87758b814e35c6590eff661160a279cdfcc73294
https://github.com/scummvm/scummvm/commit/87758b814e35c6590eff661160a279cdfcc73294
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:11+01:00
Commit Message:
IGOR: Final animation of igor stunned after explosion
Changed paths:
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_2.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index c2786db51e1..c67f0b2a0a7 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -752,7 +752,7 @@ private:
void handleRoomInput();
void executeAction(int action);
- void clearAction();
+ void clearAction(bool redraw = true);
void formatActionSentence(uint8 color);
void drawActionSentence(const char *sentence, uint8 color);
void handleRoomIgorWalk();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index e018f12b87e..bb134c3091b 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -442,16 +442,18 @@ void IgorEngine::handleRoomInput() {
hideCursor();
debugC(9, kDebugEngine, "handleRoomInput() executing action with actionCode %d", _actionCode);
+ const int actionPart = _currentPart;
executeAction(_actionCode);
if (!_gameState.dialogueTextRunning) {
showCursor();
}
- clearAction();
+ clearAction(_currentPart == actionPart);
return;
}
-void IgorEngine::clearAction() {
- redrawVerb(_currentAction.verb, false);
+void IgorEngine::clearAction(bool redraw) {
+ if (redraw)
+ redrawVerb(_currentAction.verb, false);
memset(&_currentAction, 0, sizeof(_currentAction));
_currentAction.verb = kVerbWalk;
_actionCode = 0;
diff --git a/engines/igor/part_2.cpp b/engines/igor/part_2.cpp
index a1b1c6c3f6c..49f5c94e76f 100644
--- a/engines/igor/part_2.cpp
+++ b/engines/igor/part_2.cpp
@@ -303,7 +303,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
playSound(68, 1);
PART_00_ANIMATE_RAW(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
waitForTimer(127);
- // formatActionSentence(0);
+
PART_02_START_DIALOGUE(221, 1, 125);
if (_gameState.talkMode == kTalkModeTextOnly)
@@ -413,9 +413,22 @@ void IgorEngine::PART_02() {
PART_00_DRAW_RAW_FRAME(0x820B, 0, 0xA19, 47, 55, 0x6C3B);
updatePalette(768);
- // TODO: Port the remaining sequence once its undisassembled static
- // selector table has been recovered. It selects the 20 animation
- // frames and their exact delays; guessing would change DOS behavior.
+ // Igor lies stunned, stands up, and shakes his head.
+ static const uint8 postExplosionFrames[] = {
+ 0, 1, 2, 1, 2, 1, 2, 1, 2, 1,
+ 2, 1, 2, 1, 2, 1, 2, 1, 3, 4
+ };
+ for (uint i = 0; i < ARRAYSIZE(postExplosionFrames); ++i) {
+ const int frame = postExplosionFrames[i];
+ PART_00_DRAW_RAW_FRAME(0x820B, frame, 0xA19, 47, 55, 0x6C3B);
+ if (frame == 0)
+ waitForTimer(2 * 255);
+ else if (frame == 1 || frame == 2)
+ waitForTimer(31);
+ else
+ waitForTimer(127);
+ }
+ PART_02_START_DIALOGUE(224, 1, 127);
// Rebuild the panels erased above.
drawVerbsPanel();
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 91540f2d07c..34f42f9947b 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1069,11 +1069,12 @@ void IgorEngine::handleRoomIgorWalk() {
if (_actionCode > 0) {
hideCursor();
debugC(9, kDebugEngine, "Executing action code %d", _actionCode);
+ const int actionPart = _currentPart;
executeAction(_actionCode);
if (!_gameState.dialogueTextRunning) {
showCursor();
}
- clearAction();
+ clearAction(_currentPart == actionPart);
}
}
if (_gameState.igorMoving) {
Commit: ddb465d6dfea3d3734a3c8d76673040bc7934c2f
https://github.com/scummvm/scummvm/commit/ddb465d6dfea3d3734a3c8d76673040bc7934c2f
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:12+01:00
Commit Message:
IGOR: Part 17 dialogue
Changed paths:
engines/igor/part_17.cpp
engines/igor/text.cpp
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index 4e91d7f5383..1ef119537c8 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -246,7 +246,9 @@ void IgorEngine::PART_17_ACTION_106_swapFolders() {
void IgorEngine::PART_17_HANDLE_DIALOGUE_PHILIP() {
loadDialogueData(DLG_OutsideCollege);
- warning("PART_17_HANDLE_DIALOGUE_PHILIP unimplemented");
+ _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip;
+ handleDialogue(135, 33, 63, 63, 0);
+ _updateDialogue = 0;
}
void IgorEngine::PART_17_UPDATE_DIALOGUE_Jimmy(int action) {
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 6608ce85856..1d87d2fdde5 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -567,12 +567,13 @@ int IgorEngine::selectDialogue() {
void IgorEngine::dialogueAskQuestion() {
memset(_screenVGA + 46080, 0, 17920);
int offset = (_dialogueInfo[_dialogueChoiceSelected] - 1) * 6 + (_gameState.dialogueChoiceCount - 1) * 30 + (_gameState.dialogueChoiceStart - 1) * _roomDataOffsets.dlg.matSize;
- const int question = _gameState.dialogueData[offset + 3];
- int num = question - 1;
- const int sound = _dialogueQuestionSounds[question - 1]; // cseg172:043B-0460, 0B34-0B43
+ int question = _gameState.dialogueData[offset + 3];
+ // For part 5 igor always chickens out from Phillip
if (getPart() == 17) {
- num = 5;
+ question = 5;
}
+ const int num = question - 1;
+ const int sound = _dialogueQuestionSounds[question - 1]; // cseg172:043B-0460, 0B34-0B43
debugC(9, kDebugEngine, "dialogueAskQuestion() num %d offset %d", num, offset);
Common::strlcpy(_globalDialogueTexts[250], _dialogueQuestions[num][0], sizeof(_globalDialogueTexts[250]));
Common::strlcpy(_globalDialogueTexts[251], _dialogueQuestions[num][1], sizeof(_globalDialogueTexts[251]));
Commit: eb3f81ff9b5518e81d308d64ed4f64b87ed79f3f
https://github.com/scummvm/scummvm/commit/eb3f81ff9b5518e81d308d64ed4f64b87ed79f3f
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:12+01:00
Commit Message:
IGOR: Import part 24 as it was in the legacy engine
Changed paths:
A engines/igor/part_24.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index c67f0b2a0a7..d5fb14eec2b 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -694,6 +694,63 @@ private:
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);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 5b36bf6c01d..c927d61c962 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -33,6 +33,7 @@ MODULE_OBJS = \
part_19.o \
part_21.o \
part_23.o \
+ part_24.o \
part_28.o \
part_30.o \
part_34.o \
diff --git a/engines/igor/part_24.cpp b/engines/igor/part_24.cpp
new file mode 100644
index 00000000000..e8bc9d3ba60
--- /dev/null
+++ b/engines/igor/part_24.cpp
@@ -0,0 +1,321 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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(89) + 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(5) + 1);
+ } else {
+ PART_24_HELPER_2(getRandomNumber(5) + 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;
+ fadeIn(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();
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 8402961d28f..a23cc5ff28f 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -600,6 +600,11 @@ void IgorEngine::PART_MAIN() {
case 232:
PART_23(); // college corridor lucas
break;
+ case 240:
+ case 241:
+ case 242:
+ PART_24();
+ break;
case 280:
case 281:
PART_28(); // college corridor caroline
Commit: 2f8936de5d272c119a3374e596890762abe4fdae
https://github.com/scummvm/scummvm/commit/2f8936de5d272c119a3374e596890762abe4fdae
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:12+01:00
Commit Message:
IGOR: Import parts 25-27 from legacy engine
Changed paths:
A engines/igor/part_25.cpp
A engines/igor/part_26.cpp
A engines/igor/part_27.cpp
engines/igor/module.mk
engines/igor/part_main.cpp
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index c927d61c962..3803ce5a2ef 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -34,6 +34,9 @@ MODULE_OBJS = \
part_21.o \
part_23.o \
part_24.o \
+ part_25.o \
+ part_26.o \
+ part_27.o \
part_28.o \
part_30.o \
part_34.o \
diff --git a/engines/igor/part_25.cpp b/engines/igor/part_25.cpp
new file mode 100644
index 00000000000..e648319af21
--- /dev/null
+++ b/engines/igor/part_25.cpp
@@ -0,0 +1,240 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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(2) + 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;
+ fadeIn(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();
+ fadeOut(624);
+}
+
+
+} // End of namespace Igor
diff --git a/engines/igor/part_26.cpp b/engines/igor/part_26.cpp
new file mode 100644
index 00000000000..183a9e4ab7a
--- /dev/null
+++ b/engines/igor/part_26.cpp
@@ -0,0 +1,279 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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(24) == 0) {
+ _gameState.unk10 = 1;
+ PART_26_HELPER_7(_gameState.unk10);
+ } else if (getRandomNumber(29) == 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;
+ fadeIn(768);
+ if (_currentPart == 260) {
+ PART_26_HELPER_4();
+ } else {
+ PART_26_HELPER_5();
+ }
+ enterPartLoop();
+ while (_currentPart >= 260 && _currentPart <= 261) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ fadeOut(624);
+}
+
+
+} // End of namespace Igor
diff --git a/engines/igor/part_27.cpp b/engines/igor/part_27.cpp
new file mode 100644
index 00000000000..2db85bdce34
--- /dev/null
+++ b/engines/igor/part_27.cpp
@@ -0,0 +1,285 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#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;
+ fadeIn(768);
+ if (_currentPart == 270) {
+ PART_27_HELPER_2();
+ } else {
+ PART_27_HELPER_5();
+ }
+ enterPartLoop();
+ while (_currentPart == 270 || _currentPart == 271) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index a23cc5ff28f..6aba2d5a621 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -605,6 +605,19 @@ void IgorEngine::PART_MAIN() {
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(); // college corridor caroline
Commit: 4ee3400b1c008919fd3e4b1cbd201537683dc73b
https://github.com/scummvm/scummvm/commit/4ee3400b1c008919fd3e4b1cbd201537683dc73b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:13+01:00
Commit Message:
IGOR: Fixes animation bug in Part 17
Changed paths:
engines/igor/part_17.cpp
diff --git a/engines/igor/part_17.cpp b/engines/igor/part_17.cpp
index 1ef119537c8..60f069edcc3 100644
--- a/engines/igor/part_17.cpp
+++ b/engines/igor/part_17.cpp
@@ -285,7 +285,7 @@ void IgorEngine::PART_17_UPDATE_DIALOGUE_Philip(int action) {
}
void IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND() {
- if (compareGameTick(3, 32) && _gameState.unkF) {
+ if (!_gameState.dialogueTextRunning && compareGameTick(3, 32) && _gameState.unkF) {
// Counter (unk10) values 0 through 15 animate one character while holding the other on its resting frame.
// Counter (unk10) values 16 through 31 animate the other character.
switch (_gameState.unk10 / 16) {
@@ -390,9 +390,9 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap() {
}
void IgorEngine::PART_17_HELPER_3(int lum) {
- _roomObjectAreasTable[18].y1Lum = lum;
- _roomObjectAreasTable[19].y1Lum = lum;
- _roomObjectAreasTable[20].y1Lum = lum;
+ _roomObjectAreasTable[18].area = lum;
+ _roomObjectAreasTable[19].area = lum;
+ _roomObjectAreasTable[20].area = lum;
}
void IgorEngine::PART_17_HELPER_4_paintFirsFrameOfPhilipAndJimmy() {
Commit: d5e49e9853b2c36f757a94047d3b8a795279ad44
https://github.com/scummvm/scummvm/commit/d5e49e9853b2c36f757a94047d3b8a795279ad44
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:13+01:00
Commit Message:
IGOR: Fixes issue with persistent ESCAPE key
Changed paths:
engines/igor/input.cpp
engines/igor/text.cpp
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index bb134c3091b..1e39bdf1e68 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -79,11 +79,15 @@ void IgorEngine::waitForTimer(int ticks) {
_inputVars[kInputCursorYPos] = ev.mouse.y;
break;
case Common::EVENT_RBUTTONDOWN:
+ debugC(9, kDebugEngine, "waitForTimer() right button at %d,%d running %d",
+ ev.mouse.x, ev.mouse.y, _gameState.dialogueTextRunning);
if (_gameState.dialogueTextRunning) {
_inputVars[kInputSkipDialogue] = 1;
}
break;
case Common::EVENT_LBUTTONDOWN:
+ debugC(9, kDebugEngine, "waitForTimer() left button at %d,%d running %d",
+ ev.mouse.x, ev.mouse.y, _gameState.dialogueTextRunning);
_inputVars[kInputCursorXPos] = ev.mouse.x;
_inputVars[kInputCursorYPos] = ev.mouse.y;
if (_gameState.dialogueTextRunning) {
@@ -177,6 +181,12 @@ void IgorEngine::redrawVerb(uint8 verb, bool highlight) {
}
void IgorEngine::handleRoomInput() {
+ // Escape is a transient abort input. Do not let an unused press from the
+ // room loop leak into a later blocking walk or dialogue sequence.
+ if (_inputVars[kInputEscape] && !_eventQuitGame) {
+ _inputVars[kInputEscape] = 0;
+ }
+
// ESCAPE for pause
if (_inputVars[kInputPause]) {
_inputVars[kInputPause] = 0;
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 1d87d2fdde5..9947ad8ecc5 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -212,6 +212,9 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
* Loop for character talking
*/
void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b) {
+ debugC(9, kDebugEngine, "waitForEndOfCutsceneDialogue() begin running %d start %d count %d speechCounter %d delay %d/%d",
+ _gameState.dialogueTextRunning, _dialogueTextsStart, _dialogueTextsCount,
+ _talkSpeechCounter, _talkDelayCounter, _talkDelay);
do {
// stop speech if skip dialogue hit
if (_gameState.dialogueTextRunning && _inputVars[kInputSkipDialogue]) {
@@ -231,6 +234,8 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
(this->*_updateDialogue)(kUpdateDialogueAnimEndOfSentence);
}
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
+ debugC(9, kDebugEngine, "waitForEndOfCutsceneDialogue() restored text rect y %d size %d remaining %d",
+ _dialogueDirtyRectY, _dialogueDirtyRectSize, _dialogueTextsCount);
if (_dialogueTextsCount == 0) {
stopDialogueSpeech();
_gameState.dialogueTextRunning = 0;
@@ -263,10 +268,15 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
if (_updateRoomBackground) {
(this->*_updateRoomBackground)();
}
- if (_inputVars[kInputEscape])
+ if (_inputVars[kInputEscape]) {
+ warning("waitForEndOfCutsceneDialogue() early exit with text active %d start %d count %d speechCounter %d delay %d/%d",
+ _gameState.dialogueTextRunning, _dialogueTextsStart, _dialogueTextsCount,
+ _talkSpeechCounter, _talkDelayCounter, _talkDelay);
return;
+ }
waitForTimer();
} while (_gameState.dialogueTextRunning);
+ debugC(9, kDebugEngine, "waitForEndOfCutsceneDialogue() end running %d", _gameState.dialogueTextRunning);
}
void IgorEngine::fixIgorDialogueTextPosition(int num, int count, int *x, int *y) {
@@ -448,6 +458,9 @@ void IgorEngine::animateIgorTalking(int frame) {
}
}
+/**
+ * Pos and color
+ */
void IgorEngine::handleDialogue(int x, int y, int r, int g, int b) {
_gameState.dialogueStarted = true;
_gameState.dialogueChoiceStart = 1;
@@ -510,6 +523,12 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b) {
}
void IgorEngine::drawDialogueChoices() {
+ debugC(9, kDebugEngine, "drawDialogueChoices() enter running %d start %d count %d click %d skip %d escape %d quit %d",
+ _gameState.dialogueTextRunning, _dialogueTextsStart, _dialogueTextsCount,
+ _inputVars[kInputClick], _inputVars[kInputSkipDialogue], _inputVars[kInputEscape], _eventQuitGame);
+ if (_gameState.dialogueTextRunning) {
+ warning("drawDialogueChoices() entered while dialogue text is still active");
+ }
memset(_screenVGA + 46080, 0, 56 * 320);
setPaletteColor(240, 0, 0, 0);
_dialogueInfo[0] = 0;
@@ -534,6 +553,9 @@ void IgorEngine::drawDialogueChoices() {
int IgorEngine::selectDialogue() {
showCursor();
+ debugC(9, kDebugEngine, "selectDialogue() begin cursor %d,%d choices %d running %d",
+ _inputVars[kInputCursorXPos], _inputVars[kInputCursorYPos],
+ _dialogueInfo[0], _gameState.dialogueTextRunning);
int hoveredChoice = 0;
bool end = false;
do {
@@ -552,6 +574,9 @@ int IgorEngine::selectDialogue() {
}
}
if (_inputVars[kInputClick]) {
+ debugC(9, kDebugEngine, "selectDialogue() click cursor %d,%d hovered %d choices %d running %d skip %d",
+ _inputVars[kInputCursorXPos], _inputVars[kInputCursorYPos], hoveredChoice,
+ _dialogueInfo[0], _gameState.dialogueTextRunning, _inputVars[kInputSkipDialogue]);
if (hoveredChoice != 0 && hoveredChoice <= _dialogueInfo[0]) {
end = true;
}
@@ -561,6 +586,7 @@ int IgorEngine::selectDialogue() {
waitForTimer();
} while (!end && !_eventQuitGame);
hideCursor();
+ debugC(9, kDebugEngine, "selectDialogue() end hovered %d quit %d", hoveredChoice, _eventQuitGame);
return hoveredChoice;
}
Commit: 77e4deac3ca979a6057b6356a7e7e1c687c1b4d0
https://github.com/scummvm/scummvm/commit/77e4deac3ca979a6057b6356a7e7e1c687c1b4d0
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:14+01:00
Commit Message:
IGOR: Speech index refs for parts 24-27
Changed paths:
engines/igor/part_24.cpp
engines/igor/part_25.cpp
engines/igor/part_26.cpp
engines/igor/part_27.cpp
diff --git a/engines/igor/part_24.cpp b/engines/igor/part_24.cpp
index e8bc9d3ba60..3388115d235 100644
--- a/engines/igor/part_24.cpp
+++ b/engines/igor/part_24.cpp
@@ -32,7 +32,7 @@ void IgorEngine::PART_24_EXEC_ACTION(int action) {
PART_24_ACTION_102();
break;
case 103:
- ADD_DIALOGUE_TEXT(201, 1);
+ ADD_DIALOGUE_TEXT(201, 1, 1257);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -43,7 +43,7 @@ void IgorEngine::PART_24_EXEC_ACTION(int action) {
PART_24_ACTION_105();
break;
case 106:
- ADD_DIALOGUE_TEXT(202, 1);
+ ADD_DIALOGUE_TEXT(202, 1, 1258);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -51,29 +51,29 @@ void IgorEngine::PART_24_EXEC_ACTION(int action) {
PART_24_ACTION_107();
break;
case 108:
- ADD_DIALOGUE_TEXT(203, 1);
+ ADD_DIALOGUE_TEXT(203, 1, 1259);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 109:
- ADD_DIALOGUE_TEXT(204, 1);
- ADD_DIALOGUE_TEXT(205, 1);
+ ADD_DIALOGUE_TEXT(204, 1, 1260);
+ ADD_DIALOGUE_TEXT(205, 1, 1261);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
break;
case 110:
- ADD_DIALOGUE_TEXT(206, 2);
+ ADD_DIALOGUE_TEXT(206, 2, 1262);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 111:
- ADD_DIALOGUE_TEXT(208, 2);
- ADD_DIALOGUE_TEXT(210, 2);
+ ADD_DIALOGUE_TEXT(208, 2, 1263);
+ ADD_DIALOGUE_TEXT(210, 2, 1264);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
break;
case 112:
- ADD_DIALOGUE_TEXT(212, 2);
+ ADD_DIALOGUE_TEXT(212, 2, 1265);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
diff --git a/engines/igor/part_25.cpp b/engines/igor/part_25.cpp
index e648319af21..75b87e619a0 100644
--- a/engines/igor/part_25.cpp
+++ b/engines/igor/part_25.cpp
@@ -29,41 +29,43 @@ void IgorEngine::PART_25_EXEC_ACTION(int action) {
_currentPart = 260;
break;
case 102:
+ // TODO: the trailing 206 page of every branch has no verified speech
+ // reference; that text id is not part of this room's original text set.
switch (getRandomNumber(2) + 1) {
case 1:
- ADD_DIALOGUE_TEXT(204, 2);
- ADD_DIALOGUE_TEXT(206, 1);
+ ADD_DIALOGUE_TEXT(204, 2, 1273);
+ ADD_DIALOGUE_TEXT(206, 1, kNoSpeechSound);
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);
+ ADD_DIALOGUE_TEXT(207, 1, 1274);
+ ADD_DIALOGUE_TEXT(208, 1, 1275);
+ ADD_DIALOGUE_TEXT(209, 1, 1276);
+ ADD_DIALOGUE_TEXT(206, 1, kNoSpeechSound);
SET_DIALOGUE_TEXT(1, 4);
startIgorDialogue();
break;
case 3:
- ADD_DIALOGUE_TEXT(210, 1);
- ADD_DIALOGUE_TEXT(211, 1);
- ADD_DIALOGUE_TEXT(206, 1);
+ ADD_DIALOGUE_TEXT(210, 1, 1277);
+ ADD_DIALOGUE_TEXT(211, 1, 1278);
+ ADD_DIALOGUE_TEXT(206, 1, kNoSpeechSound);
SET_DIALOGUE_TEXT(1, 3);
startIgorDialogue();
break;
}
break;
case 103:
- ADD_DIALOGUE_TEXT(201, 1);
+ ADD_DIALOGUE_TEXT(201, 1, 1271);
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);
+ ADD_DIALOGUE_TEXT(212, 1, kNoSpeechSound);
+ ADD_DIALOGUE_TEXT(213, 1, kNoSpeechSound);
+ ADD_DIALOGUE_TEXT(214, 1, kNoSpeechSound);
+ ADD_DIALOGUE_TEXT(215, 1, kNoSpeechSound);
+ ADD_DIALOGUE_TEXT(216, 2, kNoSpeechSound);
SET_DIALOGUE_TEXT(1, 5);
startIgorDialogue();
break;
@@ -71,7 +73,7 @@ void IgorEngine::PART_25_EXEC_ACTION(int action) {
PART_25_ACTION_105();
break;
case 106:
- ADD_DIALOGUE_TEXT(203, 1);
+ ADD_DIALOGUE_TEXT(203, 1, 1272);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
diff --git a/engines/igor/part_26.cpp b/engines/igor/part_26.cpp
index 183a9e4ab7a..89b144f4cd2 100644
--- a/engines/igor/part_26.cpp
+++ b/engines/igor/part_26.cpp
@@ -28,12 +28,12 @@ static const uint8 PART_26_ANIM_DATA_1[12] = { 6, 0, 2, 3, 4, 5, 6, 5, 4, 3, 2,
void IgorEngine::PART_26_EXEC_ACTION(int action) {
switch (action) {
case 101:
- ADD_DIALOGUE_TEXT(202, 1);
+ ADD_DIALOGUE_TEXT(202, 1, 1279);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 102:
- ADD_DIALOGUE_TEXT(203, 1);
+ ADD_DIALOGUE_TEXT(203, 1, 1280);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -44,7 +44,7 @@ void IgorEngine::PART_26_EXEC_ACTION(int action) {
PART_26_ACTION_104();
break;
case 105:
- ADD_DIALOGUE_TEXT(224, 2);
+ ADD_DIALOGUE_TEXT(224, 2, 1290);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -55,24 +55,24 @@ void IgorEngine::PART_26_EXEC_ACTION(int action) {
PART_26_ACTION_107();
break;
case 108:
- ADD_DIALOGUE_TEXT(216, 2);
- ADD_DIALOGUE_TEXT(218, 1);
+ ADD_DIALOGUE_TEXT(216, 2, 1284);
+ ADD_DIALOGUE_TEXT(218, 1, 1285);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
break;
case 109:
- ADD_DIALOGUE_TEXT(219, 1);
+ ADD_DIALOGUE_TEXT(219, 1, 1286);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 110:
- ADD_DIALOGUE_TEXT(220, 2);
- ADD_DIALOGUE_TEXT(222, 1);
+ ADD_DIALOGUE_TEXT(220, 2, 1287);
+ ADD_DIALOGUE_TEXT(222, 1, 1288);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
break;
case 111:
- ADD_DIALOGUE_TEXT(223, 1);
+ ADD_DIALOGUE_TEXT(223, 1, 1289);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -210,9 +210,9 @@ void IgorEngine::PART_26_HELPER_5() {
_gameState.igorMoving = true;
waitForIgorMove();
if (_objectsState[65] == 3) {
- ADD_DIALOGUE_TEXT(212, 1);
- ADD_DIALOGUE_TEXT(213, 2);
- ADD_DIALOGUE_TEXT(215, 1);
+ ADD_DIALOGUE_TEXT(212, 1, 1281);
+ ADD_DIALOGUE_TEXT(213, 2, 1282);
+ ADD_DIALOGUE_TEXT(215, 1, 1283);
SET_DIALOGUE_TEXT(1, 3);
startIgorDialogue();
_objectsState[65] = 4;
diff --git a/engines/igor/part_27.cpp b/engines/igor/part_27.cpp
index 2db85bdce34..9223198722d 100644
--- a/engines/igor/part_27.cpp
+++ b/engines/igor/part_27.cpp
@@ -26,33 +26,33 @@ namespace Igor {
void IgorEngine::PART_27_EXEC_ACTION(int action) {
switch (action) {
case 101:
- _currentPart = 231;
+ _currentPart = 211;
break;
case 102:
if (_objectsState[85] == 0) {
- ADD_DIALOGUE_TEXT(216, 2);
+ ADD_DIALOGUE_TEXT(216, 2, 1173);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
_objectsState[85] = 1;
PART_27_HELPER_1(255);
} else {
- ADD_DIALOGUE_TEXT(201, 1);
+ ADD_DIALOGUE_TEXT(201, 1, 1162);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
break;
case 103:
- ADD_DIALOGUE_TEXT(203, 1);
+ ADD_DIALOGUE_TEXT(203, 1, 1163);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 104:
- ADD_DIALOGUE_TEXT(204, 1);
+ ADD_DIALOGUE_TEXT(204, 1, 1164);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 105:
- ADD_DIALOGUE_TEXT(205, 1);
+ ADD_DIALOGUE_TEXT(205, 1, 1165);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -66,7 +66,7 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
PART_27_ACTION_108();
break;
case 109:
- ADD_DIALOGUE_TEXT(215, 1);
+ ADD_DIALOGUE_TEXT(215, 1, 1172);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -74,14 +74,14 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
PART_27_ACTION_110();
break;
case 111:
- ADD_DIALOGUE_TEXT(222, 1);
- ADD_DIALOGUE_TEXT(223, 2);
- ADD_DIALOGUE_TEXT(225, 4);
+ ADD_DIALOGUE_TEXT(222, 1, kNoSpeechSound);
+ ADD_DIALOGUE_TEXT(223, 2, kNoSpeechSound);
+ ADD_DIALOGUE_TEXT(225, 4, kNoSpeechSound);
SET_DIALOGUE_TEXT(1, 3);
startIgorDialogue();
break;
case 112:
- ADD_DIALOGUE_TEXT(221, 1);
+ ADD_DIALOGUE_TEXT(221, 1, 1176);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -100,13 +100,13 @@ void IgorEngine::PART_27_ACTION_106() {
return;
}
if (_objectsState[5] == 0) {
- ADD_DIALOGUE_TEXT(206, 1);
+ ADD_DIALOGUE_TEXT(206, 1, 1166);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
}
if (_objectsState[5] == 1) {
- ADD_DIALOGUE_TEXT(209, 3);
+ ADD_DIALOGUE_TEXT(209, 3, 1169);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
_objectsState[5] = 2;
@@ -149,12 +149,12 @@ void IgorEngine::PART_27_ACTION_107() {
void IgorEngine::PART_27_ACTION_108() {
if (_inventoryInfo[58] > 0 || _objectsState[42] == 2) {
- ADD_DIALOGUE_TEXT(208, 1);
+ ADD_DIALOGUE_TEXT(208, 1, 1168);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
}
- ADD_DIALOGUE_TEXT(207, 1);
+ ADD_DIALOGUE_TEXT(207, 1, 1167);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -175,8 +175,8 @@ void IgorEngine::PART_27_ACTION_108() {
}
void IgorEngine::PART_27_ACTION_110() {
- ADD_DIALOGUE_TEXT(212, 1);
- ADD_DIALOGUE_TEXT(213, 2);
+ ADD_DIALOGUE_TEXT(212, 1, 1170);
+ ADD_DIALOGUE_TEXT(213, 2, 1171);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue();
Commit: b9cceed0140800a514d074f91132916da6144254
https://github.com/scummvm/scummvm/commit/b9cceed0140800a514d074f91132916da6144254
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:14+01:00
Commit Message:
IGOR: Fix early appearance of UI in cutscene with Laura
Changed paths:
engines/igor/igor.h
engines/igor/part_30.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index d5fb14eec2b..a01a1c07b0a 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -895,7 +895,7 @@ private:
int x1MinY = -1, int x2MinY = -1);
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 handleDialogue(int x, int y, int r, int g, int b, bool restoreUI = true);
void drawDialogueChoices();
int selectDialogue();
void dialogueAskQuestion();
diff --git a/engines/igor/part_30.cpp b/engines/igor/part_30.cpp
index 4d3d7b05b3d..d562d4f5978 100644
--- a/engines/igor/part_30.cpp
+++ b/engines/igor/part_30.cpp
@@ -112,7 +112,7 @@ void IgorEngine::PART_30_UPDATE_DIALOGUE_LAURA(int action) {
void IgorEngine::PART_30_HANDLE_DIALOGUE_LAURA() {
loadDialogueData(DLG_CollegeStairsFirstFloor);
_updateDialogue = &IgorEngine::PART_30_UPDATE_DIALOGUE_LAURA;
- handleDialogue(201, 85, 63, 0, 38);
+ handleDialogue(201, 85, 63, 0, 38, false);
_updateDialogue = 0;
}
@@ -238,6 +238,8 @@ void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
_walkData[0].setPos(164, 135, 3, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 1;
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[72], 0);
// Que caracter
ADD_DIALOGUE_TEXT(210, 1, 459);
SET_DIALOGUE_TEXT(1, 1);
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 9947ad8ecc5..e3ef3822e97 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -461,7 +461,7 @@ void IgorEngine::animateIgorTalking(int frame) {
/**
* Pos and color
*/
-void IgorEngine::handleDialogue(int x, int y, int r, int g, int b) {
+void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreUI) {
_gameState.dialogueStarted = true;
_gameState.dialogueChoiceStart = 1;
_gameState.dialogueChoiceCount = 1;
@@ -516,8 +516,10 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b) {
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);
+ if(restoreUI) {
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[72], 0);
+ }
_currentAction.verb = kVerbWalk;
_gameState.dialogueStarted = false;
}
Commit: 2910a341215087324488d6643e5506e2d31299a4
https://github.com/scummvm/scummvm/commit/2910a341215087324488d6643e5506e2d31299a4
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:14+01:00
Commit Message:
IGOR: Move parts into dedicated folder
Changed paths:
A engines/igor/parts/part_0.cpp
A engines/igor/parts/part_1.cpp
A engines/igor/parts/part_10.cpp
A engines/igor/parts/part_11.cpp
A engines/igor/parts/part_12.cpp
A engines/igor/parts/part_17.cpp
A engines/igor/parts/part_18.cpp
A engines/igor/parts/part_19.cpp
A engines/igor/parts/part_2.cpp
A engines/igor/parts/part_21.cpp
A engines/igor/parts/part_23.cpp
A engines/igor/parts/part_24.cpp
A engines/igor/parts/part_25.cpp
A engines/igor/parts/part_26.cpp
A engines/igor/parts/part_27.cpp
A engines/igor/parts/part_28.cpp
A engines/igor/parts/part_30.cpp
A engines/igor/parts/part_34.cpp
A engines/igor/parts/part_35.cpp
A engines/igor/parts/part_4.cpp
A engines/igor/parts/part_5.cpp
A engines/igor/parts/part_6.cpp
A engines/igor/parts/part_7.cpp
A engines/igor/parts/part_8.cpp
A engines/igor/parts/part_85.cpp
A engines/igor/parts/part_9.cpp
A engines/igor/parts/part_90.cpp
R engines/igor/part_0.cpp
R engines/igor/part_1.cpp
R engines/igor/part_10.cpp
R engines/igor/part_11.cpp
R engines/igor/part_12.cpp
R engines/igor/part_17.cpp
R engines/igor/part_18.cpp
R engines/igor/part_19.cpp
R engines/igor/part_2.cpp
R engines/igor/part_21.cpp
R engines/igor/part_23.cpp
R engines/igor/part_24.cpp
R engines/igor/part_25.cpp
R engines/igor/part_26.cpp
R engines/igor/part_27.cpp
R engines/igor/part_28.cpp
R engines/igor/part_30.cpp
R engines/igor/part_34.cpp
R engines/igor/part_35.cpp
R engines/igor/part_4.cpp
R engines/igor/part_5.cpp
R engines/igor/part_6.cpp
R engines/igor/part_7.cpp
R engines/igor/part_8.cpp
R engines/igor/part_85.cpp
R engines/igor/part_9.cpp
R engines/igor/part_90.cpp
engines/igor/module.mk
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 3803ce5a2ef..a4f4652a3d4 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -14,32 +14,32 @@ MODULE_OBJS = \
static_walk.o \
static_cursor.o \
options.o \
- part_0.o \
- part_1.o \
- part_2.o \
- part_4.o \
- part_5.o \
- part_85.o \
- part_90.o \
- part_6.o \
- part_7.o \
- part_8.o \
- part_9.o \
- part_10.o \
- part_11.o \
- part_12.o \
- part_17.o \
- part_18.o \
- part_19.o \
- part_21.o \
- part_23.o \
- part_24.o \
- part_25.o \
- part_26.o \
- part_27.o \
- part_28.o \
- part_30.o \
- part_34.o \
+ parts/part_0.o \
+ parts/part_1.o \
+ parts/part_2.o \
+ parts/part_4.o \
+ parts/part_5.o \
+ parts/part_85.o \
+ parts/part_90.o \
+ parts/part_6.o \
+ parts/part_7.o \
+ parts/part_8.o \
+ parts/part_9.o \
+ parts/part_10.o \
+ parts/part_11.o \
+ parts/part_12.o \
+ parts/part_17.o \
+ parts/part_18.o \
+ parts/part_19.o \
+ parts/part_21.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_34.o \
part_35.o \
text.o \
part_main.o \
diff --git a/engines/igor/part_0.cpp b/engines/igor/parts/part_0.cpp
similarity index 100%
rename from engines/igor/part_0.cpp
rename to engines/igor/parts/part_0.cpp
diff --git a/engines/igor/part_1.cpp b/engines/igor/parts/part_1.cpp
similarity index 100%
rename from engines/igor/part_1.cpp
rename to engines/igor/parts/part_1.cpp
diff --git a/engines/igor/part_10.cpp b/engines/igor/parts/part_10.cpp
similarity index 100%
rename from engines/igor/part_10.cpp
rename to engines/igor/parts/part_10.cpp
diff --git a/engines/igor/part_11.cpp b/engines/igor/parts/part_11.cpp
similarity index 100%
rename from engines/igor/part_11.cpp
rename to engines/igor/parts/part_11.cpp
diff --git a/engines/igor/part_12.cpp b/engines/igor/parts/part_12.cpp
similarity index 100%
rename from engines/igor/part_12.cpp
rename to engines/igor/parts/part_12.cpp
diff --git a/engines/igor/part_17.cpp b/engines/igor/parts/part_17.cpp
similarity index 100%
rename from engines/igor/part_17.cpp
rename to engines/igor/parts/part_17.cpp
diff --git a/engines/igor/part_18.cpp b/engines/igor/parts/part_18.cpp
similarity index 100%
rename from engines/igor/part_18.cpp
rename to engines/igor/parts/part_18.cpp
diff --git a/engines/igor/part_19.cpp b/engines/igor/parts/part_19.cpp
similarity index 100%
rename from engines/igor/part_19.cpp
rename to engines/igor/parts/part_19.cpp
diff --git a/engines/igor/part_2.cpp b/engines/igor/parts/part_2.cpp
similarity index 100%
rename from engines/igor/part_2.cpp
rename to engines/igor/parts/part_2.cpp
diff --git a/engines/igor/part_21.cpp b/engines/igor/parts/part_21.cpp
similarity index 100%
rename from engines/igor/part_21.cpp
rename to engines/igor/parts/part_21.cpp
diff --git a/engines/igor/part_23.cpp b/engines/igor/parts/part_23.cpp
similarity index 100%
rename from engines/igor/part_23.cpp
rename to engines/igor/parts/part_23.cpp
diff --git a/engines/igor/part_24.cpp b/engines/igor/parts/part_24.cpp
similarity index 100%
rename from engines/igor/part_24.cpp
rename to engines/igor/parts/part_24.cpp
diff --git a/engines/igor/part_25.cpp b/engines/igor/parts/part_25.cpp
similarity index 100%
rename from engines/igor/part_25.cpp
rename to engines/igor/parts/part_25.cpp
diff --git a/engines/igor/part_26.cpp b/engines/igor/parts/part_26.cpp
similarity index 100%
rename from engines/igor/part_26.cpp
rename to engines/igor/parts/part_26.cpp
diff --git a/engines/igor/part_27.cpp b/engines/igor/parts/part_27.cpp
similarity index 100%
rename from engines/igor/part_27.cpp
rename to engines/igor/parts/part_27.cpp
diff --git a/engines/igor/part_28.cpp b/engines/igor/parts/part_28.cpp
similarity index 100%
rename from engines/igor/part_28.cpp
rename to engines/igor/parts/part_28.cpp
diff --git a/engines/igor/part_30.cpp b/engines/igor/parts/part_30.cpp
similarity index 100%
rename from engines/igor/part_30.cpp
rename to engines/igor/parts/part_30.cpp
diff --git a/engines/igor/part_34.cpp b/engines/igor/parts/part_34.cpp
similarity index 100%
rename from engines/igor/part_34.cpp
rename to engines/igor/parts/part_34.cpp
diff --git a/engines/igor/part_35.cpp b/engines/igor/parts/part_35.cpp
similarity index 100%
rename from engines/igor/part_35.cpp
rename to engines/igor/parts/part_35.cpp
diff --git a/engines/igor/part_4.cpp b/engines/igor/parts/part_4.cpp
similarity index 100%
rename from engines/igor/part_4.cpp
rename to engines/igor/parts/part_4.cpp
diff --git a/engines/igor/part_5.cpp b/engines/igor/parts/part_5.cpp
similarity index 100%
rename from engines/igor/part_5.cpp
rename to engines/igor/parts/part_5.cpp
diff --git a/engines/igor/part_6.cpp b/engines/igor/parts/part_6.cpp
similarity index 100%
rename from engines/igor/part_6.cpp
rename to engines/igor/parts/part_6.cpp
diff --git a/engines/igor/part_7.cpp b/engines/igor/parts/part_7.cpp
similarity index 100%
rename from engines/igor/part_7.cpp
rename to engines/igor/parts/part_7.cpp
diff --git a/engines/igor/part_8.cpp b/engines/igor/parts/part_8.cpp
similarity index 100%
rename from engines/igor/part_8.cpp
rename to engines/igor/parts/part_8.cpp
diff --git a/engines/igor/part_85.cpp b/engines/igor/parts/part_85.cpp
similarity index 100%
rename from engines/igor/part_85.cpp
rename to engines/igor/parts/part_85.cpp
diff --git a/engines/igor/part_9.cpp b/engines/igor/parts/part_9.cpp
similarity index 100%
rename from engines/igor/part_9.cpp
rename to engines/igor/parts/part_9.cpp
diff --git a/engines/igor/part_90.cpp b/engines/igor/parts/part_90.cpp
similarity index 100%
rename from engines/igor/part_90.cpp
rename to engines/igor/parts/part_90.cpp
Commit: b3bee97b6e1a5a00a02d6cdd403719922968d1ee
https://github.com/scummvm/scummvm/commit/b3bee97b6e1a5a00a02d6cdd403719922968d1ee
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:15+01:00
Commit Message:
IGOR: Fix dean drinkin animation glitch
Changed paths:
engines/igor/igor.h
engines/igor/module.mk
engines/igor/parts/part_0.cpp
engines/igor/parts/part_1.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_7.cpp
engines/igor/parts/part_8.cpp
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index a01a1c07b0a..a310ab46eb7 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -482,10 +482,10 @@ private:
void PART_00();
void PART_00_EXEC_ACTION(int action);
void PART_00_APPLY_OBJECT_STATE(int num);
- void PART_00_DRAW_RAW_FRAME(int srcOffset, int frame, int frameSize, int width, int height, int dstOffset);
- void PART_00_ANIMATE_RAW(int srcOffset, int firstFrame, int lastFrame, int frameSize, int width, int height, int dstOffset, int delay, int soundFrame, int sound);
+ void part_00_drawRawFrame(int srcOffset, int frame, int frameSize, int width, int height, int dstOffset);
+ void PART_00_animateRaw(int srcOffset, int firstFrame, int lastFrame, int frameSize, int width, int height, int dstOffset, int delay, int soundFrame, int sound);
void PART_00_ENTRY_ANIMATION();
- void PART_00_WALK_IN();
+ void PART_00_WALK_IN_FROM_CLOSET();
void PART_00_ENTER_FROM_BELOW();
void PART_01();
void PART_01_EXEC_ACTION(int action);
@@ -548,19 +548,19 @@ private:
void PART_08();
void PART_08_EXEC_ACTION(int action);
void PART_08_APPLY_OBJECT_STATE(int num);
- void PART_08_ANIMATE_DOOR(bool open);
+ void drawDoor(bool open);
void PART_08_ACTION_105();
- void PART_08_ACTION_108();
+ void PART_08_ACTION_108_deanCallsSecretary();
void PART_08_ACTION_109();
void PART_08_ACTION_103_TALK_TO_DEAN();
- void PART_08_ACTION_114();
- void PART_08_DEAN_LEAVES();
+ void giveBottleToDean();
+ void PART_08_DEAN_PASSES_OUT();
void PART_08_DEAN_DRINKS();
void PART_08_HANDLE_DIALOGUE_DEAN();
- void PART_08_DRAW_DEAN();
- void PART_08_DRAW_DEAN_DIALOGUE_FRAME(int frame);
+ void drawDean();
+ void drawDeanTalkingFrame(int frame);
void PART_08_UPDATE_DIALOGUE_DEAN(int action);
- void PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(int frame);
+ void drawSecretaryTalkingFrame(int frame);
void PART_08_UPDATE_DIALOGUE_SECRETARY(int action);
void PART_09();
void PART_09_EXEC_ACTION(int action);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index a4f4652a3d4..6f51f8b37d9 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -40,7 +40,7 @@ MODULE_OBJS = \
parts/part_28.o \
parts/part_30.o \
parts/part_34.o \
- part_35.o \
+ parts/part_35.o \
text.o \
part_main.o \
sound.o
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 25e1071aa6f..d0367f4e786 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -23,7 +23,7 @@
namespace Igor {
-void IgorEngine::PART_00_DRAW_RAW_FRAME(int srcOffset, int frame, int frameSize,
+void IgorEngine::part_00_drawRawFrame(int srcOffset, int frame, int frameSize,
int width, int height, int dstOffset) {
const uint8 *src = _animFramesBuffer + srcOffset + frame * frameSize;
@@ -45,12 +45,12 @@ void IgorEngine::PART_00_DRAW_RAW_FRAME(int srcOffset, int frame, int frameSize,
memcpy(_screenVGA + dstOffset + y * 320, _screenTempLayer + y * 100, width);
}
-void IgorEngine::PART_00_ANIMATE_RAW(int srcOffset, int firstFrame, int lastFrame,
+void IgorEngine::PART_00_animateRaw(int srcOffset, int firstFrame, int lastFrame,
int frameSize, int width, int height, int dstOffset, int delay,
int soundFrame, int sound) {
const int step = firstFrame <= lastFrame ? 1 : -1;
for (int frame = firstFrame;; frame += step) {
- PART_00_DRAW_RAW_FRAME(srcOffset, frame, frameSize, width, height, dstOffset);
+ part_00_drawRawFrame(srcOffset, frame, frameSize, width, height, dstOffset);
if (frame == soundFrame)
playSound(sound, 1);
if (frame != lastFrame)
@@ -93,14 +93,14 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
case 101: // open window
if (_objectsState[13] != 1) {
- PART_00_ANIMATE_RAW(0, 1, 3, 0x480, 36, 32, 0x6B2C, 62, 2, 1);
+ PART_00_animateRaw(0, 1, 3, 0x480, 36, 32, 0x6B2C, 62, 2, 1);
_objectsState[13] = 1;
PART_00_APPLY_OBJECT_STATE(6);
}
break;
case 102: // close window
if (_objectsState[13] == 1) {
- PART_00_ANIMATE_RAW(0, 2, 0, 0x480, 36, 32, 0x6B2C, 62, 2, 2);
+ PART_00_animateRaw(0, 2, 0, 0x480, 36, 32, 0x6B2C, 62, 2, 2);
_objectsState[13] = 2;
PART_00_APPLY_OBJECT_STATE(6);
}
@@ -119,7 +119,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
startIgorDialogue();
break;
}
- PART_00_ANIMATE_RAW(0x4D8A, 0, 1, 0x5DC, 30, 50, 0x6B2C, 62, -1, 0);
+ PART_00_animateRaw(0x4D8A, 0, 1, 0x5DC, 30, 50, 0x6B2C, 62, -1, 0);
_objectsState[13] = 2;
_objectsState[15] = 1;
_currentPart = 10;
@@ -131,14 +131,14 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
break;
case 106: // open bedside table
if (_objectsState[8] == 0) {
- PART_00_ANIMATE_RAW(0x3FC8, 0, 2, 0x436, 22, 49, 0x693C, 126, 2, 6);
+ PART_00_animateRaw(0x3FC8, 0, 2, 0x436, 22, 49, 0x693C, 126, 2, 6);
_objectsState[8] = 1;
PART_00_APPLY_OBJECT_STATE(1);
}
break;
case 107: // close bedside table
if (_objectsState[8] != 0) {
- PART_00_ANIMATE_RAW(0x3FC8, 2, 0, 0x436, 22, 49, 0x693C, 126, 1, 6);
+ PART_00_animateRaw(0x3FC8, 2, 0, 0x436, 22, 49, 0x693C, 126, 1, 6);
_objectsState[8] = 0;
PART_00_APPLY_OBJECT_STATE(1);
}
@@ -155,7 +155,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
break;
case 109: // take alarm clock
if (_objectsState[9] == 0) {
- PART_00_ANIMATE_RAW(0x8410, 0, 1, 0x405, 21, 49, 0x693D, 126, -1, 0);
+ PART_00_animateRaw(0x8410, 0, 1, 0x405, 21, 49, 0x693D, 126, -1, 0);
addObjectToInventory(6, 41); // s3:0903; cseg206:113C-1176
_objectsState[9] = 1;
PART_00_APPLY_OBJECT_STATE(1);
@@ -163,14 +163,14 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
break;
case 110: // open closet
if (_objectsState[10] == 0) {
- PART_00_ANIMATE_RAW(0x1678, 0, 2, 0x940, 37, 64, 0x556C, 126, 2, 3);
+ PART_00_animateRaw(0x1678, 0, 2, 0x940, 37, 64, 0x556C, 126, 2, 3);
_objectsState[10] = 1;
PART_00_APPLY_OBJECT_STATE(3);
}
break;
case 111: // close closet
if (_objectsState[10] != 0) {
- PART_00_ANIMATE_RAW(0x1678, 2, 0, 0x940, 37, 64, 0x556C, 126, 1, 4);
+ PART_00_animateRaw(0x1678, 2, 0, 0x940, 37, 64, 0x556C, 126, 1, 4);
_objectsState[10] = 0;
PART_00_APPLY_OBJECT_STATE(3);
}
@@ -188,7 +188,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
case 114: // go through hole
if (_objectsState[10] == 0)
PART_00_EXEC_ACTION(110);
- PART_00_ANIMATE_RAW(0x5942, 0, 2, 0x44C, 22, 50, 0x66EE, 30, -1, 0);
+ PART_00_animateRaw(0x5942, 0, 2, 0x44C, 22, 50, 0x66EE, 30, -1, 0);
_currentPart = 24;
break;
case 115: // look at records
@@ -198,7 +198,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
break;
case 116: // take records
if (_objectsState[12] == 0) {
- PART_00_ANIMATE_RAW(0x7C06, 0, 1, 0x405, 21, 49, 0x7146, 126, -1, 0);
+ PART_00_animateRaw(0x7C06, 0, 1, 0x405, 21, 49, 0x7146, 126, -1, 0);
addObjectToInventory(5, 40); // s3:0902; cseg206:0F75-0FAF
_objectsState[12] = 1;
PART_00_APPLY_OBJECT_STATE(255);
@@ -252,10 +252,10 @@ void IgorEngine::PART_00_ENTRY_ANIMATION() {
playSound(3, 1);
waitForTimer(30);
}
- PART_00_ANIMATE_RAW(0x6626, 0, 3, 0x578, 25, 56, 0x5F6E, 30, -1, 0);
+ PART_00_animateRaw(0x6626, 0, 3, 0x578, 25, 56, 0x5F6E, 30, -1, 0);
}
-void IgorEngine::PART_00_WALK_IN() {
+void IgorEngine::PART_00_WALK_IN_FROM_CLOSET() {
PART_00_ENTRY_ANIMATION();
WalkData *wd = &_walkData[0];
wd->setPos(120, 131, kFacingPositionFront, 0);
@@ -336,7 +336,7 @@ void IgorEngine::PART_00() {
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
if (_currentPart == 1)
- PART_00_WALK_IN();
+ PART_00_WALK_IN_FROM_CLOSET();
else
PART_00_ENTER_FROM_BELOW();
}
diff --git a/engines/igor/parts/part_1.cpp b/engines/igor/parts/part_1.cpp
index ea147b0e1a0..5d42f23f9f1 100644
--- a/engines/igor/parts/part_1.cpp
+++ b/engines/igor/parts/part_1.cpp
@@ -13,7 +13,7 @@ namespace Igor {
void IgorEngine::PART_01_CLOSE_WINDOW() {
static const uint8 windowFrames[] = { 0, 1, 2, 1 };
for (int i = 0; i < 4; ++i) {
- PART_00_DRAW_RAW_FRAME(216, windowFrames[i], 1204, 28, 43, 0x5919);
+ part_00_drawRawFrame(216, windowFrames[i], 1204, 28, 43, 0x5919);
if (i == 0)
playSound(2, 1);
if (i != 3) {
@@ -121,7 +121,7 @@ void IgorEngine::PART_01_EXEC_ACTION(int action) {
// waiting for the video update after each one, then
// changes to part 20.
for (int frame = 0; frame <= 1; ++frame) {
- PART_00_DRAW_RAW_FRAME(0x0EF4, frame, 0x3D8, 24, 41, 0x51F4);
+ part_00_drawRawFrame(0x0EF4, frame, 0x3D8, 24, 41, 0x51F4);
waitForTimer(); // video-update wait
}
_currentPart = 20;
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index 49f5c94e76f..c4400efc7d7 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -18,7 +18,7 @@ void IgorEngine::PART_02_START_DIALOGUE(int text, int count, int sound) {
void IgorEngine::PART_02_SEARCH_TRUNK() {
for (int frame = 0; frame <= 2; ++frame) {
- PART_00_ANIMATE_RAW(0x3C0 + frame * 0x715, 0, 0, 0x715, 37, 49, 0x608C, 0, -1, 0);
+ PART_00_animateRaw(0x3C0 + frame * 0x715, 0, 0, 0x715, 37, 49, 0x608C, 0, -1, 0);
if (frame > 0)
waitForTimer(127);
}
@@ -127,7 +127,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
PART_02_START_DIALOGUE(201, 1, 108);
break;
}
- PART_00_ANIMATE_RAW(0x18FF, 1, 2, 0x715, 37, 49, 0x608C, 127, 1, 7);
+ PART_00_animateRaw(0x18FF, 1, 2, 0x715, 37, 49, 0x608C, 127, 1, 7);
_objectsState[16] = 1;
PART_02_APPLY_OBJECT_STATE(1);
break;
@@ -137,14 +137,14 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
break;
}
playSound(8, 1);
- PART_00_ANIMATE_RAW(0x18FF, 1, 0, 0x715, 37, 49, 0x608C, 127, -1, 0);
+ PART_00_animateRaw(0x18FF, 1, 0, 0x715, 37, 49, 0x608C, 127, -1, 0);
_objectsState[16] = 0;
PART_02_APPLY_OBJECT_STATE(1);
break;
case 103: { // hammer the nail
for (int step = 1; step <= 21; ++step) {
const int frame = step == 21 ? 2 : ((step + 1) & 1);
- PART_00_ANIMATE_RAW(0x33BA + frame * 0x4B0, 0, 0, 0x4B0,
+ PART_00_animateRaw(0x33BA + frame * 0x4B0, 0, 0, 0x4B0,
24, 50, 0x5989, 0, -1, 0);
if ((step & 1) != 0 && step < 21)
playSound(9, 1);
@@ -166,7 +166,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
// 0/1 and finish on frame 2 (indexed from s3:0x0249).
for (int step = 1; step <= 21; ++step) {
const int frame = step == 21 ? 2 : ((step + 1) & 1);
- PART_00_ANIMATE_RAW(0x41CA + frame * 0x658, 0, 0, 0x658,
+ PART_00_animateRaw(0x41CA + frame * 0x658, 0, 0, 0x658,
29, 56, 0x5349, 0, -1, 0);
if ((step & 1) != 0 && step < 21)
playSound(10, 1);
@@ -228,7 +228,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
break;
case 107: // take butterfly net; cseg203:0D71-0F3E
- PART_00_ANIMATE_RAW(0x54D2, 0, 1, 0x405, 21, 49, 0x5A6D, 127, -1, 0);
+ PART_00_animateRaw(0x54D2, 0, 1, 0x405, 21, 49, 0x5A6D, 127, -1, 0);
waitForTimer(127);
addObjectToInventory(7, 42);
_objectsState[17] = 1;
@@ -253,7 +253,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
PART_02_START_DIALOGUE(216, 1, 120);
break;
case 113: // place dynamite in the crack
- PART_00_ANIMATE_RAW(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
+ PART_00_animateRaw(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
waitForTimer(127);
_objectsState[23] = 1;
PART_02_APPLY_OBJECT_STATE(8);
@@ -279,7 +279,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
break;
case 119:
- PART_00_ANIMATE_RAW(0xB488, 0, 1, 0x4B0, 24, 50, 0x5988, 64, -1, 0);
+ PART_00_animateRaw(0xB488, 0, 1, 0x4B0, 24, 50, 0x5988, 64, -1, 0);
waitForTimer(64);
_currentPart = 1;
break;
@@ -301,7 +301,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
} else {
memset(_screenVGA + 0xB400, 0, 0x4BFF);
playSound(68, 1);
- PART_00_ANIMATE_RAW(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
+ PART_00_animateRaw(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
waitForTimer(127);
@@ -388,7 +388,7 @@ void IgorEngine::PART_02() {
case 20:
fadeIn(768);
// Igor climbs through the window on the first attic entrance.
- PART_00_ANIMATE_RAW(0x69C0, 0, 2, 0x759, 33, 57, 0x4B26, 31, -1, 0);
+ PART_00_animateRaw(0x69C0, 0, 2, 0x759, 33, 57, 0x4B26, 31, -1, 0);
waitForTimer(31);
_walkData[0].setPos(57, 117, kFacingPositionRight, 0);
break;
@@ -410,7 +410,7 @@ void IgorEngine::PART_02() {
// the attic palette before drawing its post-explosion frame.
memset(_screenVGA + 0xB400, 0, 0x4600);
memcpy(_currentPalette, _paletteBuffer, 768);
- PART_00_DRAW_RAW_FRAME(0x820B, 0, 0xA19, 47, 55, 0x6C3B);
+ part_00_drawRawFrame(0x820B, 0, 0xA19, 47, 55, 0x6C3B);
updatePalette(768);
// Igor lies stunned, stands up, and shakes his head.
@@ -420,7 +420,7 @@ void IgorEngine::PART_02() {
};
for (uint i = 0; i < ARRAYSIZE(postExplosionFrames); ++i) {
const int frame = postExplosionFrames[i];
- PART_00_DRAW_RAW_FRAME(0x820B, frame, 0xA19, 47, 55, 0x6C3B);
+ part_00_drawRawFrame(0x820B, frame, 0xA19, 47, 55, 0x6C3B);
if (frame == 0)
waitForTimer(2 * 255);
else if (frame == 1 || frame == 2)
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index 9a875a7ead3..932d3fba869 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -90,6 +90,7 @@ void IgorEngine::PART_07_ENTER_FROM_OUTSIDE() {
}
_walkDataLastIndex = 0;
+ // first time read notice board
if (!_part07FirstVisitDone) {
buildWalkPath(109, 143, 180, 129);
_walkData[_walkDataLastIndex].frameNum = 0;
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index 1f68ac2cc62..0094928cad4 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -51,7 +51,7 @@ void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_08_ANIMATE_DOOR(bool open) {
+void IgorEngine::drawDoor(bool open) {
if ((_objectsState[26] != 0) == open) {
const int text = open ? 19 : 23;
ADD_DIALOGUE_TEXT(text, 1, text);
@@ -77,7 +77,7 @@ void IgorEngine::PART_08_ANIMATE_DOOR(bool open) {
PART_08_APPLY_OBJECT_STATE(1);
}
-void IgorEngine::PART_08_DRAW_DEAN() {
+void IgorEngine::drawDean() {
for (int y = 0; y <= 25; ++y) {
const uint8 *src = _animFramesBuffer + 0x23FE + y * 34;
memcpy(_screenVGA + 0x6BC3 + y * 320, src, 34);
@@ -85,7 +85,7 @@ void IgorEngine::PART_08_DRAW_DEAN() {
}
}
-void IgorEngine::PART_08_DRAW_DEAN_DIALOGUE_FRAME(int frame) {
+void IgorEngine::drawDeanTalkingFrame(int frame) {
for (int y = 0; y <= 21; ++y) {
const uint8 *src = _animFramesBuffer + 0x4E6B + frame * 0x226 + y * 25;
memcpy(_screenVGA + 0x6BC6 + y * 320, src, 25);
@@ -97,10 +97,10 @@ void IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PART_08_DRAW_DEAN_DIALOGUE_FRAME(0);
+ drawDeanTalkingFrame(0);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_08_DRAW_DEAN_DIALOGUE_FRAME(getRandomNumber(6));
+ drawDeanTalkingFrame(getRandomNumber(6));
break;
}
}
@@ -146,7 +146,7 @@ void IgorEngine::PART_08_ACTION_109() {
_objectsState[28] = 1;
}
-void IgorEngine::PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(int frame) {
+void IgorEngine::drawSecretaryTalkingFrame(int frame) {
const uint16 frameOffset = READ_LE_UINT16(_animFramesBuffer + 0xE240 + frame * 2);
decodeAnimFrame(_animFramesBuffer + 0x9AC8 + frameOffset - 1, _screenVGA, true);
}
@@ -155,22 +155,22 @@ void IgorEngine::PART_08_UPDATE_DIALOGUE_SECRETARY(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(1);
+ drawSecretaryTalkingFrame(1);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(getRandomNumber(2) + 2);
+ drawSecretaryTalkingFrame(getRandomNumber(2) + 2);
break;
}
}
-void IgorEngine::PART_08_ACTION_108() {
+void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
const int currentPart = _currentPart;
const int actionFrameOffset = _objectsState[31] == 0 ? 0x2773 : 0x328D;
playSound(60, 1);
+
for (int frame = 0; frame <= 1; ++frame) {
for (int y = 0; y <= 48; ++y)
- memcpy(_screenVGA + 0x6D1E + y * 320,
- _animFramesBuffer + actionFrameOffset - 1 + frame * 0x58D + y * 29, 29);
+ memcpy(_screenVGA + 0x6D1E + y * 320, _animFramesBuffer + actionFrameOffset - 1 + frame * 0x58D + y * 29, 29);
if (frame == 0)
waitForTimer(127);
}
@@ -178,11 +178,9 @@ void IgorEngine::PART_08_ACTION_108() {
_currentPart = 91;
fadeOut(768);
loadActionData(DAT_AdministrationSecretaryRoom);
- loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom,
- BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom,
- TXT_AdministrationSecretaryRoom);
+ loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom, BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom, TXT_AdministrationSecretaryRoom);
memcpy(_screenVGA, _screenLayer1, 46080);
- PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(1);
+ drawSecretaryTalkingFrame(1);
memcpy(_screenLayer1, _screenVGA, 46080);
fadeIn(624);
@@ -194,7 +192,7 @@ void IgorEngine::PART_08_ACTION_108() {
_updateDialogue = 0;
for (int frame = 5; frame <= 19; ++frame) {
- PART_08_DRAW_SECRETARY_CUTAWAY_FRAME(frame);
+ drawSecretaryTalkingFrame(frame);
if (frame < 19)
waitForTimer(31);
else
@@ -202,14 +200,9 @@ void IgorEngine::PART_08_ACTION_108() {
}
waitForTimer(255);
fadeOut(624);
- // The two stores this port used to do here (_objectsState[53] = 0 and
- // _objectsState[61] = 1) have no counterpart in cseg189, which writes only
- // s3:0x856, s3:0x858-0x85C, s3:0x865 and s3:0x866. s3:0x879 (index 61) is
- // part_5/part_6's flag, so that store was corrupting another room.
loadActionData(DAT_DeanPepperOffice);
- loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice,
- BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice);
+ loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice, BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice);
_roomDataOffsets = PART_08_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
PART_08_APPLY_OBJECT_STATE(255);
@@ -222,14 +215,14 @@ void IgorEngine::PART_08_ACTION_108() {
_objectsState[32] = 1;
}
-void IgorEngine::PART_08_DEAN_LEAVES() {
+void IgorEngine::PART_08_DEAN_PASSES_OUT() {
static const uint8 frames[] = {
3, 1, 2, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5,
4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 7, 8, 9
};
- PART_08_DRAW_DEAN();
+ drawDean();
for (uint i = 0; i < ARRAYSIZE(frames); ++i) {
- decodeAnimFrame(getAnimFrame(0x76DD, 0x8475, frames[i]), _screenVGA, true);
+ decodeAnimFrame(getAnimFrame(0x76DD, 0xD98, frames[i]), _screenVGA, true);
waitForTimer(31);
}
}
@@ -288,7 +281,7 @@ void IgorEngine::PART_08_ACTION_103_TALK_TO_DEAN() {
}
if (_objectsState[26] == 1) { // door open
- PART_08_DRAW_DEAN();
+ drawDean();
ADD_DIALOGUE_TEXT(220, 1, 166);
ADD_DIALOGUE_TEXT(221, 1, 167);
SET_DIALOGUE_TEXT(1, 2);
@@ -303,7 +296,8 @@ void IgorEngine::PART_08_ACTION_103_TALK_TO_DEAN() {
PART_08_APPLY_OBJECT_STATE(255);
}
-void IgorEngine::PART_08_ACTION_114() {
+void IgorEngine::giveBottleToDean() {
+
if (_objectsState[29] == 1) {
ADD_DIALOGUE_TEXT(227, 1, 172);
SET_DIALOGUE_TEXT(1, 1);
@@ -319,14 +313,15 @@ void IgorEngine::PART_08_ACTION_114() {
return;
}
- PART_08_DRAW_DEAN();
+ drawDean();
ADD_DIALOGUE_TEXT(210, 2, 158);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- static const uint8 deanFrames[] = { 1, 2, 3, 0 }; // dseg231:0x01DE,0x01E0,0x01E2,0x01E4
- static const uint8 igorFrames[] = { 0, 1, 2, 3 }; // dseg231:0x01DF,0x01E1,0x01E3,0x01E5
+ static const uint8 deanFrames[] = { 1, 2, 3, 0 };
+ static const uint8 igorFrames[] = { 0, 1, 2, 3 };
+
for (int step = 0; step < 4; ++step) {
if (deanFrames[step] != 0) {
for (int y = 0; y <= 48; ++y) {
@@ -343,8 +338,7 @@ void IgorEngine::PART_08_ACTION_114() {
waitForTimer(41);
}
- // The original removes object slot 58 here and plays sound 63 only after
- // the conversation has completed.
+
if (_inventoryInfo[58] != 0) {
_inventoryInfo[_inventoryInfo[58] - 1] = 0;
_inventoryInfo[58] = 0;
@@ -371,7 +365,7 @@ void IgorEngine::PART_08_ACTION_114() {
void IgorEngine::PART_08_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // exit office
if (_objectsState[26] == 0) {
_currentPart = 71;
break;
@@ -388,7 +382,7 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
waitForIgorMove();
if (_objectsState[30] != 0) {
waitForTimer(251);
- PART_08_DEAN_LEAVES();
+ PART_08_DEAN_PASSES_OUT();
if (_objectsState[42] == 1)
_objectsState[42] = 2;
else
@@ -404,13 +398,13 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
_currentPart = 71;
}
break;
- case 102:
+ case 102: // Look at window
ADD_DIALOGUE_TEXT(202, 1, 153);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 104:
+ case 104: // Look at dean
if (_objectsState[29] == 1)
ADD_DIALOGUE_TEXT(222, 1, 168);
else
@@ -419,19 +413,19 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 107:
+ case 107: // look at intercom
ADD_DIALOGUE_TEXT(205, 2, 155);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 110:
+ case 110: // look at bookcase
ADD_DIALOGUE_TEXT(207, 2, 156);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 111:
+ case 111: // look at door
ADD_DIALOGUE_TEXT(209, 1, 157);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -455,7 +449,7 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
startIgorDialogue();
waitForEndOfIgorDialogue();
} else {
- PART_08_ACTION_108();
+ PART_08_ACTION_108_deanCallsSecretary();
}
break;
case 109:
@@ -474,13 +468,13 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
}
break;
case 114:
- PART_08_ACTION_114();
+ giveBottleToDean();
break;
case 112:
- PART_08_ANIMATE_DOOR(true);
+ drawDoor(true);
break;
case 113:
- PART_08_ANIMATE_DOOR(false);
+ drawDoor(false);
break;
default:
warning("PART_08_EXEC_ACTION unhandled action %d", action);
@@ -491,8 +485,7 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
void IgorEngine::PART_08() {
_gameState.enableLight = 1;
loadActionData(DAT_DeanPepperOffice);
- loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice,
- BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice);
+ loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice, BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice);
static const int anim[] = {
FRM_DeanPepperOffice1, FRM_DeanPepperOffice2,
FRM_DeanPepperOffice3, FRM_DeanPepperOffice4,
@@ -508,6 +501,7 @@ void IgorEngine::PART_08() {
_roomDataOffsets = PART_08_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
PART_08_APPLY_OBJECT_STATE(255);
+
memcpy(_screenVGA, _screenLayer1, 46080);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 9d7207a7c94..a95da79dda6 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -242,7 +242,7 @@ const RoomDataOffsets IgorEngine::PART_07_ROOM_DATA_OFFSETS = {
const RoomDataOffsets IgorEngine::PART_08_ROOM_DATA_OFFSETS = {
{ 80, 4, 12, 3 },
{ 149, 162 },
- { 167, 385, 3401, 271, 347, 84 },
+ { 167, 375, 3391, 271, 347, 84 },
{
165, 30,
5188, 100,
Commit: 8d66181fd204b666c4ade2196f190d6ce2b126cd
https://github.com/scummvm/scummvm/commit/8d66181fd204b666c4ade2196f190d6ce2b126cd
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:15+01:00
Commit Message:
IGOR: Implement Part 9 secretary dialogue
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_18.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_9.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index a310ab46eb7..6b6c30974ab 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -566,6 +566,14 @@ private:
void PART_09_EXEC_ACTION(int action);
void PART_09_APPLY_OBJECT_STATE(int num);
void PART_09_ANIMATE_DOOR(bool open);
+ void PART_09_DRAW_SECRETARY_FRAME(int frame, bool background);
+ void PART_09_DRAW_DRAWER_FRAME(int frame);
+ void PART_09_ACTION_101();
+ void PART_09_ACTION_106(bool search);
+ void PART_09_ACTION_110();
+ void PART_09_UPDATE_DIALOGUE_SECRETARY(int action);
+ void PART_09_SECRETARY_GESTURE();
+ void PART_09_UPDATE_ROOM_BACKGROUND();
// Decanato right
void PART_10();
@@ -630,7 +638,7 @@ private:
// men toilets
void PART_18_EXEC_ACTION(int action);
- void PART_18_ACTION_109();
+ void PART_18_ACTION_109_useSlugOnGrating();
void PART_18_ACTION_111();
void PART_18_HELPER_1(int num);
void PART_18_HELPER_2();
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index 3b22f4f6c6d..0504836886a 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -25,53 +25,53 @@ namespace Igor {
void IgorEngine::PART_18_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // look at grating
ADD_DIALOGUE_TEXT(201, 1, 896);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 102:
+ case 102: // look at door
ADD_DIALOGUE_TEXT(202, 1, 897);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 103:
+ case 103: // use left-most door
ADD_DIALOGUE_TEXT(205, 1, 899);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(99, 54, 43, 63, 0);
waitForEndOfCutsceneDialogue(99, 54, 43, 63, 0);
break;
- case 104:
+ case 104: // use middle door
ADD_DIALOGUE_TEXT(206, 1, 900);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(132, 55, 63, 42, 0);
waitForEndOfCutsceneDialogue(132, 55, 63, 42, 0);
break;
- case 105:
+ case 105: // use right-most door
ADD_DIALOGUE_TEXT(207, 1, 901);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(167, 56, 0, 42, 42);
waitForEndOfCutsceneDialogue(167, 56, 0, 42, 42);
break;
- case 106:
+ case 106: // look at dryer
ADD_DIALOGUE_TEXT(208, 1, 902);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 107:
+ case 107: // look at tap
ADD_DIALOGUE_TEXT(209, 1, 903);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 108:
+ case 108: // use tap
ADD_DIALOGUE_TEXT(210, 1, 904);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 109:
- PART_18_ACTION_109();
+ case 109: // use slug on grating
+ PART_18_ACTION_109_useSlugOnGrating();
break;
- case 110:
+ case 110: // leave
_currentPart = 252;
break;
case 111:
@@ -83,7 +83,7 @@ void IgorEngine::PART_18_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_18_ACTION_109() {
+void IgorEngine::PART_18_ACTION_109_useSlugOnGrating() {
const int offset = 29480;
for (int i = 1; i <= 2; ++i) {
for (int j = 1; j <= 48; ++j) {
@@ -94,8 +94,11 @@ void IgorEngine::PART_18_ACTION_109() {
int part = _currentPart;
_currentPart = 191;
fadeOut(768);
+ // loads part 19
PART_19();
+
memcpy(_screenVGA, _screenLayer2, 46080);
+
loadResourceData__ROOM_MenToilets();
loadResourceData__ANIM_MenToilets();
loadActionData(DAT_MenToilets);
@@ -103,8 +106,10 @@ void IgorEngine::PART_18_ACTION_109() {
setRoomWalkBounds(0, 0, 319, 143);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_18_EXEC_ACTION);
PART_18_HELPER_1(255);
+ // paints bottom of screen black
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
+ drawInventory(1, 0);
removeObjectFromInventory(53);
fadeIn(768);
_currentPart = part;
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index e019e4f659b..e1b41189c40 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -302,7 +302,9 @@ void IgorEngine::PART_19() {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_19_HELPER_3();
+ if(_currentPart != 191) {
+ PART_19_HELPER_3();
+ }
if (_objectsState[59] == 0) {
PART_19_HELPER_4();
} else {
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index ae50cb7b44f..1bb8956e6d8 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -10,6 +10,15 @@
namespace Igor {
+void IgorEngine::PART_09_DRAW_SECRETARY_FRAME(int frame, bool background) {
+ for (int y = 0; y <= 46; ++y) {
+ const uint8 *src = _animFramesBuffer + frame * 0x34E + y * 18;
+ memcpy(_screenVGA + 0x7839 + y * 320, src, 18);
+ if (background)
+ memcpy(_screenLayer1 + 0x7839 + y * 320, src, 18);
+ }
+}
+
void IgorEngine::PART_09_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
const uint32 srcOffset = _objectsState[27] == 0 ? 0x5D0B : 0x61A3;
@@ -23,15 +32,29 @@ void IgorEngine::PART_09_APPLY_OBJECT_STATE(int num) {
memcpy(_screenLayer1 + 0x48E6 + y * 320, _animFramesBuffer + srcOffset + y * 20, 20);
_roomObjectAreasTable[4].object = (_objectsState[34] == 0 || _objectsState[36] != 0) ? 3 : 5;
}
+ if (num == 3 || num == 255) {
+ if (_objectsState[35] == 0) {
+ PART_09_DRAW_SECRETARY_FRAME(1, true);
+ _roomObjectAreasTable[6].object = 2;
+ _roomObjectAreasTable[15].object = 2;
+ _roomObjectAreasTable[15].area = 0;
+ _roomObjectAreasTable[16].area = 0;
+ } else {
+ _roomObjectAreasTable[6].object = 0;
+ _roomObjectAreasTable[15].object = 0;
+ _roomActionsTable[151] = 0xB5;
+ _roomActionsTable[152] = 0xB1;
+ _roomActionsTable[189] = 1;
+ _roomActionsTable[201] = 13;
+ _roomActionsTable[205] = 35;
+ _roomActionsTable[207] = 35;
+ }
+ }
}
void IgorEngine::PART_09_ANIMATE_DOOR(bool open) {
if ((_objectsState[27] != 0) == open) {
- const int text = open ? 19 : 23;
- ADD_DIALOGUE_TEXT(text, 1, text);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ executeAction(open ? 11 : 14);
return;
}
@@ -50,20 +73,175 @@ void IgorEngine::PART_09_ANIMATE_DOOR(bool open) {
PART_09_APPLY_OBJECT_STATE(1);
}
+void IgorEngine::PART_09_DRAW_DRAWER_FRAME(int frame) {
+ for (int y = 0; y <= 58; ++y)
+ memcpy(_screenVGA + 0x48E6 + y * 320, _animFramesBuffer + 0x6E0B + frame * 0x639 + y * 27, 27);
+}
+
+void IgorEngine::PART_09_ACTION_106(bool search) {
+ if (_objectsState[35] == 0) {
+ ADD_DIALOGUE_TEXT(214, 2, 243);
+ } else if (_objectsState[34] == 1) {
+ executeAction(10);
+ return;
+ } else if (search) {
+ static const uint8 frames[] = { 1, 2, 1, 2, 1, 2, 3 };
+ for (uint i = 0; i < ARRAYSIZE(frames); ++i) {
+ PART_09_DRAW_DRAWER_FRAME(frames[i]);
+ waitForTimer(61);
+ }
+ _objectsState[34] = 1;
+ PART_09_APPLY_OBJECT_STATE(2);
+ ADD_DIALOGUE_TEXT(212, 1, 241);
+ } else {
+ static const uint8 frames[] = { 1, 2, 1, 2, 1, 2, 1, 2, 0 };
+ for (uint i = 0; i < ARRAYSIZE(frames); ++i) {
+ PART_09_DRAW_DRAWER_FRAME(frames[i]);
+ if (i == 0)
+ playSound(49, 1);
+ if (i + 1 < ARRAYSIZE(frames))
+ waitForTimer(31);
+ }
+ ADD_DIALOGUE_TEXT(213, 1, 242);
+ }
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+}
+
+void IgorEngine::PART_09_ACTION_110() {
+ for (int frame = 1; frame >= 0; --frame) {
+ for (int y = 0; y <= 39; ++y) {
+ for (int x = 0; x <= 26; ++x) {
+ const int dst = 0x48E6 + y * 320 + x;
+ uint8 color = _animFramesBuffer[0x9BA3 + frame * 0x438 + y * 27 + x];
+ if (color >= 0xC0 && color <= 0xCF) {
+ const RoomObjectArea &area = _roomObjectAreasTable[_screenLayer2[dst]];
+ if (area.y1Lum > 0)
+ color = _screenLayer1[dst];
+ else if (area.y2Lum > 0)
+ color -= area.deltaLum;
+ }
+ _screenTempLayer[y * 100 + x] = color;
+ }
+ }
+ for (int y = 0; y <= 39; ++y)
+ memcpy(_screenVGA + 0x48E6 + y * 320, _screenTempLayer + y * 100, 27);
+ waitForTimer(127);
+ }
+ addObjectToInventory(14, 49);
+ _objectsState[36] = 1;
+ PART_09_APPLY_OBJECT_STATE(255);
+}
+
+void IgorEngine::PART_09_ACTION_101() {
+ if (_objectsState[35] == 0) {
+ ADD_DIALOGUE_TEXT(220, 1, 248);
+ } else if (_objectsState[37] == 1) {
+ ADD_DIALOGUE_TEXT(225, 1, 253);
+ } else {
+ static const uint8 frames[] = { 1, 2, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 2, 1, 6 };
+ for (uint i = 0; i < ARRAYSIZE(frames); ++i) {
+ for (int y = 0; y <= 48; ++y)
+ memcpy(_screenVGA + 0x7595 + y * 320, _animFramesBuffer + 0x9BD8 + frames[i] * 0x83B + y * 43, 43);
+ waitForTimer(i >= 3 && i <= 14 ? 31 : 61);
+ }
+ _walkData[_walkDataLastIndex - 1].posNum = kFacingPositionFront;
+ ADD_DIALOGUE_TEXT(221, 1, 249);
+ ADD_DIALOGUE_TEXT(222, 1, 250);
+ ADD_DIALOGUE_TEXT(223, 1, 251);
+ SET_DIALOGUE_TEXT(1, 3);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ for (int frame = 7; frame >= 6; --frame) {
+ for (int y = 0; y <= 48; ++y)
+ memcpy(_screenVGA + 0x7595 + y * 320, _animFramesBuffer + 0x9BD8 + frame * 0x83B + y * 43, 43);
+ if (frame == 7)
+ waitForTimer(255);
+ }
+ _objectsState[37] = 1;
+ return;
+ }
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+}
+
+void IgorEngine::PART_09_UPDATE_DIALOGUE_SECRETARY(int action) {
+ PART_09_DRAW_SECRETARY_FRAME(action == kUpdateDialogueAnimMiddleOfSentence ? getRandomNumber(1) + 2 : 1, false);
+}
+
+void IgorEngine::PART_09_SECRETARY_GESTURE() {
+ static const uint8 beginFrames[] = { 1, 2, 3, 4 };
+ static const uint8 endFrames[] = { 3, 2, 1, 8 };
+ for (uint step = 0; step < ARRAYSIZE(beginFrames); ++step) {
+ for (int y = 0; y <= 46; ++y)
+ memcpy(_screenVGA + 0x7815 + y * 320, _animFramesBuffer + 0x578 + beginFrames[step] * 0x9BB + y * 53, 53);
+ waitForTimer(31);
+ }
+ for (int step = 0; step < 32; ++step) {
+ const int frame = getRandomNumber(4) + 4;
+ for (int y = 0; y <= 46; ++y)
+ memcpy(_screenVGA + 0x7815 + y * 320, _animFramesBuffer + 0x578 + frame * 0x9BB + y * 53, 53);
+ waitForTimer(16);
+ }
+ for (uint step = 0; step < ARRAYSIZE(endFrames); ++step) {
+ for (int y = 0; y <= 46; ++y)
+ memcpy(_screenVGA + 0x7815 + y * 320, _animFramesBuffer + 0x578 + endFrames[step] * 0x9BB + y * 53, 53);
+ waitForTimer(31);
+ }
+}
+
+void IgorEngine::PART_09_UPDATE_ROOM_BACKGROUND() {
+ if (_objectsState[35] == 0 && compareGameTick(61) && getRandomNumber(2) == 0)
+ PART_09_DRAW_SECRETARY_FRAME(getRandomNumber(3), false);
+}
+
void IgorEngine::PART_09_EXEC_ACTION(int action) {
switch (action) {
+ case 101:
+ PART_09_ACTION_101();
+ break;
case 102:
ADD_DIALOGUE_TEXT(201, 2, 234);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
+ case 103:
+ loadDialogueData(DLG_AdministrationSecretaryRoom);
+ _updateDialogue = &IgorEngine::PART_09_UPDATE_DIALOGUE_SECRETARY;
+ handleDialogue(63, 59, 0, 90, 65);
+ _updateDialogue = 0;
+ PART_09_APPLY_OBJECT_STATE(255);
+ break;
case 104:
ADD_DIALOGUE_TEXT(203, 2, 235);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
+ case 105: {
+ const int text = _objectsState[34] == 0 ? 205 : (_objectsState[36] == 0 ? 218 : 219);
+ ADD_DIALOGUE_TEXT(text, _objectsState[34] == 0 ? 2 : 1, _objectsState[34] == 0 ? 236 : text + 28);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ break;
+ }
+ case 106:
+ PART_09_ACTION_106(false);
+ break;
+ case 107:
+ if (_objectsState[34] == 0) {
+ executeAction(13);
+ } else {
+ ADD_DIALOGUE_TEXT(217, 1, 245);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ }
+ break;
case 108:
ADD_DIALOGUE_TEXT(207, 1, 237);
ADD_DIALOGUE_TEXT(208, 1, 238);
@@ -72,44 +250,46 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 109:
- if (_objectsState[35] == 0)
- ADD_DIALOGUE_TEXT(216, 1, 244);
- else
- ADD_DIALOGUE_TEXT(224, 1, 252);
+ ADD_DIALOGUE_TEXT(_objectsState[35] == 0 ? 216 : 224, 1, _objectsState[35] == 0 ? 244 : 252);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 111:
+ case 110:
+ PART_09_ACTION_110();
+ break;
+ case 112:
ADD_DIALOGUE_TEXT(211, 1, 240);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
+ case 113:
+ PART_09_ANIMATE_DOOR(true);
+ break;
+ case 114:
+ PART_09_ANIMATE_DOOR(false);
+ break;
case 115:
+ PART_09_ACTION_106(true);
+ break;
+ case 116:
if (_objectsState[27] != 0) {
- _walkData[0].setPos(207, 106, kFacingPositionBack, 1);
- _walkData[0].setDefaultScale();
+ WalkData *wd = &_walkData[0];
+ wd->setPos(207, 106, kFacingPositionBack, 1);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 30;
+ wd->scaleWidth = 50;
+ wd->xPosChanged = 1;
+ wd->dxPos = 1;
+ wd->yPosChanged = 0;
+ wd->dyPos = 2;
+ wd->scaleHeight = 50;
_walkDataCurrentIndex = 0;
moveIgor(kFacingPositionBack, 1);
_currentPart = 72;
}
break;
- case 112:
- PART_09_ANIMATE_DOOR(true);
- break;
- case 113:
- PART_09_ANIMATE_DOOR(false);
- break;
- case 101:
- case 103:
- case 105:
- case 106:
- case 107:
- case 110:
- case 114:
- // TODO: translate the corresponding cseg190 action routine exactly.
- break;
default:
warning("PART_09_EXEC_ACTION unhandled action %d", action);
break;
@@ -119,9 +299,7 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
void IgorEngine::PART_09() {
_gameState.enableLight = 1;
loadActionData(DAT_AdministrationSecretaryRoom);
- loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom,
- BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom,
- TXT_AdministrationSecretaryRoom);
+ loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom,BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom, TXT_AdministrationSecretaryRoom);
static const int anim[] = {
ANM_AdministrationSecretaryRoom1, ANM_AdministrationSecretaryRoom2,
ANM_AdministrationSecretaryRoom3, ANM_AdministrationSecretaryRoom4,
@@ -137,6 +315,7 @@ void IgorEngine::PART_09() {
memcpy(_screenVGA, _screenLayer1, 46080);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
+ _updateRoomBackground = &IgorEngine::PART_09_UPDATE_ROOM_BACKGROUND;
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
_walkData[0].setPos(206, 109, kFacingPositionFront, 0);
@@ -152,6 +331,7 @@ void IgorEngine::PART_09() {
while (_currentPart == 90 && !_gameStateLoaded)
runPartLoop();
leavePartLoop();
+ _updateRoomBackground = 0;
if (!_gameStateLoaded)
fadeOut(624);
}
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 3162d5975d9..5cdfccba3eb 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -580,4 +580,6 @@
#define ANM_AdministrationSecretaryRoom8 930 // cseg192:9D78; IGOR.EXE:0x70F378, 0x870 bytes
#define ANM_AdministrationSecretaryRoom9 931 // cseg192:A5E8; IGOR.EXE:0x70FBE8, 0x399D bytes
+#define DLG_AdministrationSecretaryRoom 984
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index a95da79dda6..fdef07f55a9 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -257,13 +257,13 @@ const RoomDataOffsets IgorEngine::PART_08_ROOM_DATA_OFFSETS = {
const RoomDataOffsets IgorEngine::PART_09_ROOM_DATA_OFFSETS = {
{ 80, 4, 12, 3 }, // cseg190:1FA1-1FD4; transition table at DAT+80, four areas, strides 12 and 3
{ 149, 162 },
- { 167, 385, 3401, 271, 347, 84 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+ { 167, 375, 3391, 271, 347, 84 },
+ { 378, 29, 5237, 46, 120, 480, 10029, 10087, 46 }
};
const RoomDataOffsets IgorEngine::PART_04_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 },
- { 0, 0 },
+ { 5, 18 }, // walk points and facing positions of the room objects
{ 23, 231, 3247, 127, 203, 84 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index e3ef3822e97..fbcb4fe5939 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -486,6 +486,14 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreU
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 (getPart() == 9) {
+ if (code == 4)
+ _gameState.dialogueData[120] = 0;
+ if (code == 98 || code == 101) {
+ PART_09_SECRETARY_GESTURE();
+ dialogueReplyToQuestion(x, y, r, g, b, code);
+ }
+ }
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) {
Commit: c37f33a906d26ed93ee6c95d4668ed7bf9afb085
https://github.com/scummvm/scummvm/commit/c37f33a906d26ed93ee6c95d4668ed7bf9afb085
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:16+01:00
Commit Message:
IGOR: Fix dialogue crash with secretary
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_18.cpp
engines/igor/resource.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 6b6c30974ab..2d76900df1a 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -151,7 +151,7 @@ struct GameStateData {
uint8 unk11;
bool dialogueStarted;
// byte[1]
- uint8 dialogueData[500];
+ uint8 dialogueData[583];
uint8 dialogueChoiceStart;
uint8 dialogueChoiceCount;
// byte[2]
@@ -641,7 +641,7 @@ private:
void PART_18_ACTION_109_useSlugOnGrating();
void PART_18_ACTION_111();
void PART_18_HELPER_1(int num);
- void PART_18_HELPER_2();
+ void PART_18_HELPER_2_walkIn();
void PART_18();
void loadResourceData__ROOM_MenToilets();
void loadResourceData__ANIM_MenToilets();
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index 0504836886a..f57a475c043 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -152,7 +152,7 @@ void IgorEngine::PART_18_ACTION_111() {
void IgorEngine::PART_18_HELPER_1(int num) {
}
-void IgorEngine::PART_18_HELPER_2() {
+void IgorEngine::PART_18_HELPER_2_walkIn() {
_walkData[0].setPos(319, 142, 4, 0);
_walkData[0].clipSkipX = 1;
_walkData[0].clipWidth = 15;
@@ -182,7 +182,9 @@ void IgorEngine::PART_18() {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_18_HELPER_2();
+ if(_currentPart == 190) {
+ PART_18_HELPER_2_walkIn();
+ }
enterPartLoop();
while (_currentPart == 180) {
runPartLoop();
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 2f8bd79aaac..7eea7672dd3 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -127,7 +127,7 @@ void IgorEngine::loadDialogueData(int dlg) {
int dataSize;
uint8 *p = loadData(dlg, 0, &dataSize);
int dialogueDataSize = _roomDataOffsets.dlg.questionsOffset + 164 + 41;
- assert(dialogueDataSize <= 500);
+ assert(dialogueDataSize <= (int)sizeof(_gameState.dialogueData));
memcpy(_gameState.dialogueData, p, dialogueDataSize);
assert(_roomDataOffsets.dlg.questionsSize <= MAX_DIALOGUE_QUESTIONS);
// A zero speech layout retains the legacy packed-tail layout for dialogue
Commit: cb6d6f4efc98431a43026719d65d5e69ecec9b49
https://github.com/scummvm/scummvm/commit/cb6d6f4efc98431a43026719d65d5e69ecec9b49
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:16+01:00
Commit Message:
IGOR: Right click verb selection logic
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/parts/part_9.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index ebbd7a7ce07..f6e9166d7e5 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -135,6 +135,8 @@ void IgorEngine::restart() {
_currentAction.verb = kVerbWalk;
_actionCode = 0;
_actionWalkPoint = 0;
+ _rightButtonSelecting = false;
+ _rightButtonSelectCursorX = _rightButtonSelectCursorY = 0;
memset(_inputVars, 0, sizeof(_inputVars));
_talkDelay = _talkSpeechCounter = _talkDelayCounter = 0;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 2d76900df1a..9eb7846548f 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -99,6 +99,10 @@ enum InputVar {
kInputEscape,
kInputPause,
kInputOptions,
+ kInputRightClick,
+ kInputRightRelease,
+ kInputRightMoveLeft,
+ kInputRightMoveRight,
kInputVarCount
};
@@ -376,6 +380,9 @@ private:
int16 _inputVars[kInputVarCount];
+ bool _rightButtonSelecting;
+ int _rightButtonSelectCursorX, _rightButtonSelectCursorY;
+
bool _scrollInventory;
int _scrollInventoryStartY, _scrollInventoryEndY, _scrollInventoryDy;
WalkData _walkData[101];
@@ -568,7 +575,7 @@ private:
void PART_09_ANIMATE_DOOR(bool open);
void PART_09_DRAW_SECRETARY_FRAME(int frame, bool background);
void PART_09_DRAW_DRAWER_FRAME(int frame);
- void PART_09_ACTION_101();
+ void PART_09_ACTION_101_openFileCabinet();
void PART_09_ACTION_106(bool search);
void PART_09_ACTION_110();
void PART_09_UPDATE_DIALOGUE_SECRETARY(int action);
@@ -824,6 +831,10 @@ private:
void drawVerbsPanel();
void redrawVerb(uint8 verb, bool highlight);
+ void beginRightButtonVerbPick();
+ void updateRightButtonVerbPick();
+ void endRightButtonVerbPick();
+ void formatRightButtonSentence();
int getVerbUnderCursor(int x) const { return ((x % 46) < 44) ? (kVerbTalk + x / 46) : 0; }
void handleRoomInventoryScroll();
void handleOptionsMenu();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 1e39bdf1e68..c76ba0874fa 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -75,16 +75,33 @@ void IgorEngine::waitForTimer(int ticks) {
}
break;
case Common::EVENT_MOUSEMOVE:
- _inputVars[kInputCursorXPos] = ev.mouse.x;
- _inputVars[kInputCursorYPos] = ev.mouse.y;
+ if (_rightButtonSelecting) {
+ if (ev.mouse.x < _rightButtonSelectCursorX) {
+ _inputVars[kInputRightMoveLeft] = 1;
+ } else if (ev.mouse.x > _rightButtonSelectCursorX) {
+ _inputVars[kInputRightMoveRight] = 1;
+ }
+ _system->warpMouse(_rightButtonSelectCursorX, _rightButtonSelectCursorY);
+ } else {
+ _inputVars[kInputCursorXPos] = ev.mouse.x;
+ _inputVars[kInputCursorYPos] = ev.mouse.y;
+ }
break;
case Common::EVENT_RBUTTONDOWN:
debugC(9, kDebugEngine, "waitForTimer() right button at %d,%d running %d",
ev.mouse.x, ev.mouse.y, _gameState.dialogueTextRunning);
if (_gameState.dialogueTextRunning) {
_inputVars[kInputSkipDialogue] = 1;
+ } else {
+ _inputVars[kInputCursorXPos] = ev.mouse.x;
+ _inputVars[kInputCursorYPos] = ev.mouse.y;
+ _inputVars[kInputRightRelease] = 0;
+ _inputVars[kInputRightClick] = 1;
}
break;
+ case Common::EVENT_RBUTTONUP:
+ _inputVars[kInputRightRelease] = 1;
+ break;
case Common::EVENT_LBUTTONDOWN:
debugC(9, kDebugEngine, "waitForTimer() left button at %d,%d running %d",
ev.mouse.x, ev.mouse.y, _gameState.dialogueTextRunning);
@@ -103,6 +120,9 @@ void IgorEngine::waitForTimer(int ticks) {
break;
}
}
+ if (_rightButtonSelecting && !(_eventMan->getButtonState() & Common::EventManager::RBUTTON)) {
+ _inputVars[kInputRightRelease] = 1;
+ }
const uint32 now = _system->getMillis();
if (now >= endTicks) {
break;
@@ -180,6 +200,118 @@ void IgorEngine::redrawVerb(uint8 verb, bool highlight) {
}
}
+/**
+ * Action to select a verb with moving the right mouse button clicked
+ */
+void IgorEngine::beginRightButtonVerbPick() {
+ _rightButtonSelecting = true;
+ _rightButtonSelectCursorX = _inputVars[kInputCursorXPos];
+ _rightButtonSelectCursorY = _inputVars[kInputCursorYPos];
+ _inputVars[kInputRightMoveLeft] = 0;
+ _inputVars[kInputRightMoveRight] = 0;
+
+ const bool inventorySlot = _rightButtonSelectCursorY >= 170 && _rightButtonSelectCursorY <= 199 &&
+ _rightButtonSelectCursorX > 19 && _rightButtonSelectCursorX < 299;
+ int defaultVerb = 0;
+ // if in the scene, choose the hotspot's default verb as starting point
+ if (_rightButtonSelectCursorY < 144) {
+ const int area = _screenLayer2[_rightButtonSelectCursorY * 320 + _rightButtonSelectCursorX];
+ const int object = _roomObjectAreasTable[area].object;
+ const int defaultVerbOffset = _roomDataOffsets.obj.walkPoints +
+ _roomDataOffsets.obj.walkFacingPosition - _roomDataOffsets.action.defaultVerb;
+ defaultVerb = _roomActionsTable[defaultVerbOffset + object];
+ } else if (inventorySlot) { // for items, look is default
+ defaultVerb = kVerbLook;
+ }
+ if (defaultVerb < 2 && _currentAction.verb == kVerbWalk) {
+ defaultVerb = kVerbUse;
+ }
+ // if in inventory area but no item is below the mouse, choose use
+ if (inventorySlot && getObjectFromInventory(_rightButtonSelectCursorX) == 0 && defaultVerb == kVerbLook) {
+ defaultVerb = (_currentAction.verb == kVerbWalk) ? kVerbUse : _currentAction.verb;
+ }
+ const int previousVerb = _currentAction.verb;
+ if (defaultVerb > 0) {
+ _currentAction.verb = defaultVerb;
+ }
+ if (previousVerb != _currentAction.verb) {
+ // redraw the selected verb, and the previous one
+ redrawVerb(previousVerb, false);
+ redrawVerb(_currentAction.verb, true);
+ }
+ _currentAction.verbType = 0;
+ _currentAction.object2Num = 0;
+ _currentAction.object2Type = 0;
+ // set the current action's object1 based on the cursor position
+ if (inventorySlot) {
+ _currentAction.object1Num = getObjectFromInventory(_rightButtonSelectCursorX);
+ _currentAction.object1Type = kObjectTypeInventory;
+ } else if (_rightButtonSelectCursorY < 144) {
+ const int area = _screenLayer2[_rightButtonSelectCursorY * 320 + _rightButtonSelectCursorX];
+ _currentAction.object1Num = _roomObjectAreasTable[area].object;
+ _currentAction.object1Type = kObjectTypeRoom;
+ }
+ formatRightButtonSentence();
+}
+
+void IgorEngine::updateRightButtonVerbPick() {
+ if (_inputVars[kInputRightMoveLeft]) {
+ _inputVars[kInputRightMoveLeft] = 0;
+ const int candidate = MAX<int>(_currentAction.verb - 1, kVerbTalk);
+ if (candidate != _currentAction.verb) {
+ redrawVerb(_currentAction.verb, false);
+ redrawVerb(candidate, true);
+ _currentAction.verb = candidate;
+ formatRightButtonSentence();
+ }
+ }
+ if (_inputVars[kInputRightMoveRight]) {
+ _inputVars[kInputRightMoveRight] = 0;
+ const int candidate = MIN<int>(_currentAction.verb + 1, kVerbGive);
+ if (candidate == _currentAction.verb) {
+ return;
+ }
+ redrawVerb(_currentAction.verb, false);
+ redrawVerb(candidate, true);
+ _currentAction.verb = candidate;
+ formatRightButtonSentence();
+ }
+}
+
+void IgorEngine::endRightButtonVerbPick() {
+ _rightButtonSelecting = false;
+ _inputVars[kInputRightMoveLeft] = 0;
+ _inputVars[kInputRightMoveRight] = 0;
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputCursorXPos] = _rightButtonSelectCursorX;
+ _inputVars[kInputCursorYPos] = _rightButtonSelectCursorY;
+ //return mouse to the position the right click happened
+ _system->warpMouse(_rightButtonSelectCursorX, _rightButtonSelectCursorY);
+}
+
+/**
+ * Formats the sentence displayed when the right mouse button is used to select a verb.
+ */
+void IgorEngine::formatRightButtonSentence() {
+ const int object1Num = _currentAction.object1Num;
+ uint8 actionCode = 0;
+ if (object1Num != 0) {
+ if (_currentAction.object1Type == kObjectTypeInventory) {
+ actionCode = _inventoryActionsTable[(_currentAction.verb - 1) * 2 + object1Num * 20];
+ } else {
+ actionCode = _roomActionsTable[_roomDataOffsets.action.defaultVerb + _currentAction.verb * 2 + object1Num * 20];
+ }
+ }
+ // Without an action byte the sentence names only the verb.
+ if (actionCode == 0) {
+ _currentAction.object1Num = 0;
+ formatActionSentence(0);
+ _currentAction.object1Num = object1Num;
+ } else {
+ formatActionSentence(0);
+ }
+}
+
void IgorEngine::handleRoomInput() {
// Escape is a transient abort input. Do not let an unused press from the
// room loop leak into a later blocking walk or dialogue sequence.
@@ -208,10 +340,30 @@ void IgorEngine::handleRoomInput() {
// handler: handleRoomInput()
_inputVars[kInputClick] = 0;
}
+ if (_rightButtonSelecting && _inputVars[kInputRightRelease]) {
+ _inputVars[kInputRightRelease] = 0;
+ endRightButtonVerbPick();
+ }
if (!_roomCursorOn || _gameState.dialogueTextRunning || _scrollInventory) {
return;
}
+ if (_inputVars[kInputRightClick]) {
+ _inputVars[kInputRightClick] = 0;
+ if (!_rightButtonSelecting) {
+ beginRightButtonVerbPick();
+ }
+ }
+ if (_rightButtonSelecting) {
+ if (_inputVars[kInputRightRelease]) {
+ _inputVars[kInputRightRelease] = 0;
+ endRightButtonVerbPick();
+ } else {
+ updateRightButtonVerbPick();
+ }
+ return;
+ }
+ _inputVars[kInputRightRelease] = 0;
// verbs panel click
if (_inputVars[kInputCursorYPos] >= 156 && _inputVars[kInputCursorYPos] <= 167) {
if (_inputVars[kInputClick]) {
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index 1bb8956e6d8..bfe4243fad8 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -134,10 +134,10 @@ void IgorEngine::PART_09_ACTION_110() {
PART_09_APPLY_OBJECT_STATE(255);
}
-void IgorEngine::PART_09_ACTION_101() {
- if (_objectsState[35] == 0) {
+void IgorEngine::PART_09_ACTION_101_openFileCabinet() {
+ if (_objectsState[35] == 0) { // secretary dismissed
ADD_DIALOGUE_TEXT(220, 1, 248);
- } else if (_objectsState[37] == 1) {
+ } else if (_objectsState[37] == 1) { // already changed file
ADD_DIALOGUE_TEXT(225, 1, 253);
} else {
static const uint8 frames[] = { 1, 2, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 2, 1, 6 };
@@ -199,29 +199,29 @@ void IgorEngine::PART_09_UPDATE_ROOM_BACKGROUND() {
void IgorEngine::PART_09_EXEC_ACTION(int action) {
switch (action) {
- case 101:
- PART_09_ACTION_101();
+ case 101: // open file cabinet
+ PART_09_ACTION_101_openFileCabinet();
break;
- case 102:
+ case 102: // look at file cabinet
ADD_DIALOGUE_TEXT(201, 2, 234);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 103:
+ case 103: // talk to secretary
loadDialogueData(DLG_AdministrationSecretaryRoom);
_updateDialogue = &IgorEngine::PART_09_UPDATE_DIALOGUE_SECRETARY;
handleDialogue(63, 59, 0, 90, 65);
_updateDialogue = 0;
PART_09_APPLY_OBJECT_STATE(255);
break;
- case 104:
+ case 104: // look at secretary
ADD_DIALOGUE_TEXT(203, 2, 235);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 105: {
+ case 105: { // look at closet
const int text = _objectsState[34] == 0 ? 205 : (_objectsState[36] == 0 ? 218 : 219);
ADD_DIALOGUE_TEXT(text, _objectsState[34] == 0 ? 2 : 1, _objectsState[34] == 0 ? 236 : text + 28);
SET_DIALOGUE_TEXT(1, 1);
@@ -242,7 +242,7 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
}
break;
- case 108:
+ case 108: // look at intercom
ADD_DIALOGUE_TEXT(207, 1, 237);
ADD_DIALOGUE_TEXT(208, 1, 238);
SET_DIALOGUE_TEXT(1, 2);
@@ -258,16 +258,16 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
case 110:
PART_09_ACTION_110();
break;
- case 112:
+ case 112: // look at door
ADD_DIALOGUE_TEXT(211, 1, 240);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 113:
+ case 113: // open door
PART_09_ANIMATE_DOOR(true);
break;
- case 114:
+ case 114: // close door
PART_09_ANIMATE_DOOR(false);
break;
case 115:
Commit: 3300974eca55f88128f5e3828947194a79113749
https://github.com/scummvm/scummvm/commit/3300974eca55f88128f5e3828947194a79113749
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:16+01:00
Commit Message:
IGOR: Play music only if the same music isnt already playing
Changed paths:
engines/igor/igor.h
engines/igor/sound.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 9eb7846548f..5f3d5668341 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -75,7 +75,7 @@ enum {
MAX_VERB_NAME_LENGTH = 12,
MAX_ROOM_OBJECT_AREAS = 256,
MAX_DIALOGUE_QUESTIONS = 30,
- MAX_DIALOGUE_REPLIES = 100 // cseg181:12B1-12C0
+ MAX_DIALOGUE_REPLIES = 100
};
enum FacingPosition {
@@ -404,15 +404,15 @@ private:
int _dialogueDirtyRectY;
int _dialogueDirtyRectSize;
char _dialogueQuestions[MAX_DIALOGUE_QUESTIONS][2][41];
- uint16 _dialogueQuestionSounds[MAX_DIALOGUE_QUESTIONS]; // cseg172:043B-0460
+ uint16 _dialogueQuestionSounds[MAX_DIALOGUE_QUESTIONS];
char _dialogueReplies[MAX_DIALOGUE_REPLIES][51];
- uint16 _dialogueReplySounds[MAX_DIALOGUE_REPLIES]; // cseg172:0A59-0A82
+ uint16 _dialogueReplySounds[MAX_DIALOGUE_REPLIES];
bool _dialogueEnded;
int _dialogueChoiceSelected;
uint8 _dialogueInfo[6];
uint8 _objectsState[112];
- bool _part07FirstVisitDone; // cseg197:0795-0845; original global s3:0xED2E
+ bool _part07FirstVisitDone;
uint8 _inventoryImages[36];
uint8 _inventoryInfo[74];
char _verbPrepositions[3][7];
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 2f0bd2632c3..a120877d7f6 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -35,9 +35,12 @@ void IgorEngine::playMusic(int num) {
_gameState.musicSequenceIndex = 1;
// startMusic(cmf[num]);
} else {
- // TODO: play CD track
- g_system->getAudioCDManager()->stop();
- g_system->getAudioCDManager()->play(num, -1, 0, 0);
+ // play only if the requested track is not already playing
+ if(_gameState.musicNum != num) {
+ _gameState.musicNum = num;
+ g_system->getAudioCDManager()->stop();
+ g_system->getAudioCDManager()->play(num, -1, 0, 0);
+ }
}
}
Commit: 8500b0de1d3e3938fa685524f5ef21f285cb7e6a
https://github.com/scummvm/scummvm/commit/8500b0de1d3e3938fa685524f5ef21f285cb7e6a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:17+01:00
Commit Message:
IGOR: Fixes igor positioning when looking at things while already standing next to them
Changed paths:
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_main.cpp
engines/igor/parts/part_27.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 5f3d5668341..dc6107f0285 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -756,7 +756,7 @@ private:
// college lockers
void PART_27_EXEC_ACTION(int action);
- void PART_27_ACTION_106();
+ void PART_27_ACTION_106_openPhilipLocker();
void PART_27_ACTION_107();
void PART_27_ACTION_108();
void PART_27_ACTION_110();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index c76ba0874fa..8894abe88a7 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -598,8 +598,11 @@ void IgorEngine::handleRoomInput() {
}
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- return;
}
+ // Already at the target: the action is not run here. The walk index was
+ // decremented above, so the per-tick walk handler resynchronizes it and
+ // then executes the pending action.
+ return;
}
hideCursor();
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 6aba2d5a621..d498f546d27 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -262,19 +262,21 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
break;
- case 46:
+ case 46: // look at folder
if (_objectsState[3] == 0) {
ADD_DIALOGUE_TEXT(85, 1, 60);
} else {
ADD_DIALOGUE_TEXT(86, 2, 61);
+ _objectsState[5] = 1;
}
- SET_DIALOGUE_TEXT(1, 2);
+ SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 48:
ADD_DIALOGUE_TEXT(77 + _objectsState[0], 1, 53 + _objectsState[0]);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
+ break;
case 50:
if (_objectsState[1] == 0) {
ADD_DIALOGUE_TEXT(80, 1, 56);
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index 9223198722d..80bab9d0efa 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -25,10 +25,10 @@ namespace Igor {
void IgorEngine::PART_27_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // go to right
_currentPart = 211;
break;
- case 102:
+ case 102: // look at lockers
if (_objectsState[85] == 0) {
ADD_DIALOGUE_TEXT(216, 2, 1173);
SET_DIALOGUE_TEXT(1, 1);
@@ -41,23 +41,23 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
startIgorDialogue();
}
break;
- case 103:
+ case 103: // open lockers
ADD_DIALOGUE_TEXT(203, 1, 1163);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 104:
+ case 104: // close lockers
ADD_DIALOGUE_TEXT(204, 1, 1164);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 105:
+ case 105: // look at philips locker
ADD_DIALOGUE_TEXT(205, 1, 1165);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 106:
- PART_27_ACTION_106();
+ PART_27_ACTION_106_openPhilipLocker();
break;
case 107:
PART_27_ACTION_107();
@@ -80,12 +80,12 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
SET_DIALOGUE_TEXT(1, 3);
startIgorDialogue();
break;
- case 112:
+ case 112: // look at plaque
ADD_DIALOGUE_TEXT(221, 1, 1176);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 113:
+ case 113: // go to library
_currentPart = 150;
break;
default:
@@ -94,7 +94,7 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_27_ACTION_106() {
+void IgorEngine::PART_27_ACTION_106_openPhilipLocker() {
if (_objectsState[84] == 1) {
EXEC_MAIN_ACTION(11);
return;
@@ -109,8 +109,9 @@ void IgorEngine::PART_27_ACTION_106() {
ADD_DIALOGUE_TEXT(209, 3, 1169);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
+ waitForEndOfIgorDialogue();
_objectsState[5] = 2;
- return;
+ // return;
}
const int offset = 21810;
for (int i = 2; i <= 3; ++i) {
Commit: 6fb24eaaf937642a2b67f4ad4fc793c7380ee2a4
https://github.com/scummvm/scummvm/commit/6fb24eaaf937642a2b67f4ad4fc793c7380ee2a4
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:17+01:00
Commit Message:
IGOR: Fixes locker animation in room 27
Changed paths:
engines/igor/parts/part_27.cpp
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index 80bab9d0efa..5d0ac9d01b7 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -111,12 +111,11 @@ void IgorEngine::PART_27_ACTION_106_openPhilipLocker() {
startIgorDialogue();
waitForEndOfIgorDialogue();
_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);
+ memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + 0x3A0 + i * 1568 + j * 32, 32);
}
if (i == 3) {
playSound(3, 1);
@@ -137,7 +136,7 @@ void IgorEngine::PART_27_ACTION_107() {
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);
+ memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + 0x3A0 + i * 1568 + j * 32, 32);
}
if (i == 2) {
playSound(14, 1);
Commit: 7914ce6b15ff868d4c3773545d2856bac2910669
https://github.com/scummvm/scummvm/commit/7914ce6b15ff868d4c3773545d2856bac2910669
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:17+01:00
Commit Message:
IGOR: Fixes conversation with margaret and using an object with itself
Changed paths:
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/parts/part_21.cpp
engines/igor/static_walk.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index dc6107f0285..cde4cd4ffac 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -685,6 +685,7 @@ private:
void PART_21_HELPER_2();
void PART_21_HELPER_3();
void PART_21_HELPER_4();
+ void PART_21_HELPER_5();
void PART_21_HELPER_6(int frame);
void PART_21_HELPER_7();
void PART_21_HELPER_8();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 8894abe88a7..dee447aad1d 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -458,6 +458,10 @@ void IgorEngine::handleRoomInput() {
} else {
_currentAction.object2Num = object;
_currentAction.object2Type = kObjectTypeInventory;
+ // An object cannot be combined with itself.
+ if (object == _currentAction.object1Num && _currentAction.object1Type == kObjectTypeInventory) {
+ _currentAction.object2Num = 0;
+ }
}
} else if (_inputVars[kInputCursorYPos] < 144) {
// screen object under cursor
@@ -484,6 +488,9 @@ void IgorEngine::handleRoomInput() {
} else {
_currentAction.object2Num = object;
_currentAction.object2Type = kObjectTypeRoom;
+ if (object == _currentAction.object1Num && _currentAction.object1Type == kObjectTypeRoom) {
+ _currentAction.object2Num = 0;
+ }
}
} else {
return;
@@ -657,6 +664,12 @@ void IgorEngine::drawActionSentence(const char *sentence, uint8 color) {
memset(_screenVGA + 144 * 320, 0, 11 * 320);
int w = _font.getStringWidth(sentence);
int x = (320 - w) / 2;
+ // A sentence wider than the screen would start at a negative offset and
+ // wrap into the previous scanline; keep it left-aligned and let drawString
+ // stop at the right edge instead.
+ if (x < 0) {
+ x = 0;
+ }
_font.drawString(_screenVGA, sentence, x, 144, color, 0, 0);
}
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index 13fafe534f1..bac541f3233 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -37,22 +37,22 @@ void IgorEngine::PART_21_EXEC_ACTION(int action) {
PART_21_ACTION_102();
break;
case 103:
- ADD_DIALOGUE_TEXT(201, 1);
+ ADD_DIALOGUE_TEXT(201, 1, 1177);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 104:
- ADD_DIALOGUE_TEXT(202, 1);
+ ADD_DIALOGUE_TEXT(202, 1, 1178);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 105:
- ADD_DIALOGUE_TEXT(203, 1);
+ ADD_DIALOGUE_TEXT(203, 1, 1179);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 106:
- ADD_DIALOGUE_TEXT(204, 1);
+ ADD_DIALOGUE_TEXT(204, 1, 1180);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -63,7 +63,7 @@ void IgorEngine::PART_21_EXEC_ACTION(int action) {
PART_21_ACTION_108();
break;
case 109:
- ADD_DIALOGUE_TEXT(205, 1);
+ ADD_DIALOGUE_TEXT(205, 1, 1181);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -74,7 +74,7 @@ void IgorEngine::PART_21_EXEC_ACTION(int action) {
PART_21_ACTION_111();
break;
case 112:
- ADD_DIALOGUE_TEXT(222, 1);
+ ADD_DIALOGUE_TEXT(222, 1, 1195);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -100,11 +100,11 @@ void IgorEngine::PART_21_ACTION_101() {
void IgorEngine::PART_21_ACTION_102() {
PART_21_HELPER_6(1);
- ADD_DIALOGUE_TEXT(226, 1);
+ ADD_DIALOGUE_TEXT(226, 1, 1197);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(227, 1);
+ ADD_DIALOGUE_TEXT(227, 1, 1198);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(76, 87, 63, 32, 0);
_updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_2;
@@ -166,15 +166,14 @@ void IgorEngine::PART_21_ACTION_110() {
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);
+ ADD_DIALOGUE_TEXT(223, 2, 1196);
+ SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
}
IN_ACTION_111 = true;
- ADD_DIALOGUE_TEXT(208, 1);
- ADD_DIALOGUE_TEXT(209, 1);
+ ADD_DIALOGUE_TEXT(208, 1, 1184);
+ ADD_DIALOGUE_TEXT(209, 1, 1185);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -201,7 +200,7 @@ void IgorEngine::PART_21_ACTION_111() {
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
- ADD_DIALOGUE_TEXT(210, 2);
+ ADD_DIALOGUE_TEXT(210, 2, 1186);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
@@ -213,7 +212,7 @@ void IgorEngine::PART_21_ACTION_113() {
buildWalkPathSimple(165, 126, 119, 108);
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove();
+ PART_21_HELPER_5();
if (_objectsState[65] == 1) {
PART_21_HELPER_10();
}
@@ -275,7 +274,7 @@ void IgorEngine::PART_21_HELPER_1(int num) {
}
}
if (num == 2 || num == 255) {
- if (_objectsState[65] > 1) {
+ if (_objectsState[65] <= 1) {
PART_21_HELPER_9();
}
if (_objectsState[65] == 2 || _objectsState[65] == 4) {
@@ -295,7 +294,7 @@ void IgorEngine::PART_21_HELPER_2() {
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove();
+ PART_21_HELPER_5();
}
void IgorEngine::PART_21_HELPER_3() {
@@ -307,7 +306,7 @@ void IgorEngine::PART_21_HELPER_3() {
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove();
+ PART_21_HELPER_5();
}
void IgorEngine::PART_21_HELPER_4() {
@@ -320,7 +319,27 @@ void IgorEngine::PART_21_HELPER_4() {
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove();
+ PART_21_HELPER_5();
+}
+
+void IgorEngine::PART_21_HELPER_5() {
+ // Same walk loop as waitForIgorMove(), but the room background keeps
+ // animating (Margaret) while Igor walks.
+ _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;
+ }
+ }
+ PART_21_UPDATE_ROOM_BACKGROUND();
+ waitForTimer();
+ } while (_gameState.igorMoving);
}
void IgorEngine::PART_21_HELPER_6(int frame) {
@@ -361,7 +380,7 @@ void IgorEngine::PART_21_HELPER_8() {
}
void IgorEngine::PART_21_HELPER_9() {
- const int offset = 21901;
+ const int offset = 28520;
for (int i = 0; i <= 42; ++i) {
memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 49 + 0x14E2, 49);
}
@@ -377,19 +396,19 @@ void IgorEngine::PART_21_HELPER_10() {
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);
+ ADD_DIALOGUE_TEXT(212, 1, 1187);
+ ADD_DIALOGUE_TEXT(213, 1, 1188);
+ ADD_DIALOGUE_TEXT(214, 1, 1189);
+ ADD_DIALOGUE_TEXT(215, 2, 1190);
+ ADD_DIALOGUE_TEXT(217, 2, 1191);
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);
+ ADD_DIALOGUE_TEXT(219, 1, 1192);
+ ADD_DIALOGUE_TEXT(220, 1, 1193);
+ ADD_DIALOGUE_TEXT(221, 1, 1194);
SET_DIALOGUE_TEXT(1, 3);
startCutsceneDialogue(76, 87, 63, 32, 0);
_updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_3;
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index fdef07f55a9..974bd15ad98 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -348,7 +348,7 @@ 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, 0, 0, 0, 0 }
+ { -85, 10, 1658, 50, 30, 90, 0, 0, 0 }
};
const RoomDataOffsets IgorEngine::PART_22_ROOM_DATA_OFFSETS = {
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index fbcb4fe5939..a9b000762f0 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -268,7 +268,8 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
if (_updateRoomBackground) {
(this->*_updateRoomBackground)();
}
- if (_inputVars[kInputEscape]) {
+ // Escape only aborts dialogue during the intro cutscene (or on quit).
+ if (_inputVars[kInputEscape] && (_currentPart == 850 || _eventQuitGame)) {
warning("waitForEndOfCutsceneDialogue() early exit with text active %d start %d count %d speechCounter %d delay %d/%d",
_gameState.dialogueTextRunning, _dialogueTextsStart, _dialogueTextsCount,
_talkSpeechCounter, _talkDelayCounter, _talkDelay);
@@ -404,7 +405,7 @@ void IgorEngine::waitForEndOfIgorDialogue() {
if (_updateRoomBackground) {
(this->*_updateRoomBackground)();
}
- if (_inputVars[kInputEscape])
+ if (_inputVars[kInputEscape] && (_currentPart == 850 || _eventQuitGame))
return;
waitForTimer();
} while (_gameState.dialogueTextRunning);
Commit: 89ddceac596a08445554c4c2622cb1ee70cd8b38
https://github.com/scummvm/scummvm/commit/89ddceac596a08445554c4c2622cb1ee70cd8b38
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:18+01:00
Commit Message:
IGOR: Fix crash in walk path when going upstairs
Changed paths:
engines/igor/input.cpp
engines/igor/parts/part_30.cpp
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index dee447aad1d..40adfb0a623 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -336,8 +336,7 @@ void IgorEngine::handleRoomInput() {
_talkSpeechCounter = -1;
}
_inputVars[kInputSkipDialogue] = 0;
- // The click that dismissed the dialogue must not survive into the room
- // handler: handleRoomInput()
+ // The click that dismissed the dialogue must not survive into the room handler
_inputVars[kInputClick] = 0;
}
if (_rightButtonSelecting && _inputVars[kInputRightRelease]) {
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index d562d4f5978..0b6cd60efed 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -61,7 +61,7 @@ void IgorEngine::PART_30_ACTION_102_goUpstairs() {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- _roomObjectAreasTable[_screenLayer2[24170]].area = 0;
+ _roomObjectAreasTable[_screenLayer2[24170]].area = 2;
--_walkDataLastIndex;
buildWalkPath(108, 75, 170, 75);
_walkDataCurrentIndex = 1;
Commit: e72e186844d3f7c8fa54b46b170c9d528995410d
https://github.com/scummvm/scummvm/commit/e72e186844d3f7c8fa54b46b170c9d528995410d
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:18+01:00
Commit Message:
IGOR: Complete actions in Park scene
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
engines/igor/resource_ids.h
engines/igor/sound.cpp
engines/igor/static_walk.cpp
engines/igor/statics.h
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index f6e9166d7e5..26b27d3b4d2 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -154,6 +154,7 @@ void IgorEngine::restart() {
memset(_objectsState, 0, sizeof(_objectsState));
_part07FirstVisitDone = false; // cseg197:0795-0845; original global s3:0xED2E
+ _parkLadyIdleStep = 1;
memcpy(_inventoryImages, INVENTORY_IMG_INIT, 36);
memset(_inventoryInfo, 0, sizeof(_inventoryInfo));
memset(_verbPrepositions, 0, sizeof(_verbPrepositions));
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index cde4cd4ffac..e19b1ab9f49 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -413,6 +413,7 @@ private:
uint8 _objectsState[112];
bool _part07FirstVisitDone;
+ uint8 _parkLadyIdleStep;
uint8 _inventoryImages[36];
uint8 _inventoryInfo[74];
char _verbPrepositions[3][7];
@@ -801,12 +802,30 @@ private:
void PART_30();
// park
+ void PARK_DRAW_LADY_FRAME(uint8 *dst, int frame);
+ void PARK_DRAW_LAURA_FRAME(int frame);
+ void PARK_PICK_UP_ANIMATION(int screenOffset, int framesOffset);
+ void PARK_UPDATE_AMBIENT_SOUND();
+ void PARK_UPDATE_DIALOGUE_LADY(int action);
+ void PARK_UPDATE_DIALOGUE_LAURA(int action);
+ void PARK_QUEUE_REPLY_TEXT(int reply, int count, int sound, int &textIndex);
+ void PARK_WAIT_FOR_IGOR_DIALOGUE();
+ void PARK_WAIT_FOR_LADY_DIALOGUE();
+ void PARK_WAIT_FOR_LAURA_DIALOGUE();
void PART_34();
void PART_34_EXEC_ACTION(int action);
+ void PART_34_ACTION_103_TAKE();
+ void PART_34_ACTION_105_TALK();
+ void PART_34_ACTION_108_OLD_LADY();
void PART_34_ACTION_109_SCROLL_RIGHT();
void PART_34_APPLY_OBJECT_STATE(int num);
+ void PART_34_LADY_IDLE(int step);
+ void PART_34_LAURA_CONVERSATION();
+ void PART_34_OLD_LADY_CONVERSATION();
+ void PART_34_UPDATE_ROOM_BACKGROUND();
void PART_35();
void PART_35_EXEC_ACTION(int action);
+ void PART_35_ACTION_102_TAKE();
void PART_35_ACTION_106_EXIT_TO_MAP();
void PART_35_ACTION_107_SCROLL_LEFT();
void PART_35_APPLY_OBJECT_STATE(int num);
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index 37913ee7c04..4588e459e3c 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -7,11 +7,162 @@
*/
#include "igor/igor.h"
+#include "igor/statics.h"
namespace Igor {
+static const DialogueDataOffsets kNoDialogueData = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+// Conversation with the old lady
+static const DialogueDataOffsets kOldLadyDialogueData = {
+ -162, 3, // questions
+ 433, 10, // replies
+ 30, 30, // choices matrix size, replies data
+ 1553, // question sounds
+ 1559, 10 // reply sounds
+};
+
+// Conversation with Laura
+static const DialogueDataOffsets kLauraDialogueData = {
+ -131, 7, // questions
+ 1120, 16, // replies
+ 30, 60, // choices matrix size, replies data
+ 2852, // question sounds
+ 2866, 16 // reply sounds
+};
+
+// Frames of the old lady's idle animation, indexed by step 1..6
+static const uint8 kOldLadyIdleFrames[] = { 0, 1, 2, 3, 4, 2 };
+
+// Frames of the pick up animation
+static const uint8 kPickUpFrames[] = { 0, 1, 2, 1, 2, 1, 2, 1, 2, 0 };
+
+// Frames shown while the old lady looks at the animal Igor found and recognizes it
+static const uint8 kOldLadyPetFrames[] = { 6, 15, 7, 17, 9, 10, 9, 10, 9, 10, 1 };
+
+// Frames shown while the old lady looks for the rocket in her bag
+static const uint8 kOldLadyBagFrames[] = { 11, 15, 16, 6, 17, 1 };
+
+/**
+ * Draws a frame of FRM_Park1 (old lady and Igor) preserving the dialogue text colors.
+ */
+void IgorEngine::PARK_DRAW_LADY_FRAME(uint8 *dst, int frame) {
+ decodeAnimFrame(getAnimFrame(kParkFrames, kParkFrameTable, frame), dst, true);
+}
+
+/**
+ * Draws a frame of FRM_ParkLaura1 on the screen preserving the dialogue text colors.
+ */
+void IgorEngine::PARK_DRAW_LAURA_FRAME(int frame) {
+ decodeAnimFrame(getAnimFrame(kParkLauraFrames, kParkLauraFrameTable, frame), _screenVGA, true);
+}
+
+/**
+ * Plays the pick up animation, one raw 27x49 frame at a time. The first row of every frame is
+ * not drawn.
+ */
+void IgorEngine::PARK_PICK_UP_ANIMATION(int screenOffset, int framesOffset) {
+ for (uint i = 0; i < ARRAYSIZE(kPickUpFrames); ++i) {
+ for (int row = 1; row <= 48; ++row) {
+ memcpy(_screenVGA + screenOffset + row * 320,
+ _animFramesBuffer + framesOffset + kPickUpFrames[i] * 1323 + row * 27, 27);
+ }
+ waitForTimer(30);
+ }
+}
+
+/**
+ * Birds chirp from time to time while the park is shown.
+ */
+void IgorEngine::PARK_UPDATE_AMBIENT_SOUND() {
+ if (compareGameTick(1) && getRandomNumber(14) == 0) {
+ switch (getRandomNumber(3)) {
+ 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::PARK_UPDATE_DIALOGUE_LADY(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ case kUpdateDialogueAnimStanding:
+ PARK_DRAW_LADY_FRAME(_screenVGA, 1);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PARK_DRAW_LADY_FRAME(_screenVGA, getRandomNumber(4) + 1);
+ break;
+ }
+}
+
+void IgorEngine::PARK_UPDATE_DIALOGUE_LAURA(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ case kUpdateDialogueAnimStanding:
+ PARK_DRAW_LAURA_FRAME(20);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PARK_DRAW_LAURA_FRAME(20 + getRandomNumber(5));
+ break;
+ }
+}
+
+/**
+ * Copies lines of the loaded conversation replies to the dialogue texts pool and queues them
+ * as one dialogue text.
+ */
+void IgorEngine::PARK_QUEUE_REPLY_TEXT(int reply, int count, int sound, int &textIndex) {
+ for (int i = 0; i < count; ++i) {
+ Common::strlcpy(_globalDialogueTexts[textIndex + i], _dialogueReplies[reply - 1 + i],
+ sizeof(_globalDialogueTexts[0]));
+ }
+ ADD_DIALOGUE_TEXT(textIndex, count, sound);
+ textIndex += count;
+}
+
+/**
+ * Igor's blocking dialogues do not run the birds' sound.
+ */
+void IgorEngine::PARK_WAIT_FOR_IGOR_DIALOGUE() {
+ UpdateRoomBackgroundProc roomBackground = _updateRoomBackground;
+ _updateRoomBackground = 0;
+ waitForEndOfIgorDialogue();
+ _updateRoomBackground = roomBackground;
+}
+
+void IgorEngine::PARK_WAIT_FOR_LADY_DIALOGUE() {
+ UpdateRoomBackgroundProc roomBackground = _updateRoomBackground;
+ _updateRoomBackground = &IgorEngine::PARK_UPDATE_AMBIENT_SOUND;
+ _updateDialogue = &IgorEngine::PARK_UPDATE_DIALOGUE_LADY;
+ waitForEndOfCutsceneDialogue(121, 68, 63, 23, 0);
+ _updateDialogue = 0;
+ _updateRoomBackground = roomBackground;
+}
+
+void IgorEngine::PARK_WAIT_FOR_LAURA_DIALOGUE() {
+ UpdateRoomBackgroundProc roomBackground = _updateRoomBackground;
+ _updateRoomBackground = &IgorEngine::PARK_UPDATE_AMBIENT_SOUND;
+ _updateDialogue = &IgorEngine::PARK_UPDATE_DIALOGUE_LAURA;
+ waitForEndOfCutsceneDialogue(185, 69, 63, 0, 38);
+ _updateDialogue = 0;
+ _updateRoomBackground = roomBackground;
+}
+
void IgorEngine::PART_34_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_34_EXEC_ACTION %d", action);
+ // Only the birds keep chirping while an action takes over the room
+ UpdateRoomBackgroundProc roomBackground = _updateRoomBackground;
+ _updateRoomBackground = &IgorEngine::PARK_UPDATE_AMBIENT_SOUND;
switch (action) {
case 101:
ADD_DIALOGUE_TEXT(201, 2, 562);
@@ -26,8 +177,7 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
PART_34_APPLY_OBJECT_STATE(3);
break;
case 103:
- // TODO: transcribe the inventory acquisition sequence from cseg101:018D-0284.
- warning("PART_34_EXEC_ACTION action 103 unimplemented");
+ PART_34_ACTION_103_TAKE();
break;
case 104:
ADD_DIALOGUE_TEXT(205, 1, 564);
@@ -35,8 +185,7 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
startIgorDialogue();
break;
case 105:
- // TODO: transcribe the park conversation from cseg101:0A9B-0AC3 and cseg094:2498-280D.
- warning("PART_34_EXEC_ACTION action 105 unimplemented");
+ PART_34_ACTION_105_TALK();
break;
case 106:
ADD_DIALOGUE_TEXT(206, 2, 565);
@@ -49,8 +198,7 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
startIgorDialogue();
break;
case 108:
- // TODO: transcribe the multi-actor park sequence from cseg101:04B7-0A9A.
- warning("PART_34_EXEC_ACTION action 108 unimplemented");
+ PART_34_ACTION_108_OLD_LADY();
break;
case 109:
PART_34_ACTION_109_SCROLL_RIGHT();
@@ -59,13 +207,223 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
warning("PART_34_EXEC_ACTION unhandled action %d", action);
break;
}
+ _updateRoomBackground = roomBackground;
+}
+
+void IgorEngine::PART_34_ACTION_103_TAKE() {
+ if (_inventoryInfo[62] != 0) {
+ ADD_DIALOGUE_TEXT(210, 1, 567);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ return;
+ }
+ PARK_PICK_UP_ANIMATION(16499, kParkPickUpFrames);
+ addObjectToInventory(27, 62);
+ PART_34_APPLY_OBJECT_STATE(255);
+}
+
+void IgorEngine::PART_34_ACTION_105_TALK() {
+ PART_34_OLD_LADY_CONVERSATION();
+ PART_34_APPLY_OBJECT_STATE(255);
+ _parkLadyIdleStep = 4;
+ PART_34_LADY_IDLE(4);
+}
+
+/**
+ * Igor shows the old lady the animal he found. Depending on the animal she either rejects it
+ * or recognizes her pet, gives Igor a rocket and leaves, and Laura shows up.
+ */
+void IgorEngine::PART_34_ACTION_108_OLD_LADY() {
+ PARK_DRAW_LADY_FRAME(_screenVGA, 1);
+ ADD_DIALOGUE_TEXT(211, 2, 568);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ PARK_WAIT_FOR_IGOR_DIALOGUE();
+ for (int frame = 12; frame <= 13; ++frame) {
+ PARK_DRAW_LADY_FRAME(_screenVGA, frame);
+ waitForTimer(45);
+ }
+ if (_objectsState[1] == 0) {
+ ADD_DIALOGUE_TEXT(213, 1, 569);
+ ADD_DIALOGUE_TEXT(216, 1, 570);
+ SET_DIALOGUE_TEXT(1, 2);
+ startCutsceneDialogue(121, 58, 63, 23, 0);
+ PARK_WAIT_FOR_LADY_DIALOGUE();
+ for (int frame = 14; frame >= 12; --frame) {
+ PARK_DRAW_LADY_FRAME(_screenVGA, frame);
+ waitForTimer(45);
+ }
+ PARK_DRAW_LADY_FRAME(_screenVGA, 17);
+ _parkLadyIdleStep = 1;
+ return;
+ }
+
+ ADD_DIALOGUE_TEXT(217, 1, 571);
+ ADD_DIALOGUE_TEXT(218, 1, 572);
+ SET_DIALOGUE_TEXT(1, 2);
+ startCutsceneDialogue(121, 58, 63, 23, 0);
+ PARK_WAIT_FOR_LADY_DIALOGUE();
+ _parkLadyIdleStep = 1;
+ for (uint i = 0; i < ARRAYSIZE(kOldLadyPetFrames); ++i) {
+ PARK_DRAW_LADY_FRAME(_screenVGA, kOldLadyPetFrames[i]);
+ waitForTimer(45);
+ }
+ removeObjectFromInventory(59);
+ ADD_DIALOGUE_TEXT(219, 2, 573);
+ ADD_DIALOGUE_TEXT(221, 2, 574);
+ ADD_DIALOGUE_TEXT(223, 1, 575);
+ ADD_DIALOGUE_TEXT(224, 2, 576);
+ SET_DIALOGUE_TEXT(1, 4);
+ startCutsceneDialogue(121, 58, 63, 23, 0);
+ PARK_WAIT_FOR_LADY_DIALOGUE();
+ for (uint i = 0; i < ARRAYSIZE(kOldLadyBagFrames); ++i) {
+ PARK_DRAW_LADY_FRAME(_screenVGA, kOldLadyBagFrames[i]);
+ waitForTimer(30);
+ }
+ while (isDialogueSpeechPlaying() && !_eventQuitGame) {
+ waitForTimer();
+ }
+ addObjectToInventory(26, 61);
+ ADD_DIALOGUE_TEXT(226, 1, 577);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ PARK_WAIT_FOR_IGOR_DIALOGUE();
+ ADD_DIALOGUE_TEXT(227, 2, 578);
+ ADD_DIALOGUE_TEXT(229, 1, 579);
+ SET_DIALOGUE_TEXT(1, 2);
+ startCutsceneDialogue(121, 58, 63, 23, 0);
+ PARK_WAIT_FOR_LADY_DIALOGUE();
+ ADD_DIALOGUE_TEXT(230, 1, 580);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ PARK_WAIT_FOR_IGOR_DIALOGUE();
+ for (int frame = 18; frame <= 31; ++frame) {
+ PARK_DRAW_LADY_FRAME(_screenVGA, frame);
+ waitForTimer(30);
+ }
+ _objectsState[80] = 1;
+
+ PART_34_LAURA_CONVERSATION();
+
+ loadActionData(DAT_ParkLeft);
+ loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park);
+ SET_PAL_240_48_1();
+ static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
+ loadAnimData(frames, kParkFrames);
+ PART_34_APPLY_OBJECT_STATE(255);
+}
+
+/**
+ * Conversation with the old lady. The first time the lady greets Igor and Igor chooses what to ask,
+ * the following times only the greetings are exchanged.
+ */
+void IgorEngine::PART_34_OLD_LADY_CONVERSATION() {
+ _roomDataOffsets.dlg = kOldLadyDialogueData;
+ loadDialogueData(DLG_ParkLady);
+ if (_objectsState[81] == 0) {
+ memset(_screenVGA + 46080, 0, 17920);
+ }
+ int textIndex = 250;
+ PARK_QUEUE_REPLY_TEXT(1, 1, 584, textIndex);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(160, 58, 63, 63, 63);
+ PARK_WAIT_FOR_IGOR_DIALOGUE();
+ if (_objectsState[81] == 0) {
+ textIndex = 250;
+ PARK_QUEUE_REPLY_TEXT(2, 1, 585, textIndex);
+ PARK_QUEUE_REPLY_TEXT(3, 1, 586, textIndex);
+ SET_DIALOGUE_TEXT(1, 2);
+ startCutsceneDialogue(121, 68, 63, 23, 0);
+ PARK_WAIT_FOR_LADY_DIALOGUE();
+ _updateDialogue = &IgorEngine::PARK_UPDATE_DIALOGUE_LADY;
+ handleDialogue(121, 68, 63, 23, 0, false);
+ _updateDialogue = 0;
+ }
+ textIndex = 250;
+ PARK_QUEUE_REPLY_TEXT(4, 2, 587, textIndex);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(121, 68, 63, 23, 0);
+ PARK_WAIT_FOR_LADY_DIALOGUE();
+ if (_objectsState[81] == 0) {
+ memset(_screenVGA + 46080, 0, 17920);
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[72], 0);
+ _currentAction.verb = kVerbWalk;
+ _objectsState[81] = 1;
+ }
+ _roomDataOffsets.dlg = kNoDialogueData;
+}
+
+/**
+ * Laura walks into the park, talks with Igor and leaves.
+ */
+void IgorEngine::PART_34_LAURA_CONVERSATION() {
+ static const int frames[] = { FRM_ParkLaura1, FRM_ParkLaura2, FRM_ParkLaura3, 0 };
+ loadAnimData(frames, kParkLauraFrames);
+ memcpy(_paletteBuffer + 176 * 3, _animFramesBuffer + kParkLauraPalette, 48);
+ memcpy(_currentPalette + 176 * 3, _animFramesBuffer + kParkLauraPalette, 48);
+ setPaletteRange(176, 191);
+
+ _roomDataOffsets.dlg = kLauraDialogueData;
+ loadDialogueData(DLG_ParkLaura);
+ memset(_screenVGA + 46080, 0, 17920);
+ for (int frame = 1; frame <= 19; ++frame) {
+ PARK_DRAW_LAURA_FRAME(frame);
+ waitForTimer(30);
+ }
+ int textIndex = 250;
+ PARK_QUEUE_REPLY_TEXT(1, 1, 600, textIndex);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(185, 69, 63, 0, 38);
+ PARK_WAIT_FOR_LAURA_DIALOGUE();
+ for (int frame = 26; frame <= 29; ++frame) {
+ PARK_DRAW_LAURA_FRAME(frame);
+ waitForTimer(5);
+ }
+ textIndex = 250;
+ PARK_QUEUE_REPLY_TEXT(2, 1, 601, textIndex);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(162, 64, 63, 63, 63);
+ WalkData *wd = &_walkData[_walkDataLastIndex - 1];
+ wd->x = 162;
+ wd->y = 117;
+ wd->posNum = kFacingPositionRight;
+ PARK_WAIT_FOR_IGOR_DIALOGUE();
+ textIndex = 250;
+ PARK_QUEUE_REPLY_TEXT(3, 1, 602, textIndex);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(185, 69, 63, 0, 38);
+ PARK_WAIT_FOR_LAURA_DIALOGUE();
+ _updateDialogue = &IgorEngine::PARK_UPDATE_DIALOGUE_LAURA;
+ handleDialogue(185, 69, 63, 0, 38, false);
+ _updateDialogue = 0;
+ PARK_DRAW_LAURA_FRAME(29);
+ textIndex = 250;
+ PARK_QUEUE_REPLY_TEXT(4, 1, 603, textIndex);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(162, 64, 63, 63, 63);
+ PARK_WAIT_FOR_IGOR_DIALOGUE();
+ for (int frame = 31; frame <= 57; ++frame) {
+ PARK_DRAW_LAURA_FRAME(frame);
+ waitForTimer(30);
+ }
+ textIndex = 250;
+ PARK_QUEUE_REPLY_TEXT(5, 1, 604, textIndex);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(162, 64, 63, 63, 63);
+ PARK_WAIT_FOR_IGOR_DIALOGUE();
+ memset(_screenVGA + 46080, 0, 17920);
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[72], 0);
+ _currentAction.verb = kVerbWalk;
+ _roomDataOffsets.dlg = kNoDialogueData;
}
void IgorEngine::PART_34_ACTION_109_SCROLL_RIGHT() {
int xPos = 240;
const int yPos = 124;
int step = 1;
- _gameTicks = 8; // original counter 15 normalized to 8-tick engine units; cseg101:0BD1-0BE7
+ _gameTicks = 8; // original counter 15 normalized to 8-tick engine units
do {
if (compareGameTick(1, 16)) {
for (int y = 0; y <= 143; ++y) {
@@ -100,12 +458,15 @@ void IgorEngine::PART_34_ACTION_109_SCROLL_RIGHT() {
_currentPart = 351;
}
+/**
+ * Redraws the old lady if she is in the park and updates the state dependent objects.
+ */
void IgorEngine::PART_34_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- if (!(_objectsState[80] == 0 && _objectsState[73] == 1)) {
- _roomObjectAreasTable[5].object = 0;
+ if (_objectsState[80] == 0 && _objectsState[73] == 1) {
+ PARK_DRAW_LADY_FRAME(_screenLayer1, 1);
} else {
- // TODO: draw the state-dependent frame from FRM_Park1; cseg101:0F4A-0F79.
+ _roomObjectAreasTable[5].object = 0;
}
}
if (num == 3 || num == 255) {
@@ -113,6 +474,37 @@ void IgorEngine::PART_34_APPLY_OBJECT_STATE(int num) {
}
}
+/**
+ * The old lady idles in her place by shifting between the frames of FRM_Park4. Pixels of Igor and
+ * of the dialogue text are kept on the screen.
+ */
+void IgorEngine::PART_34_LADY_IDLE(int step) {
+ const uint8 *frame = _animFramesBuffer + kParkIdleFrames + kOldLadyIdleFrames[step - 1] * 630;
+ uint8 buffer[35 * 18];
+ for (int y = 0; y < 35; ++y) {
+ for (int x = 0; x < 18; ++x) {
+ const uint8 color = _screenVGA[(73 + y) * 320 + 112 + x];
+ if ((color >= 0xC0 && color <= 0xCF) || color == 0xF0 || color == 0xF1) {
+ buffer[y * 18 + x] = color;
+ } else {
+ buffer[y * 18 + x] = frame[y * 18 + x];
+ }
+ }
+ }
+ for (int y = 0; y < 35; ++y) {
+ memcpy(_screenVGA + (73 + y) * 320 + 112, buffer + y * 18, 18);
+ memcpy(_screenLayer1 + (73 + y) * 320 + 112, frame + y * 18, 18);
+ }
+}
+
+void IgorEngine::PART_34_UPDATE_ROOM_BACKGROUND() {
+ PARK_UPDATE_AMBIENT_SOUND();
+ if (compareGameTick(61) && _objectsState[80] == 0 && _objectsState[73] == 1 && getRandomNumber(4) == 0) {
+ PART_34_LADY_IDLE(_parkLadyIdleStep);
+ _parkLadyIdleStep = (_parkLadyIdleStep == 6) ? 1 : _parkLadyIdleStep + 1;
+ }
+}
+
void IgorEngine::PART_34() {
_gameState.enableLight = 1;
loadActionData(DAT_ParkLeft);
@@ -122,10 +514,12 @@ void IgorEngine::PART_34() {
}
loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // active left panel;
static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
- loadAnimData(frames, 0x5A00);
+ loadAnimData(frames, kParkFrames);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_34_EXEC_ACTION);
+ _updateRoomBackground = &IgorEngine::PART_34_UPDATE_ROOM_BACKGROUND;
+ _parkLadyIdleStep = 1;
_roomDataOffsets = PART_34_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
PART_34_APPLY_OBJECT_STATE(255);
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index e3faf6b38cc..98c5c3feed7 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -7,6 +7,7 @@
*/
#include "igor/igor.h"
+#include "igor/statics.h"
namespace Igor {
@@ -21,8 +22,7 @@ void IgorEngine::PART_35_EXEC_ACTION(int action) {
PART_35_APPLY_OBJECT_STATE(3);
break;
case 102:
- // TODO: transcribe the inventory acquisition sequence from cseg100:0102-01F9.
- warning("PART_35_EXEC_ACTION action 102 unimplemented");
+ PART_35_ACTION_102_TAKE();
break;
case 103:
ADD_DIALOGUE_TEXT(203, 1, 612);
@@ -51,11 +51,23 @@ void IgorEngine::PART_35_EXEC_ACTION(int action) {
}
}
+void IgorEngine::PART_35_ACTION_102_TAKE() {
+ if (_inventoryInfo[62] != 0) {
+ ADD_DIALOGUE_TEXT(206, 1, 615);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ return;
+ }
+ PARK_PICK_UP_ANIMATION(16339, kParkFrames);
+ addObjectToInventory(27, 62);
+ PART_35_APPLY_OBJECT_STATE(255);
+}
+
void IgorEngine::PART_35_ACTION_107_SCROLL_LEFT() {
int xPos = 183;
const int yPos = 124;
int step = 1;
- _gameTicks = 8; // original counter 15 normalized to 8-tick engine units; cseg100:021A-0230
+ _gameTicks = 8; // original counter 15 normalized to 8-tick engine units
do {
if (compareGameTick(1, 16)) {
for (int y = 0; y <= 143; ++y) {
@@ -65,7 +77,7 @@ void IgorEngine::PART_35_ACTION_107_SCROLL_LEFT() {
_animFramesBuffer + y * 160 + 160 - step * 8, step * 8);
}
if (step < 5) {
- xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame]; // s3:4637; cseg100:02D1-02E5
+ xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame];
WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame);
} else {
_walkCurrentFrame = 0;
@@ -94,7 +106,7 @@ void IgorEngine::PART_35_ACTION_107_SCROLL_LEFT() {
void IgorEngine::PART_35_ACTION_106_EXIT_TO_MAP() {
--_walkDataLastIndex;
- const uint8 area = _screenLayer2[10879]; // (319, 33); cseg100:0440-0455
+ const uint8 area = _screenLayer2[10879]; // (319, 33)
_roomObjectAreasTable[area].area = 1;
buildWalkPath(242, 111, 319, 33);
_roomObjectAreasTable[area].area = 0;
@@ -106,24 +118,31 @@ void IgorEngine::PART_35_ACTION_106_EXIT_TO_MAP() {
void IgorEngine::PART_35_APPLY_OBJECT_STATE(int num) {
if (num == 3 || num == 255) {
- _roomObjectAreasTable[7].object = (_objectsState[82] == 0) ? 1 : 2; // s3:0xDC7A; cseg100:0634-0653
+ _roomObjectAreasTable[7].object = (_objectsState[82] == 0) ? 1 : 2;
}
}
void IgorEngine::PART_35() {
_gameState.enableLight = 1;
- loadActionData(DAT_ParkRight); // resource 100
- loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // left panel; cseg106:0002-06A1
+ loadActionData(DAT_ParkRight);
+ loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // left panel
static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
- loadAnimData(frames, 0x5A00);
+ loadAnimData(frames, kParkFrames);
+ if (_objectsState[80] == 0 && _objectsState[73] == 1) {
+ PARK_DRAW_LADY_FRAME(_screenLayer1, 1);
+ }
for (int y = 0; y <= 143; ++y) {
memcpy(_animFramesBuffer + y * 160, _screenLayer1 + y * 320, 160);
}
loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight,
- TXT_ParkRight); // active right panel; cseg100:1714-1739; cseg104:0002-0D20
+ TXT_ParkRight); // active right panel
+ // The pick up frames replace the start of FRM_Park1, whose frames are not drawn on this panel
+ static const int pickUpFrames[] = { FRM_ParkRight1, 0 };
+ loadAnimData(pickUpFrames, kParkFrames);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_35_EXEC_ACTION);
+ _updateRoomBackground = &IgorEngine::PARK_UPDATE_AMBIENT_SOUND;
_roomDataOffsets = PART_35_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 281, 143); // rightmost walkable column is 281
PART_35_APPLY_OBJECT_STATE(255);
@@ -148,7 +167,7 @@ void IgorEngine::PART_35() {
wd->dyPos = 0;
wd->scaleHeight = 34;
_walkDataLastIndex = 0;
- const uint8 area = _screenLayer2[10879]; // (319, 33); cseg100:04CF-04E4
+ const uint8 area = _screenLayer2[10879]; // (319, 33)
_roomObjectAreasTable[area].area = 1;
buildWalkPath(319, 33, 242, 111);
_roomObjectAreasTable[area].area = 0;
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 5cdfccba3eb..be173083a48 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -582,4 +582,13 @@
#define DLG_AdministrationSecretaryRoom 984
+// Park conversation with the old lady (cseg94:2498), Laura's entrance and conversation (cseg102:0D22,
+// cseg103:0002).
+#define DLG_ParkLady 985 // cseg94:2E6A; IGOR.EXE:0x390A6A, 0x062D bytes
+#define DLG_ParkLaura 986 // cseg102:1E97; IGOR.EXE:0x3D3597, 0x0B54 bytes
+#define FRM_ParkLaura1 987 // cseg103:00A5; IGOR.EXE:0x3D58A5, 0x9EAE bytes
+#define FRM_ParkLaura2 988 // cseg103:9F53; IGOR.EXE:0x3DF753, 0x0072 bytes
+#define FRM_ParkLaura3 989 // cseg103:9FC5; IGOR.EXE:0x3DF7C5, 0x0030 bytes
+#define FRM_ParkRight1 990 // cseg49:29B6; IGOR.EXE:0x2053B6, 0x0F81 bytes
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index a120877d7f6..509193c3e1c 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -38,8 +38,8 @@ void IgorEngine::playMusic(int num) {
// play only if the requested track is not already playing
if(_gameState.musicNum != num) {
_gameState.musicNum = num;
- g_system->getAudioCDManager()->stop();
- g_system->getAudioCDManager()->play(num, -1, 0, 0);
+ // g_system->getAudioCDManager()->stop();
+ // g_system->getAudioCDManager()->play(num, -1, 0, 0);
}
}
}
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 974bd15ad98..b4c5c9b7660 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -432,16 +432,16 @@ const RoomDataOffsets IgorEngine::PART_33_ROOM_DATA_OFFSETS = {
};
const RoomDataOffsets IgorEngine::PART_34_ROOM_DATA_OFFSETS = {
- { 0, 0, 0, 0 }, // cseg101:1765-1775 calls the direct room walk builder cseg101:1006
- { 4, 15 }, // cseg101:1645-168B (walk points); cseg101:17DE-17F6 (facing)
- { 19, 211, 3087, 103, 179, 80 }, // cseg101:142D,14CB,1572,1486,14AF
+ { 0, 0, 0, 0 }, // walk paths are built directly by the room
+ { 4, 15 },
+ { 19, 211, 3087, 103, 179, 80 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
const RoomDataOffsets IgorEngine::PART_35_ROOM_DATA_OFFSETS = {
- { 0, 0, 0, 0 }, // cseg100:0E23-0E33 calls the direct room walk builder cseg100:06C4
- { 5, 18 }, // cseg100:0D03-0D49 (walk points); cseg100:0E9C-0EB4 (facing)
- { 23, 233, 3179, 127, 203, 82 }, // cseg100:0AEB,0B89,0C30,0B44,0B6D
+ { 0, 0, 0, 0 }, // walk paths are built directly by the room
+ { 5, 18 },
+ { 23, 233, 3179, 127, 203, 82 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
diff --git a/engines/igor/statics.h b/engines/igor/statics.h
index 6f4cf2e5970..f62e82d5030 100644
--- a/engines/igor/statics.h
+++ b/engines/igor/statics.h
@@ -34,6 +34,16 @@ const uint32 kPart10_11_Frm3 = 0xC5E2; // cseg177:0097
const uint32 kPart10_11_Frm4 = 0xC786; // cseg177:00CA
const uint32 kPart10_11_Frm5 = 0xC8AE; // cseg177:00FD
+// Layout of the animation buffer while the park is loaded: FRM_Park1..4 follow each other
+// from kParkFrames on, and the frames of Laura's entrance replace them while she is on screen.
+const uint32 kParkFrames = 0x5A00; // FRM_Park1: sparse frames, the old lady and Igor
+const uint32 kParkFrameTable = 0x76A8; // FRM_Park2: frame offset table, relative to kParkFrames
+const uint32 kParkPickUpFrames = 0xD0E6; // FRM_Park3: three raw 27x49 frames of the pick up animation
+const uint32 kParkIdleFrames = 0xE067; // FRM_Park4: five raw 18x35 frames of the old lady's idle animation
+const uint32 kParkLauraFrames = 0x5A00; // FRM_ParkLaura1: sparse frames
+const uint32 kParkLauraFrameTable = 0x9EAE; // FRM_ParkLaura2: frame offset table, relative to kParkLauraFrames
+const uint32 kParkLauraPalette = 0xF920; // FRM_ParkLaura3: 16 colors for Laura's sprites
+
} // End of namespace Igor
#endif // IGOR_STATICS_H
Commit: e24a4b82cf3963b55b9e55c7e6b95c0cc94ee3e6
https://github.com/scummvm/scummvm/commit/e24a4b82cf3963b55b9e55c7e6b95c0cc94ee3e6
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:18+01:00
Commit Message:
IGOR: Imports rooms 31 and 33 from legacy engine
Changed paths:
A engines/igor/parts/part_31.cpp
A engines/igor/parts/part_33.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index e19b1ab9f49..4bc2320c929 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -801,6 +801,46 @@ private:
void PART_30_HELPER_9_setLauraFrame(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();
+
// park
void PARK_DRAW_LADY_FRAME(uint8 *dst, int frame);
void PARK_DRAW_LAURA_FRAME(int frame);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 6f51f8b37d9..080e6d8d673 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -39,6 +39,8 @@ MODULE_OBJS = \
parts/part_27.o \
parts/part_28.o \
parts/part_30.o \
+ parts/part_31.o \
+ parts/part_33.o \
parts/part_34.o \
parts/part_35.o \
text.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index d498f546d27..b9f5c61f893 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -630,6 +630,16 @@ void IgorEngine::PART_MAIN() {
case 303:
PART_30(); // college stairs first floor
break;
+ case 310:
+ case 311:
+ case 312:
+ case 313:
+ PART_31();
+ break;
+ case 330:
+ case 331:
+ PART_33();
+ break;
case 340:
PART_34(); // Park, left panel
break;
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
new file mode 100644
index 00000000000..0c3c1e0d004
--- /dev/null
+++ b/engines/igor/parts/part_31.cpp
@@ -0,0 +1,435 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#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(29) == 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);
+ fadeIn(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();
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
new file mode 100644
index 00000000000..5eedc52202e
--- /dev/null
+++ b/engines/igor/parts/part_33.cpp
@@ -0,0 +1,505 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#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(3) + 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(2));
+ 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(2));
+ 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(3) + 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);
+ fadeIn(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);
+ }
+ fadeOut(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;
+ fadeIn(768);
+ PART_33_HELPER_7();
+ enterPartLoop();
+ while (_currentPart == 330) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (_objectsState[75] == 1) {
+ _objectsState[75] = 2;
+ }
+ fadeOut(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);
+}
+
+} // End of namespace Igor
Commit: 5e79a62dc2a14ef5a274309297ceb76ea767f421
https://github.com/scummvm/scummvm/commit/5e79a62dc2a14ef5a274309297ceb76ea767f421
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:19+01:00
Commit Message:
IGOR: Fix problem with toilets in which exiting would leave igor in shades
Changed paths:
engines/igor/parts/part_18.cpp
engines/igor/parts/part_25.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index f57a475c043..c7fe119a39f 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -182,9 +182,7 @@ void IgorEngine::PART_18() {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- if(_currentPart == 190) {
- PART_18_HELPER_2_walkIn();
- }
+ PART_18_HELPER_2_walkIn();
enterPartLoop();
while (_currentPart == 180) {
runPartLoop();
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index 75b87e619a0..ce7d7b81faf 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -113,12 +113,12 @@ void IgorEngine::PART_25_ACTION_107() {
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);
- }
+ }
+ if (i == 2) {
+ playSound(13, 1);
+ }
+ if (i == 1) {
+ waitForTimer(100);
}
}
_objectsState[68] = 1;
@@ -134,12 +134,12 @@ void IgorEngine::PART_25_ACTION_108() {
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);
- }
+ }
+ if (i == 4) {
+ playSound(14, 1);
+ }
+ if (i == 3) {
+ waitForTimer(100);
}
}
_objectsState[68] = 0;
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 34f42f9947b..f92a7189885 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -166,7 +166,7 @@ void IgorEngine::moveIgor(int pos, int frame) {
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;
+ int c = _paletteBuffer[color] + colorLum;
if (c < 1) {
c = 0;
} else if (c > 62) {
Commit: 1dd5eb87b5cbd6e6f7e3e373915d2e284fedcd30
https://github.com/scummvm/scummvm/commit/1dd5eb87b5cbd6e6f7e3e373915d2e284fedcd30
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:19+01:00
Commit Message:
IGOR: Fix speech in dean peppers office
Changed paths:
engines/igor/parts/part_8.cpp
engines/igor/static_walk.cpp
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index 0094928cad4..946e4e61293 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -289,6 +289,7 @@ void IgorEngine::PART_08_ACTION_103_TALK_TO_DEAN() {
startCutsceneDialogue(78, 75, 26, 58, 0);
waitForEndOfCutsceneDialogue(78, 75, 26, 58, 0);
_updateDialogue = 0;
+ PART_08_APPLY_OBJECT_STATE(255);
return;
}
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index b4c5c9b7660..30504c053e3 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -248,9 +248,9 @@ const RoomDataOffsets IgorEngine::PART_08_ROOM_DATA_OFFSETS = {
5188, 100,
90,
270,
- 15488, // cseg195:4B98-4BC0
- 15548, // cseg195:51AE-51D4
- 30
+ 15488,
+ 15548,
+ 100
}
};
Commit: 500509351bbf2ce088240d2c171738a0d18854a7
https://github.com/scummvm/scummvm/commit/500509351bbf2ce088240d2c171738a0d18854a7
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:19+01:00
Commit Message:
IGOR: Fixes walk path in part 11
Changed paths:
engines/igor/static_walk.cpp
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 30504c053e3..b37efa35bd4 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -24,26 +24,24 @@
namespace Igor {
const RoomDataOffsets IgorEngine::PART_00_ROOM_DATA_OFFSETS = {
- { 45, 3, 6, 2 }, // cseg206:29BB-29EF
- { 79, 96 }, // cseg206:2FF8-301F,3191-31B5
- { 103, 347, 3503, 247, 323, 88 }, // cseg206:2DCA-2E69
+ { 45, 3, 6, 2 },
+ { 79, 96 },
+ { 103, 347, 3503, 247, 323, 88 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
const RoomDataOffsets IgorEngine::PART_01_ROOM_DATA_OFFSETS = {
- { 0, 0, 0, 0 }, // cseg200 has no area-transition table
- { 4, 15 }, // cseg200:0EBA-0EF5 (walk points), 1067,1672 (facing)
- { 19, 103, 3155, 209, 179, 82 }, // cseg200:1E43-1F88
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // cseg200 has no room-specific dialogue matrix
+ { 0, 0, 0, 0 }, // no area-transition table
+ { 4, 15 },
+ { 19, 103, 3155, 209, 179, 82 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // no room-specific dialogue matrix
};
const RoomDataOffsets IgorEngine::PART_02_ROOM_DATA_OFFSETS = {
- { 125, 5, 20, 4 }, // cseg203:323B-324D; five-area transition table
- { 259, 280 }, // cseg203:385E-3884,39F9
- // use matrix 565: cseg203:4A89; object2 map 473: cseg203:4A43;
- // object1 map 549: cseg203:4A6D; row size 0x60: cseg203:4A74.
+ { 125, 5, 20, 4 }, // five-area transition table
+ { 259, 280 },
{ 289, 565, 4193, 473, 549, 96 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // cseg203 has no room-specific dialogue matrix
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // no room-specific dialogue matrix
};
const uint8 IgorEngine::_walkWidthScaleTable[] = {
@@ -225,18 +223,18 @@ const RoomDataOffsets IgorEngine::PART_06_ROOM_DATA_OFFSETS = {
{ 87, 259, 3135, 151, 227, 80 },
{
135, 30, 5158, 100, 60,
- 240, // cseg181:0F2F-0F41
- 15458, // cseg181:0771-0783
- 15518, // cseg181:0FCE-0FEF
- 35 // cseg181:11CB; (0x3CE6 - 15518) / 2 - 1
+ 240,
+ 15458,
+ 15518,
+ 35
}
};
const RoomDataOffsets IgorEngine::PART_07_ROOM_DATA_OFFSETS = {
- { 80, 4, 12, 3 }, // cseg197:194E-199C; DAT+80, 4 records, 12-byte source, 3-byte destination
- { 151, 168 }, // cseg197:1F87-1FCF and cseg197:2124-213D
- { 175, 419, 3575, 319, 395, 88 }, // cseg197:2E4C-2F19 and cseg197:2F23-2F62
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // cseg197 has no room-specific question/reply matrix
+ { 80, 4, 12, 3 }, // DAT+80, 4 records, 12-byte source, 3-byte destination
+ { 151, 168 },
+ { 175, 419, 3575, 319, 395, 88 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // no room-specific question/reply matrix
};
const RoomDataOffsets IgorEngine::PART_08_ROOM_DATA_OFFSETS = {
@@ -255,7 +253,7 @@ const RoomDataOffsets IgorEngine::PART_08_ROOM_DATA_OFFSETS = {
};
const RoomDataOffsets IgorEngine::PART_09_ROOM_DATA_OFFSETS = {
- { 80, 4, 12, 3 }, // cseg190:1FA1-1FD4; transition table at DAT+80, four areas, strides 12 and 3
+ { 80, 4, 12, 3 }, // transition table at DAT+80, four areas, strides 12 and 3
{ 149, 162 },
{ 167, 375, 3391, 271, 347, 84 },
{ 378, 29, 5237, 46, 120, 480, 10029, 10087, 46 }
@@ -269,16 +267,16 @@ const RoomDataOffsets IgorEngine::PART_04_ROOM_DATA_OFFSETS = {
};
const RoomDataOffsets IgorEngine::PART_10_ROOM_DATA_OFFSETS = {
- { 45, 3, 6, 2 }, // cseg175:17F9-1829: DAT+45, 3 records, 6-byte source, 2-byte destination
- { 77, 90 }, // cseg175:1E22-1E68 and cseg175:1FBB-1FD3
- { 95, 303, 3319, 199, 275, 84 }, // cseg175:1C41-1CA7, 1CE9-1D4F, 2C8B-2DEA
+ { 45, 3, 6, 2 }, // DAT+45, 3 records, 6-byte source, 2-byte destination
+ { 77, 90 },
+ { 95, 303, 3319, 199, 275, 84 },
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
const RoomDataOffsets IgorEngine::PART_11_ROOM_DATA_OFFSETS = {
- { 0, 0, 0, 0 }, // cseg176 routes walks through the room mask; no area matrix
- { 35, 52 }, // cseg176:1EE5-1F15, 207C
- { 59, 309, 3255, 203, 279, 82 }, // cseg176:2CBC-2CE5 (action); +60 is its walk behavior at 1E7B,2026,2061
+ { 20, 2, 2, 1 }, // DAT+20, 2 areas, 2-byte source stride, 1-byte destination stride
+ { 35, 52 },
+ { 59, 309, 3255, 203, 279, 82 }, // +60 is the object's walk behavior
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
@@ -288,10 +286,10 @@ const RoomDataOffsets IgorEngine::PART_12_ROOM_DATA_OFFSETS = {
{ 87, 259, 3135, 151, 227, 80 },
{
-85, 15, 2478, 25, 30,
- 60, // cseg172:09C5-09D6
- 5230, // cseg172:043B-0452
- 5260, // cseg172:0A59-0A82
- 25 // cseg172:0A4A-0A92
+ 60,
+ 5230,
+ 5260,
+ 25
}
};
@@ -405,13 +403,13 @@ const RoomDataOffsets IgorEngine::PART_30_ROOM_DATA_OFFSETS = {
{ 75, 84 },
{ 87, 259, 3135, 151, 227, 80 },
{
- -90, // cseg110:018E-019E; first question at blob+115
+ -90, // first question at blob+115
9,
- 1489, // cseg110:018E-019E; first reply at blob+1591
+ 1489, // first reply at blob+1591
11,
30,
- 90, // seg111:0ECD+90; reply 4 starts at +94 (cseg111 dialogue matrix)
- 2711, // cseg110:018E-019E; derived from the packed-tail layout
+ 90, // reply 4 starts at +94
+ 2711, // derived from the packed-tail layout
2729,
11
}
Commit: 1f018a964e24a93054205265366cc9ece74b5ed8
https://github.com/scummvm/scummvm/commit/1f018a964e24a93054205265366cc9ece74b5ed8
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:20+01:00
Commit Message:
IGOR: Fixes priest being misplaced when dialogue happens
Changed paths:
engines/igor/igor.cpp
engines/igor/part_main.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_9.cpp
engines/igor/sound.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 26b27d3b4d2..96266d8dd53 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -323,7 +323,7 @@ void IgorEngine::handleRoomLight() {
} else if (_gameState.updateLight) {
updateRoomLight(0);
_gameState.updateLight = 0;
- } else if (getRandomNumber(10) == 0) {
+ } else if (getRandomNumber(9) == 0) {
updateRoomLight(1);
_gameState.updateLight = true;
}
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index b9f5c61f893..c353c8563bd 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -27,7 +27,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
case 1:
break;
case 2: {
- int num, rnd = getRandomNumber(100);
+ int num, rnd = getRandomNumber(99);
if (rnd < 34) {
num = 11;
} else if (rnd < 69) {
@@ -72,7 +72,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
startIgorDialogue();
break;
case 9: {
- int num = 16 + getRandomNumber(2);
+ int num = 16 + getRandomNumber(1);
ADD_DIALOGUE_TEXT(num, 1, num);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -89,7 +89,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
startIgorDialogue();
break;
case 12: {
- int num = 20 + getRandomNumber(2);
+ int num = 20 + getRandomNumber(1);
ADD_DIALOGUE_TEXT(num, 1, num);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -116,7 +116,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
startIgorDialogue();
break;
case 17: {
- int num = 26 + getRandomNumber(2);
+ int num = 26 + getRandomNumber(1);
ADD_DIALOGUE_TEXT(num, 1, num);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -138,7 +138,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
startIgorDialogue();
break;
case 21: {
- int num = 1 + getRandomNumber(3);
+ int num = 1 + getRandomNumber(2);
ADD_DIALOGUE_TEXT(num, 1, num);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index ec40e7d4302..6666f1362d2 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -155,7 +155,7 @@ void IgorEngine::PART_12_ACTION_104() {
}
}
src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA440) - 1;
- decodeAnimFrame(src, _screenVGA);
+ decodeAnimFrame(src, _screenLayer1);
PART_12_HELPER_1(255);
}
@@ -177,7 +177,8 @@ void IgorEngine::PART_12_ACTION_105() {
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;
+ // the original offset is a 16-bit value and wraps within the segment
+ const uint8 *src = _animFramesBuffer + ((animOffset + PART_12_DATA_ANIM_1[i] * 1715 + j * 35 + 0xF94C) & 0xFFFF);
memcpy(_screenVGA + j * 320 + offset, src, 35);
}
waitForTimer(30);
@@ -224,7 +225,7 @@ void IgorEngine::PART_12_ACTION_105() {
}
}
if (compareGameTick(2, 32)) {
- _gameState.unk10 = getRandomNumber(2) + 7;
+ _gameState.unk10 = getRandomNumber(1) + 7;
const uint8 *src = _animFramesBuffer + 0x761 + READ_LE_UINT16(_animFramesBuffer + 0x1107 + _gameState.unk10 * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
@@ -288,8 +289,8 @@ void IgorEngine::PART_12_ACTION_108() {
}
void IgorEngine::PART_12_UPDATE_ROOM_BACKGROUND() {
- if (compareGameTick(1) && getRandomNumber(15) == 0) {
- switch (getRandomNumber(4)) {
+ if (compareGameTick(1) && getRandomNumber(14) == 0) {
+ switch (getRandomNumber(3)) {
case 0:
playSound(21, 1);
break;
@@ -312,7 +313,7 @@ void IgorEngine::PART_12_UPDATE_DIALOGUE_CHURCHMAN(int action) {
PART_12_HELPER_8();
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_12_HELPER_10(6 + getRandomNumber(6));
+ PART_12_HELPER_10(6 + getRandomNumber(5));
break;
case kUpdateDialogueAnimStanding:
PART_12_HELPER_8();
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index bfe4243fad8..04a3e1dfd78 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -193,8 +193,8 @@ void IgorEngine::PART_09_SECRETARY_GESTURE() {
}
void IgorEngine::PART_09_UPDATE_ROOM_BACKGROUND() {
- if (_objectsState[35] == 0 && compareGameTick(61) && getRandomNumber(2) == 0)
- PART_09_DRAW_SECRETARY_FRAME(getRandomNumber(3), false);
+ if (_objectsState[35] == 0 && compareGameTick(61) && getRandomNumber(1) == 0)
+ PART_09_DRAW_SECRETARY_FRAME(getRandomNumber(2), false);
}
void IgorEngine::PART_09_EXEC_ACTION(int action) {
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 509193c3e1c..c8783ce2443 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -46,6 +46,13 @@ void IgorEngine::playMusic(int num) {
void IgorEngine::playSound(int num, int type) {
+ // A zero speech number means the line has no recorded speech
+ if (type == 0 && num == 0) {
+ if (_mixer->isSoundHandleActive(_speechHandle)) {
+ _mixer->stopHandle(_speechHandle);
+ }
+ return;
+ }
--num;
int soundOffset = -1;
Audio::Mixer::SoundType soundType;
Commit: 38cd98d0013ddf2ce945941e93fd92d24bcd5684
https://github.com/scummvm/scummvm/commit/38cd98d0013ddf2ce945941e93fd92d24bcd5684
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:20+01:00
Commit Message:
IGOR: Fixes inventory combinations that changed the wrong array
Changed paths:
engines/igor/part_main.cpp
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index c353c8563bd..489506d3afd 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -358,10 +358,10 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
}
break;
case 62:
- _inventoryImages[_inventoryInfo[52] - 1] = 0;
+ _inventoryInfo[_inventoryInfo[52] - 1] = 0;
_inventoryInfo[52] = 0;
packInventory();
- _inventoryImages[_inventoryInfo[59] - 1] = 0;
+ _inventoryInfo[_inventoryInfo[59] - 1] = 0;
_inventoryInfo[59] = 0;
packInventory();
_objectsState[1] = 1;
@@ -375,10 +375,10 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
ADD_DIALOGUE_TEXT(170, 1, 94);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
- _inventoryImages[_inventoryInfo[68] - 1] = 0;
+ _inventoryInfo[_inventoryInfo[68] - 1] = 0;
_inventoryInfo[68] = 0;
packInventory();
- _inventoryImages[_inventoryInfo[69] - 1] = 0;
+ _inventoryInfo[_inventoryInfo[69] - 1] = 0;
_inventoryInfo[69] = 0;
packInventory();
_objectsState[6] = 1;
Commit: c86da7912728e2b8ec2b98bc2418c5ead94ef83c
https://github.com/scummvm/scummvm/commit/c86da7912728e2b8ec2b98bc2418c5ead94ef83c
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:20+01:00
Commit Message:
IGOR: Fixes camera not becoming a hotspot after getting rid of photographer
Changed paths:
engines/igor/parts/part_5.cpp
engines/igor/parts/part_6.cpp
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index 2f694b53bb9..2573cc20b7c 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -174,6 +174,7 @@ void IgorEngine::PART_05() {
if (_currentPart == 50) {
debug("Entering PART_05_HELPER_6");
memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
fadeIn(624);
PART_05_HELPER_6_walkIgorToScene();
}
@@ -199,6 +200,7 @@ void IgorEngine::PART_05() {
}
void IgorEngine::PART_05_ACTION_103_pickPaper() {
+ _gameTicks = 0;
int i = 0;
do {
if (compareGameTick(1)) {
@@ -226,6 +228,7 @@ void IgorEngine::PART_05_ACTION_102_scrollRight() {
int xPos = 220;
int yPos = 0;
int i = 1;
+ _gameTicks = 15 & ~(kTimerTicksCount - 1);
do {
if (compareGameTick(1, 16)) {
for (int y = 0; y <= 143; ++y) {
@@ -288,19 +291,21 @@ void IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND() {
setPaletteRange(185, 191);
}
if (compareGameTick(1)) {
- switch (getRandomNumber(199)) {
- 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 (getRandomNumber(14) == 0) {
+ switch (getRandomNumber(3)) {
+ case 0:
+ playSound(21, 1);
+ break;
+ case 1:
+ playSound(22, 1);
+ break;
+ case 2:
+ playSound(23, 1);
+ break;
+ case 3:
+ playSound(18, 1);
+ break;
+ }
}
}
if (_game.flags & kFlagFloppy) {
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index f56c68bac73..8b72cadf55d 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -40,19 +40,21 @@ void IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND() {
setPaletteRange(185, 191);
}
if (compareGameTick(1)) {
- switch (getRandomNumber(19)) {
- 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 (getRandomNumber(14) == 0) {
+ switch (getRandomNumber(3)) {
+ case 0:
+ playSound(21, 1);
+ break;
+ case 1:
+ playSound(22, 1);
+ break;
+ case 2:
+ playSound(23, 1);
+ break;
+ case 3:
+ playSound(18, 1);
+ break;
+ }
}
}
}
@@ -161,7 +163,8 @@ void IgorEngine::PART_06_HELPER_6_setPhotographerState(int num) {
_roomObjectAreasTable[2].object = 0;
_roomObjectAreasTable[15].object = 0;
_roomObjectAreasTable[18].object = 0;
- _roomObjectAreasTable[3].object = 0;
+ // the camera becomes a hotspot once the photographer is gone
+ _roomObjectAreasTable[3].object = 4;
_roomObjectAreasTable[13].area = 3;
_roomObjectAreasTable[15].area = 3;
_roomObjectAreasTable[17].area = 3;
@@ -180,17 +183,19 @@ void IgorEngine::PART_06_HELPER_6_setPhotographerState(int num) {
void IgorEngine::PART_06_ACTION_105() {
_gameTicks = 0;
- for (int i = 0; i <= 3; ++i) {
+ int i = 0;
+ do {
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);
}
+ ++i;
}
PART_06_UPDATE_ROOM_BACKGROUND();
waitForTimer();
- }
+ } while (i != 3);
addObjectToInventory(36, 71);
_objectsState[62] = 0;
PART_06_HELPER_6_setPhotographerState(255);
@@ -226,12 +231,12 @@ void IgorEngine::PART_06_ACTION_108_giveRocketToPhotographer() {
const uint8 *src = _animFramesBuffer + 0xA763 + READ_LE_UINT16(_animFramesBuffer + 0xDB95 + i * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
++i;
+ if (i == 8) {
+ stopSound();
+ playSound(19, 1);
+ }
}
PART_06_UPDATE_ROOM_BACKGROUND();
- if (i == 7) {
- stopSound();
- playSound(19, 1);
- }
waitForTimer();
} while (i != 28);
removeObjectFromInventory(61);
@@ -249,6 +254,7 @@ void IgorEngine::PART_06_ACTION_102_scrollLeft() {
int xPos = 323;
int yPos = 0;
int i = 1;
+ _gameTicks = 15 & ~(kTimerTicksCount - 1);
do {
if (compareGameTick(1, 16)) {
for (int y = 0; y <= 143; ++y) {
@@ -384,6 +390,9 @@ void IgorEngine::PART_06() {
waitForTimer();
}
leavePartLoop();
+ if (_currentPart == 255 && !_gameStateLoaded) {
+ fadeOut(768);
+ }
}
} // End of namespace Igor
Commit: 5e97e8d27c1bca9b018d4b6a1c850db05a31fbc5
https://github.com/scummvm/scummvm/commit/5e97e8d27c1bca9b018d4b6a1c850db05a31fbc5
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:21+01:00
Commit Message:
IGOR: Add console command to execute actions
Changed paths:
engines/igor/console.cpp
engines/igor/console.h
engines/igor/igor.h
diff --git a/engines/igor/console.cpp b/engines/igor/console.cpp
index 39d53cc4b1d..24254132719 100644
--- a/engines/igor/console.cpp
+++ b/engines/igor/console.cpp
@@ -24,7 +24,7 @@
namespace Igor {
-Console::Console() : GUI::Debugger() {
+ Console::Console() : GUI::Debugger() {
registerCmd("test", WRAP_METHOD(Console, Cmd_test));
registerCmd("paint_walk", WRAP_METHOD(Console, Cmd_paintWalk));
registerCmd("paint_hotspots", WRAP_METHOD(Console, Cmd_paintHotspots));
@@ -35,6 +35,7 @@ Console::Console() : GUI::Debugger() {
registerCmd("fast_mode", WRAP_METHOD(Console, Cmd_fastMode));
registerCmd("room", WRAP_METHOD(Console, Cmd_changePart));
registerCmd("give", WRAP_METHOD(Console, Cmd_addObjectToInventory));
+ registerCmd("action", WRAP_METHOD(Console, Cmd_executeAction));
}
Console::~Console() {
@@ -137,4 +138,21 @@ bool Console::Cmd_addObjectToInventory(int argc, const char **argv) {
return true;
}
+bool Console::Cmd_executeAction(int argc, const char **argv) {
+ if (argc != 2) {
+ debugPrintf("Usage: %s <action code>\n", argv[0]);
+ return true;
+ }
+
+ const int action = atoi(argv[1]);
+ if (action < 0 || action > 199) {
+ debugPrintf("Invalid action code '%s' (valid range 0-199)\n", argv[1]);
+ return true;
+ }
+
+ g_engine->debugExecuteAction(action);
+ debugPrintf("Executed action %d\n", action);
+ return false;
+}
+
} // End of namespace Igor
diff --git a/engines/igor/console.h b/engines/igor/console.h
index 04f0d9f8083..0d5fe16a86e 100644
--- a/engines/igor/console.h
+++ b/engines/igor/console.h
@@ -39,6 +39,7 @@ private:
bool Cmd_fastMode(int argc, const char **argv);
bool Cmd_changePart(int argc, const char **argv);
bool Cmd_addObjectToInventory(int argc, const char **argv);
+ bool Cmd_executeAction(int argc, const char **argv);
public:
Console();
~Console() override;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 4bc2320c929..738d91c8591 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1045,6 +1045,7 @@ public:
int debugGetFastMode() const { return _fastMode; }
void debugChangePart(int state);
bool debugAddObjectToInventory(int object);
+ void debugExecuteAction(int action) { executeAction(action); }
/**
* Uses a serializer to allow implementing savegame
Commit: 9242fd1f587287569dbfb1b822abf25654c02d99
https://github.com/scummvm/scummvm/commit/9242fd1f587287569dbfb1b822abf25654c02d99
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:21+01:00
Commit Message:
IGOR: Fixes door animations in part 23 and 26
Changed paths:
engines/igor/parts/part_23.cpp
engines/igor/parts/part_26.cpp
diff --git a/engines/igor/parts/part_23.cpp b/engines/igor/parts/part_23.cpp
index 6e6c61cca36..434e6d2dc37 100644
--- a/engines/igor/parts/part_23.cpp
+++ b/engines/igor/parts/part_23.cpp
@@ -23,7 +23,7 @@
namespace Igor {
-static const uint8 PART_23_ANIM_DATA_1[4] = { 0, 4, 1, 11 };
+static const uint8 PART_23_ANIM_DATA_1[3] = { 0, 4, 1 };
void IgorEngine::PART_23_EXEC_ACTION(int action) {
switch (action) {
@@ -95,35 +95,43 @@ void IgorEngine::PART_23_ACTION_105_enterLadiesRoom() {
void IgorEngine::PART_23_ACTION_107_openDoor() {
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);
- }
+ return;
+ }
+ 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);
+ }
+ if (i == 3) {
+ playSound(13, 1);
+ }
+ if (i < 3) {
+ waitForTimer(100);
}
- playSound(13, 1);
- waitForTimer(100);
- _objectsState[66] = 1;
- PART_23_HELPER_1(1);
}
+ _objectsState[66] = 1;
+ PART_23_HELPER_1(1);
}
void IgorEngine::PART_23_ACTION_108_closeDoor() {
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);
- }
+ return;
+ }
+ const int offset = 23901;
+ for (int i = 1; i <= 2; ++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);
+ }
+ if (i == 2) {
+ playSound(14, 1);
+ }
+ if (i < 2) {
+ waitForTimer(100);
}
- playSound(14, 1);
- waitForTimer(100);
- _objectsState[66] = 0;
- PART_23_HELPER_1(1);
}
+ _objectsState[66] = 0;
+ PART_23_HELPER_1(1);
}
void IgorEngine::PART_23_UPDATE_ROOM_BACKGROUND() {
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index 89b144f4cd2..9b63141217a 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -99,7 +99,7 @@ void IgorEngine::PART_26_ACTION_103() {
}
}
_objectsState[69] = 1;
- PART_25_HELPER_1(1);
+ PART_26_HELPER_1(1);
}
void IgorEngine::PART_26_ACTION_104() {
@@ -111,16 +111,15 @@ void IgorEngine::PART_26_ACTION_104() {
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);
- }
+ }
+ if (i == 4) {
+ playSound(14, 1);
+ } else if (i == 3) {
+ waitForTimer(100);
}
}
_objectsState[69] = 0;
- PART_25_HELPER_1(1);
+ PART_26_HELPER_1(1);
}
void IgorEngine::PART_26_ACTION_107() {
Commit: 8bbbe307a0a33f7b27da4bd140f54f5a32d412b5
https://github.com/scummvm/scummvm/commit/8bbbe307a0a33f7b27da4bd140f54f5a32d412b5
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:21+01:00
Commit Message:
IGOR: Fixes message board description in room 27
Changed paths:
engines/igor/parts/part_27.cpp
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index 5d0ac9d01b7..789c56051dd 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -74,10 +74,8 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
PART_27_ACTION_110();
break;
case 111:
- ADD_DIALOGUE_TEXT(222, 1, kNoSpeechSound);
- ADD_DIALOGUE_TEXT(223, 2, kNoSpeechSound);
- ADD_DIALOGUE_TEXT(225, 4, kNoSpeechSound);
- SET_DIALOGUE_TEXT(1, 3);
+ ADD_DIALOGUE_TEXT(218, 2, 1174);
+ SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 112: // look at plaque
Commit: 0a4594010e17fa82fc46a3e2dd20de0ba52af023
https://github.com/scummvm/scummvm/commit/0a4594010e17fa82fc46a3e2dd20de0ba52af023
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:22+01:00
Commit Message:
IGOR: Adds speech indices for room 31
Changed paths:
engines/igor/parts/part_31.cpp
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index 0c3c1e0d004..bc2786de7c0 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -43,13 +43,13 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
if (_objectsState[72] == 0) {
EXEC_MAIN_ACTION(14);
} else {
- ADD_DIALOGUE_TEXT(205, 1);
+ ADD_DIALOGUE_TEXT(205, 1, 885);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
break;
case 105:
- ADD_DIALOGUE_TEXT(201, 1);
+ ADD_DIALOGUE_TEXT(201, 1, 881);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -57,7 +57,7 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
PART_31_ACTION_106();
break;
case 107:
- ADD_DIALOGUE_TEXT(203, 1);
+ ADD_DIALOGUE_TEXT(203, 1, 883);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -65,7 +65,7 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
_currentPart = 240;
break;
case 109:
- ADD_DIALOGUE_TEXT(204, 1);
+ ADD_DIALOGUE_TEXT(204, 1, 884);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -73,36 +73,36 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
PART_31_ACTION_110();
break;
case 111:
- ADD_DIALOGUE_TEXT(206, 1);
+ ADD_DIALOGUE_TEXT(206, 2, 886);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 112:
- ADD_DIALOGUE_TEXT(208, 1);
- ADD_DIALOGUE_TEXT(209, 2);
+ ADD_DIALOGUE_TEXT(208, 1, 887);
+ ADD_DIALOGUE_TEXT(209, 2, 888);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
break;
case 113:
- ADD_DIALOGUE_TEXT(211, 1);
- ADD_DIALOGUE_TEXT(212, 1);
- ADD_DIALOGUE_TEXT(213, 1);
+ ADD_DIALOGUE_TEXT(211, 1, 889);
+ ADD_DIALOGUE_TEXT(212, 1, 890);
+ ADD_DIALOGUE_TEXT(213, 1, 891);
SET_DIALOGUE_TEXT(1, 3);
startIgorDialogue();
break;
case 114:
- ADD_DIALOGUE_TEXT(214, 1);
- ADD_DIALOGUE_TEXT(215, 1);
+ ADD_DIALOGUE_TEXT(214, 1, 892);
+ ADD_DIALOGUE_TEXT(215, 1, 893);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
break;
case 115:
- ADD_DIALOGUE_TEXT(220, 3);
+ ADD_DIALOGUE_TEXT(220, 3, 895);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 116:
- ADD_DIALOGUE_TEXT(218, 2);
+ ADD_DIALOGUE_TEXT(218, 2, 894);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -149,7 +149,7 @@ void IgorEngine::PART_31_ACTION_103() {
waitForTimer(30);
}
}
- ADD_DIALOGUE_TEXT(202, 1);
+ ADD_DIALOGUE_TEXT(202, 1, 882);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
Commit: 170c0bf1835e96183857017d855b51e7ecf5c05f
https://github.com/scummvm/scummvm/commit/170c0bf1835e96183857017d855b51e7ecf5c05f
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:22+01:00
Commit Message:
IGOR: Fixes non-existing lines in room 25
Changed paths:
engines/igor/parts/part_25.cpp
engines/igor/sound.cpp
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index ce7d7b81faf..6474500edd5 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -29,28 +29,23 @@ void IgorEngine::PART_25_EXEC_ACTION(int action) {
_currentPart = 260;
break;
case 102:
- // TODO: the trailing 206 page of every branch has no verified speech
- // reference; that text id is not part of this room's original text set.
switch (getRandomNumber(2) + 1) {
case 1:
ADD_DIALOGUE_TEXT(204, 2, 1273);
- ADD_DIALOGUE_TEXT(206, 1, kNoSpeechSound);
- SET_DIALOGUE_TEXT(1, 2);
+ SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 2:
ADD_DIALOGUE_TEXT(207, 1, 1274);
ADD_DIALOGUE_TEXT(208, 1, 1275);
ADD_DIALOGUE_TEXT(209, 1, 1276);
- ADD_DIALOGUE_TEXT(206, 1, kNoSpeechSound);
- SET_DIALOGUE_TEXT(1, 4);
+ SET_DIALOGUE_TEXT(1, 3);
startIgorDialogue();
break;
case 3:
ADD_DIALOGUE_TEXT(210, 1, 1277);
ADD_DIALOGUE_TEXT(211, 1, 1278);
- ADD_DIALOGUE_TEXT(206, 1, kNoSpeechSound);
- SET_DIALOGUE_TEXT(1, 3);
+ SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
break;
}
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index c8783ce2443..74948a838d8 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -46,8 +46,8 @@ void IgorEngine::playMusic(int num) {
void IgorEngine::playSound(int num, int type) {
- // A zero speech number means the line has no recorded speech
- if (type == 0 && num == 0) {
+ // A zero or "no speech" number means the line has no recorded speech
+ if (type == 0 && (num == 0 || num == kNoSpeechSound)) {
if (_mixer->isSoundHandleActive(_speechHandle)) {
_mixer->stopHandle(_speechHandle);
}
@@ -71,7 +71,7 @@ void IgorEngine::playSound(int num, int type) {
debugC(9, kDebugEngine, "stopping previous handle");
_mixer->stopHandle(_speechHandle);
}
- if ((_game.flags & kFlagTalkie) == 0 || num == kNoSpeechSound) {
+ if ((_game.flags & kFlagTalkie) == 0) {
return;
}
num += 101;
Commit: dd03a3f868e868dd3788cb4002884bff0f8a0334
https://github.com/scummvm/scummvm/commit/dd03a3f868e868dd3788cb4002884bff0f8a0334
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:22+01:00
Commit Message:
IGOR: import parts 35 and 36 from the legacy engine
Changed paths:
A engines/igor/parts/part_36.cpp
A engines/igor/parts/part_37.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_25.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 738d91c8591..6e7c69b2601 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -870,6 +870,22 @@ private:
void PART_35_ACTION_107_SCROLL_LEFT();
void PART_35_APPLY_OBJECT_STATE(int num);
+ // 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();
+
void PART_85();
void PART_85_HELPER_1_PLAY_ANIM(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
void PART_85_HELPER_2_SCROLL_RIGHT();
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 080e6d8d673..1880b0cfa7c 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -43,6 +43,8 @@ MODULE_OBJS = \
parts/part_33.o \
parts/part_34.o \
parts/part_35.o \
+ parts/part_36.o \
+ parts/part_37.o \
text.o \
part_main.o \
sound.o
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 489506d3afd..e0bc124db74 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -647,6 +647,12 @@ void IgorEngine::PART_MAIN() {
case 351:
PART_35(); // Park, right panel
break;
+ case 360:
+ PART_36();
+ break;
+ case 370:
+ PART_37();
+ break;
case 850: // Intro cutscene
// Clear the entire screen buffer before starting the intro cutscene
memset(_screenVGA, 0, 64000);
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index 6474500edd5..b5c1208f2db 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -55,14 +55,7 @@ void IgorEngine::PART_25_EXEC_ACTION(int action) {
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 104:
- ADD_DIALOGUE_TEXT(212, 1, kNoSpeechSound);
- ADD_DIALOGUE_TEXT(213, 1, kNoSpeechSound);
- ADD_DIALOGUE_TEXT(214, 1, kNoSpeechSound);
- ADD_DIALOGUE_TEXT(215, 1, kNoSpeechSound);
- ADD_DIALOGUE_TEXT(216, 2, kNoSpeechSound);
- SET_DIALOGUE_TEXT(1, 5);
- startIgorDialogue();
+ case 104: // walk to board: nothing happens on arrival
break;
case 105:
PART_25_ACTION_105();
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index 4588e459e3c..f5f58fe1234 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -1,9 +1,22 @@
/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
*/
#include "igor/igor.h"
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index 98c5c3feed7..d3e6888ea62 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -1,9 +1,22 @@
/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
*/
#include "igor/igor.h"
diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp
new file mode 100644
index 00000000000..0bac4bd4c2a
--- /dev/null
+++ b/engines/igor/parts/part_36.cpp
@@ -0,0 +1,166 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+
+void IgorEngine::PART_36_EXEC_ACTION(int action) {
+ switch (action) {
+ case 101:
+ ADD_DIALOGUE_TEXT(201, 1, 655);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 102:
+ PART_36_ACTION_102();
+ break;
+ case 103:
+ ADD_DIALOGUE_TEXT(202, 1, 656);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 104:
+ ADD_DIALOGUE_TEXT(203, 1, 657);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 105:
+ ADD_DIALOGUE_TEXT(204, 2, 658);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 106:
+ ADD_DIALOGUE_TEXT(209, 1, 661);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 107:
+ ADD_DIALOGUE_TEXT(206, 2, 659);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 108:
+ ADD_DIALOGUE_TEXT(208, 1, 660);
+ 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();
+ _walkData[0].clipWidth = 15;
+ _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;
+ fadeIn(768);
+ PART_36_HELPER_2();
+ enterPartLoop();
+ while (_currentPart == 360) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ fadeOut(624);
+}
+
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_37.cpp b/engines/igor/parts/part_37.cpp
new file mode 100644
index 00000000000..ffc14bd6b05
--- /dev/null
+++ b/engines/igor/parts/part_37.cpp
@@ -0,0 +1,126 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#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, 664);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 104:
+ ADD_DIALOGUE_TEXT(205, 1, 665);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 105:
+ ADD_DIALOGUE_TEXT(207, 1, 667);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 106:
+ ADD_DIALOGUE_TEXT(206, 1, 666);
+ 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, 663);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ return;
+ }
+ ADD_DIALOGUE_TEXT(201, 1, 662);
+ 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;
+ fadeIn(768);
+ PART_37_HELPER_2();
+ enterPartLoop();
+ while (_currentPart == 370) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ fadeOut(624);
+}
+
+} // End of namespace Igor
Commit: fcec6b8aa0d6e1a9cb7e9715ba1e9825f9a3c55e
https://github.com/scummvm/scummvm/commit/fcec6b8aa0d6e1a9cb7e9715ba1e9825f9a3c55e
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:23+01:00
Commit Message:
IGOR: account for igors sprites being out of bounds
Changed paths:
engines/igor/walk.cpp
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index f92a7189885..7643cb64946 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -178,13 +178,23 @@ void IgorEngine::moveIgor(int pos, int frame) {
_gameState.colorLum = colorLum;
}
}
+ // Igor's sprite can extend past the right edge of the last room row; the
+ // pixels read there are outside the room and never drawn
+ const int layerSize = 320 * 144;
+ auto layer1At = [&](int offset) -> uint8 { return offset < layerSize ? _screenLayer1[offset] : 0; };
+ auto layer2At = [&](int offset) -> uint8 { return offset < layerSize ? _screenLayer2[offset] : 0; };
+ auto copyLayer1 = [&](uint8 *dst, int offset, int size) {
+ for (int n = 0; n < size; ++n) {
+ dst[n] = layer1At(offset + n);
+ }
+ };
uint16 screenIgorDrawOffset = _walkDataDrawOffset;
uint16 igorScaledWidth = _walkDxPos + _walkClipWidth;
uint16 igorScaledHeight = _walkScaleWidth + _walkDyPos; // cseg229:4B48-4B4F
uint16 igorBodyScanLine = 0;
if (_walkYPosChanged != 0) {
for (int i = 1; i <= _walkDyPos; ++i) {
- memcpy(_igorTempFrames + igorBodyScanLine * 50, _screenLayer1 + _walkDataDrawOffset, igorScaledWidth);
+ copyLayer1(_igorTempFrames + igorBodyScanLine * 50, _walkDataDrawOffset, igorScaledWidth);
_walkDataDrawOffset += 320;
++igorBodyScanLine;
}
@@ -193,7 +203,7 @@ void IgorEngine::moveIgor(int pos, int frame) {
for (int yOffset = 0; yOffset < _walkScaleWidth; ++yOffset) {
assert(_walkDxPos > 0);
assert(igorBodyScanLine * 50 + _walkDxPos <= 3000);
- memcpy(_igorTempFrames + igorBodyScanLine * 50, _screenLayer1 + _walkDataDrawOffset, _walkDxPos);
+ copyLayer1(_igorTempFrames + igorBodyScanLine * 50, _walkDataDrawOffset, _walkDxPos);
int xOffset = _walkClipSkipX - 1;
for (int i = 0; i < _walkClipWidth; ++i) {
int offset = lookupScale(xOffset, yOffset, _walkHeightScale);
@@ -201,10 +211,10 @@ void IgorEngine::moveIgor(int pos, int frame) {
uint8 color = _facingIgorFrames[pos - 1][offset];
if (color != 0) {
assert(_walkDataDrawOffset + _walkDxPos + i >= 0);
- int index = _screenLayer2[_walkDataDrawOffset + _walkDxPos + i];
+ int index = layer2At(_walkDataDrawOffset + _walkDxPos + i);
int yPos = _roomObjectAreasTable[index].y1Lum;
if (wd->y <= yPos) {
- _igorTempFrames[igorBodyScanLine * 50 + i + _walkDxPos] = _screenLayer1[_walkDataDrawOffset + _walkDxPos + i];
+ _igorTempFrames[igorBodyScanLine * 50 + i + _walkDxPos] = layer1At(_walkDataDrawOffset + _walkDxPos + i);
} else {
if (_gameState.enableLight == 1 && wd->y <= _roomObjectAreasTable[index].y2Lum) {
color -= _roomObjectAreasTable[index].deltaLum;
@@ -212,7 +222,7 @@ void IgorEngine::moveIgor(int pos, int frame) {
_igorTempFrames[igorBodyScanLine * 50 + i + _walkDxPos] = color;
}
} else {
- _igorTempFrames[igorBodyScanLine * 50 + i + _walkDxPos] = _screenLayer1[_walkDataDrawOffset + _walkDxPos + i];
+ _igorTempFrames[igorBodyScanLine * 50 + i + _walkDxPos] = layer1At(_walkDataDrawOffset + _walkDxPos + i);
}
++xOffset;
}
@@ -228,10 +238,10 @@ void IgorEngine::moveIgor(int pos, int frame) {
uint8 color = _facingIgorFrames[pos - 1][offset];
if (color != 0) {
assert(_walkDataDrawOffset + i >= 0);
- int index = _screenLayer2[_walkDataDrawOffset + i];
+ int index = layer2At(_walkDataDrawOffset + i);
int yPos = _roomObjectAreasTable[index].y1Lum;
if (wd->y <= yPos) {
- _igorTempFrames[igorBodyScanLine * 50 + i] = _screenLayer1[_walkDataDrawOffset + i];
+ _igorTempFrames[igorBodyScanLine * 50 + i] = layer1At(_walkDataDrawOffset + i);
} else {
if (_gameState.enableLight == 1 && wd->y <= _roomObjectAreasTable[index].y2Lum) {
color -= _roomObjectAreasTable[index].deltaLum;
@@ -239,26 +249,29 @@ void IgorEngine::moveIgor(int pos, int frame) {
_igorTempFrames[igorBodyScanLine * 50 + i] = color;
}
} else {
- _igorTempFrames[igorBodyScanLine * 50 + i] = _screenLayer1[_walkDataDrawOffset + i];
+ _igorTempFrames[igorBodyScanLine * 50 + i] = layer1At(_walkDataDrawOffset + i);
}
++xOffset;
}
- const uint8 *src = _screenLayer1 + _walkDataDrawOffset + _walkClipWidth;
- memcpy(_igorTempFrames + igorBodyScanLine * 50 + _walkClipWidth, src, _walkDxPos);
+ copyLayer1(_igorTempFrames + igorBodyScanLine * 50 + _walkClipWidth, _walkDataDrawOffset + _walkClipWidth, _walkDxPos);
_walkDataDrawOffset += 320;
++igorBodyScanLine;
}
}
if (_walkYPosChanged == 0) {
for (int i = 1; i <= _walkDyPos; ++i) {
- memcpy(_igorTempFrames + igorBodyScanLine * 50, _screenLayer1 + _walkDataDrawOffset, igorScaledWidth);
+ copyLayer1(_igorTempFrames + igorBodyScanLine * 50, _walkDataDrawOffset, igorScaledWidth);
_walkDataDrawOffset += 320;
++igorBodyScanLine;
}
}
for (igorBodyScanLine = 0; igorBodyScanLine < igorScaledHeight; ++igorBodyScanLine) {
- assert(screenIgorDrawOffset + igorScaledWidth <= 320 * 200);
- memcpy(_screenVGA + screenIgorDrawOffset, _igorTempFrames + igorBodyScanLine * 50, igorScaledWidth);
+ // Pixels wrapping past the last room row would land in the panel area and
+ // come from unrelated memory, so never draw them.
+ if (screenIgorDrawOffset < 320 * 144) {
+ const int len = MIN<int>(igorScaledWidth, 320 * 144 - screenIgorDrawOffset);
+ memcpy(_screenVGA + screenIgorDrawOffset, _igorTempFrames + igorBodyScanLine * 50, len);
+ }
screenIgorDrawOffset += 320;
}
}
Commit: da7ab8cfc64231cb54c0691b6e57a0ecc590eb59
https://github.com/scummvm/scummvm/commit/da7ab8cfc64231cb54c0691b6e57a0ecc590eb59
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:23+01:00
Commit Message:
IGOR: Fix talking animations in room 33 and room 9
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_33.cpp
engines/igor/parts/part_9.cpp
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 6e7c69b2601..fa2416bfaee 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -580,6 +580,7 @@ private:
void PART_09_ACTION_106(bool search);
void PART_09_ACTION_110();
void PART_09_UPDATE_DIALOGUE_SECRETARY(int action);
+ void PART_09_DRAW_SECRETARY_MOUTH(int frame);
void PART_09_SECRETARY_GESTURE();
void PART_09_UPDATE_ROOM_BACKGROUND();
@@ -827,6 +828,7 @@ private:
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_HARRISON_SPEAKS();
void PART_33_HANDLE_DIALOGUE_HARRISON();
void PART_33_UPDATE_ROOM_BACKGROUND();
void PART_33_HELPER_1(int num);
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index 5eedc52202e..7fe389e0d81 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -31,42 +31,42 @@ 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);
+ ADD_DIALOGUE_TEXT(201, 1, 396);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 102:
- ADD_DIALOGUE_TEXT(202, 1);
+ ADD_DIALOGUE_TEXT(202, 1, 397);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 103:
- ADD_DIALOGUE_TEXT(203, 1);
+ ADD_DIALOGUE_TEXT(203, 1, 398);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 104:
- ADD_DIALOGUE_TEXT(204, 1);
+ ADD_DIALOGUE_TEXT(204, 1, 399);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 105:
- ADD_DIALOGUE_TEXT(205, 1);
+ ADD_DIALOGUE_TEXT(205, 1, 400);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 106:
- ADD_DIALOGUE_TEXT(206, 1);
+ ADD_DIALOGUE_TEXT(206, 1, 401);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 107:
- ADD_DIALOGUE_TEXT(207, 1);
+ ADD_DIALOGUE_TEXT(207, 1, 402);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 108:
- ADD_DIALOGUE_TEXT(208, 1);
+ ADD_DIALOGUE_TEXT(208, 1, 403);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -74,7 +74,7 @@ void IgorEngine::PART_33_EXEC_ACTION(int action) {
PART_33_ACTION_109();
break;
case 110:
- ADD_DIALOGUE_TEXT(209, 1);
+ ADD_DIALOGUE_TEXT(209, 1, 404);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -82,7 +82,7 @@ void IgorEngine::PART_33_EXEC_ACTION(int action) {
PART_33_ACTION_111();
break;
case 112:
- ADD_DIALOGUE_TEXT(213, 2);
+ ADD_DIALOGUE_TEXT(213, 2, 407);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -103,13 +103,13 @@ void IgorEngine::PART_33_EXEC_ACTION(int action) {
void IgorEngine::PART_33_ACTION_109() {
if (_objectsState[4] == 0) {
- ADD_DIALOGUE_TEXT(201, 1);
+ ADD_DIALOGUE_TEXT(201, 1, 396);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
}
if (_objectsState[74] == 1) {
- ADD_DIALOGUE_TEXT(222, 1);
+ ADD_DIALOGUE_TEXT(222, 1, 413);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
@@ -123,8 +123,8 @@ void IgorEngine::PART_33_ACTION_109() {
addObjectToInventory(31, 66);
_objectsState[74] = 1;
PART_33_HELPER_1(255);
- ADD_DIALOGUE_TEXT(210, 1);
- ADD_DIALOGUE_TEXT(211, 2);
+ ADD_DIALOGUE_TEXT(210, 1, 405);
+ ADD_DIALOGUE_TEXT(211, 2, 406);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -134,17 +134,14 @@ void IgorEngine::PART_33_ACTION_111() {
if (_objectsState[75] == 1) {
PART_33_HELPER_9();
PART_33_HELPER_1(255);
- ADD_DIALOGUE_TEXT(201, 1);
+ ADD_DIALOGUE_TEXT(201, 1, 447);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(202, 2);
- ADD_DIALOGUE_TEXT(204, 2);
+ ADD_DIALOGUE_TEXT(202, 2, 448);
+ ADD_DIALOGUE_TEXT(204, 2, 449);
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;
+ PART_33_HARRISON_SPEAKS();
loadResourceData__ROOM_Library();
PART_33_HELPER_1(255);
} else {
@@ -180,16 +177,13 @@ 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);
+ ADD_DIALOGUE_TEXT(223, 1, 414);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(224, 1);
+ ADD_DIALOGUE_TEXT(224, 1, 415);
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;
+ PART_33_HARRISON_SPEAKS();
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);
@@ -197,36 +191,27 @@ void IgorEngine::PART_33_ACTION_114() {
waitForTimer(60);
}
removeObjectFromInventory(54);
- ADD_DIALOGUE_TEXT(225, 1);
+ ADD_DIALOGUE_TEXT(225, 1, 416);
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;
+ PART_33_HARRISON_SPEAKS();
for (int i = 0; i <= 28; ++i) {
memcpy(_screenVGA + i * 320 + 26279, _animFramesBuffer + i * 63 + 0x5827, 62);
}
- ADD_DIALOGUE_TEXT(226, 1);
+ ADD_DIALOGUE_TEXT(226, 1, 417);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(227, 1);
+ ADD_DIALOGUE_TEXT(227, 1, 418);
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);
+ PART_33_HARRISON_SPEAKS();
+ ADD_DIALOGUE_TEXT(228, 1, 419);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(229, 2);
- ADD_DIALOGUE_TEXT(231, 2);
+ ADD_DIALOGUE_TEXT(229, 2, 420);
+ ADD_DIALOGUE_TEXT(231, 2, 421);
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;
+ PART_33_HARRISON_SPEAKS();
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);
@@ -235,12 +220,9 @@ void IgorEngine::PART_33_ACTION_114() {
}
addObjectToInventory(35, 70);
PART_33_HELPER_1(255);
- ADD_DIALOGUE_TEXT(233, 2);
+ ADD_DIALOGUE_TEXT(233, 2, 422);
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;
+ PART_33_HARRISON_SPEAKS();
_objectsState[75] = 1;
}
@@ -250,7 +232,7 @@ void IgorEngine::PART_33_ACTION_115() {
memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 63 + 0x5827, 62);
}
waitForTimer(60);
- ADD_DIALOGUE_TEXT(215, 2);
+ ADD_DIALOGUE_TEXT(215, 2, 408);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -265,32 +247,41 @@ void IgorEngine::PART_33_ACTION_115() {
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
- ADD_DIALOGUE_TEXT(217, 2);
+ ADD_DIALOGUE_TEXT(217, 2, 409);
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;
+ PART_33_HARRISON_SPEAKS();
for (int i = 0; i <= 28; ++i) {
memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 63 + 0x5827, 62);
}
- ADD_DIALOGUE_TEXT(219, 1);
+ ADD_DIALOGUE_TEXT(219, 1, 410);
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;
+ PART_33_HARRISON_SPEAKS();
for (int i = 0; i <= 28; ++i) {
memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 63 + 0x5827, 62);
}
_objectsState[76] = 1;
}
+// The room's idle animation of Harrison is only driven by the room loop; the
+// blocking dialogue loops never run it, otherwise it fights the talking frames.
+void IgorEngine::PART_33_HARRISON_SPEAKS() {
+ const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
+ _updateRoomBackground = 0;
+ _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2;
+ startCutsceneDialogue(47, 82, 0, 58, 40);
+ waitForEndOfCutsceneDialogue(47, 82, 0, 58, 40);
+ _updateDialogue = 0;
+ _updateRoomBackground = updateRoomBackground;
+}
+
void IgorEngine::PART_33_HANDLE_DIALOGUE_HARRISON() {
+ const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
+ _updateRoomBackground = 0;
loadDialogueData(DLG_Library);
_updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_3;
handleDialogue(47, 82, 0, 58, 40);
_updateDialogue = 0;
+ _updateRoomBackground = updateRoomBackground;
}
void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_1(int action) {
@@ -358,8 +349,8 @@ void IgorEngine::PART_33_HELPER_2() {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5255) - 1, _screenVGA, true);
memcpy(_screenLayer1, _screenVGA, 46080);
fadeIn(624);
- ADD_DIALOGUE_TEXT(220, 1);
- ADD_DIALOGUE_TEXT(221, 1);
+ ADD_DIALOGUE_TEXT(220, 1, 411);
+ ADD_DIALOGUE_TEXT(221, 1, 412);
SET_DIALOGUE_TEXT(1, 2);
_updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_1;
startCutsceneDialogue(92, 79, 0, 58, 40);
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index 04a3e1dfd78..1895e1ae06b 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -167,8 +167,23 @@ void IgorEngine::PART_09_ACTION_101_openFileCabinet() {
waitForEndOfIgorDialogue();
}
+void IgorEngine::PART_09_DRAW_SECRETARY_MOUTH(int frame) {
+ for (int y = 0; y <= 12; ++y) {
+ const uint8 *src = _animFramesBuffer + 0xD38 + frame * 0xA9 + y * 13;
+ memcpy(_screenVGA + 0x783A + y * 320, src, 13);
+ memcpy(_screenLayer1 + 0x783A + y * 320, src, 13);
+ }
+}
+
void IgorEngine::PART_09_UPDATE_DIALOGUE_SECRETARY(int action) {
- PART_09_DRAW_SECRETARY_FRAME(action == kUpdateDialogueAnimMiddleOfSentence ? getRandomNumber(1) + 2 : 1, false);
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_09_DRAW_SECRETARY_MOUTH(0);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_09_DRAW_SECRETARY_MOUTH(getRandomNumber(2));
+ break;
+ }
}
void IgorEngine::PART_09_SECRETARY_GESTURE() {
@@ -180,7 +195,7 @@ void IgorEngine::PART_09_SECRETARY_GESTURE() {
waitForTimer(31);
}
for (int step = 0; step < 32; ++step) {
- const int frame = getRandomNumber(4) + 4;
+ const int frame = getRandomNumber(3) + 4;
for (int y = 0; y <= 46; ++y)
memcpy(_screenVGA + 0x7815 + y * 320, _animFramesBuffer + 0x578 + frame * 0x9BB + y * 53, 53);
waitForTimer(16);
@@ -209,10 +224,17 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 103: // talk to secretary
- loadDialogueData(DLG_AdministrationSecretaryRoom);
- _updateDialogue = &IgorEngine::PART_09_UPDATE_DIALOGUE_SECRETARY;
- handleDialogue(63, 59, 0, 90, 65);
- _updateDialogue = 0;
+ {
+ // the blocking dialogue loops never run the room's idle animation, which
+ // would otherwise fight the secretary's talking frames
+ const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
+ _updateRoomBackground = 0;
+ loadDialogueData(DLG_AdministrationSecretaryRoom);
+ _updateDialogue = &IgorEngine::PART_09_UPDATE_DIALOGUE_SECRETARY;
+ handleDialogue(63, 59, 0, 90, 65);
+ _updateDialogue = 0;
+ _updateRoomBackground = updateRoomBackground;
+ }
PART_09_APPLY_OBJECT_STATE(255);
break;
case 104: // look at secretary
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index b37efa35bd4..3b014d3c88c 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -426,7 +426,7 @@ 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, 0, 0, 0, 0 }
+ { -46, 9, 1533, 19, 60, 120, 3571, 3589, 19 }
};
const RoomDataOffsets IgorEngine::PART_34_ROOM_DATA_OFFSETS = {
Commit: 870a3718389f51b7e31236dac85c2f1e81f5021b
https://github.com/scummvm/scummvm/commit/870a3718389f51b7e31236dac85c2f1e81f5021b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:24+01:00
Commit Message:
IGOR: Import part 15 from legacy engine
Changed paths:
A engines/igor/parts/part_15.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index fa2416bfaee..5e070e41b04 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -600,9 +600,6 @@ private:
void PART_11_ACTION_112();
void PART_11_APPLY_OBJECT_STATE(int num);
-
-
-
// outside church
void PART_12_EXEC_ACTION(int action);
void PART_12_ACTION_101();
@@ -623,6 +620,26 @@ private:
void PART_12_HELPER_10(int frame);
void PART_12();
+ // 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();
+
// outside college
void PART_17_EXEC_ACTION(int action);
void PART_17_ACTION_101_walkIn();
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 1880b0cfa7c..b1b69922754 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -28,6 +28,7 @@ MODULE_OBJS = \
parts/part_10.o \
parts/part_11.o \
parts/part_12.o \
+ parts/part_15.o \
parts/part_17.o \
parts/part_18.o \
parts/part_19.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index e0bc124db74..6eb39b79a58 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -580,6 +580,9 @@ void IgorEngine::PART_MAIN() {
case 122:
PART_12(); // outside church
break;
+ case 150:
+ PART_15();
+ break;
case 170:
case 171:
PART_17(); // College entrance
diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp
new file mode 100644
index 00000000000..fcf2016f14f
--- /dev/null
+++ b/engines/igor/parts/part_15.cpp
@@ -0,0 +1,507 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#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, 324);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 103:
+ ADD_DIALOGUE_TEXT(205, 2, 325);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 104:
+ ADD_DIALOGUE_TEXT(207, 1, 326);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 105:
+ ADD_DIALOGUE_TEXT(205, 2, 325);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 106:
+ ADD_DIALOGUE_TEXT(205, 2, 325);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 107:
+ PART_15_ACTION_107();
+ break;
+ case 108:
+ ADD_DIALOGUE_TEXT(208, 1, 327);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 109:
+ ADD_DIALOGUE_TEXT(201, 1, 322);
+ ADD_DIALOGUE_TEXT(202, 2, 323);
+ SET_DIALOGUE_TEXT(1, 2);
+ startIgorDialogue();
+ break;
+ case 110:
+ ADD_DIALOGUE_TEXT(234, 1, 345);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 111:
+ ADD_DIALOGUE_TEXT(235, 1, 346);
+ ADD_DIALOGUE_TEXT(236, 1, 347);
+ SET_DIALOGUE_TEXT(1, 2);
+ startIgorDialogue();
+ break;
+ case 112:
+ ADD_DIALOGUE_TEXT(237, 2, 348);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 113:
+ ADD_DIALOGUE_TEXT(239, 1, 349);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 114:
+ ADD_DIALOGUE_TEXT(240, 1, 350);
+ 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, 328);
+ ADD_DIALOGUE_TEXT(210, 1, 329);
+ SET_DIALOGUE_TEXT(1, 2);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ ADD_DIALOGUE_TEXT(212, 1, 331);
+ 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, 332);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ ADD_DIALOGUE_TEXT(214, 1, 333);
+ 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, 334);
+ ADD_DIALOGUE_TEXT(217, 1, 335);
+ } else {
+ ADD_DIALOGUE_TEXT(218, 2, 336);
+ ADD_DIALOGUE_TEXT(220, 1, 337);
+ }
+ 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, 338);
+ 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, 341);
+ 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, 342);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ ADD_DIALOGUE_TEXT(229, 1, 343);
+ 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, 344);
+ 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, 328);
+ ADD_DIALOGUE_TEXT(211, 1, 330);
+ SET_DIALOGUE_TEXT(1, 2);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ ADD_DIALOGUE_TEXT(212, 1, 331);
+ 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, 332);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ ADD_DIALOGUE_TEXT(214, 1, 333);
+ 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, 334);
+ ADD_DIALOGUE_TEXT(217, 1, 335);
+ } else {
+ ADD_DIALOGUE_TEXT(218, 2, 336);
+ ADD_DIALOGUE_TEXT(223, 1, 339);
+ }
+ 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, 340);
+ 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, 341);
+ 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, 342);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ ADD_DIALOGUE_TEXT(229, 1, 343);
+ 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, 344);
+ 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(199) == 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(4));
+ 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(9) == 0) {
+ _gameState.unk10 = 2;
+ } else {
+ _gameState.unk10 = 1;
+ }
+ if (getRandomNumber(29) == 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;
+ fadeIn(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;
+ }
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 3b014d3c88c..e713f41213d 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -311,7 +311,7 @@ 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, 0, 0, 0, 0 }
+ { 45, 22, 3756, 66, 60, 180, 10588, 10632, 66 }
};
const RoomDataOffsets IgorEngine::PART_16_ROOM_DATA_OFFSETS = {
Commit: 2a2bf1925d8c8c8f2186f40b0fe71c42fcea638c
https://github.com/scummvm/scummvm/commit/2a2bf1925d8c8c8f2186f40b0fe71c42fcea638c
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:24+01:00
Commit Message:
IGOR: Adds parts 13, 14, 16, and Margaret cutscenes from legacy engine
Changed paths:
A engines/igor/parts/part_13.cpp
A engines/igor/parts/part_14.cpp
A engines/igor/parts/part_16.cpp
A engines/igor/parts/part_margaret.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/sound.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 96266d8dd53..2b83a2c0700 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -673,7 +673,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
s.syncAsByte(_gameState.dialogueChoiceStart);
s.syncAsByte(_gameState.dialogueChoiceCount);
s.skip(2);
- s.syncAsByte(_gameState.nextMusicCounter);
+ s.syncAsByte(_gameState.shouldShowCutsceneCounter);
{
byte v = _gameState.jumpToNextMusic ? 1 : 0;
s.syncAsByte(v);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 5e070e41b04..c7568356d9a 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -159,7 +159,7 @@ struct GameStateData {
uint8 dialogueChoiceStart;
uint8 dialogueChoiceCount;
// byte[2]
- uint8 nextMusicCounter;
+ uint8 shouldShowCutsceneCounter;
bool jumpToNextMusic;
uint8 configSoundEnabled;
uint8 talkSpeed;
@@ -468,6 +468,13 @@ private:
void UPDATE_OBJECT_STATE(int num);
void PART_UPDATE_FIGURES_ON_PAPER(int delay);
+ 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 animateIgorTalking(int frame);
void fixIgorDialogueTextPosition(int num, int count, int *x, int *y);
void startIgorDialogue();
@@ -620,6 +627,37 @@ private:
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();
@@ -640,6 +678,20 @@ private:
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_walkIn();
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index b1b69922754..2f768d4b56d 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -28,7 +28,10 @@ MODULE_OBJS = \
parts/part_10.o \
parts/part_11.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 \
@@ -46,6 +49,7 @@ MODULE_OBJS = \
parts/part_35.o \
parts/part_36.o \
parts/part_37.o \
+ parts/part_margaret.o \
text.o \
part_main.o \
sound.o
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 6eb39b79a58..9dd9ad4c960 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -580,9 +580,21 @@ void IgorEngine::PART_MAIN() {
case 122:
PART_12(); // outside church
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(); // College entrance
@@ -685,6 +697,39 @@ void IgorEngine::PART_MAIN() {
error("PART_MAIN() Unhandled part %d", _currentPart);
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;
+ }
+ // skip if we havent given the note to margaret yet
+ if (_objectsState[110] < 1 || _objectsState[110] > 7) {
+ continue;
+ }
+ debugC(9, kDebugEngine, "Checking meanwhile with part: %d, should show cutscene counter %d", _currentPart, _gameState.shouldShowCutsceneCounter);
+ if (_gameState.shouldShowCutsceneCounter != 5) {
+ ++_gameState.shouldShowCutsceneCounter;
+ } else {
+ if (_gameState.musicNum != 11) {
+ // _previousMusic = _gameState.musicNum;
+ playMusic(11);
+ }
+ PART_MEANWHILE();
+ PART_MARGARET_ROOM_CUTSCENE();
+ // if (_previousMusic != 11) {
+ // playMusic(_previousMusic);
+ // }
+ _gameState.shouldShowCutsceneCounter = 0;
+ }
} while (_currentPart != kInvalidPart && !_eventQuitGame);
}
@@ -716,4 +761,23 @@ void IgorEngine::PART_UPDATE_FIGURES_ON_PAPER(int delay) {
free(framesOffsets);
}
+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;
+ fadeIn(9);
+ for (int i = 0; i <= 5 && !_inputVars[kInputEscape]; ++i) {
+ waitForTimer(250);
+ }
+ _inputVars[kInputEscape] = 0;
+ fadeOut(9);
+}
+
} // End of namespace Igor
diff --git a/engines/igor/parts/part_13.cpp b/engines/igor/parts/part_13.cpp
new file mode 100644
index 00000000000..4c195118014
--- /dev/null
+++ b/engines/igor/parts/part_13.cpp
@@ -0,0 +1,231 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#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;
+ fadeIn(768);
+ if (_currentPart == 130) {
+ PART_13_HELPER_3();
+ } else {
+ PART_13_HELPER_2();
+ }
+ enterPartLoop();
+ while (_currentPart >= 130 && _currentPart <= 131) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
new file mode 100644
index 00000000000..157e0d1c046
--- /dev/null
+++ b/engines/igor/parts/part_14.cpp
@@ -0,0 +1,600 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#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() {
+ fadeOut(768);
+ PART_14_HELPER_9();
+ loadResourceData__ROOM_ChurchPuzzle();
+ memset(_screenVGA + 46080, 0, 17920);
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[72], 0);
+ fadeIn(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(1) + 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(1) + 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);
+ fadeIn(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);
+ }
+ fadeOut(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;
+ fadeIn(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();
+ fadeOut(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);
+}
+
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
new file mode 100644
index 00000000000..fb02737c11e
--- /dev/null
+++ b/engines/igor/parts/part_16.cpp
@@ -0,0 +1,291 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#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(4) + 30 : getRandomNumber(4) + 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(3) + 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);
+ }
+ fadeOut(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);
+ fadeIn(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(3) + 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;
+ fadeIn(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();
+ fadeOut(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);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_margaret.cpp b/engines/igor/parts/part_margaret.cpp
new file mode 100644
index 00000000000..7ee975b7c00
--- /dev/null
+++ b/engines/igor/parts/part_margaret.cpp
@@ -0,0 +1,126 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+
+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);
+ fadeIn(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);
+ fadeOut(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);
+ }
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 74948a838d8..accf836a0c8 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -38,8 +38,9 @@ void IgorEngine::playMusic(int num) {
// play only if the requested track is not already playing
if(_gameState.musicNum != num) {
_gameState.musicNum = num;
- // g_system->getAudioCDManager()->stop();
- // g_system->getAudioCDManager()->play(num, -1, 0, 0);
+ _gameState.musicSequenceIndex = 1;
+ g_system->getAudioCDManager()->stop();
+ g_system->getAudioCDManager()->play(num, -1, 0, 0);
}
}
}
Commit: 4fc8c4c1f92458fc2a4fcd208875d809c071a6ca
https://github.com/scummvm/scummvm/commit/4fc8c4c1f92458fc2a4fcd208875d809c071a6ca
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:24+01:00
Commit Message:
IGOR: Adds speech indices for rooms 13, 14, 16
Changed paths:
engines/igor/parts/part_13.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_16.cpp
diff --git a/engines/igor/parts/part_13.cpp b/engines/igor/parts/part_13.cpp
index 4c195118014..9ada89e1ce0 100644
--- a/engines/igor/parts/part_13.cpp
+++ b/engines/igor/parts/part_13.cpp
@@ -31,7 +31,7 @@ void IgorEngine::PART_13_EXEC_ACTION(int action) {
PART_13_ACTION_101_103();
break;
case 102:
- ADD_DIALOGUE_TEXT(201, 2);
+ ADD_DIALOGUE_TEXT(201, 2, 858);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -73,7 +73,7 @@ void IgorEngine::PART_13_ACTION_101_103() {
waitForTimer(30);
}
_walkDataLastIndex = 1;
- ADD_DIALOGUE_TEXT(203, 1);
+ ADD_DIALOGUE_TEXT(203, 1, 859);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 157e0d1c046..4418237b59a 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -36,7 +36,7 @@ void IgorEngine::PART_14_EXEC_ACTION(int action) {
PART_14_ACTION_101();
break;
case 102:
- ADD_DIALOGUE_TEXT(201, 1);
+ ADD_DIALOGUE_TEXT(201, 1, 860);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -44,7 +44,7 @@ void IgorEngine::PART_14_EXEC_ACTION(int action) {
PART_14_ACTION_103();
break;
case 104:
- ADD_DIALOGUE_TEXT(202, 1);
+ ADD_DIALOGUE_TEXT(202, 1, 861);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -55,7 +55,7 @@ void IgorEngine::PART_14_EXEC_ACTION(int action) {
PART_14_ACTION_106();
break;
case 107:
- ADD_DIALOGUE_TEXT(203, 1);
+ ADD_DIALOGUE_TEXT(203, 1, 862);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -177,7 +177,7 @@ void IgorEngine::PART_14_ACTION_106() {
void IgorEngine::PART_14_ACTION_108() {
_gameState.unkF = false;
_updateRoomBackground = &IgorEngine::PART_14_UPDATE_ROOM_BACKGROUND_ACTION_108;
- ADD_DIALOGUE_TEXT(226, 1);
+ ADD_DIALOGUE_TEXT(226, 1, 880);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -191,7 +191,7 @@ void IgorEngine::PART_14_ACTION_108() {
playSound(33, 1);
PART_14_HELPER_8(4, 24);
stopSound();
- ADD_DIALOGUE_TEXT(205, 1);
+ ADD_DIALOGUE_TEXT(205, 1, 864);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(221, 85, 12, 33, 63);
waitForEndOfCutsceneDialogue(221, 85, 12, 33, 63);
@@ -201,22 +201,22 @@ void IgorEngine::PART_14_ACTION_108() {
wd->x = 250;
wd->y = 138;
wd->posNum = 4;
- ADD_DIALOGUE_TEXT(206, 1);
- ADD_DIALOGUE_TEXT(207, 1);
+ ADD_DIALOGUE_TEXT(206, 1, 865);
+ ADD_DIALOGUE_TEXT(207, 1, 866);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(208, 2);
+ ADD_DIALOGUE_TEXT(208, 2, 867);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(221, 85, 12, 33, 63);
waitForEndOfCutsceneDialogue(221, 85, 12, 33, 63);
- ADD_DIALOGUE_TEXT(210, 1);
+ ADD_DIALOGUE_TEXT(210, 1, 868);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(211, 2);
- ADD_DIALOGUE_TEXT(213, 3);
- ADD_DIALOGUE_TEXT(216, 1);
+ ADD_DIALOGUE_TEXT(211, 2, 869);
+ ADD_DIALOGUE_TEXT(213, 3, 870);
+ ADD_DIALOGUE_TEXT(216, 1, 871);
SET_DIALOGUE_TEXT(1, 3);
startCutsceneDialogue(221, 85, 12, 33, 63);
waitForEndOfCutsceneDialogue(221, 85, 12, 33, 63);
@@ -226,13 +226,13 @@ void IgorEngine::PART_14_ACTION_108() {
waitForTimer(60);
}
addObjectToInventory(28, 63);
- ADD_DIALOGUE_TEXT(217, 1);
- ADD_DIALOGUE_TEXT(218, 1);
- ADD_DIALOGUE_TEXT(219, 1);
+ ADD_DIALOGUE_TEXT(217, 1, 872);
+ ADD_DIALOGUE_TEXT(218, 1, 873);
+ ADD_DIALOGUE_TEXT(219, 1, 874);
SET_DIALOGUE_TEXT(1, 3);
startIgorDialogue();
waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(220, 2);
+ ADD_DIALOGUE_TEXT(220, 2, 875);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(221, 85, 12, 33, 63);
waitForEndOfCutsceneDialogue(221, 85, 12, 33, 63);
@@ -242,10 +242,10 @@ void IgorEngine::PART_14_ACTION_108() {
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);
+ ADD_DIALOGUE_TEXT(222, 1, 876);
+ ADD_DIALOGUE_TEXT(223, 1, 877);
+ ADD_DIALOGUE_TEXT(224, 1, 878);
+ ADD_DIALOGUE_TEXT(225, 1, 879);
SET_DIALOGUE_TEXT(1, 4);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -509,7 +509,7 @@ void IgorEngine::PART_14_HELPER_9() {
} else {
_currentPart = 145;
_gameState.counter[4] = 0;
- ADD_DIALOGUE_TEXT(204, 1);
+ ADD_DIALOGUE_TEXT(204, 1, 863);
SET_DIALOGUE_TEXT(1, 1);
playSound(35, 1);
waitForTimer(255);
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index fb02737c11e..3e6b9a17001 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -33,7 +33,7 @@ void IgorEngine::PART_16_EXEC_ACTION(int action) {
PART_16_ACTION_101();
break;
case 102:
- ADD_DIALOGUE_TEXT(208, 2);
+ ADD_DIALOGUE_TEXT(208, 2, 730);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
@@ -48,13 +48,13 @@ void IgorEngine::PART_16_EXEC_ACTION(int action) {
void IgorEngine::PART_16_ACTION_101() {
if (_objectsState[52] == 1) {
- ADD_DIALOGUE_TEXT(207, 1);
+ ADD_DIALOGUE_TEXT(207, 1, 729);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
}
- ADD_DIALOGUE_TEXT(201, 1);
- ADD_DIALOGUE_TEXT(202, 2);
+ ADD_DIALOGUE_TEXT(201, 1, 726);
+ ADD_DIALOGUE_TEXT(202, 2, 727);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -71,7 +71,7 @@ void IgorEngine::PART_16_ACTION_101() {
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
- ADD_DIALOGUE_TEXT(204, 3);
+ ADD_DIALOGUE_TEXT(204, 3, 728);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
@@ -122,10 +122,10 @@ void IgorEngine::PART_16_HELPER_2() {
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);
+ ADD_DIALOGUE_TEXT(210, 1, 731);
+ ADD_DIALOGUE_TEXT(211, 1, 732);
+ ADD_DIALOGUE_TEXT(212, 1, 733);
+ ADD_DIALOGUE_TEXT(213, 2, 734);
SET_DIALOGUE_TEXT(1, 4);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -173,9 +173,9 @@ void IgorEngine::PART_16_HELPER_3() {
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);
+ ADD_DIALOGUE_TEXT(215, 1, 735);
+ ADD_DIALOGUE_TEXT(216, 1, 736);
+ ADD_DIALOGUE_TEXT(217, 1, 737);
SET_DIALOGUE_TEXT(1, 3);
startCutsceneDialogue(175, 78, 0, 58, 40);
VAR_CURRENT_TALKING_ACTOR = 0;
@@ -186,7 +186,7 @@ void IgorEngine::PART_16_HELPER_3() {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true);
waitForTimer(35);
}
- ADD_DIALOGUE_TEXT(218, 2);
+ ADD_DIALOGUE_TEXT(218, 2, 738);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(88, 69, 63, 32, 0);
_updateDialogue = &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET;
@@ -196,15 +196,15 @@ void IgorEngine::PART_16_HELPER_3() {
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);
+ ADD_DIALOGUE_TEXT(220, 1, 739);
+ ADD_DIALOGUE_TEXT(221, 1, 740);
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);
+ ADD_DIALOGUE_TEXT(222, 2, 741);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(88, 69, 63, 32, 0);
_updateDialogue = &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET;
Commit: d811513c8d5c38d9c6ff2d0aee16fd0e48d83a53
https://github.com/scummvm/scummvm/commit/d811513c8d5c38d9c6ff2d0aee16fd0e48d83a53
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:25+01:00
Commit Message:
IGOR: Import part 22 from legacy code
Changed paths:
A engines/igor/parts/part_22.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_14.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index c7568356d9a..4078df65740 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -765,6 +765,16 @@ private:
void PART_21_HELPER_11(int frame);
void PART_21();
+ // church bell tower
+ void PART_22_EXEC_ACTION(int action);
+ void PART_22_ACTION_101();
+ void PART_22_ACTION_102();
+ void PART_22_APPLY_OBJECT_STATE(int num);
+ void PART_22_IGOR_STEP(int facing, int step);
+ void PART_22_SCROLL_STEP(int step);
+ void PART_22_ENTER();
+ void PART_22();
+
// college corridor lucas
void PART_23_EXEC_ACTION(int action);
void PART_23_ACTION_105_enterLadiesRoom();
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 2f768d4b56d..6a7cc9338c3 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -36,6 +36,7 @@ MODULE_OBJS = \
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 \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 9dd9ad4c960..69b3b5e4d09 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -612,6 +612,10 @@ void IgorEngine::PART_MAIN() {
case 212:
PART_21(); //college corridor margaret
break;
+ case 220:
+ case 221:
+ PART_22(); // church bell tower
+ break;
case 230:
case 231:
case 232:
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 4418237b59a..058ee140edd 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -293,11 +293,11 @@ void IgorEngine::PART_14_HELPER_2() {
wd->dxPos = 0;
wd->yPosChanged = 1;
wd->dyPos = 3;
- wd->scaleHeight = 32;
+ wd->scaleHeight = 50;
moveIgor(wd->posNum, wd->frameNum);
waitForTimer(15);
}
- _walkDataLastIndex = 1;
+ _walkDataLastIndex = 0;
_walkDataCurrentIndex = 1;
buildWalkPath(182, 143, 162, 138);
_walkData[_walkDataLastIndex].frameNum = 0;
diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp
new file mode 100644
index 00000000000..b9a491e6fb7
--- /dev/null
+++ b/engines/igor/parts/part_22.cpp
@@ -0,0 +1,194 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// FRM_BellChurch1 is a full 128 rows picture (the scene Igor comes from / goes back to) followed
+// by FRM_BellChurch2, the two 35x30 frames of the pick up animation.
+static const int kPart22PictureRows = 128;
+static const int kPart22PickUpFrames = 40960;
+static const int kPart22PickUpFrameSize = 35 * 30;
+
+static const uint8 PART_22_PICK_UP_FRAMES[3] = { 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;
+ }
+}
+
+/**
+ * Takes the object (inventory object 29) from the bell tower.
+ */
+void IgorEngine::PART_22_ACTION_101() {
+ if (_objectsState[78] == 1 && _inventoryInfo[64] == 0) {
+ ADD_DIALOGUE_TEXT(203, 2, 855);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue();
+ for (int i = 0; i < 3; ++i) {
+ // each frame is drawn as is, over Igor too
+ const uint8 *frame = _animFramesBuffer + kPart22PickUpFrames +
+ (PART_22_PICK_UP_FRAMES[i] - 1) * kPart22PickUpFrameSize;
+ for (int y = 0; y <= 29; ++y) {
+ memcpy(_screenVGA + y * 320 + 24141, frame + y * 35, 35);
+ }
+ waitForTimer(60);
+ }
+ addObjectToInventory(29, 64);
+ PART_22_APPLY_OBJECT_STATE(255);
+ ADD_DIALOGUE_TEXT(205, 1, 856);
+ ADD_DIALOGUE_TEXT(206, 1, 857);
+ SET_DIALOGUE_TEXT(1, 2);
+ startIgorDialogue();
+ _objectsState[105] = 1;
+ } else {
+ ADD_DIALOGUE_TEXT(201, 2, 854);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ }
+}
+
+/**
+ * Igor leaves the tower: he walks away from the viewer, shrinking, and the picture scrolls up to
+ * the church.
+ */
+void IgorEngine::PART_22_ACTION_102() {
+ _walkDataCurrentIndex = 0;
+ _walkCurrentFrame = 1;
+ for (int i = 9; i >= 0; --i) {
+ PART_22_IGOR_STEP(kFacingPositionBack, i);
+ waitForTimer(15);
+ }
+ for (int i = 16; i >= 0;) {
+ if (compareGameTick(1, 16)) {
+ PART_22_SCROLL_STEP(i);
+ --i;
+ }
+ waitForTimer();
+ }
+ _currentPart = 141;
+}
+
+/**
+ * Nothing to redraw for this room: the object state has no visual effect.
+ */
+void IgorEngine::PART_22_APPLY_OBJECT_STATE(int num) {
+}
+
+/**
+ * One step of Igor walking in place, scaled by the number of steps left to the ground.
+ */
+void IgorEngine::PART_22_IGOR_STEP(int facing, int step) {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(138, 123, facing, _walkCurrentFrame);
+ WalkData::setNextFrame(facing, _walkCurrentFrame);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 30;
+ wd->scaleWidth = 23 + step * 3;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 3;
+ wd->scaleHeight = 50;
+ moveIgor(wd->posNum, wd->frameNum);
+}
+
+/**
+ * Shows the bottom (step * 8 + 16) rows of the room picture on top of the top
+ * (128 - step * 8) rows of the neighbouring picture.
+ */
+void IgorEngine::PART_22_SCROLL_STEP(int step) {
+ const int roomRows = step * 8 + 16;
+ const int pictureRows = kPart22PictureRows - step * 8;
+ memcpy(_screenTextLayer, _screenLayer1 + pictureRows * 320, roomRows * 320);
+ memcpy(_screenTextLayer + roomRows * 320, _animFramesBuffer, pictureRows * 320);
+ memcpy(_screenVGA, _screenTextLayer, 46080);
+}
+
+/**
+ * The first screen shows the neighbouring picture; the room scrolls in from the top and Igor
+ * walks into it.
+ */
+void IgorEngine::PART_22_ENTER() {
+ memcpy(_screenVGA, _screenLayer1 + kPart22PictureRows * 320, 16 * 320);
+ memcpy(_screenVGA + 16 * 320, _animFramesBuffer, kPart22PictureRows * 320);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+
+ for (int i = 0; i <= 16;) {
+ if (compareGameTick(1, 16)) {
+ PART_22_SCROLL_STEP(i);
+ ++i;
+ }
+ waitForTimer();
+ }
+
+ _walkDataCurrentIndex = 0;
+ _walkCurrentFrame = 1;
+ for (int i = 0; i <= 9; ++i) {
+ if (i == 9) {
+ _walkCurrentFrame = 0;
+ }
+ PART_22_IGOR_STEP(kFacingPositionFront, i);
+ 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);
+ SET_PAL_240_48_1();
+ 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_APPLY_OBJECT_STATE(255);
+ if (!restoreRoomAfterLoad()) {
+ PART_22_ENTER();
+ }
+ enterPartLoop();
+ while (_currentPart == 220 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
Commit: a86926da417cf980a3f7665d7ab1eeb089a066b4
https://github.com/scummvm/scummvm/commit/a86926da417cf980a3f7665d7ab1eeb089a066b4
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:25+01:00
Commit Message:
IGOR: Implements looking at papyrus
Changed paths:
engines/igor/igor.h
engines/igor/part_main.cpp
engines/igor/parts/part_19.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 4078df65740..2a0f83d375c 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -478,7 +478,7 @@ private:
void animateIgorTalking(int frame);
void fixIgorDialogueTextPosition(int num, int count, int *x, int *y);
void startIgorDialogue();
- void waitForEndOfIgorDialogue();
+ void waitForEndOfIgorDialogue(bool animateHead = true);
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);
@@ -488,6 +488,7 @@ private:
void PART_MAIN();
void moveScreenUp(int offset);
+ void lookAtPapyrus(bool reveal);
void EXEC_MAIN_ACTION(int action);
// map
@@ -734,7 +735,6 @@ private:
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();
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 69b3b5e4d09..ba3136aa8a1 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -309,7 +309,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
startIgorDialogue();
break;
case 54:
- // EXEC_MAIN_ACTION_54();
+ lookAtPapyrus(false);
break;
case 55:
ADD_DIALOGUE_TEXT(159, 1, 83);
@@ -753,6 +753,61 @@ void IgorEngine::moveScreenUp(int offset) {
}
}
+// Shows the papyrus full screen. With reveal set (dryer) the figures appear
+// slowly and are remembered as seen; otherwise Igor comments on what is shown.
+void IgorEngine::lookAtPapyrus(bool reveal) {
+ memcpy(_paletteBuffer, _currentPalette, 624);
+ fadeOut(624);
+ // reserve for entire screen + palette, to save current screen
+ uint8 *tmp = (uint8 *)malloc(64000 + 768);
+ if (tmp) {
+ memcpy(tmp, _screenVGA, 64000);
+ memcpy(tmp + 64000, _paletteBuffer, 768);
+ }
+ // load image and palette
+ loadData(IMG_RomanNumbersPaper, _screenVGA);
+ loadData(PAL_RomanNumbersPaper, _paletteBuffer);
+ if (reveal) {
+ fadeIn(624);
+ PART_UPDATE_FIGURES_ON_PAPER(60);
+ _objectsState[2] = 1;
+ waitForTimer(255);
+ } else {
+ // the figures are only shown from the second viewing on
+ if (_objectsState[2] == 1) {
+ PART_UPDATE_FIGURES_ON_PAPER(0);
+ }
+ fadeIn(624);
+ WalkData *wd = &_walkData[_walkDataLastIndex - 1];
+ int _walkDataCurrentPosX2 = wd->x;
+ int _walkDataCurrentPosY2 = wd->y;
+ 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(false);
+ wd->x = _walkDataCurrentPosX2;
+ wd->y = _walkDataCurrentPosY2;
+ wd->scaleWidth = _walkDataCurrentWScale;
+ }
+ fadeOut(624);
+
+ // restore previous screen and palette
+ if (tmp) {
+ memcpy(_screenVGA, tmp, 64000);
+ memcpy(_paletteBuffer, tmp + 64000, 768);
+ free(tmp);
+ }
+ fadeIn(624);
+}
+
+// loads and displays the figures on the paper
void IgorEngine::PART_UPDATE_FIGURES_ON_PAPER(int delay) {
uint8 *framesData = loadData(FRM_NumbersPaper1);
uint8 *framesOffsets = loadData(FRM_NumbersPaper2);
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index e1b41189c40..86559e2ea6e 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -112,7 +112,7 @@ void IgorEngine::PART_19_ACTION_109() { // sub_137_0421
}
decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x35E) - 1, _screenVGA, true);
playSound(45, 1);
- PART_19_HELPER_5();
+ lookAtPapyrus(true);
PART_19_HELPER_1(255);
stopSound();
decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x360) - 1, _screenVGA, true);
@@ -260,26 +260,6 @@ void IgorEngine::PART_19_HELPER_4() { // sub_137_0D7B
_currentPart = 232;
}
-void IgorEngine::PART_19_HELPER_5() {
- fadeOut(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);
- fadeIn(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);
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index a9b000762f0..5b5ba957410 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -358,7 +358,7 @@ void IgorEngine::startIgorDialogue() {
_inputVars[kInputSkipDialogue] = 0;
}
-void IgorEngine::waitForEndOfIgorDialogue() {
+void IgorEngine::waitForEndOfIgorDialogue(bool animateHead) {
do {
if (_gameState.dialogueTextRunning && _inputVars[kInputSkipDialogue]) {
stopDialogueSpeech();
@@ -373,7 +373,9 @@ void IgorEngine::waitForEndOfIgorDialogue() {
if (compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
if (_talkSpeechCounter > 2) {
if (_talkDelay == _talkDelayCounter) {
- animateIgorTalking(0);
+ if (animateHead) {
+ animateIgorTalking(0);
+ }
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
if (_dialogueTextsCount == 0) {
stopDialogueSpeech();
@@ -392,7 +394,9 @@ void IgorEngine::waitForEndOfIgorDialogue() {
}
}
} else {
- animateIgorTalking(getRandomNumber(5));
+ if (animateHead) {
+ animateIgorTalking(getRandomNumber(5));
+ }
++_talkDelayCounter;
}
} else {
Commit: b894b426e663f6c7c1eb23201e40ce0bc64923da
https://github.com/scummvm/scummvm/commit/b894b426e663f6c7c1eb23201e40ce0bc64923da
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:25+01:00
Commit Message:
IGOR: Fix cutscene with slug
Changed paths:
engines/igor/igor.h
engines/igor/palette.cpp
engines/igor/part_main.cpp
engines/igor/parts/part_19.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 2a0f83d375c..21b32d1ec1a 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -732,7 +732,7 @@ private:
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_2_slugCutscene();
void PART_19_HELPER_3();
void PART_19_HELPER_4();
void PART_19_HELPER_7(int frame);
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index 22594988f56..7fceab8a211 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -101,7 +101,8 @@ void IgorEngine::fadeIn(int count) {
void IgorEngine::fadeOut(int count) {
debugC(9, kDebugScreen, "fadeOutPalette(%d)", count);
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
- memcpy(_paletteBuffer, _currentPalette, 768);
+ // only the faded range is saved; the rest of the buffer is left untouched
+ memcpy(_paletteBuffer, _currentPalette, count);
int m = 0;
do {
for (int i = 0; i < count; ++i) {
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index ba3136aa8a1..584b5b6a722 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -781,6 +781,7 @@ void IgorEngine::lookAtPapyrus(bool reveal) {
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;
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index 86559e2ea6e..3e701945678 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -149,7 +149,7 @@ void IgorEngine::PART_19_HELPER_1(int num) {
}
}
-void IgorEngine::PART_19_HELPER_2() { // sub_137_07AD
+void IgorEngine::PART_19_HELPER_2_slugCutscene() { // sub_137_07AD
int talkSpeed = _gameState.talkSpeed;
_gameState.talkSpeed = 5;
memcpy(_screenLayer2, _screenVGA, 46080);
@@ -180,6 +180,7 @@ void IgorEngine::PART_19_HELPER_2() { // sub_137_07AD
_updateRoomBackground = 0;
while (_gameState.counter[1] != 35) {
PART_19_UPDATE_BACKGROUND_HELPER_9();
+ waitForTimer();
}
for (int i = 47; i <= 48; ++i) {
src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x404F + i * 2) - 1;
@@ -274,17 +275,16 @@ void IgorEngine::PART_19() {
_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);
+ // cutscene only: it fades out by itself and returns to the caller
+ PART_19_HELPER_2_slugCutscene();
+ return;
}
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_19_EXEC_ACTION);
+ PART_19_HELPER_1(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- if(_currentPart != 191) {
- PART_19_HELPER_3();
- }
+ PART_19_HELPER_3();
if (_objectsState[59] == 0) {
PART_19_HELPER_4();
} else {
@@ -294,7 +294,9 @@ void IgorEngine::PART_19() {
}
leavePartLoop();
}
- fadeOut(624);
+ if(_currentPart != 191) {
+ fadeOut(624);
+ }
}
} // namespace Igor
Commit: 14094684f5d8309861bc26dcf71ae342b57f6b02
https://github.com/scummvm/scummvm/commit/14094684f5d8309861bc26dcf71ae342b57f6b02
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:26+01:00
Commit Message:
IGOR: Part 67
Changed paths:
A engines/igor/parts/part_67.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_17.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 2b83a2c0700..9485c716d6c 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -120,6 +120,7 @@ void IgorEngine::restart() {
_gameStateLoaded = false;
memset(&_gameState, 0, sizeof(_gameState));
+ _mazeLocation = 0;
_nextTimer = 0;
_fastMode = 1;
_language = 0;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 21b32d1ec1a..6f987193b5c 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -351,6 +351,7 @@ private:
bool _eventQuitGame;
bool _gameStateLoaded;
GameStateData _gameState;
+ uint8 _mazeLocation;
uint32 _nextTimer;
// Speed multiplier, 1 = original timing. Divides the millisecond
@@ -967,6 +968,18 @@ private:
void PART_37_HELPER_2();
void PART_37();
+ // maze entrance
+ void PART_67_EXEC_ACTION(int action);
+ void PART_67_ACTION_101_goToChurch();
+ void PART_67_ACTION_102_goRight();
+ void PART_67_DRAW_FLAME(int frame);
+ void PART_67_FLICKER();
+ void PART_67_UPDATE_FLICKER();
+ void PART_67_ENTER_FROM_CHURCH_PUZZLE();
+ void PART_67_ENTER_FROM_RIGHT();
+ void PART_67_UPDATE_ROOM_BACKGROUND();
+ void PART_67();
+
void PART_85();
void PART_85_HELPER_1_PLAY_ANIM(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
void PART_85_HELPER_2_SCROLL_RIGHT();
@@ -1028,7 +1041,9 @@ private:
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();
+ typedef void (IgorEngine::*IgorMoveTick)();
+ // tick: room effect that runs on every iteration while Igor walks (rooms with their own wait loop)
+ void waitForIgorMove(IgorMoveTick tick = 0);
void moveIgor(int pos, int frame);
@@ -1196,6 +1211,7 @@ protected:
static const RoomDataOffsets PART_35_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_36_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_37_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_67_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
static const uint8 _inventoryOffsetTable[];
static const uint8 _inventoryActionsTable[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 6a7cc9338c3..04f815f11ef 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -50,6 +50,7 @@ MODULE_OBJS = \
parts/part_35.o \
parts/part_36.o \
parts/part_37.o \
+ parts/part_67.o \
parts/part_margaret.o \
text.o \
part_main.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 584b5b6a722..7b5dacd428a 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -672,6 +672,10 @@ void IgorEngine::PART_MAIN() {
case 370:
PART_37();
break;
+ case 670:
+ case 671:
+ PART_67(); // maze entrance
+ break;
case 850: // Intro cutscene
// Clear the entire screen buffer before starting the intro cutscene
memset(_screenVGA, 0, 64000);
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 60f069edcc3..8b444a600b8 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -62,14 +62,14 @@ void IgorEngine::PART_17_ACTION_101_walkIn() {
buildWalkPath(243, 77, 243, 74);
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove();
+ waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
// Added this line compared to the 2009 version to correct the walk path origin.
--_walkDataLastIndex;
buildWalkPath(243, 74, 274, 68);
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove();
+ waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
_currentPart = 302;
}
@@ -131,7 +131,7 @@ void IgorEngine::PART_17_ACTION_103_talkPhilipJimmy() {
_walkDataCurrentIndex = 1;
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
- waitForIgorMove();
+ waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
ADD_DIALOGUE_TEXT(219, 1, 645);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -157,7 +157,7 @@ void IgorEngine::PART_17_ACTION_105() {
_walkDataCurrentIndex = 1;
_walkData[_walkDataLastIndex].frameNum = 1;
_gameState.igorMoving = true;
- waitForIgorMove();
+ waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
PART_17_HELPER_5_changeZindexOfPath(143);
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[44836]].area = 4;
@@ -168,7 +168,7 @@ void IgorEngine::PART_17_ACTION_105() {
for (int i = _walkDataCurrentIndex; i <= _walkDataLastIndex; ++i) {
_walkData[i].posNum = kFacingPositionBack;
}
- waitForIgorMove();
+ waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
for (int i = 17; i <= 85; ++i) {
_walkYScaleRoom[i] = ((i - 13) / 4) + 5;
}
@@ -187,7 +187,7 @@ void IgorEngine::PART_17_ACTION_105() {
_roomObjectAreasTable[_screenLayer2[36865]].area = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove();
+ waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
_currentPart = 40;
}
@@ -237,7 +237,7 @@ void IgorEngine::PART_17_ACTION_106_swapFolders() {
_walkDataCurrentIndex = 1;
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
- waitForIgorMove();
+ waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
// Creo q no ha notado nada
ADD_DIALOGUE_TEXT(223, 2, 647); // cseg141:0B75-0B81
SET_DIALOGUE_TEXT(1, 1);
@@ -352,7 +352,7 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap() {
_roomObjectAreasTable[_screenLayer2[36865]].area = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove();
+ waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
for (int i = 17; i <= 135; ++i) {
_walkYScaleRoom[i] = 50;
}
@@ -370,7 +370,7 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap() {
for (int i = _walkDataCurrentIndex; i <= _walkDataLastIndex; ++i) {
_walkData[i].posNum = kFacingPositionFront;
}
- waitForIgorMove();
+ waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
PART_17_HELPER_5_changeZindexOfPath(0);
--_walkDataLastIndex;
@@ -378,7 +378,7 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap() {
_walkDataCurrentIndex = 2;
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
- waitForIgorMove();
+ waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
_roomObjectAreasTable[5].area = 0;
_roomObjectAreasTable[10].area = 0;
_roomObjectAreasTable[11].area = 0;
@@ -427,14 +427,14 @@ void IgorEngine::PART_17_HELPER_6_walkFromCollege() {
_roomObjectAreasTable[_screenLayer2[22034]].area = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove();
+ waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
--_walkDataLastIndex;
buildWalkPath(243, 74, 205, 124);
_roomObjectAreasTable[_screenLayer2[23923]].area = 0;
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove();
+ waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
PART_17_HELPER_5_changeZindexOfPath(0);
_roomObjectAreasTable[5].area = 0;
_roomObjectAreasTable[10].area = 0;
diff --git a/engines/igor/parts/part_67.cpp b/engines/igor/parts/part_67.cpp
new file mode 100644
index 00000000000..f454838f7be
--- /dev/null
+++ b/engines/igor/parts/part_67.cpp
@@ -0,0 +1,271 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+static const int kPart67FlameX = 81;
+static const int kPart67FlameY = 52;
+static const int kPart67FlameWidth = 19;
+static const int kPart67FlameHeight = 29;
+static const int kPart67FlameFrameSize = kPart67FlameWidth * kPart67FlameHeight;
+
+// The palette is darkened by this amount in the colors of the room and of Igor.
+static const int kPart67PaletteDarkness = 8;
+
+static int PART_67_FLAME_FRAME;
+
+void IgorEngine::PART_67_EXEC_ACTION(int action) {
+ switch (action) {
+ case 101: // go back to church
+ PART_67_ACTION_101_goToChurch();
+ break;
+ case 102:
+ PART_67_ACTION_102_goRight();
+ break;
+ case 103:
+ ADD_DIALOGUE_TEXT(211, 2, 1155);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 104:
+ ADD_DIALOGUE_TEXT(201, 2, 1149);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ default:
+ error("PART_67_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+/**
+ * Igor walks back to where he came from and the church puzzle room is entered again.
+ */
+void IgorEngine::PART_67_ACTION_101_goToChurch() {
+ --_walkDataLastIndex;
+ _roomObjectAreasTable[_screenLayer2[29594]].area = 1;
+ buildWalkPathSimple(154, 106, 154, 92);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove(&IgorEngine::PART_67_UPDATE_FLICKER);
+ _currentPart = 142;
+}
+
+/**
+ * Igor walks off the right edge of the picture to the next location of the park.
+ */
+void IgorEngine::PART_67_ACTION_102_goRight() {
+ --_walkDataLastIndex;
+ _roomObjectAreasTable[_screenLayer2[41258]].area = 1;
+ buildWalkPathSimple(248, 128, 298, 128);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove(&IgorEngine::PART_67_UPDATE_FLICKER);
+ _mazeLocation = 0x55;
+ _currentPart = 643;
+}
+
+/**
+ * Draws a frame of the flame, keeping the dialogue text on screen. The empty pixels of the
+ * frame show the room and the pixels with color 1 show the same pixel of the first frame.
+ */
+void IgorEngine::PART_67_DRAW_FLAME(int frame) {
+ const int screenOffset = kPart67FlameY * 320 + kPart67FlameX;
+ const uint8 *frames = _animFramesBuffer + (frame + 1) * kPart67FlameFrameSize;
+ uint8 tmp[kPart67FlameFrameSize];
+ for (int y = 0; y < kPart67FlameHeight; ++y) {
+ for (int x = 0; x < kPart67FlameWidth; ++x) {
+ const uint8 pixel = _screenVGA[screenOffset + y * 320 + x];
+ uint8 color;
+ if (pixel == 0xF0 || pixel == 0xF1) {
+ color = pixel;
+ } else {
+ color = frames[y * kPart67FlameWidth + x];
+ if (color == 0) {
+ color = _screenLayer1[screenOffset + y * 320 + x];
+ }
+ if (color == 1) {
+ color = _animFramesBuffer[y * kPart67FlameWidth + x];
+ }
+ }
+ tmp[y * kPart67FlameWidth + x] = color;
+ }
+ }
+ for (int y = 0; y < kPart67FlameHeight; ++y) {
+ memcpy(_screenVGA + screenOffset + y * 320, tmp + y * kPart67FlameWidth, kPart67FlameWidth);
+ }
+}
+
+/**
+ * Changes the flame to another random frame and makes the light of the room flicker: the colors
+ * of the room and of Igor are set to the (darkened) palette changed by 0, -1 or -2.
+ */
+void IgorEngine::PART_67_FLICKER() {
+ int frame;
+ do {
+ frame = getRandomNumber(9);
+ } while (frame == PART_67_FLAME_FRAME);
+ PART_67_FLAME_FRAME = frame;
+ PART_67_DRAW_FLAME(frame);
+
+ int delta = 0;
+ switch (getRandomNumber(2)) {
+ case 0:
+ delta = -2;
+ break;
+ case 1:
+ delta = -1;
+ break;
+ case 2:
+ delta = 0;
+ break;
+ }
+ for (int color = 1; color <= 207; ++color) {
+ if (color > 183 && color < 192) {
+ continue;
+ }
+ for (int i = 0; i < 3; ++i) {
+ const int value = _paletteBuffer[color * 3 + i] + delta;
+ _currentPalette[color * 3 + i] = value < 1 ? 0 : value;
+ }
+ }
+ setPaletteRange(1, 183);
+ setPaletteRange(192, 207);
+}
+
+/**
+ * The flame and the light flicker.
+ */
+void IgorEngine::PART_67_UPDATE_FLICKER() {
+ // the original phases 11, 35 and 59 are the ticks 8, 32 and 56
+ if (compareGameTick(16, 24)) {
+ PART_67_FLICKER();
+ }
+}
+
+void IgorEngine::PART_67_ENTER_FROM_CHURCH_PUZZLE() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(154, 92, kFacingPositionFront, 0);
+ wd->setDefaultScale();
+ _walkDataLastIndex = 0;
+ const int area = _screenLayer2[29594];
+ _roomObjectAreasTable[area].area = 1;
+ buildWalkPathSimple(154, 92, 154, 110);
+ _roomObjectAreasTable[area].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove(&IgorEngine::PART_67_UPDATE_FLICKER);
+}
+
+void IgorEngine::PART_67_ENTER_FROM_RIGHT() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(298, 128, kFacingPositionLeft, 0);
+ wd->setDefaultScale();
+ _walkDataLastIndex = 0;
+ const int area = _screenLayer2[41258];
+ _roomObjectAreasTable[area].area = 1;
+ buildWalkPathSimple(298, 128, 240, 128);
+ _roomObjectAreasTable[area].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove(&IgorEngine::PART_67_UPDATE_FLICKER);
+}
+
+/**
+ * The flame and the light flicker; screams are heard from time to time, only if no speech is
+ * playing.
+ */
+void IgorEngine::PART_67_UPDATE_ROOM_BACKGROUND() {
+ PART_67_UPDATE_FLICKER();
+ if (compareGameTick(0x3D) && getRandomNumber(24) == 0 && !isDialogueSpeechPlaying()) {
+ switch (getRandomNumber(4)) {
+ case 0:
+ playSound(55, 1);
+ break;
+ case 1:
+ playSound(56, 1);
+ break;
+ case 2:
+ playSound(57, 1);
+ break;
+ case 3:
+ playSound(58, 1);
+ break;
+ case 4:
+ playSound(59, 1);
+ break;
+ }
+ }
+}
+
+void IgorEngine::PART_67() {
+ playMusic(5);
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_MazeEntrance, IMG_MazeEntrance, BOX_MazeEntrance, MSK_MazeEntrance, TXT_MazeEntrance);
+ memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
+ SET_PAL_240_48_1();
+ static const int anm[] = { FRM_MazeEntrance1, 0 };
+ loadAnimData(anm);
+ loadActionData(DAT_MazeEntrance);
+ _roomDataOffsets = PART_67_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(112, 0, 248, 128);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_67_EXEC_ACTION);
+ _updateRoomBackground = &IgorEngine::PART_67_UPDATE_ROOM_BACKGROUND;
+ memcpy(_screenVGA, _screenLayer1, 46080);
+
+ // the whole room is darker than its palette
+ for (int color = 1; color <= 207; ++color) {
+ if (color > 183 && color < 192) {
+ continue;
+ }
+ for (int i = 0; i < 3; ++i) {
+ const int value = _paletteBuffer[color * 3 + i] - kPart67PaletteDarkness;
+ _paletteBuffer[color * 3 + i] = value < 1 ? 0 : value;
+ }
+ }
+
+ PART_67_FLAME_FRAME = 0;
+ // draws first frame of flame
+ PART_67_DRAW_FLAME(0);
+
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 670) {
+ PART_67_ENTER_FROM_CHURCH_PUZZLE();
+ } else {
+ PART_67_ENTER_FROM_RIGHT();
+ }
+ }
+ enterPartLoop();
+ while ((_currentPart == 670 || _currentPart == 671) && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index be173083a48..712db2edf02 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -590,5 +590,12 @@
#define FRM_ParkLaura2 988 // cseg103:9F53; IGOR.EXE:0x3DF753, 0x0072 bytes
#define FRM_ParkLaura3 989 // cseg103:9FC5; IGOR.EXE:0x3DF7C5, 0x0030 bytes
#define FRM_ParkRight1 990 // cseg49:29B6; IGOR.EXE:0x2053B6, 0x0F81 bytes
+#define DAT_MazeEntrance 991 // cseg62:279B; IGOR.EXE:0x28509B, 0x15F1 bytes
+#define FRM_MazeEntrance1 992 // cseg94:0070; IGOR.EXE:0x38DC70, 0x17AD bytes
+#define TXT_MazeEntrance 993 // cseg86:06B3; IGOR.EXE:0x34A8B3, 0x04FF bytes
+#define IMG_MazeEntrance 994 // cseg86:0BB2; IGOR.EXE:0x34ADB2, 0xB400 bytes
+#define PAL_MazeEntrance 995 // cseg86:BFB2; IGOR.EXE:0x3561B2, 0x0240 bytes
+#define MSK_MazeEntrance 996 // cseg86:C222; IGOR.EXE:0x356422, 0x075C bytes
+#define BOX_MazeEntrance 997 // cseg86:C97E; IGOR.EXE:0x356B7E, 0x0500 bytes
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index e713f41213d..6ab0d101464 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -457,4 +457,11 @@ const RoomDataOffsets IgorEngine::PART_37_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_67_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 1, 6 },
+ { 7, 143, 2879, 31, 107, 76 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
} // End of namespace Igor
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 7643cb64946..3f0e3ec4dcd 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1055,7 +1055,7 @@ void IgorEngine::buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, in
}
}
-void IgorEngine::waitForIgorMove() {
+void IgorEngine::waitForIgorMove(IgorMoveTick tick) {
_gameTicks = 0;
do {
if (compareGameTick(1, 16)) {
@@ -1068,9 +1068,9 @@ void IgorEngine::waitForIgorMove() {
++_walkDataCurrentIndex;
}
}
- // if (_updateRoomBackground) {
- // (this->*_updateRoomBackground)();
- // }
+ if (tick) {
+ (this->*tick)();
+ }
waitForTimer();
} while (_gameState.igorMoving);
}
@@ -1107,6 +1107,29 @@ void IgorEngine::buildWalkPathSimple(int srcX, int srcY, int dstX, int dstY) {
}
void IgorEngine::fixWalkPosition(int *x, int *y) {
+ if (getPart() == 67) {
+ // The click is clamped to the walk bounds, then the picture is scanned for the first
+ // walkable row strictly below it (the scan starts one row down, whatever the row is) and,
+ // if none is found down to the last row, upwards from the last row.
+ int xPos = CLIP<int>(*x, _roomWalkBounds.x1, _roomWalkBounds.x2);
+ int yPos = MIN(*y, _roomWalkBounds.y2);
+ do {
+ if (yPos < 143) {
+ ++yPos;
+ }
+ if (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area > 0) {
+ break;
+ }
+ } while (yPos != 143);
+ if (yPos == 143) {
+ do {
+ --yPos;
+ } while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && yPos > 0);
+ }
+ *x = xPos;
+ *y = yPos;
+ return;
+ }
int xPos = *x;
int edgeMinY = _roomWalkBounds.y1;
if (xPos < _roomWalkBounds.x1) {
Commit: 68a663322a1bcbe585aaf685ecce0440893df433
https://github.com/scummvm/scummvm/commit/68a663322a1bcbe585aaf685ecce0440893df433
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:26+01:00
Commit Message:
IGOR: Resources for maze
Changed paths:
engines/igor/resource_ids.h
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 712db2edf02..c1dc6849629 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -486,7 +486,7 @@
// Walk line used for scroll
#define WLK_DecanatoLeft 910
#define WLK_DecanatoRight 911
-#define DAT_DecanatoPart11 912 // cseg176:286F-2882; IGOR.EXE:0x68049B, size 0x1841
+#define DAT_DecanatoPart11 912
// CD-only intro card shown by state 850. All three resources are contiguous in
// NE segment 209 immediately after the intro code.
@@ -494,108 +494,191 @@
#define IMG_IgorIntroLogo 914 // cseg209:1E34; IGOR.EXE:0x7C1434, 320x122
#define PAL_IgorIntroLogo 915 // cseg209:B6B4; IGOR.EXE:0x7CACB4, 768 bytes
-// Administration corridor used by PART_07 states 70-72. These CD resources live in
-// NE segments 197-199 and were absent from the historical TBL catalog.
-#define DAT_AdministrationCorridor 916 // cseg197:3732; IGOR.EXE:0x748B32, 0x1A59 bytes
-#define ANM_AdministrationCorridor 917 // cseg198:00D6; IGOR.EXE:0x74C8D6, 0x2B4D bytes
-#define TXT_AdministrationCorridor 918 // cseg199:06A2; IGOR.EXE:0x74FBA2, 0x5EE bytes
-#define IMG_AdministrationCorridor 919 // cseg199:0C90; IGOR.EXE:0x750190, 0xB400 bytes
-#define PAL_AdministrationCorridor 920 // cseg199:C090; IGOR.EXE:0x75B590, 0x270 bytes
-#define MSK_AdministrationCorridor 921 // cseg199:C300; IGOR.EXE:0x75B800, 0x954 bytes
-#define BOX_AdministrationCorridor 922 // cseg199:CC54; IGOR.EXE:0x75C154, 0x500 bytes
+#define DAT_AdministrationCorridor 916
+#define ANM_AdministrationCorridor 917
+#define TXT_AdministrationCorridor 918
+#define IMG_AdministrationCorridor 919
+#define PAL_AdministrationCorridor 920
+#define MSK_AdministrationCorridor 921
+#define BOX_AdministrationCorridor 922
-// Hamburger pickup animation loaded over ANM+0xB400 in PART_10.
-#define ANM_DecanatoHamburger 932 // cseg134:21AF-21ED; IGOR.EXE:0x4EFCEE, 0x1386 bytes
+#define ANM_DecanatoHamburger 932
-// Right park panel. The historical catalog only exposed cseg106's left panel;
-// these resources are cseg104's independently loaded room data.
-#define TXT_ParkRight 933 // cseg104:01AB-0244; IGOR.EXE:0x3DFFA2, 0x488 bytes
-#define IMG_ParkRight 934 // cseg104:006B-0095; IGOR.EXE:0x3E042A, 0xB400 bytes
-#define PAL_ParkRight 935 // cseg104:0010-0039; IGOR.EXE:0x3EB82A, 0x270 bytes
-#define MSK_ParkRight 936 // cseg104:00D7-01A8; IGOR.EXE:0x3EBA9A, 0xF84 bytes
-#define BOX_ParkRight 937 // cseg104:009A-00C3; IGOR.EXE:0x3ECA1E, 0x500 bytes
+#define TXT_ParkRight 933
+#define IMG_ParkRight 934
+#define PAL_ParkRight 935
+#define MSK_ParkRight 936
+#define BOX_ParkRight 937
-// Dean Peeper's conversation data block from NE segment 194.
#define DLG_DeanPepperOffice 938
-// Student dormitory animation blocks copied contiguously by cseg207:0002-0239.
-#define ANM_StudentDormitoryRoom1 939 // cseg207:023B; IGOR.EXE:0x7A843B, 0x1200 bytes
-#define ANM_StudentDormitoryRoom2 940 // cseg207:143B; IGOR.EXE:0x7A963B, 0x0478 bytes
-#define ANM_StudentDormitoryRoom3 941 // cseg207:18B3; IGOR.EXE:0x7A9AB3, 0x1BC0 bytes
-#define ANM_StudentDormitoryRoom4 942 // cseg207:3473; IGOR.EXE:0x7AB673, 0x0D90 bytes
-#define ANM_StudentDormitoryRoom5 943 // cseg207:4203; IGOR.EXE:0x7AC403, 0x0CA2 bytes
-#define ANM_StudentDormitoryRoom6 944 // cseg207:4EA5; IGOR.EXE:0x7AD0A5, 0x0120 bytes
-#define ANM_StudentDormitoryRoom7 945 // cseg207:4FC5; IGOR.EXE:0x7AD1C5, 0x0BB8 bytes
-#define ANM_StudentDormitoryRoom8 946 // cseg207:5B7D; IGOR.EXE:0x7ADD7D, 0x0CE4 bytes
-#define ANM_StudentDormitoryRoom9 947 // cseg207:6861; IGOR.EXE:0x7AEA61, 0x15E0 bytes
-#define ANM_StudentDormitoryRoom10 948 // cseg207:7E41; IGOR.EXE:0x7B0041, 0x080A bytes
-#define ANM_StudentDormitoryRoom11 949 // cseg207:864B; IGOR.EXE:0x7B084B, 0x080A bytes
+#define ANM_StudentDormitoryRoom1 939
+#define ANM_StudentDormitoryRoom2 940
+#define ANM_StudentDormitoryRoom3 941
+#define ANM_StudentDormitoryRoom4 942
+#define ANM_StudentDormitoryRoom5 943
+#define ANM_StudentDormitoryRoom6 944
+#define ANM_StudentDormitoryRoom7 945
+#define ANM_StudentDormitoryRoom8 946
+#define ANM_StudentDormitoryRoom9 947
+#define ANM_StudentDormitoryRoom10 948
+#define ANM_StudentDormitoryRoom11 949
-// Outside Igor's dormitory window (PART_01), from NE segments 200-202.
-#define DAT_OutsideStudentDormitory 950 // cseg200:278F; IGOR.EXE:0x75EF8F, 0x17DD bytes
-#define TXT_OutsideStudentDormitory 951 // cseg202:06AD; IGOR.EXE:0x76F9AD, 0x0549 bytes
-#define IMG_OutsideStudentDormitory 952 // cseg202:0BF6; IGOR.EXE:0x76FEF6, 0xB400 bytes
-#define PAL_OutsideStudentDormitory 953 // cseg202:BFF6; IGOR.EXE:0x77B2F6, 0x0270 bytes
-#define MSK_OutsideStudentDormitory 954 // cseg202:C266; IGOR.EXE:0x77B566, 0x05F4 bytes
-#define BOX_OutsideStudentDormitory 955 // cseg202:C85A; IGOR.EXE:0x77BB5A, 0x0500 bytes
-#define ANM_OutsideStudentDormitory1 956 // cseg201:01A1; IGOR.EXE:0x7627A1, 0x00D8 bytes
-#define ANM_OutsideStudentDormitory2 957 // cseg201:0279; IGOR.EXE:0x762879, 0x0E1C bytes
-#define ANM_OutsideStudentDormitory3 958 // cseg201:1095; IGOR.EXE:0x763695, 0x07B0 bytes
-#define ANM_OutsideStudentDormitory4 959 // cseg201:1845; IGOR.EXE:0x763E45, 0x01B5 bytes
-#define ANM_OutsideStudentDormitory5 960 // cseg201:19FA; IGOR.EXE:0x763FFA, 0x00D0 bytes
-#define ANM_OutsideStudentDormitory6 961 // cseg201:1ACA; IGOR.EXE:0x7640CA, 0x8E80 bytes
-#define ANM_OutsideStudentDormitory7 962 // cseg201:A94A; IGOR.EXE:0x76CF4A, 0x0050 bytes
-#define ANM_OutsideStudentDormitory8 963 // cseg201:A99A; IGOR.EXE:0x76CF9A, 0x2210 bytes
-// Dormitory attic/crawlspace (PART_02), from NE segments 203-205.
-#define DAT_StudentDormitoryAttic 964 // cseg203:52D7; IGOR.EXE:0x7814D7, 0x1EA3 bytes
-#define TXT_StudentDormitoryAttic 965 // cseg205:06A2; IGOR.EXE:0x7926A2, 0x0744 bytes
-#define IMG_StudentDormitoryAttic 966 // cseg205:0DE6; IGOR.EXE:0x792DE6, 0xB400 bytes
-#define PAL_StudentDormitoryAttic 967 // cseg205:C1E6; IGOR.EXE:0x79E1E6, 0x0270 bytes
-#define MSK_StudentDormitoryAttic 968 // cseg205:C456; IGOR.EXE:0x79E456, 0x11C1 bytes
-#define BOX_StudentDormitoryAttic 969 // cseg205:D617; IGOR.EXE:0x79F617, 0x0500 bytes
-#define ANM_StudentDormitoryAttic1 970 // cseg204:02D3; IGOR.EXE:0x7860D3, 0x02BC bytes
-#define ANM_StudentDormitoryAttic2 971 // cseg204:058F; IGOR.EXE:0x78638F, 0x00DC bytes
-#define ANM_StudentDormitoryAttic3 972 // cseg204:066B; IGOR.EXE:0x78646B, 0x0028 bytes
-#define ANM_StudentDormitoryAttic4 973 // cseg204:0693; IGOR.EXE:0x786493, 0x153F bytes
-#define ANM_StudentDormitoryAttic5 974 // cseg204:1BD2; IGOR.EXE:0x7879D2, 0x153F bytes
-#define ANM_StudentDormitoryAttic6 975 // cseg204:3111; IGOR.EXE:0x788F11, 0x057C bytes
-#define ANM_StudentDormitoryAttic7 976 // cseg204:368D; IGOR.EXE:0x78948D, 0x0E10 bytes
-#define ANM_StudentDormitoryAttic8 977 // cseg204:449D; IGOR.EXE:0x78A29D, 0x1308 bytes
-#define ANM_StudentDormitoryAttic9 978 // cseg204:57A5; IGOR.EXE:0x78B5A5, 0x080A bytes
-#define ANM_StudentDormitoryAttic10 979 // cseg204:5FAF; IGOR.EXE:0x78BDAF, 0x0CE4 bytes
-#define ANM_StudentDormitoryAttic11 980 // cseg204:6C93; IGOR.EXE:0x78CA93, 0x160B bytes
-#define ANM_StudentDormitoryAttic12 981 // cseg204:829E; IGOR.EXE:0x78E09E, 0x0240 bytes
-#define ANM_StudentDormitoryAttic13 982 // cseg204:84DE; IGOR.EXE:0x78E2DE, 0x327D bytes
-#define ANM_StudentDormitoryAttic14 983 // cseg204:B75B; IGOR.EXE:0x79155B, 0x0960 bytes
+#define DAT_OutsideStudentDormitory 950
+#define TXT_OutsideStudentDormitory 951
+#define IMG_OutsideStudentDormitory 952
+#define PAL_OutsideStudentDormitory 953
+#define MSK_OutsideStudentDormitory 954
+#define BOX_OutsideStudentDormitory 955
+#define ANM_OutsideStudentDormitory1 956
+#define ANM_OutsideStudentDormitory2 957
+#define ANM_OutsideStudentDormitory3 958
+#define ANM_OutsideStudentDormitory4 959
+#define ANM_OutsideStudentDormitory5 960
+#define ANM_OutsideStudentDormitory6 961
+#define ANM_OutsideStudentDormitory7 962
+#define ANM_OutsideStudentDormitory8 963
-// Administration secretary-room animation blocks copied by cseg192:0002-01D4.
-#define ANM_AdministrationSecretaryRoom1 923 // cseg192:01D5; IGOR.EXE:0x7057D5, 0xD38 bytes
-#define ANM_AdministrationSecretaryRoom2 924 // cseg192:0F0D; IGOR.EXE:0x70650D, 0x1FB bytes
-#define ANM_AdministrationSecretaryRoom3 925 // cseg192:1108; IGOR.EXE:0x706708, 0x4DD8 bytes
-#define ANM_AdministrationSecretaryRoom4 926 // cseg192:5EE0; IGOR.EXE:0x70B4E0, 0x930 bytes
-#define ANM_AdministrationSecretaryRoom5 927 // cseg192:6810; IGOR.EXE:0x70BE10, 0x7D0 bytes
-#define ANM_AdministrationSecretaryRoom6 928 // cseg192:6FE0; IGOR.EXE:0x70C5E0, 0x18E4 bytes
-#define ANM_AdministrationSecretaryRoom7 929 // cseg192:88C4; IGOR.EXE:0x70DEC4, 0x14B4 bytes
-#define ANM_AdministrationSecretaryRoom8 930 // cseg192:9D78; IGOR.EXE:0x70F378, 0x870 bytes
-#define ANM_AdministrationSecretaryRoom9 931 // cseg192:A5E8; IGOR.EXE:0x70FBE8, 0x399D bytes
+#define DAT_StudentDormitoryAttic 964
+#define TXT_StudentDormitoryAttic 965
+#define IMG_StudentDormitoryAttic 966
+#define PAL_StudentDormitoryAttic 967
+#define MSK_StudentDormitoryAttic 968
+#define BOX_StudentDormitoryAttic 969
+#define ANM_StudentDormitoryAttic1 970
+#define ANM_StudentDormitoryAttic2 971
+#define ANM_StudentDormitoryAttic3 972
+#define ANM_StudentDormitoryAttic4 973
+#define ANM_StudentDormitoryAttic5 974
+#define ANM_StudentDormitoryAttic6 975
+#define ANM_StudentDormitoryAttic7 976
+#define ANM_StudentDormitoryAttic8 977
+#define ANM_StudentDormitoryAttic9 978
+#define ANM_StudentDormitoryAttic10 979
+#define ANM_StudentDormitoryAttic11 980
+#define ANM_StudentDormitoryAttic12 981
+#define ANM_StudentDormitoryAttic13 982
+#define ANM_StudentDormitoryAttic14 983
+
+#define ANM_AdministrationSecretaryRoom1 923
+#define ANM_AdministrationSecretaryRoom2 924
+#define ANM_AdministrationSecretaryRoom3 925
+#define ANM_AdministrationSecretaryRoom4 926
+#define ANM_AdministrationSecretaryRoom5 927
+#define ANM_AdministrationSecretaryRoom6 928
+#define ANM_AdministrationSecretaryRoom7 929
+#define ANM_AdministrationSecretaryRoom8 930
+#define ANM_AdministrationSecretaryRoom9 931
#define DLG_AdministrationSecretaryRoom 984
-// Park conversation with the old lady (cseg94:2498), Laura's entrance and conversation (cseg102:0D22,
-// cseg103:0002).
-#define DLG_ParkLady 985 // cseg94:2E6A; IGOR.EXE:0x390A6A, 0x062D bytes
-#define DLG_ParkLaura 986 // cseg102:1E97; IGOR.EXE:0x3D3597, 0x0B54 bytes
-#define FRM_ParkLaura1 987 // cseg103:00A5; IGOR.EXE:0x3D58A5, 0x9EAE bytes
-#define FRM_ParkLaura2 988 // cseg103:9F53; IGOR.EXE:0x3DF753, 0x0072 bytes
-#define FRM_ParkLaura3 989 // cseg103:9FC5; IGOR.EXE:0x3DF7C5, 0x0030 bytes
-#define FRM_ParkRight1 990 // cseg49:29B6; IGOR.EXE:0x2053B6, 0x0F81 bytes
-#define DAT_MazeEntrance 991 // cseg62:279B; IGOR.EXE:0x28509B, 0x15F1 bytes
-#define FRM_MazeEntrance1 992 // cseg94:0070; IGOR.EXE:0x38DC70, 0x17AD bytes
-#define TXT_MazeEntrance 993 // cseg86:06B3; IGOR.EXE:0x34A8B3, 0x04FF bytes
-#define IMG_MazeEntrance 994 // cseg86:0BB2; IGOR.EXE:0x34ADB2, 0xB400 bytes
-#define PAL_MazeEntrance 995 // cseg86:BFB2; IGOR.EXE:0x3561B2, 0x0240 bytes
-#define MSK_MazeEntrance 996 // cseg86:C222; IGOR.EXE:0x356422, 0x075C bytes
-#define BOX_MazeEntrance 997 // cseg86:C97E; IGOR.EXE:0x356B7E, 0x0500 bytes
+#define DLG_ParkLady 985
+#define DLG_ParkLaura 986
+#define FRM_ParkLaura1 987
+#define FRM_ParkLaura2 988
+#define FRM_ParkLaura3 989
+#define FRM_ParkRight1 990
+#define DAT_MazeEntrance 991
+#define FRM_MazeEntrance1 992
+#define TXT_MazeEntrance 993
+#define IMG_MazeEntrance 994
+#define PAL_MazeEntrance 995
+#define MSK_MazeEntrance 996
+#define BOX_MazeEntrance 997
+
+// MAZE ROOMS BEGIN
+#define DAT_Maze51 998
+#define TXT_Maze51 999
+#define IMG_Maze51 1000
+#define PAL_Maze51 1001
+#define MSK_Maze51 1002
+#define BOX_Maze51 1003
+#define DAT_Maze52 1004
+#define TXT_Maze52 1005
+#define IMG_Maze52 1006
+#define PAL_Maze52 1007
+#define MSK_Maze52 1008
+#define BOX_Maze52 1009
+#define DAT_Maze53 1010
+#define TXT_Maze53 1011
+#define IMG_Maze53 1012
+#define PAL_Maze53 1013
+#define MSK_Maze53 1014
+#define BOX_Maze53 1015
+#define DAT_Maze54 1016
+#define TXT_Maze54 1017
+#define IMG_Maze54 1018
+#define PAL_Maze54 1019
+#define MSK_Maze54 1020
+#define BOX_Maze54 1021
+#define DAT_Maze55 1022
+#define DAT_Maze56 1023
+#define TXT_Maze56 1024
+#define IMG_Maze56 1025
+#define PAL_Maze56 1026
+#define MSK_Maze56 1027
+#define BOX_Maze56 1028
+#define DAT_Maze57 1029
+#define TXT_Maze57 1030
+#define IMG_Maze57 1031
+#define PAL_Maze57 1032
+#define MSK_Maze57 1033
+#define BOX_Maze57 1034
+#define DAT_Maze58 1035
+#define TXT_Maze58 1036
+#define IMG_Maze58 1037
+#define PAL_Maze58 1038
+#define MSK_Maze58 1039
+#define BOX_Maze58 1040
+#define DAT_Maze59 1041
+#define TXT_Maze59 1042
+#define IMG_Maze59 1043
+#define PAL_Maze59 1044
+#define MSK_Maze59 1045
+#define BOX_Maze59 1046
+#define DAT_Maze60 1047
+#define TXT_Maze60 1048
+#define IMG_Maze60 1049
+#define PAL_Maze60 1050
+#define MSK_Maze60 1051
+#define BOX_Maze60 1052
+#define DAT_Maze61 1053
+#define TXT_Maze61 1054
+#define IMG_Maze61 1055
+#define PAL_Maze61 1056
+#define MSK_Maze61 1057
+#define BOX_Maze61 1058
+#define DAT_Maze62 1059
+#define TXT_Maze62 1060
+#define IMG_Maze62 1061
+#define PAL_Maze62 1062
+#define MSK_Maze62 1063
+#define BOX_Maze62 1064
+#define DAT_Maze63 1065
+#define TXT_Maze63 1066
+#define IMG_Maze63 1067
+#define PAL_Maze63 1068
+#define MSK_Maze63 1069
+#define BOX_Maze63 1070
+#define DAT_Maze64 1071
+#define TXT_Maze64 1072
+#define IMG_Maze64 1073
+#define PAL_Maze64 1074
+#define MSK_Maze64 1075
+#define BOX_Maze64 1076
+#define DAT_Maze65 1077
+#define TXT_Maze65 1078
+#define IMG_Maze65 1079
+#define PAL_Maze65 1080
+#define MSK_Maze65 1081
+#define BOX_Maze65 1082
+#define DAT_Maze66 1083
+#define TXT_Maze66 1084
+#define IMG_Maze66 1085
+#define PAL_Maze66 1086
+#define MSK_Maze66 1087
+#define BOX_Maze66 1088
+// MAZE ROOMS END
#endif // IGOR_RESOURCE_IDS
Commit: 06b399ba6e60622eb983a0d0136b2a615668d0f6
https://github.com/scummvm/scummvm/commit/06b399ba6e60622eb983a0d0136b2a615668d0f6
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:27+01:00
Commit Message:
IGOR: Import part 75 from legacy engine
Changed paths:
A engines/igor/parts/part_75.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 6f987193b5c..abdaab4dd26 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -980,6 +980,12 @@ private:
void PART_67_UPDATE_ROOM_BACKGROUND();
void PART_67();
+
+ // philip vodka cutscene
+ void PART_75_UPDATE_DIALOGUE_PHILIP(int action);
+ void PART_75_HELPER_1(int frame);
+ void PART_75();
+
void PART_85();
void PART_85_HELPER_1_PLAY_ANIM(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
void PART_85_HELPER_2_SCROLL_RIGHT();
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 04f815f11ef..329460003ce 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -51,6 +51,7 @@ MODULE_OBJS = \
parts/part_36.o \
parts/part_37.o \
parts/part_67.o \
+ parts/part_75.o \
parts/part_margaret.o \
text.o \
part_main.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 7b5dacd428a..db5e5fc517b 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -676,6 +676,9 @@ void IgorEngine::PART_MAIN() {
case 671:
PART_67(); // maze entrance
break;
+ case 750:
+ PART_75(); // philip vodka cutscene
+ break;
case 850: // Intro cutscene
// Clear the entire screen buffer before starting the intro cutscene
memset(_screenVGA, 0, 64000);
diff --git a/engines/igor/parts/part_75.cpp b/engines/igor/parts/part_75.cpp
new file mode 100644
index 00000000000..b96d02d8c2c
--- /dev/null
+++ b/engines/igor/parts/part_75.cpp
@@ -0,0 +1,116 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#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(4) + 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);
+ fadeIn(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(3) + 37);
+ waitForTimer(30);
+ }
+ memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
+ _gameState.dialogueTextRunning = false;
+ _updateDialogue = 0;
+ _currentPart = 122;
+ fadeOut(768);
+}
+
+
+} // End of namespace Igor
Commit: efa60cb2c21e0a908222326522f7bd59082e3081
https://github.com/scummvm/scummvm/commit/efa60cb2c21e0a908222326522f7bd59082e3081
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:27+01:00
Commit Message:
IGOR: Fixes wrong colors in part 75
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/part_main.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_75.cpp
engines/igor/resource.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 9485c716d6c..e02a11779a3 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -177,6 +177,8 @@ void IgorEngine::restart() {
_currentCursor = 0;
_dialogueCursorOn = true;
_updateDialogue = 0;
+ _talkColorIndex = kTalkColor;
+ _talkShadowIndex = kTalkShadowColor;
_updateRoomBackground = 0;
_resourceEntriesCount = 0;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index abdaab4dd26..fd406f9f323 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -430,6 +430,9 @@ private:
RoomWalkBounds _roomWalkBounds;
RoomDataOffsets _roomDataOffsets;
UpdateDialogueProc _updateDialogue;
+ // palette indices used to draw cutscene dialogue text and its outline
+ uint8 _talkColorIndex;
+ uint8 _talkShadowIndex;
UpdateRoomBackgroundProc _updateRoomBackground;
int _demoActionsCounter;
int _gameTicks;
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index db5e5fc517b..c6ce782e8c8 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -832,6 +832,8 @@ void IgorEngine::PART_MEANWHILE() {
hideCursor();
memset(_currentPalette, 0, 768);
setPaletteRange(208, 255);
+ // clears the verbs and inventory panels area
+ memset(_screenVGA + 46080, 0, 17920);
loadData(IMG_Meanwhile, _screenVGA);
_paletteBuffer[3] = 63;
_paletteBuffer[4] = 32;
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 6666f1362d2..f239212a9bd 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -397,7 +397,6 @@ void IgorEngine::PART_12_HELPER_4() {
}
}
ADD_DIALOGUE_TEXT(212, 2, 796);
- ADD_DIALOGUE_TEXT(213, 2, 796);
ADD_DIALOGUE_TEXT(214, 1, 797);
ADD_DIALOGUE_TEXT(215, 1, 798);
SET_DIALOGUE_TEXT(1, 3);
diff --git a/engines/igor/parts/part_75.cpp b/engines/igor/parts/part_75.cpp
index b96d02d8c2c..cc0e583d86a 100644
--- a/engines/igor/parts/part_75.cpp
+++ b/engines/igor/parts/part_75.cpp
@@ -51,6 +51,10 @@ void IgorEngine::PART_75_HELPER_1(int frame) {
void IgorEngine::PART_75() {
PART_MEANWHILE();
_gameState.enableLight = 1;
+ // this cutscene draws its dialogue text with the last palette entry and index 0 for
+ // the outline, since Philip's sprites use the entries the regular text would recolor
+ _talkColorIndex = 255;
+ _talkShadowIndex = 0;
loadRoomData(PAL_PhilipRoom, IMG_PhilipRoom, BOX_PhilipRoom, MSK_PhilipRoom, TXT_PhilipRoom);
static const int anm[] = { ANM_PhilipVodka, AOF_PhilipVodka, 0 };
loadAnimData(anm);
@@ -100,7 +104,6 @@ void IgorEngine::PART_75() {
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(3) + 37);
waitForTimer(30);
@@ -108,6 +111,8 @@ void IgorEngine::PART_75() {
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
_gameState.dialogueTextRunning = false;
_updateDialogue = 0;
+ _talkColorIndex = kTalkColor;
+ _talkShadowIndex = kTalkShadowColor;
_currentPart = 122;
fadeOut(768);
}
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 7eea7672dd3..c3b218c7597 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -323,7 +323,7 @@ void IgorEngine::decodeAnimFrame(const uint8 *src, uint8 *dst, bool preserveText
len = 256 - len;
if (preserveText) {
for (int i = pos; i < pos + len; ++i) {
- if (dst[i] != kTalkColor && dst[i] != kTalkShadowColor) {
+ if (dst[i] != _talkColorIndex && dst[i] != _talkShadowIndex) {
dst[i] = color;
}
}
@@ -334,7 +334,7 @@ void IgorEngine::decodeAnimFrame(const uint8 *src, uint8 *dst, bool preserveText
} else {
if (preserveText) {
for (int i = pos; i < pos + len; ++i) {
- if (dst[i] != kTalkColor && dst[i] != kTalkShadowColor) {
+ if (dst[i] != _talkColorIndex && dst[i] != _talkShadowIndex) {
dst[i] = src[i - pos];
}
}
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 5b5ba957410..05e43686c24 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -184,10 +184,10 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
;
int textX = talkX - textLineWidth / 2;
int textY = i * 10;
- _font.drawString(_screenTextLayer, textLine, textX, textY, kTalkColor, kTalkShadowColor, kTalkShadowColor);
+ _font.drawString(_screenTextLayer, textLine, textX, textY, _talkColorIndex, _talkShadowIndex, _talkShadowIndex);
}
- setPaletteColor(kTalkColor, r, g, b);
- setPaletteColor(kTalkShadowColor, 0, 0, 0);
+ setPaletteColor(_talkColorIndex, r, g, b);
+ setPaletteColor(_talkShadowIndex, 0, 0, 0);
// Only update the VGA screen buffer if not in spech-only mode
if (_gameState.talkMode != kTalkModeSpeechOnly) {
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer, _dialogueDirtyRectSize);
@@ -336,10 +336,10 @@ void IgorEngine::startIgorDialogue() {
int textLineWidth = _font.getStringWidth(textLine);
int textX = talkX - textLineWidth / 2;
int textY = i * 10;
- _font.drawString(_screenTextLayer, textLine, textX, textY, kTalkColor, kTalkShadowColor, kTalkShadowColor);
+ _font.drawString(_screenTextLayer, textLine, textX, textY, _talkColorIndex, _talkShadowIndex, _talkShadowIndex);
}
- setPaletteColor(kTalkColor, _dialogueColor[0], _dialogueColor[1], _dialogueColor[2]);
- setPaletteColor(kTalkShadowColor, 0, 0, 0);
+ setPaletteColor(_talkColorIndex, _dialogueColor[0], _dialogueColor[1], _dialogueColor[2]);
+ setPaletteColor(_talkShadowIndex, 0, 0, 0);
if (_gameState.talkMode != kTalkModeSpeechOnly) {
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer, _dialogueDirtyRectSize);
}
Commit: 3a319d4964a28a1db464db583de7079d0df1ad9b
https://github.com/scummvm/scummvm/commit/3a319d4964a28a1db464db583de7079d0df1ad9b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:27+01:00
Commit Message:
IGOR: Initial maze implementation
Changed paths:
A engines/igor/parts/part_maze.cpp
A engines/igor/parts/part_maze_data.cpp
R engines/igor/parts/part_67.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/static_walk.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index e02a11779a3..10ebfe1a594 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -121,6 +121,10 @@ void IgorEngine::restart() {
memset(&_gameState, 0, sizeof(_gameState));
_mazeLocation = 0;
+ _mazeSavedLocation = 0;
+ _mazeRoom = 0;
+ memset(&_roomClickFix, 0, sizeof(_roomClickFix));
+ _roomGiveObjectSize = 0;
_nextTimer = 0;
_fastMode = 1;
_language = 0;
@@ -265,6 +269,8 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
}
void IgorEngine::leavePartLoop() {
+ _roomClickFix.enabled = false;
+ _roomGiveObjectSize = 0;
hideCursor();
SET_EXEC_ACTION_FUNC(1, 0);
_updateRoomBackground = 0;
@@ -620,7 +626,9 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
// 4. Part/state
s.syncAsSint16LE(_currentPart);
- s.skip(8);
+ // the location in the maze is kept in the padding
+ s.syncAsByte(_mazeLocation);
+ s.skip(7);
// 5. Action state
s.syncAsByte(_actionCode);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index fd406f9f323..478e92dc6f4 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -211,6 +211,104 @@ struct RoomDataOffsets {
} action;
DialogueDataOffsets dlg;
};
+
+// The click fix of a room that clamps the clicked position: y is limited, x is limited to [xMin, xMax]
+// (-1: no limit), then the first walkable row below is looked for (and above if scanUp).
+struct RoomClickFix {
+ int yMax;
+ int xMin;
+ int xMax;
+ bool scanUp;
+ bool enabled;
+};
+
+// The maze: a grid of locations, each with the location to the north, east, south and west (0: none)
+// and the shape of the room that shows it (the part of the room is 50 + shape).
+struct MazeNode {
+ uint8 neighbors[4];
+ uint8 shape;
+};
+
+enum MazeDirection {
+ kMazeNorth,
+ kMazeEast,
+ kMazeSouth,
+ kMazeWest
+};
+
+enum MazeEntryKind {
+ kMazeEntryWalk, // Igor appears at (x, y) and walks to (destX, destY)
+ kMazeEntryStairs // Igor walks into the picture at x, scaling down
+};
+
+struct MazeEntry {
+ uint16 state;
+ uint8 kind;
+ int16 x, y;
+ uint8 facing;
+ int16 destX, destY;
+};
+
+enum MazeActionKind {
+ kMazeActionExit, // walk (x1, y1) -> (x2, y2), then to the neighbour location
+ kMazeActionStairsExit, // walk out of the picture at x, scaling up, then to the neighbour location
+ kMazeActionExitFixed, // walk, then to a fixed location and state
+ kMazeActionDialogue
+};
+
+struct MazeDialogueLine {
+ uint16 text;
+ uint8 count;
+ uint16 sound;
+};
+
+struct MazeAction {
+ uint8 code;
+ uint8 kind;
+ int16 x1, y1, x2, y2;
+ uint8 dir;
+ int16 stairsX;
+ int16 location; // -1: unchanged
+ int16 state;
+ int8 objectState; // -1: none
+ int8 objectStateValue;
+ const MazeDialogueLine *lines;
+ uint8 numLines;
+ uint8 dialogueStart;
+ uint8 dialogueCount;
+};
+
+enum MazeFlameMode {
+ kMazeFlameNone,
+ kMazeFlameFixed, // one flame at a fixed position, color 1 shows the first frame
+ kMazeFlameFirstFrame, // color 1 shows the first frame
+ kMazeFlameLayer1 // color 1 shows the next pixel of the room
+};
+
+struct MazeFlame {
+ int16 x, y;
+};
+
+struct MazeRoom {
+ uint8 part;
+ int dat, txt, img, pal, msk, box;
+ int8 music; // -1: depends on the location
+ uint8 darkness;
+ uint8 flameMode;
+ uint8 numFlames;
+ MazeFlame flames[2];
+ uint8 flameFrames[2]; // frames drawn when the room starts
+ uint8 secondFlameFrame; // the frame the second flame counts as having at the start
+ bool saveLocation; // the room ends when the location changes
+ const RoomDataOffsets *offsets;
+ int giveObjectSize; // stride of the give matrix when it is not the one of the use matrix
+ RoomClickFix clickFix;
+ const MazeEntry *entries;
+ uint8 numEntries;
+ const MazeAction *actions;
+ uint8 numActions;
+ const char *objectName3;
+};
enum {
kUpdateDialogueAnimEndOfSentence = 1,
kUpdateDialogueAnimMiddleOfSentence,
@@ -352,6 +450,9 @@ private:
bool _gameStateLoaded;
GameStateData _gameState;
uint8 _mazeLocation;
+ uint8 _mazeSavedLocation;
+ const MazeRoom *_mazeRoom;
+ int _mazeFlameFrame[2];
uint32 _nextTimer;
// Speed multiplier, 1 = original timing. Divides the millisecond
@@ -428,6 +529,9 @@ private:
uint8 *_igorTempFrames;
RoomWalkBounds _roomWalkBounds;
+ RoomClickFix _roomClickFix;
+ // stride of the give matrix of the room when it differs from the use matrix (0: same)
+ int _roomGiveObjectSize;
RoomDataOffsets _roomDataOffsets;
UpdateDialogueProc _updateDialogue;
// palette indices used to draw cutscene dialogue text and its outline
@@ -971,17 +1075,22 @@ private:
void PART_37_HELPER_2();
void PART_37();
- // maze entrance
- void PART_67_EXEC_ACTION(int action);
- void PART_67_ACTION_101_goToChurch();
- void PART_67_ACTION_102_goRight();
- void PART_67_DRAW_FLAME(int frame);
- void PART_67_FLICKER();
- void PART_67_UPDATE_FLICKER();
- void PART_67_ENTER_FROM_CHURCH_PUZZLE();
- void PART_67_ENTER_FROM_RIGHT();
- void PART_67_UPDATE_ROOM_BACKGROUND();
- void PART_67();
+ // maze
+ static const MazeNode MAZE_NODES[108];
+ static const MazeRoom *getMazeRoom(int part);
+ void PART_MAZE();
+ void PART_MAZE_EXEC_ACTION(int action);
+ void PART_MAZE_UPDATE_ROOM_BACKGROUND();
+ void maybeUpdateFlicker();
+ void mazeFlicker();
+ void mazeDrawFlameFrame(int x, int y, int frame);
+ void MAZE_ENTER_WALK(const MazeEntry &entry);
+ void enterFromStairs(const MazeEntry &entry);
+ void mazeWalkToExit(const MazeAction &action);
+ void mazeExitThroughStairs(const MazeAction &action);
+ void mazeGoToNeighbor(int dir);
+ int MAZE_MUSIC_TRACK() const;
+ void setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp);
// philip vodka cutscene
@@ -1220,7 +1329,6 @@ protected:
static const RoomDataOffsets PART_35_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_36_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_37_ROOM_DATA_OFFSETS;
- static const RoomDataOffsets PART_67_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
static const uint8 _inventoryOffsetTable[];
static const uint8 _inventoryActionsTable[];
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 40adfb0a623..70f9a0354bb 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -512,7 +512,9 @@ void IgorEngine::handleRoomInput() {
int pairVerbOffset = 0;
if (_currentAction.verbType != 0) {
pairActionOffset = _roomActionsTable[_roomDataOffsets.action.object2 + _currentAction.object2Num + _currentAction.object2Type * 38] * 2;
- pairActionOffset += _roomActionsTable[_roomDataOffsets.action.object1 + _currentAction.object1Num + _currentAction.object1Type * 38] * _roomDataOffsets.action.objectSize;
+ const int objectSize = (_currentAction.verbType == 2 && _roomGiveObjectSize != 0) ?
+ _roomGiveObjectSize : _roomDataOffsets.action.objectSize;
+ pairActionOffset += _roomActionsTable[_roomDataOffsets.action.object1 + _currentAction.object1Num + _currentAction.object1Type * 38] * objectSize;
pairVerbOffset = _currentAction.verbType == 1 ? _roomDataOffsets.action.useVerb : _roomDataOffsets.action.giveVerb;
_actionCode = _roomActionsTable[pairVerbOffset + pairActionOffset];
}
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 329460003ce..25ccc467312 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -50,8 +50,9 @@ MODULE_OBJS = \
parts/part_35.o \
parts/part_36.o \
parts/part_37.o \
- parts/part_67.o \
parts/part_75.o \
+ parts/part_maze.o \
+ parts/part_maze_data.o \
parts/part_margaret.o \
text.o \
part_main.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index c6ce782e8c8..ced7b78ab58 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -672,9 +672,43 @@ void IgorEngine::PART_MAIN() {
case 370:
PART_37();
break;
+ case 510:
+ case 521:
+ case 532:
+ case 543:
+ case 550:
+ case 551:
+ case 560:
+ case 562:
+ case 570:
+ case 573:
+ case 581:
+ case 582:
+ case 591:
+ case 593:
+ case 602:
+ case 603:
+ case 610:
+ case 611:
+ case 612:
+ case 621:
+ case 622:
+ case 623:
+ case 630:
+ case 632:
+ case 633:
+ case 640:
+ case 641:
+ case 643:
+ case 650:
+ case 651:
+ case 652:
+ case 653:
+ case 660:
+ case 663:
case 670:
case 671:
- PART_67(); // maze entrance
+ PART_MAZE(); // maze, 670 and 671 are the entrance
break;
case 750:
PART_75(); // philip vodka cutscene
diff --git a/engines/igor/parts/part_67.cpp b/engines/igor/parts/part_67.cpp
deleted file mode 100644
index f454838f7be..00000000000
--- a/engines/igor/parts/part_67.cpp
+++ /dev/null
@@ -1,271 +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 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "igor/igor.h"
-
-namespace Igor {
-
-static const int kPart67FlameX = 81;
-static const int kPart67FlameY = 52;
-static const int kPart67FlameWidth = 19;
-static const int kPart67FlameHeight = 29;
-static const int kPart67FlameFrameSize = kPart67FlameWidth * kPart67FlameHeight;
-
-// The palette is darkened by this amount in the colors of the room and of Igor.
-static const int kPart67PaletteDarkness = 8;
-
-static int PART_67_FLAME_FRAME;
-
-void IgorEngine::PART_67_EXEC_ACTION(int action) {
- switch (action) {
- case 101: // go back to church
- PART_67_ACTION_101_goToChurch();
- break;
- case 102:
- PART_67_ACTION_102_goRight();
- break;
- case 103:
- ADD_DIALOGUE_TEXT(211, 2, 1155);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- break;
- case 104:
- ADD_DIALOGUE_TEXT(201, 2, 1149);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- break;
- default:
- error("PART_67_EXEC_ACTION unhandled action %d", action);
- break;
- }
-}
-
-/**
- * Igor walks back to where he came from and the church puzzle room is entered again.
- */
-void IgorEngine::PART_67_ACTION_101_goToChurch() {
- --_walkDataLastIndex;
- _roomObjectAreasTable[_screenLayer2[29594]].area = 1;
- buildWalkPathSimple(154, 106, 154, 92);
- _walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_67_UPDATE_FLICKER);
- _currentPart = 142;
-}
-
-/**
- * Igor walks off the right edge of the picture to the next location of the park.
- */
-void IgorEngine::PART_67_ACTION_102_goRight() {
- --_walkDataLastIndex;
- _roomObjectAreasTable[_screenLayer2[41258]].area = 1;
- buildWalkPathSimple(248, 128, 298, 128);
- _walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_67_UPDATE_FLICKER);
- _mazeLocation = 0x55;
- _currentPart = 643;
-}
-
-/**
- * Draws a frame of the flame, keeping the dialogue text on screen. The empty pixels of the
- * frame show the room and the pixels with color 1 show the same pixel of the first frame.
- */
-void IgorEngine::PART_67_DRAW_FLAME(int frame) {
- const int screenOffset = kPart67FlameY * 320 + kPart67FlameX;
- const uint8 *frames = _animFramesBuffer + (frame + 1) * kPart67FlameFrameSize;
- uint8 tmp[kPart67FlameFrameSize];
- for (int y = 0; y < kPart67FlameHeight; ++y) {
- for (int x = 0; x < kPart67FlameWidth; ++x) {
- const uint8 pixel = _screenVGA[screenOffset + y * 320 + x];
- uint8 color;
- if (pixel == 0xF0 || pixel == 0xF1) {
- color = pixel;
- } else {
- color = frames[y * kPart67FlameWidth + x];
- if (color == 0) {
- color = _screenLayer1[screenOffset + y * 320 + x];
- }
- if (color == 1) {
- color = _animFramesBuffer[y * kPart67FlameWidth + x];
- }
- }
- tmp[y * kPart67FlameWidth + x] = color;
- }
- }
- for (int y = 0; y < kPart67FlameHeight; ++y) {
- memcpy(_screenVGA + screenOffset + y * 320, tmp + y * kPart67FlameWidth, kPart67FlameWidth);
- }
-}
-
-/**
- * Changes the flame to another random frame and makes the light of the room flicker: the colors
- * of the room and of Igor are set to the (darkened) palette changed by 0, -1 or -2.
- */
-void IgorEngine::PART_67_FLICKER() {
- int frame;
- do {
- frame = getRandomNumber(9);
- } while (frame == PART_67_FLAME_FRAME);
- PART_67_FLAME_FRAME = frame;
- PART_67_DRAW_FLAME(frame);
-
- int delta = 0;
- switch (getRandomNumber(2)) {
- case 0:
- delta = -2;
- break;
- case 1:
- delta = -1;
- break;
- case 2:
- delta = 0;
- break;
- }
- for (int color = 1; color <= 207; ++color) {
- if (color > 183 && color < 192) {
- continue;
- }
- for (int i = 0; i < 3; ++i) {
- const int value = _paletteBuffer[color * 3 + i] + delta;
- _currentPalette[color * 3 + i] = value < 1 ? 0 : value;
- }
- }
- setPaletteRange(1, 183);
- setPaletteRange(192, 207);
-}
-
-/**
- * The flame and the light flicker.
- */
-void IgorEngine::PART_67_UPDATE_FLICKER() {
- // the original phases 11, 35 and 59 are the ticks 8, 32 and 56
- if (compareGameTick(16, 24)) {
- PART_67_FLICKER();
- }
-}
-
-void IgorEngine::PART_67_ENTER_FROM_CHURCH_PUZZLE() {
- WalkData *wd = &_walkData[0];
- wd->setPos(154, 92, kFacingPositionFront, 0);
- wd->setDefaultScale();
- _walkDataLastIndex = 0;
- const int area = _screenLayer2[29594];
- _roomObjectAreasTable[area].area = 1;
- buildWalkPathSimple(154, 92, 154, 110);
- _roomObjectAreasTable[area].area = 0;
- _walkData[_walkDataLastIndex].frameNum = 0;
- _walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_67_UPDATE_FLICKER);
-}
-
-void IgorEngine::PART_67_ENTER_FROM_RIGHT() {
- WalkData *wd = &_walkData[0];
- wd->setPos(298, 128, kFacingPositionLeft, 0);
- wd->setDefaultScale();
- _walkDataLastIndex = 0;
- const int area = _screenLayer2[41258];
- _roomObjectAreasTable[area].area = 1;
- buildWalkPathSimple(298, 128, 240, 128);
- _roomObjectAreasTable[area].area = 0;
- _walkData[_walkDataLastIndex].frameNum = 0;
- _walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_67_UPDATE_FLICKER);
-}
-
-/**
- * The flame and the light flicker; screams are heard from time to time, only if no speech is
- * playing.
- */
-void IgorEngine::PART_67_UPDATE_ROOM_BACKGROUND() {
- PART_67_UPDATE_FLICKER();
- if (compareGameTick(0x3D) && getRandomNumber(24) == 0 && !isDialogueSpeechPlaying()) {
- switch (getRandomNumber(4)) {
- case 0:
- playSound(55, 1);
- break;
- case 1:
- playSound(56, 1);
- break;
- case 2:
- playSound(57, 1);
- break;
- case 3:
- playSound(58, 1);
- break;
- case 4:
- playSound(59, 1);
- break;
- }
- }
-}
-
-void IgorEngine::PART_67() {
- playMusic(5);
- _gameState.enableLight = 1;
- loadRoomData(PAL_MazeEntrance, IMG_MazeEntrance, BOX_MazeEntrance, MSK_MazeEntrance, TXT_MazeEntrance);
- memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
- SET_PAL_240_48_1();
- static const int anm[] = { FRM_MazeEntrance1, 0 };
- loadAnimData(anm);
- loadActionData(DAT_MazeEntrance);
- _roomDataOffsets = PART_67_ROOM_DATA_OFFSETS;
- setRoomWalkBounds(112, 0, 248, 128);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_67_EXEC_ACTION);
- _updateRoomBackground = &IgorEngine::PART_67_UPDATE_ROOM_BACKGROUND;
- memcpy(_screenVGA, _screenLayer1, 46080);
-
- // the whole room is darker than its palette
- for (int color = 1; color <= 207; ++color) {
- if (color > 183 && color < 192) {
- continue;
- }
- for (int i = 0; i < 3; ++i) {
- const int value = _paletteBuffer[color * 3 + i] - kPart67PaletteDarkness;
- _paletteBuffer[color * 3 + i] = value < 1 ? 0 : value;
- }
- }
-
- PART_67_FLAME_FRAME = 0;
- // draws first frame of flame
- PART_67_DRAW_FLAME(0);
-
- if (!restoreRoomAfterLoad()) {
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- if (_currentPart == 670) {
- PART_67_ENTER_FROM_CHURCH_PUZZLE();
- } else {
- PART_67_ENTER_FROM_RIGHT();
- }
- }
- enterPartLoop();
- while ((_currentPart == 670 || _currentPart == 671) && !_gameStateLoaded) {
- runPartLoop();
- }
- leavePartLoop();
- if (!_gameStateLoaded)
- fadeOut(624);
-}
-
-} // End of namespace Igor
diff --git a/engines/igor/parts/part_maze.cpp b/engines/igor/parts/part_maze.cpp
new file mode 100644
index 00000000000..292cc7bf0ae
--- /dev/null
+++ b/engines/igor/parts/part_maze.cpp
@@ -0,0 +1,387 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+// The rooms of the maze (parts 51 to 66) are all the same room with different pictures: a corridor with torches
+// and one to four ways out. Room data is in part_maze_data.cpp.
+
+
+static const int kMazeFlameWidth = 19;
+static const int kMazeFlameHeight = 29;
+static const int kMazeFlameFrameSize = kMazeFlameWidth * kMazeFlameHeight;
+
+// Row of the floor where Igor appears or leaves when he comes from or goes to the stairs.
+static const int kMazeStairsY = 143;
+
+/**
+ * The track depends on the location: the maze is divided in three zones.
+ */
+int IgorEngine::MAZE_MUSIC_TRACK() const {
+ uint8 location = _mazeLocation;
+ while (location > 21) {
+ location -= 21;
+ }
+ --location;
+ return location / 7 + 5;
+}
+
+/**
+ * Draws a frame [frame] of a flame at (x, y). The empty pixels of the frame show the
+ * room and the pixels with color 1 show either the first frame or the next pixel of the room.
+ */
+void IgorEngine::mazeDrawFlameFrame(int x, int y, int frame) {
+ const int screenOffset = y * 320 + x;
+ const uint8 *frames = _animFramesBuffer + (frame + 1) * kMazeFlameFrameSize;
+ uint8 tmp[kMazeFlameFrameSize];
+ for (int j = 0; j < kMazeFlameHeight; ++j) {
+ for (int i = 0; i < kMazeFlameWidth; ++i) {
+ const uint8 pixel = _screenVGA[screenOffset + j * 320 + i];
+ uint8 color;
+ if (pixel == 0xF0 || pixel == 0xF1) {
+ color = pixel;
+ } else {
+ color = frames[j * kMazeFlameWidth + i];
+ if (color == 0) {
+ color = _screenLayer1[screenOffset + j * 320 + i];
+ }
+ if (color == 1) {
+ if (_mazeRoom->flameMode == kMazeFlameLayer1) {
+ color = _screenLayer1[screenOffset + j * 320 + i + 1];
+ } else {
+ color = _animFramesBuffer[j * kMazeFlameWidth + i];
+ }
+ }
+ }
+ tmp[j * kMazeFlameWidth + i] = color;
+ }
+ }
+ for (int j = 0; j < kMazeFlameHeight; ++j) {
+ memcpy(_screenVGA + screenOffset + j * 320, tmp + j * kMazeFlameWidth, kMazeFlameWidth);
+ }
+}
+
+/**
+ * Changes the flames random frames and makes the light of the room flicker: the colors of the room and of
+ * Igor are set to the (darkened) palette changed by 0, -1 or -2.
+ */
+void IgorEngine::mazeFlicker() {
+ int frames[2] = { 0, 0 };
+ // random flame frames
+ for (int i = 0; i < _mazeRoom->numFlames; ++i) {
+ int frame;
+ do {
+ frame = getRandomNumber(9);
+ } while (frame == _mazeFlameFrame[i]);
+ _mazeFlameFrame[i] = frame;
+ frames[i] = frame;
+ }
+ for (int i = 0; i < _mazeRoom->numFlames; ++i) {
+ mazeDrawFlameFrame(_mazeRoom->flames[i].x, _mazeRoom->flames[i].y, frames[i]);
+ }
+
+ // random palette delta for room flickering
+ int delta = 0;
+ switch (getRandomNumber(2)) {
+ case 0:
+ delta = -2;
+ break;
+ case 1:
+ delta = -1;
+ break;
+ case 2:
+ delta = 0;
+ break;
+ }
+ for (int color = 1; color <= 207; ++color) {
+ if (color > 183 && color < 192) {
+ continue;
+ }
+ for (int i = 0; i < 3; ++i) {
+ const int value = _paletteBuffer[color * 3 + i] + delta;
+ _currentPalette[color * 3 + i] = value < 1 ? 0 : value;
+ }
+ }
+ setPaletteRange(1, 183);
+ setPaletteRange(192, 207);
+}
+
+
+void IgorEngine::maybeUpdateFlicker() {
+ // the original phases 11, 35 and 59 are the ticks 8, 32 and 56
+ if (compareGameTick(16, 24)) {
+ mazeFlicker();
+ }
+}
+
+/**
+ * The flames and the light flicker; spooky sounds are heard from time to time, only if no speech is playing.
+ */
+void IgorEngine::PART_MAZE_UPDATE_ROOM_BACKGROUND() {
+ if (_mazeRoom->numFlames > 0) {
+ maybeUpdateFlicker();
+ }
+ if (compareGameTick(0x3D) && getRandomNumber(24) == 0 && !isDialogueSpeechPlaying()) {
+ switch (getRandomNumber(4)) {
+ case 0:
+ playSound(55, 1);
+ break;
+ case 1:
+ playSound(56, 1);
+ break;
+ case 2:
+ playSound(57, 1);
+ break;
+ case 3:
+ playSound(58, 1);
+ break;
+ case 4:
+ playSound(59, 1);
+ break;
+ }
+ }
+}
+
+/**
+ * Igor appears at the entry and walks to its destination.
+ */
+void IgorEngine::MAZE_ENTER_WALK(const MazeEntry &entry) {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(entry.x, entry.y, entry.facing, 0);
+ wd->setDefaultScale();
+ _walkDataLastIndex = 0;
+ const int area = _screenLayer2[entry.y * 320 + entry.x];
+ _roomObjectAreasTable[area].area = 1;
+ buildWalkPathSimple(entry.x, entry.y, entry.destX, entry.destY);
+ _roomObjectAreasTable[area].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove(_mazeRoom->numFlames > 0 ? &IgorEngine::maybeUpdateFlicker : 0);
+}
+
+void IgorEngine::enterFromStairs(const MazeEntry &entry) {
+ _walkDataCurrentIndex = 0;
+ _walkCurrentFrame = 1;
+ WalkData *wd = &_walkData[0];
+ for (int i = 0; i < 10;) {
+ if (compareGameTick(1, 16)) {
+ wd->x = entry.x;
+ wd->y = kMazeStairsY;
+ wd->posNum = kFacingPositionBack;
+ if (i == 9) {
+ _walkCurrentFrame = 0;
+ }
+ wd->frameNum = _walkCurrentFrame;
+ WalkData::setNextFrame(wd->posNum, _walkCurrentFrame);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 30;
+ wd->scaleWidth = 23 + i * 2;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 3;
+ wd->scaleHeight = 50;
+ moveIgor(wd->posNum, wd->frameNum);
+ ++i;
+ }
+ if (_mazeRoom->numFlames > 0) {
+ maybeUpdateFlicker();
+ }
+ waitForTimer();
+ }
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+}
+
+/**
+ * Igor walks to the exit and the maze moves to the neighbour location.
+ */
+void IgorEngine::mazeWalkToExit(const MazeAction &action) {
+ --_walkDataLastIndex;
+ _roomObjectAreasTable[_screenLayer2[action.y2 * 320 + action.x2]].area = 1;
+ buildWalkPathSimple(action.x1, action.y1, action.x2, action.y2);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove(_mazeRoom->numFlames > 0 ? &IgorEngine::maybeUpdateFlicker : 0);
+}
+
+void IgorEngine::mazeExitThroughStairs(const MazeAction &action) {
+ if (_walkCurrentFrame > 6) {
+ _walkCurrentFrame = 1;
+ }
+ _walkDataCurrentIndex = 0;
+ WalkData *wd = &_walkData[0];
+ for (int i = 10; i > 0;) {
+ if (compareGameTick(1, 16)) {
+ wd->x = action.stairsX;
+ wd->y = kMazeStairsY;
+ wd->posNum = kFacingPositionFront;
+ wd->frameNum = _walkCurrentFrame;
+ WalkData::setNextFrame(wd->posNum, _walkCurrentFrame);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 30;
+ wd->scaleWidth = 23 + (i - 1) * 2;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 3;
+ wd->scaleHeight = 50;
+ moveIgor(wd->posNum, wd->frameNum);
+ --i;
+ }
+ if (_mazeRoom->numFlames > 0) {
+ maybeUpdateFlicker();
+ }
+ waitForTimer();
+ }
+}
+
+/**
+ * Moves to the location next to the current one. The state is the shape of the new room and the side of it Igor
+ * comes in from: the opposite of the side he left.
+ */
+void IgorEngine::mazeGoToNeighbor(int dir) {
+ _mazeLocation = MAZE_NODES[_mazeLocation].neighbors[dir];
+ _currentPart = MAZE_NODES[_mazeLocation].shape * 10 + 500 + (dir + 2) % 4;
+}
+
+void IgorEngine::PART_MAZE_EXEC_ACTION(int action) {
+ for (int i = 0; i < _mazeRoom->numActions; ++i) {
+ const MazeAction &a = _mazeRoom->actions[i];
+ if (a.code != action) {
+ continue;
+ }
+ switch (a.kind) {
+ case kMazeActionExit:
+ mazeWalkToExit(a);
+ mazeGoToNeighbor(a.dir);
+ break;
+ case kMazeActionStairsExit:
+ mazeExitThroughStairs(a);
+ mazeGoToNeighbor(a.dir);
+ break;
+ case kMazeActionExitFixed:
+ mazeWalkToExit(a);
+ if (a.location >= 0) {
+ _mazeLocation = a.location;
+ }
+ _currentPart = a.state;
+ if (a.objectState >= 0) {
+ _objectsState[a.objectState] = a.objectStateValue;
+ }
+ break;
+ case kMazeActionDialogue:
+ for (int j = 0; j < a.numLines; ++j) {
+ ADD_DIALOGUE_TEXT(a.lines[j].text, a.lines[j].count, a.lines[j].sound);
+ }
+ SET_DIALOGUE_TEXT(a.dialogueStart, a.dialogueCount);
+ startIgorDialogue();
+ break;
+ }
+ return;
+ }
+ error("PART_MAZE_EXEC_ACTION unhandled action %d", action);
+}
+
+void IgorEngine::PART_MAZE() {
+ const MazeRoom *room = getMazeRoom(getPart());
+ assert(room);
+ _mazeRoom = room;
+
+ playMusic(room->music >= 0 ? room->music : MAZE_MUSIC_TRACK());
+ _gameState.enableLight = 1;
+ if (room->saveLocation) {
+ _mazeSavedLocation = _mazeLocation;
+ }
+ loadRoomData(room->pal, room->img, room->box, room->msk, room->txt);
+ memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
+ SET_PAL_240_48_1();
+ static const int anm[] = { FRM_MazeEntrance1, 0 };
+ loadAnimData(anm);
+ loadActionData(room->dat);
+ _roomDataOffsets = *room->offsets;
+ _roomGiveObjectSize = room->giveObjectSize;
+ setRoomClickFix(room->clickFix.yMax, room->clickFix.xMin, room->clickFix.xMax, room->clickFix.scanUp);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_MAZE_EXEC_ACTION);
+ _updateRoomBackground = &IgorEngine::PART_MAZE_UPDATE_ROOM_BACKGROUND;
+ if (room->objectName3) {
+ Common::strlcpy(_roomObjectNames[3], room->objectName3, sizeof(_roomObjectNames[3]));
+ }
+ memcpy(_screenVGA, _screenLayer1, 46080);
+
+ // the whole room is darker than its palette
+ for (int color = 1; color <= 207; ++color) {
+ if (color > 183 && color < 192) {
+ continue;
+ }
+ for (int i = 0; i < 3; ++i) {
+ const int value = _paletteBuffer[color * 3 + i] - room->darkness;
+ _paletteBuffer[color * 3 + i] = value < 1 ? 0 : value;
+ }
+ }
+
+ // draws the first frames of the flames
+ for (int i = 0; i < room->numFlames; ++i) {
+ mazeDrawFlameFrame(room->flames[i].x, room->flames[i].y, room->flameFrames[i]);
+ }
+ _mazeFlameFrame[0] = 0;
+ _mazeFlameFrame[1] = room->secondFlameFrame;
+
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ for (int i = 0; i < room->numEntries; ++i) {
+ const MazeEntry &entry = room->entries[i];
+ if (entry.state == _currentPart) {
+ if (entry.kind == kMazeEntryWalk) {
+ MAZE_ENTER_WALK(entry);
+ } else {
+ enterFromStairs(entry);
+ }
+ }
+ }
+ }
+ enterPartLoop();
+ for (;;) {
+ bool inRoom = false;
+ for (int i = 0; i < room->numEntries; ++i) {
+ inRoom |= room->entries[i].state == _currentPart;
+ }
+ if (!inRoom || _gameStateLoaded || (room->saveLocation && _mazeLocation != _mazeSavedLocation)) {
+ break;
+ }
+ if (_inputVars[kInputEscape] && !_eventQuitGame) {
+ // leaves the maze
+ _inputVars[kInputEscape] = 0;
+ _currentPart = (_objectsState[70] == 1 && _objectsState[71] == 0) ? 500 : 142;
+ break;
+ }
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_maze_data.cpp b/engines/igor/parts/part_maze_data.cpp
new file mode 100644
index 00000000000..e8e1e7010bf
--- /dev/null
+++ b/engines/igor/parts/part_maze_data.cpp
@@ -0,0 +1,543 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+// Generated by tools/gen_maze_data.py from the disassembly of the maze rooms. Do not edit.
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+#define MAZE_EXIT(code, x1, y1, x2, y2, dir) { code, kMazeActionExit, x1, y1, x2, y2, dir, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+#define MAZE_STAIRS_EXIT(code, x, dir) { code, kMazeActionStairsExit, 0, 0, 0, 0, dir, x, 0, 0, 0, 0, 0, 0, 0, 0 }
+#define MAZE_EXIT_FIXED(code, x1, y1, x2, y2, location, state, objectState, objectStateValue) { code, kMazeActionExitFixed, x1, y1, x2, y2, 0, 0, location, state, objectState, objectStateValue, 0, 0, 0, 0 }
+#define MAZE_DIALOGUE(code, lines, count, start, shown) { code, kMazeActionDialogue, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, lines, count, start, shown }
+
+// The maze is a grid of locations. For each one: the locations to the north, east, south and west (0: none)
+// and the shape of the room that shows it (the part is 50 + shape).
+const MazeNode IgorEngine::MAZE_NODES[108] = {
+ { { 0, 0, 0, 0 }, 0 }, // 0
+ { { 0, 2, 22, 0 }, 8 }, // 1
+ { { 0, 3, 0, 1 }, 9 }, // 2
+ { { 0, 4, 0, 2 }, 9 }, // 3
+ { { 0, 0, 25, 3 }, 10 }, // 4
+ { { 0, 0, 26, 0 }, 3 }, // 5
+ { { 0, 7, 27, 0 }, 8 }, // 6
+ { { 0, 0, 28, 6 }, 10 }, // 7
+ { { 0, 9, 0, 0 }, 2 }, // 8
+ { { 0, 0, 30, 8 }, 10 }, // 9
+ { { 0, 11, 0, 0 }, 2 }, // 10
+ { { 0, 0, 32, 10 }, 10 }, // 11
+ { { 0, 13, 33, 0 }, 8 }, // 12
+ { { 0, 14, 34, 12 }, 12 }, // 13
+ { { 0, 15, 0, 13 }, 9 }, // 14
+ { { 0, 16, 36, 14 }, 12 }, // 15
+ { { 0, 17, 0, 15 }, 9 }, // 16
+ { { 0, 0, 38, 16 }, 10 }, // 17
+ { { 0, 0, 39, 0 }, 3 }, // 18
+ { { 0, 20, 40, 0 }, 8 }, // 19
+ { { 0, 21, 41, 19 }, 12 }, // 20
+ { { 0, 0, 42, 20 }, 10 }, // 21
+ { { 1, 23, 43, 0 }, 11 }, // 22
+ { { 0, 24, 0, 22 }, 9 }, // 23
+ { { 0, 0, 0, 23 }, 4 }, // 24
+ { { 4, 26, 46, 0 }, 11 }, // 25
+ { { 5, 0, 47, 25 }, 13 }, // 26
+ { { 6, 28, 48, 0 }, 11 }, // 27
+ { { 7, 29, 49, 27 }, 15 }, // 28
+ { { 0, 30, 0, 28 }, 9 }, // 29
+ { { 9, 0, 51, 29 }, 13 }, // 30
+ { { 0, 32, 0, 0 }, 2 }, // 31
+ { { 11, 33, 0, 31 }, 14 }, // 32
+ { { 12, 0, 54, 32 }, 13 }, // 33
+ { { 13, 35, 55, 0 }, 11 }, // 34
+ { { 0, 0, 56, 34 }, 10 }, // 35
+ { { 15, 0, 57, 0 }, 6 }, // 36
+ { { 0, 38, 58, 0 }, 8 }, // 37
+ { { 17, 39, 59, 37 }, 15 }, // 38
+ { { 18, 0, 60, 38 }, 13 }, // 39
+ { { 19, 0, 61, 0 }, 6 }, // 40
+ { { 20, 0, 62, 0 }, 6 }, // 41
+ { { 21, 0, 63, 0 }, 6 }, // 42
+ { { 22, 44, 0, 0 }, 5 }, // 43
+ { { 0, 45, 0, 43 }, 9 }, // 44
+ { { 0, 0, 66, 44 }, 10 }, // 45
+ { { 25, 0, 67, 0 }, 6 }, // 46
+ { { 26, 0, 68, 0 }, 6 }, // 47
+ { { 27, 0, 69, 0 }, 6 }, // 48
+ { { 28, 0, 70, 0 }, 6 }, // 49
+ { { 0, 51, 0, 0 }, 2 }, // 50
+ { { 30, 0, 72, 50 }, 13 }, // 51
+ { { 0, 53, 73, 0 }, 8 }, // 52
+ { { 0, 0, 0, 52 }, 4 }, // 53
+ { { 33, 0, 75, 0 }, 6 }, // 54
+ { { 34, 0, 0, 0 }, 1 }, // 55
+ { { 35, 0, 0, 0 }, 1 }, // 56
+ { { 36, 0, 0, 0 }, 1 }, // 57
+ { { 37, 59, 79, 0 }, 11 }, // 58
+ { { 38, 0, 80, 58 }, 13 }, // 59
+ { { 39, 0, 81, 0 }, 6 }, // 60
+ { { 40, 0, 82, 0 }, 6 }, // 61
+ { { 41, 0, 83, 0 }, 6 }, // 62
+ { { 42, 0, 84, 0 }, 6 }, // 63
+ { { 0, 65, 85, 0 }, 8 }, // 64
+ { { 0, 66, 0, 64 }, 9 }, // 65
+ { { 45, 0, 87, 65 }, 13 }, // 66
+ { { 46, 68, 88, 0 }, 11 }, // 67
+ { { 47, 0, 89, 67 }, 13 }, // 68
+ { { 48, 0, 90, 0 }, 6 }, // 69
+ { { 49, 71, 91, 0 }, 11 }, // 70
+ { { 0, 72, 0, 70 }, 9 }, // 71
+ { { 51, 0, 0, 71 }, 7 }, // 72
+ { { 52, 74, 94, 0 }, 11 }, // 73
+ { { 0, 0, 0, 73 }, 4 }, // 74
+ { { 54, 76, 96, 0 }, 11 }, // 75
+ { { 0, 77, 97, 75 }, 12 }, // 76
+ { { 0, 0, 98, 76 }, 10 }, // 77
+ { { 0, 0, 99, 0 }, 3 }, // 78
+ { { 58, 0, 100, 0 }, 6 }, // 79
+ { { 59, 81, 101, 0 }, 11 }, // 80
+ { { 60, 0, 0, 80 }, 7 }, // 81
+ { { 61, 0, 103, 0 }, 6 }, // 82
+ { { 62, 0, 104, 0 }, 6 }, // 83
+ { { 63, 0, 105, 0 }, 6 }, // 84
+ { { 64, 86, 0, 107 }, 14 }, // 85
+ { { 0, 87, 0, 85 }, 9 }, // 86
+ { { 66, 0, 0, 86 }, 7 }, // 87
+ { { 67, 89, 0, 0 }, 5 }, // 88
+ { { 68, 90, 0, 88 }, 14 }, // 89
+ { { 69, 0, 0, 89 }, 7 }, // 90
+ { { 70, 92, 0, 0 }, 5 }, // 91
+ { { 0, 93, 0, 91 }, 9 }, // 92
+ { { 0, 94, 0, 92 }, 9 }, // 93
+ { { 73, 95, 0, 93 }, 14 }, // 94
+ { { 0, 96, 0, 94 }, 9 }, // 95
+ { { 75, 0, 0, 95 }, 7 }, // 96
+ { { 76, 98, 0, 0 }, 5 }, // 97
+ { { 77, 0, 0, 97 }, 7 }, // 98
+ { { 78, 100, 0, 0 }, 5 }, // 99
+ { { 79, 0, 0, 99 }, 7 }, // 100
+ { { 80, 102, 0, 0 }, 5 }, // 101
+ { { 0, 103, 0, 101 }, 9 }, // 102
+ { { 82, 0, 0, 102 }, 7 }, // 103
+ { { 83, 0, 0, 0 }, 1 }, // 104
+ { { 84, 0, 106, 0 }, 6 }, // 105
+ { { 0, 0, 0, 0 }, 16 }, // 106
+ { { 0, 0, 0, 0 }, 17 } // 107
+};
+
+// parts 51, 52, 53, 54
+static const RoomDataOffsets kMazeOffsets0 = {
+ { 0, 0, 0, 0 },
+ { 0, 3 },
+ { 3, 119, 2855, 7, 83, 76 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+// parts 55, 56, 57, 58, 67
+static const RoomDataOffsets kMazeOffsets1 = {
+ { 0, 0, 0, 0 },
+ { 1, 6 },
+ { 7, 143, 2879, 31, 107, 76 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+// parts 59, 60
+static const RoomDataOffsets kMazeOffsets2 = {
+ { 0, 0, 0, 0 },
+ { 1, 6 },
+ { 7, 139, 3019, 31, 107, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+// parts 61, 62, 63, 64, 66
+static const RoomDataOffsets kMazeOffsets3 = {
+ { 0, 0, 0, 0 },
+ { 2, 9 },
+ { 11, 163, 3043, 55, 131, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+// parts 65
+static const RoomDataOffsets kMazeOffsets4 = {
+ { 0, 0, 0, 0 },
+ { 3, 12 },
+ { 15, 187, 3067, 79, 155, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+static const MazeEntry kMaze51Entries[] = {
+ { 510, kMazeEntryWalk, 163, 92, kFacingPositionFront, 163, 110 },
+};
+
+static const MazeDialogueLine kMaze51Lines102[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze51Actions[] = {
+ MAZE_EXIT(101, 163, 107, 163, 92, 0),
+ MAZE_DIALOGUE(102, kMaze51Lines102, 1, 1, 1),
+};
+
+static const MazeEntry kMaze52Entries[] = {
+ { 521, kMazeEntryWalk, 298, 128, kFacingPositionLeft, 240, 128 },
+};
+
+static const MazeDialogueLine kMaze52Lines102[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze52Actions[] = {
+ MAZE_EXIT(101, 248, 128, 298, 128, 1),
+ MAZE_DIALOGUE(102, kMaze52Lines102, 1, 1, 1),
+};
+
+static const MazeEntry kMaze53Entries[] = {
+ { 532, kMazeEntryStairs, 150, 0, 0, 0, 0 },
+};
+
+static const MazeDialogueLine kMaze53Lines102[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze53Actions[] = {
+ MAZE_STAIRS_EXIT(101, 150, 2),
+ MAZE_DIALOGUE(102, kMaze53Lines102, 1, 1, 1),
+};
+
+static const MazeEntry kMaze54Entries[] = {
+ { 543, kMazeEntryWalk, 16, 109, kFacingPositionRight, 50, 109 },
+};
+
+static const MazeDialogueLine kMaze54Lines102[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze54Actions[] = {
+ MAZE_EXIT(101, 50, 109, 16, 109, 3),
+ MAZE_DIALOGUE(102, kMaze54Lines102, 1, 1, 1),
+};
+
+static const MazeEntry kMaze55Entries[] = {
+ { 550, kMazeEntryWalk, 154, 92, kFacingPositionFront, 154, 110 },
+ { 551, kMazeEntryWalk, 298, 128, kFacingPositionLeft, 240, 128 },
+};
+
+static const MazeDialogueLine kMaze55Lines103[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze55Actions[] = {
+ MAZE_EXIT(101, 154, 106, 154, 92, 0),
+ MAZE_EXIT(102, 248, 128, 298, 128, 1),
+ MAZE_DIALOGUE(103, kMaze55Lines103, 1, 1, 1),
+};
+
+static const MazeEntry kMaze56Entries[] = {
+ { 560, kMazeEntryWalk, 154, 92, kFacingPositionFront, 154, 110 },
+ { 562, kMazeEntryStairs, 154, 0, 0, 0, 0 },
+};
+
+static const MazeDialogueLine kMaze56Lines103[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze56Actions[] = {
+ MAZE_EXIT(101, 154, 106, 154, 92, 0),
+ MAZE_STAIRS_EXIT(102, 154, 2),
+ MAZE_DIALOGUE(103, kMaze56Lines103, 1, 1, 1),
+};
+
+static const MazeEntry kMaze57Entries[] = {
+ { 570, kMazeEntryWalk, 209, 80, kFacingPositionFront, 209, 104 },
+ { 573, kMazeEntryWalk, 16, 109, kFacingPositionRight, 60, 109 },
+};
+
+static const MazeDialogueLine kMaze57Lines103[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze57Actions[] = {
+ MAZE_EXIT(101, 209, 94, 209, 80, 0),
+ MAZE_EXIT(102, 50, 109, 16, 109, 3),
+ MAZE_DIALOGUE(103, kMaze57Lines103, 1, 1, 1),
+};
+
+static const MazeEntry kMaze58Entries[] = {
+ { 581, kMazeEntryWalk, 298, 128, kFacingPositionLeft, 240, 128 },
+ { 582, kMazeEntryStairs, 160, 0, 0, 0, 0 },
+};
+
+static const MazeDialogueLine kMaze58Lines103[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze58Actions[] = {
+ MAZE_EXIT(101, 248, 128, 298, 128, 1),
+ MAZE_STAIRS_EXIT(102, 160, 2),
+ MAZE_DIALOGUE(103, kMaze58Lines103, 1, 1, 1),
+};
+
+static const MazeEntry kMaze59Entries[] = {
+ { 591, kMazeEntryWalk, 313, 109, kFacingPositionLeft, 259, 109 },
+ { 593, kMazeEntryWalk, 16, 109, kFacingPositionRight, 60, 109 },
+};
+
+static const MazeDialogueLine kMaze59Lines103[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze59Actions[] = {
+ MAZE_EXIT(101, 269, 109, 313, 109, 1),
+ MAZE_EXIT(102, 50, 109, 16, 109, 3),
+ MAZE_DIALOGUE(103, kMaze59Lines103, 1, 1, 1),
+};
+
+static const MazeEntry kMaze60Entries[] = {
+ { 602, kMazeEntryStairs, 160, 0, 0, 0, 0 },
+ { 603, kMazeEntryWalk, 16, 109, kFacingPositionRight, 60, 109 },
+};
+
+static const MazeDialogueLine kMaze60Lines103[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze60Actions[] = {
+ MAZE_STAIRS_EXIT(101, 160, 2),
+ MAZE_EXIT(102, 50, 109, 16, 109, 3),
+ MAZE_DIALOGUE(103, kMaze60Lines103, 1, 1, 1),
+};
+
+static const MazeEntry kMaze61Entries[] = {
+ { 610, kMazeEntryWalk, 209, 80, kFacingPositionFront, 209, 104 },
+ { 611, kMazeEntryWalk, 313, 108, kFacingPositionLeft, 243, 108 },
+ { 612, kMazeEntryStairs, 160, 0, 0, 0, 0 },
+};
+
+static const MazeDialogueLine kMaze61Lines104[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze61Actions[] = {
+ MAZE_EXIT(101, 209, 94, 209, 80, 0),
+ MAZE_EXIT(102, 253, 108, 313, 108, 1),
+ MAZE_STAIRS_EXIT(103, 160, 2),
+ MAZE_DIALOGUE(104, kMaze61Lines104, 1, 1, 1),
+};
+
+static const MazeEntry kMaze62Entries[] = {
+ { 621, kMazeEntryWalk, 313, 109, kFacingPositionLeft, 259, 109 },
+ { 622, kMazeEntryStairs, 160, 0, 0, 0, 0 },
+ { 623, kMazeEntryWalk, 16, 109, kFacingPositionRight, 60, 109 },
+};
+
+static const MazeDialogueLine kMaze62Lines104[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze62Actions[] = {
+ MAZE_EXIT(101, 269, 109, 313, 109, 1),
+ MAZE_STAIRS_EXIT(102, 160, 2),
+ MAZE_EXIT(103, 50, 109, 16, 109, 3),
+ MAZE_DIALOGUE(104, kMaze62Lines104, 1, 1, 1),
+};
+
+static const MazeEntry kMaze63Entries[] = {
+ { 630, kMazeEntryWalk, 164, 92, kFacingPositionFront, 164, 110 },
+ { 632, kMazeEntryStairs, 164, 0, 0, 0, 0 },
+ { 633, kMazeEntryWalk, 16, 128, kFacingPositionRight, 81, 128 },
+};
+
+static const MazeDialogueLine kMaze63Lines104[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze63Actions[] = {
+ MAZE_EXIT(101, 164, 106, 164, 92, 0),
+ MAZE_STAIRS_EXIT(102, 164, 2),
+ MAZE_EXIT(103, 71, 128, 16, 128, 3),
+ MAZE_DIALOGUE(104, kMaze63Lines104, 1, 1, 1),
+};
+
+static const MazeEntry kMaze64Entries[] = {
+ { 640, kMazeEntryWalk, 214, 92, kFacingPositionFront, 214, 110 },
+ { 641, kMazeEntryWalk, 313, 128, kFacingPositionLeft, 279, 128 },
+ { 643, kMazeEntryWalk, 16, 128, kFacingPositionRight, 135, 128 },
+};
+
+static const MazeDialogueLine kMaze64Lines104[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze64Actions[] = {
+ MAZE_EXIT(101, 214, 106, 214, 92, 0),
+ MAZE_EXIT(102, 289, 128, 313, 128, 1),
+ MAZE_EXIT(103, 125, 128, 16, 128, 3),
+ MAZE_DIALOGUE(104, kMaze64Lines104, 1, 1, 1),
+};
+
+static const MazeEntry kMaze65Entries[] = {
+ { 650, kMazeEntryWalk, 105, 92, kFacingPositionFront, 105, 110 },
+ { 651, kMazeEntryWalk, 240, 128, kFacingPositionLeft, 180, 128 },
+ { 652, kMazeEntryStairs, 105, 0, 0, 0, 0 },
+ { 653, kMazeEntryWalk, 16, 127, kFacingPositionRight, 48, 127 },
+};
+
+static const MazeDialogueLine kMaze65Lines105[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze65Actions[] = {
+ MAZE_EXIT(101, 105, 106, 105, 92, 0),
+ MAZE_EXIT(102, 190, 128, 240, 128, 1),
+ MAZE_STAIRS_EXIT(103, 105, 2),
+ MAZE_EXIT(104, 38, 127, 16, 127, 3),
+ MAZE_DIALOGUE(105, kMaze65Lines105, 1, 1, 1),
+};
+
+static const MazeEntry kMaze66Entries[] = {
+ { 660, kMazeEntryWalk, 164, 92, kFacingPositionFront, 164, 110 },
+ { 663, kMazeEntryWalk, 16, 128, kFacingPositionRight, 81, 128 },
+};
+
+static const MazeDialogueLine kMaze66Lines103[] = {
+ { 201, 2, 1149 },
+};
+static const MazeDialogueLine kMaze66Lines104[] = {
+ { 203, 1, 1150 },
+};
+static const MazeDialogueLine kMaze66Lines105[] = {
+ { 204, 2, 1151 },
+ { 206, 2, 1152 },
+ { 208, 1, 1153 },
+};
+static const MazeDialogueLine kMaze66Lines106[] = {
+ { 209, 2, 1154 },
+};
+static const MazeAction kMaze66Actions[] = {
+ MAZE_EXIT_FIXED(101, 164, 106, 164, 92, 105, 562, -1, 0),
+ MAZE_EXIT_FIXED(102, 71, 128, 16, 128, -1, 500, 70, 1),
+ MAZE_DIALOGUE(103, kMaze66Lines103, 1, 1, 1),
+ MAZE_DIALOGUE(104, kMaze66Lines104, 1, 1, 1),
+ MAZE_DIALOGUE(105, kMaze66Lines105, 3, 3, 1),
+ MAZE_DIALOGUE(106, kMaze66Lines106, 1, 1, 1),
+};
+
+static const MazeEntry kMaze67Entries[] = {
+ { 670, kMazeEntryWalk, 154, 92, kFacingPositionFront, 154, 110 },
+ { 671, kMazeEntryWalk, 298, 128, kFacingPositionLeft, 240, 128 },
+};
+
+static const MazeDialogueLine kMaze67Lines103[] = {
+ { 211, 2, 1155 },
+};
+static const MazeDialogueLine kMaze67Lines104[] = {
+ { 201, 2, 1149 },
+};
+static const MazeAction kMaze67Actions[] = {
+ MAZE_EXIT_FIXED(101, 154, 106, 154, 92, -1, 142, -1, 0),
+ MAZE_EXIT_FIXED(102, 248, 128, 298, 128, 85, 643, -1, 0),
+ MAZE_DIALOGUE(103, kMaze67Lines103, 1, 1, 1),
+ MAZE_DIALOGUE(104, kMaze67Lines104, 1, 1, 1),
+};
+
+static const MazeRoom kMazeRooms[] = {
+ { 51, DAT_Maze51, TXT_Maze51, IMG_Maze51, PAL_Maze51, MSK_Maze51, BOX_Maze51, -1, 5, kMazeFlameFirstFrame, 2,
+ { { 217, 53 }, { 84, 52 } }, { 0, 4 }, 4,
+ false, &kMazeOffsets0, 0,
+ { 128, 119, 202, true, false },
+ kMaze51Entries, 1, kMaze51Actions, 2, 0 },
+ { 52, DAT_Maze52, TXT_Maze52, IMG_Maze52, PAL_Maze52, MSK_Maze52, BOX_Maze52, -1, 5, kMazeFlameLayer1, 2,
+ { { 81, 63 }, { 37, 71 } }, { 0, 4 }, 4,
+ false, &kMazeOffsets0, 0,
+ { 128, 125, 248, true, false },
+ kMaze52Entries, 1, kMaze52Actions, 2, 0 },
+ { 53, DAT_Maze53, TXT_Maze53, IMG_Maze53, PAL_Maze53, MSK_Maze53, BOX_Maze53, -1, 8, kMazeFlameLayer1, 1,
+ { { 217, 52 } }, { 0 }, 0,
+ false, &kMazeOffsets0, 0,
+ { 143, 64, 223, false, false },
+ kMaze53Entries, 1, kMaze53Actions, 2, 0 },
+ { 54, DAT_Maze54, TXT_Maze54, IMG_Maze54, PAL_Maze54, MSK_Maze54, BOX_Maze54, -1, 13, kMazeFlameLayer1, 1,
+ { { 288, 38 } }, { 0 }, 0,
+ false, &kMazeOffsets0, 0,
+ { 128, 20, 274, true, false },
+ kMaze54Entries, 1, kMaze54Actions, 2, 0 },
+ { 55, DAT_Maze55, TXT_MazeEntrance, IMG_MazeEntrance, PAL_MazeEntrance, MSK_MazeEntrance, BOX_MazeEntrance, -1, 8, kMazeFlameFixed, 1,
+ { { 81, 52 } }, { 0 }, 0,
+ false, &kMazeOffsets1, 0,
+ { 128, 112, 248, true, false },
+ kMaze55Entries, 2, kMaze55Actions, 3, 0 },
+ { 56, DAT_Maze56, TXT_Maze56, IMG_Maze56, PAL_Maze56, MSK_Maze56, BOX_Maze56, -1, 8, kMazeFlameLayer1, 1,
+ { { 83, 52 } }, { 0 }, 0,
+ true, &kMazeOffsets1, 0,
+ { 143, 95, 249, false, false },
+ kMaze56Entries, 2, kMaze56Actions, 3, 0 },
+ { 57, DAT_Maze57, TXT_Maze57, IMG_Maze57, PAL_Maze57, MSK_Maze57, BOX_Maze57, -1, 8, kMazeFlameLayer1, 2,
+ { { 113, 13 }, { 157, 12 } }, { 0, 4 }, 0,
+ false, &kMazeOffsets1, 0,
+ { 128, 22, 283, true, false },
+ kMaze57Entries, 2, kMaze57Actions, 3, 0 },
+ { 58, DAT_Maze58, TXT_Maze58, IMG_Maze58, PAL_Maze58, MSK_Maze58, BOX_Maze58, -1, 8, kMazeFlameLayer1, 1,
+ { { 83, 53 } }, { 0 }, 0,
+ false, &kMazeOffsets1, 0,
+ { 143, 97, 248, false, false },
+ kMaze58Entries, 2, kMaze58Actions, 3, 0 },
+ { 59, DAT_Maze59, TXT_Maze59, IMG_Maze59, PAL_Maze59, MSK_Maze59, BOX_Maze59, -1, 13, kMazeFlameLayer1, 1,
+ { { 127, 22 } }, { 0 }, 0,
+ true, &kMazeOffsets2, 76,
+ { 128, 22, 304, true, false },
+ kMaze59Entries, 2, kMaze59Actions, 3, 0 },
+ { 60, DAT_Maze60, TXT_Maze60, IMG_Maze60, PAL_Maze60, MSK_Maze60, BOX_Maze60, -1, 13, kMazeFlameLayer1, 1,
+ { { 157, 13 } }, { 0 }, 0,
+ false, &kMazeOffsets2, 76,
+ { 143, -1, 299, false, false },
+ kMaze60Entries, 2, kMaze60Actions, 3, 0 },
+ { 61, DAT_Maze61, TXT_Maze61, IMG_Maze61, PAL_Maze61, MSK_Maze61, BOX_Maze61, -1, 13, kMazeFlameLayer1, 1,
+ { { 157, 12 } }, { 0 }, 0,
+ false, &kMazeOffsets3, 76,
+ { 143, 21, 291, false, false },
+ kMaze61Entries, 3, kMaze61Actions, 4, 0 },
+ { 62, DAT_Maze62, TXT_Maze62, IMG_Maze62, PAL_Maze62, MSK_Maze62, BOX_Maze62, -1, 10, kMazeFlameLayer1, 2,
+ { { 174, 23 }, { 126, 23 } }, { 0, 4 }, 4,
+ false, &kMazeOffsets3, 76,
+ { 143, -1, -1, false, false },
+ kMaze62Entries, 3, kMaze62Actions, 4, 0 },
+ { 63, DAT_Maze63, TXT_Maze63, IMG_Maze63, PAL_Maze63, MSK_Maze63, BOX_Maze63, -1, 8, kMazeFlameLayer1, 1,
+ { { 217, 52 } }, { 0 }, 0,
+ true, &kMazeOffsets3, 76,
+ { 143, 71, 222, false, false },
+ kMaze63Entries, 3, kMaze63Actions, 4, 0 },
+ { 64, DAT_Maze64, TXT_Maze64, IMG_Maze64, PAL_Maze64, MSK_Maze64, BOX_Maze64, -1, 13, kMazeFlameNone, 0,
+ { }, { }, 0,
+ false, &kMazeOffsets3, 76,
+ { 128, 125, 289, true, false },
+ kMaze64Entries, 3, kMaze64Actions, 4, 0 },
+ { 65, DAT_Maze65, TXT_Maze65, IMG_Maze65, PAL_Maze65, MSK_Maze65, BOX_Maze65, -1, 12, kMazeFlameNone, 0,
+ { }, { }, 0,
+ false, &kMazeOffsets4, 76,
+ { 143, 22, 208, false, false },
+ kMaze65Entries, 4, kMaze65Actions, 5, 0 },
+ { 66, DAT_Maze66, TXT_Maze66, IMG_Maze66, PAL_Maze66, MSK_Maze66, BOX_Maze66, 7, 8, kMazeFlameLayer1, 1,
+ { { 217, 52 } }, { 0 }, 0,
+ false, &kMazeOffsets3, 76,
+ { 143, 71, 222, false, false },
+ kMaze66Entries, 2, kMaze66Actions, 6, " esqueleto" },
+ { 67, DAT_MazeEntrance, TXT_MazeEntrance, IMG_MazeEntrance, PAL_MazeEntrance, MSK_MazeEntrance, BOX_MazeEntrance, 5, 8, kMazeFlameFixed, 1,
+ { { 81, 52 } }, { 0 }, 0,
+ false, &kMazeOffsets1, 0,
+ { 128, 112, 248, true, false },
+ kMaze67Entries, 2, kMaze67Actions, 4, 0 }
+};
+
+const MazeRoom *IgorEngine::getMazeRoom(int part) {
+ for (int i = 0; i < ARRAYSIZE(kMazeRooms); ++i) {
+ if (kMazeRooms[i].part == part) {
+ return &kMazeRooms[i];
+ }
+ }
+ return 0;
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 6ab0d101464..e713f41213d 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -457,11 +457,4 @@ const RoomDataOffsets IgorEngine::PART_37_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
-const RoomDataOffsets IgorEngine::PART_67_ROOM_DATA_OFFSETS = {
- { 0, 0, 0, 0 },
- { 1, 6 },
- { 7, 143, 2879, 31, 107, 76 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
} // End of namespace Igor
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 3f0e3ec4dcd..55ef7d1a362 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -42,6 +42,14 @@ void IgorEngine::setRoomWalkBounds(int x1, int y1, int x2, int y2,
_roomWalkBounds.x2MinY = x2MinY < 0 ? y1 : x2MinY;
}
+void IgorEngine::setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp) {
+ _roomClickFix.yMax = yMax;
+ _roomClickFix.xMin = xMin;
+ _roomClickFix.xMax = xMax;
+ _roomClickFix.scanUp = scanUp;
+ _roomClickFix.enabled = true;
+}
+
void IgorEngine::buildWalkPath(int srcX, int srcY, int dstX, int dstY) {
if (srcX != dstX || srcY != dstY) {
_walkData[0] = _walkData[_walkDataLastIndex];
@@ -1107,12 +1115,18 @@ void IgorEngine::buildWalkPathSimple(int srcX, int srcY, int dstX, int dstY) {
}
void IgorEngine::fixWalkPosition(int *x, int *y) {
- if (getPart() == 67) {
- // The click is clamped to the walk bounds, then the picture is scanned for the first
- // walkable row strictly below it (the scan starts one row down, whatever the row is) and,
- // if none is found down to the last row, upwards from the last row.
- int xPos = CLIP<int>(*x, _roomWalkBounds.x1, _roomWalkBounds.x2);
- int yPos = MIN(*y, _roomWalkBounds.y2);
+ if (_roomClickFix.enabled) {
+ // The click is clamped, then the picture is scanned for the first walkable row strictly below it (the
+ // scan starts one row down, whatever the row is) and, if none is found down to the last row and the
+ // room says so, upwards from the last row.
+ int xPos = *x;
+ if (_roomClickFix.xMax >= 0) {
+ xPos = MIN(xPos, _roomClickFix.xMax);
+ }
+ if (_roomClickFix.xMin >= 0) {
+ xPos = MAX(xPos, _roomClickFix.xMin);
+ }
+ int yPos = MIN(*y, _roomClickFix.yMax);
do {
if (yPos < 143) {
++yPos;
@@ -1121,7 +1135,7 @@ void IgorEngine::fixWalkPosition(int *x, int *y) {
break;
}
} while (yPos != 143);
- if (yPos == 143) {
+ if (_roomClickFix.scanUp && yPos == 143) {
do {
--yPos;
} while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && yPos > 0);
Commit: 5044c168fc1afc82ba324c08e4371bb09742a196
https://github.com/scummvm/scummvm/commit/5044c168fc1afc82ba324c08e4371bb09742a196
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:28+01:00
Commit Message:
IGOR: Fixes palette issue on rooms 6 and 5
Changed paths:
engines/igor/parts/part_5.cpp
engines/igor/parts/part_6.cpp
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index 2573cc20b7c..8edbffc7267 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -130,6 +130,8 @@ void IgorEngine::PART_05() {
_gameState.enableLight = 1;
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
SET_PAL_240_48_1();
+ // the room palette resource is longer than the palette the room really uses, restore the inventory colors
+ SET_PAL_208_96_1();
static const int anm2[] = {FRM_SpringRock1, FRM_SpringRock2, 0};
loadAnimData(anm2, 0x7E00);
static const int anm3[] = {FRM_SpringRock3, FRM_SpringRock4, 0};
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index 8b72cadf55d..178e6baf656 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -331,6 +331,8 @@ void IgorEngine::PART_06() {
}
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
SET_PAL_240_48_1();
+ // the room palette resource is longer than the palette the room really uses, restore the inventory colors
+ SET_PAL_208_96_1();
static const int anm2[] = {FRM_SpringRock1, FRM_SpringRock2, 0};
loadAnimData(anm2, 0x7E00);
Commit: 2a1790bac6108aa7a44255b4921b13918d6d41d6
https://github.com/scummvm/scummvm/commit/2a1790bac6108aa7a44255b4921b13918d6d41d6
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:28+01:00
Commit Message:
IGOR: ESC to skip igor walking in room 17
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_17.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 478e92dc6f4..4c8611d3812 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1161,7 +1161,7 @@ private:
void buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, int dstY);
typedef void (IgorEngine::*IgorMoveTick)();
// tick: room effect that runs on every iteration while Igor walks (rooms with their own wait loop)
- void waitForIgorMove(IgorMoveTick tick = 0);
+ bool waitForIgorMove(IgorMoveTick tick = 0, bool escapeSkips = false, bool forceSkip = false);
void moveIgor(int pos, int frame);
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 8b444a600b8..4db242a7fcb 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -144,6 +144,7 @@ void IgorEngine::PART_17_ACTION_103_talkPhilipJimmy() {
}
void IgorEngine::PART_17_ACTION_105() {
+ bool escaped = false;
_roomObjectAreasTable[5].area = 1;
_roomObjectAreasTable[10].area = 2;
_roomObjectAreasTable[11].area = 2;
@@ -157,7 +158,7 @@ void IgorEngine::PART_17_ACTION_105() {
_walkDataCurrentIndex = 1;
_walkData[_walkDataLastIndex].frameNum = 1;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
+ escaped |= waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND, true, escaped);
PART_17_HELPER_5_changeZindexOfPath(143);
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[44836]].area = 4;
@@ -168,7 +169,7 @@ void IgorEngine::PART_17_ACTION_105() {
for (int i = _walkDataCurrentIndex; i <= _walkDataLastIndex; ++i) {
_walkData[i].posNum = kFacingPositionBack;
}
- waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
+ escaped |= waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND, true, escaped);
for (int i = 17; i <= 85; ++i) {
_walkYScaleRoom[i] = ((i - 13) / 4) + 5;
}
@@ -187,7 +188,7 @@ void IgorEngine::PART_17_ACTION_105() {
_roomObjectAreasTable[_screenLayer2[36865]].area = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
+ escaped |= waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND, true, escaped);
_currentPart = 40;
}
@@ -330,6 +331,7 @@ void IgorEngine::PART_17_HELPER_1(int num) {
}
void IgorEngine::PART_17_HELPER_2_walkFromMap() {
+ bool escaped = false;
for (int i = 17; i <= 85; ++i) {
_walkYScaleRoom[i] = ((i - 13) / 4) + 5;
}
@@ -352,7 +354,7 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap() {
_roomObjectAreasTable[_screenLayer2[36865]].area = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
+ escaped |= waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND, true, escaped);
for (int i = 17; i <= 135; ++i) {
_walkYScaleRoom[i] = 50;
}
@@ -370,7 +372,7 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap() {
for (int i = _walkDataCurrentIndex; i <= _walkDataLastIndex; ++i) {
_walkData[i].posNum = kFacingPositionFront;
}
- waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
+ escaped |= waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND, true, escaped);
PART_17_HELPER_5_changeZindexOfPath(0);
--_walkDataLastIndex;
@@ -378,7 +380,7 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap() {
_walkDataCurrentIndex = 2;
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
+ escaped |= waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND, true, escaped);
_roomObjectAreasTable[5].area = 0;
_roomObjectAreasTable[10].area = 0;
_roomObjectAreasTable[11].area = 0;
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 55ef7d1a362..ba387ba489b 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1033,11 +1033,11 @@ void IgorEngine::buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, in
}
wd = &_walkData[_walkDataLastIndex];
wd->setPos(dstX, dstY, 4, _walkCurrentFrame);
- scale = _walkYScaleRoom[(_walkXScaleRoom[curX] - 1) * 144 + curY];
+ scale = _walkYScaleRoom[(_walkXScaleRoom[dstX] - 1) * 144 + dstY];
xScale = _walkWidthScaleTable[scale - 1];
wd->setScale(scale, scale);
wd->yPosChanged = 1;
- wd->dyPos = curY - dstY;
+ wd->dyPos = dstY - curY;
int x = xScale - xScale / 2 + dstX - 1;
if (x > 319) {
wd->clipSkipX = 1;
@@ -1063,8 +1063,9 @@ void IgorEngine::buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, in
}
}
-void IgorEngine::waitForIgorMove(IgorMoveTick tick) {
+bool IgorEngine::waitForIgorMove(IgorMoveTick tick, bool escapeSkips, bool forceSkip) {
_gameTicks = 0;
+ bool skipped = false;
do {
if (compareGameTick(1, 16)) {
if (_walkDataCurrentIndex > _walkDataLastIndex) {
@@ -1079,8 +1080,26 @@ void IgorEngine::waitForIgorMove(IgorMoveTick tick) {
if (tick) {
(this->*tick)();
}
+ if (escapeSkips && ((_inputVars[kInputEscape] && !_eventQuitGame) || forceSkip)) {
+ // Escape draws the remaining walk frames at once, without waiting for the timer.
+ // Once pressed, the walks that follow in the same sequence are skipped the same way.
+ _inputVars[kInputEscape] = 0;
+ skipped = true;
+ while (_gameState.igorMoving && _walkDataCurrentIndex <= _walkDataLastIndex) {
+ moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
+ ++_walkDataCurrentIndex;
+ // The original draws straight to the screen, so the walk stays visible, only faster.
+ // TODO: the exact pace depends on the original's drawing cost and is not derived.
+ waitForTimer(1);
+ }
+ _inputVars[kInputEscape] = 0;
+ _gameState.igorMoving = false;
+ _walkDataLastIndex = _walkDataCurrentIndex;
+ break;
+ }
waitForTimer();
} while (_gameState.igorMoving);
+ return skipped;
}
void IgorEngine::handleRoomIgorWalk() {
Commit: 887d13f5c199be15ecf99f295878712ee419e04e
https://github.com/scummvm/scummvm/commit/887d13f5c199be15ecf99f295878712ee419e04e
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:29+01:00
Commit Message:
IGOR: Fixes Margaret animation on cutscenes
Changed paths:
engines/igor/parts/part_margaret.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/parts/part_margaret.cpp b/engines/igor/parts/part_margaret.cpp
index 7ee975b7c00..d6e0d90159f 100644
--- a/engines/igor/parts/part_margaret.cpp
+++ b/engines/igor/parts/part_margaret.cpp
@@ -43,7 +43,7 @@ void IgorEngine::PART_MARGARET_ROOM_CUTSCENE_UPDATE_DIALOGUE_MARGARET(int action
PART_MARGARET_ROOM_CUTSCENE_HELPER_2(1);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_MARGARET_ROOM_CUTSCENE_HELPER_2(getRandomNumber(5) + 1);
+ PART_MARGARET_ROOM_CUTSCENE_HELPER_2(getRandomNumber(4) + 1);
break;
}
}
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index ba387ba489b..af6596aa15f 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -58,7 +58,9 @@ void IgorEngine::buildWalkPath(int srcX, int srcY, int dstX, int dstY) {
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) {
+ // Area 0 means the point is outside any walk area: there is no route
+ // through the area table, so walk straight to the destination
+ for (int i = 1; srcArea >= 1 && dstArea >= 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);
Commit: f2fa77b7852812b19be629cb42b2d1d205296a42
https://github.com/scummvm/scummvm/commit/f2fa77b7852812b19be629cb42b2d1d205296a42
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:29+01:00
Commit Message:
IGOR: Adds photo screen
Changed paths:
engines/igor/igor.h
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 4c8611d3812..792e6f076d8 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -598,6 +598,8 @@ private:
void moveScreenUp(int offset);
void lookAtPapyrus(bool reveal);
void EXEC_MAIN_ACTION(int action);
+ void EXEC_MAIN_ACTION_38();
+ void EXEC_MAIN_ACTION_43_lookAtPhoto();
// map
void PART_04_EXEC_ACTION(int action);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index ced7b78ab58..3d2531d60f1 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -249,7 +249,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
startIgorDialogue();
break;
case 43:
- // EXEC_MAIN_ACTION_43();
+ EXEC_MAIN_ACTION_43_lookAtPhoto();
break;
case 44:
ADD_DIALOGUE_TEXT(156, 1, 80);
@@ -428,6 +428,41 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
}
}
+void IgorEngine::EXEC_MAIN_ACTION_43_lookAtPhoto() {
+ memcpy(_paletteBuffer, _currentPalette, 624);
+ fadeOut(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);
+ fadeIn(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;
+ fadeOut(624);
+ if (tmp) {
+ memcpy(_screenVGA, tmp, 64000);
+ memcpy(_paletteBuffer, tmp + 64000, 768);
+ free(tmp);
+ }
+ fadeIn(624);
+}
+
void IgorEngine::SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p) {
switch (i) {
case 0:
Commit: ecf54a740f48f6bfbd64626246bb37716a012824
https://github.com/scummvm/scummvm/commit/ecf54a740f48f6bfbd64626246bb37716a012824
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:29+01:00
Commit Message:
IGOR: Fix slow animation in part 19
Changed paths:
engines/igor/parts/part_19.cpp
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index 3e701945678..2593f7d3f96 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -90,8 +90,8 @@ void IgorEngine::PART_19_ACTION_107() { // sub_137_02C7
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);
}
+ waitForTimer(120);
}
addObjectToInventory(12, 47);
_objectsState[58] = 1;
Commit: ba031765d155a0ccf34105e22fbad93dd0311add
https://github.com/scummvm/scummvm/commit/ba031765d155a0ccf34105e22fbad93dd0311add
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:30+01:00
Commit Message:
IGOR: Fix photo cutscene in part16
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_16.cpp
engines/igor/sound.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 792e6f076d8..082ae071109 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -796,8 +796,8 @@ private:
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_3_photoCutscene();
+ void PART_16_HELPER_5_displayPhoto();
void PART_16_HELPER_6(int frame);
void PART_16();
void loadResourceData__ROOM_Laboratory();
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index 3e6b9a17001..20230853f37 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -120,7 +120,7 @@ void IgorEngine::PART_16_HELPER_2() {
waitForIgorMove();
}
-void IgorEngine::PART_16_HELPER_3() {
+void IgorEngine::PART_16_HELPER_3_photoCutscene() {
memset(_screenVGA + 46080, 0, 17920);
ADD_DIALOGUE_TEXT(210, 1, 731);
ADD_DIALOGUE_TEXT(211, 1, 732);
@@ -222,26 +222,30 @@ void IgorEngine::PART_16_HELPER_3() {
waitForTimer(15);
}
playSound(27, 1);
- PART_16_HELPER_5();
+ PART_16_HELPER_5_displayPhoto();
for (int i = 1; i <= 3; ++i) {
waitForTimer(255);
}
PART_16_HELPER_1(255);
- addObjectToInventory(19, 54);
+ // Data-only inventory update: the panel is redrawn later together with the verbs
+ ++_inventoryInfo[73];
+ _inventoryInfo[_inventoryInfo[73] - 1] = 19;
+ _inventoryInfo[54] = _inventoryInfo[73];
+ _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
_objectsState[53] = 1;
_objectsState[65] = 3;
playMusic(3);
_currentPart = 261;
}
-void IgorEngine::PART_16_HELPER_5() {
+void IgorEngine::PART_16_HELPER_5_displayPhoto() {
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]) {
+ for (int i = 3; i <= 207 * 3 + 2; ++i) {
+ if (_paletteBuffer[i] <= m && _currentPalette[i] > _paletteBuffer[i]) {
--_currentPalette[i];
}
}
@@ -269,7 +273,7 @@ void IgorEngine::PART_16() {
fadeIn(768);
PART_16_HELPER_2();
if (_objectsState[65] == 2 && _inventoryInfo[71] != 0 && _objectsState[76] == 1) {
- PART_16_HELPER_3();
+ PART_16_HELPER_3_photoCutscene();
}
enterPartLoop();
while (_currentPart == 160) {
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index accf836a0c8..725b1ac24ea 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -39,8 +39,8 @@ void IgorEngine::playMusic(int num) {
if(_gameState.musicNum != num) {
_gameState.musicNum = num;
_gameState.musicSequenceIndex = 1;
- g_system->getAudioCDManager()->stop();
- g_system->getAudioCDManager()->play(num, -1, 0, 0);
+ // g_system->getAudioCDManager()->stop();
+ // g_system->getAudioCDManager()->play(num, -1, 0, 0);
}
}
}
Commit: 9fa96f1db278e933d0dcad2c0669ddcf820967a7
https://github.com/scummvm/scummvm/commit/9fa96f1db278e933d0dcad2c0669ddcf820967a7
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:30+01:00
Commit Message:
IGOR: Fix music in existing parts
Changed paths:
engines/igor/parts/part_0.cpp
engines/igor/parts/part_1.cpp
engines/igor/parts/part_10.cpp
engines/igor/parts/part_11.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_13.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_15.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_18.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_22.cpp
engines/igor/parts/part_23.cpp
engines/igor/parts/part_24.cpp
engines/igor/parts/part_25.cpp
engines/igor/parts/part_26.cpp
engines/igor/parts/part_27.cpp
engines/igor/parts/part_28.cpp
engines/igor/parts/part_30.cpp
engines/igor/parts/part_31.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
engines/igor/parts/part_36.cpp
engines/igor/parts/part_37.cpp
engines/igor/parts/part_4.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_7.cpp
engines/igor/parts/part_75.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_85.cpp
engines/igor/parts/part_9.cpp
engines/igor/parts/part_90.cpp
engines/igor/parts/part_margaret.cpp
engines/igor/sound.cpp
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index d0367f4e786..72f954c5dec 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -311,6 +311,7 @@ void IgorEngine::PART_00_ENTER_FROM_BELOW() {
}
void IgorEngine::PART_00() {
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_StudentDormitoryRoom);
loadRoomData(PAL_StudentDormitoryRoom, IMG_StudentDormitoryRoom, BOX_StudentDormitoryRoom, MSK_StudentDormitoryRoom, TXT_StudentDormitoryRoom);
diff --git a/engines/igor/parts/part_1.cpp b/engines/igor/parts/part_1.cpp
index 5d42f23f9f1..cf93eebecdd 100644
--- a/engines/igor/parts/part_1.cpp
+++ b/engines/igor/parts/part_1.cpp
@@ -163,6 +163,7 @@ void IgorEngine::PART_01_EXEC_ACTION(int action) {
}
void IgorEngine::PART_01() {
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_OutsideStudentDormitory);
loadRoomData(PAL_OutsideStudentDormitory, IMG_OutsideStudentDormitory, BOX_OutsideStudentDormitory, MSK_OutsideStudentDormitory, TXT_OutsideStudentDormitory);
diff --git a/engines/igor/parts/part_10.cpp b/engines/igor/parts/part_10.cpp
index d716844fa4e..208edb2dd4b 100644
--- a/engines/igor/parts/part_10.cpp
+++ b/engines/igor/parts/part_10.cpp
@@ -177,6 +177,7 @@ void IgorEngine::PART_10_ACTION_108_scrollLeft() {
}
void IgorEngine::PART_10() {
+ playMusic(1);
_gameState.enableLight = 1;
loadActionData(DAT_Decanato);
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index e20111e57a1..10c6fd3b4f4 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -214,6 +214,7 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
}
void IgorEngine::PART_11() {
+ playMusic(1);
_gameState.enableLight = 1;
loadActionData(DAT_DecanatoPart11);
loadRoomData(PAL_DecanatoRight, IMG_DecanatoRight, BOX_DecanatoRight, MSK_DecanatoRight, TXT_DecanatoRight);
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index f239212a9bd..8d178b0cb92 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -461,7 +461,6 @@ void IgorEngine::PART_12_HELPER_5() {
}
void IgorEngine::PART_12_HELPER_6() {
- playMusic(2);
PART_12_HELPER_1(255);
_walkData[0].setPos(75, 89, 2, 0);
_walkData[0].setDefaultScale();
@@ -510,6 +509,9 @@ void IgorEngine::PART_12_HELPER_10(int frame) {
}
void IgorEngine::PART_12() {
+ if (_currentPart != 122) {
+ playMusic(1);
+ }
_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 };
diff --git a/engines/igor/parts/part_13.cpp b/engines/igor/parts/part_13.cpp
index 9ada89e1ce0..5b24f42a9b7 100644
--- a/engines/igor/parts/part_13.cpp
+++ b/engines/igor/parts/part_13.cpp
@@ -178,7 +178,6 @@ void IgorEngine::PART_13_HELPER_2() {
}
void IgorEngine::PART_13_HELPER_3() {
- playMusic(4);
PART_13_HELPER_1(255);
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
@@ -205,6 +204,7 @@ void IgorEngine::PART_13_HELPER_3() {
}
void IgorEngine::PART_13() {
+ playMusic(3);
_gameState.enableLight = 1;
loadRoomData(PAL_InsideChurch, IMG_InsideChurch, BOX_InsideChurch, MSK_InsideChurch, TXT_InsideChurch);
loadActionData(DAT_InsideChurch);
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 058ee140edd..48d60f237e0 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -347,7 +347,6 @@ void IgorEngine::PART_14_HELPER_3() {
}
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) {
@@ -555,6 +554,7 @@ void IgorEngine::PART_14_PUSH_STONE(int screenOffset, int w, int h, int animOffs
}
void IgorEngine::PART_14() {
+ playMusic(3);
_gameState.enableLight = 1;
loadResourceData__ROOM_ChurchPuzzle();
loadResourceData__ANIM_ChurchPuzzle();
diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp
index fcf2016f14f..c9a2149402c 100644
--- a/engines/igor/parts/part_15.cpp
+++ b/engines/igor/parts/part_15.cpp
@@ -475,6 +475,7 @@ void IgorEngine::PART_15_HELPER_9(int frame) {
}
void IgorEngine::PART_15() {
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index 20230853f37..b937d98d150 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -153,6 +153,7 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
waitForTimer(15);
}
fadeOut(768);
+ playMusic(8);
_currentPart = 331;
PART_33();
memset(_currentPalette, 0, 768);
@@ -234,7 +235,6 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
_inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
_objectsState[53] = 1;
_objectsState[65] = 3;
- playMusic(3);
_currentPart = 261;
}
@@ -260,6 +260,7 @@ void IgorEngine::PART_16_HELPER_6(int frame) {
}
void IgorEngine::PART_16() {
+ playMusic(2);
_gameState.enableLight = 1;
loadResourceData__ROOM_Laboratory();
loadResourceData__ANIM_Laboratory();
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 4db242a7fcb..16ba71da970 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -413,7 +413,6 @@ void IgorEngine::PART_17_HELPER_5_changeZindexOfPath(int lum) {
}
void IgorEngine::PART_17_HELPER_6_walkFromCollege() {
- playMusic(2);
PART_17_HELPER_1(255);
fadeIn(768);
_walkData[0].setPos(274, 68, 4, 1);
@@ -505,6 +504,7 @@ void IgorEngine::PART_17_HELPER_11_PhillipToIgor(int frame) {
}
void IgorEngine::PART_17() {
+ playMusic(1);
_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 };
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index c7fe119a39f..7d49be0d7dc 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -171,6 +171,7 @@ void IgorEngine::PART_18_HELPER_2_walkIn() {
}
void IgorEngine::PART_18() {
+ playMusic(2);
_gameState.enableLight = 1;
loadResourceData__ROOM_MenToilets();
loadResourceData__ANIM_MenToilets();
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index 2593f7d3f96..4dff93ed8d2 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -267,6 +267,7 @@ void IgorEngine::PART_19_HELPER_7(int frame) {
}
void IgorEngine::PART_19() {
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index c4400efc7d7..f076f73185b 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -361,6 +361,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
void IgorEngine::PART_02() {
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_StudentDormitoryAttic);
loadRoomData(PAL_StudentDormitoryAttic, IMG_StudentDormitoryAttic, BOX_StudentDormitoryAttic, MSK_StudentDormitoryAttic, TXT_StudentDormitoryAttic);
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index bac541f3233..0a1c893def7 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -462,6 +462,7 @@ void IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND() {
}
void IgorEngine::PART_21() {
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp
index b9a491e6fb7..f125454761a 100644
--- a/engines/igor/parts/part_22.cpp
+++ b/engines/igor/parts/part_22.cpp
@@ -169,6 +169,7 @@ void IgorEngine::PART_22_ENTER() {
}
void IgorEngine::PART_22() {
+ playMusic(3);
_gameState.enableLight = 1;
loadRoomData(PAL_BellChurch, IMG_BellChurch, BOX_BellChurch, MSK_BellChurch, TXT_BellChurch);
SET_PAL_240_48_1();
diff --git a/engines/igor/parts/part_23.cpp b/engines/igor/parts/part_23.cpp
index 434e6d2dc37..c6698027cce 100644
--- a/engines/igor/parts/part_23.cpp
+++ b/engines/igor/parts/part_23.cpp
@@ -262,6 +262,7 @@ void IgorEngine::PART_23_HELPER_7(int frame) {
}
void IgorEngine::PART_23() {
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp
index 3388115d235..9a14dcae510 100644
--- a/engines/igor/parts/part_24.cpp
+++ b/engines/igor/parts/part_24.cpp
@@ -290,6 +290,7 @@ void IgorEngine::PART_24_HELPER_9() {
}
void IgorEngine::PART_24() {
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index b5c1208f2db..454fe2007f3 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -199,6 +199,7 @@ void IgorEngine::PART_25_HELPER_7() {
}
void IgorEngine::PART_25() {
+ playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeCorridorAnnouncementBoard, IMG_CollegeCorridorAnnouncementBoard, BOX_CollegeCorridorAnnouncementBoard, MSK_CollegeCorridorAnnouncementBoard, TXT_CollegeCorridorAnnouncementBoard);
static const int anm[] = { FRM_CollegeCorridorAnnouncementBoard1, FRM_CollegeCorridorAnnouncementBoard2, 0 };
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index 9b63141217a..45eb2d9e975 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -247,6 +247,7 @@ void IgorEngine::PART_26_HELPER_7(int frame) {
}
void IgorEngine::PART_26() {
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index 789c56051dd..032626e418e 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -255,6 +255,7 @@ void IgorEngine::PART_27_HELPER_5() {
}
void IgorEngine::PART_27() {
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index 77a350c0ce3..d93b9fb4a01 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -321,6 +321,7 @@ void IgorEngine::PART_28_HELPER_8(int frame) {
}
void IgorEngine::PART_28() {
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index 0b6cd60efed..a7469ac9122 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -197,7 +197,6 @@ void IgorEngine::PART_30_HELPER_5_walkInFromRight() {
}
void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
- playMusic(3);
memset(_screenVGA + 46080, 0, 17920);
fadeIn(768);
lauraAndIgorBumpIntoEachOther();
@@ -289,6 +288,7 @@ void IgorEngine::PART_30_HELPER_9_setLauraFrame(int frame) {
}
void IgorEngine::PART_30() {
+ playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeStairsFirstFloor, IMG_CollegeStairsFirstFloor, BOX_CollegeStairsFirstFloor, MSK_CollegeStairsFirstFloor, TXT_CollegeStairsFirstFloor);
static const int anm[] = { FRM_CollegeStairsFirstFloor1, FRM_CollegeStairsFirstFloor2, 0 };
@@ -312,7 +312,6 @@ void IgorEngine::PART_30() {
} else if (_currentPart == 301) {
PART_30_HELPER_3_walkInFromUpstairs();
} else if (_currentPart == 302) {
- playMusic(3);
fadeIn(768);
PART_30_HELPER_2_walkInFromOutside();
} else if (_currentPart == 303) {
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index bc2786de7c0..4b5e8c24f31 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -400,6 +400,7 @@ void IgorEngine::PART_31_HELPER_9() {
}
void IgorEngine::PART_31() {
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index 7fe389e0d81..60d9656a4c6 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -343,7 +343,6 @@ void IgorEngine::PART_33_HELPER_1(int num) {
}
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);
@@ -454,6 +453,9 @@ void IgorEngine::PART_33_HELPER_9() {
}
void IgorEngine::PART_33() {
+ if (_currentPart != 331) {
+ playMusic(2);
+ }
_gameState.enableLight = 1;
_gameState.unk10 = 1;
loadResourceData__ROOM_Library();
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index f5f58fe1234..dc03ca40baf 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -519,6 +519,7 @@ void IgorEngine::PART_34_UPDATE_ROOM_BACKGROUND() {
}
void IgorEngine::PART_34() {
+ playMusic(1);
_gameState.enableLight = 1;
loadActionData(DAT_ParkLeft);
loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight, TXT_ParkRight);
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index d3e6888ea62..eb911b35935 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -136,6 +136,7 @@ void IgorEngine::PART_35_APPLY_OBJECT_STATE(int num) {
}
void IgorEngine::PART_35() {
+ playMusic(1);
_gameState.enableLight = 1;
loadActionData(DAT_ParkRight);
loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // left panel
diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp
index 0bac4bd4c2a..8bf12da0e28 100644
--- a/engines/igor/parts/part_36.cpp
+++ b/engines/igor/parts/part_36.cpp
@@ -141,6 +141,7 @@ void IgorEngine::PART_36_HELPER_4(int frame) {
}
void IgorEngine::PART_36() {
+ playMusic(2);
_gameState.enableLight = 1;
loadRoomData(PAL_ChemistryClassroom, IMG_ChemistryClassroom, BOX_ChemistryClassroom, MSK_ChemistryClassroom, TXT_ChemistryClassroom);
static const int anm[] = { FRM_ChemistryClassroom1, FRM_ChemistryClassroom2, 0 };
diff --git a/engines/igor/parts/part_37.cpp b/engines/igor/parts/part_37.cpp
index ffc14bd6b05..5d6a4c3f381 100644
--- a/engines/igor/parts/part_37.cpp
+++ b/engines/igor/parts/part_37.cpp
@@ -102,6 +102,7 @@ void IgorEngine::PART_37_HELPER_2() {
}
void IgorEngine::PART_37() {
+ playMusic(2);
_gameState.enableLight = 1;
loadRoomData(PAL_PhysicsClassroom, IMG_PhysicsClassroom, BOX_PhysicsClassroom, MSK_PhysicsClassroom, TXT_PhysicsClassroom);
static const int anm[] = { FRM_PhysicsClassroom1, 0 };
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index 2cb8f7db3a5..cdba9f14573 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -64,13 +64,11 @@ void IgorEngine::PART_04_CLEAR_OBJECT_STATE_84(int num) {
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;
@@ -81,9 +79,7 @@ void IgorEngine::PART_04() {
PART_04_CLEAR_OBJECT_STATE_84(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- if (_gameState.musicNum != 2) {
- playMusic(2);
- }
+ playMusic(1);
if (!restoreRoomAfterLoad(false)) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index 8edbffc7267..79ac7f969b6 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -127,6 +127,7 @@ void IgorEngine::PART_05_HELPER_6_walkIgorToScene() {
}
void IgorEngine::PART_05() {
+ playMusic(10);
_gameState.enableLight = 1;
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
SET_PAL_240_48_1();
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index 178e6baf656..7441a9542e1 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -314,6 +314,7 @@ void IgorEngine::PART_06_HELPER_15(int frame) {
}
void IgorEngine::PART_06() {
+ playMusic(10);
debug("Entering PART_06");
_gameState.enableLight = 1;
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index 932d3fba869..874cccf6543 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -223,6 +223,7 @@ void IgorEngine::PART_07_EXEC_ACTION(int action) {
}
void IgorEngine::PART_07() {
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_AdministrationCorridor);
loadRoomData(PAL_AdministrationCorridor, IMG_AdministrationCorridor,
diff --git a/engines/igor/parts/part_75.cpp b/engines/igor/parts/part_75.cpp
index cc0e583d86a..427d76bf035 100644
--- a/engines/igor/parts/part_75.cpp
+++ b/engines/igor/parts/part_75.cpp
@@ -49,6 +49,7 @@ void IgorEngine::PART_75_HELPER_1(int frame) {
}
void IgorEngine::PART_75() {
+ playMusic(8);
PART_MEANWHILE();
_gameState.enableLight = 1;
// this cutscene draws its dialogue text with the last palette entry and index 0 for
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index 946e4e61293..cad18a90305 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -484,6 +484,7 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
}
void IgorEngine::PART_08() {
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_DeanPepperOffice);
loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice, BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice);
diff --git a/engines/igor/parts/part_85.cpp b/engines/igor/parts/part_85.cpp
index ed32c50acaf..92f18d6312d 100644
--- a/engines/igor/parts/part_85.cpp
+++ b/engines/igor/parts/part_85.cpp
@@ -46,7 +46,7 @@ void IgorEngine::PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action) {
void IgorEngine::PART_85() {
if(_game.flags & kFlagFloppy) {
playMusic(2);
- } else playMusic(11);
+ } else playMusic(10);
// loads part5 room into memory
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
// copies current screenLayer1 into screenLayer2 to hold a copy
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index 1895e1ae06b..d5730154709 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -319,6 +319,7 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
}
void IgorEngine::PART_09() {
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_AdministrationSecretaryRoom);
loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom,BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom, TXT_AdministrationSecretaryRoom);
diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp
index a1f32467aa0..6bac3632c08 100644
--- a/engines/igor/parts/part_90.cpp
+++ b/engines/igor/parts/part_90.cpp
@@ -25,6 +25,10 @@ namespace Igor {
void IgorEngine::PART_90() {
const char *str;
+ if (_currentPart == 900) {
+ playMusic(14);
+ }
+
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
switch (_currentPart) {
diff --git a/engines/igor/parts/part_margaret.cpp b/engines/igor/parts/part_margaret.cpp
index d6e0d90159f..2490594bc78 100644
--- a/engines/igor/parts/part_margaret.cpp
+++ b/engines/igor/parts/part_margaret.cpp
@@ -49,6 +49,7 @@ void IgorEngine::PART_MARGARET_ROOM_CUTSCENE_UPDATE_DIALOGUE_MARGARET(int action
}
void IgorEngine::PART_MARGARET_ROOM_CUTSCENE() {
+ playMusic(8);
_gameState.enableLight = 1;
VAR_MARGARET_ROOM_ANIM_COUNTER = _objectsState[110] + 1;
if (VAR_MARGARET_ROOM_ANIM_COUNTER == 9) {
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 725b1ac24ea..33464e1569c 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -29,18 +29,21 @@ namespace Igor {
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]);
+ // play only if the requested track is not already playing
+ if (_gameState.musicNum != num) {
+ _gameState.musicNum = num;
+ _gameState.musicSequenceIndex = 1;
+ // TODO: the track number -> CMF file mapping is not known yet
+ // startMusic(...);
+ }
} else {
// play only if the requested track is not already playing
if(_gameState.musicNum != num) {
_gameState.musicNum = num;
_gameState.musicSequenceIndex = 1;
- // g_system->getAudioCDManager()->stop();
- // g_system->getAudioCDManager()->play(num, -1, 0, 0);
+ g_system->getAudioCDManager()->stop();
+ // the first CD track is the data track: music number N is CD track N + 1
+ g_system->getAudioCDManager()->play(num + 1, -1, 0, 0);
}
}
}
Commit: 372d507e7e6d287473dd5c63775ec80722c0d388
https://github.com/scummvm/scummvm/commit/372d507e7e6d287473dd5c63775ec80722c0d388
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:30+01:00
Commit Message:
IGOR: Introduces part 50
Changed paths:
A engines/igor/parts/part_50.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_maze.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 082ae071109..dfac2dbb284 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1077,6 +1077,14 @@ private:
void PART_37_HELPER_2();
void PART_37();
+ // outside the maze
+ void PART_50_EXEC_ACTION(int action);
+ void PART_50_ACTION_101_enterMaze();
+ void PART_50_ENTER_FROM_DOOR();
+ void PART_50_ENTER_FROM_HILL();
+ void PART_50_UPDATE_ROOM_BACKGROUND();
+ void PART_50();
+
// maze
static const MazeNode MAZE_NODES[108];
static const MazeRoom *getMazeRoom(int part);
@@ -1331,6 +1339,7 @@ protected:
static const RoomDataOffsets PART_35_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_36_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_37_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_50_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
static const uint8 _inventoryOffsetTable[];
static const uint8 _inventoryActionsTable[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 25ccc467312..e948555672c 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -50,6 +50,7 @@ MODULE_OBJS = \
parts/part_35.o \
parts/part_36.o \
parts/part_37.o \
+ parts/part_50.o \
parts/part_75.o \
parts/part_maze.o \
parts/part_maze_data.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 3d2531d60f1..a6c52e16a4d 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -707,6 +707,10 @@ void IgorEngine::PART_MAIN() {
case 370:
PART_37();
break;
+ case 500:
+ case 501:
+ PART_50(); // outside the maze
+ break;
case 510:
case 521:
case 532:
diff --git a/engines/igor/parts/part_50.cpp b/engines/igor/parts/part_50.cpp
new file mode 100644
index 00000000000..2866df3276d
--- /dev/null
+++ b/engines/igor/parts/part_50.cpp
@@ -0,0 +1,156 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+// The palette of the room is darker by this amount.
+static const int kPart50PaletteDarkness = 5;
+
+// Area given temporarily to the place where Igor appears next to the door, so that the path to or from it can be built.
+static const int kPart50DoorArea = 7;
+static const int kPart50DoorX = 264;
+static const int kPart50DoorY = 89;
+
+void IgorEngine::PART_50_EXEC_ACTION(int action) {
+ switch (action) {
+ case 101:
+ PART_50_ACTION_101_enterMaze();
+ break;
+ case 102:
+ ADD_DIALOGUE_TEXT(201, 1, 1083);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ break;
+ case 103:
+ _objectsState[90] = 0;
+ _currentPart = 700;
+ break;
+ default:
+ error("PART_50_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+/**
+ * Igor walks to the door and goes into the maze, through its last room.
+ */
+void IgorEngine::PART_50_ACTION_101_enterMaze() {
+ _roomObjectAreasTable[_screenLayer2[kPart50DoorY * 320 + kPart50DoorX]].area = kPart50DoorArea;
+ --_walkDataLastIndex;
+ buildWalkPath(222, 102, kPart50DoorX, kPart50DoorY);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _currentPart = 663;
+ _objectsState[71] = 1;
+}
+
+/**
+ * Igor comes out of the door, on the right, and walks to the left.
+ */
+void IgorEngine::PART_50_ENTER_FROM_DOOR() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(kPart50DoorX, kPart50DoorY, kFacingPositionLeft, 0);
+ wd->setDefaultScale();
+ _walkDataLastIndex = 0;
+ const int area = _screenLayer2[kPart50DoorY * 320 + kPart50DoorX];
+ _roomObjectAreasTable[area].area = kPart50DoorArea;
+ buildWalkPath(kPart50DoorX, kPart50DoorY, 222, 102);
+ _roomObjectAreasTable[area].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+/**
+ * Igor comes from the far top left, tiny, and walks down the hill to the right.
+ */
+void IgorEngine::PART_50_ENTER_FROM_HILL() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(45, 22, kFacingPositionFront, 0);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 5;
+ wd->scaleWidth = 9;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 9;
+ _walkDataLastIndex = 0;
+ buildWalkPath(45, 22, 84, 111);
+ _walkData[_walkDataLastIndex].posNum = kFacingPositionRight;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+/**
+ * Something is heard from time to time.
+ */
+void IgorEngine::PART_50_UPDATE_ROOM_BACKGROUND() {
+ if (compareGameTick(0x3D) && getRandomNumber(49) == 0) {
+ playSound(44, 1);
+ }
+}
+
+void IgorEngine::PART_50() {
+ playMusic(4);
+ _gameState.enableLight = 2;
+ loadRoomData(PAL_OutsideMaze, IMG_OutsideMaze, BOX_OutsideMaze, MSK_OutsideMaze, TXT_OutsideMaze);
+ memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
+ SET_PAL_240_48_1();
+ loadActionData(DAT_OutsideMaze);
+ _roomDataOffsets = PART_50_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(49, 22, 224, 119);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_50_EXEC_ACTION);
+ _updateRoomBackground = &IgorEngine::PART_50_UPDATE_ROOM_BACKGROUND;
+ memcpy(_screenVGA, _screenLayer1, 46080);
+
+ // the whole room is darker than its palette
+ for (int i = 3; i <= 207 * 3 + 2; ++i) {
+ const int value = _paletteBuffer[i] - kPart50PaletteDarkness;
+ _paletteBuffer[i] = value < 1 ? 0 : value;
+ }
+
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 500) {
+ PART_50_ENTER_FROM_DOOR();
+ } else {
+ PART_50_ENTER_FROM_HILL();
+ }
+ }
+ enterPartLoop();
+ while ((_currentPart == 500 || _currentPart == 501) && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_maze.cpp b/engines/igor/parts/part_maze.cpp
index 292cc7bf0ae..b67a627c57c 100644
--- a/engines/igor/parts/part_maze.cpp
+++ b/engines/igor/parts/part_maze.cpp
@@ -196,7 +196,7 @@ void IgorEngine::enterFromStairs(const MazeEntry &entry) {
WalkData::setNextFrame(wd->posNum, _walkCurrentFrame);
wd->clipSkipX = 1;
wd->clipWidth = 30;
- wd->scaleWidth = 23 + i * 2;
+ wd->scaleWidth = 23 + i * 3;
wd->xPosChanged = 1;
wd->dxPos = 0;
wd->yPosChanged = 1;
@@ -241,7 +241,7 @@ void IgorEngine::mazeExitThroughStairs(const MazeAction &action) {
WalkData::setNextFrame(wd->posNum, _walkCurrentFrame);
wd->clipSkipX = 1;
wd->clipWidth = 30;
- wd->scaleWidth = 23 + (i - 1) * 2;
+ wd->scaleWidth = 23 + (i - 1) * 3;
wd->xPosChanged = 1;
wd->dxPos = 0;
wd->yPosChanged = 1;
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index c1dc6849629..8b1c87c0571 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -679,6 +679,12 @@
#define PAL_Maze66 1086
#define MSK_Maze66 1087
#define BOX_Maze66 1088
+#define DAT_OutsideMaze 1089
+#define TXT_OutsideMaze 1090
+#define IMG_OutsideMaze 1091
+#define PAL_OutsideMaze 1092
+#define MSK_OutsideMaze 1093
+#define BOX_OutsideMaze 1094
// MAZE ROOMS END
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index e713f41213d..3a751aacb89 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -457,4 +457,11 @@ const RoomDataOffsets IgorEngine::PART_37_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_50_ROOM_DATA_OFFSETS = {
+ { 245, 7, 42, 6 },
+ { 589, 594 },
+ { 595, 731, 3467, 619, 695, 76 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
} // End of namespace Igor
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index af6596aa15f..c87ce1ba0c4 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1136,6 +1136,35 @@ void IgorEngine::buildWalkPathSimple(int srcX, int srcY, int dstX, int dstY) {
}
void IgorEngine::fixWalkPosition(int *x, int *y) {
+ if (getPart() == 50) {
+ // The click is clamped to a rectangle. On the right half the first walkable row is looked for below it and,
+ // if there is none, above; on the left half the first walkable column to the right and then to the left.
+ int xPos = MAX(MIN(*x, 224), 49);
+ int yPos = MAX(MIN(MIN(*y, 143), 119), 22);
+ if (xPos > 144) {
+ do {
+ ++yPos;
+ } while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && yPos != 143);
+ if (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0) {
+ do {
+ --yPos;
+ } while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && yPos > 0);
+ }
+ } else {
+ // at column 144 the scan never stops by itself: it runs on over the following rows
+ do {
+ ++xPos;
+ } while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && xPos != 144 && yPos * 320 + xPos < 320 * 143);
+ if (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0) {
+ do {
+ --xPos;
+ } while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && xPos > 0);
+ }
+ }
+ *x = xPos;
+ *y = yPos;
+ return;
+ }
if (_roomClickFix.enabled) {
// The click is clamped, then the picture is scanned for the first walkable row strictly below it (the
// scan starts one row down, whatever the row is) and, if none is found down to the last row and the
Commit: a16217fb0dc35f4739d2f85d1aa3961275076470
https://github.com/scummvm/scummvm/commit/a16217fb0dc35f4739d2f85d1aa3961275076470
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:31+01:00
Commit Message:
IGOR: Fix animation error when Margaret picks burger
Changed paths:
engines/igor/parts/part_21.cpp
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index 0a1c893def7..5febee1cc0f 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -108,7 +108,10 @@ void IgorEngine::PART_21_ACTION_102() {
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(76, 87, 63, 32, 0);
_updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_2;
+ // The cutscene dialogue wait does not run Margaret's idle animation
+ _updateRoomBackground = 0;
waitForEndOfCutsceneDialogue(76, 87, 63, 32, 0);
+ _updateRoomBackground = &IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND;
_updateDialogue = 0;
PART_21_HANDLE_DIALOGUE_MARGARET();
PART_21_HELPER_1(255);
@@ -176,7 +179,9 @@ void IgorEngine::PART_21_ACTION_111() {
ADD_DIALOGUE_TEXT(209, 1, 1185);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
- waitForEndOfIgorDialogue();
+ // Igor's talking head is not animated here; the writing frames take its place
+ waitForEndOfIgorDialogue(false);
+ IN_ACTION_111 = false;
const int offset = 28183;
for (int i = 0; i <= 49; ++i) {
memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + 0xCBE1 + i * 26, 26);
@@ -193,7 +198,6 @@ void IgorEngine::PART_21_ACTION_111() {
PART_21_UPDATE_ROOM_BACKGROUND();
waitForTimer();
} while (k != 10);
- IN_ACTION_111 = false;
removeObjectFromInventory(56);
_objectsState[65] = 1;
PART_21_HELPER_1(255);
@@ -404,7 +408,9 @@ void IgorEngine::PART_21_HELPER_10() {
SET_DIALOGUE_TEXT(1, 5);
startCutsceneDialogue(76, 87, 63, 32, 0);
_updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_3;
+ _updateRoomBackground = 0;
waitForEndOfCutsceneDialogue(76, 87, 63, 32, 0);
+ _updateRoomBackground = &IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND;
_updateDialogue = 0;
ADD_DIALOGUE_TEXT(219, 1, 1192);
ADD_DIALOGUE_TEXT(220, 1, 1193);
@@ -412,7 +418,9 @@ void IgorEngine::PART_21_HELPER_10() {
SET_DIALOGUE_TEXT(1, 3);
startCutsceneDialogue(76, 87, 63, 32, 0);
_updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_3;
+ _updateRoomBackground = 0;
waitForEndOfCutsceneDialogue(76, 87, 63, 32, 0);
+ _updateRoomBackground = &IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND;
_updateDialogue = 0;
_objectsState[65] = 2;
drawVerbsPanel();
Commit: 60fd5fa698f01fda83a388c982d8df1f9706ccdd
https://github.com/scummvm/scummvm/commit/60fd5fa698f01fda83a388c982d8df1f9706ccdd
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:31+01:00
Commit Message:
IGOR: Fix walkable areas in deans office
Changed paths:
engines/igor/parts/part_8.cpp
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index cad18a90305..89f4d970b6b 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -204,7 +204,7 @@ void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
loadActionData(DAT_DeanPepperOffice);
loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice, BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice);
_roomDataOffsets = PART_08_ROOM_DATA_OFFSETS;
- setRoomWalkBounds(0, 0, 319, 143);
+ setRoomClickFix(143, -1, 281, false); // cseg100:0657
PART_08_APPLY_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
SET_PAL_240_48_1();
@@ -501,7 +501,7 @@ void IgorEngine::PART_08() {
loadAnimData(anim);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_08_EXEC_ACTION);
_roomDataOffsets = PART_08_ROOM_DATA_OFFSETS;
- setRoomWalkBounds(0, 0, 319, 143);
+ setRoomClickFix(143, -1, 281, false); // cseg100:0657
PART_08_APPLY_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
Commit: 4e994e21e6e20700715642844ef186f730f1e4d3
https://github.com/scummvm/scummvm/commit/4e994e21e6e20700715642844ef186f730f1e4d3
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:31+01:00
Commit Message:
IGOR: make sure to save messageboard state in administrative office
Changed paths:
engines/igor/igor.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 10ebfe1a594..49ab813962d 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -628,7 +628,9 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
s.syncAsSint16LE(_currentPart);
// the location in the maze is kept in the padding
s.syncAsByte(_mazeLocation);
- s.skip(7);
+ // whether Igor has already read the notice board in room 7 is also kept in the padding
+ s.syncAsByte(_part07FirstVisitDone);
+ s.skip(6);
// 5. Action state
s.syncAsByte(_actionCode);
Commit: df704bdb7e2beb932e5e8bc22e9663f51f0de902
https://github.com/scummvm/scummvm/commit/df704bdb7e2beb932e5e8bc22e9663f51f0de902
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:32+01:00
Commit Message:
IGOR: Save secretary dismissed flag
Changed paths:
engines/igor/parts/part_8.cpp
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index 89f4d970b6b..70cf7023036 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -200,6 +200,8 @@ void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
}
waitForTimer(255);
fadeOut(624);
+ _objectsState[27] = 0;
+ _objectsState[35] = 1;
loadActionData(DAT_DeanPepperOffice);
loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice, BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice);
Commit: eda5295ddcc1619c878a537e67efd711fa7b0378
https://github.com/scummvm/scummvm/commit/eda5295ddcc1619c878a537e67efd711fa7b0378
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:32+01:00
Commit Message:
IGOR: Simplify dialog functions
Changed paths:
engines/igor/igor.h
engines/igor/part_main.cpp
engines/igor/parts/part_0.cpp
engines/igor/parts/part_1.cpp
engines/igor/parts/part_10.cpp
engines/igor/parts/part_11.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_13.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_15.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_18.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_22.cpp
engines/igor/parts/part_23.cpp
engines/igor/parts/part_24.cpp
engines/igor/parts/part_25.cpp
engines/igor/parts/part_26.cpp
engines/igor/parts/part_27.cpp
engines/igor/parts/part_28.cpp
engines/igor/parts/part_30.cpp
engines/igor/parts/part_31.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
engines/igor/parts/part_36.cpp
engines/igor/parts/part_37.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_50.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_7.cpp
engines/igor/parts/part_75.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_85.cpp
engines/igor/parts/part_9.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index dfac2dbb284..9bb040ad68b 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -591,6 +591,31 @@ private:
void startCutsceneDialogue(int x, int y, int r, int g, int b);
void waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b);
+ // One-call dialogue helpers. Each queues the given lines as consecutive pages and starts them.
+ // Use these for every new room instead of ADD_DIALOGUE_TEXT/SET_DIALOGUE_TEXT/start* sequences.
+ // igorSay Igor speaks, returns once the first page has started
+ // igorSayAndWait Igor speaks, returns once all pages are finished
+ // cutsceneSayStart text at (x, y) in color (r, g, b), returns once the first page has started
+ // cutsceneSay same, but returns once all pages are finished
+ // cutsceneSayStartWithCallback like cutsceneSayStart, but first installs a talk-animation callback
+ // (see _updateDialogue); it stays installed for the caller to clear
+ // cutsceneSayWithCallback like cutsceneSay, but installs the callback first and clears it afterwards
+ void igorSay(const Common::Array<DialogueText> &lines);
+ void igorSay(int num, int count = 1, int sound = kNoSpeechSound);
+ void igorSayAndWait(const Common::Array<DialogueText> &lines);
+ void igorSayAndWait(int num, int count = 1, int sound = kNoSpeechSound);
+ void cutsceneSayStart(int x, int y, int r, int g, int b, const Common::Array<DialogueText> &lines);
+ void cutsceneSayStart(int x, int y, int r, int g, int b, int num, int count = 1, int sound = kNoSpeechSound);
+ void cutsceneSay(int x, int y, int r, int g, int b, const Common::Array<DialogueText> &lines);
+ void cutsceneSay(int x, int y, int r, int g, int b, int num, int count = 1, int sound = kNoSpeechSound);
+ void cutsceneSayStartWithCallback(int x, int y, int r, int g, int b, const Common::Array<DialogueText> &lines, UpdateDialogueProc update);
+ void cutsceneSayStartWithCallback(int x, int y, int r, int g, int b, int num, int count, int sound, UpdateDialogueProc update);
+ void cutsceneSayWithCallback(int x, int y, int r, int g, int b, const Common::Array<DialogueText> &lines, UpdateDialogueProc update);
+ void cutsceneSayWithCallback(int x, int y, int r, int g, int b, int num, int count, int sound, UpdateDialogueProc update);
+
+ // Building block of the helpers above, do not call from rooms
+ void queueDialogueLines(const Common::Array<DialogueText> &lines);
+
bool isDialogueSpeechPlaying() const;
void stopDialogueSpeech();
@@ -1017,7 +1042,7 @@ private:
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_HARRISON_SPEAKS();
+ void PART_33_HARRISON_SPEAKS(const Common::Array<DialogueText> &lines);
void PART_33_HANDLE_DIALOGUE_HARRISON();
void PART_33_UPDATE_ROOM_BACKGROUND();
void PART_33_HELPER_1(int num);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index a6c52e16a4d..485a9abfca8 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -37,230 +37,144 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
} else {
num = 14;
}
- ADD_DIALOGUE_TEXT(num, 1, num);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(num, 1, num);
} break;
case 3:
- ADD_DIALOGUE_TEXT(15, 1, 15);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(15, 1, 15);
break;
case 4:
- ADD_DIALOGUE_TEXT(10, 1, 10);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(10, 1, 10);
break;
case 5:
- ADD_DIALOGUE_TEXT(9, 1, 9);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(9, 1, 9);
break;
case 6:
- ADD_DIALOGUE_TEXT(8, 1, 8);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(8, 1, 8);
break;
case 7:
- ADD_DIALOGUE_TEXT(6, 1, 6);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(6, 1, 6);
break;
case 8:
- ADD_DIALOGUE_TEXT(7, 1, 7);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(7, 1, 7);
break;
case 9: {
int num = 16 + getRandomNumber(1);
- ADD_DIALOGUE_TEXT(num, 1, num);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(num, 1, num);
}
break;
case 10:
- ADD_DIALOGUE_TEXT(18, 1, 18);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(18, 1, 18);
break;
case 11:
- ADD_DIALOGUE_TEXT(19, 1, 19);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(19, 1, 19);
break;
case 12: {
int num = 20 + getRandomNumber(1);
- ADD_DIALOGUE_TEXT(num, 1, num);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(num, 1, num);
}
break;
case 13:
- ADD_DIALOGUE_TEXT(22, 1, 22);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(22, 1, 22);
break;
case 14:
- ADD_DIALOGUE_TEXT(23, 1, 23);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(23, 1, 23);
break;
case 15:
- ADD_DIALOGUE_TEXT(24, 1, 24);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(24, 1, 24);
break;
case 16:
- ADD_DIALOGUE_TEXT(25, 1, 25);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(25, 1, 25);
break;
case 17: {
int num = 26 + getRandomNumber(1);
- ADD_DIALOGUE_TEXT(num, 1, num);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(num, 1, num);
}
break;
case 18:
- ADD_DIALOGUE_TEXT(28, 1, 28);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(28, 1, 28);
break;
case 19:
- ADD_DIALOGUE_TEXT(4, 1, 4);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(4, 1, 4);
break;
case 20:
- ADD_DIALOGUE_TEXT(5, 1, 5);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(5, 1, 5);
break;
case 21: {
int num = 1 + getRandomNumber(2);
- ADD_DIALOGUE_TEXT(num, 1, num);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(num, 1, num);
}
break;
case 22:
- ADD_DIALOGUE_TEXT(51, 1, 32);
- ADD_DIALOGUE_TEXT(52, 1, 33);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 51, 1, 32 }, { 52, 1, 33 } });
break;
case 23:
- ADD_DIALOGUE_TEXT(53, 1, 34);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(53, 1, 34);
break;
case 24:
- ADD_DIALOGUE_TEXT(54, 1, 35);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(54, 1, 35);
break;
case 25:
- ADD_DIALOGUE_TEXT(55, 3, 36);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(55, 3, 36);
break;
case 26:
- ADD_DIALOGUE_TEXT(58, 1, 37);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(58, 1, 37);
break;
case 27:
- ADD_DIALOGUE_TEXT(59, 2, 38);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(59, 2, 38);
break;
case 28:
- ADD_DIALOGUE_TEXT(61, 1, 39);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(61, 1, 39);
break;
case 29:
- ADD_DIALOGUE_TEXT(62, 1, 40);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(62, 1, 40);
break;
case 30:
- ADD_DIALOGUE_TEXT(64, 1, 42);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(64, 1, 42);
break;
case 31:
- ADD_DIALOGUE_TEXT(63, 1, 41);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(63, 1, 41);
break;
case 32:
- ADD_DIALOGUE_TEXT(65, 1, 43);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(65, 1, 43);
break;
case 33:
- ADD_DIALOGUE_TEXT(66, 1, 44);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(66, 1, 44);
break;
case 34:
- ADD_DIALOGUE_TEXT(30, 1, 30);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(30, 1, 30);
break;
case 35:
- ADD_DIALOGUE_TEXT(29, 1, 29);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(29, 1, 29);
break;
case 36:
- ADD_DIALOGUE_TEXT(67, 2, 45);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(67, 2, 45);
break;
case 37:
- ADD_DIALOGUE_TEXT(69, 1, 46);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(69, 1, 46);
break;
case 38:
// EXEC_MAIN_ACTION_38();
break;
case 39:
- ADD_DIALOGUE_TEXT(70, 1, 47);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(70, 1, 47);
break;
case 40:
- ADD_DIALOGUE_TEXT(71, 1, 48);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(71, 1, 48);
break;
case 41:
- ADD_DIALOGUE_TEXT(72, 1, 49);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(72, 1, 49);
break;
case 42:
- ADD_DIALOGUE_TEXT(73, 1, 50);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(73, 1, 50);
break;
case 43:
EXEC_MAIN_ACTION_43_lookAtPhoto();
break;
case 44:
- ADD_DIALOGUE_TEXT(156, 1, 80);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(156, 1, 80);
break;
case 45:
- ADD_DIALOGUE_TEXT(92, 1, 64);
- ADD_DIALOGUE_TEXT(93, 3, 65);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 92, 1, 64 }, { 93, 3, 65 } });
break;
case 46: // look at folder
if (_objectsState[3] == 0) {
@@ -273,20 +187,13 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
startIgorDialogue();
break;
case 48:
- ADD_DIALOGUE_TEXT(77 + _objectsState[0], 1, 53 + _objectsState[0]);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(77 + _objectsState[0], 1, 53 + _objectsState[0]);
break;
case 50:
if (_objectsState[1] == 0) {
- ADD_DIALOGUE_TEXT(80, 1, 56);
- ADD_DIALOGUE_TEXT(81, 1, 57);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 80, 1, 56 }, { 81, 1, 57 } });
} else {
- ADD_DIALOGUE_TEXT(82, 1, 58);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(82, 1, 58);
}
break;
case 51:
@@ -299,61 +206,38 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
startIgorDialogue();
break;
case 52:
- ADD_DIALOGUE_TEXT(89, 2, 63);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(89, 2, 63);
break;
case 53:
- ADD_DIALOGUE_TEXT(88, 1, 62);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(88, 1, 62);
break;
case 54:
lookAtPapyrus(false);
break;
case 55:
- ADD_DIALOGUE_TEXT(159, 1, 83);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(159, 1, 83);
break;
case 56:
- ADD_DIALOGUE_TEXT(160, 1, 84);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(160, 1, 84);
break;
case 57:
- ADD_DIALOGUE_TEXT(31, 1, 31);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(31, 1, 31);
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();
+ igorSay({ { 140, 1, 70 }, { 141, 1, 71 }, { 142, 1, 72 }, { 143, 1, 73 } });
_objectsState[4] = 2;
break;
case 59:
- ADD_DIALOGUE_TEXT(97, 2, 67);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(97, 2, 67);
break;
case 60:
- ADD_DIALOGUE_TEXT(161, 1, 85);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(161, 1, 85);
break;
case 61:
if (_inventoryInfo[51] != 0) {
- ADD_DIALOGUE_TEXT(76, 1, 52);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(76, 1, 52);
} else {
- ADD_DIALOGUE_TEXT(74, 2, 51);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(74, 2, 51);
addObjectToInventory(16, 51);
}
break;
@@ -367,14 +251,10 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
_objectsState[1] = 1;
UPDATE_OBJECT_STATE(2);
addObjectToInventory(24, 59);
- ADD_DIALOGUE_TEXT(169, 1, 93);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(169, 1, 93);
break;
case 63:
- ADD_DIALOGUE_TEXT(170, 1, 94);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(170, 1, 94);
_inventoryInfo[_inventoryInfo[68] - 1] = 0;
_inventoryInfo[68] = 0;
packInventory();
@@ -397,29 +277,19 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
startIgorDialogue();
break;
case 65:
- ADD_DIALOGUE_TEXT(165, 1, 89);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(165, 1, 89);
break;
case 66:
- ADD_DIALOGUE_TEXT(166, 1, 90);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(166, 1, 90);
break;
case 67:
- ADD_DIALOGUE_TEXT(167, 1, 91);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(167, 1, 91);
break;
case 68:
- ADD_DIALOGUE_TEXT(168, 1, 92);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(168, 1, 92);
break;
case 69:
- ADD_DIALOGUE_TEXT(96, 1, 66);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(96, 1, 66);
break;
default:
@@ -446,10 +316,7 @@ void IgorEngine::EXEC_MAIN_ACTION_43_lookAtPhoto() {
wd->x = 160;
wd->y = 130;
wd->scaleWidth = 50;
- ADD_DIALOGUE_TEXT(83, 2, 59);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(83, 2, 59);
_currentAction.object1Num = 0;
wd->x = _walkDataCurrentPosX2;
wd->y = _walkDataCurrentPosY2;
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 72f954c5dec..c5985207904 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -106,17 +106,13 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
}
break;
case 103: // look at window
- ADD_DIALOGUE_TEXT(201, 3, 95);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 3, 95);
break;
case 104: // go to window
if (_objectsState[13] != 1)
break;
if (_objectsState[15] != 0) {
- ADD_DIALOGUE_TEXT(212, 1, 101);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(212, 1, 101);
break;
}
PART_00_animateRaw(0x4D8A, 0, 1, 0x5DC, 30, 50, 0x6B2C, 62, -1, 0);
@@ -125,9 +121,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
_currentPart = 10;
break;
case 105: // look at bed
- ADD_DIALOGUE_TEXT(204, 1, 96);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(204, 1, 96);
break;
case 106: // open bedside table
if (_objectsState[8] == 0) {
@@ -176,14 +170,10 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
}
break;
case 112: // look at closet
- ADD_DIALOGUE_TEXT(206, 1, 98);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(206, 1, 98);
break;
case 113: // look at hole
- ADD_DIALOGUE_TEXT(207, 2, 99);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(207, 2, 99);
break;
case 114: // go through hole
if (_objectsState[10] == 0)
@@ -192,9 +182,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
_currentPart = 24;
break;
case 115: // look at records
- ADD_DIALOGUE_TEXT(209, 3, 100);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(209, 3, 100);
break;
case 116: // take records
if (_objectsState[12] == 0) {
@@ -203,9 +191,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
_objectsState[12] = 1;
PART_00_APPLY_OBJECT_STATE(255);
} else {
- ADD_DIALOGUE_TEXT(213, 2, 102);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(213, 2, 102);
}
break;
case 117: // exit to map
@@ -232,10 +218,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
_currentPart = 40;
break;
case 118: // use bed
- ADD_DIALOGUE_TEXT(219, 1, 106);
- ADD_DIALOGUE_TEXT(220, 1, 107);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 219, 1, 106 }, { 220, 1, 107 } });
break;
default:
error("PART_00_EXEC_ACTION unhandled action %d", action);
@@ -274,9 +257,7 @@ void IgorEngine::PART_00_WALK_IN_FROM_CLOSET() {
_gameState.igorMoving = true;
waitForIgorMove();
if (_objectsState[14] == 0) {
- ADD_DIALOGUE_TEXT(215, 2, 103);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(215, 2, 103);
_objectsState[14] = 1;
} else {
PART_00_ENTER_FROM_BELOW();
diff --git a/engines/igor/parts/part_1.cpp b/engines/igor/parts/part_1.cpp
index cf93eebecdd..87c0c9e8b17 100644
--- a/engines/igor/parts/part_1.cpp
+++ b/engines/igor/parts/part_1.cpp
@@ -26,11 +26,7 @@ void IgorEngine::PART_01_CLOSE_WINDOW() {
}
}
- ADD_DIALOGUE_TEXT(203, 1, 132);
- ADD_DIALOGUE_TEXT(204, 1, 133);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait({ { 203, 1, 132 }, { 204, 1, 133 } });
}
void IgorEngine::PART_01_STATE_11_BLIT_blitIgor() {
@@ -112,9 +108,7 @@ void IgorEngine::PART_01_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_01_EXEC_ACTION %d", action);
switch (action) {
case 101: // walk past pigeon
- ADD_DIALOGUE_TEXT(201, 2, 131);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 2, 131);
break;
case 102:
// draws two 24x41 roof-crossing frames at screen
@@ -127,34 +121,22 @@ void IgorEngine::PART_01_EXEC_ACTION(int action) {
_currentPart = 20;
break;
case 103: // look at pigeon
- ADD_DIALOGUE_TEXT(205, 1, 134);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 1, 134);
break;
case 104: // look at closed window
- ADD_DIALOGUE_TEXT(206, 2, 135);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(206, 2, 135);
break;
case 105: // look at other window
- ADD_DIALOGUE_TEXT(208, 1, 136);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(208, 1, 136);
break;
case 106: // close other window
- ADD_DIALOGUE_TEXT(209, 1, 137);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(209, 1, 137);
break;
case 107: // open window
- ADD_DIALOGUE_TEXT(210, 1, 138);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(210, 1, 138);
break;
case 108: // pick up pigeon
- ADD_DIALOGUE_TEXT(211, 2, 139);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(211, 2, 139);
break;
default:
warning("PART_01_EXEC_ACTION unhandled action %d", action);
diff --git a/engines/igor/parts/part_10.cpp b/engines/igor/parts/part_10.cpp
index 208edb2dd4b..c8899193e4b 100644
--- a/engines/igor/parts/part_10.cpp
+++ b/engines/igor/parts/part_10.cpp
@@ -53,10 +53,7 @@ void IgorEngine::PART_10_11_DRAW_OBJECT_STATE(int num) {
void IgorEngine::PART_10_EXEC_ACTION(int action) {
switch (action) {
case 101: // look at plaque
- ADD_DIALOGUE_TEXT(201, 1, 626);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(201, 1, 626);
break;
case 102: //enter door
_roomObjectAreasTable[7].deltaLum = 3;
@@ -71,31 +68,19 @@ void IgorEngine::PART_10_EXEC_ACTION(int action) {
_currentPart = 70;
break;
case 103: //look at door
- ADD_DIALOGUE_TEXT(202, 1, 627);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(202, 1, 627);
break;
case 104: // pick burger
PART_10_ACTION_104_pickHamburger();
break;
case 105: // use anything with paperbin
- ADD_DIALOGUE_TEXT(206, 1, 630);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(206, 1, 630);
break;
case 106: // walk at zebra crossing
- ADD_DIALOGUE_TEXT(208, 1, 632);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(208, 1, 632);
break;
case 107: // look at zebra crossing
- ADD_DIALOGUE_TEXT(207, 1, 631);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(207, 1, 631);
break;
case 108:
PART_10_ACTION_108_scrollLeft();
@@ -111,17 +96,11 @@ void IgorEngine::PART_10_EXEC_ACTION(int action) {
void IgorEngine::PART_10_ACTION_104_pickHamburger() {
if (_objectsState[38] == 1) { // already picked hamburger
- ADD_DIALOGUE_TEXT(205, 1, 629);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(205, 1, 629);
return;
}
- ADD_DIALOGUE_TEXT(203, 2, 628);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(203, 2, 628);
static const uint8 frameSelectors[] = { 0, 1, 0, 2 };
for (int frame = 0; frame < 4; ++frame) {
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index 10c6fd3b4f4..64a09e1efc1 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -141,32 +141,19 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 102:
- ADD_DIALOGUE_TEXT(29, 1, 29);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(29, 1, 29);
break;
case 103: // look at pipe
- ADD_DIALOGUE_TEXT(_objectsState[40] == 0 ? 203 : 204, 1, _objectsState[40] == 0 ? 617 : 618);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(_objectsState[40] == 0 ? 203 : 204, 1, _objectsState[40] == 0 ? 617 : 618);
break;
case 104: // look at snail
- ADD_DIALOGUE_TEXT(205, 1, 619);
- ADD_DIALOGUE_TEXT(206, 1, 620);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait({ { 205, 1, 619 }, { 206, 1, 620 } });
break;
case 105:
PART_11_ACTION_105();
break;
case 106:
- ADD_DIALOGUE_TEXT(73, 1, 50);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(73, 1, 50);
break;
case 107:
PART_11_ACTION_107();
@@ -175,37 +162,22 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
PART_11_ACTION_108_scrollRight();
break;
case 109: // Look at hole
- ADD_DIALOGUE_TEXT(207, 1, 621);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(207, 1, 621);
break;
case 110: // Look at butterfly net
- ADD_DIALOGUE_TEXT(_objectsState[42] == 1 ? 208 : 209, 1, _objectsState[42] == 1 ? 622 : 623);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(_objectsState[42] == 1 ? 208 : 209, 1, _objectsState[42] == 1 ? 622 : 623);
break;
case 111: // look at glass shards
- ADD_DIALOGUE_TEXT(210, 1, 624);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(210, 1, 624);
break;
case 112:
PART_11_ACTION_112();
break;
case 113:
- ADD_DIALOGUE_TEXT(211, 1, 625);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(211, 1, 625);
break;
case 114:
- ADD_DIALOGUE_TEXT(29, 1, 29);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(29, 1, 29);
break;
default:
warning("PART_11_EXEC_ACTION unhandled action %d", action);
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 8d178b0cb92..3008d9db0ed 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -33,9 +33,7 @@ void IgorEngine::PART_12_EXEC_ACTION(int action) {
PART_12_ACTION_101();
break;
case 102:
- ADD_DIALOGUE_TEXT(201, 1, 789);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 789);
break;
case 103:
if (_objectsState[44] == 0) {
@@ -53,14 +51,10 @@ void IgorEngine::PART_12_EXEC_ACTION(int action) {
PART_12_ACTION_105();
break;
case 106:
- ADD_DIALOGUE_TEXT(207, 2, 793);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(207, 2, 793);
break;
case 107:
- ADD_DIALOGUE_TEXT(206, 1, 792);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(206, 1, 792);
break;
case 108:
PART_12_ACTION_108();
@@ -396,14 +390,7 @@ void IgorEngine::PART_12_HELPER_4() {
waitForTimer(30);
}
}
- ADD_DIALOGUE_TEXT(212, 2, 796);
- ADD_DIALOGUE_TEXT(214, 1, 797);
- ADD_DIALOGUE_TEXT(215, 1, 798);
- 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;
+ cutsceneSayWithCallback(95, 55, 51, 28, 63, { { 212, 2, 796 }, { 214, 1, 797 }, { 215, 1, 798 } }, &IgorEngine::PART_12_UPDATE_DIALOGUE_CHURCHMAN);
for (int i = 12; i <= 29; ++i){
const uint8 *src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + i * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
diff --git a/engines/igor/parts/part_13.cpp b/engines/igor/parts/part_13.cpp
index 5b24f42a9b7..d80ec3e6a72 100644
--- a/engines/igor/parts/part_13.cpp
+++ b/engines/igor/parts/part_13.cpp
@@ -31,9 +31,7 @@ void IgorEngine::PART_13_EXEC_ACTION(int action) {
PART_13_ACTION_101_103();
break;
case 102:
- ADD_DIALOGUE_TEXT(201, 2, 858);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 2, 858);
break;
case 103:
PART_13_ACTION_101_103();
@@ -73,10 +71,7 @@ void IgorEngine::PART_13_ACTION_101_103() {
waitForTimer(30);
}
_walkDataLastIndex = 1;
- ADD_DIALOGUE_TEXT(203, 1, 859);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(203, 1, 859);
_walkData[0].posNum = 3;
moveIgor(_walkData[0].posNum, _walkData[0].frameNum);
waitForTimer(30);
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 48d60f237e0..1f355eeaa9d 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -36,17 +36,13 @@ void IgorEngine::PART_14_EXEC_ACTION(int action) {
PART_14_ACTION_101();
break;
case 102:
- ADD_DIALOGUE_TEXT(201, 1, 860);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 860);
break;
case 103:
PART_14_ACTION_103();
break;
case 104:
- ADD_DIALOGUE_TEXT(202, 1, 861);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(202, 1, 861);
break;
case 105:
PART_14_ACTION_105();
@@ -55,9 +51,7 @@ void IgorEngine::PART_14_EXEC_ACTION(int action) {
PART_14_ACTION_106();
break;
case 107:
- ADD_DIALOGUE_TEXT(203, 1, 862);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 1, 862);
break;
case 108:
PART_14_ACTION_108();
@@ -177,10 +171,7 @@ void IgorEngine::PART_14_ACTION_106() {
void IgorEngine::PART_14_ACTION_108() {
_gameState.unkF = false;
_updateRoomBackground = &IgorEngine::PART_14_UPDATE_ROOM_BACKGROUND_ACTION_108;
- ADD_DIALOGUE_TEXT(226, 1, 880);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(226, 1, 880);
removeObjectFromInventory(43);
for (int i = 1; i <= 3; ++i) {
const uint8 *src = _animFramesBuffer + 0x2AAA + READ_LE_UINT16(_animFramesBuffer + 0x940C + i * 2) - 1;
@@ -191,64 +182,32 @@ void IgorEngine::PART_14_ACTION_108() {
playSound(33, 1);
PART_14_HELPER_8(4, 24);
stopSound();
- ADD_DIALOGUE_TEXT(205, 1, 864);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(221, 85, 12, 33, 63);
- waitForEndOfCutsceneDialogue(221, 85, 12, 33, 63);
+ cutsceneSay(221, 85, 12, 33, 63, 205, 1, 864);
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, 865);
- ADD_DIALOGUE_TEXT(207, 1, 866);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(208, 2, 867);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(221, 85, 12, 33, 63);
- waitForEndOfCutsceneDialogue(221, 85, 12, 33, 63);
- ADD_DIALOGUE_TEXT(210, 1, 868);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(211, 2, 869);
- ADD_DIALOGUE_TEXT(213, 3, 870);
- ADD_DIALOGUE_TEXT(216, 1, 871);
- SET_DIALOGUE_TEXT(1, 3);
- startCutsceneDialogue(221, 85, 12, 33, 63);
- waitForEndOfCutsceneDialogue(221, 85, 12, 33, 63);
+ igorSayAndWait({ { 206, 1, 865 }, { 207, 1, 866 } });
+ cutsceneSay(221, 85, 12, 33, 63, 208, 2, 867);
+ igorSayAndWait(210, 1, 868);
+ cutsceneSay(221, 85, 12, 33, 63, { { 211, 2, 869 }, { 213, 3, 870 }, { 216, 1, 871 } });
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, 872);
- ADD_DIALOGUE_TEXT(218, 1, 873);
- ADD_DIALOGUE_TEXT(219, 1, 874);
- SET_DIALOGUE_TEXT(1, 3);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(220, 2, 875);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(221, 85, 12, 33, 63);
- waitForEndOfCutsceneDialogue(221, 85, 12, 33, 63);
+ igorSayAndWait({ { 217, 1, 872 }, { 218, 1, 873 }, { 219, 1, 874 } });
+ cutsceneSay(221, 85, 12, 33, 63, 220, 2, 875);
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, 876);
- ADD_DIALOGUE_TEXT(223, 1, 877);
- ADD_DIALOGUE_TEXT(224, 1, 878);
- ADD_DIALOGUE_TEXT(225, 1, 879);
- SET_DIALOGUE_TEXT(1, 4);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait({ { 222, 1, 876 }, { 223, 1, 877 }, { 224, 1, 878 }, { 225, 1, 879 } });
PART_14_HELPER_1(255);
_updateRoomBackground = 0;
}
@@ -508,13 +467,10 @@ void IgorEngine::PART_14_HELPER_9() {
} else {
_currentPart = 145;
_gameState.counter[4] = 0;
- ADD_DIALOGUE_TEXT(204, 1, 863);
- SET_DIALOGUE_TEXT(1, 1);
playSound(35, 1);
waitForTimer(255);
stopSound();
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(204, 1, 863);
}
}
}
diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp
index c9a2149402c..ab9c3386ad8 100644
--- a/engines/igor/parts/part_15.cpp
+++ b/engines/igor/parts/part_15.cpp
@@ -40,69 +40,43 @@ void IgorEngine::PART_15_EXEC_ACTION(int action) {
PART_15_ACTION_101();
break;
case 102:
- ADD_DIALOGUE_TEXT(204, 1, 324);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(204, 1, 324);
break;
case 103:
- ADD_DIALOGUE_TEXT(205, 2, 325);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 2, 325);
break;
case 104:
- ADD_DIALOGUE_TEXT(207, 1, 326);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(207, 1, 326);
break;
case 105:
- ADD_DIALOGUE_TEXT(205, 2, 325);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 2, 325);
break;
case 106:
- ADD_DIALOGUE_TEXT(205, 2, 325);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 2, 325);
break;
case 107:
PART_15_ACTION_107();
break;
case 108:
- ADD_DIALOGUE_TEXT(208, 1, 327);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(208, 1, 327);
break;
case 109:
- ADD_DIALOGUE_TEXT(201, 1, 322);
- ADD_DIALOGUE_TEXT(202, 2, 323);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 201, 1, 322 }, { 202, 2, 323 } });
break;
case 110:
- ADD_DIALOGUE_TEXT(234, 1, 345);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(234, 1, 345);
break;
case 111:
- ADD_DIALOGUE_TEXT(235, 1, 346);
- ADD_DIALOGUE_TEXT(236, 1, 347);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 235, 1, 346 }, { 236, 1, 347 } });
break;
case 112:
- ADD_DIALOGUE_TEXT(237, 2, 348);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(237, 2, 348);
break;
case 113:
- ADD_DIALOGUE_TEXT(239, 1, 349);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(239, 1, 349);
break;
case 114:
- ADD_DIALOGUE_TEXT(240, 1, 350);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(240, 1, 350);
break;
case 115:
PART_15_ACTION_115();
@@ -147,27 +121,10 @@ void IgorEngine::PART_15_ACTION_115() {
} while (_gameState.counter[3] != 0);
}
PART_15_HELPER_7(6);
- ADD_DIALOGUE_TEXT(209, 1, 328);
- ADD_DIALOGUE_TEXT(210, 1, 329);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(212, 1, 331);
- 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, 332);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(214, 1, 333);
- 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;
+ igorSayAndWait({ { 209, 1, 328 }, { 210, 1, 329 } });
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 212, 1, 331, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ igorSayAndWait(213, 1, 332);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 214, 1, 333, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
for (int i = 1; i <= 11; ++i) {
PART_15_HELPER_9(PART_15_ANIM_DATA_3[i]);
waitForTimer(60);
@@ -195,34 +152,13 @@ void IgorEngine::PART_15_ACTION_115() {
removeObjectFromInventory(70);
_objectsState[46] = 1;
if (_objectsState[47] == 0) {
- ADD_DIALOGUE_TEXT(221, 2, 338);
- 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;
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 221, 2, 338, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
return;
}
- ADD_DIALOGUE_TEXT(226, 2, 341);
- 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, 342);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(229, 1, 343);
- 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, 344);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 226, 2, 341, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ igorSayAndWait(228, 1, 342);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 229, 1, 343, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ igorSayAndWait(230, 1, 344);
_currentPart = 780;
}
@@ -234,27 +170,10 @@ void IgorEngine::PART_15_ACTION_116() {
} while (_gameState.counter[3] != 0);
}
PART_15_HELPER_7(6);
- ADD_DIALOGUE_TEXT(209, 1, 328);
- ADD_DIALOGUE_TEXT(211, 1, 330);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(212, 1, 331);
- 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, 332);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(214, 1, 333);
- 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;
+ igorSayAndWait({ { 209, 1, 328 }, { 211, 1, 330 } });
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 212, 1, 331, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ igorSayAndWait(213, 1, 332);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 214, 1, 333, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
for (int i = 1; i <= 11; ++i) {
PART_15_HELPER_9(PART_15_ANIM_DATA_5[i]);
waitForTimer(60);
@@ -282,34 +201,13 @@ void IgorEngine::PART_15_ACTION_116() {
removeObjectFromInventory(60);
_objectsState[47] = 1;
if (_objectsState[46] == 0) {
- ADD_DIALOGUE_TEXT(224, 2, 340);
- 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;
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 224, 2, 340, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
return;
}
- ADD_DIALOGUE_TEXT(226, 2, 341);
- 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, 342);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(229, 1, 343);
- 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, 344);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 226, 2, 341, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ igorSayAndWait(228, 1, 342);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 229, 1, 343, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ igorSayAndWait(230, 1, 344);
_currentPart = 780;
}
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index b937d98d150..4902468897d 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -33,9 +33,7 @@ void IgorEngine::PART_16_EXEC_ACTION(int action) {
PART_16_ACTION_101();
break;
case 102:
- ADD_DIALOGUE_TEXT(208, 2, 730);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(208, 2, 730);
break;
case 103:
_currentPart = 261;
@@ -48,16 +46,10 @@ void IgorEngine::PART_16_EXEC_ACTION(int action) {
void IgorEngine::PART_16_ACTION_101() {
if (_objectsState[52] == 1) {
- ADD_DIALOGUE_TEXT(207, 1, 729);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(207, 1, 729);
return;
}
- ADD_DIALOGUE_TEXT(201, 1, 726);
- ADD_DIALOGUE_TEXT(202, 2, 727);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait({ { 201, 1, 726 }, { 202, 2, 727 } });
for (int i = 1; i <= 2; ++i) {
int offset = 20332;
for (int j = 0; j <= 48; ++j) {
@@ -71,9 +63,7 @@ void IgorEngine::PART_16_ACTION_101() {
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
- ADD_DIALOGUE_TEXT(204, 3, 728);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(204, 3, 728);
}
void IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET_HARRISON(int action) {
@@ -122,13 +112,7 @@ void IgorEngine::PART_16_HELPER_2() {
void IgorEngine::PART_16_HELPER_3_photoCutscene() {
memset(_screenVGA + 46080, 0, 17920);
- ADD_DIALOGUE_TEXT(210, 1, 731);
- ADD_DIALOGUE_TEXT(211, 1, 732);
- ADD_DIALOGUE_TEXT(212, 1, 733);
- ADD_DIALOGUE_TEXT(213, 2, 734);
- SET_DIALOGUE_TEXT(1, 4);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait({ { 210, 1, 731 }, { 211, 1, 732 }, { 212, 1, 733 }, { 213, 2, 734 } });
--_walkDataLastIndex;
buildWalkPath(90, 135, 200, 143);
_walkDataCurrentIndex = 1;
@@ -174,43 +158,20 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true);
waitForTimer(25);
}
- ADD_DIALOGUE_TEXT(215, 1, 735);
- ADD_DIALOGUE_TEXT(216, 1, 736);
- ADD_DIALOGUE_TEXT(217, 1, 737);
- 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;
+ cutsceneSayWithCallback(175, 78, 0, 58, 40, { { 215, 1, 735 }, { 216, 1, 736 }, { 217, 1, 737 } }, &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET_HARRISON);
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, 738);
- 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;
+ cutsceneSayWithCallback(88, 69, 63, 32, 0, 218, 2, 738, &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET);
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, 739);
- ADD_DIALOGUE_TEXT(221, 1, 740);
- 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, 741);
- 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;
+ cutsceneSayWithCallback(175, 78, 0, 58, 40, { { 220, 1, 739 }, { 221, 1, 740 } }, &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET_HARRISON);
+ cutsceneSayWithCallback(88, 69, 63, 32, 0, 222, 2, 741, &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET);
playSound(26, 1);
for (int i = 53; i <= 61; ++i) {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true);
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 16ba71da970..bc360d119b8 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -31,17 +31,13 @@ void IgorEngine::PART_17_EXEC_ACTION(int action) {
PART_17_ACTION_101_walkIn();
break;
case 102: // look at door
- ADD_DIALOGUE_TEXT(225, 1, 648);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(225, 1, 648);
break;
case 103: // talk to philip and jimmy
PART_17_ACTION_103_talkPhilipJimmy();
break;
case 104: // look at file
- ADD_DIALOGUE_TEXT(220, 3, 646);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(220, 3, 646);
break;
case 105:
PART_17_ACTION_105();
@@ -77,50 +73,31 @@ void IgorEngine::PART_17_ACTION_103_talkPhilipJimmy() {
PART_17_HELPER_8_PhillipToJimmyAnimFrame(0);
if (_gameState.counter[4] == 1) {
- ADD_DIALOGUE_TEXT(201, 2, 633);
+ cutsceneSayWithCallback(156, 32, 35, 38, 47, 201, 2, 633, &IgorEngine::PART_17_UPDATE_DIALOGUE_Jimmy);
} else if (_gameState.counter[4] == 2) {
- ADD_DIALOGUE_TEXT(206, 2, 636);
+ cutsceneSayWithCallback(156, 32, 35, 38, 47, 206, 2, 636, &IgorEngine::PART_17_UPDATE_DIALOGUE_Jimmy);
} else if (_gameState.counter[4] == 3) {
- ADD_DIALOGUE_TEXT(210, 2, 638);
+ cutsceneSayWithCallback(156, 32, 35, 38, 47, 210, 2, 638, &IgorEngine::PART_17_UPDATE_DIALOGUE_Jimmy);
}
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(156, 32, 35, 38, 47);
- _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_Jimmy;
- waitForEndOfCutsceneDialogue(156, 32, 35, 38, 47);
- _updateDialogue = 0;
+ VAR_CURRENT_TALKING_ACTOR = 0;
if (_gameState.counter[4] == 1) {
debug("PART_17_ACTION_103_talkPhilipJimmy: counter[4] == 1");
- ADD_DIALOGUE_TEXT(203, 1, 634);
- ADD_DIALOGUE_TEXT(204, 2, 635);
- SET_DIALOGUE_TEXT(1, 2);
+ cutsceneSayWithCallback(135, 33, 63, 63, 0, { { 203, 1, 634 }, { 204, 2, 635 } }, &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip);
} else if (_gameState.counter[4] == 2) {
debug("PART_17_ACTION_103_talkPhilipJimmy: counter[4] == 2");
- ADD_DIALOGUE_TEXT(208, 2, 637);
- SET_DIALOGUE_TEXT(1, 1);
+ cutsceneSayWithCallback(135, 33, 63, 63, 0, 208, 2, 637, &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip);
} else if (_gameState.counter[4] == 3) {
debug("PART_17_ACTION_103_talkPhilipJimmy: counter[4] == 3");
- ADD_DIALOGUE_TEXT(212, 2, 639);
- ADD_DIALOGUE_TEXT(214, 1, 640);
- SET_DIALOGUE_TEXT(1, 2);
+ cutsceneSayWithCallback(135, 33, 63, 63, 0, { { 212, 2, 639 }, { 214, 1, 640 } }, &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip);
}
- startCutsceneDialogue(135, 33, 63, 63, 0);
- VAR_CURRENT_TALKING_ACTOR = 0;
- _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip;
- waitForEndOfCutsceneDialogue(135, 33, 63, 63, 0);
- _updateDialogue = 0;
PART_17_HELPER_11_PhillipToIgor(0);
waitForTimer(255);
const int randomDialogue = getRandomNumber(3);
- ADD_DIALOGUE_TEXT(215 + randomDialogue, 1, 641 + randomDialogue);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(135, 33, 63, 63, 0);
VAR_CURRENT_TALKING_ACTOR = 1;
- _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip;
- waitForEndOfCutsceneDialogue(135, 33, 63, 63, 0);
- _updateDialogue = 0;
+ cutsceneSayWithCallback(135, 33, 63, 63, 0, 215 + randomDialogue, 1, 641 + randomDialogue, &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip);
PART_17_HANDLE_DIALOGUE_PHILIP();
PART_17_HELPER_1(255);
@@ -132,10 +109,7 @@ void IgorEngine::PART_17_ACTION_103_talkPhilipJimmy() {
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
- ADD_DIALOGUE_TEXT(219, 1, 645);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(219, 1, 645);
if (_gameState.counter[4] == 3) {
_gameState.counter[4] = 1;
} else {
@@ -195,9 +169,7 @@ void IgorEngine::PART_17_ACTION_105() {
void IgorEngine::PART_17_ACTION_106_swapFolders() {
// folder already exchanged
if (_objectsState[55] == 1) {
- ADD_DIALOGUE_TEXT(226, 1, 649);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(226, 1, 649);
return;
}
playSound(24, 1);
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index 7d49be0d7dc..6072b6703b0 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -26,47 +26,28 @@ namespace Igor {
void IgorEngine::PART_18_EXEC_ACTION(int action) {
switch (action) {
case 101: // look at grating
- ADD_DIALOGUE_TEXT(201, 1, 896);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 896);
break;
case 102: // look at door
- ADD_DIALOGUE_TEXT(202, 1, 897);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(202, 1, 897);
break;
case 103: // use left-most door
- ADD_DIALOGUE_TEXT(205, 1, 899);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(99, 54, 43, 63, 0);
- waitForEndOfCutsceneDialogue(99, 54, 43, 63, 0);
+ cutsceneSay(99, 54, 43, 63, 0, 205, 1, 899);
break;
case 104: // use middle door
- ADD_DIALOGUE_TEXT(206, 1, 900);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(132, 55, 63, 42, 0);
- waitForEndOfCutsceneDialogue(132, 55, 63, 42, 0);
+ cutsceneSay(132, 55, 63, 42, 0, 206, 1, 900);
break;
case 105: // use right-most door
- ADD_DIALOGUE_TEXT(207, 1, 901);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(167, 56, 0, 42, 42);
- waitForEndOfCutsceneDialogue(167, 56, 0, 42, 42);
+ cutsceneSay(167, 56, 0, 42, 42, 207, 1, 901);
break;
case 106: // look at dryer
- ADD_DIALOGUE_TEXT(208, 1, 902);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(208, 1, 902);
break;
case 107: // look at tap
- ADD_DIALOGUE_TEXT(209, 1, 903);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(209, 1, 903);
break;
case 108: // use tap
- ADD_DIALOGUE_TEXT(210, 1, 904);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(210, 1, 904);
break;
case 109: // use slug on grating
PART_18_ACTION_109_useSlugOnGrating();
@@ -113,22 +94,16 @@ void IgorEngine::PART_18_ACTION_109_useSlugOnGrating() {
removeObjectFromInventory(53);
fadeIn(768);
_currentPart = part;
- ADD_DIALOGUE_TEXT(215, 1, 908);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(215, 1, 908);
}
void IgorEngine::PART_18_ACTION_111() {
if (_objectsState[0] == 0) {
- ADD_DIALOGUE_TEXT(211, 1, 905);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(211, 1, 905);
return;
}
if (_objectsState[0] == 2) {
- ADD_DIALOGUE_TEXT(212, 1, 906);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(212, 1, 906);
return;
}
const int offset = 26798;
@@ -142,9 +117,7 @@ void IgorEngine::PART_18_ACTION_111() {
for (int i = 0; i <= 28; ++i) {
memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 28 + 0xBDE, 28);
}
- ADD_DIALOGUE_TEXT(213, 2, 907);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(213, 2, 907);
_objectsState[0] = 2;
UPDATE_OBJECT_STATE(1);
}
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index 4dff93ed8d2..f829b3ff045 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -27,32 +27,19 @@ static int VAR_CURRENT_TALKING_ACTOR;
void IgorEngine::PART_19_EXEC_ACTION(int action) {
switch (action) {
case 101:
- ADD_DIALOGUE_TEXT(201, 1, 909);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 909);
break;
case 102:
- ADD_DIALOGUE_TEXT(202, 1, 910);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(99, 54, 43, 63, 0);
- waitForEndOfCutsceneDialogue(99, 54, 43, 63, 0);
+ cutsceneSay(99, 54, 43, 63, 0, 202, 1, 910);
break;
case 103:
- ADD_DIALOGUE_TEXT(203, 1, 911);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(132, 55, 63, 42, 0);
- waitForEndOfCutsceneDialogue(132, 55, 63, 42, 0);
+ cutsceneSay(132, 55, 63, 42, 0, 203, 1, 911);
break;
case 104:
- ADD_DIALOGUE_TEXT(204, 1, 912);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(167, 56, 0, 42, 42);
- waitForEndOfCutsceneDialogue(167, 56, 0, 42, 42);
+ cutsceneSay(167, 56, 0, 42, 42, 204, 1, 912);
break;
case 105:
- ADD_DIALOGUE_TEXT(205, 1, 913);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 1, 913);
break;
case 106:
_currentPart = 232;
@@ -61,9 +48,7 @@ void IgorEngine::PART_19_EXEC_ACTION(int action) {
PART_19_ACTION_107();
break;
case 108:
- ADD_DIALOGUE_TEXT(208, 1, 916);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(208, 1, 916);
break;
case 109:
PART_19_ACTION_109();
@@ -76,16 +61,10 @@ void IgorEngine::PART_19_EXEC_ACTION(int action) {
void IgorEngine::PART_19_ACTION_107() { // sub_137_02C7
if (_objectsState[58] == 1) {
- ADD_DIALOGUE_TEXT(211, 1, 919);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(211, 1, 919);
return;
}
- ADD_DIALOGUE_TEXT(206, 1, 914);
- ADD_DIALOGUE_TEXT(207, 1, 915);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait({ { 206, 1, 914 }, { 207, 1, 915 } });
for (int i = 1; i <= 2; ++i) {
const int offset = 27110;
for (int j = 0; j <= 48; ++j) {
@@ -100,9 +79,7 @@ void IgorEngine::PART_19_ACTION_107() { // sub_137_02C7
void IgorEngine::PART_19_ACTION_109() { // sub_137_0421
if (_objectsState[2] == 1) {
- ADD_DIALOGUE_TEXT(210, 1, 918);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(210, 1, 918);
return;
}
for (int i = 1; i <= 4; ++i) {
@@ -116,10 +93,7 @@ void IgorEngine::PART_19_ACTION_109() { // sub_137_0421
PART_19_HELPER_1(255);
stopSound();
decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x360) - 1, _screenVGA, true);
- ADD_DIALOGUE_TEXT(209, 1, 917);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(209, 1, 917);
}
void IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN(int action) {
@@ -158,21 +132,13 @@ void IgorEngine::PART_19_HELPER_2_slugCutscene() { // sub_137_07AD
decodeAnimFrame(src, _screenVGA, true);
memcpy(_screenLayer1, _screenVGA, 46080);
fadeIn(624);
- ADD_DIALOGUE_TEXT(212, 3, 920);
- 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;
+ cutsceneSayWithCallback(243, 92, 63, 23, 33, 212, 3, 920, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
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, 921);
- ADD_DIALOGUE_TEXT(216, 2, 922);
- SET_DIALOGUE_TEXT(1, 2);
- startCutsceneDialogue(227, 91, 0, 63, 63);
+ cutsceneSayStart(227, 91, 0, 63, 63, { { 215, 1, 921 }, { 216, 2, 922 } });
_gameState.counter[1] = 10;
VAR_CURRENT_TALKING_ACTOR = 1;
_updateRoomBackground = &IgorEngine::PART_19_UPDATE_BACKGROUND_HELPER_9;
@@ -200,34 +166,14 @@ void IgorEngine::PART_19_HELPER_2_slugCutscene() { // sub_137_07AD
src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x40B5) - 1;
decodeAnimFrame(src, _screenVGA, true);
waitForTimer(30);
- ADD_DIALOGUE_TEXT(218, 1, 923);
- 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, 924);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(227, 91, 0, 63, 63);
+ cutsceneSayWithCallback(243, 92, 63, 23, 33, 218, 1, 923, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
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, 925);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(243, 92, 63, 23, 33);
+ cutsceneSayWithCallback(227, 91, 0, 63, 63, 219, 2, 924, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
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, 926);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(227, 91, 0, 63, 63);
+ cutsceneSayWithCallback(243, 92, 63, 23, 33, 221, 2, 925, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
VAR_CURRENT_TALKING_ACTOR = 1;
- _updateDialogue = &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN;
- waitForEndOfCutsceneDialogue(227, 91, 0, 63, 63);
- _updateDialogue = 0;
+ cutsceneSayWithCallback(227, 91, 0, 63, 63, 223, 2, 926, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
_objectsState[59] = 1;
fadeOut(624);
_gameState.talkSpeed = talkSpeed;
@@ -249,10 +195,7 @@ void IgorEngine::PART_19_HELPER_3() {
void IgorEngine::PART_19_HELPER_4() { // sub_137_0D7B
decodeAnimFrame(_animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x40AB) - 1, _screenVGA, true);
waitForTimer(60);
- ADD_DIALOGUE_TEXT(225, 1, 927);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(225, 1, 927);
--_walkDataLastIndex;
buildWalkPath(295, 142, 319, 142);
_walkDataCurrentIndex = 1;
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index f076f73185b..8002c31ebc8 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -11,9 +11,7 @@
namespace Igor {
void IgorEngine::PART_02_START_DIALOGUE(int text, int count, int sound) {
- ADD_DIALOGUE_TEXT(text, count, sound);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(text, count, sound);
}
void IgorEngine::PART_02_SEARCH_TRUNK() {
@@ -238,10 +236,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
PART_02_START_DIALOGUE(210, 1, 116);
break;
case 109: // look at portrait
- ADD_DIALOGUE_TEXT(225, 4, 128);
- ADD_DIALOGUE_TEXT(229, 1, 129);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 225, 4, 128 }, { 229, 1, 129 } });
break;
case 110: // look at hole
PART_02_START_DIALOGUE(213, 1, 118);
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index 5febee1cc0f..f9175247a25 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -37,24 +37,16 @@ void IgorEngine::PART_21_EXEC_ACTION(int action) {
PART_21_ACTION_102();
break;
case 103:
- ADD_DIALOGUE_TEXT(201, 1, 1177);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 1177);
break;
case 104:
- ADD_DIALOGUE_TEXT(202, 1, 1178);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(202, 1, 1178);
break;
case 105:
- ADD_DIALOGUE_TEXT(203, 1, 1179);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 1, 1179);
break;
case 106:
- ADD_DIALOGUE_TEXT(204, 1, 1180);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(204, 1, 1180);
break;
case 107:
PART_21_ACTION_107();
@@ -63,9 +55,7 @@ void IgorEngine::PART_21_EXEC_ACTION(int action) {
PART_21_ACTION_108();
break;
case 109:
- ADD_DIALOGUE_TEXT(205, 1, 1181);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 1, 1181);
break;
case 110:
PART_21_ACTION_110();
@@ -74,9 +64,7 @@ void IgorEngine::PART_21_EXEC_ACTION(int action) {
PART_21_ACTION_111();
break;
case 112:
- ADD_DIALOGUE_TEXT(222, 1, 1195);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(222, 1, 1195);
break;
case 113:
PART_21_ACTION_113();
@@ -100,13 +88,8 @@ void IgorEngine::PART_21_ACTION_101() {
void IgorEngine::PART_21_ACTION_102() {
PART_21_HELPER_6(1);
- ADD_DIALOGUE_TEXT(226, 1, 1197);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(227, 1, 1198);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(76, 87, 63, 32, 0);
+ igorSayAndWait(226, 1, 1197);
+ cutsceneSayStart(76, 87, 63, 32, 0, 227, 1, 1198);
_updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_2;
// The cutscene dialogue wait does not run Margaret's idle animation
_updateRoomBackground = 0;
@@ -169,16 +152,11 @@ void IgorEngine::PART_21_ACTION_110() {
void IgorEngine::PART_21_ACTION_111() {
if (_inventoryInfo[65] == 0) {
- ADD_DIALOGUE_TEXT(223, 2, 1196);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(223, 2, 1196);
return;
}
IN_ACTION_111 = true;
- ADD_DIALOGUE_TEXT(208, 1, 1184);
- ADD_DIALOGUE_TEXT(209, 1, 1185);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 208, 1, 1184 }, { 209, 1, 1185 } });
// Igor's talking head is not animated here; the writing frames take its place
waitForEndOfIgorDialogue(false);
IN_ACTION_111 = false;
@@ -204,9 +182,7 @@ void IgorEngine::PART_21_ACTION_111() {
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
- ADD_DIALOGUE_TEXT(210, 2, 1186);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(210, 2, 1186);
}
void IgorEngine::PART_21_ACTION_113() {
@@ -400,23 +376,13 @@ void IgorEngine::PART_21_HELPER_10() {
waitForTimer(100);
}
}
- ADD_DIALOGUE_TEXT(212, 1, 1187);
- ADD_DIALOGUE_TEXT(213, 1, 1188);
- ADD_DIALOGUE_TEXT(214, 1, 1189);
- ADD_DIALOGUE_TEXT(215, 2, 1190);
- ADD_DIALOGUE_TEXT(217, 2, 1191);
- SET_DIALOGUE_TEXT(1, 5);
- startCutsceneDialogue(76, 87, 63, 32, 0);
+ cutsceneSayStart(76, 87, 63, 32, 0, { { 212, 1, 1187 }, { 213, 1, 1188 }, { 214, 1, 1189 }, { 215, 2, 1190 }, { 217, 2, 1191 } });
_updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_3;
_updateRoomBackground = 0;
waitForEndOfCutsceneDialogue(76, 87, 63, 32, 0);
_updateRoomBackground = &IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND;
_updateDialogue = 0;
- ADD_DIALOGUE_TEXT(219, 1, 1192);
- ADD_DIALOGUE_TEXT(220, 1, 1193);
- ADD_DIALOGUE_TEXT(221, 1, 1194);
- SET_DIALOGUE_TEXT(1, 3);
- startCutsceneDialogue(76, 87, 63, 32, 0);
+ cutsceneSayStart(76, 87, 63, 32, 0, { { 219, 1, 1192 }, { 220, 1, 1193 }, { 221, 1, 1194 } });
_updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_3;
_updateRoomBackground = 0;
waitForEndOfCutsceneDialogue(76, 87, 63, 32, 0);
diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp
index f125454761a..a4b42466b3c 100644
--- a/engines/igor/parts/part_22.cpp
+++ b/engines/igor/parts/part_22.cpp
@@ -49,10 +49,7 @@ void IgorEngine::PART_22_EXEC_ACTION(int action) {
*/
void IgorEngine::PART_22_ACTION_101() {
if (_objectsState[78] == 1 && _inventoryInfo[64] == 0) {
- ADD_DIALOGUE_TEXT(203, 2, 855);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(203, 2, 855);
for (int i = 0; i < 3; ++i) {
// each frame is drawn as is, over Igor too
const uint8 *frame = _animFramesBuffer + kPart22PickUpFrames +
@@ -64,15 +61,10 @@ void IgorEngine::PART_22_ACTION_101() {
}
addObjectToInventory(29, 64);
PART_22_APPLY_OBJECT_STATE(255);
- ADD_DIALOGUE_TEXT(205, 1, 856);
- ADD_DIALOGUE_TEXT(206, 1, 857);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 205, 1, 856 }, { 206, 1, 857 } });
_objectsState[105] = 1;
} else {
- ADD_DIALOGUE_TEXT(201, 2, 854);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 2, 854);
}
}
diff --git a/engines/igor/parts/part_23.cpp b/engines/igor/parts/part_23.cpp
index c6698027cce..8d7e224371a 100644
--- a/engines/igor/parts/part_23.cpp
+++ b/engines/igor/parts/part_23.cpp
@@ -31,17 +31,13 @@ void IgorEngine::PART_23_EXEC_ACTION(int action) {
_currentPart = 280;
break;
case 102: // look at portrait
- ADD_DIALOGUE_TEXT(201, 2, 1217);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 2, 1217);
break;
case 105:
PART_23_ACTION_105_enterLadiesRoom();
break;
case 106: // look at door
- ADD_DIALOGUE_TEXT(205, 1, 1220);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 1, 1220);
break;
case 107: // open door
PART_23_ACTION_107_openDoor();
@@ -53,26 +49,16 @@ void IgorEngine::PART_23_EXEC_ACTION(int action) {
_currentPart = 300;
break;
case 110: // Look at Lucas
- ADD_DIALOGUE_TEXT(203, 1, 1218);
- ADD_DIALOGUE_TEXT(204, 1, 1219);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 203, 1, 1218 }, { 204, 1, 1219 } });
break;
case 111:
- ADD_DIALOGUE_TEXT(208, 2, 1222);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(208, 2, 1222);
break;
case 112:
- ADD_DIALOGUE_TEXT(210, 1, 1223);
- ADD_DIALOGUE_TEXT(211, 1, 1224);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 210, 1, 1223 }, { 211, 1, 1224 } });
break;
case 113:
- ADD_DIALOGUE_TEXT(212, 1, 1225);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(212, 1, 1225);
break;
default:
error("PART_23_EXEC_ACTION unhandled action %d", action);
@@ -207,9 +193,7 @@ void IgorEngine::PART_23_HELPER_4_walkFromDoor() {
playSound(14, 1);
_objectsState[66] = 0;
PART_23_HELPER_1(1);
- ADD_DIALOGUE_TEXT(206, 2, 1221);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(206, 2, 1221);
}
}
diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp
index 9a14dcae510..90d85955b48 100644
--- a/engines/igor/parts/part_24.cpp
+++ b/engines/igor/parts/part_24.cpp
@@ -32,9 +32,7 @@ void IgorEngine::PART_24_EXEC_ACTION(int action) {
PART_24_ACTION_102();
break;
case 103:
- ADD_DIALOGUE_TEXT(201, 1, 1257);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 1257);
break;
case 104:
PART_24_ACTION_104();
@@ -43,39 +41,25 @@ void IgorEngine::PART_24_EXEC_ACTION(int action) {
PART_24_ACTION_105();
break;
case 106:
- ADD_DIALOGUE_TEXT(202, 1, 1258);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(202, 1, 1258);
break;
case 107:
PART_24_ACTION_107();
break;
case 108:
- ADD_DIALOGUE_TEXT(203, 1, 1259);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 1, 1259);
break;
case 109:
- ADD_DIALOGUE_TEXT(204, 1, 1260);
- ADD_DIALOGUE_TEXT(205, 1, 1261);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 204, 1, 1260 }, { 205, 1, 1261 } });
break;
case 110:
- ADD_DIALOGUE_TEXT(206, 2, 1262);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(206, 2, 1262);
break;
case 111:
- ADD_DIALOGUE_TEXT(208, 2, 1263);
- ADD_DIALOGUE_TEXT(210, 2, 1264);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 208, 2, 1263 }, { 210, 2, 1264 } });
break;
case 112:
- ADD_DIALOGUE_TEXT(212, 2, 1265);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(212, 2, 1265);
break;
default:
error("PART_24_EXEC_ACTION unhandled action %d", action);
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index 454fe2007f3..c8d16c5b78f 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -31,29 +31,18 @@ void IgorEngine::PART_25_EXEC_ACTION(int action) {
case 102:
switch (getRandomNumber(2) + 1) {
case 1:
- ADD_DIALOGUE_TEXT(204, 2, 1273);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(204, 2, 1273);
break;
case 2:
- ADD_DIALOGUE_TEXT(207, 1, 1274);
- ADD_DIALOGUE_TEXT(208, 1, 1275);
- ADD_DIALOGUE_TEXT(209, 1, 1276);
- SET_DIALOGUE_TEXT(1, 3);
- startIgorDialogue();
+ igorSay({ { 207, 1, 1274 }, { 208, 1, 1275 }, { 209, 1, 1276 } });
break;
case 3:
- ADD_DIALOGUE_TEXT(210, 1, 1277);
- ADD_DIALOGUE_TEXT(211, 1, 1278);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 210, 1, 1277 }, { 211, 1, 1278 } });
break;
}
break;
case 103:
- ADD_DIALOGUE_TEXT(201, 1, 1271);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 1271);
break;
case 104: // walk to board: nothing happens on arrival
break;
@@ -61,9 +50,7 @@ void IgorEngine::PART_25_EXEC_ACTION(int action) {
PART_25_ACTION_105();
break;
case 106:
- ADD_DIALOGUE_TEXT(203, 1, 1272);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 1, 1272);
break;
case 107:
PART_25_ACTION_107();
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index 45eb2d9e975..7ed0fd52969 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -28,14 +28,10 @@ static const uint8 PART_26_ANIM_DATA_1[12] = { 6, 0, 2, 3, 4, 5, 6, 5, 4, 3, 2,
void IgorEngine::PART_26_EXEC_ACTION(int action) {
switch (action) {
case 101:
- ADD_DIALOGUE_TEXT(202, 1, 1279);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(202, 1, 1279);
break;
case 102:
- ADD_DIALOGUE_TEXT(203, 1, 1280);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 1, 1280);
break;
case 103:
PART_26_ACTION_103();
@@ -44,9 +40,7 @@ void IgorEngine::PART_26_EXEC_ACTION(int action) {
PART_26_ACTION_104();
break;
case 105:
- ADD_DIALOGUE_TEXT(224, 2, 1290);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(224, 2, 1290);
break;
case 106:
_currentPart = 250;
@@ -55,26 +49,16 @@ void IgorEngine::PART_26_EXEC_ACTION(int action) {
PART_26_ACTION_107();
break;
case 108:
- ADD_DIALOGUE_TEXT(216, 2, 1284);
- ADD_DIALOGUE_TEXT(218, 1, 1285);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 216, 2, 1284 }, { 218, 1, 1285 } });
break;
case 109:
- ADD_DIALOGUE_TEXT(219, 1, 1286);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(219, 1, 1286);
break;
case 110:
- ADD_DIALOGUE_TEXT(220, 2, 1287);
- ADD_DIALOGUE_TEXT(222, 1, 1288);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 220, 2, 1287 }, { 222, 1, 1288 } });
break;
case 111:
- ADD_DIALOGUE_TEXT(223, 1, 1289);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(223, 1, 1289);
break;
default:
error("PART_26_EXEC_ACTION unhandled action %d", action);
@@ -209,11 +193,7 @@ void IgorEngine::PART_26_HELPER_5() {
_gameState.igorMoving = true;
waitForIgorMove();
if (_objectsState[65] == 3) {
- ADD_DIALOGUE_TEXT(212, 1, 1281);
- ADD_DIALOGUE_TEXT(213, 2, 1282);
- ADD_DIALOGUE_TEXT(215, 1, 1283);
- SET_DIALOGUE_TEXT(1, 3);
- startIgorDialogue();
+ igorSay({ { 212, 1, 1281 }, { 213, 2, 1282 }, { 215, 1, 1283 } });
_objectsState[65] = 4;
drawVerbsPanel();
redrawVerb(kVerbWalk, true);
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index 032626e418e..fab107f01e9 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -30,31 +30,21 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
break;
case 102: // look at lockers
if (_objectsState[85] == 0) {
- ADD_DIALOGUE_TEXT(216, 2, 1173);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(216, 2, 1173);
_objectsState[85] = 1;
PART_27_HELPER_1(255);
} else {
- ADD_DIALOGUE_TEXT(201, 1, 1162);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 1162);
}
break;
case 103: // open lockers
- ADD_DIALOGUE_TEXT(203, 1, 1163);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 1, 1163);
break;
case 104: // close lockers
- ADD_DIALOGUE_TEXT(204, 1, 1164);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(204, 1, 1164);
break;
case 105: // look at philips locker
- ADD_DIALOGUE_TEXT(205, 1, 1165);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 1, 1165);
break;
case 106:
PART_27_ACTION_106_openPhilipLocker();
@@ -66,22 +56,16 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
PART_27_ACTION_108();
break;
case 109:
- ADD_DIALOGUE_TEXT(215, 1, 1172);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(215, 1, 1172);
break;
case 110:
PART_27_ACTION_110();
break;
case 111:
- ADD_DIALOGUE_TEXT(218, 2, 1174);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(218, 2, 1174);
break;
case 112: // look at plaque
- ADD_DIALOGUE_TEXT(221, 1, 1176);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(221, 1, 1176);
break;
case 113: // go to library
_currentPart = 150;
@@ -98,16 +82,11 @@ void IgorEngine::PART_27_ACTION_106_openPhilipLocker() {
return;
}
if (_objectsState[5] == 0) {
- ADD_DIALOGUE_TEXT(206, 1, 1166);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(206, 1, 1166);
return;
}
if (_objectsState[5] == 1) {
- ADD_DIALOGUE_TEXT(209, 3, 1169);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(209, 3, 1169);
_objectsState[5] = 2;
}
const int offset = 21810;
@@ -147,15 +126,10 @@ void IgorEngine::PART_27_ACTION_107() {
void IgorEngine::PART_27_ACTION_108() {
if (_inventoryInfo[58] > 0 || _objectsState[42] == 2) {
- ADD_DIALOGUE_TEXT(208, 1, 1168);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(208, 1, 1168);
return;
}
- ADD_DIALOGUE_TEXT(207, 1, 1167);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(207, 1, 1167);
const int offset = 25012;
for (int i = 1; i <= 2; ++i) {
for (int j = 0; j <= 29; ++j) {
@@ -173,11 +147,7 @@ void IgorEngine::PART_27_ACTION_108() {
}
void IgorEngine::PART_27_ACTION_110() {
- ADD_DIALOGUE_TEXT(212, 1, 1170);
- ADD_DIALOGUE_TEXT(213, 2, 1171);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait({ { 212, 1, 1170 }, { 213, 2, 1171 } });
const int offset = 25012;
for (int i = 1; i <= 2; ++i) {
for (int j = 0; j <= 48; ++j) {
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index d93b9fb4a01..8b3326dba08 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -30,41 +30,26 @@ void IgorEngine::PART_28_EXEC_ACTION(int action) {
_currentPart = 230;
break;
case 102:
- ADD_DIALOGUE_TEXT(201, 1, 1226);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 1226);
break;
case 103:
- ADD_DIALOGUE_TEXT(202, 1, 1227);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(202, 1, 1227);
break;
case 104:
- ADD_DIALOGUE_TEXT(203, 1, 1228);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 1, 1228);
break;
case 105:
- ADD_DIALOGUE_TEXT(204, 1, 1229);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(204, 1, 1229);
break;
case 106:
if (_objectsState[111] == 0) {
- ADD_DIALOGUE_TEXT(205, 1, 1230);
- ADD_DIALOGUE_TEXT(206, 1, 1231);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 205, 1, 1230 }, { 206, 1, 1231 } });
} else {
- ADD_DIALOGUE_TEXT(234, 1, 1253);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(234, 1, 1253);
}
break;
case 107:
- ADD_DIALOGUE_TEXT(237, 1, 1256);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(237, 1, 1256);
break;
case 108:
PART_28_ACTION_108();
@@ -73,30 +58,20 @@ void IgorEngine::PART_28_EXEC_ACTION(int action) {
PART_28_ACTION_109();
break;
case 110:
- ADD_DIALOGUE_TEXT(228, 1, 1248);
- ADD_DIALOGUE_TEXT(229, 1, 1249);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 228, 1, 1248 }, { 229, 1, 1249 } });
break;
case 111:
if (_objectsState[3] == 0) {
- ADD_DIALOGUE_TEXT(226, 1, 1246);
- SET_DIALOGUE_TEXT(1, 1);
+ igorSay(226, 1, 1246);
} else {
- ADD_DIALOGUE_TEXT(227, 1, 1247);
- SET_DIALOGUE_TEXT(1, 1);
+ igorSay(227, 1, 1247);
}
- startIgorDialogue();
break;
case 112:
- ADD_DIALOGUE_TEXT(235, 1, 1254);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(235, 1, 1254);
break;
case 113:
- ADD_DIALOGUE_TEXT(236, 1, 1255);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(236, 1, 1255);
break;
default:
error("PART_28_EXEC_ACTION unhandled action %d", action);
@@ -106,17 +81,8 @@ void IgorEngine::PART_28_EXEC_ACTION(int action) {
void IgorEngine::PART_28_ACTION_108() {
if (_objectsState[111] == 1) {
- ADD_DIALOGUE_TEXT(218, 1, 1241);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(211, 1, 1235);
- ADD_DIALOGUE_TEXT(212, 1, 1236);
- ADD_DIALOGUE_TEXT(213, 2, 1237);
- ADD_DIALOGUE_TEXT(215, 1, 1238);
- ADD_DIALOGUE_TEXT(216, 1, 1239);
- SET_DIALOGUE_TEXT(1, 5);
- startCutsceneDialogue(182, 81, 63, 17, 17);
+ igorSayAndWait(218, 1, 1241);
+ cutsceneSayStart(182, 81, 63, 17, 17, { { 211, 1, 1235 }, { 212, 1, 1236 }, { 213, 2, 1237 }, { 215, 1, 1238 }, { 216, 1, 1239 } });
_updateDialogue = &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE;
waitForEndOfCutsceneDialogue(182, 81, 63, 17, 17);
ADD_DIALOGUE_TEXT(217, 1, 1240);
@@ -131,32 +97,19 @@ void IgorEngine::PART_28_ACTION_108() {
_walkData[_walkDataLastIndex].posNum = 3;
_gameState.igorMoving = true;
waitForIgorMove();
- ADD_DIALOGUE_TEXT(222, 2, 1244);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(222, 2, 1244);
return;
}
if (_objectsState[87] < 2) {
- ADD_DIALOGUE_TEXT(207, 1, 1232);
- SET_DIALOGUE_TEXT(1, 1);
+ igorSayAndWait(207, 1, 1232);
} else {
- ADD_DIALOGUE_TEXT(218, 1, 1241);
- SET_DIALOGUE_TEXT(1, 1);
+ igorSayAndWait(218, 1, 1241);
}
- startIgorDialogue();
- waitForEndOfIgorDialogue();
if (_objectsState[87] < 2) {
- ADD_DIALOGUE_TEXT(208, 1, 1233);
- SET_DIALOGUE_TEXT(1, 1);
+ cutsceneSayWithCallback(182, 81, 63, 17, 17, 208, 1, 1233, &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE);
} else {
- ADD_DIALOGUE_TEXT(219, 2, 1242);
- ADD_DIALOGUE_TEXT(221, 1, 1243);
- SET_DIALOGUE_TEXT(1, 2);
+ cutsceneSayWithCallback(182, 81, 63, 17, 17, { { 219, 2, 1242 }, { 221, 1, 1243 } }, &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE);
}
- 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() {
@@ -172,9 +125,7 @@ void IgorEngine::PART_28_ACTION_109() {
addObjectToInventory(22, 57);
_objectsState[87] = 1;
PART_28_HELPER_1(255);
- ADD_DIALOGUE_TEXT(230, 1, 1250);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(230, 1, 1250);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
@@ -291,26 +242,16 @@ void IgorEngine::PART_28_HELPER_6() {
_walkData[_walkDataLastIndex].posNum = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- ADD_DIALOGUE_TEXT(209, 2, 1234);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(209, 2, 1234);
waitForTimer(255);
- ADD_DIALOGUE_TEXT(231, 1, 1251);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(231, 1, 1251);
--_walkDataLastIndex;
buildWalkPath(214, 130, 214, 140);
_walkDataCurrentIndex = 1;
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
waitForIgorMove();
- ADD_DIALOGUE_TEXT(224, 2, 1245);
- ADD_DIALOGUE_TEXT(232, 2, 1252);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait({ { 224, 2, 1245 }, { 232, 2, 1252 } });
}
void IgorEngine::PART_28_HELPER_8(int frame) {
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index a7469ac9122..27ef4fcbdde 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -33,17 +33,13 @@ void IgorEngine::PART_30_EXEC_ACTION(int action) {
PART_30_ACTION_102_goUpstairs();
break;
case 103:
- ADD_DIALOGUE_TEXT(201, 1, 450);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 450);
break;
case 104:
PART_30_ACTION_104_goDownstairs();
break;
case 105:
- ADD_DIALOGUE_TEXT(202, 1, 451);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(202, 1, 451);
break;
case 106:
_currentPart = 210;
@@ -205,32 +201,17 @@ void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
_updateDialogue = &IgorEngine::PART_30_UPDATE_DIALOGUE_LAURA;
- ADD_DIALOGUE_TEXT(203, 1, 452);
- ADD_DIALOGUE_TEXT(204, 1, 453);
- ADD_DIALOGUE_TEXT(205, 1, 454);
- SET_DIALOGUE_TEXT(1, 3);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(206, 1, 455);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(201, 85, 63, 0, 38);
- waitForEndOfCutsceneDialogue(201, 85, 63, 0, 38);
+ igorSayAndWait({ { 203, 1, 452 }, { 204, 1, 453 }, { 205, 1, 454 } });
+ cutsceneSay(201, 85, 63, 0, 38, 206, 1, 455);
// igor crosses arms
igorCrossesArms();
// real dialogue
PART_30_HANDLE_DIALOGUE_LAURA();
// "Nunca me habian descrito tan bien"
- ADD_DIALOGUE_TEXT(207, 1, 456);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(207, 1, 456);
// at least you're funny
- ADD_DIALOGUE_TEXT(208, 1, 457);
- ADD_DIALOGUE_TEXT(209, 1, 458);
- SET_DIALOGUE_TEXT(1, 2);
- startCutsceneDialogue(201, 85, 63, 0, 38);
- waitForEndOfCutsceneDialogue(201, 85, 63, 0, 38);
+ cutsceneSay(201, 85, 63, 0, 38, { { 208, 1, 457 }, { 209, 1, 458 } });
_updateDialogue = 0;
// Laura leaves
lauraLeaves();
@@ -240,9 +221,7 @@ void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
// Que caracter
- ADD_DIALOGUE_TEXT(210, 1, 459);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(210, 1, 459);
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index 4b5e8c24f31..5c587014752 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -43,68 +43,44 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
if (_objectsState[72] == 0) {
EXEC_MAIN_ACTION(14);
} else {
- ADD_DIALOGUE_TEXT(205, 1, 885);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 1, 885);
}
break;
case 105:
- ADD_DIALOGUE_TEXT(201, 1, 881);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 881);
break;
case 106:
PART_31_ACTION_106();
break;
case 107:
- ADD_DIALOGUE_TEXT(203, 1, 883);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 1, 883);
break;
case 108:
_currentPart = 240;
break;
case 109:
- ADD_DIALOGUE_TEXT(204, 1, 884);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(204, 1, 884);
break;
case 110:
PART_31_ACTION_110();
break;
case 111:
- ADD_DIALOGUE_TEXT(206, 2, 886);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(206, 2, 886);
break;
case 112:
- ADD_DIALOGUE_TEXT(208, 1, 887);
- ADD_DIALOGUE_TEXT(209, 2, 888);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 208, 1, 887 }, { 209, 2, 888 } });
break;
case 113:
- ADD_DIALOGUE_TEXT(211, 1, 889);
- ADD_DIALOGUE_TEXT(212, 1, 890);
- ADD_DIALOGUE_TEXT(213, 1, 891);
- SET_DIALOGUE_TEXT(1, 3);
- startIgorDialogue();
+ igorSay({ { 211, 1, 889 }, { 212, 1, 890 }, { 213, 1, 891 } });
break;
case 114:
- ADD_DIALOGUE_TEXT(214, 1, 892);
- ADD_DIALOGUE_TEXT(215, 1, 893);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
+ igorSay({ { 214, 1, 892 }, { 215, 1, 893 } });
break;
case 115:
- ADD_DIALOGUE_TEXT(220, 3, 895);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(220, 3, 895);
break;
case 116:
- ADD_DIALOGUE_TEXT(218, 2, 894);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(218, 2, 894);
break;
default:
error("PART_31_EXEC_ACTION unhandled action %d", action);
@@ -149,9 +125,7 @@ void IgorEngine::PART_31_ACTION_103() {
waitForTimer(30);
}
}
- ADD_DIALOGUE_TEXT(202, 1, 882);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(202, 1, 882);
}
void IgorEngine::PART_31_ACTION_106() {
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index 60d9656a4c6..d762f7a5b5f 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -31,60 +31,40 @@ 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, 396);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 396);
break;
case 102:
- ADD_DIALOGUE_TEXT(202, 1, 397);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(202, 1, 397);
break;
case 103:
- ADD_DIALOGUE_TEXT(203, 1, 398);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 1, 398);
break;
case 104:
- ADD_DIALOGUE_TEXT(204, 1, 399);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(204, 1, 399);
break;
case 105:
- ADD_DIALOGUE_TEXT(205, 1, 400);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 1, 400);
break;
case 106:
- ADD_DIALOGUE_TEXT(206, 1, 401);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(206, 1, 401);
break;
case 107:
- ADD_DIALOGUE_TEXT(207, 1, 402);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(207, 1, 402);
break;
case 108:
- ADD_DIALOGUE_TEXT(208, 1, 403);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(208, 1, 403);
break;
case 109:
PART_33_ACTION_109();
break;
case 110:
- ADD_DIALOGUE_TEXT(209, 1, 404);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(209, 1, 404);
break;
case 111:
PART_33_ACTION_111();
break;
case 112:
- ADD_DIALOGUE_TEXT(213, 2, 407);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(213, 2, 407);
break;
case 113:
PART_33_ACTION_113();
@@ -103,15 +83,11 @@ void IgorEngine::PART_33_EXEC_ACTION(int action) {
void IgorEngine::PART_33_ACTION_109() {
if (_objectsState[4] == 0) {
- ADD_DIALOGUE_TEXT(201, 1, 396);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 396);
return;
}
if (_objectsState[74] == 1) {
- ADD_DIALOGUE_TEXT(222, 1, 413);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(222, 1, 413);
return;
}
for (int i = 1; i <= 3; ++i) {
@@ -123,25 +99,15 @@ void IgorEngine::PART_33_ACTION_109() {
addObjectToInventory(31, 66);
_objectsState[74] = 1;
PART_33_HELPER_1(255);
- ADD_DIALOGUE_TEXT(210, 1, 405);
- ADD_DIALOGUE_TEXT(211, 2, 406);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait({ { 210, 1, 405 }, { 211, 2, 406 } });
}
void IgorEngine::PART_33_ACTION_111() {
if (_objectsState[75] == 1) {
PART_33_HELPER_9();
PART_33_HELPER_1(255);
- ADD_DIALOGUE_TEXT(201, 1, 447);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(202, 2, 448);
- ADD_DIALOGUE_TEXT(204, 2, 449);
- SET_DIALOGUE_TEXT(1, 2);
- PART_33_HARRISON_SPEAKS();
+ igorSayAndWait(201, 1, 447);
+ PART_33_HARRISON_SPEAKS({ { 202, 2, 448 }, { 204, 2, 449 } });
loadResourceData__ROOM_Library();
PART_33_HELPER_1(255);
} else {
@@ -177,13 +143,8 @@ 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, 414);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(224, 1, 415);
- SET_DIALOGUE_TEXT(1, 1);
- PART_33_HARRISON_SPEAKS();
+ igorSayAndWait(223, 1, 414);
+ PART_33_HARRISON_SPEAKS({ { 224, 1, 415 } });
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);
@@ -191,27 +152,14 @@ void IgorEngine::PART_33_ACTION_114() {
waitForTimer(60);
}
removeObjectFromInventory(54);
- ADD_DIALOGUE_TEXT(225, 1, 416);
- SET_DIALOGUE_TEXT(1, 1);
- PART_33_HARRISON_SPEAKS();
+ PART_33_HARRISON_SPEAKS({ { 225, 1, 416 } });
for (int i = 0; i <= 28; ++i) {
memcpy(_screenVGA + i * 320 + 26279, _animFramesBuffer + i * 63 + 0x5827, 62);
}
- ADD_DIALOGUE_TEXT(226, 1, 417);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(227, 1, 418);
- SET_DIALOGUE_TEXT(1, 1);
- PART_33_HARRISON_SPEAKS();
- ADD_DIALOGUE_TEXT(228, 1, 419);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(229, 2, 420);
- ADD_DIALOGUE_TEXT(231, 2, 421);
- SET_DIALOGUE_TEXT(1, 2);
- PART_33_HARRISON_SPEAKS();
+ igorSayAndWait(226, 1, 417);
+ PART_33_HARRISON_SPEAKS({ { 227, 1, 418 } });
+ igorSayAndWait(228, 1, 419);
+ PART_33_HARRISON_SPEAKS({ { 229, 2, 420 }, { 231, 2, 421 } });
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);
@@ -220,9 +168,7 @@ void IgorEngine::PART_33_ACTION_114() {
}
addObjectToInventory(35, 70);
PART_33_HELPER_1(255);
- ADD_DIALOGUE_TEXT(233, 2, 422);
- SET_DIALOGUE_TEXT(1, 1);
- PART_33_HARRISON_SPEAKS();
+ PART_33_HARRISON_SPEAKS({ { 233, 2, 422 } });
_objectsState[75] = 1;
}
@@ -232,10 +178,7 @@ void IgorEngine::PART_33_ACTION_115() {
memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 63 + 0x5827, 62);
}
waitForTimer(60);
- ADD_DIALOGUE_TEXT(215, 2, 408);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(215, 2, 408);
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);
@@ -247,15 +190,11 @@ void IgorEngine::PART_33_ACTION_115() {
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
- ADD_DIALOGUE_TEXT(217, 2, 409);
- SET_DIALOGUE_TEXT(1, 1);
- PART_33_HARRISON_SPEAKS();
+ PART_33_HARRISON_SPEAKS({ { 217, 2, 409 } });
for (int i = 0; i <= 28; ++i) {
memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 63 + 0x5827, 62);
}
- ADD_DIALOGUE_TEXT(219, 1, 410);
- SET_DIALOGUE_TEXT(1, 1);
- PART_33_HARRISON_SPEAKS();
+ PART_33_HARRISON_SPEAKS({ { 219, 1, 410 } });
for (int i = 0; i <= 28; ++i) {
memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 63 + 0x5827, 62);
}
@@ -264,13 +203,10 @@ void IgorEngine::PART_33_ACTION_115() {
// The room's idle animation of Harrison is only driven by the room loop; the
// blocking dialogue loops never run it, otherwise it fights the talking frames.
-void IgorEngine::PART_33_HARRISON_SPEAKS() {
+void IgorEngine::PART_33_HARRISON_SPEAKS(const Common::Array<DialogueText> &lines) {
const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
_updateRoomBackground = 0;
- _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2;
- startCutsceneDialogue(47, 82, 0, 58, 40);
- waitForEndOfCutsceneDialogue(47, 82, 0, 58, 40);
- _updateDialogue = 0;
+ cutsceneSayWithCallback(47, 82, 0, 58, 40, lines, &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2);
_updateRoomBackground = updateRoomBackground;
}
@@ -348,13 +284,7 @@ void IgorEngine::PART_33_HELPER_2() {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5255) - 1, _screenVGA, true);
memcpy(_screenLayer1, _screenVGA, 46080);
fadeIn(624);
- ADD_DIALOGUE_TEXT(220, 1, 411);
- ADD_DIALOGUE_TEXT(221, 1, 412);
- 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;
+ cutsceneSayWithCallback(92, 79, 0, 58, 40, { { 220, 1, 411 }, { 221, 1, 412 } }, &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_1);
for (int i = 6; i <= 25; ++i) {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5253 + i * 2) - 1, _screenVGA, true);
waitForTimer(30);
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index dc03ca40baf..f22191e62f4 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -178,14 +178,10 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
_updateRoomBackground = &IgorEngine::PARK_UPDATE_AMBIENT_SOUND;
switch (action) {
case 101:
- ADD_DIALOGUE_TEXT(201, 2, 562);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 2, 562);
break;
case 102:
- ADD_DIALOGUE_TEXT(203, 2, 563);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 2, 563);
_objectsState[82] = 1;
PART_34_APPLY_OBJECT_STATE(3);
break;
@@ -193,22 +189,16 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
PART_34_ACTION_103_TAKE();
break;
case 104:
- ADD_DIALOGUE_TEXT(205, 1, 564);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 1, 564);
break;
case 105:
PART_34_ACTION_105_TALK();
break;
case 106:
- ADD_DIALOGUE_TEXT(206, 2, 565);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(206, 2, 565);
break;
case 107:
- ADD_DIALOGUE_TEXT(208, 2, 566);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(208, 2, 566);
break;
case 108:
PART_34_ACTION_108_OLD_LADY();
@@ -225,9 +215,7 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
void IgorEngine::PART_34_ACTION_103_TAKE() {
if (_inventoryInfo[62] != 0) {
- ADD_DIALOGUE_TEXT(210, 1, 567);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(210, 1, 567);
return;
}
PARK_PICK_UP_ANIMATION(16499, kParkPickUpFrames);
@@ -248,19 +236,14 @@ void IgorEngine::PART_34_ACTION_105_TALK() {
*/
void IgorEngine::PART_34_ACTION_108_OLD_LADY() {
PARK_DRAW_LADY_FRAME(_screenVGA, 1);
- ADD_DIALOGUE_TEXT(211, 2, 568);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(211, 2, 568);
PARK_WAIT_FOR_IGOR_DIALOGUE();
for (int frame = 12; frame <= 13; ++frame) {
PARK_DRAW_LADY_FRAME(_screenVGA, frame);
waitForTimer(45);
}
if (_objectsState[1] == 0) {
- ADD_DIALOGUE_TEXT(213, 1, 569);
- ADD_DIALOGUE_TEXT(216, 1, 570);
- SET_DIALOGUE_TEXT(1, 2);
- startCutsceneDialogue(121, 58, 63, 23, 0);
+ cutsceneSayStart(121, 58, 63, 23, 0, { { 213, 1, 569 }, { 216, 1, 570 } });
PARK_WAIT_FOR_LADY_DIALOGUE();
for (int frame = 14; frame >= 12; --frame) {
PARK_DRAW_LADY_FRAME(_screenVGA, frame);
@@ -271,10 +254,7 @@ void IgorEngine::PART_34_ACTION_108_OLD_LADY() {
return;
}
- ADD_DIALOGUE_TEXT(217, 1, 571);
- ADD_DIALOGUE_TEXT(218, 1, 572);
- SET_DIALOGUE_TEXT(1, 2);
- startCutsceneDialogue(121, 58, 63, 23, 0);
+ cutsceneSayStart(121, 58, 63, 23, 0, { { 217, 1, 571 }, { 218, 1, 572 } });
PARK_WAIT_FOR_LADY_DIALOGUE();
_parkLadyIdleStep = 1;
for (uint i = 0; i < ARRAYSIZE(kOldLadyPetFrames); ++i) {
@@ -282,12 +262,7 @@ void IgorEngine::PART_34_ACTION_108_OLD_LADY() {
waitForTimer(45);
}
removeObjectFromInventory(59);
- ADD_DIALOGUE_TEXT(219, 2, 573);
- ADD_DIALOGUE_TEXT(221, 2, 574);
- ADD_DIALOGUE_TEXT(223, 1, 575);
- ADD_DIALOGUE_TEXT(224, 2, 576);
- SET_DIALOGUE_TEXT(1, 4);
- startCutsceneDialogue(121, 58, 63, 23, 0);
+ cutsceneSayStart(121, 58, 63, 23, 0, { { 219, 2, 573 }, { 221, 2, 574 }, { 223, 1, 575 }, { 224, 2, 576 } });
PARK_WAIT_FOR_LADY_DIALOGUE();
for (uint i = 0; i < ARRAYSIZE(kOldLadyBagFrames); ++i) {
PARK_DRAW_LADY_FRAME(_screenVGA, kOldLadyBagFrames[i]);
@@ -297,18 +272,11 @@ void IgorEngine::PART_34_ACTION_108_OLD_LADY() {
waitForTimer();
}
addObjectToInventory(26, 61);
- ADD_DIALOGUE_TEXT(226, 1, 577);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(226, 1, 577);
PARK_WAIT_FOR_IGOR_DIALOGUE();
- ADD_DIALOGUE_TEXT(227, 2, 578);
- ADD_DIALOGUE_TEXT(229, 1, 579);
- SET_DIALOGUE_TEXT(1, 2);
- startCutsceneDialogue(121, 58, 63, 23, 0);
+ cutsceneSayStart(121, 58, 63, 23, 0, { { 227, 2, 578 }, { 229, 1, 579 } });
PARK_WAIT_FOR_LADY_DIALOGUE();
- ADD_DIALOGUE_TEXT(230, 1, 580);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(230, 1, 580);
PARK_WAIT_FOR_IGOR_DIALOGUE();
for (int frame = 18; frame <= 31; ++frame) {
PARK_DRAW_LADY_FRAME(_screenVGA, frame);
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index eb911b35935..35fc9ccab80 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -28,9 +28,7 @@ void IgorEngine::PART_35_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_35_EXEC_ACTION %d", action);
switch (action) {
case 101:
- ADD_DIALOGUE_TEXT(201, 2, 611);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 2, 611);
_objectsState[82] = 1;
PART_35_APPLY_OBJECT_STATE(3);
break;
@@ -38,19 +36,13 @@ void IgorEngine::PART_35_EXEC_ACTION(int action) {
PART_35_ACTION_102_TAKE();
break;
case 103:
- ADD_DIALOGUE_TEXT(203, 1, 612);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 1, 612);
break;
case 104:
- ADD_DIALOGUE_TEXT(204, 1, 613);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(204, 1, 613);
break;
case 105:
- ADD_DIALOGUE_TEXT(205, 1, 614);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 1, 614);
break;
case 106:
PART_35_ACTION_106_EXIT_TO_MAP();
@@ -66,9 +58,7 @@ void IgorEngine::PART_35_EXEC_ACTION(int action) {
void IgorEngine::PART_35_ACTION_102_TAKE() {
if (_inventoryInfo[62] != 0) {
- ADD_DIALOGUE_TEXT(206, 1, 615);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(206, 1, 615);
return;
}
PARK_PICK_UP_ANIMATION(16339, kParkFrames);
diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp
index 8bf12da0e28..bc1601cf7ec 100644
--- a/engines/igor/parts/part_36.cpp
+++ b/engines/igor/parts/part_36.cpp
@@ -27,42 +27,28 @@ namespace Igor {
void IgorEngine::PART_36_EXEC_ACTION(int action) {
switch (action) {
case 101:
- ADD_DIALOGUE_TEXT(201, 1, 655);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 655);
break;
case 102:
PART_36_ACTION_102();
break;
case 103:
- ADD_DIALOGUE_TEXT(202, 1, 656);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(202, 1, 656);
break;
case 104:
- ADD_DIALOGUE_TEXT(203, 1, 657);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 1, 657);
break;
case 105:
- ADD_DIALOGUE_TEXT(204, 2, 658);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(204, 2, 658);
break;
case 106:
- ADD_DIALOGUE_TEXT(209, 1, 661);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(209, 1, 661);
break;
case 107:
- ADD_DIALOGUE_TEXT(206, 2, 659);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(206, 2, 659);
break;
case 108:
- ADD_DIALOGUE_TEXT(208, 1, 660);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(208, 1, 660);
break;
case 109:
_currentPart = 242;
diff --git a/engines/igor/parts/part_37.cpp b/engines/igor/parts/part_37.cpp
index 5d6a4c3f381..ea72510c022 100644
--- a/engines/igor/parts/part_37.cpp
+++ b/engines/igor/parts/part_37.cpp
@@ -33,24 +33,16 @@ void IgorEngine::PART_37_EXEC_ACTION(int action) {
PART_37_ACTION_102();
break;
case 103:
- ADD_DIALOGUE_TEXT(203, 2, 664);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 2, 664);
break;
case 104:
- ADD_DIALOGUE_TEXT(205, 1, 665);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(205, 1, 665);
break;
case 105:
- ADD_DIALOGUE_TEXT(207, 1, 667);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(207, 1, 667);
break;
case 106:
- ADD_DIALOGUE_TEXT(206, 1, 666);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(206, 1, 666);
break;
default:
error("PART_37_EXEC_ACTION unhandled action %d", action);
@@ -60,15 +52,10 @@ void IgorEngine::PART_37_EXEC_ACTION(int action) {
void IgorEngine::PART_37_ACTION_102() {
if (_objectsState[89] == 1) {
- ADD_DIALOGUE_TEXT(202, 1, 663);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(202, 1, 663);
return;
}
- ADD_DIALOGUE_TEXT(201, 1, 662);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(201, 1, 662);
for (int i = 1; i >= 0; --i) {
int offset = 16423;
for (int j = 0; j <= 49; ++j) {
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index 79ac7f969b6..17c7f941439 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -27,9 +27,7 @@ namespace Igor {
switch (action) {
case 101: {
// Look at water
- ADD_DIALOGUE_TEXT(201, 2, 478);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 2, 478);
break;
}
case 102:
@@ -41,9 +39,7 @@ namespace Igor {
break;
case 104:
// Look at photographer
- ADD_DIALOGUE_TEXT(203, 2, 479);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 2, 479);
break;
case 105:
// go to map
diff --git a/engines/igor/parts/part_50.cpp b/engines/igor/parts/part_50.cpp
index 2866df3276d..c32deec23d2 100644
--- a/engines/igor/parts/part_50.cpp
+++ b/engines/igor/parts/part_50.cpp
@@ -37,9 +37,7 @@ void IgorEngine::PART_50_EXEC_ACTION(int action) {
PART_50_ACTION_101_enterMaze();
break;
case 102:
- ADD_DIALOGUE_TEXT(201, 1, 1083);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 1, 1083);
break;
case 103:
_objectsState[90] = 0;
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index 7441a9542e1..82126a48c2e 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -73,9 +73,7 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
switch (action) {
case 101:
//Look at water
- ADD_DIALOGUE_TEXT(201, 2, 480);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(201, 2, 480);
break;
case 102:
PART_06_ACTION_102_scrollLeft();
@@ -84,17 +82,13 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
PART_06_ACTION_103_talkToPhotographer();
break;
case 104: // look at photographer
- ADD_DIALOGUE_TEXT(203, 1, 481);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(203, 1, 481);
break;
case 105:
PART_06_ACTION_105();
break;
case 106: // Look at camera
- ADD_DIALOGUE_TEXT(204, 1, 482);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(204, 1, 482);
break;
case 107:
PART_06_ACTION_107_giveAnythingToPhotographer();
@@ -109,15 +103,9 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
}
void IgorEngine::PART_06_ACTION_103_talkToPhotographer() {
- ADD_DIALOGUE_TEXT(215, 1, 489);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(215, 1, 489);
PART_06_HELPER_8_animatePhotographer(0);
- ADD_DIALOGUE_TEXT(216, 1, 490);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(170, 69, 55, 37, 63);
- waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63);
+ cutsceneSay(170, 69, 55, 37, 63, 216, 1, 490);
PART_06_HANDLE_DIALOGUE_PHOTOGRAPHER();
PART_06_HELPER_6_setPhotographerState(255);
}
@@ -203,27 +191,14 @@ void IgorEngine::PART_06_ACTION_105() {
void IgorEngine::PART_06_ACTION_107_giveAnythingToPhotographer() {
PART_06_HELPER_8_animatePhotographer(0);
- ADD_DIALOGUE_TEXT(205, 1, 483);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(206, 2, 484);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(170, 69, 55, 37, 63);
- waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63);
+ igorSayAndWait(205, 1, 483);
+ cutsceneSay(170, 69, 55, 37, 63, 206, 2, 484);
}
void IgorEngine::PART_06_ACTION_108_giveRocketToPhotographer() {
PART_06_HELPER_8_animatePhotographer(0);
- ADD_DIALOGUE_TEXT(208, 2, 485);
- ADD_DIALOGUE_TEXT(210, 2, 486);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
- ADD_DIALOGUE_TEXT(212, 1, 487);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(170, 69, 55, 37, 63);
- waitForEndOfCutsceneDialogue(170, 69, 55, 37, 63);
+ igorSayAndWait({ { 208, 2, 485 }, { 210, 2, 486 } });
+ cutsceneSay(170, 69, 55, 37, 63, 212, 1, 487);
int i = 7;
_gameTicks = 0;
do {
@@ -243,9 +218,7 @@ void IgorEngine::PART_06_ACTION_108_giveRocketToPhotographer() {
_objectsState[61] = 0;
PART_06_HELPER_6_setPhotographerState(255);
_gameState.unkF = false;
- ADD_DIALOGUE_TEXT(213, 2, 488);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
+ igorSay(213, 2, 488);
}
void IgorEngine::PART_06_ACTION_102_scrollLeft() {
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index 874cccf6543..82ff7846268 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -35,10 +35,7 @@ void IgorEngine::PART_07_openCloseDoor(int door, bool open) {
const int stateIndex = door == 1 ? 26 : 27;
if ((_objectsState[stateIndex] != 0) == open) {
const int text = open ? 19 : 23;
- ADD_DIALOGUE_TEXT(text, 1, text);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(text, 1, text);
return;
}
@@ -98,11 +95,7 @@ void IgorEngine::PART_07_ENTER_FROM_OUTSIDE() {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- ADD_DIALOGUE_TEXT(206, 2, 144);
- ADD_DIALOGUE_TEXT(208, 4, 145);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait({ { 206, 2, 144 }, { 208, 4, 145 } });
_part07FirstVisitDone = true;
} else {
buildWalkPath(109, 143, 129, 138);
@@ -128,16 +121,10 @@ void IgorEngine::PART_07_EXIT_TO_OUTSIDE() {
void IgorEngine::PART_07_EXEC_ACTION(int action) {
switch (action) {
case 101: // Look at dean's plaque
- ADD_DIALOGUE_TEXT(201, 1, 140);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(201, 1, 140);
break;
case 102: // Look at dean's door
- ADD_DIALOGUE_TEXT(202, 2, 141);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(202, 2, 141);
break;
case 103:
PART_07_openCloseDoor(1, true);
@@ -152,40 +139,23 @@ void IgorEngine::PART_07_EXEC_ACTION(int action) {
PART_07_openCloseDoor(2, false);
break;
case 107: // Secretary's plaque
- ADD_DIALOGUE_TEXT(204, 1, 142);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(204, 1, 142);
break;
case 108: // Look at messageboard
switch (getRandomNumber(2)) {
case 0:
- ADD_DIALOGUE_TEXT(205, 1, 143);
- ADD_DIALOGUE_TEXT(206, 2, 144);
- ADD_DIALOGUE_TEXT(208, 4, 145);
- SET_DIALOGUE_TEXT(1, 3);
+ igorSayAndWait({ { 205, 1, 143 }, { 206, 2, 144 }, { 208, 4, 145 } });
break;
case 1:
- ADD_DIALOGUE_TEXT(213, 2, 147);
- SET_DIALOGUE_TEXT(1, 1);
+ igorSayAndWait(213, 2, 147);
break;
case 2:
- ADD_DIALOGUE_TEXT(215, 1, 148);
- ADD_DIALOGUE_TEXT(216, 1, 149);
- ADD_DIALOGUE_TEXT(217, 1, 150);
- ADD_DIALOGUE_TEXT(218, 1, 151);
- ADD_DIALOGUE_TEXT(219, 1, 152);
- SET_DIALOGUE_TEXT(1, 5);
+ igorSayAndWait({ { 215, 1, 148 }, { 216, 1, 149 }, { 217, 1, 150 }, { 218, 1, 151 }, { 219, 1, 152 } });
break;
}
- startIgorDialogue();
- waitForEndOfIgorDialogue();
break;
case 109: // Look at stairs
- ADD_DIALOGUE_TEXT(212, 1, 146);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(212, 1, 146);
break;
case 110:
PART_07_EXIT_TO_OUTSIDE();
diff --git a/engines/igor/parts/part_75.cpp b/engines/igor/parts/part_75.cpp
index 427d76bf035..2c96bcb27d3 100644
--- a/engines/igor/parts/part_75.cpp
+++ b/engines/igor/parts/part_75.cpp
@@ -66,45 +66,30 @@ void IgorEngine::PART_75() {
memset(_currentPalette, 0, 768);
fadeIn(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);
+ cutsceneSay(187, 82, 63, 63, 0, { { 201, 1, 1156 }, { 202, 2, 1157 }, { 204, 1, 1158 } });
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);
+ cutsceneSay(187, 82, 63, 63, 0, { { 205, 1, 1159 }, { 206, 1, 1160 } });
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);
+ cutsceneSayStart(187, 82, 63, 63, 0, 208, 1);
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);
+ cutsceneSayStart(187, 82, 63, 63, 0, 209, 1);
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);
+ cutsceneSayStart(187, 82, 63, 63, 0, 210, 1);
for (int i = 1; i <= 40; ++i) {
PART_75_HELPER_1(getRandomNumber(3) + 37);
waitForTimer(30);
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index 70cf7023036..9e155ce79c0 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -54,10 +54,7 @@ void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
void IgorEngine::drawDoor(bool open) {
if ((_objectsState[26] != 0) == open) {
const int text = open ? 19 : 23;
- ADD_DIALOGUE_TEXT(text, 1, text);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(text, 1, text);
return;
}
@@ -184,12 +181,7 @@ void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
memcpy(_screenLayer1, _screenVGA, 46080);
fadeIn(624);
- ADD_DIALOGUE_TEXT(226, 1, 254);
- SET_DIALOGUE_TEXT(1, 1);
- _updateDialogue = &IgorEngine::PART_08_UPDATE_DIALOGUE_SECRETARY;
- startCutsceneDialogue(65, 70, 0, 59, 63);
- waitForEndOfCutsceneDialogue(65, 70, 0, 59, 63);
- _updateDialogue = 0;
+ cutsceneSayWithCallback(65, 70, 0, 59, 63, { { 226, 1, 254 } }, &IgorEngine::PART_08_UPDATE_DIALOGUE_SECRETARY);
for (int frame = 5; frame <= 19; ++frame) {
drawSecretaryTalkingFrame(frame);
@@ -234,9 +226,7 @@ void IgorEngine::PART_08_DEAN_DRINKS() {
_gameState.talkMode = kTalkModeTextOnly;
waitForTimer(255);
- ADD_DIALOGUE_TEXT(229, 1, 0);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(78, 75, 26, 58, 0);
+ cutsceneSayStart(78, 75, 26, 58, 0, 229, 1, 0);
playSound(61, 1);
for (int step = 1; step <= 20; ++step) {
@@ -249,9 +239,7 @@ void IgorEngine::PART_08_DEAN_DRINKS() {
if (step == 10) {
memcpy(_screenVGA + _dialogueDirtyRectY,
_screenTextLayer + 320 * 72, _dialogueDirtyRectSize);
- ADD_DIALOGUE_TEXT(230, 1, 0);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(78, 75, 26, 58, 0);
+ cutsceneSayStart(78, 75, 26, 58, 0, 230, 1, 0);
}
}
@@ -275,22 +263,13 @@ void IgorEngine::PART_08_HANDLE_DIALOGUE_DEAN() {
void IgorEngine::PART_08_ACTION_103_TALK_TO_DEAN() {
if (_objectsState[29] == 1) {
- ADD_DIALOGUE_TEXT(223, 1, 169);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(223, 1, 169);
return;
}
if (_objectsState[26] == 1) { // door open
drawDean();
- ADD_DIALOGUE_TEXT(220, 1, 166);
- ADD_DIALOGUE_TEXT(221, 1, 167);
- SET_DIALOGUE_TEXT(1, 2);
- _updateDialogue = &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN;
- startCutsceneDialogue(78, 75, 26, 58, 0);
- waitForEndOfCutsceneDialogue(78, 75, 26, 58, 0);
- _updateDialogue = 0;
+ cutsceneSayWithCallback(78, 75, 26, 58, 0, { { 220, 1, 166 }, { 221, 1, 167 } }, &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN);
PART_08_APPLY_OBJECT_STATE(255);
return;
}
@@ -302,25 +281,16 @@ void IgorEngine::PART_08_ACTION_103_TALK_TO_DEAN() {
void IgorEngine::giveBottleToDean() {
if (_objectsState[29] == 1) {
- ADD_DIALOGUE_TEXT(227, 1, 172);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(227, 1, 172);
return;
}
if (_objectsState[0] == 1) {
- ADD_DIALOGUE_TEXT(226, 1, 171);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(226, 1, 171);
return;
}
drawDean();
- ADD_DIALOGUE_TEXT(210, 2, 158);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(210, 2, 158);
static const uint8 deanFrames[] = { 1, 2, 3, 0 };
static const uint8 igorFrames[] = { 0, 1, 2, 3 };
@@ -351,15 +321,7 @@ void IgorEngine::giveBottleToDean() {
drawInventory(_inventoryInfo[72], 0);
}
- ADD_DIALOGUE_TEXT(216, 1, 162);
- ADD_DIALOGUE_TEXT(217, 1, 163);
- ADD_DIALOGUE_TEXT(218, 1, 164);
- ADD_DIALOGUE_TEXT(219, 1, 165);
- SET_DIALOGUE_TEXT(1, 4);
- _updateDialogue = &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN;
- startCutsceneDialogue(78, 75, 26, 58, 0);
- waitForEndOfCutsceneDialogue(78, 75, 26, 58, 0);
- _updateDialogue = 0;
+ cutsceneSayWithCallback(78, 75, 26, 58, 0, { { 216, 1, 162 }, { 217, 1, 163 }, { 218, 1, 164 }, { 219, 1, 165 } }, &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN);
_objectsState[30] = _objectsState[0] < 2 ? 1 : 2;
drawInventory(_inventoryInfo[72], 0);
playSound(63, 1);
@@ -402,10 +364,7 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
}
break;
case 102: // Look at window
- ADD_DIALOGUE_TEXT(202, 1, 153);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(202, 1, 153);
break;
case 104: // Look at dean
if (_objectsState[29] == 1)
@@ -417,22 +376,13 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
waitForEndOfIgorDialogue();
break;
case 107: // look at intercom
- ADD_DIALOGUE_TEXT(205, 2, 155);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(205, 2, 155);
break;
case 110: // look at bookcase
- ADD_DIALOGUE_TEXT(207, 2, 156);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(207, 2, 156);
break;
case 111: // look at door
- ADD_DIALOGUE_TEXT(209, 1, 157);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(209, 1, 157);
break;
case 105:
PART_08_ACTION_105();
@@ -442,30 +392,18 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
break;
case 108:
if (_objectsState[29] == 0) {
- ADD_DIALOGUE_TEXT(212, 1, 159);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(212, 1, 159);
} else if (_objectsState[32] == 1) {
- ADD_DIALOGUE_TEXT(224, 2, 170);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(224, 2, 170);
} else {
PART_08_ACTION_108_deanCallsSecretary();
}
break;
case 109:
if (_objectsState[29] == 0) {
- ADD_DIALOGUE_TEXT(213, 2, 160);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(213, 2, 160);
} else if (_objectsState[28] == 1) {
- ADD_DIALOGUE_TEXT(215, 1, 161);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(215, 1, 161);
} else {
PART_08_ACTION_109();
}
diff --git a/engines/igor/parts/part_85.cpp b/engines/igor/parts/part_85.cpp
index 92f18d6312d..59193fa5d4a 100644
--- a/engines/igor/parts/part_85.cpp
+++ b/engines/igor/parts/part_85.cpp
@@ -83,42 +83,25 @@ void IgorEngine::PART_85() {
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);
+ cutsceneSayStart(113, 59, 63, 0, 38, 205, 3, 547);
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);
+ cutsceneSayStart(89, 56, 63, 63, 0, 208, 1, 548);
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);
+ cutsceneSayStart(113, 59, 63, 0, 38, { { 209, 2, 549 }, { 211, 1, 550 }, { 212, 1, 551 }, { 213, 1, 552 }, { 214, 1, 553 } });
VAR_CURRENT_TALKING_ACTOR = 1;
waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
PART_85_HELPER_1_PLAY_ANIM(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);
+ cutsceneSayStart(89, 56, 63, 63, 0, { { 215, 1, 554 }, { 216, 2, 555 }, { 218, 1, 556 } });
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);
+ cutsceneSayStart(113, 59, 63, 0, 38, { { 219, 2, 557 }, { 221, 2, 558 } });
VAR_CURRENT_TALKING_ACTOR = 1;
waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
@@ -143,21 +126,14 @@ void IgorEngine::PART_85() {
_walkData[0].scaleWidth = 50;
_walkDataLastIndex = 1;
_walkCurrentPos = 4;
- ADD_DIALOGUE_TEXT(223, 2, 559);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(223, 2, 559);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
PART_85_HELPER_1_PLAY_ANIM(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();
+ igorSayAndWait({ { 225, 2, 560 }, { 227, 3, 561 } });
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
PART_85_HELPER_1_PLAY_ANIM(0x74CA, 0xA6C4, 10, 24, 16);
if (_game.version == kIdSpaCD) {
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index d5730154709..79819428ebd 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -147,12 +147,7 @@ void IgorEngine::PART_09_ACTION_101_openFileCabinet() {
waitForTimer(i >= 3 && i <= 14 ? 31 : 61);
}
_walkData[_walkDataLastIndex - 1].posNum = kFacingPositionFront;
- ADD_DIALOGUE_TEXT(221, 1, 249);
- ADD_DIALOGUE_TEXT(222, 1, 250);
- ADD_DIALOGUE_TEXT(223, 1, 251);
- SET_DIALOGUE_TEXT(1, 3);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait({ { 221, 1, 249 }, { 222, 1, 250 }, { 223, 1, 251 } });
for (int frame = 7; frame >= 6; --frame) {
for (int y = 0; y <= 48; ++y)
memcpy(_screenVGA + 0x7595 + y * 320, _animFramesBuffer + 0x9BD8 + frame * 0x83B + y * 43, 43);
@@ -218,10 +213,7 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
PART_09_ACTION_101_openFileCabinet();
break;
case 102: // look at file cabinet
- ADD_DIALOGUE_TEXT(201, 2, 234);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(201, 2, 234);
break;
case 103: // talk to secretary
{
@@ -238,17 +230,11 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
PART_09_APPLY_OBJECT_STATE(255);
break;
case 104: // look at secretary
- ADD_DIALOGUE_TEXT(203, 2, 235);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(203, 2, 235);
break;
case 105: { // look at closet
const int text = _objectsState[34] == 0 ? 205 : (_objectsState[36] == 0 ? 218 : 219);
- ADD_DIALOGUE_TEXT(text, _objectsState[34] == 0 ? 2 : 1, _objectsState[34] == 0 ? 236 : text + 28);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(text, _objectsState[34] == 0 ? 2 : 1, _objectsState[34] == 0 ? 236 : text + 28);
break;
}
case 106:
@@ -258,33 +244,20 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
if (_objectsState[34] == 0) {
executeAction(13);
} else {
- ADD_DIALOGUE_TEXT(217, 1, 245);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(217, 1, 245);
}
break;
case 108: // look at intercom
- ADD_DIALOGUE_TEXT(207, 1, 237);
- ADD_DIALOGUE_TEXT(208, 1, 238);
- SET_DIALOGUE_TEXT(1, 2);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait({ { 207, 1, 237 }, { 208, 1, 238 } });
break;
case 109:
- ADD_DIALOGUE_TEXT(_objectsState[35] == 0 ? 216 : 224, 1, _objectsState[35] == 0 ? 244 : 252);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(_objectsState[35] == 0 ? 216 : 224, 1, _objectsState[35] == 0 ? 244 : 252);
break;
case 110:
PART_09_ACTION_110();
break;
case 112: // look at door
- ADD_DIALOGUE_TEXT(211, 1, 240);
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue();
+ igorSayAndWait(211, 1, 240);
break;
case 113: // open door
PART_09_ANIMATE_DOOR(true);
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 05e43686c24..c489b657aa2 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -208,6 +208,68 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
_inputVars[kInputSkipDialogue] = 0;
}
+void IgorEngine::queueDialogueLines(const Common::Array<DialogueText> &lines) {
+ for (uint i = 0; i < lines.size(); ++i)
+ ADD_DIALOGUE_TEXT(lines[i].num, lines[i].count, lines[i].sound);
+ SET_DIALOGUE_TEXT(1, lines.size());
+}
+
+void IgorEngine::igorSay(const Common::Array<DialogueText> &lines) {
+ queueDialogueLines(lines);
+ startIgorDialogue();
+}
+
+void IgorEngine::igorSay(int num, int count, int sound) {
+ igorSay({ { num, count, sound } });
+}
+
+void IgorEngine::igorSayAndWait(const Common::Array<DialogueText> &lines) {
+ igorSay(lines);
+ waitForEndOfIgorDialogue();
+}
+
+void IgorEngine::igorSayAndWait(int num, int count, int sound) {
+ igorSayAndWait({ { num, count, sound } });
+}
+
+void IgorEngine::cutsceneSayStart(int x, int y, int r, int g, int b, const Common::Array<DialogueText> &lines) {
+ queueDialogueLines(lines);
+ startCutsceneDialogue(x, y, r, g, b);
+}
+
+void IgorEngine::cutsceneSayStart(int x, int y, int r, int g, int b, int num, int count, int sound) {
+ cutsceneSayStart(x, y, r, g, b, { { num, count, sound } });
+}
+
+void IgorEngine::cutsceneSay(int x, int y, int r, int g, int b, const Common::Array<DialogueText> &lines) {
+ cutsceneSayStart(x, y, r, g, b, lines);
+ waitForEndOfCutsceneDialogue(x, y, r, g, b);
+}
+
+void IgorEngine::cutsceneSay(int x, int y, int r, int g, int b, int num, int count, int sound) {
+ cutsceneSay(x, y, r, g, b, { { num, count, sound } });
+}
+
+void IgorEngine::cutsceneSayStartWithCallback(int x, int y, int r, int g, int b, const Common::Array<DialogueText> &lines, UpdateDialogueProc update) {
+ queueDialogueLines(lines);
+ _updateDialogue = update;
+ startCutsceneDialogue(x, y, r, g, b);
+}
+
+void IgorEngine::cutsceneSayStartWithCallback(int x, int y, int r, int g, int b, int num, int count, int sound, UpdateDialogueProc update) {
+ cutsceneSayStartWithCallback(x, y, r, g, b, { { num, count, sound } }, update);
+}
+
+void IgorEngine::cutsceneSayWithCallback(int x, int y, int r, int g, int b, const Common::Array<DialogueText> &lines, UpdateDialogueProc update) {
+ cutsceneSayStartWithCallback(x, y, r, g, b, lines, update);
+ waitForEndOfCutsceneDialogue(x, y, r, g, b);
+ _updateDialogue = nullptr;
+}
+
+void IgorEngine::cutsceneSayWithCallback(int x, int y, int r, int g, int b, int num, int count, int sound, UpdateDialogueProc update) {
+ cutsceneSayWithCallback(x, y, r, g, b, { { num, count, sound } }, update);
+}
+
/**
* Loop for character talking
*/
Commit: 2212efb80edfe9f04f6203e719b2e93ce1537265
https://github.com/scummvm/scummvm/commit/2212efb80edfe9f04f6203e719b2e93ce1537265
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:33+01:00
Commit Message:
IGOR: Refactor draw routines to reuse code
Changed paths:
A engines/igor/graphics.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/module.mk
engines/igor/parts/part_0.cpp
engines/igor/parts/part_1.cpp
engines/igor/parts/part_10.cpp
engines/igor/parts/part_11.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_15.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_18.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_22.cpp
engines/igor/parts/part_23.cpp
engines/igor/parts/part_24.cpp
engines/igor/parts/part_25.cpp
engines/igor/parts/part_26.cpp
engines/igor/parts/part_27.cpp
engines/igor/parts/part_28.cpp
engines/igor/parts/part_31.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
engines/igor/parts/part_36.cpp
engines/igor/parts/part_37.cpp
engines/igor/parts/part_4.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_7.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_85.cpp
engines/igor/parts/part_9.cpp
engines/igor/parts/part_maze.cpp
engines/igor/resource.cpp
diff --git a/engines/igor/graphics.cpp b/engines/igor/graphics.cpp
new file mode 100644
index 00000000000..8294344bc4c
--- /dev/null
+++ b/engines/igor/graphics.cpp
@@ -0,0 +1,346 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+/**
+ * Copies a w x h block between two pixel buffers (each with its own pitch).
+ * Transparent copies skip source pixels equal to 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;
+ }
+}
+
+/**
+ * Draws a block of w x h pixels stored row after row (pitch == w) in the animation frames buffer onto the screen at the given screen offset.
+ * With alsoBackground the raw block is also written to the room background (_screenLayer1), so it persists when the screen is redrawn.
+ *
+ * "blend" selects how the block is combined with what is already there:
+ * kBlendCopy plain copy
+ * kBlendLitSprite sprite pixels with colors 0xC0-0xCF (Igors colors) are replaced by the background pixel or darkened according to the lighting area they land in;
+ * use it for sprites that move through lit and shaded parts of a room
+ * kBlendBehindIgor the block is drawn behind Igor: screen pixels with colors 0xC0-0xCF are kept
+ * kBlendBehindIgorAndText same, and screen pixels with the dialogue text colors 0xF0-0xF1 are kept too
+ */
+void IgorEngine::drawAnimRect(int dstOffset, int animOffset, int w, int h, bool alsoBackground, AnimBlend blend) {
+ const uint8 *src = _animFramesBuffer + animOffset;
+ if (blend == kBlendCopy) {
+ copyArea(_screenVGA, dstOffset, 320, src, w, w, h);
+ } else {
+ assert(w <= 100);
+ for (int y = 0; y < h; ++y) {
+ for (int x = 0; x < w; ++x) {
+ const int dst = dstOffset + y * 320 + x;
+ uint8 color = src[y * w + x];
+ if (blend == kBlendLitSprite) {
+ if (color >= 0xC0 && color <= 0xCF) {
+ const RoomObjectArea &area = _roomObjectAreasTable[_screenLayer2[dst]];
+ if (area.y1Lum > 0)
+ color = _screenLayer1[dst];
+ else if (area.y2Lum > 0)
+ color -= area.deltaLum;
+ }
+ } else {
+ const uint8 onScreen = _screenVGA[dst];
+ if ((onScreen >= 0xC0 && onScreen <= 0xCF) ||
+ (blend == kBlendBehindIgorAndText && onScreen >= 0xF0 && onScreen <= 0xF1))
+ color = onScreen;
+ }
+ _screenTempLayer[y * 100 + x] = color;
+ }
+ }
+ copyArea(_screenVGA, dstOffset, 320, _screenTempLayer, 100, w, h);
+ }
+ if (alsoBackground)
+ copyArea(_screenLayer1, dstOffset, 320, src, w, w, h);
+}
+
+/**
+ * Plays the frames from firstFrame to lastFrame (either direction) of a sprite strip with drawAnimRect(kBlendLitSprite)
+ * (frames of frameSize bytes starting at srcOffset, each width x height), waiting "delay" ticks between frames. When soundFrame is drawn,
+ * "sound" is played.
+ */
+void IgorEngine::animateLitAnimFrames(int srcOffset, int firstFrame, int lastFrame,
+ int frameSize, int width, int height, int dstOffset, int delay,
+ int soundFrame, int sound) {
+ const int step = firstFrame <= lastFrame ? 1 : -1;
+ for (int frame = firstFrame;; frame += step) {
+ drawAnimRect(dstOffset, srcOffset + frame * frameSize, width, height, false, kBlendLitSprite);
+ if (frame == soundFrame)
+ playSound(sound, 1);
+ if (frame != lastFrame)
+ waitForTimer(delay);
+ if (frame == lastFrame)
+ break;
+ }
+}
+
+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;
+}
+
+/**
+ * extracts from src a frame and draws it into dst, optionally preserving text
+ */
+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] != _talkColorIndex && dst[i] != _talkShadowIndex) {
+ 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] != _talkColorIndex && dst[i] != _talkShadowIndex) {
+ dst[i] = src[i - pos];
+ }
+ }
+ } else {
+ memcpy(dst + pos, src, len);
+ }
+ src += len;
+ pos += len;
+ }
+ }
+ y += 320;
+ }
+}
+
+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;
+ }
+ }
+ copyArea(_screenVGA, 320 * 156 + verb * 46, 320, verbBitmap, 44, 44, 12);
+ }
+}
+
+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::drawInventory(int start, int mode) {
+ loadData(IMG_InventoryPanel, _inventoryPanelBuffer);
+ loadData(IMG_Objects, _inventoryImagesBuffer);
+ int y, i;
+ int end = start + 7; // seven slots
+ int x = 1;
+ // Paint inventory icons
+ 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;
+ }
+ // Hide arrows
+ 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: // normal inventory rendering
+ memcpy(_screenVGA + 54400, _inventoryPanelBuffer, 9600);
+ _scrollInventory = false;
+ break;
+ case 1: // animation scrolling up
+ 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: // animation scrolling down
+ 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;
+ }
+}
+
+/**
+ * Idle animation of Igor (blinking): draws one or two single pixels (palette color 196, or 195 when fl is 1)
+ * at fixed offsets from his head, depending on the way he faces. The pixels follow the room's shading
+ * (they are skipped in shaded areas and darkened by the area's deltaLum when enableLight is 1).
+ * Nothing is drawn unless Igor is at his default size (scaleHeight 50), or while dialogue text is running.
+ */
+void IgorEngine::updateIgorIdleAnimation(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;
+ }
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 49ab813962d..d9e8e6288b4 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -289,7 +289,7 @@ void IgorEngine::runPartLoop() {
handleRoomInventoryScroll();
}
if (compareGameTick(1)) {
- handleRoomLight();
+ handleIgorIdleAnimation();
}
if (_updateRoomBackground) {
(this->*_updateRoomBackground)();
@@ -326,182 +326,24 @@ void IgorEngine::handleRoomDialogue() {
}
-void IgorEngine::handleRoomLight() {
+void IgorEngine::handleIgorIdleAnimation() {
if (_gameState.dialogueTextRunning || _gameState.igorMoving) {
_gameState.updateLight = false;
} else if (_gameState.updateLight) {
- updateRoomLight(0);
+ updateIgorIdleAnimation(0);
_gameState.updateLight = 0;
} else if (getRandomNumber(9) == 0) {
- updateRoomLight(1);
+ updateIgorIdleAnimation(1);
_gameState.updateLight = true;
}
}
-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::handleRoomInventoryScroll() {
if (_scrollInventory) {
scrollInventory();
}
}
-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::drawInventory(int start, int mode) {
- loadData(IMG_InventoryPanel, _inventoryPanelBuffer);
- loadData(IMG_Objects, _inventoryImagesBuffer);
- int y, i;
- int end = start + 7; // seven slots
- int x = 1;
- // Paint inventory icons
- 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;
- }
- // Hide arrows
- 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: // normal inventory rendering
- memcpy(_screenVGA + 54400, _inventoryPanelBuffer, 9600);
- _scrollInventory = false;
- break;
- case 1: // animation scrolling up
- 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: // animation scrolling down
- 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::addObjectToInventory(int object, int index) {
debugC(9, kDebugEngine, "addObjectToInventory %d %d", object, index);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 9bb040ad68b..ced8dd62007 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -413,10 +413,19 @@ struct WalkData {
}
};
+enum AnimBlend {
+ kBlendCopy,
+ kBlendLitSprite,
+ kBlendBehindIgor,
+ kBlendBehindIgorAndText
+};
+
class IgorEngine : public Engine {
public:
typedef void (IgorEngine::*ExecuteActionProc)(int action);
typedef void (IgorEngine::*UpdateRoomBackgroundProc)();
+
+
typedef void (IgorEngine::*UpdateDialogueProc)(int action);
private:
@@ -555,7 +564,12 @@ private:
void setupDefaultPalette();
void readTableFile();
+
+
void copyArea(uint8 *dst, int dstOffset, int dstPitch, const uint8 *src, int srcPitch, int w, int h, bool transparent = false);
+ void drawAnimRect(int dstOffset, int animOffset, int w, int h, bool alsoBackground = false, AnimBlend blend = kBlendCopy);
+ void animateLitAnimFrames(int srcOffset, int firstFrame, int lastFrame, int frameSize, int width, int height, int dstOffset, int delay, int soundFrame, int sound);
+ void updateIgorIdleAnimation(int fl);
void loadDialogueData(int dlg);
@@ -573,32 +587,13 @@ private:
void SET_DIALOGUE_TEXT(int start, int count);
void SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p);
- void UPDATE_OBJECT_STATE(int num);
- void PART_UPDATE_FIGURES_ON_PAPER(int delay);
-
- 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 animateIgorTalking(int frame);
- void fixIgorDialogueTextPosition(int num, int count, int *x, int *y);
- void startIgorDialogue();
- void waitForEndOfIgorDialogue(bool animateHead = true);
- 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);
// One-call dialogue helpers. Each queues the given lines as consecutive pages and starts them.
- // Use these for every new room instead of ADD_DIALOGUE_TEXT/SET_DIALOGUE_TEXT/start* sequences.
// igorSay Igor speaks, returns once the first page has started
// igorSayAndWait Igor speaks, returns once all pages are finished
// cutsceneSayStart text at (x, y) in color (r, g, b), returns once the first page has started
// cutsceneSay same, but returns once all pages are finished
- // cutsceneSayStartWithCallback like cutsceneSayStart, but first installs a talk-animation callback
- // (see _updateDialogue); it stays installed for the caller to clear
+ // cutsceneSayStartWithCallback like cutsceneSayStart, but first installs a talk-animation callback (see _updateDialogue); it stays installed for the caller to clear
// cutsceneSayWithCallback like cutsceneSay, but installs the callback first and clears it afterwards
void igorSay(const Common::Array<DialogueText> &lines);
void igorSay(int num, int count = 1, int sound = kNoSpeechSound);
@@ -613,8 +608,14 @@ private:
void cutsceneSayWithCallback(int x, int y, int r, int g, int b, const Common::Array<DialogueText> &lines, UpdateDialogueProc update);
void cutsceneSayWithCallback(int x, int y, int r, int g, int b, int num, int count, int sound, UpdateDialogueProc update);
- // Building block of the helpers above, do not call from rooms
void queueDialogueLines(const Common::Array<DialogueText> &lines);
+ void animateIgorTalking(int frame);
+ void fixIgorDialogueTextPosition(int num, int count, int *x, int *y);
+ void startIgorDialogue();
+ void waitForEndOfIgorDialogue(bool animateHead = true);
+ 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);
bool isDialogueSpeechPlaying() const;
void stopDialogueSpeech();
@@ -633,8 +634,6 @@ private:
void PART_00();
void PART_00_EXEC_ACTION(int action);
void PART_00_APPLY_OBJECT_STATE(int num);
- void part_00_drawRawFrame(int srcOffset, int frame, int frameSize, int width, int height, int dstOffset);
- void PART_00_animateRaw(int srcOffset, int firstFrame, int lastFrame, int frameSize, int width, int height, int dstOffset, int delay, int soundFrame, int sound);
void PART_00_ENTRY_ANIMATION();
void PART_00_WALK_IN_FROM_CLOSET();
void PART_00_ENTER_FROM_BELOW();
@@ -695,7 +694,7 @@ private:
void PART_07_ENTER_FROM_OUTSIDE();
void PART_07_EXIT_TO_OUTSIDE();
-
+ // Dean's office
void PART_08();
void PART_08_EXEC_ACTION(int action);
void PART_08_APPLY_OBJECT_STATE(int num);
@@ -1127,12 +1126,23 @@ private:
int MAZE_MUSIC_TRACK() const;
void setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp);
+ void UPDATE_OBJECT_STATE(int num);
+ void PART_UPDATE_FIGURES_ON_PAPER(int delay);
+
+ void PART_MEANWHILE();
+
+ // Margaret cutscenes
+ 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();
// philip vodka cutscene
void PART_75_UPDATE_DIALOGUE_PHILIP(int action);
void PART_75_HELPER_1(int frame);
void PART_75();
+ // Intro
void PART_85();
void PART_85_HELPER_1_PLAY_ANIM(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
void PART_85_HELPER_2_SCROLL_RIGHT();
@@ -1142,6 +1152,7 @@ private:
void PART_85_HELPER_6_animateIgorHead(int frame);
+ // Splash screens
void PART_90();
void handleRoomInput();
@@ -1176,9 +1187,8 @@ private:
void handleRoomDialogue();
- void handleRoomLight();
+ void handleIgorIdleAnimation();
- void updateRoomLight(int fl);
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);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 70f9a0354bb..84205d814fc 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -177,29 +177,6 @@ void IgorEngine::hideCursor() {
CursorMan.showMouse(_roomCursorOn);
}
-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);
- }
- }
-}
-
/**
* Action to select a verb with moving the right mouse button clicked
*/
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index e948555672c..5b5b9e8e052 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -9,6 +9,7 @@ MODULE_OBJS = \
palette.o \
font.o \
room.o \
+ graphics.o \
resource.o \
input.o \
static_walk.o \
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index c5985207904..9161e05ced9 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -23,57 +23,18 @@
namespace Igor {
-void IgorEngine::part_00_drawRawFrame(int srcOffset, int frame, int frameSize,
- int width, int height, int dstOffset) {
-
- const uint8 *src = _animFramesBuffer + srcOffset + frame * frameSize;
- for (int y = 0; y < height; ++y) {
- for (int x = 0; x < width; ++x) {
- const int dst = dstOffset + y * 320 + x;
- uint8 color = src[y * width + x];
- if (color >= 0xC0 && color <= 0xCF) {
- const RoomObjectArea &area = _roomObjectAreasTable[_screenLayer2[dst]];
- if (area.y1Lum > 0)
- color = _screenLayer1[dst];
- else if (area.y2Lum > 0)
- color -= area.deltaLum;
- }
- _screenTempLayer[y * 100 + x] = color;
- }
- }
- for (int y = 0; y < height; ++y)
- memcpy(_screenVGA + dstOffset + y * 320, _screenTempLayer + y * 100, width);
-}
-
-void IgorEngine::PART_00_animateRaw(int srcOffset, int firstFrame, int lastFrame,
- int frameSize, int width, int height, int dstOffset, int delay,
- int soundFrame, int sound) {
- const int step = firstFrame <= lastFrame ? 1 : -1;
- for (int frame = firstFrame;; frame += step) {
- part_00_drawRawFrame(srcOffset, frame, frameSize, width, height, dstOffset);
- if (frame == soundFrame)
- playSound(sound, 1);
- if (frame != lastFrame)
- waitForTimer(delay);
- if (frame == lastFrame)
- break;
- }
-}
-
void IgorEngine::PART_00_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
const bool open = _objectsState[8] != 0;
const int src = open ? 0x4CFA : 0x4C6A;
- for (int y = 0; y < 9; ++y)
- memcpy(_screenLayer1 + 0x8EBD + y * 320, _animFramesBuffer + src + y * 16, 16);
+ copyArea(_screenLayer1, 0x8EBD, 320, _animFramesBuffer + src, 16, 16, 9);
_roomActionsTable[74] = open ? 7 : 6;
_roomObjectAreasTable[13].object = open ? (_objectsState[9] == 0 ? 3 : 2) : 2;
}
if (num == 3 || num == 255) {
const bool open = _objectsState[10] != 0; // s3:0846; cseg206:1AFF-1B42
const int src = open ? 0x3900 : 0x3238;
- for (int y = 0; y < 56; ++y)
- memcpy(_screenLayer1 + 0x5572 + y * 320, _animFramesBuffer + src + y * 31, 31);
+ copyArea(_screenLayer1, 0x5572, 320, _animFramesBuffer + src, 31, 31, 56);
_roomActionsTable[76] = open ? 7 : 6;
_roomObjectAreasTable[3].object = (_objectsState[11] == 0) ? 4 : 5;
}
@@ -81,8 +42,7 @@ void IgorEngine::PART_00_APPLY_OBJECT_STATE(int num) {
const int state = _objectsState[13];
const int src = state == 1 ? 0x143C : 0x1200;
- for (int y = 0; y < 22; ++y)
- memcpy(_screenLayer1 + 0x6DB7 + y * 320, _animFramesBuffer + src + y * 26, 26);
+ copyArea(_screenLayer1, 0x6DB7, 320, _animFramesBuffer + src, 26, 26, 22);
_roomActionsTable[79] = state == 1 ? 7 : (state == 2 ? 6 : 4);
}
}
@@ -93,14 +53,14 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
case 101: // open window
if (_objectsState[13] != 1) {
- PART_00_animateRaw(0, 1, 3, 0x480, 36, 32, 0x6B2C, 62, 2, 1);
+ animateLitAnimFrames(0, 1, 3, 0x480, 36, 32, 0x6B2C, 62, 2, 1);
_objectsState[13] = 1;
PART_00_APPLY_OBJECT_STATE(6);
}
break;
case 102: // close window
if (_objectsState[13] == 1) {
- PART_00_animateRaw(0, 2, 0, 0x480, 36, 32, 0x6B2C, 62, 2, 2);
+ animateLitAnimFrames(0, 2, 0, 0x480, 36, 32, 0x6B2C, 62, 2, 2);
_objectsState[13] = 2;
PART_00_APPLY_OBJECT_STATE(6);
}
@@ -115,7 +75,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
igorSay(212, 1, 101);
break;
}
- PART_00_animateRaw(0x4D8A, 0, 1, 0x5DC, 30, 50, 0x6B2C, 62, -1, 0);
+ animateLitAnimFrames(0x4D8A, 0, 1, 0x5DC, 30, 50, 0x6B2C, 62, -1, 0);
_objectsState[13] = 2;
_objectsState[15] = 1;
_currentPart = 10;
@@ -125,14 +85,14 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
break;
case 106: // open bedside table
if (_objectsState[8] == 0) {
- PART_00_animateRaw(0x3FC8, 0, 2, 0x436, 22, 49, 0x693C, 126, 2, 6);
+ animateLitAnimFrames(0x3FC8, 0, 2, 0x436, 22, 49, 0x693C, 126, 2, 6);
_objectsState[8] = 1;
PART_00_APPLY_OBJECT_STATE(1);
}
break;
case 107: // close bedside table
if (_objectsState[8] != 0) {
- PART_00_animateRaw(0x3FC8, 2, 0, 0x436, 22, 49, 0x693C, 126, 1, 6);
+ animateLitAnimFrames(0x3FC8, 2, 0, 0x436, 22, 49, 0x693C, 126, 1, 6);
_objectsState[8] = 0;
PART_00_APPLY_OBJECT_STATE(1);
}
@@ -149,7 +109,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
break;
case 109: // take alarm clock
if (_objectsState[9] == 0) {
- PART_00_animateRaw(0x8410, 0, 1, 0x405, 21, 49, 0x693D, 126, -1, 0);
+ animateLitAnimFrames(0x8410, 0, 1, 0x405, 21, 49, 0x693D, 126, -1, 0);
addObjectToInventory(6, 41); // s3:0903; cseg206:113C-1176
_objectsState[9] = 1;
PART_00_APPLY_OBJECT_STATE(1);
@@ -157,14 +117,14 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
break;
case 110: // open closet
if (_objectsState[10] == 0) {
- PART_00_animateRaw(0x1678, 0, 2, 0x940, 37, 64, 0x556C, 126, 2, 3);
+ animateLitAnimFrames(0x1678, 0, 2, 0x940, 37, 64, 0x556C, 126, 2, 3);
_objectsState[10] = 1;
PART_00_APPLY_OBJECT_STATE(3);
}
break;
case 111: // close closet
if (_objectsState[10] != 0) {
- PART_00_animateRaw(0x1678, 2, 0, 0x940, 37, 64, 0x556C, 126, 1, 4);
+ animateLitAnimFrames(0x1678, 2, 0, 0x940, 37, 64, 0x556C, 126, 1, 4);
_objectsState[10] = 0;
PART_00_APPLY_OBJECT_STATE(3);
}
@@ -178,7 +138,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
case 114: // go through hole
if (_objectsState[10] == 0)
PART_00_EXEC_ACTION(110);
- PART_00_animateRaw(0x5942, 0, 2, 0x44C, 22, 50, 0x66EE, 30, -1, 0);
+ animateLitAnimFrames(0x5942, 0, 2, 0x44C, 22, 50, 0x66EE, 30, -1, 0);
_currentPart = 24;
break;
case 115: // look at records
@@ -186,7 +146,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
break;
case 116: // take records
if (_objectsState[12] == 0) {
- PART_00_animateRaw(0x7C06, 0, 1, 0x405, 21, 49, 0x7146, 126, -1, 0);
+ animateLitAnimFrames(0x7C06, 0, 1, 0x405, 21, 49, 0x7146, 126, -1, 0);
addObjectToInventory(5, 40); // s3:0902; cseg206:0F75-0FAF
_objectsState[12] = 1;
PART_00_APPLY_OBJECT_STATE(255);
@@ -228,14 +188,13 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
void IgorEngine::PART_00_ENTRY_ANIMATION() {
waitForTimer(62);
if (_objectsState[10] == 0) {
- for (int y = 0; y < 56; ++y)
- memcpy(_screenVGA + 0x5572 + y * 320, _animFramesBuffer + 0x3900 + y * 31, 31);
+ drawAnimRect(0x5572, 0x3900, 31, 56);
_objectsState[10] = 1;
PART_00_APPLY_OBJECT_STATE(3);
playSound(3, 1);
waitForTimer(30);
}
- PART_00_animateRaw(0x6626, 0, 3, 0x578, 25, 56, 0x5F6E, 30, -1, 0);
+ animateLitAnimFrames(0x6626, 0, 3, 0x578, 25, 56, 0x5F6E, 30, -1, 0);
}
void IgorEngine::PART_00_WALK_IN_FROM_CLOSET() {
diff --git a/engines/igor/parts/part_1.cpp b/engines/igor/parts/part_1.cpp
index 87c0c9e8b17..05ad55f323e 100644
--- a/engines/igor/parts/part_1.cpp
+++ b/engines/igor/parts/part_1.cpp
@@ -13,15 +13,14 @@ namespace Igor {
void IgorEngine::PART_01_CLOSE_WINDOW() {
static const uint8 windowFrames[] = { 0, 1, 2, 1 };
for (int i = 0; i < 4; ++i) {
- part_00_drawRawFrame(216, windowFrames[i], 1204, 28, 43, 0x5919);
+ drawAnimRect(0x5919, 216 + windowFrames[i] * 1204, 28, 43, false, kBlendLitSprite);
if (i == 0)
playSound(2, 1);
if (i != 3) {
// ANM offset 0 contains four 9x6 frames.
const int backgroundFrame = getRandomNumber(3);
const uint8 *src = _animFramesBuffer + backgroundFrame * 54;
- for (int y = 0; y < 6; ++y)
- memcpy(_screenVGA + 0x8EA4 + y * 320, src + y * 9, 9);
+ copyArea(_screenVGA, 0x8EA4, 320, src, 9, 9, 6);
waitForTimer(94);
}
}
@@ -30,20 +29,16 @@ void IgorEngine::PART_01_CLOSE_WINDOW() {
}
void IgorEngine::PART_01_STATE_11_BLIT_blitIgor() {
- for (int i = 0; i < 13; ++i)
- memcpy(_screenVGA + 0x5476 + i * 320, _animFramesBuffer + 0x1859 + i * 16, 16);
+ drawAnimRect(0x5476, 0x1859, 16, 13);
}
void IgorEngine::PART_01_STATE_11_BLIT_00A5() {
- for (int i = 0; i < 40; ++i)
- memcpy(_screenVGA + 0x118F + i * 320, _animFramesBuffer + 0xA7F9 + i * 0xDA, 0xDA);
+ drawAnimRect(0x118F, 0xA7F9, 0xDA, 40);
}
//
void IgorEngine::PART_01_STATE_11_BLIT_drawIgorsEyes(int frame) {
- for (int i = 0; i < 4; ++i)
- memcpy(_screenVGA + 0x55BB + i * 320,
- _animFramesBuffer + 0xA7A9 + frame * 20 + i * 5, 5);
+ drawAnimRect(0x55BB, 0xA7A9 + frame * 20, 5, 4);
}
//
@@ -115,7 +110,7 @@ void IgorEngine::PART_01_EXEC_ACTION(int action) {
// waiting for the video update after each one, then
// changes to part 20.
for (int frame = 0; frame <= 1; ++frame) {
- part_00_drawRawFrame(0x0EF4, frame, 0x3D8, 24, 41, 0x51F4);
+ drawAnimRect(0x51F4, 0x0EF4 + frame * 0x3D8, 24, 41, false, kBlendLitSprite);
waitForTimer(); // video-update wait
}
_currentPart = 20;
diff --git a/engines/igor/parts/part_10.cpp b/engines/igor/parts/part_10.cpp
index c8899193e4b..2e16a899388 100644
--- a/engines/igor/parts/part_10.cpp
+++ b/engines/igor/parts/part_10.cpp
@@ -32,20 +32,14 @@ void IgorEngine::PART_10_11_DRAW_OBJECT_STATE(int num) {
// halves of the room
if ((num == 2 || num == 255) && _objectsState[41] == 1) {
- for (int y = 0; y <= 7; ++y)
- memcpy(_screenLayer1 + 0x7DA1 + y * 320,
- _animFramesBuffer + 0xC786 + y * 37, 37);
+ copyArea(_screenLayer1, 0x7DA1, 320, _animFramesBuffer + 0xC786, 37, 37, 8);
}
if (num == 3 || num == 255) {
if (_objectsState[42] == 1) {
- for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320,
- _animFramesBuffer + 0xC5E2 + y * 14, 14);
+ copyArea(_screenLayer1, 0x4E32, 320, _animFramesBuffer + 0xC5E2, 14, 14, 15);
} else if (_objectsState[42] == 2) {
- for (int y = 0; y <= 14; ++y)
- memcpy(_screenLayer1 + 0x4E32 + y * 320,
- _animFramesBuffer + 0xC6B4 + y * 14, 14);
+ copyArea(_screenLayer1, 0x4E32, 320, _animFramesBuffer + 0xC6B4, 14, 14, 15);
}
}
}
@@ -104,11 +98,7 @@ void IgorEngine::PART_10_ACTION_104_pickHamburger() {
static const uint8 frameSelectors[] = { 0, 1, 0, 2 };
for (int frame = 0; frame < 4; ++frame) {
- for (int y = 0; y < 49; ++y) {
- memcpy(_screenVGA + 0x595F + y * 320,
- _animFramesBuffer + kPart10_11_Frm1 + frameSelectors[frame] * 0x682 + y * 34,
- 34);
- }
+ drawAnimRect(0x595F, kPart10_11_Frm1 + frameSelectors[frame] * 0x682, 34, 49);
waitForTimer(31);
}
@@ -123,10 +113,8 @@ void IgorEngine::PART_10_ACTION_108_scrollLeft() {
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 + kPart10PanelLeft + y * 320 + 320 - i * 8, i * 8);
- }
+ copyArea(_screenLayer2, i * 8, 320, _screenLayer1, 320, 320 - i * 8, 144);
+ copyArea(_screenLayer2, 0, 320, _animFramesBuffer + kPart10PanelLeft + 320 - i * 8, 320, i * 8, 144);
if (i < 9) {
xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame];
assert(xPos >= 260);
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index 64a09e1efc1..ea927eedecd 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -60,8 +60,7 @@ void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
void IgorEngine::PART_11_ACTION_105() {
for (int frame = 0; frame <= 1; ++frame) {
- for (int y = 0; y <= 48; ++y)
- memcpy(_screenVGA + 0x6167 + y * 320, _animFramesBuffer + kPart10_11_Frm1 + frame * 0x405 + y * 21, 21);
+ drawAnimRect(0x6167, kPart10_11_Frm1 + frame * 0x405, 21, 49);
waitForTimer(127);
}
addObjectToInventory(18, 53);
@@ -71,8 +70,7 @@ void IgorEngine::PART_11_ACTION_105() {
void IgorEngine::PART_11_ACTION_107() {
for (int frame = 0; frame <= 2; ++frame) {
- for (int y = 0; y <= 27; ++y)
- memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart10_11_Frm5 + frame * 0x348 + y * 30, 30);
+ drawAnimRect(0x47E3, kPart10_11_Frm5 + frame * 0x348, 30, 28);
waitForTimer(61);
}
removeObjectFromInventory(42);
@@ -87,10 +85,8 @@ void IgorEngine::PART_11_ACTION_108_scrollRight() {
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 + kPart11PanelRight + y * 320, i * 8);
- }
+ copyArea(_screenLayer2, 0, 320, _screenLayer1 + i * 8, 320, 320 - i * 8, 144);
+ copyArea(_screenLayer2, 320 - i * 8, 320, _animFramesBuffer + kPart11PanelRight, 320, i * 8, 144);
if (i < 9) {
xPos += _walkScaleTable[0x8F9 + _walkCurrentFrame];
assert(xPos >= 260);
@@ -121,8 +117,7 @@ void IgorEngine::PART_11_ACTION_108_scrollRight() {
void IgorEngine::PART_11_ACTION_112() {
for (int frame = 0; frame <= 2; ++frame) {
- for (int y = 0; y <= 27; ++y)
- memcpy(_screenVGA + 0x47E3 + y * 320, _animFramesBuffer + kPart10_11_Frm2 + frame * 0x348 + y * 30, 30);
+ drawAnimRect(0x47E3, kPart10_11_Frm2 + frame * 0x348, 30, 28);
waitForTimer(61);
}
addObjectToInventory(23, 58);
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 1f355eeaa9d..8082bfd1dc0 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -352,9 +352,7 @@ void IgorEngine::PART_14_HELPER_4() {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xD5BA, 44, 44, 66);
}
void IgorEngine::PART_14_HELPER_7(int frame) {
@@ -504,9 +502,7 @@ void IgorEngine::PART_14_PUSH_STONE(int screenOffset, int w, int h, int animOffs
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);
- }
+ copyArea(_screenVGA, screenOffset, 320, _screenTempLayer, 100, 28, h + 1);
}
void IgorEngine::PART_14() {
diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp
index ab9c3386ad8..3d135c007da 100644
--- a/engines/igor/parts/part_15.cpp
+++ b/engines/igor/parts/part_15.cpp
@@ -339,10 +339,8 @@ void IgorEngine::PART_15_HELPER_6(int frame) {
}
}
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);
- }
+ copyArea(_screenVGA, offset, 320, _screenTempLayer, 100, 53, 18);
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x4B8C + frame * 954, 53, 53, 18);
if (_gameState.dialogueTextRunning) {
memcpy(_screenTextLayer + 23040, _screenLayer1 + _dialogueDirtyRectY, _dialogueDirtyRectSize);
}
@@ -353,23 +351,17 @@ void IgorEngine::PART_15_HELPER_6(int frame) {
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);
- }
+ drawAnimRect(offset, 0x49A + frame * 2124, 59, 36);
}
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);
- }
+ drawAnimRect(offset, 0x958 + frame * 182, 14, 13);
}
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);
- }
+ drawAnimRect(offset, frame * 598, 26, 23);
}
void IgorEngine::PART_15() {
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index 4902468897d..dadee26cb9d 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -52,10 +52,7 @@ void IgorEngine::PART_16_ACTION_101() {
igorSayAndWait({ { 201, 1, 726 }, { 202, 2, 727 } });
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);
- }
+ drawAnimRect(offset, (i - 1) * 1127, 23, 49);
waitForTimer(120);
}
addObjectToInventory(20, 55);
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index bc360d119b8..833ef8a3e96 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -182,15 +182,11 @@ void IgorEngine::PART_17_ACTION_106_swapFolders() {
const int offset = 0x311F;
for (int j = 0; j <= 8; ++j) { // frames 0..8; cseg141:0A7E-0AEC
- for (int i = 0; i <= 27; ++i) {
- memcpy(_screenVGA + offset + i * 320, _animFramesBuffer + 0x1E6E + i * 40 + j * 1120, 40);
- }
+ drawAnimRect(offset, 0x1E6E + j * 1120, 40, 28);
waitForTimer(30);
}
- for (int i = 0; i <= 27; ++i) {
- memcpy(_screenVGA + offset + i * 320, _animFramesBuffer + 0x1E6E + i * 40, 40);
- }
+ drawAnimRect(offset, 0x1E6E, 40, 28);
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
g_engine->_screen->updateScreen();
@@ -371,10 +367,8 @@ void IgorEngine::PART_17_HELPER_3(int lum) {
void IgorEngine::PART_17_HELPER_4_paintFirsFrameOfPhilipAndJimmy() {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 44, 44, 49);
+ drawAnimRect(offset, 0, 44, 49);
}
void IgorEngine::PART_17_HELPER_5_changeZindexOfPath(int lum) {
@@ -432,29 +426,12 @@ void IgorEngine::PART_17_HELPER_8_PhillipToJimmyAnimFrame(int num) {
}
}
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);
- }
+ copyArea(_screenVGA, offset, 320, _screenTempLayer, 100, 11, 9);
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + num * 99 + 0x1967, 11, 11, 9);
}
void IgorEngine::PART_17_HELPER_9_JimmyTalkingAnimFrame(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);
- }
+ drawAnimRect(11663, num * 621 + 0x86C, 23, 27, true, kBlendBehindIgorAndText);
}
void IgorEngine::PART_17_HELPER_11_PhillipToIgor(int frame) {
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index 6072b6703b0..c3fdf86e9ba 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -67,9 +67,7 @@ void IgorEngine::PART_18_EXEC_ACTION(int action) {
void IgorEngine::PART_18_ACTION_109_useSlugOnGrating() {
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);
- }
+ drawAnimRect(offset + 320, (i - 1) * 1519 + 31, 31, 48);
waitForTimer(120);
}
int part = _currentPart;
@@ -107,16 +105,12 @@ void IgorEngine::PART_18_ACTION_111() {
return;
}
const int offset = 26798;
- for (int i = 0; i <= 28; ++i) {
- memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 28 + 0xF0A, 28);
- }
+ drawAnimRect(offset, 0xF0A, 28, 29);
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);
- }
+ drawAnimRect(offset, 0xBDE, 28, 29);
igorSay(213, 2, 907);
_objectsState[0] = 2;
UPDATE_OBJECT_STATE(1);
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index 8002c31ebc8..35c6f58a229 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -16,7 +16,7 @@ void IgorEngine::PART_02_START_DIALOGUE(int text, int count, int sound) {
void IgorEngine::PART_02_SEARCH_TRUNK() {
for (int frame = 0; frame <= 2; ++frame) {
- PART_00_animateRaw(0x3C0 + frame * 0x715, 0, 0, 0x715, 37, 49, 0x608C, 0, -1, 0);
+ animateLitAnimFrames(0x3C0 + frame * 0x715, 0, 0, 0x715, 37, 49, 0x608C, 0, -1, 0);
if (frame > 0)
waitForTimer(127);
}
@@ -71,8 +71,7 @@ void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
// redraws the closed/open trunk into the persistent room background.
const int srcOffset = _objectsState[16] == 0 ? 0x2E3E : 0x30FC;
- for (int y = 0; y < 18; ++y)
- memcpy(_screenLayer1 + 0x748A + y * 320, _animFramesBuffer + srcOffset + y * 39, 39);
+ copyArea(_screenLayer1, 0x748A, 320, _animFramesBuffer + srcOffset, 39, 39, 18);
_roomActionsTable[252] = _objectsState[16] == 0 ? 6 : 4;
}
if ((num == 2 || num == 255) && _objectsState[17] == 1) {
@@ -81,8 +80,7 @@ void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
}
if (num == 3 || num == 255) {
if (_objectsState[18] == 1) {
- for (int y = 0; y < 50; ++y)
- memcpy(_screenLayer1 + 0x50D6 + y * 320, _animFramesBuffer + y * 14, 14);
+ copyArea(_screenLayer1, 0x50D6, 320, _animFramesBuffer, 14, 14, 50);
}
_roomObjectAreasTable[9].object = _objectsState[18] == 0 ? 0 : 6;
}
@@ -90,8 +88,7 @@ void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
if (_objectsState[19] == 0) {
_roomObjectAreasTable[12].object = _objectsState[18] == 1 ? 6 : 0;
} else {
- for (int y = 0; y < 22; ++y)
- memcpy(_screenLayer1 + 0x5357 + y * 320,_animFramesBuffer + 0x2BC + y * 10, 10);
+ copyArea(_screenLayer1, 0x5357, 320, _animFramesBuffer + 0x2BC, 10, 10, 22);
_roomObjectAreasTable[12].object = 7;
}
}
@@ -99,8 +96,7 @@ void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
if (_objectsState[20] == 0) {
_roomObjectAreasTable[13].object = _objectsState[19] == 1 ? 7 : (_objectsState[18] == 1 ? 6 : 0);
} else {
- for (int y = 0; y < 10; ++y)
- memcpy(_screenLayer1 + 0x599B + y * 320, _animFramesBuffer + 0x398 + y * 4, 4);
+ copyArea(_screenLayer1, 0x599B, 320, _animFramesBuffer + 0x398, 4, 4, 10);
_roomObjectAreasTable[13].object = 8;
}
}
@@ -125,7 +121,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
PART_02_START_DIALOGUE(201, 1, 108);
break;
}
- PART_00_animateRaw(0x18FF, 1, 2, 0x715, 37, 49, 0x608C, 127, 1, 7);
+ animateLitAnimFrames(0x18FF, 1, 2, 0x715, 37, 49, 0x608C, 127, 1, 7);
_objectsState[16] = 1;
PART_02_APPLY_OBJECT_STATE(1);
break;
@@ -135,14 +131,14 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
break;
}
playSound(8, 1);
- PART_00_animateRaw(0x18FF, 1, 0, 0x715, 37, 49, 0x608C, 127, -1, 0);
+ animateLitAnimFrames(0x18FF, 1, 0, 0x715, 37, 49, 0x608C, 127, -1, 0);
_objectsState[16] = 0;
PART_02_APPLY_OBJECT_STATE(1);
break;
case 103: { // hammer the nail
for (int step = 1; step <= 21; ++step) {
const int frame = step == 21 ? 2 : ((step + 1) & 1);
- PART_00_animateRaw(0x33BA + frame * 0x4B0, 0, 0, 0x4B0,
+ animateLitAnimFrames(0x33BA + frame * 0x4B0, 0, 0, 0x4B0,
24, 50, 0x5989, 0, -1, 0);
if ((step & 1) != 0 && step < 21)
playSound(9, 1);
@@ -164,7 +160,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
// 0/1 and finish on frame 2 (indexed from s3:0x0249).
for (int step = 1; step <= 21; ++step) {
const int frame = step == 21 ? 2 : ((step + 1) & 1);
- PART_00_animateRaw(0x41CA + frame * 0x658, 0, 0, 0x658,
+ animateLitAnimFrames(0x41CA + frame * 0x658, 0, 0, 0x658,
29, 56, 0x5349, 0, -1, 0);
if ((step & 1) != 0 && step < 21)
playSound(10, 1);
@@ -226,7 +222,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
break;
case 107: // take butterfly net; cseg203:0D71-0F3E
- PART_00_animateRaw(0x54D2, 0, 1, 0x405, 21, 49, 0x5A6D, 127, -1, 0);
+ animateLitAnimFrames(0x54D2, 0, 1, 0x405, 21, 49, 0x5A6D, 127, -1, 0);
waitForTimer(127);
addObjectToInventory(7, 42);
_objectsState[17] = 1;
@@ -248,7 +244,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
PART_02_START_DIALOGUE(216, 1, 120);
break;
case 113: // place dynamite in the crack
- PART_00_animateRaw(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
+ animateLitAnimFrames(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
waitForTimer(127);
_objectsState[23] = 1;
PART_02_APPLY_OBJECT_STATE(8);
@@ -274,7 +270,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
break;
case 119:
- PART_00_animateRaw(0xB488, 0, 1, 0x4B0, 24, 50, 0x5988, 64, -1, 0);
+ animateLitAnimFrames(0xB488, 0, 1, 0x4B0, 24, 50, 0x5988, 64, -1, 0);
waitForTimer(64);
_currentPart = 1;
break;
@@ -296,7 +292,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
} else {
memset(_screenVGA + 0xB400, 0, 0x4BFF);
playSound(68, 1);
- PART_00_animateRaw(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
+ animateLitAnimFrames(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
waitForTimer(127);
@@ -316,9 +312,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
PART_02_UPDATE_FUSE();
waitForTimer();
}
- for (int y = 0; y < 12; ++y) {
- memcpy(_screenVGA + 0x5996 + y * 320, _screenLayer1 + 0x5996 + y * 320, 12);
- }
+ copyArea(_screenVGA, 0x5996, 320, _screenLayer1 + 0x5996, 320, 12, 12);
stopSound();
waitForTimer(5 * 255);
@@ -384,7 +378,7 @@ void IgorEngine::PART_02() {
case 20:
fadeIn(768);
// Igor climbs through the window on the first attic entrance.
- PART_00_animateRaw(0x69C0, 0, 2, 0x759, 33, 57, 0x4B26, 31, -1, 0);
+ animateLitAnimFrames(0x69C0, 0, 2, 0x759, 33, 57, 0x4B26, 31, -1, 0);
waitForTimer(31);
_walkData[0].setPos(57, 117, kFacingPositionRight, 0);
break;
@@ -406,7 +400,7 @@ void IgorEngine::PART_02() {
// the attic palette before drawing its post-explosion frame.
memset(_screenVGA + 0xB400, 0, 0x4600);
memcpy(_currentPalette, _paletteBuffer, 768);
- part_00_drawRawFrame(0x820B, 0, 0xA19, 47, 55, 0x6C3B);
+ drawAnimRect(0x6C3B, 0x820B + 0 * 0xA19, 47, 55, false, kBlendLitSprite);
updatePalette(768);
// Igor lies stunned, stands up, and shakes his head.
@@ -416,7 +410,7 @@ void IgorEngine::PART_02() {
};
for (uint i = 0; i < ARRAYSIZE(postExplosionFrames); ++i) {
const int frame = postExplosionFrames[i];
- part_00_drawRawFrame(0x820B, frame, 0xA19, 47, 55, 0x6C3B);
+ drawAnimRect(0x6C3B, 0x820B + frame * 0xA19, 47, 55, false, kBlendLitSprite);
if (frame == 0)
waitForTimer(2 * 255);
else if (frame == 1 || frame == 2)
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index f9175247a25..9494cef088b 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -78,9 +78,7 @@ void IgorEngine::PART_21_EXEC_ACTION(int action) {
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);
- }
+ copyArea(_screenVGA, offset, 320, _screenLayer1 + offset, 320, 20, 51);
PART_21_HELPER_10();
}
_currentPart = 303;
@@ -107,9 +105,7 @@ void IgorEngine::PART_21_ACTION_107() {
}
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);
- }
+ drawAnimRect(offset, (i - 1) * 1782, 33, 54);
if (i == 3) {
playSound(13, 1);
} else {
@@ -127,9 +123,7 @@ void IgorEngine::PART_21_ACTION_108() {
}
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);
- }
+ drawAnimRect(offset, (i - 1) * 1782, 33, 54);
if (i == 2) {
playSound(14, 1);
waitForTimer(100);
@@ -142,9 +136,7 @@ void IgorEngine::PART_21_ACTION_108() {
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);
- }
+ copyArea(_screenVGA, offset, 320, _screenLayer1 + offset, 320, 20, 51);
PART_21_HELPER_10();
}
_currentPart = 270;
@@ -161,16 +153,12 @@ void IgorEngine::PART_21_ACTION_111() {
waitForEndOfIgorDialogue(false);
IN_ACTION_111 = false;
const int offset = 28183;
- for (int i = 0; i <= 49; ++i) {
- memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + 0xCBE1 + i * 26, 26);
- }
+ drawAnimRect(offset, 0xCBE1, 26, 50);
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);
- }
+ drawAnimRect(offset, 0xBCA5 + PART_21_ANIM_DATA_2[k] * 1300, 26, 50);
++k;
}
PART_21_UPDATE_ROOM_BACKGROUND();
@@ -336,10 +324,8 @@ void IgorEngine::PART_21_HELPER_6(int frame) {
}
}
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);
- }
+ copyArea(_screenVGA, offset, 320, _screenTempLayer, 100, 49, 43);
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + frame * 2107 + 0xCA7, 49, 49, 43);
if (_dialogueCursorOn) {
_roomCursorOn = true;
}
@@ -347,23 +333,17 @@ void IgorEngine::PART_21_HELPER_6(int frame) {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xE031, 33, 33, 54);
}
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xE727, 33, 33, 54);
}
void IgorEngine::PART_21_HELPER_9() {
const int offset = 28520;
- for (int i = 0; i <= 42; ++i) {
- memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + i * 49 + 0x14E2, 49);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x14E2, 49, 49, 43);
}
void IgorEngine::PART_21_HELPER_10() {
@@ -398,18 +378,14 @@ void IgorEngine::PART_21_HELPER_10() {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + frame * 2107 + 0xCA7, 49, 49, 43);
}
void IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND() {
if (IN_ACTION_111 && compareGameTick(3, 24)) {
const int offset = 28183;
int i = getRandomNumber(1) + 1;
- for (int j = 0; j <= 49; ++j) {
- memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + 0xBCA5 + i * 1300 + j * 26, 26);
- }
+ drawAnimRect(offset, 0xBCA5 + i * 1300, 26, 50);
++i;
}
if (compareGameTick(61) && _objectsState[65] <= 1) {
diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp
index a4b42466b3c..7347ab89fd4 100644
--- a/engines/igor/parts/part_22.cpp
+++ b/engines/igor/parts/part_22.cpp
@@ -54,9 +54,7 @@ void IgorEngine::PART_22_ACTION_101() {
// each frame is drawn as is, over Igor too
const uint8 *frame = _animFramesBuffer + kPart22PickUpFrames +
(PART_22_PICK_UP_FRAMES[i] - 1) * kPart22PickUpFrameSize;
- for (int y = 0; y <= 29; ++y) {
- memcpy(_screenVGA + y * 320 + 24141, frame + y * 35, 35);
- }
+ copyArea(_screenVGA, 24141, 320, frame, 35, 35, 30);
waitForTimer(60);
}
addObjectToInventory(29, 64);
diff --git a/engines/igor/parts/part_23.cpp b/engines/igor/parts/part_23.cpp
index 8d7e224371a..2b0c51ec67a 100644
--- a/engines/igor/parts/part_23.cpp
+++ b/engines/igor/parts/part_23.cpp
@@ -85,9 +85,7 @@ void IgorEngine::PART_23_ACTION_107_openDoor() {
}
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);
- }
+ drawAnimRect(offset, i * 1620 + 0x895, 30, 54);
if (i == 3) {
playSound(13, 1);
}
@@ -106,9 +104,7 @@ void IgorEngine::PART_23_ACTION_108_closeDoor() {
}
const int offset = 23901;
for (int i = 1; i <= 2; ++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);
- }
+ drawAnimRect(offset, PART_23_ANIM_DATA_1[i] * 1620 + 0x895, 30, 54);
if (i == 2) {
playSound(14, 1);
}
@@ -153,16 +149,12 @@ void IgorEngine::PART_23_HELPER_1(int num) {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + (frame - 1) * 1296, 24, 24, 54);
}
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xA20, 25, 25, 49);
}
void IgorEngine::PART_23_HELPER_4_walkFromDoor() {
@@ -177,19 +169,7 @@ void IgorEngine::PART_23_HELPER_4_walkFromDoor() {
_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);
- }
+ drawAnimRect(23907, 0, 24, 54, false, kBlendBehindIgor);
playSound(14, 1);
_objectsState[66] = 0;
PART_23_HELPER_1(1);
@@ -236,10 +216,8 @@ void IgorEngine::PART_23_HELPER_7(int frame) {
}
}
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);
- }
+ copyArea(_screenVGA, offset, 320, _screenTempLayer, 100, 15, 19);
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + frame * 285 + 0x271C, 15, 15, 19);
if (_dialogueCursorOn) {
_roomCursorOn = true;
}
diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp
index 90d85955b48..68d66b020df 100644
--- a/engines/igor/parts/part_24.cpp
+++ b/engines/igor/parts/part_24.cpp
@@ -86,9 +86,7 @@ void IgorEngine::PART_24_ACTION_104() {
}
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);
- }
+ drawAnimRect(offset, i * 1938 + 0x69C, 34, 57);
if (i == 2) {
playSound(13, 1);
} else if (i == 1) {
@@ -106,9 +104,7 @@ void IgorEngine::PART_24_ACTION_105() {
}
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);
- }
+ drawAnimRect(offset, i * 1938 + 0x69C, 34, 57);
if (i == 4) {
playSound(14, 1);
} else if (i == 3) {
@@ -177,10 +173,8 @@ void IgorEngine::PART_24_HELPER_2(int frame) {
}
}
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);
- }
+ copyArea(_screenVGA, offset, 320, _screenTempLayer, 100, 23, 49);
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + frame * 1127 + 0x3E3B, 23, 23, 49);
if (_gameState.dialogueTextRunning) {
memcpy(_screenTextLayer + 23040, _screenLayer1 + _dialogueDirtyRectY, _dialogueDirtyRectSize);
}
@@ -203,10 +197,8 @@ void IgorEngine::PART_24_HELPER_3(int frame) {
}
}
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);
- }
+ copyArea(_screenVGA, offset, 320, _screenTempLayer, 100, 22, 43);
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + frame * 946 + 0x28C4, 22, 22, 43);
if (_gameState.dialogueTextRunning) {
memcpy(_screenTextLayer + 23040, _screenLayer1 + _dialogueDirtyRectY, _dialogueDirtyRectSize);
}
@@ -217,16 +209,12 @@ void IgorEngine::PART_24_HELPER_3(int frame) {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 33, 33, 55);
}
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x717, 33, 33, 55);
}
void IgorEngine::PART_24_HELPER_7() {
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index c8d16c5b78f..0d757007006 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -86,9 +86,7 @@ void IgorEngine::PART_25_ACTION_107() {
}
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);
- }
+ drawAnimRect(offset, i * 1736 + 0x290, 31, 56);
if (i == 2) {
playSound(13, 1);
}
@@ -107,9 +105,7 @@ void IgorEngine::PART_25_ACTION_108() {
}
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);
- }
+ drawAnimRect(offset, i * 1736 + 0x290, 31, 56);
if (i == 4) {
playSound(14, 1);
}
@@ -173,16 +169,12 @@ void IgorEngine::PART_25_HELPER_4() {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 23, 23, 52);
}
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x4AC, 23, 23, 52);
}
void IgorEngine::PART_25() {
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index 7ed0fd52969..f59209503ab 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -73,9 +73,7 @@ void IgorEngine::PART_26_ACTION_103() {
}
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);
- }
+ drawAnimRect(offset, 0x16C0 + i * 2706, 41, 66);
if (i == 2) {
playSound(13, 1);
} else if (i == 1) {
@@ -93,9 +91,7 @@ void IgorEngine::PART_26_ACTION_104() {
}
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);
- }
+ drawAnimRect(offset, i * 2706 + 0x16C0, 41, 66);
if (i == 4) {
playSound(14, 1);
} else if (i == 3) {
@@ -155,16 +151,12 @@ void IgorEngine::PART_26_HELPER_1(int num) {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 25, 25, 65);
}
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x659, 25, 25, 65);
}
void IgorEngine::PART_26_HELPER_4() {
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index fab107f01e9..d7c30855518 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -91,9 +91,7 @@ void IgorEngine::PART_27_ACTION_106_openPhilipLocker() {
}
const int offset = 21810;
for (int i = 2; i <= 3; ++i) {
- for (int j = 0; j <= 48; ++j) {
- memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + 0x3A0 + i * 1568 + j * 32, 32);
- }
+ drawAnimRect(offset, 0x3A0 + i * 1568, 32, 49);
if (i == 3) {
playSound(3, 1);
}
@@ -112,9 +110,7 @@ void IgorEngine::PART_27_ACTION_107() {
}
const int offset = 21810;
for (int i = 2; i >= 1; --i) {
- for (int j = 0; j <= 48; ++j) {
- memcpy(_screenVGA + j * 320 + offset, _animFramesBuffer + 0x3A0 + i * 1568 + j * 32, 32);
- }
+ drawAnimRect(offset, 0x3A0 + i * 1568, 32, 49);
if (i == 2) {
playSound(14, 1);
waitForTimer(100);
@@ -132,9 +128,7 @@ void IgorEngine::PART_27_ACTION_108() {
igorSayAndWait(207, 1, 1167);
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);
- }
+ drawAnimRect(offset, i * 630 + 0x19AA, 21, 30);
if (i == 1) {
waitForTimer(100);
}
@@ -150,9 +144,7 @@ void IgorEngine::PART_27_ACTION_110() {
igorSayAndWait({ { 212, 1, 1170 }, { 213, 2, 1171 } });
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);
- }
+ drawAnimRect(offset, 0x19AA + i * 630, 21, 49);
if (i == 1) {
waitForTimer(100);
}
@@ -201,16 +193,12 @@ void IgorEngine::PART_27_HELPER_2() {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 26, 26, 48);
}
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x4E0, 26, 26, 48);
}
void IgorEngine::PART_27_HELPER_5() {
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index 8b3326dba08..6d1d48ffbd4 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -115,9 +115,7 @@ void IgorEngine::PART_28_ACTION_108() {
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);
- }
+ drawAnimRect(offset, i * 1085 + 0x5EC9, 31, 35);
if (i < 7) {
waitForTimer(45);
}
@@ -179,9 +177,7 @@ void IgorEngine::PART_28_HELPER_1(int num) {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 30, 30, 44);
}
void IgorEngine::PART_28_HELPER_3() {
@@ -211,10 +207,8 @@ void IgorEngine::PART_28_HELPER_5(int frame) {
}
}
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);
- }
+ copyArea(_screenVGA, offset, 320, _screenTempLayer, 100, 30, 44);
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + (frame - 1) * 1320, 30, 30, 44);
if (_gameState.dialogueTextRunning) {
memcpy(_screenTextLayer + 23040, _screenLayer1 + _dialogueDirtyRectY, _dialogueDirtyRectSize);
}
@@ -256,9 +250,7 @@ void IgorEngine::PART_28_HELPER_6() {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + frame * 135 + 0x61F8, 15, 15, 9);
}
void IgorEngine::PART_28() {
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index 5c587014752..5ccaefec426 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -118,9 +118,7 @@ void IgorEngine::PART_31_ACTION_103() {
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);
- }
+ drawAnimRect(offset, PART_31_ANIM_DATA_1[i] * 1856 + 0x384, 32, 58);
if (i < 9) {
waitForTimer(30);
}
@@ -164,9 +162,7 @@ void IgorEngine::PART_31_ACTION_110() {
}
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);
- }
+ drawAnimRect(offset, PART_31_ANIM_DATA_2[i] * 1856 + 0x384, 32, 58);
if (i == 9) {
playSound(13, 1);
} else if (i < 8) {
@@ -368,9 +364,7 @@ void IgorEngine::PART_31_HELPER_6() {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x562, 26, 26, 53);
}
void IgorEngine::PART_31() {
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index d762f7a5b5f..833b83cea6b 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -140,30 +140,22 @@ void IgorEngine::PART_33_ACTION_113() {
}
void IgorEngine::PART_33_ACTION_114() {
- for (int i = 0; i <= 28; ++i) {
- memcpy(_screenVGA + i * 320 + 26279, _animFramesBuffer + i * 63 + 0x5827, 62);
- }
+ copyArea(_screenVGA, 26279, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
igorSayAndWait(223, 1, 414);
PART_33_HARRISON_SPEAKS({ { 224, 1, 415 } });
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);
- }
+ copyArea(_screenVGA, 26279, 320, _animFramesBuffer + i * 1827 + 0x5104, 63, 62, 29);
waitForTimer(60);
}
removeObjectFromInventory(54);
PART_33_HARRISON_SPEAKS({ { 225, 1, 416 } });
- for (int i = 0; i <= 28; ++i) {
- memcpy(_screenVGA + i * 320 + 26279, _animFramesBuffer + i * 63 + 0x5827, 62);
- }
+ copyArea(_screenVGA, 26279, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
igorSayAndWait(226, 1, 417);
PART_33_HARRISON_SPEAKS({ { 227, 1, 418 } });
igorSayAndWait(228, 1, 419);
PART_33_HARRISON_SPEAKS({ { 229, 2, 420 }, { 231, 2, 421 } });
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);
- }
+ copyArea(_screenVGA, 26279, 320, _animFramesBuffer + PART_33_ANIM_DATA_5[i] * 1827 + 0x5104, 63, 62, 29);
waitForTimer(60);
}
addObjectToInventory(35, 70);
@@ -174,15 +166,11 @@ void IgorEngine::PART_33_ACTION_114() {
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);
- }
+ copyArea(_screenVGA, offset, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
waitForTimer(60);
igorSayAndWait(215, 2, 408);
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);
- }
+ copyArea(_screenVGA, offset, 320, _animFramesBuffer + i * 1827 + 0x5104, 63, 62, 29);
waitForTimer(60);
}
removeObjectFromInventory(67);
@@ -191,13 +179,9 @@ void IgorEngine::PART_33_ACTION_115() {
++_demoActionsCounter;
}
PART_33_HARRISON_SPEAKS({ { 217, 2, 409 } });
- for (int i = 0; i <= 28; ++i) {
- memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 63 + 0x5827, 62);
- }
+ copyArea(_screenVGA, offset, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
PART_33_HARRISON_SPEAKS({ { 219, 1, 410 } });
- for (int i = 0; i <= 28; ++i) {
- memcpy(_screenVGA + i * 320 + offset, _animFramesBuffer + i * 63 + 0x5827, 62);
- }
+ copyArea(_screenVGA, offset, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
_objectsState[76] = 1;
}
@@ -294,9 +278,7 @@ void IgorEngine::PART_33_HELPER_2() {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x5287, 16, 16, 15);
}
void IgorEngine::PART_33_HELPER_4(int frame) {
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index f22191e62f4..faee3a25820 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -76,10 +76,7 @@ void IgorEngine::PARK_DRAW_LAURA_FRAME(int frame) {
*/
void IgorEngine::PARK_PICK_UP_ANIMATION(int screenOffset, int framesOffset) {
for (uint i = 0; i < ARRAYSIZE(kPickUpFrames); ++i) {
- for (int row = 1; row <= 48; ++row) {
- memcpy(_screenVGA + screenOffset + row * 320,
- _animFramesBuffer + framesOffset + kPickUpFrames[i] * 1323 + row * 27, 27);
- }
+ drawAnimRect(screenOffset + 320, framesOffset + kPickUpFrames[i] * 1323 + 27, 27, 48);
waitForTimer(30);
}
}
@@ -407,10 +404,8 @@ void IgorEngine::PART_34_ACTION_109_SCROLL_RIGHT() {
_gameTicks = 8; // original counter 15 normalized to 8-tick engine units
do {
if (compareGameTick(1, 16)) {
- for (int y = 0; y <= 143; ++y) {
- memcpy(_screenLayer2 + y * 320, _screenLayer1 + y * 320 + step * 8, 320 - step * 8);
- memcpy(_screenLayer2 + y * 320 + 320 - step * 8, _animFramesBuffer + y * 160, step * 8);
- }
+ copyArea(_screenLayer2, 0, 320, _screenLayer1 + step * 8, 320, 320 - step * 8, 144);
+ copyArea(_screenLayer2, 320 - step * 8, 320, _animFramesBuffer, 160, step * 8, 144);
if (step < 15) {
xPos += _walkScaleTable[0x8F9 + _walkCurrentFrame];
WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame);
@@ -460,22 +455,7 @@ void IgorEngine::PART_34_APPLY_OBJECT_STATE(int num) {
* of the dialogue text are kept on the screen.
*/
void IgorEngine::PART_34_LADY_IDLE(int step) {
- const uint8 *frame = _animFramesBuffer + kParkIdleFrames + kOldLadyIdleFrames[step - 1] * 630;
- uint8 buffer[35 * 18];
- for (int y = 0; y < 35; ++y) {
- for (int x = 0; x < 18; ++x) {
- const uint8 color = _screenVGA[(73 + y) * 320 + 112 + x];
- if ((color >= 0xC0 && color <= 0xCF) || color == 0xF0 || color == 0xF1) {
- buffer[y * 18 + x] = color;
- } else {
- buffer[y * 18 + x] = frame[y * 18 + x];
- }
- }
- }
- for (int y = 0; y < 35; ++y) {
- memcpy(_screenVGA + (73 + y) * 320 + 112, buffer + y * 18, 18);
- memcpy(_screenLayer1 + (73 + y) * 320 + 112, frame + y * 18, 18);
- }
+ drawAnimRect(73 * 320 + 112, kParkIdleFrames + kOldLadyIdleFrames[step - 1] * 630, 18, 35, true, kBlendBehindIgorAndText);
}
void IgorEngine::PART_34_UPDATE_ROOM_BACKGROUND() {
@@ -491,9 +471,7 @@ void IgorEngine::PART_34() {
_gameState.enableLight = 1;
loadActionData(DAT_ParkLeft);
loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight, TXT_ParkRight);
- for (int y = 0; y <= 143; ++y) {
- memcpy(_animFramesBuffer + y * 160, _screenLayer1 + y * 320 + 160, 160);
- }
+ copyArea(_animFramesBuffer, 0, 160, _screenLayer1 + 160, 320, 160, 144);
loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // active left panel;
static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
loadAnimData(frames, kParkFrames);
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index 35fc9ccab80..ca1d4dc9060 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -73,12 +73,8 @@ void IgorEngine::PART_35_ACTION_107_SCROLL_LEFT() {
_gameTicks = 8; // original counter 15 normalized to 8-tick engine units
do {
if (compareGameTick(1, 16)) {
- for (int y = 0; y <= 143; ++y) {
- memcpy(_screenLayer2 + y * 320 + step * 8,
- _screenLayer1 + y * 320, 320 - step * 8);
- memcpy(_screenLayer2 + y * 320,
- _animFramesBuffer + y * 160 + 160 - step * 8, step * 8);
- }
+ copyArea(_screenLayer2, step * 8, 320, _screenLayer1, 320, 320 - step * 8, 144);
+ copyArea(_screenLayer2, 0, 320, _animFramesBuffer + 160 - step * 8, 160, step * 8, 144);
if (step < 5) {
xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame];
WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame);
@@ -135,9 +131,7 @@ void IgorEngine::PART_35() {
if (_objectsState[80] == 0 && _objectsState[73] == 1) {
PARK_DRAW_LADY_FRAME(_screenLayer1, 1);
}
- for (int y = 0; y <= 143; ++y) {
- memcpy(_animFramesBuffer + y * 160, _screenLayer1 + y * 320, 160);
- }
+ copyArea(_animFramesBuffer, 0, 160, _screenLayer1, 320, 160, 144);
loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight,
TXT_ParkRight); // active right panel
// The pick up frames replace the start of FRM_Park1, whose frames are not drawn on this panel
diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp
index bc1601cf7ec..c04dccda509 100644
--- a/engines/igor/parts/part_36.cpp
+++ b/engines/igor/parts/part_36.cpp
@@ -80,9 +80,7 @@ void IgorEngine::PART_36_ACTION_102() {
}
}
}
- for (int j = 0; j <= 48; ++j) {
- memcpy(_screenVGA + j * 320 + 23750, _screenTempLayer + j * 100, 34);
- }
+ copyArea(_screenVGA, 23750, 320, _screenTempLayer, 100, 34, 49);
waitForTimer(45);
}
addObjectToInventory(30, 65);
diff --git a/engines/igor/parts/part_37.cpp b/engines/igor/parts/part_37.cpp
index ea72510c022..fc4c1b75a6a 100644
--- a/engines/igor/parts/part_37.cpp
+++ b/engines/igor/parts/part_37.cpp
@@ -58,9 +58,7 @@ void IgorEngine::PART_37_ACTION_102() {
igorSayAndWait(201, 1, 662);
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);
- }
+ drawAnimRect(offset, i * 1550, 31, 50);
waitForTimer(60);
}
addObjectToInventory(32, 67);
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index cdba9f14573..08ac06ea7b6 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -102,7 +102,7 @@ void IgorEngine::PART_04() {
scrollPalette(200, 207);
setPaletteRange(200, 207);
if (compareGameTick(1)) {
- handleRoomLight();
+ handleIgorIdleAnimation();
}
scrollPalette(184, 199);
setPaletteRange(184, 199);
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index 17c7f941439..273549df4ec 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -70,44 +70,32 @@ void IgorEngine::PART_05_HELPER_4_drawPaperOrNot(int num) {
void IgorEngine::PART_05_06_DRAW_PAPER(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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x7E00 + frame * 12, 4, 4, 3);
}
void IgorEngine::PART_05_06_SAVE_PHOTOGRAPHER_BACKGROUND() {
const int offset = 23521;
- for (int i = 0; i <= 48; ++i) {
- memcpy(_animFramesBuffer + 0xDEA8 + i * 23 - 1, _screenLayer1 + i * 320 + offset, 23);
- }
+ copyArea(_animFramesBuffer, 0xDEA8 - 1, 23, _screenLayer1 + offset, 320, 23, 49);
}
void IgorEngine::PART_05_06_DRAW_PHOTOGRAPHER() {
const int offset = 23521;
- for (int i = 0; i <= 48; ++i)
- memcpy(_screenLayer1 + i * 320 + offset, _animFramesBuffer + 0x95C7 + i * 23, 23);
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x95C7, 23, 23, 49);
}
void IgorEngine::PART_05_06_DRAW_TRIPOD(bool drawToScreen) {
// Layer-1 blit: cseg182:047C-04CB; the active-pane copy is
// cseg180:03E9-0462.
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);
- if (drawToScreen)
- memcpy(_screenVGA + i * 320 + offset, src, 23);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x7E54, 23, 23, 33);
+ if (drawToScreen)
+ drawAnimRect(offset, 0x7E54, 23, 33);
}
void IgorEngine::PART_05_06_DRAW_CAMERA(int frame) {
// cseg180:038B-03E6; duplicated at cseg182:041E-0479.
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x7E00 + frame * 42, 7, 7, 6);
}
void IgorEngine::PART_05_HELPER_6_walkIgorToScene() {
@@ -150,9 +138,7 @@ void IgorEngine::PART_05() {
// copying a patch of 224 pixels width and 144 height into the backup buffer for later scroll
// then it loads the actual current scene, SpringBridge
- for (int i = 0; i <= 143; ++i) {
- memcpy(_animFramesBuffer + i * 224, _screenLayer1 + i * 320 + 96, 224);
- }
+ copyArea(_animFramesBuffer, 0, 224, _screenLayer1 + 96, 320, 224, 144);
loadRoomData(PAL_SpringBridge, IMG_SpringBridge, BOX_SpringBridge, MSK_SpringBridge, TXT_SpringBridge);
static const int anm1[] = {FRM_SpringBridge1, FRM_SpringBridge2, 0};
@@ -204,10 +190,7 @@ void IgorEngine::PART_05_ACTION_103_pickPaper() {
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);
- }
+ drawAnimRect(offset, 0x7E18 + i * 1470, 30, 49);
++i;
}
PART_05_UPDATE_ROOM_BACKGROUND();
@@ -230,10 +213,8 @@ void IgorEngine::PART_05_ACTION_102_scrollRight() {
_gameTicks = 15 & ~(kTimerTicksCount - 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);
- }
+ copyArea(_screenLayer2, 0, 320, _screenLayer1 + i * 8, 320, 320 - i * 8, 144);
+ copyArea(_screenLayer2, 320 - i * 8, 320, _animFramesBuffer, 224, i * 8, 144);
if (i < 15) {
xPos += _walkScaleTable[0x8F9 + _walkCurrentFrame];
assert(xPos >= 205);
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index 82126a48c2e..6751fb3e866 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -61,10 +61,7 @@ void IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND() {
void IgorEngine::PART_06_HELPER_8_animatePhotographer(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);
- }
+ drawAnimRect(offset, 0x95C7 + frame * 1127, 23, 49);
}
@@ -230,10 +227,8 @@ void IgorEngine::PART_06_ACTION_102_scrollLeft() {
_gameTicks = 15 & ~(kTimerTicksCount - 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);
- }
+ copyArea(_screenLayer2, i * 8, 320, _screenLayer1, 320, 320 - i * 8, 144);
+ copyArea(_screenLayer2, 0, 320, _animFramesBuffer + 224 - i * 8, 224, i * 8, 144);
if (i < 15) {
xPos -= _walkScaleTable[0x8F9 + _walkCurrentFrame];
assert(xPos >= 205);
@@ -275,10 +270,7 @@ void IgorEngine::PART_06_ACTION_102_scrollLeft() {
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);
- }
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xDEA7, 23, 23, 49);
}
void IgorEngine::PART_06_HELPER_15(int frame) {
@@ -300,9 +292,7 @@ void IgorEngine::PART_06() {
}
// copying a patch of 224 pixels width and 144 height into the backup buffer for later scroll
// then it loads the actual current scene, SpringRock
- for (int i = 0; i <= 143; ++i) {
- memcpy(_animFramesBuffer + i * 224, _screenLayer1 + i * 320, 224);
- }
+ copyArea(_animFramesBuffer, 0, 224, _screenLayer1, 320, 224, 144);
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
SET_PAL_240_48_1();
// the room palette resource is longer than the palette the room really uses, restore the inventory colors
@@ -355,7 +345,7 @@ void IgorEngine::PART_06() {
handleRoomInventoryScroll();
}
if (compareGameTick(1)) {
- handleRoomLight();
+ handleIgorIdleAnimation();
}
PART_06_UPDATE_ROOM_BACKGROUND();
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index 82ff7846268..ae6ecff0229 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -19,14 +19,12 @@ void IgorEngine::PART_07_DRAW_DOOR_STATE(int num) {
_roomActionsTable[297] = 109;
if (num == 1 || num == 255) {
const uint32 srcOffset = _objectsState[26] == 0 ? kDoor1Closed : kDoor1Open;
- for (int y = 0; y <= 52; ++y)
- memcpy(_screenLayer1 + 0x4DB8 + y * 320, _animFramesBuffer + srcOffset + y * 12, 12);
+ copyArea(_screenLayer1, 0x4DB8, 320, _animFramesBuffer + srcOffset, 12, 12, 53);
_roomActionsTable[146] = _objectsState[26] == 0 ? 6 : 7;
}
if (num == 2 || num == 255) {
const uint32 srcOffset = _objectsState[27] == 0 ? kDoor2Closed : kDoor2Open;
- for (int y = 0; y <= 51; ++y)
- memcpy(_screenLayer1 + 0x4E1A + y * 320, _animFramesBuffer + srcOffset + y * 12, 12);
+ copyArea(_screenLayer1, 0x4E1A, 320, _animFramesBuffer + srcOffset, 12, 12, 52);
_roomActionsTable[147] = _objectsState[27] == 0 ? 6 : 7;
}
}
@@ -43,11 +41,9 @@ void IgorEngine::PART_07_openCloseDoor(int door, bool open) {
const int step = open ? 1 : -1;
for (int frame = 1;; frame += step) {
if (door == 1) {
- for (int y = 0; y <= 52; ++y)
- memcpy(_screenVGA + 0x4DB8 + y * 320, _animFramesBuffer + frame * 0x636 + y * 30, 30);
+ drawAnimRect(0x4DB8, frame * 0x636, 30, 53);
} else {
- for (int y = 0; y <= 54; ++y)
- memcpy(_screenVGA + 0x4E0F + y * 320, _animFramesBuffer + 0x12A2 + frame * 0x4F1 + y * 23, 23);
+ drawAnimRect(0x4E0F, 0x12A2 + frame * 0x4F1, 23, 55);
}
if ((open && frame == 2) || (!open && frame == 1))
playSound(open ? 13 : 14, 1);
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index 9e155ce79c0..f9d7194f4b1 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -14,8 +14,7 @@ namespace Igor {
void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
const uint32 srcOffset = _objectsState[26] == 0 ? 0 : 0x4C8;
- for (int y = 0; y <= 50; ++y)
- memcpy(_screenLayer1 + 0x572C + y * 320, _animFramesBuffer + srcOffset + y * 24, 24);
+ copyArea(_screenLayer1, 0x572C, 320, _animFramesBuffer + srcOffset, 24, 24, 51);
_roomActionsTable[150] = _objectsState[26] == 0 ? 6 : 7;
}
if (num == 2 || num == 255) {
@@ -42,11 +41,7 @@ void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
width = 31;
_roomObjectAreasTable[8].object = _objectsState[31] == 0 ? 3 : 0;
}
- for (int y = 0; y < rows; ++y) {
- const uint8 *src = _animFramesBuffer + srcOffset + y * width;
- memcpy(_screenVGA + dstOffset + y * 320, src, width);
- memcpy(_screenLayer1 + dstOffset + y * 320, src, width);
- }
+ drawAnimRect(dstOffset, srcOffset, width, rows, true);
_roomActionsTable[146] = 4;
}
}
@@ -61,9 +56,7 @@ void IgorEngine::drawDoor(bool open) {
const int lastFrame = open ? 2 : 0;
const int step = open ? 1 : -1;
for (int frame = 1;; frame += step) {
- for (int y = 0; y <= 52; ++y)
- memcpy(_screenVGA + 0x5729 + y * 320,
- _animFramesBuffer + 0x3DA6 + frame * 0x597 + y * 27, 27);
+ drawAnimRect(0x5729, 0x3DA6 + frame * 0x597, 27, 53);
if ((open && frame == 2) || (!open && frame == 1))
playSound(open ? 13 : 14, 1);
if (frame == lastFrame)
@@ -75,19 +68,11 @@ void IgorEngine::drawDoor(bool open) {
}
void IgorEngine::drawDean() {
- for (int y = 0; y <= 25; ++y) {
- const uint8 *src = _animFramesBuffer + 0x23FE + y * 34;
- memcpy(_screenVGA + 0x6BC3 + y * 320, src, 34);
- memcpy(_screenLayer1 + 0x6BC3 + y * 320, src, 34);
- }
+ drawAnimRect(0x6BC3, 0x23FE, 34, 26, true);
}
void IgorEngine::drawDeanTalkingFrame(int frame) {
- for (int y = 0; y <= 21; ++y) {
- const uint8 *src = _animFramesBuffer + 0x4E6B + frame * 0x226 + y * 25;
- memcpy(_screenVGA + 0x6BC6 + y * 320, src, 25);
- memcpy(_screenLayer1 + 0x6BC6 + y * 320, src, 25);
- }
+ drawAnimRect(0x6BC6, 0x4E6B + frame * 0x226, 25, 22, true);
}
void IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN(int action) {
@@ -104,10 +89,7 @@ void IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN(int action) {
void IgorEngine::PART_08_ACTION_105() {
for (int frame = 0; frame <= 1; ++frame) {
- for (int y = 0; y <= 48; ++y) {
- const uint8 *src = _animFramesBuffer + 0x125E + frame * 0x55C + y * 28;
- memcpy(_screenVGA + 0x66E3 + y * 320, src, 28);
- }
+ drawAnimRect(0x66E3, 0x125E + frame * 0x55C, 28, 49);
if (frame == 0)
waitForTimer(127);
}
@@ -118,22 +100,7 @@ void IgorEngine::PART_08_ACTION_105() {
void IgorEngine::PART_08_ACTION_109() {
for (int frame = 0; frame <= 1; ++frame) {
- for (int y = 0; y <= 48; ++y) {
- for (int x = 0; x <= 22; ++x) {
- const int dstOffset = 0x4F77 + y * 320 + x;
- uint8 color = _animFramesBuffer[2448 + frame * 1127 + y * 23 + x];
- if (color >= 0xC0 && color <= 0xCF) {
- const RoomObjectArea &area = _roomObjectAreasTable[_screenLayer2[dstOffset]];
- if (area.y1Lum > 0)
- color = _screenLayer1[dstOffset];
- else if (area.y2Lum > 0)
- color -= area.deltaLum;
- }
- _screenTempLayer[y * 100 + x] = color;
- }
- }
- for (int y = 0; y <= 48; ++y)
- memcpy(_screenVGA + 0x4F77 + y * 320, _screenTempLayer + y * 100, 23);
+ drawAnimRect(0x4F77, 2448 + frame * 1127, 23, 49, false, kBlendLitSprite);
if (frame == 0)
waitForTimer(127);
}
@@ -166,8 +133,7 @@ void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
playSound(60, 1);
for (int frame = 0; frame <= 1; ++frame) {
- for (int y = 0; y <= 48; ++y)
- memcpy(_screenVGA + 0x6D1E + y * 320, _animFramesBuffer + actionFrameOffset - 1 + frame * 0x58D + y * 29, 29);
+ drawAnimRect(0x6D1E, actionFrameOffset - 1 + frame * 0x58D, 29, 49);
if (frame == 0)
waitForTimer(127);
}
@@ -231,9 +197,7 @@ void IgorEngine::PART_08_DEAN_DRINKS() {
for (int step = 1; step <= 20; ++step) {
const int frame = getRandomNumber(5);
- for (int y = 0; y <= 28; ++y)
- memcpy(_screenVGA + 0x6806 + y * 320,
- _animFramesBuffer + 0x8489 + frame * 0x2D5 + y * 25, 25);
+ drawAnimRect(0x6806, 0x8489 + frame * 0x2D5, 25, 29);
waitForTimer(61);
if (step == 10) {
@@ -247,9 +211,7 @@ void IgorEngine::PART_08_DEAN_DRINKS() {
_screenTextLayer + 320 * 72, _dialogueDirtyRectSize);
_gameState.dialogueTextRunning = false;
playSound(15, 1);
- for (int y = 0; y <= 28; ++y)
- memcpy(_screenVGA + 0x6806 + y * 320,
- _animFramesBuffer + 0x9587 + y * 25, 25);
+ drawAnimRect(0x6806, 0x9587, 25, 29);
waitForTimer(255);
_gameState.talkMode = savedTalkMode;
}
@@ -297,16 +259,10 @@ void IgorEngine::giveBottleToDean() {
for (int step = 0; step < 4; ++step) {
if (deanFrames[step] != 0) {
- for (int y = 0; y <= 48; ++y) {
- const uint8 *src = _animFramesBuffer + 0x5755 + deanFrames[step] * 0x620 + y * 32;
- memcpy(_screenVGA + 0x6463 + y * 320, src, 32);
- }
+ drawAnimRect(0x6463, 0x5755 + deanFrames[step] * 0x620, 32, 49);
}
if (igorFrames[step] != 0) {
- for (int y = 0; y <= 24; ++y) {
- const uint8 *src = _animFramesBuffer + 0x6D7D + igorFrames[step] * 0x258 + y * 24;
- memcpy(_screenVGA + 0x6D06 + y * 320, src, 24);
- }
+ drawAnimRect(0x6D06, 0x6D7D + igorFrames[step] * 0x258, 24, 25);
}
waitForTimer(41);
}
diff --git a/engines/igor/parts/part_85.cpp b/engines/igor/parts/part_85.cpp
index 59193fa5d4a..d39c913d978 100644
--- a/engines/igor/parts/part_85.cpp
+++ b/engines/igor/parts/part_85.cpp
@@ -253,10 +253,8 @@ void IgorEngine::PART_85_HELPER_2_SCROLL_RIGHT() {
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);
- }
+ copyArea(_screenTextLayer, 0, 320, _screenLayer1 + x * 8, 320, 320 - x * 8, 144);
+ copyArea(_screenTextLayer, 320 - x * 8, 320, _screenLayer2 + 96, 320, x * 8, 144);
memcpy(_screenVGA, _screenTextLayer, 46080);
++x;
}
@@ -297,22 +295,4 @@ void IgorEngine::PART_85_HELPER_6_animateIgorHead(int frame) {
copyArea(_screenVGA, offset, 320, _igorHeadFrames + (_walkCurrentPos - 1) * 924 + frame * 154, 14, 14, 8, true);
}
-
-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;
- }
-}
-
} // End of namespace Igor
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index 79819428ebd..7e416aba2e9 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -11,25 +11,18 @@
namespace Igor {
void IgorEngine::PART_09_DRAW_SECRETARY_FRAME(int frame, bool background) {
- for (int y = 0; y <= 46; ++y) {
- const uint8 *src = _animFramesBuffer + frame * 0x34E + y * 18;
- memcpy(_screenVGA + 0x7839 + y * 320, src, 18);
- if (background)
- memcpy(_screenLayer1 + 0x7839 + y * 320, src, 18);
- }
+ drawAnimRect(0x7839, frame * 0x34E, 18, 47, background);
}
void IgorEngine::PART_09_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
const uint32 srcOffset = _objectsState[27] == 0 ? 0x5D0B : 0x61A3;
- for (int y = 0; y <= 48; ++y)
- memcpy(_screenLayer1 + 0x46C2 + y * 320, _animFramesBuffer + srcOffset + y * 24, 24);
+ copyArea(_screenLayer1, 0x46C2, 320, _animFramesBuffer + srcOffset, 24, 24, 49);
_roomActionsTable[150] = _objectsState[27] == 0 ? 6 : 7;
}
if (num == 2 || num == 255) {
const uint32 srcOffset = _objectsState[34] == 0 ? 0x663B : 0x6A23;
- for (int y = 0; y <= 49; ++y)
- memcpy(_screenLayer1 + 0x48E6 + y * 320, _animFramesBuffer + srcOffset + y * 20, 20);
+ copyArea(_screenLayer1, 0x48E6, 320, _animFramesBuffer + srcOffset, 20, 20, 50);
_roomObjectAreasTable[4].object = (_objectsState[34] == 0 || _objectsState[36] != 0) ? 3 : 5;
}
if (num == 3 || num == 255) {
@@ -62,9 +55,7 @@ void IgorEngine::PART_09_ANIMATE_DOOR(bool open) {
for (int i = 0; i < 2; ++i) {
const int frame = open ? openFrames[i] : i + 1;
- for (int y = 0; y <= 52; ++y)
- memcpy(_screenVGA + 0x46C2 + y * 320,
- _animFramesBuffer + 0x86EF + frame * 0x52D + y * 25, 25);
+ drawAnimRect(0x46C2, 0x86EF + frame * 0x52D, 25, 53);
if (i == 1)
playSound(open ? 13 : 14, 1);
waitForTimer(127);
@@ -74,8 +65,7 @@ void IgorEngine::PART_09_ANIMATE_DOOR(bool open) {
}
void IgorEngine::PART_09_DRAW_DRAWER_FRAME(int frame) {
- for (int y = 0; y <= 58; ++y)
- memcpy(_screenVGA + 0x48E6 + y * 320, _animFramesBuffer + 0x6E0B + frame * 0x639 + y * 27, 27);
+ drawAnimRect(0x48E6, 0x6E0B + frame * 0x639, 27, 59);
}
void IgorEngine::PART_09_ACTION_106(bool search) {
@@ -111,22 +101,7 @@ void IgorEngine::PART_09_ACTION_106(bool search) {
void IgorEngine::PART_09_ACTION_110() {
for (int frame = 1; frame >= 0; --frame) {
- for (int y = 0; y <= 39; ++y) {
- for (int x = 0; x <= 26; ++x) {
- const int dst = 0x48E6 + y * 320 + x;
- uint8 color = _animFramesBuffer[0x9BA3 + frame * 0x438 + y * 27 + x];
- if (color >= 0xC0 && color <= 0xCF) {
- const RoomObjectArea &area = _roomObjectAreasTable[_screenLayer2[dst]];
- if (area.y1Lum > 0)
- color = _screenLayer1[dst];
- else if (area.y2Lum > 0)
- color -= area.deltaLum;
- }
- _screenTempLayer[y * 100 + x] = color;
- }
- }
- for (int y = 0; y <= 39; ++y)
- memcpy(_screenVGA + 0x48E6 + y * 320, _screenTempLayer + y * 100, 27);
+ drawAnimRect(0x48E6, 0x9BA3 + frame * 0x438, 27, 40, false, kBlendLitSprite);
waitForTimer(127);
}
addObjectToInventory(14, 49);
@@ -142,15 +117,13 @@ void IgorEngine::PART_09_ACTION_101_openFileCabinet() {
} else {
static const uint8 frames[] = { 1, 2, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 2, 1, 6 };
for (uint i = 0; i < ARRAYSIZE(frames); ++i) {
- for (int y = 0; y <= 48; ++y)
- memcpy(_screenVGA + 0x7595 + y * 320, _animFramesBuffer + 0x9BD8 + frames[i] * 0x83B + y * 43, 43);
+ drawAnimRect(0x7595, 0x9BD8 + frames[i] * 0x83B, 43, 49);
waitForTimer(i >= 3 && i <= 14 ? 31 : 61);
}
_walkData[_walkDataLastIndex - 1].posNum = kFacingPositionFront;
igorSayAndWait({ { 221, 1, 249 }, { 222, 1, 250 }, { 223, 1, 251 } });
for (int frame = 7; frame >= 6; --frame) {
- for (int y = 0; y <= 48; ++y)
- memcpy(_screenVGA + 0x7595 + y * 320, _animFramesBuffer + 0x9BD8 + frame * 0x83B + y * 43, 43);
+ drawAnimRect(0x7595, 0x9BD8 + frame * 0x83B, 43, 49);
if (frame == 7)
waitForTimer(255);
}
@@ -163,11 +136,7 @@ void IgorEngine::PART_09_ACTION_101_openFileCabinet() {
}
void IgorEngine::PART_09_DRAW_SECRETARY_MOUTH(int frame) {
- for (int y = 0; y <= 12; ++y) {
- const uint8 *src = _animFramesBuffer + 0xD38 + frame * 0xA9 + y * 13;
- memcpy(_screenVGA + 0x783A + y * 320, src, 13);
- memcpy(_screenLayer1 + 0x783A + y * 320, src, 13);
- }
+ drawAnimRect(0x783A, 0xD38 + frame * 0xA9, 13, 13, true);
}
void IgorEngine::PART_09_UPDATE_DIALOGUE_SECRETARY(int action) {
@@ -185,19 +154,16 @@ void IgorEngine::PART_09_SECRETARY_GESTURE() {
static const uint8 beginFrames[] = { 1, 2, 3, 4 };
static const uint8 endFrames[] = { 3, 2, 1, 8 };
for (uint step = 0; step < ARRAYSIZE(beginFrames); ++step) {
- for (int y = 0; y <= 46; ++y)
- memcpy(_screenVGA + 0x7815 + y * 320, _animFramesBuffer + 0x578 + beginFrames[step] * 0x9BB + y * 53, 53);
+ drawAnimRect(0x7815, 0x578 + beginFrames[step] * 0x9BB, 53, 47);
waitForTimer(31);
}
for (int step = 0; step < 32; ++step) {
const int frame = getRandomNumber(3) + 4;
- for (int y = 0; y <= 46; ++y)
- memcpy(_screenVGA + 0x7815 + y * 320, _animFramesBuffer + 0x578 + frame * 0x9BB + y * 53, 53);
+ drawAnimRect(0x7815, 0x578 + frame * 0x9BB, 53, 47);
waitForTimer(16);
}
for (uint step = 0; step < ARRAYSIZE(endFrames); ++step) {
- for (int y = 0; y <= 46; ++y)
- memcpy(_screenVGA + 0x7815 + y * 320, _animFramesBuffer + 0x578 + endFrames[step] * 0x9BB + y * 53, 53);
+ drawAnimRect(0x7815, 0x578 + endFrames[step] * 0x9BB, 53, 47);
waitForTimer(31);
}
}
diff --git a/engines/igor/parts/part_maze.cpp b/engines/igor/parts/part_maze.cpp
index b67a627c57c..1cc1bf87143 100644
--- a/engines/igor/parts/part_maze.cpp
+++ b/engines/igor/parts/part_maze.cpp
@@ -76,9 +76,7 @@ void IgorEngine::mazeDrawFlameFrame(int x, int y, int frame) {
tmp[j * kMazeFlameWidth + i] = color;
}
}
- for (int j = 0; j < kMazeFlameHeight; ++j) {
- memcpy(_screenVGA + screenOffset + j * 320, tmp + j * kMazeFlameWidth, kMazeFlameWidth);
- }
+ copyArea(_screenVGA, screenOffset, 320, tmp, kMazeFlameWidth, kMazeFlameWidth, kMazeFlameHeight);
}
/**
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index c3b218c7597..79aeb82d78a 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -299,54 +299,4 @@ void IgorEngine::loadAnimData(const int *anm, int loadOffset) {
}
}
-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;
-}
-
-/**
- * extracts from src a frame and draws it into dst, optionally preserving text
- */
-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] != _talkColorIndex && dst[i] != _talkShadowIndex) {
- 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] != _talkColorIndex && dst[i] != _talkShadowIndex) {
- dst[i] = src[i - pos];
- }
- }
- } else {
- memcpy(dst + pos, src, len);
- }
- src += len;
- pos += len;
- }
- }
- y += 320;
- }
-}
-
} // End of namespace Igor
Commit: a22719e300b4b2525cd67c5743f7c2225f48c8f9
https://github.com/scummvm/scummvm/commit/a22719e300b4b2525cd67c5743f7c2225f48c8f9
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:33+01:00
Commit Message:
IGOR: Implement part 70 (map of second area)
Changed paths:
A engines/igor/parts/part_70.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index ced8dd62007..d42296c854a 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1109,6 +1109,11 @@ private:
void PART_50_UPDATE_ROOM_BACKGROUND();
void PART_50();
+ void PART_70_EXEC_ACTION(int action);
+ void PART_70_DRAW_OBJECT_STATE();
+ void PART_70_UPDATE_ROOM_BACKGROUND();
+ void PART_70();
+
// maze
static const MazeNode MAZE_NODES[108];
static const MazeRoom *getMazeRoom(int part);
@@ -1375,6 +1380,7 @@ protected:
static const RoomDataOffsets PART_36_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_37_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_50_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_70_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
static const uint8 _inventoryOffsetTable[];
static const uint8 _inventoryActionsTable[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 5b5b9e8e052..c175017867e 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -24,6 +24,7 @@ MODULE_OBJS = \
parts/part_90.o \
parts/part_6.o \
parts/part_7.o \
+ parts/part_70.o \
parts/part_8.o \
parts/part_9.o \
parts/part_10.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 485a9abfca8..1a66a8634bc 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -616,6 +616,9 @@ void IgorEngine::PART_MAIN() {
case 671:
PART_MAZE(); // maze, 670 and 671 are the entrance
break;
+ case 700:
+ PART_70();
+ break;
case 750:
PART_75(); // philip vodka cutscene
break;
diff --git a/engines/igor/parts/part_70.cpp b/engines/igor/parts/part_70.cpp
new file mode 100644
index 00000000000..3cff45266f4
--- /dev/null
+++ b/engines/igor/parts/part_70.cpp
@@ -0,0 +1,106 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// The object that changes with the story is a 55x39 picture in the top right corner of the room; the
+// animation resource holds its two versions one after the other.
+static const int kPart70ObjectOffset = 6 * 320 + 265;
+static const int kPart70ObjectWidth = 55;
+static const int kPart70ObjectHeight = 39;
+static const int kPart70ObjectStateIndex = 104;
+
+// Where Igor goes to from each of the four exits of the room.
+static const int kPart70ExitStates[4] = { 501, 720, 680, 810 };
+
+void IgorEngine::PART_70_EXEC_ACTION(int action) {
+ switch (action) {
+ case 101:
+ case 102:
+ case 103:
+ case 104:
+ _currentPart = kPart70ExitStates[action - 101];
+ break;
+ default:
+ error("PART_70_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+/**
+ * Draws the version of the object that matches the story into the room picture.
+ */
+void IgorEngine::PART_70_DRAW_OBJECT_STATE() {
+ const int frameSize = kPart70ObjectWidth * kPart70ObjectHeight;
+ const int frame = _objectsState[kPart70ObjectStateIndex] == 0 ? 0 : 1;
+ copyArea(_screenLayer1, kPart70ObjectOffset, 320, _animFramesBuffer + frame * frameSize, kPart70ObjectWidth,
+ kPart70ObjectWidth, kPart70ObjectHeight);
+}
+
+/**
+ * The colors 192 to 207 rotate by one step every half cycle of the room.
+ */
+void IgorEngine::PART_70_UPDATE_ROOM_BACKGROUND() {
+ if (compareGameTick(3, 32)) {
+ scrollPalette(192, 207);
+ setPaletteRange(192, 207);
+ }
+}
+
+void IgorEngine::PART_70() {
+ playMusic(4);
+ _gameState.enableLight = 2;
+ loadActionData(DAT_Part70);
+ loadRoomData(PAL_Part70, IMG_Part70, BOX_Part70, MSK_Part70, TXT_Part70);
+ SET_PAL_240_48_1();
+ static const int anim[] = { ANM_Part70, 0 };
+ loadAnimData(anim);
+ _roomDataOffsets = PART_70_ROOM_DATA_OFFSETS;
+ setRoomClickFix(143, -1, -1, false);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_70_EXEC_ACTION);
+ _updateRoomBackground = &IgorEngine::PART_70_UPDATE_ROOM_BACKGROUND;
+ PART_70_DRAW_OBJECT_STATE();
+ memcpy(_screenVGA, _screenLayer1, 46080);
+
+ // Igor is not shown in this room
+ if (!restoreRoomAfterLoad(false)) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ _walkData[0].x = 160;
+ _walkData[0].y = 133;
+ _walkData[0].scaleWidth = 49;
+ _walkData[0].scaleHeight = 49;
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ }
+ enterPartLoop();
+ while (_currentPart == 700 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ // the rotated colors are kept
+ memcpy(_paletteBuffer, _currentPalette, 624);
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 8b1c87c0571..73220af1e3e 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -687,4 +687,13 @@
#define BOX_OutsideMaze 1094
// MAZE ROOMS END
+// State 700 (PART_70)
+#define DAT_Part70 1095
+#define ANM_Part70 1096
+#define TXT_Part70 1097
+#define IMG_Part70 1098
+#define PAL_Part70 1099
+#define MSK_Part70 1100
+#define BOX_Part70 1101
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 3a751aacb89..286196b70b1 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -464,4 +464,11 @@ const RoomDataOffsets IgorEngine::PART_50_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_70_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 3, 12 },
+ { 15, 187, 3063, 79, 155, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
} // End of namespace Igor
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index c489b657aa2..805a3467d15 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -478,7 +478,7 @@ void IgorEngine::waitForEndOfIgorDialogue(bool animateHead) {
}
void IgorEngine::animateIgorTalking(int frame) {
- if (getPart() == 4) {
+ if (getPart() == 4 || getPart() == 70) {
return;
}
if (getPart() == 85) {
Commit: 340d1822bb13530a061c8ba9e4d840948c98f04a
https://github.com/scummvm/scummvm/commit/340d1822bb13530a061c8ba9e4d840948c98f04a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:33+01:00
Commit Message:
IGOR: PART 72
Changed paths:
A engines/igor/parts/part_72.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index d42296c854a..9fddf55cd0b 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -524,6 +524,7 @@ private:
uint8 _objectsState[112];
bool _part07FirstVisitDone;
+ uint8 _part72StarIndex;
uint8 _parkLadyIdleStep;
uint8 _inventoryImages[36];
uint8 _inventoryInfo[74];
@@ -1114,6 +1115,15 @@ private:
void PART_70_UPDATE_ROOM_BACKGROUND();
void PART_70();
+ void PART_72_EXEC_ACTION(int action);
+ void PART_72_APPLY_OBJECT_STATE();
+ void PART_72_ACTION_102_takeObject();
+ void PART_72_ENTER_FROM_RIGHT();
+ void PART_72_ENTER_FROM_LEFT();
+ void PART_72_UPDATE_STAR();
+ void PART_72_UPDATE_ROOM_BACKGROUND();
+ void PART_72();
+
// maze
static const MazeNode MAZE_NODES[108];
static const MazeRoom *getMazeRoom(int part);
@@ -1381,6 +1391,7 @@ protected:
static const RoomDataOffsets PART_37_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_50_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_70_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_72_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
static const uint8 _inventoryOffsetTable[];
static const uint8 _inventoryActionsTable[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index c175017867e..099b2abb292 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -25,6 +25,7 @@ MODULE_OBJS = \
parts/part_6.o \
parts/part_7.o \
parts/part_70.o \
+ parts/part_72.o \
parts/part_8.o \
parts/part_9.o \
parts/part_10.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 1a66a8634bc..3a29c3a79d0 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -619,6 +619,10 @@ void IgorEngine::PART_MAIN() {
case 700:
PART_70();
break;
+ case 720:
+ case 721:
+ PART_72();
+ break;
case 750:
PART_75(); // philip vodka cutscene
break;
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
new file mode 100644
index 00000000000..66e06dad2cf
--- /dev/null
+++ b/engines/igor/parts/part_72.cpp
@@ -0,0 +1,246 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// The object that can be taken is drawn in the room picture as a 9x5 patch; the animation resource starts with
+// its two versions and then holds the three frames of the taking animation.
+static const int kPart72ObjectOffset = 84 * 320 + 133;
+static const int kPart72ObjectWidth = 9;
+static const int kPart72ObjectHeight = 5;
+static const int kPart72ObjectStateIndex = 102;
+static const int kPart72TakeFramesOffset = 2 * kPart72ObjectWidth * kPart72ObjectHeight;
+static const int kPart72TakeWidth = 35;
+static const int kPart72TakeHeight = 49;
+static const int kPart72TakeFrameSize = kPart72TakeWidth * kPart72TakeHeight;
+static const int kPart72TakeOffset = 42 * 320 + 133;
+
+// The areas that show the object while it is there.
+static const int kPart72ObjectAreas[5] = { 42, 44, 50, 56, 61 };
+
+// Screen positions of the five stars, each one drawn as two pixels two columns apart.
+static const int kPart72StarOffsets[5] = { 0x2C06, 0x135B, 0x0FC5, 0x23E7, 0x254D };
+
+static const int kPart72InventoryObject = 33;
+static const int kPart72InventoryIndex = 68;
+
+static bool PART_72_IS_PROTECTED_COLOR(uint8 color) {
+ return (color >= 0xC0 && color <= 0xCF) || (color >= 0xF0 && color <= 0xF1);
+}
+
+static void PART_72_DARKEN_PALETTE(uint8 *palette, int firstColor, int lastColor, int amount) {
+ for (int i = firstColor * 3; i < (lastColor + 1) * 3; ++i) {
+ const int value = palette[i] - amount;
+ palette[i] = value < 1 ? 0 : value;
+ }
+}
+
+void IgorEngine::PART_72_EXEC_ACTION(int action) {
+ switch (action) {
+ case 101:
+ _currentPart = 690;
+ break;
+ case 102:
+ PART_72_ACTION_102_takeObject();
+ break;
+ case 103:
+ igorSay(202, 1, 1094);
+ break;
+ case 104:
+ igorSay(203, 1, 1095);
+ break;
+ case 105:
+ igorSay(204, 1, 1096);
+ break;
+ case 106:
+ _objectsState[90] = 0;
+ _currentPart = 700;
+ break;
+ default:
+ error("PART_72_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+/**
+ * Draws the object into the room picture while it is there. Once it is taken its places are not objects anymore.
+ */
+void IgorEngine::PART_72_APPLY_OBJECT_STATE() {
+ const int taken = _objectsState[kPart72ObjectStateIndex] == 0 ? 0 : 1;
+ copyArea(_screenLayer1, kPart72ObjectOffset, 320, _animFramesBuffer + taken * kPart72ObjectWidth * kPart72ObjectHeight,
+ kPart72ObjectWidth, kPart72ObjectWidth, kPart72ObjectHeight);
+ if (taken) {
+ for (int i = 0; i < 5; ++i) {
+ _roomObjectAreasTable[kPart72ObjectAreas[i]].object = 0;
+ }
+ }
+}
+
+/**
+ * Igor takes the object: three frames of the animation are drawn over the screen, then the object goes to the
+ * inventory.
+ */
+void IgorEngine::PART_72_ACTION_102_takeObject() {
+ for (int i = 0; i < 3; ++i) {
+ const uint8 *frame = _animFramesBuffer + kPart72TakeFramesOffset + i * kPart72TakeFrameSize;
+ copyArea(_screenVGA, kPart72TakeOffset, 320, frame, kPart72TakeWidth, kPart72TakeWidth, kPart72TakeHeight);
+ waitForTimer(90);
+ }
+ addObjectToInventory(kPart72InventoryObject, kPart72InventoryIndex);
+ _objectsState[kPart72ObjectStateIndex] = 1;
+ PART_72_APPLY_OBJECT_STATE();
+ igorSay(201, 1, 1093);
+}
+
+/**
+ * Igor comes from the right edge, walking to the left.
+ */
+void IgorEngine::PART_72_ENTER_FROM_RIGHT() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(319, 68, kFacingPositionLeft, 0);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 15;
+ wd->scaleWidth = 50;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 50;
+ _walkDataLastIndex = 0;
+ _walkDataCurrentIndex = 1;
+ buildWalkPath(319, 68, 248, 108);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+/**
+ * Igor comes from the left edge, walking to the right.
+ */
+void IgorEngine::PART_72_ENTER_FROM_LEFT() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(0, 119, kFacingPositionRight, 0);
+ wd->clipSkipX = 15;
+ wd->clipWidth = 15;
+ wd->scaleWidth = 50;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 50;
+ _walkDataLastIndex = 0;
+ _walkDataCurrentIndex = 1;
+ buildWalkPath(0, 119, 41, 119);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+/**
+ * The current star is lit and, from time to time, another one is chosen and put out.
+ */
+void IgorEngine::PART_72_UPDATE_STAR() {
+ int pos = kPart72StarOffsets[_part72StarIndex - 1];
+ if (!PART_72_IS_PROTECTED_COLOR(_screenVGA[pos])) {
+ _screenVGA[pos] = 0xB3;
+ }
+ if (!PART_72_IS_PROTECTED_COLOR(_screenVGA[pos])) {
+ _screenVGA[pos + 2] = 0xB3;
+ }
+ if (getRandomNumber(4) != 0) {
+ return;
+ }
+ _part72StarIndex = getRandomNumber(4) + 1;
+ pos = kPart72StarOffsets[_part72StarIndex - 1];
+ if (!PART_72_IS_PROTECTED_COLOR(_screenVGA[pos])) {
+ _screenVGA[pos] = _screenLayer1[pos];
+ }
+ if (!PART_72_IS_PROTECTED_COLOR(_screenVGA[pos])) {
+ _screenVGA[pos + 2] = _screenLayer1[pos + 2];
+ }
+}
+
+void IgorEngine::PART_72_UPDATE_ROOM_BACKGROUND() {
+ if (compareGameTick(1)) {
+ if (getRandomNumber(14) == 0 && !isDialogueSpeechPlaying()) {
+ switch (getRandomNumber(1)) {
+ case 0:
+ playSound(39, 1);
+ break;
+ case 1:
+ playSound(40, 1);
+ break;
+ }
+ }
+ }
+ if (compareGameTick(0x3D)) {
+ PART_72_UPDATE_STAR();
+ }
+}
+
+void IgorEngine::PART_72() {
+ playMusic(4);
+ _gameState.enableLight = 2;
+ _part72StarIndex = 1;
+ loadActionData(DAT_Part72);
+ loadRoomData(PAL_Part72, IMG_Part72, BOX_Part72, MSK_Part72, TXT_Part72);
+ SET_PAL_240_48_1();
+ static const int anim[] = { ANM_Part72, 0 };
+ loadAnimData(anim);
+ _roomDataOffsets = PART_72_ROOM_DATA_OFFSETS;
+ setRoomClickFix(143, -1, -1, true);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_72_EXEC_ACTION);
+ _updateRoomBackground = &IgorEngine::PART_72_UPDATE_ROOM_BACKGROUND;
+ PART_72_APPLY_OBJECT_STATE();
+ memcpy(_screenVGA, _screenLayer1, 46080);
+
+ // the whole picture is darker than its palette
+ PART_72_DARKEN_PALETTE(_paletteBuffer, 1, 175, 10);
+ PART_72_DARKEN_PALETTE(_paletteBuffer, 192, 207, 15);
+
+ for (int i = 0; i < 5; ++i) {
+ const int pos = kPart72StarOffsets[i];
+ _screenVGA[pos] = 0xB3;
+ _screenVGA[pos + 2] = 0xB3;
+ }
+
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 720) {
+ PART_72_ENTER_FROM_RIGHT();
+ } else {
+ PART_72_ENTER_FROM_LEFT();
+ }
+ }
+ enterPartLoop();
+ while ((_currentPart == 720 || _currentPart == 721) && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ // the colors that changed are kept
+ memcpy(_paletteBuffer, _currentPalette, 624);
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 73220af1e3e..9be6ab6a586 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -696,4 +696,13 @@
#define MSK_Part70 1100
#define BOX_Part70 1101
+// State 720 (PART_72)
+#define DAT_Part72 1102
+#define ANM_Part72 1103
+#define TXT_Part72 1104
+#define IMG_Part72 1105
+#define PAL_Part72 1106
+#define MSK_Part72 1107
+#define BOX_Part72 1108
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 286196b70b1..1a5a635aca0 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -471,4 +471,11 @@ const RoomDataOffsets IgorEngine::PART_70_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_72_ROOM_DATA_OFFSETS = {
+ { 45, 3, 6, 2 },
+ { 76, 87 },
+ { 91, 281, 3227, 175, 251, 82 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
} // End of namespace Igor
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index c87ce1ba0c4..9e5b82e0272 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1185,7 +1185,7 @@ void IgorEngine::fixWalkPosition(int *x, int *y) {
break;
}
} while (yPos != 143);
- if (_roomClickFix.scanUp && yPos == 143) {
+ if (_roomClickFix.scanUp && yPos == 143 && _roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0) {
do {
--yPos;
} while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && yPos > 0);
Commit: c0a7586ec1ef287e9319d59adcf887108e2d91d6
https://github.com/scummvm/scummvm/commit/c0a7586ec1ef287e9319d59adcf887108e2d91d6
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:34+01:00
Commit Message:
IGOR: Fixes stone slab puzzle crashes
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_0.cpp
engines/igor/parts/part_1.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_4.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 9fddf55cd0b..4f9c310f6e6 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -630,31 +630,34 @@ private:
// map
void PART_04_EXEC_ACTION(int action);
- void PART_04_CLEAR_OBJECT_STATE_84(int num);
void PART_04();
+
+ // Igors room
void PART_00();
void PART_00_EXEC_ACTION(int action);
void PART_00_APPLY_OBJECT_STATE(int num);
void PART_00_ENTRY_ANIMATION();
void PART_00_WALK_IN_FROM_CLOSET();
void PART_00_ENTER_FROM_BELOW();
+ // Rooftop
void PART_01();
void PART_01_EXEC_ACTION(int action);
void PART_01_CLOSE_WINDOW();
void PART_01_STATE_11_BLIT_blitIgor();
- void PART_01_STATE_11_BLIT_00A5();
+ void PART_01_STATE_11_BLIT_blitRoof();
void PART_01_STATE_11_BLIT_drawIgorsEyes(int frame);
void PART_01_STATE_11_DRAW_drawPigeons(int index);
void PART_01_STATE_11_pigeonsCutscene();
void PART_01_STATE_12_explosion();
+ // junk room
void PART_02();
void PART_02_EXEC_ACTION(int action);
+ void lightUpDynamite();
void PART_02_APPLY_OBJECT_STATE(int num);
- void PART_02_START_DIALOGUE(int text, int count, int sound);
void PART_02_SEARCH_TRUNK();
void PART_02_DRAW_FUSE_SPARK(int frame);
void PART_02_UPDATE_FUSE();
- void PART_02_WALK_WITH_FUSE(int srcX, int srcY, int dstX, int dstY);
+ void PART_02_WALK_WHILE_FUSE_BURNS(int srcX, int srcY, int dstX, int dstY);
// spring bridge
void PART_05_HELPER_4_drawPaperOrNot(int num);
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 9161e05ced9..bc722ff00b3 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -26,14 +26,14 @@ namespace Igor {
void IgorEngine::PART_00_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
const bool open = _objectsState[8] != 0;
- const int src = open ? 0x4CFA : 0x4C6A;
+ const int src = open ? 0x4CFA : 0x4C6A; // open or closed bedside table depending on the flag
copyArea(_screenLayer1, 0x8EBD, 320, _animFramesBuffer + src, 16, 16, 9);
_roomActionsTable[74] = open ? 7 : 6;
_roomObjectAreasTable[13].object = open ? (_objectsState[9] == 0 ? 3 : 2) : 2;
}
if (num == 3 || num == 255) {
- const bool open = _objectsState[10] != 0; // s3:0846; cseg206:1AFF-1B42
- const int src = open ? 0x3900 : 0x3238;
+ const bool open = _objectsState[10] != 0;
+ const int src = open ? 0x3900 : 0x3238; // open or closed door frame depending on the flag
copyArea(_screenLayer1, 0x5572, 320, _animFramesBuffer + src, 31, 31, 56);
_roomActionsTable[76] = open ? 7 : 6;
_roomObjectAreasTable[3].object = (_objectsState[11] == 0) ? 4 : 5;
@@ -41,7 +41,7 @@ void IgorEngine::PART_00_APPLY_OBJECT_STATE(int num) {
if (num == 6 || num == 255) {
const int state = _objectsState[13];
- const int src = state == 1 ? 0x143C : 0x1200;
+ const int src = state == 1 ? 0x143C : 0x1200; // open or closed window depending on the flag
copyArea(_screenLayer1, 0x6DB7, 320, _animFramesBuffer + src, 26, 26, 22);
_roomActionsTable[79] = state == 1 ? 7 : (state == 2 ? 6 : 4);
}
@@ -189,6 +189,7 @@ void IgorEngine::PART_00_ENTRY_ANIMATION() {
waitForTimer(62);
if (_objectsState[10] == 0) {
drawAnimRect(0x5572, 0x3900, 31, 56);
+ // leave closet open
_objectsState[10] = 1;
PART_00_APPLY_OBJECT_STATE(3);
playSound(3, 1);
@@ -265,9 +266,11 @@ void IgorEngine::PART_00() {
};
loadAnimData(animFrames);
_roomDataOffsets = PART_00_ROOM_DATA_OFFSETS;
+
// clamps clicks to x 41..253 and y <= 143; clicks past the
// horizontal edges also clamp to y >= 141/138
setRoomWalkBounds(41, 0, 253, 143, 141, 138);
+
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_00_EXEC_ACTION);
PART_00_APPLY_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
diff --git a/engines/igor/parts/part_1.cpp b/engines/igor/parts/part_1.cpp
index 05ad55f323e..1f7aae2b98e 100644
--- a/engines/igor/parts/part_1.cpp
+++ b/engines/igor/parts/part_1.cpp
@@ -32,7 +32,7 @@ void IgorEngine::PART_01_STATE_11_BLIT_blitIgor() {
drawAnimRect(0x5476, 0x1859, 16, 13);
}
-void IgorEngine::PART_01_STATE_11_BLIT_00A5() {
+void IgorEngine::PART_01_STATE_11_BLIT_blitRoof() {
drawAnimRect(0x118F, 0xA7F9, 0xDA, 40);
}
@@ -51,7 +51,7 @@ void IgorEngine::PART_01_STATE_11_DRAW_drawPigeons(int index) {
// animation loop before handing over to state 22.
void IgorEngine::PART_01_STATE_11_pigeonsCutscene() {
PART_01_STATE_11_BLIT_blitIgor();
- PART_01_STATE_11_BLIT_00A5();
+ PART_01_STATE_11_BLIT_blitRoof();
memcpy(_currentPalette, _paletteBuffer, 768);
updatePalette(768);
@@ -85,6 +85,9 @@ void IgorEngine::PART_01_STATE_11_pigeonsCutscene() {
_currentPart = 22;
}
+/**
+ * Just a screen shaking effect
+ */
void IgorEngine::PART_01_STATE_12_explosion() {
int shakeY = 0;
int elapsed = 0;
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 8082bfd1dc0..bef962c19ab 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -416,7 +416,7 @@ void IgorEngine::PART_14_HELPER_9() {
}
if (_inputVars[kInputClick]) {
_inputVars[kInputClick] = 0;
- _dialogueEnded = area == 0;
+ _dialogueEnded = area != 0;
if (area == 9) {
_currentPart = 146;
}
@@ -450,25 +450,27 @@ void IgorEngine::PART_14_HELPER_9() {
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;
- playSound(35, 1);
- waitForTimer(255);
- stopSound();
- igorSayAndWait(204, 1, 863);
+ stopSound();
+ drawActionSentence(getString(STR_PushStone), 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;
+ playSound(35, 1);
+ waitForTimer(255);
+ stopSound();
+ // The mosaic screen has no Igor sprite, so his head is not animated.
+ igorSay(204, 1, 863);
+ waitForEndOfIgorDialogue(false);
+ }
}
}
}
@@ -477,7 +479,10 @@ void IgorEngine::PART_14_HELPER_9() {
_currentPart = 146;
_dialogueEnded = true;
}
- } while (_currentPart >= 145 && _currentPart <= 146 && !_dialogueEnded);
+ // The original reads mouse/keyboard state updated by interrupts; here
+ // input is only gathered while waiting for the timer.
+ waitForTimer();
+ } while (!_eventQuitGame && !(_currentPart >= 145 && _currentPart <= 146 && _dialogueEnded));
drawActionSentence("", 253);
hideCursor();
if (_currentPart == 145) {
@@ -498,11 +503,13 @@ void IgorEngine::PART_14_HELPER_10() {
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);
+ memcpy(_screenTempLayer + i * 100, _screenVGA + i * 320 + screenOffset, w);
+ memcpy(_screenVGA + i * 320 + screenOffset, _animFramesBuffer + animOffset + i * w, w);
}
waitForTimer(127);
- copyArea(_screenVGA, screenOffset, 320, _screenTempLayer, 100, 28, h + 1);
+ for (int i = 0; i <= h; ++i) {
+ memcpy(_screenVGA + i * 320 + screenOffset, _screenTempLayer + i * 100, w);
+ }
}
void IgorEngine::PART_14() {
@@ -542,9 +549,9 @@ void IgorEngine::loadResourceData__ROOM_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 };
+ static const int anm2[] = { FRM_ChurchPuzzle5, FRM_ChurchPuzzle6, FRM_ChurchPuzzle7, FRM_ChurchPuzzle8, FRM_ChurchPuzzle9, FRM_ChurchPuzzle10, FRM_ChurchPuzzle11, 0 };
loadAnimData(anm2, 0x1D8F);
- static const int anm3[] = { FRM_ChurchPuzzle13, FRM_ChurchPuzzle14, 0 };
+ static const int anm3[] = { FRM_ChurchPuzzle12, FRM_ChurchPuzzle13, FRM_ChurchPuzzle14, 0 };
loadAnimData(anm3, 0xCCE6);
}
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index 35c6f58a229..956d072e1df 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -10,10 +10,6 @@
namespace Igor {
-void IgorEngine::PART_02_START_DIALOGUE(int text, int count, int sound) {
- igorSay(text, count, sound);
-}
-
void IgorEngine::PART_02_SEARCH_TRUNK() {
for (int frame = 0; frame <= 2; ++frame) {
animateLitAnimFrames(0x3C0 + frame * 0x715, 0, 0, 0x715, 37, 49, 0x608C, 0, -1, 0);
@@ -39,12 +35,10 @@ void IgorEngine::PART_02_DRAW_FUSE_SPARK(int frame) {
}
void IgorEngine::PART_02_UPDATE_FUSE() {
- // The DOS loop chooses a new spark every eight timer units. The engine's
- // regular update step is exactly kTimerTicksCount (8) units.
- PART_02_DRAW_FUSE_SPARK(getRandomNumber(3)); // DOS random(4);
+ PART_02_DRAW_FUSE_SPARK(getRandomNumber(3));
}
-void IgorEngine::PART_02_WALK_WITH_FUSE(int srcX, int srcY, int dstX, int dstY) {
+void IgorEngine::PART_02_WALK_WHILE_FUSE_BURNS(int srcX, int srcY, int dstX, int dstY) {
--_walkDataLastIndex;
buildWalkPath(srcX, srcY, dstX, dstY);
_walkDataCurrentIndex = 1;
@@ -101,7 +95,7 @@ void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
}
}
if (num == 6 || num == 255) {
- if (_objectsState[21] == 0)
+ if (_objectsState[21] == 0) // changes action on hammer after using it the first time
_roomObjectAreasTable[14].object = _objectsState[20] == 1 ? 8 : (_objectsState[19] == 1 ? 7 : (_objectsState[18] == 1 ? 6 : 0));
}
if ((num == 8 || num == 255) && _objectsState[23] == 1) {
@@ -118,7 +112,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
switch (action) {
case 101: // open trunk
if (_objectsState[16] == 1) {
- PART_02_START_DIALOGUE(201, 1, 108);
+ igorSay(201, 1, 108);
break;
}
animateLitAnimFrames(0x18FF, 1, 2, 0x715, 37, 49, 0x608C, 127, 1, 7);
@@ -127,7 +121,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
break;
case 102: // close trunk
if (_objectsState[16] == 0) {
- PART_02_START_DIALOGUE(201, 1, 108);
+ igorSay(201, 1, 108);
break;
}
playSound(8, 1);
@@ -148,16 +142,15 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
_objectsState[21] = 0;
PART_02_APPLY_OBJECT_STATE(5);
PART_02_APPLY_OBJECT_STATE(6);
- PART_02_START_DIALOGUE(217, 1, 121);
+ igorSay(217, 1, 121);
break;
}
case 104: { // use the pick on the crack; cseg203:0838-0A2C
- if (_objectsState[23] == 1) { // s3:0x0853; cseg203:0846-0851
- EXEC_MAIN_ACTION(2); // s3:0x5944 = cseg222:2A76
+ if (_objectsState[23] == 1) {
+ EXEC_MAIN_ACTION(2);
break;
}
- // The selector bytes at dseg231:0x024A-0x025E alternate frames
- // 0/1 and finish on frame 2 (indexed from s3:0x0249).
+
for (int step = 1; step <= 21; ++step) {
const int frame = step == 21 ? 2 : ((step + 1) & 1);
animateLitAnimFrames(0x41CA + frame * 0x658, 0, 0, 0x658,
@@ -166,43 +159,43 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
playSound(10, 1);
waitForTimer(63);
}
- _objectsState[19] = 1; // s3:0x084F; cseg203:09EB
- _objectsState[20] = 0; // s3:0x0850; cseg203:09F0
+ _objectsState[19] = 1;
+ _objectsState[20] = 0;
PART_02_APPLY_OBJECT_STATE(4);
PART_02_APPLY_OBJECT_STATE(5);
PART_02_APPLY_OBJECT_STATE(6);
- PART_02_START_DIALOGUE(218, 1, 122);
+ igorSay(218, 1, 122);
break;
}
case 105: // look at nail
- PART_02_START_DIALOGUE(209, 1, 115);
+ igorSay(209, 1, 115);
_objectsState[22] = 1;
break;
- case 106: // look in trunk; cseg203:0A87-0D70
- if (_objectsState[16] == 0) { // s3:0x084C; cseg203:0A91-0AB9
- PART_02_START_DIALOGUE(201, 1, 108);
+ case 106: // look in trunk
+ if (_objectsState[16] == 0) {
+ igorSay(201, 1, 108);
break;
}
- if (_inventoryInfo[44] == 0 && _inventoryInfo[45] == 0) { // s3:0x0906/0907
- if (_objectsState[22] == 0) { // s3:0x0852; cseg203:0AD0-0B0A
- PART_02_START_DIALOGUE(202, 2, 109);
+ if (_inventoryInfo[44] == 0 && _inventoryInfo[45] == 0) {
+ if (_objectsState[22] == 0) {
+ igorSay(202, 2, 109);
} else {
PART_02_SEARCH_TRUNK();
- PART_02_START_DIALOGUE(204, 1, 111);
- addObjectToInventory(9, 44); // s3:0x0906; cseg203:0B35-0B6F
+ igorSay(204, 1, 111);
+ addObjectToInventory(9, 44);
PART_02_APPLY_OBJECT_STATE(255);
}
break;
}
if (_inventoryInfo[44] != 0 && _inventoryInfo[45] == 0) {
- if (_objectsState[20] == 0) { // s3:0x0850
- PART_02_START_DIALOGUE(202, 2, 109);
+ if (_objectsState[20] == 0) {
+ igorSay(202, 2, 109);
} else {
PART_02_SEARCH_TRUNK();
- PART_02_START_DIALOGUE(205, 1, 112);
- removeObjectFromInventory(44); // s3:0x0906; cseg203:0BFD-0C17
+ igorSay(205, 1, 112);
+ removeObjectFromInventory(44);
playSound(63, 1);
- addObjectToInventory(10, 45); // s3:0x0907; cseg203:0C1C-0C60
+ addObjectToInventory(10, 45);
PART_02_APPLY_OBJECT_STATE(255);
}
break;
@@ -211,17 +204,16 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
_inventoryInfo[46] == 0 && _objectsState[23] == 0 &&
_objectsState[19] != 0) {
PART_02_SEARCH_TRUNK();
- PART_02_START_DIALOGUE(206, 1, 113);
- addObjectToInventory(11, 46); // s3:0x0908; cseg203:0D01-0D3B
- PART_02_APPLY_OBJECT_STATE(255);
+ igorSay(206, 1, 113);
+ addObjectToInventory(11, 46);
} else if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 &&
_inventoryInfo[46] == 0 && _objectsState[23] == 0) {
- PART_02_START_DIALOGUE(202, 2, 109);
+ igorSay(202, 2, 109);
} else {
- PART_02_START_DIALOGUE(207, 2, 114);
+ igorSay(207, 2, 114);
}
break;
- case 107: // take butterfly net; cseg203:0D71-0F3E
+ case 107: // take butterfly net
animateLitAnimFrames(0x54D2, 0, 1, 0x405, 21, 49, 0x5A6D, 127, -1, 0);
waitForTimer(127);
addObjectToInventory(7, 42);
@@ -229,19 +221,19 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
PART_02_APPLY_OBJECT_STATE(2);
break;
case 108: // Look at old junk
- PART_02_START_DIALOGUE(210, 1, 116);
+ igorSay(210, 1, 116);
break;
case 109: // look at portrait
igorSay({ { 225, 4, 128 }, { 229, 1, 129 } });
break;
case 110: // look at hole
- PART_02_START_DIALOGUE(213, 1, 118);
+ igorSay(213, 1, 118);
break;
- case 111:
- PART_02_START_DIALOGUE(214, 2, 119);
+ case 111: // look at big crack
+ igorSay(214, 2, 119);
break;
case 112:
- PART_02_START_DIALOGUE(216, 1, 120);
+ igorSay(216, 1, 120);
break;
case 113: // place dynamite in the crack
animateLitAnimFrames(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
@@ -253,17 +245,17 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
PART_02_APPLY_OBJECT_STATE(255);
break;
case 114:
- PART_02_START_DIALOGUE(219, 1, 123);
+ igorSay(219, 1, 123);
break;
case 115:
- PART_02_START_DIALOGUE(217, 1, 121);
+ igorSay(217, 1, 121);
break;
case 116:
- PART_02_START_DIALOGUE(218, 1, 122);
+ igorSay(218, 1, 122);
break;
case 118: // exit through window
if (_objectsState[24] == 1) {
- PART_02_START_DIALOGUE(220, 1, 124);
+ igorSay(220, 1, 124);
} else {
_objectsState[24] = 1;
_currentPart = 11;
@@ -278,10 +270,10 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
_currentPart = 30;
break;
case 121: // look at shelf / take matches
- if (_objectsState[25] == 1) { // s3:0x0855; cseg203:0F49
- PART_02_START_DIALOGUE(230, 1, 130);
+ if (_objectsState[25] == 1) {
+ igorSay(230, 1, 130);
} else {
- PART_02_START_DIALOGUE(211, 2, 117);
+ igorSay(211, 2, 117);
addObjectToInventory(8, 43);
_objectsState[25] = 1;
}
@@ -290,63 +282,66 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
if (_objectsState[23] == 0) {
EXEC_MAIN_ACTION(2);
} else {
- memset(_screenVGA + 0xB400, 0, 0x4BFF);
- playSound(68, 1);
- animateLitAnimFrames(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
- waitForTimer(127);
+ lightUpDynamite();
+ }
+ break;
+ default:
+ warning("PART_02_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+void IgorEngine::lightUpDynamite() {
+ memset(_screenVGA + 0xB400, 0, 0x4BFF);
+ playSound(68, 1);
+ animateLitAnimFrames(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
+ waitForTimer(127);
- PART_02_START_DIALOGUE(221, 1, 125);
- if (_gameState.talkMode == kTalkModeTextOnly)
- playSound(11, 1);
- _updateRoomBackground = &IgorEngine::PART_02_UPDATE_FUSE;
- waitForEndOfIgorDialogue();
- _updateRoomBackground = 0;
+ igorSay(221, 1, 125);
+ if (_gameState.talkMode == kTalkModeTextOnly)
+ playSound(11, 1);
+ _updateRoomBackground = &IgorEngine::PART_02_UPDATE_FUSE;
+ waitForEndOfIgorDialogue();
+ _updateRoomBackground = 0;
- memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 320 * 72, _dialogueDirtyRectSize);
- if (_gameState.talkMode != kTalkModeTextOnly)
- playSound(11, 1);
+ memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 320 * 72, _dialogueDirtyRectSize);
+ if (_gameState.talkMode != kTalkModeTextOnly)
+ playSound(11, 1);
- PART_02_WALK_WITH_FUSE(211, 120, 0, 143);
- for (int elapsed = 0; elapsed < 255; elapsed += kTimerTicksCount) {
- PART_02_UPDATE_FUSE();
- waitForTimer();
- }
- copyArea(_screenVGA, 0x5996, 320, _screenLayer1 + 0x5996, 320, 12, 12);
- stopSound();
- waitForTimer(5 * 255);
+ PART_02_WALK_WHILE_FUSE_BURNS(211, 120, 0, 143);
+ for (int elapsed = 0; elapsed < 255; elapsed += kTimerTicksCount) {
+ PART_02_UPDATE_FUSE();
+ waitForTimer();
+ }
+ copyArea(_screenVGA, 0x5996, 320, _screenLayer1 + 0x5996, 320, 12, 12);
+ stopSound();
+ waitForTimer(5 * 255);
- PART_02_START_DIALOGUE(222, 2, 126);
- waitForEndOfIgorDialogue();
- waitForTimer(2 * 255);
- stopDialogueSpeech();
+ igorSay(222, 2, 126);
+ waitForEndOfIgorDialogue();
+ waitForTimer(2 * 255);
+ stopDialogueSpeech();
- _gameState.dialogueTextRunning = false;
+ _gameState.dialogueTextRunning = false;
- // Return from the left edge to the dynamite wall.
- --_walkDataLastIndex;
- buildWalkPath(0, 143, 211, 120);
- _walkDataCurrentIndex = 1;
- _walkData[_walkDataLastIndex].frameNum = 0;
- _gameState.igorMoving = true;
- waitForIgorMove();
+ // Return from the left edge to the dynamite wall.
+ --_walkDataLastIndex;
+ buildWalkPath(0, 143, 211, 120);
+ _walkDataCurrentIndex = 1;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
- _objectsState[18] = 1;
- _objectsState[19] = 0;
- _objectsState[23] = 0;
- _objectsState[11] = 1;
- PART_02_APPLY_OBJECT_STATE(3);
- PART_02_APPLY_OBJECT_STATE(4);
- PART_02_APPLY_OBJECT_STATE(5);
- memset(_currentPalette + 240 * 3, 0, 16 * 3);
- setPaletteRange(240, 255);
- _currentPart = 12;
- }
- break;
- default:
- warning("PART_02_EXEC_ACTION unhandled action %d", action);
- break;
- }
+ _objectsState[18] = 1;
+ _objectsState[19] = 0;
+ _objectsState[23] = 0;
+ _objectsState[11] = 1;
+ PART_02_APPLY_OBJECT_STATE(3);
+ PART_02_APPLY_OBJECT_STATE(4);
+ PART_02_APPLY_OBJECT_STATE(5);
+ memset(_currentPalette + 240 * 3, 0, 16 * 3);
+ setPaletteRange(240, 255);
+ _currentPart = 12;
}
void IgorEngine::PART_02() {
@@ -375,9 +370,8 @@ void IgorEngine::PART_02() {
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
switch (_currentPart) {
- case 20:
+ case 20: // Igor climbs through the window on the first attic entrance.
fadeIn(768);
- // Igor climbs through the window on the first attic entrance.
animateLitAnimFrames(0x69C0, 0, 2, 0x759, 33, 57, 0x4B26, 31, -1, 0);
waitForTimer(31);
_walkData[0].setPos(57, 117, kFacingPositionRight, 0);
@@ -386,18 +380,12 @@ void IgorEngine::PART_02() {
fadeIn(768);
_walkData[0].setPos(300, 136, kFacingPositionLeft, 0);
break;
- case 22:
- // restores the live palette from the saved one
- // before the walk setup below, the same copy state 11 happens
- // Without it the part-1 fadeOut leaves the attic black.
+ case 22: // back after pigeons cutscene
memcpy(_currentPalette, _paletteBuffer, 768);
updatePalette(768);
_walkData[0].setPos(49, 118, kFacingPositionBack, 0);
break;
- case 23:
- // State 12 fades the outside scene to black before returning here.
- // The original state-23 entrance clears the text/UI area and restores
- // the attic palette before drawing its post-explosion frame.
+ case 23: // back after outdoor explosion scene
memset(_screenVGA + 0xB400, 0, 0x4600);
memcpy(_currentPalette, _paletteBuffer, 768);
drawAnimRect(0x6C3B, 0x820B + 0 * 0xA19, 47, 55, false, kBlendLitSprite);
@@ -418,14 +406,14 @@ void IgorEngine::PART_02() {
else
waitForTimer(127);
}
- PART_02_START_DIALOGUE(224, 1, 127);
+ igorSay(224, 1, 127);
// Rebuild the panels erased above.
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
_walkData[0].setPos(215, 134, kFacingPositionRight, 0);
break;
- case 24:
+ case 24: // From igor's room
_walkData[0].setPos(211, 120, kFacingPositionFront, 0);
fadeIn(768);
break;
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index 08ac06ea7b6..8847c8ee328 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -54,18 +54,19 @@ void IgorEngine::PART_04_EXEC_ACTION(int action) {
break;
}
}
-void IgorEngine::PART_04_CLEAR_OBJECT_STATE_84(int num) {
- _objectsState[84] = 0;
-}
+
/**
* MAP
* */
void IgorEngine::PART_04() {
- if (_objectsState[106] == 1) {
+
+ if (_objectsState[106] == 1) { // newspaper cutscene
_currentPart = 730;
return;
}
+
+ // if philip has drunk the chemical, trigger the cutscene
if (_objectsState[107] == 1) {
_objectsState[107] = 0;
_currentPart = 750;
@@ -76,7 +77,9 @@ void IgorEngine::PART_04() {
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);
+
+ // closes Philips locker
+ _objectsState[84] = 0;
memcpy(_screenVGA, _screenLayer1, 46080);
playMusic(1);
@@ -99,11 +102,14 @@ void IgorEngine::PART_04() {
if (compareGameTick(4, 8)) {
handleRoomInventoryScroll();
}
+ // palette animation for the water
scrollPalette(200, 207);
setPaletteRange(200, 207);
+
if (compareGameTick(1)) {
handleIgorIdleAnimation();
}
+
scrollPalette(184, 199);
setPaletteRange(184, 199);
waitForTimer();
Commit: 0d3940973eafbc6b7d9f82b3a8c105d93963dd1f
https://github.com/scummvm/scummvm/commit/0d3940973eafbc6b7d9f82b3a8c105d93963dd1f
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:34+01:00
Commit Message:
IGOR: Look at newspaper full screen scene
Changed paths:
engines/igor/igor.h
engines/igor/part_main.cpp
engines/igor/parts/part_10.cpp
engines/igor/parts/part_11.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_7.cpp
engines/igor/parts/part_8.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 4f9c310f6e6..c9a744ca00f 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -625,7 +625,7 @@ private:
void moveScreenUp(int offset);
void lookAtPapyrus(bool reveal);
void EXEC_MAIN_ACTION(int action);
- void EXEC_MAIN_ACTION_38();
+ void EXEC_MAIN_ACTION_38_lookAtNewspaper();
void EXEC_MAIN_ACTION_43_lookAtPhoto();
// map
@@ -662,7 +662,7 @@ private:
// spring bridge
void PART_05_HELPER_4_drawPaperOrNot(int num);
void PART_05_HELPER_6_walkIgorToScene();
- void PART_05_06_DRAW_PAPER(int frame);
+ void PART_05_06_drawPaperFrame(int frame);
void PART_05_06_SAVE_PHOTOGRAPHER_BACKGROUND();
void PART_05_06_DRAW_PHOTOGRAPHER();
void PART_05_06_DRAW_CAMERA(int frame);
@@ -681,35 +681,34 @@ private:
void PART_06_HANDLE_DIALOGUE_PHOTOGRAPHER();
void PART_06_UPDATE_DIALOGUE_PHOTOGRAPHER(int action);
void PART_06_HELPER_7_decodePhotographerTalkingFrame(int frame);
- void PART_06_ACTION_105();
+ void PART_06_ACTION_105_pickCamera();
void PART_06_ACTION_107_giveAnythingToPhotographer();
void PART_06_ACTION_108_giveRocketToPhotographer();
void PART_06_ACTION_102_scrollLeft();
void PART_06_HELPER_6_setPhotographerState(int num);
void PART_06_HELPER_8_animatePhotographer(int frame);
- void PART_06_HELPER_12();
- void PART_06_HELPER_15(int frame);
+ void PART_06_HELPER_12_drawBackgroundOverPhotographer();
void PART_07();
void PART_07_EXEC_ACTION(int action);
void PART_07_DRAW_DOOR_STATE(int num);
void PART_07_openCloseDoor(int door, bool open);
void PART_07_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame, int dyPos);
- void PART_07_ENTER_FROM_OUTSIDE();
- void PART_07_EXIT_TO_OUTSIDE();
+ void PART_07_enterFromOutside();
+ void PART_07_exitToOutside();
// Dean's office
void PART_08();
void PART_08_EXEC_ACTION(int action);
void PART_08_APPLY_OBJECT_STATE(int num);
void drawDoor(bool open);
- void PART_08_ACTION_105();
+ void PART_08_ACTION_pickNewspaper();
void PART_08_ACTION_108_deanCallsSecretary();
- void PART_08_ACTION_109();
- void PART_08_ACTION_103_TALK_TO_DEAN();
+ void PART_08_ACTION_pickBook();
+ void PART_08_ACTION_103_talkToDean();
void giveBottleToDean();
- void PART_08_DEAN_PASSES_OUT();
- void PART_08_DEAN_DRINKS();
+ void PART_08_deanDrinksBottle();
+ void PART_08_deanPassesOut();
void PART_08_HANDLE_DIALOGUE_DEAN();
void drawDean();
void drawDeanTalkingFrame(int frame);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 3a29c3a79d0..40d33d5c9dc 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -153,7 +153,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
igorSay(69, 1, 46);
break;
case 38:
- // EXEC_MAIN_ACTION_38();
+ EXEC_MAIN_ACTION_38_lookAtNewspaper();
break;
case 39:
igorSay(70, 1, 47);
@@ -298,6 +298,51 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
}
}
+void IgorEngine::EXEC_MAIN_ACTION_38_lookAtNewspaper() {
+ memcpy(_paletteBuffer, _currentPalette, 624);
+ fadeOut(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);
+ fadeIn(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(false);
+ 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(false);
+ wd->x = _walkDataCurrentPosX2;
+ wd->y = _walkDataCurrentPosY2;
+ wd->scaleWidth = _walkDataCurrentWScale;
+ fadeOut(624);
+ if (tmp) {
+ memcpy(_screenVGA, tmp, 64000);
+ memcpy(_paletteBuffer, tmp + 64000, 768);
+ free(tmp);
+ }
+ fadeIn(624);
+ _objectsState[2] = 1;
+}
+
void IgorEngine::EXEC_MAIN_ACTION_43_lookAtPhoto() {
memcpy(_paletteBuffer, _currentPalette, 624);
fadeOut(624);
diff --git a/engines/igor/parts/part_10.cpp b/engines/igor/parts/part_10.cpp
index 2e16a899388..99d97132f99 100644
--- a/engines/igor/parts/part_10.cpp
+++ b/engines/igor/parts/part_10.cpp
@@ -32,6 +32,7 @@ void IgorEngine::PART_10_11_DRAW_OBJECT_STATE(int num) {
// halves of the room
if ((num == 2 || num == 255) && _objectsState[41] == 1) {
+ //draw shards
copyArea(_screenLayer1, 0x7DA1, 320, _animFramesBuffer + 0xC786, 37, 37, 8);
}
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index ea927eedecd..d52a5a2d395 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -33,7 +33,7 @@ void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
_roomObjectAreasTable[13].object = _objectsState[40] == 0 ? 4 : 3;
if (num == 2 || num == 255) {
- if (_objectsState[41] == 1) {
+ if (_objectsState[41] == 1) { //glass shards
// make area selectable
for (int area = 10; area <= 11; ++area)
_roomObjectAreasTable[area].object = 7;
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index 273549df4ec..cd6ba89f76e 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -55,11 +55,11 @@ void IgorEngine::PART_05_HELPER_4_drawPaperOrNot(int num) {
if (_objectsState[60] == 0) {
// paper not taken, paint "frame 0"
- PART_05_06_DRAW_PAPER(0);
+ PART_05_06_drawPaperFrame(0);
return;
}
// paper taken, paint "frame 1"
- PART_05_06_DRAW_PAPER(1);
+ PART_05_06_drawPaperFrame(1);
// disable object
_roomObjectAreasTable[24].object = 0;
for (int i = 27; i <= 29; ++i) {
@@ -67,7 +67,7 @@ void IgorEngine::PART_05_HELPER_4_drawPaperOrNot(int num) {
}
}
-void IgorEngine::PART_05_06_DRAW_PAPER(int frame) {
+void IgorEngine::PART_05_06_drawPaperFrame(int frame) {
const int offset = 41926;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x7E00 + frame * 12, 4, 4, 3);
@@ -84,8 +84,6 @@ void IgorEngine::PART_05_06_DRAW_PHOTOGRAPHER() {
}
void IgorEngine::PART_05_06_DRAW_TRIPOD(bool drawToScreen) {
- // Layer-1 blit: cseg182:047C-04CB; the active-pane copy is
- // cseg180:03E9-0462.
const int offset = 28668;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x7E54, 23, 23, 33);
if (drawToScreen)
@@ -93,7 +91,6 @@ void IgorEngine::PART_05_06_DRAW_TRIPOD(bool drawToScreen) {
}
void IgorEngine::PART_05_06_DRAW_CAMERA(int frame) {
- // cseg180:038B-03E6; duplicated at cseg182:041E-0479.
const int offset = 26756;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x7E00 + frame * 42, 7, 7, 6);
}
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index 6751fb3e866..db09410de8c 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -81,8 +81,8 @@ void IgorEngine::PART_06_EXEC_ACTION(int action) {
case 104: // look at photographer
igorSay(203, 1, 481);
break;
- case 105:
- PART_06_ACTION_105();
+ case 105: // pick camera
+ PART_06_ACTION_105_pickCamera();
break;
case 106: // Look at camera
igorSay(204, 1, 482);
@@ -144,7 +144,7 @@ void IgorEngine::PART_06_HELPER_6_setPhotographerState(int num) {
_roomObjectAreasTable[17].area = 0;
_roomObjectAreasTable[18].area = 0;
} else {
- PART_06_HELPER_12();
+ PART_06_HELPER_12_drawBackgroundOverPhotographer();
_roomObjectAreasTable[2].object = 0;
_roomObjectAreasTable[15].object = 0;
_roomObjectAreasTable[18].object = 0;
@@ -166,7 +166,7 @@ void IgorEngine::PART_06_HELPER_6_setPhotographerState(int num) {
}
}
-void IgorEngine::PART_06_ACTION_105() {
+void IgorEngine::PART_06_ACTION_105_pickCamera() {
_gameTicks = 0;
int i = 0;
do {
@@ -193,6 +193,7 @@ void IgorEngine::PART_06_ACTION_107_giveAnythingToPhotographer() {
}
void IgorEngine::PART_06_ACTION_108_giveRocketToPhotographer() {
+ // first frame of photographer
PART_06_HELPER_8_animatePhotographer(0);
igorSayAndWait({ { 208, 2, 485 }, { 210, 2, 486 } });
cutsceneSay(170, 69, 55, 37, 63, 212, 1, 487);
@@ -211,6 +212,7 @@ void IgorEngine::PART_06_ACTION_108_giveRocketToPhotographer() {
PART_06_UPDATE_ROOM_BACKGROUND();
waitForTimer();
} while (i != 28);
+ // removes rocket
removeObjectFromInventory(61);
_objectsState[61] = 0;
PART_06_HELPER_6_setPhotographerState(255);
@@ -267,17 +269,12 @@ void IgorEngine::PART_06_ACTION_102_scrollLeft() {
_currentPart = 51;
}
-void IgorEngine::PART_06_HELPER_12() {
+void IgorEngine::PART_06_HELPER_12_drawBackgroundOverPhotographer() {
const int offset = 23521;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xDEA7, 23, 23, 49);
}
-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() {
playMusic(10);
debug("Entering PART_06");
@@ -288,14 +285,14 @@ void IgorEngine::PART_06() {
// loads from offset 32256
loadAnimData(anm1, 0x7E00);
if (_objectsState[60] == 0) {
- PART_05_06_DRAW_PAPER(0);
+ PART_05_06_drawPaperFrame(0);
}
// copying a patch of 224 pixels width and 144 height into the backup buffer for later scroll
// then it loads the actual current scene, SpringRock
copyArea(_animFramesBuffer, 0, 224, _screenLayer1, 320, 224, 144);
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
+
SET_PAL_240_48_1();
- // the room palette resource is longer than the palette the room really uses, restore the inventory colors
SET_PAL_208_96_1();
static const int anm2[] = {FRM_SpringRock1, FRM_SpringRock2, 0};
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index ae6ecff0229..7ecbd276084 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -17,7 +17,7 @@ const uint32 kDoor2Open = 0x28DD;
void IgorEngine::PART_07_DRAW_DOOR_STATE(int num) {
_roomActionsTable[297] = 109;
- if (num == 1 || num == 255) {
+ if (num == 1 || num == 255) { // draws open or closed door depending on the flag
const uint32 srcOffset = _objectsState[26] == 0 ? kDoor1Closed : kDoor1Open;
copyArea(_screenLayer1, 0x4DB8, 320, _animFramesBuffer + srcOffset, 12, 12, 53);
_roomActionsTable[146] = _objectsState[26] == 0 ? 6 : 7;
@@ -70,7 +70,7 @@ void IgorEngine::PART_07_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame,
moveIgor(facing, frame);
}
-void IgorEngine::PART_07_ENTER_FROM_OUTSIDE() {
+void IgorEngine::PART_07_enterFromOutside() {
PART_07_DRAW_DOOR_STATE(255);
for (int area = 11; area <= 13; ++area)
_roomObjectAreasTable[area].area = 0;
@@ -102,7 +102,7 @@ void IgorEngine::PART_07_ENTER_FROM_OUTSIDE() {
}
}
-void IgorEngine::PART_07_EXIT_TO_OUTSIDE() {
+void IgorEngine::PART_07_exitToOutside() {
int frame = 1;
for (int step = 9; step >= 0; --step) {
if (step == 9)
@@ -154,7 +154,7 @@ void IgorEngine::PART_07_EXEC_ACTION(int action) {
igorSayAndWait(212, 1, 146);
break;
case 110:
- PART_07_EXIT_TO_OUTSIDE();
+ PART_07_exitToOutside();
break;
case 111: // Go through dean's door
if (_objectsState[26] != 0) {
@@ -225,7 +225,7 @@ void IgorEngine::PART_07() {
_walkDataCurrentIndex = 1;
fadeIn(768);
if (_currentPart == 70) { // enter from outside
- PART_07_ENTER_FROM_OUTSIDE();
+ PART_07_enterFromOutside();
}
}
enterPartLoop();
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index f9d7194f4b1..f57f0a87ecb 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -87,7 +87,7 @@ void IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN(int action) {
}
}
-void IgorEngine::PART_08_ACTION_105() {
+void IgorEngine::PART_08_ACTION_pickNewspaper() {
for (int frame = 0; frame <= 1; ++frame) {
drawAnimRect(0x66E3, 0x125E + frame * 0x55C, 28, 49);
if (frame == 0)
@@ -98,7 +98,7 @@ void IgorEngine::PART_08_ACTION_105() {
PART_08_APPLY_OBJECT_STATE(255);
}
-void IgorEngine::PART_08_ACTION_109() {
+void IgorEngine::PART_08_ACTION_pickBook() {
for (int frame = 0; frame <= 1; ++frame) {
drawAnimRect(0x4F77, 2448 + frame * 1127, 23, 49, false, kBlendLitSprite);
if (frame == 0)
@@ -140,6 +140,7 @@ void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
_currentPart = 91;
fadeOut(768);
+ // loads screen 9
loadActionData(DAT_AdministrationSecretaryRoom);
loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom, BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom, TXT_AdministrationSecretaryRoom);
memcpy(_screenVGA, _screenLayer1, 46080);
@@ -161,6 +162,7 @@ void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
_objectsState[27] = 0;
_objectsState[35] = 1;
+ // back to room 8
loadActionData(DAT_DeanPepperOffice);
loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice, BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice);
_roomDataOffsets = PART_08_ROOM_DATA_OFFSETS;
@@ -175,7 +177,7 @@ void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
_objectsState[32] = 1;
}
-void IgorEngine::PART_08_DEAN_PASSES_OUT() {
+void IgorEngine::PART_08_deanDrinksBottle() {
static const uint8 frames[] = {
3, 1, 2, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5,
4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 6, 7, 8, 9
@@ -187,7 +189,7 @@ void IgorEngine::PART_08_DEAN_PASSES_OUT() {
}
}
-void IgorEngine::PART_08_DEAN_DRINKS() {
+void IgorEngine::PART_08_deanPassesOut() {
const uint8 savedTalkMode = _gameState.talkMode;
_gameState.talkMode = kTalkModeTextOnly;
waitForTimer(255);
@@ -223,7 +225,7 @@ void IgorEngine::PART_08_HANDLE_DIALOGUE_DEAN() {
_updateDialogue = 0;
}
-void IgorEngine::PART_08_ACTION_103_TALK_TO_DEAN() {
+void IgorEngine::PART_08_ACTION_103_talkToDean() {
if (_objectsState[29] == 1) {
igorSayAndWait(223, 1, 169);
return;
@@ -301,9 +303,10 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
+ // if gave bottle to dean
if (_objectsState[30] != 0) {
waitForTimer(251);
- PART_08_DEAN_PASSES_OUT();
+ PART_08_deanDrinksBottle();
if (_objectsState[42] == 1)
_objectsState[42] = 2;
else
@@ -311,7 +314,7 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
waitForTimer(101);
playSound(16, 1);
if (_objectsState[30] == 2) {
- PART_08_DEAN_DRINKS();
+ PART_08_deanPassesOut();
_objectsState[29] = 1;
}
_objectsState[30] = 0;
@@ -341,10 +344,10 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
igorSayAndWait(209, 1, 157);
break;
case 105:
- PART_08_ACTION_105();
+ PART_08_ACTION_pickNewspaper();
break;
case 103:
- PART_08_ACTION_103_TALK_TO_DEAN();
+ PART_08_ACTION_103_talkToDean();
break;
case 108:
if (_objectsState[29] == 0) {
@@ -361,7 +364,7 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
} else if (_objectsState[28] == 1) {
igorSayAndWait(215, 1, 161);
} else {
- PART_08_ACTION_109();
+ PART_08_ACTION_pickBook();
}
break;
case 114:
@@ -397,7 +400,7 @@ void IgorEngine::PART_08() {
loadAnimData(anim);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_08_EXEC_ACTION);
_roomDataOffsets = PART_08_ROOM_DATA_OFFSETS;
- setRoomClickFix(143, -1, 281, false); // cseg100:0657
+ setRoomClickFix(143, -1, 281, false);
PART_08_APPLY_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
Commit: 23b4b301fc728ff5c6338bae4bc5d9afcd03ed14
https://github.com/scummvm/scummvm/commit/23b4b301fc728ff5c6338bae4bc5d9afcd03ed14
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:34+01:00
Commit Message:
IGOR: Part 68
Changed paths:
A engines/igor/parts/part_68.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_72.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index d9e8e6288b4..903513ae648 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -159,6 +159,10 @@ void IgorEngine::restart() {
memset(_objectsState, 0, sizeof(_objectsState));
_part07FirstVisitDone = false; // cseg197:0795-0845; original global s3:0xED2E
+ _roomAmbientIndex = 0;
+ _part68QuestionCounter = 1;
+ _part68LastDialogueCode = 0;
+ _part68NpcPresent = false;
_parkLadyIdleStep = 1;
memcpy(_inventoryImages, INVENTORY_IMG_INIT, 36);
memset(_inventoryInfo, 0, sizeof(_inventoryInfo));
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index c9a744ca00f..632f6293ec3 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -524,7 +524,11 @@ private:
uint8 _objectsState[112];
bool _part07FirstVisitDone;
- uint8 _part72StarIndex;
+ // scratch of the room loops: the current ambient frame (a star in part 72, the screen in part 68)
+ uint8 _roomAmbientIndex;
+ uint8 _part68QuestionCounter;
+ uint8 _part68LastDialogueCode;
+ bool _part68NpcPresent;
uint8 _parkLadyIdleStep;
uint8 _inventoryImages[36];
uint8 _inventoryInfo[74];
@@ -1117,6 +1121,31 @@ private:
void PART_70_UPDATE_ROOM_BACKGROUND();
void PART_70();
+ void PART_68_EXEC_ACTION(int action);
+ void PART_68_LOAD_ROOM();
+ void PART_68_APPLY_OBJECT_STATE(int num);
+ void PART_68_DRAW_NPC(int frame);
+ void PART_68_DRAW_AMBIENT(int frame);
+ void PART_68_DRAW_OBJECT(int frame);
+ void PART_68_DRAW_POSE(int frame);
+ void PART_68_UPDATE_AMBIENT();
+ void PART_68_UPDATE_ROOM_BACKGROUND();
+ void PART_68_UPDATE_ROOM_BACKGROUND_TALK();
+ void PART_68_UPDATE_DIALOGUE_NPC(int action);
+ void PART_68_NPC_SAY(const Common::Array<DialogueText> &lines);
+ void PART_68_NPC_SAY_REPLIES(const int *replies, const int *sounds, int count);
+ void PART_68_ENTER_FROM_RIGHT();
+ void PART_68_ENTER_FROM_LEFT();
+ void PART_68_ENTER_INSIDE();
+ void PART_68_ACTION_102_takeObject();
+ void PART_68_ACTION_104_talk();
+ void PART_68_ACTION_106();
+ void PART_68_ACTION_108_giveObject();
+ void PART_68_CONVERSATION();
+ void PART_68_DIALOGUE_CODE(int code);
+ void PART_68_NPC_LEAVES();
+ void PART_68();
+
void PART_72_EXEC_ACTION(int action);
void PART_72_APPLY_OBJECT_STATE();
void PART_72_ACTION_102_takeObject();
@@ -1392,6 +1421,7 @@ protected:
static const RoomDataOffsets PART_36_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_37_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_50_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_68_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_70_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_72_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 099b2abb292..e4126bd2bee 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -24,6 +24,7 @@ MODULE_OBJS = \
parts/part_90.o \
parts/part_6.o \
parts/part_7.o \
+ parts/part_68.o \
parts/part_70.o \
parts/part_72.o \
parts/part_8.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 40d33d5c9dc..db02555a690 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -661,6 +661,10 @@ void IgorEngine::PART_MAIN() {
case 671:
PART_MAZE(); // maze, 670 and 671 are the entrance
break;
+ case 680:
+ case 681:
+ PART_68();
+ break;
case 700:
PART_70();
break;
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
new file mode 100644
index 00000000000..7001216fcaf
--- /dev/null
+++ b/engines/igor/parts/part_68.cpp
@@ -0,0 +1,562 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// A character stands on the right of the room. His head is a 33x43 picture drawn at (263,88); the frames follow
+// the first part of the animation resource.
+static const int kPart68NpcOffset = 88 * 320 + 263;
+static const int kPart68NpcWidth = 33;
+static const int kPart68NpcHeight = 43;
+static const int kPart68NpcFramesOffset = 2516;
+static const int kPart68NpcFrameSize = kPart68NpcWidth * kPart68NpcHeight;
+static const int kPart68NpcStanding = 4;
+static const int kPart68NpcFacing = 3;
+
+// A small picture (39x14, four frames) at (39,31) blinks from time to time.
+static const int kPart68AmbientOffset = 31 * 320 + 39;
+static const int kPart68AmbientWidth = 39;
+static const int kPart68AmbientHeight = 14;
+static const int kPart68AmbientFramesOffset = 0x3BB7;
+
+// The object in the room (9x12, two frames) at (179,92).
+static const int kPart68ObjectOffset = 92 * 320 + 179;
+static const int kPart68ObjectWidth = 9;
+static const int kPart68ObjectHeight = 12;
+
+// The picture of the exchange (23x50, two frames) at (170,83).
+static const int kPart68PoseOffset = 83 * 320 + 170;
+static const int kPart68PoseWidth = 23;
+static const int kPart68PoseHeight = 50;
+static const int kPart68PoseFramesOffset = 0xD8;
+
+// The picture of the object that is given (52x30, four frames) at (244,86).
+static const int kPart68GiveOffset = 86 * 320 + 244;
+static const int kPart68GiveWidth = 52;
+static const int kPart68GiveHeight = 30;
+static const int kPart68GiveFramesOffset = 0x443F;
+static const int kPart68GiveFrameSize = kPart68GiveWidth * kPart68GiveHeight;
+
+// Sprites played when the character leaves: frame table at offset 0x140E of the block starting at 0x5C9F.
+static const int kPart68LeaveBase = 0x5C9F;
+static const int kPart68LeaveTable = 0x140E;
+
+// Where the character's lines are shown.
+static const int kPart68TextX = 282;
+static const int kPart68TextY = 85;
+static const int kPart68TextR = 63;
+static const int kPart68TextG = 50;
+static const int kPart68TextB = 0;
+
+// Flags of the story kept in the objects state.
+static const int kPart68SideState = 90;
+static const int kPart68ObjectTakenState = 91;
+static const int kPart68TalkState = 92;
+static const int kPart68GivenState = 93;
+static const int kPart68IntroState = 94;
+static const int kPart68FlagState = 104;
+
+// Inventory objects.
+static const int kPart68TakenObject = 34;
+static const int kPart68TakenObjectIndex = 69;
+static const int kPart68GiveInventoryIndex = 40;
+
+static const int kPart68TalkCodeEnd = 100;
+
+void IgorEngine::PART_68_LOAD_ROOM() {
+ loadRoomData(PAL_Part68, IMG_Part68, BOX_Part68, MSK_Part68, TXT_Part68);
+ SET_PAL_240_48_1();
+}
+
+void IgorEngine::PART_68_DRAW_NPC(int frame) {
+ drawAnimRect(kPart68NpcOffset, kPart68NpcFramesOffset + frame * kPart68NpcFrameSize, kPart68NpcWidth, kPart68NpcHeight,
+ true, kBlendBehindIgorAndText);
+}
+
+void IgorEngine::PART_68_DRAW_AMBIENT(int frame) {
+ drawAnimRect(kPart68AmbientOffset, kPart68AmbientFramesOffset + frame * kPart68AmbientWidth * kPart68AmbientHeight,
+ kPart68AmbientWidth, kPart68AmbientHeight);
+}
+
+void IgorEngine::PART_68_DRAW_OBJECT(int frame) {
+ copyArea(_screenLayer1, kPart68ObjectOffset, 320, _animFramesBuffer + frame * kPart68ObjectWidth * kPart68ObjectHeight,
+ kPart68ObjectWidth, kPart68ObjectWidth, kPart68ObjectHeight);
+}
+
+void IgorEngine::PART_68_DRAW_POSE(int frame) {
+ drawAnimRect(kPart68PoseOffset, kPart68PoseFramesOffset + frame * kPart68PoseWidth * kPart68PoseHeight,
+ kPart68PoseWidth, kPart68PoseHeight);
+}
+
+/**
+ * The character is in the room until the conversation with him is over; after that the room is loaded again
+ * without him. The object is drawn while it is there.
+ */
+void IgorEngine::PART_68_APPLY_OBJECT_STATE(int num) {
+ if (num == 3 || num == 255) {
+ if (_objectsState[kPart68TalkState] == 0) {
+ PART_68_DRAW_NPC(0);
+ for (int i = 0; i < MAX_ROOM_OBJECT_AREAS; ++i) {
+ if (_roomObjectAreasTable[i].area >= 3 && _roomObjectAreasTable[i].area <= 4) {
+ _roomObjectAreasTable[i].area = 0;
+ }
+ }
+ WRITE_LE_UINT16(_roomActionsTable + 156, 0xA87D);
+ _roomActionsTable[246] = 1;
+ _part68NpcPresent = true;
+ } else {
+ loadActionData(DAT_Part68);
+ PART_68_LOAD_ROOM();
+ WRITE_LE_UINT16(_roomActionsTable + 156, 0x9081);
+ _roomActionsTable[246] = 3;
+ for (int i = 0; i < MAX_ROOM_OBJECT_AREAS; ++i) {
+ if (_roomObjectAreasTable[i].object == 3) {
+ _roomObjectAreasTable[i].object = 0;
+ }
+ }
+ _part68NpcPresent = false;
+ }
+ }
+ if (num == 2 || num == 255) {
+ if (_objectsState[kPart68ObjectTakenState] == 0) {
+ PART_68_DRAW_OBJECT(0);
+ } else {
+ PART_68_DRAW_OBJECT(1);
+ for (int i = 0; i < MAX_ROOM_OBJECT_AREAS; ++i) {
+ if (_roomObjectAreasTable[i].object == 2) {
+ _roomObjectAreasTable[i].object = 0;
+ }
+ }
+ }
+ }
+}
+
+void IgorEngine::PART_68_UPDATE_AMBIENT() {
+ if (compareGameTick(0x3D)) {
+ if (_roomAmbientIndex == 3) {
+ _roomAmbientIndex = 0;
+ PART_68_DRAW_AMBIENT(0);
+ } else if (getRandomNumber(9) == 0) {
+ _roomAmbientIndex = getRandomNumber(3);
+ PART_68_DRAW_AMBIENT(_roomAmbientIndex);
+ }
+ }
+}
+
+/**
+ * Used while the character is talking: no idle frames of him.
+ */
+void IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND_TALK() {
+ if (compareGameTick(1) && getRandomNumber(49) == 0) {
+ playSound(41, 1);
+ }
+ PART_68_UPDATE_AMBIENT();
+}
+
+void IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND() {
+ if (compareGameTick(1) && getRandomNumber(49) == 0) {
+ playSound(41, 1);
+ }
+ if (compareGameTick(0x3D) && _part68NpcPresent) {
+ PART_68_DRAW_NPC(getRandomNumber(2));
+ }
+ PART_68_UPDATE_AMBIENT();
+}
+
+void IgorEngine::PART_68_UPDATE_DIALOGUE_NPC(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ case kUpdateDialogueAnimStanding:
+ PART_68_DRAW_NPC(kPart68NpcStanding);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_68_DRAW_NPC(kPart68NpcStanding + getRandomNumber(4));
+ break;
+ }
+}
+
+/**
+ * The character says lines of the room texts.
+ */
+void IgorEngine::PART_68_NPC_SAY(const Common::Array<DialogueText> &lines) {
+ UpdateRoomBackgroundProc previous = _updateRoomBackground;
+ _updateRoomBackground = &IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND_TALK;
+ cutsceneSayWithCallback(kPart68TextX, kPart68TextY, kPart68TextR, kPart68TextG, kPart68TextB, lines,
+ &IgorEngine::PART_68_UPDATE_DIALOGUE_NPC);
+ _updateRoomBackground = previous;
+}
+
+/**
+ * The character says lines taken from the replies of the conversation, one line per page.
+ */
+void IgorEngine::PART_68_NPC_SAY_REPLIES(const int *replies, const int *sounds, int count) {
+ Common::Array<DialogueText> lines;
+ for (int i = 0; i < count; ++i) {
+ Common::strlcpy(_globalDialogueTexts[250 + i], _dialogueReplies[replies[i] - 1], sizeof(_globalDialogueTexts[250 + i]));
+ DialogueText line = { 250 + i, 1, sounds[i] };
+ lines.push_back(line);
+ }
+ PART_68_NPC_SAY(lines);
+}
+
+/**
+ * Igor comes from the right edge and walks to the left.
+ */
+void IgorEngine::PART_68_ENTER_FROM_RIGHT() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(319, 143, kFacingPositionLeft, 0);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 15;
+ wd->scaleWidth = 50;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 50;
+ _walkDataLastIndex = 0;
+ buildWalkPath(319, 143, 259, 143);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove(&IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND);
+}
+
+/**
+ * Igor comes from the left edge and walks to the right.
+ */
+void IgorEngine::PART_68_ENTER_FROM_LEFT() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(0, 143, kFacingPositionRight, 0);
+ wd->clipSkipX = 16;
+ wd->clipWidth = 15;
+ wd->scaleWidth = 50;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 50;
+ _walkDataLastIndex = 0;
+ buildWalkPath(0, 143, 60, 143);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove(&IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND);
+}
+
+/**
+ * Igor appears next to the character, smaller, and walks down.
+ */
+void IgorEngine::PART_68_ENTER_INSIDE() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(193, 115, kFacingPositionRight, 0);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 25;
+ wd->scaleWidth = 42;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 42;
+ _walkDataLastIndex = 0;
+ buildWalkPath(193, 115, 253, 138);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove(&IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND);
+}
+
+/**
+ * The character gives Igor the object; it goes to the inventory.
+ */
+void IgorEngine::PART_68_ACTION_102_takeObject() {
+ if (_objectsState[kPart68GivenState] != 0) {
+ return;
+ }
+ PART_68_DRAW_POSE(0);
+ PART_68_DRAW_NPC(kPart68NpcFacing);
+ waitForTimer(30);
+ PART_68_NPC_SAY({ { 202, 1, 1008 }, { 203, 1, 1009 }, { 204, 1, 1010 }, { 205, 1, 1011 } });
+ PART_68_DRAW_POSE(1);
+ waitForTimer(30);
+
+ // Igor turns to the right
+ _walkData[_walkDataLastIndex - 1].posNum = kFacingPositionRight;
+ _walkDataCurrentIndex = _walkDataLastIndex - 1;
+ moveIgor(kFacingPositionRight, 0);
+ _walkDataCurrentIndex = _walkDataLastIndex;
+ igorSayAndWait({ { 206, 1, 1012 }, { 207, 1, 1013 } });
+ PART_68_NPC_SAY({ { 208, 1, 1014 }, { 209, 1, 1015 }, { 210, 1, 1016 }, { 211, 1, 1017 } });
+ PART_68_DRAW_NPC(kPart68NpcFacing);
+ waitForTimer(30);
+ for (int frame = 0; frame <= 1; ++frame) {
+ PART_68_DRAW_POSE(frame);
+ waitForTimer(120);
+ }
+ addObjectToInventory(kPart68TakenObject, kPart68TakenObjectIndex);
+ _objectsState[kPart68ObjectTakenState] = 1;
+ PART_68_APPLY_OBJECT_STATE(255);
+}
+
+/**
+ * Igor gives the object to the character.
+ */
+void IgorEngine::PART_68_ACTION_108_giveObject() {
+ PART_68_DRAW_NPC(kPart68NpcFacing);
+ waitForTimer(30);
+ drawAnimRect(kPart68GiveOffset, kPart68GiveFramesOffset, kPart68GiveWidth, kPart68GiveHeight);
+ if (_inventoryInfo[kPart68GiveInventoryIndex] != 0) {
+ _inventoryInfo[_inventoryInfo[kPart68GiveInventoryIndex] - 1] = 0;
+ _inventoryInfo[kPart68GiveInventoryIndex] = 0;
+ packInventory();
+ if (_inventoryInfo[72] > _inventoryInfo[73])
+ _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
+ drawInventory(_inventoryInfo[72], 0);
+ }
+ playSound(63, 1);
+ igorSayAndWait(214, 1, 1019);
+ PART_68_NPC_SAY({ { 215, 1, 1020 }, { 216, 1, 1021 }, { 217, 1, 1022 }, { 218, 1, 1023 } });
+ for (int frame = 1; frame <= 3; ++frame) {
+ drawAnimRect(kPart68GiveOffset, kPart68GiveFramesOffset + frame * kPart68GiveFrameSize, kPart68GiveWidth, kPart68GiveHeight);
+ waitForTimer(40);
+ }
+ PART_68_NPC_SAY({ { 219, 1, 1024 }, { 220, 1, 1025 }, { 221, 1, 1026 }, { 222, 1, 1027 } });
+ PART_68_DRAW_NPC(kPart68NpcFacing);
+ waitForTimer(30);
+ _objectsState[kPart68GivenState] = 1;
+ PART_68_APPLY_OBJECT_STATE(255);
+}
+
+/**
+ * The changes of the conversation for some of the answers.
+ */
+void IgorEngine::PART_68_DIALOGUE_CODE(int code) {
+ uint8 *data = _gameState.dialogueData;
+ if (code == 10) {
+ const int entries = _objectsState[kPart68FlagState] == 1 ? 4 : 5;
+ for (int i = 1; i <= entries; ++i) {
+ data[27 + 6 * i] = _part68QuestionCounter;
+ ++_part68QuestionCounter;
+ if (_part68QuestionCounter == 16) {
+ _part68QuestionCounter = 1;
+ }
+ }
+ if (_objectsState[kPart68FlagState] == 1) {
+ data[57] = 20;
+ data[58] = 55;
+ data[56] = 0;
+ data[59] = kPart68TalkCodeEnd;
+ }
+ }
+ if (code == 20) {
+ data[6] = 0;
+ }
+ if (code == 30) {
+ data[12] = 0;
+ }
+}
+
+/**
+ * The sprites of the character going away.
+ */
+void IgorEngine::PART_68_NPC_LEAVES() {
+ for (int frame = 1; frame <= 6; ++frame) {
+ decodeAnimFrame(getAnimFrame(kPart68LeaveBase, kPart68LeaveTable, frame), _screenVGA, true);
+ waitForTimer(30);
+ }
+}
+
+void IgorEngine::PART_68_CONVERSATION() {
+ UpdateRoomBackgroundProc previousBackground = _updateRoomBackground;
+ _updateRoomBackground = &IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND_TALK;
+ _updateDialogue = &IgorEngine::PART_68_UPDATE_DIALOGUE_NPC;
+ loadDialogueData(DLG_Part68);
+ _part68QuestionCounter = 1;
+ PART_68_DRAW_NPC(kPart68NpcStanding);
+
+ memset(_screenVGA + 46080, 0, 17920);
+ _gameState.dialogueStarted = true;
+ _gameState.dialogueChoiceStart = 1;
+ _gameState.dialogueChoiceCount = 1;
+ if (_objectsState[kPart68IntroState] == 0) {
+ igorSayAndWait(225, 1, 1029);
+ static const int replies[4] = { 1, 2, 3, 4 };
+ static const int sounds[4] = { 1051, 1052, 1053, 1054 };
+ PART_68_NPC_SAY_REPLIES(replies, sounds, 4);
+ _objectsState[kPart68IntroState] = 1;
+ } else {
+ igorSayAndWait(226, 1, 1030);
+ static const int replies[4] = { 5, 6, 7, 8 };
+ static const int sounds[4] = { 1055, 1056, 1057, 1058 };
+ PART_68_NPC_SAY_REPLIES(replies, sounds, 4);
+ }
+
+ bool done = false;
+ do {
+ drawDialogueChoices();
+ PART_68_DRAW_NPC(kPart68NpcStanding);
+ const int choice = selectDialogue();
+ if (choice == 0) {
+ break;
+ }
+ if (choice == -1) {
+ _updateDialogue = 0;
+ _updateRoomBackground = previousBackground;
+ return;
+ }
+ _dialogueChoiceSelected = choice;
+ dialogueAskQuestion();
+ dialogueReplyToQuestion(kPart68TextX, kPart68TextY, kPart68TextR, kPart68TextG, kPart68TextB);
+ const int offset = (_dialogueInfo[choice] - 1) * 6 + (_gameState.dialogueChoiceCount - 1) * 30 +
+ (_gameState.dialogueChoiceStart - 1) * 30;
+ _part68LastDialogueCode = _gameState.dialogueData[offset + 5];
+ if (_part68LastDialogueCode != 0) {
+ PART_68_DIALOGUE_CODE(_part68LastDialogueCode);
+ }
+ 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:
+ done = true;
+ break;
+ }
+ } while (!done);
+
+ if (_part68LastDialogueCode == kPart68TalkCodeEnd) {
+ static const int replies[4] = { 29, 30, 31, 32 };
+ static const int sounds[4] = { 1079, 1080, 1081, 1082 };
+ PART_68_NPC_SAY_REPLIES(replies, sounds, 4);
+ PART_68_NPC_LEAVES();
+ _objectsState[kPart68TalkState] = 2;
+ }
+ memset(_screenVGA + 46080, 0, 17920);
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[72], 0);
+ _currentAction.verb = kVerbWalk;
+ _gameState.dialogueStarted = false;
+ _updateDialogue = 0;
+ _updateRoomBackground = previousBackground;
+}
+
+void IgorEngine::PART_68_ACTION_104_talk() {
+ PART_68_CONVERSATION();
+ if (_objectsState[kPart68TalkState] == 2) {
+ _objectsState[kPart68TalkState] = 1;
+ PART_68_APPLY_OBJECT_STATE(255);
+ }
+}
+
+void IgorEngine::PART_68_ACTION_106() {
+ if (_objectsState[kPart68TalkState] == 0) {
+ igorSayAndWait(223, 2, 1028);
+ PART_68_ACTION_104_talk();
+ } else {
+ _currentPart = 710;
+ }
+}
+
+void IgorEngine::PART_68_EXEC_ACTION(int action) {
+ switch (action) {
+ case 101:
+ _objectsState[kPart68SideState] = 1;
+ _currentPart = 700;
+ break;
+ case 102:
+ PART_68_ACTION_102_takeObject();
+ break;
+ case 103:
+ igorSay(201, 1, 1007);
+ break;
+ case 104:
+ PART_68_ACTION_104_talk();
+ break;
+ case 105:
+ igorSay(212, 2, 1018);
+ break;
+ case 106:
+ PART_68_ACTION_106();
+ break;
+ case 108:
+ PART_68_ACTION_108_giveObject();
+ break;
+ case 109:
+ _objectsState[kPart68SideState] = 0;
+ _currentPart = 700;
+ break;
+ default:
+ error("PART_68_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::PART_68() {
+ playMusic(4);
+ _gameState.enableLight = 2;
+ loadActionData(DAT_Part68);
+ PART_68_LOAD_ROOM();
+ static const int anim[] = { ANM_Part68, 0 };
+ loadAnimData(anim);
+ _roomDataOffsets = PART_68_ROOM_DATA_OFFSETS;
+ setRoomClickFix(143, -1, -1, false);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_68_EXEC_ACTION);
+ _updateRoomBackground = &IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND;
+ PART_68_APPLY_OBJECT_STATE(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+
+ // the colors that change are darker than their palette
+ for (int i = 192 * 3; i < 208 * 3; ++i) {
+ const int value = _paletteBuffer[i] - 10;
+ _paletteBuffer[i] = value < 1 ? 0 : value;
+ }
+
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 680) {
+ if (_objectsState[kPart68SideState] == 0) {
+ PART_68_ENTER_FROM_RIGHT();
+ } else {
+ PART_68_ENTER_FROM_LEFT();
+ }
+ } else {
+ PART_68_ENTER_INSIDE();
+ }
+ }
+ enterPartLoop();
+ while ((_currentPart == 680 || _currentPart == 681) && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
index 66e06dad2cf..7aadc252ece 100644
--- a/engines/igor/parts/part_72.cpp
+++ b/engines/igor/parts/part_72.cpp
@@ -159,7 +159,7 @@ void IgorEngine::PART_72_ENTER_FROM_LEFT() {
* The current star is lit and, from time to time, another one is chosen and put out.
*/
void IgorEngine::PART_72_UPDATE_STAR() {
- int pos = kPart72StarOffsets[_part72StarIndex - 1];
+ int pos = kPart72StarOffsets[_roomAmbientIndex - 1];
if (!PART_72_IS_PROTECTED_COLOR(_screenVGA[pos])) {
_screenVGA[pos] = 0xB3;
}
@@ -169,8 +169,8 @@ void IgorEngine::PART_72_UPDATE_STAR() {
if (getRandomNumber(4) != 0) {
return;
}
- _part72StarIndex = getRandomNumber(4) + 1;
- pos = kPart72StarOffsets[_part72StarIndex - 1];
+ _roomAmbientIndex = getRandomNumber(4) + 1;
+ pos = kPart72StarOffsets[_roomAmbientIndex - 1];
if (!PART_72_IS_PROTECTED_COLOR(_screenVGA[pos])) {
_screenVGA[pos] = _screenLayer1[pos];
}
@@ -200,7 +200,7 @@ void IgorEngine::PART_72_UPDATE_ROOM_BACKGROUND() {
void IgorEngine::PART_72() {
playMusic(4);
_gameState.enableLight = 2;
- _part72StarIndex = 1;
+ _roomAmbientIndex = 1;
loadActionData(DAT_Part72);
loadRoomData(PAL_Part72, IMG_Part72, BOX_Part72, MSK_Part72, TXT_Part72);
SET_PAL_240_48_1();
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 9be6ab6a586..f5d5d715d72 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -705,4 +705,14 @@
#define MSK_Part72 1107
#define BOX_Part72 1108
+// States 680 / 681 (PART_68)
+#define DAT_Part68 1109
+#define DLG_Part68 1110
+#define ANM_Part68 1111
+#define TXT_Part68 1112
+#define IMG_Part68 1113
+#define PAL_Part68 1114
+#define MSK_Part68 1115
+#define BOX_Part68 1116
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 1a5a635aca0..70aa42b6402 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -478,4 +478,11 @@ const RoomDataOffsets IgorEngine::PART_72_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_68_ROOM_DATA_OFFSETS = {
+ { 80, 4, 12, 3 },
+ { 148, 159 },
+ { 163, 355, 3231, 247, 323, 80 },
+ { -75, 21, 3472, 100, 30, 60, 13772, 13814, 100 }
+};
+
} // End of namespace Igor
Commit: ab331f1f9af3443ab2a1f7414c1dd8b0692f1259
https://github.com/scummvm/scummvm/commit/ab331f1f9af3443ab2a1f7414c1dd8b0692f1259
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:35+01:00
Commit Message:
IGOR: Part 81
Changed paths:
A engines/igor/parts/part_74.cpp
A engines/igor/parts/part_81.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 632f6293ec3..c322bb92e52 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1121,6 +1121,39 @@ private:
void PART_70_UPDATE_ROOM_BACKGROUND();
void PART_70();
+ void PART_74_CYCLE_COLORS();
+ void PART_74_DRAW_FRAME(int frame);
+ void PART_74_UPDATE_DIALOGUE_FIRST(int action);
+ void PART_74_UPDATE_DIALOGUE_SECOND_A(int action);
+ void PART_74_UPDATE_DIALOGUE_SECOND_B(int action);
+ void PART_74_SAY(int who, const Common::Array<DialogueText> &lines);
+ void PART_74_CUTSCENE();
+
+ void PART_81_EXEC_ACTION(int action);
+ void PART_81_LOAD_ROOM();
+ void PART_81_LOAD_ANIMATION();
+ void PART_81_DRAW_HEAD(int frame);
+ void PART_81_DRAW_STORY_HEAD(int frame);
+ void PART_81_DRAW_FIGURE(int offset);
+ void PART_81_DRAW_END_FRAME(int frame);
+ void PART_81_UPDATE_ROOM_BACKGROUND();
+ void PART_81_UPDATE_DIALOGUE_NPC(int action);
+ void PART_81_NPC_SAY(const Common::Array<DialogueText> &lines);
+ void PART_81_IGOR_SAY(int num, int count, int sound);
+ void PART_81_APPLY_OBJECT_STATE(int num);
+ void PART_81_SCROLL_IN();
+ void PART_81_TRANSITION_IN();
+ void PART_81_TRANSITION_OUT();
+ void PART_81_END_SCENE();
+ void PART_81_ACTION_109();
+ void PART_81_ACTION_110();
+ void PART_81_ACTION_102_talk();
+ void PART_81_DIALOGUE_CODE(int code);
+ void PART_81_CONVERSATION();
+ void PART_81_ENTER();
+ void PART_81();
+
+
void PART_68_EXEC_ACTION(int action);
void PART_68_LOAD_ROOM();
void PART_68_APPLY_OBJECT_STATE(int num);
@@ -1424,6 +1457,7 @@ protected:
static const RoomDataOffsets PART_68_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_70_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_72_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_81_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
static const uint8 _inventoryOffsetTable[];
static const uint8 _inventoryActionsTable[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index e4126bd2bee..851ca704574 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -55,7 +55,9 @@ MODULE_OBJS = \
parts/part_36.o \
parts/part_37.o \
parts/part_50.o \
+ parts/part_74.o \
parts/part_75.o \
+ parts/part_81.o \
parts/part_maze.o \
parts/part_maze_data.o \
parts/part_margaret.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index db02555a690..ff636b8619b 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -675,6 +675,9 @@ void IgorEngine::PART_MAIN() {
case 750:
PART_75(); // philip vodka cutscene
break;
+ case 810:
+ PART_81();
+ break;
case 850: // Intro cutscene
// Clear the entire screen buffer before starting the intro cutscene
memset(_screenVGA, 0, 64000);
diff --git a/engines/igor/parts/part_74.cpp b/engines/igor/parts/part_74.cpp
new file mode 100644
index 00000000000..da39c9d1e4b
--- /dev/null
+++ b/engines/igor/parts/part_74.cpp
@@ -0,0 +1,182 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// The frames of the two characters follow the animation of the room, from this offset on; the table of
+// frame offsets is after the frames.
+static const int kPart74FramesBase = 0xC318;
+static const int kPart74FramesTable = 0x15BE;
+
+// Frames of the first character (left): the last is the standing one, four more are used while speaking.
+static const int kPart74FirstStanding = 13;
+static const int kPart74FirstTalking = 13;
+// Frames of the second character (right): 3..7 speaking with the first expression and 8..12 with the second.
+static const int kPart74SecondStandingA = 3;
+static const int kPart74SecondStandingB = 8;
+
+// Where the lines are shown: x, y and color of the first (blue) and of the second (violet) character.
+static const int kPart74FirstX = 141;
+static const int kPart74FirstY = 55;
+static const int kPart74SecondX = 247;
+static const int kPart74SecondY = 38;
+
+// Length in timer ticks of the part of the scene that only turns the colors.
+static const int kPart74ColorsTicks = 750;
+
+/**
+ * The colors 192 to 207 rotate while the scene is on.
+ */
+void IgorEngine::PART_74_CYCLE_COLORS() {
+ if (compareGameTick(3, 32)) {
+ scrollPalette(192, 207);
+ setPaletteRange(192, 207);
+ }
+}
+
+void IgorEngine::PART_74_DRAW_FRAME(int frame) {
+ decodeAnimFrame(getAnimFrame(kPart74FramesBase, kPart74FramesTable, frame), _screenVGA, true);
+}
+
+void IgorEngine::PART_74_UPDATE_DIALOGUE_FIRST(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ case kUpdateDialogueAnimStanding:
+ PART_74_DRAW_FRAME(kPart74FirstStanding);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_74_DRAW_FRAME(kPart74FirstTalking + getRandomNumber(3));
+ break;
+ }
+}
+
+void IgorEngine::PART_74_UPDATE_DIALOGUE_SECOND_A(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ case kUpdateDialogueAnimStanding:
+ PART_74_DRAW_FRAME(kPart74SecondStandingA);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_74_DRAW_FRAME(kPart74SecondStandingA + getRandomNumber(4));
+ break;
+ }
+}
+
+void IgorEngine::PART_74_UPDATE_DIALOGUE_SECOND_B(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ case kUpdateDialogueAnimStanding:
+ PART_74_DRAW_FRAME(kPart74SecondStandingB);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_74_DRAW_FRAME(kPart74SecondStandingB + getRandomNumber(4));
+ break;
+ }
+}
+
+/**
+ * One line of the scene, said by the first character (blue) or by the second (violet).
+ */
+void IgorEngine::PART_74_SAY(int who, const Common::Array<DialogueText> &lines) {
+ switch (who) {
+ case 0:
+ cutsceneSayWithCallback(kPart74FirstX, kPart74FirstY, 0, 50, 63, lines, &IgorEngine::PART_74_UPDATE_DIALOGUE_FIRST);
+ break;
+ case 1:
+ cutsceneSayWithCallback(kPart74SecondX, kPart74SecondY, 63, 32, 63, lines, &IgorEngine::PART_74_UPDATE_DIALOGUE_SECOND_B);
+ break;
+ default:
+ cutsceneSayWithCallback(kPart74SecondX, kPart74SecondY, 63, 32, 63, lines, &IgorEngine::PART_74_UPDATE_DIALOGUE_SECOND_A);
+ break;
+ }
+}
+
+/**
+ * Scene with two characters over a picture whose colors rotate. It is part of the story of state 810.
+ */
+void IgorEngine::PART_74_CUTSCENE() {
+ UpdateRoomBackgroundProc previousBackground = _updateRoomBackground;
+ playMusic(4);
+ _gameState.enableLight = 1;
+ fadeOut(624);
+ uint8 savedPalette[624];
+ memcpy(savedPalette, _paletteBuffer, 624);
+
+ loadData(PAL_Part74, _paletteBuffer);
+ loadData(IMG_Part74, _screenVGA);
+ {
+ uint8 *text = loadData(TXT_Part74);
+ decodeRoomText(text);
+ free(text);
+ }
+ static const int anim[] = { ANM_Part74, 0 };
+ loadAnimData(anim, kPart74FramesBase);
+ fadeIn(624);
+ _gameState.igorMoving = false;
+ _updateRoomBackground = &IgorEngine::PART_74_CYCLE_COLORS;
+
+ // the sound plays while the colors turn
+ playSound(43, 1);
+ do {
+ PART_74_CYCLE_COLORS();
+ waitForTimer();
+ } while (_mixer->isSoundHandleActive(_sfxHandle) || isDialogueSpeechPlaying());
+
+ PART_74_SAY(0, { { 201, 1, 935 }, { 202, 1, 936 } });
+ PART_74_DRAW_FRAME(8);
+ PART_74_SAY(1, { { 203, 1, 937 } });
+ PART_74_DRAW_FRAME(3);
+ PART_74_SAY(2, { { 204, 1, 938 } });
+ PART_74_DRAW_FRAME(1);
+
+ for (int ticks = 0; ticks < kPart74ColorsTicks; ticks += kTimerTicksCount) {
+ PART_74_CYCLE_COLORS();
+ waitForTimer();
+ }
+
+ PART_74_DRAW_FRAME(2);
+ PART_74_SAY(0, { { 205, 1, 939 } });
+ PART_74_DRAW_FRAME(8);
+ PART_74_SAY(1, { { 206, 1, 940 } });
+ PART_74_DRAW_FRAME(3);
+ PART_74_SAY(2, { { 207, 1, 941 } });
+ PART_74_SAY(0, { { 208, 1, 942 } });
+ PART_74_DRAW_FRAME(8);
+ PART_74_SAY(1, { { 209, 1, 943 } });
+ PART_74_DRAW_FRAME(3);
+ PART_74_SAY(2, { { 210, 1, 944 } });
+
+ // the colors of the room come back and the picture of the room is shown from its top
+ memcpy(_paletteBuffer, _currentPalette, 624);
+ fadeOut(624);
+ memcpy(_paletteBuffer, savedPalette, 624);
+ memset(_screenTextLayer, 0, 46080);
+ memset(_screenVGA, 0, 46080);
+ for (int row = 0; row <= 0x8F; ++row) {
+ memcpy(_screenVGA + row * 320 + 0x6A, _animFramesBuffer + row * 0x82, 0x82);
+ }
+ fadeIn(624);
+ _gameState.enableLight = 2;
+ _updateRoomBackground = previousBackground;
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
new file mode 100644
index 00000000000..80cf29850cf
--- /dev/null
+++ b/engines/igor/parts/part_81.cpp
@@ -0,0 +1,567 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// A character stands in the middle of the room. His head is a 21x53 picture drawn at (140,28); the animation
+// resource has the frames from 1 on, 1113 bytes each, after a base offset.
+static const int kPart81HeadOffset = 28 * 320 + 140;
+static const int kPart81HeadWidth = 21;
+static const int kPart81HeadHeight = 53;
+static const int kPart81HeadFramesBase = 0x1AE5;
+static const int kPart81HeadFrameSize = kPart81HeadWidth * kPart81HeadHeight;
+static const int kPart81HeadStanding = 4;
+
+// Another picture of the head, drawn into the room picture while it is there.
+static const int kPart81HeadRestFrame = 1;
+
+// A picture (43x62, frames of 2666 bytes) at (116,32).
+static const int kPart81FigureOffset = 32 * 320 + 116;
+static const int kPart81FigureWidth = 43;
+static const int kPart81FigureHeight = 62;
+static const int kPart81FigureFrameSize = kPart81FigureWidth * kPart81FigureHeight;
+static const int kPart81FigureFirst = 0xC4DF;
+static const int kPart81FigureSecond = 0xBA75;
+
+// The frames of the head that follow the story: 6 frames of the third block of the animation.
+static const int kPart81StoryFramesBase = 0x4206;
+
+// Where the lines of the character are shown.
+static const int kPart81TextX = 148;
+static const int kPart81TextY = 31;
+static const int kPart81TextR = 63;
+static const int kPart81TextG = 32;
+static const int kPart81TextB = 0;
+
+// The scenes use a tall picture (130x369) at the start of the second animation and a smaller one (285x72) in the
+// walk mask buffer.
+static const int kPart81TallWidth = 0x82;
+static const int kPart81TallX = 0x6A;
+static const int kPart81StripWidth = 0x11D;
+static const int kPart81StripRows = 0x48;
+
+// The last frames of the animation of the end of the story.
+static const int kPart81EndFramesBase = 0xBAE0;
+static const int kPart81EndFramesTable = 0x808;
+
+// Flags of the story kept in the objects state.
+static const int kPart81StoryState = 6;
+static const int kPart81SideState = 90;
+static const int kPart81InventoryState = 69;
+static const int kPart81EventDoneState = 104;
+static const int kPart81BellState = 105;
+
+// First picture of each of the steps of the animation of the story.
+static const uint8 kPart81FigureFrames[4] = { 1, 2, 3, 1 };
+// Frames and times of the end scene (timer ticks).
+static const uint8 kPart81EndFrames[10] = { 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 };
+static const uint8 kPart81EndHold[10] = { 45, 35, 25, 40, 45, 30, 45, 35, 20, 30 };
+static const uint8 kPart81EndFinalHold[10] = { 25, 30, 20, 40, 25, 35, 40, 42, 20, 25 };
+
+static const int kPart81StepTicks = 16;
+
+void IgorEngine::PART_81_LOAD_ROOM() {
+ loadRoomData(PAL_Part81, IMG_Part81, BOX_Part81, MSK_Part81, TXT_Part81);
+ SET_PAL_240_48_1();
+}
+
+void IgorEngine::PART_81_LOAD_ANIMATION() {
+ static const int anim[] = { ANM_Part81, 0 };
+ loadAnimData(anim);
+}
+
+void IgorEngine::PART_81_DRAW_HEAD(int frame) {
+ drawAnimRect(kPart81HeadOffset, kPart81HeadFramesBase + frame * kPart81HeadFrameSize, kPart81HeadWidth, kPart81HeadHeight,
+ true, kBlendBehindIgorAndText);
+ if (_gameState.dialogueTextRunning) {
+ memcpy(_screenLayer1 + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
+ }
+}
+
+void IgorEngine::PART_81_UPDATE_ROOM_BACKGROUND() {
+ if (compareGameTick(0x3D) && getRandomNumber(1) == 0 && _objectsState[kPart81BellState] == 1) {
+ PART_81_DRAW_HEAD(getRandomNumber(2) + 1);
+ }
+}
+
+void IgorEngine::PART_81_UPDATE_DIALOGUE_NPC(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ case kUpdateDialogueAnimStanding:
+ PART_81_DRAW_HEAD(kPart81HeadStanding);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_81_DRAW_HEAD(getRandomNumber(4) + 5);
+ break;
+ }
+}
+
+/**
+ * The character says lines of the room texts. The lines of the room itself do not run meanwhile.
+ */
+void IgorEngine::PART_81_NPC_SAY(const Common::Array<DialogueText> &lines) {
+ UpdateRoomBackgroundProc previous = _updateRoomBackground;
+ _updateRoomBackground = 0;
+ cutsceneSayWithCallback(kPart81TextX, kPart81TextY, kPart81TextR, kPart81TextG, kPart81TextB, lines,
+ &IgorEngine::PART_81_UPDATE_DIALOGUE_NPC);
+ _updateRoomBackground = previous;
+}
+
+void IgorEngine::PART_81_IGOR_SAY(int num, int count, int sound) {
+ UpdateRoomBackgroundProc previous = _updateRoomBackground;
+ _updateRoomBackground = 0;
+ igorSayAndWait(num, count, sound);
+ _updateRoomBackground = previous;
+}
+
+/**
+ * The picture of the character at rest is part of the room picture while the bell is on; the dialogue and the
+ * objects of the room depend on the story.
+ */
+void IgorEngine::PART_81_APPLY_OBJECT_STATE(int num) {
+ if (num != 1 && num != 255) {
+ return;
+ }
+ if (_objectsState[kPart81BellState] == 1) {
+ copyArea(_screenLayer1, kPart81HeadOffset, 320, _animFramesBuffer + kPart81HeadRestFrame * kPart81HeadFrameSize + 0x1AE5,
+ kPart81HeadWidth, kPart81HeadWidth, kPart81HeadHeight);
+ _roomActionsTable[30] = 2;
+ _roomActionsTable[99] = 0;
+ _roomActionsTable[100] = 0;
+ _roomActionsTable[101] = 0;
+ _roomActionsTable[102] = 0;
+ } else {
+ _roomActionsTable[30] = 4;
+ _roomActionsTable[91] = 0;
+ _roomActionsTable[92] = 0;
+ _roomActionsTable[99] = 0x68;
+ _roomActionsTable[100] = 1;
+ _roomActionsTable[101] = 0xE;
+ _roomActionsTable[102] = 1;
+ for (int i = 1; i <= 0x23; ++i) {
+ for (int j = 1; j <= 2; ++j) {
+ _roomActionsTable[82 * i + j + 3258] = 0;
+ }
+ }
+ _roomObjectAreasTable[7].y2Lum = 0xEC;
+ }
+}
+
+/**
+ * The room picture comes in from the left, over the one that was on the screen (a 160 columns picture).
+ */
+void IgorEngine::PART_81_SCROLL_IN() {
+ uint8 *buffer = _screenTextLayer;
+ for (int step = 20; step >= 0; --step) {
+ const int shift = step * 8;
+ for (int row = 0; row <= 0x8F; ++row) {
+ memcpy(buffer + row * 320, _screenLayer1 + row * 320 + shift, 320 - shift);
+ memcpy(buffer + row * 320 + (320 - shift), _animFramesBuffer + row * 160 + 0x6075, shift);
+ }
+ memcpy(_screenVGA, buffer, 46080);
+ if (step == 20) {
+ fadeIn(768);
+ } else {
+ waitForTimer(step == 0 ? 1 : kPart81StepTicks);
+ }
+ }
+}
+
+/**
+ * Transition: the screen moves down while the small picture of the walk mask buffer, then the tall picture of
+ * the animation, come in from above.
+ */
+void IgorEngine::PART_81_TRANSITION_IN() {
+ uint8 *buffer = _screenTextLayer;
+ memset(buffer, 0, 46080);
+ for (int i = 1; i <= 9; ++i) {
+ memcpy(buffer + 8 * i * 320, _screenVGA + (8 * i - 8) * 320, (0x90 - 8 * i) * 320);
+ int dstRow = 0;
+ for (int row = kPart81StripRows - 8 * i; row <= kPart81StripRows - 1; ++row, ++dstRow) {
+ memcpy(buffer + dstRow * 320, _screenLayer2 + row * kPart81StripWidth, kPart81StripWidth);
+ }
+ memcpy(_screenVGA, buffer, 46080);
+ waitForTimer(i == 9 ? 1 : kPart81StepTicks);
+ }
+
+ memset(buffer, 0, 46080);
+ for (int i = 1; i <= 18; ++i) {
+ memcpy(buffer + 8 * i * 320, _screenVGA + (8 * i - 8) * 320, (0x90 - 8 * i) * 320);
+ int dstRow = 0;
+ for (int row = 0x170 - 8 * i; row <= 0x16F; ++row, ++dstRow) {
+ memset(buffer + dstRow * 320, 0, kPart81TallX);
+ memcpy(buffer + dstRow * 320 + kPart81TallX, _animFramesBuffer + row * kPart81TallWidth, kPart81TallWidth);
+ }
+ memcpy(_screenVGA, buffer, 46080);
+ waitForTimer(i == 18 ? 1 : kPart81StepTicks);
+ }
+
+ for (int i = 1; i <= 28; ++i) {
+ int dstRow = 0;
+ for (int row = 0xE0 - 8 * i; row <= 0xE0 - 8 * i + 0x8F; ++row, ++dstRow) {
+ memcpy(buffer + dstRow * 320 + kPart81TallX, _animFramesBuffer + row * kPart81TallWidth, kPart81TallWidth);
+ }
+ memcpy(_screenVGA, buffer, 46080);
+ waitForTimer(i == 28 ? 1 : kPart81StepTicks);
+ }
+}
+
+/**
+ * The opposite transition: the tall picture goes down, then the small picture and finally the room picture come in.
+ */
+void IgorEngine::PART_81_TRANSITION_OUT() {
+ uint8 *buffer = _screenTextLayer;
+ for (int n = 0x2E; n >= 0x12; --n) {
+ int dstRow = 0;
+ for (int row = 0x170 - 8 * n; row <= 0x170 - 8 * n + 0x8F; ++row, ++dstRow) {
+ memcpy(buffer + dstRow * 320 + kPart81TallX, _animFramesBuffer + row * kPart81TallWidth, kPart81TallWidth);
+ }
+ memcpy(_screenVGA, buffer, 46080);
+ waitForTimer(n == 0x12 ? 1 : kPart81StepTicks);
+ }
+
+ for (int n = 8; n >= 0; --n) {
+ int dstRow = 8 * n + kPart81StripRows;
+ for (int row = 0; row <= kPart81StripRows - 1 - 8 * n; ++row, ++dstRow) {
+ memcpy(buffer + dstRow * 320, _screenLayer2 + row * kPart81StripWidth, kPart81StripWidth);
+ }
+ dstRow = 0;
+ for (int row = 0x128 - 8 * n; row <= 0x16F; ++row, ++dstRow) {
+ memcpy(buffer + dstRow * 320 + kPart81TallX, _animFramesBuffer + row * kPart81TallWidth, kPart81TallWidth);
+ }
+ memcpy(_screenVGA, buffer, 46080);
+ waitForTimer(n == 0 ? 1 : kPart81StepTicks);
+ }
+
+ for (int n = 17; n >= 0; --n) {
+ memcpy(buffer + 8 * n * 320, _screenLayer1, (0x90 - 8 * n) * 320);
+ memcpy(buffer, _screenVGA + 0xA00, 8 * n * 320);
+ memcpy(_screenVGA, buffer, 46080);
+ waitForTimer(n == 0 ? 1 : kPart81StepTicks);
+ }
+}
+
+void IgorEngine::PART_81_DRAW_END_FRAME(int frame) {
+ decodeAnimFrame(getAnimFrame(kPart81EndFramesBase, kPart81EndFramesTable, frame), _screenVGA, false);
+}
+
+/**
+ * The end of the story: the transition, the long picture, the scene of the two characters and back.
+ */
+void IgorEngine::PART_81_END_SCENE() {
+ PART_81_TRANSITION_IN();
+ for (int i = 0; i < 3; ++i) {
+ waitForTimer(251);
+ }
+ for (int i = 0; i < 10; ++i) {
+ PART_81_DRAW_END_FRAME(kPart81EndFrames[i]);
+ waitForTimer(kPart81EndHold[i]);
+ }
+ waitForTimer(251);
+ PART_74_CUTSCENE();
+ for (int i = 0; i < 10; ++i) {
+ for (int frame = 3; frame <= 8; ++frame) {
+ PART_81_DRAW_END_FRAME(frame);
+ waitForTimer(10);
+ }
+ waitForTimer(kPart81EndFinalHold[i]);
+ }
+ PART_81_TRANSITION_OUT();
+}
+
+void IgorEngine::PART_81_DRAW_STORY_HEAD(int frame) {
+ copyArea(_screenVGA, kPart81HeadOffset, 320, _animFramesBuffer + kPart81StoryFramesBase + frame * kPart81HeadFrameSize,
+ kPart81HeadWidth, kPart81HeadWidth, kPart81HeadHeight);
+}
+
+void IgorEngine::PART_81_DRAW_FIGURE(int offset) {
+ copyArea(_screenVGA, kPart81FigureOffset, 320, _animFramesBuffer + offset, kPart81FigureWidth, kPart81FigureWidth,
+ kPart81FigureHeight);
+}
+
+/**
+ * Looking at the picture on the wall before the story is complete.
+ */
+void IgorEngine::PART_81_ACTION_110() {
+ for (int frame = 3; frame <= 4; ++frame) {
+ PART_81_DRAW_HEAD(frame);
+ waitForTimer(31);
+ }
+ PART_81_IGOR_SAY(208, 1, 952);
+ PART_81_DRAW_FIGURE(kPart81FigureFirst);
+ PART_81_NPC_SAY({ { 209, 1, 953 } });
+ PART_81_DRAW_FIGURE(kPart81FigureSecond);
+}
+
+/**
+ * The story of the room: Igor shows what he has, the two characters talk and the end scene plays.
+ */
+void IgorEngine::PART_81_ACTION_109() {
+ if (_objectsState[kPart81StoryState] <= 1) {
+ PART_81_ACTION_110();
+ return;
+ }
+ memset(_screenVGA + 46080, 0, 17920);
+ for (int frame = 3; frame <= 4; ++frame) {
+ PART_81_DRAW_HEAD(frame);
+ waitForTimer(31);
+ }
+ PART_81_IGOR_SAY(208, 1, 952);
+ for (int step = 0; step < 4; ++step) {
+ PART_81_DRAW_FIGURE((kPart81FigureFrames[step] - 1) * kPart81FigureFrameSize);
+ waitForTimer(61);
+ }
+
+ // the object that Igor brought is given
+ if (_inventoryInfo[kPart81InventoryState] != 0) {
+ _inventoryInfo[_inventoryInfo[kPart81InventoryState] - 1] = 0;
+ _inventoryInfo[kPart81InventoryState] = 0;
+ packInventory();
+ if (_inventoryInfo[72] > _inventoryInfo[73])
+ _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
+ }
+ PART_81_NPC_SAY({ { 210, 1, 954 }, { 211, 1, 955 } });
+ PART_81_IGOR_SAY(212, 1, 956);
+ PART_81_NPC_SAY({ { 213, 1, 957 }, { 214, 1, 958 } });
+ PART_81_IGOR_SAY(215, 1, 959);
+ PART_81_NPC_SAY({ { 216, 1, 960 }, { 217, 1, 961 } });
+ PART_81_IGOR_SAY(218, 1, 962);
+ PART_81_NPC_SAY({ { 219, 2, 963 }, { 221, 2, 964 }, { 223, 1, 965 } });
+ playSound(14, 1);
+ for (int frame = 1; frame <= 3; ++frame) {
+ PART_81_DRAW_STORY_HEAD(frame);
+ waitForTimer(31);
+ }
+
+ // the scene of the end, with the pictures of its own
+ static const int cutsceneAnim[] = { ANM_Part81Cutscene, 0 };
+ loadAnimData(cutsceneAnim);
+ loadData(IMG_Part81Strip, _screenLayer2);
+ memcpy(_screenLayer1, _screenVGA, 46080);
+ PART_81_END_SCENE();
+
+ // the room again
+ loadActionData(DAT_Part81);
+ PART_81_LOAD_ROOM();
+ PART_81_LOAD_ANIMATION();
+ PART_81_APPLY_OBJECT_STATE(255);
+ for (int frame = 4; frame <= 6; ++frame) {
+ PART_81_DRAW_STORY_HEAD(frame);
+ if (frame == 6) {
+ playSound(13, 1);
+ }
+ waitForTimer(31);
+ }
+ while (_mixer->isSoundHandleActive(_sfxHandle) && !_eventQuitGame) {
+ waitForTimer(1);
+ }
+ PART_81_NPC_SAY({ { 224, 1, 966 }, { 225, 1, 967 }, { 226, 3, 968 } });
+ PART_81_IGOR_SAY(229, 1, 969);
+ PART_81_NPC_SAY({ { 230, 1, 970 } });
+ _objectsState[kPart81EventDoneState] = 1;
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[72], 0);
+ PART_81_APPLY_OBJECT_STATE(255);
+}
+
+void IgorEngine::PART_81_DIALOGUE_CODE(int code) {
+ uint8 *data = _gameState.dialogueData;
+ if (code == 10) {
+ data[0] = 0;
+ }
+ if (code == 20) {
+ data[6] = 0;
+ }
+ if (code == 30) {
+ data[12] = 0;
+ }
+}
+
+void IgorEngine::PART_81_CONVERSATION() {
+ UpdateRoomBackgroundProc previousBackground = _updateRoomBackground;
+ _updateRoomBackground = 0;
+ _updateDialogue = &IgorEngine::PART_81_UPDATE_DIALOGUE_NPC;
+ loadDialogueData(DLG_Part81);
+ _gameState.dialogueStarted = true;
+ _gameState.dialogueChoiceStart = 1;
+ _gameState.dialogueChoiceCount = 1;
+
+ bool done = false;
+ do {
+ drawDialogueChoices();
+ PART_81_DRAW_HEAD(kPart81HeadStanding);
+ const int choice = selectDialogue();
+ if (choice == 0) {
+ break;
+ }
+ if (choice == -1) {
+ _updateDialogue = 0;
+ _updateRoomBackground = previousBackground;
+ return;
+ }
+ _dialogueChoiceSelected = choice;
+ dialogueAskQuestion();
+ dialogueReplyToQuestion(kPart81TextX, kPart81TextY, kPart81TextR, kPart81TextG, kPart81TextB);
+ const int offset = (_dialogueInfo[choice] - 1) * 6 + (_gameState.dialogueChoiceCount - 1) * 30 +
+ (_gameState.dialogueChoiceStart - 1) * 30;
+ const int code = _gameState.dialogueData[offset + 5];
+ if (code >= 1 && code <= 99) {
+ PART_81_DIALOGUE_CODE(code);
+ }
+ 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:
+ done = true;
+ break;
+ }
+ } while (!done);
+
+ memset(_screenVGA + 46080, 0, 17920);
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[72], 0);
+ _currentAction.verb = kVerbWalk;
+ _gameState.dialogueStarted = false;
+ _updateDialogue = 0;
+ _updateRoomBackground = previousBackground;
+}
+
+void IgorEngine::PART_81_ACTION_102_talk() {
+ if (_objectsState[kPart81BellState] == 1 && _objectsState[kPart81EventDoneState] == 1) {
+ igorSay(234, 1, 974);
+ return;
+ }
+ PART_81_IGOR_SAY(231, 1, 971);
+ PART_81_NPC_SAY({ { 232, 1, 972 } });
+ PART_81_CONVERSATION();
+ PART_81_APPLY_OBJECT_STATE(255);
+}
+
+void IgorEngine::PART_81_ENTER() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(0, 138, kFacingPositionRight, 0);
+ wd->clipSkipX = 15;
+ wd->clipWidth = 15;
+ wd->scaleWidth = 50;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 50;
+ _walkDataLastIndex = 0;
+ buildWalkPath(0, 138, 30, 138);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::PART_81_EXEC_ACTION(int action) {
+ switch (action) {
+ case 101:
+ _objectsState[kPart81SideState] = 1;
+ _currentPart = 700;
+ break;
+ case 102:
+ PART_81_ACTION_102_talk();
+ break;
+ case 103:
+ if (_objectsState[kPart81BellState] == 1) {
+ igorSay(202, 1, 946);
+ } else {
+ igorSay(201, 1, 945);
+ }
+ break;
+ case 104:
+ igorSay(233, 1, 973);
+ break;
+ case 106:
+ igorSay(203, 1, 947);
+ break;
+ case 107:
+ igorSay(204, 1, 948);
+ break;
+ case 108:
+ if (_objectsState[kPart81EventDoneState] == 0) {
+ igorSay({ { 206, 1, 950 }, { 207, 1, 951 } });
+ } else {
+ igorSay(205, 1, 949);
+ }
+ break;
+ case 109:
+ PART_81_ACTION_109();
+ break;
+ case 110:
+ PART_81_ACTION_110();
+ break;
+ default:
+ error("PART_81_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::PART_81() {
+ playMusic(4);
+ _gameState.enableLight = 2;
+ loadActionData(DAT_Part81);
+ PART_81_LOAD_ROOM();
+ PART_81_LOAD_ANIMATION();
+ _roomDataOffsets = PART_81_ROOM_DATA_OFFSETS;
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_81_EXEC_ACTION);
+ _updateRoomBackground = &IgorEngine::PART_81_UPDATE_ROOM_BACKGROUND;
+ PART_81_APPLY_OBJECT_STATE(255);
+
+ // the colors that change are darker than their palette
+ for (int i = 192 * 3; i < 208 * 3; ++i) {
+ const int value = _paletteBuffer[i] - 20;
+ _paletteBuffer[i] = value < 1 ? 0 : value;
+ }
+ memcpy(_screenVGA, _screenLayer1, 46080);
+
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ PART_81_SCROLL_IN();
+ PART_81_ENTER();
+ }
+ enterPartLoop();
+ while (_currentPart == 810 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ if (!_gameStateLoaded && _objectsState[kPart81BellState] == 1 && _objectsState[kPart81EventDoneState] == 1) {
+ _objectsState[kPart81BellState] = 0;
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index f5d5d715d72..c45c794addb 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -715,4 +715,20 @@
#define MSK_Part68 1115
#define BOX_Part68 1116
+// States 810 (PART_81) and the cutscene of state 740 (PART_74)
+#define DAT_Part81 1117
+#define DLG_Part81 1118
+#define ANM_Part81 1119
+#define TXT_Part81 1120
+#define IMG_Part81 1121
+#define PAL_Part81 1122
+#define MSK_Part81 1123
+#define BOX_Part81 1124
+#define ANM_Part81Cutscene 1125
+#define IMG_Part81Strip 1126
+#define PAL_Part74 1127
+#define IMG_Part74 1128
+#define TXT_Part74 1129
+#define ANM_Part74 1130
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 70aa42b6402..fdeac17f13a 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -485,4 +485,11 @@ const RoomDataOffsets IgorEngine::PART_68_ROOM_DATA_OFFSETS = {
{ -75, 21, 3472, 100, 30, 60, 13772, 13814, 100 }
};
+const RoomDataOffsets IgorEngine::PART_81_ROOM_DATA_OFFSETS = {
+ { 20, 2, 2, 1 },
+ { 32, 43 },
+ { 47, 237, 3183, 131, 207, 82 },
+ { -125, 10, 1618, 50, 30, 30, 6818, 6838, 50 }
+};
+
} // End of namespace Igor
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 9e5b82e0272..026ad7a78ea 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1165,6 +1165,44 @@ void IgorEngine::fixWalkPosition(int *x, int *y) {
*y = yPos;
return;
}
+ if (getPart() == 81) {
+ // The click is clamped to the floor: on the left part the first walkable row is looked for below it (starting
+ // one row down) and, if there is none, above; on the right part a click above row 93 goes to a fixed
+ // place and any other goes to the first walkable column to the left.
+ int xPos = *x;
+ int yPos = MIN(*y, 143);
+ if (xPos <= 128) {
+ do {
+ if (yPos < 143) {
+ ++yPos;
+ }
+ if (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area > 0) {
+ break;
+ }
+ } while (yPos != 143);
+ if (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0) {
+ // the scan upwards never stops by itself in the original when nothing is walkable
+ do {
+ if (yPos > 0) {
+ --yPos;
+ }
+ } while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && yPos > 0);
+ }
+ } else if (yPos < 93) {
+ xPos = 128;
+ yPos = 93;
+ } else {
+ // the scan to the left never stops by itself in the original when nothing is walkable
+ do {
+ if (xPos > 0) {
+ --xPos;
+ }
+ } while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && xPos > 0);
+ }
+ *x = xPos;
+ *y = yPos;
+ return;
+ }
if (_roomClickFix.enabled) {
// The click is clamped, then the picture is scanned for the first walkable row strictly below it (the
// scan starts one row down, whatever the row is) and, if none is found down to the last row and the
Commit: 95252663d948ea3c59a325ff4f234c3a441aeecc
https://github.com/scummvm/scummvm/commit/95252663d948ea3c59a325ff4f234c3a441aeecc
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:35+01:00
Commit Message:
IGOR: Fixes shading of igor
Changed paths:
engines/igor/igor.h
engines/igor/module.mk
engines/igor/parts/part_10.cpp
engines/igor/parts/part_11.cpp
engines/igor/parts/part_72.cpp
engines/igor/parts/part_81.cpp
engines/igor/parts/part_9.cpp
engines/igor/text.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index c322bb92e52..ed5f63d8c7c 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -723,14 +723,14 @@ private:
void PART_09_EXEC_ACTION(int action);
void PART_09_APPLY_OBJECT_STATE(int num);
void PART_09_ANIMATE_DOOR(bool open);
- void PART_09_DRAW_SECRETARY_FRAME(int frame, bool background);
- void PART_09_DRAW_DRAWER_FRAME(int frame);
+ void PART_09_drawSecretaryFrame(int frame, bool background);
+ void PART_09_DRAW_openClosetFrame(int frame);
void PART_09_ACTION_101_openFileCabinet();
- void PART_09_ACTION_106(bool search);
- void PART_09_ACTION_110();
+ void PART_09_ACTION_106_openCloset(bool search);
+ void PART_09_ACTION_110_pickCostumeFromCloset();
void PART_09_UPDATE_DIALOGUE_SECRETARY(int action);
void PART_09_DRAW_SECRETARY_MOUTH(int frame);
- void PART_09_SECRETARY_GESTURE();
+ void PART_09_secretarySearchesFile();
void PART_09_UPDATE_ROOM_BACKGROUND();
// Decanato right
@@ -743,10 +743,10 @@ private:
// Decanato left
void PART_11();
void PART_11_EXEC_ACTION(int action);
- void PART_11_ACTION_105();
+ void PART_11_ACTION_105_pickSlug();
void PART_11_ACTION_107();
void PART_11_ACTION_108_scrollRight();
- void PART_11_ACTION_112();
+ void PART_11_ACTION_112_pickBottle();
void PART_11_APPLY_OBJECT_STATE(int num);
// outside church
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 851ca704574..918f3a0dc43 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -20,13 +20,8 @@ MODULE_OBJS = \
parts/part_2.o \
parts/part_4.o \
parts/part_5.o \
- parts/part_85.o \
- parts/part_90.o \
parts/part_6.o \
parts/part_7.o \
- parts/part_68.o \
- parts/part_70.o \
- parts/part_72.o \
parts/part_8.o \
parts/part_9.o \
parts/part_10.o \
@@ -55,9 +50,14 @@ MODULE_OBJS = \
parts/part_36.o \
parts/part_37.o \
parts/part_50.o \
+ parts/part_68.o \
+ parts/part_70.o \
+ parts/part_72.o \
parts/part_74.o \
parts/part_75.o \
parts/part_81.o \
+ parts/part_85.o \
+ parts/part_90.o \
parts/part_maze.o \
parts/part_maze_data.o \
parts/part_margaret.o \
diff --git a/engines/igor/parts/part_10.cpp b/engines/igor/parts/part_10.cpp
index 99d97132f99..634dcfd6eb7 100644
--- a/engines/igor/parts/part_10.cpp
+++ b/engines/igor/parts/part_10.cpp
@@ -37,9 +37,10 @@ void IgorEngine::PART_10_11_DRAW_OBJECT_STATE(int num) {
}
if (num == 3 || num == 255) {
+ // draw butterfly net with or without bottle
if (_objectsState[42] == 1) {
copyArea(_screenLayer1, 0x4E32, 320, _animFramesBuffer + 0xC5E2, 14, 14, 15);
- } else if (_objectsState[42] == 2) {
+ } else if (_objectsState[42] == 2) { // w/ bottle
copyArea(_screenLayer1, 0x4E32, 320, _animFramesBuffer + 0xC6B4, 14, 14, 15);
}
}
@@ -167,7 +168,6 @@ void IgorEngine::PART_10() {
// active. The original load order is unconditional.
memcpy(_animFramesBuffer + kPart10PanelLeft, _screenLayer1, 46080);
-
loadRoomData(PAL_DecanatoRight, IMG_DecanatoRight, BOX_DecanatoRight, MSK_DecanatoRight, TXT_DecanatoRight);
static const int hamburgerAnimation[] = { ANM_DecanatoHamburger, 0 };
loadAnimData(hamburgerAnimation, kPart10_11_Frm1);
@@ -179,10 +179,6 @@ void IgorEngine::PART_10() {
_roomDataOffsets = PART_10_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
- // A normal entry presents the freshly loaded right panel. On state 102
- // handoff, the original jumps directly to the walk-index setup instead,
- // preserving the completed pan (including Igor) already in screen VGA.
-
if (_currentPart != 102 && !_gameStateLoaded) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index d52a5a2d395..6548f345574 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -58,7 +58,7 @@ void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_11_ACTION_105() {
+void IgorEngine::PART_11_ACTION_105_pickSlug() {
for (int frame = 0; frame <= 1; ++frame) {
drawAnimRect(0x6167, kPart10_11_Frm1 + frame * 0x405, 21, 49);
waitForTimer(127);
@@ -115,7 +115,7 @@ void IgorEngine::PART_11_ACTION_108_scrollRight() {
_currentPart = 102;
}
-void IgorEngine::PART_11_ACTION_112() {
+void IgorEngine::PART_11_ACTION_112_pickBottle() {
for (int frame = 0; frame <= 2; ++frame) {
drawAnimRect(0x47E3, kPart10_11_Frm2 + frame * 0x348, 30, 28);
waitForTimer(61);
@@ -135,19 +135,19 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
- case 102:
+ case 102: // close window
igorSayAndWait(29, 1, 29);
break;
case 103: // look at pipe
igorSayAndWait(_objectsState[40] == 0 ? 203 : 204, 1, _objectsState[40] == 0 ? 617 : 618);
break;
- case 104: // look at snail
+ case 104: // talk to slug
igorSayAndWait({ { 205, 1, 619 }, { 206, 1, 620 } });
break;
case 105:
- PART_11_ACTION_105();
+ PART_11_ACTION_105_pickSlug();
break;
- case 106:
+ case 106: // look at slug
igorSayAndWait(73, 1, 50);
break;
case 107:
@@ -166,7 +166,7 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
igorSayAndWait(210, 1, 624);
break;
case 112:
- PART_11_ACTION_112();
+ PART_11_ACTION_112_pickBottle();
break;
case 113:
igorSayAndWait(211, 1, 625);
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
index 7aadc252ece..37764270cb0 100644
--- a/engines/igor/parts/part_72.cpp
+++ b/engines/igor/parts/part_72.cpp
@@ -203,6 +203,8 @@ void IgorEngine::PART_72() {
_roomAmbientIndex = 1;
loadActionData(DAT_Part72);
loadRoomData(PAL_Part72, IMG_Part72, BOX_Part72, MSK_Part72, TXT_Part72);
+ // the colors of Igor
+ memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
SET_PAL_240_48_1();
static const int anim[] = { ANM_Part72, 0 };
loadAnimData(anim);
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index 80cf29850cf..c664fabc7da 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -81,6 +81,8 @@ static const int kPart81StepTicks = 16;
void IgorEngine::PART_81_LOAD_ROOM() {
loadRoomData(PAL_Part81, IMG_Part81, BOX_Part81, MSK_Part81, TXT_Part81);
+ // the colors of Igor
+ memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
SET_PAL_240_48_1();
}
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index 7e416aba2e9..dff9d39ecff 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -10,7 +10,7 @@
namespace Igor {
-void IgorEngine::PART_09_DRAW_SECRETARY_FRAME(int frame, bool background) {
+void IgorEngine::PART_09_drawSecretaryFrame(int frame, bool background) {
drawAnimRect(0x7839, frame * 0x34E, 18, 47, background);
}
@@ -27,7 +27,7 @@ void IgorEngine::PART_09_APPLY_OBJECT_STATE(int num) {
}
if (num == 3 || num == 255) {
if (_objectsState[35] == 0) {
- PART_09_DRAW_SECRETARY_FRAME(1, true);
+ PART_09_drawSecretaryFrame(1, true);
_roomObjectAreasTable[6].object = 2;
_roomObjectAreasTable[15].object = 2;
_roomObjectAreasTable[15].area = 0;
@@ -64,29 +64,29 @@ void IgorEngine::PART_09_ANIMATE_DOOR(bool open) {
PART_09_APPLY_OBJECT_STATE(1);
}
-void IgorEngine::PART_09_DRAW_DRAWER_FRAME(int frame) {
+void IgorEngine::PART_09_DRAW_openClosetFrame(int frame) {
drawAnimRect(0x48E6, 0x6E0B + frame * 0x639, 27, 59);
}
-void IgorEngine::PART_09_ACTION_106(bool search) {
- if (_objectsState[35] == 0) {
+void IgorEngine::PART_09_ACTION_106_openCloset(bool hairpin) {
+ if (_objectsState[35] == 0) { // if secretary present, she will prevent searching the closet
ADD_DIALOGUE_TEXT(214, 2, 243);
} else if (_objectsState[34] == 1) {
executeAction(10);
return;
- } else if (search) {
+ } else if (hairpin) {
static const uint8 frames[] = { 1, 2, 1, 2, 1, 2, 3 };
for (uint i = 0; i < ARRAYSIZE(frames); ++i) {
- PART_09_DRAW_DRAWER_FRAME(frames[i]);
+ PART_09_DRAW_openClosetFrame(frames[i]);
waitForTimer(61);
}
_objectsState[34] = 1;
PART_09_APPLY_OBJECT_STATE(2);
ADD_DIALOGUE_TEXT(212, 1, 241);
- } else {
+ } else { // igor tries to open
static const uint8 frames[] = { 1, 2, 1, 2, 1, 2, 1, 2, 0 };
for (uint i = 0; i < ARRAYSIZE(frames); ++i) {
- PART_09_DRAW_DRAWER_FRAME(frames[i]);
+ PART_09_DRAW_openClosetFrame(frames[i]);
if (i == 0)
playSound(49, 1);
if (i + 1 < ARRAYSIZE(frames))
@@ -99,7 +99,7 @@ void IgorEngine::PART_09_ACTION_106(bool search) {
waitForEndOfIgorDialogue();
}
-void IgorEngine::PART_09_ACTION_110() {
+void IgorEngine::PART_09_ACTION_110_pickCostumeFromCloset() {
for (int frame = 1; frame >= 0; --frame) {
drawAnimRect(0x48E6, 0x9BA3 + frame * 0x438, 27, 40, false, kBlendLitSprite);
waitForTimer(127);
@@ -150,7 +150,7 @@ void IgorEngine::PART_09_UPDATE_DIALOGUE_SECRETARY(int action) {
}
}
-void IgorEngine::PART_09_SECRETARY_GESTURE() {
+void IgorEngine::PART_09_secretarySearchesFile() {
static const uint8 beginFrames[] = { 1, 2, 3, 4 };
static const uint8 endFrames[] = { 3, 2, 1, 8 };
for (uint step = 0; step < ARRAYSIZE(beginFrames); ++step) {
@@ -170,7 +170,7 @@ void IgorEngine::PART_09_SECRETARY_GESTURE() {
void IgorEngine::PART_09_UPDATE_ROOM_BACKGROUND() {
if (_objectsState[35] == 0 && compareGameTick(61) && getRandomNumber(1) == 0)
- PART_09_DRAW_SECRETARY_FRAME(getRandomNumber(2), false);
+ PART_09_drawSecretaryFrame(getRandomNumber(2), false);
}
void IgorEngine::PART_09_EXEC_ACTION(int action) {
@@ -204,9 +204,9 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
break;
}
case 106:
- PART_09_ACTION_106(false);
+ PART_09_ACTION_106_openCloset(false);
break;
- case 107:
+ case 107: // close closet
if (_objectsState[34] == 0) {
executeAction(13);
} else {
@@ -216,11 +216,11 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
case 108: // look at intercom
igorSayAndWait({ { 207, 1, 237 }, { 208, 1, 238 } });
break;
- case 109:
+ case 109: //user intercom
igorSayAndWait(_objectsState[35] == 0 ? 216 : 224, 1, _objectsState[35] == 0 ? 244 : 252);
break;
case 110:
- PART_09_ACTION_110();
+ PART_09_ACTION_110_pickCostumeFromCloset();
break;
case 112: // look at door
igorSayAndWait(211, 1, 240);
@@ -231,10 +231,10 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
case 114: // close door
PART_09_ANIMATE_DOOR(false);
break;
- case 115:
- PART_09_ACTION_106(true);
+ case 115: // use hairpin
+ PART_09_ACTION_106_openCloset(true);
break;
- case 116:
+ case 116: //leave
if (_objectsState[27] != 0) {
WalkData *wd = &_walkData[0];
wd->setPos(207, 106, kFacingPositionBack, 1);
@@ -261,7 +261,9 @@ void IgorEngine::PART_09() {
playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_AdministrationSecretaryRoom);
- loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom,BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom, TXT_AdministrationSecretaryRoom);
+ loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom,
+ BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom,
+ TXT_AdministrationSecretaryRoom);
static const int anim[] = {
ANM_AdministrationSecretaryRoom1, ANM_AdministrationSecretaryRoom2,
ANM_AdministrationSecretaryRoom3, ANM_AdministrationSecretaryRoom4,
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 805a3467d15..a80dd0a7d57 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -557,7 +557,7 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreU
if (code == 4)
_gameState.dialogueData[120] = 0;
if (code == 98 || code == 101) {
- PART_09_SECRETARY_GESTURE();
+ PART_09_secretarySearchesFile();
dialogueReplyToQuestion(x, y, r, g, b, code);
}
}
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 026ad7a78ea..0dc36012869 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -176,7 +176,8 @@ void IgorEngine::moveIgor(int pos, int frame) {
int8 colorLum = _roomObjectAreasTable[_screenLayer2[_walkDataCurrentPosY2 * 320 + _walkDataCurrentPosX2]].y2Lum;
if (_gameState.colorLum != colorLum) {
for (int color = 192 * 3; color <= 207 * 3; ++color) {
- int c = _paletteBuffer[color] + colorLum;
+ // Igor's colors come from his own palette, not from the (possibly darkened) palette of the room
+ int c = _igorPalette[color - 192 * 3] + colorLum;
if (c < 1) {
c = 0;
} else if (c > 62) {
Commit: 8660dd46f5939827700efea698852e798b661e6d
https://github.com/scummvm/scummvm/commit/8660dd46f5939827700efea698852e798b661e6d
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:35+01:00
Commit Message:
IGOR: Part 71
Changed paths:
A engines/igor/parts/part_71.cpp
engines/igor/graphics.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/palette.cpp
engines/igor/part_main.cpp
engines/igor/parts/part_11.cpp
engines/igor/parts/part_72.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/graphics.cpp b/engines/igor/graphics.cpp
index 8294344bc4c..2344016adea 100644
--- a/engines/igor/graphics.cpp
+++ b/engines/igor/graphics.cpp
@@ -52,6 +52,7 @@ void IgorEngine::copyArea(uint8 *dst, int dstOffset, int dstPitch, const uint8 *
* kBlendCopy plain copy
* kBlendLitSprite sprite pixels with colors 0xC0-0xCF (Igors colors) are replaced by the background pixel or darkened according to the lighting area they land in;
* use it for sprites that move through lit and shaded parts of a room
+ * kBlendLitSpriteNoShade same, but sprite pixels are never darkened: they are only replaced by the background pixel in the lit areas
* kBlendBehindIgor the block is drawn behind Igor: screen pixels with colors 0xC0-0xCF are kept
* kBlendBehindIgorAndText same, and screen pixels with the dialogue text colors 0xF0-0xF1 are kept too
*/
@@ -65,12 +66,12 @@ void IgorEngine::drawAnimRect(int dstOffset, int animOffset, int w, int h, bool
for (int x = 0; x < w; ++x) {
const int dst = dstOffset + y * 320 + x;
uint8 color = src[y * w + x];
- if (blend == kBlendLitSprite) {
+ if (blend == kBlendLitSprite || blend == kBlendLitSpriteNoShade) {
if (color >= 0xC0 && color <= 0xCF) {
const RoomObjectArea &area = _roomObjectAreasTable[_screenLayer2[dst]];
if (area.y1Lum > 0)
color = _screenLayer1[dst];
- else if (area.y2Lum > 0)
+ else if (blend == kBlendLitSprite && area.y2Lum > 0)
color -= area.deltaLum;
}
} else {
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 903513ae648..77d2696f771 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -124,6 +124,7 @@ void IgorEngine::restart() {
_mazeSavedLocation = 0;
_mazeRoom = 0;
memset(&_roomClickFix, 0, sizeof(_roomClickFix));
+ _roomClickFixBottom = 143;
_roomGiveObjectSize = 0;
_nextTimer = 0;
_fastMode = 1;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index ed5f63d8c7c..2db7de31caf 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -416,6 +416,7 @@ struct WalkData {
enum AnimBlend {
kBlendCopy,
kBlendLitSprite,
+ kBlendLitSpriteNoShade,
kBlendBehindIgor,
kBlendBehindIgorAndText
};
@@ -544,6 +545,7 @@ private:
RoomWalkBounds _roomWalkBounds;
RoomClickFix _roomClickFix;
+ int _roomClickFixBottom; // the last row the click fix scans
// stride of the give matrix of the room when it differs from the use matrix (0: same)
int _roomGiveObjectSize;
RoomDataOffsets _roomDataOffsets;
@@ -744,7 +746,7 @@ private:
void PART_11();
void PART_11_EXEC_ACTION(int action);
void PART_11_ACTION_105_pickSlug();
- void PART_11_ACTION_107();
+ void PART_11_ACTION_107_useButterflyNetWithHole();
void PART_11_ACTION_108_scrollRight();
void PART_11_ACTION_112_pickBottle();
void PART_11_APPLY_OBJECT_STATE(int num);
@@ -1179,6 +1181,16 @@ private:
void PART_68_NPC_LEAVES();
void PART_68();
+ void PART_71_EXEC_ACTION(int action);
+ void PART_71_APPLY_OBJECT_STATE(int what);
+ void PART_71_DRAW_OBJECT(int frame);
+ void PART_71_ACTION_102_takeObject();
+ void PART_71_ACTION_103_look();
+ void PART_71_ENTER_FROM_RIGHT();
+ void PART_71_LIGHTNING();
+ void PART_71_UPDATE_ROOM_BACKGROUND();
+ void PART_71();
+
void PART_72_EXEC_ACTION(int action);
void PART_72_APPLY_OBJECT_STATE();
void PART_72_ACTION_102_takeObject();
@@ -1203,7 +1215,7 @@ private:
void mazeExitThroughStairs(const MazeAction &action);
void mazeGoToNeighbor(int dir);
int MAZE_MUSIC_TRACK() const;
- void setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp);
+ void setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp, int yBottom = 143);
void UPDATE_OBJECT_STATE(int num);
void PART_UPDATE_FIGURES_ON_PAPER(int delay);
@@ -1296,6 +1308,7 @@ private:
void scrollPalette(int startColor, int endColor);
void setPaletteColor(uint8 index, uint8 r, uint8 g, uint8 b);
void setPaletteRange(int startColor, int endColor);
+ void darkenPalette(uint8 *palette, int firstColor, int lastColor, int amount);
void updatePalette(int count);
void SET_PAL_208_96_1();
void SET_PAL_240_48_1();
@@ -1456,6 +1469,7 @@ protected:
static const RoomDataOffsets PART_50_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_68_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_70_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_71_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_72_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_81_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 918f3a0dc43..7174fe90e56 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -52,6 +52,7 @@ MODULE_OBJS = \
parts/part_50.o \
parts/part_68.o \
parts/part_70.o \
+ parts/part_71.o \
parts/part_72.o \
parts/part_74.o \
parts/part_75.o \
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index 7fceab8a211..7c36802eb92 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -42,6 +42,16 @@ void IgorEngine::scrollPalette(int startColor, int endColor) {
memcpy(&_currentPalette[startColor * 3], c, 3);
}
+/**
+ * Lowers the components of the colors firstColor to lastColor of a palette by "amount" (a component never goes below 0).
+ */
+void IgorEngine::darkenPalette(uint8 *palette, int firstColor, int lastColor, int amount) {
+ for (int i = firstColor * 3; i < (lastColor + 1) * 3; ++i) {
+ const int value = palette[i] - amount;
+ palette[i] = value < 1 ? 0 : value;
+ }
+}
+
void IgorEngine::setPaletteRange(int startColor, int endColor) {
// debugC(9, kDebugScreen, "setPaletteRange(%d, %d)", startColor, endColor);
assert(endColor - startColor + 1 <= 256);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index ff636b8619b..8d6e2c753ee 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -668,6 +668,9 @@ void IgorEngine::PART_MAIN() {
case 700:
PART_70();
break;
+ case 710:
+ PART_71();
+ break;
case 720:
case 721:
PART_72();
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index 6548f345574..1353087ca06 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -68,7 +68,7 @@ void IgorEngine::PART_11_ACTION_105_pickSlug() {
PART_11_APPLY_OBJECT_STATE(255);
}
-void IgorEngine::PART_11_ACTION_107() {
+void IgorEngine::PART_11_ACTION_107_useButterflyNetWithHole() {
for (int frame = 0; frame <= 2; ++frame) {
drawAnimRect(0x47E3, kPart10_11_Frm5 + frame * 0x348, 30, 28);
waitForTimer(61);
@@ -151,7 +151,7 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
igorSayAndWait(73, 1, 50);
break;
case 107:
- PART_11_ACTION_107();
+ PART_11_ACTION_107_useButterflyNetWithHole();
break;
case 108:
PART_11_ACTION_108_scrollRight();
diff --git a/engines/igor/parts/part_71.cpp b/engines/igor/parts/part_71.cpp
new file mode 100644
index 00000000000..e0a98e41838
--- /dev/null
+++ b/engines/igor/parts/part_71.cpp
@@ -0,0 +1,246 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// The animation resource starts with the three frames of Igor taking the object (34x50 each, drawn on the screen) and
+// ends with the two versions of the object as it is drawn in the room picture (5x6 each).
+static const int kPart71TakeFramesCount = 3;
+static const int kPart71TakeWidth = 34;
+static const int kPart71TakeHeight = 50;
+static const int kPart71TakeFrameSize = kPart71TakeWidth * kPart71TakeHeight;
+static const int kPart71TakeOffset = 23 * 320 + 101;
+static const int kPart71TakeFrameDelay = 91;
+
+static const int kPart71ObjectOffset = 55 * 320 + 101;
+static const int kPart71ObjectWidth = 5;
+static const int kPart71ObjectHeight = 6;
+static const int kPart71ObjectPicturesOffset = kPart71TakeFramesCount * kPart71TakeFrameSize;
+
+static const int kPart71TakenStateIndex = 100;
+static const int kPart71ExaminedStateIndex = 101;
+static const int kPart71TakeDoneStateIndex = 106;
+static const int kPart71ObjectNameIndex = 2;
+
+static const int kPart71InventoryObject = 25;
+static const int kPart71InventoryIndex = 60;
+
+// What PART_71_APPLY_OBJECT_STATE refreshes.
+static const int kPart71ApplyPicture = 1;
+static const int kPart71ApplyName = 2;
+static const int kPart71ApplyAll = 0xFF;
+
+// Thunder comes a number of lightning checks after the lightning.
+static const int kPart71ThunderDelay = 10;
+static const int kPart71ThunderSound = 42;
+
+void IgorEngine::PART_71_EXEC_ACTION(int action) {
+ switch (action) {
+ case 101:
+ igorSay({ { 201, 1, 993 }, { 202, 1, 994 }, { 203, 1, 995 } });
+ break;
+ case 102:
+ PART_71_ACTION_102_takeObject();
+ break;
+ case 103:
+ PART_71_ACTION_103_look();
+ break;
+ case 104:
+ igorSay({ { 208, 1, 997 }, { 209, 1, 998 }, { 210, 1, 999 } });
+ break;
+ case 105:
+ _currentPart = 681;
+ break;
+ case 106:
+ igorSay({ { 212, 1, 1000 }, { 213, 1, 1001 }, { 214, 1, 1002 } });
+ break;
+ case 107:
+ igorSay({ { 216, 1, 1003 }, { 217, 2, 1004 } });
+ break;
+ default:
+ error("PART_71_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+/**
+ * Draws one of the two versions of the object into the room picture.
+ */
+void IgorEngine::PART_71_DRAW_OBJECT(int frame) {
+ const int frameSize = kPart71ObjectWidth * kPart71ObjectHeight;
+ copyArea(_screenLayer1, kPart71ObjectOffset, 320, _animFramesBuffer + kPart71ObjectPicturesOffset + frame * frameSize,
+ kPart71ObjectWidth, kPart71ObjectWidth, kPart71ObjectHeight);
+}
+
+/**
+ * Refreshes what depends on the story: the picture of the object (it is gone once Igor has taken it) and its name
+ * (it changes once Igor has examined it).
+ */
+void IgorEngine::PART_71_APPLY_OBJECT_STATE(int what) {
+ if (what == kPart71ApplyPicture || what == kPart71ApplyAll) {
+ PART_71_DRAW_OBJECT(_objectsState[kPart71TakenStateIndex] == 0 ? 0 : 1);
+ }
+ if (what == kPart71ApplyName || what == kPart71ApplyAll) {
+ const char *name = getString(_objectsState[kPart71ExaminedStateIndex] == 0 ? STR_ShinyThing : STR_Statuette);
+ // TODO: the name of the object before it is examined is only known in Spanish; the other languages keep the
+ // name that comes with the room.
+ if (name) {
+ Common::strlcpy(_roomObjectNames[kPart71ObjectNameIndex], name, sizeof(_roomObjectNames[kPart71ObjectNameIndex]));
+ }
+ }
+}
+
+/**
+ * Igor examines the object: the first time he describes it and it gets its real name.
+ */
+void IgorEngine::PART_71_ACTION_103_look() {
+ if (_objectsState[kPart71ExaminedStateIndex] == 0) {
+ igorSay(220, 2, 1005);
+ _objectsState[kPart71ExaminedStateIndex] = 1;
+ PART_71_APPLY_OBJECT_STATE(kPart71ApplyName);
+ } else {
+ igorSay(222, 2, 1006);
+ }
+}
+
+/**
+ * Igor takes the object: three frames of the animation are drawn over the screen, then the object goes to the
+ * inventory.
+ */
+void IgorEngine::PART_71_ACTION_102_takeObject() {
+ if (_objectsState[kPart71ExaminedStateIndex] == 0) {
+ igorSayAndWait(220, 2, 1005);
+ _objectsState[kPart71ExaminedStateIndex] = 1;
+ }
+ for (int i = 0; i < kPart71TakeFramesCount; ++i) {
+ drawAnimRect(kPart71TakeOffset, i * kPart71TakeFrameSize, kPart71TakeWidth, kPart71TakeHeight, false, kBlendLitSpriteNoShade);
+ waitForTimer(kPart71TakeFrameDelay);
+ }
+ addObjectToInventory(kPart71InventoryObject, kPart71InventoryIndex);
+ _objectsState[kPart71TakenStateIndex] = 1;
+ PART_71_APPLY_OBJECT_STATE(kPart71ApplyAll);
+ igorSay(204, 3, 996);
+ _objectsState[kPart71TakeDoneStateIndex] = 1;
+}
+
+/**
+ * Igor comes from the right edge, walking to the left.
+ */
+void IgorEngine::PART_71_ENTER_FROM_RIGHT() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(319, 138, kFacingPositionLeft, 0);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 15;
+ wd->scaleWidth = 50;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 50;
+ _walkDataLastIndex = 0;
+ _walkDataCurrentIndex = 1;
+ buildWalkPath(319, 138, 276, 123);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+/**
+ * The picture and the colors of the room are inverted twice, as when lightning strikes outside. The thunder follows
+ * later.
+ */
+void IgorEngine::PART_71_LIGHTNING() {
+ uint8 normalPalette[624];
+ uint8 invertedPalette[624];
+
+ memcpy(normalPalette, _currentPalette, sizeof(normalPalette));
+ for (int i = 3; i < (int)sizeof(invertedPalette); ++i) {
+ _currentPalette[i] = 62 - _currentPalette[i];
+ }
+ memcpy(invertedPalette, _currentPalette, sizeof(invertedPalette));
+
+ for (int flash = 0; flash < 2; ++flash) {
+ memcpy(_currentPalette, invertedPalette, sizeof(invertedPalette));
+ setPaletteRange(1, 207);
+ waitForTimer(15);
+ memcpy(_currentPalette, normalPalette, sizeof(normalPalette));
+ setPaletteRange(1, 207);
+ if (flash == 0) {
+ waitForTimer(5);
+ }
+ }
+ _roomAmbientIndex = 1;
+}
+
+void IgorEngine::PART_71_UPDATE_ROOM_BACKGROUND() {
+ if (compareGameTick(1)) {
+ if (getRandomNumber(99) == 0) {
+ PART_71_LIGHTNING();
+ }
+ if (_roomAmbientIndex > 0) {
+ ++_roomAmbientIndex;
+ }
+ }
+ if (_roomAmbientIndex == kPart71ThunderDelay) {
+ playSound(kPart71ThunderSound, 1);
+ _roomAmbientIndex = 0;
+ }
+}
+
+void IgorEngine::PART_71() {
+ playMusic(4);
+ _gameState.enableLight = 1;
+ loadActionData(DAT_Part71);
+ loadRoomData(PAL_Part71, IMG_Part71, BOX_Part71, MSK_Part71, TXT_Part71);
+ // the colors of Igor
+ memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
+ SET_PAL_240_48_1();
+ static const int anim[] = { ANM_Part71, 0 };
+ loadAnimData(anim);
+ _roomDataOffsets = PART_71_ROOM_DATA_OFFSETS;
+ setRoomClickFix(138, 127, -1, true, 138);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_71_EXEC_ACTION);
+ _updateRoomBackground = &IgorEngine::PART_71_UPDATE_ROOM_BACKGROUND;
+ PART_71_APPLY_OBJECT_STATE(kPart71ApplyAll);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _roomAmbientIndex = 0;
+
+ // the colors of Igor are darker than their palette
+ darkenPalette(_paletteBuffer, 192, 207, 10);
+
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ PART_71_ENTER_FROM_RIGHT();
+ }
+ enterPartLoop();
+ while (_currentPart == 710 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ // the colors that changed are kept
+ memcpy(_paletteBuffer, _currentPalette, 624);
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
index 37764270cb0..9e177a24917 100644
--- a/engines/igor/parts/part_72.cpp
+++ b/engines/igor/parts/part_72.cpp
@@ -47,13 +47,6 @@ static bool PART_72_IS_PROTECTED_COLOR(uint8 color) {
return (color >= 0xC0 && color <= 0xCF) || (color >= 0xF0 && color <= 0xF1);
}
-static void PART_72_DARKEN_PALETTE(uint8 *palette, int firstColor, int lastColor, int amount) {
- for (int i = firstColor * 3; i < (lastColor + 1) * 3; ++i) {
- const int value = palette[i] - amount;
- palette[i] = value < 1 ? 0 : value;
- }
-}
-
void IgorEngine::PART_72_EXEC_ACTION(int action) {
switch (action) {
case 101:
@@ -216,8 +209,8 @@ void IgorEngine::PART_72() {
memcpy(_screenVGA, _screenLayer1, 46080);
// the whole picture is darker than its palette
- PART_72_DARKEN_PALETTE(_paletteBuffer, 1, 175, 10);
- PART_72_DARKEN_PALETTE(_paletteBuffer, 192, 207, 15);
+ darkenPalette(_paletteBuffer, 1, 175, 10);
+ darkenPalette(_paletteBuffer, 192, 207, 15);
for (int i = 0; i < 5; ++i) {
const int pos = kPart72StarOffsets[i];
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index c45c794addb..ea97b61e595 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -470,6 +470,7 @@
#define STR_SharewarePenduloAddress4 446
#define STR_SharewarePenduloAddress5 447
#define STR_SharewarePenduloAddress6 448
+#define STR_ShinyThing 449
// Decanato panels
@@ -731,4 +732,13 @@
#define TXT_Part74 1129
#define ANM_Part74 1130
+// State 710 (PART_71)
+#define DAT_Part71 1131
+#define ANM_Part71 1132
+#define TXT_Part71 1133
+#define IMG_Part71 1134
+#define PAL_Part71 1135
+#define MSK_Part71 1136
+#define BOX_Part71 1137
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index fdeac17f13a..a7cda8b7975 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -471,6 +471,13 @@ const RoomDataOffsets IgorEngine::PART_70_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_71_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 5, 18 },
+ { 23, 231, 3247, 127, 203, 84 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_72_ROOM_DATA_OFFSETS = {
{ 45, 3, 6, 2 },
{ 76, 87 },
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 0dc36012869..ace031c33fc 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -42,8 +42,9 @@ void IgorEngine::setRoomWalkBounds(int x1, int y1, int x2, int y2,
_roomWalkBounds.x2MinY = x2MinY < 0 ? y1 : x2MinY;
}
-void IgorEngine::setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp) {
+void IgorEngine::setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp, int yBottom) {
_roomClickFix.yMax = yMax;
+ _roomClickFixBottom = yBottom;
_roomClickFix.xMin = xMin;
_roomClickFix.xMax = xMax;
_roomClickFix.scanUp = scanUp;
@@ -1217,14 +1218,14 @@ void IgorEngine::fixWalkPosition(int *x, int *y) {
}
int yPos = MIN(*y, _roomClickFix.yMax);
do {
- if (yPos < 143) {
+ if (yPos < _roomClickFixBottom) {
++yPos;
}
if (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area > 0) {
break;
}
- } while (yPos != 143);
- if (_roomClickFix.scanUp && yPos == 143 && _roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0) {
+ } while (yPos != _roomClickFixBottom);
+ if (_roomClickFix.scanUp && yPos == _roomClickFixBottom && _roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0) {
do {
--yPos;
} while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && yPos > 0);
Commit: 51b27926b92fd454402c635b60be2b495987fb36
https://github.com/scummvm/scummvm/commit/51b27926b92fd454402c635b60be2b495987fb36
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:36+01:00
Commit Message:
IGOR: Refactor inventory removal
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/parts/part_12.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_81.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 77d2696f771..3be55d1a298 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -378,13 +378,17 @@ bool IgorEngine::debugAddObjectToInventory(int object) {
return true;
}
-void IgorEngine::removeObjectFromInventory(int index) {
+void IgorEngine::removeInventoryEntry(int index) {
_inventoryInfo[_inventoryInfo[index] - 1] = 0;
_inventoryInfo[index] = 0;
packInventory();
if (_inventoryInfo[72] > _inventoryInfo[73]) {
_inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
}
+}
+
+void IgorEngine::removeObjectFromInventory(int index) {
+ removeInventoryEntry(index);
drawInventory(_inventoryInfo[72], 0);
playSound(63, 1);
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 2db7de31caf..5b192828c4f 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -753,17 +753,17 @@ private:
// 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_ACTION_goToPath();
+ void PART_12_ACTION_104_tryEnterChurch();
+ void PART_12_ACTION_105_useResinWithStone();
+ void PART_12_ACTION_108_enterChurch();
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_UPDATE_DIALOGUE_PRIEST(int action);
+ void PART_12_HANDLE_DIALOGUE_PRIEST();
+ void PART_12_OBJECT_STATE(int num);
void PART_12_HELPER_2();
- void PART_12_HELPER_3();
- void PART_12_HELPER_4();
+ void PART_12_HELPER_3_paintOverLizard();
+ void PART_12_HELPER_4_exorcismCutscene();
void PART_12_HELPER_5();
void PART_12_HELPER_6();
void PART_12_HELPER_8();
@@ -1266,6 +1266,7 @@ private:
void scrollInventory();
void drawInventory(int start, int mode);
void addObjectToInventory(int object, int index);
+ void removeInventoryEntry(int index);
void removeObjectFromInventory(int index);
int getObjectFromInventory(int x) const;
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 3008d9db0ed..0504596ec52 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -30,12 +30,12 @@ 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();
+ PART_12_ACTION_goToPath();
break;
- case 102:
+ case 102: // look at portal
igorSay(201, 1, 789);
break;
- case 103:
+ case 103: // look at stone
if (_objectsState[44] == 0) {
ADD_DIALOGUE_TEXT(203, 2, 790);
} else {
@@ -45,19 +45,19 @@ void IgorEngine::PART_12_EXEC_ACTION(int action) {
startIgorDialogue();
break;
case 104:
- PART_12_ACTION_104();
+ PART_12_ACTION_104_tryEnterChurch();
break;
case 105:
- PART_12_ACTION_105();
+ PART_12_ACTION_105_useResinWithStone();
break;
- case 106:
+ case 106: // look at door
igorSay(207, 2, 793);
break;
- case 107:
+ case 107: // close door
igorSay(206, 1, 792);
break;
case 108:
- PART_12_ACTION_108();
+ PART_12_ACTION_108_enterChurch();
break;
default:
error("PART_12_EXEC_ACTION unhandled action %d", action);
@@ -65,7 +65,7 @@ void IgorEngine::PART_12_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_12_ACTION_101() {
+void IgorEngine::PART_12_ACTION_goToPath() {
for (int i = 9; i <= 10; ++i) {
_roomObjectAreasTable[i].area = 3;
}
@@ -99,15 +99,17 @@ void IgorEngine::PART_12_ACTION_101() {
_currentPart = 40;
}
-void IgorEngine::PART_12_ACTION_104() {
+void IgorEngine::PART_12_ACTION_104_tryEnterChurch() {
_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);
+ // dor opening
playSound(13, 1);
_walkDataCurrentIndex = _walkDataLastIndex;
const uint8 *src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA444) - 1;
@@ -138,7 +140,7 @@ void IgorEngine::PART_12_ACTION_104() {
decodeAnimFrame(src, _screenVGA);
decodeAnimFrame(src, _screenLayer1);
moveIgor(4, 0);
- PART_12_HANDLE_DIALOGUE_CHURCHMAN();
+ PART_12_HANDLE_DIALOGUE_PRIEST();
for (int i = 4; i >= 1; --i) {
src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + i * 2) - 1;
decodeAnimFrame(src, _screenVGA);
@@ -150,23 +152,18 @@ void IgorEngine::PART_12_ACTION_104() {
}
src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA440) - 1;
decodeAnimFrame(src, _screenLayer1);
- PART_12_HELPER_1(255);
+ PART_12_OBJECT_STATE(255);
}
-void IgorEngine::PART_12_ACTION_105() {
+void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
if (_objectsState[44] == 1) {
- ADD_DIALOGUE_TEXT(219, 1, 801); // cseg171:09A1-09C4
+ ADD_DIALOGUE_TEXT(219, 1, 801);
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];
- }
+ removeInventoryEntry(62);
const int animOffset = (_objectsState[45] == 0) ? 0x2543 : 0xBF1E;
for (int i = 1; i <= 9; ++i) {
const int offset = 30149;
@@ -244,13 +241,13 @@ void IgorEngine::PART_12_ACTION_105() {
_currentAction.verb = kVerbWalk;
addObjectToInventory(24, 59);
_objectsState[44] = 1;
- PART_12_HELPER_1(255);
+ PART_12_OBJECT_STATE(255);
ADD_DIALOGUE_TEXT(211, 1, 795); // cseg171:0EBF-0EDB
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
-void IgorEngine::PART_12_ACTION_108() {
+void IgorEngine::PART_12_ACTION_108_enterChurch() {
_walkCurrentFrame = 2;
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[28555]].area = _roomObjectAreasTable[_screenLayer2[34686]].area;
@@ -301,7 +298,7 @@ void IgorEngine::PART_12_UPDATE_ROOM_BACKGROUND() {
}
}
-void IgorEngine::PART_12_UPDATE_DIALOGUE_CHURCHMAN(int action) {
+void IgorEngine::PART_12_UPDATE_DIALOGUE_PRIEST(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
PART_12_HELPER_8();
@@ -315,14 +312,14 @@ void IgorEngine::PART_12_UPDATE_DIALOGUE_CHURCHMAN(int action) {
}
}
-void IgorEngine::PART_12_HANDLE_DIALOGUE_CHURCHMAN() {
+void IgorEngine::PART_12_HANDLE_DIALOGUE_PRIEST() {
loadDialogueData(DLG_OutsideChurch);
- _updateDialogue = &IgorEngine::PART_12_UPDATE_DIALOGUE_CHURCHMAN;
+ _updateDialogue = &IgorEngine::PART_12_UPDATE_DIALOGUE_PRIEST;
handleDialogue(95, 55, 51, 28, 63);
_updateDialogue = 0;
}
-void IgorEngine::PART_12_HELPER_1(int num) {
+void IgorEngine::PART_12_OBJECT_STATE(int num) {
if (num == 2 || num == 255) {
if (_objectsState[45] == 0) {
_roomActionsTable[169] = 104;
@@ -365,11 +362,11 @@ void IgorEngine::PART_12_HELPER_2() {
}
}
-void IgorEngine::PART_12_HELPER_3() {
+void IgorEngine::PART_12_HELPER_3_paintOverLizard() {
decodeAnimFrame(_animFramesBuffer, _screenVGA, true);
}
-void IgorEngine::PART_12_HELPER_4() {
+void IgorEngine::PART_12_HELPER_4_exorcismCutscene() {
SET_PAL_240_48_1();
SET_PAL_208_96_1();
fadeIn(768);
@@ -390,7 +387,7 @@ void IgorEngine::PART_12_HELPER_4() {
waitForTimer(30);
}
}
- cutsceneSayWithCallback(95, 55, 51, 28, 63, { { 212, 2, 796 }, { 214, 1, 797 }, { 215, 1, 798 } }, &IgorEngine::PART_12_UPDATE_DIALOGUE_CHURCHMAN);
+ cutsceneSayWithCallback(95, 55, 51, 28, 63, { { 212, 2, 796 }, { 214, 1, 797 }, { 215, 1, 798 } }, &IgorEngine::PART_12_UPDATE_DIALOGUE_PRIEST);
for (int i = 12; i <= 29; ++i){
const uint8 *src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + i * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
@@ -448,7 +445,7 @@ void IgorEngine::PART_12_HELPER_5() {
}
void IgorEngine::PART_12_HELPER_6() {
- PART_12_HELPER_1(255);
+ PART_12_OBJECT_STATE(255);
_walkData[0].setPos(75, 89, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
@@ -501,20 +498,28 @@ 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 };
+ 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);
+ PART_12_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (_objectsState[44] == 0) {
- PART_12_HELPER_3();
+ PART_12_HELPER_3_paintOverLizard();
}
if (_currentPart == 122 && !_gameStateLoaded) {
- PART_12_HELPER_4();
+ PART_12_HELPER_4_exorcismCutscene();
return;
}
if (!restoreRoomAfterLoad()) {
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 7001216fcaf..73b76495d3e 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -324,11 +324,7 @@ void IgorEngine::PART_68_ACTION_108_giveObject() {
waitForTimer(30);
drawAnimRect(kPart68GiveOffset, kPart68GiveFramesOffset, kPart68GiveWidth, kPart68GiveHeight);
if (_inventoryInfo[kPart68GiveInventoryIndex] != 0) {
- _inventoryInfo[_inventoryInfo[kPart68GiveInventoryIndex] - 1] = 0;
- _inventoryInfo[kPart68GiveInventoryIndex] = 0;
- packInventory();
- if (_inventoryInfo[72] > _inventoryInfo[73])
- _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
+ removeInventoryEntry(kPart68GiveInventoryIndex);
drawInventory(_inventoryInfo[72], 0);
}
playSound(63, 1);
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index f57f0a87ecb..04f24d7d908 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -271,11 +271,7 @@ void IgorEngine::giveBottleToDean() {
if (_inventoryInfo[58] != 0) {
- _inventoryInfo[_inventoryInfo[58] - 1] = 0;
- _inventoryInfo[58] = 0;
- packInventory();
- if (_inventoryInfo[72] > _inventoryInfo[73])
- _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
+ removeInventoryEntry(58);
drawInventory(_inventoryInfo[72], 0);
}
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index c664fabc7da..51fadd7d902 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -335,11 +335,7 @@ void IgorEngine::PART_81_ACTION_109() {
// the object that Igor brought is given
if (_inventoryInfo[kPart81InventoryState] != 0) {
- _inventoryInfo[_inventoryInfo[kPart81InventoryState] - 1] = 0;
- _inventoryInfo[kPart81InventoryState] = 0;
- packInventory();
- if (_inventoryInfo[72] > _inventoryInfo[73])
- _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
+ removeInventoryEntry(kPart81InventoryState);
}
PART_81_NPC_SAY({ { 210, 1, 954 }, { 211, 1, 955 } });
PART_81_IGOR_SAY(212, 1, 956);
Commit: f53bb8d94583ab15e5b62cd068fdc89331e09ab3
https://github.com/scummvm/scummvm/commit/f53bb8d94583ab15e5b62cd068fdc89331e09ab3
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:36+01:00
Commit Message:
IGOR: Implements part 69
Changed paths:
A engines/igor/parts/part_69.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 3be55d1a298..914b39c55b2 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -162,6 +162,9 @@ void IgorEngine::restart() {
_part07FirstVisitDone = false; // cseg197:0795-0845; original global s3:0xED2E
_roomAmbientIndex = 0;
_part68QuestionCounter = 1;
+ _part69FireflyFrameA = 0;
+ _part69FireflyFrameB = 0;
+ _part69FireflyStepCount = 0;
_part68LastDialogueCode = 0;
_part68NpcPresent = false;
_parkLadyIdleStep = 1;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 5b192828c4f..46f4f5d0220 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -527,6 +527,10 @@ private:
bool _part07FirstVisitDone;
// scratch of the room loops: the current ambient frame (a star in part 72, the screen in part 68)
uint8 _roomAmbientIndex;
+ // the two fireflies of room 69: the current frame of each and the steps of the first one since the second one started
+ uint8 _part69FireflyFrameA;
+ uint8 _part69FireflyFrameB;
+ uint16 _part69FireflyStepCount;
uint8 _part68QuestionCounter;
uint8 _part68LastDialogueCode;
bool _part68NpcPresent;
@@ -1118,6 +1122,17 @@ private:
void PART_50_UPDATE_ROOM_BACKGROUND();
void PART_50();
+ void PART_69_EXEC_ACTION(int action);
+ void PART_69_APPLY_OBJECT_STATE();
+ void PART_69_DRAW_FIREFLY_A(int frame);
+ void PART_69_DRAW_FIREFLY_B(int frame);
+ void PART_69_ANIMATE_FIREFLIES();
+ void PART_69_ACTION_107_watch();
+ void PART_69_FINALE(int num, int sound);
+ void PART_69_ENTER_FROM_RIGHT();
+ void PART_69_UPDATE_ROOM_BACKGROUND();
+ void PART_69();
+
void PART_70_EXEC_ACTION(int action);
void PART_70_DRAW_OBJECT_STATE();
void PART_70_UPDATE_ROOM_BACKGROUND();
@@ -1469,6 +1484,7 @@ protected:
static const RoomDataOffsets PART_37_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_50_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_68_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_69_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_70_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_71_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_72_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 7174fe90e56..f4a573093ca 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -51,6 +51,7 @@ MODULE_OBJS = \
parts/part_37.o \
parts/part_50.o \
parts/part_68.o \
+ parts/part_69.o \
parts/part_70.o \
parts/part_71.o \
parts/part_72.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 8d6e2c753ee..723dbbb174d 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -665,6 +665,9 @@ void IgorEngine::PART_MAIN() {
case 681:
PART_68();
break;
+ case 690:
+ PART_69();
+ break;
case 700:
PART_70();
break;
diff --git a/engines/igor/parts/part_69.cpp b/engines/igor/parts/part_69.cpp
new file mode 100644
index 00000000000..6ac97b25142
--- /dev/null
+++ b/engines/igor/parts/part_69.cpp
@@ -0,0 +1,342 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// The animation resource is made of several blocks, each one a table of frame offsets and the frames it points to:
+// the first and the second firefly of the room, the transformation and the ending.
+static const int kPart69FireflyAFramesBase = 0;
+static const int kPart69FireflyAFramesTable = 0xB138;
+static const int kPart69FireflyBFramesBase = 0xB200;
+static const int kPart69FireflyBFramesTable = 0xBBA;
+static const int kPart69FramesCBase = 0xBE3A;
+static const int kPart69FramesCTable = 0x3FF;
+static const int kPart69FramesDBase = 0xC265;
+static const int kPart69FramesDTable = 0x179C;
+static const int kPart69PictureAnimOffset = 0xDA1F;
+static const int kPart69PictureOffset = 69 * 320 + 148;
+static const int kPart69PictureWidth = 27;
+static const int kPart69PictureHeight = 49;
+
+// The walk-in: Igor comes from the right edge.
+static const int kPart69EntryY = 130;
+static const int kPart69EntryDstX = 259;
+
+// objectsState
+static const int kPart69SceneDoneState = 96;
+static const int kPart69FlagState = 97;
+static const int kPart69SequenceState = 98;
+static const int kPart69SecondFireflyState = 99;
+static const int kPart69RewardState = 6;
+
+// The animation of the two fireflies is a sequence of steps (1 to 6). Each step plays the frames of the first firefly from
+// the first to the last frame of the step; every 5 steps of the first firefly the second firefly plays too. The values come
+// from the data segment of the executable (index 0 is not used).
+static const uint8 kPart69StepFirstFireflyFrameA[7] = { 37, 71, 1, 41, 0, 80, 20 };
+static const uint8 kPart69StepLastFireflyFrameA[7] = { 0, 80, 20, 50, 100, 40, 70 };
+static const uint8 kPart69StepNext[7] = { 70, 1, 2, 3, 2, 3, 1 };
+static const uint8 kPart69StepFirstFireflyFrameB[4] = { 1, 41, 1, 21 };
+static const uint8 kPart69StepLastFireflyFrameB[4] = { 0, 64, 20, 40 };
+// The areas that answer to the step, and the areas of the second firefly.
+static const uint8 kPart69StepAreas[4] = { 0, 1, 52, 16 };
+static const uint8 kPart69SecondFireflyAreas[4] = { 0, 2, 72, 45 };
+
+static const int kPart69FirstFireflyFrameA = 71;
+static const int kPart69FirstFireflyFrameB = 40;
+static const int kPart69TalkFrameFirst = 0x29;
+static const int kPart69TalkFrameLast = 0x32;
+static const int kPart69TransformFrameLast = 0x16;
+static const int kPart69EndingFrameFirst = 1;
+static const int kPart69EndingFrameLast = 0xE;
+
+void IgorEngine::PART_69_EXEC_ACTION(int action) {
+ switch (action) {
+ case 101:
+ _currentPart = 721;
+ break;
+ case 102:
+ igorSay(201, 2, 1084);
+ break;
+ case 103:
+ igorSay({ { 203, 2, 1085 }, { 205, 1, 1086 } });
+ _objectsState[kPart69FlagState] = 1;
+ break;
+ case 104:
+ igorSay(206, 2, 1087);
+ break;
+ case 105:
+ igorSay(208, 2, 1088);
+ break;
+ case 106:
+ igorSay(210, 1, 1089);
+ break;
+ case 107:
+ PART_69_ACTION_107_watch();
+ break;
+ case 108:
+ igorSay(215, 2, 1092);
+ break;
+ default:
+ error("PART_69_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+/**
+ * Once the scene is over the places of the fireflies are not objects anymore.
+ */
+void IgorEngine::PART_69_APPLY_OBJECT_STATE() {
+ if (_objectsState[kPart69SceneDoneState] != 1) {
+ return;
+ }
+ for (int i = 1; i <= 3; ++i) {
+ _roomObjectAreasTable[kPart69StepAreas[i]].object = 0;
+ _roomObjectAreasTable[kPart69SecondFireflyAreas[i]].object = 5;
+ }
+ for (int i = 0; i <= 5; ++i) {
+ if (_roomActionsTable[72 + i] == 1) {
+ _roomActionsTable[72 + i] = 0;
+ }
+ }
+}
+
+void IgorEngine::PART_69_DRAW_FIREFLY_A(int frame) {
+ decodeAnimFrame(getAnimFrame(kPart69FireflyAFramesBase, kPart69FireflyAFramesTable, frame), _screenVGA, true);
+}
+
+void IgorEngine::PART_69_DRAW_FIREFLY_B(int frame) {
+ decodeAnimFrame(getAnimFrame(kPart69FireflyBFramesBase, kPart69FireflyBFramesTable, frame), _screenVGA, true);
+}
+
+/**
+ * Runs the sequence of the two fireflies, one frame of each every 16 ticks, and sets which places answer to the
+ * fireflies.
+ */
+void IgorEngine::PART_69_ANIMATE_FIREFLIES() {
+ if (!compareGameTick(13, 16)) {
+ return;
+ }
+ if (_objectsState[kPart69SceneDoneState] != 0) {
+ return;
+ }
+ uint8 &sequence = _objectsState[kPart69SequenceState];
+ uint8 &secondFirefly = _objectsState[kPart69SecondFireflyState];
+ if (_part69FireflyStepCount == 5) {
+ secondFirefly = sequence;
+ _part69FireflyFrameB = kPart69StepFirstFireflyFrameB[secondFirefly];
+ _part69FireflyStepCount = 0;
+ }
+ if (secondFirefly > 0) {
+ PART_69_DRAW_FIREFLY_B(_part69FireflyFrameB);
+ if (kPart69StepLastFireflyFrameB[secondFirefly] == _part69FireflyFrameB) {
+ secondFirefly = 0;
+ sequence += 3;
+ } else {
+ ++_part69FireflyFrameB;
+ }
+ }
+ PART_69_DRAW_FIREFLY_A(_part69FireflyFrameA);
+ if (kPart69StepLastFireflyFrameA[sequence] == _part69FireflyFrameA) {
+ if (sequence > 3) {
+ sequence = kPart69StepNext[sequence];
+ }
+ _part69FireflyFrameA = kPart69StepFirstFireflyFrameA[sequence];
+ ++_part69FireflyStepCount;
+ } else {
+ ++_part69FireflyFrameA;
+ }
+
+ if (sequence > 3) {
+ for (int i = 1; i <= 3; ++i) {
+ _roomObjectAreasTable[kPart69StepAreas[i]].object = 0;
+ }
+ } else {
+ for (int i = 1; i <= 3; ++i) {
+ _roomObjectAreasTable[kPart69StepAreas[i]].object = sequence == i ? 3 : 0;
+ }
+ }
+ if (secondFirefly > 0) {
+ for (int i = 1; i <= 3; ++i) {
+ _roomObjectAreasTable[kPart69SecondFireflyAreas[i]].object = 5;
+ }
+ } else {
+ for (int i = 1; i <= 3; ++i) {
+ const bool answers = kPart69StepNext[sequence] == i && _objectsState[kPart69FlagState] == 1;
+ _roomObjectAreasTable[kPart69SecondFireflyAreas[i]].object = answers ? 4 : 5;
+ }
+ }
+}
+
+/**
+ * The end of the scene: the last frames of the ending and what Igor says.
+ */
+void IgorEngine::PART_69_FINALE(int num, int sound) {
+ for (int frame = kPart69EndingFrameLast; frame <= kPart69EndingFrameLast + 1; ++frame) {
+ decodeAnimFrame(getAnimFrame(kPart69FramesDBase, kPart69FramesDTable, frame), _screenVGA, true);
+ waitForTimer(46);
+ }
+ igorSay(num, 2, sound);
+}
+
+/**
+ * Igor watches the fireflies. If the reward has not been given yet nothing happens for a while; otherwise the first
+ * firefly transforms and the scene ends.
+ */
+void IgorEngine::PART_69_ACTION_107_watch() {
+ drawAnimRect(kPart69PictureOffset, kPart69PictureAnimOffset, kPart69PictureWidth, kPart69PictureHeight);
+ if (_objectsState[kPart69RewardState] == 0) {
+ for (int i = 0; i < 1000 / kTimerTicksCount && !_eventQuitGame; ++i) {
+ PART_69_ANIMATE_FIREFLIES();
+ waitForTimer();
+ }
+ PART_69_FINALE(211, 1090);
+ return;
+ }
+
+ do {
+ PART_69_ANIMATE_FIREFLIES();
+ waitForTimer();
+ } while (!(_objectsState[kPart69SequenceState] == 3 && _objectsState[kPart69SecondFireflyState] == 0) && !_eventQuitGame);
+
+ uint8 frameC = 1;
+ do {
+ if (compareGameTick(13, 16)) {
+ PART_69_DRAW_FIREFLY_A(_part69FireflyFrameA);
+ _part69FireflyFrameA = _part69FireflyFrameA == kPart69TalkFrameLast ? kPart69TalkFrameFirst : _part69FireflyFrameA + 1;
+ decodeAnimFrame(getAnimFrame(kPart69FramesCBase, kPart69FramesCTable, frameC), _screenVGA, true);
+ if (frameC < kPart69TransformFrameLast) {
+ ++frameC;
+ }
+ }
+ waitForTimer();
+ } while (!(frameC == kPart69TransformFrameLast && _part69FireflyFrameA == kPart69TalkFrameFirst) && !_eventQuitGame);
+
+ _part69FireflyFrameA = kPart69EndingFrameFirst;
+ do {
+ if (compareGameTick(13, 16)) {
+ decodeAnimFrame(getAnimFrame(kPart69FramesDBase, kPart69FramesDTable, _part69FireflyFrameA), _screenVGA, true);
+ ++_part69FireflyFrameA;
+ }
+ waitForTimer();
+ } while (_part69FireflyFrameA != kPart69EndingFrameLast && !_eventQuitGame);
+
+ waitForTimer(255);
+ _objectsState[kPart69SceneDoneState] = 1;
+ _objectsState[kPart69RewardState] = 2;
+ UPDATE_OBJECT_STATE(7);
+ drawInventory(_inventoryInfo[72], 0);
+ playSound(63, 1);
+ while (_mixer->isSoundHandleActive(_sfxHandle) && !_eventQuitGame) {
+ waitForTimer(1);
+ }
+ playSound(51, 1);
+ PART_69_APPLY_OBJECT_STATE();
+ PART_69_FINALE(213, 1091);
+}
+
+/**
+ * Igor comes from the right edge, walking to the left, while the fireflies move.
+ */
+void IgorEngine::PART_69_ENTER_FROM_RIGHT() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(319, kPart69EntryY, kFacingPositionLeft, 0);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 15;
+ wd->scaleWidth = 50;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 50;
+ _walkDataLastIndex = 0;
+ _walkDataCurrentIndex = 1;
+ buildWalkPath(319, kPart69EntryY, kPart69EntryDstX, kPart69EntryY);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ waitForIgorMove(&IgorEngine::PART_69_ANIMATE_FIREFLIES);
+}
+
+void IgorEngine::PART_69_UPDATE_ROOM_BACKGROUND() {
+ if (compareGameTick(1)) {
+ if (getRandomNumber(14) == 0 && !isDialogueSpeechPlaying()) {
+ switch (getRandomNumber(2)) {
+ case 0:
+ playSound(36, 1);
+ break;
+ case 1:
+ playSound(37, 1);
+ break;
+ case 2:
+ playSound(38, 1);
+ break;
+ }
+ }
+ }
+ PART_69_ANIMATE_FIREFLIES();
+}
+
+void IgorEngine::PART_69() {
+ playMusic(4);
+ _gameState.enableLight = 2;
+ loadActionData(DAT_Part69);
+ loadRoomData(PAL_Part69, IMG_Part69, BOX_Part69, MSK_Part69, TXT_Part69);
+ // the colors of Igor
+ memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
+ SET_PAL_240_48_1();
+ static const int anim[] = { ANM_Part69, 0 };
+ loadAnimData(anim);
+ _roomDataOffsets = PART_69_ROOM_DATA_OFFSETS;
+ setRoomClickFix(130, 166, -1, false, 130);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_69_EXEC_ACTION);
+ _updateRoomBackground = &IgorEngine::PART_69_UPDATE_ROOM_BACKGROUND;
+ PART_69_APPLY_OBJECT_STATE();
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ if (_objectsState[kPart69SceneDoneState] == 0) {
+ PART_69_DRAW_FIREFLY_A(kPart69FirstFireflyFrameA);
+ PART_69_DRAW_FIREFLY_B(kPart69FirstFireflyFrameB);
+ }
+ _part69FireflyStepCount = 0;
+ _part69FireflyFrameB = 0;
+ _objectsState[kPart69SequenceState] = 1;
+ _objectsState[kPart69SecondFireflyState] = 0;
+ _part69FireflyFrameA = kPart69FirstFireflyFrameA;
+
+ // the whole picture is darker than its palette
+ darkenPalette(_paletteBuffer, 1, 175, 10);
+
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ PART_69_ENTER_FROM_RIGHT();
+ }
+ enterPartLoop();
+ while (_currentPart == 690 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ // the colors that changed are kept
+ memcpy(_paletteBuffer, _currentPalette, 624);
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index ea97b61e595..efe2a4427aa 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -741,4 +741,13 @@
#define MSK_Part71 1136
#define BOX_Part71 1137
+// State 690 (PART_69)
+#define DAT_Part69 1138
+#define ANM_Part69 1139
+#define TXT_Part69 1140
+#define IMG_Part69 1141
+#define PAL_Part69 1142
+#define MSK_Part69 1143
+#define BOX_Part69 1144
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index a7cda8b7975..2f8e470450e 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -464,6 +464,13 @@ const RoomDataOffsets IgorEngine::PART_50_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_69_ROOM_DATA_OFFSETS = {
+ { 45, 3, 6, 2 },
+ { 76, 87 },
+ { 91, 283, 3159, 175, 251, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_70_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 },
{ 3, 12 },
Commit: 7e0786c10b6466949a92feb67bdfe0fa5fde9fea
https://github.com/scummvm/scummvm/commit/7e0786c10b6466949a92feb67bdfe0fa5fde9fea
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:36+01:00
Commit Message:
IGOR: Rename of functions in part14
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_13.cpp
engines/igor/parts/part_14.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 46f4f5d0220..dcde16724e4 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -777,31 +777,31 @@ private:
// 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_ACTION_101_103_goToPlatform();
+ void PART_13_ACTION_104_exitChurch();
+ void PART_13_HELPER_OBJECT_STATE(int num);
+ void PART_13_HELPER_2_enterFromRight();
+ void PART_13_HELPER_3_enterFromBelow();
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_ACTION_101_goToChurchBell();
+ void PART_14_ACTION_103_lookAtPuzzle();
+ void PART_14_ACTION_105_goBackToChurch();
+ void PART_14_ACTION_106_enterMaze();
+ void PART_14_ACTION_108_useMatchesOnCandles();
+ void PART_14_HELPER_1_OBJECT_STATE(int num);
+ void PART_14_HELPER_2_enterFromChurch();
+ void PART_14_HELPER_3_enterFromChurchBell();
+ void PART_14_HELPER_4_enterFromMaze();
+ void PART_14_HELPER_6_drawEntrance();
+ void PART_14_HELPER_7_candleFlicker(int frame);
+ void PART_14_HELPER_8_brotherReveal(int start, int end);
+ void PART_14_HELPER_9_showPuzzle();
+ void PART_14_HELPER_10_loadChurchMosaicData();
+ void PART_14_pushStone(int screenOffset, int w, int h, int animOffset);
void PART_14();
void loadResourceData__ROOM_ChurchPuzzle();
void loadResourceData__ANIM_ChurchPuzzle();
diff --git a/engines/igor/parts/part_13.cpp b/engines/igor/parts/part_13.cpp
index d80ec3e6a72..cf2471af470 100644
--- a/engines/igor/parts/part_13.cpp
+++ b/engines/igor/parts/part_13.cpp
@@ -23,23 +23,22 @@
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();
+ case 101: // go to platform
+ PART_13_ACTION_101_103_goToPlatform();
break;
- case 102:
+ case 102: // look at stained glass
igorSay(201, 2, 858);
break;
- case 103:
- PART_13_ACTION_101_103();
+ case 103: // look at platform
+ PART_13_ACTION_101_103_goToPlatform();
break;
case 104:
- PART_13_ACTION_104();
+ PART_13_ACTION_104_exitChurch();
break;
- case 105:
+ case 105: // go to church puzzle
_currentPart = 140;
break;
default:
@@ -48,7 +47,7 @@ void IgorEngine::PART_13_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_13_ACTION_101_103() {
+void IgorEngine::PART_13_ACTION_101_103_goToPlatform() {
waitForTimer(255);
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
@@ -127,7 +126,7 @@ void IgorEngine::PART_13_ACTION_101_103() {
} while (_gameState.igorMoving);
}
-void IgorEngine::PART_13_ACTION_104() {
+void IgorEngine::PART_13_ACTION_104_exitChurch() {
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
for (int i = 9; i >= 0; --i) {
@@ -150,10 +149,10 @@ void IgorEngine::PART_13_ACTION_104() {
_currentPart = 121;
}
-void IgorEngine::PART_13_HELPER_1(int num) {
+void IgorEngine::PART_13_HELPER_OBJECT_STATE(int num) {
}
-void IgorEngine::PART_13_HELPER_2() {
+void IgorEngine::PART_13_HELPER_2_enterFromRight() {
WalkData *wd = &_walkData[0];
wd->setPos(314, 127, 4, 0);
wd->clipSkipX = 1;
@@ -172,8 +171,8 @@ void IgorEngine::PART_13_HELPER_2() {
waitForIgorMove();
}
-void IgorEngine::PART_13_HELPER_3() {
- PART_13_HELPER_1(255);
+void IgorEngine::PART_13_HELPER_3_enterFromBelow() {
+ PART_13_HELPER_OBJECT_STATE(255);
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
for (int i = 0; i <= 9; ++i) {
@@ -206,14 +205,14 @@ void IgorEngine::PART_13() {
_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);
+ PART_13_HELPER_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 130) {
- PART_13_HELPER_3();
+ PART_13_HELPER_3_enterFromBelow();
} else {
- PART_13_HELPER_2();
+ PART_13_HELPER_2_enterFromRight();
}
enterPartLoop();
while (_currentPart >= 130 && _currentPart <= 131) {
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index bef962c19ab..79bb7947aee 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -33,28 +33,28 @@ 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();
+ PART_14_ACTION_101_goToChurchBell();
break;
- case 102:
+ case 102: // look at stairs
igorSay(201, 1, 860);
break;
case 103:
- PART_14_ACTION_103();
+ PART_14_ACTION_103_lookAtPuzzle();
break;
- case 104:
+ case 104: // look at candles
igorSay(202, 1, 861);
break;
case 105:
- PART_14_ACTION_105();
+ PART_14_ACTION_105_goBackToChurch();
break;
case 106:
- PART_14_ACTION_106();
+ PART_14_ACTION_106_enterMaze();
break;
case 107:
igorSay(203, 1, 862);
break;
case 108:
- PART_14_ACTION_108();
+ PART_14_ACTION_108_useMatchesOnCandles();
break;
default:
error("PART_14_EXEC_ACTION unhandled action %d", action);
@@ -62,7 +62,7 @@ void IgorEngine::PART_14_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_14_ACTION_101() {
+void IgorEngine::PART_14_ACTION_101_goToChurchBell() {
_roomObjectAreasTable[_screenLayer2[22156]].area = 1;
_roomObjectAreasTable[_screenLayer2[27895]].area = 1;
--_walkDataLastIndex;
@@ -86,9 +86,9 @@ void IgorEngine::PART_14_ACTION_101() {
_currentPart = 220;
}
-void IgorEngine::PART_14_ACTION_103() {
+void IgorEngine::PART_14_ACTION_103_lookAtPuzzle() {
fadeOut(768);
- PART_14_HELPER_9();
+ PART_14_HELPER_9_showPuzzle();
loadResourceData__ROOM_ChurchPuzzle();
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
@@ -103,11 +103,11 @@ void IgorEngine::PART_14_ACTION_103() {
stopSound();
_objectsState[50] = 1;
}
- PART_14_HELPER_1(255);
+ PART_14_HELPER_1_OBJECT_STATE(255);
_currentPart = 140;
}
-void IgorEngine::PART_14_ACTION_105() {
+void IgorEngine::PART_14_ACTION_105_goBackToChurch() {
_walkDataCurrentIndex = 0;
for (int i = 9; i >= 0; --i) {
WalkData *wd = &_walkData[0];
@@ -130,7 +130,7 @@ void IgorEngine::PART_14_ACTION_105() {
_currentPart = 131;
}
-void IgorEngine::PART_14_ACTION_106() {
+void IgorEngine::PART_14_ACTION_106_enterMaze() {
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[35684]].area = 2;
buildWalkPath(164, 126, 164, 111);
@@ -168,7 +168,8 @@ void IgorEngine::PART_14_ACTION_106() {
_currentPart = 670;
}
-void IgorEngine::PART_14_ACTION_108() {
+// cutscene where the brother gives us the papyrus
+void IgorEngine::PART_14_ACTION_108_useMatchesOnCandles() {
_gameState.unkF = false;
_updateRoomBackground = &IgorEngine::PART_14_UPDATE_ROOM_BACKGROUND_ACTION_108;
igorSayAndWait(226, 1, 880);
@@ -180,11 +181,11 @@ void IgorEngine::PART_14_ACTION_108() {
}
_gameState.unkF = true;
playSound(33, 1);
- PART_14_HELPER_8(4, 24);
+ PART_14_HELPER_8_brotherReveal(4, 24);
stopSound();
cutsceneSay(221, 85, 12, 33, 63, 205, 1, 864);
- PART_14_HELPER_8(25, 26);
- PART_14_HELPER_8(60, 60);
+ PART_14_HELPER_8_brotherReveal(25, 26);
+ PART_14_HELPER_8_brotherReveal(60, 60);
WalkData *wd = &_walkData[_walkDataLastIndex - 1];
wd->x = 250;
wd->y = 138;
@@ -201,27 +202,27 @@ void IgorEngine::PART_14_ACTION_108() {
addObjectToInventory(28, 63);
igorSayAndWait({ { 217, 1, 872 }, { 218, 1, 873 }, { 219, 1, 874 } });
cutsceneSay(221, 85, 12, 33, 63, 220, 2, 875);
- PART_14_HELPER_7(0);
+ PART_14_HELPER_7_candleFlicker(0);
_gameState.unkF = false;
_screenVGA[32865] = _screenLayer1[32865];
playSound(33, 1);
- PART_14_HELPER_8(36, 60);
+ PART_14_HELPER_8_brotherReveal(36, 60);
stopSound();
igorSayAndWait({ { 222, 1, 876 }, { 223, 1, 877 }, { 224, 1, 878 }, { 225, 1, 879 } });
- PART_14_HELPER_1(255);
+ PART_14_HELPER_1_OBJECT_STATE(255);
_updateRoomBackground = 0;
}
void IgorEngine::PART_14_UPDATE_ROOM_BACKGROUND_ACTION_108() {
if (compareGameTick(2, 16) && _gameState.unkF) {
- PART_14_HELPER_7(getRandomNumber(1) + 1);
+ PART_14_HELPER_7_candleFlicker(getRandomNumber(1) + 1);
}
}
-void IgorEngine::PART_14_HELPER_1(int num) {
+void IgorEngine::PART_14_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
if (_objectsState[50] == 1) {
- PART_14_HELPER_6();
+ PART_14_HELPER_6_drawEntrance();
_roomObjectAreasTable[3].object = 5;
_roomObjectAreasTable[4].object = 5;
_roomObjectAreasTable[7].object = 5;
@@ -235,7 +236,7 @@ void IgorEngine::PART_14_HELPER_1(int num) {
}
}
-void IgorEngine::PART_14_HELPER_2() {
+void IgorEngine::PART_14_HELPER_2_enterFromChurch() {
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
for (int i = 0; i <= 9; ++i) {
@@ -265,7 +266,7 @@ void IgorEngine::PART_14_HELPER_2() {
waitForIgorMove();
}
-void IgorEngine::PART_14_HELPER_3() {
+void IgorEngine::PART_14_HELPER_3_enterFromChurchBell() {
for (int i = 192 * 3; i <= 207 * 3; ++i) {
if (_paletteBuffer[i] > 5) {
_currentPalette[i] -= 5;
@@ -305,8 +306,8 @@ void IgorEngine::PART_14_HELPER_3() {
_roomObjectAreasTable[_screenLayer2[27895]].area = 0;
}
-void IgorEngine::PART_14_HELPER_4() {
- PART_14_HELPER_1(255);
+void IgorEngine::PART_14_HELPER_4_enterFromMaze() {
+ PART_14_HELPER_1_OBJECT_STATE(255);
for (int i = 192 * 3; i <= 207 * 3; ++i) {
if (_paletteBuffer[i] > 5) {
_currentPalette[i] -= 5;
@@ -350,19 +351,19 @@ void IgorEngine::PART_14_HELPER_4() {
waitForIgorMove();
}
-void IgorEngine::PART_14_HELPER_6() {
+void IgorEngine::PART_14_HELPER_6_drawEntrance() {
const int offset = 18382;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xD5BA, 44, 44, 66);
}
-void IgorEngine::PART_14_HELPER_7(int frame) {
+void IgorEngine::PART_14_HELPER_7_candleFlicker(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) {
+void IgorEngine::PART_14_HELPER_8_brotherReveal(int start, int end) {
_gameState.counter[0] = start - 1;
do {
if (compareGameTick(1, 16)) {
@@ -371,14 +372,14 @@ void IgorEngine::PART_14_HELPER_8(int start, int end) {
decodeAnimFrame(src, _screenVGA, true);
}
if (compareGameTick(2, 16) && _gameState.unkF) {
- PART_14_HELPER_7(getRandomNumber(1) + 1);
+ PART_14_HELPER_7_candleFlicker(getRandomNumber(1) + 1);
}
waitForTimer();
} while (_gameState.counter[0] != end);
}
-void IgorEngine::PART_14_HELPER_9() {
- PART_14_HELPER_10();
+void IgorEngine::PART_14_HELPER_9_showPuzzle() {
+ PART_14_HELPER_10_loadChurchMosaicData();
memcpy(_screenTextLayer, _screenVGA, 46080);
memcpy(_screenVGA, _screenLayer1, 46080);
memcpy(_screenLayer1, _screenTextLayer, 46080);
@@ -392,7 +393,8 @@ void IgorEngine::PART_14_HELPER_9() {
_dialogueEnded = false;
VAR_CURRENT_CHURCH_MOSAIC_STONE = 255;
do {
- int area = _screenLayer2[_inputVars[kInputCursorYPos] * 320 + _inputVars[kInputCursorXPos]];
+ // the region mask only covers the room area; below it (verbs panel) there is no region
+ int area = _inputVars[kInputCursorYPos] < 144 ? _screenLayer2[_inputVars[kInputCursorYPos] * 320 + _inputVars[kInputCursorXPos]] : 0;
if (area == 0) {
VAR_NEW_CHURCH_MOSAIC_STONE = 1;
} else if (area >= 1 && area <= 8) {
@@ -426,28 +428,28 @@ void IgorEngine::PART_14_HELPER_9() {
playSound(34, 1);
switch (area) {
case 1:
- PART_14_PUSH_STONE(33359, 28, 34, 0);
+ PART_14_pushStone(33359, 28, 34, 0);
break;
case 2:
- PART_14_PUSH_STONE(22800, 27, 34, 0x3D4);
+ PART_14_pushStone(22800, 27, 34, 0x3D4);
break;
case 3:
- PART_14_PUSH_STONE(10642, 39, 45, 0x785);
+ PART_14_pushStone(10642, 39, 45, 0x785);
break;
case 4:
- PART_14_PUSH_STONE(3624, 56, 39, 0xCCFA);
+ PART_14_pushStone(3624, 56, 39, 0xCCFA);
break;
case 5:
- PART_14_PUSH_STONE(3679, 54, 38, 0xE87);
+ PART_14_pushStone(3679, 54, 38, 0xE87);
break;
case 6:
- PART_14_PUSH_STONE(11077, 35, 35, 0x1D8F);
+ PART_14_pushStone(11077, 35, 35, 0x1D8F);
break;
case 7:
- PART_14_PUSH_STONE(20688, 28, 36, 0x227B);
+ PART_14_pushStone(20688, 28, 36, 0x227B);
break;
case 8:
- PART_14_PUSH_STONE(31889, 27, 38, 0x2687);
+ PART_14_pushStone(31889, 27, 38, 0x2687);
break;
}
stopSound();
@@ -493,7 +495,7 @@ void IgorEngine::PART_14_HELPER_9() {
SET_PAL_208_96_1();
}
-void IgorEngine::PART_14_HELPER_10() {
+void IgorEngine::PART_14_HELPER_10_loadChurchMosaicData() {
loadData(PAL_ChurchMosaic, _paletteBuffer);
loadData(IMG_ChurchMosaic, _screenLayer1);
uint8 *p = loadData(MSK_ChurchMosaic);
@@ -501,7 +503,7 @@ void IgorEngine::PART_14_HELPER_10() {
free(p);
}
-void IgorEngine::PART_14_PUSH_STONE(int screenOffset, int w, int h, int animOffset) {
+void IgorEngine::PART_14_pushStone(int screenOffset, int w, int h, int animOffset) {
for (int i = 0; i <= h; ++i) {
memcpy(_screenTempLayer + i * 100, _screenVGA + i * 320 + screenOffset, w);
memcpy(_screenVGA + i * 320 + screenOffset, _animFramesBuffer + animOffset + i * w, w);
@@ -521,18 +523,18 @@ void IgorEngine::PART_14() {
_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);
+ PART_14_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 140) {
- PART_14_HELPER_2();
+ PART_14_HELPER_2_enterFromChurch();
}
if (_currentPart == 141) {
- PART_14_HELPER_3();
+ PART_14_HELPER_3_enterFromChurchBell();
}
if (_currentPart == 142) {
- PART_14_HELPER_4();
+ PART_14_HELPER_4_enterFromMaze();
}
enterPartLoop();
while (_currentPart >= 140 && _currentPart <= 142) {
Commit: c64f02698b2d9bc1fd5ce2edbcf3e5ea65ee5c8a
https://github.com/scummvm/scummvm/commit/c64f02698b2d9bc1fd5ce2edbcf3e5ea65ee5c8a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:37+01:00
Commit Message:
IGOR: Fix cuckoo animation in part 15
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_15.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index dcde16724e4..b66b4184104 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -808,22 +808,22 @@ private:
// 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_ACTION_101_leaveRoom();
+ void PART_15_ACTION_107_talkToTobias();
+ void PART_15_ACTION_115_giveProjectToTobias();
+ void PART_15_ACTION_116_giveMoneyToTobias();
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_HELPER_1_OBJECT_STATE(int num);
+ void PART_15_HELPER_2_walkIn();
+ void PART_15_HELPER_3_updateCuckooClock();
+ void PART_15_waitForCuckooClock();
+ void PART_15_HELPER_5_animateTobiasIdle();
+ void PART_15_HELPER_6_drawCuckooFrame(int frame);
+ void PART_15_HELPER_7_drawIgorAndTobiasScene(int frame);
+ void PART_15_HELPER_8_drawTobiasTalking(int frame);
+ void PART_15_PART_15_HELPER_9_drawTobiasIdleFrame(int frame);
void PART_15();
// laboratory
diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp
index 3d135c007da..b8ddc191c92 100644
--- a/engines/igor/parts/part_15.cpp
+++ b/engines/igor/parts/part_15.cpp
@@ -37,39 +37,39 @@ static const uint8 PART_15_ANIM_DATA_5[12] = { 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1,
void IgorEngine::PART_15_EXEC_ACTION(int action) {
switch (action) {
case 101:
- PART_15_ACTION_101();
+ PART_15_ACTION_101_leaveRoom();
break;
- case 102:
+ case 102: // look at door
igorSay(204, 1, 324);
break;
- case 103:
+ case 103: // take clock
igorSay(205, 2, 325);
break;
- case 104:
+ case 104: // look at clock
igorSay(207, 1, 326);
break;
- case 105:
+ case 105: // open clock
igorSay(205, 2, 325);
break;
- case 106:
+ case 106: // close clock
igorSay(205, 2, 325);
break;
case 107:
- PART_15_ACTION_107();
+ PART_15_ACTION_107_talkToTobias();
break;
- case 108:
+ case 108: // Take tobias
igorSay(208, 1, 327);
break;
- case 109:
+ case 109: // look at Tobias
igorSay({ { 201, 1, 322 }, { 202, 2, 323 } });
break;
- case 110:
+ case 110: // use Tobias
igorSay(234, 1, 345);
break;
- case 111:
+ case 111: // take keys
igorSay({ { 235, 1, 346 }, { 236, 1, 347 } });
break;
- case 112:
+ case 112: // look at keys
igorSay(237, 2, 348);
break;
case 113:
@@ -79,10 +79,10 @@ void IgorEngine::PART_15_EXEC_ACTION(int action) {
igorSay(240, 1, 350);
break;
case 115:
- PART_15_ACTION_115();
+ PART_15_ACTION_115_giveProjectToTobias();
break;
case 116:
- PART_15_ACTION_116();
+ PART_15_ACTION_116_giveMoneyToTobias();
break;
default:
error("PART_15_EXEC_ACTION unhandled action %d", action);
@@ -90,7 +90,7 @@ void IgorEngine::PART_15_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_15_ACTION_101() {
+void IgorEngine::PART_15_ACTION_101_leaveRoom() {
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[34560]].area = 1;
buildWalkPathSimple(34, 108, 0, 108);
@@ -102,34 +102,24 @@ void IgorEngine::PART_15_ACTION_101() {
_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);
+void IgorEngine::PART_15_ACTION_107_talkToTobias() {
+ PART_15_waitForCuckooClock();
+ PART_15_HELPER_7_drawIgorAndTobiasScene(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);
+void IgorEngine::PART_15_ACTION_115_giveProjectToTobias() {
+ PART_15_waitForCuckooClock();
+ PART_15_HELPER_7_drawIgorAndTobiasScene(6);
igorSayAndWait({ { 209, 1, 328 }, { 210, 1, 329 } });
cutsceneSayWithCallback(133, 67, 0, 63, 19, 212, 1, 331, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
igorSayAndWait(213, 1, 332);
cutsceneSayWithCallback(133, 67, 0, 63, 19, 214, 1, 333, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
for (int i = 1; i <= 11; ++i) {
- PART_15_HELPER_9(PART_15_ANIM_DATA_3[i]);
+ PART_15_PART_15_HELPER_9_drawTobiasIdleFrame(PART_15_ANIM_DATA_3[i]);
waitForTimer(60);
}
- PART_15_HELPER_7(6);
+ PART_15_HELPER_7_drawIgorAndTobiasScene(6);
if (_objectsState[37] == 0) {
ADD_DIALOGUE_TEXT(215, 2, 334);
ADD_DIALOGUE_TEXT(217, 1, 335);
@@ -146,7 +136,7 @@ void IgorEngine::PART_15_ACTION_115() {
return;
}
for (int i = 1; i <= 7; ++i) {
- PART_15_HELPER_7(PART_15_ANIM_DATA_2[i]);
+ PART_15_HELPER_7_drawIgorAndTobiasScene(PART_15_ANIM_DATA_2[i]);
waitForTimer(40);
}
removeObjectFromInventory(70);
@@ -162,23 +152,18 @@ void IgorEngine::PART_15_ACTION_115() {
_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);
+void IgorEngine::PART_15_ACTION_116_giveMoneyToTobias() {
+ PART_15_waitForCuckooClock();
+ PART_15_HELPER_7_drawIgorAndTobiasScene(6);
igorSayAndWait({ { 209, 1, 328 }, { 211, 1, 330 } });
cutsceneSayWithCallback(133, 67, 0, 63, 19, 212, 1, 331, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
igorSayAndWait(213, 1, 332);
cutsceneSayWithCallback(133, 67, 0, 63, 19, 214, 1, 333, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
for (int i = 1; i <= 11; ++i) {
- PART_15_HELPER_9(PART_15_ANIM_DATA_5[i]);
+ PART_15_PART_15_HELPER_9_drawTobiasIdleFrame(PART_15_ANIM_DATA_5[i]);
waitForTimer(60);
}
- PART_15_HELPER_7(6);
+ PART_15_HELPER_7_drawIgorAndTobiasScene(6);
if (_objectsState[37] == 0) {
ADD_DIALOGUE_TEXT(215, 2, 334);
ADD_DIALOGUE_TEXT(217, 1, 335);
@@ -195,7 +180,7 @@ void IgorEngine::PART_15_ACTION_116() {
return;
}
for (int i = 1; i <= 7; ++i) {
- PART_15_HELPER_7(PART_15_ANIM_DATA_4[i]);
+ PART_15_HELPER_7_drawIgorAndTobiasScene(PART_15_ANIM_DATA_4[i]);
waitForTimer(40);
}
removeObjectFromInventory(60);
@@ -212,25 +197,25 @@ void IgorEngine::PART_15_ACTION_116() {
}
void IgorEngine::PART_15_UPDATE_ROOM_BACKGROUND() {
- PART_15_HELPER_5();
- if (_gameTicks == 38 || _gameTicks == 60) {
+ PART_15_HELPER_5_animateTobiasIdle();
+ if (compareGameTick(38) || compareGameTick(60)) {
if (_objectsState[48] != 1 && getRandomNumber(199) == 0 && _gameState.counter[3] == 0) {
_gameState.counter[3] = 1;
}
}
- PART_15_HELPER_3();
+ PART_15_HELPER_3_updateCuckooClock();
}
void IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_15_HELPER_8(0);
+ PART_15_HELPER_8_drawTobiasTalking(0);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_15_HELPER_8(getRandomNumber(4));
+ PART_15_HELPER_8_drawTobiasTalking(getRandomNumber(4));
break;
case kUpdateDialogueAnimStanding:
- PART_15_HELPER_8(0);
+ PART_15_HELPER_8_drawTobiasTalking(0);
break;
}
}
@@ -242,10 +227,10 @@ void IgorEngine::PART_15_HANDLE_DIALOGUE_TOBIAS() {
_updateDialogue = 0;
}
-void IgorEngine::PART_15_HELPER_1(int num) {
+void IgorEngine::PART_15_HELPER_1_OBJECT_STATE(int num) {
}
-void IgorEngine::PART_15_HELPER_2() {
+void IgorEngine::PART_15_HELPER_2_walkIn() {
_walkData[0].setPos(0, 108, 2, 0);
_walkData[0].clipSkipX = 1;
_walkData[0].clipWidth = 15;
@@ -265,7 +250,7 @@ void IgorEngine::PART_15_HELPER_2() {
waitForIgorMove();
}
-void IgorEngine::PART_15_HELPER_3() {
+void IgorEngine::PART_15_HELPER_3_updateCuckooClock() {
if (compareGameTick(38) || compareGameTick(60)) {
if (_objectsState[48] != 1 && _gameState.counter[3] == 1) {
if (_gameState.unk11 == 0) {
@@ -273,7 +258,7 @@ void IgorEngine::PART_15_HELPER_3() {
_objectsState[49] = 1;
_gameState.counter[3] = 0;
} else {
- PART_15_HELPER_6(_gameState.unk11);
+ PART_15_HELPER_6_drawCuckooFrame(_gameState.unk11);
}
if (_gameState.unk11 == 7) {
_objectsState[49] = 2;
@@ -301,10 +286,19 @@ void IgorEngine::PART_15_HELPER_3() {
}
}
-void IgorEngine::PART_15_HELPER_5() {
+void IgorEngine::PART_15_waitForCuckooClock() {
+ if (_gameState.counter[3] == 1) {
+ do {
+ PART_15_HELPER_3_updateCuckooClock();
+ waitForTimer();
+ } while (_gameState.counter[3] != 0);
+ }
+}
+
+void IgorEngine::PART_15_HELPER_5_animateTobiasIdle() {
if (compareGameTick(7) || compareGameTick(29) || compareGameTick(61)) {
if (_gameState.unk10 >= 3) {
- PART_15_HELPER_9(PART_15_ANIM_DATA_1[_gameState.unk10]);
+ PART_15_PART_15_HELPER_9_drawTobiasIdleFrame(PART_15_ANIM_DATA_1[_gameState.unk10]);
++_gameState.unk10;
if (_gameState.unk10 == 8) {
_gameState.unk10 = 1;
@@ -313,7 +307,7 @@ void IgorEngine::PART_15_HELPER_5() {
}
if (compareGameTick(5)) {
if (_gameState.unk10 >= 1 && _gameState.unk10 <= 2) {
- PART_15_HELPER_9(_gameState.unk10);
+ PART_15_PART_15_HELPER_9_drawTobiasIdleFrame(_gameState.unk10);
if (_gameState.unk10 == 1 && getRandomNumber(9) == 0) {
_gameState.unk10 = 2;
} else {
@@ -326,7 +320,7 @@ void IgorEngine::PART_15_HELPER_5() {
}
}
-void IgorEngine::PART_15_HELPER_6(int frame) {
+void IgorEngine::PART_15_HELPER_6_drawCuckooFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 17; ++i) {
for (int j = 0; j <= 52; ++j) {
@@ -349,17 +343,17 @@ void IgorEngine::PART_15_HELPER_6(int frame) {
}
}
-void IgorEngine::PART_15_HELPER_7(int frame) {
+void IgorEngine::PART_15_HELPER_7_drawIgorAndTobiasScene(int frame) {
int offset = 20887;
drawAnimRect(offset, 0x49A + frame * 2124, 59, 36);
}
-void IgorEngine::PART_15_HELPER_8(int frame) {
+void IgorEngine::PART_15_HELPER_8_drawTobiasTalking(int frame) {
int offset = 22847;
drawAnimRect(offset, 0x958 + frame * 182, 14, 13);
}
-void IgorEngine::PART_15_HELPER_9(int frame) {
+void IgorEngine::PART_15_PART_15_HELPER_9_drawTobiasIdleFrame(int frame) {
int offset = 22835;
drawAnimRect(offset, frame * 598, 26, 23);
}
@@ -375,7 +369,7 @@ void IgorEngine::PART_15() {
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);
+ PART_15_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
@@ -383,7 +377,7 @@ void IgorEngine::PART_15() {
_gameState.unk11 = 2;
_gameState.counter[3] = 0;
_gameState.counter[4] = 0;
- PART_15_HELPER_2();
+ PART_15_HELPER_2_walkIn();
enterPartLoop();
while (_currentPart == 150) {
runPartLoop();
Commit: f085b57468572f997168ae862bf991f77cbefb47
https://github.com/scummvm/scummvm/commit/f085b57468572f997168ae862bf991f77cbefb47
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:37+01:00
Commit Message:
IGOR: Renames in part12
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_12.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index b66b4184104..749b93a7f80 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -768,11 +768,11 @@ private:
void PART_12_HELPER_2();
void PART_12_HELPER_3_paintOverLizard();
void PART_12_HELPER_4_exorcismCutscene();
- 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_HELPER_5_enterFromPath();
+ void PART_12_HELPER_6_enterFromChurch();
+ void PART_12_HELPER_8_drawIdlePriest();
+ void PART_12_HELPER_9_drawEntrance();
+ void PART_12_HELPER_10_drawPriestTalkingFrame(int frame);
void PART_12();
// inside church
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 0504596ec52..8fc1eeb3491 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -301,13 +301,13 @@ void IgorEngine::PART_12_UPDATE_ROOM_BACKGROUND() {
void IgorEngine::PART_12_UPDATE_DIALOGUE_PRIEST(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_12_HELPER_8();
+ PART_12_HELPER_8_drawIdlePriest();
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_12_HELPER_10(6 + getRandomNumber(5));
+ PART_12_HELPER_10_drawPriestTalkingFrame(6 + getRandomNumber(5));
break;
case kUpdateDialogueAnimStanding:
- PART_12_HELPER_8();
+ PART_12_HELPER_8_drawIdlePriest();
break;
}
}
@@ -337,7 +337,7 @@ void IgorEngine::PART_12_OBJECT_STATE(int num) {
_roomActionsTable[186] = 3;
_roomActionsTable[188] = 3;
} else {
- PART_12_HELPER_9();
+ PART_12_HELPER_9_drawEntrance();
_roomActionsTable[169] = 108;
_roomActionsTable[175] = 106;
_roomActionsTable[177] = 2;
@@ -408,7 +408,7 @@ void IgorEngine::PART_12_HELPER_4_exorcismCutscene() {
_currentPart = 40;
}
-void IgorEngine::PART_12_HELPER_5() {
+void IgorEngine::PART_12_HELPER_5_enterFromPath() {
_walkData[0].setPos(196, 64, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
@@ -444,7 +444,7 @@ void IgorEngine::PART_12_HELPER_5() {
} while (_gameState.igorMoving || _gameState.unk10 != 11);
}
-void IgorEngine::PART_12_HELPER_6() {
+void IgorEngine::PART_12_HELPER_6_enterFromChurch() {
PART_12_OBJECT_STATE(255);
_walkData[0].setPos(75, 89, 2, 0);
_walkData[0].setDefaultScale();
@@ -480,15 +480,15 @@ void IgorEngine::PART_12_HELPER_6() {
} while (_gameState.igorMoving || _gameState.unk10 != 11);
}
-void IgorEngine::PART_12_HELPER_8() {
+void IgorEngine::PART_12_HELPER_8_drawIdlePriest() {
decodeAnimFrame(_animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA454) - 1, _screenVGA, true);
}
-void IgorEngine::PART_12_HELPER_9() {
+void IgorEngine::PART_12_HELPER_9_drawEntrance() {
decodeAnimFrame(_animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA442) - 1, _screenLayer1, true);
}
-void IgorEngine::PART_12_HELPER_10(int frame) {
+void IgorEngine::PART_12_HELPER_10_drawPriestTalkingFrame(int frame) {
decodeAnimFrame(_animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + frame * 2) - 1, _screenVGA, true);
}
@@ -526,10 +526,10 @@ void IgorEngine::PART_12() {
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 120) {
- PART_12_HELPER_5();
+ PART_12_HELPER_5_enterFromPath();
}
if (_currentPart == 121) {
- PART_12_HELPER_6();
+ PART_12_HELPER_6_enterFromChurch();
if (_objectsState[106] == 1) {
ADD_DIALOGUE_TEXT(216, 2, 799); // cseg171:3766-3772
ADD_DIALOGUE_TEXT(218, 1, 800); // cseg171:3778-3784
Commit: c9f603eb0164559e7f1c3f9b51ead83bbfa572e7
https://github.com/scummvm/scummvm/commit/c9f603eb0164559e7f1c3f9b51ead83bbfa572e7
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:37+01:00
Commit Message:
IGOR: Renames on parts 16,17,18,19
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_16.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_18.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_21.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 749b93a7f80..6aa8972cfee 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -539,7 +539,7 @@ private:
uint8 _inventoryInfo[74];
char _verbPrepositions[3][7];
char _roomObjectNames[20][MAX_OBJECT_NAME_LENGTH];
- char _globalObjectNames[35][MAX_OBJECT_NAME_LENGTH];
+ char _globalObjectNames[37][MAX_OBJECT_NAME_LENGTH];
char _verbsName[9][MAX_VERB_NAME_LENGTH];
uint8 _currentPalette[768];
@@ -828,14 +828,14 @@ private:
// laboratory
void PART_16_EXEC_ACTION(int action);
- void PART_16_ACTION_101();
+ void PART_16_ACTION_101_pickUpFlask();
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_1_OBJECT_STATE(int num);
+ void PART_16_HELPER_2_enterScene();
void PART_16_HELPER_3_photoCutscene();
void PART_16_HELPER_5_displayPhoto();
- void PART_16_HELPER_6(int frame);
+ void PART_16_HELPER_6_drawTalkingFrame(int frame);
void PART_16();
void loadResourceData__ROOM_Laboratory();
void loadResourceData__ANIM_Laboratory();
@@ -844,15 +844,15 @@ private:
void PART_17_EXEC_ACTION(int action);
void PART_17_ACTION_101_walkIn();
void PART_17_ACTION_103_talkPhilipJimmy();
- void PART_17_ACTION_105();
+ void PART_17_ACTION_105_leaveThroughPath();
void PART_17_ACTION_106_swapFolders();
void PART_17_HANDLE_DIALOGUE_PHILIP();
void PART_17_UPDATE_DIALOGUE_Jimmy(int action);
void PART_17_UPDATE_DIALOGUE_Philip(int action);
void PART_17_UPDATE_ROOM_BACKGROUND();
- void PART_17_HELPER_1(int num);
+ void PART_17_HELPER_1_OBJECT_STATE(int num);
void PART_17_HELPER_2_walkFromMap();
- void PART_17_HELPER_3(int lum);
+ void PART_17_HELPER_3_disableArea(int lum);
void PART_17_HELPER_4_paintFirsFrameOfPhilipAndJimmy();
void PART_17_HELPER_5_changeZindexOfPath(int lum);
void PART_17_HELPER_6_walkFromCollege();
@@ -865,8 +865,8 @@ private:
// men toilets
void PART_18_EXEC_ACTION(int action);
void PART_18_ACTION_109_useSlugOnGrating();
- void PART_18_ACTION_111();
- void PART_18_HELPER_1(int num);
+ void PART_18_ACTION_111_useBottleOnTap();
+ void PART_18_HELPER_1_OBJECT_STATE(int num);
void PART_18_HELPER_2_walkIn();
void PART_18();
void loadResourceData__ROOM_MenToilets();
@@ -874,15 +874,15 @@ private:
// women toilets
void PART_19_EXEC_ACTION(int action);
- void PART_19_ACTION_107();
- void PART_19_ACTION_109();
+ void PART_19_ACTION_107_lookAtSink();
+ void PART_19_ACTION_109_usePapyrusOnDryer();
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_1_OBJECT_STATE(int num);
void PART_19_HELPER_2_slugCutscene();
- void PART_19_HELPER_3();
- void PART_19_HELPER_4();
- void PART_19_HELPER_7(int frame);
+ void PART_19_HELPER_3_walkIn();
+ void PART_19_HELPER_4_enterAndLeave();
+ void PART_19_HELPER_7_drawTalkingFrame(int frame);
void PART_19();
// college corridor margaret
@@ -899,10 +899,10 @@ private:
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_1_OBJECT_STATE(int num);
+ void PART_21_HELPER_2_enterFromLeft();
+ void PART_21_HELPER_3_enterFromRight();
+ void PART_21_HELPER_4_enterFromPhysicsClass();
void PART_21_HELPER_5();
void PART_21_HELPER_6(int frame);
void PART_21_HELPER_7();
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index dadee26cb9d..5243528a5db 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -29,13 +29,13 @@ 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();
+ case 101: // pick up things
+ PART_16_ACTION_101_pickUpFlask();
break;
- case 102:
+ case 102: // look at things
igorSay(208, 2, 730);
break;
- case 103:
+ case 103: // exit
_currentPart = 261;
break;
default:
@@ -44,7 +44,7 @@ void IgorEngine::PART_16_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_16_ACTION_101() {
+void IgorEngine::PART_16_ACTION_101_pickUpFlask() {
if (_objectsState[52] == 1) {
igorSay(207, 1, 729);
return;
@@ -66,10 +66,10 @@ void IgorEngine::PART_16_ACTION_101() {
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);
+ PART_16_HELPER_6_drawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? 34 : 48);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_16_HELPER_6((VAR_CURRENT_TALKING_ACTOR == 0) ? getRandomNumber(4) + 30 : getRandomNumber(4) + 44);
+ PART_16_HELPER_6_drawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? getRandomNumber(4) + 30 : getRandomNumber(4) + 44);
break;
}
}
@@ -77,18 +77,18 @@ void IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET_HARRISON(int action) {
void IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_16_HELPER_6(49);
+ PART_16_HELPER_6_drawTalkingFrame(49);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_16_HELPER_6(getRandomNumber(3) + 49);
+ PART_16_HELPER_6_drawTalkingFrame(getRandomNumber(3) + 49);
break;
}
}
-void IgorEngine::PART_16_HELPER_1(int num) {
+void IgorEngine::PART_16_HELPER_1_OBJECT_STATE(int num) {
}
-void IgorEngine::PART_16_HELPER_2() {
+void IgorEngine::PART_16_HELPER_2_enterScene() {
WalkData *wd = &_walkData[0];
wd->setPos(0, 135, 2, 0);
wd->clipSkipX = 1;
@@ -148,7 +148,7 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
loadResourceData__ROOM_Laboratory();
loadResourceData__ANIM_Laboratory();
memcpy(_screenVGA, _screenLayer1, 46080);
- PART_16_HELPER_1(255);
+ PART_16_HELPER_1_OBJECT_STATE(255);
fadeIn(768);
waitForTimer(255);
for (int i = 1; i <= 29; ++i) {
@@ -185,7 +185,7 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
for (int i = 1; i <= 3; ++i) {
waitForTimer(255);
}
- PART_16_HELPER_1(255);
+ PART_16_HELPER_1_OBJECT_STATE(255);
// Data-only inventory update: the panel is redrawn later together with the verbs
++_inventoryInfo[73];
_inventoryInfo[_inventoryInfo[73] - 1] = 19;
@@ -212,7 +212,7 @@ void IgorEngine::PART_16_HELPER_5_displayPhoto() {
}
}
-void IgorEngine::PART_16_HELPER_6(int frame) {
+void IgorEngine::PART_16_HELPER_6_drawTalkingFrame(int frame) {
const uint8 *src = _animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + frame * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
@@ -226,11 +226,11 @@ void IgorEngine::PART_16() {
_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);
+ PART_16_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_16_HELPER_2();
+ PART_16_HELPER_2_enterScene();
if (_objectsState[65] == 2 && _inventoryInfo[71] != 0 && _objectsState[76] == 1) {
PART_16_HELPER_3_photoCutscene();
}
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 833ef8a3e96..648b3253626 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -40,7 +40,7 @@ void IgorEngine::PART_17_EXEC_ACTION(int action) {
igorSay(220, 3, 646);
break;
case 105:
- PART_17_ACTION_105();
+ PART_17_ACTION_105_leaveThroughPath();
break;
case 106: // exchange files
PART_17_ACTION_106_swapFolders();
@@ -100,7 +100,7 @@ void IgorEngine::PART_17_ACTION_103_talkPhilipJimmy() {
cutsceneSayWithCallback(135, 33, 63, 63, 0, 215 + randomDialogue, 1, 641 + randomDialogue, &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip);
PART_17_HANDLE_DIALOGUE_PHILIP();
- PART_17_HELPER_1(255);
+ PART_17_HELPER_1_OBJECT_STATE(255);
PART_17_HELPER_8_PhillipToJimmyAnimFrame(0);
--_walkDataLastIndex;
@@ -117,7 +117,7 @@ void IgorEngine::PART_17_ACTION_103_talkPhilipJimmy() {
}
}
-void IgorEngine::PART_17_ACTION_105() {
+void IgorEngine::PART_17_ACTION_105_leaveThroughPath() {
bool escaped = false;
_roomObjectAreasTable[5].area = 1;
_roomObjectAreasTable[10].area = 2;
@@ -194,7 +194,7 @@ void IgorEngine::PART_17_ACTION_106_swapFolders() {
_objectsState[55] = 1;
_objectsState[3] = 1;
- PART_17_HELPER_1(255);
+ PART_17_HELPER_1_OBJECT_STATE(255);
UPDATE_OBJECT_STATE(4);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
@@ -274,13 +274,13 @@ void IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND() {
}
}
-void IgorEngine::PART_17_HELPER_1(int num) {
+void IgorEngine::PART_17_HELPER_1_OBJECT_STATE(int num) {
// Enable or disable phillip and jimmy animation
if (num == 1 || num == 255) {
if (_objectsState[54] == 0) {
_gameState.unkF = false;
} else {
- PART_17_HELPER_3(0);
+ PART_17_HELPER_3_disableArea(0);
_gameState.unkF = true;
}
}
@@ -293,7 +293,7 @@ void IgorEngine::PART_17_HELPER_1(int num) {
if (num == 3 || num == 255) {
if (_objectsState[56] == 1) {
_gameState.unkF = false;
- PART_17_HELPER_3(6);
+ PART_17_HELPER_3_disableArea(6);
}
}
}
@@ -359,7 +359,7 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap() {
_roomObjectAreasTable[28].area = 0;
}
-void IgorEngine::PART_17_HELPER_3(int lum) {
+void IgorEngine::PART_17_HELPER_3_disableArea(int lum) {
_roomObjectAreasTable[18].area = lum;
_roomObjectAreasTable[19].area = lum;
_roomObjectAreasTable[20].area = lum;
@@ -379,7 +379,7 @@ void IgorEngine::PART_17_HELPER_5_changeZindexOfPath(int lum) {
}
void IgorEngine::PART_17_HELPER_6_walkFromCollege() {
- PART_17_HELPER_1(255);
+ PART_17_HELPER_1_OBJECT_STATE(255);
fadeIn(768);
_walkData[0].setPos(274, 68, 4, 1);
_walkData[0].setDefaultScale();
@@ -466,14 +466,14 @@ void IgorEngine::PART_17() {
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_17_EXEC_ACTION);
_updateRoomBackground = &IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND;
- PART_17_HELPER_1(255);
+ PART_17_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (_objectsState[56] == 1) {
_gameState.unkF = false;
- PART_17_HELPER_3(6);
+ PART_17_HELPER_3_disableArea(6);
_roomObjectAreasTable[14].object = 0;
_roomObjectAreasTable[15].object = 0;
_roomObjectAreasTable[19].object = 0;
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index c3fdf86e9ba..1fbd9a1b991 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -56,7 +56,7 @@ void IgorEngine::PART_18_EXEC_ACTION(int action) {
_currentPart = 252;
break;
case 111:
- PART_18_ACTION_111();
+ PART_18_ACTION_111_useBottleOnTap();
break;
default:
error("PART_18_EXEC_ACTION unhandled action %d", action);
@@ -84,7 +84,7 @@ void IgorEngine::PART_18_ACTION_109_useSlugOnGrating() {
_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);
+ PART_18_HELPER_1_OBJECT_STATE(255);
// paints bottom of screen black
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
@@ -95,7 +95,7 @@ void IgorEngine::PART_18_ACTION_109_useSlugOnGrating() {
igorSay(215, 1, 908);
}
-void IgorEngine::PART_18_ACTION_111() {
+void IgorEngine::PART_18_ACTION_111_useBottleOnTap() {
if (_objectsState[0] == 0) {
igorSay(211, 1, 905);
return;
@@ -116,7 +116,7 @@ void IgorEngine::PART_18_ACTION_111() {
UPDATE_OBJECT_STATE(1);
}
-void IgorEngine::PART_18_HELPER_1(int num) {
+void IgorEngine::PART_18_HELPER_1_OBJECT_STATE(int num) {
}
void IgorEngine::PART_18_HELPER_2_walkIn() {
@@ -146,7 +146,7 @@ void IgorEngine::PART_18() {
_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);
+ PART_18_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index f829b3ff045..aae9ff6b748 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -45,13 +45,13 @@ void IgorEngine::PART_19_EXEC_ACTION(int action) {
_currentPart = 232;
break;
case 107:
- PART_19_ACTION_107();
+ PART_19_ACTION_107_lookAtSink();
break;
case 108:
igorSay(208, 1, 916);
break;
case 109:
- PART_19_ACTION_109();
+ PART_19_ACTION_109_usePapyrusOnDryer();
break;
default:
error("PART_19_EXEC_ACTION unhandled action %d", action);
@@ -59,7 +59,7 @@ void IgorEngine::PART_19_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_19_ACTION_107() { // sub_137_02C7
+void IgorEngine::PART_19_ACTION_107_lookAtSink() {
if (_objectsState[58] == 1) {
igorSay(211, 1, 919);
return;
@@ -74,10 +74,10 @@ void IgorEngine::PART_19_ACTION_107() { // sub_137_02C7
}
addObjectToInventory(12, 47);
_objectsState[58] = 1;
- PART_19_HELPER_1(255);
+ PART_19_HELPER_1_OBJECT_STATE(255);
}
-void IgorEngine::PART_19_ACTION_109() { // sub_137_0421
+void IgorEngine::PART_19_ACTION_109_usePapyrusOnDryer() {
if (_objectsState[2] == 1) {
igorSay(210, 1, 918);
return;
@@ -90,7 +90,7 @@ void IgorEngine::PART_19_ACTION_109() { // sub_137_0421
decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x35E) - 1, _screenVGA, true);
playSound(45, 1);
lookAtPapyrus(true);
- PART_19_HELPER_1(255);
+ PART_19_HELPER_1_OBJECT_STATE(255);
stopSound();
decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x360) - 1, _screenVGA, true);
igorSayAndWait(209, 1, 917);
@@ -99,10 +99,10 @@ void IgorEngine::PART_19_ACTION_109() { // sub_137_0421
void IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_19_HELPER_7((VAR_CURRENT_TALKING_ACTOR == 0) ? 35 : 40);
+ PART_19_HELPER_7_drawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? 35 : 40);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_19_HELPER_7((VAR_CURRENT_TALKING_ACTOR == 0) ? 35 + getRandomNumber(4) : 40 + getRandomNumber(4));
+ PART_19_HELPER_7_drawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? 35 + getRandomNumber(4) : 40 + getRandomNumber(4));
break;
}
}
@@ -115,7 +115,7 @@ void IgorEngine::PART_19_UPDATE_BACKGROUND_HELPER_9() {
}
}
-void IgorEngine::PART_19_HELPER_1(int num) {
+void IgorEngine::PART_19_HELPER_1_OBJECT_STATE(int num) {
if (num == 2 || num == 255) {
if (_objectsState[59] == 0) {
decodeAnimFrame(_animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x4051) - 1, _screenLayer1, true);
@@ -179,7 +179,7 @@ void IgorEngine::PART_19_HELPER_2_slugCutscene() { // sub_137_07AD
_gameState.talkSpeed = talkSpeed;
}
-void IgorEngine::PART_19_HELPER_3() {
+void IgorEngine::PART_19_HELPER_3_walkIn() {
_walkData[0].setPos(319, 142, 1, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
@@ -192,7 +192,7 @@ void IgorEngine::PART_19_HELPER_3() {
waitForIgorMove();
}
-void IgorEngine::PART_19_HELPER_4() { // sub_137_0D7B
+void IgorEngine::PART_19_HELPER_4_enterAndLeave() {
decodeAnimFrame(_animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x40AB) - 1, _screenVGA, true);
waitForTimer(60);
igorSayAndWait(225, 1, 927);
@@ -204,7 +204,7 @@ void IgorEngine::PART_19_HELPER_4() { // sub_137_0D7B
_currentPart = 232;
}
-void IgorEngine::PART_19_HELPER_7(int frame) {
+void IgorEngine::PART_19_HELPER_7_drawTalkingFrame(int frame) {
const uint8 *src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x404F + frame * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
@@ -224,13 +224,13 @@ void IgorEngine::PART_19() {
return;
}
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_19_EXEC_ACTION);
- PART_19_HELPER_1(255);
+ PART_19_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_19_HELPER_3();
+ PART_19_HELPER_3_walkIn();
if (_objectsState[59] == 0) {
- PART_19_HELPER_4();
+ PART_19_HELPER_4_enterAndLeave();
} else {
enterPartLoop();
while (_currentPart == 190) {
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index 9494cef088b..67b79dbb2a0 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -95,7 +95,7 @@ void IgorEngine::PART_21_ACTION_102() {
_updateRoomBackground = &IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND;
_updateDialogue = 0;
PART_21_HANDLE_DIALOGUE_MARGARET();
- PART_21_HELPER_1(255);
+ PART_21_HELPER_1_OBJECT_STATE(255);
}
void IgorEngine::PART_21_ACTION_107() {
@@ -113,7 +113,7 @@ void IgorEngine::PART_21_ACTION_107() {
}
}
_objectsState[64] = 1;
- PART_21_HELPER_1(1);
+ PART_21_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_21_ACTION_108() {
@@ -130,7 +130,7 @@ void IgorEngine::PART_21_ACTION_108() {
}
}
_objectsState[64] = 0;
- PART_21_HELPER_1(1);
+ PART_21_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_21_ACTION_110() {
@@ -166,7 +166,7 @@ void IgorEngine::PART_21_ACTION_111() {
} while (k != 10);
removeObjectFromInventory(56);
_objectsState[65] = 1;
- PART_21_HELPER_1(255);
+ PART_21_HELPER_1_OBJECT_STATE(255);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
@@ -231,7 +231,7 @@ void IgorEngine::PART_21_HANDLE_DIALOGUE_MARGARET() {
_updateDialogue = 0;
}
-void IgorEngine::PART_21_HELPER_1(int num) {
+void IgorEngine::PART_21_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
if (_objectsState[64] == 0) {
PART_21_HELPER_7();
@@ -252,7 +252,7 @@ void IgorEngine::PART_21_HELPER_1(int num) {
}
}
-void IgorEngine::PART_21_HELPER_2() {
+void IgorEngine::PART_21_HELPER_2_enterFromLeft() {
_walkData[0].setPos(0, 141, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 15;
@@ -265,7 +265,7 @@ void IgorEngine::PART_21_HELPER_2() {
PART_21_HELPER_5();
}
-void IgorEngine::PART_21_HELPER_3() {
+void IgorEngine::PART_21_HELPER_3_enterFromRight() {
_walkData[0].setPos(319, 133, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -277,7 +277,7 @@ void IgorEngine::PART_21_HELPER_3() {
PART_21_HELPER_5();
}
-void IgorEngine::PART_21_HELPER_4() {
+void IgorEngine::PART_21_HELPER_4_enterFromPhysicsClass() {
_walkData[0].setPos(119, 108, 2, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 0;
@@ -372,7 +372,7 @@ void IgorEngine::PART_21_HELPER_10() {
drawVerbsPanel();
_currentAction.verb = kVerbWalk;
drawInventory(_inventoryInfo[72], 0);
- PART_21_HELPER_1(255);
+ PART_21_HELPER_1_OBJECT_STATE(255);
_objectsState[110] = 1;
}
@@ -422,18 +422,18 @@ void IgorEngine::PART_21() {
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);
+ PART_21_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
_gameState.unk10 = 1;
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 210) {
- PART_21_HELPER_2();
+ PART_21_HELPER_2_enterFromLeft();
} else if (_currentPart == 211) {
- PART_21_HELPER_3();
+ PART_21_HELPER_3_enterFromRight();
} else if (_currentPart == 212) {
- PART_21_HELPER_4();
+ PART_21_HELPER_4_enterFromPhysicsClass();
}
}
enterPartLoop();
Commit: b1c22540b6ab9f8f67a832f4e27c4a7e6597d19d
https://github.com/scummvm/scummvm/commit/b1c22540b6ab9f8f67a832f4e27c4a7e6597d19d
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:38+01:00
Commit Message:
IGOR: Part 32
Changed paths:
A engines/igor/parts/part_32.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_22.cpp
engines/igor/parts/part_23.cpp
engines/igor/resource.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 6aa8972cfee..3bc41246786 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -531,6 +531,15 @@ private:
uint8 _part69FireflyFrameA;
uint8 _part69FireflyFrameB;
uint16 _part69FireflyStepCount;
+ uint8 _part32Glyphs[420];
+ uint8 _part32DeclinationDigits[2];
+ uint8 _part32AscensionDigits[3];
+ int _part32DeclinationIndex;
+ int _part32AscensionIndex;
+ int _part32LineRow;
+ int _part32Blink;
+ int _part32Result;
+ bool _part32Done;
uint8 _part68QuestionCounter;
uint8 _part68LastDialogueCode;
bool _part68NpcPresent;
@@ -858,7 +867,6 @@ private:
void PART_17_HELPER_6_walkFromCollege();
void PART_17_HELPER_8_PhillipToJimmyAnimFrame(int num);
void PART_17_HELPER_9_JimmyTalkingAnimFrame(int num);
- void PART_17_HELPER_10();
void PART_17_HELPER_11_PhillipToIgor(int frame);
void PART_17();
@@ -914,12 +922,12 @@ private:
// church bell tower
void PART_22_EXEC_ACTION(int action);
- void PART_22_ACTION_101();
- void PART_22_ACTION_102();
+ void PART_22_ACTION_101_lookAtBell();
+ void PART_22_ACTION_102_leave();
void PART_22_APPLY_OBJECT_STATE(int num);
void PART_22_IGOR_STEP(int facing, int step);
void PART_22_SCROLL_STEP(int step);
- void PART_22_ENTER();
+ void PART_22_enter();
void PART_22();
// college corridor lucas
@@ -928,14 +936,13 @@ private:
void PART_23_ACTION_107_openDoor();
void PART_23_ACTION_108_closeDoor();
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_1_APPLY_OBJECT_STATE(int num);
+ void PART_23_HELPER_2_drawDoor(int frame);
+ void PART_23_HELPER_3_drawLucas();
void PART_23_HELPER_4_walkFromDoor();
void PART_23_HELPER_5_walkFromLeft();
void PART_23_HELPER_6_walkFromRight();
- void PART_23_HELPER_7(int frame);
- void PART_23_HELPER_8(int frame);
+ void PART_23_HELPER_7_drawLucasFrame(int frame);
void PART_23();
// college corridor sharon michael
@@ -1044,6 +1051,37 @@ private:
void PART_31_HELPER_9();
void PART_31();
+ // telescope room
+ void PART_32_EXEC_ACTION(int action);
+ void PART_32_ENTER();
+ void PART_32_ACTION_103_useControls();
+ void PART_32_ACTION_106_walkToControls();
+ void PART_32_CONTROLS();
+ void PART_32_CONTROLS_COPY_COLOR(int dstColor, int srcColor);
+ int PART_32_CONTROLS_KEY_AT_CURSOR() const;
+ void PART_32_CONTROLS_DRAW_DIGIT(int fieldOffset, int index, int key);
+ void PART_32_CONTROLS_ERASE_DIGIT(int fieldOffset, int index);
+ void PART_32_CONTROLS_IDLE(int fieldColor);
+ void PART_32_CONTROLS_EXIT();
+ void PART_32_CONTROLS_SELECT_DECLINATION();
+ void PART_32_CONTROLS_SELECT_ASCENSION();
+ void PART_32_CONTROLS_CONFIRM();
+ int PART_32_CONTROLS_ANIMATE_DECLINATION();
+ int PART_32_CONTROLS_ANIMATE_ASCENSION();
+ void PART_32_LOAD_TOWER();
+ void PART_32_LOAD_FINAL();
+ void PART_32_DRAW_TOWER_FRAME(int frame);
+ void PART_32_UPDATE_DIALOGUE_SPEAKER_A(int action);
+ void PART_32_UPDATE_DIALOGUE_SPEAKER_B(int action);
+ void PART_32_SPEAKER_A_SAYS(const Common::Array<DialogueText> &lines);
+ void PART_32_SPEAKER_B_SAYS(const Common::Array<DialogueText> &lines);
+ void PART_32_SCENE();
+ void PART_32_SCENE_TOWER_CONVERSATION();
+ void PART_32_SCENE_TOWER_EMPTY();
+ void PART_32_SCENE_NOTHING();
+ void PART_32_SCENE_FINAL();
+ void PART_32();
+
// library
void PART_33_EXEC_ACTION(int action);
void PART_33_ACTION_109();
@@ -1477,6 +1515,7 @@ protected:
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_32_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_33_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_34_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_35_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index f4a573093ca..2c99b69993e 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -44,6 +44,7 @@ MODULE_OBJS = \
parts/part_28.o \
parts/part_30.o \
parts/part_31.o \
+ parts/part_32.o \
parts/part_33.o \
parts/part_34.o \
parts/part_35.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 723dbbb174d..4f66fc9e2ce 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -602,6 +602,9 @@ void IgorEngine::PART_MAIN() {
case 313:
PART_31();
break;
+ case 320:
+ PART_32(); // telescope room
+ break;
case 330:
case 331:
PART_33();
diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp
index 7347ab89fd4..489cb6cd1aa 100644
--- a/engines/igor/parts/part_22.cpp
+++ b/engines/igor/parts/part_22.cpp
@@ -33,10 +33,10 @@ static const uint8 PART_22_PICK_UP_FRAMES[3] = { 1, 2, 1 };
void IgorEngine::PART_22_EXEC_ACTION(int action) {
switch (action) {
case 101:
- PART_22_ACTION_101();
+ PART_22_ACTION_101_lookAtBell();
break;
case 102:
- PART_22_ACTION_102();
+ PART_22_ACTION_102_leave();
break;
default:
error("PART_22_EXEC_ACTION unhandled action %d", action);
@@ -47,7 +47,7 @@ void IgorEngine::PART_22_EXEC_ACTION(int action) {
/**
* Takes the object (inventory object 29) from the bell tower.
*/
-void IgorEngine::PART_22_ACTION_101() {
+void IgorEngine::PART_22_ACTION_101_lookAtBell() {
if (_objectsState[78] == 1 && _inventoryInfo[64] == 0) {
igorSayAndWait(203, 2, 855);
for (int i = 0; i < 3; ++i) {
@@ -67,10 +67,9 @@ void IgorEngine::PART_22_ACTION_101() {
}
/**
- * Igor leaves the tower: he walks away from the viewer, shrinking, and the picture scrolls up to
- * the church.
+ * Igor leaves the tower
*/
-void IgorEngine::PART_22_ACTION_102() {
+void IgorEngine::PART_22_ACTION_102_leave() {
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
for (int i = 9; i >= 0; --i) {
@@ -124,10 +123,9 @@ void IgorEngine::PART_22_SCROLL_STEP(int step) {
}
/**
- * The first screen shows the neighbouring picture; the room scrolls in from the top and Igor
- * walks into it.
+ * The first screen shows the church and scrolls up to church bell tower
*/
-void IgorEngine::PART_22_ENTER() {
+void IgorEngine::PART_22_enter() {
memcpy(_screenVGA, _screenLayer1 + kPart22PictureRows * 320, 16 * 320);
memcpy(_screenVGA + 16 * 320, _animFramesBuffer, kPart22PictureRows * 320);
_currentAction.verb = kVerbWalk;
@@ -171,7 +169,7 @@ void IgorEngine::PART_22() {
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_22_EXEC_ACTION);
PART_22_APPLY_OBJECT_STATE(255);
if (!restoreRoomAfterLoad()) {
- PART_22_ENTER();
+ PART_22_enter();
}
enterPartLoop();
while (_currentPart == 220 && !_gameStateLoaded) {
diff --git a/engines/igor/parts/part_23.cpp b/engines/igor/parts/part_23.cpp
index 2b0c51ec67a..d31ecf840ef 100644
--- a/engines/igor/parts/part_23.cpp
+++ b/engines/igor/parts/part_23.cpp
@@ -94,7 +94,7 @@ void IgorEngine::PART_23_ACTION_107_openDoor() {
}
}
_objectsState[66] = 1;
- PART_23_HELPER_1(1);
+ PART_23_HELPER_1_APPLY_OBJECT_STATE(1);
}
void IgorEngine::PART_23_ACTION_108_closeDoor() {
@@ -113,7 +113,7 @@ void IgorEngine::PART_23_ACTION_108_closeDoor() {
}
}
_objectsState[66] = 0;
- PART_23_HELPER_1(1);
+ PART_23_HELPER_1_APPLY_OBJECT_STATE(1);
}
void IgorEngine::PART_23_UPDATE_ROOM_BACKGROUND() {
@@ -130,29 +130,29 @@ void IgorEngine::PART_23_UPDATE_ROOM_BACKGROUND() {
_gameState.unk10 = getRandomNumber(1) + 1;
}
}
- PART_23_HELPER_7(_gameState.unk10);
+ PART_23_HELPER_7_drawLucasFrame(_gameState.unk10);
}
}
-void IgorEngine::PART_23_HELPER_1(int num) {
+void IgorEngine::PART_23_HELPER_1_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
if (_objectsState[66] == 0) {
- PART_23_HELPER_2(1);
+ PART_23_HELPER_2_drawDoor(1);
_roomActionsTable[4] = 6;
} else {
- PART_23_HELPER_2(2);
+ PART_23_HELPER_2_drawDoor(2);
_roomActionsTable[4] = 7;
}
}
- PART_23_HELPER_3();
+ PART_23_HELPER_3_drawLucas();
}
-void IgorEngine::PART_23_HELPER_2(int frame) {
+void IgorEngine::PART_23_HELPER_2_drawDoor(int frame) {
const int offset = 23907;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + (frame - 1) * 1296, 24, 24, 54);
}
-void IgorEngine::PART_23_HELPER_3() {
+void IgorEngine::PART_23_HELPER_3_drawLucas() {
const int offset = 25763;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xA20, 25, 25, 49);
}
@@ -172,7 +172,7 @@ void IgorEngine::PART_23_HELPER_4_walkFromDoor() {
drawAnimRect(23907, 0, 24, 54, false, kBlendBehindIgor);
playSound(14, 1);
_objectsState[66] = 0;
- PART_23_HELPER_1(1);
+ PART_23_HELPER_1_APPLY_OBJECT_STATE(1);
igorSay(206, 2, 1221);
}
}
@@ -202,7 +202,7 @@ void IgorEngine::PART_23_HELPER_6_walkFromRight() {
waitForIgorMove();
}
-void IgorEngine::PART_23_HELPER_7(int frame) {
+void IgorEngine::PART_23_HELPER_7_drawLucasFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 18; ++i) {
for (int j = 0; j <= 14; ++j) {
@@ -227,7 +227,11 @@ void IgorEngine::PART_23() {
playMusic(2);
_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 };
+ static const int anm[] = {
+ FRM_CollegeCorridorLucas1, FRM_CollegeCorridorLucas2,
+ FRM_CollegeCorridorLucas3, FRM_CollegeCorridorLucas4,
+ 0
+ };
loadAnimData(anm);
loadActionData(DAT_CollegeCorridorLucas);
_roomDataOffsets = PART_23_ROOM_DATA_OFFSETS;
@@ -235,7 +239,7 @@ void IgorEngine::PART_23() {
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_23_EXEC_ACTION);
_updateRoomBackground = &IgorEngine::PART_23_UPDATE_ROOM_BACKGROUND;
- PART_23_HELPER_1(255);
+ PART_23_HELPER_1_APPLY_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_32.cpp b/engines/igor/parts/part_32.cpp
new file mode 100644
index 00000000000..efa0d4e899f
--- /dev/null
+++ b/engines/igor/parts/part_32.cpp
@@ -0,0 +1,671 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// The colors of the buttons of the control panel in the mask of its picture.
+enum {
+ kPart32KeyBackspace = 11,
+ kPart32KeyDeclination = 12,
+ kPart32KeyAscension = 13,
+ kPart32KeyConfirm = 14,
+ kPart32KeyExit = 15
+};
+
+// Results of the control panel.
+enum {
+ kPart32ResultNone = 0,
+ kPart32ResultTower = 1,
+ kPart32ResultNothing = 2,
+ kPart32ResultFinal = 3
+};
+
+// The glyphs of the digits are 6x7 pixels, drawn 7 pixels apart.
+static const int kPart32GlyphWidth = 6;
+static const int kPart32GlyphHeight = 7;
+static const int kPart32GlyphSize = kPart32GlyphWidth * kPart32GlyphHeight;
+static const int kPart32DigitPitch = 7;
+static const int kPart32DeclinationDigitsOffset = 48 * 320 + 115;
+static const int kPart32AscensionDigitsOffset = 68 * 320 + 162;
+
+// The palette colors that mark the two fields of the control panel (the blinking one is the selected field) and
+// the color they have when not blinking.
+static const int kPart32DeclinationColor = 12;
+static const int kPart32AscensionColor = 13;
+static const int kPart32FieldColor = 14;
+
+// The declination is a horizontal line that rises from the bottom of its gauge, the ascension a vertical line that
+// moves to the right. Both cross at the aimed point.
+static const int kPart32DeclinationBottom = 0x75;
+static const int kPart32DeclinationLineX = 0x23;
+static const int kPart32DeclinationLineWidth = 0x70;
+static const int kPart32AscensionLeft = 0x22;
+static const int kPart32AscensionTop = 0x55;
+static const int kPart32AscensionWidth = 0x70;
+static const int kPart32AscensionMax = 360;
+static const int kPart32LineColor = 0xE;
+
+// The coordinates that open each scene.
+static const int kPart32TowerDeclination = 74;
+static const int kPart32TowerAscension = 207;
+static const int kPart32FinalDeclination = 60;
+static const int kPart32FinalAscension = 90;
+
+// The room data has the table of the frames of the tower scene at its end; the frame offsets are relative to the
+// start of the picture buffer.
+static const int kPart32TowerFramesTable = 0x851E;
+
+// Where Igor goes before using the control panel.
+static const int kPart32ControlsX = 117;
+static const int kPart32ControlsY = 122;
+
+// The frames of the final scene, in order (1-based index in the table of the data).
+static const uint8 kPart32FinalFrames[13] = { 1, 2, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5 };
+
+// The speakers of the tower scene.
+static const int kPart32SpeakerAX = 147;
+static const int kPart32SpeakerAY = 70;
+static const int kPart32SpeakerBX = 166;
+static const int kPart32SpeakerBY = 67;
+
+void IgorEngine::PART_32_EXEC_ACTION(int action) {
+ switch (action) {
+ case 101:
+ _currentPart = 311;
+ break;
+ case 102:
+ igorSay(201, 1, 828);
+ break;
+ case 103:
+ PART_32_ACTION_103_useControls();
+ break;
+ case 104:
+ igorSay(202, 2, 829);
+ break;
+ case 105:
+ igorSay(204, 2, 830);
+ break;
+ case 106:
+ PART_32_ACTION_106_walkToControls();
+ break;
+ default:
+ error("PART_32_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+/**
+ * Igor comes in from the left edge, walking to the right.
+ */
+void IgorEngine::PART_32_ENTER() {
+ WalkData *wd = &_walkData[0];
+ wd->setPos(0, 143, kFacingPositionLeft, 0);
+ wd->clipSkipX = 11;
+ wd->clipWidth = 10;
+ wd->scaleWidth = 33;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 33;
+ _walkDataLastIndex = 0;
+ buildWalkPathSimple(0, 143, 40, 143);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+/**
+ * Igor stops where he is, walks to the place in front of the control panel (unless he is already there) and
+ * uses it.
+ */
+void IgorEngine::PART_32_ACTION_106_walkToControls() {
+ if (_gameState.igorMoving) {
+ _walkDataLastIndex = _walkDataCurrentIndex + 1;
+ _walkData[_walkDataCurrentIndex].frameNum = 0;
+ moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
+ _gameState.igorMoving = false;
+ }
+ const WalkData &last = _walkData[_walkDataLastIndex - 1];
+ if (last.x != kPart32ControlsX || last.y != kPart32ControlsY) {
+ --_walkDataLastIndex;
+ buildWalkPathSimple(_walkData[_walkDataLastIndex].x, _walkData[_walkDataLastIndex].y, kPart32ControlsX, kPart32ControlsY);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ }
+ PART_32_ACTION_103_useControls();
+}
+
+/**
+ * The room is faded out and its screen and palette are kept; the control panel takes the screen and, depending
+ * on the coordinates that were set, a scene follows. Then the room is loaded again and faded in.
+ */
+void IgorEngine::PART_32_ACTION_103_useControls() {
+ fadeOut(624);
+ memcpy(_animFramesBuffer, _screenVGA, 64000);
+ memcpy(_animFramesBuffer + 64000, _paletteBuffer, 768);
+ PART_32_CONTROLS();
+ if (_part32Result >= kPart32ResultTower && _part32Result <= kPart32ResultFinal) {
+ PART_32_SCENE();
+ }
+ loadRoomData(PAL_Part32, IMG_Part32, BOX_Part32, MSK_Part32, TXT_Part32);
+ memcpy(_screenVGA, _animFramesBuffer, 64000);
+ memcpy(_paletteBuffer, _animFramesBuffer + 64000, 768);
+ fadeIn(768);
+ if (_part32Result == kPart32ResultTower) {
+ if (_objectsState[78] == 0 && _objectsState[4] == 2) {
+ igorSay(206, 3, 831);
+ _objectsState[78] = 1;
+ }
+ }
+ if (_part32Result == kPart32ResultFinal) {
+ if (_objectsState[79] == 0) {
+ igorSay({ { 209, 1, 832 }, { 210, 1, 833 } });
+ _objectsState[79] = 1;
+ } else {
+ igorSay(211, 1, 834);
+ }
+ }
+ if (!_eventQuitGame) {
+ _currentPart = 320;
+ }
+}
+
+// The control panel
+
+void IgorEngine::PART_32_CONTROLS_COPY_COLOR(int dstColor, int srcColor) {
+ memcpy(_currentPalette + dstColor * 3, _currentPalette + srcColor * 3, 3);
+}
+
+/**
+ * The button under the cursor; the part of the screen below the picture has none.
+ */
+int IgorEngine::PART_32_CONTROLS_KEY_AT_CURSOR() const {
+ const int x = _inputVars[kInputCursorXPos];
+ const int y = _inputVars[kInputCursorYPos];
+ if (x < 0 || x >= 320 || y < 0 || y >= 144) {
+ return 0;
+ }
+ return _screenLayer2[y * 320 + x];
+}
+
+void IgorEngine::PART_32_CONTROLS_DRAW_DIGIT(int fieldOffset, int index, int key) {
+ copyArea(_screenVGA, fieldOffset + index * kPart32DigitPitch, 320, _part32Glyphs + (key - 1) * kPart32GlyphSize,
+ kPart32GlyphWidth, kPart32GlyphWidth, kPart32GlyphHeight);
+}
+
+void IgorEngine::PART_32_CONTROLS_ERASE_DIGIT(int fieldOffset, int index) {
+ for (int row = 0; row < kPart32GlyphHeight; ++row) {
+ memset(_screenVGA + fieldOffset + index * kPart32DigitPitch + row * 320, 0, kPart32GlyphWidth);
+ }
+}
+
+/**
+ * What every pass of a selected field does after its click: the escape key leaves the panel, the color that
+ * marks the field blinks once in a while and the game waits for the next tick.
+ */
+void IgorEngine::PART_32_CONTROLS_IDLE(int fieldColor) {
+ if (_inputVars[kInputEscape]) {
+ PART_32_CONTROLS_EXIT();
+ }
+ if (compareGameTick(0)) {
+ if (_part32Blink == 1) {
+ PART_32_CONTROLS_COPY_COLOR(fieldColor, kPart32FieldColor);
+ } else if (_part32Blink == 2) {
+ PART_32_CONTROLS_COPY_COLOR(fieldColor, 0);
+ }
+ setPaletteRange(fieldColor, fieldColor);
+ _part32Blink = _part32Blink == 1 ? 2 : 1;
+ }
+ waitForTimer();
+}
+
+void IgorEngine::PART_32_CONTROLS_EXIT() {
+ playSound(getRandomNumber(1) + 0x42, 1);
+ PART_32_CONTROLS_COPY_COLOR(kPart32DeclinationColor, kPart32FieldColor);
+ PART_32_CONTROLS_COPY_COLOR(kPart32AscensionColor, kPart32FieldColor);
+ setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
+ _part32Done = true;
+}
+
+/**
+ * The declination field is selected: the digits typed go to it until the other field or a button is chosen.
+ */
+void IgorEngine::PART_32_CONTROLS_SELECT_DECLINATION() {
+ playSound(31, 1);
+ PART_32_CONTROLS_COPY_COLOR(kPart32DeclinationColor, kPart32FieldColor);
+ PART_32_CONTROLS_COPY_COLOR(kPart32AscensionColor, kPart32FieldColor);
+ setPaletteRange(kPart32AscensionColor, kPart32AscensionColor);
+ _part32Blink = 2;
+ do {
+ if (_inputVars[kInputClick]) {
+ _inputVars[kInputClick] = 0;
+ const int key = PART_32_CONTROLS_KEY_AT_CURSOR();
+ if (key != kPart32KeyAscension) {
+ playSound(getRandomNumber(1) + 0x42, 1);
+ }
+ if (key >= 1 && key <= 10) {
+ // the declination does not go over 90
+ if (_part32DeclinationIndex == 1 && _part32DeclinationDigits[0] == 9 && key < 10) {
+ continue;
+ }
+ PART_32_CONTROLS_DRAW_DIGIT(kPart32DeclinationDigitsOffset, _part32DeclinationIndex, key);
+ _part32DeclinationDigits[_part32DeclinationIndex] = key % 10;
+ if (_part32DeclinationIndex < 1) {
+ ++_part32DeclinationIndex;
+ }
+ } else if (key == kPart32KeyBackspace) {
+ if (_part32DeclinationDigits[_part32DeclinationIndex] == 0xFF && _part32DeclinationIndex > 0) {
+ --_part32DeclinationIndex;
+ }
+ PART_32_CONTROLS_ERASE_DIGIT(kPart32DeclinationDigitsOffset, _part32DeclinationIndex);
+ _part32DeclinationDigits[_part32DeclinationIndex] = 0xFF;
+ } else if (key == kPart32KeyAscension) {
+ PART_32_CONTROLS_SELECT_ASCENSION();
+ } else if (key == kPart32KeyConfirm) {
+ PART_32_CONTROLS_CONFIRM();
+ } else if (key == kPart32KeyExit) {
+ PART_32_CONTROLS_EXIT();
+ }
+ }
+ PART_32_CONTROLS_IDLE(kPart32DeclinationColor);
+ } while (!_part32Done);
+}
+
+/**
+ * The ascension field is selected.
+ */
+void IgorEngine::PART_32_CONTROLS_SELECT_ASCENSION() {
+ playSound(31, 1);
+ PART_32_CONTROLS_COPY_COLOR(kPart32DeclinationColor, kPart32FieldColor);
+ setPaletteRange(kPart32DeclinationColor, kPart32DeclinationColor);
+ _part32Blink = 2;
+ do {
+ if (_inputVars[kInputClick]) {
+ _inputVars[kInputClick] = 0;
+ const int key = PART_32_CONTROLS_KEY_AT_CURSOR();
+ if (key != kPart32KeyDeclination) {
+ playSound(getRandomNumber(1) + 0x42, 1);
+ }
+ if (key >= 1 && key <= 10) {
+ // the ascension does not go over 360
+ if (_part32AscensionIndex == 0 && key >= 4 && key <= 9) {
+ continue;
+ }
+ if (_part32AscensionIndex == 1 && _part32AscensionDigits[0] == 3 && key >= 7 && key <= 9) {
+ continue;
+ }
+ if (_part32AscensionIndex == 2 && _part32AscensionDigits[0] == 3 && _part32AscensionDigits[1] == 6 && key < 10) {
+ continue;
+ }
+ PART_32_CONTROLS_DRAW_DIGIT(kPart32AscensionDigitsOffset, _part32AscensionIndex, key);
+ _part32AscensionDigits[_part32AscensionIndex] = key % 10;
+ if (_part32AscensionIndex < 2) {
+ ++_part32AscensionIndex;
+ }
+ } else if (key == kPart32KeyBackspace) {
+ if (_part32AscensionDigits[_part32AscensionIndex] == 0xFF && _part32AscensionIndex > 0) {
+ --_part32AscensionIndex;
+ }
+ PART_32_CONTROLS_ERASE_DIGIT(kPart32AscensionDigitsOffset, _part32AscensionIndex);
+ _part32AscensionDigits[_part32AscensionIndex] = 0xFF;
+ } else if (key == kPart32KeyDeclination) {
+ PART_32_CONTROLS_SELECT_DECLINATION();
+ } else if (key == kPart32KeyConfirm) {
+ PART_32_CONTROLS_CONFIRM();
+ } else if (key == kPart32KeyExit) {
+ PART_32_CONTROLS_EXIT();
+ }
+ }
+ PART_32_CONTROLS_IDLE(kPart32AscensionColor);
+ } while (!_part32Done);
+}
+
+/**
+ * The coordinates are set: the two lines move to them and the scene that belongs to them is chosen.
+ */
+void IgorEngine::PART_32_CONTROLS_CONFIRM() {
+ playSound(getRandomNumber(1) + 0x42, 1);
+ PART_32_CONTROLS_COPY_COLOR(kPart32DeclinationColor, kPart32FieldColor);
+ PART_32_CONTROLS_COPY_COLOR(kPart32AscensionColor, kPart32FieldColor);
+ setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
+ const int declination = PART_32_CONTROLS_ANIMATE_DECLINATION();
+ const int ascension = PART_32_CONTROLS_ANIMATE_ASCENSION();
+ waitForTimer(100);
+ if (declination == kPart32TowerDeclination && ascension == kPart32TowerAscension) {
+ _part32Result = kPart32ResultTower;
+ } else if (declination == kPart32FinalDeclination && ascension == kPart32FinalAscension) {
+ _part32Result = kPart32ResultFinal;
+ } else {
+ _part32Result = kPart32ResultNothing;
+ }
+ _part32Done = true;
+}
+
+/**
+ * The declination typed (a single digit is the unit) and the horizontal line rising to it, 1 row per step.
+ */
+int IgorEngine::PART_32_CONTROLS_ANIMATE_DECLINATION() {
+ playSound(30, 1);
+ uint8 *digits = _part32DeclinationDigits;
+ if (digits[1] == 0xFF) {
+ digits[1] = digits[0];
+ digits[0] = 0;
+ }
+ int declination = digits[0] == 0xFF ? 0 : digits[0] * 10;
+ if (digits[1] != 0xFF) {
+ declination += digits[1];
+ }
+ _part32LineRow = kPart32DeclinationBottom - (declination << 5) / 0x5A;
+ int row = kPart32DeclinationBottom;
+ do {
+ if (compareGameTick(1, 8) && row > _part32LineRow) {
+ memset(_screenVGA + row * 320 + kPart32DeclinationLineX, 0, kPart32DeclinationLineWidth);
+ memset(_screenVGA + (row - 1) * 320 + kPart32DeclinationLineX, kPart32LineColor, kPart32DeclinationLineWidth);
+ --row;
+ }
+ waitForTimer();
+ } while (row != _part32LineRow);
+ stopSound();
+ return declination;
+}
+
+/**
+ * The ascension typed (the last digit is the unit) and the vertical line moving to it, 1 column per step. It is
+ * cut at the row of the horizontal line.
+ */
+int IgorEngine::PART_32_CONTROLS_ANIMATE_ASCENSION() {
+ playSound(30, 1);
+ uint8 *digits = _part32AscensionDigits;
+ if (digits[2] == 0xFF) {
+ digits[2] = digits[1];
+ digits[1] = digits[0];
+ digits[0] = 0;
+ }
+ if (digits[2] == 0xFF) {
+ digits[2] = digits[1];
+ digits[1] = 0;
+ }
+ int ascension = digits[0] == 0xFF ? 0 : digits[0] * 100;
+ if (digits[1] != 0xFF) {
+ ascension += digits[1] * 10;
+ }
+ if (digits[2] != 0xFF) {
+ ascension += digits[2];
+ }
+ const int target = ascension * kPart32AscensionWidth / kPart32AscensionMax + kPart32AscensionLeft;
+ int column = kPart32AscensionLeft;
+ do {
+ if (compareGameTick(1, 8) && column < target) {
+ for (int y = kPart32AscensionTop; y <= kPart32DeclinationBottom; ++y) {
+ if (y == _part32LineRow) {
+ continue;
+ }
+ _screenVGA[y * 320 + column] = 0;
+ _screenVGA[y * 320 + column + 1] = kPart32LineColor;
+ }
+ ++column;
+ }
+ waitForTimer();
+ } while (column != target);
+ stopSound();
+ return ascension;
+}
+
+/**
+ * The picture with the digit boxes. Clicking a button of it does what the button says; the escape key and the exit
+ * button leave.
+ */
+void IgorEngine::PART_32_CONTROLS() {
+ loadData(PAL_Part32Lock, _paletteBuffer);
+ loadData(IMG_Part32Lock, _screenLayer1);
+ uint8 *mask = loadData(MSK_Part32Lock);
+ decodeRoomMask(mask);
+ free(mask);
+ loadData(ANM_Part32Digits, _part32Glyphs);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ memset(_screenVGA + 46080, 0, 17920);
+ fadeIn(624);
+ showCursor();
+
+ memset(_part32DeclinationDigits, 0xFF, sizeof(_part32DeclinationDigits));
+ memset(_part32AscensionDigits, 0xFF, sizeof(_part32AscensionDigits));
+ _part32DeclinationIndex = 0;
+ _part32AscensionIndex = 0;
+ _part32Done = false;
+ _part32Result = kPart32ResultNone;
+ do {
+ if (_inputVars[kInputClick] && _inputVars[kInputCursorYPos] < 144) {
+ _inputVars[kInputClick] = 0;
+ switch (PART_32_CONTROLS_KEY_AT_CURSOR()) {
+ case kPart32KeyDeclination:
+ PART_32_CONTROLS_SELECT_DECLINATION();
+ break;
+ case kPart32KeyAscension:
+ PART_32_CONTROLS_SELECT_ASCENSION();
+ break;
+ case kPart32KeyConfirm:
+ PART_32_CONTROLS_CONFIRM();
+ break;
+ case kPart32KeyExit:
+ PART_32_CONTROLS_EXIT();
+ break;
+ }
+ }
+ if (_inputVars[kInputEscape]) {
+ PART_32_CONTROLS_EXIT();
+ }
+ PART_32_CONTROLS_COPY_COLOR(kPart32DeclinationColor, kPart32FieldColor);
+ PART_32_CONTROLS_COPY_COLOR(kPart32AscensionColor, kPart32FieldColor);
+ setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
+ // the original polls the input here without waiting
+ waitForTimer();
+ } while (!_part32Done);
+ hideCursor();
+ fadeOut(624);
+}
+
+// The scenes
+
+/**
+ * The tower scenes and the final one have their own pictures and palettes. The tower scenes also have their
+ * own texts, which replace the ones of the room until it is loaded again.
+ */
+void IgorEngine::PART_32_LOAD_TOWER() {
+ loadData(PAL_Part32Tower, _paletteBuffer);
+ // the pictures start 1 byte into the buffer; the table of the offsets of the frames follows them
+ loadData(ANM_Part32Tower, _screenLayer1 + 1);
+ uint8 *texts = loadData(TXT_Part32Tower);
+ decodeRoomStrings(texts, true);
+ free(texts);
+}
+
+void IgorEngine::PART_32_LOAD_FINAL() {
+ loadData(PAL_Part32Final, _paletteBuffer);
+ loadData(IMG_Part32Final, _screenLayer1);
+ // the offsets of the frames, and the frames after them
+ loadData(ANM_Part32Final, _screenLayer2);
+}
+
+void IgorEngine::PART_32_DRAW_TOWER_FRAME(int frame) {
+ const uint8 *src = _screenLayer1 + READ_LE_UINT16(_screenLayer1 + kPart32TowerFramesTable + frame * 2);
+ decodeAnimFrame(src, _screenVGA, true);
+}
+
+/**
+ * The man in the tower talks: his mouth is closed when a sentence ends and open in one of 5 ways while it goes on.
+ */
+void IgorEngine::PART_32_UPDATE_DIALOGUE_SPEAKER_A(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_32_DRAW_TOWER_FRAME(9);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_32_DRAW_TOWER_FRAME(getRandomNumber(4) + 9);
+ break;
+ }
+}
+
+/**
+ * The other man in the tower talks.
+ */
+void IgorEngine::PART_32_UPDATE_DIALOGUE_SPEAKER_B(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_32_DRAW_TOWER_FRAME(4);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_32_DRAW_TOWER_FRAME(getRandomNumber(4) + 4);
+ break;
+ }
+}
+
+void IgorEngine::PART_32_SPEAKER_A_SAYS(const Common::Array<DialogueText> &lines) {
+ cutsceneSayWithCallback(kPart32SpeakerAX, kPart32SpeakerAY, 63, 59, 0, lines,
+ &IgorEngine::PART_32_UPDATE_DIALOGUE_SPEAKER_A);
+}
+
+void IgorEngine::PART_32_SPEAKER_B_SAYS(const Common::Array<DialogueText> &lines) {
+ cutsceneSayWithCallback(kPart32SpeakerBX, kPart32SpeakerBY, 63, 21, 21, lines,
+ &IgorEngine::PART_32_UPDATE_DIALOGUE_SPEAKER_B);
+}
+
+/**
+ * The scene of the coordinates that were set.
+ */
+void IgorEngine::PART_32_SCENE() {
+ const bool tower = _part32Result != kPart32ResultFinal;
+ if (tower) {
+ PART_32_LOAD_TOWER();
+ } else {
+ PART_32_LOAD_FINAL();
+ }
+ memset(_screenVGA, 0, 46080);
+ switch (_part32Result) {
+ case kPart32ResultTower:
+ if (_objectsState[78] == 0 && _objectsState[4] == 2) {
+ PART_32_SCENE_TOWER_CONVERSATION();
+ } else {
+ PART_32_SCENE_TOWER_EMPTY();
+ }
+ break;
+ case kPart32ResultNothing:
+ PART_32_SCENE_NOTHING();
+ break;
+ case kPart32ResultFinal:
+ PART_32_SCENE_FINAL();
+ break;
+ }
+ fadeOut(tower ? 624 : 768);
+}
+
+/**
+ * The two men in the bell tower talk about the signal hidden in the bell. Seen once.
+ */
+void IgorEngine::PART_32_SCENE_TOWER_CONVERSATION() {
+ PART_32_DRAW_TOWER_FRAME(2);
+ PART_32_DRAW_TOWER_FRAME(3);
+ fadeIn(624);
+ PART_32_SPEAKER_A_SAYS({ { 201, 2, 835 } });
+ PART_32_SPEAKER_B_SAYS({ { 203, 1, 836 }, { 204, 1, 837 }, { 205, 1, 838 }, { 206, 2, 839 } });
+ PART_32_SPEAKER_A_SAYS({ { 208, 1, 840 } });
+ PART_32_SPEAKER_B_SAYS({ { 209, 2, 841 }, { 211, 1, 842 } });
+ PART_32_SPEAKER_A_SAYS({ { 212, 1, 843 } });
+ PART_32_SPEAKER_B_SAYS({ { 213, 2, 844 }, { 215, 2, 845 } });
+ PART_32_SPEAKER_A_SAYS({ { 217, 1, 846 } });
+ PART_32_SPEAKER_B_SAYS({ { 218, 1, 847 }, { 219, 2, 848 }, { 221, 1, 849 }, { 222, 2, 850 } });
+ PART_32_SPEAKER_A_SAYS({ { 224, 1, 851 } });
+ waitForTimer(255);
+}
+
+/**
+ * The tower again, with nobody there.
+ */
+void IgorEngine::PART_32_SCENE_TOWER_EMPTY() {
+ PART_32_DRAW_TOWER_FRAME(2);
+ fadeIn(624);
+ waitForTimer(255);
+ cutsceneSayStart(160, 70, 63, 63, 63, 227, 1, 853);
+ waitForEndOfIgorDialogue(false);
+ waitForTimer(255);
+}
+
+/**
+ * Coordinates without anything special.
+ */
+void IgorEngine::PART_32_SCENE_NOTHING() {
+ PART_32_DRAW_TOWER_FRAME(1);
+ fadeIn(624);
+ waitForTimer(255);
+ cutsceneSayStart(160, 70, 63, 63, 63, 225, 2, 852);
+ waitForEndOfIgorDialogue(false);
+ waitForTimer(255);
+}
+
+/**
+ * The animation of the last coordinates.
+ */
+void IgorEngine::PART_32_SCENE_FINAL() {
+ memset(_currentPalette, 0, 768);
+ setPaletteRange(0, 255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ fadeIn(768);
+ for (int i = 0; i < ARRAYSIZE(kPart32FinalFrames); ++i) {
+ const int frame = kPart32FinalFrames[i];
+ decodeAnimFrame(_screenLayer2 + READ_LE_UINT16(_screenLayer2 + frame * 2 - 2) + 9, _screenVGA, false);
+ waitForTimer(50);
+ }
+ playSound(32, 1);
+ waitForTimer(255);
+}
+
+void IgorEngine::PART_32() {
+ playMusic(2);
+ _gameState.enableLight = 1;
+ loadActionData(DAT_Part32);
+ loadRoomData(PAL_Part32, IMG_Part32, BOX_Part32, MSK_Part32, TXT_Part32);
+ SET_PAL_240_48_1();
+ _roomDataOffsets = PART_32_ROOM_DATA_OFFSETS;
+ setRoomClickFix(143, 10, 120, true);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_32_EXEC_ACTION);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ PART_32_ENTER();
+ }
+ enterPartLoop();
+ while (_currentPart == 320 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ // the colors that changed are kept
+ memcpy(_paletteBuffer, _currentPalette, 624);
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 79aeb82d78a..4fabc7b0e32 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -209,7 +209,7 @@ void IgorEngine::loadMainTexts() {
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) {
+ for (int i = 0; i < 37; ++i, src += 31 * 2) {
decodeMainString(src, _globalObjectNames[i]);
debugC(9, kDebugResource, "loadMainTexts() _globalObjectNames[%d] '%s'", i, _globalObjectNames[i]);
}
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index efe2a4427aa..318ed3f2b32 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -750,4 +750,22 @@
#define MSK_Part69 1143
#define BOX_Part69 1144
+// State 320 (PART_32)
+#define DAT_Part32 1145
+#define TXT_Part32 1146
+#define IMG_Part32 1147
+#define PAL_Part32 1148
+#define MSK_Part32 1149
+#define BOX_Part32 1150
+#define IMG_Part32Lock 1151
+#define PAL_Part32Lock 1152
+#define MSK_Part32Lock 1153
+#define ANM_Part32Digits 1154
+#define ANM_Part32Tower 1155
+#define TXT_Part32Tower 1156
+#define PAL_Part32Tower 1157
+#define IMG_Part32Final 1158
+#define PAL_Part32Final 1159
+#define ANM_Part32Final 1160
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 2f8e470450e..902d3c853a7 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -422,6 +422,13 @@ const RoomDataOffsets IgorEngine::PART_31_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_32_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 4, 15 },
+ { 19, 209, 3155, 103, 179, 82 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_33_ROOM_DATA_OFFSETS = {
{ 180, 6, 30, 5 },
{ 405, 426 },
Commit: a43732591a4004a98aa1f1b26e4750df54a97b60
https://github.com/scummvm/scummvm/commit/a43732591a4004a98aa1f1b26e4750df54a97b60
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:38+01:00
Commit Message:
IGOR: Renames on parts 24 - 27
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_24.cpp
engines/igor/parts/part_25.cpp
engines/igor/parts/part_26.cpp
engines/igor/parts/part_27.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 3bc41246786..5b792a8ea88 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -945,62 +945,62 @@ private:
void PART_23_HELPER_7_drawLucasFrame(int frame);
void PART_23();
- // college corridor sharon michael
+ // 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_ACTION_104_closeDoor();
+ void PART_24_ACTION_105_openDoor();
+ void PART_24_ACTION_107_goToLibrary();
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_HELPER_1_OBJECT_STATE(int num);
+ void PART_24_HELPER_2_talkingFrameSharon(int frame);
+ void PART_24_HELPER_3_talkingFrameMichael(int frame);
+ void PART_24_HELPER_4_drawClosedDoor();
+ void PART_24_HELPER_5_drawOpenDoor();
+ void PART_24_HELPER_7_enterFromLeft();
+ void PART_24_HELPER_8_enterFromRight();
+ void PART_24_HELPER_9_enterFromChemistryClass();
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_ACTION_105_enterMensToilet();
+ void PART_25_ACTION_107_openDoor();
+ void PART_25_ACTION_108_closeDoor();
+ void PART_25_HELPER_1_OBJECT_STATE(int num);
+ void PART_25_HELPER_2_enterFromLeft();
+ void PART_25_HELPER_3_enterFromRight();
+ void PART_25_HELPER_4_enterFromMensToilet();
+ void PART_25_HELPER_5_drawClosedDoor();
+ void PART_25_HELPER_7_drawOpenDoor();
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_103_openDoor();
+ void PART_26_ACTION_104_closeDoor();
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_HELPER_1_OBJECT_STATE(int num);
+ void PART_26_HELPER_2_drawClosedDoor();
+ void PART_26_HELPER_3_drawOpenDoor();
+ void PART_26_HELPER_4_enterFromRight();
+ void PART_26_HELPER_5_enterFromLaboratory();
+ void PART_26_HELPER_7_drawMissSullivanFrame(int frame);
void PART_26();
// college lockers
void PART_27_EXEC_ACTION(int action);
void PART_27_ACTION_106_openPhilipLocker();
- 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_ACTION_107_closeLocker();
+ void PART_27_ACTION_108_openLocker();
+ void PART_27_ACTION_110_useFlaskOnLocker();
+ void PART_27_HELPER_1_OBJECT_STATE(int num);
+ void PART_27_HELPER_2_enterFromLeft();
+ void PART_27_HELPER_3_drawClosedLocker();
+ void PART_27_HELPER_4_drawOpenLocker();
+ void PART_27_HELPER_5_enterFromLibrary();
void PART_27();
// college corridor caroline
diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp
index 68d66b020df..6845f633d01 100644
--- a/engines/igor/parts/part_24.cpp
+++ b/engines/igor/parts/part_24.cpp
@@ -25,40 +25,40 @@ namespace Igor {
void IgorEngine::PART_24_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // go to corridor
_currentPart = 313;
break;
case 102:
PART_24_ACTION_102();
break;
- case 103:
+ case 103: // look at chemistry door
igorSay(201, 1, 1257);
break;
case 104:
- PART_24_ACTION_104();
+ PART_24_ACTION_104_closeDoor();
break;
case 105:
- PART_24_ACTION_105();
+ PART_24_ACTION_105_openDoor();
break;
- case 106:
+ case 106: // look at chemistry plaque
igorSay(202, 1, 1258);
break;
case 107:
- PART_24_ACTION_107();
+ PART_24_ACTION_107_goToLibrary();
break;
- case 108:
+ case 108: // look at library plaque
igorSay(203, 1, 1259);
break;
- case 109:
+ case 109: // talk to sharon and michael
igorSay({ { 204, 1, 1260 }, { 205, 1, 1261 } });
break;
- case 110:
+ case 110: // take sharon and michael
igorSay(206, 2, 1262);
break;
- case 111:
+ case 111: // look at sharon and michael
igorSay({ { 208, 2, 1263 }, { 210, 2, 1264 } });
break;
- case 112:
+ case 112: // give an item to sharon and michael
igorSay(212, 2, 1265);
break;
default:
@@ -79,7 +79,7 @@ void IgorEngine::PART_24_ACTION_102() {
}
}
-void IgorEngine::PART_24_ACTION_104() {
+void IgorEngine::PART_24_ACTION_104_closeDoor() {
if (_objectsState[67] == 1) {
executeAction(11);
return;
@@ -94,10 +94,10 @@ void IgorEngine::PART_24_ACTION_104() {
}
}
_objectsState[67] = 1;
- PART_24_HELPER_1(1);
+ PART_24_HELPER_1_OBJECT_STATE(1);
}
-void IgorEngine::PART_24_ACTION_105() {
+void IgorEngine::PART_24_ACTION_105_openDoor() {
if (_objectsState[67] == 0) {
executeAction(14);
return;
@@ -112,10 +112,10 @@ void IgorEngine::PART_24_ACTION_105() {
}
}
_objectsState[67] = 0;
- PART_24_HELPER_1(1);
+ PART_24_HELPER_1_OBJECT_STATE(1);
}
-void IgorEngine::PART_24_ACTION_107() {
+void IgorEngine::PART_24_ACTION_107_goToLibrary() {
_roomObjectAreasTable[_screenLayer2[38719]].area = 1;
--_walkDataLastIndex;
buildWalkPathSimple(266, 123, 319, 120);
@@ -131,35 +131,35 @@ void IgorEngine::PART_24_UPDATE_ROOM_BACKGROUND() {
_gameState.counter[4] = getRandomNumber(89) + 10;
_gameState.unk10 = 0;
if (_gameState.unkF) {
- PART_24_HELPER_3(1);
+ PART_24_HELPER_3_talkingFrameMichael(1);
} else {
- PART_24_HELPER_3(2);
+ PART_24_HELPER_3_talkingFrameMichael(2);
}
_gameState.unkF = !_gameState.unkF;
} else {
++_gameState.unk10;
}
if (_gameState.unkF) {
- PART_24_HELPER_3(getRandomNumber(5) + 1);
+ PART_24_HELPER_3_talkingFrameMichael(getRandomNumber(5) + 1);
} else {
- PART_24_HELPER_2(getRandomNumber(5) + 1);
+ PART_24_HELPER_2_talkingFrameSharon(getRandomNumber(5) + 1);
}
}
}
-void IgorEngine::PART_24_HELPER_1(int num) {
- if (num == 1 || num == 255) {
+void IgorEngine::PART_24_HELPER_1_OBJECT_STATE(int num) {
+ if (num == 1 || num == 255) { // door
if (_objectsState[67] == 0) {
- PART_24_HELPER_4();
+ PART_24_HELPER_4_drawClosedDoor();
_roomActionsTable[2] = 6;
} else {
- PART_24_HELPER_5();
+ PART_24_HELPER_5_drawOpenDoor();
_roomActionsTable[2] = 7;
}
}
}
-void IgorEngine::PART_24_HELPER_2(int frame) {
+void IgorEngine::PART_24_HELPER_2_talkingFrameSharon(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 48; ++i) {
for (int j = 0; j <= 22; ++j) {
@@ -183,7 +183,7 @@ void IgorEngine::PART_24_HELPER_2(int frame) {
}
}
-void IgorEngine::PART_24_HELPER_3(int frame) {
+void IgorEngine::PART_24_HELPER_3_talkingFrameMichael(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 42; ++i) {
for (int j = 0; j <= 21; ++j) {
@@ -207,17 +207,17 @@ void IgorEngine::PART_24_HELPER_3(int frame) {
}
}
-void IgorEngine::PART_24_HELPER_4() {
+void IgorEngine::PART_24_HELPER_4_drawClosedDoor() {
const int offset = 22785;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 33, 33, 55);
}
-void IgorEngine::PART_24_HELPER_5() {
+void IgorEngine::PART_24_HELPER_5_drawOpenDoor() {
const int offset = 22785;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x717, 33, 33, 55);
}
-void IgorEngine::PART_24_HELPER_7() {
+void IgorEngine::PART_24_HELPER_7_enterFromLeft() {
_walkData[0].setPos(0, 138, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 15;
@@ -230,7 +230,7 @@ void IgorEngine::PART_24_HELPER_7() {
waitForIgorMove();
}
-void IgorEngine::PART_24_HELPER_8() {
+void IgorEngine::PART_24_HELPER_8_enterFromRight() {
_walkData[0].setPos(319, 123, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
@@ -245,7 +245,7 @@ void IgorEngine::PART_24_HELPER_8() {
waitForIgorMove();
}
-void IgorEngine::PART_24_HELPER_9() {
+void IgorEngine::PART_24_HELPER_9_enterFromChemistryClass() {
_walkData[0].setPos(68, 116, 3, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
@@ -272,16 +272,16 @@ void IgorEngine::PART_24() {
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);
+ PART_24_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 240) {
- PART_24_HELPER_7();
+ PART_24_HELPER_7_enterFromLeft();
} else if (_currentPart == 241) {
- PART_24_HELPER_8();
+ PART_24_HELPER_8_enterFromRight();
} else if (_currentPart == 242) {
- PART_24_HELPER_9();
+ PART_24_HELPER_9_enterFromChemistryClass();
}
enterPartLoop();
while (_currentPart >= 240 && _currentPart <= 242) {
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index 0d757007006..5ed0291ea3a 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -25,10 +25,10 @@ namespace Igor {
void IgorEngine::PART_25_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // go to left-side
_currentPart = 260;
break;
- case 102:
+ case 102: // look at message board
switch (getRandomNumber(2) + 1) {
case 1:
igorSay(204, 2, 1273);
@@ -41,24 +41,24 @@ void IgorEngine::PART_25_EXEC_ACTION(int action) {
break;
}
break;
- case 103:
+ case 103: // use message board
igorSay(201, 1, 1271);
break;
case 104: // walk to board: nothing happens on arrival
break;
- case 105:
- PART_25_ACTION_105();
+ case 105: // enter men's toilet
+ PART_25_ACTION_105_enterMensToilet();
break;
- case 106:
+ case 106: // look at door
igorSay(203, 1, 1272);
break;
- case 107:
- PART_25_ACTION_107();
+ case 107: // open door
+ PART_25_ACTION_107_openDoor();
break;
- case 108:
- PART_25_ACTION_108();
+ case 108: // close door
+ PART_25_ACTION_108_closeDoor();
break;
- case 109:
+ case 109: // go to corridor
_currentPart = 310;
break;
default:
@@ -67,7 +67,7 @@ void IgorEngine::PART_25_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_25_ACTION_105() {
+void IgorEngine::PART_25_ACTION_105_enterMensToilet() {
if (_objectsState[68] != 0) {
_roomObjectAreasTable[_screenLayer2[34370]].area = 1;
--_walkDataLastIndex;
@@ -79,7 +79,7 @@ void IgorEngine::PART_25_ACTION_105() {
}
}
-void IgorEngine::PART_25_ACTION_107() {
+void IgorEngine::PART_25_ACTION_107_openDoor() {
if (_objectsState[68] == 1) {
EXEC_MAIN_ACTION(11);
return;
@@ -95,10 +95,10 @@ void IgorEngine::PART_25_ACTION_107() {
}
}
_objectsState[68] = 1;
- PART_25_HELPER_1(1);
+ PART_25_HELPER_1_OBJECT_STATE(1);
}
-void IgorEngine::PART_25_ACTION_108() {
+void IgorEngine::PART_25_ACTION_108_closeDoor() {
if (_objectsState[68] == 0) {
EXEC_MAIN_ACTION(14);
return;
@@ -114,22 +114,22 @@ void IgorEngine::PART_25_ACTION_108() {
}
}
_objectsState[68] = 0;
- PART_25_HELPER_1(1);
+ PART_25_HELPER_1_OBJECT_STATE(1);
}
-void IgorEngine::PART_25_HELPER_1(int num) {
- if (num == 1 || num == 255) {
+void IgorEngine::PART_25_HELPER_1_OBJECT_STATE(int num) {
+ if (num == 1 || num == 255) { // door state
if (_objectsState[68] == 0) {
- PART_25_HELPER_5();
+ PART_25_HELPER_5_drawClosedDoor();
_roomActionsTable[31] = 6;
} else {
- PART_25_HELPER_7();
+ PART_25_HELPER_7_drawOpenDoor();
_roomActionsTable[31] = 7;
}
}
}
-void IgorEngine::PART_25_HELPER_2() {
+void IgorEngine::PART_25_HELPER_2_enterFromLeft() {
_walkData[0].setPos(0, 130, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 15;
@@ -142,7 +142,7 @@ void IgorEngine::PART_25_HELPER_2() {
waitForIgorMove();
}
-void IgorEngine::PART_25_HELPER_3() {
+void IgorEngine::PART_25_HELPER_3_enterFromRight() {
_walkData[0].setPos(319, 138, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -154,7 +154,7 @@ void IgorEngine::PART_25_HELPER_3() {
waitForIgorMove();
}
-void IgorEngine::PART_25_HELPER_4() {
+void IgorEngine::PART_25_HELPER_4_enterFromMensToilet() {
_walkData[0].setPos(130, 107, 3, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 0;
@@ -167,12 +167,12 @@ void IgorEngine::PART_25_HELPER_4() {
waitForIgorMove();
}
-void IgorEngine::PART_25_HELPER_5() {
+void IgorEngine::PART_25_HELPER_5_drawClosedDoor() {
const int offset = 22208;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 23, 23, 52);
}
-void IgorEngine::PART_25_HELPER_7() {
+void IgorEngine::PART_25_HELPER_7_drawOpenDoor() {
const int offset = 22208;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x4AC, 23, 23, 52);
}
@@ -187,16 +187,16 @@ void IgorEngine::PART_25() {
_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);
+ PART_25_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 250) {
- PART_25_HELPER_2();
+ PART_25_HELPER_2_enterFromLeft();
} else if (_currentPart == 251) {
- PART_25_HELPER_3();
+ PART_25_HELPER_3_enterFromRight();
} else if (_currentPart == 252) {
- PART_25_HELPER_4();
+ PART_25_HELPER_4_enterFromMensToilet();
}
enterPartLoop();
while (_currentPart >= 250 && _currentPart <= 252) {
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index f59209503ab..f0ed7006196 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -27,37 +27,37 @@ static const uint8 PART_26_ANIM_DATA_1[12] = { 6, 0, 2, 3, 4, 5, 6, 5, 4, 3, 2,
void IgorEngine::PART_26_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // look at plaque
igorSay(202, 1, 1279);
break;
- case 102:
+ case 102: // look at door
igorSay(203, 1, 1280);
break;
case 103:
- PART_26_ACTION_103();
+ PART_26_ACTION_103_openDoor();
break;
case 104:
- PART_26_ACTION_104();
+ PART_26_ACTION_104_closeDoor();
break;
- case 105:
+ case 105: // look at picture
igorSay(224, 2, 1290);
break;
- case 106:
+ case 106: // go to mens toilets corridor
_currentPart = 250;
break;
case 107:
PART_26_ACTION_107();
break;
- case 108:
+ case 108: // talk to miss sullivan
igorSay({ { 216, 2, 1284 }, { 218, 1, 1285 } });
break;
- case 109:
+ case 109: // take miss sullivan
igorSay(219, 1, 1286);
break;
- case 110:
+ case 110: // look at miss sullivan
igorSay({ { 220, 2, 1287 }, { 222, 1, 1288 } });
break;
- case 111:
+ case 111: // use miss sullivan
igorSay(223, 1, 1289);
break;
default:
@@ -66,7 +66,7 @@ void IgorEngine::PART_26_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_26_ACTION_103() {
+void IgorEngine::PART_26_ACTION_103_openDoor() {
if (_objectsState[69] == 1) {
EXEC_MAIN_ACTION(11);
return;
@@ -81,10 +81,10 @@ void IgorEngine::PART_26_ACTION_103() {
}
}
_objectsState[69] = 1;
- PART_26_HELPER_1(1);
+ PART_26_HELPER_1_OBJECT_STATE(1);
}
-void IgorEngine::PART_26_ACTION_104() {
+void IgorEngine::PART_26_ACTION_104_closeDoor() {
if (_objectsState[69] == 0) {
EXEC_MAIN_ACTION(14);
return;
@@ -99,7 +99,7 @@ void IgorEngine::PART_26_ACTION_104() {
}
}
_objectsState[69] = 0;
- PART_26_HELPER_1(1);
+ PART_26_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_26_ACTION_107() {
@@ -121,45 +121,45 @@ void IgorEngine::PART_26_UPDATE_ROOM_BACKGROUND() {
if (_gameState.unk10 == 11) {
_gameState.unk10 = 2;
}
- PART_26_HELPER_7(PART_26_ANIM_DATA_1[_gameState.unk10]);
+ PART_26_HELPER_7_drawMissSullivanFrame(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);
+ PART_26_HELPER_7_drawMissSullivanFrame(_gameState.unk10);
} else if (getRandomNumber(24) == 0) {
_gameState.unk10 = 1;
- PART_26_HELPER_7(_gameState.unk10);
+ PART_26_HELPER_7_drawMissSullivanFrame(_gameState.unk10);
} else if (getRandomNumber(29) == 0) {
_gameState.unk10 = 3;
}
}
}
-void IgorEngine::PART_26_HELPER_1(int num) {
+void IgorEngine::PART_26_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
if (_objectsState[69] == 0) {
- PART_26_HELPER_2();
+ PART_26_HELPER_2_drawClosedDoor();
_roomActionsTable[0x1E] = 6;
} else {
- PART_26_HELPER_3();
+ PART_26_HELPER_3_drawOpenDoor();
_roomActionsTable[0x1E] = 7;
}
}
}
-void IgorEngine::PART_26_HELPER_2() {
+void IgorEngine::PART_26_HELPER_2_drawClosedDoor() {
const int offset = 19870;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 25, 25, 65);
}
-void IgorEngine::PART_26_HELPER_3() {
+void IgorEngine::PART_26_HELPER_3_drawOpenDoor() {
const int offset = 19870;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x659, 25, 25, 65);
}
-void IgorEngine::PART_26_HELPER_4() {
+void IgorEngine::PART_26_HELPER_4_enterFromRight() {
_walkData[0].setPos(319, 125, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -171,7 +171,7 @@ void IgorEngine::PART_26_HELPER_4() {
waitForIgorMove();
}
-void IgorEngine::PART_26_HELPER_5() {
+void IgorEngine::PART_26_HELPER_5_enterFromLaboratory() {
_walkData[0].setPos(0, 115, 3, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 2;
@@ -192,11 +192,11 @@ void IgorEngine::PART_26_HELPER_5() {
_currentAction.verb = kVerbWalk;
drawInventory(_inventoryInfo[72], 0);
playSound(51, 1);
- PART_26_HELPER_1(255);
+ PART_26_HELPER_1_OBJECT_STATE(255);
}
}
-void IgorEngine::PART_26_HELPER_7(int frame) {
+void IgorEngine::PART_26_HELPER_7_drawMissSullivanFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 39; ++i) {
for (int j = 0; j <= 21; ++j) {
@@ -229,15 +229,15 @@ void IgorEngine::PART_26() {
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);
+ PART_26_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
_gameState.unk10 = true;
fadeIn(768);
if (_currentPart == 260) {
- PART_26_HELPER_4();
+ PART_26_HELPER_4_enterFromRight();
} else {
- PART_26_HELPER_5();
+ PART_26_HELPER_5_enterFromLaboratory();
}
enterPartLoop();
while (_currentPart >= 260 && _currentPart <= 261) {
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index d7c30855518..66c4111d8f4 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -32,7 +32,7 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
if (_objectsState[85] == 0) {
igorSay(216, 2, 1173);
_objectsState[85] = 1;
- PART_27_HELPER_1(255);
+ PART_27_HELPER_1_OBJECT_STATE(255);
} else {
igorSay(201, 1, 1162);
}
@@ -46,22 +46,22 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
case 105: // look at philips locker
igorSay(205, 1, 1165);
break;
- case 106:
+ case 106: // open Philip's locker
PART_27_ACTION_106_openPhilipLocker();
break;
case 107:
- PART_27_ACTION_107();
+ PART_27_ACTION_107_closeLocker();
break;
case 108:
- PART_27_ACTION_108();
+ PART_27_ACTION_108_openLocker();
break;
- case 109:
+ case 109: // look at bottles
igorSay(215, 1, 1172);
break;
case 110:
- PART_27_ACTION_110();
+ PART_27_ACTION_110_useFlaskOnLocker();
break;
- case 111:
+ case 111: // look at messageboard
igorSay(218, 2, 1174);
break;
case 112: // look at plaque
@@ -100,10 +100,10 @@ void IgorEngine::PART_27_ACTION_106_openPhilipLocker() {
}
}
_objectsState[84] = 1;
- PART_27_HELPER_1(1);
+ PART_27_HELPER_1_OBJECT_STATE(1);
}
-void IgorEngine::PART_27_ACTION_107() {
+void IgorEngine::PART_27_ACTION_107_closeLocker() {
if (_objectsState[84] == 0) {
EXEC_MAIN_ACTION(14);
return;
@@ -117,10 +117,10 @@ void IgorEngine::PART_27_ACTION_107() {
}
}
_objectsState[84] = 0;
- PART_27_HELPER_1(1);
+ PART_27_HELPER_1_OBJECT_STATE(1);
}
-void IgorEngine::PART_27_ACTION_108() {
+void IgorEngine::PART_27_ACTION_108_openLocker() {
if (_inventoryInfo[58] > 0 || _objectsState[42] == 2) {
igorSay(208, 1, 1168);
return;
@@ -134,13 +134,13 @@ void IgorEngine::PART_27_ACTION_108() {
}
}
addObjectToInventory(23, 58);
- PART_27_HELPER_1(1);
+ PART_27_HELPER_1_OBJECT_STATE(1);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
}
-void IgorEngine::PART_27_ACTION_110() {
+void IgorEngine::PART_27_ACTION_110_useFlaskOnLocker() {
igorSayAndWait({ { 212, 1, 1170 }, { 213, 2, 1171 } });
const int offset = 25012;
for (int i = 1; i <= 2; ++i) {
@@ -150,21 +150,21 @@ void IgorEngine::PART_27_ACTION_110() {
}
}
removeObjectFromInventory(55);
- PART_27_HELPER_1(255);
+ PART_27_HELPER_1_OBJECT_STATE(255);
_objectsState[107] = 1;
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
}
-void IgorEngine::PART_27_HELPER_1(int num) {
+void IgorEngine::PART_27_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
if (_objectsState[84] == 0) {
- PART_27_HELPER_3();
+ PART_27_HELPER_3_drawClosedLocker();
_roomActionsTable[3] = 6;
_roomObjectAreasTable[6].object = 3;
} else {
- PART_27_HELPER_4();
+ PART_27_HELPER_4_drawOpenLocker();
_roomActionsTable[3] = 7;
_roomObjectAreasTable[6].object = 4;
}
@@ -179,7 +179,7 @@ void IgorEngine::PART_27_HELPER_1(int num) {
}
}
-void IgorEngine::PART_27_HELPER_2() {
+void IgorEngine::PART_27_HELPER_2_enterFromLeft() {
_walkData[0].setPos(0, 132, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -191,17 +191,17 @@ void IgorEngine::PART_27_HELPER_2() {
waitForIgorMove();
}
-void IgorEngine::PART_27_HELPER_3() {
+void IgorEngine::PART_27_HELPER_3_drawClosedLocker() {
const int offset = 21816;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 26, 26, 48);
}
-void IgorEngine::PART_27_HELPER_4() {
+void IgorEngine::PART_27_HELPER_4_drawOpenLocker() {
const int offset = 21816;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x4E0, 26, 26, 48);
}
-void IgorEngine::PART_27_HELPER_5() {
+void IgorEngine::PART_27_HELPER_5_enterFromLibrary() {
_walkData[0].setPos(270, 134, 4, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 0;
@@ -222,14 +222,14 @@ void IgorEngine::PART_27() {
_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);
+ PART_27_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 270) {
- PART_27_HELPER_2();
+ PART_27_HELPER_2_enterFromLeft();
} else {
- PART_27_HELPER_5();
+ PART_27_HELPER_5_enterFromLibrary();
}
enterPartLoop();
while (_currentPart == 270 || _currentPart == 271) {
Commit: c15a7779147455f367b4b56200449a920c07acfa
https://github.com/scummvm/scummvm/commit/c15a7779147455f367b4b56200449a920c07acfa
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:39+01:00
Commit Message:
IGOR: Fixes Caroline talking animation fighting her idle animation
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_28.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 5b792a8ea88..18d5b61f3cd 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1005,15 +1005,15 @@ private:
// college corridor caroline
void PART_28_EXEC_ACTION(int action);
- void PART_28_ACTION_108();
- void PART_28_ACTION_109();
+ void PART_28_ACTION_108_talkCaroline();
+ void PART_28_ACTION_109_takeFolder();
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_1_OBJECT_STATE(int num);
+ void PART_28_HELPER_2_drawCaroline();
+ void PART_28_HELPER_3_enterFromRight();
+ void PART_28_HELPER_5_drawCarolineTalkingFrame(int frame);
+ void PART_28_HELPER_6_enterAndCheckGrades();
void PART_28_HELPER_8(int frame);
void PART_28();
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index 6d1d48ffbd4..e1313763ce2 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -26,48 +26,48 @@ namespace Igor {
void IgorEngine::PART_28_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // leave
_currentPart = 230;
break;
- case 102:
+ case 102: // read plaque
igorSay(201, 1, 1226);
break;
- case 103:
+ case 103: // look at door
igorSay(202, 1, 1227);
break;
- case 104:
+ case 104: // look at file
igorSay(203, 1, 1228);
break;
- case 105:
+ case 105: // look at Caroline
igorSay(204, 1, 1229);
break;
- case 106:
+ case 106: // look at message board
if (_objectsState[111] == 0) {
igorSay({ { 205, 1, 1230 }, { 206, 1, 1231 } });
} else {
igorSay(234, 1, 1253);
}
break;
- case 107:
+ case 107: // look at plant
igorSay(237, 1, 1256);
break;
case 108:
- PART_28_ACTION_108();
+ PART_28_ACTION_108_talkCaroline();
break;
case 109:
- PART_28_ACTION_109();
+ PART_28_ACTION_109_takeFolder();
break;
- case 110:
+ case 110: // open door
igorSay({ { 228, 1, 1248 }, { 229, 1, 1249 } });
break;
- case 111:
+ case 111: // give folder to caroline
if (_objectsState[3] == 0) {
igorSay(226, 1, 1246);
} else {
igorSay(227, 1, 1247);
}
break;
- case 112:
+ case 112: // use caroline
igorSay(235, 1, 1254);
break;
case 113:
@@ -79,9 +79,13 @@ void IgorEngine::PART_28_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_28_ACTION_108() {
+// Caroline's idle animation is only driven by the room loop and while Igor speaks;
+// her own talking loops never run it, otherwise it fights the talking frames.
+void IgorEngine::PART_28_ACTION_108_talkCaroline() {
+ const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
if (_objectsState[111] == 1) {
igorSayAndWait(218, 1, 1241);
+ _updateRoomBackground = 0;
cutsceneSayStart(182, 81, 63, 17, 17, { { 211, 1, 1235 }, { 212, 1, 1236 }, { 213, 2, 1237 }, { 215, 1, 1238 }, { 216, 1, 1239 } });
_updateDialogue = &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE;
waitForEndOfCutsceneDialogue(182, 81, 63, 17, 17);
@@ -90,6 +94,7 @@ void IgorEngine::PART_28_ACTION_108() {
startCutsceneDialogue(182, 81, 63, 17, 17);
waitForEndOfCutsceneDialogue(182, 81, 63, 17, 17);
_updateDialogue = 0;
+ _updateRoomBackground = updateRoomBackground;
--_walkDataLastIndex;
buildWalkPath(213, 131, 160, 140);
_walkDataCurrentIndex = 1;
@@ -105,14 +110,16 @@ void IgorEngine::PART_28_ACTION_108() {
} else {
igorSayAndWait(218, 1, 1241);
}
+ _updateRoomBackground = 0;
if (_objectsState[87] < 2) {
cutsceneSayWithCallback(182, 81, 63, 17, 17, 208, 1, 1233, &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE);
} else {
cutsceneSayWithCallback(182, 81, 63, 17, 17, { { 219, 2, 1242 }, { 221, 1, 1243 } }, &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE);
}
+ _updateRoomBackground = updateRoomBackground;
}
-void IgorEngine::PART_28_ACTION_109() {
+void IgorEngine::PART_28_ACTION_109_takeFolder() {
for (int i = 1; i <= 7; ++i) {
const int offset = 25067;
drawAnimRect(offset, i * 1085 + 0x5EC9, 31, 35);
@@ -122,7 +129,7 @@ void IgorEngine::PART_28_ACTION_109() {
}
addObjectToInventory(22, 57);
_objectsState[87] = 1;
- PART_28_HELPER_1(255);
+ PART_28_HELPER_1_OBJECT_STATE(255);
igorSay(230, 1, 1250);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
@@ -132,10 +139,10 @@ void IgorEngine::PART_28_ACTION_109() {
void IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_28_HELPER_5(7);
+ PART_28_HELPER_5_drawCarolineTalkingFrame(7);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_28_HELPER_5(getRandomNumber(4) + 7);
+ PART_28_HELPER_5_drawCarolineTalkingFrame(getRandomNumber(4) + 7);
break;
}
}
@@ -143,14 +150,14 @@ void IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE(int action) {
void IgorEngine::PART_28_UPDATE_ROOM_BACKGROUND() {
if (compareGameTick(61)) {
if (_gameState.unk10 > 2) {
- PART_28_HELPER_5(_gameState.unk10);
+ PART_28_HELPER_5_drawCarolineTalkingFrame(_gameState.unk10);
if (_gameState.unk10 < 6) {
++_gameState.unk10;
} else {
_gameState.unk10 = 1;
}
} else {
- PART_28_HELPER_5(_gameState.unk10);
+ PART_28_HELPER_5_drawCarolineTalkingFrame(_gameState.unk10);
if (_gameState.unk10 == 1) {
_gameState.unk10 = 2;
} else {
@@ -163,7 +170,7 @@ void IgorEngine::PART_28_UPDATE_ROOM_BACKGROUND() {
}
}
-void IgorEngine::PART_28_HELPER_1(int num) {
+void IgorEngine::PART_28_HELPER_1_OBJECT_STATE(int num) {
WRITE_LE_UINT16(_roomActionsTable + 0x56, 42133);
if (num == 2 || num == 255) {
if (_objectsState[87] == 0) {
@@ -175,12 +182,12 @@ void IgorEngine::PART_28_HELPER_1(int num) {
}
}
-void IgorEngine::PART_28_HELPER_2() {
+void IgorEngine::PART_28_HELPER_2_drawCaroline() {
const int offset = 27374;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 30, 30, 44);
}
-void IgorEngine::PART_28_HELPER_3() {
+void IgorEngine::PART_28_HELPER_3_enterFromRight() {
_walkData[0].setPos(319, 142, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -193,7 +200,7 @@ void IgorEngine::PART_28_HELPER_3() {
waitForIgorMove();
}
-void IgorEngine::PART_28_HELPER_5(int frame) {
+void IgorEngine::PART_28_HELPER_5_drawCarolineTalkingFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 43; ++i) {
for (int j = 0; j <= 29; ++j) {
@@ -217,13 +224,13 @@ void IgorEngine::PART_28_HELPER_5(int frame) {
}
}
-void IgorEngine::PART_28_HELPER_6() {
+void IgorEngine::PART_28_HELPER_6_enterAndCheckGrades() {
setupDefaultPalette();
SET_PAL_240_48_1();
SET_PAL_208_96_1();
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
- PART_28_HELPER_1(255);
+ PART_28_HELPER_1_OBJECT_STATE(255);
fadeIn(768);
_walkData[0].setPos(319, 142, 4, 0);
_walkData[0].setDefaultScale();
@@ -264,23 +271,18 @@ void IgorEngine::PART_28() {
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);
+ PART_28_HELPER_2_drawCaroline();
+ PART_28_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- // cseg123:2E04 -- the original's only write to the background-animation frame
- // counter (s3:0xEB2C) is an unconditional set to 1 in this room's setup, made
- // before the state dispatch below. PART_28_HELPER_5() forms its source address
- // as animBase + frame * 1320 + i * 30 + j - 1320 (cseg123:0B7-0D5), so the frame
- // is 1-based and a counter of 0 reads 1320 bytes before _animFramesBuffer.
- // Without this the first background update reads out of bounds.
+
if (!restoreRoomAfterLoad()) {
_gameState.unk10 = 1;
_currentAction.verb = kVerbWalk;
if (_currentPart == 280) {
fadeIn(768);
- PART_28_HELPER_3();
+ PART_28_HELPER_3_enterFromRight();
} else if (_currentPart == 281) {
- PART_28_HELPER_6();
+ PART_28_HELPER_6_enterAndCheckGrades();
}
}
enterPartLoop();
Commit: b215bc1f1174a0e4c47ad751be0b8784514cf8ee
https://github.com/scummvm/scummvm/commit/b215bc1f1174a0e4c47ad751be0b8784514cf8ee
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:39+01:00
Commit Message:
IGOR: Implements parts 77 and 78
Changed paths:
A engines/igor/parts/part_77.cpp
A engines/igor/parts/part_78.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_30.cpp
engines/igor/parts/part_31.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 18d5b61f3cd..8ef7e7c007e 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -528,6 +528,8 @@ private:
// scratch of the room loops: the current ambient frame (a star in part 72, the screen in part 68)
uint8 _roomAmbientIndex;
// the two fireflies of room 69: the current frame of each and the steps of the first one since the second one started
+ // frames of the band drawn across the picture in state 780 (loaded while the scene lasts)
+ uint8 *_part78BandFrames = nullptr;
uint8 _part69FireflyFrameA;
uint8 _part69FireflyFrameB;
uint16 _part69FireflyStepCount;
@@ -1023,7 +1025,7 @@ private:
void PART_30_ACTION_104_goDownstairs();
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_1_OBJECT_STATE(int num);
void PART_30_HELPER_2_walkInFromLeft();
void PART_30_HELPER_3_walkInFromUpstairs();
void PART_30_HELPER_2_walkInFromOutside();
@@ -1038,17 +1040,17 @@ private:
// 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_ACTION_103_openDoor();
+ void PART_31_ACTION_106_goDownstairs();
+ void PART_31_ACTION_110_openDoor2();
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_HELPER_1_OBJECT_STATE(int num);
+ void PART_31_HELPER_2_drawJohnnyFrame(int frame);
+ void PART_31_HELPER_3_enterFromLeft();
+ void PART_31_HELPER_4_enterFromAstronomyLab();
+ void PART_31_HELPER_5_enterFromDownstairs();
+ void PART_31_HELPER_6_enterFromRight();
+ void PART_31_HELPER_9_drawOpenDoor();
void PART_31();
// telescope room
@@ -1253,6 +1255,37 @@ private:
void PART_72_UPDATE_ROOM_BACKGROUND();
void PART_72();
+ void PART_77_EXEC_ACTION(int action);
+ void PART_77_APPLY_OBJECT_STATE();
+ void PART_77_SET_AREAS_LIGHT(int lum);
+ void PART_77_CLEAR_ENTRY_AREAS();
+ void PART_77_SET_Y_SCALE_RAMP();
+ void PART_77_SET_Y_SCALE_UNIFORM();
+ void PART_77_DRAW_FRAME(int frame);
+ void PART_77_UPDATE_DIALOGUE(int action);
+ void PART_77_ACTION_101_exitToStairs();
+ void PART_77_ACTION_105_leave();
+ void PART_77_ACTION_106_cutscene();
+ void PART_77_ENTER_FROM_MAP();
+ void PART_77_ENTER_FROM_STAIRS();
+ void PART_77();
+
+ void PART_78_DRAW_FIGURE(int frame);
+ void PART_78_DRAW_BACKGROUND_FRAME(int frame);
+ void PART_78_DRAW_BAND(int frame);
+ void PART_78_DRAW_PATCH(int frame);
+ void PART_78_UPDATE_DIALOGUE_FIGURE_A(int action);
+ void PART_78_UPDATE_DIALOGUE_FIGURE_B(int action);
+ void PART_78_UPDATE_DIALOGUE_FIGURE_C(int action);
+ void PART_78_UPDATE_DIALOGUE_BAND_A(int action);
+ void PART_78_UPDATE_DIALOGUE_BAND_B(int action);
+ void PART_78_UPDATE_DIALOGUE_PATCH(int action);
+ void PART_78_SAY_START(int speaker, const Common::Array<DialogueText> &lines);
+ void PART_78_WAIT_FOR_LINES(int speaker);
+ void PART_78_SAY(int speaker, const Common::Array<DialogueText> &lines);
+ void PART_78_INTERJECTION(int which);
+ void PART_78();
+
// maze
static const MazeNode MAZE_NODES[108];
static const MazeRoom *getMazeRoom(int part);
@@ -1273,7 +1306,7 @@ private:
void UPDATE_OBJECT_STATE(int num);
void PART_UPDATE_FIGURES_ON_PAPER(int delay);
- void PART_MEANWHILE();
+ void PART_MEANWHILE(int img = IMG_Meanwhile);
// Margaret cutscenes
void PART_MARGARET_ROOM_CUTSCENE_HELPER_1();
@@ -1351,7 +1384,7 @@ private:
void buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, int dstY);
typedef void (IgorEngine::*IgorMoveTick)();
// tick: room effect that runs on every iteration while Igor walks (rooms with their own wait loop)
- bool waitForIgorMove(IgorMoveTick tick = 0, bool escapeSkips = false, bool forceSkip = false);
+ bool waitForIgorMove(IgorMoveTick tick = 0, bool escapeSkips = false, bool forceSkip = false, int fixedPosNum = -1);
void moveIgor(int pos, int frame);
@@ -1527,6 +1560,7 @@ protected:
static const RoomDataOffsets PART_70_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_71_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_72_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_77_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_81_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
static const uint8 _inventoryOffsetTable[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 2c99b69993e..50298b20a92 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -58,6 +58,8 @@ MODULE_OBJS = \
parts/part_72.o \
parts/part_74.o \
parts/part_75.o \
+ parts/part_77.o \
+ parts/part_78.o \
parts/part_81.o \
parts/part_85.o \
parts/part_90.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 4f66fc9e2ce..8d98b16483a 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -684,6 +684,13 @@ void IgorEngine::PART_MAIN() {
case 750:
PART_75(); // philip vodka cutscene
break;
+ case 770:
+ case 771:
+ PART_77();
+ break;
+ case 780:
+ PART_78(); // cutscene in the lecture hall
+ break;
case 810:
PART_81();
break;
@@ -836,13 +843,13 @@ void IgorEngine::PART_UPDATE_FIGURES_ON_PAPER(int delay) {
free(framesOffsets);
}
-void IgorEngine::PART_MEANWHILE() {
+void IgorEngine::PART_MEANWHILE(int img) {
hideCursor();
memset(_currentPalette, 0, 768);
setPaletteRange(208, 255);
// clears the verbs and inventory panels area
memset(_screenVGA + 46080, 0, 17920);
- loadData(IMG_Meanwhile, _screenVGA);
+ loadData(img, _screenVGA);
_paletteBuffer[3] = 63;
_paletteBuffer[4] = 32;
_paletteBuffer[5] = 0;
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index 27ef4fcbdde..7d35456a0fe 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -32,13 +32,13 @@ void IgorEngine::PART_30_EXEC_ACTION(int action) {
case 102:
PART_30_ACTION_102_goUpstairs();
break;
- case 103:
+ case 103: // look at upward stairs
igorSay(201, 1, 450);
break;
case 104:
PART_30_ACTION_104_goDownstairs();
break;
- case 105:
+ case 105: // look at downward stairs
igorSay(202, 1, 451);
break;
case 106:
@@ -112,7 +112,7 @@ void IgorEngine::PART_30_HANDLE_DIALOGUE_LAURA() {
_updateDialogue = 0;
}
-void IgorEngine::PART_30_HELPER_1(int num) {
+void IgorEngine::PART_30_HELPER_1_OBJECT_STATE(int num) {
}
void IgorEngine::PART_30_HELPER_2_walkInFromLeft() {
@@ -227,7 +227,7 @@ void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
drawInventory(_inventoryInfo[72], 0);
_currentAction.verb = kVerbWalk;
_objectsState[73] = 1;
- PART_30_HELPER_1(255);
+ PART_30_HELPER_1_OBJECT_STATE(255);
}
void IgorEngine::lauraAndIgorBumpIntoEachOther() {
@@ -276,7 +276,7 @@ void IgorEngine::PART_30() {
_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);
+ PART_30_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index 5ccaefec426..ed8c8e0f2ca 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -37,7 +37,7 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
PART_31_ACTION_102();
break;
case 103:
- PART_31_ACTION_103();
+ PART_31_ACTION_103_openDoor();
break;
case 104:
if (_objectsState[72] == 0) {
@@ -50,7 +50,7 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
igorSay(201, 1, 881);
break;
case 106:
- PART_31_ACTION_106();
+ PART_31_ACTION_106_goDownstairs();
break;
case 107:
igorSay(203, 1, 883);
@@ -62,7 +62,7 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
igorSay(204, 1, 884);
break;
case 110:
- PART_31_ACTION_110();
+ PART_31_ACTION_110_openDoor2();
break;
case 111:
igorSay(206, 2, 886);
@@ -110,7 +110,7 @@ void IgorEngine::PART_31_ACTION_102() {
_currentPart = 320;
}
-void IgorEngine::PART_31_ACTION_103() {
+void IgorEngine::PART_31_ACTION_103_openDoor() {
if (_objectsState[72] == 1) {
EXEC_MAIN_ACTION(11);
return;
@@ -126,7 +126,7 @@ void IgorEngine::PART_31_ACTION_103() {
igorSay(202, 1, 882);
}
-void IgorEngine::PART_31_ACTION_106() {
+void IgorEngine::PART_31_ACTION_106_goDownstairs() {
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[36326]].area = 2;
buildWalkPath(166, 120, 166, 113);
@@ -155,7 +155,7 @@ void IgorEngine::PART_31_ACTION_106() {
_currentPart = 301;
}
-void IgorEngine::PART_31_ACTION_110() {
+void IgorEngine::PART_31_ACTION_110_openDoor2() {
if (_objectsState[72] == 1) {
EXEC_MAIN_ACTION(11);
return;
@@ -172,7 +172,7 @@ void IgorEngine::PART_31_ACTION_110() {
}
}
_objectsState[72] = 1;
- PART_31_HELPER_1(1);
+ PART_31_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() {
@@ -189,23 +189,23 @@ void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() {
if (_gameState.igorMoving) {
if (_gameState.unk10 == 1 || _gameState.unk10 == 2) {
_gameState.unk10 = 3;
- PART_31_HELPER_2(_gameState.unk10);
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
return;
} else if (_gameState.unk10 == 3) {
_gameState.unk10 = 4;
- PART_31_HELPER_2(_gameState.unk10);
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
return;
} else if (_gameState.unk10 == 4) {
if (getRandomNumber(29) == 0) {
_gameState.unk10 = 5;
- PART_31_HELPER_2(_gameState.unk10);
+ PART_31_HELPER_2_drawJohnnyFrame(_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);
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
return;
} else {
++_gameState.counter[4];
@@ -215,12 +215,12 @@ void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() {
} else {
if (_gameState.unk10 == 4 || _gameState.unk10 == 5) {
_gameState.unk10 = 3;
- PART_31_HELPER_2(_gameState.unk10);
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
return;
}
if (_gameState.unk10 == 1 || _gameState.unk10 == 3) {
_gameState.unk10 = 2;
- PART_31_HELPER_2(_gameState.unk10);
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
return;
}
}
@@ -232,7 +232,7 @@ void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() {
} else {
_gameState.unk10 = 2;
}
- PART_31_HELPER_2(_gameState.unk10);
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
return;
}
}
@@ -242,22 +242,22 @@ void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() {
} else {
_gameState.unk10 = 1;
}
- PART_31_HELPER_2(_gameState.unk10);
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
}
}
-void IgorEngine::PART_31_HELPER_1(int num) {
+void IgorEngine::PART_31_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
if (_objectsState[72] == 0) {
_roomActionsTable[74] = 6;
} else {
- PART_31_HELPER_9();
+ PART_31_HELPER_9_drawOpenDoor();
_roomActionsTable[74] = 7;
}
}
}
-void IgorEngine::PART_31_HELPER_2(int frame) {
+void IgorEngine::PART_31_HELPER_2_drawJohnnyFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 42; ++i) {
for (int j = 0; j <= 30; ++j) {
@@ -279,7 +279,7 @@ void IgorEngine::PART_31_HELPER_2(int frame) {
}
}
-void IgorEngine::PART_31_HELPER_3() {
+void IgorEngine::PART_31_HELPER_3_enterFromLeft() {
_walkData[0].setPos(0, 137, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 15;
@@ -292,7 +292,7 @@ void IgorEngine::PART_31_HELPER_3() {
waitForIgorMove();
}
-void IgorEngine::PART_31_HELPER_4() {
+void IgorEngine::PART_31_HELPER_4_enterFromAstronomyLab() {
_walkData[0].setPos(47, 63, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 30;
@@ -316,7 +316,7 @@ void IgorEngine::PART_31_HELPER_4() {
waitForIgorMove();
}
-void IgorEngine::PART_31_HELPER_5() {
+void IgorEngine::PART_31_HELPER_5_enterFromDownstairs() {
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
_walkCurrentPos = 3;
@@ -350,7 +350,7 @@ void IgorEngine::PART_31_HELPER_5() {
waitForIgorMove();
}
-void IgorEngine::PART_31_HELPER_6() {
+void IgorEngine::PART_31_HELPER_6_enterFromRight() {
_walkData[0].setPos(319, 138, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -362,7 +362,7 @@ void IgorEngine::PART_31_HELPER_6() {
waitForIgorMove();
}
-void IgorEngine::PART_31_HELPER_9() {
+void IgorEngine::PART_31_HELPER_9_drawOpenDoor() {
const int offset = 20256;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x562, 26, 26, 53);
}
@@ -378,20 +378,20 @@ void IgorEngine::PART_31() {
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);
+ PART_31_HELPER_1_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
_gameState.unk10 = 4;
- PART_31_HELPER_2(_gameState.unk10);
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
fadeIn(768);
if (_currentPart == 310) {
- PART_31_HELPER_3();
+ PART_31_HELPER_3_enterFromLeft();
} else if (_currentPart == 311) {
- PART_31_HELPER_4();
+ PART_31_HELPER_4_enterFromAstronomyLab();
} else if (_currentPart == 312) {
- PART_31_HELPER_5();
+ PART_31_HELPER_5_enterFromDownstairs();
} else if (_currentPart == 313) {
- PART_31_HELPER_6();
+ PART_31_HELPER_6_enterFromRight();
}
enterPartLoop();
while (_currentPart >= 310 && _currentPart <= 313) {
diff --git a/engines/igor/parts/part_77.cpp b/engines/igor/parts/part_77.cpp
new file mode 100644
index 00000000000..2265d86e62b
--- /dev/null
+++ b/engines/igor/parts/part_77.cpp
@@ -0,0 +1,372 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// The animation resource starts with the frames and ends with the table of their offsets.
+static const int kPart77FramesTable = 0x67D2;
+
+// Frame shown when a line ends; while a line goes on one of this and the next four frames is picked at random.
+static const int kPart77StandingFrame = 40;
+
+// Where the lines of the cutscene are shown.
+static const int kPart77TextX = 120;
+static const int kPart77TextY = 40;
+
+// Areas that get another value for the walk that leaves the room and go back to 0 after the walks that enter it.
+static const int kPart77ScriptedAreas[8] = { 5, 10, 11, 13, 16, 17, 26, 28 };
+static const int kPart77ScriptedAreaValues[8] = { 1, 2, 2, 2, 3, 4, 4, 4 };
+
+// Areas whose first light limit is changed while Igor leaves the room.
+static const int kPart77LightAreas[4] = { 23, 26, 27, 32 };
+
+// Positions of the picture whose area is set to 4 while a scripted walk from or to them is built.
+static const int kPart77TopPointOffset = 115 * 320 + 65;
+static const int kPart77BottomPointOffset = 140 * 320 + 36;
+
+// Frames shown for 46 ticks each, between the frames 6 to 16 and the frames 19 to 21.
+static const uint8 kPart77CutsceneFrames[6] = { 17, 18, 17, 18, 17, 18 };
+
+void IgorEngine::PART_77_EXEC_ACTION(int action) {
+ switch (action) {
+ case 101:
+ PART_77_ACTION_101_exitToStairs();
+ break;
+ case 102:
+ igorSay(209, 1, 1125);
+ break;
+ case 103:
+ igorSay(203, 3, 1122);
+ break;
+ case 104:
+ igorSay(201, 2, 1121);
+ break;
+ case 105:
+ PART_77_ACTION_105_leave();
+ break;
+ case 106:
+ PART_77_ACTION_106_cutscene();
+ break;
+ default:
+ error("PART_77_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+/**
+ * The object of area 15.
+ */
+void IgorEngine::PART_77_APPLY_OBJECT_STATE() {
+ _roomObjectAreasTable[15].object = 2;
+}
+
+/**
+ * First light limit of the areas of the room that change while Igor leaves it.
+ */
+void IgorEngine::PART_77_SET_AREAS_LIGHT(int lum) {
+ for (int i = 0; i < 4; ++i) {
+ _roomObjectAreasTable[kPart77LightAreas[i]].y1Lum = lum;
+ }
+}
+
+void IgorEngine::PART_77_CLEAR_ENTRY_AREAS() {
+ for (int i = 0; i < 8; ++i) {
+ _roomObjectAreasTable[kPart77ScriptedAreas[i]].area = 0;
+ }
+}
+
+/**
+ * Size of Igor by row: it grows by one every four rows from row 17 to row 85 and stays the same below.
+ */
+void IgorEngine::PART_77_SET_Y_SCALE_RAMP() {
+ for (int i = 0x11; i <= 0x55; ++i) {
+ _walkYScaleRoom[i] = ((i - 13) >> 2) + 5;
+ }
+ for (int i = 0x56; i <= 0x87; ++i) {
+ _walkYScaleRoom[i] = 0x17;
+ }
+}
+
+void IgorEngine::PART_77_SET_Y_SCALE_UNIFORM() {
+ for (int i = 0x11; i <= 0x87; ++i) {
+ _walkYScaleRoom[i] = 0x32;
+ }
+}
+
+void IgorEngine::PART_77_DRAW_FRAME(int frame) {
+ decodeAnimFrame(getAnimFrame(0, kPart77FramesTable, frame), _screenVGA, true);
+}
+
+void IgorEngine::PART_77_UPDATE_DIALOGUE(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_77_DRAW_FRAME(kPart77StandingFrame);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_77_DRAW_FRAME(kPart77StandingFrame + getRandomNumber(4));
+ break;
+ }
+}
+
+/**
+ * Igor walks to the exit at the right of the picture and the story goes on in state 302.
+ */
+void IgorEngine::PART_77_ACTION_101_exitToStairs() {
+ _roomObjectAreasTable[_screenLayer2[68 * 320 + 274]].area = 8;
+ _roomObjectAreasTable[_screenLayer2[74 * 320 + 243]].area = 8;
+ --_walkDataLastIndex;
+ buildWalkPath(243, 77, 243, 74);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ --_walkDataLastIndex;
+ buildWalkPath(243, 74, 274, 68);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _currentPart = 302;
+}
+
+/**
+ * Igor walks away into the distance in three walks and the story goes on in state 40.
+ */
+void IgorEngine::PART_77_ACTION_105_leave() {
+ for (int i = 0; i < 8; ++i) {
+ _roomObjectAreasTable[kPart77ScriptedAreas[i]].area = kPart77ScriptedAreaValues[i];
+ }
+ --_walkDataLastIndex;
+ buildWalkPath(45, 95, 41, 86);
+ _walkDataCurrentIndex = 1;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ bool skipped = waitForIgorMove(0, true, false);
+
+ PART_77_SET_AREAS_LIGHT(0x8F);
+ --_walkDataLastIndex;
+ _roomObjectAreasTable[_screenLayer2[kPart77BottomPointOffset]].area = 4;
+ buildWalkPath(41, 86, 36, 143);
+ _roomObjectAreasTable[_screenLayer2[kPart77BottomPointOffset]].area = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ skipped |= waitForIgorMove(0, true, skipped, 1);
+
+ PART_77_SET_Y_SCALE_RAMP();
+ WalkData *wd = &_walkData[0];
+ wd->setPos(65, 115, 1, 0);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 14;
+ wd->scaleWidth = 23;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 23;
+ _walkDataLastIndex = 0;
+ _roomObjectAreasTable[_screenLayer2[kPart77TopPointOffset]].area = 4;
+ buildWalkPath(65, 115, 21, 17);
+ _roomObjectAreasTable[_screenLayer2[kPart77TopPointOffset]].area = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove(0, true, skipped);
+ _currentPart = 40;
+}
+
+/**
+ * Igor walks to (124, 88), the scene plays and the story goes on in state 760.
+ */
+void IgorEngine::PART_77_ACTION_106_cutscene() {
+ memset(_screenVGA + 46080, 0, 17920);
+ --_walkDataLastIndex;
+ _roomObjectAreasTable[_screenLayer2[88 * 320 + 124]].area = 5;
+ buildWalkPath(_walkData[_walkDataLastIndex].x, _walkData[_walkDataLastIndex].y, 124, 88);
+ _walkDataCurrentIndex = 1;
+ _walkData[_walkDataLastIndex].posNum = 2;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+
+ for (int i = 1; i <= 5; ++i) {
+ PART_77_DRAW_FRAME(i);
+ waitForTimer(31);
+ }
+ igorSayAndWait(206, 2, 1123);
+ for (int i = 6; i <= 16; ++i) {
+ PART_77_DRAW_FRAME(i);
+ waitForTimer(31);
+ }
+ for (int i = 0; i < 6; ++i) {
+ PART_77_DRAW_FRAME(kPart77CutsceneFrames[i]);
+ waitForTimer(46);
+ }
+ for (int i = 19; i <= 21; ++i) {
+ PART_77_DRAW_FRAME(i);
+ waitForTimer(46);
+ }
+ _walkData[_walkDataLastIndex - 1].x = 155;
+ _walkData[_walkDataLastIndex - 1].y = 75;
+ igorSay(208, 1, 1124);
+ waitForEndOfIgorDialogue(false);
+ waitForTimer(255);
+ for (int i = 22; i <= 39; ++i) {
+ PART_77_DRAW_FRAME(i);
+ waitForTimer(31);
+ }
+ cutsceneSayWithCallback(kPart77TextX, kPart77TextY, 63, 57, 0,
+ { { 210, 2, 1126 }, { 212, 2, 1127 }, { 214, 1, 1128 }, { 215, 2, 1129 }, { 217, 2, 1130 } },
+ &IgorEngine::PART_77_UPDATE_DIALOGUE);
+ waitForTimer(255);
+ // the colors 240 to 255 are black on the screen
+ for (int i = 240; i <= 255; ++i) {
+ setPaletteColor(i, 0, 0, 0);
+ }
+ _currentPart = 760;
+}
+
+/**
+ * State 770: Igor appears small at the top of the picture and walks in three walks to (45, 95).
+ */
+void IgorEngine::PART_77_ENTER_FROM_MAP() {
+ PART_77_SET_Y_SCALE_RAMP();
+ 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[kPart77TopPointOffset]].area = 4;
+ buildWalkPath(21, 17, 65, 115);
+ _roomObjectAreasTable[_screenLayer2[kPart77TopPointOffset]].area = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ // the escape key draws what is left of the walks at once
+ bool skipped = waitForIgorMove(0, true, false);
+
+ PART_77_SET_Y_SCALE_UNIFORM();
+ wd->setPos(36, 140, 3, 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;
+ _roomObjectAreasTable[_screenLayer2[kPart77BottomPointOffset]].area = 4;
+ buildWalkPath(36, 143, 41, 86);
+ _roomObjectAreasTable[_screenLayer2[kPart77BottomPointOffset]].area = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ skipped |= waitForIgorMove(0, true, skipped, 3);
+
+ PART_77_SET_AREAS_LIGHT(0);
+ --_walkDataLastIndex;
+ buildWalkPath(41, 86, 45, 95);
+ _walkDataCurrentIndex = 2;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ waitForIgorMove(0, true, skipped);
+ PART_77_CLEAR_ENTRY_AREAS();
+}
+
+/**
+ * State 771: Igor appears at (225, 100), the first step is drawn before the picture fades in, and walks to (205, 124).
+ */
+void IgorEngine::PART_77_ENTER_FROM_STAIRS() {
+ PART_77_APPLY_OBJECT_STATE();
+ WalkData *wd = &_walkData[0];
+ wd->setPos(225, 100, 3, 1);
+ wd->clipSkipX = 1;
+ wd->clipWidth = 30;
+ wd->scaleWidth = 50;
+ wd->xPosChanged = 1;
+ wd->dxPos = 0;
+ wd->yPosChanged = 1;
+ wd->dyPos = 0;
+ wd->scaleHeight = 50;
+ _walkCurrentFrame = 1;
+ _walkDataCurrentIndex = 0;
+ _walkDataLastIndex = 0;
+ buildWalkPath(225, 100, 205, 124);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ moveIgor(3, _walkData[1].frameNum);
+ ++_walkDataCurrentIndex;
+ fadeIn(768);
+ waitForIgorMove();
+ PART_77_SET_AREAS_LIGHT(0);
+ PART_77_CLEAR_ENTRY_AREAS();
+}
+
+void IgorEngine::PART_77() {
+ playMusic(1);
+ _gameState.enableLight = 1;
+ loadActionData(DAT_Part77);
+ loadRoomData(PAL_Part77, IMG_Part77, BOX_Part77, MSK_Part77, TXT_Part77);
+ SET_PAL_240_48_1();
+ static const int anim[] = { ANM_Part77, 0 };
+ loadAnimData(anim);
+ _roomDataOffsets = PART_77_ROOM_DATA_OFFSETS;
+ setRoomClickFix(143, -1, 286, true);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_77_EXEC_ACTION);
+ PART_77_APPLY_OBJECT_STATE();
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ for (int i = 18; i <= 20; ++i) {
+ _roomObjectAreasTable[i].area = 0;
+ }
+
+ if (_gameStateLoaded) {
+ PART_77_SET_AREAS_LIGHT(0);
+ }
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ if (_currentPart == 770) {
+ fadeIn(768);
+ PART_77_ENTER_FROM_MAP();
+ } else {
+ PART_77_ENTER_FROM_STAIRS();
+ }
+ }
+ enterPartLoop();
+ while ((_currentPart == 770 || _currentPart == 771) && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ if (!_gameStateLoaded) {
+ _objectsState[54] = 1;
+ if (_currentPart == 760) {
+ // the colors 208 to 254 are cleared in both palettes
+ memset(_paletteBuffer + 208 * 3, 0, 141);
+ memset(_currentPalette + 208 * 3, 0, 141);
+ }
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_78.cpp b/engines/igor/parts/part_78.cpp
new file mode 100644
index 00000000000..82db5b5a788
--- /dev/null
+++ b/engines/igor/parts/part_78.cpp
@@ -0,0 +1,309 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// The animation resource ends with four tables of offsets, one word per frame (frame 1 first): the frames drawn
+// over the whole picture, the pieces of the picture kept in the second layer, the frames of a band of the picture
+// that are kept in a resource of their own and, last, the tiles of a small patch of the picture.
+static const int kPart78FigureTable = 0xF832;
+static const int kPart78BackgroundTable = 0xF8B2;
+static const int kPart78BandTable = 0xF8D0;
+static const int kPart78PatchTiles = 0xF8EE;
+
+// The patch is a 12x12 area of the picture cut from 13x13 tiles.
+static const int kPart78PatchTileSize = 13 * 13;
+static const int kPart78PatchOffset = 57 * 320 + 72;
+static const int kPart78PatchSize = 12;
+
+// The scene draws its text with this color index instead of the usual one.
+static const int kPart78TalkColor = 242;
+
+// The figure that is drawn first is also the first of the frames of the loop of the first part of the scene. The
+// loop goes through the steps 1 to 44, one step every 32 ticks, and each step shows the frame of this table.
+static const int kPart78FirstFigure = 0x16;
+static const int kPart78StepFirstRepeat = 0x16;
+static const int kPart78StepLast = 0x2C;
+static const uint8 kPart78StepFrames[45] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45
+};
+
+// Who talks: the three figures drawn over the whole picture, the two frame sets of the band and the patch.
+enum {
+ kPart78FigureA,
+ kPart78FigureB,
+ kPart78FigureC,
+ kPart78BandA,
+ kPart78BandB,
+ kPart78Patch
+};
+
+void IgorEngine::PART_78_DRAW_FIGURE(int frame) {
+ decodeAnimFrame(getAnimFrame(0, kPart78FigureTable, frame), _screenVGA, false);
+}
+
+void IgorEngine::PART_78_DRAW_BACKGROUND_FRAME(int frame) {
+ const int offset = READ_LE_UINT16(_animFramesBuffer + kPart78BackgroundTable + (frame - 1) * 2);
+ decodeAnimFrame(_screenLayer2 + offset, _screenVGA, false);
+}
+
+void IgorEngine::PART_78_DRAW_BAND(int frame) {
+ const int offset = READ_LE_UINT16(_animFramesBuffer + kPart78BandTable + (frame - 1) * 2);
+ decodeAnimFrame(_part78BandFrames + offset - 1, _screenVGA, false);
+}
+
+void IgorEngine::PART_78_DRAW_PATCH(int frame) {
+ copyArea(_screenVGA, kPart78PatchOffset, 320, _animFramesBuffer + kPart78PatchTiles + (frame - 1) * kPart78PatchTileSize,
+ 13, kPart78PatchSize, kPart78PatchSize);
+}
+
+void IgorEngine::PART_78_UPDATE_DIALOGUE_FIGURE_A(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_78_DRAW_FIGURE(0x3B);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_78_DRAW_FIGURE(0x3B + getRandomNumber(4));
+ break;
+ }
+}
+
+void IgorEngine::PART_78_UPDATE_DIALOGUE_FIGURE_B(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_78_DRAW_FIGURE(0x16);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_78_DRAW_FIGURE(0x16 + getRandomNumber(1));
+ break;
+ }
+}
+
+void IgorEngine::PART_78_UPDATE_DIALOGUE_FIGURE_C(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_78_DRAW_FIGURE(0x2D);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_78_DRAW_FIGURE(0x2D + getRandomNumber(1));
+ break;
+ }
+}
+
+void IgorEngine::PART_78_UPDATE_DIALOGUE_BAND_A(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_78_DRAW_BAND(8);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_78_DRAW_BAND(8 + getRandomNumber(3));
+ break;
+ }
+}
+
+void IgorEngine::PART_78_UPDATE_DIALOGUE_BAND_B(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_78_DRAW_BAND(12);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_78_DRAW_BAND(12 + getRandomNumber(3));
+ break;
+ }
+}
+
+void IgorEngine::PART_78_UPDATE_DIALOGUE_PATCH(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_78_DRAW_PATCH(1);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_78_DRAW_PATCH(getRandomNumber(3) + 1);
+ break;
+ }
+}
+
+/**
+ * Starts the lines of one of the speakers. The caller waits for them with PART_78_WAIT_FOR_LINES.
+ */
+void IgorEngine::PART_78_SAY_START(int speaker, const Common::Array<DialogueText> &lines) {
+ switch (speaker) {
+ case kPart78FigureA:
+ cutsceneSayStartWithCallback(173, 65, 0, 43, 43, lines, &IgorEngine::PART_78_UPDATE_DIALOGUE_FIGURE_A);
+ break;
+ case kPart78FigureB:
+ cutsceneSayStartWithCallback(260, 91, 0, 43, 43, lines, &IgorEngine::PART_78_UPDATE_DIALOGUE_FIGURE_B);
+ break;
+ case kPart78FigureC:
+ cutsceneSayStartWithCallback(98, 90, 0, 43, 43, lines, &IgorEngine::PART_78_UPDATE_DIALOGUE_FIGURE_C);
+ break;
+ case kPart78BandA:
+ cutsceneSayStartWithCallback(142, 58, 63, 63, 63, lines, &IgorEngine::PART_78_UPDATE_DIALOGUE_BAND_A);
+ break;
+ case kPart78BandB:
+ cutsceneSayStartWithCallback(142, 58, 63, 63, 63, lines, &IgorEngine::PART_78_UPDATE_DIALOGUE_BAND_B);
+ break;
+ default:
+ cutsceneSayStartWithCallback(78, 54, 63, 63, 0, lines, &IgorEngine::PART_78_UPDATE_DIALOGUE_PATCH);
+ break;
+ }
+}
+
+void IgorEngine::PART_78_WAIT_FOR_LINES(int speaker) {
+ switch (speaker) {
+ case kPart78FigureA:
+ waitForEndOfCutsceneDialogue(173, 65, 0, 43, 43);
+ break;
+ case kPart78FigureB:
+ waitForEndOfCutsceneDialogue(260, 91, 0, 43, 43);
+ break;
+ case kPart78FigureC:
+ waitForEndOfCutsceneDialogue(98, 90, 0, 43, 43);
+ break;
+ case kPart78BandA:
+ case kPart78BandB:
+ waitForEndOfCutsceneDialogue(142, 58, 63, 63, 63);
+ break;
+ default:
+ waitForEndOfCutsceneDialogue(78, 54, 63, 63, 0);
+ break;
+ }
+ _updateDialogue = nullptr;
+}
+
+void IgorEngine::PART_78_SAY(int speaker, const Common::Array<DialogueText> &lines) {
+ PART_78_SAY_START(speaker, lines);
+ PART_78_WAIT_FOR_LINES(speaker);
+}
+
+/**
+ * One of the three short lines said at random while the first part of the scene goes on.
+ */
+void IgorEngine::PART_78_INTERJECTION(int which) {
+ static const DialogueText kLines[3] = { { 211, 1, 676 }, { 212, 1, 677 }, { 213, 1, 678 } };
+ Common::Array<DialogueText> lines;
+ lines.push_back(kLines[which - 1]);
+ PART_78_SAY(_roomAmbientIndex == 0x16 ? kPart78FigureB : kPart78FigureC, lines);
+}
+
+void IgorEngine::PART_78() {
+ playMusic(11);
+ // the card with the time that has passed
+ PART_MEANWHILE(IMG_Part78MinutesLater);
+ memset(_currentPalette, 0, 768);
+ setPaletteRange(0, 255);
+ memset(_screenVGA + 46080, 0, 17920);
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_Part78, IMG_Part78, BOX_Part78, 0, TXT_Part78);
+ static const int anim[] = { ANM_Part78, 0 };
+ loadAnimData(anim);
+ // the second layer holds the pieces of the picture, starting at its second byte
+ loadData(IMG_Part78Layer2, _screenLayer2 + 1);
+ _part78BandFrames = loadData(ANM_Part78Frames);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ PART_78_DRAW_FIGURE(kPart78FirstFigure);
+ PART_78_DRAW_BAND(1);
+ memset(_currentPalette, 0, 768);
+ setPaletteRange(208, 255);
+ fadeIn(768);
+ _gameState.igorMoving = false;
+ _talkColorIndex = kPart78TalkColor;
+
+ PART_78_SAY(kPart78FigureB, { { 204, 1, 671 }, { 205, 2, 672 }, { 207, 1, 673 }, { 208, 2, 674 }, { 210, 1, 675 } });
+
+ // the figures go through their frames while one of them talks now and then, until five turns are done
+ _roomAmbientIndex = kPart78StepFirstRepeat;
+ int turns = 1;
+ while (turns <= 5) {
+ if (compareGameTick(1, 32)) {
+ if (_roomAmbientIndex == kPart78StepLast) {
+ _roomAmbientIndex = 1;
+ } else {
+ ++_roomAmbientIndex;
+ }
+ if (_roomAmbientIndex == kPart78StepFirstRepeat) {
+ ++turns;
+ }
+ PART_78_DRAW_FIGURE(kPart78StepFrames[_roomAmbientIndex]);
+ if ((_roomAmbientIndex == kPart78StepFirstRepeat || _roomAmbientIndex == kPart78StepLast) && turns <= 5) {
+ if (getRandomNumber(2) == 0) {
+ PART_78_INTERJECTION(getRandomNumber(2) + 1);
+ }
+ }
+ }
+ if (compareGameTick(0x3D)) {
+ PART_78_DRAW_BACKGROUND_FRAME(getRandomNumber(13) + 2);
+ PART_78_DRAW_BAND(getRandomNumber(4) + 1);
+ }
+ waitForTimer();
+ }
+
+ for (int i = 6; i <= 7; ++i) {
+ PART_78_DRAW_BAND(i);
+ waitForTimer(90);
+ }
+ PART_78_DRAW_BAND(3);
+ PART_78_SAY_START(kPart78BandA, { { 201, 1, 668 } });
+ PART_78_DRAW_FIGURE(0x2F);
+ PART_78_WAIT_FOR_LINES(kPart78BandA);
+ PART_78_DRAW_BACKGROUND_FRAME(1);
+ PART_78_DRAW_BAND(2);
+
+ PART_78_SAY(kPart78FigureB, { { 214, 1, 679 } });
+ for (int i = 0x30; i <= 0x3A; ++i) {
+ PART_78_DRAW_FIGURE(i);
+ waitForTimer(40);
+ }
+ PART_78_SAY(kPart78FigureA, { { 215, 1, 680 } });
+ PART_78_SAY(kPart78BandB, { { 216, 1, 681 } });
+ PART_78_SAY(kPart78FigureA, { { 217, 1, 682 }, { 218, 1, 683 } });
+ PART_78_SAY(kPart78BandB, { { 219, 1, 684 } });
+ PART_78_SAY(kPart78FigureA, { { 235, 1, 698 }, { 236, 2, 699 } });
+ PART_78_SAY(kPart78BandB, { { 222, 1, 685 }, { 223, 1, 686 } });
+ PART_78_DRAW_BAND(3);
+ PART_78_SAY(kPart78Patch, { { 224, 1, 687 }, { 225, 1, 688 }, { 226, 1, 689 } });
+ PART_78_DRAW_BAND(2);
+ PART_78_SAY(kPart78FigureA, { { 227, 1, 690 }, { 228, 1, 691 } });
+ PART_78_DRAW_BAND(3);
+ PART_78_SAY(kPart78Patch, { { 229, 1, 692 }, { 230, 1, 693 } });
+ PART_78_DRAW_BAND(2);
+ PART_78_SAY(kPart78FigureA, { { 231, 1, 694 }, { 232, 1, 695 }, { 233, 1, 696 }, { 234, 1, 697 } });
+
+ PART_78_DRAW_FIGURE(0x40);
+ waitForTimer(255);
+ waitForTimer(255);
+ waitForTimer(255);
+
+ _talkColorIndex = kTalkColor;
+ free(_part78BandFrames);
+ _part78BandFrames = nullptr;
+ memcpy(_paletteBuffer, _currentPalette, 624);
+ fadeOut(768);
+ _objectsState[111] = 1;
+ playMusic(2);
+ // the card with the time that has passed
+ PART_MEANWHILE(IMG_Part78NextDay);
+ _currentPart = 281;
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 318ed3f2b32..1bb030cdd4b 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -768,4 +768,24 @@
#define PAL_Part32Final 1159
#define ANM_Part32Final 1160
+// State 770 (PART_77)
+#define DAT_Part77 1161
+#define ANM_Part77 1162
+#define TXT_Part77 1163
+#define IMG_Part77 1164
+#define PAL_Part77 1165
+#define MSK_Part77 1166
+#define BOX_Part77 1167
+
+// State 780 (PART_78)
+#define ANM_Part78 1168
+#define TXT_Part78 1169
+#define IMG_Part78 1170
+#define PAL_Part78 1171
+#define BOX_Part78 1172
+#define IMG_Part78Layer2 1173
+#define ANM_Part78Frames 1174
+#define IMG_Part78MinutesLater 1175
+#define IMG_Part78NextDay 1176
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 902d3c853a7..1675985fbd6 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -499,6 +499,13 @@ const RoomDataOffsets IgorEngine::PART_72_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_77_ROOM_DATA_OFFSETS = {
+ { 320, 8, 56, 7 },
+ { 835, 844 },
+ { 847, 1019, 3895, 911, 987, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_68_ROOM_DATA_OFFSETS = {
{ 80, 4, 12, 3 },
{ 148, 159 },
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index ace031c33fc..115a12c2ab2 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1067,7 +1067,7 @@ void IgorEngine::buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, in
}
}
-bool IgorEngine::waitForIgorMove(IgorMoveTick tick, bool escapeSkips, bool forceSkip) {
+bool IgorEngine::waitForIgorMove(IgorMoveTick tick, bool escapeSkips, bool forceSkip, int fixedPosNum) {
_gameTicks = 0;
bool skipped = false;
do {
@@ -1077,7 +1077,8 @@ bool IgorEngine::waitForIgorMove(IgorMoveTick tick, bool escapeSkips, bool force
_walkDataLastIndex = _walkDataCurrentIndex;
}
if (_gameState.igorMoving) {
- moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
+ // some scripted walks draw every step with one fixed facing instead of the facing of the step
+ moveIgor(fixedPosNum >= 0 ? fixedPosNum : _walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
++_walkDataCurrentIndex;
}
}
@@ -1090,7 +1091,7 @@ bool IgorEngine::waitForIgorMove(IgorMoveTick tick, bool escapeSkips, bool force
_inputVars[kInputEscape] = 0;
skipped = true;
while (_gameState.igorMoving && _walkDataCurrentIndex <= _walkDataLastIndex) {
- moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
+ moveIgor(fixedPosNum >= 0 ? fixedPosNum : _walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
++_walkDataCurrentIndex;
// The original draws straight to the screen, so the walk stays visible, only faster.
// TODO: the exact pace depends on the original's drawing cost and is not derived.
Commit: b5ed8d27ff2df2fa12c910d8afef73b56461cb28
https://github.com/scummvm/scummvm/commit/b5ed8d27ff2df2fa12c910d8afef73b56461cb28
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:39+01:00
Commit Message:
IGOR: Renames on parts 33, 34, 35
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_33.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 8ef7e7c007e..8cfd28af236 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1086,31 +1086,30 @@ private:
// 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_ACTION_109_takeAstronomyBooks();
+ void PART_33_ACTION_111_talkToHarrison();
+ void PART_33_ACTION_113_walkOut();
+ void PART_33_ACTION_114_showPhotoToHarrison();
+ void PART_33_ACTION_115_giveNoteToHarrison();
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_HARRISON_SPEAKS(const Common::Array<DialogueText> &lines);
+ void PART_33_HarrisonSay(const Common::Array<DialogueText> &lines);
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_HELPER_1_OBJECTS_STATE(int num);
+ void PART_33_HELPER_2_HarrisonWalksOut();
+ void PART_33_HELPER_3_drawHarrisonFrame();
+ void PART_33_HELPER_4_drawHarrisonBodyFrame(int frame);
+ void PART_33_HELPER_5_drawHarrisonHeadFrame(int frame);
+ void PART_33_HELPER_7_walkIn();
+ void PART_33_HELPER_9_loadExtraTexts();
void PART_33();
void loadResourceData__ROOM_Library();
void loadResourceData__ANIM_Library();
// park
- void PARK_DRAW_LADY_FRAME(uint8 *dst, int frame);
+ void PARK_DRAW_drawOldLadyFrame(uint8 *dst, int frame);
void PARK_DRAW_LAURA_FRAME(int frame);
void PARK_PICK_UP_ANIMATION(int screenOffset, int framesOffset);
void PARK_UPDATE_AMBIENT_SOUND();
@@ -1123,11 +1122,11 @@ private:
void PART_34();
void PART_34_EXEC_ACTION(int action);
void PART_34_ACTION_103_TAKE();
- void PART_34_ACTION_105_TALK();
- void PART_34_ACTION_108_OLD_LADY();
+ void PART_34_ACTION_105_talkToOldLady();
+ void PART_34_ACTION_108_giveLizardToOldLady();
void PART_34_ACTION_109_SCROLL_RIGHT();
void PART_34_APPLY_OBJECT_STATE(int num);
- void PART_34_LADY_IDLE(int step);
+ void PART_34_oldLadyIdleAnimationFrame(int step);
void PART_34_LAURA_CONVERSATION();
void PART_34_OLD_LADY_CONVERSATION();
void PART_34_UPDATE_ROOM_BACKGROUND();
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index 833b83cea6b..edadc320485 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -30,50 +30,50 @@ 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:
+ case 101: // take any book
igorSay(201, 1, 396);
break;
- case 102:
+ case 102: // look at history books
igorSay(202, 1, 397);
break;
- case 103:
+ case 103: // look at physics books
igorSay(203, 1, 398);
break;
- case 104:
+ case 104: // look at chemistry books
igorSay(204, 1, 399);
break;
- case 105:
+ case 105: // look at geography books
igorSay(205, 1, 400);
break;
- case 106:
+ case 106: // look at algebra books
igorSay(206, 1, 401);
break;
- case 107:
+ case 107: // look at art books
igorSay(207, 1, 402);
break;
- case 108:
+ case 108: // look at astronomy books
igorSay(208, 1, 403);
break;
- case 109:
- PART_33_ACTION_109();
+ case 109: // take astronomy books
+ PART_33_ACTION_109_takeAstronomyBooks();
break;
- case 110:
+ case 110: // take philosophy books
igorSay(209, 1, 404);
break;
- case 111:
- PART_33_ACTION_111();
+ case 111: // talk to harrison
+ PART_33_ACTION_111_talkToHarrison();
break;
- case 112:
+ case 112: // look at harrison
igorSay(213, 2, 407);
break;
case 113:
- PART_33_ACTION_113();
+ PART_33_ACTION_113_walkOut();
break;
case 114:
- PART_33_ACTION_114();
+ PART_33_ACTION_114_showPhotoToHarrison();
break;
case 115:
- PART_33_ACTION_115();
+ PART_33_ACTION_115_giveNoteToHarrison();
break;
default:
error("PART_33_EXEC_ACTION unhandled action %d", action);
@@ -81,7 +81,7 @@ void IgorEngine::PART_33_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_33_ACTION_109() {
+void IgorEngine::PART_33_ACTION_109_takeAstronomyBooks() {
if (_objectsState[4] == 0) {
igorSay(201, 1, 396);
return;
@@ -98,25 +98,25 @@ void IgorEngine::PART_33_ACTION_109() {
}
addObjectToInventory(31, 66);
_objectsState[74] = 1;
- PART_33_HELPER_1(255);
+ PART_33_HELPER_1_OBJECTS_STATE(255);
igorSayAndWait({ { 210, 1, 405 }, { 211, 2, 406 } });
}
-void IgorEngine::PART_33_ACTION_111() {
+void IgorEngine::PART_33_ACTION_111_talkToHarrison() {
if (_objectsState[75] == 1) {
- PART_33_HELPER_9();
- PART_33_HELPER_1(255);
+ PART_33_HELPER_9_loadExtraTexts();
+ PART_33_HELPER_1_OBJECTS_STATE(255);
igorSayAndWait(201, 1, 447);
- PART_33_HARRISON_SPEAKS({ { 202, 2, 448 }, { 204, 2, 449 } });
+ PART_33_HarrisonSay({ { 202, 2, 448 }, { 204, 2, 449 } });
loadResourceData__ROOM_Library();
- PART_33_HELPER_1(255);
+ PART_33_HELPER_1_OBJECTS_STATE(255);
} else {
PART_33_HANDLE_DIALOGUE_HARRISON();
- PART_33_HELPER_1(255);
+ PART_33_HELPER_1_OBJECTS_STATE(255);
}
}
-void IgorEngine::PART_33_ACTION_113() {
+void IgorEngine::PART_33_ACTION_113_walkOut() {
_walkDataCurrentIndex = 0;
for (int i = 9; i >= 0; --i) {
if (i == 9) {
@@ -139,32 +139,32 @@ void IgorEngine::PART_33_ACTION_113() {
_currentPart = 241;
}
-void IgorEngine::PART_33_ACTION_114() {
+void IgorEngine::PART_33_ACTION_114_showPhotoToHarrison() {
copyArea(_screenVGA, 26279, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
igorSayAndWait(223, 1, 414);
- PART_33_HARRISON_SPEAKS({ { 224, 1, 415 } });
+ PART_33_HarrisonSay({ { 224, 1, 415 } });
for (int i = 2; i <= 5; ++i) {
copyArea(_screenVGA, 26279, 320, _animFramesBuffer + i * 1827 + 0x5104, 63, 62, 29);
waitForTimer(60);
}
removeObjectFromInventory(54);
- PART_33_HARRISON_SPEAKS({ { 225, 1, 416 } });
+ PART_33_HarrisonSay({ { 225, 1, 416 } });
copyArea(_screenVGA, 26279, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
igorSayAndWait(226, 1, 417);
- PART_33_HARRISON_SPEAKS({ { 227, 1, 418 } });
+ PART_33_HarrisonSay({ { 227, 1, 418 } });
igorSayAndWait(228, 1, 419);
- PART_33_HARRISON_SPEAKS({ { 229, 2, 420 }, { 231, 2, 421 } });
+ PART_33_HarrisonSay({ { 229, 2, 420 }, { 231, 2, 421 } });
for (int i = 1; i <= 4; ++i) {
copyArea(_screenVGA, 26279, 320, _animFramesBuffer + PART_33_ANIM_DATA_5[i] * 1827 + 0x5104, 63, 62, 29);
waitForTimer(60);
}
addObjectToInventory(35, 70);
- PART_33_HELPER_1(255);
- PART_33_HARRISON_SPEAKS({ { 233, 2, 422 } });
+ PART_33_HELPER_1_OBJECTS_STATE(255);
+ PART_33_HarrisonSay({ { 233, 2, 422 } });
_objectsState[75] = 1;
}
-void IgorEngine::PART_33_ACTION_115() {
+void IgorEngine::PART_33_ACTION_115_giveNoteToHarrison() {
const int offset = 26279;
copyArea(_screenVGA, offset, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
waitForTimer(60);
@@ -174,20 +174,20 @@ void IgorEngine::PART_33_ACTION_115() {
waitForTimer(60);
}
removeObjectFromInventory(67);
- PART_33_HELPER_1(255);
+ PART_33_HELPER_1_OBJECTS_STATE(255);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
- PART_33_HARRISON_SPEAKS({ { 217, 2, 409 } });
+ PART_33_HarrisonSay({ { 217, 2, 409 } });
copyArea(_screenVGA, offset, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
- PART_33_HARRISON_SPEAKS({ { 219, 1, 410 } });
+ PART_33_HarrisonSay({ { 219, 1, 410 } });
copyArea(_screenVGA, offset, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
_objectsState[76] = 1;
}
// The room's idle animation of Harrison is only driven by the room loop; the
// blocking dialogue loops never run it, otherwise it fights the talking frames.
-void IgorEngine::PART_33_HARRISON_SPEAKS(const Common::Array<DialogueText> &lines) {
+void IgorEngine::PART_33_HarrisonSay(const Common::Array<DialogueText> &lines) {
const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
_updateRoomBackground = 0;
cutsceneSayWithCallback(47, 82, 0, 58, 40, lines, &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2);
@@ -207,10 +207,10 @@ void IgorEngine::PART_33_HANDLE_DIALOGUE_HARRISON() {
void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_1(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_33_HELPER_4(1);
+ PART_33_HELPER_4_drawHarrisonBodyFrame(1);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_33_HELPER_4(getRandomNumber(3) + 2);
+ PART_33_HELPER_4_drawHarrisonBodyFrame(getRandomNumber(3) + 2);
break;
}
}
@@ -218,10 +218,10 @@ void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_1(int action) {
void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_33_HELPER_8(4);
+ PART_33_HELPER_5_drawHarrisonHeadFrame(4);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_33_HELPER_8(4 + getRandomNumber(2));
+ PART_33_HELPER_5_drawHarrisonHeadFrame(4 + getRandomNumber(2));
break;
}
}
@@ -229,20 +229,20 @@ void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2(int action) {
void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_3(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_33_HELPER_5(4);
+ PART_33_HELPER_5_drawHarrisonHeadFrame(4);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_33_HELPER_5(4 + getRandomNumber(2));
+ PART_33_HELPER_5_drawHarrisonHeadFrame(4 + getRandomNumber(2));
break;
case kUpdateDialogueAnimStanding:
- PART_33_HELPER_5(4);
+ PART_33_HELPER_5_drawHarrisonHeadFrame(4);
break;
}
}
void IgorEngine::PART_33_UPDATE_ROOM_BACKGROUND() {
if (compareGameTick(61) && _objectsState[75] != 2) {
- PART_33_HELPER_8(_gameState.unk10);
+ PART_33_HELPER_5_drawHarrisonHeadFrame(_gameState.unk10);
_gameState.unk10 = getRandomNumber(3) + 1;
if (_gameState.unk10 >= 1 && _gameState.unk10 <= 2) {
_gameState.unk10 = 1;
@@ -252,23 +252,25 @@ void IgorEngine::PART_33_UPDATE_ROOM_BACKGROUND() {
}
}
-void IgorEngine::PART_33_HELPER_1(int num) {
+void IgorEngine::PART_33_HELPER_1_OBJECTS_STATE(int num) {
if (num == 2 || num == 255) {
+ // is harrison here or not
if (_objectsState[75] <= 1) {
- PART_33_HELPER_3();
+ PART_33_HELPER_3_drawHarrisonFrame();
} else {
_roomObjectAreasTable[27].object = 0;
}
}
}
-void IgorEngine::PART_33_HELPER_2() {
+void IgorEngine::PART_33_HELPER_2_HarrisonWalksOut() {
memcpy(_screenLayer2, _screenVGA, 46080);
memcpy(_screenVGA, _screenLayer1, 46080);
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5255) - 1, _screenVGA, true);
memcpy(_screenLayer1, _screenVGA, 46080);
fadeIn(624);
cutsceneSayWithCallback(92, 79, 0, 58, 40, { { 220, 1, 411 }, { 221, 1, 412 } }, &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_1);
+ // Harrison walks out
for (int i = 6; i <= 25; ++i) {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5253 + i * 2) - 1, _screenVGA, true);
waitForTimer(30);
@@ -276,16 +278,11 @@ void IgorEngine::PART_33_HELPER_2() {
fadeOut(624);
}
-void IgorEngine::PART_33_HELPER_3() {
- const int offset = 29479;
- copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x5287, 16, 16, 15);
-}
-
-void IgorEngine::PART_33_HELPER_4(int frame) {
+void IgorEngine::PART_33_HELPER_4_drawHarrisonBodyFrame(int frame) {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5253 + frame * 2) - 1, _screenVGA, true);
}
-void IgorEngine::PART_33_HELPER_5(int frame) {
+void IgorEngine::PART_33_HELPER_5_drawHarrisonHeadFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 14; ++i) {
for (int j = 0; j <= 15; ++j) {
@@ -305,9 +302,10 @@ void IgorEngine::PART_33_HELPER_5(int frame) {
if (_dialogueCursorOn) {
_roomCursorOn = true;
}
+
}
-void IgorEngine::PART_33_HELPER_7() {
+void IgorEngine::PART_33_HELPER_7_walkIn() {
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
_walkCurrentPos = 1;
@@ -336,29 +334,12 @@ void IgorEngine::PART_33_HELPER_7() {
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_3_drawHarrisonFrame() {
+ const int offset = 29479;
+ copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x5287, 16, 16, 15);
}
-void IgorEngine::PART_33_HELPER_9() {
+void IgorEngine::PART_33_HELPER_9_loadExtraTexts() {
uint8 *p = loadData(TXT_Library2);
decodeRoomStrings(p, true);
free(p);
@@ -376,22 +357,23 @@ void IgorEngine::PART_33() {
_roomDataOffsets = PART_33_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 276, 143);
if (_currentPart == 331) {
- PART_33_HELPER_2();
+ PART_33_HELPER_2_HarrisonWalksOut();
return;
}
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_33_EXEC_ACTION);
_updateRoomBackground = &IgorEngine::PART_33_UPDATE_ROOM_BACKGROUND;
- PART_33_HELPER_1(255);
+ PART_33_HELPER_1_OBJECTS_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_33_HELPER_7();
+ PART_33_HELPER_7_walkIn();
enterPartLoop();
while (_currentPart == 330) {
runPartLoop();
}
leavePartLoop();
if (_objectsState[75] == 1) {
+ // harrison leaves
_objectsState[75] = 2;
}
fadeOut(624);
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index faee3a25820..377ce56f2ef 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -59,7 +59,7 @@ static const uint8 kOldLadyBagFrames[] = { 11, 15, 16, 6, 17, 1 };
/**
* Draws a frame of FRM_Park1 (old lady and Igor) preserving the dialogue text colors.
*/
-void IgorEngine::PARK_DRAW_LADY_FRAME(uint8 *dst, int frame) {
+void IgorEngine::PARK_DRAW_drawOldLadyFrame(uint8 *dst, int frame) {
decodeAnimFrame(getAnimFrame(kParkFrames, kParkFrameTable, frame), dst, true);
}
@@ -82,7 +82,7 @@ void IgorEngine::PARK_PICK_UP_ANIMATION(int screenOffset, int framesOffset) {
}
/**
- * Birds chirp from time to time while the park is shown.
+ * Birds chirp.
*/
void IgorEngine::PARK_UPDATE_AMBIENT_SOUND() {
if (compareGameTick(1) && getRandomNumber(14) == 0) {
@@ -107,10 +107,10 @@ void IgorEngine::PARK_UPDATE_DIALOGUE_LADY(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PARK_DRAW_LADY_FRAME(_screenVGA, 1);
+ PARK_DRAW_drawOldLadyFrame(_screenVGA, 1);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PARK_DRAW_LADY_FRAME(_screenVGA, getRandomNumber(4) + 1);
+ PARK_DRAW_drawOldLadyFrame(_screenVGA, getRandomNumber(4) + 1);
break;
}
}
@@ -189,7 +189,7 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
igorSay(205, 1, 564);
break;
case 105:
- PART_34_ACTION_105_TALK();
+ PART_34_ACTION_105_talkToOldLady();
break;
case 106:
igorSay(206, 2, 565);
@@ -198,7 +198,7 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
igorSay(208, 2, 566);
break;
case 108:
- PART_34_ACTION_108_OLD_LADY();
+ PART_34_ACTION_108_giveLizardToOldLady();
break;
case 109:
PART_34_ACTION_109_SCROLL_RIGHT();
@@ -220,33 +220,29 @@ void IgorEngine::PART_34_ACTION_103_TAKE() {
PART_34_APPLY_OBJECT_STATE(255);
}
-void IgorEngine::PART_34_ACTION_105_TALK() {
+void IgorEngine::PART_34_ACTION_105_talkToOldLady() {
PART_34_OLD_LADY_CONVERSATION();
PART_34_APPLY_OBJECT_STATE(255);
_parkLadyIdleStep = 4;
- PART_34_LADY_IDLE(4);
+ PART_34_oldLadyIdleAnimationFrame(4);
}
-/**
- * Igor shows the old lady the animal he found. Depending on the animal she either rejects it
- * or recognizes her pet, gives Igor a rocket and leaves, and Laura shows up.
- */
-void IgorEngine::PART_34_ACTION_108_OLD_LADY() {
- PARK_DRAW_LADY_FRAME(_screenVGA, 1);
+void IgorEngine::PART_34_ACTION_108_giveLizardToOldLady() {
+ PARK_DRAW_drawOldLadyFrame(_screenVGA, 1);
igorSay(211, 2, 568);
PARK_WAIT_FOR_IGOR_DIALOGUE();
for (int frame = 12; frame <= 13; ++frame) {
- PARK_DRAW_LADY_FRAME(_screenVGA, frame);
+ PARK_DRAW_drawOldLadyFrame(_screenVGA, frame);
waitForTimer(45);
}
if (_objectsState[1] == 0) {
cutsceneSayStart(121, 58, 63, 23, 0, { { 213, 1, 569 }, { 216, 1, 570 } });
PARK_WAIT_FOR_LADY_DIALOGUE();
for (int frame = 14; frame >= 12; --frame) {
- PARK_DRAW_LADY_FRAME(_screenVGA, frame);
+ PARK_DRAW_drawOldLadyFrame(_screenVGA, frame);
waitForTimer(45);
}
- PARK_DRAW_LADY_FRAME(_screenVGA, 17);
+ PARK_DRAW_drawOldLadyFrame(_screenVGA, 17);
_parkLadyIdleStep = 1;
return;
}
@@ -255,14 +251,14 @@ void IgorEngine::PART_34_ACTION_108_OLD_LADY() {
PARK_WAIT_FOR_LADY_DIALOGUE();
_parkLadyIdleStep = 1;
for (uint i = 0; i < ARRAYSIZE(kOldLadyPetFrames); ++i) {
- PARK_DRAW_LADY_FRAME(_screenVGA, kOldLadyPetFrames[i]);
+ PARK_DRAW_drawOldLadyFrame(_screenVGA, kOldLadyPetFrames[i]);
waitForTimer(45);
}
removeObjectFromInventory(59);
cutsceneSayStart(121, 58, 63, 23, 0, { { 219, 2, 573 }, { 221, 2, 574 }, { 223, 1, 575 }, { 224, 2, 576 } });
PARK_WAIT_FOR_LADY_DIALOGUE();
for (uint i = 0; i < ARRAYSIZE(kOldLadyBagFrames); ++i) {
- PARK_DRAW_LADY_FRAME(_screenVGA, kOldLadyBagFrames[i]);
+ PARK_DRAW_drawOldLadyFrame(_screenVGA, kOldLadyBagFrames[i]);
waitForTimer(30);
}
while (isDialogueSpeechPlaying() && !_eventQuitGame) {
@@ -276,7 +272,7 @@ void IgorEngine::PART_34_ACTION_108_OLD_LADY() {
igorSay(230, 1, 580);
PARK_WAIT_FOR_IGOR_DIALOGUE();
for (int frame = 18; frame <= 31; ++frame) {
- PARK_DRAW_LADY_FRAME(_screenVGA, frame);
+ PARK_DRAW_drawOldLadyFrame(_screenVGA, frame);
waitForTimer(30);
}
_objectsState[80] = 1;
@@ -291,10 +287,6 @@ void IgorEngine::PART_34_ACTION_108_OLD_LADY() {
PART_34_APPLY_OBJECT_STATE(255);
}
-/**
- * Conversation with the old lady. The first time the lady greets Igor and Igor chooses what to ask,
- * the following times only the greetings are exchanged.
- */
void IgorEngine::PART_34_OLD_LADY_CONVERSATION() {
_roomDataOffsets.dlg = kOldLadyDialogueData;
loadDialogueData(DLG_ParkLady);
@@ -440,7 +432,7 @@ void IgorEngine::PART_34_ACTION_109_SCROLL_RIGHT() {
void IgorEngine::PART_34_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
if (_objectsState[80] == 0 && _objectsState[73] == 1) {
- PARK_DRAW_LADY_FRAME(_screenLayer1, 1);
+ PARK_DRAW_drawOldLadyFrame(_screenLayer1, 1);
} else {
_roomObjectAreasTable[5].object = 0;
}
@@ -450,18 +442,14 @@ void IgorEngine::PART_34_APPLY_OBJECT_STATE(int num) {
}
}
-/**
- * The old lady idles in her place by shifting between the frames of FRM_Park4. Pixels of Igor and
- * of the dialogue text are kept on the screen.
- */
-void IgorEngine::PART_34_LADY_IDLE(int step) {
+void IgorEngine::PART_34_oldLadyIdleAnimationFrame(int step) {
drawAnimRect(73 * 320 + 112, kParkIdleFrames + kOldLadyIdleFrames[step - 1] * 630, 18, 35, true, kBlendBehindIgorAndText);
}
void IgorEngine::PART_34_UPDATE_ROOM_BACKGROUND() {
PARK_UPDATE_AMBIENT_SOUND();
if (compareGameTick(61) && _objectsState[80] == 0 && _objectsState[73] == 1 && getRandomNumber(4) == 0) {
- PART_34_LADY_IDLE(_parkLadyIdleStep);
+ PART_34_oldLadyIdleAnimationFrame(_parkLadyIdleStep);
_parkLadyIdleStep = (_parkLadyIdleStep == 6) ? 1 : _parkLadyIdleStep + 1;
}
}
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index ca1d4dc9060..d1635552b4f 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -129,7 +129,7 @@ void IgorEngine::PART_35() {
static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
loadAnimData(frames, kParkFrames);
if (_objectsState[80] == 0 && _objectsState[73] == 1) {
- PARK_DRAW_LADY_FRAME(_screenLayer1, 1);
+ PARK_DRAW_drawOldLadyFrame(_screenLayer1, 1);
}
copyArea(_animFramesBuffer, 0, 160, _screenLayer1, 320, 160, 144);
loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight,
Commit: 19acaea4fb82ccf0c56a9cdbfa917be3790709d2
https://github.com/scummvm/scummvm/commit/19acaea4fb82ccf0c56a9cdbfa917be3790709d2
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:40+01:00
Commit Message:
IGOR: Implements part 73
Changed paths:
A engines/igor/parts/part_73.cpp
A engines/igor/parts/part_80.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_4.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 8cfd28af236..d1ed5ae1d65 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1285,6 +1285,16 @@ private:
void PART_78_INTERJECTION(int which);
void PART_78();
+ void PART_73_DRAW_PATCH(int frame);
+ void PART_73_UPDATE_DIALOGUE(int action);
+ void PART_73();
+
+ void PART_80_DRAW_PATCH(int frame);
+ void PART_80_UPDATE_DIALOGUE_FIRST(int action);
+ void PART_80_UPDATE_DIALOGUE_SECOND(int action);
+ void PART_80_SAY(int who, const Common::Array<DialogueText> &lines);
+ void PART_80();
+
// maze
static const MazeNode MAZE_NODES[108];
static const MazeRoom *getMazeRoom(int part);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 50298b20a92..abe18292987 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -56,10 +56,12 @@ MODULE_OBJS = \
parts/part_70.o \
parts/part_71.o \
parts/part_72.o \
+ parts/part_73.o \
parts/part_74.o \
parts/part_75.o \
parts/part_77.o \
parts/part_78.o \
+ parts/part_80.o \
parts/part_81.o \
parts/part_85.o \
parts/part_90.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 8d98b16483a..fb8d8336115 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -681,6 +681,9 @@ void IgorEngine::PART_MAIN() {
case 721:
PART_72();
break;
+ case 730:
+ PART_73(); // cutscene that plays state 800 at its end
+ break;
case 750:
PART_75(); // philip vodka cutscene
break;
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index 8847c8ee328..a73efd8c600 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -61,7 +61,7 @@ void IgorEngine::PART_04_EXEC_ACTION(int action) {
* */
void IgorEngine::PART_04() {
- if (_objectsState[106] == 1) { // newspaper cutscene
+ if (_objectsState[106] == 1) { // police custcene
_currentPart = 730;
return;
}
diff --git a/engines/igor/parts/part_73.cpp b/engines/igor/parts/part_73.cpp
new file mode 100644
index 00000000000..2ba9478e092
--- /dev/null
+++ b/engines/igor/parts/part_73.cpp
@@ -0,0 +1,116 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// A 26x52 area of the picture is redrawn from the animation resource, whose frames are 26x53 each.
+static const int kPart73PatchOffset = 55 * 320 + 157;
+static const int kPart73PatchWidth = 26;
+static const int kPart73PatchHeight = 52;
+static const int kPart73PatchFrameSize = 26 * 53;
+
+// Where the lines of the person of the picture are shown.
+static const int kPart73TextX = 170;
+static const int kPart73TextY = 50;
+
+// The object that goes to the end of the inventory while the scene lasts.
+static const int kPart73InventoryObject = 25;
+static const int kPart73InventoryIndex = 60;
+
+void IgorEngine::PART_73_DRAW_PATCH(int frame) {
+ copyArea(_screenVGA, kPart73PatchOffset, 320, _animFramesBuffer + (frame - 1) * kPart73PatchFrameSize + kPart73PatchWidth,
+ kPart73PatchWidth, kPart73PatchWidth, kPart73PatchHeight);
+}
+
+void IgorEngine::PART_73_UPDATE_DIALOGUE(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_73_DRAW_PATCH(1);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_73_DRAW_PATCH(getRandomNumber(4) + 1);
+ break;
+ }
+}
+
+void IgorEngine::PART_73() {
+ playMusic(8);
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_Part73, IMG_Part73, BOX_Part73, MSK_Part73, TXT_Part73);
+ // the colors of Igor
+ memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
+ static const int anim[] = { ANM_Part73, 0 };
+ loadAnimData(anim);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ memset(_screenVGA + 46080, 0, 17920);
+ PART_73_DRAW_PATCH(1);
+ WalkData *wd = &_walkData[0];
+ wd->setPos(195, 107, 4, 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 = 1;
+ _walkDataCurrentIndex = 0;
+ moveIgor(4, 0);
+ fadeIn(768);
+ _gameState.igorMoving = false;
+
+ cutsceneSayWithCallback(kPart73TextX, kPart73TextY, 63, 14, 19, { { 201, 2, 928 } }, &IgorEngine::PART_73_UPDATE_DIALOGUE);
+ igorSayAndWait({ { 203, 1, 929 }, { 204, 2, 930 } });
+ cutsceneSayWithCallback(kPart73TextX, kPart73TextY, 63, 14, 19, { { 206, 2, 931 }, { 208, 2, 932 } },
+ &IgorEngine::PART_73_UPDATE_DIALOGUE);
+ igorSayAndWait({ { 210, 1, 933 }, { 211, 1, 934 } });
+
+ --_walkDataLastIndex;
+ buildWalkPath(195, 107, 319, 123);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+
+ _objectsState[7] = 1;
+ UPDATE_OBJECT_STATE(8);
+ // the object is taken out of the inventory and put at its end
+ removeInventoryEntry(kPart73InventoryIndex);
+ ++_inventoryInfo[73];
+ _inventoryInfo[_inventoryInfo[73] - 1] = kPart73InventoryObject;
+ _inventoryInfo[kPart73InventoryIndex] = _inventoryInfo[73];
+ _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
+ fadeOut(624);
+
+ // the card with the time that has passed
+ PART_MEANWHILE(IMG_Part73Card);
+ PART_80();
+
+ setupDefaultPalette();
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[72], 0);
+ _currentAction.verb = kVerbWalk;
+ _objectsState[106] = 0;
+ _currentPart = 40;
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_80.cpp b/engines/igor/parts/part_80.cpp
new file mode 100644
index 00000000000..24ed57df232
--- /dev/null
+++ b/engines/igor/parts/part_80.cpp
@@ -0,0 +1,127 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// A 50x29 area of the picture is redrawn from the animation resource, whose frames are 50x29 (1450 bytes) each.
+static const int kPart80PatchOffset = 62 * 320 + 135;
+static const int kPart80PatchWidth = 50;
+static const int kPart80PatchHeight = 29;
+static const int kPart80PatchFrameSize = 1450;
+
+// Four frames of 28x69 are drawn into the picture at the end of the scene; they start at this offset of the animation
+// resource.
+static const int kPart80ObjectOffset = 68 * 320 + 121;
+static const int kPart80ObjectWidth = 28;
+static const int kPart80ObjectHeight = 69;
+static const int kPart80ObjectFrameSize = 0x78C;
+static const int kPart80ObjectFramesBase = 0x25C4;
+
+// Where and in which color each of the two persons talk.
+static const int kPart80FirstX = 149;
+static const int kPart80FirstY = 59;
+static const int kPart80SecondX = 171;
+static const int kPart80SecondY = 60;
+
+void IgorEngine::PART_80_DRAW_PATCH(int frame) {
+ copyArea(_screenVGA, kPart80PatchOffset, 320, _animFramesBuffer + (frame - 1) * kPart80PatchFrameSize, kPart80PatchWidth,
+ kPart80PatchWidth, kPart80PatchHeight);
+}
+
+void IgorEngine::PART_80_UPDATE_DIALOGUE_FIRST(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_80_DRAW_PATCH(1);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_80_DRAW_PATCH(getRandomNumber(3) + 1);
+ break;
+ }
+}
+
+void IgorEngine::PART_80_UPDATE_DIALOGUE_SECOND(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_80_DRAW_PATCH(5);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_80_DRAW_PATCH(getRandomNumber(3) + 5);
+ break;
+ }
+}
+
+void IgorEngine::PART_80_SAY(int who, const Common::Array<DialogueText> &lines) {
+ if (who == 0) {
+ cutsceneSayWithCallback(kPart80FirstX, kPart80FirstY, 0, 44, 63, lines, &IgorEngine::PART_80_UPDATE_DIALOGUE_FIRST);
+ } else {
+ cutsceneSayWithCallback(kPart80SecondX, kPart80SecondY, 63, 0, 38, lines, &IgorEngine::PART_80_UPDATE_DIALOGUE_SECOND);
+ }
+}
+
+/**
+ * Scene of two persons talking, followed by four frames drawn into the picture. It is played at the end of state 730.
+ */
+void IgorEngine::PART_80() {
+ playMusic(8);
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_Part80, IMG_Part80, BOX_Part80, MSK_Part80, TXT_Part80);
+ static const int anim[] = { ANM_Part80, 0 };
+ loadAnimData(anim);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ memset(_screenVGA + 46080, 0, 17920);
+ fadeIn(768);
+ _gameState.igorMoving = false;
+
+ PART_80_SAY(0, { { 201, 2, 1131 } });
+ PART_80_SAY(1, { { 203, 1, 1132 } });
+ PART_80_SAY(0, { { 204, 2, 1133 } });
+ PART_80_SAY(1, { { 206, 1, 1134 } });
+ PART_80_SAY(0, { { 207, 1, 1135 } });
+ PART_80_SAY(1, { { 208, 1, 1136 } });
+ PART_80_SAY(0, { { 209, 1, 1137 } });
+ PART_80_SAY(1, { { 210, 1, 1138 } });
+ PART_80_SAY(0, { { 211, 1, 1139 }, { 212, 1, 1140 } });
+ PART_80_SAY(1, { { 213, 1, 1141 } });
+ PART_80_SAY(0, { { 214, 2, 1142 } });
+ PART_80_SAY(1, { { 216, 1, 1143 }, { 217, 1, 1144 } });
+ PART_80_SAY(0, { { 218, 1, 1145 } });
+ PART_80_SAY(1, { { 219, 1, 1146 }, { 220, 1, 1147 }, { 221, 1, 1148 } });
+ waitForTimer(255);
+
+ for (int i = 1; i <= 4; ++i) {
+ copyArea(_screenVGA, kPart80ObjectOffset, 320,
+ _animFramesBuffer + kPart80ObjectFramesBase + i * kPart80ObjectFrameSize, kPart80ObjectWidth,
+ kPart80ObjectWidth, kPart80ObjectHeight);
+ if (i < 4) {
+ waitForTimer(21);
+ } else {
+ playSound(15, 1);
+ }
+ }
+ for (int i = 1; i <= 3; ++i) {
+ waitForTimer(255);
+ }
+ memcpy(_paletteBuffer, _currentPalette, 624);
+ fadeOut(768);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 1bb030cdd4b..7a6409052cd 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -788,4 +788,21 @@
#define IMG_Part78MinutesLater 1175
#define IMG_Part78NextDay 1176
+// State 730 (PART_73)
+#define ANM_Part73 1177
+#define TXT_Part73 1178
+#define IMG_Part73 1179
+#define PAL_Part73 1180
+#define MSK_Part73 1181
+#define BOX_Part73 1182
+#define IMG_Part73Card 1183
+
+// State 800 (PART_80), played inside state 730
+#define ANM_Part80 1184
+#define TXT_Part80 1185
+#define IMG_Part80 1186
+#define PAL_Part80 1187
+#define MSK_Part80 1188
+#define BOX_Part80 1189
+
#endif // IGOR_RESOURCE_IDS
Commit: 675f23c1c23cdd772ba020709a6109a51f0eeae6
https://github.com/scummvm/scummvm/commit/675f23c1c23cdd772ba020709a6109a51f0eeae6
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:40+01:00
Commit Message:
IGOR: Implements part 76
Changed paths:
A engines/igor/parts/part_76.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index d1ed5ae1d65..8fe3ddd24b9 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1254,6 +1254,16 @@ private:
void PART_72_UPDATE_ROOM_BACKGROUND();
void PART_72();
+ void PART_76_EXEC_ACTION(int action);
+ void PART_76_APPLY_OBJECT_STATE();
+ void PART_76_DRAW_SCENE_FRAME(int frame);
+ void PART_76_DRAW_SEQUENCE_FRAME(int frame);
+ void PART_76_ACTION_103_sequence();
+ void PART_76_ACTION_104_takeObject();
+ void PART_76_ACTION_106_finale();
+ void PART_76_ENTRY();
+ void PART_76();
+
void PART_77_EXEC_ACTION(int action);
void PART_77_APPLY_OBJECT_STATE();
void PART_77_SET_AREAS_LIGHT(int lum);
@@ -1569,6 +1579,7 @@ protected:
static const RoomDataOffsets PART_70_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_71_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_72_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_76_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_77_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_81_ROOM_DATA_OFFSETS;
static const uint8 INVENTORY_IMG_INIT[];
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index abe18292987..c61b4c239e7 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -59,6 +59,7 @@ MODULE_OBJS = \
parts/part_73.o \
parts/part_74.o \
parts/part_75.o \
+ parts/part_76.o \
parts/part_77.o \
parts/part_78.o \
parts/part_80.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index fb8d8336115..fd8670d04dc 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -687,6 +687,9 @@ void IgorEngine::PART_MAIN() {
case 750:
PART_75(); // philip vodka cutscene
break;
+ case 760:
+ PART_76(); // room reached after the scene of the college garden
+ break;
case 770:
case 771:
PART_77();
diff --git a/engines/igor/parts/part_76.cpp b/engines/igor/parts/part_76.cpp
new file mode 100644
index 00000000000..81dc6088146
--- /dev/null
+++ b/engines/igor/parts/part_76.cpp
@@ -0,0 +1,343 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// The animation resource: two 7x6 pieces and two 68x54 pieces of the room picture first, then the sprite strips and
+// the full screen frames, each group followed by the table of its frame offsets.
+static const int kPart76SmallPieceWidth = 7;
+static const int kPart76SmallPieceHeight = 6;
+static const int kPart76SmallPieceSize = kPart76SmallPieceWidth * kPart76SmallPieceHeight;
+static const int kPart76SmallPieceOffset = 83 * 320 + 300;
+
+static const int kPart76BigPieceWidth = 68;
+static const int kPart76BigPieceHeight = 54;
+static const int kPart76BigPieceSize = kPart76BigPieceWidth * kPart76BigPieceHeight;
+static const int kPart76BigPieceFirst = 0x54;
+static const int kPart76BigPieceOffset = 27 * 320 + 188;
+
+// Frames of the first sequence: the group starts at 0x2902 and its table of offsets follows the frames.
+static const int kPart76SequenceBase = 0x2902;
+static const int kPart76SequenceTable = 0x1753;
+
+// Frames of the full screen scenes: the group starts at 0x4067 and its table of offsets follows the frames.
+static const int kPart76SceneBase = 0x4067;
+static const int kPart76SceneTable = 0x3ABB;
+
+// A 17x16 sprite drawn at (289,81), three frames of 272 bytes.
+static const int kPart76LampOffset = 81 * 320 + 289;
+static const int kPart76LampWidth = 17;
+static const int kPart76LampHeight = 16;
+static const int kPart76LampFrames = 0x1BF4;
+static const int kPart76LampFrameSize = kPart76LampWidth * kPart76LampHeight;
+
+// A 23x49 sprite drawn at (285,71), frames of 1127 bytes.
+static const int kPart76SpriteOffset = 71 * 320 + 285;
+static const int kPart76SpriteWidth = 23;
+static const int kPart76SpriteHeight = 49;
+static const int kPart76SpriteFrames = 0x1BCD;
+static const int kPart76SpriteFrameSize = kPart76SpriteWidth * kPart76SpriteHeight;
+
+// Order in which the frames of the first sequence are shown before the closing frames 4 to 9.
+static const uint8 kPart76SequenceFrames[5] = { 1, 2, 3, 2, 3 };
+
+// Order of the sprite frames of the third action.
+static const uint8 kPart76SpriteOrder[3] = { 1, 2, 1 };
+
+// Order of the frames of the last part of the third action.
+static const uint8 kPart76EndFrames[20] = { 18, 19, 20, 21, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 24, 25, 26, 27 };
+
+// Point where Igor stops at the end of the walk of the scene and the one he reaches later.
+static const int kPart76WalkEndX = 295;
+static const int kPart76WalkEndY = 119;
+
+// Object of the inventory that action 104 puts into it, and the position where the inventory keeps its index.
+static const int kPart76InventoryObject = 3;
+static const int kPart76InventoryObjectIndex = 38;
+
+void IgorEngine::PART_76_EXEC_ACTION(int action) {
+ if (action != 103) {
+ // the music of the room is started again by every action but the third one
+ playMusic(12);
+ }
+ switch (action) {
+ case 101:
+ igorSay(201, 1, 700);
+ break;
+ case 102:
+ igorSay(202, 1, 701);
+ break;
+ case 103:
+ PART_76_ACTION_103_sequence();
+ break;
+ case 104:
+ PART_76_ACTION_104_takeObject();
+ break;
+ case 105:
+ igorSay(207, 2, 705);
+ break;
+ case 106:
+ PART_76_ACTION_106_finale();
+ break;
+ case 107:
+ igorSay(224, 1, 719);
+ break;
+ case 108:
+ igorSay(225, 1, 720);
+ break;
+ default:
+ error("PART_76_EXEC_ACTION unhandled action %d", action);
+ break;
+ }
+}
+
+/**
+ * Pieces of the room picture that follow the state of the objects (they are drawn into the picture, not on the
+ * screen) and the actions and objects that go with them.
+ */
+void IgorEngine::PART_76_APPLY_OBJECT_STATE() {
+ if (_objectsState[108] == 0) {
+ copyArea(_screenLayer1, kPart76BigPieceOffset, 320, _animFramesBuffer + kPart76BigPieceFirst, kPart76BigPieceWidth,
+ kPart76BigPieceWidth, kPart76BigPieceHeight);
+ _roomActionsTable[79] = 9;
+ _roomActionsTable[81] = 14;
+ } else {
+ copyArea(_screenLayer1, kPart76BigPieceOffset, 320,
+ _animFramesBuffer + kPart76BigPieceFirst + kPart76BigPieceSize, kPart76BigPieceWidth, kPart76BigPieceWidth,
+ kPart76BigPieceHeight);
+ _roomObjectAreasTable[10].object = 1;
+ _roomActionsTable[79] = 11;
+ _roomActionsTable[81] = 12;
+ }
+ if (_objectsState[109] == 0) {
+ copyArea(_screenLayer1, kPart76SmallPieceOffset, 320, _animFramesBuffer, kPart76SmallPieceWidth,
+ kPart76SmallPieceWidth, kPart76SmallPieceHeight);
+ } else {
+ copyArea(_screenLayer1, kPart76SmallPieceOffset, 320, _animFramesBuffer + kPart76SmallPieceSize,
+ kPart76SmallPieceWidth, kPart76SmallPieceWidth, kPart76SmallPieceHeight);
+ }
+ _roomObjectAreasTable[11].object = 0;
+ _roomObjectAreasTable[12].object = 0;
+}
+
+/**
+ * Frame n of the full screen scenes, drawn on the screen.
+ */
+void IgorEngine::PART_76_DRAW_SCENE_FRAME(int frame) {
+ decodeAnimFrame(getAnimFrame(kPart76SceneBase, kPart76SceneTable, frame), _screenVGA);
+}
+
+/**
+ * Frame n of the first sequence, drawn on the screen.
+ */
+void IgorEngine::PART_76_DRAW_SEQUENCE_FRAME(int frame) {
+ decodeAnimFrame(getAnimFrame(kPart76SequenceBase, kPart76SequenceTable, frame), _screenVGA);
+}
+
+/**
+ * Frames 1 to 5 and then 4 to 9 are drawn on the screen, then the object changes its state.
+ */
+void IgorEngine::PART_76_ACTION_103_sequence() {
+ for (int i = 0; i < 5; ++i) {
+ PART_76_DRAW_SEQUENCE_FRAME(kPart76SequenceFrames[i]);
+ waitForTimer(51);
+ }
+ for (int frame = 4; frame <= 9; ++frame) {
+ PART_76_DRAW_SEQUENCE_FRAME(frame);
+ waitForTimer(31);
+ }
+ igorSay(206, 1, 704);
+ _objectsState[108] = 1;
+ PART_76_APPLY_OBJECT_STATE();
+}
+
+/**
+ * Three frames of a sprite are drawn on the screen, then object 3 goes into the inventory.
+ */
+void IgorEngine::PART_76_ACTION_104_takeObject() {
+ for (int frame = 1; frame <= 3; ++frame) {
+ drawAnimRect(kPart76LampOffset, kPart76LampFrames + frame * kPart76LampFrameSize, kPart76LampWidth, kPart76LampHeight);
+ waitForTimer(91);
+ }
+ addObjectToInventory(kPart76InventoryObject, kPart76InventoryObjectIndex);
+ _objectsState[109] = 1;
+ PART_76_APPLY_OBJECT_STATE();
+ igorSay({ { 203, 1, 702 }, { 204, 2, 703 } });
+}
+
+/**
+ * Scripted sequence that is only played once the third action was done (before that, Igor only says a line). Igor stops
+ * where he is, talks, walks to the right of the picture, the sprite is drawn, he talks again and walks to (190, 85);
+ * the full screen frames follow and the story goes on in state 790.
+ */
+void IgorEngine::PART_76_ACTION_106_finale() {
+ if (_objectsState[108] == 0) {
+ igorSay(209, 1, 706);
+ return;
+ }
+ // the panel and the colors 240 to 255 are cleared
+ memset(_screenVGA + 46080, 0, 17920);
+ memset(_paletteBuffer + 240 * 3, 0, 48);
+ memset(_currentPalette + 240 * 3, 0, 48);
+ if (_gameState.igorMoving) {
+ _walkDataLastIndex = _walkDataCurrentIndex + 1;
+ _walkData[_walkDataCurrentIndex].frameNum = 0;
+ moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
+ _gameState.igorMoving = false;
+ }
+ igorSay({ { 210, 1, 707 }, { 211, 1, 708 } });
+ waitForEndOfIgorDialogue();
+
+ --_walkDataLastIndex;
+ buildWalkPath(_walkData[_walkDataLastIndex].x, _walkData[_walkDataLastIndex].y, kPart76WalkEndX, kPart76WalkEndY);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+
+ for (int i = 0; i < 3; ++i) {
+ drawAnimRect(kPart76SpriteOffset, kPart76SpriteFrames + kPart76SpriteOrder[i] * kPart76SpriteFrameSize,
+ kPart76SpriteWidth, kPart76SpriteHeight, false, kBlendLitSpriteNoShade);
+ waitForTimer(46);
+ }
+ igorSay({ { 212, 2, 709 }, { 214, 2, 710 } });
+ waitForEndOfIgorDialogue();
+
+ --_walkDataLastIndex;
+ buildWalkPath(kPart76WalkEndX, kPart76WalkEndY, 190, 85);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkData[_walkDataLastIndex].posNum = 2;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+
+ igorSay({ { 216, 1, 711 }, { 217, 1, 712 }, { 218, 1, 713 }, { 219, 1, 714 } });
+ waitForEndOfIgorDialogue();
+ PART_76_DRAW_SCENE_FRAME(11);
+ waitForTimer(255);
+ for (int frame = 12; frame <= 17; ++frame) {
+ PART_76_DRAW_SCENE_FRAME(frame);
+ if (frame < 17) {
+ waitForTimer(3);
+ }
+ }
+ igorSay({ { 220, 1, 715 }, { 221, 1, 716 }, { 222, 1, 717 }, { 223, 1, 718 } });
+ waitForEndOfIgorDialogue();
+ for (int i = 0; i < 20; ++i) {
+ PART_76_DRAW_SCENE_FRAME(kPart76EndFrames[i]);
+ waitForTimer(31);
+ }
+ // the colors 240 to 255 are black on the screen
+ for (int i = 240; i <= 255; ++i) {
+ setPaletteColor(i, 0, 0, 0);
+ }
+ _currentPart = 790;
+}
+
+/**
+ * Igor says something before he is in the picture, then he walks in from the left to (159, 94). The text that goes
+ * with the arrival is shown while the room is already running.
+ */
+void IgorEngine::PART_76_ENTRY() {
+ WalkData *wd = &_walkData[0];
+ wd->x = 0;
+ wd->y = 71;
+ wd->scaleWidth = 49;
+ wd->scaleHeight = 49;
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ igorSay({ { 226, 2, 721 }, { 228, 1, 722 } });
+ waitForEndOfIgorDialogue(false);
+ waitForTimer(255);
+ waitForTimer(255);
+
+ wd->setPos(10, 71, 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;
+ // the point at the left edge is part of the walkable area while the path is built
+ const int startArea = _screenLayer2[71 * 320 + 10];
+ _roomObjectAreasTable[startArea].area = 1;
+ buildWalkPath(10, 71, 159, 94);
+ _roomObjectAreasTable[startArea].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+
+ igorSay({ { 229, 1, 723 }, { 230, 2, 724 }, { 232, 1, 725 } });
+}
+
+void IgorEngine::PART_76() {
+ playMusic(12);
+ if (!_gameStateLoaded) {
+ // the card that opens the part
+ PART_MEANWHILE(IMG_Part76Card);
+ }
+ _gameState.enableLight = 2;
+ loadIgorFrames();
+ loadActionData(DAT_Part76);
+ loadRoomData(PAL_Part76, IMG_Part76, BOX_Part76, MSK_Part76, TXT_Part76);
+ SET_PAL_240_48_1();
+ static const int anim[] = { ANM_Part76, 0 };
+ loadAnimData(anim);
+ SET_PAL_208_96_1();
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[72], 0);
+ _roomDataOffsets = PART_76_ROOM_DATA_OFFSETS;
+ setRoomClickFix(119, 153, 295, true, 119);
+ SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_76_EXEC_ACTION);
+ PART_76_APPLY_OBJECT_STATE();
+ memcpy(_screenVGA, _screenLayer1, 46080);
+
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ PART_76_ENTRY();
+ }
+ enterPartLoop();
+ while (_currentPart == 760 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ stopDialogueSpeech();
+ if (!_gameStateLoaded) {
+ // the panel is cleared and the colors 208 to 254 go black in both palettes
+ memset(_screenVGA + 46080, 0, 17920);
+ memset(_paletteBuffer + 208 * 3, 0, 141);
+ memset(_currentPalette + 208 * 3, 0, 141);
+ } else {
+ loadIgorFrames();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+ // the display starts at the top of the picture again
+ _screenVGAVOffset = 0;
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 7a6409052cd..19f9e1f827c 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -805,4 +805,14 @@
#define MSK_Part80 1188
#define BOX_Part80 1189
+// State 760 (PART_76)
+#define DAT_Part76 1190
+#define ANM_Part76 1191
+#define TXT_Part76 1192
+#define IMG_Part76 1193
+#define PAL_Part76 1194
+#define MSK_Part76 1195
+#define BOX_Part76 1196
+#define IMG_Part76Card 1197
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 1675985fbd6..2d577fe8d5d 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -499,6 +499,13 @@ const RoomDataOffsets IgorEngine::PART_72_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_76_ROOM_DATA_OFFSETS = {
+ { 20, 2, 2, 1 },
+ { 32, 43 },
+ { 47, 237, 3183, 131, 207, 82 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_77_ROOM_DATA_OFFSETS = {
{ 320, 8, 56, 7 },
{ 835, 844 },
Commit: ab6164a5dfda85aa713c47a74c5e1bbe3f1472e9
https://github.com/scummvm/scummvm/commit/ab6164a5dfda85aa713c47a74c5e1bbe3f1472e9
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:40+01:00
Commit Message:
IGOR: Implements part 79
Changed paths:
A engines/igor/parts/part_79.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 8fe3ddd24b9..d47e6598a56 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -530,6 +530,8 @@ private:
// the two fireflies of room 69: the current frame of each and the steps of the first one since the second one started
// frames of the band drawn across the picture in state 780 (loaded while the scene lasts)
uint8 *_part78BandFrames = nullptr;
+ uint8 _part79EndFrame = 0;
+ uint8 _part79BaseFrame = 0;
uint8 _part69FireflyFrameA;
uint8 _part69FireflyFrameB;
uint16 _part69FireflyStepCount;
@@ -1264,6 +1266,34 @@ private:
void PART_76_ENTRY();
void PART_76();
+ void PART_79_DRAW_FIGURE(int frame);
+ void PART_79_DRAW_PATCH(int step);
+ void PART_79_CLEAR_PATCH();
+ void PART_79_UPDATE_AMBIENT_790();
+ void PART_79_UPDATE_DIALOGUE_790(int action);
+ void PART_79_SAY_790(const Common::Array<DialogueText> &lines);
+ void PART_79_SLIDE();
+ void PART_79_790();
+ void PART_79_DRAW_GROUP_FRAME(const uint8 *buffer, int table, int base, int frame);
+ void PART_79_DRAW_SCENE(int frame);
+ void PART_79_DRAW_LAYER2_FRAME(int frame);
+ void PART_79_DRAW_LAYER2_FRAME_2(int frame);
+ void PART_79_DRAW_ANIM2_FRAME(const void *group, int frame);
+ void PART_79_ANIMATE_IGOR_HEAD(int frame);
+ void PART_79_UPDATE_DIALOGUE_SPEAKER(int action);
+ void PART_79_UPDATE_DIALOGUE_FIRST_SPEAKER(int action);
+ void PART_79_UPDATE_DIALOGUE_THIRD_SPEAKER(int action);
+ void PART_79_UPDATE_AMBIENT_791();
+ void PART_79_SAY_SPEAKER(int startX, int startY, int x, int y, int r, int g, int b, int endFrame, int baseFrame, const Common::Array<DialogueText> &lines);
+ void PART_79_SAY_FIRST_SPEAKER(int startX, int startY, const Common::Array<DialogueText> &lines);
+ void PART_79_SAY_THIRD_SPEAKER(const Common::Array<DialogueText> &lines);
+ void PART_79_IGOR_SAY(const Common::Array<DialogueText> &lines);
+ void PART_79_SET_IGOR_POS(int x, int y);
+ void PART_79_FADE_COLORS(int first, int last, bool fadeInColors);
+ void PART_79_FADE_IN_PAIR(int firstColor);
+ void PART_79_791();
+ void PART_79();
+
void PART_77_EXEC_ACTION(int action);
void PART_77_APPLY_OBJECT_STATE();
void PART_77_SET_AREAS_LIGHT(int lum);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index c61b4c239e7..3b0dc538708 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -62,6 +62,7 @@ MODULE_OBJS = \
parts/part_76.o \
parts/part_77.o \
parts/part_78.o \
+ parts/part_79.o \
parts/part_80.o \
parts/part_81.o \
parts/part_85.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index fd8670d04dc..275cb0d44ef 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -697,6 +697,10 @@ void IgorEngine::PART_MAIN() {
case 780:
PART_78(); // cutscene in the lecture hall
break;
+ case 790:
+ case 791:
+ PART_79(); // two scenes, shown below a black band
+ break;
case 810:
PART_81();
break;
diff --git a/engines/igor/parts/part_79.cpp b/engines/igor/parts/part_79.cpp
new file mode 100644
index 00000000000..73097110fb5
--- /dev/null
+++ b/engines/igor/parts/part_79.cpp
@@ -0,0 +1,614 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "common/system.h"
+#include "igor/igor.h"
+
+namespace Igor {
+
+// The picture of both states is shown below a black band of this many rows.
+static const int kPart79BandRows = 24;
+
+// ---------------------------------------------------------------------------------------------------------------
+// State 790
+// ---------------------------------------------------------------------------------------------------------------
+
+// The animation resource ends with a table of offsets (one word per frame, frame 1 first). The frames drawn over the
+// whole picture are 1 to 88.
+static const int kPart79FigureTable = 0xF858;
+
+// Small pieces of 17x9 that are drawn at (86,135), five of them, 153 bytes each, after the table.
+static const int kPart79PatchOffset = 135 * 320 + 86;
+static const int kPart79PatchWidth = 17;
+static const int kPart79PatchHeight = 9;
+static const int kPart79PatchFrames = 0xF908;
+static const int kPart79PatchFrameSize = kPart79PatchWidth * kPart79PatchHeight;
+static const uint8 kPart79PatchSteps[8] = { 0, 1, 2, 3, 4, 3, 2, 1 };
+static const int kPart79PatchClearColor = 0x68;
+
+// Where and in which color the text of the scene is shown.
+static const int kPart79TextX = 94;
+static const int kPart79TextY = 108;
+static const int kPart79TextR = 63;
+static const int kPart79TextG = 0;
+static const int kPart79TextB = 38;
+
+// Frame the talking figure goes back to at the end of a line, and the number of frames it picks from while it talks.
+static const int kPart79TalkFrame = 2;
+
+// Frames shown before the picture slides to the next one, the first one of the standing loop and the last.
+static const int kPart79StandingFirst = 7;
+static const int kPart79StandingEnd = 0x31;
+static const int kPart79FinalFirst = 0x39;
+static const int kPart79FinalLast = 0x4C;
+
+// Slide to the second picture: it goes 8 pixels at a time, 20 steps, one step every 16 ticks. The first 12 steps draw
+// the frames 77 to 88 over the picture, the last 8 frames 1 to 8 of the group kept in a resource of their own.
+static const int kPart79SlideSteps = 20;
+static const int kPart79SlideFirstFrame = 77;
+static const int kPart79SlideLastFrame = 88;
+static const int kPart79SlideAnimSteps = 12;
+static const int kPart79SlideLayer2Offset = 0xA0;
+static const int kPart79BankTable = 0x6DA6;
+
+void IgorEngine::PART_79_DRAW_FIGURE(int frame) {
+ decodeAnimFrame(getAnimFrame(0, kPart79FigureTable, frame), _screenVGA, false);
+}
+
+void IgorEngine::PART_79_DRAW_PATCH(int step) {
+ copyArea(_screenVGA, kPart79PatchOffset, 320, _animFramesBuffer + kPart79PatchFrames + step * kPart79PatchFrameSize,
+ kPart79PatchWidth, kPart79PatchWidth, kPart79PatchHeight);
+}
+
+void IgorEngine::PART_79_CLEAR_PATCH() {
+ for (int y = 0; y < kPart79PatchHeight; ++y) {
+ memset(_screenVGA + kPart79PatchOffset + y * 320, kPart79PatchClearColor, kPart79PatchWidth);
+ }
+}
+
+/**
+ * Every 64 ticks the small piece goes on to the next of its steps.
+ */
+void IgorEngine::PART_79_UPDATE_AMBIENT_790() {
+ if (compareGameTick(0x3D)) {
+ PART_79_DRAW_PATCH(kPart79PatchSteps[_roomAmbientIndex]);
+ _roomAmbientIndex = (_roomAmbientIndex == 7) ? 0 : _roomAmbientIndex + 1;
+ }
+}
+
+void IgorEngine::PART_79_UPDATE_DIALOGUE_790(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_79_DRAW_FIGURE(kPart79TalkFrame);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_79_DRAW_FIGURE(kPart79TalkFrame + getRandomNumber(4));
+ break;
+ }
+}
+
+void IgorEngine::PART_79_SAY_790(const Common::Array<DialogueText> &lines) {
+ cutsceneSayStartWithCallback(kPart79TextX, kPart79TextY, kPart79TextR, kPart79TextG, kPart79TextB, lines,
+ &IgorEngine::PART_79_UPDATE_DIALOGUE_790);
+ _updateRoomBackground = &IgorEngine::PART_79_UPDATE_AMBIENT_790;
+ waitForEndOfCutsceneDialogue(kPart79TextX, kPart79TextY, kPart79TextR, kPart79TextG, kPart79TextB);
+ _updateDialogue = nullptr;
+ _updateRoomBackground = nullptr;
+}
+
+/**
+ * The picture slides to the left 8 pixels per step, the second picture comes in from the right and frames are
+ * drawn over the result.
+ */
+void IgorEngine::PART_79_SLIDE() {
+ uint8 *bank = loadData(ANM_Part79Frames);
+ uint8 *buffer = _screenTextLayer;
+ int frame = kPart79SlideFirstFrame;
+ int step = 1;
+ _gameTicks = 0;
+ do {
+ if (compareGameTick(1, 16)) {
+ const int shift = step * 8;
+ copyArea(buffer, 0, 320, _screenLayer1 + shift, 320, 320 - shift, 144);
+ copyArea(buffer, 320 - shift, 320, _screenLayer2 + kPart79SlideLayer2Offset, 320, shift, 144);
+ if (step <= kPart79SlideAnimSteps) {
+ decodeAnimFrame(getAnimFrame(0, kPart79FigureTable, frame), buffer, false);
+ frame = (frame == kPart79SlideLastFrame) ? 1 : frame + 1;
+ } else {
+ const int offset = READ_LE_UINT16(bank + kPart79BankTable + (frame - 1) * 2);
+ decodeAnimFrame(bank + offset - 1, buffer, false);
+ ++frame;
+ }
+ memcpy(_screenVGA, buffer, 46080);
+ ++step;
+ }
+ waitForTimer();
+ } while (step != kPart79SlideSteps + 1);
+ free(bank);
+}
+
+void IgorEngine::PART_79_790() {
+ playMusic(13);
+ memset(_currentPalette, 0, 768);
+ setPaletteRange(0, 255);
+ loadRoomData(PAL_Part79, IMG_Part79, 0, 0, 0);
+ uint8 *text = loadData(TXT_Part79);
+ decodeRoomStrings(text, true);
+ free(text);
+ loadData(IMG_Part79Layer2, _screenLayer2);
+ loadData(ANM_Part79, _animFramesBuffer);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ PART_79_DRAW_FIGURE(1);
+ fadeIn(768);
+ _roomAmbientIndex = 0;
+
+ PART_79_SAY_790({ { 201, 2, 742 }, { 203, 1, 743 }, { 204, 2, 744 }, { 206, 1, 745 }, { 207, 1, 746 } });
+ PART_79_SAY_790({ { 208, 1, 747 }, { 209, 2, 748 } });
+
+ // the figure goes through its frames while the small piece keeps changing
+ int frame = kPart79StandingFirst;
+ do {
+ if (compareGameTick(1, 16)) {
+ PART_79_DRAW_FIGURE(frame);
+ ++frame;
+ }
+ if (compareGameTick(0x3D)) {
+ PART_79_DRAW_PATCH(kPart79PatchSteps[_roomAmbientIndex]);
+ _roomAmbientIndex = (_roomAmbientIndex == 7) ? 0 : _roomAmbientIndex + 1;
+ PART_79_DRAW_PATCH(getRandomNumber(4));
+ }
+ waitForTimer();
+ } while (frame != kPart79StandingEnd);
+
+ PART_79_SAY_790({ { 211, 1, 749 }, { 212, 1, 750 }, { 213, 1, 751 }, { 214, 2, 752 } });
+ PART_79_CLEAR_PATCH();
+ for (frame = kPart79FinalFirst; frame <= kPart79FinalLast; ++frame) {
+ PART_79_DRAW_FIGURE(frame);
+ waitForTimer(31);
+ }
+ PART_79_SLIDE();
+ _currentPart = 791;
+}
+
+// ---------------------------------------------------------------------------------------------------------------
+// State 791
+// ---------------------------------------------------------------------------------------------------------------
+
+// Groups of frames and where their table of offsets (one word per frame, frame 1 first) is. The offset of a frame is
+// relative to the base of its group. The groups are in the animation resource or in the second layer.
+struct Part79FrameGroup {
+ int table;
+ int base;
+};
+
+// frames 1.. of the animation resource that is loaded first (the table is the last 200 bytes of it)
+static const Part79FrameGroup kPart79Scenes = { 0xF6BA, 0 };
+// frames kept in the second layer
+static const Part79FrameGroup kPart79Layer2Frames = { 0x594C, 0 };
+static const Part79FrameGroup kPart79Layer2Frames2 = { 0x7FF0, 0x5989 };
+// frames of the second animation resource
+static const Part79FrameGroup kPart79Anim2A = { 0xC093, 0x88C8 };
+static const Part79FrameGroup kPart79Anim2B = { 0x3CC9, 0 };
+static const Part79FrameGroup kPart79Anim2C = { 0x7ACD, 0x3CEF };
+static const Part79FrameGroup kPart79Anim2D = { 0x88B8, 0x7AF1 };
+
+// Frame shown when a line of a speaker ends / the first frame of the group the speaker picks from while talking.
+static const int kPart79FirstSpeakerEndFrame = 1;
+static const int kPart79FirstSpeakerBase = 7;
+static const int kPart79ThirdSpeakerEndFrame = 22;
+static const int kPart79ThirdSpeakerBase = 23;
+
+// Frames that alternate in the background while Igor talks.
+static const int kPart79AmbientFirst = 0x57;
+static const int kPart79AmbientSecond = 0x58;
+
+// The three groups of 90x23, 13x11 and 44x23 pieces that are drawn at the end.
+static const int kPart79Block1Offset = 53 * 320 + 115;
+static const int kPart79Block1Width = 90;
+static const int kPart79Block1Height = 23;
+static const int kPart79Block1Frames = 0xC0A3;
+static const int kPart79Block2Offset = 108 * 320 + 201;
+static const int kPart79Block2Width = 13;
+static const int kPart79Block2Height = 11;
+static const int kPart79Block2Color = 0x68;
+static const int kPart79Block3Offset = 53 * 320 + 138;
+static const int kPart79Block3Width = 44;
+static const int kPart79Block3Height = 23;
+static const int kPart79Block3Frames = 0xC8B9;
+
+// Colors faded in and out by pairs, in the colors the Igor texts go through the sky in.
+static const int kPart79FadeFirstColor = 0xF5;
+static const int kPart79FadeLastColor = 0xFE;
+static const uint8 kPart79FadeColors[6] = { 0x3F, 0x20, 0x00, 0x2C, 0x0C, 0x00 };
+
+void IgorEngine::PART_79_DRAW_GROUP_FRAME(const uint8 *buffer, int table, int base, int frame) {
+ decodeAnimFrame(buffer + base + READ_LE_UINT16(buffer + table + frame * 2) - 1, _screenVGA, false);
+}
+
+void IgorEngine::PART_79_DRAW_SCENE(int frame) {
+ PART_79_DRAW_GROUP_FRAME(_animFramesBuffer, kPart79Scenes.table, kPart79Scenes.base, frame);
+}
+
+void IgorEngine::PART_79_DRAW_LAYER2_FRAME(int frame) {
+ PART_79_DRAW_GROUP_FRAME(_screenLayer2, kPart79Layer2Frames.table, kPart79Layer2Frames.base, frame);
+}
+
+// The frames of this group are addressed by the offset from the base without the usual correction of one byte.
+void IgorEngine::PART_79_DRAW_LAYER2_FRAME_2(int frame) {
+ const int offset = READ_LE_UINT16(_screenLayer2 + kPart79Layer2Frames2.table + frame * 2);
+ decodeAnimFrame(_screenLayer2 + kPart79Layer2Frames2.base + offset, _screenVGA, false);
+}
+
+void IgorEngine::PART_79_DRAW_ANIM2_FRAME(const void *group, int frame) {
+ const Part79FrameGroup *g = (const Part79FrameGroup *)group;
+ PART_79_DRAW_GROUP_FRAME(_animFramesBuffer, g->table, g->base, frame);
+}
+
+/**
+ * Talk animation of Igor in these states: 14x11 piece of his head over the picture (the colors of the head are
+ * moved into the range of the picture) or the picture itself where the head is transparent.
+ */
+void IgorEngine::PART_79_ANIMATE_IGOR_HEAD(int frame) {
+ WalkData *wd = &_walkData[_walkDataLastIndex - 1];
+ int dst = (wd->y - wd->scaleWidth + 1) * 320;
+ const int delta = wd->x - _walkWidthScaleTable[wd->scaleHeight - 1] / 2;
+ if (delta > 0) {
+ dst += delta;
+ }
+ for (int row = 0; row <= 10; ++row, dst += 320) {
+ for (int col = 8; col <= 21; ++col) {
+ const int offset = (wd->posNum - 1) * 924 + frame * 154 + row * 14 + (col - 8);
+ uint8 color = _igorHeadFrames[offset];
+ if (color > 0) {
+ _screenVGA[dst + col] = color + 0x20;
+ } else {
+ _screenVGA[dst + col] = _screenLayer1[dst + col];
+ }
+ }
+ }
+}
+
+void IgorEngine::PART_79_UPDATE_DIALOGUE_SPEAKER(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_79_DRAW_SCENE(_part79EndFrame);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_79_DRAW_SCENE(_part79BaseFrame + getRandomNumber(3));
+ break;
+ }
+}
+
+void IgorEngine::PART_79_UPDATE_DIALOGUE_FIRST_SPEAKER(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_79_DRAW_SCENE(kPart79FirstSpeakerEndFrame);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_79_DRAW_SCENE(kPart79FirstSpeakerBase + getRandomNumber(3));
+ break;
+ }
+}
+
+void IgorEngine::PART_79_UPDATE_DIALOGUE_THIRD_SPEAKER(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ PART_79_DRAW_LAYER2_FRAME(kPart79ThirdSpeakerEndFrame);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ PART_79_DRAW_LAYER2_FRAME(kPart79ThirdSpeakerBase + getRandomNumber(3));
+ break;
+ }
+}
+
+void IgorEngine::PART_79_UPDATE_AMBIENT_791() {
+ if (compareGameTick(0x3D)) {
+ PART_79_DRAW_SCENE(_roomAmbientIndex);
+ _roomAmbientIndex = (_roomAmbientIndex == kPart79AmbientFirst) ? kPart79AmbientSecond : kPart79AmbientFirst;
+ }
+}
+
+/**
+ * Lines of a person of the scene: the frames of the speaker go with the text, which is shown at (x, y).
+ */
+void IgorEngine::PART_79_SAY_SPEAKER(int startX, int startY, int x, int y, int r, int g, int b, int endFrame, int baseFrame,
+ const Common::Array<DialogueText> &lines) {
+ _part79EndFrame = endFrame;
+ _part79BaseFrame = baseFrame;
+ cutsceneSayStartWithCallback(startX, startY, r, g, b, lines, &IgorEngine::PART_79_UPDATE_DIALOGUE_SPEAKER);
+ waitForEndOfCutsceneDialogue(x, y, r, g, b);
+ _updateDialogue = nullptr;
+}
+
+void IgorEngine::PART_79_SAY_FIRST_SPEAKER(int startX, int startY, const Common::Array<DialogueText> &lines) {
+ cutsceneSayStartWithCallback(startX, startY, 63, 0, 38, lines, &IgorEngine::PART_79_UPDATE_DIALOGUE_FIRST_SPEAKER);
+ waitForEndOfCutsceneDialogue(145, 86, 63, 0, 38);
+ _updateDialogue = nullptr;
+}
+
+void IgorEngine::PART_79_SAY_THIRD_SPEAKER(const Common::Array<DialogueText> &lines) {
+ cutsceneSayStartWithCallback(220, 91, 63, 0, 38, lines, &IgorEngine::PART_79_UPDATE_DIALOGUE_THIRD_SPEAKER);
+ waitForEndOfCutsceneDialogue(220, 91, 63, 0, 38);
+ _updateDialogue = nullptr;
+}
+
+/**
+ * Igor talks from the position given. The head is drawn with his talk animation.
+ */
+void IgorEngine::PART_79_IGOR_SAY(const Common::Array<DialogueText> &lines) {
+ igorSay(lines);
+ waitForEndOfIgorDialogue();
+}
+
+void IgorEngine::PART_79_SET_IGOR_POS(int x, int y) {
+ _walkData[0].x = x;
+ _walkData[0].y = y;
+}
+
+/**
+ * Colors first to last go from black to the colors of the palette buffer (in) or back to black (out) one level at a
+ * time, the palette is set after each level.
+ */
+void IgorEngine::PART_79_FADE_COLORS(int first, int last, bool fadeInColors) {
+ _system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
+ for (int step = 1; step <= 63; ++step) {
+ const int level = fadeInColors ? 64 - step : step;
+ for (int i = first * 3; i < (last + 1) * 3; ++i) {
+ if (_paletteBuffer[i] >= level) {
+ if (fadeInColors) {
+ ++_currentPalette[i];
+ } else {
+ --_currentPalette[i];
+ }
+ }
+ }
+ setPaletteRange(first, last);
+ _system->updateScreen();
+ _system->delayMillis(1000 / 60);
+ }
+}
+
+/**
+ * Two colors of the palette buffer are set to the orange of the texts and faded in.
+ */
+void IgorEngine::PART_79_FADE_IN_PAIR(int firstColor) {
+ memcpy(_paletteBuffer + firstColor * 3, kPart79FadeColors, 6);
+ PART_79_FADE_COLORS(firstColor, firstColor + 1, true);
+}
+
+void IgorEngine::PART_79_791() {
+ playMusic(13);
+ _gameState.enableLight = 2;
+ loadData(IMG_Part79b, _screenLayer1);
+ uint8 *text = loadData(TXT_Part79b);
+ decodeRoomStrings(text, true);
+ free(text);
+ loadData(ANM_Part79bFrames, _animFramesBuffer);
+ loadData(ANM_Part79bLayer2, _screenLayer2);
+
+ PART_79_SAY_SPEAKER(178, 82, 178, 82, 63, 63, 0, 2, 2, { { 201, 2, 753 }, { 203, 1, 754 }, { 204, 1, 755 } });
+ PART_79_SAY_FIRST_SPEAKER(145, 86, { { 205, 2, 756 }, { 207, 2, 757 } });
+ PART_79_SAY_SPEAKER(172, 82, 178, 82, 63, 63, 0, 2, 2, { { 209, 2, 758 } });
+ for (int frame = 0x10; frame <= 0x1C; ++frame) {
+ PART_79_DRAW_SCENE(frame);
+ waitForTimer(31);
+ }
+ PART_79_SAY_FIRST_SPEAKER(145, 86, { { 211, 1, 759 } });
+ for (int frame = 0xB; frame <= 0xF; ++frame) {
+ PART_79_DRAW_SCENE(frame);
+ waitForTimer(11);
+ }
+ PART_79_DRAW_SCENE(29);
+ PART_79_SAY_SPEAKER(178, 82, 178, 82, 63, 63, 0, 0x1D, 0x1E, { { 212, 1, 760 }, { 213, 1, 761 } });
+
+ PART_79_SET_IGOR_POS(229, 137);
+ _walkData[0].posNum = 4;
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 30;
+ _walkData[0].scaleWidth = 50;
+ _walkData[0].scaleHeight = 50;
+ _walkDataLastIndex = 1;
+ PART_79_IGOR_SAY({ { 214, 2, 762 }, { 216, 2, 763 } });
+ PART_79_SAY_SPEAKER(178, 82, 178, 82, 63, 63, 0, 0x1D, 0x1E, { { 218, 2, 764 } });
+ for (int frame = 0x21; frame <= 0x26; ++frame) {
+ PART_79_DRAW_SCENE(frame);
+ waitForTimer(31);
+ }
+ PART_79_DRAW_SCENE(46);
+
+ PART_79_SET_IGOR_POS(236, 138);
+ PART_79_IGOR_SAY({ { 220, 2, 765 } });
+ PART_79_SAY_SPEAKER(195, 83, 195, 83, 63, 63, 0, 40, 41, { { 222, 2, 766 } });
+ PART_79_DRAW_SCENE(39);
+ waitForTimer(31);
+ PART_79_DRAW_SCENE(46);
+ PART_79_IGOR_SAY({ { 224, 2, 767 } });
+ for (int frame = 0x2F; frame <= 0x32; ++frame) {
+ PART_79_DRAW_SCENE(frame);
+ waitForTimer(31);
+ }
+ PART_79_SAY_SPEAKER(206, 85, 206, 85, 63, 63, 0, 0x35, 0x36, { { 226, 2, 768 } });
+ PART_79_DRAW_SCENE(51);
+ waitForTimer(31);
+
+ PART_79_SET_IGOR_POS(246, 138);
+ PART_79_IGOR_SAY({ { 228, 2, 769 }, { 230, 2, 770 } });
+ PART_79_SAY_SPEAKER(206, 85, 206, 85, 63, 63, 0, 0x35, 0x36, { { 232, 1, 771 } });
+ playSound(28, 1);
+ for (int frame = 0x3A; frame <= 0x56; ++frame) {
+ PART_79_DRAW_SCENE(frame);
+ if (frame == 0x4F) {
+ playSound(29, 1);
+ }
+ waitForTimer(17);
+ }
+ PART_79_DRAW_SCENE(52);
+ waitForTimer(33);
+ // the sound goes on until it ends
+ while (_mixer->isSoundHandleActive(_sfxHandle) || isDialogueSpeechPlaying()) {
+ waitForTimer();
+ }
+ _roomAmbientIndex = kPart79AmbientFirst;
+ igorSay(233, 2, 772);
+ _updateRoomBackground = &IgorEngine::PART_79_UPDATE_AMBIENT_791;
+ waitForEndOfIgorDialogue();
+ _updateRoomBackground = nullptr;
+ for (int frame = 0x58; frame <= 0x64; ++frame) {
+ PART_79_DRAW_SCENE(frame);
+ if (frame < 0x64) {
+ waitForTimer(31);
+ }
+ if (frame == 0x59) {
+ playSound(48, 1);
+ }
+ }
+
+ for (int frame = 1; frame <= 3; ++frame) {
+ PART_79_DRAW_LAYER2_FRAME(frame);
+ waitForTimer(31);
+ }
+ PART_79_SET_IGOR_POS(178, 142);
+ _walkData[0].posNum = 2;
+ PART_79_IGOR_SAY({ { 235, 1, 773 }, { 236, 2, 774 } });
+ for (int frame = 4; frame <= 0x12; ++frame) {
+ PART_79_DRAW_LAYER2_FRAME(frame);
+ waitForTimer(31);
+ }
+ PART_79_IGOR_SAY({ { 238, 1, 775 } });
+ // the texts 201 to 215 are replaced by the ones of the main resource
+ text = loadData(TXT_Part79bMain);
+ decodeRoomStrings(text, true);
+ free(text);
+ for (int frame = 0x13; frame <= 0x15; ++frame) {
+ PART_79_DRAW_LAYER2_FRAME(frame);
+ waitForTimer(31);
+ }
+
+ PART_79_SET_IGOR_POS(196, 141);
+ PART_79_IGOR_SAY({ { 201, 2, 776 }, { 203, 2, 777 } });
+ PART_79_SAY_THIRD_SPEAKER({ { 205, 1, 778 }, { 206, 1, 779 }, { 207, 1, 780 } });
+ PART_79_IGOR_SAY({ { 208, 1, 781 }, { 209, 1, 782 } });
+ PART_79_SAY_THIRD_SPEAKER({ { 210, 1, 783 } });
+ PART_79_IGOR_SAY({ { 211, 1, 784 } });
+ PART_79_SAY_THIRD_SPEAKER({ { 212, 1, 785 } });
+ PART_79_IGOR_SAY({ { 213, 1, 786 } });
+ PART_79_SAY_THIRD_SPEAKER({ { 214, 1, 787 } });
+ for (int frame = 0x1B; frame <= 0x1D; ++frame) {
+ PART_79_DRAW_LAYER2_FRAME(frame);
+ waitForTimer(31);
+ }
+ for (int frame = 1; frame <= 0xE; ++frame) {
+ PART_79_DRAW_LAYER2_FRAME_2(frame);
+ waitForTimer(31);
+ }
+ waitForTimer(255);
+ PART_79_DRAW_LAYER2_FRAME(30);
+ waitForTimer(255);
+ for (int frame = 0xF; frame <= 0x11; ++frame) {
+ PART_79_DRAW_LAYER2_FRAME_2(frame);
+ waitForTimer(31);
+ }
+
+ // the second animation resource replaces the first one
+ loadData(ANM_Part79bScenes, _animFramesBuffer);
+ copyArea(_screenVGA, kPart79Block1Offset, 320, _animFramesBuffer + kPart79Block1Frames, kPart79Block1Width,
+ kPart79Block1Width, kPart79Block1Height);
+
+ PART_79_FADE_IN_PAIR(0xF5);
+ for (int i = 0; i < 5; ++i) {
+ waitForTimer(255);
+ }
+ PART_79_FADE_IN_PAIR(0xF7);
+ waitForTimer(255);
+ PART_79_FADE_IN_PAIR(0xF9);
+ waitForTimer(255);
+ PART_79_FADE_IN_PAIR(0xFB);
+ waitForTimer(255);
+ PART_79_FADE_IN_PAIR(0xFD);
+ for (int i = 0; i < 3; ++i) {
+ waitForTimer(255);
+ }
+ PART_79_FADE_COLORS(kPart79FadeFirstColor, kPart79FadeLastColor, false);
+
+ for (int frame = 1; frame <= 7; ++frame) {
+ PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2A, frame);
+ waitForTimer(31);
+ }
+ for (int frame = 2; frame <= 0x12; ++frame) {
+ PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2B, frame);
+ waitForTimer(31);
+ }
+ for (int frame = 1; frame <= 0x12; ++frame) {
+ PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2B, frame);
+ waitForTimer(31);
+ }
+ PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2C, 1);
+ waitForTimer(31);
+ for (int y = 0; y < kPart79Block2Height; ++y) {
+ memset(_screenVGA + kPart79Block2Offset + y * 320, kPart79Block2Color, kPart79Block2Width);
+ }
+ for (int round = 1; round <= 5; ++round) {
+ for (int frame = 0x10; frame <= 0x11; ++frame) {
+ PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2C, frame);
+ waitForTimer(61);
+ }
+ }
+ for (int frame = 2; frame <= 0xF; ++frame) {
+ PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2C, frame);
+ waitForTimer(31);
+ }
+ cutsceneSayStart(206, 89, 63, 32, 0, { { 215, 1, 788 } });
+ waitForEndOfCutsceneDialogue(206, 89, 63, 32, 0);
+ waitForTimer(255);
+ for (int frame = 1; frame <= 7; ++frame) {
+ PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2D, frame);
+ waitForTimer(31);
+ }
+ copyArea(_screenVGA, kPart79Block3Offset, 320, _animFramesBuffer + kPart79Block3Frames, kPart79Block3Width,
+ kPart79Block3Width, kPart79Block3Height);
+ PART_79_FADE_COLORS(kPart79FadeFirstColor, kPart79FadeLastColor, true);
+ for (int i = 0; i < 8; ++i) {
+ waitForTimer(255);
+ }
+ PART_79_FADE_COLORS(kPart79FadeFirstColor, kPart79FadeLastColor, false);
+
+ loadIgorFrames();
+ // TODO: a byte variable that the next state reads is cleared here (not identified yet)
+ _currentPart = 910;
+}
+
+void IgorEngine::PART_79() {
+ // the picture is shown below a black band
+ if (_currentPart == 790) {
+ memset(_screenVGA, 0, 64000);
+ }
+ uint8 band[320 * kPart79BandRows];
+ memset(band, 0, sizeof(band));
+ _system->copyRectToScreen(band, 320, 0, 0, 320, kPart79BandRows);
+ _screenVGAVOffset = kPart79BandRows;
+ if (_currentPart == 790) {
+ PART_79_790();
+ } else {
+ PART_79_791();
+ }
+ _screenVGAVOffset = 0;
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 19f9e1f827c..3103f0af109 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -815,4 +815,18 @@
#define BOX_Part76 1196
#define IMG_Part76Card 1197
+// States 790 / 791 (PART_79)
+#define PAL_Part79 1198
+#define IMG_Part79 1199
+#define TXT_Part79 1200
+#define IMG_Part79Layer2 1201
+#define ANM_Part79 1202
+#define ANM_Part79Frames 1203
+#define IMG_Part79b 1204
+#define TXT_Part79b 1205
+#define ANM_Part79bFrames 1206
+#define ANM_Part79bLayer2 1207
+#define ANM_Part79bScenes 1208
+#define TXT_Part79bMain 1209
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index a80dd0a7d57..941dd14dd5b 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -485,6 +485,10 @@ void IgorEngine::animateIgorTalking(int frame) {
PART_85_HELPER_6_animateIgorHead(frame);
return;
}
+ if (getPart() == 79) {
+ PART_79_ANIMATE_IGOR_HEAD(frame);
+ return;
+ }
WalkData *wd = &_walkData[_walkDataLastIndex - 1];
int y = (wd->y - wd->scaleWidth + 1) * 320;
int delta = wd->x - _walkWidthScaleTable[wd->scaleHeight - 1] / 2;
Commit: c096c32c33763c5b03ebeb5cb15a52af72014a4a
https://github.com/scummvm/scummvm/commit/c096c32c33763c5b03ebeb5cb15a52af72014a4a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:41+01:00
Commit Message:
IGOR: Implements credits
Changed paths:
A engines/igor/parts/part_credits.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_79.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 914b39c55b2..311cecc3224 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -118,6 +118,7 @@ void IgorEngine::restart() {
_screenVGAVOffset = 0;
_debugOverlayMode = kOverlayOff;
_gameStateLoaded = false;
+ _creditsPass = 0;
memset(&_gameState, 0, sizeof(_gameState));
_mazeLocation = 0;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index d47e6598a56..ce91b60e2f2 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -458,6 +458,8 @@ private:
bool _eventQuitGame;
bool _gameStateLoaded;
+ // pass of the end credits: 0 for the first one (set when the ending is over), the pages are shown again after it
+ uint8 _creditsPass;
GameStateData _gameState;
uint8 _mazeLocation;
uint8 _mazeSavedLocation;
@@ -1381,6 +1383,10 @@ private:
// Splash screens
void PART_90();
+ // End credits
+ void PART_CREDITS();
+ void PART_CREDITS_DRAW_TEXT(int x, int y, uint8 color, bool underline, const char *str);
+
void handleRoomInput();
void executeAction(int action);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 3b0dc538708..5ee05239a40 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -67,6 +67,7 @@ MODULE_OBJS = \
parts/part_81.o \
parts/part_85.o \
parts/part_90.o \
+ parts/part_credits.o \
parts/part_maze.o \
parts/part_maze_data.o \
parts/part_margaret.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 275cb0d44ef..6fbfdbeb7f4 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -728,6 +728,15 @@ void IgorEngine::PART_MAIN() {
case 904:
PART_90();
break;
+ case 910: // End credits
+ case 920:
+ case 930:
+ case 940:
+ case 950:
+ case 960:
+ case 970:
+ PART_CREDITS();
+ break;
default:
error("PART_MAIN() Unhandled part %d", _currentPart);
diff --git a/engines/igor/parts/part_79.cpp b/engines/igor/parts/part_79.cpp
index 73097110fb5..26a2d835a13 100644
--- a/engines/igor/parts/part_79.cpp
+++ b/engines/igor/parts/part_79.cpp
@@ -590,7 +590,7 @@ void IgorEngine::PART_79_791() {
PART_79_FADE_COLORS(kPart79FadeFirstColor, kPart79FadeLastColor, false);
loadIgorFrames();
- // TODO: a byte variable that the next state reads is cleared here (not identified yet)
+ _creditsPass = 0;
_currentPart = 910;
}
diff --git a/engines/igor/parts/part_credits.cpp b/engines/igor/parts/part_credits.cpp
new file mode 100644
index 00000000000..bf4bfa63a8a
--- /dev/null
+++ b/engines/igor/parts/part_credits.cpp
@@ -0,0 +1,230 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+
+namespace Igor {
+
+// Texts of the end credits: every page is a picture with the texts of the first or of the second pass drawn over
+// it. Positions are the centre of every line.
+
+struct CreditsLine {
+ int16 x;
+ int16 y;
+ uint8 color;
+ bool underline;
+ uint16 strId;
+};
+
+struct CreditsPage {
+ uint16 imgId;
+ uint16 palId;
+ const CreditsLine *lines[2];
+ int count[2];
+};
+
+static const CreditsLine kCredits1Pass0[] = {
+ { 232, 90, 0xC2, true, STR_CreditsHistoriaYDiseno },
+ { 232, 118, 0xC3, false, STR_CreditsRamonHernaez },
+ { 232, 133, 0xC3, false, STR_CreditsFelipeGomez },
+ { 232, 148, 0xC3, false, STR_CreditsRafaelLatiegui },
+ { 232, 163, 0xC3, false, STR_CreditsMiguelAngelRamos },
+};
+
+static const CreditsLine kCredits1Pass1[] = {
+ { 210, 5, 0xC2, true, STR_CreditsProduccionYDireccionDeVoces },
+ { 210, 33, 0xC3, false, STR_CreditsLunaFaraco },
+};
+
+static const CreditsLine kCredits2Pass0[] = {
+ { 74, 105, 0xC2, true, STR_CreditsProgramacion },
+ { 74, 133, 0xC3, false, STR_CreditsRamonHernaez },
+ { 74, 148, 0xC3, false, STR_CreditsFelipeGomez },
+ { 74, 163, 0xC3, false, STR_CreditsMiguelAngelRamos },
+};
+
+static const CreditsLine kCredits2Pass1[] = {
+ { 74, 20, 0xC2, true, STR_CreditsVoces },
+ { 74, 48, 0xC3, false, STR_CreditsAngieDeBirch },
+ { 74, 63, 0xC3, false, STR_CreditsAntonioFdezMunoz },
+ { 74, 78, 0xC3, false, STR_CreditsArantxaFranco },
+ { 74, 93, 0xC3, false, STR_CreditsAlfredoGabrieli },
+ { 74, 108, 0xC3, false, STR_CreditsFernandoLuna },
+ { 74, 123, 0xC3, false, STR_CreditsAnaOlivares },
+ { 74, 138, 0xC3, false, STR_CreditsAdolfoPastor },
+};
+
+static const CreditsLine kCredits3Pass0[] = {
+ { 244, 30, 0xC2, true, STR_CreditsFondos },
+ { 244, 58, 0xC3, false, STR_CreditsCarlosVeredas },
+};
+
+static const CreditsLine kCredits3Pass1[] = {
+ { 244, 30, 0xC2, true, STR_CreditsVoces },
+ { 244, 58, 0xC3, false, STR_CreditsMiguelAngelPerez },
+ { 244, 73, 0xC3, false, STR_CreditsAntonioRamos },
+ { 244, 88, 0xC3, false, STR_CreditsPatriciaReija },
+ { 244, 103, 0xC3, false, STR_CreditsAparicioRivero },
+ { 244, 118, 0xC3, false, STR_CreditsDanielSanchez },
+ { 244, 133, 0xC3, false, STR_CreditsEnriqueSantaren },
+ { 244, 148, 0xC3, false, STR_CreditsCarlosViaga },
+};
+
+static const CreditsLine kCredits4Pass0[] = {
+ { 74, 23, 0xC2, true, STR_CreditsAnimaciones },
+ { 74, 51, 0xC3, false, STR_CreditsRafaelLatiegui },
+};
+
+static const CreditsLine kCredits4Pass1[] = {
+ { 74, 23, 0xC2, true, STR_CreditsProductorAsociado },
+ { 74, 51, 0xC3, false, STR_CreditsPabloDeLaNuez },
+};
+
+static const CreditsLine kCredits5Pass0[] = {
+ { 210, 20, 0xC2, true, STR_CreditsMusicaOriginalYArreglos },
+ { 210, 48, 0xC3, false, STR_CreditsEstebanMoreno },
+};
+
+static const CreditsLine kCredits5Pass1[] = {
+ { 240, 20, 0xC2, true, STR_CreditsDistribuidoPor },
+ { 240, 48, 0xC3, false, STR_CreditsDinamicMultimedia },
+};
+
+static const CreditsLine kCredits6Pass0[] = {
+ { 90, 5, 0xC2, true, STR_CreditsProduccionMusicaDigital },
+ { 90, 33, 0xC3, false, STR_CreditsAgpDigital },
+};
+
+static const CreditsLine kCredits6Pass1[] = {
+ { 74, 72, 0xC2, true, STR_CreditsAgradecimientos },
+ { 74, 100, 0xC3, false, STR_CreditsThePromisedLand },
+ { 74, 115, 0xC3, false, STR_CreditsRaquelAlvarez },
+ { 74, 130, 0xC3, false, STR_CreditsPilarRomero },
+ { 74, 145, 0xC3, false, STR_CreditsDouglasPrats },
+ { 74, 160, 0xC3, false, STR_CreditsEnriqueRAtienzar },
+};
+
+static const CreditsLine kCredits7Pass0[] = {
+ { 240, 142, 0xC2, true, STR_CreditsEfectosDeSonido },
+ { 240, 170, 0xC3, false, STR_CreditsLunaFaraco },
+};
+
+static const CreditsLine kCredits7Pass1[] = {
+ { 238, 140, 0xC2, true, STR_CreditsCreadoYProducidoPor },
+ { 238, 168, 0xC3, false, STR_CreditsPenduloStudios },
+};
+
+static const CreditsPage kCreditsPages[7] = {
+ { IMG_Credits1, PAL_Credits1, { kCredits1Pass0, kCredits1Pass1 }, { ARRAYSIZE(kCredits1Pass0), ARRAYSIZE(kCredits1Pass1) } },
+ { IMG_Credits2, PAL_Credits2, { kCredits2Pass0, kCredits2Pass1 }, { ARRAYSIZE(kCredits2Pass0), ARRAYSIZE(kCredits2Pass1) } },
+ { IMG_Credits3, PAL_Credits3, { kCredits3Pass0, kCredits3Pass1 }, { ARRAYSIZE(kCredits3Pass0), ARRAYSIZE(kCredits3Pass1) } },
+ { IMG_Credits4, PAL_Credits4, { kCredits4Pass0, kCredits4Pass1 }, { ARRAYSIZE(kCredits4Pass0), ARRAYSIZE(kCredits4Pass1) } },
+ { IMG_Credits5, PAL_Credits5, { kCredits5Pass0, kCredits5Pass1 }, { ARRAYSIZE(kCredits5Pass0), ARRAYSIZE(kCredits5Pass1) } },
+ { IMG_Credits6, PAL_Credits6, { kCredits6Pass0, kCredits6Pass1 }, { ARRAYSIZE(kCredits6Pass0), ARRAYSIZE(kCredits6Pass1) } },
+ { IMG_Credits7, PAL_Credits7, { kCredits7Pass0, kCredits7Pass1 }, { ARRAYSIZE(kCredits7Pass0), ARRAYSIZE(kCredits7Pass1) } },
+};
+
+// Number of timer units a page stays on the screen
+static const int kCreditsPageTicks = 4000;
+static const int kCreditsMusic = 9;
+// Color of the names, set to white in the palette of every page
+static const int kCreditsNameColor = 0xC3;
+
+/**
+ * Centers the string on x. The underlined lines (the headings) have a bar of the text color, three rows high and
+ * black at both ends, 18 rows below the top of the text.
+ */
+void IgorEngine::PART_CREDITS_DRAW_TEXT(int x, int y, uint8 color, bool underline, const char *str) {
+ const int width = _font.getStringWidth(str);
+ _font.drawString(_screenVGA, str, x - (width >> 1), y, color, 0, 0);
+ if (underline) {
+ const int barX = x - (width >> 1) - 10;
+ const int barWidth = width + 21;
+ memset(_screenVGA + (y + 18) * 320 + barX, 0, barWidth);
+ memset(_screenVGA + (y + 19) * 320 + barX, color, barWidth);
+ memset(_screenVGA + (y + 20) * 320 + barX, 0, barWidth);
+ _screenVGA[(y + 19) * 320 + barX] = 0;
+ _screenVGA[(y + 19) * 320 + barX + barWidth - 1] = 0;
+ }
+}
+
+/**
+ * States 910 .. 970: seven pages with the credits, shown twice (the second pass has other texts over the same
+ * pictures), then the logos again.
+ */
+void IgorEngine::PART_CREDITS() {
+ const CreditsPage &page = kCreditsPages[(_currentPart - 910) / 10];
+
+ playMusic(kCreditsMusic);
+
+ memset(_screenVGA, 0, 64000);
+ memset(_currentPalette, 0, 768);
+ setPaletteRange(0, 255);
+
+ loadData(page.imgId, _screenVGA);
+ loadData(page.palId, _paletteBuffer);
+ SET_PAL_240_48_1();
+ memset(_paletteBuffer + kCreditsNameColor * 3, 0x3F, 3);
+
+ const int pass = (_creditsPass == 0) ? 0 : 1;
+ for (int i = 0; i < page.count[pass]; ++i) {
+ const CreditsLine &line = page.lines[pass][i];
+ PART_CREDITS_DRAW_TEXT(line.x, line.y, line.color, line.underline, getString(line.strId));
+ }
+
+ if (_gameStateLoaded) {
+ fadeIn(768);
+ _gameStateLoaded = false;
+ } else {
+ PART_79_FADE_COLORS(0, 255, true);
+ }
+
+ for (int ticks = 0; ticks < kCreditsPageTicks; ticks += kTimerTicksCount) {
+ if (_inputVars[kInputOptions]) {
+ _inputVars[kInputOptions] = 0;
+ handleOptionsMenu();
+ }
+ // the original does not look at escape on these pages
+ if (_inputVars[kInputEscape] && !_eventQuitGame) {
+ _inputVars[kInputEscape] = 0;
+ }
+ waitForTimer();
+ if (_currentPart == kInvalidPart || _gameStateLoaded) {
+ break;
+ }
+ }
+
+ if (_gameStateLoaded || _currentPart == kInvalidPart) {
+ // a game was loaded or the game is quit: the state is not changed
+ fadeOut(768);
+ SET_PAL_208_96_1();
+ return;
+ }
+
+ PART_79_FADE_COLORS(0, 255, false);
+ if (_currentPart == 970) {
+ _currentPart = (_creditsPass == 1) ? 900 : 910;
+ ++_creditsPass;
+ } else {
+ _currentPart += 10;
+ }
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 3103f0af109..7a3a85fc070 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -829,4 +829,65 @@
#define ANM_Part79bScenes 1208
#define TXT_Part79bMain 1209
+// States 910 .. 970 (credits, PART_CREDITS): picture and palette of every page
+#define IMG_Credits1 1210
+#define PAL_Credits1 1211
+#define IMG_Credits2 1212
+#define PAL_Credits2 1213
+#define IMG_Credits3 1214
+#define PAL_Credits3 1215
+#define IMG_Credits4 1216
+#define PAL_Credits4 1217
+#define IMG_Credits5 1218
+#define PAL_Credits5 1219
+#define IMG_Credits6 1220
+#define PAL_Credits6 1221
+#define IMG_Credits7 1222
+#define PAL_Credits7 1223
+
+// Credit texts (Spanish)
+#define STR_CreditsHistoriaYDiseno 450
+#define STR_CreditsRamonHernaez 451
+#define STR_CreditsFelipeGomez 452
+#define STR_CreditsRafaelLatiegui 453
+#define STR_CreditsMiguelAngelRamos 454
+#define STR_CreditsProduccionYDireccionDeVoces 455
+#define STR_CreditsLunaFaraco 456
+#define STR_CreditsProgramacion 457
+#define STR_CreditsVoces 458
+#define STR_CreditsAngieDeBirch 459
+#define STR_CreditsAntonioFdezMunoz 460
+#define STR_CreditsArantxaFranco 461
+#define STR_CreditsAlfredoGabrieli 462
+#define STR_CreditsFernandoLuna 463
+#define STR_CreditsAnaOlivares 464
+#define STR_CreditsAdolfoPastor 465
+#define STR_CreditsFondos 466
+#define STR_CreditsCarlosVeredas 467
+#define STR_CreditsMiguelAngelPerez 468
+#define STR_CreditsAntonioRamos 469
+#define STR_CreditsPatriciaReija 470
+#define STR_CreditsAparicioRivero 471
+#define STR_CreditsDanielSanchez 472
+#define STR_CreditsEnriqueSantaren 473
+#define STR_CreditsCarlosViaga 474
+#define STR_CreditsAnimaciones 475
+#define STR_CreditsProductorAsociado 476
+#define STR_CreditsPabloDeLaNuez 477
+#define STR_CreditsMusicaOriginalYArreglos 478
+#define STR_CreditsEstebanMoreno 479
+#define STR_CreditsDistribuidoPor 480
+#define STR_CreditsDinamicMultimedia 481
+#define STR_CreditsProduccionMusicaDigital 482
+#define STR_CreditsAgpDigital 483
+#define STR_CreditsAgradecimientos 484
+#define STR_CreditsThePromisedLand 485
+#define STR_CreditsRaquelAlvarez 486
+#define STR_CreditsPilarRomero 487
+#define STR_CreditsDouglasPrats 488
+#define STR_CreditsEnriqueRAtienzar 489
+#define STR_CreditsEfectosDeSonido 490
+#define STR_CreditsCreadoYProducidoPor 491
+#define STR_CreditsPenduloStudios 492
+
#endif // IGOR_RESOURCE_IDS
Commit: 03a6ebb9c2d9a7b7f79cb94ceee898336515b914
https://github.com/scummvm/scummvm/commit/03a6ebb9c2d9a7b7f79cb94ceee898336515b914
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:41+01:00
Commit Message:
IGOR: Fix missing dialogue in part 8
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_9.cpp
engines/igor/resource_ids.h
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index ce91b60e2f2..08e01af6405 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -735,6 +735,7 @@ private:
void PART_08_deanDrinksBottle();
void PART_08_deanPassesOut();
void PART_08_HANDLE_DIALOGUE_DEAN();
+ void PART_08_HANDLE_DIALOGUE_INTERCOM();
void drawDean();
void drawDeanTalkingFrame(int frame);
void PART_08_UPDATE_DIALOGUE_DEAN(int action);
@@ -750,7 +751,7 @@ private:
void PART_09_ACTION_106_openCloset(bool search);
void PART_09_ACTION_110_pickCostumeFromCloset();
void PART_09_UPDATE_DIALOGUE_SECRETARY(int action);
- void PART_09_DRAW_SECRETARY_MOUTH(int frame);
+ void PART_09_DRAW_secretaryTalkingFrame(int frame);
void PART_09_secretarySearchesFile();
void PART_09_UPDATE_ROOM_BACKGROUND();
@@ -1125,10 +1126,10 @@ private:
void PARK_WAIT_FOR_LAURA_DIALOGUE();
void PART_34();
void PART_34_EXEC_ACTION(int action);
- void PART_34_ACTION_103_TAKE();
+ void PART_34_ACTION_103_takeResin();
void PART_34_ACTION_105_talkToOldLady();
void PART_34_ACTION_108_giveLizardToOldLady();
- void PART_34_ACTION_109_SCROLL_RIGHT();
+ void PART_34_ACTION_109_scrollRight();
void PART_34_APPLY_OBJECT_STATE(int num);
void PART_34_oldLadyIdleAnimationFrame(int step);
void PART_34_LAURA_CONVERSATION();
@@ -1136,9 +1137,9 @@ private:
void PART_34_UPDATE_ROOM_BACKGROUND();
void PART_35();
void PART_35_EXEC_ACTION(int action);
- void PART_35_ACTION_102_TAKE();
- void PART_35_ACTION_106_EXIT_TO_MAP();
- void PART_35_ACTION_107_SCROLL_LEFT();
+ void PART_35_ACTION_102_takeResin();
+ void PART_35_ACTION_106_exitToMap();
+ void PART_35_ACTION_107_scrollLeft();
void PART_35_APPLY_OBJECT_STATE(int num);
// chemistry classroom
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index 377ce56f2ef..b32e46644a5 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -174,24 +174,24 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
UpdateRoomBackgroundProc roomBackground = _updateRoomBackground;
_updateRoomBackground = &IgorEngine::PARK_UPDATE_AMBIENT_SOUND;
switch (action) {
- case 101:
+ case 101: // look at statue
igorSay(201, 2, 562);
break;
- case 102:
+ case 102: // look at tree
igorSay(203, 2, 563);
_objectsState[82] = 1;
PART_34_APPLY_OBJECT_STATE(3);
break;
case 103:
- PART_34_ACTION_103_TAKE();
+ PART_34_ACTION_103_takeResin();
break;
- case 104:
+ case 104: // look at roses
igorSay(205, 1, 564);
break;
case 105:
PART_34_ACTION_105_talkToOldLady();
break;
- case 106:
+ case 106: // look at old lady
igorSay(206, 2, 565);
break;
case 107:
@@ -201,7 +201,7 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
PART_34_ACTION_108_giveLizardToOldLady();
break;
case 109:
- PART_34_ACTION_109_SCROLL_RIGHT();
+ PART_34_ACTION_109_scrollRight();
break;
default:
warning("PART_34_EXEC_ACTION unhandled action %d", action);
@@ -210,7 +210,7 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
_updateRoomBackground = roomBackground;
}
-void IgorEngine::PART_34_ACTION_103_TAKE() {
+void IgorEngine::PART_34_ACTION_103_takeResin() {
if (_inventoryInfo[62] != 0) {
igorSay(210, 1, 567);
return;
@@ -389,7 +389,7 @@ void IgorEngine::PART_34_LAURA_CONVERSATION() {
_roomDataOffsets.dlg = kNoDialogueData;
}
-void IgorEngine::PART_34_ACTION_109_SCROLL_RIGHT() {
+void IgorEngine::PART_34_ACTION_109_scrollRight() {
int xPos = 240;
const int yPos = 124;
int step = 1;
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index d1635552b4f..eff3cf41bb7 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -27,28 +27,28 @@ namespace Igor {
void IgorEngine::PART_35_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_35_EXEC_ACTION %d", action);
switch (action) {
- case 101:
+ case 101: // look at tree
igorSay(201, 2, 611);
_objectsState[82] = 1;
PART_35_APPLY_OBJECT_STATE(3);
break;
- case 102:
- PART_35_ACTION_102_TAKE();
+ case 102: // take resin
+ PART_35_ACTION_102_takeResin();
break;
- case 103:
+ case 103: // look at resin
igorSay(203, 1, 612);
break;
- case 104:
+ case 104: // look at roses
igorSay(204, 1, 613);
break;
- case 105:
+ case 105: // look at bench
igorSay(205, 1, 614);
break;
case 106:
- PART_35_ACTION_106_EXIT_TO_MAP();
+ PART_35_ACTION_106_exitToMap();
break;
case 107:
- PART_35_ACTION_107_SCROLL_LEFT();
+ PART_35_ACTION_107_scrollLeft();
break;
default:
warning("PART_35_EXEC_ACTION unhandled action %d", action);
@@ -56,7 +56,7 @@ void IgorEngine::PART_35_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_35_ACTION_102_TAKE() {
+void IgorEngine::PART_35_ACTION_102_takeResin() {
if (_inventoryInfo[62] != 0) {
igorSay(206, 1, 615);
return;
@@ -66,7 +66,7 @@ void IgorEngine::PART_35_ACTION_102_TAKE() {
PART_35_APPLY_OBJECT_STATE(255);
}
-void IgorEngine::PART_35_ACTION_107_SCROLL_LEFT() {
+void IgorEngine::PART_35_ACTION_107_scrollLeft() {
int xPos = 183;
const int yPos = 124;
int step = 1;
@@ -103,7 +103,7 @@ void IgorEngine::PART_35_ACTION_107_SCROLL_LEFT() {
_currentPart = 340;
}
-void IgorEngine::PART_35_ACTION_106_EXIT_TO_MAP() {
+void IgorEngine::PART_35_ACTION_106_exitToMap() {
--_walkDataLastIndex;
const uint8 area = _screenLayer2[10879]; // (319, 33)
_roomObjectAreasTable[area].area = 1;
@@ -116,7 +116,7 @@ void IgorEngine::PART_35_ACTION_106_EXIT_TO_MAP() {
}
void IgorEngine::PART_35_APPLY_OBJECT_STATE(int num) {
- if (num == 3 || num == 255) {
+ if (num == 3 || num == 255) {// disable hotspot if resin taken
_roomObjectAreasTable[7].object = (_objectsState[82] == 0) ? 1 : 2;
}
}
@@ -132,8 +132,7 @@ void IgorEngine::PART_35() {
PARK_DRAW_drawOldLadyFrame(_screenLayer1, 1);
}
copyArea(_animFramesBuffer, 0, 160, _screenLayer1, 320, 160, 144);
- loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight,
- TXT_ParkRight); // active right panel
+ loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight, TXT_ParkRight); // active right panel
// The pick up frames replace the start of FRM_Park1, whose frames are not drawn on this panel
static const int pickUpFrames[] = { FRM_ParkRight1, 0 };
loadAnimData(pickUpFrames, kParkFrames);
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index 04f24d7d908..139bce3ddff 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -138,8 +138,13 @@ void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
waitForTimer(127);
}
+ PART_08_HANDLE_DIALOGUE_INTERCOM();
+
_currentPart = 91;
fadeOut(768);
+ // the room is saved again as it was left, Igor included
+ uint8 *roomScreen = (uint8 *)malloc(46080);
+ memcpy(roomScreen, _screenVGA, 46080);
// loads screen 9
loadActionData(DAT_AdministrationSecretaryRoom);
loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom, BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom, TXT_AdministrationSecretaryRoom);
@@ -168,7 +173,8 @@ void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
_roomDataOffsets = PART_08_ROOM_DATA_OFFSETS;
setRoomClickFix(143, -1, 281, false); // cseg100:0657
PART_08_APPLY_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ memcpy(_screenVGA, roomScreen, 46080);
+ free(roomScreen);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
drawInventory(_inventoryInfo[72], 0);
@@ -225,6 +231,15 @@ void IgorEngine::PART_08_HANDLE_DIALOGUE_DEAN() {
_updateDialogue = 0;
}
+void IgorEngine::PART_08_HANDLE_DIALOGUE_INTERCOM() {
+ const RoomDataOffsets savedOffsets = _roomDataOffsets;
+ _roomDataOffsets.dlg = { -174, 2, 257, 0, 30, 0, 459, 459, 0 };
+ loadDialogueData(DLG_Part8Intercom);
+ _updateDialogue = 0;
+ handleDialogue(0, 0, 0, 0, 0);
+ _roomDataOffsets = savedOffsets;
+}
+
void IgorEngine::PART_08_ACTION_103_talkToDean() {
if (_objectsState[29] == 1) {
igorSayAndWait(223, 1, 169);
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index dff9d39ecff..293dac443cd 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -135,17 +135,17 @@ void IgorEngine::PART_09_ACTION_101_openFileCabinet() {
waitForEndOfIgorDialogue();
}
-void IgorEngine::PART_09_DRAW_SECRETARY_MOUTH(int frame) {
+void IgorEngine::PART_09_DRAW_secretaryTalkingFrame(int frame) {
drawAnimRect(0x783A, 0xD38 + frame * 0xA9, 13, 13, true);
}
void IgorEngine::PART_09_UPDATE_DIALOGUE_SECRETARY(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_09_DRAW_SECRETARY_MOUTH(0);
+ PART_09_DRAW_secretaryTalkingFrame(0);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_09_DRAW_SECRETARY_MOUTH(getRandomNumber(2));
+ PART_09_DRAW_secretaryTalkingFrame(getRandomNumber(2));
break;
}
}
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 7a3a85fc070..34f7dffbdff 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -890,4 +890,6 @@
#define STR_CreditsCreadoYProducidoPor 491
#define STR_CreditsPenduloStudios 492
+#define DLG_Part8Intercom 1224
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 941dd14dd5b..bbe120f2460 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -546,7 +546,9 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreU
_gameState.dialogueData[6] = 0;
}
drawDialogueChoices();
- (this->*_updateDialogue)(kUpdateDialogueAnimStanding);
+ if (_updateDialogue) {
+ (this->*_updateDialogue)(kUpdateDialogueAnimStanding);
+ }
_dialogueChoiceSelected = selectDialogue();
if (_dialogueChoiceSelected == 0) {
break;
Commit: 85fe89ae6aecf7a642ac7b1712f14e7642cc66e9
https://github.com/scummvm/scummvm/commit/85fe89ae6aecf7a642ac7b1712f14e7642cc66e9
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:41+01:00
Commit Message:
IGOR: Fix crash when entering astronomy lab
Changed paths:
engines/igor/parts/part_31.cpp
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index ed8c8e0f2ca..bebc68fec35 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -102,7 +102,7 @@ void IgorEngine::PART_31_ACTION_102() {
--_walkDataLastIndex;
buildWalkPath(112, 105, 47, 63);
for (int i = 1; i <= _walkDataLastIndex; ++i) {
- _walkData[i].posNum = i;
+ _walkData[i].posNum = 4;
}
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
Commit: bdeb56a532ed5e70c264c074d77d6061a774e0a7
https://github.com/scummvm/scummvm/commit/bdeb56a532ed5e70c264c074d77d6061a774e0a7
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:42+01:00
Commit Message:
IGOR: Fix exiting astronomy lab
Changed paths:
engines/igor/parts/part_31.cpp
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index bebc68fec35..9d85fd67938 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -300,13 +300,14 @@ void IgorEngine::PART_31_HELPER_4_enterFromAstronomyLab() {
_roomObjectAreasTable[_screenLayer2[20207]].area = 2;
_roomObjectAreasTable[_screenLayer2[33712]].area = 2;
buildWalkPath(47, 63, 112, 105);
- for (int i = 1; i <= _walkDataCurrentIndex; ++i) {
+ for (int i = 1; i <= _walkDataLastIndex; ++i) {
_walkData[i].posNum = 2;
}
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
+ --_walkDataLastIndex;
buildWalkPath(112, 105, 102, 125);
_roomObjectAreasTable[_screenLayer2[20207]].area = 0;
_roomObjectAreasTable[_screenLayer2[33712]].area = 0;
Commit: 196330850e8e603955d88de4709aaa5f8fbd1fd1
https://github.com/scummvm/scummvm/commit/196330850e8e603955d88de4709aaa5f8fbd1fd1
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:42+01:00
Commit Message:
IGOR: Fixes not being able to pick astronomy book
Changed paths:
engines/igor/part_main.cpp
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 6fbfdbeb7f4..2133afac647 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -340,7 +340,9 @@ void IgorEngine::EXEC_MAIN_ACTION_38_lookAtNewspaper() {
free(tmp);
}
fadeIn(624);
- _objectsState[2] = 1;
+ if (_objectsState[4] == 0) {
+ _objectsState[4] = 1;
+ }
}
void IgorEngine::EXEC_MAIN_ACTION_43_lookAtPhoto() {
Commit: 20c5e2a8ae055da8ea2bb9fddda7732c3fd148fd
https://github.com/scummvm/scummvm/commit/20c5e2a8ae055da8ea2bb9fddda7732c3fd148fd
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:42+01:00
Commit Message:
IGOR: Fixes not being able to pick vase
Changed paths:
engines/igor/input.cpp
engines/igor/parts/part_68.cpp
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 84205d814fc..e73753b9597 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -480,7 +480,7 @@ void IgorEngine::handleRoomInput() {
}
// The original only exposes a room object when this action byte is
// non-zero; otherwise hover text is verb-only.
- if (((_currentPart >= 100 && _currentPart <= 102) || _currentPart == 110) && _actionCode == 0 && _currentAction.object1Type == kObjectTypeRoom) {
+ if (_actionCode == 0 && _currentAction.object1Type == kObjectTypeRoom) {
_currentAction.object1Num = 0;
}
}
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 73b76495d3e..aa99ca3fbcb 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -285,28 +285,29 @@ void IgorEngine::PART_68_ENTER_INSIDE() {
}
/**
- * The character gives Igor the object; it goes to the inventory.
+ * Before the character has been given his object he only talks (and refuses); afterwards the object in the room
+ * goes to the inventory.
*/
void IgorEngine::PART_68_ACTION_102_takeObject() {
- if (_objectsState[kPart68GivenState] != 0) {
+ if (_objectsState[kPart68GivenState] == 0) {
+ PART_68_DRAW_POSE(0);
+ PART_68_DRAW_NPC(kPart68NpcFacing);
+ waitForTimer(30);
+ PART_68_NPC_SAY({ { 202, 1, 1008 }, { 203, 1, 1009 }, { 204, 1, 1010 }, { 205, 1, 1011 } });
+ PART_68_DRAW_POSE(1);
+ waitForTimer(30);
+
+ // Igor turns to the right
+ _walkData[_walkDataLastIndex - 1].posNum = kFacingPositionRight;
+ _walkDataCurrentIndex = _walkDataLastIndex - 1;
+ moveIgor(kFacingPositionRight, 0);
+ _walkDataCurrentIndex = _walkDataLastIndex;
+ igorSayAndWait({ { 206, 1, 1012 }, { 207, 1, 1013 } });
+ PART_68_NPC_SAY({ { 208, 1, 1014 }, { 209, 1, 1015 }, { 210, 1, 1016 }, { 211, 1, 1017 } });
+ PART_68_DRAW_NPC(kPart68NpcFacing);
+ waitForTimer(30);
return;
}
- PART_68_DRAW_POSE(0);
- PART_68_DRAW_NPC(kPart68NpcFacing);
- waitForTimer(30);
- PART_68_NPC_SAY({ { 202, 1, 1008 }, { 203, 1, 1009 }, { 204, 1, 1010 }, { 205, 1, 1011 } });
- PART_68_DRAW_POSE(1);
- waitForTimer(30);
-
- // Igor turns to the right
- _walkData[_walkDataLastIndex - 1].posNum = kFacingPositionRight;
- _walkDataCurrentIndex = _walkDataLastIndex - 1;
- moveIgor(kFacingPositionRight, 0);
- _walkDataCurrentIndex = _walkDataLastIndex;
- igorSayAndWait({ { 206, 1, 1012 }, { 207, 1, 1013 } });
- PART_68_NPC_SAY({ { 208, 1, 1014 }, { 209, 1, 1015 }, { 210, 1, 1016 }, { 211, 1, 1017 } });
- PART_68_DRAW_NPC(kPart68NpcFacing);
- waitForTimer(30);
for (int frame = 0; frame <= 1; ++frame) {
PART_68_DRAW_POSE(frame);
waitForTimer(120);
Commit: 7799a6e2c39f7716a23a2f34d147f57a4762293b
https://github.com/scummvm/scummvm/commit/7799a6e2c39f7716a23a2f34d147f57a4762293b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:43+01:00
Commit Message:
IGOR: Fix pickup animation speed in library
Changed paths:
engines/igor/parts/part_33.cpp
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index edadc320485..5b220a38d50 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -93,8 +93,8 @@ void IgorEngine::PART_33_ACTION_109_takeAstronomyBooks() {
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);
}
+ waitForTimer(120);
}
addObjectToInventory(31, 66);
_objectsState[74] = 1;
Commit: 2d5baf06ea503e7b3ee05d085850ab8735fb95f1
https://github.com/scummvm/scummvm/commit/2d5baf06ea503e7b3ee05d085850ab8735fb95f1
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:43+01:00
Commit Message:
IGOR: Fixes crash in lighthouse animation
Changed paths:
engines/igor/parts/part_81.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index 51fadd7d902..cd4964a2892 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -61,7 +61,7 @@ static const int kPart81StripRows = 0x48;
// The last frames of the animation of the end of the story.
static const int kPart81EndFramesBase = 0xBAE0;
-static const int kPart81EndFramesTable = 0x808;
+static const int kPart81EndFramesTable = 0x828;
// Flags of the story kept in the objects state.
static const int kPart81StoryState = 6;
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 115a12c2ab2..9e692107370 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -143,6 +143,14 @@ void IgorEngine::lookupScale(int curX, int curY, uint8 &scale, uint8 &xScale, ui
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);
+ if (pos < 1 || pos > 4) {
+ // The facing selects one of the four frame sets; any other value (a walk step whose
+ // facing byte came from a room object without a walk target) has no frames to draw.
+ // TODO: the original indexes its table of frame sets without a bounds check, so what
+ // it draws for such a facing is not derived.
+ warning("moveIgor: invalid facing %d, step not drawn", pos);
+ return;
+ }
WalkData *wd = &_walkData[_walkDataCurrentIndex];
uint8 _walkClipSkipX = wd->clipSkipX;
uint8 _walkHeightScale = wd->scaleHeight;
Commit: 5f896103a899bf54e4530223f6f47f2c9767949e
https://github.com/scummvm/scummvm/commit/5f896103a899bf54e4530223f6f47f2c9767949e
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:43+01:00
Commit Message:
IGOR: Used igor's beach sprite on the plane
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/parts/part_76.cpp
engines/igor/resource.cpp
engines/igor/static_cursor.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 311cecc3224..68c56757ff3 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -567,7 +567,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
if (s.isLoading()) {
_gameStateLoaded = true;
- memcpy(_igorPalette, (_currentPart == 760) ? PAL_IGOR_1 : PAL_IGOR_1, 48);
+ memcpy(_igorPalette, (_currentPart == 760) ? PAL_IGOR_2 : PAL_IGOR_1, 48);
UPDATE_OBJECT_STATE(255);
playMusic(_gameState.musicNum);
_system->warpMouse(_inputVars[kInputCursorXPos], _inputVars[kInputCursorYPos]);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 08e01af6405..6e9166d2160 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -608,6 +608,7 @@ private:
void playSound(int num, int type);
void stopSound();
void loadIgorFrames();
+ void loadIgorBeachFrames();
void ADD_DIALOGUE_TEXT(int num, int count, int sound = kNoSpeechSound);
void SET_DIALOGUE_TEXT(int start, int count);
@@ -1630,6 +1631,7 @@ protected:
static const uint8 _mouseCursorMask[];
static const uint8 _mouseCursorData[];
static const uint8 PAL_IGOR_1[];
+ static const uint8 PAL_IGOR_2[];
static const uint8 PAL_48_1[];
static const uint8 PAL_96_1[];
};
diff --git a/engines/igor/parts/part_76.cpp b/engines/igor/parts/part_76.cpp
index 81dc6088146..c9b81b40c9e 100644
--- a/engines/igor/parts/part_76.cpp
+++ b/engines/igor/parts/part_76.cpp
@@ -134,9 +134,10 @@ void IgorEngine::PART_76_APPLY_OBJECT_STATE() {
} else {
copyArea(_screenLayer1, kPart76SmallPieceOffset, 320, _animFramesBuffer + kPart76SmallPieceSize,
kPart76SmallPieceWidth, kPart76SmallPieceWidth, kPart76SmallPieceHeight);
+ // once the object was taken its areas stop being selectable
+ _roomObjectAreasTable[11].object = 0;
+ _roomObjectAreasTable[12].object = 0;
}
- _roomObjectAreasTable[11].object = 0;
- _roomObjectAreasTable[12].object = 0;
}
/**
@@ -300,7 +301,7 @@ void IgorEngine::PART_76() {
PART_MEANWHILE(IMG_Part76Card);
}
_gameState.enableLight = 2;
- loadIgorFrames();
+ loadIgorBeachFrames();
loadActionData(DAT_Part76);
loadRoomData(PAL_Part76, IMG_Part76, BOX_Part76, MSK_Part76, TXT_Part76);
SET_PAL_240_48_1();
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 4fabc7b0e32..81e75908652 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -246,6 +246,18 @@ void IgorEngine::loadIgorFrames() {
memcpy(_igorPalette, PAL_IGOR_1, 48);
}
+/**
+ * Igor with the other clothes (the plane scenes).
+ */
+void IgorEngine::loadIgorBeachFrames() {
+ 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);
+}
+
static int compareResourceEntry(const void *a, const void *b) {
int id = *(const int *)a;
const ResourceEntry *entry = (const ResourceEntry *)b;
diff --git a/engines/igor/static_cursor.cpp b/engines/igor/static_cursor.cpp
index 0fd9edbadda..60a8eb7c77f 100644
--- a/engines/igor/static_cursor.cpp
+++ b/engines/igor/static_cursor.cpp
@@ -44,6 +44,12 @@ const uint8 IgorEngine::PAL_IGOR_1[] = {
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::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,
Commit: 59029a536130c2a11b6a57b516161e586fe34059
https://github.com/scummvm/scummvm/commit/59029a536130c2a11b6a57b516161e586fe34059
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:44+01:00
Commit Message:
IGOR: Fix error when looking at window outsides of administrative building
Changed paths:
engines/igor/parts/part_11.cpp
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index 1353087ca06..a2f2117c27f 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -131,7 +131,7 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
switch (action) {
case 101: // look at window
ADD_DIALOGUE_TEXT(201, 2, 616);
- SET_DIALOGUE_TEXT(1, 2);
+ SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
break;
Commit: efd41ac04a187b0e4ecf6656044a4a7dc0251383
https://github.com/scummvm/scummvm/commit/efd41ac04a187b0e4ecf6656044a4a7dc0251383
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:44+01:00
Commit Message:
IGOR: Fix small igor appearing outside of the church after coming from indoor
Changed paths:
engines/igor/parts/part_12.cpp
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 8fc1eeb3491..3d6e354479d 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -450,6 +450,8 @@ void IgorEngine::PART_12_HELPER_6_enterFromChurch() {
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
_walkData[0].clipWidth = 30;
+ _walkDataLastIndex = 0;
+ _walkDataCurrentIndex = 1;
_roomObjectAreasTable[_screenLayer2[28555]].area = _roomObjectAreasTable[_screenLayer2[34686]].area;
buildWalkPath(75, 89, 126, 108);
_roomObjectAreasTable[_screenLayer2[28555]].area = 0;
Commit: 3d5f1ec3a81c15cb8339743cc6442c4473217d6f
https://github.com/scummvm/scummvm/commit/3d5f1ec3a81c15cb8339743cc6442c4473217d6f
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:44+01:00
Commit Message:
IGOR: Fixes weird Igor pose after entering park
Changed paths:
engines/igor/parts/part_35.cpp
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index eff3cf41bb7..793764165bf 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -168,6 +168,7 @@ void IgorEngine::PART_35() {
_roomObjectAreasTable[area].area = 1;
buildWalkPath(319, 33, 242, 111);
_roomObjectAreasTable[area].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
Commit: 8f298a8c7658370e510cb35a51414ab1d065248a
https://github.com/scummvm/scummvm/commit/8f298a8c7658370e510cb35a51414ab1d065248a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:45+01:00
Commit Message:
IGOR: Fix johnny never revealing his face again
Changed paths:
engines/igor/parts/part_31.cpp
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index 9d85fd67938..d76ff9e5e15 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -186,33 +186,6 @@ void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() {
}
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_drawJohnnyFrame(_gameState.unk10);
- return;
- } else if (_gameState.unk10 == 3) {
- _gameState.unk10 = 4;
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
- return;
- } else if (_gameState.unk10 == 4) {
- if (getRandomNumber(29) == 0) {
- _gameState.unk10 = 5;
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
- _gameState.counter[4] = 0;
- return;
- }
- } else if (_gameState.unk10 == 5) {
- if (_gameState.counter[4] == 20) {
- _gameState.unk10 = 4;
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
- return;
- } else {
- ++_gameState.counter[4];
- }
- }
- }
- } else {
if (_gameState.unk10 == 4 || _gameState.unk10 == 5) {
_gameState.unk10 = 3;
PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
@@ -223,6 +196,31 @@ void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() {
PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
return;
}
+ } else if (!_gameState.igorMoving) {
+ if (_gameState.unk10 == 1 || _gameState.unk10 == 2) {
+ _gameState.unk10 = 3;
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ return;
+ } else if (_gameState.unk10 == 3) {
+ _gameState.unk10 = 4;
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ return;
+ } else if (_gameState.unk10 == 4) {
+ if (getRandomNumber(29) == 0) {
+ _gameState.unk10 = 5;
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ _gameState.counter[4] = 0;
+ return;
+ }
+ } else if (_gameState.unk10 == 5) {
+ if (_gameState.counter[4] == 20) {
+ _gameState.unk10 = 4;
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ return;
+ } else {
+ ++_gameState.counter[4];
+ }
+ }
}
}
if (xPos > 159 && xPos < 251) {
Commit: 1eff602ef249770defcfd305303d9e212a43b8f9
https://github.com/scummvm/scummvm/commit/1eff602ef249770defcfd305303d9e212a43b8f9
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:45+01:00
Commit Message:
IGOR: Fix papyrus dismissed with a single click
Changed paths:
engines/igor/part_main.cpp
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 2133afac647..c1ef5a014ac 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -797,7 +797,7 @@ void IgorEngine::moveScreenUp(int offset) {
}
// Shows the papyrus full screen. With reveal set (dryer) the figures appear
-// slowly and are remembered as seen; otherwise Igor comments on what is shown.
+// slowly and are remembered as seen
void IgorEngine::lookAtPapyrus(bool reveal) {
memcpy(_paletteBuffer, _currentPalette, 624);
fadeOut(624);
@@ -816,7 +816,7 @@ void IgorEngine::lookAtPapyrus(bool reveal) {
_objectsState[2] = 1;
waitForTimer(255);
} else {
- // the figures are only shown from the second viewing on
+
if (_objectsState[2] == 1) {
PART_UPDATE_FIGURES_ON_PAPER(0);
}
@@ -836,6 +836,14 @@ void IgorEngine::lookAtPapyrus(bool reveal) {
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue(false);
+ // the paper stays on screen until another click (left or right)
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputRightClick] = 0;
+ while (!_inputVars[kInputClick] && !_inputVars[kInputRightClick] && !_eventQuitGame) {
+ waitForTimer(1);
+ }
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputRightClick] = 0;
wd->x = _walkDataCurrentPosX2;
wd->y = _walkDataCurrentPosY2;
wd->scaleWidth = _walkDataCurrentWScale;
Commit: a42c2811c0fa2d277c36982610b68a772b10cbda
https://github.com/scummvm/scummvm/commit/a42c2811c0fa2d277c36982610b68a772b10cbda
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:45+01:00
Commit Message:
IGOR: Fix wrong order of lines in part 2
Changed paths:
engines/igor/parts/part_2.cpp
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index 956d072e1df..356a664be88 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -178,7 +178,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
if (_inventoryInfo[44] == 0 && _inventoryInfo[45] == 0) {
if (_objectsState[22] == 0) {
- igorSay(202, 2, 109);
+ igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
PART_02_SEARCH_TRUNK();
igorSay(204, 1, 111);
@@ -189,7 +189,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
if (_inventoryInfo[44] != 0 && _inventoryInfo[45] == 0) {
if (_objectsState[20] == 0) {
- igorSay(202, 2, 109);
+ igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
PART_02_SEARCH_TRUNK();
igorSay(205, 1, 112);
@@ -208,7 +208,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
addObjectToInventory(11, 46);
} else if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 &&
_inventoryInfo[46] == 0 && _objectsState[23] == 0) {
- igorSay(202, 2, 109);
+ igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
igorSay(207, 2, 114);
}
Commit: 0bdeb546ea90423498f9262aa432433afa84db2a
https://github.com/scummvm/scummvm/commit/0bdeb546ea90423498f9262aa432433afa84db2a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:46+01:00
Commit Message:
IGOR: add missing line in part 14 when solving church puzzle
Changed paths:
engines/igor/parts/part_14.cpp
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 79bb7947aee..ad03953cb87 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -101,6 +101,7 @@ void IgorEngine::PART_14_ACTION_103_lookAtPuzzle() {
waitForTimer(60);
}
stopSound();
+ igorSay(227, 1, 1292);
_objectsState[50] = 1;
}
PART_14_HELPER_1_OBJECT_STATE(255);
Commit: 1772d58b7dc3e98e207de6d3b961ff6a2a66faa9
https://github.com/scummvm/scummvm/commit/1772d58b7dc3e98e207de6d3b961ff6a2a66faa9
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:46+01:00
Commit Message:
IGOR: Fix missing animation in womens toilet cutscene
Changed paths:
engines/igor/parts/part_19.cpp
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index aae9ff6b748..7f762805f27 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -136,6 +136,7 @@ void IgorEngine::PART_19_HELPER_2_slugCutscene() { // sub_137_07AD
cutsceneSayWithCallback(243, 92, 63, 23, 33, 212, 3, 920, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
for (int i = 2; i <= 9; ++i) {
src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x404F + i * 2) - 1;
+ decodeAnimFrame(src, _screenVGA, true);
waitForTimer(60);
}
cutsceneSayStart(227, 91, 0, 63, 63, { { 215, 1, 921 }, { 216, 2, 922 } });
Commit: ef52dd24c00ac1e886493d6ab69c3288133c4eb7
https://github.com/scummvm/scummvm/commit/ef52dd24c00ac1e886493d6ab69c3288133c4eb7
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:46+01:00
Commit Message:
IGOR: Use correct sound when closing locker
Changed paths:
engines/igor/parts/part_27.cpp
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index 66c4111d8f4..52d2bac6957 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -112,7 +112,7 @@ void IgorEngine::PART_27_ACTION_107_closeLocker() {
for (int i = 2; i >= 1; --i) {
drawAnimRect(offset, 0x3A0 + i * 1568, 32, 49);
if (i == 2) {
- playSound(14, 1);
+ playSound(4, 1);
waitForTimer(100);
}
}
Commit: fe88e27a48b0ab40c2ec8a152f7d4420d4beae83
https://github.com/scummvm/scummvm/commit/fe88e27a48b0ab40c2ec8a152f7d4420d4beae83
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:47+01:00
Commit Message:
IGOR: Fix animation of putting flask in locker
Changed paths:
engines/igor/parts/part_27.cpp
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index 52d2bac6957..42231a68491 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -144,7 +144,7 @@ void IgorEngine::PART_27_ACTION_110_useFlaskOnLocker() {
igorSayAndWait({ { 212, 1, 1170 }, { 213, 2, 1171 } });
const int offset = 25012;
for (int i = 1; i <= 2; ++i) {
- drawAnimRect(offset, 0x19AA + i * 630, 21, 49);
+ drawAnimRect(offset, 0x19AA + i * 630, 21, 30);
if (i == 1) {
waitForTimer(100);
}
Commit: ed0ff172b82ca5a03f3cf7e3047d4f8eb0078fbe
https://github.com/scummvm/scummvm/commit/ed0ff172b82ca5a03f3cf7e3047d4f8eb0078fbe
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:47+01:00
Commit Message:
IGOR: Fix gating meanwhile inserts on scrollable areas
Changed paths:
engines/igor/part_main.cpp
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index c1ef5a014ac..065551ef3d5 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -744,11 +744,15 @@ void IgorEngine::PART_MAIN() {
error("PART_MAIN() Unhandled part %d", _currentPart);
break;
}
- if (_currentPart >= 10) {
- if (_currentPart <= 24 || _currentPart == 51) {
+ // These scheduler exclusions compare only the low byte of the state.
+ // Margaret cutscenes trigger between room changes, but scrollable
+ // areas are omitted so it doesnt trigger after a scroll
+ const uint8 stateLowByte = static_cast<uint8>(_currentPart);
+ if (stateLowByte >= 10) {
+ if (stateLowByte <= 24 || stateLowByte == 51) {
continue;
}
- if (_currentPart == 60 || _currentPart == 102 || _currentPart == 110) {
+ if (stateLowByte == 60 || stateLowByte == 102 || stateLowByte == 110) {
continue;
}
}
Commit: 63fe99406391d3ec5d84e3e9958756c76bedde3a
https://github.com/scummvm/scummvm/commit/63fe99406391d3ec5d84e3e9958756c76bedde3a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:47+01:00
Commit Message:
IGOR: Fix music in margaret inserts
Changed paths:
engines/igor/part_main.cpp
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 065551ef3d5..718def1da33 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -770,15 +770,9 @@ void IgorEngine::PART_MAIN() {
if (_gameState.shouldShowCutsceneCounter != 5) {
++_gameState.shouldShowCutsceneCounter;
} else {
- if (_gameState.musicNum != 11) {
- // _previousMusic = _gameState.musicNum;
- playMusic(11);
- }
+ playMusic(8);
PART_MEANWHILE();
PART_MARGARET_ROOM_CUTSCENE();
- // if (_previousMusic != 11) {
- // playMusic(_previousMusic);
- // }
_gameState.shouldShowCutsceneCounter = 0;
}
} while (_currentPart != kInvalidPart && !_eventQuitGame);
@@ -890,10 +884,9 @@ void IgorEngine::PART_MEANWHILE(int img) {
_paletteBuffer[7] = 12;
_paletteBuffer[8] = 0;
fadeIn(9);
- for (int i = 0; i <= 5 && !_inputVars[kInputEscape]; ++i) {
+ for (int i = 0; i < 5; ++i) {
waitForTimer(250);
}
- _inputVars[kInputEscape] = 0;
fadeOut(9);
}
Commit: c0181c8bb08c59eca0c367ebfc6c586742a2c3d4
https://github.com/scummvm/scummvm/commit/c0181c8bb08c59eca0c367ebfc6c586742a2c3d4
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:48+01:00
Commit Message:
IGOR: Fix splash logos with the right timer
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/parts/part_90.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 68c56757ff3..242d8f2cdd4 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -66,7 +66,7 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
- _currentPart = 850;
+ _currentPart = kStartupPart;
// _currentPart = 171;
// _currentPart = 62;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 6e9166d2160..a428c58e504 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1384,6 +1384,7 @@ private:
// Splash screens
void PART_90();
+ void PART_90_FADE_PALETTE(bool fadeInColors);
// End credits
void PART_CREDITS();
@@ -1471,7 +1472,7 @@ private:
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; }
- void waitForTimer(int ticks = -1);
+ void waitForTimer(int ticks = -1, bool presentScreen = true, uint32 deadline = 0);
ResourceEntry *findData(int num);
uint8 *loadData(int num, uint8 *dst = 0, int *size = 0);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index e73753b9597..80fce34fdc8 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -29,19 +29,21 @@ namespace Igor {
static const uint8 kSentenceColorIndex[] = {0xFD, 0xFB, 0xF1};
-void IgorEngine::waitForTimer(int ticks) {
+void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
- _system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
+ if (presentScreen) {
+ _system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
- if (_debugOverlayMode != kOverlayOff) {
- debugApplyOverlay();
- }
+ if (_debugOverlayMode != kOverlayOff) {
+ debugApplyOverlay();
+ }
- _system->updateScreen();
+ _system->updateScreen();
+ }
// wait till next timer if no param is passed, ticks if not
// _fastMode divides the wall-clock deadlines
- uint32 endTicks = (ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay / _fastMode;
+ uint32 endTicks = deadline ? deadline : ((ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay / _fastMode);
do {
Common::Event ev;
while (_eventMan->pollEvent(ev)) {
@@ -152,6 +154,7 @@ void IgorEngine::waitForTimer(int ticks) {
}
}
+
void IgorEngine::setCursor(int num) {
uint8 cursor[11 * 11];
memset(cursor, 0, 11 * 11);
diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp
index 6bac3632c08..2aadfa12b35 100644
--- a/engines/igor/parts/part_90.cpp
+++ b/engines/igor/parts/part_90.cpp
@@ -18,11 +18,35 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+#include "common/system.h"
#include "igor/igor.h"
namespace Igor {
+void IgorEngine::PART_90_FADE_PALETTE(bool fadeInColors) {
+ for (int pass = 1; pass <= 63; ++pass) {
+ const int threshold = fadeInColors ? 64 - pass : pass;
+ for (int i = 0; i < 768; ++i) {
+ if (_paletteBuffer[i] >= threshold) {
+ if (fadeInColors) {
+ ++_currentPalette[i];
+ } else {
+ --_currentPalette[i];
+ }
+ }
+ }
+ setPaletteRange(0, 255);
+ // Present each palette pass and poll input without a timer delay.
+ waitForTimer(0);
+ if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart) {
+ return;
+ }
+ }
+}
+
void IgorEngine::PART_90() {
+ static const uint16 holdTicks[] = { 2000, 500, 500, 2500, 2000 };
+ const uint16 duration = holdTicks[_currentPart - 900];
const char *str;
if (_currentPart == 900) {
@@ -55,23 +79,59 @@ void IgorEngine::PART_90() {
_font.drawString(_screenVGA, str, 2, 187, 0xF5, 0, 0);
break;
}
- fadeIn(768);
- while (!_inputVars[kInputEscape]) {
- waitForTimer();
- if (_inputVars[kInputOptions]) {
- _inputVars[kInputOptions] = 0;
- // handleOptionsMenu();
- break;
- }
+ if (_gameStateLoaded) {
+ _gameStateLoaded = false;
+ fadeIn(768);
+ } else {
+ PART_90_FADE_PALETTE(true);
}
- _inputVars[kInputEscape] = 0;
- fadeOut(768);
- if (_currentPart != kInvalidPart) {
- ++_currentPart;
- if ((_game.version == kIdSpaCD && _currentPart == 904) || _currentPart == 905) {
- _currentPart = 850;
+ if (!_gameStateLoaded && !_eventQuitGame && _currentPart != kInvalidPart) {
+ memcpy(_paletteBuffer, _currentPalette, 768);
+ _inputVars[kInputSkipDialogue] = 0;
+ _inputVars[kInputEscape] = 0;
+ _inputVars[kInputOptions] = 0;
+ _inputVars[kInputClick] = 0;
+ const uint32 timerStart = _system->getMillis();
+ uint8 observedTimer = 0;
+ for (uint16 elapsed = 0; elapsed < duration; ++elapsed) {
+ if (_inputVars[kInputOptions]) {
+ handleOptionsMenu();
+ _inputVars[kInputOptions] = 0;
+ waitForTimer(0);
+ }
+ while (!_gameStateLoaded && !_eventQuitGame && _currentPart != kInvalidPart) {
+ waitForTimer(0, false);
+ const uint32 timerMillis = _system->getMillis() - timerStart;
+ const uint64 timerRate = (uint64)kTickDelay * _fastMode;
+ const uint64 timerTicks = (uint64)timerMillis * timerRate / 1000;
+ const uint8 timerByte = (uint8)timerTicks;
+ if (timerByte != observedTimer) {
+ observedTimer = timerByte;
+ break;
+ }
+ const uint32 deadline = timerStart + ((timerTicks + 1) * 1000 + timerRate - 1) / timerRate;
+ waitForTimer(0, false, deadline);
+ }
+ _gameTicks = (_gameTicks + 1) & 63;
+ if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart) {
+ break;
+ }
}
}
+ if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart) {
+ fadeOut(768);
+ SET_PAL_208_96_1();
+ SET_PAL_240_48_1();
+ return;
+ }
+ PART_90_FADE_PALETTE(false);
+ if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart) {
+ return;
+ }
+ ++_currentPart;
+ if ((_game.version == kIdSpaCD && _currentPart == 904) || _currentPart == 905) {
+ _currentPart = 850;
+ }
}
} // End of namespace Igor
Commit: 8649d0bf9b92f268166bfb95658f68a1a197adc4
https://github.com/scummvm/scummvm/commit/8649d0bf9b92f268166bfb95658f68a1a197adc4
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:48+01:00
Commit Message:
IGOR: fix scene transition between 8 and 9
Changed paths:
engines/igor/igor.cpp
engines/igor/input.cpp
engines/igor/part_main.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_9.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 242d8f2cdd4..baaa1f55fd8 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -65,8 +65,8 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_game.language = Common::ES_ESP; // Assuming 0 represents the default language
-
- _currentPart = kStartupPart;
+ _currentPart = 850;
+ // _currentPart = kStartupPart;
// _currentPart = 171;
// _currentPart = 62;
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 80fce34fdc8..662035dea70 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -42,7 +42,8 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
}
// wait till next timer if no param is passed, ticks if not
- // _fastMode divides the wall-clock deadlines
+ // _fastMode divides the wall-clock deadlines. An absolute deadline avoids
+ // accumulating rounding error when repeating short waits.
uint32 endTicks = deadline ? deadline : ((ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay / _fastMode);
do {
Common::Event ev;
@@ -154,7 +155,6 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
}
}
-
void IgorEngine::setCursor(int num) {
uint8 cursor[11 * 11];
memset(cursor, 0, 11 * 11);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 718def1da33..c0873eb4ad0 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -502,6 +502,7 @@ void IgorEngine::PART_MAIN() {
break;
case 60: // arrive through scroll
case 61: // arrive from intro
+ case 62:
PART_06(); // SpringRock
break;
case 70: // enter from outside the administration corridor
@@ -513,6 +514,7 @@ void IgorEngine::PART_MAIN() {
PART_08(); // Dean Pepper office
break;
case 90:
+ case 91:
PART_09(); // Administration secretary room
break;
@@ -684,7 +686,10 @@ void IgorEngine::PART_MAIN() {
PART_72();
break;
case 730:
- PART_73(); // cutscene that plays state 800 at its end
+ PART_73(); // Cutscene followed by PART_80
+ break;
+ case 740:
+ PART_74_CUTSCENE();
break;
case 750:
PART_75(); // philip vodka cutscene
@@ -703,6 +708,9 @@ void IgorEngine::PART_MAIN() {
case 791:
PART_79(); // two scenes, shown below a black band
break;
+ case 800:
+ PART_80();
+ break;
case 810:
PART_81();
break;
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index 139bce3ddff..92a0579ef9c 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -145,27 +145,7 @@ void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
// the room is saved again as it was left, Igor included
uint8 *roomScreen = (uint8 *)malloc(46080);
memcpy(roomScreen, _screenVGA, 46080);
- // loads screen 9
- loadActionData(DAT_AdministrationSecretaryRoom);
- loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom, BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom, TXT_AdministrationSecretaryRoom);
- memcpy(_screenVGA, _screenLayer1, 46080);
- drawSecretaryTalkingFrame(1);
- memcpy(_screenLayer1, _screenVGA, 46080);
- fadeIn(624);
-
- cutsceneSayWithCallback(65, 70, 0, 59, 63, { { 226, 1, 254 } }, &IgorEngine::PART_08_UPDATE_DIALOGUE_SECRETARY);
-
- for (int frame = 5; frame <= 19; ++frame) {
- drawSecretaryTalkingFrame(frame);
- if (frame < 19)
- waitForTimer(31);
- else
- playSound(14, 1);
- }
- waitForTimer(255);
- fadeOut(624);
- _objectsState[27] = 0;
- _objectsState[35] = 1;
+ PART_09();
// back to room 8
loadActionData(DAT_DeanPepperOffice);
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index 293dac443cd..97afa2988d9 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -264,6 +264,28 @@ void IgorEngine::PART_09() {
loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom,
BOX_AdministrationSecretaryRoom, MSK_AdministrationSecretaryRoom,
TXT_AdministrationSecretaryRoom);
+ if (_currentPart == 91) {
+ // This sequence uses the animation frames retained from the dean's room.
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ drawSecretaryTalkingFrame(1);
+ memcpy(_screenLayer1, _screenVGA, 46080);
+ fadeIn(624);
+
+ cutsceneSayWithCallback(65, 70, 0, 59, 63, { { 226, 1, 254 } }, &IgorEngine::PART_08_UPDATE_DIALOGUE_SECRETARY);
+
+ for (int frame = 5; frame <= 19; ++frame) {
+ drawSecretaryTalkingFrame(frame);
+ if (frame < 19)
+ waitForTimer(31);
+ else
+ playSound(14, 1);
+ }
+ waitForTimer(255);
+ fadeOut(624);
+ _objectsState[27] = 0;
+ _objectsState[35] = 1;
+ return;
+ }
static const int anim[] = {
ANM_AdministrationSecretaryRoom1, ANM_AdministrationSecretaryRoom2,
ANM_AdministrationSecretaryRoom3, ANM_AdministrationSecretaryRoom4,
Commit: 50acc393831c8f9d7b6b4d54ec30830df717571a
https://github.com/scummvm/scummvm/commit/50acc393831c8f9d7b6b4d54ec30830df717571a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:48+01:00
Commit Message:
IGOR: Pause while menu is open
Changed paths:
engines/igor/options.cpp
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 83fe46be7ba..21bf7c2ad6d 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -212,6 +212,7 @@ static void drawButtonsBar(uint8 *dst, const uint8 *src) {
}
void IgorEngine::handleOptionsMenu() {
+ PauseToken pauseToken = pauseEngine();
hideCursor();
memcpy(_paletteBuffer, _currentPalette, 768);
memset(_screenVGA + 144 * 320, 0, 11 * 320);
Commit: 7fbb14cb5658b45c697c9da0ca2d36e9330df85f
https://github.com/scummvm/scummvm/commit/7fbb14cb5658b45c697c9da0ca2d36e9330df85f
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:49+01:00
Commit Message:
IGOR: Add savegame load for all rooms
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/parts/part_13.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_15.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_18.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_24.cpp
engines/igor/parts/part_25.cpp
engines/igor/parts/part_26.cpp
engines/igor/parts/part_27.cpp
engines/igor/parts/part_31.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_36.cpp
engines/igor/parts/part_37.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_50.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_90.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index baaa1f55fd8..8216b2a2f30 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -269,11 +269,21 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
_walkDataCurrentIndex = _walkDataLastIndex - 1;
WalkData *wd = &_walkData[_walkDataCurrentIndex];
moveIgor(wd->posNum, wd->frameNum);
- _walkDataCurrentIndex = _walkDataLastIndex;
+ if (!_gameState.igorMoving)
+ _walkDataCurrentIndex = _walkDataLastIndex;
}
- drawInventory(_inventoryInfo[72], 0);
- fadeIn(768);
+ if (!_gameState.dialogueStarted) {
+ memset(_screenVGA + 46080, 0, 17920);
+ SET_PAL_208_96_1();
+ SET_PAL_240_48_1();
+ drawVerbsPanel();
+ redrawVerb(_currentAction.verb, true);
+ drawInventory(_inventoryInfo[72], 0);
+ }
+ if (!_gameState.dialogueTextRunning)
+ showCursor();
_gameStateLoaded = false;
+ fadeIn(768);
return true;
}
@@ -288,6 +298,8 @@ void IgorEngine::leavePartLoop() {
void IgorEngine::runPartLoop() {
handleRoomInput();
+ if (_gameStateLoaded)
+ return;
if (compareGameTick(1, 16)) {
handleRoomIgorWalk();
}
@@ -566,6 +578,8 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
}
if (s.isLoading()) {
+ // Fade the outgoing screen before any loaded room redraws its pixels.
+ fadeOut(768);
_gameStateLoaded = true;
memcpy(_igorPalette, (_currentPart == 760) ? PAL_IGOR_2 : PAL_IGOR_1, 48);
UPDATE_OBJECT_STATE(255);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index a428c58e504..045d4567997 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1145,25 +1145,24 @@ private:
// 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_ACTION_102_takePen();
+ void PART_36_HELPER_1_OBJECT_STATE(int num);
+ void PART_36_HELPER_2_walkIn();
+ void PART_36_HELPER_4_drawPen(int frame);
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_ACTION_102_lookAtPaperBinTakePaper();
+ void PART_37_HELPER_1_OBJECT_STATE(int num);
+ void PART_37_HELPER_2_walkIn();
void PART_37();
// outside the maze
void PART_50_EXEC_ACTION(int action);
void PART_50_ACTION_101_enterMaze();
- void PART_50_ENTER_FROM_DOOR();
- void PART_50_ENTER_FROM_HILL();
+ void PART_50_enterFromDoor();
+ void PART_50_enterFromHill();
void PART_50_UPDATE_ROOM_BACKGROUND();
void PART_50();
diff --git a/engines/igor/parts/part_13.cpp b/engines/igor/parts/part_13.cpp
index cf2471af470..c73b722ea6c 100644
--- a/engines/igor/parts/part_13.cpp
+++ b/engines/igor/parts/part_13.cpp
@@ -206,20 +206,23 @@ void IgorEngine::PART_13() {
setRoomWalkBounds(92, 0, 288, 143);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_13_EXEC_ACTION);
PART_13_HELPER_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- if (_currentPart == 130) {
- PART_13_HELPER_3_enterFromBelow();
- } else {
- PART_13_HELPER_2_enterFromRight();
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 130) {
+ PART_13_HELPER_3_enterFromBelow();
+ } else {
+ PART_13_HELPER_2_enterFromRight();
+ }
+ enterPartLoop();
}
- enterPartLoop();
- while (_currentPart >= 130 && _currentPart <= 131) {
+ while (_currentPart >= 130 && _currentPart <= 131 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index ad03953cb87..edd122e5e98 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -525,24 +525,27 @@ void IgorEngine::PART_14() {
setRoomWalkBounds(0, 0, 256, 143);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_14_EXEC_ACTION);
PART_14_HELPER_1_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- if (_currentPart == 140) {
- PART_14_HELPER_2_enterFromChurch();
- }
- if (_currentPart == 141) {
- PART_14_HELPER_3_enterFromChurchBell();
- }
- if (_currentPart == 142) {
- PART_14_HELPER_4_enterFromMaze();
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 140) {
+ PART_14_HELPER_2_enterFromChurch();
+ }
+ if (_currentPart == 141) {
+ PART_14_HELPER_3_enterFromChurchBell();
+ }
+ if (_currentPart == 142) {
+ PART_14_HELPER_4_enterFromMaze();
+ }
+ enterPartLoop();
}
- enterPartLoop();
- while (_currentPart >= 140 && _currentPart <= 142) {
+ while (_currentPart >= 140 && _currentPart <= 142 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
void IgorEngine::loadResourceData__ROOM_ChurchPuzzle() {
diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp
index b8ddc191c92..caef9610012 100644
--- a/engines/igor/parts/part_15.cpp
+++ b/engines/igor/parts/part_15.cpp
@@ -370,23 +370,26 @@ void IgorEngine::PART_15() {
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_15_EXEC_ACTION);
_updateRoomBackground = &IgorEngine::PART_15_UPDATE_ROOM_BACKGROUND;
PART_15_HELPER_1_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- _gameState.unk10 = 1;
- _gameState.unk11 = 2;
- _gameState.counter[3] = 0;
- _gameState.counter[4] = 0;
- PART_15_HELPER_2_walkIn();
- enterPartLoop();
- while (_currentPart == 150) {
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ _gameState.unk10 = 1;
+ _gameState.unk11 = 2;
+ _gameState.counter[3] = 0;
+ _gameState.counter[4] = 0;
+ PART_15_HELPER_2_walkIn();
+ enterPartLoop();
+ }
+ while (_currentPart == 150 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
if (_objectsState[48] == 1) {
_objectsState[48] = 2;
}
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index 5243528a5db..965d489cb91 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -227,19 +227,22 @@ void IgorEngine::PART_16() {
setRoomWalkBounds(0, 0, 248, 143);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_16_EXEC_ACTION);
PART_16_HELPER_1_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- PART_16_HELPER_2_enterScene();
- if (_objectsState[65] == 2 && _inventoryInfo[71] != 0 && _objectsState[76] == 1) {
- PART_16_HELPER_3_photoCutscene();
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ PART_16_HELPER_2_enterScene();
+ if (_objectsState[65] == 2 && _inventoryInfo[71] != 0 && _objectsState[76] == 1) {
+ PART_16_HELPER_3_photoCutscene();
+ }
+ enterPartLoop();
}
- enterPartLoop();
- while (_currentPart == 160) {
+ while (_currentPart == 160 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
void IgorEngine::loadResourceData__ROOM_Laboratory() {
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index 1fbd9a1b991..cf50b779067 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -147,16 +147,19 @@ void IgorEngine::PART_18() {
setRoomWalkBounds(0, 0, 319, 143);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_18_EXEC_ACTION);
PART_18_HELPER_1_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- PART_18_HELPER_2_walkIn();
- enterPartLoop();
- while (_currentPart == 180) {
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ PART_18_HELPER_2_walkIn();
+ enterPartLoop();
+ }
+ while (_currentPart == 180 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
void IgorEngine::loadResourceData__ROOM_MenToilets() {
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index 7f762805f27..223cc34152a 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -226,20 +226,24 @@ void IgorEngine::PART_19() {
}
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_19_EXEC_ACTION);
PART_19_HELPER_1_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- PART_19_HELPER_3_walkIn();
- if (_objectsState[59] == 0) {
- PART_19_HELPER_4_enterAndLeave();
- } else {
- enterPartLoop();
- while (_currentPart == 190) {
- runPartLoop();
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ PART_19_HELPER_3_walkIn();
+ if (_objectsState[59] == 0) {
+ PART_19_HELPER_4_enterAndLeave();
+ if (!_gameStateLoaded && _currentPart != 191)
+ fadeOut(624);
+ return;
}
- leavePartLoop();
+ enterPartLoop();
+ }
+ while (_currentPart == 190 && !_gameStateLoaded) {
+ runPartLoop();
}
- if(_currentPart != 191) {
+ leavePartLoop();
+ if (_currentPart != 191 && !_gameStateLoaded) {
fadeOut(624);
}
}
diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp
index 6845f633d01..0e2b6b26c91 100644
--- a/engines/igor/parts/part_24.cpp
+++ b/engines/igor/parts/part_24.cpp
@@ -273,22 +273,25 @@ void IgorEngine::PART_24() {
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_24_EXEC_ACTION);
_updateRoomBackground = &IgorEngine::PART_24_UPDATE_ROOM_BACKGROUND;
PART_24_HELPER_1_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- if (_currentPart == 240) {
- PART_24_HELPER_7_enterFromLeft();
- } else if (_currentPart == 241) {
- PART_24_HELPER_8_enterFromRight();
- } else if (_currentPart == 242) {
- PART_24_HELPER_9_enterFromChemistryClass();
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 240) {
+ PART_24_HELPER_7_enterFromLeft();
+ } else if (_currentPart == 241) {
+ PART_24_HELPER_8_enterFromRight();
+ } else if (_currentPart == 242) {
+ PART_24_HELPER_9_enterFromChemistryClass();
+ }
+ enterPartLoop();
}
- enterPartLoop();
- while (_currentPart >= 240 && _currentPart <= 242) {
+ while (_currentPart >= 240 && _currentPart <= 242 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index 5ed0291ea3a..2a793f55c4b 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -188,22 +188,25 @@ void IgorEngine::PART_25() {
setRoomWalkBounds(0, 0, 319, 143);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_25_EXEC_ACTION);
PART_25_HELPER_1_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- if (_currentPart == 250) {
- PART_25_HELPER_2_enterFromLeft();
- } else if (_currentPart == 251) {
- PART_25_HELPER_3_enterFromRight();
- } else if (_currentPart == 252) {
- PART_25_HELPER_4_enterFromMensToilet();
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 250) {
+ PART_25_HELPER_2_enterFromLeft();
+ } else if (_currentPart == 251) {
+ PART_25_HELPER_3_enterFromRight();
+ } else if (_currentPart == 252) {
+ PART_25_HELPER_4_enterFromMensToilet();
+ }
+ enterPartLoop();
}
- enterPartLoop();
- while (_currentPart >= 250 && _currentPart <= 252) {
+ while (_currentPart >= 250 && _currentPart <= 252 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index f0ed7006196..b012d67a25a 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -230,21 +230,24 @@ void IgorEngine::PART_26() {
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_26_EXEC_ACTION);
_updateRoomBackground = &IgorEngine::PART_26_UPDATE_ROOM_BACKGROUND;
PART_26_HELPER_1_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- _gameState.unk10 = true;
- fadeIn(768);
- if (_currentPart == 260) {
- PART_26_HELPER_4_enterFromRight();
- } else {
- PART_26_HELPER_5_enterFromLaboratory();
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ _gameState.unk10 = true;
+ fadeIn(768);
+ if (_currentPart == 260) {
+ PART_26_HELPER_4_enterFromRight();
+ } else {
+ PART_26_HELPER_5_enterFromLaboratory();
+ }
+ enterPartLoop();
}
- enterPartLoop();
- while (_currentPart >= 260 && _currentPart <= 261) {
+ while (_currentPart >= 260 && _currentPart <= 261 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index 42231a68491..b26d59e58fd 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -223,20 +223,23 @@ void IgorEngine::PART_27() {
setRoomWalkBounds(0, 0, 319, 143);
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_27_EXEC_ACTION);
PART_27_HELPER_1_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- if (_currentPart == 270) {
- PART_27_HELPER_2_enterFromLeft();
- } else {
- PART_27_HELPER_5_enterFromLibrary();
- }
- enterPartLoop();
- while (_currentPart == 270 || _currentPart == 271) {
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 270) {
+ PART_27_HELPER_2_enterFromLeft();
+ } else {
+ PART_27_HELPER_5_enterFromLibrary();
+ }
+ enterPartLoop();
+ }
+ while ((_currentPart == 270 || _currentPart == 271) && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index d76ff9e5e15..16029f8a470 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -378,26 +378,29 @@ void IgorEngine::PART_31() {
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_31_EXEC_ACTION);
_updateRoomBackground = &IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND;
PART_31_HELPER_1_OBJECT_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- _gameState.unk10 = 4;
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
- fadeIn(768);
- if (_currentPart == 310) {
- PART_31_HELPER_3_enterFromLeft();
- } else if (_currentPart == 311) {
- PART_31_HELPER_4_enterFromAstronomyLab();
- } else if (_currentPart == 312) {
- PART_31_HELPER_5_enterFromDownstairs();
- } else if (_currentPart == 313) {
- PART_31_HELPER_6_enterFromRight();
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ _gameState.unk10 = 4;
+ PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ fadeIn(768);
+ if (_currentPart == 310) {
+ PART_31_HELPER_3_enterFromLeft();
+ } else if (_currentPart == 311) {
+ PART_31_HELPER_4_enterFromAstronomyLab();
+ } else if (_currentPart == 312) {
+ PART_31_HELPER_5_enterFromDownstairs();
+ } else if (_currentPart == 313) {
+ PART_31_HELPER_6_enterFromRight();
+ }
+ enterPartLoop();
}
- enterPartLoop();
- while (_currentPart >= 310 && _currentPart <= 313) {
+ while (_currentPart >= 310 && _currentPart <= 313 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index 5b220a38d50..f95c4691937 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -363,20 +363,24 @@ void IgorEngine::PART_33() {
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_33_EXEC_ACTION);
_updateRoomBackground = &IgorEngine::PART_33_UPDATE_ROOM_BACKGROUND;
PART_33_HELPER_1_OBJECTS_STATE(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
- _currentAction.verb = kVerbWalk;
- fadeIn(768);
- PART_33_HELPER_7_walkIn();
- enterPartLoop();
- while (_currentPart == 330) {
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ PART_33_HELPER_7_walkIn();
+ enterPartLoop();
+ }
+ while (_currentPart == 330 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- if (_objectsState[75] == 1) {
- // harrison leaves
- _objectsState[75] = 2;
+ if (!_gameStateLoaded) {
+ if (_objectsState[75] == 1) {
+ // harrison leaves
+ _objectsState[75] = 2;
+ }
+ fadeOut(624);
}
- fadeOut(624);
_updateRoomBackground = 0;
}
diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp
index c04dccda509..4d39ba98147 100644
--- a/engines/igor/parts/part_36.cpp
+++ b/engines/igor/parts/part_36.cpp
@@ -26,28 +26,28 @@ namespace Igor {
void IgorEngine::PART_36_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // look at desk
igorSay(201, 1, 655);
break;
case 102:
- PART_36_ACTION_102();
+ PART_36_ACTION_102_takePen();
break;
- case 103:
+ case 103: // look at pen
igorSay(202, 1, 656);
break;
- case 104:
+ case 104: // look at portrait
igorSay(203, 1, 657);
break;
- case 105:
+ case 105: // look at blackboard
igorSay(204, 2, 658);
break;
- case 106:
+ case 106: // use blackboard
igorSay(209, 1, 661);
break;
- case 107:
+ case 107: // look at closet
igorSay(206, 2, 659);
break;
- case 108:
+ case 108: // open closet
igorSay(208, 1, 660);
break;
case 109:
@@ -59,7 +59,7 @@ void IgorEngine::PART_36_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_36_ACTION_102() {
+void IgorEngine::PART_36_ACTION_102_takePen() {
for (int i = 1; i >= 0; --i) {
for (int j = 0; j <= 48; ++j) {
for (int k = 0; k <= 33; ++k) {
@@ -85,25 +85,25 @@ void IgorEngine::PART_36_ACTION_102() {
}
addObjectToInventory(30, 65);
_objectsState[88] = 1;
- PART_36_HELPER_1(255);
+ PART_36_HELPER_1_OBJECT_STATE(255);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
}
-void IgorEngine::PART_36_HELPER_1(int num) {
+void IgorEngine::PART_36_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
if (_objectsState[88] == 0) {
- PART_36_HELPER_4(1);
+ PART_36_HELPER_4_drawPen(1);
} else {
- PART_36_HELPER_4(0);
+ PART_36_HELPER_4_drawPen(0);
_roomObjectAreasTable[6].object = 1;
_roomObjectAreasTable[7].object = 1;
}
}
}
-void IgorEngine::PART_36_HELPER_2() {
+void IgorEngine::PART_36_HELPER_2_walkIn() {
_walkData[0].setPos(319, 143, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -116,7 +116,7 @@ void IgorEngine::PART_36_HELPER_2() {
waitForIgorMove();
}
-void IgorEngine::PART_36_HELPER_4(int frame) {
+void IgorEngine::PART_36_HELPER_4_drawPen(int frame) {
if (frame == 0) {
memcpy(_screenLayer1 + 31430, _animFramesBuffer, 7);
} else if (frame == 1) {
@@ -134,17 +134,20 @@ void IgorEngine::PART_36() {
_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;
- fadeIn(768);
- PART_36_HELPER_2();
- enterPartLoop();
- while (_currentPart == 360) {
+ PART_36_HELPER_1_OBJECT_STATE(255);
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ PART_36_HELPER_2_walkIn();
+ enterPartLoop();
+ }
+ while (_currentPart == 360 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
diff --git a/engines/igor/parts/part_37.cpp b/engines/igor/parts/part_37.cpp
index fc4c1b75a6a..ee2c44fcef8 100644
--- a/engines/igor/parts/part_37.cpp
+++ b/engines/igor/parts/part_37.cpp
@@ -26,22 +26,22 @@ namespace Igor {
void IgorEngine::PART_37_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // exit
_currentPart = 212;
break;
case 102:
- PART_37_ACTION_102();
+ PART_37_ACTION_102_lookAtPaperBinTakePaper();
break;
- case 103:
+ case 103: // look at blackboard
igorSay(203, 2, 664);
break;
- case 104:
+ case 104: // look at desk
igorSay(205, 1, 665);
break;
- case 105:
+ case 105: // use blackboard
igorSay(207, 1, 667);
break;
- case 106:
+ case 106: // use paper bin
igorSay(206, 1, 666);
break;
default:
@@ -50,7 +50,7 @@ void IgorEngine::PART_37_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_37_ACTION_102() {
+void IgorEngine::PART_37_ACTION_102_lookAtPaperBinTakePaper() {
if (_objectsState[89] == 1) {
igorSay(202, 1, 663);
return;
@@ -63,16 +63,16 @@ void IgorEngine::PART_37_ACTION_102() {
}
addObjectToInventory(32, 67);
_objectsState[89] = 1;
- PART_37_HELPER_1(255);
+ PART_37_HELPER_1_OBJECT_STATE(255);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
}
-void IgorEngine::PART_37_HELPER_1(int num) {
+void IgorEngine::PART_37_HELPER_1_OBJECT_STATE(int num) {
}
-void IgorEngine::PART_37_HELPER_2() {
+void IgorEngine::PART_37_HELPER_2_walkIn() {
_walkData[0].setPos(0, 143, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 16;
@@ -96,17 +96,20 @@ void IgorEngine::PART_37() {
_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;
- fadeIn(768);
- PART_37_HELPER_2();
- enterPartLoop();
- while (_currentPart == 370) {
+ PART_37_HELPER_1_OBJECT_STATE(255);
+ if (!restoreRoomAfterLoad()) {
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ PART_37_HELPER_2_walkIn();
+ enterPartLoop();
+ }
+ while (_currentPart == 370 && !_gameStateLoaded) {
runPartLoop();
}
leavePartLoop();
- fadeOut(624);
+ if (!_gameStateLoaded)
+ fadeOut(624);
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index cd6ba89f76e..77826fe8688 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -160,9 +160,9 @@ void IgorEngine::PART_05() {
fadeIn(624);
PART_05_HELPER_6_walkIgorToScene();
}
+ enterPartLoop();
}
- enterPartLoop();
while (_currentPart >= 50 && _currentPart <= 52 && !_gameStateLoaded) {
runPartLoop();
}
diff --git a/engines/igor/parts/part_50.cpp b/engines/igor/parts/part_50.cpp
index c32deec23d2..bcb1f656db3 100644
--- a/engines/igor/parts/part_50.cpp
+++ b/engines/igor/parts/part_50.cpp
@@ -36,7 +36,7 @@ void IgorEngine::PART_50_EXEC_ACTION(int action) {
case 101:
PART_50_ACTION_101_enterMaze();
break;
- case 102:
+ case 102: // look at maze door
igorSay(201, 1, 1083);
break;
case 103:
@@ -49,9 +49,6 @@ void IgorEngine::PART_50_EXEC_ACTION(int action) {
}
}
-/**
- * Igor walks to the door and goes into the maze, through its last room.
- */
void IgorEngine::PART_50_ACTION_101_enterMaze() {
_roomObjectAreasTable[_screenLayer2[kPart50DoorY * 320 + kPart50DoorX]].area = kPart50DoorArea;
--_walkDataLastIndex;
@@ -64,10 +61,7 @@ void IgorEngine::PART_50_ACTION_101_enterMaze() {
_objectsState[71] = 1;
}
-/**
- * Igor comes out of the door, on the right, and walks to the left.
- */
-void IgorEngine::PART_50_ENTER_FROM_DOOR() {
+void IgorEngine::PART_50_enterFromDoor() {
WalkData *wd = &_walkData[0];
wd->setPos(kPart50DoorX, kPart50DoorY, kFacingPositionLeft, 0);
wd->setDefaultScale();
@@ -82,10 +76,7 @@ void IgorEngine::PART_50_ENTER_FROM_DOOR() {
waitForIgorMove();
}
-/**
- * Igor comes from the far top left, tiny, and walks down the hill to the right.
- */
-void IgorEngine::PART_50_ENTER_FROM_HILL() {
+void IgorEngine::PART_50_enterFromHill() {
WalkData *wd = &_walkData[0];
wd->setPos(45, 22, kFacingPositionFront, 0);
wd->clipSkipX = 1;
@@ -137,9 +128,9 @@ void IgorEngine::PART_50() {
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 500) {
- PART_50_ENTER_FROM_DOOR();
+ PART_50_enterFromDoor();
} else {
- PART_50_ENTER_FROM_HILL();
+ PART_50_enterFromHill();
}
}
enterPartLoop();
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index db09410de8c..7c1234f76e2 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -326,12 +326,14 @@ void IgorEngine::PART_06() {
_gameState.unkF = (_objectsState[61] == 1);
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
+ enterPartLoop();
}
- enterPartLoop();
while (_currentPart >= 60 && _currentPart <= 61 && !_gameStateLoaded) {
setRoomWalkBounds(0, 0, _objectsState[61] == 0 ? 234 : 142, 143);
handleRoomInput();
+ if (_gameStateLoaded)
+ break;
if (compareGameTick(1, 16)) {
handleRoomIgorWalk();
}
diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp
index 2aadfa12b35..8fd92c030e4 100644
--- a/engines/igor/parts/part_90.cpp
+++ b/engines/igor/parts/part_90.cpp
@@ -119,7 +119,8 @@ void IgorEngine::PART_90() {
}
}
if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart) {
- fadeOut(768);
+ if (!_gameStateLoaded)
+ fadeOut(768);
SET_PAL_208_96_1();
SET_PAL_240_48_1();
return;
Commit: ddb80c05297e2c9717dba851af4a44364ec4cdc7
https://github.com/scummvm/scummvm/commit/ddb80c05297e2c9717dba851af4a44364ec4cdc7
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:49+01:00
Commit Message:
IGOR: Allows start of music during save game load
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/palette.cpp
engines/igor/parts/part_68.cpp
engines/igor/sound.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 8216b2a2f30..39a8b846b60 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -583,7 +583,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
_gameStateLoaded = true;
memcpy(_igorPalette, (_currentPart == 760) ? PAL_IGOR_2 : PAL_IGOR_1, 48);
UPDATE_OBJECT_STATE(255);
- playMusic(_gameState.musicNum);
+ playMusic(_gameState.musicNum, true);
_system->warpMouse(_inputVars[kInputCursorXPos], _inputVars[kInputCursorYPos]);
if (_currentPart < 900) {
showCursor();
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 045d4567997..b7fd60c477f 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -603,7 +603,7 @@ private:
const char *getString(int id) const;
void startMusic(int cmf);
- void playMusic(int num);
+ void playMusic(int num, bool restart = false);
void updateMusic();
void playSound(int num, int type);
void stopSound();
@@ -1228,8 +1228,8 @@ private:
void PART_68_UPDATE_DIALOGUE_NPC(int action);
void PART_68_NPC_SAY(const Common::Array<DialogueText> &lines);
void PART_68_NPC_SAY_REPLIES(const int *replies, const int *sounds, int count);
- void PART_68_ENTER_FROM_RIGHT();
- void PART_68_ENTER_FROM_LEFT();
+ void PART_68_enterFromRight();
+ void PART_68_enterFromLeft();
void PART_68_ENTER_INSIDE();
void PART_68_ACTION_102_takeObject();
void PART_68_ACTION_104_talk();
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index 7c36802eb92..ba186b7bd02 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -73,7 +73,7 @@ void IgorEngine::updatePalette(int count) {
assert(count <= 768);
uint8 pal[768];
for (int j = 0, i = 0; i < count; ++i) {
- pal[j++] = (_currentPalette[i] << 2);
+ pal[j++] = (_currentPalette[i] << 2) | (_currentPalette[i] >> 4);
}
g_system->getPaletteManager()->setPalette(pal, 0, count / 3);
}
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index aa99ca3fbcb..35ef2da7b98 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -221,7 +221,7 @@ void IgorEngine::PART_68_NPC_SAY_REPLIES(const int *replies, const int *sounds,
/**
* Igor comes from the right edge and walks to the left.
*/
-void IgorEngine::PART_68_ENTER_FROM_RIGHT() {
+void IgorEngine::PART_68_enterFromRight() {
WalkData *wd = &_walkData[0];
wd->setPos(319, 143, kFacingPositionLeft, 0);
wd->clipSkipX = 1;
@@ -243,7 +243,7 @@ void IgorEngine::PART_68_ENTER_FROM_RIGHT() {
/**
* Igor comes from the left edge and walks to the right.
*/
-void IgorEngine::PART_68_ENTER_FROM_LEFT() {
+void IgorEngine::PART_68_enterFromLeft() {
WalkData *wd = &_walkData[0];
wd->setPos(0, 143, kFacingPositionRight, 0);
wd->clipSkipX = 16;
@@ -539,9 +539,9 @@ void IgorEngine::PART_68() {
fadeIn(768);
if (_currentPart == 680) {
if (_objectsState[kPart68SideState] == 0) {
- PART_68_ENTER_FROM_RIGHT();
+ PART_68_enterFromRight();
} else {
- PART_68_ENTER_FROM_LEFT();
+ PART_68_enterFromLeft();
}
} else {
PART_68_ENTER_INSIDE();
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 33464e1569c..c2f7569c368 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -26,25 +26,21 @@
namespace Igor {
-void IgorEngine::playMusic(int num) {
- debugC(9, kDebugEngine, "playMusic() %d", num);
+void IgorEngine::playMusic(int num, bool restart) {
+ debugC(9, kDebugEngine, "playMusic() %d", num);
+ if (_gameState.musicNum == num && !restart)
+ return;
+ if (_gameState.musicNum != num) {
+ _gameState.musicNum = num;
+ _gameState.musicSequenceIndex = 1;
+ }
if (_game.flags & kFlagFloppy) {
- // play only if the requested track is not already playing
- if (_gameState.musicNum != num) {
- _gameState.musicNum = num;
- _gameState.musicSequenceIndex = 1;
- // TODO: the track number -> CMF file mapping is not known yet
- // startMusic(...);
- }
+ // TODO: the track number -> CMF file mapping is not known yet
+ // startMusic(...);
} else {
- // play only if the requested track is not already playing
- if(_gameState.musicNum != num) {
- _gameState.musicNum = num;
- _gameState.musicSequenceIndex = 1;
- g_system->getAudioCDManager()->stop();
- // the first CD track is the data track: music number N is CD track N + 1
- g_system->getAudioCDManager()->play(num + 1, -1, 0, 0);
- }
+ g_system->getAudioCDManager()->stop();
+ // the first CD track is the data track: music number N is CD track N + 1
+ g_system->getAudioCDManager()->play(num + 1, -1, 0, 0);
}
}
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 9e692107370..1b532a0ab88 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -1101,9 +1101,6 @@ bool IgorEngine::waitForIgorMove(IgorMoveTick tick, bool escapeSkips, bool force
while (_gameState.igorMoving && _walkDataCurrentIndex <= _walkDataLastIndex) {
moveIgor(fixedPosNum >= 0 ? fixedPosNum : _walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
++_walkDataCurrentIndex;
- // The original draws straight to the screen, so the walk stays visible, only faster.
- // TODO: the exact pace depends on the original's drawing cost and is not derived.
- waitForTimer(1);
}
_inputVars[kInputEscape] = 0;
_gameState.igorMoving = false;
Commit: ebb18b357745635b797bdadc7bea4078e0c46835
https://github.com/scummvm/scummvm/commit/ebb18b357745635b797bdadc7bea4078e0c46835
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:49+01:00
Commit Message:
IGOR: Implements scummvm save/load menus
Changed paths:
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/options.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_30.cpp
engines/igor/parts/part_68.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index b7fd60c477f..153df7e13fd 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -63,7 +63,6 @@ enum {
kTimerTicksCount = 8,
kFastModeFactor = 4,
kFastModeMaxFactor = 16,
- kQuickSaveSlot = 100,
kMaxSaveStates = 10,
kNoSpeechSound = 999
};
@@ -1218,26 +1217,26 @@ private:
void PART_68_EXEC_ACTION(int action);
void PART_68_LOAD_ROOM();
void PART_68_APPLY_OBJECT_STATE(int num);
- void PART_68_DRAW_NPC(int frame);
+ void PART_68_drawUndertaker(int frame);
void PART_68_DRAW_AMBIENT(int frame);
- void PART_68_DRAW_OBJECT(int frame);
- void PART_68_DRAW_POSE(int frame);
- void PART_68_UPDATE_AMBIENT();
+ void PART_68_drawVase(int frame);
+ void PART_68_drawPose(int frame);
+ void PART_68_updateOwlsEyes();
void PART_68_UPDATE_ROOM_BACKGROUND();
void PART_68_UPDATE_ROOM_BACKGROUND_TALK();
- void PART_68_UPDATE_DIALOGUE_NPC(int action);
- void PART_68_NPC_SAY(const Common::Array<DialogueText> &lines);
- void PART_68_NPC_SAY_REPLIES(const int *replies, const int *sounds, int count);
+ void PART_68_BorisSayReplies(int action);
+ void PART_68_sayBoris(const Common::Array<DialogueText> &lines);
+ void PART_68_BorisSayReplies(const int *replies, const int *sounds, int count);
void PART_68_enterFromRight();
void PART_68_enterFromLeft();
- void PART_68_ENTER_INSIDE();
- void PART_68_ACTION_102_takeObject();
- void PART_68_ACTION_104_talk();
- void PART_68_ACTION_106();
- void PART_68_ACTION_108_giveObject();
+ void PART_68_enterFromCemetery();
+ void PART_68_ACTION_102_takeVase();
+ void PART_68_ACTION_104_talkToBoris();
+ void PART_68_ACTION_106_enterCemetery();
+ void PART_68_ACTION_108_giveRecordsToBoris();
void PART_68_CONVERSATION();
- void PART_68_DIALOGUE_CODE(int code);
- void PART_68_NPC_LEAVES();
+ void PART_68_chooseRandomNames(int code);
+ void PART_68_BorisLeaves();
void PART_68();
void PART_71_EXEC_ACTION(int action);
@@ -1499,10 +1498,6 @@ private:
public:
Graphics::Screen *_screen = nullptr;
- 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();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 662035dea70..f8b1f3bee3d 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -66,16 +66,6 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
} else if (ev.kbd.keycode == Common::KEYCODE_p) {
_inputVars[kInputPause] = 1;
}
- else if (ev.kbd.keycode == Common::KEYCODE_F1) {
- const Common::String description = Common::String::format("Quicksave part %d", _currentPart);
- const Common::Error err = saveGameState(kQuickSaveSlot, description);
- if (err.getCode() != Common::kNoError)
- warning("Unable to quick-save: %s", err.getDesc().c_str());
- } else if (ev.kbd.keycode == Common::KEYCODE_F2) {
- const Common::Error err = loadGameState(kQuickSaveSlot);
- if (err.getCode() != Common::kNoError)
- warning("Unable to quick-load: %s", err.getDesc().c_str());
- }
break;
case Common::EVENT_MOUSEMOVE:
if (_rightButtonSelecting) {
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 21bf7c2ad6d..e2526f29ab7 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -71,14 +71,14 @@ static const Page pages[] = {
{
{ "Salvar", "Elige una posición donde salvar" },
{ 50, 75 },
- &IgorEngine::handleOptionsMenu_paintSave,
- &IgorEngine::handleOptionsMenu_handleKeyDownSave
+ 0,
+ 0
},
{
{ "Cargar", "Elige el juego que quieres cargar" },
{ 95, 93 },
- &IgorEngine::handleOptionsMenu_paintLoad,
- &IgorEngine::handleOptionsMenu_handleKeyDownLoad
+ 0,
+ 0
},
{
{ "Salir", "Salir" },
@@ -101,22 +101,6 @@ static const Page pages[] = {
};
-void IgorEngine::handleOptionsMenu_paintSave() {
- _font.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() {
- _font.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() {
_font.drawString(_screenTextLayer, "Are you sure?", 120, 64 - 15, 0xF6, -1, 0);
_font.drawString(_screenTextLayer, "(Y/N)", 143, 76 - 15, 0xF6, -1, 0);
@@ -214,8 +198,23 @@ static void drawButtonsBar(uint8 *dst, const uint8 *src) {
void IgorEngine::handleOptionsMenu() {
PauseToken pauseToken = pauseEngine();
hideCursor();
- memcpy(_paletteBuffer, _currentPalette, 768);
- memset(_screenVGA + 144 * 320, 0, 11 * 320);
+ // End the room's spoken line before reusing its text backing store.
+ if (_gameState.dialogueTextRunning) {
+ if (_currentPart != 40 && _currentPart != 700)
+ animateIgorTalking(0);
+ memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
+ stopDialogueSpeech();
+ _gameState.dialogueTextRunning = false;
+ _currentAction.verbType = 0;
+ _currentAction.object2Num = 0;
+ _currentAction.object2Type = 0;
+ }
+ // Keep the reserved UI colors: dialogue changes the displayed palette only.
+ memcpy(_paletteBuffer, _currentPalette, 208 * 3);
+ memcpy(_currentPalette + 208 * 3, _paletteBuffer + 208 * 3, 48 * 3);
+ setPaletteRange(208, 255);
+ if (!_gameState.dialogueStarted)
+ 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) {
@@ -276,7 +275,12 @@ void IgorEngine::handleOptionsMenu() {
menuLoop = false;
break;
case Common::KEYCODE_RETURN:
- if (currentPage == kPagePlay) {
+ if (currentPage == kPageSave) {
+ saveGameDialog();
+ } else if (currentPage == kPageLoad) {
+ if (loadGameDialog())
+ return;
+ } else if (currentPage == kPagePlay) {
menuLoop = false;
} else {
memcpy(buttonsBarBackup, _screenTextLayer + 3 * 320, 320 * 12);
@@ -318,6 +322,13 @@ void IgorEngine::handleOptionsMenu() {
_system->updateScreen();
}
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputRightClick] = 0;
+ _inputVars[kInputSkipDialogue] = 0;
+ _inputVars[kInputOptions] = 0;
+ _inputVars[kInputPause] = 0;
+ _system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, 200);
+ setPaletteColor(255, 63, 63, 63);
for (int m = 21; m >= 3; m -= 3) {
for (int i = 1 * 3; i <= 245 * 3; ++i) {
if (_paletteBuffer[i] >= m) {
@@ -328,6 +339,9 @@ void IgorEngine::handleOptionsMenu() {
_system->updateScreen();
_system->delayMillis(1000 / 60);
}
+ memcpy(_currentPalette, _paletteBuffer, 768);
+ updatePalette(768);
+ _system->updateScreen();
showCursor();
}
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 648b3253626..b2793d5150d 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -486,6 +486,10 @@ void IgorEngine::PART_17() {
_roomObjectAreasTable[19].object = 0;
}
+ if (_gameStateLoaded) {
+ // Restore the path depth before drawing Igor at his saved position.
+ PART_17_HELPER_5_changeZindexOfPath(0);
+ }
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
if (_currentPart == 170) {
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index 7d35456a0fe..9d356447a39 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -208,6 +208,8 @@ void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
// real dialogue
PART_30_HANDLE_DIALOGUE_LAURA();
+ if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart)
+ return;
// "Nunca me habian descrito tan bien"
igorSayAndWait(207, 1, 456);
// at least you're funny
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 35ef2da7b98..400e4195660 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -69,14 +69,14 @@ static const int kPart68TextB = 0;
// Flags of the story kept in the objects state.
static const int kPart68SideState = 90;
-static const int kPart68ObjectTakenState = 91;
-static const int kPart68TalkState = 92;
-static const int kPart68GivenState = 93;
-static const int kPart68IntroState = 94;
+static const int kPart68VaseTaken = 91;
+static const int kPart68UndertakerLeft = 92;
+static const int kPart68RecordsGiven = 93;
+static const int kPart68BorisIntroduced = 94;
static const int kPart68FlagState = 104;
// Inventory objects.
-static const int kPart68TakenObject = 34;
+static const int kVaseInventoryNumber = 34;
static const int kPart68TakenObjectIndex = 69;
static const int kPart68GiveInventoryIndex = 40;
@@ -87,7 +87,7 @@ void IgorEngine::PART_68_LOAD_ROOM() {
SET_PAL_240_48_1();
}
-void IgorEngine::PART_68_DRAW_NPC(int frame) {
+void IgorEngine::PART_68_drawUndertaker(int frame) {
drawAnimRect(kPart68NpcOffset, kPart68NpcFramesOffset + frame * kPart68NpcFrameSize, kPart68NpcWidth, kPart68NpcHeight,
true, kBlendBehindIgorAndText);
}
@@ -97,24 +97,21 @@ void IgorEngine::PART_68_DRAW_AMBIENT(int frame) {
kPart68AmbientWidth, kPart68AmbientHeight);
}
-void IgorEngine::PART_68_DRAW_OBJECT(int frame) {
+void IgorEngine::PART_68_drawVase(int frame) {
copyArea(_screenLayer1, kPart68ObjectOffset, 320, _animFramesBuffer + frame * kPart68ObjectWidth * kPart68ObjectHeight,
kPart68ObjectWidth, kPart68ObjectWidth, kPart68ObjectHeight);
}
-void IgorEngine::PART_68_DRAW_POSE(int frame) {
+void IgorEngine::PART_68_drawPose(int frame) {
drawAnimRect(kPart68PoseOffset, kPart68PoseFramesOffset + frame * kPart68PoseWidth * kPart68PoseHeight,
kPart68PoseWidth, kPart68PoseHeight);
}
-/**
- * The character is in the room until the conversation with him is over; after that the room is loaded again
- * without him. The object is drawn while it is there.
- */
void IgorEngine::PART_68_APPLY_OBJECT_STATE(int num) {
if (num == 3 || num == 255) {
- if (_objectsState[kPart68TalkState] == 0) {
- PART_68_DRAW_NPC(0);
+ // undertaker is still in the room
+ if (_objectsState[kPart68UndertakerLeft] == 0) {
+ PART_68_drawUndertaker(0);
for (int i = 0; i < MAX_ROOM_OBJECT_AREAS; ++i) {
if (_roomObjectAreasTable[i].area >= 3 && _roomObjectAreasTable[i].area <= 4) {
_roomObjectAreasTable[i].area = 0;
@@ -128,6 +125,7 @@ void IgorEngine::PART_68_APPLY_OBJECT_STATE(int num) {
PART_68_LOAD_ROOM();
WRITE_LE_UINT16(_roomActionsTable + 156, 0x9081);
_roomActionsTable[246] = 3;
+ // disable undertaker hotspot
for (int i = 0; i < MAX_ROOM_OBJECT_AREAS; ++i) {
if (_roomObjectAreasTable[i].object == 3) {
_roomObjectAreasTable[i].object = 0;
@@ -137,10 +135,10 @@ void IgorEngine::PART_68_APPLY_OBJECT_STATE(int num) {
}
}
if (num == 2 || num == 255) {
- if (_objectsState[kPart68ObjectTakenState] == 0) {
- PART_68_DRAW_OBJECT(0);
+ if (_objectsState[kPart68VaseTaken] == 0) {
+ PART_68_drawVase(0);
} else {
- PART_68_DRAW_OBJECT(1);
+ PART_68_drawVase(1);
for (int i = 0; i < MAX_ROOM_OBJECT_AREAS; ++i) {
if (_roomObjectAreasTable[i].object == 2) {
_roomObjectAreasTable[i].object = 0;
@@ -150,7 +148,7 @@ void IgorEngine::PART_68_APPLY_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_68_UPDATE_AMBIENT() {
+void IgorEngine::PART_68_updateOwlsEyes() {
if (compareGameTick(0x3D)) {
if (_roomAmbientIndex == 3) {
_roomAmbientIndex = 0;
@@ -162,14 +160,11 @@ void IgorEngine::PART_68_UPDATE_AMBIENT() {
}
}
-/**
- * Used while the character is talking: no idle frames of him.
- */
void IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND_TALK() {
if (compareGameTick(1) && getRandomNumber(49) == 0) {
playSound(41, 1);
}
- PART_68_UPDATE_AMBIENT();
+ PART_68_updateOwlsEyes();
}
void IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND() {
@@ -177,50 +172,44 @@ void IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND() {
playSound(41, 1);
}
if (compareGameTick(0x3D) && _part68NpcPresent) {
- PART_68_DRAW_NPC(getRandomNumber(2));
+ PART_68_drawUndertaker(getRandomNumber(2));
}
- PART_68_UPDATE_AMBIENT();
+ PART_68_updateOwlsEyes();
}
-void IgorEngine::PART_68_UPDATE_DIALOGUE_NPC(int action) {
+void IgorEngine::PART_68_BorisSayReplies(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PART_68_DRAW_NPC(kPart68NpcStanding);
+ PART_68_drawUndertaker(kPart68NpcStanding);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_68_DRAW_NPC(kPart68NpcStanding + getRandomNumber(4));
+ PART_68_drawUndertaker(kPart68NpcStanding + getRandomNumber(4));
break;
}
}
-/**
- * The character says lines of the room texts.
- */
-void IgorEngine::PART_68_NPC_SAY(const Common::Array<DialogueText> &lines) {
+void IgorEngine::PART_68_sayBoris(const Common::Array<DialogueText> &lines) {
UpdateRoomBackgroundProc previous = _updateRoomBackground;
_updateRoomBackground = &IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND_TALK;
cutsceneSayWithCallback(kPart68TextX, kPart68TextY, kPart68TextR, kPart68TextG, kPart68TextB, lines,
- &IgorEngine::PART_68_UPDATE_DIALOGUE_NPC);
+ &IgorEngine::PART_68_BorisSayReplies);
_updateRoomBackground = previous;
}
/**
- * The character says lines taken from the replies of the conversation, one line per page.
+ * Since Boris speaks in four separate pages, utility function to help on that
*/
-void IgorEngine::PART_68_NPC_SAY_REPLIES(const int *replies, const int *sounds, int count) {
+void IgorEngine::PART_68_BorisSayReplies(const int *replies, const int *sounds, int count) {
Common::Array<DialogueText> lines;
for (int i = 0; i < count; ++i) {
Common::strlcpy(_globalDialogueTexts[250 + i], _dialogueReplies[replies[i] - 1], sizeof(_globalDialogueTexts[250 + i]));
DialogueText line = { 250 + i, 1, sounds[i] };
lines.push_back(line);
}
- PART_68_NPC_SAY(lines);
+ PART_68_sayBoris(lines);
}
-/**
- * Igor comes from the right edge and walks to the left.
- */
void IgorEngine::PART_68_enterFromRight() {
WalkData *wd = &_walkData[0];
wd->setPos(319, 143, kFacingPositionLeft, 0);
@@ -240,9 +229,6 @@ void IgorEngine::PART_68_enterFromRight() {
waitForIgorMove(&IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND);
}
-/**
- * Igor comes from the left edge and walks to the right.
- */
void IgorEngine::PART_68_enterFromLeft() {
WalkData *wd = &_walkData[0];
wd->setPos(0, 143, kFacingPositionRight, 0);
@@ -262,10 +248,7 @@ void IgorEngine::PART_68_enterFromLeft() {
waitForIgorMove(&IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND);
}
-/**
- * Igor appears next to the character, smaller, and walks down.
- */
-void IgorEngine::PART_68_ENTER_INSIDE() {
+void IgorEngine::PART_68_enterFromCemetery() {
WalkData *wd = &_walkData[0];
wd->setPos(193, 115, kFacingPositionRight, 0);
wd->clipSkipX = 1;
@@ -284,17 +267,15 @@ void IgorEngine::PART_68_ENTER_INSIDE() {
waitForIgorMove(&IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND);
}
-/**
- * Before the character has been given his object he only talks (and refuses); afterwards the object in the room
- * goes to the inventory.
- */
-void IgorEngine::PART_68_ACTION_102_takeObject() {
- if (_objectsState[kPart68GivenState] == 0) {
- PART_68_DRAW_POSE(0);
- PART_68_DRAW_NPC(kPart68NpcFacing);
+
+void IgorEngine::PART_68_ACTION_102_takeVase() {
+ // will only let us take the vase if the records have been given to him
+ if (_objectsState[kPart68RecordsGiven] == 0) {
+ PART_68_drawPose(0);
+ PART_68_drawUndertaker(kPart68NpcFacing);
waitForTimer(30);
- PART_68_NPC_SAY({ { 202, 1, 1008 }, { 203, 1, 1009 }, { 204, 1, 1010 }, { 205, 1, 1011 } });
- PART_68_DRAW_POSE(1);
+ PART_68_sayBoris({ { 202, 1, 1008 }, { 203, 1, 1009 }, { 204, 1, 1010 }, { 205, 1, 1011 } });
+ PART_68_drawPose(1);
waitForTimer(30);
// Igor turns to the right
@@ -303,25 +284,25 @@ void IgorEngine::PART_68_ACTION_102_takeObject() {
moveIgor(kFacingPositionRight, 0);
_walkDataCurrentIndex = _walkDataLastIndex;
igorSayAndWait({ { 206, 1, 1012 }, { 207, 1, 1013 } });
- PART_68_NPC_SAY({ { 208, 1, 1014 }, { 209, 1, 1015 }, { 210, 1, 1016 }, { 211, 1, 1017 } });
- PART_68_DRAW_NPC(kPart68NpcFacing);
+ PART_68_sayBoris({ { 208, 1, 1014 }, { 209, 1, 1015 }, { 210, 1, 1016 }, { 211, 1, 1017 } });
+ PART_68_drawUndertaker(kPart68NpcFacing);
waitForTimer(30);
return;
}
for (int frame = 0; frame <= 1; ++frame) {
- PART_68_DRAW_POSE(frame);
+ PART_68_drawPose(frame);
waitForTimer(120);
}
- addObjectToInventory(kPart68TakenObject, kPart68TakenObjectIndex);
- _objectsState[kPart68ObjectTakenState] = 1;
+ addObjectToInventory(kVaseInventoryNumber, kPart68TakenObjectIndex);
+ _objectsState[kPart68VaseTaken] = 1;
PART_68_APPLY_OBJECT_STATE(255);
}
/**
* Igor gives the object to the character.
*/
-void IgorEngine::PART_68_ACTION_108_giveObject() {
- PART_68_DRAW_NPC(kPart68NpcFacing);
+void IgorEngine::PART_68_ACTION_108_giveRecordsToBoris() {
+ PART_68_drawUndertaker(kPart68NpcFacing);
waitForTimer(30);
drawAnimRect(kPart68GiveOffset, kPart68GiveFramesOffset, kPart68GiveWidth, kPart68GiveHeight);
if (_inventoryInfo[kPart68GiveInventoryIndex] != 0) {
@@ -330,22 +311,22 @@ void IgorEngine::PART_68_ACTION_108_giveObject() {
}
playSound(63, 1);
igorSayAndWait(214, 1, 1019);
- PART_68_NPC_SAY({ { 215, 1, 1020 }, { 216, 1, 1021 }, { 217, 1, 1022 }, { 218, 1, 1023 } });
+ PART_68_sayBoris({ { 215, 1, 1020 }, { 216, 1, 1021 }, { 217, 1, 1022 }, { 218, 1, 1023 } });
for (int frame = 1; frame <= 3; ++frame) {
drawAnimRect(kPart68GiveOffset, kPart68GiveFramesOffset + frame * kPart68GiveFrameSize, kPart68GiveWidth, kPart68GiveHeight);
waitForTimer(40);
}
- PART_68_NPC_SAY({ { 219, 1, 1024 }, { 220, 1, 1025 }, { 221, 1, 1026 }, { 222, 1, 1027 } });
- PART_68_DRAW_NPC(kPart68NpcFacing);
+ PART_68_sayBoris({ { 219, 1, 1024 }, { 220, 1, 1025 }, { 221, 1, 1026 }, { 222, 1, 1027 } });
+ PART_68_drawUndertaker(kPart68NpcFacing);
waitForTimer(30);
- _objectsState[kPart68GivenState] = 1;
+ _objectsState[kPart68RecordsGiven] = 1;
PART_68_APPLY_OBJECT_STATE(255);
}
/**
- * The changes of the conversation for some of the answers.
+ * Chooses names at random for the replies
*/
-void IgorEngine::PART_68_DIALOGUE_CODE(int code) {
+void IgorEngine::PART_68_chooseRandomNames(int code) {
uint8 *data = _gameState.dialogueData;
if (code == 10) {
const int entries = _objectsState[kPart68FlagState] == 1 ? 4 : 5;
@@ -374,7 +355,7 @@ void IgorEngine::PART_68_DIALOGUE_CODE(int code) {
/**
* The sprites of the character going away.
*/
-void IgorEngine::PART_68_NPC_LEAVES() {
+void IgorEngine::PART_68_BorisLeaves() {
for (int frame = 1; frame <= 6; ++frame) {
decodeAnimFrame(getAnimFrame(kPart68LeaveBase, kPart68LeaveTable, frame), _screenVGA, true);
waitForTimer(30);
@@ -384,32 +365,33 @@ void IgorEngine::PART_68_NPC_LEAVES() {
void IgorEngine::PART_68_CONVERSATION() {
UpdateRoomBackgroundProc previousBackground = _updateRoomBackground;
_updateRoomBackground = &IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND_TALK;
- _updateDialogue = &IgorEngine::PART_68_UPDATE_DIALOGUE_NPC;
+ _updateDialogue = &IgorEngine::PART_68_BorisSayReplies;
loadDialogueData(DLG_Part68);
_part68QuestionCounter = 1;
- PART_68_DRAW_NPC(kPart68NpcStanding);
+ PART_68_drawUndertaker(kPart68NpcStanding);
memset(_screenVGA + 46080, 0, 17920);
_gameState.dialogueStarted = true;
_gameState.dialogueChoiceStart = 1;
_gameState.dialogueChoiceCount = 1;
- if (_objectsState[kPart68IntroState] == 0) {
+ // boris says different greeting depending if its the first time or not
+ if (_objectsState[kPart68BorisIntroduced] == 0) {
igorSayAndWait(225, 1, 1029);
static const int replies[4] = { 1, 2, 3, 4 };
static const int sounds[4] = { 1051, 1052, 1053, 1054 };
- PART_68_NPC_SAY_REPLIES(replies, sounds, 4);
- _objectsState[kPart68IntroState] = 1;
+ PART_68_BorisSayReplies(replies, sounds, 4);
+ _objectsState[kPart68BorisIntroduced] = 1;
} else {
igorSayAndWait(226, 1, 1030);
static const int replies[4] = { 5, 6, 7, 8 };
static const int sounds[4] = { 1055, 1056, 1057, 1058 };
- PART_68_NPC_SAY_REPLIES(replies, sounds, 4);
+ PART_68_BorisSayReplies(replies, sounds, 4);
}
bool done = false;
do {
drawDialogueChoices();
- PART_68_DRAW_NPC(kPart68NpcStanding);
+ PART_68_drawUndertaker(kPart68NpcStanding);
const int choice = selectDialogue();
if (choice == 0) {
break;
@@ -426,7 +408,7 @@ void IgorEngine::PART_68_CONVERSATION() {
(_gameState.dialogueChoiceStart - 1) * 30;
_part68LastDialogueCode = _gameState.dialogueData[offset + 5];
if (_part68LastDialogueCode != 0) {
- PART_68_DIALOGUE_CODE(_part68LastDialogueCode);
+ PART_68_chooseRandomNames(_part68LastDialogueCode);
}
switch (_gameState.dialogueData[offset + 2]) {
case 1:
@@ -450,9 +432,9 @@ void IgorEngine::PART_68_CONVERSATION() {
if (_part68LastDialogueCode == kPart68TalkCodeEnd) {
static const int replies[4] = { 29, 30, 31, 32 };
static const int sounds[4] = { 1079, 1080, 1081, 1082 };
- PART_68_NPC_SAY_REPLIES(replies, sounds, 4);
- PART_68_NPC_LEAVES();
- _objectsState[kPart68TalkState] = 2;
+ PART_68_BorisSayReplies(replies, sounds, 4);
+ PART_68_BorisLeaves();
+ _objectsState[kPart68UndertakerLeft] = 2;
}
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
@@ -463,18 +445,18 @@ void IgorEngine::PART_68_CONVERSATION() {
_updateRoomBackground = previousBackground;
}
-void IgorEngine::PART_68_ACTION_104_talk() {
+void IgorEngine::PART_68_ACTION_104_talkToBoris() {
PART_68_CONVERSATION();
- if (_objectsState[kPart68TalkState] == 2) {
- _objectsState[kPart68TalkState] = 1;
+ if (_objectsState[kPart68UndertakerLeft] == 2) {
+ _objectsState[kPart68UndertakerLeft] = 1;
PART_68_APPLY_OBJECT_STATE(255);
}
}
-void IgorEngine::PART_68_ACTION_106() {
- if (_objectsState[kPart68TalkState] == 0) {
+void IgorEngine::PART_68_ACTION_106_enterCemetery() {
+ if (_objectsState[kPart68UndertakerLeft] == 0) {
igorSayAndWait(223, 2, 1028);
- PART_68_ACTION_104_talk();
+ PART_68_ACTION_104_talkToBoris();
} else {
_currentPart = 710;
}
@@ -482,27 +464,27 @@ void IgorEngine::PART_68_ACTION_106() {
void IgorEngine::PART_68_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // exit through either side will cause next entry to be that side
_objectsState[kPart68SideState] = 1;
_currentPart = 700;
break;
- case 102:
- PART_68_ACTION_102_takeObject();
+ case 102: // take vase
+ PART_68_ACTION_102_takeVase();
break;
- case 103:
+ case 103: // look at vase
igorSay(201, 1, 1007);
break;
- case 104:
- PART_68_ACTION_104_talk();
+ case 104: // talk to Boris
+ PART_68_ACTION_104_talkToBoris();
break;
- case 105:
+ case 105: // look at Boris
igorSay(212, 2, 1018);
break;
case 106:
- PART_68_ACTION_106();
+ PART_68_ACTION_106_enterCemetery();
break;
case 108:
- PART_68_ACTION_108_giveObject();
+ PART_68_ACTION_108_giveRecordsToBoris();
break;
case 109:
_objectsState[kPart68SideState] = 0;
@@ -544,7 +526,7 @@ void IgorEngine::PART_68() {
PART_68_enterFromLeft();
}
} else {
- PART_68_ENTER_INSIDE();
+ PART_68_enterFromCemetery();
}
}
enterPartLoop();
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index bbe120f2460..023773a833a 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -642,6 +642,14 @@ int IgorEngine::selectDialogue() {
int hoveredChoice = 0;
bool end = false;
do {
+ if (_inputVars[kInputOptions]) {
+ _inputVars[kInputOptions] = 0;
+ handleOptionsMenu();
+ if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart)
+ return -1;
+ drawDialogueChoices();
+ hoveredChoice = 0;
+ }
int currentChoice = (_inputVars[kInputCursorYPos] - 134) / 11;
if (currentChoice < 0) {
currentChoice = 0;
Commit: 0e0ffb760f599e9eac113aa858f7cfdc42601457
https://github.com/scummvm/scummvm/commit/0e0ffb760f599e9eac113aa858f7cfdc42601457
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:50+01:00
Commit Message:
IGOR: Refactor darken palette function
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_50.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_72.cpp
engines/igor/parts/part_81.cpp
engines/igor/parts/part_maze.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 153df7e13fd..8572d8b0467 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1252,12 +1252,14 @@ private:
void PART_72_EXEC_ACTION(int action);
void PART_72_APPLY_OBJECT_STATE();
void PART_72_ACTION_102_takeObject();
- void PART_72_ENTER_FROM_RIGHT();
- void PART_72_ENTER_FROM_LEFT();
+ void PART_72_enterFromMap();
+ void PART_72_enterFromSwamp();
void PART_72_UPDATE_STAR();
void PART_72_UPDATE_ROOM_BACKGROUND();
void PART_72();
+ void paintEyes();
+
void PART_76_EXEC_ACTION(int action);
void PART_76_APPLY_OBJECT_STATE();
void PART_76_DRAW_SCENE_FRAME(int frame);
diff --git a/engines/igor/parts/part_50.cpp b/engines/igor/parts/part_50.cpp
index bcb1f656db3..0fb777cd526 100644
--- a/engines/igor/parts/part_50.cpp
+++ b/engines/igor/parts/part_50.cpp
@@ -119,10 +119,7 @@ void IgorEngine::PART_50() {
memcpy(_screenVGA, _screenLayer1, 46080);
// the whole room is darker than its palette
- for (int i = 3; i <= 207 * 3 + 2; ++i) {
- const int value = _paletteBuffer[i] - kPart50PaletteDarkness;
- _paletteBuffer[i] = value < 1 ? 0 : value;
- }
+ darkenPalette(_paletteBuffer, 1, 207, kPart50PaletteDarkness);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 400e4195660..14ec730ea48 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -511,10 +511,7 @@ void IgorEngine::PART_68() {
memcpy(_screenVGA, _screenLayer1, 46080);
// the colors that change are darker than their palette
- for (int i = 192 * 3; i < 208 * 3; ++i) {
- const int value = _paletteBuffer[i] - 10;
- _paletteBuffer[i] = value < 1 ? 0 : value;
- }
+ darkenPalette(_paletteBuffer, 192, 207, 10);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
index 9e177a24917..d836f7df5c2 100644
--- a/engines/igor/parts/part_72.cpp
+++ b/engines/igor/parts/part_72.cpp
@@ -107,7 +107,7 @@ void IgorEngine::PART_72_ACTION_102_takeObject() {
/**
* Igor comes from the right edge, walking to the left.
*/
-void IgorEngine::PART_72_ENTER_FROM_RIGHT() {
+void IgorEngine::PART_72_enterFromMap() {
WalkData *wd = &_walkData[0];
wd->setPos(319, 68, kFacingPositionLeft, 0);
wd->clipSkipX = 1;
@@ -129,7 +129,7 @@ void IgorEngine::PART_72_ENTER_FROM_RIGHT() {
/**
* Igor comes from the left edge, walking to the right.
*/
-void IgorEngine::PART_72_ENTER_FROM_LEFT() {
+void IgorEngine::PART_72_enterFromSwamp() {
WalkData *wd = &_walkData[0];
wd->setPos(0, 119, kFacingPositionRight, 0);
wd->clipSkipX = 15;
@@ -208,23 +208,19 @@ void IgorEngine::PART_72() {
PART_72_APPLY_OBJECT_STATE();
memcpy(_screenVGA, _screenLayer1, 46080);
- // the whole picture is darker than its palette
+ // Darken the room colors by 10 and Igor's colors by 15.
darkenPalette(_paletteBuffer, 1, 175, 10);
darkenPalette(_paletteBuffer, 192, 207, 15);
- for (int i = 0; i < 5; ++i) {
- const int pos = kPart72StarOffsets[i];
- _screenVGA[pos] = 0xB3;
- _screenVGA[pos + 2] = 0xB3;
- }
+ paintEyes();
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 720) {
- PART_72_ENTER_FROM_RIGHT();
+ PART_72_enterFromMap();
} else {
- PART_72_ENTER_FROM_LEFT();
+ PART_72_enterFromSwamp();
}
}
enterPartLoop();
@@ -238,4 +234,12 @@ void IgorEngine::PART_72() {
fadeOut(624);
}
+void IgorEngine::paintEyes() {
+ for (int i = 0; i < 5; ++i) {
+ const int pos = kPart72StarOffsets[i];
+ _screenVGA[pos] = 0xB3;
+ _screenVGA[pos + 2] = 0xB3;
+ }
+}
+
} // End of namespace Igor
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index cd4964a2892..2ce9be3b9b5 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -539,10 +539,7 @@ void IgorEngine::PART_81() {
PART_81_APPLY_OBJECT_STATE(255);
// the colors that change are darker than their palette
- for (int i = 192 * 3; i < 208 * 3; ++i) {
- const int value = _paletteBuffer[i] - 20;
- _paletteBuffer[i] = value < 1 ? 0 : value;
- }
+ darkenPalette(_paletteBuffer, 192, 207, 20);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
diff --git a/engines/igor/parts/part_maze.cpp b/engines/igor/parts/part_maze.cpp
index 1cc1bf87143..ef3bf9931ad 100644
--- a/engines/igor/parts/part_maze.cpp
+++ b/engines/igor/parts/part_maze.cpp
@@ -329,15 +329,8 @@ void IgorEngine::PART_MAZE() {
memcpy(_screenVGA, _screenLayer1, 46080);
// the whole room is darker than its palette
- for (int color = 1; color <= 207; ++color) {
- if (color > 183 && color < 192) {
- continue;
- }
- for (int i = 0; i < 3; ++i) {
- const int value = _paletteBuffer[color * 3 + i] - room->darkness;
- _paletteBuffer[color * 3 + i] = value < 1 ? 0 : value;
- }
- }
+ darkenPalette(_paletteBuffer, 1, 183, room->darkness);
+ darkenPalette(_paletteBuffer, 192, 207, room->darkness);
// draws the first frames of the flames
for (int i = 0; i < room->numFlames; ++i) {
Commit: 77917e710d9def1ae0e7d668b617c1719307c235
https://github.com/scummvm/scummvm/commit/77917e710d9def1ae0e7d668b617c1719307c235
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:50+01:00
Commit Message:
IGOR: renaming part 72
Changed paths:
engines/igor/parts/part_72.cpp
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
index d836f7df5c2..cc3540ce787 100644
--- a/engines/igor/parts/part_72.cpp
+++ b/engines/igor/parts/part_72.cpp
@@ -27,7 +27,7 @@ namespace Igor {
static const int kPart72ObjectOffset = 84 * 320 + 133;
static const int kPart72ObjectWidth = 9;
static const int kPart72ObjectHeight = 5;
-static const int kPart72ObjectStateIndex = 102;
+static const int kPart72FlowerTaken = 102;
static const int kPart72TakeFramesOffset = 2 * kPart72ObjectWidth * kPart72ObjectHeight;
static const int kPart72TakeWidth = 35;
static const int kPart72TakeHeight = 49;
@@ -38,30 +38,30 @@ static const int kPart72TakeOffset = 42 * 320 + 133;
static const int kPart72ObjectAreas[5] = { 42, 44, 50, 56, 61 };
// Screen positions of the five stars, each one drawn as two pixels two columns apart.
-static const int kPart72StarOffsets[5] = { 0x2C06, 0x135B, 0x0FC5, 0x23E7, 0x254D };
+static const int kPart72EyeOffsets[5] = { 0x2C06, 0x135B, 0x0FC5, 0x23E7, 0x254D };
-static const int kPart72InventoryObject = 33;
-static const int kPart72InventoryIndex = 68;
+static const int kPart72FlowerObjectNumber = 33;
+static const int kPart72FlowerObjectIndex = 68;
-static bool PART_72_IS_PROTECTED_COLOR(uint8 color) {
+static bool PART_72_shouldBlink(uint8 color) {
return (color >= 0xC0 && color <= 0xCF) || (color >= 0xF0 && color <= 0xF1);
}
void IgorEngine::PART_72_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // go to swamp
_currentPart = 690;
break;
case 102:
- PART_72_ACTION_102_takeObject();
+ PART_72_ACTION_102_takeFlower();
break;
- case 103:
+ case 103: // look at flower
igorSay(202, 1, 1094);
break;
- case 104:
+ case 104: // look at birds
igorSay(203, 1, 1095);
break;
- case 105:
+ case 105: // look at eyes
igorSay(204, 1, 1096);
break;
case 106:
@@ -74,11 +74,9 @@ void IgorEngine::PART_72_EXEC_ACTION(int action) {
}
}
-/**
- * Draws the object into the room picture while it is there. Once it is taken its places are not objects anymore.
- */
+
void IgorEngine::PART_72_APPLY_OBJECT_STATE() {
- const int taken = _objectsState[kPart72ObjectStateIndex] == 0 ? 0 : 1;
+ const int taken = _objectsState[kPart72FlowerTaken] == 0 ? 0 : 1;
copyArea(_screenLayer1, kPart72ObjectOffset, 320, _animFramesBuffer + taken * kPart72ObjectWidth * kPart72ObjectHeight,
kPart72ObjectWidth, kPart72ObjectWidth, kPart72ObjectHeight);
if (taken) {
@@ -88,25 +86,18 @@ void IgorEngine::PART_72_APPLY_OBJECT_STATE() {
}
}
-/**
- * Igor takes the object: three frames of the animation are drawn over the screen, then the object goes to the
- * inventory.
- */
-void IgorEngine::PART_72_ACTION_102_takeObject() {
+void IgorEngine::PART_72_ACTION_102_takeFlower() {
for (int i = 0; i < 3; ++i) {
const uint8 *frame = _animFramesBuffer + kPart72TakeFramesOffset + i * kPart72TakeFrameSize;
copyArea(_screenVGA, kPart72TakeOffset, 320, frame, kPart72TakeWidth, kPart72TakeWidth, kPart72TakeHeight);
waitForTimer(90);
}
- addObjectToInventory(kPart72InventoryObject, kPart72InventoryIndex);
- _objectsState[kPart72ObjectStateIndex] = 1;
+ addObjectToInventory(kPart72FlowerObjectNumber, kPart72FlowerObjectIndex);
+ _objectsState[kPart72FlowerTaken] = 1;
PART_72_APPLY_OBJECT_STATE();
igorSay(201, 1, 1093);
}
-/**
- * Igor comes from the right edge, walking to the left.
- */
void IgorEngine::PART_72_enterFromMap() {
WalkData *wd = &_walkData[0];
wd->setPos(319, 68, kFacingPositionLeft, 0);
@@ -126,9 +117,6 @@ void IgorEngine::PART_72_enterFromMap() {
waitForIgorMove();
}
-/**
- * Igor comes from the left edge, walking to the right.
- */
void IgorEngine::PART_72_enterFromSwamp() {
WalkData *wd = &_walkData[0];
wd->setPos(0, 119, kFacingPositionRight, 0);
@@ -149,25 +137,25 @@ void IgorEngine::PART_72_enterFromSwamp() {
}
/**
- * The current star is lit and, from time to time, another one is chosen and put out.
+ * Eyes in the background blink from time to time
*/
-void IgorEngine::PART_72_UPDATE_STAR() {
- int pos = kPart72StarOffsets[_roomAmbientIndex - 1];
- if (!PART_72_IS_PROTECTED_COLOR(_screenVGA[pos])) {
+void IgorEngine::PART_72_updateBlinkingEyes() {
+ int pos = kPart72EyeOffsets[_roomAmbientIndex - 1];
+ if (!PART_72_shouldBlink(_screenVGA[pos])) {
_screenVGA[pos] = 0xB3;
}
- if (!PART_72_IS_PROTECTED_COLOR(_screenVGA[pos])) {
+ if (!PART_72_shouldBlink(_screenVGA[pos])) {
_screenVGA[pos + 2] = 0xB3;
}
if (getRandomNumber(4) != 0) {
return;
}
_roomAmbientIndex = getRandomNumber(4) + 1;
- pos = kPart72StarOffsets[_roomAmbientIndex - 1];
- if (!PART_72_IS_PROTECTED_COLOR(_screenVGA[pos])) {
+ pos = kPart72EyeOffsets[_roomAmbientIndex - 1];
+ if (!PART_72_shouldBlink(_screenVGA[pos])) {
_screenVGA[pos] = _screenLayer1[pos];
}
- if (!PART_72_IS_PROTECTED_COLOR(_screenVGA[pos])) {
+ if (!PART_72_shouldBlink(_screenVGA[pos])) {
_screenVGA[pos + 2] = _screenLayer1[pos + 2];
}
}
@@ -186,7 +174,7 @@ void IgorEngine::PART_72_UPDATE_ROOM_BACKGROUND() {
}
}
if (compareGameTick(0x3D)) {
- PART_72_UPDATE_STAR();
+ PART_72_updateBlinkingEyes();
}
}
@@ -212,7 +200,7 @@ void IgorEngine::PART_72() {
darkenPalette(_paletteBuffer, 1, 175, 10);
darkenPalette(_paletteBuffer, 192, 207, 15);
- paintEyes();
+ paintBlinkingEyes();
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
@@ -234,9 +222,9 @@ void IgorEngine::PART_72() {
fadeOut(624);
}
-void IgorEngine::paintEyes() {
+void IgorEngine::paintBlinkingEyes() {
for (int i = 0; i < 5; ++i) {
- const int pos = kPart72StarOffsets[i];
+ const int pos = kPart72EyeOffsets[i];
_screenVGA[pos] = 0xB3;
_screenVGA[pos + 2] = 0xB3;
}
Commit: 56918ad737f50f3d370b2b2d89033817432c2c08
https://github.com/scummvm/scummvm/commit/56918ad737f50f3d370b2b2d89033817432c2c08
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:51+01:00
Commit Message:
IGOR: Renamings of parts 70, 72, 73, 74, 75, 76, 78
Changed paths:
engines/igor/igor.h
engines/igor/part_main.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_70.cpp
engines/igor/parts/part_72.cpp
engines/igor/parts/part_73.cpp
engines/igor/parts/part_74.cpp
engines/igor/parts/part_75.cpp
engines/igor/parts/part_76.cpp
engines/igor/parts/part_78.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 8572d8b0467..72f5918a416 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1165,55 +1165,7 @@ private:
void PART_50_UPDATE_ROOM_BACKGROUND();
void PART_50();
- void PART_69_EXEC_ACTION(int action);
- void PART_69_APPLY_OBJECT_STATE();
- void PART_69_DRAW_FIREFLY_A(int frame);
- void PART_69_DRAW_FIREFLY_B(int frame);
- void PART_69_ANIMATE_FIREFLIES();
- void PART_69_ACTION_107_watch();
- void PART_69_FINALE(int num, int sound);
- void PART_69_ENTER_FROM_RIGHT();
- void PART_69_UPDATE_ROOM_BACKGROUND();
- void PART_69();
-
- void PART_70_EXEC_ACTION(int action);
- void PART_70_DRAW_OBJECT_STATE();
- void PART_70_UPDATE_ROOM_BACKGROUND();
- void PART_70();
-
- void PART_74_CYCLE_COLORS();
- void PART_74_DRAW_FRAME(int frame);
- void PART_74_UPDATE_DIALOGUE_FIRST(int action);
- void PART_74_UPDATE_DIALOGUE_SECOND_A(int action);
- void PART_74_UPDATE_DIALOGUE_SECOND_B(int action);
- void PART_74_SAY(int who, const Common::Array<DialogueText> &lines);
- void PART_74_CUTSCENE();
-
- void PART_81_EXEC_ACTION(int action);
- void PART_81_LOAD_ROOM();
- void PART_81_LOAD_ANIMATION();
- void PART_81_DRAW_HEAD(int frame);
- void PART_81_DRAW_STORY_HEAD(int frame);
- void PART_81_DRAW_FIGURE(int offset);
- void PART_81_DRAW_END_FRAME(int frame);
- void PART_81_UPDATE_ROOM_BACKGROUND();
- void PART_81_UPDATE_DIALOGUE_NPC(int action);
- void PART_81_NPC_SAY(const Common::Array<DialogueText> &lines);
- void PART_81_IGOR_SAY(int num, int count, int sound);
- void PART_81_APPLY_OBJECT_STATE(int num);
- void PART_81_SCROLL_IN();
- void PART_81_TRANSITION_IN();
- void PART_81_TRANSITION_OUT();
- void PART_81_END_SCENE();
- void PART_81_ACTION_109();
- void PART_81_ACTION_110();
- void PART_81_ACTION_102_talk();
- void PART_81_DIALOGUE_CODE(int code);
- void PART_81_CONVERSATION();
- void PART_81_ENTER();
- void PART_81();
-
-
+ // cemetery entrance
void PART_68_EXEC_ACTION(int action);
void PART_68_LOAD_ROOM();
void PART_68_APPLY_OBJECT_STATE(int num);
@@ -1239,6 +1191,24 @@ private:
void PART_68_BorisLeaves();
void PART_68();
+ // swamp
+ void PART_69_EXEC_ACTION(int action);
+ void PART_69_APPLY_OBJECT_STATE();
+ void PART_69_DRAW_FIREFLY_A(int frame);
+ void PART_69_DRAW_FIREFLY_B(int frame);
+ void PART_69_ANIMATE_FIREFLIES();
+ void PART_69_ACTION_107_watch();
+ void PART_69_FINALE(int num, int sound);
+ void PART_69_ENTER_FROM_RIGHT();
+ void PART_69_UPDATE_ROOM_BACKGROUND();
+ void PART_69();
+
+ // map of second area
+ void PART_70_EXEC_ACTION(int action);
+ void PART_70_DRAW_OBJECT_STATE();
+ void PART_70_UPDATE_ROOM_BACKGROUND();
+ void PART_70();
+
void PART_71_EXEC_ACTION(int action);
void PART_71_APPLY_OBJECT_STATE(int what);
void PART_71_DRAW_OBJECT(int frame);
@@ -1251,53 +1221,41 @@ private:
void PART_72_EXEC_ACTION(int action);
void PART_72_APPLY_OBJECT_STATE();
- void PART_72_ACTION_102_takeObject();
+ void PART_72_ACTION_102_takeFlower();
void PART_72_enterFromMap();
void PART_72_enterFromSwamp();
- void PART_72_UPDATE_STAR();
+ void PART_72_updateBlinkingEyes();
void PART_72_UPDATE_ROOM_BACKGROUND();
void PART_72();
+ void PART_72_paintBlinkingEyes();
+
+ void PART_73_drawPoliceman(int frame);
+ void PART_73_UPDATE_DIALOGUE(int action);
+ void PART_73_CUTSCENE();
- void paintEyes();
+ void PART_74_CYCLE_COLORS();
+ void PART_74_drawCharacterFrame(int frame);
+ void PART_74_UPDATE_DIALOGUE_Sailor(int action);
+ void PART_74_UPDATE_DIALOGUE_CaptainA(int action);
+ void PART_74_UPDATE_DIALOGUE_CaptainB(int action);
+ void PART_74_SAY(int who, const Common::Array<DialogueText> &lines);
+ void PART_74_CUTSCENE();
+
+ // philip vodka cutscene
+ void PART_75_UPDATE_DIALOGUE_PHILIP(int action);
+ void PART_75_HELPER_drawPhilipFrame(int frame);
+ void PART_75();
void PART_76_EXEC_ACTION(int action);
void PART_76_APPLY_OBJECT_STATE();
- void PART_76_DRAW_SCENE_FRAME(int frame);
- void PART_76_DRAW_SEQUENCE_FRAME(int frame);
- void PART_76_ACTION_103_sequence();
- void PART_76_ACTION_104_takeObject();
- void PART_76_ACTION_106_finale();
+ void PART_76_drawParachuteFrame(int frame);
+ void PART_76_drawOpenDoorFrame(int frame);
+ void PART_76_ACTION_103_openDoor();
+ void PART_76_ACTION_104_takeParachute();
+ void PART_76_ACTION_106_useParachute();
void PART_76_ENTRY();
void PART_76();
- void PART_79_DRAW_FIGURE(int frame);
- void PART_79_DRAW_PATCH(int step);
- void PART_79_CLEAR_PATCH();
- void PART_79_UPDATE_AMBIENT_790();
- void PART_79_UPDATE_DIALOGUE_790(int action);
- void PART_79_SAY_790(const Common::Array<DialogueText> &lines);
- void PART_79_SLIDE();
- void PART_79_790();
- void PART_79_DRAW_GROUP_FRAME(const uint8 *buffer, int table, int base, int frame);
- void PART_79_DRAW_SCENE(int frame);
- void PART_79_DRAW_LAYER2_FRAME(int frame);
- void PART_79_DRAW_LAYER2_FRAME_2(int frame);
- void PART_79_DRAW_ANIM2_FRAME(const void *group, int frame);
- void PART_79_ANIMATE_IGOR_HEAD(int frame);
- void PART_79_UPDATE_DIALOGUE_SPEAKER(int action);
- void PART_79_UPDATE_DIALOGUE_FIRST_SPEAKER(int action);
- void PART_79_UPDATE_DIALOGUE_THIRD_SPEAKER(int action);
- void PART_79_UPDATE_AMBIENT_791();
- void PART_79_SAY_SPEAKER(int startX, int startY, int x, int y, int r, int g, int b, int endFrame, int baseFrame, const Common::Array<DialogueText> &lines);
- void PART_79_SAY_FIRST_SPEAKER(int startX, int startY, const Common::Array<DialogueText> &lines);
- void PART_79_SAY_THIRD_SPEAKER(const Common::Array<DialogueText> &lines);
- void PART_79_IGOR_SAY(const Common::Array<DialogueText> &lines);
- void PART_79_SET_IGOR_POS(int x, int y);
- void PART_79_FADE_COLORS(int first, int last, bool fadeInColors);
- void PART_79_FADE_IN_PAIR(int firstColor);
- void PART_79_791();
- void PART_79();
-
void PART_77_EXEC_ACTION(int action);
void PART_77_APPLY_OBJECT_STATE();
void PART_77_SET_AREAS_LIGHT(int lum);
@@ -1329,9 +1287,33 @@ private:
void PART_78_INTERJECTION(int which);
void PART_78();
- void PART_73_DRAW_PATCH(int frame);
- void PART_73_UPDATE_DIALOGUE(int action);
- void PART_73();
+ void PART_79_DRAW_FIGURE(int frame);
+ void PART_79_DRAW_PATCH(int step);
+ void PART_79_CLEAR_PATCH();
+ void PART_79_UPDATE_AMBIENT_790();
+ void PART_79_UPDATE_DIALOGUE_790(int action);
+ void PART_79_SAY_790(const Common::Array<DialogueText> &lines);
+ void PART_79_SLIDE();
+ void PART_79_790();
+ void PART_79_DRAW_GROUP_FRAME(const uint8 *buffer, int table, int base, int frame);
+ void PART_79_DRAW_SCENE(int frame);
+ void PART_79_DRAW_LAYER2_FRAME(int frame);
+ void PART_79_DRAW_LAYER2_FRAME_2(int frame);
+ void PART_79_DRAW_ANIM2_FRAME(const void *group, int frame);
+ void PART_79_ANIMATE_IGOR_HEAD(int frame);
+ void PART_79_UPDATE_DIALOGUE_SPEAKER(int action);
+ void PART_79_UPDATE_DIALOGUE_FIRST_SPEAKER(int action);
+ void PART_79_UPDATE_DIALOGUE_THIRD_SPEAKER(int action);
+ void PART_79_UPDATE_AMBIENT_791();
+ void PART_79_SAY_SPEAKER(int startX, int startY, int x, int y, int r, int g, int b, int endFrame, int baseFrame, const Common::Array<DialogueText> &lines);
+ void PART_79_SAY_FIRST_SPEAKER(int startX, int startY, const Common::Array<DialogueText> &lines);
+ void PART_79_SAY_THIRD_SPEAKER(const Common::Array<DialogueText> &lines);
+ void PART_79_IGOR_SAY(const Common::Array<DialogueText> &lines);
+ void PART_79_SET_IGOR_POS(int x, int y);
+ void PART_79_FADE_COLORS(int first, int last, bool fadeInColors);
+ void PART_79_FADE_IN_PAIR(int firstColor);
+ void PART_79_791();
+ void PART_79();
void PART_80_DRAW_PATCH(int frame);
void PART_80_UPDATE_DIALOGUE_FIRST(int action);
@@ -1339,6 +1321,30 @@ private:
void PART_80_SAY(int who, const Common::Array<DialogueText> &lines);
void PART_80();
+ void PART_81_EXEC_ACTION(int action);
+ void PART_81_LOAD_ROOM();
+ void PART_81_LOAD_ANIMATION();
+ void PART_81_DRAW_HEAD(int frame);
+ void PART_81_DRAW_STORY_HEAD(int frame);
+ void PART_81_DRAW_FIGURE(int offset);
+ void PART_81_DRAW_END_FRAME(int frame);
+ void PART_81_UPDATE_ROOM_BACKGROUND();
+ void PART_81_UPDATE_DIALOGUE_NPC(int action);
+ void PART_81_NPC_SAY(const Common::Array<DialogueText> &lines);
+ void PART_81_IGOR_SAY(int num, int count, int sound);
+ void PART_81_APPLY_OBJECT_STATE(int num);
+ void PART_81_SCROLL_IN();
+ void PART_81_TRANSITION_IN();
+ void PART_81_TRANSITION_OUT();
+ void PART_81_END_SCENE();
+ void PART_81_ACTION_109();
+ void PART_81_ACTION_110();
+ void PART_81_ACTION_102_talk();
+ void PART_81_DIALOGUE_CODE(int code);
+ void PART_81_CONVERSATION();
+ void PART_81_ENTER();
+ void PART_81();
+
// maze
static const MazeNode MAZE_NODES[108];
static const MazeRoom *getMazeRoom(int part);
@@ -1359,7 +1365,7 @@ private:
void UPDATE_OBJECT_STATE(int num);
void PART_UPDATE_FIGURES_ON_PAPER(int delay);
- void PART_MEANWHILE(int img = IMG_Meanwhile);
+ void PART_meanwhile(int img = IMG_Meanwhile);
// Margaret cutscenes
void PART_MARGARET_ROOM_CUTSCENE_HELPER_1();
@@ -1367,11 +1373,6 @@ private:
void PART_MARGARET_ROOM_CUTSCENE_UPDATE_DIALOGUE_MARGARET(int action);
void PART_MARGARET_ROOM_CUTSCENE();
- // philip vodka cutscene
- void PART_75_UPDATE_DIALOGUE_PHILIP(int action);
- void PART_75_HELPER_1(int frame);
- void PART_75();
-
// Intro
void PART_85();
void PART_85_HELPER_1_PLAY_ANIM(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index c0873eb4ad0..1ddfdd699c3 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -686,7 +686,7 @@ void IgorEngine::PART_MAIN() {
PART_72();
break;
case 730:
- PART_73(); // Cutscene followed by PART_80
+ PART_73_CUTSCENE(); // Cutscene followed by PART_80
break;
case 740:
PART_74_CUTSCENE();
@@ -779,7 +779,7 @@ void IgorEngine::PART_MAIN() {
++_gameState.shouldShowCutsceneCounter;
} else {
playMusic(8);
- PART_MEANWHILE();
+ PART_meanwhile();
PART_MARGARET_ROOM_CUTSCENE();
_gameState.shouldShowCutsceneCounter = 0;
}
@@ -878,7 +878,7 @@ void IgorEngine::PART_UPDATE_FIGURES_ON_PAPER(int delay) {
free(framesOffsets);
}
-void IgorEngine::PART_MEANWHILE(int img) {
+void IgorEngine::PART_meanwhile(int img) {
hideCursor();
memset(_currentPalette, 0, 768);
setPaletteRange(208, 255);
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 14ec730ea48..2ff4f5e4399 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -22,45 +22,40 @@
namespace Igor {
-// A character stands on the right of the room. His head is a 33x43 picture drawn at (263,88); the frames follow
-// the first part of the animation resource.
-static const int kPart68NpcOffset = 88 * 320 + 263;
-static const int kPart68NpcWidth = 33;
-static const int kPart68NpcHeight = 43;
-static const int kPart68NpcFramesOffset = 2516;
-static const int kPart68NpcFrameSize = kPart68NpcWidth * kPart68NpcHeight;
-static const int kPart68NpcStanding = 4;
-static const int kPart68NpcFacing = 3;
-
-// A small picture (39x14, four frames) at (39,31) blinks from time to time.
-static const int kPart68AmbientOffset = 31 * 320 + 39;
-static const int kPart68AmbientWidth = 39;
-static const int kPart68AmbientHeight = 14;
-static const int kPart68AmbientFramesOffset = 0x3BB7;
-
-// The object in the room (9x12, two frames) at (179,92).
-static const int kPart68ObjectOffset = 92 * 320 + 179;
-static const int kPart68ObjectWidth = 9;
-static const int kPart68ObjectHeight = 12;
-
-// The picture of the exchange (23x50, two frames) at (170,83).
+static const int kPart68NBorisOffset = 88 * 320 + 263;
+static const int kPart68BorisWidth = 33;
+static const int kPart68BorisHeight = 43;
+static const int kPart68BorisFramesOffset = 2516;
+static const int kPart68BorisFrameSize = kPart68BorisWidth * kPart68BorisHeight;
+static const int kPart68BorisStanding = 4;
+static const int kPart68BorisFacing = 3;
+
+
+static const int kPart68OwlsEyesOffset = 31 * 320 + 39;
+static const int kPart68OwlsEyesWidth = 39;
+static const int kPart68OwlsEyesHeight = 14;
+static const int kPart68OwlsEyesFramesOffset = 0x3BB7;
+
+static const int kPart68VaseOffset = 92 * 320 + 179;
+static const int kPart68VaseWidth = 9;
+static const int kPart68VaseHeight = 12;
+
+// The picture of the exchange
static const int kPart68PoseOffset = 83 * 320 + 170;
static const int kPart68PoseWidth = 23;
static const int kPart68PoseHeight = 50;
static const int kPart68PoseFramesOffset = 0xD8;
-// The picture of the object that is given (52x30, four frames) at (244,86).
-static const int kPart68GiveOffset = 86 * 320 + 244;
+static const int kPart68GiveAnimOffset = 86 * 320 + 244;
static const int kPart68GiveWidth = 52;
static const int kPart68GiveHeight = 30;
static const int kPart68GiveFramesOffset = 0x443F;
static const int kPart68GiveFrameSize = kPart68GiveWidth * kPart68GiveHeight;
-// Sprites played when the character leaves: frame table at offset 0x140E of the block starting at 0x5C9F.
static const int kPart68LeaveBase = 0x5C9F;
static const int kPart68LeaveTable = 0x140E;
-// Where the character's lines are shown.
+// Where Boris' lines are shown.
static const int kPart68TextX = 282;
static const int kPart68TextY = 85;
static const int kPart68TextR = 63;
@@ -73,7 +68,7 @@ static const int kPart68VaseTaken = 91;
static const int kPart68UndertakerLeft = 92;
static const int kPart68RecordsGiven = 93;
static const int kPart68BorisIntroduced = 94;
-static const int kPart68FlagState = 104;
+static const int kPart68MessageSent = 104;
// Inventory objects.
static const int kVaseInventoryNumber = 34;
@@ -88,18 +83,18 @@ void IgorEngine::PART_68_LOAD_ROOM() {
}
void IgorEngine::PART_68_drawUndertaker(int frame) {
- drawAnimRect(kPart68NpcOffset, kPart68NpcFramesOffset + frame * kPart68NpcFrameSize, kPart68NpcWidth, kPart68NpcHeight,
+ drawAnimRect(kPart68NBorisOffset, kPart68BorisFramesOffset + frame * kPart68BorisFrameSize, kPart68BorisWidth, kPart68BorisHeight,
true, kBlendBehindIgorAndText);
}
void IgorEngine::PART_68_DRAW_AMBIENT(int frame) {
- drawAnimRect(kPart68AmbientOffset, kPart68AmbientFramesOffset + frame * kPart68AmbientWidth * kPart68AmbientHeight,
- kPart68AmbientWidth, kPart68AmbientHeight);
+ drawAnimRect(kPart68OwlsEyesOffset, kPart68OwlsEyesFramesOffset + frame * kPart68OwlsEyesWidth * kPart68OwlsEyesHeight,
+ kPart68OwlsEyesWidth, kPart68OwlsEyesHeight);
}
void IgorEngine::PART_68_drawVase(int frame) {
- copyArea(_screenLayer1, kPart68ObjectOffset, 320, _animFramesBuffer + frame * kPart68ObjectWidth * kPart68ObjectHeight,
- kPart68ObjectWidth, kPart68ObjectWidth, kPart68ObjectHeight);
+ copyArea(_screenLayer1, kPart68VaseOffset, 320, _animFramesBuffer + frame * kPart68VaseWidth * kPart68VaseHeight,
+ kPart68VaseWidth, kPart68VaseWidth, kPart68VaseHeight);
}
void IgorEngine::PART_68_drawPose(int frame) {
@@ -181,10 +176,10 @@ void IgorEngine::PART_68_BorisSayReplies(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PART_68_drawUndertaker(kPart68NpcStanding);
+ PART_68_drawUndertaker(kPart68BorisStanding);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_68_drawUndertaker(kPart68NpcStanding + getRandomNumber(4));
+ PART_68_drawUndertaker(kPart68BorisStanding + getRandomNumber(4));
break;
}
}
@@ -272,7 +267,7 @@ void IgorEngine::PART_68_ACTION_102_takeVase() {
// will only let us take the vase if the records have been given to him
if (_objectsState[kPart68RecordsGiven] == 0) {
PART_68_drawPose(0);
- PART_68_drawUndertaker(kPart68NpcFacing);
+ PART_68_drawUndertaker(kPart68BorisFacing);
waitForTimer(30);
PART_68_sayBoris({ { 202, 1, 1008 }, { 203, 1, 1009 }, { 204, 1, 1010 }, { 205, 1, 1011 } });
PART_68_drawPose(1);
@@ -285,7 +280,7 @@ void IgorEngine::PART_68_ACTION_102_takeVase() {
_walkDataCurrentIndex = _walkDataLastIndex;
igorSayAndWait({ { 206, 1, 1012 }, { 207, 1, 1013 } });
PART_68_sayBoris({ { 208, 1, 1014 }, { 209, 1, 1015 }, { 210, 1, 1016 }, { 211, 1, 1017 } });
- PART_68_drawUndertaker(kPart68NpcFacing);
+ PART_68_drawUndertaker(kPart68BorisFacing);
waitForTimer(30);
return;
}
@@ -302,9 +297,9 @@ void IgorEngine::PART_68_ACTION_102_takeVase() {
* Igor gives the object to the character.
*/
void IgorEngine::PART_68_ACTION_108_giveRecordsToBoris() {
- PART_68_drawUndertaker(kPart68NpcFacing);
+ PART_68_drawUndertaker(kPart68BorisFacing);
waitForTimer(30);
- drawAnimRect(kPart68GiveOffset, kPart68GiveFramesOffset, kPart68GiveWidth, kPart68GiveHeight);
+ drawAnimRect(kPart68GiveAnimOffset, kPart68GiveFramesOffset, kPart68GiveWidth, kPart68GiveHeight);
if (_inventoryInfo[kPart68GiveInventoryIndex] != 0) {
removeInventoryEntry(kPart68GiveInventoryIndex);
drawInventory(_inventoryInfo[72], 0);
@@ -313,11 +308,11 @@ void IgorEngine::PART_68_ACTION_108_giveRecordsToBoris() {
igorSayAndWait(214, 1, 1019);
PART_68_sayBoris({ { 215, 1, 1020 }, { 216, 1, 1021 }, { 217, 1, 1022 }, { 218, 1, 1023 } });
for (int frame = 1; frame <= 3; ++frame) {
- drawAnimRect(kPart68GiveOffset, kPart68GiveFramesOffset + frame * kPart68GiveFrameSize, kPart68GiveWidth, kPart68GiveHeight);
+ drawAnimRect(kPart68GiveAnimOffset, kPart68GiveFramesOffset + frame * kPart68GiveFrameSize, kPart68GiveWidth, kPart68GiveHeight);
waitForTimer(40);
}
PART_68_sayBoris({ { 219, 1, 1024 }, { 220, 1, 1025 }, { 221, 1, 1026 }, { 222, 1, 1027 } });
- PART_68_drawUndertaker(kPart68NpcFacing);
+ PART_68_drawUndertaker(kPart68BorisFacing);
waitForTimer(30);
_objectsState[kPart68RecordsGiven] = 1;
PART_68_APPLY_OBJECT_STATE(255);
@@ -329,7 +324,7 @@ void IgorEngine::PART_68_ACTION_108_giveRecordsToBoris() {
void IgorEngine::PART_68_chooseRandomNames(int code) {
uint8 *data = _gameState.dialogueData;
if (code == 10) {
- const int entries = _objectsState[kPart68FlagState] == 1 ? 4 : 5;
+ const int entries = _objectsState[kPart68MessageSent] == 1 ? 4 : 5;
for (int i = 1; i <= entries; ++i) {
data[27 + 6 * i] = _part68QuestionCounter;
++_part68QuestionCounter;
@@ -337,7 +332,7 @@ void IgorEngine::PART_68_chooseRandomNames(int code) {
_part68QuestionCounter = 1;
}
}
- if (_objectsState[kPart68FlagState] == 1) {
+ if (_objectsState[kPart68MessageSent] == 1) {
data[57] = 20;
data[58] = 55;
data[56] = 0;
@@ -368,7 +363,7 @@ void IgorEngine::PART_68_CONVERSATION() {
_updateDialogue = &IgorEngine::PART_68_BorisSayReplies;
loadDialogueData(DLG_Part68);
_part68QuestionCounter = 1;
- PART_68_drawUndertaker(kPart68NpcStanding);
+ PART_68_drawUndertaker(kPart68BorisStanding);
memset(_screenVGA + 46080, 0, 17920);
_gameState.dialogueStarted = true;
@@ -391,7 +386,7 @@ void IgorEngine::PART_68_CONVERSATION() {
bool done = false;
do {
drawDialogueChoices();
- PART_68_drawUndertaker(kPart68NpcStanding);
+ PART_68_drawUndertaker(kPart68BorisStanding);
const int choice = selectDialogue();
if (choice == 0) {
break;
diff --git a/engines/igor/parts/part_70.cpp b/engines/igor/parts/part_70.cpp
index 3cff45266f4..58ef8b7b3c0 100644
--- a/engines/igor/parts/part_70.cpp
+++ b/engines/igor/parts/part_70.cpp
@@ -22,14 +22,13 @@
namespace Igor {
-// The object that changes with the story is a 55x39 picture in the top right corner of the room; the
-// animation resource holds its two versions one after the other.
-static const int kPart70ObjectOffset = 6 * 320 + 265;
-static const int kPart70ObjectWidth = 55;
-static const int kPart70ObjectHeight = 39;
-static const int kPart70ObjectStateIndex = 104;
-// Where Igor goes to from each of the four exits of the room.
+static const int kPart70BoatOffset = 6 * 320 + 265;
+static const int kPart70BoatWidth = 55;
+static const int kPart70BoatHeight = 39;
+
+static const int kPart70MessageSent = 104;
+
static const int kPart70ExitStates[4] = { 501, 720, 680, 810 };
void IgorEngine::PART_70_EXEC_ACTION(int action) {
@@ -47,17 +46,17 @@ void IgorEngine::PART_70_EXEC_ACTION(int action) {
}
/**
- * Draws the version of the object that matches the story into the room picture.
+ * Draws the boat if we havent sent the message yet
*/
void IgorEngine::PART_70_DRAW_OBJECT_STATE() {
- const int frameSize = kPart70ObjectWidth * kPart70ObjectHeight;
- const int frame = _objectsState[kPart70ObjectStateIndex] == 0 ? 0 : 1;
- copyArea(_screenLayer1, kPart70ObjectOffset, 320, _animFramesBuffer + frame * frameSize, kPart70ObjectWidth,
- kPart70ObjectWidth, kPart70ObjectHeight);
+ const int frameSize = kPart70BoatWidth * kPart70BoatHeight;
+ const int frame = _objectsState[kPart70MessageSent] == 0 ? 0 : 1;
+ copyArea(_screenLayer1, kPart70BoatOffset, 320, _animFramesBuffer + frame * frameSize, kPart70BoatWidth,
+ kPart70BoatWidth, kPart70BoatHeight);
}
/**
- * The colors 192 to 207 rotate by one step every half cycle of the room.
+ * The colors 192 to 207 rotate for the water animation.
*/
void IgorEngine::PART_70_UPDATE_ROOM_BACKGROUND() {
if (compareGameTick(3, 32)) {
@@ -81,7 +80,7 @@ void IgorEngine::PART_70() {
PART_70_DRAW_OBJECT_STATE();
memcpy(_screenVGA, _screenLayer1, 46080);
- // Igor is not shown in this room
+ // Igor is not shown in the map
if (!restoreRoomAfterLoad(false)) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
@@ -96,7 +95,7 @@ void IgorEngine::PART_70() {
while (_currentPart == 700 && !_gameStateLoaded) {
runPartLoop();
}
- // the rotated colors are kept
+
memcpy(_paletteBuffer, _currentPalette, 624);
leavePartLoop();
if (!_gameStateLoaded)
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
index cc3540ce787..10e2b7de67d 100644
--- a/engines/igor/parts/part_72.cpp
+++ b/engines/igor/parts/part_72.cpp
@@ -22,13 +22,12 @@
namespace Igor {
-// The object that can be taken is drawn in the room picture as a 9x5 patch; the animation resource starts with
-// its two versions and then holds the three frames of the taking animation.
-static const int kPart72ObjectOffset = 84 * 320 + 133;
-static const int kPart72ObjectWidth = 9;
-static const int kPart72ObjectHeight = 5;
+
+static const int kPart72FlowerOffset = 84 * 320 + 133;
+static const int kPart72FlowerWidth = 9;
+static const int kPart72FlowerHeight = 5;
static const int kPart72FlowerTaken = 102;
-static const int kPart72TakeFramesOffset = 2 * kPart72ObjectWidth * kPart72ObjectHeight;
+static const int kPart72TakeFramesOffset = 2 * kPart72FlowerWidth * kPart72FlowerHeight;
static const int kPart72TakeWidth = 35;
static const int kPart72TakeHeight = 49;
static const int kPart72TakeFrameSize = kPart72TakeWidth * kPart72TakeHeight;
@@ -37,7 +36,7 @@ static const int kPart72TakeOffset = 42 * 320 + 133;
// The areas that show the object while it is there.
static const int kPart72ObjectAreas[5] = { 42, 44, 50, 56, 61 };
-// Screen positions of the five stars, each one drawn as two pixels two columns apart.
+// Screen positions of the five blinking eyes, each one drawn as two pixels two columns apart.
static const int kPart72EyeOffsets[5] = { 0x2C06, 0x135B, 0x0FC5, 0x23E7, 0x254D };
static const int kPart72FlowerObjectNumber = 33;
@@ -77,8 +76,8 @@ void IgorEngine::PART_72_EXEC_ACTION(int action) {
void IgorEngine::PART_72_APPLY_OBJECT_STATE() {
const int taken = _objectsState[kPart72FlowerTaken] == 0 ? 0 : 1;
- copyArea(_screenLayer1, kPart72ObjectOffset, 320, _animFramesBuffer + taken * kPart72ObjectWidth * kPart72ObjectHeight,
- kPart72ObjectWidth, kPart72ObjectWidth, kPart72ObjectHeight);
+ copyArea(_screenLayer1, kPart72FlowerOffset, 320, _animFramesBuffer + taken * kPart72FlowerWidth * kPart72FlowerHeight,
+ kPart72FlowerWidth, kPart72FlowerWidth, kPart72FlowerHeight);
if (taken) {
for (int i = 0; i < 5; ++i) {
_roomObjectAreasTable[kPart72ObjectAreas[i]].object = 0;
@@ -200,7 +199,7 @@ void IgorEngine::PART_72() {
darkenPalette(_paletteBuffer, 1, 175, 10);
darkenPalette(_paletteBuffer, 192, 207, 15);
- paintBlinkingEyes();
+ PART_72_paintBlinkingEyes();
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
@@ -222,7 +221,7 @@ void IgorEngine::PART_72() {
fadeOut(624);
}
-void IgorEngine::paintBlinkingEyes() {
+void IgorEngine::PART_72_paintBlinkingEyes() {
for (int i = 0; i < 5; ++i) {
const int pos = kPart72EyeOffsets[i];
_screenVGA[pos] = 0xB3;
diff --git a/engines/igor/parts/part_73.cpp b/engines/igor/parts/part_73.cpp
index 2ba9478e092..15ac57a37f3 100644
--- a/engines/igor/parts/part_73.cpp
+++ b/engines/igor/parts/part_73.cpp
@@ -22,37 +22,32 @@
namespace Igor {
-// A 26x52 area of the picture is redrawn from the animation resource, whose frames are 26x53 each.
-static const int kPart73PatchOffset = 55 * 320 + 157;
-static const int kPart73PatchWidth = 26;
-static const int kPart73PatchHeight = 52;
-static const int kPart73PatchFrameSize = 26 * 53;
+static const int kPart73PolicemanOffset = 55 * 320 + 157;
+static const int kPart73PolicemanWidth = 26;
+static const int kPart73PolicemanHeight = 52;
+static const int kPart73PolicemanFrameSize = 26 * 53;
-// Where the lines of the person of the picture are shown.
-static const int kPart73TextX = 170;
-static const int kPart73TextY = 50;
-
-// The object that goes to the end of the inventory while the scene lasts.
+// Great dosicua
static const int kPart73InventoryObject = 25;
static const int kPart73InventoryIndex = 60;
-void IgorEngine::PART_73_DRAW_PATCH(int frame) {
- copyArea(_screenVGA, kPart73PatchOffset, 320, _animFramesBuffer + (frame - 1) * kPart73PatchFrameSize + kPart73PatchWidth,
- kPart73PatchWidth, kPart73PatchWidth, kPart73PatchHeight);
+void IgorEngine::PART_73_drawPoliceman(int frame) {
+ copyArea(_screenVGA, kPart73PolicemanOffset, 320, _animFramesBuffer + (frame - 1) * kPart73PolicemanFrameSize + kPart73PolicemanWidth,
+ kPart73PolicemanWidth, kPart73PolicemanWidth, kPart73PolicemanHeight);
}
void IgorEngine::PART_73_UPDATE_DIALOGUE(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_73_DRAW_PATCH(1);
+ PART_73_drawPoliceman(1);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_73_DRAW_PATCH(getRandomNumber(4) + 1);
+ PART_73_drawPoliceman(getRandomNumber(4) + 1);
break;
}
}
-void IgorEngine::PART_73() {
+void IgorEngine::PART_73_CUTSCENE() {
playMusic(8);
_gameState.enableLight = 1;
loadRoomData(PAL_Part73, IMG_Part73, BOX_Part73, MSK_Part73, TXT_Part73);
@@ -62,7 +57,7 @@ void IgorEngine::PART_73() {
loadAnimData(anim);
memcpy(_screenVGA, _screenLayer1, 46080);
memset(_screenVGA + 46080, 0, 17920);
- PART_73_DRAW_PATCH(1);
+ PART_73_drawPoliceman(1);
WalkData *wd = &_walkData[0];
wd->setPos(195, 107, 4, 0);
wd->clipSkipX = 1;
@@ -79,10 +74,9 @@ void IgorEngine::PART_73() {
fadeIn(768);
_gameState.igorMoving = false;
- cutsceneSayWithCallback(kPart73TextX, kPart73TextY, 63, 14, 19, { { 201, 2, 928 } }, &IgorEngine::PART_73_UPDATE_DIALOGUE);
+ cutsceneSayWithCallback(170, 50, 63, 14, 19, { { 201, 2, 928 } }, &IgorEngine::PART_73_UPDATE_DIALOGUE);
igorSayAndWait({ { 203, 1, 929 }, { 204, 2, 930 } });
- cutsceneSayWithCallback(kPart73TextX, kPart73TextY, 63, 14, 19, { { 206, 2, 931 }, { 208, 2, 932 } },
- &IgorEngine::PART_73_UPDATE_DIALOGUE);
+ cutsceneSayWithCallback(170, 50, 63, 14, 19, { { 206, 2, 931 }, { 208, 2, 932 } }, &IgorEngine::PART_73_UPDATE_DIALOGUE);
igorSayAndWait({ { 210, 1, 933 }, { 211, 1, 934 } });
--_walkDataLastIndex;
@@ -93,7 +87,7 @@ void IgorEngine::PART_73() {
_objectsState[7] = 1;
UPDATE_OBJECT_STATE(8);
- // the object is taken out of the inventory and put at its end
+ // removes the great dosicua
removeInventoryEntry(kPart73InventoryIndex);
++_inventoryInfo[73];
_inventoryInfo[_inventoryInfo[73] - 1] = kPart73InventoryObject;
@@ -102,7 +96,8 @@ void IgorEngine::PART_73() {
fadeOut(624);
// the card with the time that has passed
- PART_MEANWHILE(IMG_Part73Card);
+ PART_meanwhile(IMG_Part73Card);
+ // loads part80 now
PART_80();
setupDefaultPalette();
diff --git a/engines/igor/parts/part_74.cpp b/engines/igor/parts/part_74.cpp
index da39c9d1e4b..87e2b659ace 100644
--- a/engines/igor/parts/part_74.cpp
+++ b/engines/igor/parts/part_74.cpp
@@ -22,30 +22,25 @@
namespace Igor {
-// The frames of the two characters follow the animation of the room, from this offset on; the table of
-// frame offsets is after the frames.
static const int kPart74FramesBase = 0xC318;
static const int kPart74FramesTable = 0x15BE;
-// Frames of the first character (left): the last is the standing one, four more are used while speaking.
-static const int kPart74FirstStanding = 13;
-static const int kPart74FirstTalking = 13;
-// Frames of the second character (right): 3..7 speaking with the first expression and 8..12 with the second.
-static const int kPart74SecondStandingA = 3;
-static const int kPart74SecondStandingB = 8;
+// Frames of the sailor: the last is the standing one, four more are used while speaking.
+static const int kPart74SailorStanding = 13;
+static const int kPart74SailorTalking = 13;
+// Frames of the captain: 3..7 speaking with the first expression and 8..12 with the second.
+static const int kPart74CaptainStandingA = 3;
+static const int kPart74CaptainStandingB = 8;
// Where the lines are shown: x, y and color of the first (blue) and of the second (violet) character.
-static const int kPart74FirstX = 141;
-static const int kPart74FirstY = 55;
-static const int kPart74SecondX = 247;
-static const int kPart74SecondY = 38;
+static const int kPart74SailorX = 141;
+static const int kPart74SailorY = 55;
+static const int kPart74CaptainX = 247;
+static const int kPart74CaptainY = 38;
// Length in timer ticks of the part of the scene that only turns the colors.
static const int kPart74ColorsTicks = 750;
-/**
- * The colors 192 to 207 rotate while the scene is on.
- */
void IgorEngine::PART_74_CYCLE_COLORS() {
if (compareGameTick(3, 32)) {
scrollPalette(192, 207);
@@ -53,65 +48,65 @@ void IgorEngine::PART_74_CYCLE_COLORS() {
}
}
-void IgorEngine::PART_74_DRAW_FRAME(int frame) {
+void IgorEngine::PART_74_drawCharacterFrame(int frame) {
decodeAnimFrame(getAnimFrame(kPart74FramesBase, kPart74FramesTable, frame), _screenVGA, true);
}
-void IgorEngine::PART_74_UPDATE_DIALOGUE_FIRST(int action) {
+void IgorEngine::PART_74_UPDATE_DIALOGUE_Sailor(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PART_74_DRAW_FRAME(kPart74FirstStanding);
+ PART_74_drawCharacterFrame(kPart74SailorStanding);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_74_DRAW_FRAME(kPart74FirstTalking + getRandomNumber(3));
+ PART_74_drawCharacterFrame(kPart74SailorTalking + getRandomNumber(3));
break;
}
}
-void IgorEngine::PART_74_UPDATE_DIALOGUE_SECOND_A(int action) {
+void IgorEngine::PART_74_UPDATE_DIALOGUE_CaptainA(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PART_74_DRAW_FRAME(kPart74SecondStandingA);
+ PART_74_drawCharacterFrame(kPart74CaptainStandingA);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_74_DRAW_FRAME(kPart74SecondStandingA + getRandomNumber(4));
+ PART_74_drawCharacterFrame(kPart74CaptainStandingA + getRandomNumber(4));
break;
}
}
-void IgorEngine::PART_74_UPDATE_DIALOGUE_SECOND_B(int action) {
+void IgorEngine::PART_74_UPDATE_DIALOGUE_CaptainB(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PART_74_DRAW_FRAME(kPart74SecondStandingB);
+ PART_74_drawCharacterFrame(kPart74CaptainStandingB);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_74_DRAW_FRAME(kPart74SecondStandingB + getRandomNumber(4));
+ PART_74_drawCharacterFrame(kPart74CaptainStandingB + getRandomNumber(4));
break;
}
}
/**
- * One line of the scene, said by the first character (blue) or by the second (violet).
+ * One line of the scene, said by the first character (sailor) or by the second (captain).
*/
void IgorEngine::PART_74_SAY(int who, const Common::Array<DialogueText> &lines) {
switch (who) {
case 0:
- cutsceneSayWithCallback(kPart74FirstX, kPart74FirstY, 0, 50, 63, lines, &IgorEngine::PART_74_UPDATE_DIALOGUE_FIRST);
+ cutsceneSayWithCallback(kPart74SailorX, kPart74SailorY, 0, 50, 63, lines, &IgorEngine::PART_74_UPDATE_DIALOGUE_Sailor);
break;
case 1:
- cutsceneSayWithCallback(kPart74SecondX, kPart74SecondY, 63, 32, 63, lines, &IgorEngine::PART_74_UPDATE_DIALOGUE_SECOND_B);
+ cutsceneSayWithCallback(kPart74CaptainX, kPart74CaptainY, 63, 32, 63, lines, &IgorEngine::PART_74_UPDATE_DIALOGUE_CaptainB);
break;
default:
- cutsceneSayWithCallback(kPart74SecondX, kPart74SecondY, 63, 32, 63, lines, &IgorEngine::PART_74_UPDATE_DIALOGUE_SECOND_A);
+ cutsceneSayWithCallback(kPart74CaptainX, kPart74CaptainY, 63, 32, 63, lines, &IgorEngine::PART_74_UPDATE_DIALOGUE_CaptainA);
break;
}
}
/**
- * Scene with two characters over a picture whose colors rotate. It is part of the story of state 810.
+ * Boat scene
*/
void IgorEngine::PART_74_CUTSCENE() {
UpdateRoomBackgroundProc previousBackground = _updateRoomBackground;
@@ -134,7 +129,7 @@ void IgorEngine::PART_74_CUTSCENE() {
_gameState.igorMoving = false;
_updateRoomBackground = &IgorEngine::PART_74_CYCLE_COLORS;
- // the sound plays while the colors turn
+ // water sound
playSound(43, 1);
do {
PART_74_CYCLE_COLORS();
@@ -142,27 +137,27 @@ void IgorEngine::PART_74_CUTSCENE() {
} while (_mixer->isSoundHandleActive(_sfxHandle) || isDialogueSpeechPlaying());
PART_74_SAY(0, { { 201, 1, 935 }, { 202, 1, 936 } });
- PART_74_DRAW_FRAME(8);
+ PART_74_drawCharacterFrame(8);
PART_74_SAY(1, { { 203, 1, 937 } });
- PART_74_DRAW_FRAME(3);
+ PART_74_drawCharacterFrame(3);
PART_74_SAY(2, { { 204, 1, 938 } });
- PART_74_DRAW_FRAME(1);
+ PART_74_drawCharacterFrame(1);
for (int ticks = 0; ticks < kPart74ColorsTicks; ticks += kTimerTicksCount) {
PART_74_CYCLE_COLORS();
waitForTimer();
}
- PART_74_DRAW_FRAME(2);
+ PART_74_drawCharacterFrame(2);
PART_74_SAY(0, { { 205, 1, 939 } });
- PART_74_DRAW_FRAME(8);
+ PART_74_drawCharacterFrame(8);
PART_74_SAY(1, { { 206, 1, 940 } });
- PART_74_DRAW_FRAME(3);
+ PART_74_drawCharacterFrame(3);
PART_74_SAY(2, { { 207, 1, 941 } });
PART_74_SAY(0, { { 208, 1, 942 } });
- PART_74_DRAW_FRAME(8);
+ PART_74_drawCharacterFrame(8);
PART_74_SAY(1, { { 209, 1, 943 } });
- PART_74_DRAW_FRAME(3);
+ PART_74_drawCharacterFrame(3);
PART_74_SAY(2, { { 210, 1, 944 } });
// the colors of the room come back and the picture of the room is shown from its top
diff --git a/engines/igor/parts/part_75.cpp b/engines/igor/parts/part_75.cpp
index 2c96bcb27d3..49ed79d0177 100644
--- a/engines/igor/parts/part_75.cpp
+++ b/engines/igor/parts/part_75.cpp
@@ -35,25 +35,23 @@ static const uint8 PART_75_ANIM_DATA_2[37] = {
void IgorEngine::PART_75_UPDATE_DIALOGUE_PHILIP(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_75_HELPER_1(2);
+ PART_75_HELPER_drawPhilipFrame(2);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_75_HELPER_1(getRandomNumber(4) + 2);
+ PART_75_HELPER_drawPhilipFrame(getRandomNumber(4) + 2);
break;
}
}
-void IgorEngine::PART_75_HELPER_1(int frame) {
+void IgorEngine::PART_75_HELPER_drawPhilipFrame(int frame) {
const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x5E6D + frame * 2) - 1;
decodeAnimFrame(src, _screenVGA);
}
void IgorEngine::PART_75() {
playMusic(8);
- PART_MEANWHILE();
+ PART_meanwhile();
_gameState.enableLight = 1;
- // this cutscene draws its dialogue text with the last palette entry and index 0 for
- // the outline, since Philip's sprites use the entries the regular text would recolor
_talkColorIndex = 255;
_talkShadowIndex = 0;
loadRoomData(PAL_PhilipRoom, IMG_PhilipRoom, BOX_PhilipRoom, MSK_PhilipRoom, TXT_PhilipRoom);
@@ -61,37 +59,37 @@ void IgorEngine::PART_75() {
loadAnimData(anm);
memcpy(_screenVGA, _screenLayer1, 46080);
_updateDialogue = &IgorEngine::PART_75_UPDATE_DIALOGUE_PHILIP;
- PART_75_HELPER_1(1);
- PART_75_HELPER_1(7);
+ PART_75_HELPER_drawPhilipFrame(1);
+ PART_75_HELPER_drawPhilipFrame(7);
memset(_currentPalette, 0, 768);
fadeIn(768);
_gameState.igorMoving = false;
cutsceneSay(187, 82, 63, 63, 0, { { 201, 1, 1156 }, { 202, 2, 1157 }, { 204, 1, 1158 } });
for (int i = 1; i <= 17; ++i) {
- PART_75_HELPER_1(PART_75_ANIM_DATA_1[i]);
+ PART_75_HELPER_drawPhilipFrame(PART_75_ANIM_DATA_1[i]);
waitForTimer(30);
}
cutsceneSay(187, 82, 63, 63, 0, { { 205, 1, 1159 }, { 206, 1, 1160 } });
for (int i = 17; i <= 30; ++i) {
- PART_75_HELPER_1(i);
+ PART_75_HELPER_drawPhilipFrame(i);
waitForTimer(15);
}
cutsceneSayStart(187, 82, 63, 63, 0, 208, 1);
playSound(62, 1);
for (int i = 1; i <= 36; ++i) {
- PART_75_HELPER_1(PART_75_ANIM_DATA_2[i]);
+ PART_75_HELPER_drawPhilipFrame(PART_75_ANIM_DATA_2[i]);
waitForTimer(15);
}
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
cutsceneSayStart(187, 82, 63, 63, 0, 209, 1);
- PART_75_HELPER_1(35);
+ PART_75_HELPER_drawPhilipFrame(35);
waitForTimer(255);
- PART_75_HELPER_1(36);
+ PART_75_HELPER_drawPhilipFrame(36);
waitForTimer(140);
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
cutsceneSayStart(187, 82, 63, 63, 0, 210, 1);
for (int i = 1; i <= 40; ++i) {
- PART_75_HELPER_1(getRandomNumber(3) + 37);
+ PART_75_HELPER_drawPhilipFrame(getRandomNumber(3) + 37);
waitForTimer(30);
}
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
diff --git a/engines/igor/parts/part_76.cpp b/engines/igor/parts/part_76.cpp
index c9b81b40c9e..c85decf2105 100644
--- a/engines/igor/parts/part_76.cpp
+++ b/engines/igor/parts/part_76.cpp
@@ -22,57 +22,47 @@
namespace Igor {
-// The animation resource: two 7x6 pieces and two 68x54 pieces of the room picture first, then the sprite strips and
-// the full screen frames, each group followed by the table of its frame offsets.
-static const int kPart76SmallPieceWidth = 7;
-static const int kPart76SmallPieceHeight = 6;
-static const int kPart76SmallPieceSize = kPart76SmallPieceWidth * kPart76SmallPieceHeight;
-static const int kPart76SmallPieceOffset = 83 * 320 + 300;
+static const int kPart76ParachuteWidth = 7;
+static const int kPart76ParachuteHeight = 6;
+static const int kPart76ParachuteSize = kPart76ParachuteWidth * kPart76ParachuteHeight;
+static const int kPart76ParachuteOffset = 83 * 320 + 300;
-static const int kPart76BigPieceWidth = 68;
-static const int kPart76BigPieceHeight = 54;
-static const int kPart76BigPieceSize = kPart76BigPieceWidth * kPart76BigPieceHeight;
-static const int kPart76BigPieceFirst = 0x54;
-static const int kPart76BigPieceOffset = 27 * 320 + 188;
+static const int kPart76PlaneDoorWidth = 68;
+static const int kPart76PlaneDoorHeight = 54;
+static const int kPart76PlaneDoorSize = kPart76PlaneDoorWidth * kPart76PlaneDoorHeight;
+static const int kPart76PlaneDoorFirst = 0x54;
+static const int kPart76PlaneDoorOffset = 27 * 320 + 188;
-// Frames of the first sequence: the group starts at 0x2902 and its table of offsets follows the frames.
-static const int kPart76SequenceBase = 0x2902;
-static const int kPart76SequenceTable = 0x1753;
+static const int kPart76OpenDoorAnimBase = 0x2902;
+static const int kPart76OpenDoorAnimTable = 0x1753;
-// Frames of the full screen scenes: the group starts at 0x4067 and its table of offsets follows the frames.
-static const int kPart76SceneBase = 0x4067;
-static const int kPart76SceneTable = 0x3ABB;
+static const int kPart76ParachuteAnimBase = 0x4067;
+static const int kPart76ParachuteAnimTable = 0x3ABB;
-// A 17x16 sprite drawn at (289,81), three frames of 272 bytes.
-static const int kPart76LampOffset = 81 * 320 + 289;
-static const int kPart76LampWidth = 17;
-static const int kPart76LampHeight = 16;
-static const int kPart76LampFrames = 0x1BF4;
-static const int kPart76LampFrameSize = kPart76LampWidth * kPart76LampHeight;
+static const int kPart76TakeParachuteOffset = 81 * 320 + 289;
+static const int kPart76TakeParachuteWidth = 17;
+static const int kPart76TakeParachuteHeight = 16;
+static const int kPart76TakeParachuteFrames = 0x1BF4;
+static const int kPart76TakeParachuteFrameSize = kPart76TakeParachuteWidth * kPart76TakeParachuteHeight;
-// A 23x49 sprite drawn at (285,71), frames of 1127 bytes.
static const int kPart76SpriteOffset = 71 * 320 + 285;
static const int kPart76SpriteWidth = 23;
static const int kPart76SpriteHeight = 49;
static const int kPart76SpriteFrames = 0x1BCD;
static const int kPart76SpriteFrameSize = kPart76SpriteWidth * kPart76SpriteHeight;
-// Order in which the frames of the first sequence are shown before the closing frames 4 to 9.
-static const uint8 kPart76SequenceFrames[5] = { 1, 2, 3, 2, 3 };
+static const uint8 kPart76DoorFrames[5] = { 1, 2, 3, 2, 3 };
-// Order of the sprite frames of the third action.
static const uint8 kPart76SpriteOrder[3] = { 1, 2, 1 };
-// Order of the frames of the last part of the third action.
-static const uint8 kPart76EndFrames[20] = { 18, 19, 20, 21, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 24, 25, 26, 27 };
+static const uint8 kPart76ParachuteFrames[20] = { 18, 19, 20, 21, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 22, 23, 24, 25, 26, 27 };
// Point where Igor stops at the end of the walk of the scene and the one he reaches later.
static const int kPart76WalkEndX = 295;
static const int kPart76WalkEndY = 119;
-// Object of the inventory that action 104 puts into it, and the position where the inventory keeps its index.
-static const int kPart76InventoryObject = 3;
-static const int kPart76InventoryObjectIndex = 38;
+static const int kPart76ParachuteInvNumber = 3;
+static const int kPart76ParachuteInventoryIndex = 38;
void IgorEngine::PART_76_EXEC_ACTION(int action) {
if (action != 103) {
@@ -80,28 +70,28 @@ void IgorEngine::PART_76_EXEC_ACTION(int action) {
playMusic(12);
}
switch (action) {
- case 101:
+ case 101: // look at door
igorSay(201, 1, 700);
break;
- case 102:
+ case 102: // look at lever
igorSay(202, 1, 701);
break;
case 103:
- PART_76_ACTION_103_sequence();
+ PART_76_ACTION_103_openDoor();
break;
case 104:
- PART_76_ACTION_104_takeObject();
+ PART_76_ACTION_104_takeParachute();
break;
- case 105:
+ case 105: // look at parachute
igorSay(207, 2, 705);
break;
case 106:
- PART_76_ACTION_106_finale();
+ PART_76_ACTION_106_useParachute();
break;
- case 107:
+ case 107: // look at crate
igorSay(224, 1, 719);
break;
- case 108:
+ case 108: // look at crates
igorSay(225, 1, 720);
break;
default:
@@ -116,54 +106,45 @@ void IgorEngine::PART_76_EXEC_ACTION(int action) {
*/
void IgorEngine::PART_76_APPLY_OBJECT_STATE() {
if (_objectsState[108] == 0) {
- copyArea(_screenLayer1, kPart76BigPieceOffset, 320, _animFramesBuffer + kPart76BigPieceFirst, kPart76BigPieceWidth,
- kPart76BigPieceWidth, kPart76BigPieceHeight);
+ copyArea(_screenLayer1, kPart76PlaneDoorOffset, 320, _animFramesBuffer + kPart76PlaneDoorFirst, kPart76PlaneDoorWidth,
+ kPart76PlaneDoorWidth, kPart76PlaneDoorHeight);
_roomActionsTable[79] = 9;
_roomActionsTable[81] = 14;
} else {
- copyArea(_screenLayer1, kPart76BigPieceOffset, 320,
- _animFramesBuffer + kPart76BigPieceFirst + kPart76BigPieceSize, kPart76BigPieceWidth, kPart76BigPieceWidth,
- kPart76BigPieceHeight);
+ copyArea(_screenLayer1, kPart76PlaneDoorOffset, 320,
+ _animFramesBuffer + kPart76PlaneDoorFirst + kPart76PlaneDoorSize, kPart76PlaneDoorWidth, kPart76PlaneDoorWidth,
+ kPart76PlaneDoorHeight);
_roomObjectAreasTable[10].object = 1;
_roomActionsTable[79] = 11;
_roomActionsTable[81] = 12;
}
if (_objectsState[109] == 0) {
- copyArea(_screenLayer1, kPart76SmallPieceOffset, 320, _animFramesBuffer, kPart76SmallPieceWidth,
- kPart76SmallPieceWidth, kPart76SmallPieceHeight);
+ copyArea(_screenLayer1, kPart76ParachuteOffset, 320, _animFramesBuffer, kPart76ParachuteWidth,
+ kPart76ParachuteWidth, kPart76ParachuteHeight);
} else {
- copyArea(_screenLayer1, kPart76SmallPieceOffset, 320, _animFramesBuffer + kPart76SmallPieceSize,
- kPart76SmallPieceWidth, kPart76SmallPieceWidth, kPart76SmallPieceHeight);
+ copyArea(_screenLayer1, kPart76ParachuteOffset, 320, _animFramesBuffer + kPart76ParachuteSize,
+ kPart76ParachuteWidth, kPart76ParachuteWidth, kPart76ParachuteHeight);
// once the object was taken its areas stop being selectable
_roomObjectAreasTable[11].object = 0;
_roomObjectAreasTable[12].object = 0;
}
}
-/**
- * Frame n of the full screen scenes, drawn on the screen.
- */
-void IgorEngine::PART_76_DRAW_SCENE_FRAME(int frame) {
- decodeAnimFrame(getAnimFrame(kPart76SceneBase, kPart76SceneTable, frame), _screenVGA);
+void IgorEngine::PART_76_drawParachuteFrame(int frame) {
+ decodeAnimFrame(getAnimFrame(kPart76ParachuteAnimBase, kPart76ParachuteAnimTable, frame), _screenVGA);
}
-/**
- * Frame n of the first sequence, drawn on the screen.
- */
-void IgorEngine::PART_76_DRAW_SEQUENCE_FRAME(int frame) {
- decodeAnimFrame(getAnimFrame(kPart76SequenceBase, kPart76SequenceTable, frame), _screenVGA);
+void IgorEngine::PART_76_drawOpenDoorFrame(int frame) {
+ decodeAnimFrame(getAnimFrame(kPart76OpenDoorAnimBase, kPart76OpenDoorAnimTable, frame), _screenVGA);
}
-/**
- * Frames 1 to 5 and then 4 to 9 are drawn on the screen, then the object changes its state.
- */
-void IgorEngine::PART_76_ACTION_103_sequence() {
+void IgorEngine::PART_76_ACTION_103_openDoor() {
for (int i = 0; i < 5; ++i) {
- PART_76_DRAW_SEQUENCE_FRAME(kPart76SequenceFrames[i]);
+ PART_76_drawOpenDoorFrame(kPart76DoorFrames[i]);
waitForTimer(51);
}
for (int frame = 4; frame <= 9; ++frame) {
- PART_76_DRAW_SEQUENCE_FRAME(frame);
+ PART_76_drawOpenDoorFrame(frame);
waitForTimer(31);
}
igorSay(206, 1, 704);
@@ -174,12 +155,12 @@ void IgorEngine::PART_76_ACTION_103_sequence() {
/**
* Three frames of a sprite are drawn on the screen, then object 3 goes into the inventory.
*/
-void IgorEngine::PART_76_ACTION_104_takeObject() {
+void IgorEngine::PART_76_ACTION_104_takeParachute() {
for (int frame = 1; frame <= 3; ++frame) {
- drawAnimRect(kPart76LampOffset, kPart76LampFrames + frame * kPart76LampFrameSize, kPart76LampWidth, kPart76LampHeight);
+ drawAnimRect(kPart76TakeParachuteOffset, kPart76TakeParachuteFrames + frame * kPart76TakeParachuteFrameSize, kPart76TakeParachuteWidth, kPart76TakeParachuteHeight);
waitForTimer(91);
}
- addObjectToInventory(kPart76InventoryObject, kPart76InventoryObjectIndex);
+ addObjectToInventory(kPart76ParachuteInvNumber, kPart76ParachuteInventoryIndex);
_objectsState[109] = 1;
PART_76_APPLY_OBJECT_STATE();
igorSay({ { 203, 1, 702 }, { 204, 2, 703 } });
@@ -190,7 +171,7 @@ void IgorEngine::PART_76_ACTION_104_takeObject() {
* where he is, talks, walks to the right of the picture, the sprite is drawn, he talks again and walks to (190, 85);
* the full screen frames follow and the story goes on in state 790.
*/
-void IgorEngine::PART_76_ACTION_106_finale() {
+void IgorEngine::PART_76_ACTION_106_useParachute() {
if (_objectsState[108] == 0) {
igorSay(209, 1, 706);
return;
@@ -233,10 +214,10 @@ void IgorEngine::PART_76_ACTION_106_finale() {
igorSay({ { 216, 1, 711 }, { 217, 1, 712 }, { 218, 1, 713 }, { 219, 1, 714 } });
waitForEndOfIgorDialogue();
- PART_76_DRAW_SCENE_FRAME(11);
+ PART_76_drawParachuteFrame(11);
waitForTimer(255);
for (int frame = 12; frame <= 17; ++frame) {
- PART_76_DRAW_SCENE_FRAME(frame);
+ PART_76_drawParachuteFrame(frame);
if (frame < 17) {
waitForTimer(3);
}
@@ -244,7 +225,7 @@ void IgorEngine::PART_76_ACTION_106_finale() {
igorSay({ { 220, 1, 715 }, { 221, 1, 716 }, { 222, 1, 717 }, { 223, 1, 718 } });
waitForEndOfIgorDialogue();
for (int i = 0; i < 20; ++i) {
- PART_76_DRAW_SCENE_FRAME(kPart76EndFrames[i]);
+ PART_76_drawParachuteFrame(kPart76ParachuteFrames[i]);
waitForTimer(31);
}
// the colors 240 to 255 are black on the screen
@@ -298,7 +279,7 @@ void IgorEngine::PART_76() {
playMusic(12);
if (!_gameStateLoaded) {
// the card that opens the part
- PART_MEANWHILE(IMG_Part76Card);
+ PART_meanwhile(IMG_Part76Card);
}
_gameState.enableLight = 2;
loadIgorBeachFrames();
diff --git a/engines/igor/parts/part_78.cpp b/engines/igor/parts/part_78.cpp
index 82db5b5a788..7d4c615b5c5 100644
--- a/engines/igor/parts/part_78.cpp
+++ b/engines/igor/parts/part_78.cpp
@@ -209,7 +209,7 @@ void IgorEngine::PART_78_INTERJECTION(int which) {
void IgorEngine::PART_78() {
playMusic(11);
// the card with the time that has passed
- PART_MEANWHILE(IMG_Part78MinutesLater);
+ PART_meanwhile(IMG_Part78MinutesLater);
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
memset(_screenVGA + 46080, 0, 17920);
@@ -302,7 +302,7 @@ void IgorEngine::PART_78() {
_objectsState[111] = 1;
playMusic(2);
// the card with the time that has passed
- PART_MEANWHILE(IMG_Part78NextDay);
+ PART_meanwhile(IMG_Part78NextDay);
_currentPart = 281;
}
Commit: cee9e3e8695c7908bda652e9bb7112f43ece6d69
https://github.com/scummvm/scummvm/commit/cee9e3e8695c7908bda652e9bb7112f43ece6d69
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:51+01:00
Commit Message:
IGOR: Allow exiting scummVM without artifacts
Changed paths:
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 72f5918a416..831df32660d 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -645,6 +645,7 @@ private:
bool isDialogueSpeechPlaying() const;
void stopDialogueSpeech();
+ void cancelDialogue();
void PART_MAIN();
void moveScreenUp(int offset);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index f8b1f3bee3d..16eb817e4c7 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -31,7 +31,7 @@ static const uint8 kSentenceColorIndex[] = {0xFD, 0xFB, 0xF1};
void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
- if (presentScreen) {
+ if (presentScreen && !_eventQuitGame) {
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
if (_debugOverlayMode != kOverlayOff) {
@@ -47,12 +47,13 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
uint32 endTicks = deadline ? deadline : ((ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay / _fastMode);
do {
Common::Event ev;
- while (_eventMan->pollEvent(ev)) {
+ while (!_eventQuitGame && _eventMan->pollEvent(ev)) {
switch (ev.type) {
case Common::EVENT_QUIT:
_inputVars[kInputEscape] = 1;
_currentPart = kInvalidPart;
_eventQuitGame = true;
+ cancelDialogue();
break;
case Common::EVENT_KEYDOWN:
if (ev.kbd.keycode == Common::KEYCODE_f && (ev.kbd.flags & Common::KBD_CTRL)) {
@@ -113,6 +114,10 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
break;
}
}
+ // Keep advancing game ticks so scripted animation loops can finish,
+ // but do not wait or present another frame during shutdown.
+ if (_eventQuitGame)
+ break;
if (_rightButtonSelecting && !(_eventMan->getButtonState() & Common::EventManager::RBUTTON)) {
_inputVars[kInputRightRelease] = 1;
}
@@ -133,7 +138,7 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
_gameTicks += kTimerTicksCount;
// Update cursor mask
- if ((_gameTicks & 31) == 0) {
+ if ((_gameTicks & 31) == 0 && !_eventQuitGame) {
setCursor(_currentCursor);
_currentCursor = (_currentCursor + 1) & 3;
}
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 023773a833a..8f27df9fa83 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -148,6 +148,8 @@ void IgorEngine::fixDialogueTextPosition(int num, int count, int *x, int *y) {
* Paints the text on the screen buffer
*/
void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
+ if (_eventQuitGame)
+ return;
debugC(9, kDebugEngine, "startCutsceneDialogue() pos %d,%d color %d,%d,%d", x, y, r, g, b);
if (_dialogueTextsCount <= 0 || _dialogueTextsStart < 0 || _dialogueTextsStart >= MAX_DIALOGUE_TEXTS) {
warning("startCutsceneDialogue() invalid playback range start %d count %d", _dialogueTextsStart, _dialogueTextsCount);
@@ -278,6 +280,10 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
_gameState.dialogueTextRunning, _dialogueTextsStart, _dialogueTextsCount,
_talkSpeechCounter, _talkDelayCounter, _talkDelay);
do {
+ if (_eventQuitGame) {
+ cancelDialogue();
+ return;
+ }
// stop speech if skip dialogue hit
if (_gameState.dialogueTextRunning && _inputVars[kInputSkipDialogue]) {
stopDialogueSpeech();
@@ -330,8 +336,8 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
if (_updateRoomBackground) {
(this->*_updateRoomBackground)();
}
- // Escape only aborts dialogue during the intro cutscene (or on quit).
- if (_inputVars[kInputEscape] && (_currentPart == 850 || _eventQuitGame)) {
+ // Escape only aborts dialogue during the intro cutscene.
+ if (_inputVars[kInputEscape] && _currentPart == 850) {
warning("waitForEndOfCutsceneDialogue() early exit with text active %d start %d count %d speechCounter %d delay %d/%d",
_gameState.dialogueTextRunning, _dialogueTextsStart, _dialogueTextsCount,
_talkSpeechCounter, _talkDelayCounter, _talkDelay);
@@ -359,7 +365,19 @@ void IgorEngine::stopDialogueSpeech() {
}
}
+void IgorEngine::cancelDialogue() {
+ if (_gameState.dialogueTextRunning) {
+ memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 320 * 72, _dialogueDirtyRectSize);
+ }
+ stopDialogueSpeech();
+ _gameState.dialogueTextRunning = false;
+ _dialogueTextsCount = 0;
+ _inputVars[kInputSkipDialogue] = 0;
+}
+
void IgorEngine::startIgorDialogue() {
+ if (_eventQuitGame)
+ return;
debugC(9, kDebugEngine, "startIgorDialogue()");
if (_dialogueTextsCount <= 0 || _dialogueTextsStart < 0 || _dialogueTextsStart >= MAX_DIALOGUE_TEXTS) {
warning("startIgorDialogue() invalid playback range start %d count %d", _dialogueTextsStart, _dialogueTextsCount);
@@ -422,6 +440,10 @@ void IgorEngine::startIgorDialogue() {
void IgorEngine::waitForEndOfIgorDialogue(bool animateHead) {
do {
+ if (_eventQuitGame) {
+ cancelDialogue();
+ return;
+ }
if (_gameState.dialogueTextRunning && _inputVars[kInputSkipDialogue]) {
stopDialogueSpeech();
_talkDelayCounter = _talkDelay;
@@ -471,7 +493,7 @@ void IgorEngine::waitForEndOfIgorDialogue(bool animateHead) {
if (_updateRoomBackground) {
(this->*_updateRoomBackground)();
}
- if (_inputVars[kInputEscape] && (_currentPart == 850 || _eventQuitGame))
+ if (_inputVars[kInputEscape] && _currentPart == 850)
return;
waitForTimer();
} while (_gameState.dialogueTextRunning);
Commit: f81e1e2573d6385a1ceeeaa942fded8e20e5be86
https://github.com/scummvm/scummvm/commit/f81e1e2573d6385a1ceeeaa942fded8e20e5be86
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:51+01:00
Commit Message:
IGOR: Fix animations being visible through full screen objects
Changed paths:
engines/igor/igor.h
engines/igor/part_main.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 831df32660d..95e8e5f24be 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -638,7 +638,7 @@ private:
void animateIgorTalking(int frame);
void fixIgorDialogueTextPosition(int num, int count, int *x, int *y);
void startIgorDialogue();
- void waitForEndOfIgorDialogue(bool animateHead = true);
+ void waitForEndOfIgorDialogue(bool animateHead = true, bool updateRoomBackground = true);
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);
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 1ddfdd699c3..835e61e2b02 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -322,14 +322,14 @@ void IgorEngine::EXEC_MAIN_ACTION_38_lookAtNewspaper() {
ADD_DIALOGUE_TEXT(150, 2, 77);
SET_DIALOGUE_TEXT(1, 4);
startIgorDialogue();
- waitForEndOfIgorDialogue(false);
+ waitForEndOfIgorDialogue(false, false);
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(false);
+ waitForEndOfIgorDialogue(false, false);
wd->x = _walkDataCurrentPosX2;
wd->y = _walkDataCurrentPosY2;
wd->scaleWidth = _walkDataCurrentWScale;
@@ -363,7 +363,8 @@ void IgorEngine::EXEC_MAIN_ACTION_43_lookAtPhoto() {
wd->x = 160;
wd->y = 130;
wd->scaleWidth = 50;
- igorSayAndWait(83, 2, 59);
+ igorSay(83, 2, 59);
+ waitForEndOfIgorDialogue(false, false);
_currentAction.object1Num = 0;
wd->x = _walkDataCurrentPosX2;
wd->y = _walkDataCurrentPosY2;
@@ -841,7 +842,7 @@ void IgorEngine::lookAtPapyrus(bool reveal) {
}
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
- waitForEndOfIgorDialogue(false);
+ waitForEndOfIgorDialogue(false, false);
// the paper stays on screen until another click (left or right)
_inputVars[kInputClick] = 0;
_inputVars[kInputRightClick] = 0;
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 8f27df9fa83..9bdb16d13a2 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -438,7 +438,7 @@ void IgorEngine::startIgorDialogue() {
_inputVars[kInputSkipDialogue] = 0;
}
-void IgorEngine::waitForEndOfIgorDialogue(bool animateHead) {
+void IgorEngine::waitForEndOfIgorDialogue(bool animateHead, bool updateRoomBackground) {
do {
if (_eventQuitGame) {
cancelDialogue();
@@ -490,7 +490,7 @@ void IgorEngine::waitForEndOfIgorDialogue(bool animateHead) {
++_talkSpeechCounter;
}
}
- if (_updateRoomBackground) {
+ if (updateRoomBackground && _updateRoomBackground) {
(this->*_updateRoomBackground)();
}
if (_inputVars[kInputEscape] && _currentPart == 850)
Commit: 4e856f33ac1c7d269fdab689fc5ad197261dd03a
https://github.com/scummvm/scummvm/commit/4e856f33ac1c7d269fdab689fc5ad197261dd03a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:52+01:00
Commit Message:
IGOR: Hook options menu to original resources (rather than hardcoded text)
Changed paths:
engines/igor/igor.h
engines/igor/options.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 95e8e5f24be..63930aa1dc0 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -582,6 +582,7 @@ private:
ResourceEntry *_resourceEntries;
Common::Array<StringEntry> _stringEntries;
+ Common::Array<Common::String> _optionsMenuTexts;
char _saveStateDescriptions[kMaxSaveStates][100];
void restart();
@@ -1408,6 +1409,8 @@ private:
void formatRightButtonSentence();
int getVerbUnderCursor(int x) const { return ((x % 46) < 44) ? (kVerbTalk + x / 46) : 0; }
void handleRoomInventoryScroll();
+ void loadOptionsMenuTexts();
+ void drawOptionsMenuText(int text, int x, int y, int color);
void handleOptionsMenu();
void scrollInventory();
void drawInventory(int start, int mode);
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index e2526f29ab7..8f28fc4a9ba 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -60,8 +60,41 @@ enum {
kPagePlay
};
+enum OptionsMenuText {
+ kOptionsSave = 0,
+ kOptionsLoad,
+ kOptionsQuit,
+ kOptionsCtrl,
+ kOptionsPlay,
+ kOptionsSoundOff,
+ kOptionsSoundOn,
+ kOptionsSoundUnavailable,
+ kOptionsSpeechOnly,
+ kOptionsSpeechAndText,
+ kOptionsTextOnly,
+ kOptionsSpeechUnavailable,
+ kOptionsMusicOff,
+ kOptionsMusicOn,
+ kOptionsMusicUnavailable,
+ kOptionsSpeedVerySlow,
+ kOptionsSpeedSlow,
+ kOptionsSpeedNormal,
+ kOptionsSpeedFast,
+ kOptionsSpeedVeryFast,
+ kOptionsSpeedSpeech,
+ kOptionsSpeedOff,
+ kOptionsCtrlTitle,
+ kOptionsQuitTitle,
+ kOptionsQuitQuestion,
+ kOptionsQuitKeys,
+ kOptionsSaveTitle,
+ kOptionsNoSavedGames,
+ kOptionsLoadTitle,
+ kOptionsTextCount
+};
+
struct Page {
- const char *captions[2];
+ int captions[2];
int xPos[2];
void (IgorEngine::*paintProc)();
bool (IgorEngine::*handleKeyDownProc)(int key);
@@ -69,48 +102,85 @@ struct Page {
static const Page pages[] = {
{
- { "Salvar", "Elige una posición donde salvar" },
- { 50, 75 },
+ { kOptionsSave, kOptionsSaveTitle },
+ { 67, 159 },
0,
0
},
{
- { "Cargar", "Elige el juego que quieres cargar" },
- { 95, 93 },
+ { kOptionsLoad, kOptionsLoadTitle },
+ { 113, 159 },
0,
0
},
{
- { "Salir", "Salir" },
- { 145, 145 },
+ { kOptionsQuit, kOptionsQuitTitle },
+ { 159, 159 },
&IgorEngine::handleOptionsMenu_paintQuit,
&IgorEngine::handleOptionsMenu_handleKeyDownQuit
},
{
- { "Opcion.", "Opciones" },
- { 185, 112 },
+ { kOptionsCtrl, kOptionsCtrlTitle },
+ { 205, 159 },
&IgorEngine::handleOptionsMenu_paintCtrl,
&IgorEngine::handleOptionsMenu_handleKeyDownCtrl
},
{
- { "Jugar", 0 },
- { 237, 0 },
+ { kOptionsPlay, -1 },
+ { 251, 0 },
0,
0
}
};
+void IgorEngine::loadOptionsMenuTexts() {
+ if (!_optionsMenuTexts.empty())
+ return;
+
+ const struct {
+ int resource;
+ int count;
+ } groups[] = {
+ { TXT_OptionsButtons, 5 },
+ { TXT_OptionsSettings, 17 },
+ { TXT_OptionsTitle, 1 },
+ { TXT_OptionsQuit, 3 },
+ { TXT_OptionsSaveTitle, 1 },
+ { TXT_OptionsLoadTitle, 2 }
+ };
+ for (uint i = 0; i < ARRAYSIZE(groups); ++i) {
+ int size;
+ uint8 *data = loadData(groups[i].resource, 0, &size);
+ int offset = 0;
+ for (int j = 0; j < groups[i].count; ++j) {
+ if (offset >= size || data[offset] > size - offset - 1)
+ error("Invalid options menu text resource %d", groups[i].resource);
+ int length = data[offset++];
+ _optionsMenuTexts.push_back(Common::String((const char *)data + offset, length));
+ offset += length;
+ }
+ if (offset != size)
+ error("Unexpected data in options menu text resource %d", groups[i].resource);
+ free(data);
+ }
+ assert(_optionsMenuTexts.size() == kOptionsTextCount);
+}
+
+void IgorEngine::drawOptionsMenuText(int text, int x, int y, int color) {
+ const char *str = _optionsMenuTexts[text].c_str();
+ _font.drawString(_screenTextLayer, str, x - _font.getStringWidth(str) / 2, y, color, -1, 0);
+}
+
void IgorEngine::handleOptionsMenu_paintQuit() {
- _font.drawString(_screenTextLayer, "Are you sure?", 120, 64 - 15, 0xF6, -1, 0);
- _font.drawString(_screenTextLayer, "(Y/N)", 143, 76 - 15, 0xF6, -1, 0);
+ drawOptionsMenuText(kOptionsQuitQuestion, 159, 64 - 15, 0xF6);
+ drawOptionsMenuText(kOptionsQuitKeys, 159, 76 - 15, 0xF6);
}
bool IgorEngine::handleOptionsMenu_handleKeyDownQuit(int key) {
- if (key == Common::KEYCODE_y) {
+ if (key == Common::KEYCODE_s)
_currentPart = kInvalidPart;
- }
- return true;
+ return key == Common::KEYCODE_s || key == Common::KEYCODE_n || key == Common::KEYCODE_ESCAPE;
}
static void redrawRect(uint8 *dst, int num, bool border) {
@@ -130,40 +200,20 @@ static void redrawRect(uint8 *dst, int num, bool border) {
}
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);
- _font.drawString(_screenTextLayer, textsStrTable1[i], textsPosTable1[i], 41 - 15, 0xF7, -1, 0);
+ drawOptionsMenuText(kOptionsSoundOff + CLIP<int>(_gameState.configSoundEnabled, 0, 2), 159, 41 - 15, 0xF7);
redrawRect(_screenTextLayer, 2, false);
- _font.drawString(_screenTextLayer, "Only TEXT AVAILABLE", 93, 63 - 15, 0xF7, -1, 0);
+ int speechText = (_game.flags & kFlagTalkie)
+ ? kOptionsSpeechOnly + CLIP<int>(_gameState.talkMode, 0, 2)
+ : kOptionsSpeechUnavailable;
+ drawOptionsMenuText(speechText, 159, 63 - 15, 0xF7);
- static const char *textsStrTable2[] = {
- "Music OFF",
- "Music ON",
- "Music UNAVAILABLE"
- };
- static int textsPosTable2[] = { 129, 133, 100 };
- i = 1;
redrawRect(_screenTextLayer, 3, false);
- _font.drawString(_screenTextLayer, textsStrTable2[i], textsPosTable2[i], 85 - 15, 0xF7, -1, 0);
+ drawOptionsMenuText(kOptionsMusicOn, 159, 85 - 15, 0xF7);
- 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);
- _font.drawString(_screenTextLayer, textsStrTable3[i], textsPosTable3[i], 107 - 15, 0xF6, -1, 0);
+ drawOptionsMenuText(kOptionsSpeedVerySlow + CLIP<int>(_gameState.talkSpeed, 1, 7) - 1, 159, 107 - 15, 0xF6);
}
bool IgorEngine::handleOptionsMenu_handleKeyDownCtrl(int key) {
@@ -196,6 +246,7 @@ static void drawButtonsBar(uint8 *dst, const uint8 *src) {
}
void IgorEngine::handleOptionsMenu() {
+ loadOptionsMenuTexts();
PauseToken pauseToken = pauseEngine();
hideCursor();
// End the room's spoken line before reusing its text backing store.
@@ -243,7 +294,7 @@ void IgorEngine::handleOptionsMenu() {
const int yPosCaption = 18 - 15;
for (int i = 0; i < 5; ++i) {
- _font.drawString(_screenTextLayer, pages[i].captions[0], pages[i].xPos[0], yPosCaption, 0xF6, -1, 0);
+ drawOptionsMenuText(pages[i].captions[0], pages[i].xPos[0], yPosCaption, 0xF6);
}
redrawButton(_screenTextLayer, 0, true);
@@ -287,7 +338,7 @@ void IgorEngine::handleOptionsMenu() {
for (int y = 0; y <= 11; ++y) {
memset(_screenTextLayer + (y + 3) * 320 + 44, 0xF8, 232);
}
- _font.drawString(_screenTextLayer, pages[currentPage].captions[1], pages[currentPage].xPos[1], yPosCaption, 0xFB, -1, 0);
+ drawOptionsMenuText(pages[currentPage].captions[1], pages[currentPage].xPos[1], yPosCaption, 0xFB);
(this->*pages[currentPage].paintProc)();
focusOnPage = true;
}
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 34f7dffbdff..ac8323f2706 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -892,4 +892,11 @@
#define DLG_Part8Intercom 1224
+#define TXT_OptionsButtons 1225
+#define TXT_OptionsSettings 1226
+#define TXT_OptionsTitle 1227
+#define TXT_OptionsQuit 1228
+#define TXT_OptionsSaveTitle 1229
+#define TXT_OptionsLoadTitle 1230
+
#endif // IGOR_RESOURCE_IDS
Commit: 35ab57216d0bc5788e3dad22d680b4d5bea105a9
https://github.com/scummvm/scummvm/commit/35ab57216d0bc5788e3dad22d680b4d5bea105a9
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:52+01:00
Commit Message:
IGOR: Hook game parameters through detection
Changed paths:
engines/igor/detection.h
engines/igor/detection_tables.h
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/metaengine.cpp
engines/igor/metaengine.h
diff --git a/engines/igor/detection.h b/engines/igor/detection.h
index a05dfa1515c..72df6e2493f 100644
--- a/engines/igor/detection.h
+++ b/engines/igor/detection.h
@@ -26,6 +26,40 @@
namespace Igor {
+enum {
+ kFlagDemo = 1 << 0,
+ kFlagFloppy = 1 << 1,
+ kFlagTalkie = 1 << 2
+};
+
+enum {
+ kIdEngDemo100,
+ kIdEngDemo110,
+ kIdEngFloppy,
+ kIdSpaFloppy,
+ kIdEngCD,
+ kIdSpaCD
+};
+
+struct IgorGameDescription {
+ ADGameDescription desc;
+ int gameVersion;
+ int gameFlags;
+ const char *ovlFileName;
+ const char *sfxFileName;
+
+ uint32 sizeBuffer() const {
+ return desc.sizeBuffer() + ADDynamicDescription::strSizeBuffer(ovlFileName) +
+ ADDynamicDescription::strSizeBuffer(sfxFileName);
+ }
+
+ void *toBuffer(void *buffer) {
+ buffer = desc.toBuffer(buffer);
+ buffer = ADDynamicDescription::strToBuffer(buffer, ovlFileName);
+ return ADDynamicDescription::strToBuffer(buffer, sfxFileName);
+ }
+};
+
enum IgorDebugChannels {
kDebugGraphics = 1,
kDebugPath,
@@ -42,13 +76,13 @@ enum IgorDebugChannels {
extern const PlainGameDescriptor igorGames[];
-extern const ADGameDescription gameDescriptions[];
+extern const IgorGameDescription gameDescriptions[];
#define GAMEOPTION_ORIGINAL_SAVELOAD GUIO_GAMEOPTIONS1
} // End of namespace Igor
-class IgorMetaEngineDetection : public AdvancedMetaEngineDetection<ADGameDescription> {
+class IgorMetaEngineDetection : public AdvancedMetaEngineDetection<Igor::IgorGameDescription> {
static const DebugChannelDef debugFlagList[];
public:
diff --git a/engines/igor/detection_tables.h b/engines/igor/detection_tables.h
index 627304c3fa4..918851114da 100644
--- a/engines/igor/detection_tables.h
+++ b/engines/igor/detection_tables.h
@@ -26,22 +26,45 @@ const PlainGameDescriptor igorGames[] = {
{ 0, 0 }
};
-const ADGameDescription gameDescriptions[] = {
+const IgorGameDescription gameDescriptions[] = {
{
- "igor",
- nullptr,
- AD_ENTRY2s(
- "IGOR.DAT", "b4ba3ec480ec66a2fa456265ab51f5f6", 61682719,
- "IGOR.EXE", "70f49859d1defddda140d144e1eb90b1", 9115648
- ),
-
- Common::EN_ANY,
- Common::kPlatformDOS,
- ADGF_UNSTABLE,
- GUIO1(GUIO_NONE)
+ {
+ "igor",
+ "CD",
+ AD_ENTRY2s(
+ "IGOR.DAT", "b4ba3ec480ec66a2fa456265ab51f5f6", 61682719,
+ "IGOR.EXE", "70f49859d1defddda140d144e1eb90b1", 9115648
+ ),
+ Common::ES_ESP,
+ Common::kPlatformDOS,
+ ADGF_UNSTABLE | ADGF_CD,
+ GUIO1(GUIO_NONE)
+ },
+ kIdSpaCD,
+ kFlagTalkie,
+ "IGOR.EXE",
+ "IGOR.DAT"
+ },
+ {
+ {
+ "igor",
+ "Floppy",
+ AD_ENTRY2s(
+ "IGOR.DAT", "69eec27e1d2fe2f0612a6fb265385dfb", 11199335,
+ "IGOR.EXE", "91d60ccc00ea19c1bd1b50657a9c598b", 39537
+ ),
+ Common::ES_ESP,
+ Common::kPlatformDOS,
+ ADGF_UNSTABLE,
+ GUIO1(GUIO_NOSPEECH)
+ },
+ kIdSpaFloppy,
+ kFlagFloppy,
+ "IGOR.DAT",
+ "IGOR.FSD"
},
- AD_TABLE_END_MARKER
+ { AD_TABLE_END_MARKER, 0, 0, nullptr, nullptr }
};
} // End of namespace Igor
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 39a8b846b60..32745835a3b 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -35,7 +35,7 @@ namespace Igor {
IgorEngine *g_engine;
-IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst),
+IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Engine(syst),
_gameDescription(gameDesc), _randomSource("Igor") {
g_engine = this;
@@ -57,21 +57,18 @@ IgorEngine::IgorEngine(OSystem *syst, const ADGameDescription *gameDesc) : Engin
_verbsPanelBuffer = (uint8 *)malloc(3840);
_debugOverlayBuffer = (uint8 *)malloc(320 * 144);
- { // hardcoded now
- _game.ovlFileName = "igor.exe";
- _game.sfxFileName = "igor.dat";
- _game.version = kIdSpaCD;
- _game.flags = kFlagTalkie;
+ _game.ovlFileName = gameDesc->ovlFileName;
+ _game.sfxFileName = gameDesc->sfxFileName;
+ _game.version = gameDesc->gameVersion;
+ _game.flags = gameDesc->gameFlags;
+ _game.language = gameDesc->desc.language;
- _game.language = Common::ES_ESP; // Assuming 0 represents the default language
+ _currentPart = 850;
+ // _currentPart = kStartupPart;
- _currentPart = 850;
- // _currentPart = kStartupPart;
-
- // _currentPart = 171;
- // _currentPart = 62;
- // _currentPart = 40;
- }
+ // _currentPart = 171;
+ // _currentPart = 62;
+ // _currentPart = 40;
// if (_game.flags & kFlagFloppy) {
// _midiPlayer = new Midi(this);
@@ -107,11 +104,11 @@ IgorEngine::~IgorEngine() {
}
uint32 IgorEngine::getFeatures() const {
- return _gameDescription->flags;
+ return _gameDescription->desc.flags;
}
Common::String IgorEngine::getGameId() const {
- return _gameDescription->gameId;
+ return _gameDescription->desc.gameId;
}
void IgorEngine::restart() {
@@ -229,8 +226,6 @@ Common::Error IgorEngine::run() {
loadMainTexts();
loadIgorFrames();
- // _gameState.talkMode = kTalkModeTextOnly;
- // _gameState.talkMode = kTalkModeSpeechOnly;
_gameState.talkMode = kTalkModeSpeechAndText;
_gameState.talkSpeed = 3;
_talkSpeechCounter = 5;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 63930aa1dc0..423f843fb15 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -45,13 +45,6 @@
namespace Igor {
-struct IgorGameDescription;
-
-enum {
- kFlagDemo = 1 << 0,
- kFlagFloppy = 1 << 1,
- kFlagTalkie = 1 << 2
-};
enum {
kStartupPart = 900,
@@ -339,15 +332,6 @@ enum DebugOverlay {
kOverlayDeltaLum
};
-enum {
- kIdEngDemo100,
- kIdEngDemo110,
- kIdEngFloppy,
- kIdSpaFloppy,
- kIdEngCD,
- kIdSpaCD
-};
-
struct DialogueText {
int num;
int count;
@@ -429,7 +413,7 @@ public:
typedef void (IgorEngine::*UpdateDialogueProc)(int action);
private:
- const ADGameDescription *_gameDescription;
+ const IgorGameDescription *_gameDescription;
Common::RandomSource _randomSource;
// MidiPlayer *_midiPlayer;
@@ -1511,7 +1495,7 @@ public:
bool handleOptionsMenu_handleKeyDownCtrl(int key);
public:
- IgorEngine(OSystem *syst, const ADGameDescription *gameDesc);
+ IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc);
~IgorEngine() override;
uint32 getFeatures() const;
diff --git a/engines/igor/metaengine.cpp b/engines/igor/metaengine.cpp
index f0ea197abd1..6b835c310bf 100644
--- a/engines/igor/metaengine.cpp
+++ b/engines/igor/metaengine.cpp
@@ -52,7 +52,7 @@ const ADExtraGuiOptionsMap *IgorMetaEngine::getAdvancedExtraGuiOptions() const {
return Igor::optionsList;
}
-Common::Error IgorMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
+Common::Error IgorMetaEngine::createInstance(OSystem *syst, Engine **engine, const Igor::IgorGameDescription *desc) const {
*engine = new Igor::IgorEngine(syst, desc);
return Common::kNoError;
}
diff --git a/engines/igor/metaengine.h b/engines/igor/metaengine.h
index 59b163242cd..7d8c741d45e 100644
--- a/engines/igor/metaengine.h
+++ b/engines/igor/metaengine.h
@@ -22,13 +22,13 @@
#ifndef IGOR_METAENGINE_H
#define IGOR_METAENGINE_H
-#include "engines/advancedDetector.h"
+#include "igor/detection.h"
-class IgorMetaEngine : public AdvancedMetaEngine<ADGameDescription> {
+class IgorMetaEngine : public AdvancedMetaEngine<Igor::IgorGameDescription> {
public:
const char *getName() const override;
- Common::Error createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const override;
+ Common::Error createInstance(OSystem *syst, Engine **engine, const Igor::IgorGameDescription *desc) const override;
/**
* Determine whether the engine supports the specified MetaEngine feature.
Commit: 1c2420536e6ad8ef4ccf2ae9d3745886ca9fb6a4
https://github.com/scummvm/scummvm/commit/1c2420536e6ad8ef4ccf2ae9d3745886ca9fb6a4
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:52+01:00
Commit Message:
IGOR: Consolidate common functions in parts 17 and 77
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_17.cpp
engines/igor/parts/part_77.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 423f843fb15..b9c44c94472 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -844,16 +844,18 @@ private:
// outside college
void PART_17_EXEC_ACTION(int action);
- void PART_17_ACTION_101_walkIn();
+ void PART_17_ACTION_101_walkIn(bool lateGame = false);
void PART_17_ACTION_103_talkPhilipJimmy();
- void PART_17_ACTION_105_leaveThroughPath();
+ void PART_17_ACTION_105_leaveThroughPath(bool lateGame = false);
void PART_17_ACTION_106_swapFolders();
void PART_17_HANDLE_DIALOGUE_PHILIP();
void PART_17_UPDATE_DIALOGUE_Jimmy(int action);
void PART_17_UPDATE_DIALOGUE_Philip(int action);
void PART_17_UPDATE_ROOM_BACKGROUND();
void PART_17_HELPER_1_OBJECT_STATE(int num);
- void PART_17_HELPER_2_walkFromMap();
+ void PART_17_HELPER_2_walkFromMap(bool lateGame = false);
+ void PART_17_HELPER_2_setYScaleRamp();
+ void PART_17_HELPER_2_clearEntryAreas();
void PART_17_HELPER_3_disableArea(int lum);
void PART_17_HELPER_4_paintFirsFrameOfPhilipAndJimmy();
void PART_17_HELPER_5_changeZindexOfPath(int lum);
@@ -1244,17 +1246,10 @@ private:
void PART_77_EXEC_ACTION(int action);
void PART_77_APPLY_OBJECT_STATE();
- void PART_77_SET_AREAS_LIGHT(int lum);
- void PART_77_CLEAR_ENTRY_AREAS();
- void PART_77_SET_Y_SCALE_RAMP();
- void PART_77_SET_Y_SCALE_UNIFORM();
- void PART_77_DRAW_FRAME(int frame);
+ void PART_77_drawMonkeyFrame(int frame);
void PART_77_UPDATE_DIALOGUE(int action);
- void PART_77_ACTION_101_exitToStairs();
- void PART_77_ACTION_105_leave();
- void PART_77_ACTION_106_cutscene();
- void PART_77_ENTER_FROM_MAP();
- void PART_77_ENTER_FROM_STAIRS();
+ void PART_77_ACTION_106_monkeyCageCutscene();
+ void PART_77_enterFromCollege();
void PART_77();
void PART_78_DRAW_FIGURE(int frame);
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index b2793d5150d..25eeb7efd7b 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -51,21 +51,22 @@ void IgorEngine::PART_17_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_17_ACTION_101_walkIn() {
+void IgorEngine::PART_17_ACTION_101_walkIn(bool lateGame) {
+ const IgorMoveTick tick = lateGame ? 0 : &IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND;
_roomObjectAreasTable[_screenLayer2[22034]].area = 8;
_roomObjectAreasTable[_screenLayer2[23923]].area = 8;
--_walkDataLastIndex;
buildWalkPath(243, 77, 243, 74);
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
+ waitForIgorMove(tick);
// Added this line compared to the 2009 version to correct the walk path origin.
--_walkDataLastIndex;
buildWalkPath(243, 74, 274, 68);
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
+ waitForIgorMove(tick);
_currentPart = 302;
}
@@ -117,7 +118,8 @@ void IgorEngine::PART_17_ACTION_103_talkPhilipJimmy() {
}
}
-void IgorEngine::PART_17_ACTION_105_leaveThroughPath() {
+void IgorEngine::PART_17_ACTION_105_leaveThroughPath(bool lateGame) {
+ const IgorMoveTick tick = lateGame ? 0 : &IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND;
bool escaped = false;
_roomObjectAreasTable[5].area = 1;
_roomObjectAreasTable[10].area = 2;
@@ -130,9 +132,9 @@ void IgorEngine::PART_17_ACTION_105_leaveThroughPath() {
--_walkDataLastIndex;
buildWalkPath(45, 95, 41, 86);
_walkDataCurrentIndex = 1;
- _walkData[_walkDataLastIndex].frameNum = 1;
+ _walkData[_walkDataLastIndex].frameNum = lateGame ? 0 : 1;
_gameState.igorMoving = true;
- escaped |= waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND, true, escaped);
+ escaped |= waitForIgorMove(tick, true, escaped);
PART_17_HELPER_5_changeZindexOfPath(143);
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[44836]].area = 4;
@@ -140,16 +142,13 @@ void IgorEngine::PART_17_ACTION_105_leaveThroughPath() {
_roomObjectAreasTable[_screenLayer2[44836]].area = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- for (int i = _walkDataCurrentIndex; i <= _walkDataLastIndex; ++i) {
- _walkData[i].posNum = kFacingPositionBack;
- }
- escaped |= waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND, true, escaped);
- for (int i = 17; i <= 85; ++i) {
- _walkYScaleRoom[i] = ((i - 13) / 4) + 5;
- }
- for (int i = 86; i <= 135; ++i) {
- _walkYScaleRoom[i] = 23;
+ if (!lateGame) {
+ for (int i = _walkDataCurrentIndex; i <= _walkDataLastIndex; ++i) {
+ _walkData[i].posNum = kFacingPositionBack;
+ }
}
+ escaped |= waitForIgorMove(tick, true, escaped, lateGame ? kFacingPositionBack : -1);
+ PART_17_HELPER_2_setYScaleRamp();
_walkData[0].setPos(65, 115, 1, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
@@ -162,7 +161,7 @@ void IgorEngine::PART_17_ACTION_105_leaveThroughPath() {
_roomObjectAreasTable[_screenLayer2[36865]].area = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- escaped |= waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND, true, escaped);
+ escaped |= waitForIgorMove(tick, true, escaped);
_currentPart = 40;
}
@@ -298,14 +297,10 @@ void IgorEngine::PART_17_HELPER_1_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_17_HELPER_2_walkFromMap() {
+void IgorEngine::PART_17_HELPER_2_walkFromMap(bool lateGame) {
+ const IgorMoveTick tick = lateGame ? 0 : &IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND;
bool escaped = false;
- for (int i = 17; i <= 85; ++i) {
- _walkYScaleRoom[i] = ((i - 13) / 4) + 5;
- }
- for (int i = 86; i <= 135; ++i) {
- _walkYScaleRoom[i] = 23;
- }
+ PART_17_HELPER_2_setYScaleRamp();
WalkData *wd = &_walkData[0];
wd->setPos(21, 17, 3, 0);
wd->clipSkipX = 1;
@@ -322,7 +317,7 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap() {
_roomObjectAreasTable[_screenLayer2[36865]].area = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- escaped |= waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND, true, escaped);
+ escaped |= waitForIgorMove(tick, true, escaped);
for (int i = 17; i <= 135; ++i) {
_walkYScaleRoom[i] = 50;
}
@@ -334,13 +329,17 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap() {
_roomObjectAreasTable[_screenLayer2[44836]].area = 4;
buildWalkPath(36, 143, 41, 86);
_roomObjectAreasTable[_screenLayer2[44836]].area = 0;
- _walkData[_walkDataLastIndex].frameNum = 0;
+ if (!lateGame) {
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ }
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- for (int i = _walkDataCurrentIndex; i <= _walkDataLastIndex; ++i) {
- _walkData[i].posNum = kFacingPositionFront;
+ if (!lateGame) {
+ for (int i = _walkDataCurrentIndex; i <= _walkDataLastIndex; ++i) {
+ _walkData[i].posNum = kFacingPositionFront;
+ }
}
- escaped |= waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND, true, escaped);
+ escaped |= waitForIgorMove(tick, true, escaped, lateGame ? kFacingPositionFront : -1);
PART_17_HELPER_5_changeZindexOfPath(0);
--_walkDataLastIndex;
@@ -348,7 +347,20 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap() {
_walkDataCurrentIndex = 2;
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
- escaped |= waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND, true, escaped);
+ escaped |= waitForIgorMove(tick, true, escaped);
+ PART_17_HELPER_2_clearEntryAreas();
+}
+
+void IgorEngine::PART_17_HELPER_2_setYScaleRamp() {
+ for (int i = 17; i <= 85; ++i) {
+ _walkYScaleRoom[i] = ((i - 13) / 4) + 5;
+ }
+ for (int i = 86; i <= 135; ++i) {
+ _walkYScaleRoom[i] = 23;
+ }
+}
+
+void IgorEngine::PART_17_HELPER_2_clearEntryAreas() {
_roomObjectAreasTable[5].area = 0;
_roomObjectAreasTable[10].area = 0;
_roomObjectAreasTable[11].area = 0;
@@ -403,14 +415,7 @@ void IgorEngine::PART_17_HELPER_6_walkFromCollege() {
_gameState.igorMoving = true;
waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
PART_17_HELPER_5_changeZindexOfPath(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;
+ PART_17_HELPER_2_clearEntryAreas();
}
void IgorEngine::PART_17_HELPER_8_PhillipToJimmyAnimFrame(int num) {
diff --git a/engines/igor/parts/part_77.cpp b/engines/igor/parts/part_77.cpp
index 2265d86e62b..a099116f12c 100644
--- a/engines/igor/parts/part_77.cpp
+++ b/engines/igor/parts/part_77.cpp
@@ -22,49 +22,34 @@
namespace Igor {
-// The animation resource starts with the frames and ends with the table of their offsets.
-static const int kPart77FramesTable = 0x67D2;
+static const int kPart77MonkeyFramesTable = 0x67D2;
-// Frame shown when a line ends; while a line goes on one of this and the next four frames is picked at random.
-static const int kPart77StandingFrame = 40;
+static const int kPart77MonkeyStandingFrame = 40;
-// Where the lines of the cutscene are shown.
static const int kPart77TextX = 120;
static const int kPart77TextY = 40;
-// Areas that get another value for the walk that leaves the room and go back to 0 after the walks that enter it.
-static const int kPart77ScriptedAreas[8] = { 5, 10, 11, 13, 16, 17, 26, 28 };
-static const int kPart77ScriptedAreaValues[8] = { 1, 2, 2, 2, 3, 4, 4, 4 };
-
-// Areas whose first light limit is changed while Igor leaves the room.
-static const int kPart77LightAreas[4] = { 23, 26, 27, 32 };
-
-// Positions of the picture whose area is set to 4 while a scripted walk from or to them is built.
-static const int kPart77TopPointOffset = 115 * 320 + 65;
-static const int kPart77BottomPointOffset = 140 * 320 + 36;
-
-// Frames shown for 46 ticks each, between the frames 6 to 16 and the frames 19 to 21.
static const uint8 kPart77CutsceneFrames[6] = { 17, 18, 17, 18, 17, 18 };
void IgorEngine::PART_77_EXEC_ACTION(int action) {
switch (action) {
case 101:
- PART_77_ACTION_101_exitToStairs();
+ PART_17_ACTION_101_walkIn(true);
break;
- case 102:
+ case 102: // look at college door
igorSay(209, 1, 1125);
break;
- case 103:
+ case 103: // look at cage
igorSay(203, 3, 1122);
break;
- case 104:
+ case 104: // use cage
igorSay(201, 2, 1121);
break;
case 105:
- PART_77_ACTION_105_leave();
+ PART_17_ACTION_105_leaveThroughPath(true);
break;
case 106:
- PART_77_ACTION_106_cutscene();
+ PART_77_ACTION_106_monkeyCageCutscene();
break;
default:
error("PART_77_EXEC_ACTION unhandled action %d", action);
@@ -72,128 +57,26 @@ void IgorEngine::PART_77_EXEC_ACTION(int action) {
}
}
-/**
- * The object of area 15.
- */
void IgorEngine::PART_77_APPLY_OBJECT_STATE() {
_roomObjectAreasTable[15].object = 2;
}
-/**
- * First light limit of the areas of the room that change while Igor leaves it.
- */
-void IgorEngine::PART_77_SET_AREAS_LIGHT(int lum) {
- for (int i = 0; i < 4; ++i) {
- _roomObjectAreasTable[kPart77LightAreas[i]].y1Lum = lum;
- }
-}
-
-void IgorEngine::PART_77_CLEAR_ENTRY_AREAS() {
- for (int i = 0; i < 8; ++i) {
- _roomObjectAreasTable[kPart77ScriptedAreas[i]].area = 0;
- }
-}
-
-/**
- * Size of Igor by row: it grows by one every four rows from row 17 to row 85 and stays the same below.
- */
-void IgorEngine::PART_77_SET_Y_SCALE_RAMP() {
- for (int i = 0x11; i <= 0x55; ++i) {
- _walkYScaleRoom[i] = ((i - 13) >> 2) + 5;
- }
- for (int i = 0x56; i <= 0x87; ++i) {
- _walkYScaleRoom[i] = 0x17;
- }
-}
-
-void IgorEngine::PART_77_SET_Y_SCALE_UNIFORM() {
- for (int i = 0x11; i <= 0x87; ++i) {
- _walkYScaleRoom[i] = 0x32;
- }
-}
-
-void IgorEngine::PART_77_DRAW_FRAME(int frame) {
- decodeAnimFrame(getAnimFrame(0, kPart77FramesTable, frame), _screenVGA, true);
+void IgorEngine::PART_77_drawMonkeyFrame(int frame) {
+ decodeAnimFrame(getAnimFrame(0, kPart77MonkeyFramesTable, frame), _screenVGA, true);
}
void IgorEngine::PART_77_UPDATE_DIALOGUE(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_77_DRAW_FRAME(kPart77StandingFrame);
+ PART_77_drawMonkeyFrame(kPart77MonkeyStandingFrame);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_77_DRAW_FRAME(kPart77StandingFrame + getRandomNumber(4));
+ PART_77_drawMonkeyFrame(kPart77MonkeyStandingFrame + getRandomNumber(4));
break;
}
}
-/**
- * Igor walks to the exit at the right of the picture and the story goes on in state 302.
- */
-void IgorEngine::PART_77_ACTION_101_exitToStairs() {
- _roomObjectAreasTable[_screenLayer2[68 * 320 + 274]].area = 8;
- _roomObjectAreasTable[_screenLayer2[74 * 320 + 243]].area = 8;
- --_walkDataLastIndex;
- buildWalkPath(243, 77, 243, 74);
- _walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- waitForIgorMove();
- --_walkDataLastIndex;
- buildWalkPath(243, 74, 274, 68);
- _walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- waitForIgorMove();
- _currentPart = 302;
-}
-
-/**
- * Igor walks away into the distance in three walks and the story goes on in state 40.
- */
-void IgorEngine::PART_77_ACTION_105_leave() {
- for (int i = 0; i < 8; ++i) {
- _roomObjectAreasTable[kPart77ScriptedAreas[i]].area = kPart77ScriptedAreaValues[i];
- }
- --_walkDataLastIndex;
- buildWalkPath(45, 95, 41, 86);
- _walkDataCurrentIndex = 1;
- _walkData[_walkDataLastIndex].frameNum = 0;
- _gameState.igorMoving = true;
- bool skipped = waitForIgorMove(0, true, false);
-
- PART_77_SET_AREAS_LIGHT(0x8F);
- --_walkDataLastIndex;
- _roomObjectAreasTable[_screenLayer2[kPart77BottomPointOffset]].area = 4;
- buildWalkPath(41, 86, 36, 143);
- _roomObjectAreasTable[_screenLayer2[kPart77BottomPointOffset]].area = 0;
- _walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- skipped |= waitForIgorMove(0, true, skipped, 1);
-
- PART_77_SET_Y_SCALE_RAMP();
- WalkData *wd = &_walkData[0];
- wd->setPos(65, 115, 1, 0);
- wd->clipSkipX = 1;
- wd->clipWidth = 14;
- wd->scaleWidth = 23;
- wd->xPosChanged = 1;
- wd->dxPos = 0;
- wd->yPosChanged = 1;
- wd->dyPos = 0;
- wd->scaleHeight = 23;
- _walkDataLastIndex = 0;
- _roomObjectAreasTable[_screenLayer2[kPart77TopPointOffset]].area = 4;
- buildWalkPath(65, 115, 21, 17);
- _roomObjectAreasTable[_screenLayer2[kPart77TopPointOffset]].area = 0;
- _walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- waitForIgorMove(0, true, skipped);
- _currentPart = 40;
-}
-
-/**
- * Igor walks to (124, 88), the scene plays and the story goes on in state 760.
- */
-void IgorEngine::PART_77_ACTION_106_cutscene() {
+void IgorEngine::PART_77_ACTION_106_monkeyCageCutscene() {
memset(_screenVGA + 46080, 0, 17920);
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[88 * 320 + 124]].area = 5;
@@ -205,20 +88,20 @@ void IgorEngine::PART_77_ACTION_106_cutscene() {
waitForIgorMove();
for (int i = 1; i <= 5; ++i) {
- PART_77_DRAW_FRAME(i);
+ PART_77_drawMonkeyFrame(i);
waitForTimer(31);
}
igorSayAndWait(206, 2, 1123);
for (int i = 6; i <= 16; ++i) {
- PART_77_DRAW_FRAME(i);
+ PART_77_drawMonkeyFrame(i);
waitForTimer(31);
}
for (int i = 0; i < 6; ++i) {
- PART_77_DRAW_FRAME(kPart77CutsceneFrames[i]);
+ PART_77_drawMonkeyFrame(kPart77CutsceneFrames[i]);
waitForTimer(46);
}
for (int i = 19; i <= 21; ++i) {
- PART_77_DRAW_FRAME(i);
+ PART_77_drawMonkeyFrame(i);
waitForTimer(46);
}
_walkData[_walkDataLastIndex - 1].x = 155;
@@ -227,7 +110,7 @@ void IgorEngine::PART_77_ACTION_106_cutscene() {
waitForEndOfIgorDialogue(false);
waitForTimer(255);
for (int i = 22; i <= 39; ++i) {
- PART_77_DRAW_FRAME(i);
+ PART_77_drawMonkeyFrame(i);
waitForTimer(31);
}
cutsceneSayWithCallback(kPart77TextX, kPart77TextY, 63, 57, 0,
@@ -241,62 +124,7 @@ void IgorEngine::PART_77_ACTION_106_cutscene() {
_currentPart = 760;
}
-/**
- * State 770: Igor appears small at the top of the picture and walks in three walks to (45, 95).
- */
-void IgorEngine::PART_77_ENTER_FROM_MAP() {
- PART_77_SET_Y_SCALE_RAMP();
- 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[kPart77TopPointOffset]].area = 4;
- buildWalkPath(21, 17, 65, 115);
- _roomObjectAreasTable[_screenLayer2[kPart77TopPointOffset]].area = 0;
- _walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- // the escape key draws what is left of the walks at once
- bool skipped = waitForIgorMove(0, true, false);
-
- PART_77_SET_Y_SCALE_UNIFORM();
- wd->setPos(36, 140, 3, 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;
- _roomObjectAreasTable[_screenLayer2[kPart77BottomPointOffset]].area = 4;
- buildWalkPath(36, 143, 41, 86);
- _roomObjectAreasTable[_screenLayer2[kPart77BottomPointOffset]].area = 0;
- _walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- skipped |= waitForIgorMove(0, true, skipped, 3);
-
- PART_77_SET_AREAS_LIGHT(0);
- --_walkDataLastIndex;
- buildWalkPath(41, 86, 45, 95);
- _walkDataCurrentIndex = 2;
- _walkData[_walkDataLastIndex].frameNum = 0;
- _gameState.igorMoving = true;
- waitForIgorMove(0, true, skipped);
- PART_77_CLEAR_ENTRY_AREAS();
-}
-
-/**
- * State 771: Igor appears at (225, 100), the first step is drawn before the picture fades in, and walks to (205, 124).
- */
-void IgorEngine::PART_77_ENTER_FROM_STAIRS() {
+void IgorEngine::PART_77_enterFromCollege() {
PART_77_APPLY_OBJECT_STATE();
WalkData *wd = &_walkData[0];
wd->setPos(225, 100, 3, 1);
@@ -319,8 +147,8 @@ void IgorEngine::PART_77_ENTER_FROM_STAIRS() {
++_walkDataCurrentIndex;
fadeIn(768);
waitForIgorMove();
- PART_77_SET_AREAS_LIGHT(0);
- PART_77_CLEAR_ENTRY_AREAS();
+ PART_17_HELPER_5_changeZindexOfPath(0);
+ PART_17_HELPER_2_clearEntryAreas();
}
void IgorEngine::PART_77() {
@@ -336,20 +164,18 @@ void IgorEngine::PART_77() {
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_77_EXEC_ACTION);
PART_77_APPLY_OBJECT_STATE();
memcpy(_screenVGA, _screenLayer1, 46080);
- for (int i = 18; i <= 20; ++i) {
- _roomObjectAreasTable[i].area = 0;
- }
+ PART_17_HELPER_3_disableArea(0);
if (_gameStateLoaded) {
- PART_77_SET_AREAS_LIGHT(0);
+ PART_17_HELPER_5_changeZindexOfPath(0);
}
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
if (_currentPart == 770) {
fadeIn(768);
- PART_77_ENTER_FROM_MAP();
+ PART_17_HELPER_2_walkFromMap(true);
} else {
- PART_77_ENTER_FROM_STAIRS();
+ PART_77_enterFromCollege();
}
}
enterPartLoop();
Commit: 874d76502b7172561e3c0b06d00c9393fd9737fd
https://github.com/scummvm/scummvm/commit/874d76502b7172561e3c0b06d00c9393fd9737fd
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:53+01:00
Commit Message:
IGOR: Sound and text speed options
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/options.cpp
engines/igor/palette.cpp
engines/igor/parts/part_0.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_8.cpp
engines/igor/resource.cpp
engines/igor/resource_ids.h
engines/igor/sound.cpp
engines/igor/statics.h
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 32745835a3b..e4f47481752 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -157,7 +157,7 @@ void IgorEngine::restart() {
memset(_dialogueInfo, 0, sizeof(_dialogueInfo));
memset(_objectsState, 0, sizeof(_objectsState));
- _part07FirstVisitDone = false; // cseg197:0795-0845; original global s3:0xED2E
+ _part07FirstVisitDone = false;
_roomAmbientIndex = 0;
_part68QuestionCounter = 1;
_part69FireflyFrameA = 0;
@@ -228,6 +228,7 @@ Common::Error IgorEngine::run() {
_gameState.talkMode = kTalkModeSpeechAndText;
_gameState.talkSpeed = 3;
+ syncSoundSettings();
_talkSpeechCounter = 5;
_eventQuitGame = false;
@@ -318,7 +319,7 @@ void IgorEngine::handleRoomDialogue() {
if (_gameState.dialogueTextRunning) {
// Speech completion ends the sentence, exactly as in the two blocking
// dialogue loops. Without this the sentence only ever ends on a click:
- if (_gameState.talkMode != kTalkModeTextOnly && !isDialogueSpeechPlaying()) {
+ if (_talkDelay < 0 && !isDialogueSpeechPlaying()) {
_talkDelayCounter = _talkDelay;
}
if (_talkDelayCounter == _talkDelay) {
@@ -573,6 +574,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
}
if (s.isLoading()) {
+ syncSoundSettings();
// Fade the outgoing screen before any loaded room redraws its pixels.
fadeOut(768);
_gameStateLoaded = true;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index b9c44c94472..a3878aab2bd 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -411,6 +411,7 @@ public:
typedef void (IgorEngine::*UpdateDialogueProc)(int action);
+ void syncSoundSettings() override;
private:
const IgorGameDescription *_gameDescription;
@@ -422,6 +423,7 @@ private:
Audio::SoundHandle _sfxHandle;
Audio::SoundHandle _speechHandle;
+ int _optionsControlRow;
uint8 *_screenVGA;
uint8 *_facingIgorFrames[4];
@@ -591,6 +593,8 @@ private:
void updateMusic();
void playSound(int num, int type);
void stopSound();
+ int getTalkMode() const;
+ int prepareDialoguePlayback(const DialogueText &text);
void loadIgorFrames();
void loadIgorBeachFrames();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 16eb817e4c7..3ef31daaf1d 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -306,7 +306,7 @@ void IgorEngine::handleRoomInput() {
// dialogue skip
if (_inputVars[kInputSkipDialogue] && _gameState.dialogueTextRunning) {
_talkDelayCounter = _talkDelay;
- if (_gameState.talkMode != kTalkModeTextOnly && _talkSpeechCounter > 2) {
+ if (_talkDelay < 0 && _talkSpeechCounter > 2) {
stopSound();
_talkSpeechCounter = -1;
}
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 8f28fc4a9ba..3bb18d82521 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+#include "common/config-manager.h"
#include "common/events.h"
#include "igor/igor.h"
@@ -200,35 +201,61 @@ static void redrawRect(uint8 *dst, int num, bool border) {
}
void IgorEngine::handleOptionsMenu_paintCtrl() {
- redrawRect(_screenTextLayer, 1, false);
- drawOptionsMenuText(kOptionsSoundOff + CLIP<int>(_gameState.configSoundEnabled, 0, 2), 159, 41 - 15, 0xF7);
-
- redrawRect(_screenTextLayer, 2, false);
- int speechText = (_game.flags & kFlagTalkie)
- ? kOptionsSpeechOnly + CLIP<int>(_gameState.talkMode, 0, 2)
- : kOptionsSpeechUnavailable;
- drawOptionsMenuText(speechText, 159, 63 - 15, 0xF7);
-
- redrawRect(_screenTextLayer, 3, false);
- drawOptionsMenuText(kOptionsMusicOn, 159, 85 - 15, 0xF7);
-
- redrawRect(_screenTextLayer, 4, true);
- drawOptionsMenuText(kOptionsSpeedVerySlow + CLIP<int>(_gameState.talkSpeed, 1, 7) - 1, 159, 107 - 15, 0xF6);
+ const int talkMode = getTalkMode();
+ const int labels[] = {
+ kOptionsSoundOff + CLIP<int>(_gameState.configSoundEnabled, 0, 2),
+ (_game.flags & kFlagTalkie) ? kOptionsSpeechOnly + talkMode : kOptionsSpeechUnavailable,
+ (ConfMan.getBool("mute") || ConfMan.getBool("music_mute")) ? kOptionsMusicOff : kOptionsMusicOn,
+ talkMode == kTalkModeTextOnly
+ ? kOptionsSpeedVerySlow + CLIP<int>(_gameState.talkSpeed, 1, 5) - 1
+ : (talkMode == kTalkModeSpeechOnly ? kOptionsSpeedOff : kOptionsSpeedSpeech)
+ };
+ for (int row = 1; row <= 4; ++row) {
+ redrawRect(_screenTextLayer, row, row == _optionsControlRow);
+ drawOptionsMenuText(labels[row - 1], 159, 22 * row + 4,
+ row == _optionsControlRow ? 0xF6 : 0xFF);
+ }
}
bool IgorEngine::handleOptionsMenu_handleKeyDownCtrl(int key) {
+ const int firstRow = (_game.flags & kFlagTalkie) ? 1 : 4;
+ const int lastRow = getTalkMode() == kTalkModeTextOnly ? 4 : 3;
switch (key) {
case Common::KEYCODE_ESCAPE:
return true;
+ case Common::KEYCODE_UP:
+ _optionsControlRow = MAX(firstRow, _optionsControlRow - 1);
+ break;
+ case Common::KEYCODE_DOWN:
+ _optionsControlRow = MIN(lastRow, _optionsControlRow + 1);
+ break;
case Common::KEYCODE_RETURN:
- if (_gameState.talkSpeed == 5) {
- _gameState.talkSpeed = 1;
- } else {
- ++_gameState.talkSpeed;
+ switch (_optionsControlRow) {
+ case 1:
+ ConfMan.setBool("sfx_mute", !ConfMan.getBool("sfx_mute"));
+ break;
+ case 2: {
+ const int talkMode = (getTalkMode() + 1) % 3;
+ ConfMan.setBool("speech_mute", talkMode == kTalkModeTextOnly);
+ ConfMan.setBool("subtitles", talkMode != kTalkModeSpeechOnly);
+ _gameState.talkSpeed = talkMode == kTalkModeTextOnly ? 3
+ : (talkMode == kTalkModeSpeechOnly ? 7 : 6);
+ break;
+ }
+ case 3:
+ ConfMan.setBool("music_mute", !ConfMan.getBool("music_mute"));
+ break;
+ case 4:
+ _gameState.talkSpeed = _gameState.talkSpeed == 5 ? 1 : _gameState.talkSpeed + 1;
+ break;
}
- handleOptionsMenu_paintCtrl();
+ syncSoundSettings();
+ ConfMan.flushToDisk();
break;
+ default:
+ return false;
}
+ handleOptionsMenu_paintCtrl();
return false;
}
static void drawButtonsBar(uint8 *dst, const uint8 *src) {
@@ -339,6 +366,8 @@ void IgorEngine::handleOptionsMenu() {
memset(_screenTextLayer + (y + 3) * 320 + 44, 0xF8, 232);
}
drawOptionsMenuText(pages[currentPage].captions[1], pages[currentPage].xPos[1], yPosCaption, 0xFB);
+ if (currentPage == kPageCtrl)
+ _optionsControlRow = (_game.flags & kFlagTalkie) ? 1 : 4;
(this->*pages[currentPage].paintProc)();
focusOnPage = true;
}
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index ba186b7bd02..c4ae0202190 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -36,7 +36,7 @@ void IgorEngine::setupDefaultPalette() {
void IgorEngine::scrollPalette(int startColor, int endColor) {
uint8 c[3];
// Rotate toward higher indices: save the last color, shift the range right,
- // and wrap the saved color to the start. cseg182:0016-00A1
+ // and wrap the saved color to the start.
memcpy(c, &_currentPalette[endColor * 3], 3);
memmove(&_currentPalette[(startColor + 1) * 3], &_currentPalette[startColor * 3], (endColor - startColor) * 3);
memcpy(&_currentPalette[startColor * 3], c, 3);
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index bc722ff00b3..9fb7596d482 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -110,7 +110,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
case 109: // take alarm clock
if (_objectsState[9] == 0) {
animateLitAnimFrames(0x8410, 0, 1, 0x405, 21, 49, 0x693D, 126, -1, 0);
- addObjectToInventory(6, 41); // s3:0903; cseg206:113C-1176
+ addObjectToInventory(6, 41);
_objectsState[9] = 1;
PART_00_APPLY_OBJECT_STATE(1);
}
@@ -147,7 +147,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
case 116: // take records
if (_objectsState[12] == 0) {
animateLitAnimFrames(0x7C06, 0, 1, 0x405, 21, 49, 0x7146, 126, -1, 0);
- addObjectToInventory(5, 40); // s3:0902; cseg206:0F75-0FAF
+ addObjectToInventory(5, 40);
_objectsState[12] = 1;
PART_00_APPLY_OBJECT_STATE(255);
} else {
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 3d6e354479d..71a27cb7949 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -174,7 +174,7 @@ void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
}
waitForTimer(30);
}
- ADD_DIALOGUE_TEXT(209, 2, 794); // cseg171:0AA0-0ABC
+ ADD_DIALOGUE_TEXT(209, 2, 794);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
waitForEndOfIgorDialogue();
@@ -242,7 +242,7 @@ void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
addObjectToInventory(24, 59);
_objectsState[44] = 1;
PART_12_OBJECT_STATE(255);
- ADD_DIALOGUE_TEXT(211, 1, 795); // cseg171:0EBF-0EDB
+ ADD_DIALOGUE_TEXT(211, 1, 795);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
@@ -533,8 +533,8 @@ void IgorEngine::PART_12() {
if (_currentPart == 121) {
PART_12_HELPER_6_enterFromChurch();
if (_objectsState[106] == 1) {
- ADD_DIALOGUE_TEXT(216, 2, 799); // cseg171:3766-3772
- ADD_DIALOGUE_TEXT(218, 1, 800); // cseg171:3778-3784
+ ADD_DIALOGUE_TEXT(216, 2, 799);
+ ADD_DIALOGUE_TEXT(218, 1, 800);
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue();
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 25eeb7efd7b..69c53d1751c 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -173,15 +173,10 @@ void IgorEngine::PART_17_ACTION_106_swapFolders() {
}
playSound(24, 1);
- // The pair record for action 106 is { 106, 5 }; selector 5 makes the common
- // input handler walk to object2, the room folder beside Philip and Jimmy,
- // before dispatching this action. Its walk point is (104, 87). The action
- // animation itself has the fixed destination 0x311F.
- // DAT_OutsideCollege use matrix offset 0x68E; cseg141:0A89,0AEE.
const int offset = 0x311F;
- for (int j = 0; j <= 8; ++j) { // frames 0..8; cseg141:0A7E-0AEC
- drawAnimRect(offset, 0x1E6E + j * 1120, 40, 28);
+ for (int frame = 0; frame <= 8; ++frame) {
+ drawAnimRect(offset, 0x1E6E + frame * 1120, 40, 28);
waitForTimer(30);
}
@@ -207,7 +202,7 @@ void IgorEngine::PART_17_ACTION_106_swapFolders() {
_gameState.igorMoving = true;
waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
// Creo q no ha notado nada
- ADD_DIALOGUE_TEXT(223, 2, 647); // cseg141:0B75-0B81
+ ADD_DIALOGUE_TEXT(223, 2, 647);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index 356a664be88..ec2503cf3ff 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -20,7 +20,7 @@ void IgorEngine::PART_02_SEARCH_TRUNK() {
void IgorEngine::PART_02_DRAW_FUSE_SPARK(int frame) {
// Four 12x12 spark frames are stored at animation offset 0x7FCB and are
- // composited over the fuse at screen offset 0x5996. cseg203:1339-1443
+ // composited over the fuse at screen offset 0x5996.
const uint8 *src = _animFramesBuffer + 0x7FCB + frame * 0x90;
for (int y = 0; y < 12; ++y) {
for (int x = 0; x < 12; ++x) {
@@ -145,7 +145,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
igorSay(217, 1, 121);
break;
}
- case 104: { // use the pick on the crack; cseg203:0838-0A2C
+ case 104: { // use the pick on the crack;
if (_objectsState[23] == 1) {
EXEC_MAIN_ACTION(2);
break;
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index 92a0579ef9c..f1cb762d724 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -151,7 +151,7 @@ void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
loadActionData(DAT_DeanPepperOffice);
loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice, BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice);
_roomDataOffsets = PART_08_ROOM_DATA_OFFSETS;
- setRoomClickFix(143, -1, 281, false); // cseg100:0657
+ setRoomClickFix(143, -1, 281, false);
PART_08_APPLY_OBJECT_STATE(255);
memcpy(_screenVGA, roomScreen, 46080);
free(roomScreen);
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 81e75908652..5e1105447ce 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -137,7 +137,7 @@ void IgorEngine::loadDialogueData(int dlg) {
int replySoundsSize = _roomDataOffsets.dlg.replySoundsSize;
if (questionSoundsOffset == 0) {
// The packed tail shares the last question word with the reply table's
- // leading residue word. cseg172:043B-0452,0A4A-0A92.
+ // leading residue word.
questionSoundsOffset = dataSize - (_roomDataOffsets.dlg.questionsSize + _roomDataOffsets.dlg.repliesSize + 1) * 2;
replySoundsOffset = questionSoundsOffset + _roomDataOffsets.dlg.questionsSize * 2;
replySoundsSize = _roomDataOffsets.dlg.repliesSize;
@@ -150,7 +150,7 @@ void IgorEngine::loadDialogueData(int dlg) {
assert(_roomDataOffsets.dlg.repliesSize <= MAX_DIALOGUE_REPLIES);
assert(replySoundsOffset + (replySoundsSize + 1) * 2 <= dataSize);
for (int i = 0; i < replySoundsSize; ++i) {
- _dialogueReplySounds[i] = READ_LE_UINT16(p + replySoundsOffset + (i + 1) * 2); // cseg172:0A59-0A82
+ _dialogueReplySounds[i] = READ_LE_UINT16(p + replySoundsOffset + (i + 1) * 2);
}
for (int i = 0; i < _roomDataOffsets.dlg.questionsSize; ++i) {
for (int n = 0; n < 2; ++n) {
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index ac8323f2706..0f004be7ef4 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -491,9 +491,9 @@
// CD-only intro card shown by state 850. All three resources are contiguous in
// NE segment 209 immediately after the intro code.
-#define FRM_IgorIntroLogo 913 // cseg209:13BE; IGOR.EXE:0x7C09BE, 206x13
-#define IMG_IgorIntroLogo 914 // cseg209:1E34; IGOR.EXE:0x7C1434, 320x122
-#define PAL_IgorIntroLogo 915 // cseg209:B6B4; IGOR.EXE:0x7CACB4, 768 bytes
+#define FRM_IgorIntroLogo 913
+#define IMG_IgorIntroLogo 914
+#define PAL_IgorIntroLogo 915
#define DAT_AdministrationCorridor 916
#define ANM_AdministrationCorridor 917
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index c2f7569c368..3292cdd59f9 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -21,11 +21,51 @@
#include "audio/decoders/raw.h"
#include "audio/decoders/voc.h"
#include "backends/audiocd/audiocd.h"
+#include "common/config-manager.h"
#include "igor/igor.h"
namespace Igor {
+int IgorEngine::getTalkMode() const {
+ if (!(_game.flags & kFlagTalkie) || ConfMan.getBool("mute") || ConfMan.getBool("speech_mute"))
+ return kTalkModeTextOnly;
+ return CLIP<int>(_gameState.talkMode, kTalkModeSpeechOnly, kTalkModeTextOnly);
+}
+
+void IgorEngine::syncSoundSettings() {
+ Engine::syncSoundSettings();
+ const bool mute = ConfMan.getBool("mute");
+ const bool musicMute = mute || ConfMan.getBool("music_mute");
+ const bool sfxMute = mute || ConfMan.getBool("sfx_mute");
+ const bool speechMute = mute || ConfMan.getBool("speech_mute") || !(_game.flags & kFlagTalkie);
+ _mixer->muteSoundType(Audio::Mixer::kMusicSoundType, musicMute);
+ _mixer->muteSoundType(Audio::Mixer::kSFXSoundType, sfxMute);
+ _mixer->muteSoundType(Audio::Mixer::kSpeechSoundType, speechMute);
+ _system->getAudioCDManager()->setVolume(musicMute ? 0 : Audio::Mixer::kMaxChannelVolume);
+ _gameState.configSoundEnabled = sfxMute ? 0 : 1;
+
+ _gameState.talkMode = speechMute ? kTalkModeTextOnly
+ : (ConfMan.getBool("subtitles") ? kTalkModeSpeechAndText : kTalkModeSpeechOnly);
+
+ if (speechMute && (_gameState.talkSpeed < 1 || _gameState.talkSpeed > 5))
+ _gameState.talkSpeed = 3;
+ if (sfxMute)
+ _mixer->stopHandle(_sfxHandle);
+
+ if (speechMute) {
+ stopDialogueSpeech();
+ // Disabling speech during a sentence reveals its text and starts the
+ // same reading timer used by sentences begun in text-only mode.
+ if (_gameState.dialogueTextRunning && _talkDelay < 0) {
+ _talkDelay = 2 * _dialogueTextsTable[_dialogueTextsStart].count
+ * _talkDelays[CLIP<int>(_gameState.talkSpeed, 1, 5)];
+ _talkDelayCounter = 0;
+ memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer, _dialogueDirtyRectSize);
+ }
+ }
+}
+
void IgorEngine::playMusic(int num, bool restart) {
debugC(9, kDebugEngine, "playMusic() %d", num);
if (_gameState.musicNum == num && !restart)
@@ -45,6 +85,12 @@ void IgorEngine::playMusic(int num, bool restart) {
}
void IgorEngine::playSound(int num, int type) {
+ if (type == 1 && (ConfMan.getBool("mute") || ConfMan.getBool("sfx_mute")))
+ return;
+ if (type == 0 && getTalkMode() == kTalkModeTextOnly) {
+ stopDialogueSpeech();
+ return;
+ }
// A zero or "no speech" number means the line has no recorded speech
if (type == 0 && (num == 0 || num == kNoSpeechSound)) {
diff --git a/engines/igor/statics.h b/engines/igor/statics.h
index f62e82d5030..777612d0d6f 100644
--- a/engines/igor/statics.h
+++ b/engines/igor/statics.h
@@ -27,7 +27,6 @@
namespace Igor {
// Shared animation frame buffer offsets for Part 10 & Part 11
-// Ground truth: code/175_2767.asm cseg175:2815, cseg177:0064, cseg177:0097, cseg177:00CA, cseg177:00FD
const uint32 kPart10_11_Frm1 = 0xB400; // cseg175:2815
const uint32 kPart10_11_Frm2 = 0xBC0A; // cseg177:0064
const uint32 kPart10_11_Frm3 = 0xC5E2; // cseg177:0097
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 9bdb16d13a2..24d62e582c5 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -190,22 +190,9 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
}
setPaletteColor(_talkColorIndex, r, g, b);
setPaletteColor(_talkShadowIndex, 0, 0, 0);
- // Only update the VGA screen buffer if not in spech-only mode
- if (_gameState.talkMode != kTalkModeSpeechOnly) {
+ const int talkMode = prepareDialoguePlayback(*dt);
+ if (talkMode != kTalkModeSpeechOnly)
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer, _dialogueDirtyRectSize);
- }
- // If on text mode, the game has a text delay
- if (_gameState.talkMode == kTalkModeTextOnly) {
- _talkDelay = (2 * dt->count) * _talkDelays[_gameState.talkSpeed];
- _talkDelayCounter = 0;
- } else {
- _talkDelay = -1;
- _talkDelayCounter = 0;
- }
- if (_gameState.talkMode != kTalkModeTextOnly) {
- // Play speech
- playSound(dt->sound, 0);
- }
_gameState.dialogueTextRunning = true;
_inputVars[kInputSkipDialogue] = 0;
}
@@ -291,8 +278,8 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
_inputVars[kInputSkipDialogue] = 0;
}
// Speech completion ends the sentence; active speech does not suspend
- // character animation. See cseg209:0x0802-0x0843.
- if (_gameState.dialogueTextRunning && _gameState.talkMode != kTalkModeTextOnly && !isDialogueSpeechPlaying()) {
+ // character animation.
+ if (_gameState.dialogueTextRunning && _talkDelay < 0 && !isDialogueSpeechPlaying()) {
_talkDelayCounter = _talkDelay;
}
if (compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
@@ -309,7 +296,7 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
_gameState.dialogueTextRunning = 0;
} else {
++_dialogueTextsStart;
- if (_gameState.talkMode != kTalkModeTextOnly) {
+ if (_talkDelay < 0) {
if (_talkSpeechCounter != -1) {
_talkSpeechCounter = 0;
} else {
@@ -355,8 +342,26 @@ void IgorEngine::fixIgorDialogueTextPosition(int num, int count, int *x, int *y)
fixDialogueTextPosition(num, count, x, y);
}
+int IgorEngine::prepareDialoguePlayback(const DialogueText &text) {
+ stopDialogueSpeech();
+ int talkMode = getTalkMode();
+ if (talkMode != kTalkModeTextOnly) {
+ // play speech file
+ playSound(text.sound, 0);
+ }
+ if (!isDialogueSpeechPlaying())
+ talkMode = kTalkModeTextOnly;
+ // Speech modes use speed markers instead of a reading speed. Falling
+ // back to text selects normal speed, as switching to text-only does.
+ const int talkSpeed = (_gameState.talkSpeed >= 1 && _gameState.talkSpeed <= 5)
+ ? _gameState.talkSpeed : 3;
+ _talkDelay = talkMode == kTalkModeTextOnly? 2 * text.count * _talkDelays[talkSpeed] : -1;
+ _talkDelayCounter = 0;
+ return talkMode;
+}
+
bool IgorEngine::isDialogueSpeechPlaying() const {
- return _gameState.talkMode != kTalkModeTextOnly && _mixer->isSoundHandleActive(_speechHandle);
+ return _mixer->isSoundHandleActive(_speechHandle);
}
void IgorEngine::stopDialogueSpeech() {
@@ -420,20 +425,9 @@ void IgorEngine::startIgorDialogue() {
}
setPaletteColor(_talkColorIndex, _dialogueColor[0], _dialogueColor[1], _dialogueColor[2]);
setPaletteColor(_talkShadowIndex, 0, 0, 0);
- if (_gameState.talkMode != kTalkModeSpeechOnly) {
+ const int talkMode = prepareDialoguePlayback(*dt);
+ if (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) {
- debug("Playing sound for igor dialogue text: %d", dt->sound);
- playSound(dt->sound, 0);
- }
_gameState.dialogueTextRunning = true;
_inputVars[kInputSkipDialogue] = 0;
}
@@ -450,8 +444,8 @@ void IgorEngine::waitForEndOfIgorDialogue(bool animateHead, bool updateRoomBackg
_inputVars[kInputSkipDialogue] = 0;
}
// Speech completion ends the sentence; active speech does not suspend
- // Igor's head animation. See cseg209:0x0B3D-0x0B7E.
- if (_gameState.dialogueTextRunning && _gameState.talkMode != kTalkModeTextOnly && !isDialogueSpeechPlaying()) {
+ // Igor's head animation.
+ if (_gameState.dialogueTextRunning && _talkDelay < 0 && !isDialogueSpeechPlaying()) {
_talkDelayCounter = _talkDelay;
}
if (compareGameTick(19, 32) && _gameState.dialogueTextRunning) {
@@ -466,7 +460,7 @@ void IgorEngine::waitForEndOfIgorDialogue(bool animateHead, bool updateRoomBackg
_gameState.dialogueTextRunning = 0;
} else {
++_dialogueTextsStart;
- if (_gameState.talkMode != kTalkModeTextOnly) {
+ if (_talkDelay < 0) {
if (_talkSpeechCounter != -1) {
_talkSpeechCounter = 0;
} else {
Commit: b0d7010534fd2db006073d2ac3d1d4f578386b43
https://github.com/scummvm/scummvm/commit/b0d7010534fd2db006073d2ac3d1d4f578386b43
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:53+01:00
Commit Message:
IGOR: Fix hotspot naming in lighthouse scene
Changed paths:
engines/igor/igor.h
engines/igor/part_main.cpp
engines/igor/parts/part_69.cpp
engines/igor/parts/part_74.cpp
engines/igor/parts/part_77.cpp
engines/igor/parts/part_78.cpp
engines/igor/parts/part_80.cpp
engines/igor/parts/part_81.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index a3878aab2bd..19a1c9f1f66 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1231,7 +1231,7 @@ private:
void PART_74_UPDATE_DIALOGUE_CaptainA(int action);
void PART_74_UPDATE_DIALOGUE_CaptainB(int action);
void PART_74_SAY(int who, const Common::Array<DialogueText> &lines);
- void PART_74_CUTSCENE();
+ void PART_74_shipCutscene();
// philip vodka cutscene
void PART_75_UPDATE_DIALOGUE_PHILIP(int action);
@@ -1256,20 +1256,20 @@ private:
void PART_77_enterFromCollege();
void PART_77();
- void PART_78_DRAW_FIGURE(int frame);
- void PART_78_DRAW_BACKGROUND_FRAME(int frame);
- void PART_78_DRAW_BAND(int frame);
- void PART_78_DRAW_PATCH(int frame);
- void PART_78_UPDATE_DIALOGUE_FIGURE_A(int action);
- void PART_78_UPDATE_DIALOGUE_FIGURE_B(int action);
- void PART_78_UPDATE_DIALOGUE_FIGURE_C(int action);
- void PART_78_UPDATE_DIALOGUE_BAND_A(int action);
- void PART_78_UPDATE_DIALOGUE_BAND_B(int action);
- void PART_78_UPDATE_DIALOGUE_PATCH(int action);
- void PART_78_SAY_START(int speaker, const Common::Array<DialogueText> &lines);
- void PART_78_WAIT_FOR_LINES(int speaker);
- void PART_78_SAY(int speaker, const Common::Array<DialogueText> &lines);
- void PART_78_INTERJECTION(int which);
+ void PART_78_drawProfessorFrame(int frame);
+ void PART_78_drawAlumniFrame(int frame);
+ void PART_78_drawIgorFrame(int frame);
+ void PART_78_drawPhilipFrame(int frame);
+ void PART_78_updateProfessorDialogueLeft(int action);
+ void PART_78_updateProfessorDialogueFromDesk(int action);
+ void PART_78_updateProfessorDialogueToIgor(int action);
+ void PART_78_updateIgorDialogueLeft(int action);
+ void PART_78_updateIgorDialogueRight(int action);
+ void PART_78_updatePhilipDialogue(int action);
+ void PART_78_sayStart(int speaker, const Common::Array<DialogueText> &lines);
+ void PART_78_waitForLines(int speaker);
+ void PART_78_say(int speaker, const Common::Array<DialogueText> &lines);
+ void PART_78_professorWarnings(int which);
void PART_78();
void PART_79_DRAW_FIGURE(int frame);
@@ -1300,34 +1300,34 @@ private:
void PART_79_791();
void PART_79();
- void PART_80_DRAW_PATCH(int frame);
- void PART_80_UPDATE_DIALOGUE_FIRST(int action);
- void PART_80_UPDATE_DIALOGUE_SECOND(int action);
- void PART_80_SAY(int who, const Common::Array<DialogueText> &lines);
+ void PART_80_drawFrame(int frame);
+ void PART_80_updateDialogueFriend(int action);
+ void PART_80_updateDialogueLaura(int action);
+ void PART_80_say(int who, const Common::Array<DialogueText> &lines);
void PART_80();
void PART_81_EXEC_ACTION(int action);
- void PART_81_LOAD_ROOM();
- void PART_81_LOAD_ANIMATION();
- void PART_81_DRAW_HEAD(int frame);
- void PART_81_DRAW_STORY_HEAD(int frame);
- void PART_81_DRAW_FIGURE(int offset);
- void PART_81_DRAW_END_FRAME(int frame);
+ void PART_81_loadRoom();
+ void PART_81_loadAnimation();
+ void PART_81_drawLighthouseKeeperHead(int frame);
+ void PART_81_drawLighthouseKeeper(int frame);
+ void PART_81_drawIgor(int offset);
+ void PART_81_drawLighthouseFrame(int frame);
void PART_81_UPDATE_ROOM_BACKGROUND();
- void PART_81_UPDATE_DIALOGUE_NPC(int action);
- void PART_81_NPC_SAY(const Common::Array<DialogueText> &lines);
- void PART_81_IGOR_SAY(int num, int count, int sound);
+ void PART_81_updateDialogueLighthouseKeeper(int action);
+ void PART_81_lighthouseKeeperSay(const Common::Array<DialogueText> &lines);
+ void PART_81_igorSay(int num, int count, int sound);
void PART_81_APPLY_OBJECT_STATE(int num);
- void PART_81_SCROLL_IN();
- void PART_81_TRANSITION_IN();
- void PART_81_TRANSITION_OUT();
- void PART_81_END_SCENE();
- void PART_81_ACTION_109();
- void PART_81_ACTION_110();
+ void PART_81_scrollIn();
+ void PART_81_transitionScrollUp();
+ void PART_81_transitionScrollDown();
+ void PART_81_lighthouseSendMessage();
+ void PART_81_ACTION_109_giveLampToLighthouseKeeper();
+ void PART_81_ACTION_110_rejectItem();
void PART_81_ACTION_102_talk();
void PART_81_DIALOGUE_CODE(int code);
- void PART_81_CONVERSATION();
- void PART_81_ENTER();
+ void PART_81_handleDialogue();
+ void PART_81_walkIn();
void PART_81();
// maze
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 835e61e2b02..b853fda7eee 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -265,7 +265,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
UPDATE_OBJECT_STATE(7);
addObjectToInventory(34, 69);
break;
- case 64:
+ case 64: // look at vase
if (_objectsState[6] == 0) {
ADD_DIALOGUE_TEXT(162, 1, 86);
} else if (_objectsState[6] == 1) {
@@ -690,7 +690,7 @@ void IgorEngine::PART_MAIN() {
PART_73_CUTSCENE(); // Cutscene followed by PART_80
break;
case 740:
- PART_74_CUTSCENE();
+ PART_74_shipCutscene();
break;
case 750:
PART_75(); // philip vodka cutscene
diff --git a/engines/igor/parts/part_69.cpp b/engines/igor/parts/part_69.cpp
index 6ac97b25142..79f4834904d 100644
--- a/engines/igor/parts/part_69.cpp
+++ b/engines/igor/parts/part_69.cpp
@@ -46,7 +46,7 @@ static const int kPart69SceneDoneState = 96;
static const int kPart69FlagState = 97;
static const int kPart69SequenceState = 98;
static const int kPart69SecondFireflyState = 99;
-static const int kPart69RewardState = 6;
+static const int kPart69VaseState = 6;
// The animation of the two fireflies is a sequence of steps (1 to 6). Each step plays the frames of the first firefly from
// the first to the last frame of the step; every 5 steps of the first firefly the second firefly plays too. The values come
@@ -203,7 +203,7 @@ void IgorEngine::PART_69_FINALE(int num, int sound) {
*/
void IgorEngine::PART_69_ACTION_107_watch() {
drawAnimRect(kPart69PictureOffset, kPart69PictureAnimOffset, kPart69PictureWidth, kPart69PictureHeight);
- if (_objectsState[kPart69RewardState] == 0) {
+ if (_objectsState[kPart69VaseState] == 0) {
for (int i = 0; i < 1000 / kTimerTicksCount && !_eventQuitGame; ++i) {
PART_69_ANIMATE_FIREFLIES();
waitForTimer();
@@ -241,7 +241,7 @@ void IgorEngine::PART_69_ACTION_107_watch() {
waitForTimer(255);
_objectsState[kPart69SceneDoneState] = 1;
- _objectsState[kPart69RewardState] = 2;
+ _objectsState[kPart69VaseState] = 2;
UPDATE_OBJECT_STATE(7);
drawInventory(_inventoryInfo[72], 0);
playSound(63, 1);
diff --git a/engines/igor/parts/part_74.cpp b/engines/igor/parts/part_74.cpp
index 87e2b659ace..3f64dba6702 100644
--- a/engines/igor/parts/part_74.cpp
+++ b/engines/igor/parts/part_74.cpp
@@ -108,7 +108,7 @@ void IgorEngine::PART_74_SAY(int who, const Common::Array<DialogueText> &lines)
/**
* Boat scene
*/
-void IgorEngine::PART_74_CUTSCENE() {
+void IgorEngine::PART_74_shipCutscene() {
UpdateRoomBackgroundProc previousBackground = _updateRoomBackground;
playMusic(4);
_gameState.enableLight = 1;
diff --git a/engines/igor/parts/part_77.cpp b/engines/igor/parts/part_77.cpp
index a099116f12c..fbeb2b8bad1 100644
--- a/engines/igor/parts/part_77.cpp
+++ b/engines/igor/parts/part_77.cpp
@@ -26,8 +26,8 @@ static const int kPart77MonkeyFramesTable = 0x67D2;
static const int kPart77MonkeyStandingFrame = 40;
-static const int kPart77TextX = 120;
-static const int kPart77TextY = 40;
+static const int kPart77MonkeyTextX = 120;
+static const int kPart77MonkeyTextY = 40;
static const uint8 kPart77CutsceneFrames[6] = { 17, 18, 17, 18, 17, 18 };
@@ -113,7 +113,7 @@ void IgorEngine::PART_77_ACTION_106_monkeyCageCutscene() {
PART_77_drawMonkeyFrame(i);
waitForTimer(31);
}
- cutsceneSayWithCallback(kPart77TextX, kPart77TextY, 63, 57, 0,
+ cutsceneSayWithCallback(kPart77MonkeyTextX, kPart77MonkeyTextY, 63, 57, 0,
{ { 210, 2, 1126 }, { 212, 2, 1127 }, { 214, 1, 1128 }, { 215, 2, 1129 }, { 217, 2, 1130 } },
&IgorEngine::PART_77_UPDATE_DIALOGUE);
waitForTimer(255);
diff --git a/engines/igor/parts/part_78.cpp b/engines/igor/parts/part_78.cpp
index 7d4c615b5c5..32c08431490 100644
--- a/engines/igor/parts/part_78.cpp
+++ b/engines/igor/parts/part_78.cpp
@@ -22,24 +22,19 @@
namespace Igor {
-// The animation resource ends with four tables of offsets, one word per frame (frame 1 first): the frames drawn
-// over the whole picture, the pieces of the picture kept in the second layer, the frames of a band of the picture
-// that are kept in a resource of their own and, last, the tiles of a small patch of the picture.
-static const int kPart78FigureTable = 0xF832;
-static const int kPart78BackgroundTable = 0xF8B2;
-static const int kPart78BandTable = 0xF8D0;
-static const int kPart78PatchTiles = 0xF8EE;
-// The patch is a 12x12 area of the picture cut from 13x13 tiles.
-static const int kPart78PatchTileSize = 13 * 13;
-static const int kPart78PatchOffset = 57 * 320 + 72;
-static const int kPart78PatchSize = 12;
+static const int kPart78ProfessorTable = 0xF832;
+static const int kPart78AlumniTable = 0xF8B2;
+static const int kPart78IgorTable = 0xF8D0;
+static const int kPart78PhilipTiles = 0xF8EE;
+
+static const int kPart78PhilipTileSize = 13 * 13;
+static const int kPart78PhilipOffset = 57 * 320 + 72;
+static const int kPart78PhilipSize = 12;
// The scene draws its text with this color index instead of the usual one.
static const int kPart78TalkColor = 242;
-// The figure that is drawn first is also the first of the frames of the loop of the first part of the scene. The
-// loop goes through the steps 1 to 44, one step every 32 ticks, and each step shows the frame of this table.
static const int kPart78FirstFigure = 0x16;
static const int kPart78StepFirstRepeat = 0x16;
static const int kPart78StepLast = 0x2C;
@@ -48,140 +43,140 @@ static const uint8 kPart78StepFrames[45] = {
24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45
};
-// Who talks: the three figures drawn over the whole picture, the two frame sets of the band and the patch.
+// speakers
enum {
- kPart78FigureA,
- kPart78FigureB,
- kPart78FigureC,
- kPart78BandA,
- kPart78BandB,
- kPart78Patch
+ kPart78ProfessorLeft,
+ kPart78ProfessorFromDesk,
+ kPart78ProfessorToIgor,
+ kPart78IgorLeft, // to Harrison / Philip
+ kPart78IgorRight, // to professor
+ kPart78Philip
};
-void IgorEngine::PART_78_DRAW_FIGURE(int frame) {
- decodeAnimFrame(getAnimFrame(0, kPart78FigureTable, frame), _screenVGA, false);
+void IgorEngine::PART_78_drawProfessorFrame(int frame) {
+ decodeAnimFrame(getAnimFrame(0, kPart78ProfessorTable, frame), _screenVGA, false);
}
-void IgorEngine::PART_78_DRAW_BACKGROUND_FRAME(int frame) {
- const int offset = READ_LE_UINT16(_animFramesBuffer + kPart78BackgroundTable + (frame - 1) * 2);
+void IgorEngine::PART_78_drawAlumniFrame(int frame) {
+ const int offset = READ_LE_UINT16(_animFramesBuffer + kPart78AlumniTable + (frame - 1) * 2);
decodeAnimFrame(_screenLayer2 + offset, _screenVGA, false);
}
-void IgorEngine::PART_78_DRAW_BAND(int frame) {
- const int offset = READ_LE_UINT16(_animFramesBuffer + kPart78BandTable + (frame - 1) * 2);
+void IgorEngine::PART_78_drawIgorFrame(int frame) {
+ const int offset = READ_LE_UINT16(_animFramesBuffer + kPart78IgorTable + (frame - 1) * 2);
decodeAnimFrame(_part78BandFrames + offset - 1, _screenVGA, false);
}
-void IgorEngine::PART_78_DRAW_PATCH(int frame) {
- copyArea(_screenVGA, kPart78PatchOffset, 320, _animFramesBuffer + kPart78PatchTiles + (frame - 1) * kPart78PatchTileSize,
- 13, kPart78PatchSize, kPart78PatchSize);
+void IgorEngine::PART_78_drawPhilipFrame(int frame) {
+ copyArea(_screenVGA, kPart78PhilipOffset, 320, _animFramesBuffer + kPart78PhilipTiles + (frame - 1) * kPart78PhilipTileSize,
+ 13, kPart78PhilipSize, kPart78PhilipSize);
}
-void IgorEngine::PART_78_UPDATE_DIALOGUE_FIGURE_A(int action) {
+void IgorEngine::PART_78_updateProfessorDialogueLeft(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_78_DRAW_FIGURE(0x3B);
+ PART_78_drawProfessorFrame(0x3B);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_78_DRAW_FIGURE(0x3B + getRandomNumber(4));
+ PART_78_drawProfessorFrame(0x3B + getRandomNumber(4));
break;
}
}
-void IgorEngine::PART_78_UPDATE_DIALOGUE_FIGURE_B(int action) {
+void IgorEngine::PART_78_updateProfessorDialogueFromDesk(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_78_DRAW_FIGURE(0x16);
+ PART_78_drawProfessorFrame(0x16);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_78_DRAW_FIGURE(0x16 + getRandomNumber(1));
+ PART_78_drawProfessorFrame(0x16 + getRandomNumber(1));
break;
}
}
-void IgorEngine::PART_78_UPDATE_DIALOGUE_FIGURE_C(int action) {
+void IgorEngine::PART_78_updateProfessorDialogueToIgor(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_78_DRAW_FIGURE(0x2D);
+ PART_78_drawProfessorFrame(0x2D);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_78_DRAW_FIGURE(0x2D + getRandomNumber(1));
+ PART_78_drawProfessorFrame(0x2D + getRandomNumber(1));
break;
}
}
-void IgorEngine::PART_78_UPDATE_DIALOGUE_BAND_A(int action) {
+void IgorEngine::PART_78_updateIgorDialogueLeft(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_78_DRAW_BAND(8);
+ PART_78_drawIgorFrame(8);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_78_DRAW_BAND(8 + getRandomNumber(3));
+ PART_78_drawIgorFrame(8 + getRandomNumber(3));
break;
}
}
-void IgorEngine::PART_78_UPDATE_DIALOGUE_BAND_B(int action) {
+void IgorEngine::PART_78_updateIgorDialogueRight(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_78_DRAW_BAND(12);
+ PART_78_drawIgorFrame(12);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_78_DRAW_BAND(12 + getRandomNumber(3));
+ PART_78_drawIgorFrame(12 + getRandomNumber(3));
break;
}
}
-void IgorEngine::PART_78_UPDATE_DIALOGUE_PATCH(int action) {
+void IgorEngine::PART_78_updatePhilipDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_78_DRAW_PATCH(1);
+ PART_78_drawPhilipFrame(1);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_78_DRAW_PATCH(getRandomNumber(3) + 1);
+ PART_78_drawPhilipFrame(getRandomNumber(3) + 1);
break;
}
}
/**
- * Starts the lines of one of the speakers. The caller waits for them with PART_78_WAIT_FOR_LINES.
+ * Starts the lines of one of the speakers. The caller waits for them with PART_78_waitForLines.
*/
-void IgorEngine::PART_78_SAY_START(int speaker, const Common::Array<DialogueText> &lines) {
+void IgorEngine::PART_78_sayStart(int speaker, const Common::Array<DialogueText> &lines) {
switch (speaker) {
- case kPart78FigureA:
- cutsceneSayStartWithCallback(173, 65, 0, 43, 43, lines, &IgorEngine::PART_78_UPDATE_DIALOGUE_FIGURE_A);
+ case kPart78ProfessorLeft:
+ cutsceneSayStartWithCallback(173, 65, 0, 43, 43, lines, &IgorEngine::PART_78_updateProfessorDialogueLeft);
break;
- case kPart78FigureB:
- cutsceneSayStartWithCallback(260, 91, 0, 43, 43, lines, &IgorEngine::PART_78_UPDATE_DIALOGUE_FIGURE_B);
+ case kPart78ProfessorFromDesk:
+ cutsceneSayStartWithCallback(260, 91, 0, 43, 43, lines, &IgorEngine::PART_78_updateProfessorDialogueFromDesk);
break;
- case kPart78FigureC:
- cutsceneSayStartWithCallback(98, 90, 0, 43, 43, lines, &IgorEngine::PART_78_UPDATE_DIALOGUE_FIGURE_C);
+ case kPart78ProfessorToIgor:
+ cutsceneSayStartWithCallback(98, 90, 0, 43, 43, lines, &IgorEngine::PART_78_updateProfessorDialogueToIgor);
break;
- case kPart78BandA:
- cutsceneSayStartWithCallback(142, 58, 63, 63, 63, lines, &IgorEngine::PART_78_UPDATE_DIALOGUE_BAND_A);
+ case kPart78IgorLeft:
+ cutsceneSayStartWithCallback(142, 58, 63, 63, 63, lines, &IgorEngine::PART_78_updateIgorDialogueLeft);
break;
- case kPart78BandB:
- cutsceneSayStartWithCallback(142, 58, 63, 63, 63, lines, &IgorEngine::PART_78_UPDATE_DIALOGUE_BAND_B);
+ case kPart78IgorRight:
+ cutsceneSayStartWithCallback(142, 58, 63, 63, 63, lines, &IgorEngine::PART_78_updateIgorDialogueRight);
break;
default:
- cutsceneSayStartWithCallback(78, 54, 63, 63, 0, lines, &IgorEngine::PART_78_UPDATE_DIALOGUE_PATCH);
+ cutsceneSayStartWithCallback(78, 54, 63, 63, 0, lines, &IgorEngine::PART_78_updatePhilipDialogue);
break;
}
}
-void IgorEngine::PART_78_WAIT_FOR_LINES(int speaker) {
+void IgorEngine::PART_78_waitForLines(int speaker) {
switch (speaker) {
- case kPart78FigureA:
+ case kPart78ProfessorLeft:
waitForEndOfCutsceneDialogue(173, 65, 0, 43, 43);
break;
- case kPart78FigureB:
+ case kPart78ProfessorFromDesk:
waitForEndOfCutsceneDialogue(260, 91, 0, 43, 43);
break;
- case kPart78FigureC:
+ case kPart78ProfessorToIgor:
waitForEndOfCutsceneDialogue(98, 90, 0, 43, 43);
break;
- case kPart78BandA:
- case kPart78BandB:
+ case kPart78IgorLeft:
+ case kPart78IgorRight:
waitForEndOfCutsceneDialogue(142, 58, 63, 63, 63);
break;
default:
@@ -191,24 +186,20 @@ void IgorEngine::PART_78_WAIT_FOR_LINES(int speaker) {
_updateDialogue = nullptr;
}
-void IgorEngine::PART_78_SAY(int speaker, const Common::Array<DialogueText> &lines) {
- PART_78_SAY_START(speaker, lines);
- PART_78_WAIT_FOR_LINES(speaker);
+void IgorEngine::PART_78_say(int speaker, const Common::Array<DialogueText> &lines) {
+ PART_78_sayStart(speaker, lines);
+ PART_78_waitForLines(speaker);
}
-/**
- * One of the three short lines said at random while the first part of the scene goes on.
- */
-void IgorEngine::PART_78_INTERJECTION(int which) {
+void IgorEngine::PART_78_professorWarnings(int which) {
static const DialogueText kLines[3] = { { 211, 1, 676 }, { 212, 1, 677 }, { 213, 1, 678 } };
Common::Array<DialogueText> lines;
lines.push_back(kLines[which - 1]);
- PART_78_SAY(_roomAmbientIndex == 0x16 ? kPart78FigureB : kPart78FigureC, lines);
+ PART_78_say(_roomAmbientIndex == 0x16 ? kPart78ProfessorFromDesk : kPart78ProfessorToIgor, lines);
}
void IgorEngine::PART_78() {
playMusic(11);
- // the card with the time that has passed
PART_meanwhile(IMG_Part78MinutesLater);
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
@@ -217,21 +208,21 @@ void IgorEngine::PART_78() {
loadRoomData(PAL_Part78, IMG_Part78, BOX_Part78, 0, TXT_Part78);
static const int anim[] = { ANM_Part78, 0 };
loadAnimData(anim);
- // the second layer holds the pieces of the picture, starting at its second byte
+
loadData(IMG_Part78Layer2, _screenLayer2 + 1);
_part78BandFrames = loadData(ANM_Part78Frames);
memcpy(_screenVGA, _screenLayer1, 46080);
- PART_78_DRAW_FIGURE(kPart78FirstFigure);
- PART_78_DRAW_BAND(1);
+ PART_78_drawProfessorFrame(kPart78FirstFigure);
+ PART_78_drawIgorFrame(1);
memset(_currentPalette, 0, 768);
setPaletteRange(208, 255);
fadeIn(768);
_gameState.igorMoving = false;
_talkColorIndex = kPart78TalkColor;
- PART_78_SAY(kPart78FigureB, { { 204, 1, 671 }, { 205, 2, 672 }, { 207, 1, 673 }, { 208, 2, 674 }, { 210, 1, 675 } });
+ PART_78_say(kPart78ProfessorFromDesk, { { 204, 1, 671 }, { 205, 2, 672 }, { 207, 1, 673 }, { 208, 2, 674 }, { 210, 1, 675 } });
- // the figures go through their frames while one of them talks now and then, until five turns are done
+ // alumni move while professor talks now and then, until five turns are done
_roomAmbientIndex = kPart78StepFirstRepeat;
int turns = 1;
while (turns <= 5) {
@@ -244,52 +235,52 @@ void IgorEngine::PART_78() {
if (_roomAmbientIndex == kPart78StepFirstRepeat) {
++turns;
}
- PART_78_DRAW_FIGURE(kPart78StepFrames[_roomAmbientIndex]);
+ PART_78_drawProfessorFrame(kPart78StepFrames[_roomAmbientIndex]);
if ((_roomAmbientIndex == kPart78StepFirstRepeat || _roomAmbientIndex == kPart78StepLast) && turns <= 5) {
if (getRandomNumber(2) == 0) {
- PART_78_INTERJECTION(getRandomNumber(2) + 1);
+ PART_78_professorWarnings(getRandomNumber(2) + 1);
}
}
}
if (compareGameTick(0x3D)) {
- PART_78_DRAW_BACKGROUND_FRAME(getRandomNumber(13) + 2);
- PART_78_DRAW_BAND(getRandomNumber(4) + 1);
+ PART_78_drawAlumniFrame(getRandomNumber(13) + 2);
+ PART_78_drawIgorFrame(getRandomNumber(4) + 1);
}
waitForTimer();
}
for (int i = 6; i <= 7; ++i) {
- PART_78_DRAW_BAND(i);
+ PART_78_drawIgorFrame(i);
waitForTimer(90);
}
- PART_78_DRAW_BAND(3);
- PART_78_SAY_START(kPart78BandA, { { 201, 1, 668 } });
- PART_78_DRAW_FIGURE(0x2F);
- PART_78_WAIT_FOR_LINES(kPart78BandA);
- PART_78_DRAW_BACKGROUND_FRAME(1);
- PART_78_DRAW_BAND(2);
+ PART_78_drawIgorFrame(3);
+ PART_78_sayStart(kPart78IgorLeft, { { 201, 1, 668 } });
+ PART_78_drawProfessorFrame(0x2F);
+ PART_78_waitForLines(kPart78IgorLeft);
+ PART_78_drawAlumniFrame(1);
+ PART_78_drawIgorFrame(2);
- PART_78_SAY(kPart78FigureB, { { 214, 1, 679 } });
+ PART_78_say(kPart78ProfessorFromDesk, { { 214, 1, 679 } });
for (int i = 0x30; i <= 0x3A; ++i) {
- PART_78_DRAW_FIGURE(i);
+ PART_78_drawProfessorFrame(i);
waitForTimer(40);
}
- PART_78_SAY(kPart78FigureA, { { 215, 1, 680 } });
- PART_78_SAY(kPart78BandB, { { 216, 1, 681 } });
- PART_78_SAY(kPart78FigureA, { { 217, 1, 682 }, { 218, 1, 683 } });
- PART_78_SAY(kPart78BandB, { { 219, 1, 684 } });
- PART_78_SAY(kPart78FigureA, { { 235, 1, 698 }, { 236, 2, 699 } });
- PART_78_SAY(kPart78BandB, { { 222, 1, 685 }, { 223, 1, 686 } });
- PART_78_DRAW_BAND(3);
- PART_78_SAY(kPart78Patch, { { 224, 1, 687 }, { 225, 1, 688 }, { 226, 1, 689 } });
- PART_78_DRAW_BAND(2);
- PART_78_SAY(kPart78FigureA, { { 227, 1, 690 }, { 228, 1, 691 } });
- PART_78_DRAW_BAND(3);
- PART_78_SAY(kPart78Patch, { { 229, 1, 692 }, { 230, 1, 693 } });
- PART_78_DRAW_BAND(2);
- PART_78_SAY(kPart78FigureA, { { 231, 1, 694 }, { 232, 1, 695 }, { 233, 1, 696 }, { 234, 1, 697 } });
+ PART_78_say(kPart78ProfessorLeft, { { 215, 1, 680 } });
+ PART_78_say(kPart78IgorRight, { { 216, 1, 681 } });
+ PART_78_say(kPart78ProfessorLeft, { { 217, 1, 682 }, { 218, 1, 683 } });
+ PART_78_say(kPart78IgorRight, { { 219, 1, 684 } });
+ PART_78_say(kPart78ProfessorLeft, { { 235, 1, 698 }, { 236, 2, 699 } });
+ PART_78_say(kPart78IgorRight, { { 222, 1, 685 }, { 223, 1, 686 } });
+ PART_78_drawIgorFrame(3);
+ PART_78_say(kPart78Philip, { { 224, 1, 687 }, { 225, 1, 688 }, { 226, 1, 689 } });
+ PART_78_drawIgorFrame(2);
+ PART_78_say(kPart78ProfessorLeft, { { 227, 1, 690 }, { 228, 1, 691 } });
+ PART_78_drawIgorFrame(3);
+ PART_78_say(kPart78Philip, { { 229, 1, 692 }, { 230, 1, 693 } });
+ PART_78_drawIgorFrame(2);
+ PART_78_say(kPart78ProfessorLeft, { { 231, 1, 694 }, { 232, 1, 695 }, { 233, 1, 696 }, { 234, 1, 697 } });
- PART_78_DRAW_FIGURE(0x40);
+ PART_78_drawProfessorFrame(0x40);
waitForTimer(255);
waitForTimer(255);
waitForTimer(255);
diff --git a/engines/igor/parts/part_80.cpp b/engines/igor/parts/part_80.cpp
index 24ed57df232..0ae59196227 100644
--- a/engines/igor/parts/part_80.cpp
+++ b/engines/igor/parts/part_80.cpp
@@ -22,63 +22,62 @@
namespace Igor {
-// A 50x29 area of the picture is redrawn from the animation resource, whose frames are 50x29 (1450 bytes) each.
+// Laura and friend talking are actually the same screen patch
static const int kPart80PatchOffset = 62 * 320 + 135;
static const int kPart80PatchWidth = 50;
static const int kPart80PatchHeight = 29;
static const int kPart80PatchFrameSize = 1450;
-// Four frames of 28x69 are drawn into the picture at the end of the scene; they start at this offset of the animation
-// resource.
-static const int kPart80ObjectOffset = 68 * 320 + 121;
-static const int kPart80ObjectWidth = 28;
-static const int kPart80ObjectHeight = 69;
-static const int kPart80ObjectFrameSize = 0x78C;
-static const int kPart80ObjectFramesBase = 0x25C4;
+// animation of the girl falling at the end
+static const int kPart80FallingGirlOffset = 68 * 320 + 121;
+static const int kPart80FallingGirlWidth = 28;
+static const int kPart80FallingGirlHeight = 69;
+static const int kPart80FallingGirlFrameSize = 0x78C;
+static const int kPart80FallingGirlFramesBase = 0x25C4;
// Where and in which color each of the two persons talk.
-static const int kPart80FirstX = 149;
-static const int kPart80FirstY = 59;
-static const int kPart80SecondX = 171;
-static const int kPart80SecondY = 60;
+static const int kPart80FriendX = 149;
+static const int kPart80FriendY = 59;
+static const int kPart80LauraX = 171;
+static const int kPart80LauraY = 60;
-void IgorEngine::PART_80_DRAW_PATCH(int frame) {
+void IgorEngine::PART_80_drawFrame(int frame) {
copyArea(_screenVGA, kPart80PatchOffset, 320, _animFramesBuffer + (frame - 1) * kPart80PatchFrameSize, kPart80PatchWidth,
kPart80PatchWidth, kPart80PatchHeight);
}
-void IgorEngine::PART_80_UPDATE_DIALOGUE_FIRST(int action) {
+void IgorEngine::PART_80_updateDialogueFriend(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_80_DRAW_PATCH(1);
+ PART_80_drawFrame(1);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_80_DRAW_PATCH(getRandomNumber(3) + 1);
+ PART_80_drawFrame(getRandomNumber(3) + 1);
break;
}
}
-void IgorEngine::PART_80_UPDATE_DIALOGUE_SECOND(int action) {
+void IgorEngine::PART_80_updateDialogueLaura(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_80_DRAW_PATCH(5);
+ PART_80_drawFrame(5);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_80_DRAW_PATCH(getRandomNumber(3) + 5);
+ PART_80_drawFrame(getRandomNumber(3) + 5);
break;
}
}
-void IgorEngine::PART_80_SAY(int who, const Common::Array<DialogueText> &lines) {
+void IgorEngine::PART_80_say(int who, const Common::Array<DialogueText> &lines) {
if (who == 0) {
- cutsceneSayWithCallback(kPart80FirstX, kPart80FirstY, 0, 44, 63, lines, &IgorEngine::PART_80_UPDATE_DIALOGUE_FIRST);
+ cutsceneSayWithCallback(kPart80FriendX, kPart80FriendY, 0, 44, 63, lines, &IgorEngine::PART_80_updateDialogueFriend);
} else {
- cutsceneSayWithCallback(kPart80SecondX, kPart80SecondY, 63, 0, 38, lines, &IgorEngine::PART_80_UPDATE_DIALOGUE_SECOND);
+ cutsceneSayWithCallback(kPart80LauraX, kPart80LauraY, 63, 0, 38, lines, &IgorEngine::PART_80_updateDialogueLaura);
}
}
/**
- * Scene of two persons talking, followed by four frames drawn into the picture. It is played at the end of state 730.
+ * Larua and Friend discuss the great dosicua recovery.
*/
void IgorEngine::PART_80() {
playMusic(8);
@@ -91,26 +90,27 @@ void IgorEngine::PART_80() {
fadeIn(768);
_gameState.igorMoving = false;
- PART_80_SAY(0, { { 201, 2, 1131 } });
- PART_80_SAY(1, { { 203, 1, 1132 } });
- PART_80_SAY(0, { { 204, 2, 1133 } });
- PART_80_SAY(1, { { 206, 1, 1134 } });
- PART_80_SAY(0, { { 207, 1, 1135 } });
- PART_80_SAY(1, { { 208, 1, 1136 } });
- PART_80_SAY(0, { { 209, 1, 1137 } });
- PART_80_SAY(1, { { 210, 1, 1138 } });
- PART_80_SAY(0, { { 211, 1, 1139 }, { 212, 1, 1140 } });
- PART_80_SAY(1, { { 213, 1, 1141 } });
- PART_80_SAY(0, { { 214, 2, 1142 } });
- PART_80_SAY(1, { { 216, 1, 1143 }, { 217, 1, 1144 } });
- PART_80_SAY(0, { { 218, 1, 1145 } });
- PART_80_SAY(1, { { 219, 1, 1146 }, { 220, 1, 1147 }, { 221, 1, 1148 } });
+ PART_80_say(0, { { 201, 2, 1131 } });
+ PART_80_say(1, { { 203, 1, 1132 } });
+ PART_80_say(0, { { 204, 2, 1133 } });
+ PART_80_say(1, { { 206, 1, 1134 } });
+ PART_80_say(0, { { 207, 1, 1135 } });
+ PART_80_say(1, { { 208, 1, 1136 } });
+ PART_80_say(0, { { 209, 1, 1137 } });
+ PART_80_say(1, { { 210, 1, 1138 } });
+ PART_80_say(0, { { 211, 1, 1139 }, { 212, 1, 1140 } });
+ PART_80_say(1, { { 213, 1, 1141 } });
+ PART_80_say(0, { { 214, 2, 1142 } });
+ PART_80_say(1, { { 216, 1, 1143 }, { 217, 1, 1144 } });
+ PART_80_say(0, { { 218, 1, 1145 } });
+ PART_80_say(1, { { 219, 1, 1146 }, { 220, 1, 1147 }, { 221, 1, 1148 } });
waitForTimer(255);
+ // left-most friend falls on the floor
for (int i = 1; i <= 4; ++i) {
- copyArea(_screenVGA, kPart80ObjectOffset, 320,
- _animFramesBuffer + kPart80ObjectFramesBase + i * kPart80ObjectFrameSize, kPart80ObjectWidth,
- kPart80ObjectWidth, kPart80ObjectHeight);
+ copyArea(_screenVGA, kPart80FallingGirlOffset, 320,
+ _animFramesBuffer + kPart80FallingGirlFramesBase + i * kPart80FallingGirlFrameSize, kPart80FallingGirlWidth,
+ kPart80FallingGirlWidth, kPart80FallingGirlHeight);
if (i < 4) {
waitForTimer(21);
} else {
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index 2ce9be3b9b5..39404a47b08 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -22,8 +22,7 @@
namespace Igor {
-// A character stands in the middle of the room. His head is a 21x53 picture drawn at (140,28); the animation
-// resource has the frames from 1 on, 1113 bytes each, after a base offset.
+
static const int kPart81HeadOffset = 28 * 320 + 140;
static const int kPart81HeadWidth = 21;
static const int kPart81HeadHeight = 53;
@@ -34,64 +33,59 @@ static const int kPart81HeadStanding = 4;
// Another picture of the head, drawn into the room picture while it is there.
static const int kPart81HeadRestFrame = 1;
-// A picture (43x62, frames of 2666 bytes) at (116,32).
-static const int kPart81FigureOffset = 32 * 320 + 116;
-static const int kPart81FigureWidth = 43;
-static const int kPart81FigureHeight = 62;
-static const int kPart81FigureFrameSize = kPart81FigureWidth * kPart81FigureHeight;
-static const int kPart81FigureFirst = 0xC4DF;
-static const int kPart81FigureSecond = 0xBA75;
+static const int kPart81IgorOffset = 32 * 320 + 116;
+static const int kPart81IgorWidth = 43;
+static const int kPart81IgorHeight = 62;
+static const int kPart81IgorFrameSize = kPart81IgorWidth * kPart81IgorHeight;
+static const int kPart81IgorHanding = 0xC4DF;
+static const int kPart81IgorStanding = 0xBA75;
-// The frames of the head that follow the story: 6 frames of the third block of the animation.
static const int kPart81StoryFramesBase = 0x4206;
-// Where the lines of the character are shown.
+// Where the lines of the lighthouse keeper are shown.
static const int kPart81TextX = 148;
static const int kPart81TextY = 31;
static const int kPart81TextR = 63;
static const int kPart81TextG = 32;
static const int kPart81TextB = 0;
-// The scenes use a tall picture (130x369) at the start of the second animation and a smaller one (285x72) in the
-// walk mask buffer.
static const int kPart81TallWidth = 0x82;
static const int kPart81TallX = 0x6A;
static const int kPart81StripWidth = 0x11D;
static const int kPart81StripRows = 0x48;
-// The last frames of the animation of the end of the story.
static const int kPart81EndFramesBase = 0xBAE0;
static const int kPart81EndFramesTable = 0x828;
// Flags of the story kept in the objects state.
-static const int kPart81StoryState = 6;
+static const int kPart81VaseState = 6;
static const int kPart81SideState = 90;
-static const int kPart81InventoryState = 69;
-static const int kPart81EventDoneState = 104;
-static const int kPart81BellState = 105;
+static const int kPart81LighthouseMessageSent = 104;
+static const int kPart81HasSeenChurchBellMessageState = 105;
+
+static const int kPart81InventoryIndex = 69;
-// First picture of each of the steps of the animation of the story.
static const uint8 kPart81FigureFrames[4] = { 1, 2, 3, 1 };
-// Frames and times of the end scene (timer ticks).
+
static const uint8 kPart81EndFrames[10] = { 1, 2, 1, 2, 1, 2, 1, 2, 1, 2 };
static const uint8 kPart81EndHold[10] = { 45, 35, 25, 40, 45, 30, 45, 35, 20, 30 };
static const uint8 kPart81EndFinalHold[10] = { 25, 30, 20, 40, 25, 35, 40, 42, 20, 25 };
static const int kPart81StepTicks = 16;
-void IgorEngine::PART_81_LOAD_ROOM() {
+void IgorEngine::PART_81_loadRoom() {
loadRoomData(PAL_Part81, IMG_Part81, BOX_Part81, MSK_Part81, TXT_Part81);
// the colors of Igor
memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
SET_PAL_240_48_1();
}
-void IgorEngine::PART_81_LOAD_ANIMATION() {
+void IgorEngine::PART_81_loadAnimation() {
static const int anim[] = { ANM_Part81, 0 };
loadAnimData(anim);
}
-void IgorEngine::PART_81_DRAW_HEAD(int frame) {
+void IgorEngine::PART_81_drawLighthouseKeeperHead(int frame) {
drawAnimRect(kPart81HeadOffset, kPart81HeadFramesBase + frame * kPart81HeadFrameSize, kPart81HeadWidth, kPart81HeadHeight,
true, kBlendBehindIgorAndText);
if (_gameState.dialogueTextRunning) {
@@ -100,50 +94,51 @@ void IgorEngine::PART_81_DRAW_HEAD(int frame) {
}
void IgorEngine::PART_81_UPDATE_ROOM_BACKGROUND() {
- if (compareGameTick(0x3D) && getRandomNumber(1) == 0 && _objectsState[kPart81BellState] == 1) {
- PART_81_DRAW_HEAD(getRandomNumber(2) + 1);
+ // if user has seen church bell message, show lighthouse keeper
+ if (compareGameTick(0x3D) && getRandomNumber(1) == 0 && _objectsState[kPart81HasSeenChurchBellMessageState] == 1) {
+ PART_81_drawLighthouseKeeperHead(getRandomNumber(2) + 1);
}
}
-void IgorEngine::PART_81_UPDATE_DIALOGUE_NPC(int action) {
+void IgorEngine::PART_81_updateDialogueLighthouseKeeper(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PART_81_DRAW_HEAD(kPart81HeadStanding);
+ PART_81_drawLighthouseKeeperHead(kPart81HeadStanding);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_81_DRAW_HEAD(getRandomNumber(4) + 5);
+ PART_81_drawLighthouseKeeperHead(getRandomNumber(4) + 5);
break;
}
}
-/**
- * The character says lines of the room texts. The lines of the room itself do not run meanwhile.
- */
-void IgorEngine::PART_81_NPC_SAY(const Common::Array<DialogueText> &lines) {
+void IgorEngine::PART_81_lighthouseKeeperSay(const Common::Array<DialogueText> &lines) {
UpdateRoomBackgroundProc previous = _updateRoomBackground;
_updateRoomBackground = 0;
cutsceneSayWithCallback(kPart81TextX, kPart81TextY, kPart81TextR, kPart81TextG, kPart81TextB, lines,
- &IgorEngine::PART_81_UPDATE_DIALOGUE_NPC);
+ &IgorEngine::PART_81_updateDialogueLighthouseKeeper);
_updateRoomBackground = previous;
}
-void IgorEngine::PART_81_IGOR_SAY(int num, int count, int sound) {
+void IgorEngine::PART_81_igorSay(int num, int count, int sound) {
UpdateRoomBackgroundProc previous = _updateRoomBackground;
_updateRoomBackground = 0;
igorSayAndWait(num, count, sound);
_updateRoomBackground = previous;
}
-/**
- * The picture of the character at rest is part of the room picture while the bell is on; the dialogue and the
- * objects of the room depend on the story.
- */
void IgorEngine::PART_81_APPLY_OBJECT_STATE(int num) {
if (num != 1 && num != 255) {
return;
}
- if (_objectsState[kPart81BellState] == 1) {
+ // change door hotspot to lighthouse keeper and vice-versa
+ uint8 objectNames[16];
+ loadData(TXT_Part81ObjectNames, objectNames);
+ const uint8 *name = objectNames + (_objectsState[kPart81HasSeenChurchBellMessageState] == 1 ? 0 : 8);
+ memcpy(_roomObjectNames[2], name + 1, name[0]);
+ _roomObjectNames[2][name[0]] = '\0';
+ // show lighthouse keeper if the player has seen the church bell message
+ if (_objectsState[kPart81HasSeenChurchBellMessageState] == 1) {
copyArea(_screenLayer1, kPart81HeadOffset, 320, _animFramesBuffer + kPart81HeadRestFrame * kPart81HeadFrameSize + 0x1AE5,
kPart81HeadWidth, kPart81HeadWidth, kPart81HeadHeight);
_roomActionsTable[30] = 2;
@@ -169,9 +164,9 @@ void IgorEngine::PART_81_APPLY_OBJECT_STATE(int num) {
}
/**
- * The room picture comes in from the left, over the one that was on the screen (a 160 columns picture).
+ * The room picture comes in from the left, over the actual scene (a 160 columns picture).
*/
-void IgorEngine::PART_81_SCROLL_IN() {
+void IgorEngine::PART_81_scrollIn() {
uint8 *buffer = _screenTextLayer;
for (int step = 20; step >= 0; --step) {
const int shift = step * 8;
@@ -189,10 +184,9 @@ void IgorEngine::PART_81_SCROLL_IN() {
}
/**
- * Transition: the screen moves down while the small picture of the walk mask buffer, then the tall picture of
- * the animation, come in from above.
+ * Transition: for the message cutscene, the scene scrolls up to the top of lighthouse
*/
-void IgorEngine::PART_81_TRANSITION_IN() {
+void IgorEngine::PART_81_transitionScrollUp() {
uint8 *buffer = _screenTextLayer;
memset(buffer, 0, 46080);
for (int i = 1; i <= 9; ++i) {
@@ -228,9 +222,9 @@ void IgorEngine::PART_81_TRANSITION_IN() {
}
/**
- * The opposite transition: the tall picture goes down, then the small picture and finally the room picture come in.
+ * The opposite transition: from the top of the lighthouse back to the normal scene.
*/
-void IgorEngine::PART_81_TRANSITION_OUT() {
+void IgorEngine::PART_81_transitionScrollDown() {
uint8 *buffer = _screenTextLayer;
for (int n = 0x2E; n >= 0x12; --n) {
int dstRow = 0;
@@ -262,91 +256,84 @@ void IgorEngine::PART_81_TRANSITION_OUT() {
}
}
-void IgorEngine::PART_81_DRAW_END_FRAME(int frame) {
+void IgorEngine::PART_81_drawLighthouseFrame(int frame) {
decodeAnimFrame(getAnimFrame(kPart81EndFramesBase, kPart81EndFramesTable, frame), _screenVGA, false);
}
-/**
- * The end of the story: the transition, the long picture, the scene of the two characters and back.
- */
-void IgorEngine::PART_81_END_SCENE() {
- PART_81_TRANSITION_IN();
+void IgorEngine::PART_81_lighthouseSendMessage() {
+ PART_81_transitionScrollUp();
for (int i = 0; i < 3; ++i) {
waitForTimer(251);
}
+ // lighthouse flashes message
for (int i = 0; i < 10; ++i) {
- PART_81_DRAW_END_FRAME(kPart81EndFrames[i]);
+ PART_81_drawLighthouseFrame(kPart81EndFrames[i]);
waitForTimer(kPart81EndHold[i]);
}
waitForTimer(251);
- PART_74_CUTSCENE();
+ PART_74_shipCutscene();
+ // ship receives message
for (int i = 0; i < 10; ++i) {
for (int frame = 3; frame <= 8; ++frame) {
- PART_81_DRAW_END_FRAME(frame);
+ PART_81_drawLighthouseFrame(frame);
waitForTimer(10);
}
waitForTimer(kPart81EndFinalHold[i]);
}
- PART_81_TRANSITION_OUT();
+ PART_81_transitionScrollDown();
}
-void IgorEngine::PART_81_DRAW_STORY_HEAD(int frame) {
+void IgorEngine::PART_81_drawLighthouseKeeper(int frame) {
copyArea(_screenVGA, kPart81HeadOffset, 320, _animFramesBuffer + kPart81StoryFramesBase + frame * kPart81HeadFrameSize,
kPart81HeadWidth, kPart81HeadWidth, kPart81HeadHeight);
}
-void IgorEngine::PART_81_DRAW_FIGURE(int offset) {
- copyArea(_screenVGA, kPart81FigureOffset, 320, _animFramesBuffer + offset, kPart81FigureWidth, kPart81FigureWidth,
- kPart81FigureHeight);
+void IgorEngine::PART_81_drawIgor(int offset) {
+ copyArea(_screenVGA, kPart81IgorOffset, 320, _animFramesBuffer + offset, kPart81IgorWidth, kPart81IgorWidth,
+ kPart81IgorHeight);
}
-/**
- * Looking at the picture on the wall before the story is complete.
- */
-void IgorEngine::PART_81_ACTION_110() {
+void IgorEngine::PART_81_ACTION_110_rejectItem() {
for (int frame = 3; frame <= 4; ++frame) {
- PART_81_DRAW_HEAD(frame);
+ PART_81_drawLighthouseKeeperHead(frame);
waitForTimer(31);
}
- PART_81_IGOR_SAY(208, 1, 952);
- PART_81_DRAW_FIGURE(kPart81FigureFirst);
- PART_81_NPC_SAY({ { 209, 1, 953 } });
- PART_81_DRAW_FIGURE(kPart81FigureSecond);
+ PART_81_igorSay(208, 1, 952);
+ PART_81_drawIgor(kPart81IgorHanding);
+ PART_81_lighthouseKeeperSay({ { 209, 1, 953 } });
+ PART_81_drawIgor(kPart81IgorStanding);
}
-/**
- * The story of the room: Igor shows what he has, the two characters talk and the end scene plays.
- */
-void IgorEngine::PART_81_ACTION_109() {
- if (_objectsState[kPart81StoryState] <= 1) {
- PART_81_ACTION_110();
+void IgorEngine::PART_81_ACTION_109_giveLampToLighthouseKeeper() {
+ if (_objectsState[kPart81VaseState] <= 1) {
+ PART_81_ACTION_110_rejectItem();
return;
}
memset(_screenVGA + 46080, 0, 17920);
for (int frame = 3; frame <= 4; ++frame) {
- PART_81_DRAW_HEAD(frame);
+ PART_81_drawLighthouseKeeperHead(frame);
waitForTimer(31);
}
- PART_81_IGOR_SAY(208, 1, 952);
+ PART_81_igorSay(208, 1, 952);
for (int step = 0; step < 4; ++step) {
- PART_81_DRAW_FIGURE((kPart81FigureFrames[step] - 1) * kPart81FigureFrameSize);
+ PART_81_drawIgor((kPart81FigureFrames[step] - 1) * kPart81IgorFrameSize);
waitForTimer(61);
}
- // the object that Igor brought is given
- if (_inventoryInfo[kPart81InventoryState] != 0) {
- removeInventoryEntry(kPart81InventoryState);
+ // giving the lamp
+ if (_inventoryInfo[kPart81InventoryIndex] != 0) {
+ removeInventoryEntry(kPart81InventoryIndex);
}
- PART_81_NPC_SAY({ { 210, 1, 954 }, { 211, 1, 955 } });
- PART_81_IGOR_SAY(212, 1, 956);
- PART_81_NPC_SAY({ { 213, 1, 957 }, { 214, 1, 958 } });
- PART_81_IGOR_SAY(215, 1, 959);
- PART_81_NPC_SAY({ { 216, 1, 960 }, { 217, 1, 961 } });
- PART_81_IGOR_SAY(218, 1, 962);
- PART_81_NPC_SAY({ { 219, 2, 963 }, { 221, 2, 964 }, { 223, 1, 965 } });
+ PART_81_lighthouseKeeperSay({ { 210, 1, 954 }, { 211, 1, 955 } });
+ PART_81_igorSay(212, 1, 956);
+ PART_81_lighthouseKeeperSay({ { 213, 1, 957 }, { 214, 1, 958 } });
+ PART_81_igorSay(215, 1, 959);
+ PART_81_lighthouseKeeperSay({ { 216, 1, 960 }, { 217, 1, 961 } });
+ PART_81_igorSay(218, 1, 962);
+ PART_81_lighthouseKeeperSay({ { 219, 2, 963 }, { 221, 2, 964 }, { 223, 1, 965 } });
playSound(14, 1);
for (int frame = 1; frame <= 3; ++frame) {
- PART_81_DRAW_STORY_HEAD(frame);
+ PART_81_drawLighthouseKeeper(frame);
waitForTimer(31);
}
@@ -355,15 +342,15 @@ void IgorEngine::PART_81_ACTION_109() {
loadAnimData(cutsceneAnim);
loadData(IMG_Part81Strip, _screenLayer2);
memcpy(_screenLayer1, _screenVGA, 46080);
- PART_81_END_SCENE();
+ PART_81_lighthouseSendMessage();
// the room again
loadActionData(DAT_Part81);
- PART_81_LOAD_ROOM();
- PART_81_LOAD_ANIMATION();
+ PART_81_loadRoom();
+ PART_81_loadAnimation();
PART_81_APPLY_OBJECT_STATE(255);
for (int frame = 4; frame <= 6; ++frame) {
- PART_81_DRAW_STORY_HEAD(frame);
+ PART_81_drawLighthouseKeeper(frame);
if (frame == 6) {
playSound(13, 1);
}
@@ -372,10 +359,10 @@ void IgorEngine::PART_81_ACTION_109() {
while (_mixer->isSoundHandleActive(_sfxHandle) && !_eventQuitGame) {
waitForTimer(1);
}
- PART_81_NPC_SAY({ { 224, 1, 966 }, { 225, 1, 967 }, { 226, 3, 968 } });
- PART_81_IGOR_SAY(229, 1, 969);
- PART_81_NPC_SAY({ { 230, 1, 970 } });
- _objectsState[kPart81EventDoneState] = 1;
+ PART_81_lighthouseKeeperSay({ { 224, 1, 966 }, { 225, 1, 967 }, { 226, 3, 968 } });
+ PART_81_igorSay(229, 1, 969);
+ PART_81_lighthouseKeeperSay({ { 230, 1, 970 } });
+ _objectsState[kPart81LighthouseMessageSent] = 1;
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
PART_81_APPLY_OBJECT_STATE(255);
@@ -394,10 +381,10 @@ void IgorEngine::PART_81_DIALOGUE_CODE(int code) {
}
}
-void IgorEngine::PART_81_CONVERSATION() {
+void IgorEngine::PART_81_handleDialogue() {
UpdateRoomBackgroundProc previousBackground = _updateRoomBackground;
_updateRoomBackground = 0;
- _updateDialogue = &IgorEngine::PART_81_UPDATE_DIALOGUE_NPC;
+ _updateDialogue = &IgorEngine::PART_81_updateDialogueLighthouseKeeper;
loadDialogueData(DLG_Part81);
_gameState.dialogueStarted = true;
_gameState.dialogueChoiceStart = 1;
@@ -406,7 +393,7 @@ void IgorEngine::PART_81_CONVERSATION() {
bool done = false;
do {
drawDialogueChoices();
- PART_81_DRAW_HEAD(kPart81HeadStanding);
+ PART_81_drawLighthouseKeeperHead(kPart81HeadStanding);
const int choice = selectDialogue();
if (choice == 0) {
break;
@@ -454,17 +441,17 @@ void IgorEngine::PART_81_CONVERSATION() {
}
void IgorEngine::PART_81_ACTION_102_talk() {
- if (_objectsState[kPart81BellState] == 1 && _objectsState[kPart81EventDoneState] == 1) {
+ if (_objectsState[kPart81HasSeenChurchBellMessageState] == 1 && _objectsState[kPart81LighthouseMessageSent] == 1) {
igorSay(234, 1, 974);
return;
}
- PART_81_IGOR_SAY(231, 1, 971);
- PART_81_NPC_SAY({ { 232, 1, 972 } });
- PART_81_CONVERSATION();
+ PART_81_igorSay(231, 1, 971);
+ PART_81_lighthouseKeeperSay({ { 232, 1, 972 } });
+ PART_81_handleDialogue();
PART_81_APPLY_OBJECT_STATE(255);
}
-void IgorEngine::PART_81_ENTER() {
+void IgorEngine::PART_81_walkIn() {
WalkData *wd = &_walkData[0];
wd->setPos(0, 138, kFacingPositionRight, 0);
wd->clipSkipX = 15;
@@ -489,37 +476,37 @@ void IgorEngine::PART_81_EXEC_ACTION(int action) {
_objectsState[kPart81SideState] = 1;
_currentPart = 700;
break;
- case 102:
+ case 102: // talk to lighthouse keeper
PART_81_ACTION_102_talk();
break;
- case 103:
- if (_objectsState[kPart81BellState] == 1) {
+ case 103: // look at lighthouse keeper
+ if (_objectsState[kPart81HasSeenChurchBellMessageState] == 1) {
igorSay(202, 1, 946);
} else {
igorSay(201, 1, 945);
}
break;
- case 104:
+ case 104: // open door
igorSay(233, 1, 973);
break;
- case 106:
+ case 106: // look at tree
igorSay(203, 1, 947);
break;
- case 107:
+ case 107: // look at lighthouse
igorSay(204, 1, 948);
break;
- case 108:
- if (_objectsState[kPart81EventDoneState] == 0) {
+ case 108: // look at sea
+ if (_objectsState[kPart81LighthouseMessageSent] == 0) {
igorSay({ { 206, 1, 950 }, { 207, 1, 951 } });
} else {
igorSay(205, 1, 949);
}
break;
case 109:
- PART_81_ACTION_109();
+ PART_81_ACTION_109_giveLampToLighthouseKeeper();
break;
case 110:
- PART_81_ACTION_110();
+ PART_81_ACTION_110_rejectItem();
break;
default:
error("PART_81_EXEC_ACTION unhandled action %d", action);
@@ -531,8 +518,8 @@ void IgorEngine::PART_81() {
playMusic(4);
_gameState.enableLight = 2;
loadActionData(DAT_Part81);
- PART_81_LOAD_ROOM();
- PART_81_LOAD_ANIMATION();
+ PART_81_loadRoom();
+ PART_81_loadAnimation();
_roomDataOffsets = PART_81_ROOM_DATA_OFFSETS;
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_81_EXEC_ACTION);
_updateRoomBackground = &IgorEngine::PART_81_UPDATE_ROOM_BACKGROUND;
@@ -544,15 +531,15 @@ void IgorEngine::PART_81() {
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
- PART_81_SCROLL_IN();
- PART_81_ENTER();
+ PART_81_scrollIn();
+ PART_81_walkIn();
}
enterPartLoop();
while (_currentPart == 810 && !_gameStateLoaded) {
runPartLoop();
}
- if (!_gameStateLoaded && _objectsState[kPart81BellState] == 1 && _objectsState[kPart81EventDoneState] == 1) {
- _objectsState[kPart81BellState] = 0;
+ if (!_gameStateLoaded && _objectsState[kPart81HasSeenChurchBellMessageState] == 1 && _objectsState[kPart81LighthouseMessageSent] == 1) {
+ _objectsState[kPart81HasSeenChurchBellMessageState] = 0;
}
leavePartLoop();
if (!_gameStateLoaded)
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 0f004be7ef4..4ad1e5d1572 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -731,6 +731,7 @@
#define IMG_Part74 1128
#define TXT_Part74 1129
#define ANM_Part74 1130
+#define TXT_Part81ObjectNames 1231
// State 710 (PART_71)
#define DAT_Part71 1131
Commit: d666e3b7b18c2240ce740c1c43967169f5aa03c0
https://github.com/scummvm/scummvm/commit/d666e3b7b18c2240ce740c1c43967169f5aa03c0
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:53+01:00
Commit Message:
IGOR: Fix timing in igor splash logo
Changed paths:
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_main.cpp
engines/igor/parts/part_0.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_71.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_85.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 19a1c9f1f66..ce73cfde5c7 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -95,6 +95,7 @@ enum InputVar {
kInputRightRelease,
kInputRightMoveLeft,
kInputRightMoveRight,
+ kInputConfirm,
kInputVarCount
};
@@ -667,12 +668,12 @@ private:
// junk room
void PART_02();
void PART_02_EXEC_ACTION(int action);
- void lightUpDynamite();
+ void PART_02_lightUpDynamite();
void PART_02_APPLY_OBJECT_STATE(int num);
- void PART_02_SEARCH_TRUNK();
- void PART_02_DRAW_FUSE_SPARK(int frame);
- void PART_02_UPDATE_FUSE();
- void PART_02_WALK_WHILE_FUSE_BURNS(int srcX, int srcY, int dstX, int dstY);
+ void PART_02_searchTrunk();
+ void PART_02_drawFuseSpark(int frame);
+ void PART_02_updateFuse();
+ void PART_02_walkWhileFuseBurns(int srcX, int srcY, int dstX, int dstY);
// spring bridge
void PART_05_HELPER_4_drawPaperOrNot(int num);
@@ -771,7 +772,7 @@ private:
void PART_12_UPDATE_DIALOGUE_PRIEST(int action);
void PART_12_HANDLE_DIALOGUE_PRIEST();
void PART_12_OBJECT_STATE(int num);
- void PART_12_HELPER_2();
+ void PART_12_HELPER_2_disablePathBehindChurch();
void PART_12_HELPER_3_paintOverLizard();
void PART_12_HELPER_4_exorcismCutscene();
void PART_12_HELPER_5_enterFromPath();
@@ -1360,8 +1361,8 @@ private:
// Intro
void PART_85();
- void PART_85_HELPER_1_PLAY_ANIM(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
- void PART_85_HELPER_2_SCROLL_RIGHT();
+ void PART_85_HELPER_1_playAnimationFrame(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
+ void PART_85_HELPER_2_scrollRight();
void displayLogo();
void PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action);
void PART_85_UPDATE_ROOM_BACKGROUND();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 3ef31daaf1d..c550b104369 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -62,12 +62,19 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
_fastMode, kTimerTicksCount * 1000 / kTickDelay / _fastMode);
} else if (ev.kbd.keycode == Common::KEYCODE_ESCAPE) {
_inputVars[kInputEscape] = 1;
+ } else if (ev.kbd.keycode == Common::KEYCODE_RETURN || ev.kbd.keycode == Common::KEYCODE_KP_ENTER) {
+ _inputVars[kInputConfirm] = 1;
} else if (ev.kbd.keycode == Common::KEYCODE_SPACE) {
_inputVars[kInputOptions] = 1;
} else if (ev.kbd.keycode == Common::KEYCODE_p) {
_inputVars[kInputPause] = 1;
}
break;
+ case Common::EVENT_KEYUP:
+ if (ev.kbd.keycode == Common::KEYCODE_RETURN || ev.kbd.keycode == Common::KEYCODE_KP_ENTER) {
+ _inputVars[kInputConfirm] = 0;
+ }
+ break;
case Common::EVENT_MOUSEMOVE:
if (_rightButtonSelecting) {
if (ev.mouse.x < _rightButtonSelectCursorX) {
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index b853fda7eee..7acfc532fd0 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -186,7 +186,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
- case 48:
+ case 48: // look at bottle
igorSay(77 + _objectsState[0], 1, 53 + _objectsState[0]);
break;
case 50:
@@ -196,7 +196,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
igorSay(82, 1, 58);
}
break;
- case 51:
+ case 51: // look at great statuette / money
if (_objectsState[7] == 0) {
ADD_DIALOGUE_TEXT(157, 1, 81);
} else {
@@ -223,7 +223,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
case 57:
igorSay(31, 1, 31);
break;
- case 58:
+ case 58: // look at astronomy book
igorSay({ { 140, 1, 70 }, { 141, 1, 71 }, { 142, 1, 72 }, { 143, 1, 73 } });
_objectsState[4] = 2;
break;
@@ -241,7 +241,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
addObjectToInventory(16, 51);
}
break;
- case 62:
+ case 62: // use burger on lizard
_inventoryInfo[_inventoryInfo[52] - 1] = 0;
_inventoryInfo[52] = 0;
packInventory();
@@ -253,7 +253,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
addObjectToInventory(24, 59);
igorSay(169, 1, 93);
break;
- case 63:
+ case 63: // use flower on vase
igorSay(170, 1, 94);
_inventoryInfo[_inventoryInfo[68] - 1] = 0;
_inventoryInfo[68] = 0;
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 9fb7596d482..6df981c09c6 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -36,6 +36,7 @@ void IgorEngine::PART_00_APPLY_OBJECT_STATE(int num) {
const int src = open ? 0x3900 : 0x3238; // open or closed door frame depending on the flag
copyArea(_screenLayer1, 0x5572, 320, _animFramesBuffer + src, 31, 31, 56);
_roomActionsTable[76] = open ? 7 : 6;
+ // hole open or not
_roomObjectAreasTable[3].object = (_objectsState[11] == 0) ? 4 : 5;
}
if (num == 6 || num == 255) {
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 71a27cb7949..01e6820daf2 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -199,7 +199,7 @@ void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
} while (_gameState.unk10 != 8);
--_walkDataLastIndex;
buildWalkPath(196, 64, 95, 142);
- PART_12_HELPER_2();
+ PART_12_HELPER_2_disablePathBehindChurch();
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
@@ -356,7 +356,9 @@ void IgorEngine::PART_12_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_12_HELPER_2() {
+// Disables the path behind the church, which shall only be enabled
+// in the cutscene where we pick the lizard
+void IgorEngine::PART_12_HELPER_2_disablePathBehindChurch() {
for (int i = 9; i <= 10; ++i) {
_roomObjectAreasTable[i].area = 0;
}
@@ -549,7 +551,7 @@ void IgorEngine::PART_12() {
}
}
}
- PART_12_HELPER_2();
+ PART_12_HELPER_2_disablePathBehindChurch();
enterPartLoop();
while (_currentPart >= 120 && _currentPart <= 122 && !_gameStateLoaded) {
runPartLoop();
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index ec2503cf3ff..b082d8c9e3e 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -10,7 +10,7 @@
namespace Igor {
-void IgorEngine::PART_02_SEARCH_TRUNK() {
+void IgorEngine::PART_02_searchTrunk() {
for (int frame = 0; frame <= 2; ++frame) {
animateLitAnimFrames(0x3C0 + frame * 0x715, 0, 0, 0x715, 37, 49, 0x608C, 0, -1, 0);
if (frame > 0)
@@ -18,7 +18,7 @@ void IgorEngine::PART_02_SEARCH_TRUNK() {
}
}
-void IgorEngine::PART_02_DRAW_FUSE_SPARK(int frame) {
+void IgorEngine::PART_02_drawFuseSpark(int frame) {
// Four 12x12 spark frames are stored at animation offset 0x7FCB and are
// composited over the fuse at screen offset 0x5996.
const uint8 *src = _animFramesBuffer + 0x7FCB + frame * 0x90;
@@ -34,11 +34,11 @@ void IgorEngine::PART_02_DRAW_FUSE_SPARK(int frame) {
}
}
-void IgorEngine::PART_02_UPDATE_FUSE() {
- PART_02_DRAW_FUSE_SPARK(getRandomNumber(3));
+void IgorEngine::PART_02_updateFuse() {
+ PART_02_drawFuseSpark(getRandomNumber(3));
}
-void IgorEngine::PART_02_WALK_WHILE_FUSE_BURNS(int srcX, int srcY, int dstX, int dstY) {
+void IgorEngine::PART_02_walkWhileFuseBurns(int srcX, int srcY, int dstX, int dstY) {
--_walkDataLastIndex;
buildWalkPath(srcX, srcY, dstX, dstY);
_walkDataCurrentIndex = 1;
@@ -56,7 +56,7 @@ void IgorEngine::PART_02_WALK_WHILE_FUSE_BURNS(int srcX, int srcY, int dstX, int
++_walkDataCurrentIndex;
}
}
- PART_02_UPDATE_FUSE();
+ PART_02_updateFuse();
waitForTimer();
} while (_gameState.igorMoving);
}
@@ -68,10 +68,15 @@ void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
copyArea(_screenLayer1, 0x748A, 320, _animFramesBuffer + srcOffset, 39, 39, 18);
_roomActionsTable[252] = _objectsState[16] == 0 ? 6 : 4;
}
+ // butterfly net
if ((num == 2 || num == 255) && _objectsState[17] == 1) {
_roomObjectAreasTable[17].object = 4;
_roomObjectAreasTable[19].object = 4;
}
+ // these handle states of the hole in the wall:
+ // 18 = hole
+ // 19 = big crack
+ // 20 = small crack
if (num == 3 || num == 255) {
if (_objectsState[18] == 1) {
copyArea(_screenLayer1, 0x50D6, 320, _animFramesBuffer, 14, 14, 50);
@@ -132,8 +137,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
case 103: { // hammer the nail
for (int step = 1; step <= 21; ++step) {
const int frame = step == 21 ? 2 : ((step + 1) & 1);
- animateLitAnimFrames(0x33BA + frame * 0x4B0, 0, 0, 0x4B0,
- 24, 50, 0x5989, 0, -1, 0);
+ animateLitAnimFrames(0x33BA + frame * 0x4B0, 0, 0, 0x4B0, 24, 50, 0x5989, 0, -1, 0);
if ((step & 1) != 0 && step < 21)
playSound(9, 1);
waitForTimer(63);
@@ -153,8 +157,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
for (int step = 1; step <= 21; ++step) {
const int frame = step == 21 ? 2 : ((step + 1) & 1);
- animateLitAnimFrames(0x41CA + frame * 0x658, 0, 0, 0x658,
- 29, 56, 0x5349, 0, -1, 0);
+ animateLitAnimFrames(0x41CA + frame * 0x658, 0, 0, 0x658, 29, 56, 0x5349, 0, -1, 0);
if ((step & 1) != 0 && step < 21)
playSound(10, 1);
waitForTimer(63);
@@ -180,7 +183,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
if (_objectsState[22] == 0) {
igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
- PART_02_SEARCH_TRUNK();
+ PART_02_searchTrunk();
igorSay(204, 1, 111);
addObjectToInventory(9, 44);
PART_02_APPLY_OBJECT_STATE(255);
@@ -191,7 +194,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
if (_objectsState[20] == 0) {
igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
- PART_02_SEARCH_TRUNK();
+ PART_02_searchTrunk();
igorSay(205, 1, 112);
removeObjectFromInventory(44);
playSound(63, 1);
@@ -200,14 +203,11 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
break;
}
- if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 &&
- _inventoryInfo[46] == 0 && _objectsState[23] == 0 &&
- _objectsState[19] != 0) {
- PART_02_SEARCH_TRUNK();
+ if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 && _inventoryInfo[46] == 0 && _objectsState[23] == 0 && _objectsState[19] != 0) {
+ PART_02_searchTrunk();
igorSay(206, 1, 113);
addObjectToInventory(11, 46);
- } else if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 &&
- _inventoryInfo[46] == 0 && _objectsState[23] == 0) {
+ } else if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 && _inventoryInfo[46] == 0 && _objectsState[23] == 0) {
igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
igorSay(207, 2, 114);
@@ -282,7 +282,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
if (_objectsState[23] == 0) {
EXEC_MAIN_ACTION(2);
} else {
- lightUpDynamite();
+ PART_02_lightUpDynamite();
}
break;
default:
@@ -291,7 +291,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
}
-void IgorEngine::lightUpDynamite() {
+void IgorEngine::PART_02_lightUpDynamite() {
memset(_screenVGA + 0xB400, 0, 0x4BFF);
playSound(68, 1);
animateLitAnimFrames(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
@@ -300,7 +300,7 @@ void IgorEngine::lightUpDynamite() {
igorSay(221, 1, 125);
if (_gameState.talkMode == kTalkModeTextOnly)
playSound(11, 1);
- _updateRoomBackground = &IgorEngine::PART_02_UPDATE_FUSE;
+ _updateRoomBackground = &IgorEngine::PART_02_updateFuse;
waitForEndOfIgorDialogue();
_updateRoomBackground = 0;
@@ -308,9 +308,9 @@ void IgorEngine::lightUpDynamite() {
if (_gameState.talkMode != kTalkModeTextOnly)
playSound(11, 1);
- PART_02_WALK_WHILE_FUSE_BURNS(211, 120, 0, 143);
+ PART_02_walkWhileFuseBurns(211, 120, 0, 143);
for (int elapsed = 0; elapsed < 255; elapsed += kTimerTicksCount) {
- PART_02_UPDATE_FUSE();
+ PART_02_updateFuse();
waitForTimer();
}
copyArea(_screenVGA, 0x5996, 320, _screenLayer1 + 0x5996, 320, 12, 12);
diff --git a/engines/igor/parts/part_71.cpp b/engines/igor/parts/part_71.cpp
index e0a98e41838..6967725f131 100644
--- a/engines/igor/parts/part_71.cpp
+++ b/engines/igor/parts/part_71.cpp
@@ -38,7 +38,7 @@ static const int kPart71ObjectPicturesOffset = kPart71TakeFramesCount * kPart71T
static const int kPart71TakenStateIndex = 100;
static const int kPart71ExaminedStateIndex = 101;
-static const int kPart71TakeDoneStateIndex = 106;
+static const int kPart71StatuetteTaken = 106;
static const int kPart71ObjectNameIndex = 2;
static const int kPart71InventoryObject = 25;
@@ -139,7 +139,7 @@ void IgorEngine::PART_71_ACTION_102_takeObject() {
_objectsState[kPart71TakenStateIndex] = 1;
PART_71_APPLY_OBJECT_STATE(kPart71ApplyAll);
igorSay(204, 3, 996);
- _objectsState[kPart71TakeDoneStateIndex] = 1;
+ _objectsState[kPart71StatuetteTaken] = 1;
}
/**
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index f1cb762d724..ef591d352d2 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -10,6 +10,13 @@
namespace Igor {
+static const int kPart08PendingDeanDrinkState = 30;
+
+enum Part08PendingDeanDrink {
+ kPart08PendingDeanDrinkNone = 0,
+ kPart08PendingDeanDrinkWhisky = 1,
+ kPart08PendingDeanDrinkWater = 2
+};
void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
@@ -271,7 +278,9 @@ void IgorEngine::giveBottleToDean() {
}
cutsceneSayWithCallback(78, 75, 26, 58, 0, { { 216, 1, 162 }, { 217, 1, 163 }, { 218, 1, 164 }, { 219, 1, 165 } }, &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN);
- _objectsState[30] = _objectsState[0] < 2 ? 1 : 2;
+ const Part08PendingDeanDrink pendingDeanDrink =
+ _objectsState[0] < 2 ? kPart08PendingDeanDrinkWhisky : kPart08PendingDeanDrinkWater;
+ _objectsState[kPart08PendingDeanDrinkState] = pendingDeanDrink;
drawInventory(_inventoryInfo[72], 0);
playSound(63, 1);
PART_08_APPLY_OBJECT_STATE(255);
@@ -294,8 +303,8 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- // if gave bottle to dean
- if (_objectsState[30] != 0) {
+ uint8 &pendingDeanDrink = _objectsState[kPart08PendingDeanDrinkState];
+ if (pendingDeanDrink != kPart08PendingDeanDrinkNone) {
waitForTimer(251);
PART_08_deanDrinksBottle();
if (_objectsState[42] == 1)
@@ -304,11 +313,11 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
_objectsState[41] = 1;
waitForTimer(101);
playSound(16, 1);
- if (_objectsState[30] == 2) {
+ if (pendingDeanDrink == kPart08PendingDeanDrinkWater) {
PART_08_deanPassesOut();
_objectsState[29] = 1;
}
- _objectsState[30] = 0;
+ pendingDeanDrink = kPart08PendingDeanDrinkNone;
}
_currentPart = 71;
}
diff --git a/engines/igor/parts/part_85.cpp b/engines/igor/parts/part_85.cpp
index d39c913d978..ce0cc74be45 100644
--- a/engines/igor/parts/part_85.cpp
+++ b/engines/igor/parts/part_85.cpp
@@ -19,6 +19,7 @@
*
*/
#include "igor/igor.h"
+#include "common/system.h"
namespace Igor {
@@ -42,11 +43,169 @@ void IgorEngine::PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action) {
}
}
+void IgorEngine::displayLogo() {
+ // The CD executable preserves the last intro frame while it displays a
+ // 320x122 title card, then restores that frame before entering part 61.
+ memcpy(_screenTextLayer, _screenVGA, 46080);
+ playSound(65, 1);
+
+ memcpy(_paletteBuffer, _currentPalette, 768);
+ loadData(PAL_IgorIntroLogo, _currentPalette);
+ memset(_paletteBuffer + 765, 63, 3);
+ uint8 logoColor255[3];
+ memcpy(logoColor255, _currentPalette + 765, 3);
+ memset(_currentPalette + 765, 0, 3);
+ updatePalette(768);
+ loadData(IMG_IgorIntroLogo, _screenVGA);
+
+ // Keep the title and subtitle holds on the same refresh cadence as the fades.
+ const int refreshRate = 70086; // VGA refresh rate in millihertz.
+ auto waitForLogoHold = [this](int timerTicks, int refreshFrames, bool canSkip) {
+ const uint32 start = _system->getMillis();
+ for (int ticks = 0; ticks < timerTicks; ticks += kTimerTicksCount) {
+ PART_85_UPDATE_ROOM_BACKGROUND();
+ if (_eventQuitGame) {
+ return;
+ }
+ if (canSkip && (_inputVars[kInputConfirm] || _inputVars[kInputClick] ||
+ _inputVars[kInputEscape] || _inputVars[kInputRightClick])) {
+ _inputVars[kInputConfirm] = 0;
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputEscape] = 0;
+ _inputVars[kInputRightClick] = 0;
+ return;
+ }
+ const int elapsedTicks = MIN(ticks + kTimerTicksCount, timerTicks);
+ const uint32 deadline = start + static_cast<uint64>(elapsedTicks) * refreshFrames * 1000000 /
+ (timerTicks * refreshRate * _fastMode);
+ waitForTimer(-1, true, deadline);
+ }
+ };
+ waitForLogoHold(200, 53, false);
+
+ uint8 *subtitle = loadData(FRM_IgorIntroLogo);
+ for (int y = 0; y < 13; ++y) {
+ for (int x = 0; x < 206; ++x) {
+ const uint8 color = subtitle[y * 206 + x];
+ if (color != 255) {
+ _screenVGA[(130 + y) * 320 + 57 + x] = (color == 241) ? 0 : 255;
+ }
+ }
+ }
+ free(subtitle);
+
+ // Each palette change becomes visible on the next refresh, without
+ // advancing the logical game ticks.
+ uint32 fadeStart = _system->getMillis();
+ int fadeStep = 0;
+ // Fade color 255 from black to the logo's white.
+ for (int threshold = 63; threshold >= 0; threshold -= 3) {
+ waitForTimer(0, true, fadeStart + ++fadeStep * 1000000 / refreshRate / _fastMode);
+ for (int i = 765; i < 768; ++i) {
+ if (logoColor255[i - 765] >= threshold) {
+ const int color = _currentPalette[i] + 3;
+ _currentPalette[i] = MIN<int>(color, logoColor255[i - 765]);
+ }
+ }
+ setPaletteRange(255, 255);
+ waitForTimer(0);
+ }
+
+ waitForLogoHold(1500, 398, true);
+
+ memcpy(_screenVGA, _screenTextLayer, 39040);
+ memcpy(_currentPalette, _paletteBuffer, 765);
+ setPaletteRange(0, 255);
+ // Restoring the scene palette also consumes one refresh.
+ waitForTimer(0, true, _system->getMillis() + 1000000 / refreshRate / _fastMode);
+ fadeStart = _system->getMillis();
+ fadeStep = 0;
+
+ // Fade the subtitle, which remains below the 122 restored rows and uses
+ // palette color 255.
+ for (int threshold = 0; threshold <= 63; threshold += 3) {
+ waitForTimer(0, true, fadeStart + ++fadeStep * 1000000 / refreshRate / _fastMode);
+ for (int i = 765; i < 768; ++i) {
+ if (logoColor255[i - 765] >= threshold) {
+ _currentPalette[i] = (_currentPalette[i] < 3) ? 0 : _currentPalette[i] - 3;
+ }
+ }
+ setPaletteRange(255, 255);
+ waitForTimer(0);
+ }
+
+ memcpy(_screenVGA, _screenTextLayer, 46080);
+ _currentPalette[765] = 63;
+ _currentPalette[766] = 63;
+ _currentPalette[767] = 63;
+ setPaletteRange(255, 255);
+ waitForTimer(0);
+}
+
+void IgorEngine::PART_85_HELPER_1_playAnimationFrame(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_scrollRight() {
+ int x = 1;
+ do {
+ if (compareGameTick(0, 16)) {
+ copyArea(_screenTextLayer, 0, 320, _screenLayer1 + x * 8, 320, 320 - x * 8, 144);
+ copyArea(_screenTextLayer, 320 - x * 8, 320, _screenLayer2 + 96, 320, x * 8, 144);
+ memcpy(_screenVGA, _screenTextLayer, 46080);
+ ++x;
+ }
+ PART_85_UPDATE_ROOM_BACKGROUND();
+ waitForTimer();
+ } while (x != 29 && !_inputVars[kInputEscape]);
+}
+
+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 (_game.flags & kFlagFloppy /*|| !_gameState.dialogueTextRunning*/) {
+ playSound(17, 1);
+ }
+}
+
+void IgorEngine::PART_85_HELPER_6_animateIgorHead(int frame) {
+ const int offset = (_walkCurrentPos == 4) ? 24564 : 22643;
+ // Animate Igor's head by copying the relevant area from the screen and overlaying the head frame.
+ copyArea(_screenVGA, offset, 320, _screenLayer2 + offset, 320, 14, 8);
+ copyArea(_screenVGA, offset, 320, _igorHeadFrames + (_walkCurrentPos - 1) * 924 + frame * 154, 14, 14, 8, true);
+}
+
+// Introduction cutscene
void IgorEngine::PART_85() {
if(_game.flags & kFlagFloppy) {
playMusic(2);
} else playMusic(10);
+
// loads part5 room into memory
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
// copies current screenLayer1 into screenLayer2 to hold a copy
@@ -60,18 +219,20 @@ void IgorEngine::PART_85() {
_updateDialogue = &IgorEngine::PART_85_UPDATE_DIALOGUE_PHILIP_LAURA;
_updateRoomBackground = &IgorEngine::PART_85_UPDATE_ROOM_BACKGROUND;
+
// In the CD version the water sound is embedded in the CD track
if(_game.flags & kFlagFloppy) {
VAR_WATER_SOUND_PLAYING = true;
playSound(17, 1);
}
+
fadeIn(768);
//decode first frame and paint it
decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
- //Laura does her hair
- PART_85_HELPER_1_PLAY_ANIM(0, 0x7481, 2, 7, 32);
+ // Laura does her hair
+ PART_85_HELPER_1_playAnimationFrame(0, 0x7481, 2, 7, 32);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
// 3 lines of text
@@ -95,7 +256,7 @@ void IgorEngine::PART_85() {
VAR_CURRENT_TALKING_ACTOR = 1;
waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
- PART_85_HELPER_1_PLAY_ANIM(0, 0x7481, 2, 7, 32);
+ PART_85_HELPER_1_playAnimationFrame(0, 0x7481, 2, 7, 32);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
cutsceneSayStart(89, 56, 63, 63, 0, { { 215, 1, 554 }, { 216, 2, 555 }, { 218, 1, 556 } });
VAR_CURRENT_TALKING_ACTOR = 0;
@@ -106,15 +267,15 @@ void IgorEngine::PART_85() {
waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true);
- PART_85_HELPER_1_PLAY_ANIM(0, 0x7481, 2, 7, 32);
+ PART_85_HELPER_1_playAnimationFrame(0, 0x7481, 2, 7, 32);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
- PART_85_HELPER_1_PLAY_ANIM(0, 0x7481, 18, 37, 20);
+ PART_85_HELPER_1_playAnimationFrame(0, 0x7481, 18, 37, 20);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
- PART_85_HELPER_2_SCROLL_RIGHT();
+ PART_85_HELPER_2_scrollRight();
VAR_WATER_SOUND_PLAYING = false;
stopSound();
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
- PART_85_HELPER_1_PLAY_ANIM(0x74CA, 0xA6C4, 1, 6, 32);
+ PART_85_HELPER_1_playAnimationFrame(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();
@@ -128,16 +289,16 @@ void IgorEngine::PART_85() {
_walkCurrentPos = 4;
igorSayAndWait(223, 2, 559);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
- PART_85_HELPER_1_PLAY_ANIM(0x74CA, 0xA6C4, 7, 9, 32);
+ PART_85_HELPER_1_playAnimationFrame(0x74CA, 0xA6C4, 7, 9, 32);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
_walkData[0].x = 250;
_walkData[0].y = 119;
_walkCurrentPos = 3;
igorSayAndWait({ { 225, 2, 560 }, { 227, 3, 561 } });
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
- PART_85_HELPER_1_PLAY_ANIM(0x74CA, 0xA6C4, 10, 24, 16);
+ PART_85_HELPER_1_playAnimationFrame(0x74CA, 0xA6C4, 10, 24, 16);
if (_game.version == kIdSpaCD) {
- displayLogo(); // cseg209:0x12B5
+ displayLogo();
}
PART_85_EXIT:
@@ -156,143 +317,4 @@ PART_85_EXIT:
_updateRoomBackground = 0;
}
-void IgorEngine::displayLogo() {
- // The CD executable preserves the last intro frame while it displays a
- // 320x122 title card, then restores that frame before entering part 61.
- memcpy(_screenTextLayer, _screenVGA, 46080); // cseg209:0x03EE-0x0400
- playSound(65, 1); // cseg209:0x041C-0x0420
-
- memcpy(_paletteBuffer, _currentPalette, 768); // cseg209:0x0425-0x0432
- loadData(PAL_IgorIntroLogo, _currentPalette); // cseg209:0x0437-0x0460
- _currentPalette[765] = 63; // cseg209:0x0465
- _currentPalette[766] = 63; // cseg209:0x046A
- _currentPalette[767] = 63; // cseg209:0x046F
- uint8 logoColor255[3];
- memcpy(logoColor255, _currentPalette + 765, 3);
- memset(_currentPalette + 765, 0, 3); // cseg209:0x0474-0x047D
- updatePalette(768); // cseg209:0x0474-0x0486
- loadData(IMG_IgorIntroLogo, _screenVGA); // cseg209:0x048B-0x04B8
-
- for (int i = 0; i <= 200 / kTimerTicksCount; ++i) { // cseg209:0x04BD-0x04F2
- PART_85_UPDATE_ROOM_BACKGROUND();
- waitForTimer();
- }
-
- uint8 *subtitle = loadData(FRM_IgorIntroLogo); // cseg209:0x0002
- for (int y = 0; y < 13; ++y) {
- for (int x = 0; x < 206; ++x) {
- const uint8 color = subtitle[y * 206 + x];
- if (color != 255) {
- _screenVGA[(130 + y) * 320 + 57 + x] = (color == 241) ? 0 : 255;
- }
- }
- }
- free(subtitle);
-
- // Fade color 255 from black to the logo's white. cseg209:0x04F9-0x05CB
- for (int threshold = 63; threshold >= 0; threshold -= 3) {
- for (int i = 765; i < 768; ++i) { // cseg209:0x0504-0x05B8
- if (logoColor255[i - 765] >= threshold) {
- const int color = _currentPalette[i] + 3;
- _currentPalette[i] = MIN<int>(color, logoColor255[i - 765]);
- }
- }
- setPaletteRange(255, 255); // cseg209:0x05BB-0x05BF
- waitForTimer();
- }
-
- // The original counter runs in DOS timer units; waitForTimer() advances by
- // kTimerTicksCount units. cseg209:0x05CE-0x0635
- for (int i = 0; i <= 1500 / kTimerTicksCount; ++i) {
- PART_85_UPDATE_ROOM_BACKGROUND();
- waitForTimer();
- if (_inputVars[kInputClick] || _inputVars[kInputEscape] || _inputVars[kInputOptions]) {
- _inputVars[kInputClick] = 0;
- _inputVars[kInputEscape] = 0;
- _inputVars[kInputOptions] = 0;
- break;
- }
- }
-
- memcpy(_screenVGA, _screenTextLayer, 39040); // cseg209:0x0637-0x0649
- memcpy(_currentPalette, _paletteBuffer, 765); // cseg209:0x064E-0x065B
- setPaletteRange(0, 255); // cseg209:0x0660-0x0664
-
- // Fade the subtitle, which remains below the 122 restored rows and uses
- // palette color 255. cseg209:0x0669-0x0705
- for (int threshold = 0; threshold <= 63; threshold += 3) {
- for (int i = 765; i < 768; ++i) { // cseg209:0x066E-0x06E6
- if (logoColor255[i - 765] >= threshold) {
- _currentPalette[i] = (_currentPalette[i] < 3) ? 0 : _currentPalette[i] - 3;
- }
- }
- setPaletteRange(255, 255); // cseg209:0x06F0-0x06F4
- waitForTimer();
- }
-
- memcpy(_screenVGA, _screenTextLayer, 46080); // cseg209:0x0708-0x071A
- _currentPalette[765] = 63; // cseg209:0x071F
- _currentPalette[766] = 63; // cseg209:0x0724
- _currentPalette[767] = 63; // cseg209:0x0729
- setPaletteRange(255, 255); // cseg209:0x072E-0x0740
-}
-
-void IgorEngine::PART_85_HELPER_1_PLAY_ANIM(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_SCROLL_RIGHT() {
- int x = 1;
- do {
- if (compareGameTick(0, 16)) {
- copyArea(_screenTextLayer, 0, 320, _screenLayer1 + x * 8, 320, 320 - x * 8, 144);
- copyArea(_screenTextLayer, 320 - x * 8, 320, _screenLayer2 + 96, 320, x * 8, 144);
- memcpy(_screenVGA, _screenTextLayer, 46080);
- ++x;
- }
- PART_85_UPDATE_ROOM_BACKGROUND();
- waitForTimer();
- } while (x != 29 && !_inputVars[kInputEscape]);
-}
-
-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 (_game.flags & kFlagFloppy /*|| !_gameState.dialogueTextRunning*/) {
- playSound(17, 1);
- }
-}
-
-void IgorEngine::PART_85_HELPER_6_animateIgorHead(int frame) {
- const int offset = (_walkCurrentPos == 4) ? 24564 : 22643;
- // Animate Igor's head by copying the relevant area from the screen and overlaying the head frame.
- copyArea(_screenVGA, offset, 320, _screenLayer2 + offset, 320, 14, 8);
- copyArea(_screenVGA, offset, 320, _igorHeadFrames + (_walkCurrentPos - 1) * 924 + frame * 154, 14, 14, 8, true);
-}
-
} // End of namespace Igor
Commit: 0209e75fda7dcf20e6a9fdfdf66701d9c7c79ecb
https://github.com/scummvm/scummvm/commit/0209e75fda7dcf20e6a9fdfdf66701d9c7c79ecb
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:54+01:00
Commit Message:
IGOR: fix speech sound 999 not playing, renaming stuff in the process
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_16.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_26.cpp
engines/igor/parts/part_31.cpp
engines/igor/parts/part_69.cpp
engines/igor/parts/part_71.cpp
engines/igor/parts/part_79.cpp
engines/igor/parts/part_margaret.cpp
engines/igor/parts/part_maze.cpp
engines/igor/parts/part_maze_data.cpp
engines/igor/sound.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index ce73cfde5c7..a9d92d7815a 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -57,7 +57,7 @@ enum {
kFastModeFactor = 4,
kFastModeMaxFactor = 16,
kMaxSaveStates = 10,
- kNoSpeechSound = 999
+ kNoSpeechSound = 0
};
enum {
@@ -313,6 +313,19 @@ enum ObjectType {
kObjectTypeRoom = 2
};
+enum {
+ kPhysicsClassDoorStateIndex = 64,
+ kMargaretStateIndex = 65
+};
+
+enum MargaretState {
+ kMargaretStateInitial = 0,
+ kMargaretStateNoteAltered,
+ kMargaretStateReadNote,
+ kMargaretStatePhotoTaken,
+ kMargaretStatePhotoSequenceComplete
+};
+
enum Verb {
kVerbWalk = 1,
kVerbTalk,
@@ -895,13 +908,13 @@ private:
// 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_ACTION_101_leaveLeft();
+ void PART_21_ACTION_102_talkToMargaret();
+ void PART_21_ACTION_107_openPhysicsDoor();
+ void PART_21_ACTION_108_closePhysicsDoor();
+ void PART_21_ACTION_110_leaveRight();
+ void PART_21_ACTION_111_useNoteWithSandwhiches();
+ void PART_21_ACTION_113_enterPhysicsClass();
void PART_21_UPDATE_ROOM_BACKGROUND();
void PART_21_UPDATE_DIALOGUE_MARGARET_1(int action);
void PART_21_UPDATE_DIALOGUE_MARGARET_2(int action);
@@ -911,13 +924,13 @@ private:
void PART_21_HELPER_2_enterFromLeft();
void PART_21_HELPER_3_enterFromRight();
void PART_21_HELPER_4_enterFromPhysicsClass();
- void PART_21_HELPER_5();
- 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_HELPER_5_waitForIgorWalkWithAnimation();
+ void PART_21_HELPER_6_drawMargaretFrameComposited(int frame);
+ void PART_21_HELPER_7_drawClosedDoor();
+ void PART_21_HELPER_8_drawOpenDoor();
+ void PART_21_HELPER_9_drawMargaret();
+ void PART_21_HELPER_10_MargaretTakesNote();
+ void PART_21_HELPER_11_setMargaretBackgroundFrame(int frame);
void PART_21();
// church bell tower
@@ -1037,7 +1050,7 @@ private:
// college corridor stairs second floor
void PART_31_EXEC_ACTION(int action);
- void PART_31_ACTION_102();
+ void PART_31_ACTION_102_enterAstronomyLab();
void PART_31_ACTION_103_openDoor();
void PART_31_ACTION_106_goDownstairs();
void PART_31_ACTION_110_openDoor2();
@@ -1189,10 +1202,10 @@ private:
void PART_69_APPLY_OBJECT_STATE();
void PART_69_DRAW_FIREFLY_A(int frame);
void PART_69_DRAW_FIREFLY_B(int frame);
- void PART_69_ANIMATE_FIREFLIES();
+ void PART_69_animateFireflies();
void PART_69_ACTION_107_watch();
void PART_69_FINALE(int num, int sound);
- void PART_69_ENTER_FROM_RIGHT();
+ void PART_69_enterFromRight();
void PART_69_UPDATE_ROOM_BACKGROUND();
void PART_69();
@@ -1207,7 +1220,7 @@ private:
void PART_71_DRAW_OBJECT(int frame);
void PART_71_ACTION_102_takeObject();
void PART_71_ACTION_103_look();
- void PART_71_ENTER_FROM_RIGHT();
+ void PART_71_enterFromRight();
void PART_71_LIGHTNING();
void PART_71_UPDATE_ROOM_BACKGROUND();
void PART_71();
@@ -1273,32 +1286,32 @@ private:
void PART_78_professorWarnings(int which);
void PART_78();
- void PART_79_DRAW_FIGURE(int frame);
- void PART_79_DRAW_PATCH(int step);
- void PART_79_CLEAR_PATCH();
- void PART_79_UPDATE_AMBIENT_790();
- void PART_79_UPDATE_DIALOGUE_790(int action);
- void PART_79_SAY_790(const Common::Array<DialogueText> &lines);
- void PART_79_SLIDE();
- void PART_79_790();
- void PART_79_DRAW_GROUP_FRAME(const uint8 *buffer, int table, int base, int frame);
- void PART_79_DRAW_SCENE(int frame);
- void PART_79_DRAW_LAYER2_FRAME(int frame);
- void PART_79_DRAW_LAYER2_FRAME_2(int frame);
- void PART_79_DRAW_ANIM2_FRAME(const void *group, int frame);
- void PART_79_ANIMATE_IGOR_HEAD(int frame);
+ void PART_79_drawLauraInWater(int frame);
+ void PART_79_drawReflection(int step);
+ void PART_79_clearReflection();
+ void PART_79_updateReflection();
+ void PART_79_updateLauraInWaterDialogue(int action);
+ void PART_79_sayLaura(const Common::Array<DialogueText> &lines);
+ void PART_79_scroll();
+ void PART_79_LauraInWater();
+ void PART_79_drawGroupFrame(const uint8 *buffer, int table, int base, int frame);
+ void PART_79_drawBoomerangScene(int frame);
+ void PART_79_drawKiss(int frame);
+ void PART_79_drawCircularClosingTransition(int frame);
+ void PART_79_drawPhilipSharkScene(const void *group, int frame);
+ void PART_79_animateIgorHead(int frame);
void PART_79_UPDATE_DIALOGUE_SPEAKER(int action);
void PART_79_UPDATE_DIALOGUE_FIRST_SPEAKER(int action);
void PART_79_UPDATE_DIALOGUE_THIRD_SPEAKER(int action);
- void PART_79_UPDATE_AMBIENT_791();
+ void PART_79_animatePhilipShaking();
void PART_79_SAY_SPEAKER(int startX, int startY, int x, int y, int r, int g, int b, int endFrame, int baseFrame, const Common::Array<DialogueText> &lines);
- void PART_79_SAY_FIRST_SPEAKER(int startX, int startY, const Common::Array<DialogueText> &lines);
- void PART_79_SAY_THIRD_SPEAKER(const Common::Array<DialogueText> &lines);
- void PART_79_IGOR_SAY(const Common::Array<DialogueText> &lines);
- void PART_79_SET_IGOR_POS(int x, int y);
+ void PART_79_sayLaura(int startX, int startY, const Common::Array<DialogueText> &lines);
+ void PART_79_sayPhilip(const Common::Array<DialogueText> &lines);
+ void PART_79_sayIgor(const Common::Array<DialogueText> &lines);
+ void PART_79_setIgorPos(int x, int y);
void PART_79_FADE_COLORS(int first, int last, bool fadeInColors);
void PART_79_FADE_IN_PAIR(int firstColor);
- void PART_79_791();
+ void PART_79_beachScene();
void PART_79();
void PART_80_drawFrame(int frame);
@@ -1340,12 +1353,12 @@ private:
void maybeUpdateFlicker();
void mazeFlicker();
void mazeDrawFlameFrame(int x, int y, int frame);
- void MAZE_ENTER_WALK(const MazeEntry &entry);
+ void MAZE_walkIn(const MazeEntry &entry);
void enterFromStairs(const MazeEntry &entry);
void mazeWalkToExit(const MazeAction &action);
void mazeExitThroughStairs(const MazeAction &action);
void mazeGoToNeighbor(int dir);
- int MAZE_MUSIC_TRACK() const;
+ int MAZE_getMusicTrack() const;
void setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp, int yBottom = 143);
void UPDATE_OBJECT_STATE(int num);
@@ -1354,8 +1367,8 @@ private:
void PART_meanwhile(int img = IMG_Meanwhile);
// Margaret cutscenes
- void PART_MARGARET_ROOM_CUTSCENE_HELPER_1();
- void PART_MARGARET_ROOM_CUTSCENE_HELPER_2(int frame);
+ void PART_MARGARET_ROOM_CUTSCENE_drawMargaretBasePose();
+ void PART_MARGARET_ROOM_CUTSCENE_drawMargaretFrame(int frame);
void PART_MARGARET_ROOM_CUTSCENE_UPDATE_DIALOGUE_MARGARET(int action);
void PART_MARGARET_ROOM_CUTSCENE();
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index 965d489cb91..05234f8f672 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -192,7 +192,7 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
_inventoryInfo[54] = _inventoryInfo[73];
_inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
_objectsState[53] = 1;
- _objectsState[65] = 3;
+ _objectsState[kMargaretStateIndex] = kMargaretStatePhotoTaken;
_currentPart = 261;
}
@@ -232,7 +232,7 @@ void IgorEngine::PART_16() {
_currentAction.verb = kVerbWalk;
fadeIn(768);
PART_16_HELPER_2_enterScene();
- if (_objectsState[65] == 2 && _inventoryInfo[71] != 0 && _objectsState[76] == 1) {
+ if (_objectsState[kMargaretStateIndex] == kMargaretStateReadNote && _inventoryInfo[71] != 0 && _objectsState[76] == 1) {
PART_16_HELPER_3_photoCutscene();
}
enterPartLoop();
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index 67b79dbb2a0..46477a11555 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -31,10 +31,10 @@ static bool IN_ACTION_111;
void IgorEngine::PART_21_EXEC_ACTION(int action) {
switch (action) {
case 101:
- PART_21_ACTION_101();
+ PART_21_ACTION_101_leaveLeft();
break;
case 102:
- PART_21_ACTION_102();
+ PART_21_ACTION_102_talkToMargaret();
break;
case 103:
igorSay(201, 1, 1177);
@@ -49,25 +49,25 @@ void IgorEngine::PART_21_EXEC_ACTION(int action) {
igorSay(204, 1, 1180);
break;
case 107:
- PART_21_ACTION_107();
+ PART_21_ACTION_107_openPhysicsDoor();
break;
case 108:
- PART_21_ACTION_108();
+ PART_21_ACTION_108_closePhysicsDoor();
break;
case 109:
igorSay(205, 1, 1181);
break;
case 110:
- PART_21_ACTION_110();
+ PART_21_ACTION_110_leaveRight();
break;
case 111:
- PART_21_ACTION_111();
+ PART_21_ACTION_111_useNoteWithSandwhiches();
break;
case 112:
igorSay(222, 1, 1195);
break;
case 113:
- PART_21_ACTION_113();
+ PART_21_ACTION_113_enterPhysicsClass();
break;
default:
error("PART_21_EXEC_ACTION unhandled action %d", action);
@@ -75,17 +75,17 @@ void IgorEngine::PART_21_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_21_ACTION_101() {
+void IgorEngine::PART_21_ACTION_101_leaveLeft() {
if (_objectsState[65] == 1) {
const int offset = 29440;
copyArea(_screenVGA, offset, 320, _screenLayer1 + offset, 320, 20, 51);
- PART_21_HELPER_10();
+ PART_21_HELPER_10_MargaretTakesNote();
}
_currentPart = 303;
}
-void IgorEngine::PART_21_ACTION_102() {
- PART_21_HELPER_6(1);
+void IgorEngine::PART_21_ACTION_102_talkToMargaret() {
+ PART_21_HELPER_6_drawMargaretFrameComposited(1);
igorSayAndWait(226, 1, 1197);
cutsceneSayStart(76, 87, 63, 32, 0, 227, 1, 1198);
_updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_2;
@@ -98,7 +98,7 @@ void IgorEngine::PART_21_ACTION_102() {
PART_21_HELPER_1_OBJECT_STATE(255);
}
-void IgorEngine::PART_21_ACTION_107() {
+void IgorEngine::PART_21_ACTION_107_openPhysicsDoor() {
if (_objectsState[64] == 1) {
EXEC_MAIN_ACTION(11);
return;
@@ -116,7 +116,7 @@ void IgorEngine::PART_21_ACTION_107() {
PART_21_HELPER_1_OBJECT_STATE(1);
}
-void IgorEngine::PART_21_ACTION_108() {
+void IgorEngine::PART_21_ACTION_108_closePhysicsDoor() {
if (_objectsState[64] == 0) {
EXEC_MAIN_ACTION(14);
return;
@@ -133,16 +133,16 @@ void IgorEngine::PART_21_ACTION_108() {
PART_21_HELPER_1_OBJECT_STATE(1);
}
-void IgorEngine::PART_21_ACTION_110() {
+void IgorEngine::PART_21_ACTION_110_leaveRight() {
if (_objectsState[65] == 1) {
const int offset = 27180;
copyArea(_screenVGA, offset, 320, _screenLayer1 + offset, 320, 20, 51);
- PART_21_HELPER_10();
+ PART_21_HELPER_10_MargaretTakesNote();
}
_currentPart = 270;
}
-void IgorEngine::PART_21_ACTION_111() {
+void IgorEngine::PART_21_ACTION_111_useNoteWithSandwhiches() {
if (_inventoryInfo[65] == 0) {
igorSay(223, 2, 1196);
return;
@@ -173,16 +173,16 @@ void IgorEngine::PART_21_ACTION_111() {
igorSay(210, 2, 1186);
}
-void IgorEngine::PART_21_ACTION_113() {
+void IgorEngine::PART_21_ACTION_113_enterPhysicsClass() {
if (_objectsState[64] != 0) {
_roomObjectAreasTable[_screenLayer2[34679]].area = 1;
--_walkDataLastIndex;
buildWalkPathSimple(165, 126, 119, 108);
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- PART_21_HELPER_5();
+ PART_21_HELPER_5_waitForIgorWalkWithAnimation();
if (_objectsState[65] == 1) {
- PART_21_HELPER_10();
+ PART_21_HELPER_10_MargaretTakesNote();
}
_currentPart = 370;
}
@@ -191,13 +191,13 @@ void IgorEngine::PART_21_ACTION_113() {
void IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_1(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_21_HELPER_11(6);
+ PART_21_HELPER_11_setMargaretBackgroundFrame(6);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_21_HELPER_11(getRandomNumber(4) + 6);
+ PART_21_HELPER_11_setMargaretBackgroundFrame(getRandomNumber(4) + 6);
break;
case kUpdateDialogueAnimStanding:
- PART_21_HELPER_11(1);
+ PART_21_HELPER_11_setMargaretBackgroundFrame(1);
break;
}
}
@@ -205,10 +205,10 @@ void IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_1(int action) {
void IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_2(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_21_HELPER_6(6);
+ PART_21_HELPER_6_drawMargaretFrameComposited(6);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_21_HELPER_6(getRandomNumber(4) + 6);
+ PART_21_HELPER_6_drawMargaretFrameComposited(getRandomNumber(4) + 6);
break;
}
}
@@ -216,10 +216,10 @@ void IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_2(int action) {
void IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_3(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_21_HELPER_6(15);
+ PART_21_HELPER_6_drawMargaretFrameComposited(15);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_21_HELPER_6(getRandomNumber(4) + 15);
+ PART_21_HELPER_6_drawMargaretFrameComposited(getRandomNumber(4) + 15);
break;
}
}
@@ -233,17 +233,19 @@ void IgorEngine::PART_21_HANDLE_DIALOGUE_MARGARET() {
void IgorEngine::PART_21_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
+ // physics class door
if (_objectsState[64] == 0) {
- PART_21_HELPER_7();
+ PART_21_HELPER_7_drawClosedDoor();
_roomActionsTable[4] = 6;
} else {
- PART_21_HELPER_8();
+ PART_21_HELPER_8_drawOpenDoor();
_roomActionsTable[4] = 7;
}
}
if (num == 2 || num == 255) {
+ // is margaret present?
if (_objectsState[65] <= 1) {
- PART_21_HELPER_9();
+ PART_21_HELPER_9_drawMargaret();
}
if (_objectsState[65] == 2 || _objectsState[65] == 4) {
_roomObjectAreasTable[9].object = 0;
@@ -262,7 +264,7 @@ void IgorEngine::PART_21_HELPER_2_enterFromLeft() {
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- PART_21_HELPER_5();
+ PART_21_HELPER_5_waitForIgorWalkWithAnimation();
}
void IgorEngine::PART_21_HELPER_3_enterFromRight() {
@@ -274,7 +276,7 @@ void IgorEngine::PART_21_HELPER_3_enterFromRight() {
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- PART_21_HELPER_5();
+ PART_21_HELPER_5_waitForIgorWalkWithAnimation();
}
void IgorEngine::PART_21_HELPER_4_enterFromPhysicsClass() {
@@ -287,10 +289,10 @@ void IgorEngine::PART_21_HELPER_4_enterFromPhysicsClass() {
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- PART_21_HELPER_5();
+ PART_21_HELPER_5_waitForIgorWalkWithAnimation();
}
-void IgorEngine::PART_21_HELPER_5() {
+void IgorEngine::PART_21_HELPER_5_waitForIgorWalkWithAnimation() {
// Same walk loop as waitForIgorMove(), but the room background keeps
// animating (Margaret) while Igor walks.
_gameTicks = 0;
@@ -310,7 +312,7 @@ void IgorEngine::PART_21_HELPER_5() {
} while (_gameState.igorMoving);
}
-void IgorEngine::PART_21_HELPER_6(int frame) {
+void IgorEngine::PART_21_HELPER_6_drawMargaretFrameComposited(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 42; ++i) {
for (int j = 0; j <= 48; ++j) {
@@ -331,27 +333,27 @@ void IgorEngine::PART_21_HELPER_6(int frame) {
}
}
-void IgorEngine::PART_21_HELPER_7() {
+void IgorEngine::PART_21_HELPER_7_drawClosedDoor() {
const int offset = 21901;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xE031, 33, 33, 54);
}
-void IgorEngine::PART_21_HELPER_8() {
+void IgorEngine::PART_21_HELPER_8_drawOpenDoor() {
const int offset = 21901;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xE727, 33, 33, 54);
}
-void IgorEngine::PART_21_HELPER_9() {
+void IgorEngine::PART_21_HELPER_9_drawMargaret() {
const int offset = 28520;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x14E2, 49, 49, 43);
}
-void IgorEngine::PART_21_HELPER_10() {
- PART_21_HELPER_6(1);
+void IgorEngine::PART_21_HELPER_10_MargaretTakesNote() {
+ PART_21_HELPER_6_drawMargaretFrameComposited(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]);
+ PART_21_HELPER_6_drawMargaretFrameComposited(PART_21_ANIM_DATA_1[i]);
if (i < 6) {
waitForTimer(100);
}
@@ -376,7 +378,7 @@ void IgorEngine::PART_21_HELPER_10() {
_objectsState[110] = 1;
}
-void IgorEngine::PART_21_HELPER_11(int frame) {
+void IgorEngine::PART_21_HELPER_11_setMargaretBackgroundFrame(int frame) {
const int offset = 28520;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + frame * 2107 + 0xCA7, 49, 49, 43);
}
@@ -390,7 +392,7 @@ void IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND() {
}
if (compareGameTick(61) && _objectsState[65] <= 1) {
if (_gameState.unk10 > 2) {
- PART_21_HELPER_6(_gameState.unk10);
+ PART_21_HELPER_6_drawMargaretFrameComposited(_gameState.unk10);
++_gameState.unk10;
if (_gameState.unk10 == 6) {
++_gameState.counter[4];
@@ -402,7 +404,7 @@ void IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND() {
}
}
} else {
- PART_21_HELPER_6(_gameState.unk10);
+ PART_21_HELPER_6_drawMargaretFrameComposited(_gameState.unk10);
++_gameState.unk10;
if (_gameState.unk10 == 3 && getRandomNumber(5) != 0) {
_gameState.unk10 = 1;
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index b012d67a25a..8ba2aab06a0 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -184,9 +184,9 @@ void IgorEngine::PART_26_HELPER_5_enterFromLaboratory() {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- if (_objectsState[65] == 3) {
+ if (_objectsState[kMargaretStateIndex] == kMargaretStatePhotoTaken) {
igorSay({ { 212, 1, 1281 }, { 213, 2, 1282 }, { 215, 1, 1283 } });
- _objectsState[65] = 4;
+ _objectsState[kMargaretStateIndex] = kMargaretStatePhotoSequenceComplete;
drawVerbsPanel();
redrawVerb(kVerbWalk, true);
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index 16029f8a470..4f9d7a92e27 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -34,7 +34,7 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
_currentPart = 251;
break;
case 102:
- PART_31_ACTION_102();
+ PART_31_ACTION_102_enterAstronomyLab();
break;
case 103:
PART_31_ACTION_103_openDoor();
@@ -88,7 +88,7 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_31_ACTION_102() {
+void IgorEngine::PART_31_ACTION_102_enterAstronomyLab() {
if (_objectsState[72] == 0) {
return;
}
diff --git a/engines/igor/parts/part_69.cpp b/engines/igor/parts/part_69.cpp
index 79f4834904d..666513750de 100644
--- a/engines/igor/parts/part_69.cpp
+++ b/engines/igor/parts/part_69.cpp
@@ -26,12 +26,16 @@ namespace Igor {
// the first and the second firefly of the room, the transformation and the ending.
static const int kPart69FireflyAFramesBase = 0;
static const int kPart69FireflyAFramesTable = 0xB138;
+
static const int kPart69FireflyBFramesBase = 0xB200;
static const int kPart69FireflyBFramesTable = 0xBBA;
+
static const int kPart69FramesCBase = 0xBE3A;
static const int kPart69FramesCTable = 0x3FF;
+
static const int kPart69FramesDBase = 0xC265;
static const int kPart69FramesDTable = 0x179C;
+
static const int kPart69PictureAnimOffset = 0xDA1F;
static const int kPart69PictureOffset = 69 * 320 + 148;
static const int kPart69PictureWidth = 27;
@@ -56,6 +60,7 @@ static const uint8 kPart69StepLastFireflyFrameA[7] = { 0, 80, 20, 50, 100, 40, 7
static const uint8 kPart69StepNext[7] = { 70, 1, 2, 3, 2, 3, 1 };
static const uint8 kPart69StepFirstFireflyFrameB[4] = { 1, 41, 1, 21 };
static const uint8 kPart69StepLastFireflyFrameB[4] = { 0, 64, 20, 40 };
+
// The areas that answer to the step, and the areas of the second firefly.
static const uint8 kPart69StepAreas[4] = { 0, 1, 52, 16 };
static const uint8 kPart69SecondFireflyAreas[4] = { 0, 2, 72, 45 };
@@ -131,7 +136,7 @@ void IgorEngine::PART_69_DRAW_FIREFLY_B(int frame) {
* Runs the sequence of the two fireflies, one frame of each every 16 ticks, and sets which places answer to the
* fireflies.
*/
-void IgorEngine::PART_69_ANIMATE_FIREFLIES() {
+void IgorEngine::PART_69_animateFireflies() {
if (!compareGameTick(13, 16)) {
return;
}
@@ -186,9 +191,7 @@ void IgorEngine::PART_69_ANIMATE_FIREFLIES() {
}
}
-/**
- * The end of the scene: the last frames of the ending and what Igor says.
- */
+
void IgorEngine::PART_69_FINALE(int num, int sound) {
for (int frame = kPart69EndingFrameLast; frame <= kPart69EndingFrameLast + 1; ++frame) {
decodeAnimFrame(getAnimFrame(kPart69FramesDBase, kPart69FramesDTable, frame), _screenVGA, true);
@@ -205,7 +208,7 @@ void IgorEngine::PART_69_ACTION_107_watch() {
drawAnimRect(kPart69PictureOffset, kPart69PictureAnimOffset, kPart69PictureWidth, kPart69PictureHeight);
if (_objectsState[kPart69VaseState] == 0) {
for (int i = 0; i < 1000 / kTimerTicksCount && !_eventQuitGame; ++i) {
- PART_69_ANIMATE_FIREFLIES();
+ PART_69_animateFireflies();
waitForTimer();
}
PART_69_FINALE(211, 1090);
@@ -213,7 +216,7 @@ void IgorEngine::PART_69_ACTION_107_watch() {
}
do {
- PART_69_ANIMATE_FIREFLIES();
+ PART_69_animateFireflies();
waitForTimer();
} while (!(_objectsState[kPart69SequenceState] == 3 && _objectsState[kPart69SecondFireflyState] == 0) && !_eventQuitGame);
@@ -256,7 +259,7 @@ void IgorEngine::PART_69_ACTION_107_watch() {
/**
* Igor comes from the right edge, walking to the left, while the fireflies move.
*/
-void IgorEngine::PART_69_ENTER_FROM_RIGHT() {
+void IgorEngine::PART_69_enterFromRight() {
WalkData *wd = &_walkData[0];
wd->setPos(319, kPart69EntryY, kFacingPositionLeft, 0);
wd->clipSkipX = 1;
@@ -272,7 +275,7 @@ void IgorEngine::PART_69_ENTER_FROM_RIGHT() {
buildWalkPath(319, kPart69EntryY, kPart69EntryDstX, kPart69EntryY);
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_69_ANIMATE_FIREFLIES);
+ waitForIgorMove(&IgorEngine::PART_69_animateFireflies);
}
void IgorEngine::PART_69_UPDATE_ROOM_BACKGROUND() {
@@ -291,7 +294,7 @@ void IgorEngine::PART_69_UPDATE_ROOM_BACKGROUND() {
}
}
}
- PART_69_ANIMATE_FIREFLIES();
+ PART_69_animateFireflies();
}
void IgorEngine::PART_69() {
@@ -326,7 +329,7 @@ void IgorEngine::PART_69() {
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_69_ENTER_FROM_RIGHT();
+ PART_69_enterFromRight();
}
enterPartLoop();
while (_currentPart == 690 && !_gameStateLoaded) {
diff --git a/engines/igor/parts/part_71.cpp b/engines/igor/parts/part_71.cpp
index 6967725f131..70edbfe4d15 100644
--- a/engines/igor/parts/part_71.cpp
+++ b/engines/igor/parts/part_71.cpp
@@ -22,8 +22,6 @@
namespace Igor {
-// The animation resource starts with the three frames of Igor taking the object (34x50 each, drawn on the screen) and
-// ends with the two versions of the object as it is drawn in the room picture (5x6 each).
static const int kPart71TakeFramesCount = 3;
static const int kPart71TakeWidth = 34;
static const int kPart71TakeHeight = 50;
@@ -31,18 +29,18 @@ static const int kPart71TakeFrameSize = kPart71TakeWidth * kPart71TakeHeight;
static const int kPart71TakeOffset = 23 * 320 + 101;
static const int kPart71TakeFrameDelay = 91;
-static const int kPart71ObjectOffset = 55 * 320 + 101;
-static const int kPart71ObjectWidth = 5;
-static const int kPart71ObjectHeight = 6;
-static const int kPart71ObjectPicturesOffset = kPart71TakeFramesCount * kPart71TakeFrameSize;
+static const int kPart71StatuetteFrameOffset = 55 * 320 + 101;
+static const int kPart71StatuetteFrameWidth = 5;
+static const int kPart71StatuetteFrameHeight = 6;
+static const int kPart71StatuetteFramesOffset = kPart71TakeFramesCount * kPart71TakeFrameSize;
static const int kPart71TakenStateIndex = 100;
-static const int kPart71ExaminedStateIndex = 101;
+static const int kPart71StatuetteExamined = 101;
static const int kPart71StatuetteTaken = 106;
-static const int kPart71ObjectNameIndex = 2;
-static const int kPart71InventoryObject = 25;
-static const int kPart71InventoryIndex = 60;
+static const int kPart71StatuetteNameIndex = 2;
+static const int kPart71StatuetteInventoryNumber = 25;
+static const int kPart71StatuetteInventoryIndex = 60;
// What PART_71_APPLY_OBJECT_STATE refreshes.
static const int kPart71ApplyPicture = 1;
@@ -55,25 +53,25 @@ static const int kPart71ThunderSound = 42;
void IgorEngine::PART_71_EXEC_ACTION(int action) {
switch (action) {
- case 101:
+ case 101: // look at John O'Callahan's grave
igorSay({ { 201, 1, 993 }, { 202, 1, 994 }, { 203, 1, 995 } });
break;
- case 102:
+ case 102: // take statuette
PART_71_ACTION_102_takeObject();
break;
- case 103:
+ case 103: // look at statuette
PART_71_ACTION_103_look();
break;
- case 104:
+ case 104: // look at Mary O'hara's grave
igorSay({ { 208, 1, 997 }, { 209, 1, 998 }, { 210, 1, 999 } });
break;
- case 105:
+ case 105: // leave
_currentPart = 681;
break;
- case 106:
+ case 106: // look at chris mcpherson's grave
igorSay({ { 212, 1, 1000 }, { 213, 1, 1001 }, { 214, 1, 1002 } });
break;
- case 107:
+ case 107: // look at pat's grave
igorSay({ { 216, 1, 1003 }, { 217, 2, 1004 } });
break;
default:
@@ -86,66 +84,53 @@ void IgorEngine::PART_71_EXEC_ACTION(int action) {
* Draws one of the two versions of the object into the room picture.
*/
void IgorEngine::PART_71_DRAW_OBJECT(int frame) {
- const int frameSize = kPart71ObjectWidth * kPart71ObjectHeight;
- copyArea(_screenLayer1, kPart71ObjectOffset, 320, _animFramesBuffer + kPart71ObjectPicturesOffset + frame * frameSize,
- kPart71ObjectWidth, kPart71ObjectWidth, kPart71ObjectHeight);
+ const int frameSize = kPart71StatuetteFrameWidth * kPart71StatuetteFrameHeight;
+ copyArea(_screenLayer1, kPart71StatuetteFrameOffset, 320, _animFramesBuffer + kPart71StatuetteFramesOffset + frame * frameSize,
+ kPart71StatuetteFrameWidth, kPart71StatuetteFrameWidth, kPart71StatuetteFrameHeight);
}
-/**
- * Refreshes what depends on the story: the picture of the object (it is gone once Igor has taken it) and its name
- * (it changes once Igor has examined it).
- */
+
void IgorEngine::PART_71_APPLY_OBJECT_STATE(int what) {
if (what == kPart71ApplyPicture || what == kPart71ApplyAll) {
PART_71_DRAW_OBJECT(_objectsState[kPart71TakenStateIndex] == 0 ? 0 : 1);
}
if (what == kPart71ApplyName || what == kPart71ApplyAll) {
- const char *name = getString(_objectsState[kPart71ExaminedStateIndex] == 0 ? STR_ShinyThing : STR_Statuette);
- // TODO: the name of the object before it is examined is only known in Spanish; the other languages keep the
- // name that comes with the room.
+ const char *name = getString(_objectsState[kPart71StatuetteExamined] == 0 ? STR_ShinyThing : STR_Statuette);
if (name) {
- Common::strlcpy(_roomObjectNames[kPart71ObjectNameIndex], name, sizeof(_roomObjectNames[kPart71ObjectNameIndex]));
+ Common::strlcpy(_roomObjectNames[kPart71StatuetteNameIndex], name, sizeof(_roomObjectNames[kPart71StatuetteNameIndex]));
}
}
}
-/**
- * Igor examines the object: the first time he describes it and it gets its real name.
- */
+
void IgorEngine::PART_71_ACTION_103_look() {
- if (_objectsState[kPart71ExaminedStateIndex] == 0) {
+ if (_objectsState[kPart71StatuetteExamined] == 0) {
igorSay(220, 2, 1005);
- _objectsState[kPart71ExaminedStateIndex] = 1;
+ _objectsState[kPart71StatuetteExamined] = 1;
PART_71_APPLY_OBJECT_STATE(kPart71ApplyName);
} else {
igorSay(222, 2, 1006);
}
}
-/**
- * Igor takes the object: three frames of the animation are drawn over the screen, then the object goes to the
- * inventory.
- */
+
void IgorEngine::PART_71_ACTION_102_takeObject() {
- if (_objectsState[kPart71ExaminedStateIndex] == 0) {
+ if (_objectsState[kPart71StatuetteExamined] == 0) {
igorSayAndWait(220, 2, 1005);
- _objectsState[kPart71ExaminedStateIndex] = 1;
+ _objectsState[kPart71StatuetteExamined] = 1;
}
for (int i = 0; i < kPart71TakeFramesCount; ++i) {
drawAnimRect(kPart71TakeOffset, i * kPart71TakeFrameSize, kPart71TakeWidth, kPart71TakeHeight, false, kBlendLitSpriteNoShade);
waitForTimer(kPart71TakeFrameDelay);
}
- addObjectToInventory(kPart71InventoryObject, kPart71InventoryIndex);
+ addObjectToInventory(kPart71StatuetteInventoryNumber, kPart71StatuetteInventoryIndex);
_objectsState[kPart71TakenStateIndex] = 1;
PART_71_APPLY_OBJECT_STATE(kPart71ApplyAll);
igorSay(204, 3, 996);
_objectsState[kPart71StatuetteTaken] = 1;
}
-/**
- * Igor comes from the right edge, walking to the left.
- */
-void IgorEngine::PART_71_ENTER_FROM_RIGHT() {
+void IgorEngine::PART_71_enterFromRight() {
WalkData *wd = &_walkData[0];
wd->setPos(319, 138, kFacingPositionLeft, 0);
wd->clipSkipX = 1;
@@ -230,7 +215,7 @@ void IgorEngine::PART_71() {
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_71_ENTER_FROM_RIGHT();
+ PART_71_enterFromRight();
}
enterPartLoop();
while (_currentPart == 710 && !_gameStateLoaded) {
diff --git a/engines/igor/parts/part_79.cpp b/engines/igor/parts/part_79.cpp
index 26a2d835a13..f5d0f69bea7 100644
--- a/engines/igor/parts/part_79.cpp
+++ b/engines/igor/parts/part_79.cpp
@@ -23,25 +23,17 @@
namespace Igor {
-// The picture of both states is shown below a black band of this many rows.
static const int kPart79BandRows = 24;
-// ---------------------------------------------------------------------------------------------------------------
-// State 790
-// ---------------------------------------------------------------------------------------------------------------
+static const int kPart79LauraTable = 0xF858;
-// The animation resource ends with a table of offsets (one word per frame, frame 1 first). The frames drawn over the
-// whole picture are 1 to 88.
-static const int kPart79FigureTable = 0xF858;
-
-// Small pieces of 17x9 that are drawn at (86,135), five of them, 153 bytes each, after the table.
-static const int kPart79PatchOffset = 135 * 320 + 86;
-static const int kPart79PatchWidth = 17;
+static const int kPart79ReflectionOffset = 135 * 320 + 86;
+static const int kPart79ReflectionWidth = 17;
static const int kPart79PatchHeight = 9;
-static const int kPart79PatchFrames = 0xF908;
-static const int kPart79PatchFrameSize = kPart79PatchWidth * kPart79PatchHeight;
-static const uint8 kPart79PatchSteps[8] = { 0, 1, 2, 3, 4, 3, 2, 1 };
-static const int kPart79PatchClearColor = 0x68;
+static const int kPart79ReflectionFrames = 0xF908;
+static const int kPart79ReflectionFrameSize = kPart79ReflectionWidth * kPart79PatchHeight;
+static const uint8 kPart79ReflectionSteps[8] = { 0, 1, 2, 3, 4, 3, 2, 1 };
+static const int kPart79ReflectionClearColor = 0x68;
// Where and in which color the text of the scene is shown.
static const int kPart79TextX = 94;
@@ -50,17 +42,12 @@ static const int kPart79TextR = 63;
static const int kPart79TextG = 0;
static const int kPart79TextB = 38;
-// Frame the talking figure goes back to at the end of a line, and the number of frames it picks from while it talks.
static const int kPart79TalkFrame = 2;
-
-// Frames shown before the picture slides to the next one, the first one of the standing loop and the last.
static const int kPart79StandingFirst = 7;
static const int kPart79StandingEnd = 0x31;
-static const int kPart79FinalFirst = 0x39;
-static const int kPart79FinalLast = 0x4C;
+static const int kPart79WalkFirst = 0x39;
+static const int kPart79WalkLast = 0x4C;
-// Slide to the second picture: it goes 8 pixels at a time, 20 steps, one step every 16 ticks. The first 12 steps draw
-// the frames 77 to 88 over the picture, the last 8 frames 1 to 8 of the group kept in a resource of their own.
static const int kPart79SlideSteps = 20;
static const int kPart79SlideFirstFrame = 77;
static const int kPart79SlideLastFrame = 88;
@@ -68,56 +55,52 @@ static const int kPart79SlideAnimSteps = 12;
static const int kPart79SlideLayer2Offset = 0xA0;
static const int kPart79BankTable = 0x6DA6;
-void IgorEngine::PART_79_DRAW_FIGURE(int frame) {
- decodeAnimFrame(getAnimFrame(0, kPart79FigureTable, frame), _screenVGA, false);
+void IgorEngine::PART_79_drawLauraInWater(int frame) {
+ decodeAnimFrame(getAnimFrame(0, kPart79LauraTable, frame), _screenVGA, false);
}
-void IgorEngine::PART_79_DRAW_PATCH(int step) {
- copyArea(_screenVGA, kPart79PatchOffset, 320, _animFramesBuffer + kPart79PatchFrames + step * kPart79PatchFrameSize,
- kPart79PatchWidth, kPart79PatchWidth, kPart79PatchHeight);
+void IgorEngine::PART_79_drawReflection(int step) {
+ copyArea(_screenVGA, kPart79ReflectionOffset, 320, _animFramesBuffer + kPart79ReflectionFrames + step * kPart79ReflectionFrameSize,
+ kPart79ReflectionWidth, kPart79ReflectionWidth, kPart79PatchHeight);
}
-void IgorEngine::PART_79_CLEAR_PATCH() {
+void IgorEngine::PART_79_clearReflection() {
for (int y = 0; y < kPart79PatchHeight; ++y) {
- memset(_screenVGA + kPart79PatchOffset + y * 320, kPart79PatchClearColor, kPart79PatchWidth);
+ memset(_screenVGA + kPart79ReflectionOffset + y * 320, kPart79ReflectionClearColor, kPart79ReflectionWidth);
}
}
/**
* Every 64 ticks the small piece goes on to the next of its steps.
*/
-void IgorEngine::PART_79_UPDATE_AMBIENT_790() {
+void IgorEngine::PART_79_updateReflection() {
if (compareGameTick(0x3D)) {
- PART_79_DRAW_PATCH(kPart79PatchSteps[_roomAmbientIndex]);
+ PART_79_drawReflection(kPart79ReflectionSteps[_roomAmbientIndex]);
_roomAmbientIndex = (_roomAmbientIndex == 7) ? 0 : _roomAmbientIndex + 1;
}
}
-void IgorEngine::PART_79_UPDATE_DIALOGUE_790(int action) {
+void IgorEngine::PART_79_updateLauraInWaterDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_79_DRAW_FIGURE(kPart79TalkFrame);
+ PART_79_drawLauraInWater(kPart79TalkFrame);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_79_DRAW_FIGURE(kPart79TalkFrame + getRandomNumber(4));
+ PART_79_drawLauraInWater(kPart79TalkFrame + getRandomNumber(4));
break;
}
}
-void IgorEngine::PART_79_SAY_790(const Common::Array<DialogueText> &lines) {
+void IgorEngine::PART_79_sayLaura(const Common::Array<DialogueText> &lines) {
cutsceneSayStartWithCallback(kPart79TextX, kPart79TextY, kPart79TextR, kPart79TextG, kPart79TextB, lines,
- &IgorEngine::PART_79_UPDATE_DIALOGUE_790);
- _updateRoomBackground = &IgorEngine::PART_79_UPDATE_AMBIENT_790;
+ &IgorEngine::PART_79_updateLauraInWaterDialogue);
+ _updateRoomBackground = &IgorEngine::PART_79_updateReflection;
waitForEndOfCutsceneDialogue(kPart79TextX, kPart79TextY, kPart79TextR, kPart79TextG, kPart79TextB);
_updateDialogue = nullptr;
_updateRoomBackground = nullptr;
}
-/**
- * The picture slides to the left 8 pixels per step, the second picture comes in from the right and frames are
- * drawn over the result.
- */
-void IgorEngine::PART_79_SLIDE() {
+void IgorEngine::PART_79_scroll() {
uint8 *bank = loadData(ANM_Part79Frames);
uint8 *buffer = _screenTextLayer;
int frame = kPart79SlideFirstFrame;
@@ -129,7 +112,7 @@ void IgorEngine::PART_79_SLIDE() {
copyArea(buffer, 0, 320, _screenLayer1 + shift, 320, 320 - shift, 144);
copyArea(buffer, 320 - shift, 320, _screenLayer2 + kPart79SlideLayer2Offset, 320, shift, 144);
if (step <= kPart79SlideAnimSteps) {
- decodeAnimFrame(getAnimFrame(0, kPart79FigureTable, frame), buffer, false);
+ decodeAnimFrame(getAnimFrame(0, kPart79LauraTable, frame), buffer, false);
frame = (frame == kPart79SlideLastFrame) ? 1 : frame + 1;
} else {
const int offset = READ_LE_UINT16(bank + kPart79BankTable + (frame - 1) * 2);
@@ -144,7 +127,8 @@ void IgorEngine::PART_79_SLIDE() {
free(bank);
}
-void IgorEngine::PART_79_790() {
+// Laura in the water
+void IgorEngine::PART_79_LauraInWater() {
playMusic(13);
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
@@ -155,71 +139,63 @@ void IgorEngine::PART_79_790() {
loadData(IMG_Part79Layer2, _screenLayer2);
loadData(ANM_Part79, _animFramesBuffer);
memcpy(_screenVGA, _screenLayer1, 46080);
- PART_79_DRAW_FIGURE(1);
+ PART_79_drawLauraInWater(1);
fadeIn(768);
_roomAmbientIndex = 0;
- PART_79_SAY_790({ { 201, 2, 742 }, { 203, 1, 743 }, { 204, 2, 744 }, { 206, 1, 745 }, { 207, 1, 746 } });
- PART_79_SAY_790({ { 208, 1, 747 }, { 209, 2, 748 } });
+ PART_79_sayLaura({ { 201, 2, 742 }, { 203, 1, 743 }, { 204, 2, 744 }, { 206, 1, 745 }, { 207, 1, 746 } });
+ PART_79_sayLaura({ { 208, 1, 747 }, { 209, 2, 748 } });
// the figure goes through its frames while the small piece keeps changing
int frame = kPart79StandingFirst;
do {
if (compareGameTick(1, 16)) {
- PART_79_DRAW_FIGURE(frame);
+ PART_79_drawLauraInWater(frame);
++frame;
}
if (compareGameTick(0x3D)) {
- PART_79_DRAW_PATCH(kPart79PatchSteps[_roomAmbientIndex]);
+ PART_79_drawReflection(kPart79ReflectionSteps[_roomAmbientIndex]);
_roomAmbientIndex = (_roomAmbientIndex == 7) ? 0 : _roomAmbientIndex + 1;
- PART_79_DRAW_PATCH(getRandomNumber(4));
+ PART_79_drawReflection(getRandomNumber(4));
}
waitForTimer();
} while (frame != kPart79StandingEnd);
- PART_79_SAY_790({ { 211, 1, 749 }, { 212, 1, 750 }, { 213, 1, 751 }, { 214, 2, 752 } });
- PART_79_CLEAR_PATCH();
- for (frame = kPart79FinalFirst; frame <= kPart79FinalLast; ++frame) {
- PART_79_DRAW_FIGURE(frame);
+ PART_79_sayLaura({ { 211, 1, 749 }, { 212, 1, 750 }, { 213, 1, 751 }, { 214, 2, 752 } });
+ PART_79_clearReflection();
+ // laura walks
+ for (frame = kPart79WalkFirst; frame <= kPart79WalkLast; ++frame) {
+ PART_79_drawLauraInWater(frame);
waitForTimer(31);
}
- PART_79_SLIDE();
+ PART_79_scroll();
_currentPart = 791;
}
-// ---------------------------------------------------------------------------------------------------------------
-// State 791
-// ---------------------------------------------------------------------------------------------------------------
-// Groups of frames and where their table of offsets (one word per frame, frame 1 first) is. The offset of a frame is
-// relative to the base of its group. The groups are in the animation resource or in the second layer.
struct Part79FrameGroup {
int table;
int base;
};
-// frames 1.. of the animation resource that is loaded first (the table is the last 200 bytes of it)
static const Part79FrameGroup kPart79Scenes = { 0xF6BA, 0 };
-// frames kept in the second layer
+
static const Part79FrameGroup kPart79Layer2Frames = { 0x594C, 0 };
static const Part79FrameGroup kPart79Layer2Frames2 = { 0x7FF0, 0x5989 };
-// frames of the second animation resource
+
static const Part79FrameGroup kPart79Anim2A = { 0xC093, 0x88C8 };
static const Part79FrameGroup kPart79Anim2B = { 0x3CC9, 0 };
static const Part79FrameGroup kPart79Anim2C = { 0x7ACD, 0x3CEF };
static const Part79FrameGroup kPart79Anim2D = { 0x88B8, 0x7AF1 };
-// Frame shown when a line of a speaker ends / the first frame of the group the speaker picks from while talking.
static const int kPart79FirstSpeakerEndFrame = 1;
static const int kPart79FirstSpeakerBase = 7;
static const int kPart79ThirdSpeakerEndFrame = 22;
static const int kPart79ThirdSpeakerBase = 23;
-// Frames that alternate in the background while Igor talks.
static const int kPart79AmbientFirst = 0x57;
static const int kPart79AmbientSecond = 0x58;
-// The three groups of 90x23, 13x11 and 44x23 pieces that are drawn at the end.
static const int kPart79Block1Offset = 53 * 320 + 115;
static const int kPart79Block1Width = 90;
static const int kPart79Block1Height = 23;
@@ -233,39 +209,33 @@ static const int kPart79Block3Width = 44;
static const int kPart79Block3Height = 23;
static const int kPart79Block3Frames = 0xC8B9;
-// Colors faded in and out by pairs, in the colors the Igor texts go through the sky in.
static const int kPart79FadeFirstColor = 0xF5;
static const int kPart79FadeLastColor = 0xFE;
static const uint8 kPart79FadeColors[6] = { 0x3F, 0x20, 0x00, 0x2C, 0x0C, 0x00 };
-void IgorEngine::PART_79_DRAW_GROUP_FRAME(const uint8 *buffer, int table, int base, int frame) {
+void IgorEngine::PART_79_drawGroupFrame(const uint8 *buffer, int table, int base, int frame) {
decodeAnimFrame(buffer + base + READ_LE_UINT16(buffer + table + frame * 2) - 1, _screenVGA, false);
}
-void IgorEngine::PART_79_DRAW_SCENE(int frame) {
- PART_79_DRAW_GROUP_FRAME(_animFramesBuffer, kPart79Scenes.table, kPart79Scenes.base, frame);
+void IgorEngine::PART_79_drawBoomerangScene(int frame) {
+ PART_79_drawGroupFrame(_animFramesBuffer, kPart79Scenes.table, kPart79Scenes.base, frame);
}
-void IgorEngine::PART_79_DRAW_LAYER2_FRAME(int frame) {
- PART_79_DRAW_GROUP_FRAME(_screenLayer2, kPart79Layer2Frames.table, kPart79Layer2Frames.base, frame);
+void IgorEngine::PART_79_drawKiss(int frame) {
+ PART_79_drawGroupFrame(_screenLayer2, kPart79Layer2Frames.table, kPart79Layer2Frames.base, frame);
}
-// The frames of this group are addressed by the offset from the base without the usual correction of one byte.
-void IgorEngine::PART_79_DRAW_LAYER2_FRAME_2(int frame) {
+void IgorEngine::PART_79_drawCircularClosingTransition(int frame) {
const int offset = READ_LE_UINT16(_screenLayer2 + kPart79Layer2Frames2.table + frame * 2);
decodeAnimFrame(_screenLayer2 + kPart79Layer2Frames2.base + offset, _screenVGA, false);
}
-void IgorEngine::PART_79_DRAW_ANIM2_FRAME(const void *group, int frame) {
+void IgorEngine::PART_79_drawPhilipSharkScene(const void *group, int frame) {
const Part79FrameGroup *g = (const Part79FrameGroup *)group;
- PART_79_DRAW_GROUP_FRAME(_animFramesBuffer, g->table, g->base, frame);
+ PART_79_drawGroupFrame(_animFramesBuffer, g->table, g->base, frame);
}
-/**
- * Talk animation of Igor in these states: 14x11 piece of his head over the picture (the colors of the head are
- * moved into the range of the picture) or the picture itself where the head is transparent.
- */
-void IgorEngine::PART_79_ANIMATE_IGOR_HEAD(int frame) {
+void IgorEngine::PART_79_animateIgorHead(int frame) {
WalkData *wd = &_walkData[_walkDataLastIndex - 1];
int dst = (wd->y - wd->scaleWidth + 1) * 320;
const int delta = wd->x - _walkWidthScaleTable[wd->scaleHeight - 1] / 2;
@@ -288,10 +258,10 @@ void IgorEngine::PART_79_ANIMATE_IGOR_HEAD(int frame) {
void IgorEngine::PART_79_UPDATE_DIALOGUE_SPEAKER(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_79_DRAW_SCENE(_part79EndFrame);
+ PART_79_drawBoomerangScene(_part79EndFrame);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_79_DRAW_SCENE(_part79BaseFrame + getRandomNumber(3));
+ PART_79_drawBoomerangScene(_part79BaseFrame + getRandomNumber(3));
break;
}
}
@@ -299,10 +269,10 @@ void IgorEngine::PART_79_UPDATE_DIALOGUE_SPEAKER(int action) {
void IgorEngine::PART_79_UPDATE_DIALOGUE_FIRST_SPEAKER(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_79_DRAW_SCENE(kPart79FirstSpeakerEndFrame);
+ PART_79_drawBoomerangScene(kPart79FirstSpeakerEndFrame);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_79_DRAW_SCENE(kPart79FirstSpeakerBase + getRandomNumber(3));
+ PART_79_drawBoomerangScene(kPart79FirstSpeakerBase + getRandomNumber(3));
break;
}
}
@@ -310,24 +280,21 @@ void IgorEngine::PART_79_UPDATE_DIALOGUE_FIRST_SPEAKER(int action) {
void IgorEngine::PART_79_UPDATE_DIALOGUE_THIRD_SPEAKER(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_79_DRAW_LAYER2_FRAME(kPart79ThirdSpeakerEndFrame);
+ PART_79_drawKiss(kPart79ThirdSpeakerEndFrame);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_79_DRAW_LAYER2_FRAME(kPart79ThirdSpeakerBase + getRandomNumber(3));
+ PART_79_drawKiss(kPart79ThirdSpeakerBase + getRandomNumber(3));
break;
}
}
-void IgorEngine::PART_79_UPDATE_AMBIENT_791() {
+void IgorEngine::PART_79_animatePhilipShaking() {
if (compareGameTick(0x3D)) {
- PART_79_DRAW_SCENE(_roomAmbientIndex);
+ PART_79_drawBoomerangScene(_roomAmbientIndex);
_roomAmbientIndex = (_roomAmbientIndex == kPart79AmbientFirst) ? kPart79AmbientSecond : kPart79AmbientFirst;
}
}
-/**
- * Lines of a person of the scene: the frames of the speaker go with the text, which is shown at (x, y).
- */
void IgorEngine::PART_79_SAY_SPEAKER(int startX, int startY, int x, int y, int r, int g, int b, int endFrame, int baseFrame,
const Common::Array<DialogueText> &lines) {
_part79EndFrame = endFrame;
@@ -337,35 +304,28 @@ void IgorEngine::PART_79_SAY_SPEAKER(int startX, int startY, int x, int y, int r
_updateDialogue = nullptr;
}
-void IgorEngine::PART_79_SAY_FIRST_SPEAKER(int startX, int startY, const Common::Array<DialogueText> &lines) {
+void IgorEngine::PART_79_sayLaura(int startX, int startY, const Common::Array<DialogueText> &lines) {
cutsceneSayStartWithCallback(startX, startY, 63, 0, 38, lines, &IgorEngine::PART_79_UPDATE_DIALOGUE_FIRST_SPEAKER);
waitForEndOfCutsceneDialogue(145, 86, 63, 0, 38);
_updateDialogue = nullptr;
}
-void IgorEngine::PART_79_SAY_THIRD_SPEAKER(const Common::Array<DialogueText> &lines) {
+void IgorEngine::PART_79_sayPhilip(const Common::Array<DialogueText> &lines) {
cutsceneSayStartWithCallback(220, 91, 63, 0, 38, lines, &IgorEngine::PART_79_UPDATE_DIALOGUE_THIRD_SPEAKER);
waitForEndOfCutsceneDialogue(220, 91, 63, 0, 38);
_updateDialogue = nullptr;
}
-/**
- * Igor talks from the position given. The head is drawn with his talk animation.
- */
-void IgorEngine::PART_79_IGOR_SAY(const Common::Array<DialogueText> &lines) {
+void IgorEngine::PART_79_sayIgor(const Common::Array<DialogueText> &lines) {
igorSay(lines);
waitForEndOfIgorDialogue();
}
-void IgorEngine::PART_79_SET_IGOR_POS(int x, int y) {
+void IgorEngine::PART_79_setIgorPos(int x, int y) {
_walkData[0].x = x;
_walkData[0].y = y;
}
-/**
- * Colors first to last go from black to the colors of the palette buffer (in) or back to black (out) one level at a
- * time, the palette is set after each level.
- */
void IgorEngine::PART_79_FADE_COLORS(int first, int last, bool fadeInColors) {
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
for (int step = 1; step <= 63; ++step) {
@@ -385,17 +345,16 @@ void IgorEngine::PART_79_FADE_COLORS(int first, int last, bool fadeInColors) {
}
}
-/**
- * Two colors of the palette buffer are set to the orange of the texts and faded in.
- */
void IgorEngine::PART_79_FADE_IN_PAIR(int firstColor) {
memcpy(_paletteBuffer + firstColor * 3, kPart79FadeColors, 6);
PART_79_FADE_COLORS(firstColor, firstColor + 1, true);
}
-void IgorEngine::PART_79_791() {
+void IgorEngine::PART_79_beachScene() {
playMusic(13);
_gameState.enableLight = 2;
+ // The ending uses the beach clothes, including when entered directly.
+ loadIgorBeachFrames();
loadData(IMG_Part79b, _screenLayer1);
uint8 *text = loadData(TXT_Part79b);
decodeRoomStrings(text, true);
@@ -404,62 +363,62 @@ void IgorEngine::PART_79_791() {
loadData(ANM_Part79bLayer2, _screenLayer2);
PART_79_SAY_SPEAKER(178, 82, 178, 82, 63, 63, 0, 2, 2, { { 201, 2, 753 }, { 203, 1, 754 }, { 204, 1, 755 } });
- PART_79_SAY_FIRST_SPEAKER(145, 86, { { 205, 2, 756 }, { 207, 2, 757 } });
+ PART_79_sayLaura(145, 86, { { 205, 2, 756 }, { 207, 2, 757 } });
PART_79_SAY_SPEAKER(172, 82, 178, 82, 63, 63, 0, 2, 2, { { 209, 2, 758 } });
for (int frame = 0x10; frame <= 0x1C; ++frame) {
- PART_79_DRAW_SCENE(frame);
+ PART_79_drawBoomerangScene(frame);
waitForTimer(31);
}
- PART_79_SAY_FIRST_SPEAKER(145, 86, { { 211, 1, 759 } });
+ PART_79_sayLaura(145, 86, { { 211, 1, 759 } });
for (int frame = 0xB; frame <= 0xF; ++frame) {
- PART_79_DRAW_SCENE(frame);
+ PART_79_drawBoomerangScene(frame);
waitForTimer(11);
}
- PART_79_DRAW_SCENE(29);
+ PART_79_drawBoomerangScene(29);
PART_79_SAY_SPEAKER(178, 82, 178, 82, 63, 63, 0, 0x1D, 0x1E, { { 212, 1, 760 }, { 213, 1, 761 } });
- PART_79_SET_IGOR_POS(229, 137);
+ PART_79_setIgorPos(229, 137);
_walkData[0].posNum = 4;
_walkData[0].clipSkipX = 1;
_walkData[0].clipWidth = 30;
_walkData[0].scaleWidth = 50;
_walkData[0].scaleHeight = 50;
_walkDataLastIndex = 1;
- PART_79_IGOR_SAY({ { 214, 2, 762 }, { 216, 2, 763 } });
+ PART_79_sayIgor({ { 214, 2, 762 }, { 216, 2, 763 } });
PART_79_SAY_SPEAKER(178, 82, 178, 82, 63, 63, 0, 0x1D, 0x1E, { { 218, 2, 764 } });
for (int frame = 0x21; frame <= 0x26; ++frame) {
- PART_79_DRAW_SCENE(frame);
+ PART_79_drawBoomerangScene(frame);
waitForTimer(31);
}
- PART_79_DRAW_SCENE(46);
+ PART_79_drawBoomerangScene(46);
- PART_79_SET_IGOR_POS(236, 138);
- PART_79_IGOR_SAY({ { 220, 2, 765 } });
+ PART_79_setIgorPos(236, 138);
+ PART_79_sayIgor({ { 220, 2, 765 } });
PART_79_SAY_SPEAKER(195, 83, 195, 83, 63, 63, 0, 40, 41, { { 222, 2, 766 } });
- PART_79_DRAW_SCENE(39);
+ PART_79_drawBoomerangScene(39);
waitForTimer(31);
- PART_79_DRAW_SCENE(46);
- PART_79_IGOR_SAY({ { 224, 2, 767 } });
+ PART_79_drawBoomerangScene(46);
+ PART_79_sayIgor({ { 224, 2, 767 } });
for (int frame = 0x2F; frame <= 0x32; ++frame) {
- PART_79_DRAW_SCENE(frame);
+ PART_79_drawBoomerangScene(frame);
waitForTimer(31);
}
PART_79_SAY_SPEAKER(206, 85, 206, 85, 63, 63, 0, 0x35, 0x36, { { 226, 2, 768 } });
- PART_79_DRAW_SCENE(51);
+ PART_79_drawBoomerangScene(51);
waitForTimer(31);
- PART_79_SET_IGOR_POS(246, 138);
- PART_79_IGOR_SAY({ { 228, 2, 769 }, { 230, 2, 770 } });
+ PART_79_setIgorPos(246, 138);
+ PART_79_sayIgor({ { 228, 2, 769 }, { 230, 2, 770 } });
PART_79_SAY_SPEAKER(206, 85, 206, 85, 63, 63, 0, 0x35, 0x36, { { 232, 1, 771 } });
playSound(28, 1);
for (int frame = 0x3A; frame <= 0x56; ++frame) {
- PART_79_DRAW_SCENE(frame);
+ PART_79_drawBoomerangScene(frame);
if (frame == 0x4F) {
playSound(29, 1);
}
waitForTimer(17);
}
- PART_79_DRAW_SCENE(52);
+ PART_79_drawBoomerangScene(52);
waitForTimer(33);
// the sound goes on until it ends
while (_mixer->isSoundHandleActive(_sfxHandle) || isDialogueSpeechPlaying()) {
@@ -467,11 +426,11 @@ void IgorEngine::PART_79_791() {
}
_roomAmbientIndex = kPart79AmbientFirst;
igorSay(233, 2, 772);
- _updateRoomBackground = &IgorEngine::PART_79_UPDATE_AMBIENT_791;
+ _updateRoomBackground = &IgorEngine::PART_79_animatePhilipShaking;
waitForEndOfIgorDialogue();
_updateRoomBackground = nullptr;
for (int frame = 0x58; frame <= 0x64; ++frame) {
- PART_79_DRAW_SCENE(frame);
+ PART_79_drawBoomerangScene(frame);
if (frame < 0x64) {
waitForTimer(31);
}
@@ -481,48 +440,48 @@ void IgorEngine::PART_79_791() {
}
for (int frame = 1; frame <= 3; ++frame) {
- PART_79_DRAW_LAYER2_FRAME(frame);
+ PART_79_drawKiss(frame);
waitForTimer(31);
}
- PART_79_SET_IGOR_POS(178, 142);
+ PART_79_setIgorPos(178, 142);
_walkData[0].posNum = 2;
- PART_79_IGOR_SAY({ { 235, 1, 773 }, { 236, 2, 774 } });
+ PART_79_sayIgor({ { 235, 1, 773 }, { 236, 2, 774 } });
for (int frame = 4; frame <= 0x12; ++frame) {
- PART_79_DRAW_LAYER2_FRAME(frame);
+ PART_79_drawKiss(frame);
waitForTimer(31);
}
- PART_79_IGOR_SAY({ { 238, 1, 775 } });
+ PART_79_sayIgor({ { 238, 1, 775 } });
// the texts 201 to 215 are replaced by the ones of the main resource
text = loadData(TXT_Part79bMain);
decodeRoomStrings(text, true);
free(text);
for (int frame = 0x13; frame <= 0x15; ++frame) {
- PART_79_DRAW_LAYER2_FRAME(frame);
+ PART_79_drawKiss(frame);
waitForTimer(31);
}
- PART_79_SET_IGOR_POS(196, 141);
- PART_79_IGOR_SAY({ { 201, 2, 776 }, { 203, 2, 777 } });
- PART_79_SAY_THIRD_SPEAKER({ { 205, 1, 778 }, { 206, 1, 779 }, { 207, 1, 780 } });
- PART_79_IGOR_SAY({ { 208, 1, 781 }, { 209, 1, 782 } });
- PART_79_SAY_THIRD_SPEAKER({ { 210, 1, 783 } });
- PART_79_IGOR_SAY({ { 211, 1, 784 } });
- PART_79_SAY_THIRD_SPEAKER({ { 212, 1, 785 } });
- PART_79_IGOR_SAY({ { 213, 1, 786 } });
- PART_79_SAY_THIRD_SPEAKER({ { 214, 1, 787 } });
+ PART_79_setIgorPos(196, 141);
+ PART_79_sayIgor({ { 201, 2, 776 }, { 203, 2, 777 } });
+ PART_79_sayPhilip({ { 205, 1, 778 }, { 206, 1, 779 }, { 207, 1, 780 } });
+ PART_79_sayIgor({ { 208, 1, 781 }, { 209, 1, 782 } });
+ PART_79_sayPhilip({ { 210, 1, 783 } });
+ PART_79_sayIgor({ { 211, 1, 784 } });
+ PART_79_sayPhilip({ { 212, 1, 785 } });
+ PART_79_sayIgor({ { 213, 1, 786 } });
+ PART_79_sayPhilip({ { 214, 1, 787 } });
for (int frame = 0x1B; frame <= 0x1D; ++frame) {
- PART_79_DRAW_LAYER2_FRAME(frame);
+ PART_79_drawKiss(frame);
waitForTimer(31);
}
for (int frame = 1; frame <= 0xE; ++frame) {
- PART_79_DRAW_LAYER2_FRAME_2(frame);
+ PART_79_drawCircularClosingTransition(frame);
waitForTimer(31);
}
waitForTimer(255);
- PART_79_DRAW_LAYER2_FRAME(30);
+ PART_79_drawKiss(30);
waitForTimer(255);
for (int frame = 0xF; frame <= 0x11; ++frame) {
- PART_79_DRAW_LAYER2_FRAME_2(frame);
+ PART_79_drawCircularClosingTransition(frame);
waitForTimer(31);
}
@@ -548,37 +507,37 @@ void IgorEngine::PART_79_791() {
PART_79_FADE_COLORS(kPart79FadeFirstColor, kPart79FadeLastColor, false);
for (int frame = 1; frame <= 7; ++frame) {
- PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2A, frame);
+ PART_79_drawPhilipSharkScene(&kPart79Anim2A, frame);
waitForTimer(31);
}
for (int frame = 2; frame <= 0x12; ++frame) {
- PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2B, frame);
+ PART_79_drawPhilipSharkScene(&kPart79Anim2B, frame);
waitForTimer(31);
}
for (int frame = 1; frame <= 0x12; ++frame) {
- PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2B, frame);
+ PART_79_drawPhilipSharkScene(&kPart79Anim2B, frame);
waitForTimer(31);
}
- PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2C, 1);
+ PART_79_drawPhilipSharkScene(&kPart79Anim2C, 1);
waitForTimer(31);
for (int y = 0; y < kPart79Block2Height; ++y) {
memset(_screenVGA + kPart79Block2Offset + y * 320, kPart79Block2Color, kPart79Block2Width);
}
for (int round = 1; round <= 5; ++round) {
for (int frame = 0x10; frame <= 0x11; ++frame) {
- PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2C, frame);
+ PART_79_drawPhilipSharkScene(&kPart79Anim2C, frame);
waitForTimer(61);
}
}
for (int frame = 2; frame <= 0xF; ++frame) {
- PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2C, frame);
+ PART_79_drawPhilipSharkScene(&kPart79Anim2C, frame);
waitForTimer(31);
}
cutsceneSayStart(206, 89, 63, 32, 0, { { 215, 1, 788 } });
waitForEndOfCutsceneDialogue(206, 89, 63, 32, 0);
waitForTimer(255);
for (int frame = 1; frame <= 7; ++frame) {
- PART_79_DRAW_ANIM2_FRAME(&kPart79Anim2D, frame);
+ PART_79_drawPhilipSharkScene(&kPart79Anim2D, frame);
waitForTimer(31);
}
copyArea(_screenVGA, kPart79Block3Offset, 320, _animFramesBuffer + kPart79Block3Frames, kPart79Block3Width,
@@ -604,9 +563,9 @@ void IgorEngine::PART_79() {
_system->copyRectToScreen(band, 320, 0, 0, 320, kPart79BandRows);
_screenVGAVOffset = kPart79BandRows;
if (_currentPart == 790) {
- PART_79_790();
+ PART_79_LauraInWater();
} else {
- PART_79_791();
+ PART_79_beachScene();
}
_screenVGAVOffset = 0;
}
diff --git a/engines/igor/parts/part_margaret.cpp b/engines/igor/parts/part_margaret.cpp
index 2490594bc78..3ab5eb92165 100644
--- a/engines/igor/parts/part_margaret.cpp
+++ b/engines/igor/parts/part_margaret.cpp
@@ -26,12 +26,12 @@ namespace Igor {
static int VAR_MARGARET_ROOM_ANIM_COUNTER;
-void IgorEngine::PART_MARGARET_ROOM_CUTSCENE_HELPER_1() {
+void IgorEngine::PART_MARGARET_ROOM_CUTSCENE_drawMargaretBasePose() {
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) {
+void IgorEngine::PART_MARGARET_ROOM_CUTSCENE_drawMargaretFrame(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);
@@ -40,10 +40,10 @@ void IgorEngine::PART_MARGARET_ROOM_CUTSCENE_HELPER_2(int frame) {
void IgorEngine::PART_MARGARET_ROOM_CUTSCENE_UPDATE_DIALOGUE_MARGARET(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_MARGARET_ROOM_CUTSCENE_HELPER_2(1);
+ PART_MARGARET_ROOM_CUTSCENE_drawMargaretFrame(1);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_MARGARET_ROOM_CUTSCENE_HELPER_2(getRandomNumber(4) + 1);
+ PART_MARGARET_ROOM_CUTSCENE_drawMargaretFrame(getRandomNumber(4) + 1);
break;
}
}
@@ -60,7 +60,7 @@ void IgorEngine::PART_MARGARET_ROOM_CUTSCENE() {
loadAnimData(anm);
memcpy(_screenVGA, _screenLayer1, 46080);
_updateDialogue = &IgorEngine::PART_MARGARET_ROOM_CUTSCENE_UPDATE_DIALOGUE_MARGARET;
- PART_MARGARET_ROOM_CUTSCENE_HELPER_1();
+ PART_MARGARET_ROOM_CUTSCENE_drawMargaretBasePose();
memset(_currentPalette, 0, 768);
fadeIn(768);
_gameState.igorMoving = false;
diff --git a/engines/igor/parts/part_maze.cpp b/engines/igor/parts/part_maze.cpp
index ef3bf9931ad..1cb793e6832 100644
--- a/engines/igor/parts/part_maze.cpp
+++ b/engines/igor/parts/part_maze.cpp
@@ -26,7 +26,6 @@ namespace Igor {
// The rooms of the maze (parts 51 to 66) are all the same room with different pictures: a corridor with torches
// and one to four ways out. Room data is in part_maze_data.cpp.
-
static const int kMazeFlameWidth = 19;
static const int kMazeFlameHeight = 29;
static const int kMazeFlameFrameSize = kMazeFlameWidth * kMazeFlameHeight;
@@ -37,7 +36,7 @@ static const int kMazeStairsY = 143;
/**
* The track depends on the location: the maze is divided in three zones.
*/
-int IgorEngine::MAZE_MUSIC_TRACK() const {
+int IgorEngine::MAZE_getMusicTrack() const {
uint8 location = _mazeLocation;
while (location > 21) {
location -= 21;
@@ -163,7 +162,7 @@ void IgorEngine::PART_MAZE_UPDATE_ROOM_BACKGROUND() {
/**
* Igor appears at the entry and walks to its destination.
*/
-void IgorEngine::MAZE_ENTER_WALK(const MazeEntry &entry) {
+void IgorEngine::MAZE_walkIn(const MazeEntry &entry) {
WalkData *wd = &_walkData[0];
wd->setPos(entry.x, entry.y, entry.facing, 0);
wd->setDefaultScale();
@@ -307,7 +306,7 @@ void IgorEngine::PART_MAZE() {
assert(room);
_mazeRoom = room;
- playMusic(room->music >= 0 ? room->music : MAZE_MUSIC_TRACK());
+ playMusic(room->music >= 0 ? room->music : MAZE_getMusicTrack());
_gameState.enableLight = 1;
if (room->saveLocation) {
_mazeSavedLocation = _mazeLocation;
@@ -346,7 +345,7 @@ void IgorEngine::PART_MAZE() {
const MazeEntry &entry = room->entries[i];
if (entry.state == _currentPart) {
if (entry.kind == kMazeEntryWalk) {
- MAZE_ENTER_WALK(entry);
+ MAZE_walkIn(entry);
} else {
enterFromStairs(entry);
}
@@ -354,6 +353,7 @@ void IgorEngine::PART_MAZE() {
}
}
enterPartLoop();
+ // run until we leave the maze
for (;;) {
bool inRoom = false;
for (int i = 0; i < room->numEntries; ++i) {
diff --git a/engines/igor/parts/part_maze_data.cpp b/engines/igor/parts/part_maze_data.cpp
index e8e1e7010bf..031f42671e4 100644
--- a/engines/igor/parts/part_maze_data.cpp
+++ b/engines/igor/parts/part_maze_data.cpp
@@ -19,8 +19,6 @@
*
*/
-// Generated by tools/gen_maze_data.py from the disassembly of the maze rooms. Do not edit.
-
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 3292cdd59f9..8f82c03df81 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -92,8 +92,8 @@ void IgorEngine::playSound(int num, int type) {
return;
}
- // A zero or "no speech" number means the line has no recorded speech
- if (type == 0 && (num == 0 || num == kNoSpeechSound)) {
+ // A zero speech number means the line has no recorded speech.
+ if (type == 0 && num == kNoSpeechSound) {
if (_mixer->isSoundHandleActive(_speechHandle)) {
_mixer->stopHandle(_speechHandle);
}
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 24d62e582c5..6ba838f78ee 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -502,7 +502,7 @@ void IgorEngine::animateIgorTalking(int frame) {
return;
}
if (getPart() == 79) {
- PART_79_ANIMATE_IGOR_HEAD(frame);
+ PART_79_animateIgorHead(frame);
return;
}
WalkData *wd = &_walkData[_walkDataLastIndex - 1];
Commit: 67c947bba55e753ec473955128dfee251b6661fd
https://github.com/scummvm/scummvm/commit/67c947bba55e753ec473955128dfee251b6661fd
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:54+01:00
Commit Message:
IGOR: Rename missing function in chemistry entrance
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_12.cpp
engines/igor/parts/part_24.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index a9d92d7815a..0490b1d766e 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -960,7 +960,7 @@ private:
// college corridor sharon michael
void PART_24_EXEC_ACTION(int action);
- void PART_24_ACTION_102();
+ void PART_24_ACTION_102_enterChemistryClass();
void PART_24_ACTION_104_closeDoor();
void PART_24_ACTION_105_openDoor();
void PART_24_ACTION_107_goToLibrary();
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 01e6820daf2..2440f849119 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -223,6 +223,7 @@ void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
waitForTimer();
} while (_gameState.igorMoving);
decodeAnimFrame(_animFramesBuffer + 0x761 + READ_LE_UINT16(_animFramesBuffer + 0x1117) - 1, _screenVGA, true);
+ // draws the same scene with the church door open or closed
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;
@@ -404,6 +405,7 @@ void IgorEngine::PART_12_HELPER_4_exorcismCutscene() {
}
waitForTimer(255);
fadeOut(768);
+ // door open
_objectsState[45] = 1;
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp
index 0e2b6b26c91..2951070666c 100644
--- a/engines/igor/parts/part_24.cpp
+++ b/engines/igor/parts/part_24.cpp
@@ -29,7 +29,7 @@ void IgorEngine::PART_24_EXEC_ACTION(int action) {
_currentPart = 313;
break;
case 102:
- PART_24_ACTION_102();
+ PART_24_ACTION_102_enterChemistryClass();
break;
case 103: // look at chemistry door
igorSay(201, 1, 1257);
@@ -67,7 +67,7 @@ void IgorEngine::PART_24_EXEC_ACTION(int action) {
}
}
-void IgorEngine::PART_24_ACTION_102() {
+void IgorEngine::PART_24_ACTION_102_enterChemistryClass() {
if (_objectsState[67] != 0) {
_roomObjectAreasTable[_screenLayer2[37188]].area = 1;
--_walkDataLastIndex;
Commit: 803f847446033d17a4601f91caab6ea3ff91baf5
https://github.com/scummvm/scummvm/commit/803f847446033d17a4601f91caab6ea3ff91baf5
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:54+01:00
Commit Message:
IGOR: name global state constants
Changed paths:
engines/igor/igor.h
engines/igor/part_main.cpp
engines/igor/parts/part_0.cpp
engines/igor/parts/part_10.cpp
engines/igor/parts/part_11.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_15.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_18.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_22.cpp
engines/igor/parts/part_23.cpp
engines/igor/parts/part_24.cpp
engines/igor/parts/part_25.cpp
engines/igor/parts/part_26.cpp
engines/igor/parts/part_27.cpp
engines/igor/parts/part_28.cpp
engines/igor/parts/part_30.cpp
engines/igor/parts/part_31.cpp
engines/igor/parts/part_32.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
engines/igor/parts/part_36.cpp
engines/igor/parts/part_37.cpp
engines/igor/parts/part_4.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_50.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_69.cpp
engines/igor/parts/part_7.cpp
engines/igor/parts/part_70.cpp
engines/igor/parts/part_71.cpp
engines/igor/parts/part_72.cpp
engines/igor/parts/part_73.cpp
engines/igor/parts/part_76.cpp
engines/igor/parts/part_77.cpp
engines/igor/parts/part_78.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_81.cpp
engines/igor/parts/part_9.cpp
engines/igor/parts/part_margaret.cpp
engines/igor/parts/part_maze.cpp
engines/igor/parts/part_maze_data.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 0490b1d766e..2f435231ef4 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -313,9 +313,109 @@ enum ObjectType {
kObjectTypeRoom = 2
};
-enum {
+enum ObjectStateIndex {
+ kBottleStateIndex = 0,
+ kLizardFedStateIndex = 1,
+ kPapyrusFiguresVisibleStateIndex = 2,
+ kFolderSwappedStateIndex = 3,
+ kAstronomyBookStateIndex = 4,
+ kPhillipLockerCombinationLearnedStateIndex = 5,
+ kVaseStateIndex = 6,
+ kStatueDeliveredStateIndex = 7,
+ kBedroomNightstandOpenStateIndex = 8,
+ kAlarmClockTakenStateIndex = 9,
+ kBedroomClosetOpenStateIndex = 10,
+ kBedroomHoleOpenStateIndex = 11,
+ kRecordTakenStateIndex = 12,
+ kBedroomWindowStateIndex = 13,
+ kRatSkinHatSeenStateIndex = 14,
+ kBedroomWindowExitUsedStateIndex = 15,
+ kAtticTrunkOpenStateIndex = 16,
+ kButterflyNetTakenStateIndex = 17,
+ kAtticWallHolePresentStateIndex = 18,
+ kAtticLargeCrackPresentStateIndex = 19,
+ kAtticSmallCrackPresentStateIndex = 20,
+ kAtticNailHotspotActiveStateIndex = 21,
+ kAtticNailExaminedStateIndex = 22,
+ kDynamitePlacedStateIndex = 23,
+ kAtticWindowExitTriedStateIndex = 24,
+ kMatchesTakenStateIndex = 25,
+ kDeanDoorOpenStateIndex = 26,
+ kSecretaryDoorOpenStateIndex = 27,
+ kDeanBookTakenStateIndex = 28,
+ kDeanPassedOutStateIndex = 29,
+ kPendingDeanDrinkStateIndex = 30,
+ kNewspaperTakenStateIndex = 31,
+ kIntercomUsedStateIndex = 32,
+ kSecretaryClosetOpenStateIndex = 34,
+ kSecretaryDismissedStateIndex = 35,
+ kSecretaryClosetStateIndex = 36,
+ kPersonalFileChangedStateIndex = 37,
+ kHamburgerTakenStateIndex = 38,
+ kSlugTakenStateIndex = 40,
+ kGlassShardsPresentStateIndex = 41,
+ kButterflyNetStateIndex = 42,
+ kLizardTakenStateIndex = 44,
+ kChurchDoorOpenStateIndex = 45,
+ kProjectHandedToTobiasStateIndex = 46,
+ kMoneyHandedToTobiasStateIndex = 47,
+ kCuckooClockTriggeredStateIndex = 48,
+ kCuckooAnimationControlStateIndex = 49,
+ kSecretPassageEntranceOpenStateIndex = 50,
+ kFlaskTakenStateIndex = 52,
+ kPhotoCutsceneSeenStateIndex = 53,
+ kPhillipAndJimmyPresentStateIndex = 54,
+ kCollegeEntranceFoldersSwappedStateIndex = 55,
+ kPhillipAndJimmyHaveLeftStateIndex = 56,
+ kHairpinTakenStateIndex = 58,
+ kToiletGirlsHaveLeftStateIndex = 59,
+ kSpringBridgePaperStateIndex = 60,
+ kPhotographerGoneStateIndex = 61,
+ kTripodStateIndex = 62,
+ kCameraStateIndex = 63,
kPhysicsClassDoorStateIndex = 64,
- kMargaretStateIndex = 65
+ kMargaretStateIndex = 65,
+ kLadiesRoomDoorStateIndex = 66,
+ kChemistryDoorStateIndex = 67,
+ kMensRoomDoorStateIndex = 68,
+ kLaboratoryDoorOpenStateIndex = 69,
+ kMazeBeatenStateIndex = 70,
+ kMazeEntryDirectionStateIndex = 71,
+ kAstronomyLabDoorStateIndex = 72,
+ kLauraMetAtCollegeStateIndex = 73,
+ kAstronomyBookTakenStateIndex = 74,
+ kHarrisonPhotoStateIndex = 75,
+ kHarrisonNoteShownStateIndex = 76,
+ kBellTowerConversationSeenStateIndex = 78,
+ kFinalCoordinatesSceneSeenStateIndex = 79,
+ kLizardGivenStateIndex = 80,
+ kOldLadyConversationSeenStateIndex = 81,
+ kTreeResinDiscoveredStateIndex = 82,
+ kPhillipLockerStateIndex = 84,
+ kLockersExaminedStateIndex = 85,
+ kCarolineFolderStateIndex = 87,
+ kPenTakenStateIndex = 88,
+ kPhysicsClassPaperTakenStateIndex = 89,
+ kCemeteryEntrySideStateIndex = 90,
+ kVaseTakenStateIndex = 91,
+ kUndertakerLeftStateIndex = 92,
+ kRecordGivenToUndertakerStateIndex = 93,
+ kBorisIntroducedStateIndex = 94,
+ kPart69FireflyCapturedStateIndex = 96,
+ kPart69LeaderFireflyIdentifiedStateIndex = 97,
+ kPart69SwarmAnimationPhaseStateIndex = 98,
+ kPart69LeaderFireflyPathStateIndex = 99,
+ kStatuetteTakenStateIndex = 100,
+ kStatuetteExaminedStateIndex = 101,
+ kFlowerTakenStateIndex = 102,
+ kLighthouseMessageSentStateIndex = 104,
+ kChurchBellMessageSeenStateIndex = 105,
+ kStatuetteTaken2StateIndex = 106,
+ kFlaskLeftInPhillipLockerStateIndex = 107,
+ kPlaneDoorOpenStateIndex = 108,
+ kParachuteTakenStateIndex = 109,
+ kMargaretSceneStateIndex = 110,
+ kExamCompletedStateIndex = 111
};
enum MargaretState {
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 7acfc532fd0..abc7b349ab6 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -177,27 +177,27 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
igorSay({ { 92, 1, 64 }, { 93, 3, 65 } });
break;
case 46: // look at folder
- if (_objectsState[3] == 0) {
+ if (_objectsState[kFolderSwappedStateIndex] == 0) {
ADD_DIALOGUE_TEXT(85, 1, 60);
} else {
ADD_DIALOGUE_TEXT(86, 2, 61);
- _objectsState[5] = 1;
+ _objectsState[kPhillipLockerCombinationLearnedStateIndex] = 1;
}
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
break;
case 48: // look at bottle
- igorSay(77 + _objectsState[0], 1, 53 + _objectsState[0]);
+ igorSay(77 + _objectsState[kBottleStateIndex], 1, 53 + _objectsState[kBottleStateIndex]);
break;
case 50:
- if (_objectsState[1] == 0) {
+ if (_objectsState[kLizardFedStateIndex] == 0) {
igorSay({ { 80, 1, 56 }, { 81, 1, 57 } });
} else {
igorSay(82, 1, 58);
}
break;
case 51: // look at great statuette / money
- if (_objectsState[7] == 0) {
+ if (_objectsState[kStatueDeliveredStateIndex] == 0) {
ADD_DIALOGUE_TEXT(157, 1, 81);
} else {
ADD_DIALOGUE_TEXT(158, 1, 82);
@@ -225,7 +225,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
break;
case 58: // look at astronomy book
igorSay({ { 140, 1, 70 }, { 141, 1, 71 }, { 142, 1, 72 }, { 143, 1, 73 } });
- _objectsState[4] = 2;
+ _objectsState[kAstronomyBookStateIndex] = 2;
break;
case 59:
igorSay(97, 2, 67);
@@ -248,7 +248,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
_inventoryInfo[_inventoryInfo[59] - 1] = 0;
_inventoryInfo[59] = 0;
packInventory();
- _objectsState[1] = 1;
+ _objectsState[kLizardFedStateIndex] = 1;
UPDATE_OBJECT_STATE(2);
addObjectToInventory(24, 59);
igorSay(169, 1, 93);
@@ -261,16 +261,16 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
_inventoryInfo[_inventoryInfo[69] - 1] = 0;
_inventoryInfo[69] = 0;
packInventory();
- _objectsState[6] = 1;
+ _objectsState[kVaseStateIndex] = 1;
UPDATE_OBJECT_STATE(7);
addObjectToInventory(34, 69);
break;
case 64: // look at vase
- if (_objectsState[6] == 0) {
+ if (_objectsState[kVaseStateIndex] == 0) {
ADD_DIALOGUE_TEXT(162, 1, 86);
- } else if (_objectsState[6] == 1) {
+ } else if (_objectsState[kVaseStateIndex] == 1) {
ADD_DIALOGUE_TEXT(163, 1, 87);
- } else if (_objectsState[6] == 2) {
+ } else if (_objectsState[kVaseStateIndex] == 2) {
ADD_DIALOGUE_TEXT(164, 1, 88);
}
SET_DIALOGUE_TEXT(1, 1);
@@ -340,8 +340,8 @@ void IgorEngine::EXEC_MAIN_ACTION_38_lookAtNewspaper() {
free(tmp);
}
fadeIn(624);
- if (_objectsState[4] == 0) {
- _objectsState[4] = 1;
+ if (_objectsState[kAstronomyBookStateIndex] == 0) {
+ _objectsState[kAstronomyBookStateIndex] = 1;
}
}
@@ -391,7 +391,7 @@ void IgorEngine::SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p) {
void IgorEngine::UPDATE_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- switch (_objectsState[0]) {
+ switch (_objectsState[kBottleStateIndex]) {
case 0:
Common::strlcpy(_globalObjectNames[23], getString(STR_BottleOfWhisky), sizeof(_globalObjectNames[23]));
break;
@@ -404,7 +404,7 @@ void IgorEngine::UPDATE_OBJECT_STATE(int num) {
}
}
if (num == 2 || num == 255) {
- switch (_objectsState[1]) {
+ switch (_objectsState[kLizardFedStateIndex]) {
case 0:
_inventoryImages[23] = 27;
Common::strlcpy(_globalObjectNames[24], getString(STR_Lizard), sizeof(_globalObjectNames[24]));
@@ -416,7 +416,7 @@ void IgorEngine::UPDATE_OBJECT_STATE(int num) {
}
}
if (num == 4 || num == 255) {
- switch (_objectsState[3]) {
+ switch (_objectsState[kFolderSwappedStateIndex]) {
case 0:
Common::strlcpy(_globalObjectNames[22], getString(STR_CarolineFolder), sizeof(_globalObjectNames[22]));
break;
@@ -426,7 +426,7 @@ void IgorEngine::UPDATE_OBJECT_STATE(int num) {
}
}
if (num == 7 || num == 255) {
- switch (_objectsState[6]) {
+ switch (_objectsState[kVaseStateIndex]) {
case 0:
_inventoryImages[33] = 21;
break;
@@ -439,7 +439,7 @@ void IgorEngine::UPDATE_OBJECT_STATE(int num) {
}
}
if (num == 8 || num == 255) {
- if (_objectsState[7] == 0) {
+ if (_objectsState[kStatueDeliveredStateIndex] == 0) {
Common::strlcpy(_globalObjectNames[25], getString(STR_Statuette), sizeof(_globalObjectNames[25]));
_inventoryImages[24] = 29;
} else {
@@ -453,8 +453,8 @@ void IgorEngine::PART_MAIN() {
SET_EXEC_ACTION_FUNC(0, &IgorEngine::EXEC_MAIN_ACTION);
if (!_gameStateLoaded) {
memset(_objectsState, 0, 112);
- _objectsState[21] = 1;
- _objectsState[49] = 1;
+ _objectsState[kAtticNailHotspotActiveStateIndex] = 1;
+ _objectsState[kCuckooAnimationControlStateIndex] = 1;
memset(_inventoryInfo, 0, 36);
_inventoryInfo[0] = 1; // ordering
_inventoryInfo[1] = 2;
@@ -772,7 +772,7 @@ void IgorEngine::PART_MAIN() {
continue;
}
// skip if we havent given the note to margaret yet
- if (_objectsState[110] < 1 || _objectsState[110] > 7) {
+ if (_objectsState[kMargaretSceneStateIndex] < 1 || _objectsState[kMargaretSceneStateIndex] > 7) {
continue;
}
debugC(9, kDebugEngine, "Checking meanwhile with part: %d, should show cutscene counter %d", _currentPart, _gameState.shouldShowCutsceneCounter);
@@ -820,11 +820,11 @@ void IgorEngine::lookAtPapyrus(bool reveal) {
if (reveal) {
fadeIn(624);
PART_UPDATE_FIGURES_ON_PAPER(60);
- _objectsState[2] = 1;
+ _objectsState[kPapyrusFiguresVisibleStateIndex] = 1;
waitForTimer(255);
} else {
- if (_objectsState[2] == 1) {
+ if (_objectsState[kPapyrusFiguresVisibleStateIndex] == 1) {
PART_UPDATE_FIGURES_ON_PAPER(0);
}
fadeIn(624);
@@ -835,7 +835,7 @@ void IgorEngine::lookAtPapyrus(bool reveal) {
wd->x = 160;
wd->y = 130;
wd->scaleWidth = 50;
- if (_objectsState[2] == 0) {
+ if (_objectsState[kPapyrusFiguresVisibleStateIndex] == 0) {
ADD_DIALOGUE_TEXT(99, 1, 68);
} else {
ADD_DIALOGUE_TEXT(100, 2, 69);
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 6df981c09c6..8e2e9b2bc3e 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -25,23 +25,23 @@ namespace Igor {
void IgorEngine::PART_00_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- const bool open = _objectsState[8] != 0;
+ const bool open = _objectsState[kBedroomNightstandOpenStateIndex] != 0;
const int src = open ? 0x4CFA : 0x4C6A; // open or closed bedside table depending on the flag
copyArea(_screenLayer1, 0x8EBD, 320, _animFramesBuffer + src, 16, 16, 9);
_roomActionsTable[74] = open ? 7 : 6;
- _roomObjectAreasTable[13].object = open ? (_objectsState[9] == 0 ? 3 : 2) : 2;
+ _roomObjectAreasTable[13].object = open ? (_objectsState[kAlarmClockTakenStateIndex] == 0 ? 3 : 2) : 2;
}
if (num == 3 || num == 255) {
- const bool open = _objectsState[10] != 0;
+ const bool open = _objectsState[kBedroomClosetOpenStateIndex] != 0;
const int src = open ? 0x3900 : 0x3238; // open or closed door frame depending on the flag
copyArea(_screenLayer1, 0x5572, 320, _animFramesBuffer + src, 31, 31, 56);
_roomActionsTable[76] = open ? 7 : 6;
// hole open or not
- _roomObjectAreasTable[3].object = (_objectsState[11] == 0) ? 4 : 5;
+ _roomObjectAreasTable[3].object = (_objectsState[kBedroomHoleOpenStateIndex] == 0) ? 4 : 5;
}
if (num == 6 || num == 255) {
- const int state = _objectsState[13];
+ const int state = _objectsState[kBedroomWindowStateIndex];
const int src = state == 1 ? 0x143C : 0x1200; // open or closed window depending on the flag
copyArea(_screenLayer1, 0x6DB7, 320, _animFramesBuffer + src, 26, 26, 22);
_roomActionsTable[79] = state == 1 ? 7 : (state == 2 ? 6 : 4);
@@ -52,17 +52,17 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_00_EXEC_ACTION %d", action);
switch (action) {
case 101: // open window
- if (_objectsState[13] != 1) {
+ if (_objectsState[kBedroomWindowStateIndex] != 1) {
animateLitAnimFrames(0, 1, 3, 0x480, 36, 32, 0x6B2C, 62, 2, 1);
- _objectsState[13] = 1;
+ _objectsState[kBedroomWindowStateIndex] = 1;
PART_00_APPLY_OBJECT_STATE(6);
}
break;
case 102: // close window
- if (_objectsState[13] == 1) {
+ if (_objectsState[kBedroomWindowStateIndex] == 1) {
animateLitAnimFrames(0, 2, 0, 0x480, 36, 32, 0x6B2C, 62, 2, 2);
- _objectsState[13] = 2;
+ _objectsState[kBedroomWindowStateIndex] = 2;
PART_00_APPLY_OBJECT_STATE(6);
}
break;
@@ -70,38 +70,38 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
igorSay(201, 3, 95);
break;
case 104: // go to window
- if (_objectsState[13] != 1)
+ if (_objectsState[kBedroomWindowStateIndex] != 1)
break;
- if (_objectsState[15] != 0) {
+ if (_objectsState[kBedroomWindowExitUsedStateIndex] != 0) {
igorSay(212, 1, 101);
break;
}
animateLitAnimFrames(0x4D8A, 0, 1, 0x5DC, 30, 50, 0x6B2C, 62, -1, 0);
- _objectsState[13] = 2;
- _objectsState[15] = 1;
+ _objectsState[kBedroomWindowStateIndex] = 2;
+ _objectsState[kBedroomWindowExitUsedStateIndex] = 1;
_currentPart = 10;
break;
case 105: // look at bed
igorSay(204, 1, 96);
break;
case 106: // open bedside table
- if (_objectsState[8] == 0) {
+ if (_objectsState[kBedroomNightstandOpenStateIndex] == 0) {
animateLitAnimFrames(0x3FC8, 0, 2, 0x436, 22, 49, 0x693C, 126, 2, 6);
- _objectsState[8] = 1;
+ _objectsState[kBedroomNightstandOpenStateIndex] = 1;
PART_00_APPLY_OBJECT_STATE(1);
}
break;
case 107: // close bedside table
- if (_objectsState[8] != 0) {
+ if (_objectsState[kBedroomNightstandOpenStateIndex] != 0) {
animateLitAnimFrames(0x3FC8, 2, 0, 0x436, 22, 49, 0x693C, 126, 1, 6);
- _objectsState[8] = 0;
+ _objectsState[kBedroomNightstandOpenStateIndex] = 0;
PART_00_APPLY_OBJECT_STATE(1);
}
break;
case 108: // look bedside table
- if (_objectsState[8] == 0)
+ if (_objectsState[kBedroomNightstandOpenStateIndex] == 0)
ADD_DIALOGUE_TEXT(205, 1, 97);
- else if (_objectsState[9] == 0)
+ else if (_objectsState[kAlarmClockTakenStateIndex] == 0)
ADD_DIALOGUE_TEXT(217, 1, 104);
else
ADD_DIALOGUE_TEXT(218, 1, 105);
@@ -109,24 +109,24 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
startIgorDialogue();
break;
case 109: // take alarm clock
- if (_objectsState[9] == 0) {
+ if (_objectsState[kAlarmClockTakenStateIndex] == 0) {
animateLitAnimFrames(0x8410, 0, 1, 0x405, 21, 49, 0x693D, 126, -1, 0);
addObjectToInventory(6, 41);
- _objectsState[9] = 1;
+ _objectsState[kAlarmClockTakenStateIndex] = 1;
PART_00_APPLY_OBJECT_STATE(1);
}
break;
case 110: // open closet
- if (_objectsState[10] == 0) {
+ if (_objectsState[kBedroomClosetOpenStateIndex] == 0) {
animateLitAnimFrames(0x1678, 0, 2, 0x940, 37, 64, 0x556C, 126, 2, 3);
- _objectsState[10] = 1;
+ _objectsState[kBedroomClosetOpenStateIndex] = 1;
PART_00_APPLY_OBJECT_STATE(3);
}
break;
case 111: // close closet
- if (_objectsState[10] != 0) {
+ if (_objectsState[kBedroomClosetOpenStateIndex] != 0) {
animateLitAnimFrames(0x1678, 2, 0, 0x940, 37, 64, 0x556C, 126, 1, 4);
- _objectsState[10] = 0;
+ _objectsState[kBedroomClosetOpenStateIndex] = 0;
PART_00_APPLY_OBJECT_STATE(3);
}
break;
@@ -137,7 +137,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
igorSay(207, 2, 99);
break;
case 114: // go through hole
- if (_objectsState[10] == 0)
+ if (_objectsState[kBedroomClosetOpenStateIndex] == 0)
PART_00_EXEC_ACTION(110);
animateLitAnimFrames(0x5942, 0, 2, 0x44C, 22, 50, 0x66EE, 30, -1, 0);
_currentPart = 24;
@@ -146,10 +146,10 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
igorSay(209, 3, 100);
break;
case 116: // take records
- if (_objectsState[12] == 0) {
+ if (_objectsState[kRecordTakenStateIndex] == 0) {
animateLitAnimFrames(0x7C06, 0, 1, 0x405, 21, 49, 0x7146, 126, -1, 0);
addObjectToInventory(5, 40);
- _objectsState[12] = 1;
+ _objectsState[kRecordTakenStateIndex] = 1;
PART_00_APPLY_OBJECT_STATE(255);
} else {
igorSay(213, 2, 102);
@@ -188,10 +188,10 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
void IgorEngine::PART_00_ENTRY_ANIMATION() {
waitForTimer(62);
- if (_objectsState[10] == 0) {
+ if (_objectsState[kBedroomClosetOpenStateIndex] == 0) {
drawAnimRect(0x5572, 0x3900, 31, 56);
// leave closet open
- _objectsState[10] = 1;
+ _objectsState[kBedroomClosetOpenStateIndex] = 1;
PART_00_APPLY_OBJECT_STATE(3);
playSound(3, 1);
waitForTimer(30);
@@ -217,9 +217,9 @@ void IgorEngine::PART_00_WALK_IN_FROM_CLOSET() {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- if (_objectsState[14] == 0) {
+ if (_objectsState[kRatSkinHatSeenStateIndex] == 0) {
igorSay(215, 2, 103);
- _objectsState[14] = 1;
+ _objectsState[kRatSkinHatSeenStateIndex] = 1;
} else {
PART_00_ENTER_FROM_BELOW();
}
diff --git a/engines/igor/parts/part_10.cpp b/engines/igor/parts/part_10.cpp
index 634dcfd6eb7..73c858c9e4e 100644
--- a/engines/igor/parts/part_10.cpp
+++ b/engines/igor/parts/part_10.cpp
@@ -31,16 +31,16 @@ void IgorEngine::PART_10_11_DRAW_OBJECT_STATE(int num) {
// These three original blitters are byte-for-byte duplicates in the two
// halves of the room
- if ((num == 2 || num == 255) && _objectsState[41] == 1) {
+ if ((num == 2 || num == 255) && _objectsState[kGlassShardsPresentStateIndex] == 1) {
//draw shards
copyArea(_screenLayer1, 0x7DA1, 320, _animFramesBuffer + 0xC786, 37, 37, 8);
}
if (num == 3 || num == 255) {
// draw butterfly net with or without bottle
- if (_objectsState[42] == 1) {
+ if (_objectsState[kButterflyNetStateIndex] == 1) {
copyArea(_screenLayer1, 0x4E32, 320, _animFramesBuffer + 0xC5E2, 14, 14, 15);
- } else if (_objectsState[42] == 2) { // w/ bottle
+ } else if (_objectsState[kButterflyNetStateIndex] == 2) { // w/ bottle
copyArea(_screenLayer1, 0x4E32, 320, _animFramesBuffer + 0xC6B4, 14, 14, 15);
}
}
@@ -91,7 +91,7 @@ void IgorEngine::PART_10_EXEC_ACTION(int action) {
}
void IgorEngine::PART_10_ACTION_104_pickHamburger() {
- if (_objectsState[38] == 1) { // already picked hamburger
+ if (_objectsState[kHamburgerTakenStateIndex] == 1) { // already picked hamburger
igorSayAndWait(205, 1, 629);
return;
}
@@ -105,7 +105,7 @@ void IgorEngine::PART_10_ACTION_104_pickHamburger() {
}
addObjectToInventory(17, 52);
- _objectsState[38] = 1;
+ _objectsState[kHamburgerTakenStateIndex] = 1;
}
void IgorEngine::PART_10_ACTION_108_scrollLeft() {
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index a2f2117c27f..429cba2fe8c 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -30,10 +30,10 @@ void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
PART_10_11_DRAW_OBJECT_STATE(num);
if (num == 1 || num == 255)
- _roomObjectAreasTable[13].object = _objectsState[40] == 0 ? 4 : 3;
+ _roomObjectAreasTable[13].object = _objectsState[kSlugTakenStateIndex] == 0 ? 4 : 3;
if (num == 2 || num == 255) {
- if (_objectsState[41] == 1) { //glass shards
+ if (_objectsState[kGlassShardsPresentStateIndex] == 1) { //glass shards
// make area selectable
for (int area = 10; area <= 11; ++area)
_roomObjectAreasTable[area].object = 7;
@@ -45,13 +45,13 @@ void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
}
if (num == 3 || num == 255) {
- if (_objectsState[42] == 0) {
+ if (_objectsState[kButterflyNetStateIndex] == 0) {
for (int area = 7; area <= 8; ++area)
_roomObjectAreasTable[area].object = 0;
- } else if (_objectsState[42] == 1) {
+ } else if (_objectsState[kButterflyNetStateIndex] == 1) {
for (int area = 7; area <= 8; ++area)
_roomObjectAreasTable[area].object = 6;
- } else if (_objectsState[42] == 2) {
+ } else if (_objectsState[kButterflyNetStateIndex] == 2) {
_roomObjectAreasTable[7].object = 6;
_roomObjectAreasTable[8].object = 8;
}
@@ -64,7 +64,7 @@ void IgorEngine::PART_11_ACTION_105_pickSlug() {
waitForTimer(127);
}
addObjectToInventory(18, 53);
- _objectsState[40] = 1;
+ _objectsState[kSlugTakenStateIndex] = 1;
PART_11_APPLY_OBJECT_STATE(255);
}
@@ -74,7 +74,7 @@ void IgorEngine::PART_11_ACTION_107_useButterflyNetWithHole() {
waitForTimer(61);
}
removeObjectFromInventory(42);
- _objectsState[42] = 1;
+ _objectsState[kButterflyNetStateIndex] = 1;
PART_11_APPLY_OBJECT_STATE(255);
}
@@ -121,9 +121,9 @@ void IgorEngine::PART_11_ACTION_112_pickBottle() {
waitForTimer(61);
}
addObjectToInventory(23, 58);
- _objectsState[42] = 1;
+ _objectsState[kButterflyNetStateIndex] = 1;
PART_11_APPLY_OBJECT_STATE(3);
- _objectsState[0] = 1;
+ _objectsState[kBottleStateIndex] = 1;
UPDATE_OBJECT_STATE(1);
}
@@ -139,7 +139,7 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
igorSayAndWait(29, 1, 29);
break;
case 103: // look at pipe
- igorSayAndWait(_objectsState[40] == 0 ? 203 : 204, 1, _objectsState[40] == 0 ? 617 : 618);
+ igorSayAndWait(_objectsState[kSlugTakenStateIndex] == 0 ? 203 : 204, 1, _objectsState[kSlugTakenStateIndex] == 0 ? 617 : 618);
break;
case 104: // talk to slug
igorSayAndWait({ { 205, 1, 619 }, { 206, 1, 620 } });
@@ -160,7 +160,7 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
igorSayAndWait(207, 1, 621);
break;
case 110: // Look at butterfly net
- igorSayAndWait(_objectsState[42] == 1 ? 208 : 209, 1, _objectsState[42] == 1 ? 622 : 623);
+ igorSayAndWait(_objectsState[kButterflyNetStateIndex] == 1 ? 208 : 209, 1, _objectsState[kButterflyNetStateIndex] == 1 ? 622 : 623);
break;
case 111: // look at glass shards
igorSayAndWait(210, 1, 624);
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 2440f849119..897509b0578 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -36,7 +36,7 @@ void IgorEngine::PART_12_EXEC_ACTION(int action) {
igorSay(201, 1, 789);
break;
case 103: // look at stone
- if (_objectsState[44] == 0) {
+ if (_objectsState[kLizardTakenStateIndex] == 0) {
ADD_DIALOGUE_TEXT(203, 2, 790);
} else {
ADD_DIALOGUE_TEXT(205, 1, 791);
@@ -88,7 +88,7 @@ void IgorEngine::PART_12_ACTION_goToPath() {
}
}
if (compareGameTick(2, 32) && _gameState.unk10 < 8) {
- if (_objectsState[44] == 0) {
+ if (_objectsState[kLizardTakenStateIndex] == 0) {
const uint8 *src = _animFramesBuffer + 0x761 + READ_LE_UINT16(_animFramesBuffer + 0x1107 + _gameState.unk10 * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
@@ -156,7 +156,7 @@ void IgorEngine::PART_12_ACTION_104_tryEnterChurch() {
}
void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
- if (_objectsState[44] == 1) {
+ if (_objectsState[kLizardTakenStateIndex] == 1) {
ADD_DIALOGUE_TEXT(219, 1, 801);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
@@ -164,7 +164,7 @@ void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
}
memset(_screenVGA + 46080, 0, 17920);
removeInventoryEntry(62);
- const int animOffset = (_objectsState[45] == 0) ? 0x2543 : 0xBF1E;
+ const int animOffset = (_objectsState[kChurchDoorOpenStateIndex] == 0) ? 0x2543 : 0xBF1E;
for (int i = 1; i <= 9; ++i) {
const int offset = 30149;
for (int j = 0; j <= 48; ++j) {
@@ -224,7 +224,7 @@ void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
} while (_gameState.igorMoving);
decodeAnimFrame(_animFramesBuffer + 0x761 + READ_LE_UINT16(_animFramesBuffer + 0x1117) - 1, _screenVGA, true);
// draws the same scene with the church door open or closed
- if (_objectsState[45] == 0) {
+ if (_objectsState[kChurchDoorOpenStateIndex] == 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);
@@ -241,7 +241,7 @@ void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
redrawVerb(kVerbWalk, true);
_currentAction.verb = kVerbWalk;
addObjectToInventory(24, 59);
- _objectsState[44] = 1;
+ _objectsState[kLizardTakenStateIndex] = 1;
PART_12_OBJECT_STATE(255);
ADD_DIALOGUE_TEXT(211, 1, 795);
SET_DIALOGUE_TEXT(1, 1);
@@ -269,7 +269,7 @@ void IgorEngine::PART_12_ACTION_108_enterChurch() {
}
}
if (compareGameTick(2, 32) && _gameState.unk10 < 8) {
- if (_objectsState[44] == 0) {
+ if (_objectsState[kLizardTakenStateIndex] == 0) {
const uint8 *src = _animFramesBuffer + 0x761 + READ_LE_UINT16(_animFramesBuffer + 0x1107 + _gameState.unk10 * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
@@ -322,7 +322,7 @@ void IgorEngine::PART_12_HANDLE_DIALOGUE_PRIEST() {
void IgorEngine::PART_12_OBJECT_STATE(int num) {
if (num == 2 || num == 255) {
- if (_objectsState[45] == 0) {
+ if (_objectsState[kChurchDoorOpenStateIndex] == 0) {
_roomActionsTable[169] = 104;
_roomActionsTable[175] = 104;
_roomActionsTable[177] = 104;
@@ -377,13 +377,13 @@ void IgorEngine::PART_12_HELPER_4_exorcismCutscene() {
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) {
+ if (_objectsState[kLizardTakenStateIndex] == 0) {
src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x74B + i * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
waitForTimer(30);
}
- if (_objectsState[44] == 0) {
+ if (_objectsState[kLizardTakenStateIndex] == 0) {
for (int i = 6; i <= 10; ++i) {
const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x74B + i * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
@@ -396,7 +396,7 @@ void IgorEngine::PART_12_HELPER_4_exorcismCutscene() {
decodeAnimFrame(src, _screenVGA, true);
waitForTimer(30);
}
- if (_objectsState[44] == 0) {
+ if (_objectsState[kLizardTakenStateIndex] == 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);
@@ -406,7 +406,7 @@ void IgorEngine::PART_12_HELPER_4_exorcismCutscene() {
waitForTimer(255);
fadeOut(768);
// door open
- _objectsState[45] = 1;
+ _objectsState[kChurchDoorOpenStateIndex] = 1;
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
_currentPart = 40;
@@ -438,7 +438,7 @@ void IgorEngine::PART_12_HELPER_5_enterFromPath() {
}
}
if (compareGameTick(2, 32) && _gameState.unk10 < 11) {
- if (_objectsState[44] == 0) {
+ if (_objectsState[kLizardTakenStateIndex] == 0) {
const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x74B + _gameState.unk10 * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
@@ -476,7 +476,7 @@ void IgorEngine::PART_12_HELPER_6_enterFromChurch() {
}
}
if (compareGameTick(2, 32) && _gameState.unk10 < 11) {
- if (_objectsState[44] == 0) {
+ if (_objectsState[kLizardTakenStateIndex] == 0) {
const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x74B + _gameState.unk10 * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
@@ -521,7 +521,7 @@ void IgorEngine::PART_12() {
_updateRoomBackground = &IgorEngine::PART_12_UPDATE_ROOM_BACKGROUND;
PART_12_OBJECT_STATE(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- if (_objectsState[44] == 0) {
+ if (_objectsState[kLizardTakenStateIndex] == 0) {
PART_12_HELPER_3_paintOverLizard();
}
if (_currentPart == 122 && !_gameStateLoaded) {
@@ -536,7 +536,7 @@ void IgorEngine::PART_12() {
}
if (_currentPart == 121) {
PART_12_HELPER_6_enterFromChurch();
- if (_objectsState[106] == 1) {
+ if (_objectsState[kStatuetteTaken2StateIndex] == 1) {
ADD_DIALOGUE_TEXT(216, 2, 799);
ADD_DIALOGUE_TEXT(218, 1, 800);
SET_DIALOGUE_TEXT(1, 2);
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index edd122e5e98..6b799161c88 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -102,7 +102,7 @@ void IgorEngine::PART_14_ACTION_103_lookAtPuzzle() {
}
stopSound();
igorSay(227, 1, 1292);
- _objectsState[50] = 1;
+ _objectsState[kSecretPassageEntranceOpenStateIndex] = 1;
}
PART_14_HELPER_1_OBJECT_STATE(255);
_currentPart = 140;
@@ -165,7 +165,7 @@ void IgorEngine::PART_14_ACTION_106_enterMaze() {
moveIgor(wd->posNum, wd->frameNum);
waitForTimer(15);
}
- _objectsState[71] = 0;
+ _objectsState[kMazeEntryDirectionStateIndex] = 0;
_currentPart = 670;
}
@@ -222,7 +222,7 @@ void IgorEngine::PART_14_UPDATE_ROOM_BACKGROUND_ACTION_108() {
void IgorEngine::PART_14_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- if (_objectsState[50] == 1) {
+ if (_objectsState[kSecretPassageEntranceOpenStateIndex] == 1) {
PART_14_HELPER_6_drawEntrance();
_roomObjectAreasTable[3].object = 5;
_roomObjectAreasTable[4].object = 5;
@@ -458,7 +458,7 @@ void IgorEngine::PART_14_HELPER_9_showPuzzle() {
showCursor();
_dialogueEnded = false;
++_gameState.counter[4];
- if (_objectsState[2] == 0 || PART_14_ANIM_DATA_1[_gameState.counter[4]] != area) {
+ if (_objectsState[kPapyrusFiguresVisibleStateIndex] == 0 || PART_14_ANIM_DATA_1[_gameState.counter[4]] != area) {
_currentPart = 0;
}
if (_gameState.counter[4] == 5) {
diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp
index caef9610012..9222912c3cb 100644
--- a/engines/igor/parts/part_15.cpp
+++ b/engines/igor/parts/part_15.cpp
@@ -120,7 +120,7 @@ void IgorEngine::PART_15_ACTION_115_giveProjectToTobias() {
waitForTimer(60);
}
PART_15_HELPER_7_drawIgorAndTobiasScene(6);
- if (_objectsState[37] == 0) {
+ if (_objectsState[kPersonalFileChangedStateIndex] == 0) {
ADD_DIALOGUE_TEXT(215, 2, 334);
ADD_DIALOGUE_TEXT(217, 1, 335);
} else {
@@ -132,7 +132,7 @@ void IgorEngine::PART_15_ACTION_115_giveProjectToTobias() {
_updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS;
waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19);
_updateDialogue = 0;
- if (_objectsState[37] == 0) {
+ if (_objectsState[kPersonalFileChangedStateIndex] == 0) {
return;
}
for (int i = 1; i <= 7; ++i) {
@@ -140,8 +140,8 @@ void IgorEngine::PART_15_ACTION_115_giveProjectToTobias() {
waitForTimer(40);
}
removeObjectFromInventory(70);
- _objectsState[46] = 1;
- if (_objectsState[47] == 0) {
+ _objectsState[kProjectHandedToTobiasStateIndex] = 1;
+ if (_objectsState[kMoneyHandedToTobiasStateIndex] == 0) {
cutsceneSayWithCallback(133, 67, 0, 63, 19, 221, 2, 338, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
return;
}
@@ -164,7 +164,7 @@ void IgorEngine::PART_15_ACTION_116_giveMoneyToTobias() {
waitForTimer(60);
}
PART_15_HELPER_7_drawIgorAndTobiasScene(6);
- if (_objectsState[37] == 0) {
+ if (_objectsState[kPersonalFileChangedStateIndex] == 0) {
ADD_DIALOGUE_TEXT(215, 2, 334);
ADD_DIALOGUE_TEXT(217, 1, 335);
} else {
@@ -176,7 +176,7 @@ void IgorEngine::PART_15_ACTION_116_giveMoneyToTobias() {
_updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS;
waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19);
_updateDialogue = 0;
- if (_objectsState[37] == 0) {
+ if (_objectsState[kPersonalFileChangedStateIndex] == 0) {
return;
}
for (int i = 1; i <= 7; ++i) {
@@ -184,8 +184,8 @@ void IgorEngine::PART_15_ACTION_116_giveMoneyToTobias() {
waitForTimer(40);
}
removeObjectFromInventory(60);
- _objectsState[47] = 1;
- if (_objectsState[46] == 0) {
+ _objectsState[kMoneyHandedToTobiasStateIndex] = 1;
+ if (_objectsState[kProjectHandedToTobiasStateIndex] == 0) {
cutsceneSayWithCallback(133, 67, 0, 63, 19, 224, 2, 340, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
return;
}
@@ -199,7 +199,7 @@ void IgorEngine::PART_15_ACTION_116_giveMoneyToTobias() {
void IgorEngine::PART_15_UPDATE_ROOM_BACKGROUND() {
PART_15_HELPER_5_animateTobiasIdle();
if (compareGameTick(38) || compareGameTick(60)) {
- if (_objectsState[48] != 1 && getRandomNumber(199) == 0 && _gameState.counter[3] == 0) {
+ if (_objectsState[kCuckooClockTriggeredStateIndex] != 1 && getRandomNumber(199) == 0 && _gameState.counter[3] == 0) {
_gameState.counter[3] = 1;
}
}
@@ -252,18 +252,18 @@ void IgorEngine::PART_15_HELPER_2_walkIn() {
void IgorEngine::PART_15_HELPER_3_updateCuckooClock() {
if (compareGameTick(38) || compareGameTick(60)) {
- if (_objectsState[48] != 1 && _gameState.counter[3] == 1) {
+ if (_objectsState[kCuckooClockTriggeredStateIndex] != 1 && _gameState.counter[3] == 1) {
if (_gameState.unk11 == 0) {
- _objectsState[48] = 1;
- _objectsState[49] = 1;
+ _objectsState[kCuckooClockTriggeredStateIndex] = 1;
+ _objectsState[kCuckooAnimationControlStateIndex] = 1;
_gameState.counter[3] = 0;
} else {
PART_15_HELPER_6_drawCuckooFrame(_gameState.unk11);
}
if (_gameState.unk11 == 7) {
- _objectsState[49] = 2;
+ _objectsState[kCuckooAnimationControlStateIndex] = 2;
}
- if (_objectsState[49] == 2) {
+ if (_objectsState[kCuckooAnimationControlStateIndex] == 2) {
if (_gameState.counter[4] == 0) {
playSound(54, 1);
}
@@ -274,10 +274,10 @@ void IgorEngine::PART_15_HELPER_3_updateCuckooClock() {
_gameState.unk11 = 7;
}
if (_gameState.counter[4] > 15) {
- _objectsState[49] = 3;
+ _objectsState[kCuckooAnimationControlStateIndex] = 3;
_gameState.unk11 = 6;
}
- } else if (_objectsState[49] == 1) {
+ } else if (_objectsState[kCuckooAnimationControlStateIndex] == 1) {
++_gameState.unk11;
} else {
--_gameState.unk11;
@@ -385,8 +385,8 @@ void IgorEngine::PART_15() {
runPartLoop();
}
leavePartLoop();
- if (_objectsState[48] == 1) {
- _objectsState[48] = 2;
+ if (_objectsState[kCuckooClockTriggeredStateIndex] == 1) {
+ _objectsState[kCuckooClockTriggeredStateIndex] = 2;
}
if (!_gameStateLoaded)
fadeOut(624);
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index 05234f8f672..cdf32139dba 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -45,7 +45,7 @@ void IgorEngine::PART_16_EXEC_ACTION(int action) {
}
void IgorEngine::PART_16_ACTION_101_pickUpFlask() {
- if (_objectsState[52] == 1) {
+ if (_objectsState[kFlaskTakenStateIndex] == 1) {
igorSay(207, 1, 729);
return;
}
@@ -56,7 +56,7 @@ void IgorEngine::PART_16_ACTION_101_pickUpFlask() {
waitForTimer(120);
}
addObjectToInventory(20, 55);
- _objectsState[52] = 1;
+ _objectsState[kFlaskTakenStateIndex] = 1;
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
@@ -141,7 +141,7 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
setPaletteRange(208, 255);
do {
PART_MARGARET_ROOM_CUTSCENE();
- } while (_objectsState[110] != 9);
+ } while (_objectsState[kMargaretSceneStateIndex] != 9);
setupDefaultPalette();
SET_PAL_240_48_1();
SET_PAL_208_96_1();
@@ -191,7 +191,7 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
_inventoryInfo[_inventoryInfo[73] - 1] = 19;
_inventoryInfo[54] = _inventoryInfo[73];
_inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
- _objectsState[53] = 1;
+ _objectsState[kPhotoCutsceneSeenStateIndex] = 1;
_objectsState[kMargaretStateIndex] = kMargaretStatePhotoTaken;
_currentPart = 261;
}
@@ -232,7 +232,7 @@ void IgorEngine::PART_16() {
_currentAction.verb = kVerbWalk;
fadeIn(768);
PART_16_HELPER_2_enterScene();
- if (_objectsState[kMargaretStateIndex] == kMargaretStateReadNote && _inventoryInfo[71] != 0 && _objectsState[76] == 1) {
+ if (_objectsState[kMargaretStateIndex] == kMargaretStateReadNote && _inventoryInfo[71] != 0 && _objectsState[kHarrisonNoteShownStateIndex] == 1) {
PART_16_HELPER_3_photoCutscene();
}
enterPartLoop();
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 69c53d1751c..88ebd1014a2 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -167,7 +167,7 @@ void IgorEngine::PART_17_ACTION_105_leaveThroughPath(bool lateGame) {
void IgorEngine::PART_17_ACTION_106_swapFolders() {
// folder already exchanged
- if (_objectsState[55] == 1) {
+ if (_objectsState[kCollegeEntranceFoldersSwappedStateIndex] == 1) {
igorSay(226, 1, 649);
return;
}
@@ -186,8 +186,8 @@ void IgorEngine::PART_17_ACTION_106_swapFolders() {
g_engine->_screen->updateScreen();
- _objectsState[55] = 1;
- _objectsState[3] = 1;
+ _objectsState[kCollegeEntranceFoldersSwappedStateIndex] = 1;
+ _objectsState[kFolderSwappedStateIndex] = 1;
PART_17_HELPER_1_OBJECT_STATE(255);
UPDATE_OBJECT_STATE(4);
if (_game.version == kIdEngDemo110) {
@@ -271,7 +271,7 @@ void IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND() {
void IgorEngine::PART_17_HELPER_1_OBJECT_STATE(int num) {
// Enable or disable phillip and jimmy animation
if (num == 1 || num == 255) {
- if (_objectsState[54] == 0) {
+ if (_objectsState[kPhillipAndJimmyPresentStateIndex] == 0) {
_gameState.unkF = false;
} else {
PART_17_HELPER_3_disableArea(0);
@@ -280,12 +280,12 @@ void IgorEngine::PART_17_HELPER_1_OBJECT_STATE(int num) {
}
if (num == 2 || num == 255) {
- if (_objectsState[55] == 1) {
+ if (_objectsState[kCollegeEntranceFoldersSwappedStateIndex] == 1) {
_roomActionsTable[2698] = 0;
}
}
if (num == 3 || num == 255) {
- if (_objectsState[56] == 1) {
+ if (_objectsState[kPhillipAndJimmyHaveLeftStateIndex] == 1) {
_gameState.unkF = false;
PART_17_HELPER_3_disableArea(6);
}
@@ -471,7 +471,7 @@ void IgorEngine::PART_17() {
memcpy(_screenVGA, _screenLayer1, 46080);
- if (_objectsState[56] == 1) {
+ if (_objectsState[kPhillipAndJimmyHaveLeftStateIndex] == 1) {
_gameState.unkF = false;
PART_17_HELPER_3_disableArea(6);
_roomObjectAreasTable[14].object = 0;
@@ -507,11 +507,11 @@ void IgorEngine::PART_17() {
}
leavePartLoop();
if (!_gameStateLoaded) {
- if (_objectsState[55] == 1) {
- _objectsState[56] = 1;
+ if (_objectsState[kCollegeEntranceFoldersSwappedStateIndex] == 1) {
+ _objectsState[kPhillipAndJimmyHaveLeftStateIndex] = 1;
}
- if (_objectsState[54] == 0) {
- _objectsState[54] = 1;
+ if (_objectsState[kPhillipAndJimmyPresentStateIndex] == 0) {
+ _objectsState[kPhillipAndJimmyPresentStateIndex] = 1;
}
fadeOut(624);
}
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index cf50b779067..7e6f5b3c511 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -96,11 +96,11 @@ void IgorEngine::PART_18_ACTION_109_useSlugOnGrating() {
}
void IgorEngine::PART_18_ACTION_111_useBottleOnTap() {
- if (_objectsState[0] == 0) {
+ if (_objectsState[kBottleStateIndex] == 0) {
igorSay(211, 1, 905);
return;
}
- if (_objectsState[0] == 2) {
+ if (_objectsState[kBottleStateIndex] == 2) {
igorSay(212, 1, 906);
return;
}
@@ -112,7 +112,7 @@ void IgorEngine::PART_18_ACTION_111_useBottleOnTap() {
}
drawAnimRect(offset, 0xBDE, 28, 29);
igorSay(213, 2, 907);
- _objectsState[0] = 2;
+ _objectsState[kBottleStateIndex] = 2;
UPDATE_OBJECT_STATE(1);
}
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index 223cc34152a..db0938a3e9d 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -60,7 +60,7 @@ void IgorEngine::PART_19_EXEC_ACTION(int action) {
}
void IgorEngine::PART_19_ACTION_107_lookAtSink() {
- if (_objectsState[58] == 1) {
+ if (_objectsState[kHairpinTakenStateIndex] == 1) {
igorSay(211, 1, 919);
return;
}
@@ -73,12 +73,12 @@ void IgorEngine::PART_19_ACTION_107_lookAtSink() {
waitForTimer(120);
}
addObjectToInventory(12, 47);
- _objectsState[58] = 1;
+ _objectsState[kHairpinTakenStateIndex] = 1;
PART_19_HELPER_1_OBJECT_STATE(255);
}
void IgorEngine::PART_19_ACTION_109_usePapyrusOnDryer() {
- if (_objectsState[2] == 1) {
+ if (_objectsState[kPapyrusFiguresVisibleStateIndex] == 1) {
igorSay(210, 1, 918);
return;
}
@@ -117,7 +117,7 @@ void IgorEngine::PART_19_UPDATE_BACKGROUND_HELPER_9() {
void IgorEngine::PART_19_HELPER_1_OBJECT_STATE(int num) {
if (num == 2 || num == 255) {
- if (_objectsState[59] == 0) {
+ if (_objectsState[kToiletGirlsHaveLeftStateIndex] == 0) {
decodeAnimFrame(_animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x4051) - 1, _screenLayer1, true);
}
}
@@ -175,7 +175,7 @@ void IgorEngine::PART_19_HELPER_2_slugCutscene() { // sub_137_07AD
cutsceneSayWithCallback(243, 92, 63, 23, 33, 221, 2, 925, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
VAR_CURRENT_TALKING_ACTOR = 1;
cutsceneSayWithCallback(227, 91, 0, 63, 63, 223, 2, 926, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
- _objectsState[59] = 1;
+ _objectsState[kToiletGirlsHaveLeftStateIndex] = 1;
fadeOut(624);
_gameState.talkSpeed = talkSpeed;
}
@@ -231,7 +231,7 @@ void IgorEngine::PART_19() {
_currentAction.verb = kVerbWalk;
fadeIn(768);
PART_19_HELPER_3_walkIn();
- if (_objectsState[59] == 0) {
+ if (_objectsState[kToiletGirlsHaveLeftStateIndex] == 0) {
PART_19_HELPER_4_enterAndLeave();
if (!_gameStateLoaded && _currentPart != 191)
fadeOut(624);
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index b082d8c9e3e..f372ee79ffc 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -64,12 +64,12 @@ void IgorEngine::PART_02_walkWhileFuseBurns(int srcX, int srcY, int dstX, int ds
void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
// redraws the closed/open trunk into the persistent room background.
- const int srcOffset = _objectsState[16] == 0 ? 0x2E3E : 0x30FC;
+ const int srcOffset = _objectsState[kAtticTrunkOpenStateIndex] == 0 ? 0x2E3E : 0x30FC;
copyArea(_screenLayer1, 0x748A, 320, _animFramesBuffer + srcOffset, 39, 39, 18);
- _roomActionsTable[252] = _objectsState[16] == 0 ? 6 : 4;
+ _roomActionsTable[252] = _objectsState[kAtticTrunkOpenStateIndex] == 0 ? 6 : 4;
}
// butterfly net
- if ((num == 2 || num == 255) && _objectsState[17] == 1) {
+ if ((num == 2 || num == 255) && _objectsState[kButterflyNetTakenStateIndex] == 1) {
_roomObjectAreasTable[17].object = 4;
_roomObjectAreasTable[19].object = 4;
}
@@ -78,32 +78,32 @@ void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
// 19 = big crack
// 20 = small crack
if (num == 3 || num == 255) {
- if (_objectsState[18] == 1) {
+ if (_objectsState[kAtticWallHolePresentStateIndex] == 1) {
copyArea(_screenLayer1, 0x50D6, 320, _animFramesBuffer, 14, 14, 50);
}
- _roomObjectAreasTable[9].object = _objectsState[18] == 0 ? 0 : 6;
+ _roomObjectAreasTable[9].object = _objectsState[kAtticWallHolePresentStateIndex] == 0 ? 0 : 6;
}
if (num == 4 || num == 255) {
- if (_objectsState[19] == 0) {
- _roomObjectAreasTable[12].object = _objectsState[18] == 1 ? 6 : 0;
+ if (_objectsState[kAtticLargeCrackPresentStateIndex] == 0) {
+ _roomObjectAreasTable[12].object = _objectsState[kAtticWallHolePresentStateIndex] == 1 ? 6 : 0;
} else {
copyArea(_screenLayer1, 0x5357, 320, _animFramesBuffer + 0x2BC, 10, 10, 22);
_roomObjectAreasTable[12].object = 7;
}
}
if (num == 5 || num == 255) {
- if (_objectsState[20] == 0) {
- _roomObjectAreasTable[13].object = _objectsState[19] == 1 ? 7 : (_objectsState[18] == 1 ? 6 : 0);
+ if (_objectsState[kAtticSmallCrackPresentStateIndex] == 0) {
+ _roomObjectAreasTable[13].object = _objectsState[kAtticLargeCrackPresentStateIndex] == 1 ? 7 : (_objectsState[kAtticWallHolePresentStateIndex] == 1 ? 6 : 0);
} else {
copyArea(_screenLayer1, 0x599B, 320, _animFramesBuffer + 0x398, 4, 4, 10);
_roomObjectAreasTable[13].object = 8;
}
}
if (num == 6 || num == 255) {
- if (_objectsState[21] == 0) // changes action on hammer after using it the first time
- _roomObjectAreasTable[14].object = _objectsState[20] == 1 ? 8 : (_objectsState[19] == 1 ? 7 : (_objectsState[18] == 1 ? 6 : 0));
+ if (_objectsState[kAtticNailHotspotActiveStateIndex] == 0) // changes action on hammer after using it the first time
+ _roomObjectAreasTable[14].object = _objectsState[kAtticSmallCrackPresentStateIndex] == 1 ? 8 : (_objectsState[kAtticLargeCrackPresentStateIndex] == 1 ? 7 : (_objectsState[kAtticWallHolePresentStateIndex] == 1 ? 6 : 0));
}
- if ((num == 8 || num == 255) && _objectsState[23] == 1) {
+ if ((num == 8 || num == 255) && _objectsState[kDynamitePlacedStateIndex] == 1) {
_roomObjectAreasTable[13].object = 8;
// Reuse the already-loaded
// localized inventory-object name for dynamite.
@@ -116,22 +116,22 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
debugC(9, kDebugGame, "PART_02_EXEC_ACTION %d", action);
switch (action) {
case 101: // open trunk
- if (_objectsState[16] == 1) {
+ if (_objectsState[kAtticTrunkOpenStateIndex] == 1) {
igorSay(201, 1, 108);
break;
}
animateLitAnimFrames(0x18FF, 1, 2, 0x715, 37, 49, 0x608C, 127, 1, 7);
- _objectsState[16] = 1;
+ _objectsState[kAtticTrunkOpenStateIndex] = 1;
PART_02_APPLY_OBJECT_STATE(1);
break;
case 102: // close trunk
- if (_objectsState[16] == 0) {
+ if (_objectsState[kAtticTrunkOpenStateIndex] == 0) {
igorSay(201, 1, 108);
break;
}
playSound(8, 1);
animateLitAnimFrames(0x18FF, 1, 0, 0x715, 37, 49, 0x608C, 127, -1, 0);
- _objectsState[16] = 0;
+ _objectsState[kAtticTrunkOpenStateIndex] = 0;
PART_02_APPLY_OBJECT_STATE(1);
break;
case 103: { // hammer the nail
@@ -142,15 +142,15 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
playSound(9, 1);
waitForTimer(63);
}
- _objectsState[20] = 1;
- _objectsState[21] = 0;
+ _objectsState[kAtticSmallCrackPresentStateIndex] = 1;
+ _objectsState[kAtticNailHotspotActiveStateIndex] = 0;
PART_02_APPLY_OBJECT_STATE(5);
PART_02_APPLY_OBJECT_STATE(6);
igorSay(217, 1, 121);
break;
}
case 104: { // use the pick on the crack;
- if (_objectsState[23] == 1) {
+ if (_objectsState[kDynamitePlacedStateIndex] == 1) {
EXEC_MAIN_ACTION(2);
break;
}
@@ -162,8 +162,8 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
playSound(10, 1);
waitForTimer(63);
}
- _objectsState[19] = 1;
- _objectsState[20] = 0;
+ _objectsState[kAtticLargeCrackPresentStateIndex] = 1;
+ _objectsState[kAtticSmallCrackPresentStateIndex] = 0;
PART_02_APPLY_OBJECT_STATE(4);
PART_02_APPLY_OBJECT_STATE(5);
PART_02_APPLY_OBJECT_STATE(6);
@@ -172,15 +172,15 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
case 105: // look at nail
igorSay(209, 1, 115);
- _objectsState[22] = 1;
+ _objectsState[kAtticNailExaminedStateIndex] = 1;
break;
case 106: // look in trunk
- if (_objectsState[16] == 0) {
+ if (_objectsState[kAtticTrunkOpenStateIndex] == 0) {
igorSay(201, 1, 108);
break;
}
if (_inventoryInfo[44] == 0 && _inventoryInfo[45] == 0) {
- if (_objectsState[22] == 0) {
+ if (_objectsState[kAtticNailExaminedStateIndex] == 0) {
igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
PART_02_searchTrunk();
@@ -191,7 +191,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
break;
}
if (_inventoryInfo[44] != 0 && _inventoryInfo[45] == 0) {
- if (_objectsState[20] == 0) {
+ if (_objectsState[kAtticSmallCrackPresentStateIndex] == 0) {
igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
PART_02_searchTrunk();
@@ -203,11 +203,11 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
break;
}
- if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 && _inventoryInfo[46] == 0 && _objectsState[23] == 0 && _objectsState[19] != 0) {
+ if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 && _inventoryInfo[46] == 0 && _objectsState[kDynamitePlacedStateIndex] == 0 && _objectsState[kAtticLargeCrackPresentStateIndex] != 0) {
PART_02_searchTrunk();
igorSay(206, 1, 113);
addObjectToInventory(11, 46);
- } else if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 && _inventoryInfo[46] == 0 && _objectsState[23] == 0) {
+ } else if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 && _inventoryInfo[46] == 0 && _objectsState[kDynamitePlacedStateIndex] == 0) {
igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
igorSay(207, 2, 114);
@@ -217,7 +217,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
animateLitAnimFrames(0x54D2, 0, 1, 0x405, 21, 49, 0x5A6D, 127, -1, 0);
waitForTimer(127);
addObjectToInventory(7, 42);
- _objectsState[17] = 1;
+ _objectsState[kButterflyNetTakenStateIndex] = 1;
PART_02_APPLY_OBJECT_STATE(2);
break;
case 108: // Look at old junk
@@ -238,7 +238,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
case 113: // place dynamite in the crack
animateLitAnimFrames(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
waitForTimer(127);
- _objectsState[23] = 1;
+ _objectsState[kDynamitePlacedStateIndex] = 1;
PART_02_APPLY_OBJECT_STATE(8);
removeObjectFromInventory(46);
playSound(63, 1);
@@ -254,10 +254,10 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
igorSay(218, 1, 122);
break;
case 118: // exit through window
- if (_objectsState[24] == 1) {
+ if (_objectsState[kAtticWindowExitTriedStateIndex] == 1) {
igorSay(220, 1, 124);
} else {
- _objectsState[24] = 1;
+ _objectsState[kAtticWindowExitTriedStateIndex] = 1;
_currentPart = 11;
}
break;
@@ -270,16 +270,16 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
_currentPart = 30;
break;
case 121: // look at shelf / take matches
- if (_objectsState[25] == 1) {
+ if (_objectsState[kMatchesTakenStateIndex] == 1) {
igorSay(230, 1, 130);
} else {
igorSay(211, 2, 117);
addObjectToInventory(8, 43);
- _objectsState[25] = 1;
+ _objectsState[kMatchesTakenStateIndex] = 1;
}
break;
case 117: // light the dynamite
- if (_objectsState[23] == 0) {
+ if (_objectsState[kDynamitePlacedStateIndex] == 0) {
EXEC_MAIN_ACTION(2);
} else {
PART_02_lightUpDynamite();
@@ -332,10 +332,10 @@ void IgorEngine::PART_02_lightUpDynamite() {
_gameState.igorMoving = true;
waitForIgorMove();
- _objectsState[18] = 1;
- _objectsState[19] = 0;
- _objectsState[23] = 0;
- _objectsState[11] = 1;
+ _objectsState[kAtticWallHolePresentStateIndex] = 1;
+ _objectsState[kAtticLargeCrackPresentStateIndex] = 0;
+ _objectsState[kDynamitePlacedStateIndex] = 0;
+ _objectsState[kBedroomHoleOpenStateIndex] = 1;
PART_02_APPLY_OBJECT_STATE(3);
PART_02_APPLY_OBJECT_STATE(4);
PART_02_APPLY_OBJECT_STATE(5);
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index 46477a11555..df4b1523f62 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -76,7 +76,7 @@ void IgorEngine::PART_21_EXEC_ACTION(int action) {
}
void IgorEngine::PART_21_ACTION_101_leaveLeft() {
- if (_objectsState[65] == 1) {
+ if (_objectsState[kMargaretStateIndex] == 1) {
const int offset = 29440;
copyArea(_screenVGA, offset, 320, _screenLayer1 + offset, 320, 20, 51);
PART_21_HELPER_10_MargaretTakesNote();
@@ -99,7 +99,7 @@ void IgorEngine::PART_21_ACTION_102_talkToMargaret() {
}
void IgorEngine::PART_21_ACTION_107_openPhysicsDoor() {
- if (_objectsState[64] == 1) {
+ if (_objectsState[kPhysicsClassDoorStateIndex] == 1) {
EXEC_MAIN_ACTION(11);
return;
}
@@ -112,12 +112,12 @@ void IgorEngine::PART_21_ACTION_107_openPhysicsDoor() {
waitForTimer(100);
}
}
- _objectsState[64] = 1;
+ _objectsState[kPhysicsClassDoorStateIndex] = 1;
PART_21_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_21_ACTION_108_closePhysicsDoor() {
- if (_objectsState[64] == 0) {
+ if (_objectsState[kPhysicsClassDoorStateIndex] == 0) {
EXEC_MAIN_ACTION(14);
return;
}
@@ -129,12 +129,12 @@ void IgorEngine::PART_21_ACTION_108_closePhysicsDoor() {
waitForTimer(100);
}
}
- _objectsState[64] = 0;
+ _objectsState[kPhysicsClassDoorStateIndex] = 0;
PART_21_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_21_ACTION_110_leaveRight() {
- if (_objectsState[65] == 1) {
+ if (_objectsState[kMargaretStateIndex] == 1) {
const int offset = 27180;
copyArea(_screenVGA, offset, 320, _screenLayer1 + offset, 320, 20, 51);
PART_21_HELPER_10_MargaretTakesNote();
@@ -165,7 +165,7 @@ void IgorEngine::PART_21_ACTION_111_useNoteWithSandwhiches() {
waitForTimer();
} while (k != 10);
removeObjectFromInventory(56);
- _objectsState[65] = 1;
+ _objectsState[kMargaretStateIndex] = 1;
PART_21_HELPER_1_OBJECT_STATE(255);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
@@ -174,14 +174,14 @@ void IgorEngine::PART_21_ACTION_111_useNoteWithSandwhiches() {
}
void IgorEngine::PART_21_ACTION_113_enterPhysicsClass() {
- if (_objectsState[64] != 0) {
+ if (_objectsState[kPhysicsClassDoorStateIndex] != 0) {
_roomObjectAreasTable[_screenLayer2[34679]].area = 1;
--_walkDataLastIndex;
buildWalkPathSimple(165, 126, 119, 108);
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
PART_21_HELPER_5_waitForIgorWalkWithAnimation();
- if (_objectsState[65] == 1) {
+ if (_objectsState[kMargaretStateIndex] == 1) {
PART_21_HELPER_10_MargaretTakesNote();
}
_currentPart = 370;
@@ -234,7 +234,7 @@ void IgorEngine::PART_21_HANDLE_DIALOGUE_MARGARET() {
void IgorEngine::PART_21_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
// physics class door
- if (_objectsState[64] == 0) {
+ if (_objectsState[kPhysicsClassDoorStateIndex] == 0) {
PART_21_HELPER_7_drawClosedDoor();
_roomActionsTable[4] = 6;
} else {
@@ -244,10 +244,10 @@ void IgorEngine::PART_21_HELPER_1_OBJECT_STATE(int num) {
}
if (num == 2 || num == 255) {
// is margaret present?
- if (_objectsState[65] <= 1) {
+ if (_objectsState[kMargaretStateIndex] <= 1) {
PART_21_HELPER_9_drawMargaret();
}
- if (_objectsState[65] == 2 || _objectsState[65] == 4) {
+ if (_objectsState[kMargaretStateIndex] == 2 || _objectsState[kMargaretStateIndex] == 4) {
_roomObjectAreasTable[9].object = 0;
_roomObjectAreasTable[10].object = 0;
}
@@ -370,12 +370,12 @@ void IgorEngine::PART_21_HELPER_10_MargaretTakesNote() {
waitForEndOfCutsceneDialogue(76, 87, 63, 32, 0);
_updateRoomBackground = &IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND;
_updateDialogue = 0;
- _objectsState[65] = 2;
+ _objectsState[kMargaretStateIndex] = 2;
drawVerbsPanel();
_currentAction.verb = kVerbWalk;
drawInventory(_inventoryInfo[72], 0);
PART_21_HELPER_1_OBJECT_STATE(255);
- _objectsState[110] = 1;
+ _objectsState[kMargaretSceneStateIndex] = 1;
}
void IgorEngine::PART_21_HELPER_11_setMargaretBackgroundFrame(int frame) {
@@ -390,7 +390,7 @@ void IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND() {
drawAnimRect(offset, 0xBCA5 + i * 1300, 26, 50);
++i;
}
- if (compareGameTick(61) && _objectsState[65] <= 1) {
+ if (compareGameTick(61) && _objectsState[kMargaretStateIndex] <= 1) {
if (_gameState.unk10 > 2) {
PART_21_HELPER_6_drawMargaretFrameComposited(_gameState.unk10);
++_gameState.unk10;
diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp
index 489cb6cd1aa..b24c5b011bb 100644
--- a/engines/igor/parts/part_22.cpp
+++ b/engines/igor/parts/part_22.cpp
@@ -48,7 +48,7 @@ void IgorEngine::PART_22_EXEC_ACTION(int action) {
* Takes the object (inventory object 29) from the bell tower.
*/
void IgorEngine::PART_22_ACTION_101_lookAtBell() {
- if (_objectsState[78] == 1 && _inventoryInfo[64] == 0) {
+ if (_objectsState[kBellTowerConversationSeenStateIndex] == 1 && _inventoryInfo[64] == 0) {
igorSayAndWait(203, 2, 855);
for (int i = 0; i < 3; ++i) {
// each frame is drawn as is, over Igor too
@@ -60,7 +60,7 @@ void IgorEngine::PART_22_ACTION_101_lookAtBell() {
addObjectToInventory(29, 64);
PART_22_APPLY_OBJECT_STATE(255);
igorSay({ { 205, 1, 856 }, { 206, 1, 857 } });
- _objectsState[105] = 1;
+ _objectsState[kChurchBellMessageSeenStateIndex] = 1;
} else {
igorSay(201, 2, 854);
}
diff --git a/engines/igor/parts/part_23.cpp b/engines/igor/parts/part_23.cpp
index d31ecf840ef..f1b6eff0561 100644
--- a/engines/igor/parts/part_23.cpp
+++ b/engines/igor/parts/part_23.cpp
@@ -67,7 +67,7 @@ void IgorEngine::PART_23_EXEC_ACTION(int action) {
}
void IgorEngine::PART_23_ACTION_105_enterLadiesRoom() {
- if (_objectsState[66] != 0) {
+ if (_objectsState[kLadiesRoomDoorStateIndex] != 0) {
_roomObjectAreasTable[_screenLayer2[38633]].area = 1;
--_walkDataLastIndex;
buildWalkPathSimple(233, 132, 233, 120);
@@ -79,7 +79,7 @@ void IgorEngine::PART_23_ACTION_105_enterLadiesRoom() {
}
void IgorEngine::PART_23_ACTION_107_openDoor() {
- if (_objectsState[66] == 1) {
+ if (_objectsState[kLadiesRoomDoorStateIndex] == 1) {
EXEC_MAIN_ACTION(11);
return;
}
@@ -93,12 +93,12 @@ void IgorEngine::PART_23_ACTION_107_openDoor() {
waitForTimer(100);
}
}
- _objectsState[66] = 1;
+ _objectsState[kLadiesRoomDoorStateIndex] = 1;
PART_23_HELPER_1_APPLY_OBJECT_STATE(1);
}
void IgorEngine::PART_23_ACTION_108_closeDoor() {
- if (_objectsState[66] == 0) {
+ if (_objectsState[kLadiesRoomDoorStateIndex] == 0) {
EXEC_MAIN_ACTION(14);
return;
}
@@ -112,7 +112,7 @@ void IgorEngine::PART_23_ACTION_108_closeDoor() {
waitForTimer(100);
}
}
- _objectsState[66] = 0;
+ _objectsState[kLadiesRoomDoorStateIndex] = 0;
PART_23_HELPER_1_APPLY_OBJECT_STATE(1);
}
@@ -136,7 +136,7 @@ void IgorEngine::PART_23_UPDATE_ROOM_BACKGROUND() {
void IgorEngine::PART_23_HELPER_1_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- if (_objectsState[66] == 0) {
+ if (_objectsState[kLadiesRoomDoorStateIndex] == 0) {
PART_23_HELPER_2_drawDoor(1);
_roomActionsTable[4] = 6;
} else {
@@ -168,10 +168,10 @@ void IgorEngine::PART_23_HELPER_4_walkFromDoor() {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- if (_objectsState[59] == 0) {
+ if (_objectsState[kToiletGirlsHaveLeftStateIndex] == 0) {
drawAnimRect(23907, 0, 24, 54, false, kBlendBehindIgor);
playSound(14, 1);
- _objectsState[66] = 0;
+ _objectsState[kLadiesRoomDoorStateIndex] = 0;
PART_23_HELPER_1_APPLY_OBJECT_STATE(1);
igorSay(206, 2, 1221);
}
diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp
index 2951070666c..3728e3abe6c 100644
--- a/engines/igor/parts/part_24.cpp
+++ b/engines/igor/parts/part_24.cpp
@@ -68,7 +68,7 @@ void IgorEngine::PART_24_EXEC_ACTION(int action) {
}
void IgorEngine::PART_24_ACTION_102_enterChemistryClass() {
- if (_objectsState[67] != 0) {
+ if (_objectsState[kChemistryDoorStateIndex] != 0) {
_roomObjectAreasTable[_screenLayer2[37188]].area = 1;
--_walkDataLastIndex;
buildWalkPathSimple(76, 128, 68, 116);
@@ -80,7 +80,7 @@ void IgorEngine::PART_24_ACTION_102_enterChemistryClass() {
}
void IgorEngine::PART_24_ACTION_104_closeDoor() {
- if (_objectsState[67] == 1) {
+ if (_objectsState[kChemistryDoorStateIndex] == 1) {
executeAction(11);
return;
}
@@ -93,12 +93,12 @@ void IgorEngine::PART_24_ACTION_104_closeDoor() {
waitForTimer(100);
}
}
- _objectsState[67] = 1;
+ _objectsState[kChemistryDoorStateIndex] = 1;
PART_24_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_24_ACTION_105_openDoor() {
- if (_objectsState[67] == 0) {
+ if (_objectsState[kChemistryDoorStateIndex] == 0) {
executeAction(14);
return;
}
@@ -111,7 +111,7 @@ void IgorEngine::PART_24_ACTION_105_openDoor() {
waitForTimer(100);
}
}
- _objectsState[67] = 0;
+ _objectsState[kChemistryDoorStateIndex] = 0;
PART_24_HELPER_1_OBJECT_STATE(1);
}
@@ -149,7 +149,7 @@ void IgorEngine::PART_24_UPDATE_ROOM_BACKGROUND() {
void IgorEngine::PART_24_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) { // door
- if (_objectsState[67] == 0) {
+ if (_objectsState[kChemistryDoorStateIndex] == 0) {
PART_24_HELPER_4_drawClosedDoor();
_roomActionsTable[2] = 6;
} else {
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index 2a793f55c4b..4c36923c19f 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -68,7 +68,7 @@ void IgorEngine::PART_25_EXEC_ACTION(int action) {
}
void IgorEngine::PART_25_ACTION_105_enterMensToilet() {
- if (_objectsState[68] != 0) {
+ if (_objectsState[kMensRoomDoorStateIndex] != 0) {
_roomObjectAreasTable[_screenLayer2[34370]].area = 1;
--_walkDataLastIndex;
buildWalkPath(133, 123, 130, 107);
@@ -80,7 +80,7 @@ void IgorEngine::PART_25_ACTION_105_enterMensToilet() {
}
void IgorEngine::PART_25_ACTION_107_openDoor() {
- if (_objectsState[68] == 1) {
+ if (_objectsState[kMensRoomDoorStateIndex] == 1) {
EXEC_MAIN_ACTION(11);
return;
}
@@ -94,12 +94,12 @@ void IgorEngine::PART_25_ACTION_107_openDoor() {
waitForTimer(100);
}
}
- _objectsState[68] = 1;
+ _objectsState[kMensRoomDoorStateIndex] = 1;
PART_25_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_25_ACTION_108_closeDoor() {
- if (_objectsState[68] == 0) {
+ if (_objectsState[kMensRoomDoorStateIndex] == 0) {
EXEC_MAIN_ACTION(14);
return;
}
@@ -113,13 +113,13 @@ void IgorEngine::PART_25_ACTION_108_closeDoor() {
waitForTimer(100);
}
}
- _objectsState[68] = 0;
+ _objectsState[kMensRoomDoorStateIndex] = 0;
PART_25_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_25_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) { // door state
- if (_objectsState[68] == 0) {
+ if (_objectsState[kMensRoomDoorStateIndex] == 0) {
PART_25_HELPER_5_drawClosedDoor();
_roomActionsTable[31] = 6;
} else {
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index 8ba2aab06a0..cad2b2836cb 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -67,7 +67,7 @@ void IgorEngine::PART_26_EXEC_ACTION(int action) {
}
void IgorEngine::PART_26_ACTION_103_openDoor() {
- if (_objectsState[69] == 1) {
+ if (_objectsState[kLaboratoryDoorOpenStateIndex] == 1) {
EXEC_MAIN_ACTION(11);
return;
}
@@ -80,12 +80,12 @@ void IgorEngine::PART_26_ACTION_103_openDoor() {
waitForTimer(100);
}
}
- _objectsState[69] = 1;
+ _objectsState[kLaboratoryDoorOpenStateIndex] = 1;
PART_26_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_26_ACTION_104_closeDoor() {
- if (_objectsState[69] == 0) {
+ if (_objectsState[kLaboratoryDoorOpenStateIndex] == 0) {
EXEC_MAIN_ACTION(14);
return;
}
@@ -98,12 +98,12 @@ void IgorEngine::PART_26_ACTION_104_closeDoor() {
waitForTimer(100);
}
}
- _objectsState[69] = 0;
+ _objectsState[kLaboratoryDoorOpenStateIndex] = 0;
PART_26_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_26_ACTION_107() {
- if (_objectsState[69] != 0) {
+ if (_objectsState[kLaboratoryDoorOpenStateIndex] != 0) {
_roomObjectAreasTable[_screenLayer2[36800]].area = 1;
--_walkDataLastIndex;
buildWalkPath(62, 127, 0, 115);
@@ -139,7 +139,7 @@ void IgorEngine::PART_26_UPDATE_ROOM_BACKGROUND() {
void IgorEngine::PART_26_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- if (_objectsState[69] == 0) {
+ if (_objectsState[kLaboratoryDoorOpenStateIndex] == 0) {
PART_26_HELPER_2_drawClosedDoor();
_roomActionsTable[0x1E] = 6;
} else {
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index b26d59e58fd..5f56cfa2c74 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -29,9 +29,9 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
_currentPart = 211;
break;
case 102: // look at lockers
- if (_objectsState[85] == 0) {
+ if (_objectsState[kLockersExaminedStateIndex] == 0) {
igorSay(216, 2, 1173);
- _objectsState[85] = 1;
+ _objectsState[kLockersExaminedStateIndex] = 1;
PART_27_HELPER_1_OBJECT_STATE(255);
} else {
igorSay(201, 1, 1162);
@@ -77,17 +77,17 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
}
void IgorEngine::PART_27_ACTION_106_openPhilipLocker() {
- if (_objectsState[84] == 1) {
+ if (_objectsState[kPhillipLockerStateIndex] == 1) {
EXEC_MAIN_ACTION(11);
return;
}
- if (_objectsState[5] == 0) {
+ if (_objectsState[kPhillipLockerCombinationLearnedStateIndex] == 0) {
igorSay(206, 1, 1166);
return;
}
- if (_objectsState[5] == 1) {
+ if (_objectsState[kPhillipLockerCombinationLearnedStateIndex] == 1) {
igorSayAndWait(209, 3, 1169);
- _objectsState[5] = 2;
+ _objectsState[kPhillipLockerCombinationLearnedStateIndex] = 2;
}
const int offset = 21810;
for (int i = 2; i <= 3; ++i) {
@@ -99,12 +99,12 @@ void IgorEngine::PART_27_ACTION_106_openPhilipLocker() {
waitForTimer(100);
}
}
- _objectsState[84] = 1;
+ _objectsState[kPhillipLockerStateIndex] = 1;
PART_27_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_27_ACTION_107_closeLocker() {
- if (_objectsState[84] == 0) {
+ if (_objectsState[kPhillipLockerStateIndex] == 0) {
EXEC_MAIN_ACTION(14);
return;
}
@@ -116,12 +116,12 @@ void IgorEngine::PART_27_ACTION_107_closeLocker() {
waitForTimer(100);
}
}
- _objectsState[84] = 0;
+ _objectsState[kPhillipLockerStateIndex] = 0;
PART_27_HELPER_1_OBJECT_STATE(1);
}
void IgorEngine::PART_27_ACTION_108_openLocker() {
- if (_inventoryInfo[58] > 0 || _objectsState[42] == 2) {
+ if (_inventoryInfo[58] > 0 || _objectsState[kButterflyNetStateIndex] == 2) {
igorSay(208, 1, 1168);
return;
}
@@ -151,7 +151,7 @@ void IgorEngine::PART_27_ACTION_110_useFlaskOnLocker() {
}
removeObjectFromInventory(55);
PART_27_HELPER_1_OBJECT_STATE(255);
- _objectsState[107] = 1;
+ _objectsState[kFlaskLeftInPhillipLockerStateIndex] = 1;
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
@@ -159,7 +159,7 @@ void IgorEngine::PART_27_ACTION_110_useFlaskOnLocker() {
void IgorEngine::PART_27_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- if (_objectsState[84] == 0) {
+ if (_objectsState[kPhillipLockerStateIndex] == 0) {
PART_27_HELPER_3_drawClosedLocker();
_roomActionsTable[3] = 6;
_roomObjectAreasTable[6].object = 3;
@@ -170,7 +170,7 @@ void IgorEngine::PART_27_HELPER_1_OBJECT_STATE(int num) {
}
}
if (num == 2 || num == 255) {
- if (_objectsState[85] == 0) {
+ if (_objectsState[kLockersExaminedStateIndex] == 0) {
_roomObjectAreasTable[5].object = 2;
_roomObjectAreasTable[6].object = 2;
} else {
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index e1313763ce2..29f006ac84f 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -42,7 +42,7 @@ void IgorEngine::PART_28_EXEC_ACTION(int action) {
igorSay(204, 1, 1229);
break;
case 106: // look at message board
- if (_objectsState[111] == 0) {
+ if (_objectsState[kExamCompletedStateIndex] == 0) {
igorSay({ { 205, 1, 1230 }, { 206, 1, 1231 } });
} else {
igorSay(234, 1, 1253);
@@ -61,7 +61,7 @@ void IgorEngine::PART_28_EXEC_ACTION(int action) {
igorSay({ { 228, 1, 1248 }, { 229, 1, 1249 } });
break;
case 111: // give folder to caroline
- if (_objectsState[3] == 0) {
+ if (_objectsState[kFolderSwappedStateIndex] == 0) {
igorSay(226, 1, 1246);
} else {
igorSay(227, 1, 1247);
@@ -83,7 +83,7 @@ void IgorEngine::PART_28_EXEC_ACTION(int action) {
// her own talking loops never run it, otherwise it fights the talking frames.
void IgorEngine::PART_28_ACTION_108_talkCaroline() {
const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
- if (_objectsState[111] == 1) {
+ if (_objectsState[kExamCompletedStateIndex] == 1) {
igorSayAndWait(218, 1, 1241);
_updateRoomBackground = 0;
cutsceneSayStart(182, 81, 63, 17, 17, { { 211, 1, 1235 }, { 212, 1, 1236 }, { 213, 2, 1237 }, { 215, 1, 1238 }, { 216, 1, 1239 } });
@@ -105,13 +105,13 @@ void IgorEngine::PART_28_ACTION_108_talkCaroline() {
igorSay(222, 2, 1244);
return;
}
- if (_objectsState[87] < 2) {
+ if (_objectsState[kCarolineFolderStateIndex] < 2) {
igorSayAndWait(207, 1, 1232);
} else {
igorSayAndWait(218, 1, 1241);
}
_updateRoomBackground = 0;
- if (_objectsState[87] < 2) {
+ if (_objectsState[kCarolineFolderStateIndex] < 2) {
cutsceneSayWithCallback(182, 81, 63, 17, 17, 208, 1, 1233, &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE);
} else {
cutsceneSayWithCallback(182, 81, 63, 17, 17, { { 219, 2, 1242 }, { 221, 1, 1243 } }, &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE);
@@ -128,7 +128,7 @@ void IgorEngine::PART_28_ACTION_109_takeFolder() {
}
}
addObjectToInventory(22, 57);
- _objectsState[87] = 1;
+ _objectsState[kCarolineFolderStateIndex] = 1;
PART_28_HELPER_1_OBJECT_STATE(255);
igorSay(230, 1, 1250);
if (_game.version == kIdEngDemo110) {
@@ -173,7 +173,7 @@ void IgorEngine::PART_28_UPDATE_ROOM_BACKGROUND() {
void IgorEngine::PART_28_HELPER_1_OBJECT_STATE(int num) {
WRITE_LE_UINT16(_roomActionsTable + 0x56, 42133);
if (num == 2 || num == 255) {
- if (_objectsState[87] == 0) {
+ if (_objectsState[kCarolineFolderStateIndex] == 0) {
PART_28_HELPER_8(1);
} else {
PART_28_HELPER_8(0);
@@ -289,8 +289,8 @@ void IgorEngine::PART_28() {
while ((_currentPart == 280 || _currentPart == 281) && !_gameStateLoaded) {
runPartLoop();
}
- if (!_gameStateLoaded && _objectsState[87] == 1) {
- _objectsState[87] = 2;
+ if (!_gameStateLoaded && _objectsState[kCarolineFolderStateIndex] == 1) {
+ _objectsState[kCarolineFolderStateIndex] = 2;
}
leavePartLoop();
if (!_gameStateLoaded)
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index 9d356447a39..0b4aca12aa8 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -88,7 +88,7 @@ void IgorEngine::PART_30_ACTION_104_goDownstairs() {
moveIgor(_walkData[0].posNum, _walkData[0].frameNum);
waitForTimer(15);
}
- _currentPart = (_objectsState[111] == 0) ? 171 : 771;
+ _currentPart = (_objectsState[kExamCompletedStateIndex] == 0) ? 171 : 771;
}
void IgorEngine::PART_30_UPDATE_DIALOGUE_LAURA(int action) {
@@ -228,7 +228,7 @@ void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
_currentAction.verb = kVerbWalk;
- _objectsState[73] = 1;
+ _objectsState[kLauraMetAtCollegeStateIndex] = 1;
PART_30_HELPER_1_OBJECT_STATE(255);
}
@@ -282,7 +282,7 @@ void IgorEngine::PART_30() {
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
- if (_objectsState[73] == 0) {
+ if (_objectsState[kLauraMetAtCollegeStateIndex] == 0) {
PART_30_HELPER_8_LauraCutscene();
} else {
if (_currentPart != 302) {
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index 4f9d7a92e27..c3d4a29fd1b 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -40,7 +40,7 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
PART_31_ACTION_103_openDoor();
break;
case 104:
- if (_objectsState[72] == 0) {
+ if (_objectsState[kAstronomyLabDoorStateIndex] == 0) {
EXEC_MAIN_ACTION(14);
} else {
igorSay(205, 1, 885);
@@ -89,7 +89,7 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
}
void IgorEngine::PART_31_ACTION_102_enterAstronomyLab() {
- if (_objectsState[72] == 0) {
+ if (_objectsState[kAstronomyLabDoorStateIndex] == 0) {
return;
}
_roomObjectAreasTable[_screenLayer2[33712]].area = 2;
@@ -111,7 +111,7 @@ void IgorEngine::PART_31_ACTION_102_enterAstronomyLab() {
}
void IgorEngine::PART_31_ACTION_103_openDoor() {
- if (_objectsState[72] == 1) {
+ if (_objectsState[kAstronomyLabDoorStateIndex] == 1) {
EXEC_MAIN_ACTION(11);
return;
}
@@ -156,7 +156,7 @@ void IgorEngine::PART_31_ACTION_106_goDownstairs() {
}
void IgorEngine::PART_31_ACTION_110_openDoor2() {
- if (_objectsState[72] == 1) {
+ if (_objectsState[kAstronomyLabDoorStateIndex] == 1) {
EXEC_MAIN_ACTION(11);
return;
}
@@ -171,7 +171,7 @@ void IgorEngine::PART_31_ACTION_110_openDoor2() {
waitForTimer(10);
}
}
- _objectsState[72] = 1;
+ _objectsState[kAstronomyLabDoorStateIndex] = 1;
PART_31_HELPER_1_OBJECT_STATE(1);
}
@@ -246,7 +246,7 @@ void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() {
void IgorEngine::PART_31_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- if (_objectsState[72] == 0) {
+ if (_objectsState[kAstronomyLabDoorStateIndex] == 0) {
_roomActionsTable[74] = 6;
} else {
PART_31_HELPER_9_drawOpenDoor();
diff --git a/engines/igor/parts/part_32.cpp b/engines/igor/parts/part_32.cpp
index efa0d4e899f..929c2cef487 100644
--- a/engines/igor/parts/part_32.cpp
+++ b/engines/igor/parts/part_32.cpp
@@ -175,15 +175,15 @@ void IgorEngine::PART_32_ACTION_103_useControls() {
memcpy(_paletteBuffer, _animFramesBuffer + 64000, 768);
fadeIn(768);
if (_part32Result == kPart32ResultTower) {
- if (_objectsState[78] == 0 && _objectsState[4] == 2) {
+ if (_objectsState[kBellTowerConversationSeenStateIndex] == 0 && _objectsState[kAstronomyBookStateIndex] == 2) {
igorSay(206, 3, 831);
- _objectsState[78] = 1;
+ _objectsState[kBellTowerConversationSeenStateIndex] = 1;
}
}
if (_part32Result == kPart32ResultFinal) {
- if (_objectsState[79] == 0) {
+ if (_objectsState[kFinalCoordinatesSceneSeenStateIndex] == 0) {
igorSay({ { 209, 1, 832 }, { 210, 1, 833 } });
- _objectsState[79] = 1;
+ _objectsState[kFinalCoordinatesSceneSeenStateIndex] = 1;
} else {
igorSay(211, 1, 834);
}
@@ -565,7 +565,7 @@ void IgorEngine::PART_32_SCENE() {
memset(_screenVGA, 0, 46080);
switch (_part32Result) {
case kPart32ResultTower:
- if (_objectsState[78] == 0 && _objectsState[4] == 2) {
+ if (_objectsState[kBellTowerConversationSeenStateIndex] == 0 && _objectsState[kAstronomyBookStateIndex] == 2) {
PART_32_SCENE_TOWER_CONVERSATION();
} else {
PART_32_SCENE_TOWER_EMPTY();
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index f95c4691937..0d086cca024 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -82,11 +82,11 @@ void IgorEngine::PART_33_EXEC_ACTION(int action) {
}
void IgorEngine::PART_33_ACTION_109_takeAstronomyBooks() {
- if (_objectsState[4] == 0) {
+ if (_objectsState[kAstronomyBookStateIndex] == 0) {
igorSay(201, 1, 396);
return;
}
- if (_objectsState[74] == 1) {
+ if (_objectsState[kAstronomyBookTakenStateIndex] == 1) {
igorSay(222, 1, 413);
return;
}
@@ -97,13 +97,13 @@ void IgorEngine::PART_33_ACTION_109_takeAstronomyBooks() {
waitForTimer(120);
}
addObjectToInventory(31, 66);
- _objectsState[74] = 1;
+ _objectsState[kAstronomyBookTakenStateIndex] = 1;
PART_33_HELPER_1_OBJECTS_STATE(255);
igorSayAndWait({ { 210, 1, 405 }, { 211, 2, 406 } });
}
void IgorEngine::PART_33_ACTION_111_talkToHarrison() {
- if (_objectsState[75] == 1) {
+ if (_objectsState[kHarrisonPhotoStateIndex] == 1) {
PART_33_HELPER_9_loadExtraTexts();
PART_33_HELPER_1_OBJECTS_STATE(255);
igorSayAndWait(201, 1, 447);
@@ -161,7 +161,7 @@ void IgorEngine::PART_33_ACTION_114_showPhotoToHarrison() {
addObjectToInventory(35, 70);
PART_33_HELPER_1_OBJECTS_STATE(255);
PART_33_HarrisonSay({ { 233, 2, 422 } });
- _objectsState[75] = 1;
+ _objectsState[kHarrisonPhotoStateIndex] = 1;
}
void IgorEngine::PART_33_ACTION_115_giveNoteToHarrison() {
@@ -182,7 +182,7 @@ void IgorEngine::PART_33_ACTION_115_giveNoteToHarrison() {
copyArea(_screenVGA, offset, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
PART_33_HarrisonSay({ { 219, 1, 410 } });
copyArea(_screenVGA, offset, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
- _objectsState[76] = 1;
+ _objectsState[kHarrisonNoteShownStateIndex] = 1;
}
// The room's idle animation of Harrison is only driven by the room loop; the
@@ -241,7 +241,7 @@ void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_3(int action) {
}
void IgorEngine::PART_33_UPDATE_ROOM_BACKGROUND() {
- if (compareGameTick(61) && _objectsState[75] != 2) {
+ if (compareGameTick(61) && _objectsState[kHarrisonPhotoStateIndex] != 2) {
PART_33_HELPER_5_drawHarrisonHeadFrame(_gameState.unk10);
_gameState.unk10 = getRandomNumber(3) + 1;
if (_gameState.unk10 >= 1 && _gameState.unk10 <= 2) {
@@ -255,7 +255,7 @@ void IgorEngine::PART_33_UPDATE_ROOM_BACKGROUND() {
void IgorEngine::PART_33_HELPER_1_OBJECTS_STATE(int num) {
if (num == 2 || num == 255) {
// is harrison here or not
- if (_objectsState[75] <= 1) {
+ if (_objectsState[kHarrisonPhotoStateIndex] <= 1) {
PART_33_HELPER_3_drawHarrisonFrame();
} else {
_roomObjectAreasTable[27].object = 0;
@@ -375,9 +375,9 @@ void IgorEngine::PART_33() {
}
leavePartLoop();
if (!_gameStateLoaded) {
- if (_objectsState[75] == 1) {
+ if (_objectsState[kHarrisonPhotoStateIndex] == 1) {
// harrison leaves
- _objectsState[75] = 2;
+ _objectsState[kHarrisonPhotoStateIndex] = 2;
}
fadeOut(624);
}
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index b32e46644a5..c8519a965ee 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -179,7 +179,7 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
break;
case 102: // look at tree
igorSay(203, 2, 563);
- _objectsState[82] = 1;
+ _objectsState[kTreeResinDiscoveredStateIndex] = 1;
PART_34_APPLY_OBJECT_STATE(3);
break;
case 103:
@@ -235,7 +235,7 @@ void IgorEngine::PART_34_ACTION_108_giveLizardToOldLady() {
PARK_DRAW_drawOldLadyFrame(_screenVGA, frame);
waitForTimer(45);
}
- if (_objectsState[1] == 0) {
+ if (_objectsState[kLizardFedStateIndex] == 0) {
cutsceneSayStart(121, 58, 63, 23, 0, { { 213, 1, 569 }, { 216, 1, 570 } });
PARK_WAIT_FOR_LADY_DIALOGUE();
for (int frame = 14; frame >= 12; --frame) {
@@ -275,7 +275,7 @@ void IgorEngine::PART_34_ACTION_108_giveLizardToOldLady() {
PARK_DRAW_drawOldLadyFrame(_screenVGA, frame);
waitForTimer(30);
}
- _objectsState[80] = 1;
+ _objectsState[kLizardGivenStateIndex] = 1;
PART_34_LAURA_CONVERSATION();
@@ -290,7 +290,7 @@ void IgorEngine::PART_34_ACTION_108_giveLizardToOldLady() {
void IgorEngine::PART_34_OLD_LADY_CONVERSATION() {
_roomDataOffsets.dlg = kOldLadyDialogueData;
loadDialogueData(DLG_ParkLady);
- if (_objectsState[81] == 0) {
+ if (_objectsState[kOldLadyConversationSeenStateIndex] == 0) {
memset(_screenVGA + 46080, 0, 17920);
}
int textIndex = 250;
@@ -298,7 +298,7 @@ void IgorEngine::PART_34_OLD_LADY_CONVERSATION() {
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(160, 58, 63, 63, 63);
PARK_WAIT_FOR_IGOR_DIALOGUE();
- if (_objectsState[81] == 0) {
+ if (_objectsState[kOldLadyConversationSeenStateIndex] == 0) {
textIndex = 250;
PARK_QUEUE_REPLY_TEXT(2, 1, 585, textIndex);
PARK_QUEUE_REPLY_TEXT(3, 1, 586, textIndex);
@@ -314,12 +314,12 @@ void IgorEngine::PART_34_OLD_LADY_CONVERSATION() {
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(121, 68, 63, 23, 0);
PARK_WAIT_FOR_LADY_DIALOGUE();
- if (_objectsState[81] == 0) {
+ if (_objectsState[kOldLadyConversationSeenStateIndex] == 0) {
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
_currentAction.verb = kVerbWalk;
- _objectsState[81] = 1;
+ _objectsState[kOldLadyConversationSeenStateIndex] = 1;
}
_roomDataOffsets.dlg = kNoDialogueData;
}
@@ -431,14 +431,14 @@ void IgorEngine::PART_34_ACTION_109_scrollRight() {
*/
void IgorEngine::PART_34_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- if (_objectsState[80] == 0 && _objectsState[73] == 1) {
+ if (_objectsState[kLizardGivenStateIndex] == 0 && _objectsState[kLauraMetAtCollegeStateIndex] == 1) {
PARK_DRAW_drawOldLadyFrame(_screenLayer1, 1);
} else {
_roomObjectAreasTable[5].object = 0;
}
}
if (num == 3 || num == 255) {
- _roomObjectAreasTable[4].object = (_objectsState[82] == 0) ? 2 : 3;
+ _roomObjectAreasTable[4].object = (_objectsState[kTreeResinDiscoveredStateIndex] == 0) ? 2 : 3;
}
}
@@ -448,7 +448,7 @@ void IgorEngine::PART_34_oldLadyIdleAnimationFrame(int step) {
void IgorEngine::PART_34_UPDATE_ROOM_BACKGROUND() {
PARK_UPDATE_AMBIENT_SOUND();
- if (compareGameTick(61) && _objectsState[80] == 0 && _objectsState[73] == 1 && getRandomNumber(4) == 0) {
+ if (compareGameTick(61) && _objectsState[kLizardGivenStateIndex] == 0 && _objectsState[kLauraMetAtCollegeStateIndex] == 1 && getRandomNumber(4) == 0) {
PART_34_oldLadyIdleAnimationFrame(_parkLadyIdleStep);
_parkLadyIdleStep = (_parkLadyIdleStep == 6) ? 1 : _parkLadyIdleStep + 1;
}
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index 793764165bf..424046a6cc8 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -29,7 +29,7 @@ void IgorEngine::PART_35_EXEC_ACTION(int action) {
switch (action) {
case 101: // look at tree
igorSay(201, 2, 611);
- _objectsState[82] = 1;
+ _objectsState[kTreeResinDiscoveredStateIndex] = 1;
PART_35_APPLY_OBJECT_STATE(3);
break;
case 102: // take resin
@@ -117,7 +117,7 @@ void IgorEngine::PART_35_ACTION_106_exitToMap() {
void IgorEngine::PART_35_APPLY_OBJECT_STATE(int num) {
if (num == 3 || num == 255) {// disable hotspot if resin taken
- _roomObjectAreasTable[7].object = (_objectsState[82] == 0) ? 1 : 2;
+ _roomObjectAreasTable[7].object = (_objectsState[kTreeResinDiscoveredStateIndex] == 0) ? 1 : 2;
}
}
@@ -128,7 +128,7 @@ void IgorEngine::PART_35() {
loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // left panel
static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
loadAnimData(frames, kParkFrames);
- if (_objectsState[80] == 0 && _objectsState[73] == 1) {
+ if (_objectsState[kLizardGivenStateIndex] == 0 && _objectsState[kLauraMetAtCollegeStateIndex] == 1) {
PARK_DRAW_drawOldLadyFrame(_screenLayer1, 1);
}
copyArea(_animFramesBuffer, 0, 160, _screenLayer1, 320, 160, 144);
diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp
index 4d39ba98147..b4d343bf911 100644
--- a/engines/igor/parts/part_36.cpp
+++ b/engines/igor/parts/part_36.cpp
@@ -84,7 +84,7 @@ void IgorEngine::PART_36_ACTION_102_takePen() {
waitForTimer(45);
}
addObjectToInventory(30, 65);
- _objectsState[88] = 1;
+ _objectsState[kPenTakenStateIndex] = 1;
PART_36_HELPER_1_OBJECT_STATE(255);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
@@ -93,7 +93,7 @@ void IgorEngine::PART_36_ACTION_102_takePen() {
void IgorEngine::PART_36_HELPER_1_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- if (_objectsState[88] == 0) {
+ if (_objectsState[kPenTakenStateIndex] == 0) {
PART_36_HELPER_4_drawPen(1);
} else {
PART_36_HELPER_4_drawPen(0);
diff --git a/engines/igor/parts/part_37.cpp b/engines/igor/parts/part_37.cpp
index ee2c44fcef8..b403d5754ae 100644
--- a/engines/igor/parts/part_37.cpp
+++ b/engines/igor/parts/part_37.cpp
@@ -51,7 +51,7 @@ void IgorEngine::PART_37_EXEC_ACTION(int action) {
}
void IgorEngine::PART_37_ACTION_102_lookAtPaperBinTakePaper() {
- if (_objectsState[89] == 1) {
+ if (_objectsState[kPhysicsClassPaperTakenStateIndex] == 1) {
igorSay(202, 1, 663);
return;
}
@@ -62,7 +62,7 @@ void IgorEngine::PART_37_ACTION_102_lookAtPaperBinTakePaper() {
waitForTimer(60);
}
addObjectToInventory(32, 67);
- _objectsState[89] = 1;
+ _objectsState[kPhysicsClassPaperTakenStateIndex] = 1;
PART_37_HELPER_1_OBJECT_STATE(255);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index a73efd8c600..d0e8413ba77 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -38,7 +38,7 @@ void IgorEngine::PART_04_EXEC_ACTION(int action) {
_currentPart = 100;
break;
case 105:
- if (_objectsState[111] == 0) {
+ if (_objectsState[kExamCompletedStateIndex] == 0) {
// college entrance
_currentPart = 170;
} else {
@@ -61,14 +61,14 @@ void IgorEngine::PART_04_EXEC_ACTION(int action) {
* */
void IgorEngine::PART_04() {
- if (_objectsState[106] == 1) { // police custcene
+ if (_objectsState[kStatuetteTaken2StateIndex] == 1) { // police custcene
_currentPart = 730;
return;
}
// if philip has drunk the chemical, trigger the cutscene
- if (_objectsState[107] == 1) {
- _objectsState[107] = 0;
+ if (_objectsState[kFlaskLeftInPhillipLockerStateIndex] == 1) {
+ _objectsState[kFlaskLeftInPhillipLockerStateIndex] = 0;
_currentPart = 750;
return;
}
@@ -79,7 +79,7 @@ void IgorEngine::PART_04() {
SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_04_EXEC_ACTION);
// closes Philips locker
- _objectsState[84] = 0;
+ _objectsState[kPhillipLockerStateIndex] = 0;
memcpy(_screenVGA, _screenLayer1, 46080);
playMusic(1);
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index 77826fe8688..d6909b8cd85 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -53,7 +53,7 @@ namespace Igor {
void IgorEngine::PART_05_HELPER_4_drawPaperOrNot(int num) {
- if (_objectsState[60] == 0) {
+ if (_objectsState[kSpringBridgePaperStateIndex] == 0) {
// paper not taken, paint "frame 0"
PART_05_06_drawPaperFrame(0);
return;
@@ -122,14 +122,14 @@ void IgorEngine::PART_05() {
loadAnimData(anm4, 0xA763);
// Draws photographer and objects before copying the screenLayer
- if (_objectsState[61] != 0) {
+ if (_objectsState[kPhotographerGoneStateIndex] != 0) {
PART_05_06_SAVE_PHOTOGRAPHER_BACKGROUND();
PART_05_06_DRAW_PHOTOGRAPHER();
}
- if (_objectsState[63] != 0) {
+ if (_objectsState[kCameraStateIndex] != 0) {
PART_05_06_DRAW_TRIPOD(false);
}
- if (_objectsState[62] != 0) {
+ if (_objectsState[kTripodStateIndex] != 0) {
PART_05_06_DRAW_CAMERA(0);
}
@@ -173,8 +173,8 @@ void IgorEngine::PART_05() {
} else if (_currentPart == 255) {
fadeOut(768);
} else if (_currentPart != 60) {
- if (_objectsState[63] == 0) {
- _objectsState[61] = _objectsState[62] = _objectsState[63] = 1;
+ if (_objectsState[kCameraStateIndex] == 0) {
+ _objectsState[kPhotographerGoneStateIndex] = _objectsState[kTripodStateIndex] = _objectsState[kCameraStateIndex] = 1;
}
memcpy(_currentPalette, _paletteBuffer, 624);
fadeOut(624);
@@ -194,7 +194,7 @@ void IgorEngine::PART_05_ACTION_103_pickPaper() {
waitForTimer();
} while (i != 3);
addObjectToInventory(21, 56);
- _objectsState[60] = 1;
+ _objectsState[kSpringBridgePaperStateIndex] = 1;
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
diff --git a/engines/igor/parts/part_50.cpp b/engines/igor/parts/part_50.cpp
index 0fb777cd526..bbae4cfe87f 100644
--- a/engines/igor/parts/part_50.cpp
+++ b/engines/igor/parts/part_50.cpp
@@ -40,7 +40,7 @@ void IgorEngine::PART_50_EXEC_ACTION(int action) {
igorSay(201, 1, 1083);
break;
case 103:
- _objectsState[90] = 0;
+ _objectsState[kCemeteryEntrySideStateIndex] = 0;
_currentPart = 700;
break;
default:
@@ -58,7 +58,7 @@ void IgorEngine::PART_50_ACTION_101_enterMaze() {
_gameState.igorMoving = true;
waitForIgorMove();
_currentPart = 663;
- _objectsState[71] = 1;
+ _objectsState[kMazeEntryDirectionStateIndex] = 1;
}
void IgorEngine::PART_50_enterFromDoor() {
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index 7c1234f76e2..b1c5b6e2488 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -136,7 +136,7 @@ void IgorEngine::PART_06_HELPER_7_decodePhotographerTalkingFrame(int frame) {
void IgorEngine::PART_06_HELPER_6_setPhotographerState(int num) {
if (num == 2 || num == 255) {
- if (_objectsState[61] == 1) {
+ if (_objectsState[kPhotographerGoneStateIndex] == 1) {
PART_05_06_DRAW_PHOTOGRAPHER();
_roomObjectAreasTable[3].object = 0;
_roomObjectAreasTable[13].area = 0;
@@ -157,7 +157,7 @@ void IgorEngine::PART_06_HELPER_6_setPhotographerState(int num) {
}
}
if (num == 3 || num == 255) {
- if (_objectsState[62] == 1) {
+ if (_objectsState[kTripodStateIndex] == 1) {
PART_05_06_DRAW_CAMERA(0);
} else {
PART_05_06_DRAW_CAMERA(1);
@@ -182,7 +182,7 @@ void IgorEngine::PART_06_ACTION_105_pickCamera() {
waitForTimer();
} while (i != 3);
addObjectToInventory(36, 71);
- _objectsState[62] = 0;
+ _objectsState[kTripodStateIndex] = 0;
PART_06_HELPER_6_setPhotographerState(255);
}
@@ -214,7 +214,7 @@ void IgorEngine::PART_06_ACTION_108_giveRocketToPhotographer() {
} while (i != 28);
// removes rocket
removeObjectFromInventory(61);
- _objectsState[61] = 0;
+ _objectsState[kPhotographerGoneStateIndex] = 0;
PART_06_HELPER_6_setPhotographerState(255);
_gameState.unkF = false;
igorSay(213, 2, 488);
@@ -284,7 +284,7 @@ void IgorEngine::PART_06() {
static const int anm1[] = {FRM_SpringBridge1, FRM_SpringBridge2, 0};
// loads from offset 32256
loadAnimData(anm1, 0x7E00);
- if (_objectsState[60] == 0) {
+ if (_objectsState[kSpringBridgePaperStateIndex] == 0) {
PART_05_06_drawPaperFrame(0);
}
// copying a patch of 224 pixels width and 144 height into the backup buffer for later scroll
@@ -307,7 +307,7 @@ void IgorEngine::PART_06() {
_updateRoomBackground = &IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND;
PART_06_HELPER_6_setPhotographerState(255);
- if (_objectsState[63] == 1) {
+ if (_objectsState[kCameraStateIndex] == 1) {
PART_05_06_DRAW_TRIPOD(true);
}
@@ -323,14 +323,14 @@ void IgorEngine::PART_06() {
loadActionData(DAT_SpringBridge);
_roomDataOffsets = PART_06_ROOM_DATA_OFFSETS;
if (!restoreRoomAfterLoad()) {
- _gameState.unkF = (_objectsState[61] == 1);
+ _gameState.unkF = (_objectsState[kPhotographerGoneStateIndex] == 1);
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
enterPartLoop();
}
while (_currentPart >= 60 && _currentPart <= 61 && !_gameStateLoaded) {
- setRoomWalkBounds(0, 0, _objectsState[61] == 0 ? 234 : 142, 143);
+ setRoomWalkBounds(0, 0, _objectsState[kPhotographerGoneStateIndex] == 0 ? 234 : 142, 143);
handleRoomInput();
if (_gameStateLoaded)
break;
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 2ff4f5e4399..f9d9562cd82 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -62,14 +62,6 @@ static const int kPart68TextR = 63;
static const int kPart68TextG = 50;
static const int kPart68TextB = 0;
-// Flags of the story kept in the objects state.
-static const int kPart68SideState = 90;
-static const int kPart68VaseTaken = 91;
-static const int kPart68UndertakerLeft = 92;
-static const int kPart68RecordsGiven = 93;
-static const int kPart68BorisIntroduced = 94;
-static const int kPart68MessageSent = 104;
-
// Inventory objects.
static const int kVaseInventoryNumber = 34;
static const int kPart68TakenObjectIndex = 69;
@@ -105,7 +97,7 @@ void IgorEngine::PART_68_drawPose(int frame) {
void IgorEngine::PART_68_APPLY_OBJECT_STATE(int num) {
if (num == 3 || num == 255) {
// undertaker is still in the room
- if (_objectsState[kPart68UndertakerLeft] == 0) {
+ if (_objectsState[kUndertakerLeftStateIndex] == 0) {
PART_68_drawUndertaker(0);
for (int i = 0; i < MAX_ROOM_OBJECT_AREAS; ++i) {
if (_roomObjectAreasTable[i].area >= 3 && _roomObjectAreasTable[i].area <= 4) {
@@ -130,7 +122,7 @@ void IgorEngine::PART_68_APPLY_OBJECT_STATE(int num) {
}
}
if (num == 2 || num == 255) {
- if (_objectsState[kPart68VaseTaken] == 0) {
+ if (_objectsState[kVaseTakenStateIndex] == 0) {
PART_68_drawVase(0);
} else {
PART_68_drawVase(1);
@@ -265,7 +257,7 @@ void IgorEngine::PART_68_enterFromCemetery() {
void IgorEngine::PART_68_ACTION_102_takeVase() {
// will only let us take the vase if the records have been given to him
- if (_objectsState[kPart68RecordsGiven] == 0) {
+ if (_objectsState[kRecordGivenToUndertakerStateIndex] == 0) {
PART_68_drawPose(0);
PART_68_drawUndertaker(kPart68BorisFacing);
waitForTimer(30);
@@ -289,7 +281,7 @@ void IgorEngine::PART_68_ACTION_102_takeVase() {
waitForTimer(120);
}
addObjectToInventory(kVaseInventoryNumber, kPart68TakenObjectIndex);
- _objectsState[kPart68VaseTaken] = 1;
+ _objectsState[kVaseTakenStateIndex] = 1;
PART_68_APPLY_OBJECT_STATE(255);
}
@@ -314,7 +306,7 @@ void IgorEngine::PART_68_ACTION_108_giveRecordsToBoris() {
PART_68_sayBoris({ { 219, 1, 1024 }, { 220, 1, 1025 }, { 221, 1, 1026 }, { 222, 1, 1027 } });
PART_68_drawUndertaker(kPart68BorisFacing);
waitForTimer(30);
- _objectsState[kPart68RecordsGiven] = 1;
+ _objectsState[kRecordGivenToUndertakerStateIndex] = 1;
PART_68_APPLY_OBJECT_STATE(255);
}
@@ -324,7 +316,7 @@ void IgorEngine::PART_68_ACTION_108_giveRecordsToBoris() {
void IgorEngine::PART_68_chooseRandomNames(int code) {
uint8 *data = _gameState.dialogueData;
if (code == 10) {
- const int entries = _objectsState[kPart68MessageSent] == 1 ? 4 : 5;
+ const int entries = _objectsState[kLighthouseMessageSentStateIndex] == 1 ? 4 : 5;
for (int i = 1; i <= entries; ++i) {
data[27 + 6 * i] = _part68QuestionCounter;
++_part68QuestionCounter;
@@ -332,7 +324,7 @@ void IgorEngine::PART_68_chooseRandomNames(int code) {
_part68QuestionCounter = 1;
}
}
- if (_objectsState[kPart68MessageSent] == 1) {
+ if (_objectsState[kLighthouseMessageSentStateIndex] == 1) {
data[57] = 20;
data[58] = 55;
data[56] = 0;
@@ -370,12 +362,12 @@ void IgorEngine::PART_68_CONVERSATION() {
_gameState.dialogueChoiceStart = 1;
_gameState.dialogueChoiceCount = 1;
// boris says different greeting depending if its the first time or not
- if (_objectsState[kPart68BorisIntroduced] == 0) {
+ if (_objectsState[kBorisIntroducedStateIndex] == 0) {
igorSayAndWait(225, 1, 1029);
static const int replies[4] = { 1, 2, 3, 4 };
static const int sounds[4] = { 1051, 1052, 1053, 1054 };
PART_68_BorisSayReplies(replies, sounds, 4);
- _objectsState[kPart68BorisIntroduced] = 1;
+ _objectsState[kBorisIntroducedStateIndex] = 1;
} else {
igorSayAndWait(226, 1, 1030);
static const int replies[4] = { 5, 6, 7, 8 };
@@ -429,7 +421,7 @@ void IgorEngine::PART_68_CONVERSATION() {
static const int sounds[4] = { 1079, 1080, 1081, 1082 };
PART_68_BorisSayReplies(replies, sounds, 4);
PART_68_BorisLeaves();
- _objectsState[kPart68UndertakerLeft] = 2;
+ _objectsState[kUndertakerLeftStateIndex] = 2;
}
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
@@ -442,14 +434,14 @@ void IgorEngine::PART_68_CONVERSATION() {
void IgorEngine::PART_68_ACTION_104_talkToBoris() {
PART_68_CONVERSATION();
- if (_objectsState[kPart68UndertakerLeft] == 2) {
- _objectsState[kPart68UndertakerLeft] = 1;
+ if (_objectsState[kUndertakerLeftStateIndex] == 2) {
+ _objectsState[kUndertakerLeftStateIndex] = 1;
PART_68_APPLY_OBJECT_STATE(255);
}
}
void IgorEngine::PART_68_ACTION_106_enterCemetery() {
- if (_objectsState[kPart68UndertakerLeft] == 0) {
+ if (_objectsState[kUndertakerLeftStateIndex] == 0) {
igorSayAndWait(223, 2, 1028);
PART_68_ACTION_104_talkToBoris();
} else {
@@ -460,7 +452,7 @@ void IgorEngine::PART_68_ACTION_106_enterCemetery() {
void IgorEngine::PART_68_EXEC_ACTION(int action) {
switch (action) {
case 101: // exit through either side will cause next entry to be that side
- _objectsState[kPart68SideState] = 1;
+ _objectsState[kCemeteryEntrySideStateIndex] = 1;
_currentPart = 700;
break;
case 102: // take vase
@@ -482,7 +474,7 @@ void IgorEngine::PART_68_EXEC_ACTION(int action) {
PART_68_ACTION_108_giveRecordsToBoris();
break;
case 109:
- _objectsState[kPart68SideState] = 0;
+ _objectsState[kCemeteryEntrySideStateIndex] = 0;
_currentPart = 700;
break;
default:
@@ -512,7 +504,7 @@ void IgorEngine::PART_68() {
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 680) {
- if (_objectsState[kPart68SideState] == 0) {
+ if (_objectsState[kCemeteryEntrySideStateIndex] == 0) {
PART_68_enterFromRight();
} else {
PART_68_enterFromLeft();
diff --git a/engines/igor/parts/part_69.cpp b/engines/igor/parts/part_69.cpp
index 666513750de..b2ad45cbfa8 100644
--- a/engines/igor/parts/part_69.cpp
+++ b/engines/igor/parts/part_69.cpp
@@ -45,13 +45,6 @@ static const int kPart69PictureHeight = 49;
static const int kPart69EntryY = 130;
static const int kPart69EntryDstX = 259;
-// objectsState
-static const int kPart69SceneDoneState = 96;
-static const int kPart69FlagState = 97;
-static const int kPart69SequenceState = 98;
-static const int kPart69SecondFireflyState = 99;
-static const int kPart69VaseState = 6;
-
// The animation of the two fireflies is a sequence of steps (1 to 6). Each step plays the frames of the first firefly from
// the first to the last frame of the step; every 5 steps of the first firefly the second firefly plays too. The values come
// from the data segment of the executable (index 0 is not used).
@@ -83,7 +76,7 @@ void IgorEngine::PART_69_EXEC_ACTION(int action) {
break;
case 103:
igorSay({ { 203, 2, 1085 }, { 205, 1, 1086 } });
- _objectsState[kPart69FlagState] = 1;
+ _objectsState[kPart69LeaderFireflyIdentifiedStateIndex] = 1;
break;
case 104:
igorSay(206, 2, 1087);
@@ -110,7 +103,7 @@ void IgorEngine::PART_69_EXEC_ACTION(int action) {
* Once the scene is over the places of the fireflies are not objects anymore.
*/
void IgorEngine::PART_69_APPLY_OBJECT_STATE() {
- if (_objectsState[kPart69SceneDoneState] != 1) {
+ if (_objectsState[kPart69FireflyCapturedStateIndex] != 1) {
return;
}
for (int i = 1; i <= 3; ++i) {
@@ -140,11 +133,11 @@ void IgorEngine::PART_69_animateFireflies() {
if (!compareGameTick(13, 16)) {
return;
}
- if (_objectsState[kPart69SceneDoneState] != 0) {
+ if (_objectsState[kPart69FireflyCapturedStateIndex] != 0) {
return;
}
- uint8 &sequence = _objectsState[kPart69SequenceState];
- uint8 &secondFirefly = _objectsState[kPart69SecondFireflyState];
+ uint8 &sequence = _objectsState[kPart69SwarmAnimationPhaseStateIndex];
+ uint8 &secondFirefly = _objectsState[kPart69LeaderFireflyPathStateIndex];
if (_part69FireflyStepCount == 5) {
secondFirefly = sequence;
_part69FireflyFrameB = kPart69StepFirstFireflyFrameB[secondFirefly];
@@ -185,7 +178,7 @@ void IgorEngine::PART_69_animateFireflies() {
}
} else {
for (int i = 1; i <= 3; ++i) {
- const bool answers = kPart69StepNext[sequence] == i && _objectsState[kPart69FlagState] == 1;
+ const bool answers = kPart69StepNext[sequence] == i && _objectsState[kPart69LeaderFireflyIdentifiedStateIndex] == 1;
_roomObjectAreasTable[kPart69SecondFireflyAreas[i]].object = answers ? 4 : 5;
}
}
@@ -206,7 +199,7 @@ void IgorEngine::PART_69_FINALE(int num, int sound) {
*/
void IgorEngine::PART_69_ACTION_107_watch() {
drawAnimRect(kPart69PictureOffset, kPart69PictureAnimOffset, kPart69PictureWidth, kPart69PictureHeight);
- if (_objectsState[kPart69VaseState] == 0) {
+ if (_objectsState[kVaseStateIndex] == 0) {
for (int i = 0; i < 1000 / kTimerTicksCount && !_eventQuitGame; ++i) {
PART_69_animateFireflies();
waitForTimer();
@@ -218,7 +211,7 @@ void IgorEngine::PART_69_ACTION_107_watch() {
do {
PART_69_animateFireflies();
waitForTimer();
- } while (!(_objectsState[kPart69SequenceState] == 3 && _objectsState[kPart69SecondFireflyState] == 0) && !_eventQuitGame);
+ } while (!(_objectsState[kPart69SwarmAnimationPhaseStateIndex] == 3 && _objectsState[kPart69LeaderFireflyPathStateIndex] == 0) && !_eventQuitGame);
uint8 frameC = 1;
do {
@@ -243,8 +236,8 @@ void IgorEngine::PART_69_ACTION_107_watch() {
} while (_part69FireflyFrameA != kPart69EndingFrameLast && !_eventQuitGame);
waitForTimer(255);
- _objectsState[kPart69SceneDoneState] = 1;
- _objectsState[kPart69VaseState] = 2;
+ _objectsState[kPart69FireflyCapturedStateIndex] = 1;
+ _objectsState[kVaseStateIndex] = 2;
UPDATE_OBJECT_STATE(7);
drawInventory(_inventoryInfo[72], 0);
playSound(63, 1);
@@ -313,14 +306,14 @@ void IgorEngine::PART_69() {
_updateRoomBackground = &IgorEngine::PART_69_UPDATE_ROOM_BACKGROUND;
PART_69_APPLY_OBJECT_STATE();
memcpy(_screenVGA, _screenLayer1, 46080);
- if (_objectsState[kPart69SceneDoneState] == 0) {
+ if (_objectsState[kPart69FireflyCapturedStateIndex] == 0) {
PART_69_DRAW_FIREFLY_A(kPart69FirstFireflyFrameA);
PART_69_DRAW_FIREFLY_B(kPart69FirstFireflyFrameB);
}
_part69FireflyStepCount = 0;
_part69FireflyFrameB = 0;
- _objectsState[kPart69SequenceState] = 1;
- _objectsState[kPart69SecondFireflyState] = 0;
+ _objectsState[kPart69SwarmAnimationPhaseStateIndex] = 1;
+ _objectsState[kPart69LeaderFireflyPathStateIndex] = 0;
_part69FireflyFrameA = kPart69FirstFireflyFrameA;
// the whole picture is darker than its palette
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index 7ecbd276084..cf1f87b444e 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -18,19 +18,19 @@ const uint32 kDoor2Open = 0x28DD;
void IgorEngine::PART_07_DRAW_DOOR_STATE(int num) {
_roomActionsTable[297] = 109;
if (num == 1 || num == 255) { // draws open or closed door depending on the flag
- const uint32 srcOffset = _objectsState[26] == 0 ? kDoor1Closed : kDoor1Open;
+ const uint32 srcOffset = _objectsState[kDeanDoorOpenStateIndex] == 0 ? kDoor1Closed : kDoor1Open;
copyArea(_screenLayer1, 0x4DB8, 320, _animFramesBuffer + srcOffset, 12, 12, 53);
- _roomActionsTable[146] = _objectsState[26] == 0 ? 6 : 7;
+ _roomActionsTable[146] = _objectsState[kDeanDoorOpenStateIndex] == 0 ? 6 : 7;
}
if (num == 2 || num == 255) {
- const uint32 srcOffset = _objectsState[27] == 0 ? kDoor2Closed : kDoor2Open;
+ const uint32 srcOffset = _objectsState[kSecretaryDoorOpenStateIndex] == 0 ? kDoor2Closed : kDoor2Open;
copyArea(_screenLayer1, 0x4E1A, 320, _animFramesBuffer + srcOffset, 12, 12, 52);
- _roomActionsTable[147] = _objectsState[27] == 0 ? 6 : 7;
+ _roomActionsTable[147] = _objectsState[kSecretaryDoorOpenStateIndex] == 0 ? 6 : 7;
}
}
void IgorEngine::PART_07_openCloseDoor(int door, bool open) {
- const int stateIndex = door == 1 ? 26 : 27;
+ const int stateIndex = door == 1 ? kDeanDoorOpenStateIndex : kSecretaryDoorOpenStateIndex;
if ((_objectsState[stateIndex] != 0) == open) {
const int text = open ? 19 : 23;
igorSayAndWait(text, 1, text);
@@ -157,7 +157,7 @@ void IgorEngine::PART_07_EXEC_ACTION(int action) {
PART_07_exitToOutside();
break;
case 111: // Go through dean's door
- if (_objectsState[26] != 0) {
+ if (_objectsState[kDeanDoorOpenStateIndex] != 0) {
for (int area = 11; area <= 13; ++area) {
_roomObjectAreasTable[area].area = 3;
}
@@ -170,7 +170,7 @@ void IgorEngine::PART_07_EXEC_ACTION(int action) {
}
break;
case 112: // Go through secretary's door
- if (_objectsState[27] != 0) {
+ if (_objectsState[kSecretaryDoorOpenStateIndex] != 0) {
WalkData &wd = _walkData[0];
wd.setPos(156, 113, kFacingPositionBack, 1);
wd.setDefaultScale();
diff --git a/engines/igor/parts/part_70.cpp b/engines/igor/parts/part_70.cpp
index 58ef8b7b3c0..2b01db9a521 100644
--- a/engines/igor/parts/part_70.cpp
+++ b/engines/igor/parts/part_70.cpp
@@ -27,8 +27,6 @@ static const int kPart70BoatOffset = 6 * 320 + 265;
static const int kPart70BoatWidth = 55;
static const int kPart70BoatHeight = 39;
-static const int kPart70MessageSent = 104;
-
static const int kPart70ExitStates[4] = { 501, 720, 680, 810 };
void IgorEngine::PART_70_EXEC_ACTION(int action) {
@@ -50,7 +48,7 @@ void IgorEngine::PART_70_EXEC_ACTION(int action) {
*/
void IgorEngine::PART_70_DRAW_OBJECT_STATE() {
const int frameSize = kPart70BoatWidth * kPart70BoatHeight;
- const int frame = _objectsState[kPart70MessageSent] == 0 ? 0 : 1;
+ const int frame = _objectsState[kLighthouseMessageSentStateIndex] == 0 ? 0 : 1;
copyArea(_screenLayer1, kPart70BoatOffset, 320, _animFramesBuffer + frame * frameSize, kPart70BoatWidth,
kPart70BoatWidth, kPart70BoatHeight);
}
diff --git a/engines/igor/parts/part_71.cpp b/engines/igor/parts/part_71.cpp
index 70edbfe4d15..0337c7e6831 100644
--- a/engines/igor/parts/part_71.cpp
+++ b/engines/igor/parts/part_71.cpp
@@ -34,10 +34,6 @@ static const int kPart71StatuetteFrameWidth = 5;
static const int kPart71StatuetteFrameHeight = 6;
static const int kPart71StatuetteFramesOffset = kPart71TakeFramesCount * kPart71TakeFrameSize;
-static const int kPart71TakenStateIndex = 100;
-static const int kPart71StatuetteExamined = 101;
-static const int kPart71StatuetteTaken = 106;
-
static const int kPart71StatuetteNameIndex = 2;
static const int kPart71StatuetteInventoryNumber = 25;
static const int kPart71StatuetteInventoryIndex = 60;
@@ -92,10 +88,10 @@ void IgorEngine::PART_71_DRAW_OBJECT(int frame) {
void IgorEngine::PART_71_APPLY_OBJECT_STATE(int what) {
if (what == kPart71ApplyPicture || what == kPart71ApplyAll) {
- PART_71_DRAW_OBJECT(_objectsState[kPart71TakenStateIndex] == 0 ? 0 : 1);
+ PART_71_DRAW_OBJECT(_objectsState[kStatuetteTakenStateIndex] == 0 ? 0 : 1);
}
if (what == kPart71ApplyName || what == kPart71ApplyAll) {
- const char *name = getString(_objectsState[kPart71StatuetteExamined] == 0 ? STR_ShinyThing : STR_Statuette);
+ const char *name = getString(_objectsState[kStatuetteExaminedStateIndex] == 0 ? STR_ShinyThing : STR_Statuette);
if (name) {
Common::strlcpy(_roomObjectNames[kPart71StatuetteNameIndex], name, sizeof(_roomObjectNames[kPart71StatuetteNameIndex]));
}
@@ -104,9 +100,9 @@ void IgorEngine::PART_71_APPLY_OBJECT_STATE(int what) {
void IgorEngine::PART_71_ACTION_103_look() {
- if (_objectsState[kPart71StatuetteExamined] == 0) {
+ if (_objectsState[kStatuetteExaminedStateIndex] == 0) {
igorSay(220, 2, 1005);
- _objectsState[kPart71StatuetteExamined] = 1;
+ _objectsState[kStatuetteExaminedStateIndex] = 1;
PART_71_APPLY_OBJECT_STATE(kPart71ApplyName);
} else {
igorSay(222, 2, 1006);
@@ -115,19 +111,19 @@ void IgorEngine::PART_71_ACTION_103_look() {
void IgorEngine::PART_71_ACTION_102_takeObject() {
- if (_objectsState[kPart71StatuetteExamined] == 0) {
+ if (_objectsState[kStatuetteExaminedStateIndex] == 0) {
igorSayAndWait(220, 2, 1005);
- _objectsState[kPart71StatuetteExamined] = 1;
+ _objectsState[kStatuetteExaminedStateIndex] = 1;
}
for (int i = 0; i < kPart71TakeFramesCount; ++i) {
drawAnimRect(kPart71TakeOffset, i * kPart71TakeFrameSize, kPart71TakeWidth, kPart71TakeHeight, false, kBlendLitSpriteNoShade);
waitForTimer(kPart71TakeFrameDelay);
}
addObjectToInventory(kPart71StatuetteInventoryNumber, kPart71StatuetteInventoryIndex);
- _objectsState[kPart71TakenStateIndex] = 1;
+ _objectsState[kStatuetteTakenStateIndex] = 1;
PART_71_APPLY_OBJECT_STATE(kPart71ApplyAll);
igorSay(204, 3, 996);
- _objectsState[kPart71StatuetteTaken] = 1;
+ _objectsState[kStatuetteTaken2StateIndex] = 1;
}
void IgorEngine::PART_71_enterFromRight() {
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
index 10e2b7de67d..c26f25321da 100644
--- a/engines/igor/parts/part_72.cpp
+++ b/engines/igor/parts/part_72.cpp
@@ -22,11 +22,9 @@
namespace Igor {
-
static const int kPart72FlowerOffset = 84 * 320 + 133;
static const int kPart72FlowerWidth = 9;
static const int kPart72FlowerHeight = 5;
-static const int kPart72FlowerTaken = 102;
static const int kPart72TakeFramesOffset = 2 * kPart72FlowerWidth * kPart72FlowerHeight;
static const int kPart72TakeWidth = 35;
static const int kPart72TakeHeight = 49;
@@ -64,7 +62,7 @@ void IgorEngine::PART_72_EXEC_ACTION(int action) {
igorSay(204, 1, 1096);
break;
case 106:
- _objectsState[90] = 0;
+ _objectsState[kCemeteryEntrySideStateIndex] = 0;
_currentPart = 700;
break;
default:
@@ -75,7 +73,7 @@ void IgorEngine::PART_72_EXEC_ACTION(int action) {
void IgorEngine::PART_72_APPLY_OBJECT_STATE() {
- const int taken = _objectsState[kPart72FlowerTaken] == 0 ? 0 : 1;
+ const int taken = _objectsState[kFlowerTakenStateIndex] == 0 ? 0 : 1;
copyArea(_screenLayer1, kPart72FlowerOffset, 320, _animFramesBuffer + taken * kPart72FlowerWidth * kPart72FlowerHeight,
kPart72FlowerWidth, kPart72FlowerWidth, kPart72FlowerHeight);
if (taken) {
@@ -92,7 +90,7 @@ void IgorEngine::PART_72_ACTION_102_takeFlower() {
waitForTimer(90);
}
addObjectToInventory(kPart72FlowerObjectNumber, kPart72FlowerObjectIndex);
- _objectsState[kPart72FlowerTaken] = 1;
+ _objectsState[kFlowerTakenStateIndex] = 1;
PART_72_APPLY_OBJECT_STATE();
igorSay(201, 1, 1093);
}
diff --git a/engines/igor/parts/part_73.cpp b/engines/igor/parts/part_73.cpp
index 15ac57a37f3..60874a5a255 100644
--- a/engines/igor/parts/part_73.cpp
+++ b/engines/igor/parts/part_73.cpp
@@ -85,7 +85,7 @@ void IgorEngine::PART_73_CUTSCENE() {
_gameState.igorMoving = true;
waitForIgorMove();
- _objectsState[7] = 1;
+ _objectsState[kStatueDeliveredStateIndex] = 1;
UPDATE_OBJECT_STATE(8);
// removes the great dosicua
removeInventoryEntry(kPart73InventoryIndex);
@@ -104,7 +104,7 @@ void IgorEngine::PART_73_CUTSCENE() {
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
_currentAction.verb = kVerbWalk;
- _objectsState[106] = 0;
+ _objectsState[kStatuetteTaken2StateIndex] = 0;
_currentPart = 40;
}
diff --git a/engines/igor/parts/part_76.cpp b/engines/igor/parts/part_76.cpp
index c85decf2105..51c61ac32f1 100644
--- a/engines/igor/parts/part_76.cpp
+++ b/engines/igor/parts/part_76.cpp
@@ -105,7 +105,7 @@ void IgorEngine::PART_76_EXEC_ACTION(int action) {
* screen) and the actions and objects that go with them.
*/
void IgorEngine::PART_76_APPLY_OBJECT_STATE() {
- if (_objectsState[108] == 0) {
+ if (_objectsState[kPlaneDoorOpenStateIndex] == 0) {
copyArea(_screenLayer1, kPart76PlaneDoorOffset, 320, _animFramesBuffer + kPart76PlaneDoorFirst, kPart76PlaneDoorWidth,
kPart76PlaneDoorWidth, kPart76PlaneDoorHeight);
_roomActionsTable[79] = 9;
@@ -118,7 +118,7 @@ void IgorEngine::PART_76_APPLY_OBJECT_STATE() {
_roomActionsTable[79] = 11;
_roomActionsTable[81] = 12;
}
- if (_objectsState[109] == 0) {
+ if (_objectsState[kParachuteTakenStateIndex] == 0) {
copyArea(_screenLayer1, kPart76ParachuteOffset, 320, _animFramesBuffer, kPart76ParachuteWidth,
kPart76ParachuteWidth, kPart76ParachuteHeight);
} else {
@@ -148,7 +148,7 @@ void IgorEngine::PART_76_ACTION_103_openDoor() {
waitForTimer(31);
}
igorSay(206, 1, 704);
- _objectsState[108] = 1;
+ _objectsState[kPlaneDoorOpenStateIndex] = 1;
PART_76_APPLY_OBJECT_STATE();
}
@@ -161,7 +161,7 @@ void IgorEngine::PART_76_ACTION_104_takeParachute() {
waitForTimer(91);
}
addObjectToInventory(kPart76ParachuteInvNumber, kPart76ParachuteInventoryIndex);
- _objectsState[109] = 1;
+ _objectsState[kParachuteTakenStateIndex] = 1;
PART_76_APPLY_OBJECT_STATE();
igorSay({ { 203, 1, 702 }, { 204, 2, 703 } });
}
@@ -172,7 +172,7 @@ void IgorEngine::PART_76_ACTION_104_takeParachute() {
* the full screen frames follow and the story goes on in state 790.
*/
void IgorEngine::PART_76_ACTION_106_useParachute() {
- if (_objectsState[108] == 0) {
+ if (_objectsState[kPlaneDoorOpenStateIndex] == 0) {
igorSay(209, 1, 706);
return;
}
diff --git a/engines/igor/parts/part_77.cpp b/engines/igor/parts/part_77.cpp
index fbeb2b8bad1..1c8368831bd 100644
--- a/engines/igor/parts/part_77.cpp
+++ b/engines/igor/parts/part_77.cpp
@@ -183,7 +183,7 @@ void IgorEngine::PART_77() {
runPartLoop();
}
if (!_gameStateLoaded) {
- _objectsState[54] = 1;
+ _objectsState[kPhillipAndJimmyPresentStateIndex] = 1;
if (_currentPart == 760) {
// the colors 208 to 254 are cleared in both palettes
memset(_paletteBuffer + 208 * 3, 0, 141);
diff --git a/engines/igor/parts/part_78.cpp b/engines/igor/parts/part_78.cpp
index 32c08431490..241d72b8a7c 100644
--- a/engines/igor/parts/part_78.cpp
+++ b/engines/igor/parts/part_78.cpp
@@ -290,7 +290,7 @@ void IgorEngine::PART_78() {
_part78BandFrames = nullptr;
memcpy(_paletteBuffer, _currentPalette, 624);
fadeOut(768);
- _objectsState[111] = 1;
+ _objectsState[kExamCompletedStateIndex] = 1;
playMusic(2);
// the card with the time that has passed
PART_meanwhile(IMG_Part78NextDay);
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index ef591d352d2..de20fb95286 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -10,7 +10,6 @@
namespace Igor {
-static const int kPart08PendingDeanDrinkState = 30;
enum Part08PendingDeanDrink {
kPart08PendingDeanDrinkNone = 0,
@@ -20,12 +19,12 @@ enum Part08PendingDeanDrink {
void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- const uint32 srcOffset = _objectsState[26] == 0 ? 0 : 0x4C8;
+ const uint32 srcOffset = _objectsState[kDeanDoorOpenStateIndex] == 0 ? 0 : 0x4C8;
copyArea(_screenLayer1, 0x572C, 320, _animFramesBuffer + srcOffset, 24, 24, 51);
- _roomActionsTable[150] = _objectsState[26] == 0 ? 6 : 7;
+ _roomActionsTable[150] = _objectsState[kDeanDoorOpenStateIndex] == 0 ? 6 : 7;
}
if (num == 2 || num == 255) {
- if (_objectsState[111] == 1) {
+ if (_objectsState[kExamCompletedStateIndex] == 1) {
_roomObjectAreasTable[7].object = 0;
_roomObjectAreasTable[8].object = 0;
_roomActionsTable[146] = 4;
@@ -35,18 +34,18 @@ void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
int dstOffset;
int rows;
int width;
- if (_objectsState[29] == 0) {
+ if (_objectsState[kDeanPassedOutStateIndex] == 0) {
srcOffset = 0x208A;
dstOffset = 0x6BC3;
rows = 26;
width = 34;
_roomObjectAreasTable[8].object = 0;
} else {
- srcOffset = _objectsState[31] == 0 ? 0x9992 : 0x985C;
+ srcOffset = _objectsState[kNewspaperTakenStateIndex] == 0 ? 0x9992 : 0x985C;
dstOffset = 0x7FC8;
rows = 10;
width = 31;
- _roomObjectAreasTable[8].object = _objectsState[31] == 0 ? 3 : 0;
+ _roomObjectAreasTable[8].object = _objectsState[kNewspaperTakenStateIndex] == 0 ? 3 : 0;
}
drawAnimRect(dstOffset, srcOffset, width, rows, true);
_roomActionsTable[146] = 4;
@@ -54,7 +53,7 @@ void IgorEngine::PART_08_APPLY_OBJECT_STATE(int num) {
}
void IgorEngine::drawDoor(bool open) {
- if ((_objectsState[26] != 0) == open) {
+ if ((_objectsState[kDeanDoorOpenStateIndex] != 0) == open) {
const int text = open ? 19 : 23;
igorSayAndWait(text, 1, text);
return;
@@ -70,7 +69,7 @@ void IgorEngine::drawDoor(bool open) {
break;
waitForTimer(127);
}
- _objectsState[26] = open ? 1 : 0;
+ _objectsState[kDeanDoorOpenStateIndex] = open ? 1 : 0;
PART_08_APPLY_OBJECT_STATE(1);
}
@@ -101,7 +100,7 @@ void IgorEngine::PART_08_ACTION_pickNewspaper() {
waitForTimer(127);
}
addObjectToInventory(15, 50);
- _objectsState[31] = 1;
+ _objectsState[kNewspaperTakenStateIndex] = 1;
PART_08_APPLY_OBJECT_STATE(255);
}
@@ -114,7 +113,7 @@ void IgorEngine::PART_08_ACTION_pickBook() {
addObjectToInventory(13, 48);
PART_08_APPLY_OBJECT_STATE(255);
- _objectsState[28] = 1;
+ _objectsState[kDeanBookTakenStateIndex] = 1;
}
void IgorEngine::drawSecretaryTalkingFrame(int frame) {
@@ -136,7 +135,7 @@ void IgorEngine::PART_08_UPDATE_DIALOGUE_SECRETARY(int action) {
void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
const int currentPart = _currentPart;
- const int actionFrameOffset = _objectsState[31] == 0 ? 0x2773 : 0x328D;
+ const int actionFrameOffset = _objectsState[kNewspaperTakenStateIndex] == 0 ? 0x2773 : 0x328D;
playSound(60, 1);
for (int frame = 0; frame <= 1; ++frame) {
@@ -167,7 +166,7 @@ void IgorEngine::PART_08_ACTION_108_deanCallsSecretary() {
drawInventory(_inventoryInfo[72], 0);
fadeIn(768);
_currentPart = currentPart;
- _objectsState[32] = 1;
+ _objectsState[kIntercomUsedStateIndex] = 1;
}
void IgorEngine::PART_08_deanDrinksBottle() {
@@ -228,12 +227,12 @@ void IgorEngine::PART_08_HANDLE_DIALOGUE_INTERCOM() {
}
void IgorEngine::PART_08_ACTION_103_talkToDean() {
- if (_objectsState[29] == 1) {
+ if (_objectsState[kDeanPassedOutStateIndex] == 1) {
igorSayAndWait(223, 1, 169);
return;
}
- if (_objectsState[26] == 1) { // door open
+ if (_objectsState[kDeanDoorOpenStateIndex] == 1) { // door open
drawDean();
cutsceneSayWithCallback(78, 75, 26, 58, 0, { { 220, 1, 166 }, { 221, 1, 167 } }, &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN);
PART_08_APPLY_OBJECT_STATE(255);
@@ -246,11 +245,11 @@ void IgorEngine::PART_08_ACTION_103_talkToDean() {
void IgorEngine::giveBottleToDean() {
- if (_objectsState[29] == 1) {
+ if (_objectsState[kDeanPassedOutStateIndex] == 1) {
igorSayAndWait(227, 1, 172);
return;
}
- if (_objectsState[0] == 1) {
+ if (_objectsState[kBottleStateIndex] == 1) {
igorSayAndWait(226, 1, 171);
return;
}
@@ -279,8 +278,8 @@ void IgorEngine::giveBottleToDean() {
cutsceneSayWithCallback(78, 75, 26, 58, 0, { { 216, 1, 162 }, { 217, 1, 163 }, { 218, 1, 164 }, { 219, 1, 165 } }, &IgorEngine::PART_08_UPDATE_DIALOGUE_DEAN);
const Part08PendingDeanDrink pendingDeanDrink =
- _objectsState[0] < 2 ? kPart08PendingDeanDrinkWhisky : kPart08PendingDeanDrinkWater;
- _objectsState[kPart08PendingDeanDrinkState] = pendingDeanDrink;
+ _objectsState[kBottleStateIndex] < 2 ? kPart08PendingDeanDrinkWhisky : kPart08PendingDeanDrinkWater;
+ _objectsState[kPendingDeanDrinkStateIndex] = pendingDeanDrink;
drawInventory(_inventoryInfo[72], 0);
playSound(63, 1);
PART_08_APPLY_OBJECT_STATE(255);
@@ -289,11 +288,11 @@ void IgorEngine::giveBottleToDean() {
void IgorEngine::PART_08_EXEC_ACTION(int action) {
switch (action) {
case 101: // exit office
- if (_objectsState[26] == 0) {
+ if (_objectsState[kDeanDoorOpenStateIndex] == 0) {
_currentPart = 71;
break;
}
- if (_objectsState[26] != 0) {
+ if (_objectsState[kDeanDoorOpenStateIndex] != 0) {
for (int area = 10; area <= 11; ++area)
_roomObjectAreasTable[area].area = 4;
for (int area = 13; area <= 14; ++area)
@@ -303,19 +302,19 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
- uint8 &pendingDeanDrink = _objectsState[kPart08PendingDeanDrinkState];
+ uint8 &pendingDeanDrink = _objectsState[kPendingDeanDrinkStateIndex];
if (pendingDeanDrink != kPart08PendingDeanDrinkNone) {
waitForTimer(251);
PART_08_deanDrinksBottle();
- if (_objectsState[42] == 1)
- _objectsState[42] = 2;
+ if (_objectsState[kButterflyNetStateIndex] == 1)
+ _objectsState[kButterflyNetStateIndex] = 2;
else
- _objectsState[41] = 1;
+ _objectsState[kGlassShardsPresentStateIndex] = 1;
waitForTimer(101);
playSound(16, 1);
if (pendingDeanDrink == kPart08PendingDeanDrinkWater) {
PART_08_deanPassesOut();
- _objectsState[29] = 1;
+ _objectsState[kDeanPassedOutStateIndex] = 1;
}
pendingDeanDrink = kPart08PendingDeanDrinkNone;
}
@@ -326,7 +325,7 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
igorSayAndWait(202, 1, 153);
break;
case 104: // Look at dean
- if (_objectsState[29] == 1)
+ if (_objectsState[kDeanPassedOutStateIndex] == 1)
ADD_DIALOGUE_TEXT(222, 1, 168);
else
ADD_DIALOGUE_TEXT(203, 2, 154);
@@ -350,18 +349,18 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
PART_08_ACTION_103_talkToDean();
break;
case 108:
- if (_objectsState[29] == 0) {
+ if (_objectsState[kDeanPassedOutStateIndex] == 0) {
igorSayAndWait(212, 1, 159);
- } else if (_objectsState[32] == 1) {
+ } else if (_objectsState[kIntercomUsedStateIndex] == 1) {
igorSayAndWait(224, 2, 170);
} else {
PART_08_ACTION_108_deanCallsSecretary();
}
break;
case 109:
- if (_objectsState[29] == 0) {
+ if (_objectsState[kDeanPassedOutStateIndex] == 0) {
igorSayAndWait(213, 2, 160);
- } else if (_objectsState[28] == 1) {
+ } else if (_objectsState[kDeanBookTakenStateIndex] == 1) {
igorSayAndWait(215, 1, 161);
} else {
PART_08_ACTION_pickBook();
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index 39404a47b08..a87555dc192 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -57,12 +57,6 @@ static const int kPart81StripRows = 0x48;
static const int kPart81EndFramesBase = 0xBAE0;
static const int kPart81EndFramesTable = 0x828;
-// Flags of the story kept in the objects state.
-static const int kPart81VaseState = 6;
-static const int kPart81SideState = 90;
-static const int kPart81LighthouseMessageSent = 104;
-static const int kPart81HasSeenChurchBellMessageState = 105;
-
static const int kPart81InventoryIndex = 69;
static const uint8 kPart81FigureFrames[4] = { 1, 2, 3, 1 };
@@ -95,7 +89,7 @@ void IgorEngine::PART_81_drawLighthouseKeeperHead(int frame) {
void IgorEngine::PART_81_UPDATE_ROOM_BACKGROUND() {
// if user has seen church bell message, show lighthouse keeper
- if (compareGameTick(0x3D) && getRandomNumber(1) == 0 && _objectsState[kPart81HasSeenChurchBellMessageState] == 1) {
+ if (compareGameTick(0x3D) && getRandomNumber(1) == 0 && _objectsState[kChurchBellMessageSeenStateIndex] == 1) {
PART_81_drawLighthouseKeeperHead(getRandomNumber(2) + 1);
}
}
@@ -134,11 +128,11 @@ void IgorEngine::PART_81_APPLY_OBJECT_STATE(int num) {
// change door hotspot to lighthouse keeper and vice-versa
uint8 objectNames[16];
loadData(TXT_Part81ObjectNames, objectNames);
- const uint8 *name = objectNames + (_objectsState[kPart81HasSeenChurchBellMessageState] == 1 ? 0 : 8);
+ const uint8 *name = objectNames + (_objectsState[kChurchBellMessageSeenStateIndex] == 1 ? 0 : 8);
memcpy(_roomObjectNames[2], name + 1, name[0]);
_roomObjectNames[2][name[0]] = '\0';
// show lighthouse keeper if the player has seen the church bell message
- if (_objectsState[kPart81HasSeenChurchBellMessageState] == 1) {
+ if (_objectsState[kChurchBellMessageSeenStateIndex] == 1) {
copyArea(_screenLayer1, kPart81HeadOffset, 320, _animFramesBuffer + kPart81HeadRestFrame * kPart81HeadFrameSize + 0x1AE5,
kPart81HeadWidth, kPart81HeadWidth, kPart81HeadHeight);
_roomActionsTable[30] = 2;
@@ -305,7 +299,7 @@ void IgorEngine::PART_81_ACTION_110_rejectItem() {
}
void IgorEngine::PART_81_ACTION_109_giveLampToLighthouseKeeper() {
- if (_objectsState[kPart81VaseState] <= 1) {
+ if (_objectsState[kVaseStateIndex] <= 1) {
PART_81_ACTION_110_rejectItem();
return;
}
@@ -362,7 +356,7 @@ void IgorEngine::PART_81_ACTION_109_giveLampToLighthouseKeeper() {
PART_81_lighthouseKeeperSay({ { 224, 1, 966 }, { 225, 1, 967 }, { 226, 3, 968 } });
PART_81_igorSay(229, 1, 969);
PART_81_lighthouseKeeperSay({ { 230, 1, 970 } });
- _objectsState[kPart81LighthouseMessageSent] = 1;
+ _objectsState[kLighthouseMessageSentStateIndex] = 1;
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
PART_81_APPLY_OBJECT_STATE(255);
@@ -441,7 +435,7 @@ void IgorEngine::PART_81_handleDialogue() {
}
void IgorEngine::PART_81_ACTION_102_talk() {
- if (_objectsState[kPart81HasSeenChurchBellMessageState] == 1 && _objectsState[kPart81LighthouseMessageSent] == 1) {
+ if (_objectsState[kChurchBellMessageSeenStateIndex] == 1 && _objectsState[kLighthouseMessageSentStateIndex] == 1) {
igorSay(234, 1, 974);
return;
}
@@ -473,14 +467,14 @@ void IgorEngine::PART_81_walkIn() {
void IgorEngine::PART_81_EXEC_ACTION(int action) {
switch (action) {
case 101:
- _objectsState[kPart81SideState] = 1;
+ _objectsState[kCemeteryEntrySideStateIndex] = 1;
_currentPart = 700;
break;
case 102: // talk to lighthouse keeper
PART_81_ACTION_102_talk();
break;
case 103: // look at lighthouse keeper
- if (_objectsState[kPart81HasSeenChurchBellMessageState] == 1) {
+ if (_objectsState[kChurchBellMessageSeenStateIndex] == 1) {
igorSay(202, 1, 946);
} else {
igorSay(201, 1, 945);
@@ -496,7 +490,7 @@ void IgorEngine::PART_81_EXEC_ACTION(int action) {
igorSay(204, 1, 948);
break;
case 108: // look at sea
- if (_objectsState[kPart81LighthouseMessageSent] == 0) {
+ if (_objectsState[kLighthouseMessageSentStateIndex] == 0) {
igorSay({ { 206, 1, 950 }, { 207, 1, 951 } });
} else {
igorSay(205, 1, 949);
@@ -538,8 +532,8 @@ void IgorEngine::PART_81() {
while (_currentPart == 810 && !_gameStateLoaded) {
runPartLoop();
}
- if (!_gameStateLoaded && _objectsState[kPart81HasSeenChurchBellMessageState] == 1 && _objectsState[kPart81LighthouseMessageSent] == 1) {
- _objectsState[kPart81HasSeenChurchBellMessageState] = 0;
+ if (!_gameStateLoaded && _objectsState[kChurchBellMessageSeenStateIndex] == 1 && _objectsState[kLighthouseMessageSentStateIndex] == 1) {
+ _objectsState[kChurchBellMessageSeenStateIndex] = 0;
}
leavePartLoop();
if (!_gameStateLoaded)
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index 97afa2988d9..8d018026264 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -16,17 +16,17 @@ void IgorEngine::PART_09_drawSecretaryFrame(int frame, bool background) {
void IgorEngine::PART_09_APPLY_OBJECT_STATE(int num) {
if (num == 1 || num == 255) {
- const uint32 srcOffset = _objectsState[27] == 0 ? 0x5D0B : 0x61A3;
+ const uint32 srcOffset = _objectsState[kSecretaryDoorOpenStateIndex] == 0 ? 0x5D0B : 0x61A3;
copyArea(_screenLayer1, 0x46C2, 320, _animFramesBuffer + srcOffset, 24, 24, 49);
- _roomActionsTable[150] = _objectsState[27] == 0 ? 6 : 7;
+ _roomActionsTable[150] = _objectsState[kSecretaryDoorOpenStateIndex] == 0 ? 6 : 7;
}
if (num == 2 || num == 255) {
- const uint32 srcOffset = _objectsState[34] == 0 ? 0x663B : 0x6A23;
+ const uint32 srcOffset = _objectsState[kSecretaryClosetOpenStateIndex] == 0 ? 0x663B : 0x6A23;
copyArea(_screenLayer1, 0x48E6, 320, _animFramesBuffer + srcOffset, 20, 20, 50);
- _roomObjectAreasTable[4].object = (_objectsState[34] == 0 || _objectsState[36] != 0) ? 3 : 5;
+ _roomObjectAreasTable[4].object = (_objectsState[kSecretaryClosetOpenStateIndex] == 0 || _objectsState[kSecretaryClosetStateIndex] != 0) ? 3 : 5;
}
if (num == 3 || num == 255) {
- if (_objectsState[35] == 0) {
+ if (_objectsState[kSecretaryDismissedStateIndex] == 0) {
PART_09_drawSecretaryFrame(1, true);
_roomObjectAreasTable[6].object = 2;
_roomObjectAreasTable[15].object = 2;
@@ -46,7 +46,7 @@ void IgorEngine::PART_09_APPLY_OBJECT_STATE(int num) {
}
void IgorEngine::PART_09_ANIMATE_DOOR(bool open) {
- if ((_objectsState[27] != 0) == open) {
+ if ((_objectsState[kSecretaryDoorOpenStateIndex] != 0) == open) {
executeAction(open ? 11 : 14);
return;
}
@@ -60,7 +60,7 @@ void IgorEngine::PART_09_ANIMATE_DOOR(bool open) {
playSound(open ? 13 : 14, 1);
waitForTimer(127);
}
- _objectsState[27] = open ? 1 : 0;
+ _objectsState[kSecretaryDoorOpenStateIndex] = open ? 1 : 0;
PART_09_APPLY_OBJECT_STATE(1);
}
@@ -69,9 +69,9 @@ void IgorEngine::PART_09_DRAW_openClosetFrame(int frame) {
}
void IgorEngine::PART_09_ACTION_106_openCloset(bool hairpin) {
- if (_objectsState[35] == 0) { // if secretary present, she will prevent searching the closet
+ if (_objectsState[kSecretaryDismissedStateIndex] == 0) { // if secretary present, she will prevent searching the closet
ADD_DIALOGUE_TEXT(214, 2, 243);
- } else if (_objectsState[34] == 1) {
+ } else if (_objectsState[kSecretaryClosetOpenStateIndex] == 1) {
executeAction(10);
return;
} else if (hairpin) {
@@ -80,7 +80,7 @@ void IgorEngine::PART_09_ACTION_106_openCloset(bool hairpin) {
PART_09_DRAW_openClosetFrame(frames[i]);
waitForTimer(61);
}
- _objectsState[34] = 1;
+ _objectsState[kSecretaryClosetOpenStateIndex] = 1;
PART_09_APPLY_OBJECT_STATE(2);
ADD_DIALOGUE_TEXT(212, 1, 241);
} else { // igor tries to open
@@ -105,14 +105,14 @@ void IgorEngine::PART_09_ACTION_110_pickCostumeFromCloset() {
waitForTimer(127);
}
addObjectToInventory(14, 49);
- _objectsState[36] = 1;
+ _objectsState[kSecretaryClosetStateIndex] = 1;
PART_09_APPLY_OBJECT_STATE(255);
}
void IgorEngine::PART_09_ACTION_101_openFileCabinet() {
- if (_objectsState[35] == 0) { // secretary dismissed
+ if (_objectsState[kSecretaryDismissedStateIndex] == 0) { // secretary dismissed
ADD_DIALOGUE_TEXT(220, 1, 248);
- } else if (_objectsState[37] == 1) { // already changed file
+ } else if (_objectsState[kPersonalFileChangedStateIndex] == 1) { // already changed file
ADD_DIALOGUE_TEXT(225, 1, 253);
} else {
static const uint8 frames[] = { 1, 2, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5, 2, 1, 6 };
@@ -127,7 +127,7 @@ void IgorEngine::PART_09_ACTION_101_openFileCabinet() {
if (frame == 7)
waitForTimer(255);
}
- _objectsState[37] = 1;
+ _objectsState[kPersonalFileChangedStateIndex] = 1;
return;
}
SET_DIALOGUE_TEXT(1, 1);
@@ -169,7 +169,7 @@ void IgorEngine::PART_09_secretarySearchesFile() {
}
void IgorEngine::PART_09_UPDATE_ROOM_BACKGROUND() {
- if (_objectsState[35] == 0 && compareGameTick(61) && getRandomNumber(1) == 0)
+ if (_objectsState[kSecretaryDismissedStateIndex] == 0 && compareGameTick(61) && getRandomNumber(1) == 0)
PART_09_drawSecretaryFrame(getRandomNumber(2), false);
}
@@ -199,15 +199,15 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
igorSayAndWait(203, 2, 235);
break;
case 105: { // look at closet
- const int text = _objectsState[34] == 0 ? 205 : (_objectsState[36] == 0 ? 218 : 219);
- igorSayAndWait(text, _objectsState[34] == 0 ? 2 : 1, _objectsState[34] == 0 ? 236 : text + 28);
+ const int text = _objectsState[kSecretaryClosetOpenStateIndex] == 0 ? 205 : (_objectsState[kSecretaryClosetStateIndex] == 0 ? 218 : 219);
+ igorSayAndWait(text, _objectsState[kSecretaryClosetOpenStateIndex] == 0 ? 2 : 1, _objectsState[kSecretaryClosetOpenStateIndex] == 0 ? 236 : text + 28);
break;
}
case 106:
PART_09_ACTION_106_openCloset(false);
break;
case 107: // close closet
- if (_objectsState[34] == 0) {
+ if (_objectsState[kSecretaryClosetOpenStateIndex] == 0) {
executeAction(13);
} else {
igorSayAndWait(217, 1, 245);
@@ -217,7 +217,7 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
igorSayAndWait({ { 207, 1, 237 }, { 208, 1, 238 } });
break;
case 109: //user intercom
- igorSayAndWait(_objectsState[35] == 0 ? 216 : 224, 1, _objectsState[35] == 0 ? 244 : 252);
+ igorSayAndWait(_objectsState[kSecretaryDismissedStateIndex] == 0 ? 216 : 224, 1, _objectsState[kSecretaryDismissedStateIndex] == 0 ? 244 : 252);
break;
case 110:
PART_09_ACTION_110_pickCostumeFromCloset();
@@ -235,7 +235,7 @@ void IgorEngine::PART_09_EXEC_ACTION(int action) {
PART_09_ACTION_106_openCloset(true);
break;
case 116: //leave
- if (_objectsState[27] != 0) {
+ if (_objectsState[kSecretaryDoorOpenStateIndex] != 0) {
WalkData *wd = &_walkData[0];
wd->setPos(207, 106, kFacingPositionBack, 1);
wd->clipSkipX = 1;
@@ -282,8 +282,8 @@ void IgorEngine::PART_09() {
}
waitForTimer(255);
fadeOut(624);
- _objectsState[27] = 0;
- _objectsState[35] = 1;
+ _objectsState[kSecretaryDoorOpenStateIndex] = 0;
+ _objectsState[kSecretaryDismissedStateIndex] = 1;
return;
}
static const int anim[] = {
diff --git a/engines/igor/parts/part_margaret.cpp b/engines/igor/parts/part_margaret.cpp
index 3ab5eb92165..c62f8f92a4e 100644
--- a/engines/igor/parts/part_margaret.cpp
+++ b/engines/igor/parts/part_margaret.cpp
@@ -51,7 +51,7 @@ void IgorEngine::PART_MARGARET_ROOM_CUTSCENE_UPDATE_DIALOGUE_MARGARET(int action
void IgorEngine::PART_MARGARET_ROOM_CUTSCENE() {
playMusic(8);
_gameState.enableLight = 1;
- VAR_MARGARET_ROOM_ANIM_COUNTER = _objectsState[110] + 1;
+ VAR_MARGARET_ROOM_ANIM_COUNTER = _objectsState[kMargaretSceneStateIndex] + 1;
if (VAR_MARGARET_ROOM_ANIM_COUNTER == 9) {
VAR_MARGARET_ROOM_ANIM_COUNTER = 1;
}
@@ -111,11 +111,11 @@ void IgorEngine::PART_MARGARET_ROOM_CUTSCENE() {
waitForEndOfCutsceneDialogue(200, 73, 63, 32, 0);
waitForTimer(255);
_updateDialogue = 0;
- ++_objectsState[110];
+ ++_objectsState[kMargaretSceneStateIndex];
memcpy(_paletteBuffer, _currentPalette, 768);
fadeOut(768);
memset(_screenVGA, 0, 46080);
- if (_objectsState[110] < 9 && _currentPart != 331) {
+ if (_objectsState[kMargaretSceneStateIndex] < 9 && _currentPart != 331) {
setupDefaultPalette();
SET_PAL_240_48_1();
SET_PAL_208_96_1();
diff --git a/engines/igor/parts/part_maze.cpp b/engines/igor/parts/part_maze.cpp
index 1cb793e6832..102ab4d8cc2 100644
--- a/engines/igor/parts/part_maze.cpp
+++ b/engines/igor/parts/part_maze.cpp
@@ -365,7 +365,7 @@ void IgorEngine::PART_MAZE() {
if (_inputVars[kInputEscape] && !_eventQuitGame) {
// leaves the maze
_inputVars[kInputEscape] = 0;
- _currentPart = (_objectsState[70] == 1 && _objectsState[71] == 0) ? 500 : 142;
+ _currentPart = (_objectsState[kMazeBeatenStateIndex] == 1 && _objectsState[kMazeEntryDirectionStateIndex] == 0) ? 500 : 142;
break;
}
runPartLoop();
diff --git a/engines/igor/parts/part_maze_data.cpp b/engines/igor/parts/part_maze_data.cpp
index 031f42671e4..14fa3db6f4b 100644
--- a/engines/igor/parts/part_maze_data.cpp
+++ b/engines/igor/parts/part_maze_data.cpp
@@ -416,7 +416,7 @@ static const MazeDialogueLine kMaze66Lines106[] = {
};
static const MazeAction kMaze66Actions[] = {
MAZE_EXIT_FIXED(101, 164, 106, 164, 92, 105, 562, -1, 0),
- MAZE_EXIT_FIXED(102, 71, 128, 16, 128, -1, 500, 70, 1),
+ MAZE_EXIT_FIXED(102, 71, 128, 16, 128, -1, 500, kMazeBeatenStateIndex, 1),
MAZE_DIALOGUE(103, kMaze66Lines103, 1, 1, 1),
MAZE_DIALOGUE(104, kMaze66Lines104, 1, 1, 1),
MAZE_DIALOGUE(105, kMaze66Lines105, 3, 3, 1),
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 6ba838f78ee..73afe318969 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -553,12 +553,12 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreU
_gameState.dialogueChoiceStart = 1;
_gameState.dialogueChoiceCount = 1;
_dialogueEnded = false;
- if (getPart() == 12 && _objectsState[44] == 0) {
+ if (getPart() == 12 && _objectsState[kLizardTakenStateIndex] == 0) {
_gameState.dialogueData[6] = 1;
dialogueReplyToQuestion(x, y, r, g, b, 40);
}
do {
- if (getPart() == 15 && _objectsState[48] == 0) {
+ if (getPart() == 15 && _objectsState[kCuckooClockTriggeredStateIndex] == 0) {
_gameState.dialogueData[6] = 0;
}
drawDialogueChoices();
Commit: 6233c908a5e9b28e010ca1f07a674f9aec381487
https://github.com/scummvm/scummvm/commit/6233c908a5e9b28e010ca1f07a674f9aec381487
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:55+01:00
Commit Message:
IGOR: Inventory item numbers as constants
Changed paths:
engines/igor/igor.h
engines/igor/part_main.cpp
engines/igor/parts/part_0.cpp
engines/igor/parts/part_10.cpp
engines/igor/parts/part_11.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_22.cpp
engines/igor/parts/part_27.cpp
engines/igor/parts/part_28.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
engines/igor/parts/part_36.cpp
engines/igor/parts/part_37.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_69.cpp
engines/igor/parts/part_71.cpp
engines/igor/parts/part_72.cpp
engines/igor/parts/part_73.cpp
engines/igor/parts/part_76.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_9.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 2f435231ef4..5f3c4cfbf02 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -313,6 +313,46 @@ enum ObjectType {
kObjectTypeRoom = 2
};
+// One-based inventory object numbers, separate from object state and inventory lookup indices.
+enum InventoryObjectNumber {
+ kInventoryObjectBoomerang = 1,
+ kInventoryObjectWallet = 2,
+ kInventoryObjectParachute = 3,
+ kInventoryObjectTplTickets = 4,
+ kInventoryObjectRecords = 5,
+ kInventoryObjectAlarmClock = 6,
+ kInventoryObjectButterflyNet = 7,
+ kInventoryObjectMatches = 8,
+ kInventoryObjectHammer = 9,
+ kInventoryObjectPickaxe = 10,
+ kInventoryObjectDynamite = 11,
+ kInventoryObjectHairpin = 12,
+ kInventoryObjectDeansBook = 13,
+ kInventoryObjectMonkeySuit = 14,
+ kInventoryObjectNewspaper = 15,
+ kInventoryObjectLabKeys = 16,
+ kInventoryObjectBurger = 17,
+ kInventoryObjectSlug = 18,
+ kInventoryObjectPhoto = 19,
+ kInventoryObjectFlask = 20,
+ kInventoryObjectLoveNote = 21,
+ kInventoryObjectFolder = 22,
+ kInventoryObjectBottle = 23,
+ kInventoryObjectMoney = 24,
+ kInventoryObjectLizard = 25,
+ kInventoryObjectRocket = 26,
+ kInventoryObjectResin = 27,
+ kInventoryObjectPapyrus = 28,
+ kInventoryObjectPassword = 29,
+ kInventoryObjectPen = 30,
+ kInventoryObjectAstronomyBook = 31,
+ kInventoryObjectLabNote = 32,
+ kInventoryObjectFlower = 33,
+ kInventoryObjectVase = 34,
+ kInventoryObjectBiologyProject = 35,
+ kInventoryObjectCamera = 36
+};
+
enum ObjectStateIndex {
kBottleStateIndex = 0,
kLizardFedStateIndex = 1,
@@ -1300,11 +1340,11 @@ private:
// swamp
void PART_69_EXEC_ACTION(int action);
void PART_69_APPLY_OBJECT_STATE();
- void PART_69_DRAW_FIREFLY_A(int frame);
- void PART_69_DRAW_FIREFLY_B(int frame);
+ void PART_69_drawSwarm(int frame);
+ void PART_69_drawMainFirefly(int frame);
void PART_69_animateFireflies();
- void PART_69_ACTION_107_watch();
- void PART_69_FINALE(int num, int sound);
+ void PART_69_ACTION_107_useVaseWithFireflies();
+ void PART_69_takeVaseBack(int num, int sound);
void PART_69_enterFromRight();
void PART_69_UPDATE_ROOM_BACKGROUND();
void PART_69();
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index abc7b349ab6..55ce53695fe 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -238,7 +238,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
igorSay(76, 1, 52);
} else {
igorSay(74, 2, 51);
- addObjectToInventory(16, 51);
+ addObjectToInventory(kInventoryObjectLabKeys, 51);
}
break;
case 62: // use burger on lizard
@@ -250,7 +250,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
packInventory();
_objectsState[kLizardFedStateIndex] = 1;
UPDATE_OBJECT_STATE(2);
- addObjectToInventory(24, 59);
+ addObjectToInventory(kInventoryObjectMoney, 59);
igorSay(169, 1, 93);
break;
case 63: // use flower on vase
@@ -263,7 +263,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
packInventory();
_objectsState[kVaseStateIndex] = 1;
UPDATE_OBJECT_STATE(7);
- addObjectToInventory(34, 69);
+ addObjectToInventory(kInventoryObjectVase, 69);
break;
case 64: // look at vase
if (_objectsState[kVaseStateIndex] == 0) {
@@ -456,9 +456,9 @@ void IgorEngine::PART_MAIN() {
_objectsState[kAtticNailHotspotActiveStateIndex] = 1;
_objectsState[kCuckooAnimationControlStateIndex] = 1;
memset(_inventoryInfo, 0, 36);
- _inventoryInfo[0] = 1; // ordering
- _inventoryInfo[1] = 2;
- _inventoryInfo[2] = 4;
+ _inventoryInfo[0] = kInventoryObjectBoomerang; // ordering
+ _inventoryInfo[1] = kInventoryObjectWallet;
+ _inventoryInfo[2] = kInventoryObjectTplTickets;
_inventoryInfo[36] = 1;
_inventoryInfo[37] = 2;
_inventoryInfo[39] = 3;
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 8e2e9b2bc3e..8b51a0517a9 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -111,7 +111,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
case 109: // take alarm clock
if (_objectsState[kAlarmClockTakenStateIndex] == 0) {
animateLitAnimFrames(0x8410, 0, 1, 0x405, 21, 49, 0x693D, 126, -1, 0);
- addObjectToInventory(6, 41);
+ addObjectToInventory(kInventoryObjectAlarmClock, 41);
_objectsState[kAlarmClockTakenStateIndex] = 1;
PART_00_APPLY_OBJECT_STATE(1);
}
@@ -148,7 +148,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
case 116: // take records
if (_objectsState[kRecordTakenStateIndex] == 0) {
animateLitAnimFrames(0x7C06, 0, 1, 0x405, 21, 49, 0x7146, 126, -1, 0);
- addObjectToInventory(5, 40);
+ addObjectToInventory(kInventoryObjectRecords, 40);
_objectsState[kRecordTakenStateIndex] = 1;
PART_00_APPLY_OBJECT_STATE(255);
} else {
diff --git a/engines/igor/parts/part_10.cpp b/engines/igor/parts/part_10.cpp
index 73c858c9e4e..dda46a2351e 100644
--- a/engines/igor/parts/part_10.cpp
+++ b/engines/igor/parts/part_10.cpp
@@ -104,7 +104,7 @@ void IgorEngine::PART_10_ACTION_104_pickHamburger() {
waitForTimer(31);
}
- addObjectToInventory(17, 52);
+ addObjectToInventory(kInventoryObjectBurger, 52);
_objectsState[kHamburgerTakenStateIndex] = 1;
}
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index 429cba2fe8c..da5ee0c5732 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -63,7 +63,7 @@ void IgorEngine::PART_11_ACTION_105_pickSlug() {
drawAnimRect(0x6167, kPart10_11_Frm1 + frame * 0x405, 21, 49);
waitForTimer(127);
}
- addObjectToInventory(18, 53);
+ addObjectToInventory(kInventoryObjectSlug, 53);
_objectsState[kSlugTakenStateIndex] = 1;
PART_11_APPLY_OBJECT_STATE(255);
}
@@ -120,7 +120,7 @@ void IgorEngine::PART_11_ACTION_112_pickBottle() {
drawAnimRect(0x47E3, kPart10_11_Frm2 + frame * 0x348, 30, 28);
waitForTimer(61);
}
- addObjectToInventory(23, 58);
+ addObjectToInventory(kInventoryObjectBottle, 58);
_objectsState[kButterflyNetStateIndex] = 1;
PART_11_APPLY_OBJECT_STATE(3);
_objectsState[kBottleStateIndex] = 1;
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 897509b0578..cda281633eb 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -240,7 +240,7 @@ void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
drawVerbsPanel();
redrawVerb(kVerbWalk, true);
_currentAction.verb = kVerbWalk;
- addObjectToInventory(24, 59);
+ addObjectToInventory(kInventoryObjectMoney, 59);
_objectsState[kLizardTakenStateIndex] = 1;
PART_12_OBJECT_STATE(255);
ADD_DIALOGUE_TEXT(211, 1, 795);
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 6b799161c88..e9926a8c82c 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -200,7 +200,7 @@ void IgorEngine::PART_14_ACTION_108_useMatchesOnCandles() {
decodeAnimFrame(src, _screenVGA, true);
waitForTimer(60);
}
- addObjectToInventory(28, 63);
+ addObjectToInventory(kInventoryObjectPapyrus, 63);
igorSayAndWait({ { 217, 1, 872 }, { 218, 1, 873 }, { 219, 1, 874 } });
cutsceneSay(221, 85, 12, 33, 63, 220, 2, 875);
PART_14_HELPER_7_candleFlicker(0);
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index cdf32139dba..ea26462ec78 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -55,7 +55,7 @@ void IgorEngine::PART_16_ACTION_101_pickUpFlask() {
drawAnimRect(offset, (i - 1) * 1127, 23, 49);
waitForTimer(120);
}
- addObjectToInventory(20, 55);
+ addObjectToInventory(kInventoryObjectFlask, 55);
_objectsState[kFlaskTakenStateIndex] = 1;
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
@@ -188,7 +188,7 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
PART_16_HELPER_1_OBJECT_STATE(255);
// Data-only inventory update: the panel is redrawn later together with the verbs
++_inventoryInfo[73];
- _inventoryInfo[_inventoryInfo[73] - 1] = 19;
+ _inventoryInfo[_inventoryInfo[73] - 1] = kInventoryObjectPhoto;
_inventoryInfo[54] = _inventoryInfo[73];
_inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
_objectsState[kPhotoCutsceneSeenStateIndex] = 1;
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index db0938a3e9d..e1b9b181bf9 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -72,7 +72,7 @@ void IgorEngine::PART_19_ACTION_107_lookAtSink() {
}
waitForTimer(120);
}
- addObjectToInventory(12, 47);
+ addObjectToInventory(kInventoryObjectHairpin, 47);
_objectsState[kHairpinTakenStateIndex] = 1;
PART_19_HELPER_1_OBJECT_STATE(255);
}
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index f372ee79ffc..f96dfaa5f53 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -185,7 +185,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
} else {
PART_02_searchTrunk();
igorSay(204, 1, 111);
- addObjectToInventory(9, 44);
+ addObjectToInventory(kInventoryObjectHammer, 44);
PART_02_APPLY_OBJECT_STATE(255);
}
break;
@@ -198,7 +198,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
igorSay(205, 1, 112);
removeObjectFromInventory(44);
playSound(63, 1);
- addObjectToInventory(10, 45);
+ addObjectToInventory(kInventoryObjectPickaxe, 45);
PART_02_APPLY_OBJECT_STATE(255);
}
break;
@@ -206,7 +206,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 && _inventoryInfo[46] == 0 && _objectsState[kDynamitePlacedStateIndex] == 0 && _objectsState[kAtticLargeCrackPresentStateIndex] != 0) {
PART_02_searchTrunk();
igorSay(206, 1, 113);
- addObjectToInventory(11, 46);
+ addObjectToInventory(kInventoryObjectDynamite, 46);
} else if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 && _inventoryInfo[46] == 0 && _objectsState[kDynamitePlacedStateIndex] == 0) {
igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
@@ -216,7 +216,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
case 107: // take butterfly net
animateLitAnimFrames(0x54D2, 0, 1, 0x405, 21, 49, 0x5A6D, 127, -1, 0);
waitForTimer(127);
- addObjectToInventory(7, 42);
+ addObjectToInventory(kInventoryObjectButterflyNet, 42);
_objectsState[kButterflyNetTakenStateIndex] = 1;
PART_02_APPLY_OBJECT_STATE(2);
break;
@@ -274,7 +274,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
igorSay(230, 1, 130);
} else {
igorSay(211, 2, 117);
- addObjectToInventory(8, 43);
+ addObjectToInventory(kInventoryObjectMatches, 43);
_objectsState[kMatchesTakenStateIndex] = 1;
}
break;
diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp
index b24c5b011bb..6be866935d8 100644
--- a/engines/igor/parts/part_22.cpp
+++ b/engines/igor/parts/part_22.cpp
@@ -57,7 +57,7 @@ void IgorEngine::PART_22_ACTION_101_lookAtBell() {
copyArea(_screenVGA, 24141, 320, frame, 35, 35, 30);
waitForTimer(60);
}
- addObjectToInventory(29, 64);
+ addObjectToInventory(kInventoryObjectPassword, 64);
PART_22_APPLY_OBJECT_STATE(255);
igorSay({ { 205, 1, 856 }, { 206, 1, 857 } });
_objectsState[kChurchBellMessageSeenStateIndex] = 1;
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index 5f56cfa2c74..3fc77039562 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -133,7 +133,7 @@ void IgorEngine::PART_27_ACTION_108_openLocker() {
waitForTimer(100);
}
}
- addObjectToInventory(23, 58);
+ addObjectToInventory(kInventoryObjectBottle, 58);
PART_27_HELPER_1_OBJECT_STATE(1);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index 29f006ac84f..f8f94277cd0 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -127,7 +127,7 @@ void IgorEngine::PART_28_ACTION_109_takeFolder() {
waitForTimer(45);
}
}
- addObjectToInventory(22, 57);
+ addObjectToInventory(kInventoryObjectFolder, 57);
_objectsState[kCarolineFolderStateIndex] = 1;
PART_28_HELPER_1_OBJECT_STATE(255);
igorSay(230, 1, 1250);
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index 0d086cca024..c046b153510 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -96,7 +96,7 @@ void IgorEngine::PART_33_ACTION_109_takeAstronomyBooks() {
}
waitForTimer(120);
}
- addObjectToInventory(31, 66);
+ addObjectToInventory(kInventoryObjectAstronomyBook, 66);
_objectsState[kAstronomyBookTakenStateIndex] = 1;
PART_33_HELPER_1_OBJECTS_STATE(255);
igorSayAndWait({ { 210, 1, 405 }, { 211, 2, 406 } });
@@ -158,7 +158,7 @@ void IgorEngine::PART_33_ACTION_114_showPhotoToHarrison() {
copyArea(_screenVGA, 26279, 320, _animFramesBuffer + PART_33_ANIM_DATA_5[i] * 1827 + 0x5104, 63, 62, 29);
waitForTimer(60);
}
- addObjectToInventory(35, 70);
+ addObjectToInventory(kInventoryObjectBiologyProject, 70);
PART_33_HELPER_1_OBJECTS_STATE(255);
PART_33_HarrisonSay({ { 233, 2, 422 } });
_objectsState[kHarrisonPhotoStateIndex] = 1;
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index c8519a965ee..73c52065bd3 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -216,7 +216,7 @@ void IgorEngine::PART_34_ACTION_103_takeResin() {
return;
}
PARK_PICK_UP_ANIMATION(16499, kParkPickUpFrames);
- addObjectToInventory(27, 62);
+ addObjectToInventory(kInventoryObjectResin, 62);
PART_34_APPLY_OBJECT_STATE(255);
}
@@ -264,7 +264,7 @@ void IgorEngine::PART_34_ACTION_108_giveLizardToOldLady() {
while (isDialogueSpeechPlaying() && !_eventQuitGame) {
waitForTimer();
}
- addObjectToInventory(26, 61);
+ addObjectToInventory(kInventoryObjectRocket, 61);
igorSay(226, 1, 577);
PARK_WAIT_FOR_IGOR_DIALOGUE();
cutsceneSayStart(121, 58, 63, 23, 0, { { 227, 2, 578 }, { 229, 1, 579 } });
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index 424046a6cc8..d299abf5ebd 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -62,7 +62,7 @@ void IgorEngine::PART_35_ACTION_102_takeResin() {
return;
}
PARK_PICK_UP_ANIMATION(16339, kParkFrames);
- addObjectToInventory(27, 62);
+ addObjectToInventory(kInventoryObjectResin, 62);
PART_35_APPLY_OBJECT_STATE(255);
}
diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp
index b4d343bf911..42a41b45946 100644
--- a/engines/igor/parts/part_36.cpp
+++ b/engines/igor/parts/part_36.cpp
@@ -83,7 +83,7 @@ void IgorEngine::PART_36_ACTION_102_takePen() {
copyArea(_screenVGA, 23750, 320, _screenTempLayer, 100, 34, 49);
waitForTimer(45);
}
- addObjectToInventory(30, 65);
+ addObjectToInventory(kInventoryObjectPen, 65);
_objectsState[kPenTakenStateIndex] = 1;
PART_36_HELPER_1_OBJECT_STATE(255);
if (_game.version == kIdEngDemo110) {
diff --git a/engines/igor/parts/part_37.cpp b/engines/igor/parts/part_37.cpp
index b403d5754ae..0318aacfefd 100644
--- a/engines/igor/parts/part_37.cpp
+++ b/engines/igor/parts/part_37.cpp
@@ -61,7 +61,7 @@ void IgorEngine::PART_37_ACTION_102_lookAtPaperBinTakePaper() {
drawAnimRect(offset, i * 1550, 31, 50);
waitForTimer(60);
}
- addObjectToInventory(32, 67);
+ addObjectToInventory(kInventoryObjectLabNote, 67);
_objectsState[kPhysicsClassPaperTakenStateIndex] = 1;
PART_37_HELPER_1_OBJECT_STATE(255);
if (_game.version == kIdEngDemo110) {
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index d6909b8cd85..76f6c691c7b 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -193,7 +193,7 @@ void IgorEngine::PART_05_ACTION_103_pickPaper() {
PART_05_UPDATE_ROOM_BACKGROUND();
waitForTimer();
} while (i != 3);
- addObjectToInventory(21, 56);
+ addObjectToInventory(kInventoryObjectLoveNote, 56);
_objectsState[kSpringBridgePaperStateIndex] = 1;
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index b1c5b6e2488..9328b55ceb6 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -181,7 +181,7 @@ void IgorEngine::PART_06_ACTION_105_pickCamera() {
PART_06_UPDATE_ROOM_BACKGROUND();
waitForTimer();
} while (i != 3);
- addObjectToInventory(36, 71);
+ addObjectToInventory(kInventoryObjectCamera, 71);
_objectsState[kTripodStateIndex] = 0;
PART_06_HELPER_6_setPhotographerState(255);
}
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index f9d9562cd82..4c2eb496a92 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -63,7 +63,6 @@ static const int kPart68TextG = 50;
static const int kPart68TextB = 0;
// Inventory objects.
-static const int kVaseInventoryNumber = 34;
static const int kPart68TakenObjectIndex = 69;
static const int kPart68GiveInventoryIndex = 40;
@@ -280,7 +279,7 @@ void IgorEngine::PART_68_ACTION_102_takeVase() {
PART_68_drawPose(frame);
waitForTimer(120);
}
- addObjectToInventory(kVaseInventoryNumber, kPart68TakenObjectIndex);
+ addObjectToInventory(kInventoryObjectVase, kPart68TakenObjectIndex);
_objectsState[kVaseTakenStateIndex] = 1;
PART_68_APPLY_OBJECT_STATE(255);
}
diff --git a/engines/igor/parts/part_69.cpp b/engines/igor/parts/part_69.cpp
index b2ad45cbfa8..ef7cb5f6d45 100644
--- a/engines/igor/parts/part_69.cpp
+++ b/engines/igor/parts/part_69.cpp
@@ -23,12 +23,12 @@
namespace Igor {
// The animation resource is made of several blocks, each one a table of frame offsets and the frames it points to:
-// the first and the second firefly of the room, the transformation and the ending.
-static const int kPart69FireflyAFramesBase = 0;
-static const int kPart69FireflyAFramesTable = 0xB138;
+// the swarm, the main firefly, the transformation and the ending.
+static const int kPart69SwarmFramesBase = 0;
+static const int kPart69SwarmFramesTable = 0xB138;
-static const int kPart69FireflyBFramesBase = 0xB200;
-static const int kPart69FireflyBFramesTable = 0xBBA;
+static const int kPart69MainFireflyFramesBase = 0xB200;
+static const int kPart69MainFireflyFramesTable = 0xBBA;
static const int kPart69FramesCBase = 0xBE3A;
static const int kPart69FramesCTable = 0x3FF;
@@ -45,21 +45,20 @@ static const int kPart69PictureHeight = 49;
static const int kPart69EntryY = 130;
static const int kPart69EntryDstX = 259;
-// The animation of the two fireflies is a sequence of steps (1 to 6). Each step plays the frames of the first firefly from
-// the first to the last frame of the step; every 5 steps of the first firefly the second firefly plays too. The values come
-// from the data segment of the executable (index 0 is not used).
-static const uint8 kPart69StepFirstFireflyFrameA[7] = { 37, 71, 1, 41, 0, 80, 20 };
-static const uint8 kPart69StepLastFireflyFrameA[7] = { 0, 80, 20, 50, 100, 40, 70 };
-static const uint8 kPart69StepNext[7] = { 70, 1, 2, 3, 2, 3, 1 };
-static const uint8 kPart69StepFirstFireflyFrameB[4] = { 1, 41, 1, 21 };
-static const uint8 kPart69StepLastFireflyFrameB[4] = { 0, 64, 20, 40 };
+// The swarm animation is a sequence of steps (1 to 6). Each step plays the swarm frames from
+// the first to the last frame of the step; every 5 swarm steps the main firefly plays too.
+static const uint8 kPart69SwarmStepFirstFrame[7] = { 37, 71, 1, 41, 0, 80, 20 };
+static const uint8 kPart69SwarmStepLastFrame[7] = { 0, 80, 20, 50, 100, 40, 70 };
+static const uint8 kPart69SwarmStepNext[7] = { 70, 1, 2, 3, 2, 3, 1 };
+static const uint8 kPart69MainFireflyStepFirstFrame[4] = { 1, 41, 1, 21 };
+static const uint8 kPart69MainFireflyStepLastFrame[4] = { 0, 64, 20, 40 };
-// The areas that answer to the step, and the areas of the second firefly.
-static const uint8 kPart69StepAreas[4] = { 0, 1, 52, 16 };
-static const uint8 kPart69SecondFireflyAreas[4] = { 0, 2, 72, 45 };
+// The areas that answer to the swarm step, and the areas of the main firefly.
+static const uint8 kPart69SwarmStepAreas[4] = { 0, 1, 52, 16 };
+static const uint8 kPart69MainFireflyAreas[4] = { 0, 2, 72, 45 };
-static const int kPart69FirstFireflyFrameA = 71;
-static const int kPart69FirstFireflyFrameB = 40;
+static const int kPart69SwarmInitialFrame = 71;
+static const int kPart69MainFireflyInitialFrame = 40;
static const int kPart69TalkFrameFirst = 0x29;
static const int kPart69TalkFrameLast = 0x32;
static const int kPart69TransformFrameLast = 0x16;
@@ -88,7 +87,7 @@ void IgorEngine::PART_69_EXEC_ACTION(int action) {
igorSay(210, 1, 1089);
break;
case 107:
- PART_69_ACTION_107_watch();
+ PART_69_ACTION_107_useVaseWithFireflies();
break;
case 108:
igorSay(215, 2, 1092);
@@ -107,8 +106,8 @@ void IgorEngine::PART_69_APPLY_OBJECT_STATE() {
return;
}
for (int i = 1; i <= 3; ++i) {
- _roomObjectAreasTable[kPart69StepAreas[i]].object = 0;
- _roomObjectAreasTable[kPart69SecondFireflyAreas[i]].object = 5;
+ _roomObjectAreasTable[kPart69SwarmStepAreas[i]].object = 0;
+ _roomObjectAreasTable[kPart69MainFireflyAreas[i]].object = 5;
}
for (int i = 0; i <= 5; ++i) {
if (_roomActionsTable[72 + i] == 1) {
@@ -117,18 +116,14 @@ void IgorEngine::PART_69_APPLY_OBJECT_STATE() {
}
}
-void IgorEngine::PART_69_DRAW_FIREFLY_A(int frame) {
- decodeAnimFrame(getAnimFrame(kPart69FireflyAFramesBase, kPart69FireflyAFramesTable, frame), _screenVGA, true);
+void IgorEngine::PART_69_drawSwarm(int frame) {
+ decodeAnimFrame(getAnimFrame(kPart69SwarmFramesBase, kPart69SwarmFramesTable, frame), _screenVGA, true);
}
-void IgorEngine::PART_69_DRAW_FIREFLY_B(int frame) {
- decodeAnimFrame(getAnimFrame(kPart69FireflyBFramesBase, kPart69FireflyBFramesTable, frame), _screenVGA, true);
+void IgorEngine::PART_69_drawMainFirefly(int frame) {
+ decodeAnimFrame(getAnimFrame(kPart69MainFireflyFramesBase, kPart69MainFireflyFramesTable, frame), _screenVGA, true);
}
-/**
- * Runs the sequence of the two fireflies, one frame of each every 16 ticks, and sets which places answer to the
- * fireflies.
- */
void IgorEngine::PART_69_animateFireflies() {
if (!compareGameTick(13, 16)) {
return;
@@ -140,24 +135,24 @@ void IgorEngine::PART_69_animateFireflies() {
uint8 &secondFirefly = _objectsState[kPart69LeaderFireflyPathStateIndex];
if (_part69FireflyStepCount == 5) {
secondFirefly = sequence;
- _part69FireflyFrameB = kPart69StepFirstFireflyFrameB[secondFirefly];
+ _part69FireflyFrameB = kPart69MainFireflyStepFirstFrame[secondFirefly];
_part69FireflyStepCount = 0;
}
if (secondFirefly > 0) {
- PART_69_DRAW_FIREFLY_B(_part69FireflyFrameB);
- if (kPart69StepLastFireflyFrameB[secondFirefly] == _part69FireflyFrameB) {
+ PART_69_drawMainFirefly(_part69FireflyFrameB);
+ if (kPart69MainFireflyStepLastFrame[secondFirefly] == _part69FireflyFrameB) {
secondFirefly = 0;
sequence += 3;
} else {
++_part69FireflyFrameB;
}
}
- PART_69_DRAW_FIREFLY_A(_part69FireflyFrameA);
- if (kPart69StepLastFireflyFrameA[sequence] == _part69FireflyFrameA) {
+ PART_69_drawSwarm(_part69FireflyFrameA);
+ if (kPart69SwarmStepLastFrame[sequence] == _part69FireflyFrameA) {
if (sequence > 3) {
- sequence = kPart69StepNext[sequence];
+ sequence = kPart69SwarmStepNext[sequence];
}
- _part69FireflyFrameA = kPart69StepFirstFireflyFrameA[sequence];
+ _part69FireflyFrameA = kPart69SwarmStepFirstFrame[sequence];
++_part69FireflyStepCount;
} else {
++_part69FireflyFrameA;
@@ -165,27 +160,27 @@ void IgorEngine::PART_69_animateFireflies() {
if (sequence > 3) {
for (int i = 1; i <= 3; ++i) {
- _roomObjectAreasTable[kPart69StepAreas[i]].object = 0;
+ _roomObjectAreasTable[kPart69SwarmStepAreas[i]].object = 0;
}
} else {
for (int i = 1; i <= 3; ++i) {
- _roomObjectAreasTable[kPart69StepAreas[i]].object = sequence == i ? 3 : 0;
+ _roomObjectAreasTable[kPart69SwarmStepAreas[i]].object = sequence == i ? 3 : 0;
}
}
if (secondFirefly > 0) {
for (int i = 1; i <= 3; ++i) {
- _roomObjectAreasTable[kPart69SecondFireflyAreas[i]].object = 5;
+ _roomObjectAreasTable[kPart69MainFireflyAreas[i]].object = 5;
}
} else {
for (int i = 1; i <= 3; ++i) {
- const bool answers = kPart69StepNext[sequence] == i && _objectsState[kPart69LeaderFireflyIdentifiedStateIndex] == 1;
- _roomObjectAreasTable[kPart69SecondFireflyAreas[i]].object = answers ? 4 : 5;
+ const bool answers = kPart69SwarmStepNext[sequence] == i && _objectsState[kPart69LeaderFireflyIdentifiedStateIndex] == 1;
+ _roomObjectAreasTable[kPart69MainFireflyAreas[i]].object = answers ? 4 : 5;
}
}
}
-void IgorEngine::PART_69_FINALE(int num, int sound) {
+void IgorEngine::PART_69_takeVaseBack(int num, int sound) {
for (int frame = kPart69EndingFrameLast; frame <= kPart69EndingFrameLast + 1; ++frame) {
decodeAnimFrame(getAnimFrame(kPart69FramesDBase, kPart69FramesDTable, frame), _screenVGA, true);
waitForTimer(46);
@@ -193,18 +188,15 @@ void IgorEngine::PART_69_FINALE(int num, int sound) {
igorSay(num, 2, sound);
}
-/**
- * Igor watches the fireflies. If the reward has not been given yet nothing happens for a while; otherwise the first
- * firefly transforms and the scene ends.
- */
-void IgorEngine::PART_69_ACTION_107_watch() {
+
+void IgorEngine::PART_69_ACTION_107_useVaseWithFireflies() {
drawAnimRect(kPart69PictureOffset, kPart69PictureAnimOffset, kPart69PictureWidth, kPart69PictureHeight);
if (_objectsState[kVaseStateIndex] == 0) {
for (int i = 0; i < 1000 / kTimerTicksCount && !_eventQuitGame; ++i) {
PART_69_animateFireflies();
waitForTimer();
}
- PART_69_FINALE(211, 1090);
+ PART_69_takeVaseBack(211, 1090);
return;
}
@@ -216,7 +208,7 @@ void IgorEngine::PART_69_ACTION_107_watch() {
uint8 frameC = 1;
do {
if (compareGameTick(13, 16)) {
- PART_69_DRAW_FIREFLY_A(_part69FireflyFrameA);
+ PART_69_drawSwarm(_part69FireflyFrameA);
_part69FireflyFrameA = _part69FireflyFrameA == kPart69TalkFrameLast ? kPart69TalkFrameFirst : _part69FireflyFrameA + 1;
decodeAnimFrame(getAnimFrame(kPart69FramesCBase, kPart69FramesCTable, frameC), _screenVGA, true);
if (frameC < kPart69TransformFrameLast) {
@@ -246,7 +238,7 @@ void IgorEngine::PART_69_ACTION_107_watch() {
}
playSound(51, 1);
PART_69_APPLY_OBJECT_STATE();
- PART_69_FINALE(213, 1091);
+ PART_69_takeVaseBack(213, 1091);
}
/**
@@ -307,14 +299,14 @@ void IgorEngine::PART_69() {
PART_69_APPLY_OBJECT_STATE();
memcpy(_screenVGA, _screenLayer1, 46080);
if (_objectsState[kPart69FireflyCapturedStateIndex] == 0) {
- PART_69_DRAW_FIREFLY_A(kPart69FirstFireflyFrameA);
- PART_69_DRAW_FIREFLY_B(kPart69FirstFireflyFrameB);
+ PART_69_drawSwarm(kPart69SwarmInitialFrame);
+ PART_69_drawMainFirefly(kPart69MainFireflyInitialFrame);
}
_part69FireflyStepCount = 0;
_part69FireflyFrameB = 0;
_objectsState[kPart69SwarmAnimationPhaseStateIndex] = 1;
_objectsState[kPart69LeaderFireflyPathStateIndex] = 0;
- _part69FireflyFrameA = kPart69FirstFireflyFrameA;
+ _part69FireflyFrameA = kPart69SwarmInitialFrame;
// the whole picture is darker than its palette
darkenPalette(_paletteBuffer, 1, 175, 10);
diff --git a/engines/igor/parts/part_71.cpp b/engines/igor/parts/part_71.cpp
index 0337c7e6831..49cce8ae89a 100644
--- a/engines/igor/parts/part_71.cpp
+++ b/engines/igor/parts/part_71.cpp
@@ -35,7 +35,6 @@ static const int kPart71StatuetteFrameHeight = 6;
static const int kPart71StatuetteFramesOffset = kPart71TakeFramesCount * kPart71TakeFrameSize;
static const int kPart71StatuetteNameIndex = 2;
-static const int kPart71StatuetteInventoryNumber = 25;
static const int kPart71StatuetteInventoryIndex = 60;
// What PART_71_APPLY_OBJECT_STATE refreshes.
@@ -119,7 +118,7 @@ void IgorEngine::PART_71_ACTION_102_takeObject() {
drawAnimRect(kPart71TakeOffset, i * kPart71TakeFrameSize, kPart71TakeWidth, kPart71TakeHeight, false, kBlendLitSpriteNoShade);
waitForTimer(kPart71TakeFrameDelay);
}
- addObjectToInventory(kPart71StatuetteInventoryNumber, kPart71StatuetteInventoryIndex);
+ addObjectToInventory(kInventoryObjectLizard, kPart71StatuetteInventoryIndex);
_objectsState[kStatuetteTakenStateIndex] = 1;
PART_71_APPLY_OBJECT_STATE(kPart71ApplyAll);
igorSay(204, 3, 996);
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
index c26f25321da..d140e6a5b57 100644
--- a/engines/igor/parts/part_72.cpp
+++ b/engines/igor/parts/part_72.cpp
@@ -37,7 +37,6 @@ static const int kPart72ObjectAreas[5] = { 42, 44, 50, 56, 61 };
// Screen positions of the five blinking eyes, each one drawn as two pixels two columns apart.
static const int kPart72EyeOffsets[5] = { 0x2C06, 0x135B, 0x0FC5, 0x23E7, 0x254D };
-static const int kPart72FlowerObjectNumber = 33;
static const int kPart72FlowerObjectIndex = 68;
static bool PART_72_shouldBlink(uint8 color) {
@@ -89,7 +88,7 @@ void IgorEngine::PART_72_ACTION_102_takeFlower() {
copyArea(_screenVGA, kPart72TakeOffset, 320, frame, kPart72TakeWidth, kPart72TakeWidth, kPart72TakeHeight);
waitForTimer(90);
}
- addObjectToInventory(kPart72FlowerObjectNumber, kPart72FlowerObjectIndex);
+ addObjectToInventory(kInventoryObjectFlower, kPart72FlowerObjectIndex);
_objectsState[kFlowerTakenStateIndex] = 1;
PART_72_APPLY_OBJECT_STATE();
igorSay(201, 1, 1093);
diff --git a/engines/igor/parts/part_73.cpp b/engines/igor/parts/part_73.cpp
index 60874a5a255..84ed033a35c 100644
--- a/engines/igor/parts/part_73.cpp
+++ b/engines/igor/parts/part_73.cpp
@@ -28,7 +28,6 @@ static const int kPart73PolicemanHeight = 52;
static const int kPart73PolicemanFrameSize = 26 * 53;
// Great dosicua
-static const int kPart73InventoryObject = 25;
static const int kPart73InventoryIndex = 60;
void IgorEngine::PART_73_drawPoliceman(int frame) {
@@ -90,7 +89,7 @@ void IgorEngine::PART_73_CUTSCENE() {
// removes the great dosicua
removeInventoryEntry(kPart73InventoryIndex);
++_inventoryInfo[73];
- _inventoryInfo[_inventoryInfo[73] - 1] = kPart73InventoryObject;
+ _inventoryInfo[_inventoryInfo[73] - 1] = kInventoryObjectLizard;
_inventoryInfo[kPart73InventoryIndex] = _inventoryInfo[73];
_inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
fadeOut(624);
diff --git a/engines/igor/parts/part_76.cpp b/engines/igor/parts/part_76.cpp
index 51c61ac32f1..7a7a6ba6f62 100644
--- a/engines/igor/parts/part_76.cpp
+++ b/engines/igor/parts/part_76.cpp
@@ -61,7 +61,6 @@ static const uint8 kPart76ParachuteFrames[20] = { 18, 19, 20, 21, 22, 23, 22, 23
static const int kPart76WalkEndX = 295;
static const int kPart76WalkEndY = 119;
-static const int kPart76ParachuteInvNumber = 3;
static const int kPart76ParachuteInventoryIndex = 38;
void IgorEngine::PART_76_EXEC_ACTION(int action) {
@@ -160,7 +159,7 @@ void IgorEngine::PART_76_ACTION_104_takeParachute() {
drawAnimRect(kPart76TakeParachuteOffset, kPart76TakeParachuteFrames + frame * kPart76TakeParachuteFrameSize, kPart76TakeParachuteWidth, kPart76TakeParachuteHeight);
waitForTimer(91);
}
- addObjectToInventory(kPart76ParachuteInvNumber, kPart76ParachuteInventoryIndex);
+ addObjectToInventory(kInventoryObjectParachute, kPart76ParachuteInventoryIndex);
_objectsState[kParachuteTakenStateIndex] = 1;
PART_76_APPLY_OBJECT_STATE();
igorSay({ { 203, 1, 702 }, { 204, 2, 703 } });
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index de20fb95286..ef800f3c5f7 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -99,7 +99,7 @@ void IgorEngine::PART_08_ACTION_pickNewspaper() {
if (frame == 0)
waitForTimer(127);
}
- addObjectToInventory(15, 50);
+ addObjectToInventory(kInventoryObjectNewspaper, 50);
_objectsState[kNewspaperTakenStateIndex] = 1;
PART_08_APPLY_OBJECT_STATE(255);
}
@@ -111,7 +111,7 @@ void IgorEngine::PART_08_ACTION_pickBook() {
waitForTimer(127);
}
- addObjectToInventory(13, 48);
+ addObjectToInventory(kInventoryObjectDeansBook, 48);
PART_08_APPLY_OBJECT_STATE(255);
_objectsState[kDeanBookTakenStateIndex] = 1;
}
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index 8d018026264..573f8bfe9fa 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -104,7 +104,7 @@ void IgorEngine::PART_09_ACTION_110_pickCostumeFromCloset() {
drawAnimRect(0x48E6, 0x9BA3 + frame * 0x438, 27, 40, false, kBlendLitSprite);
waitForTimer(127);
}
- addObjectToInventory(14, 49);
+ addObjectToInventory(kInventoryObjectMonkeySuit, 49);
_objectsState[kSecretaryClosetStateIndex] = 1;
PART_09_APPLY_OBJECT_STATE(255);
}
Commit: f3d0addc9373baf05f9cb6e624c0da5565c1ef33
https://github.com/scummvm/scummvm/commit/f3d0addc9373baf05f9cb6e624c0da5565c1ef33
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:55+01:00
Commit Message:
IGOR: Renames in astronomy lab
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_32.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 5f3c4cfbf02..04b4cfabe4e 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -427,7 +427,7 @@ enum ObjectStateIndex {
kHarrisonPhotoStateIndex = 75,
kHarrisonNoteShownStateIndex = 76,
kBellTowerConversationSeenStateIndex = 78,
- kFinalCoordinatesSceneSeenStateIndex = 79,
+ kSeenChickThroughTelescopeStateIndex = 79,
kLizardGivenStateIndex = 80,
kOldLadyConversationSeenStateIndex = 81,
kTreeResinDiscoveredStateIndex = 82,
@@ -1206,33 +1206,33 @@ private:
// telescope room
void PART_32_EXEC_ACTION(int action);
- void PART_32_ENTER();
+ void PART_32_walkIn();
void PART_32_ACTION_103_useControls();
void PART_32_ACTION_106_walkToControls();
- void PART_32_CONTROLS();
- void PART_32_CONTROLS_COPY_COLOR(int dstColor, int srcColor);
+ void PART_32_controls();
+ void PART_32_CONTROLS_copyColor(int dstColor, int srcColor);
int PART_32_CONTROLS_KEY_AT_CURSOR() const;
- void PART_32_CONTROLS_DRAW_DIGIT(int fieldOffset, int index, int key);
- void PART_32_CONTROLS_ERASE_DIGIT(int fieldOffset, int index);
- void PART_32_CONTROLS_IDLE(int fieldColor);
- void PART_32_CONTROLS_EXIT();
- void PART_32_CONTROLS_SELECT_DECLINATION();
- void PART_32_CONTROLS_SELECT_ASCENSION();
- void PART_32_CONTROLS_CONFIRM();
- int PART_32_CONTROLS_ANIMATE_DECLINATION();
- int PART_32_CONTROLS_ANIMATE_ASCENSION();
- void PART_32_LOAD_TOWER();
- void PART_32_LOAD_FINAL();
- void PART_32_DRAW_TOWER_FRAME(int frame);
- void PART_32_UPDATE_DIALOGUE_SPEAKER_A(int action);
- void PART_32_UPDATE_DIALOGUE_SPEAKER_B(int action);
- void PART_32_SPEAKER_A_SAYS(const Common::Array<DialogueText> &lines);
- void PART_32_SPEAKER_B_SAYS(const Common::Array<DialogueText> &lines);
+ void PART_32_drawDigit(int fieldOffset, int index, int key);
+ void PART_32_eraseDigit(int fieldOffset, int index);
+ void PART_32_controlsIdle(int fieldColor);
+ void PART_32_exitControls();
+ void PART_32_CONTROLS_selectDeclination();
+ void PART_32_CONTROLS_selectAscension();
+ void PART_32_CONTROLS_enterCoordinates();
+ int PART_32_CONTROLS_animateDeclination();
+ int PART_32_CONTROLS_animateAscension();
+ void PART_32_loadTowerScene();
+ void PART_32_loadGirlScene();
+ void PART_32_drawTowerConversationFrame(int frame);
+ void PART_32_updateDialogueSpeakerA(int action);
+ void PART_32_updateDialogueSpeakerB(int action);
+ void PART_32_speakerASays(const Common::Array<DialogueText> &lines);
+ void PART_32_speakerBSays(const Common::Array<DialogueText> &lines);
void PART_32_SCENE();
- void PART_32_SCENE_TOWER_CONVERSATION();
- void PART_32_SCENE_TOWER_EMPTY();
- void PART_32_SCENE_NOTHING();
- void PART_32_SCENE_FINAL();
+ void PART_32_sceneTowerConversation();
+ void PART_32_sceneTowerEmpty();
+ void PART_32_sceneNothing();
+ void PART_32_sceneGirl();
void PART_32();
// library
diff --git a/engines/igor/parts/part_32.cpp b/engines/igor/parts/part_32.cpp
index 929c2cef487..a539e3ee42a 100644
--- a/engines/igor/parts/part_32.cpp
+++ b/engines/igor/parts/part_32.cpp
@@ -36,7 +36,7 @@ enum {
kPart32ResultNone = 0,
kPart32ResultTower = 1,
kPart32ResultNothing = 2,
- kPart32ResultFinal = 3
+ kPart32ResultChick = 3
};
// The glyphs of the digits are 6x7 pixels, drawn 7 pixels apart.
@@ -79,7 +79,7 @@ static const int kPart32ControlsX = 117;
static const int kPart32ControlsY = 122;
// The frames of the final scene, in order (1-based index in the table of the data).
-static const uint8 kPart32FinalFrames[13] = { 1, 2, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5 };
+static const uint8 kPart32GirlFrames[13] = { 1, 2, 3, 4, 5, 4, 5, 4, 5, 4, 5, 4, 5 };
// The speakers of the tower scene.
static const int kPart32SpeakerAX = 147;
@@ -113,10 +113,8 @@ void IgorEngine::PART_32_EXEC_ACTION(int action) {
}
}
-/**
- * Igor comes in from the left edge, walking to the right.
- */
-void IgorEngine::PART_32_ENTER() {
+
+void IgorEngine::PART_32_walkIn() {
WalkData *wd = &_walkData[0];
wd->setPos(0, 143, kFacingPositionLeft, 0);
wd->clipSkipX = 11;
@@ -135,10 +133,6 @@ void IgorEngine::PART_32_ENTER() {
waitForIgorMove();
}
-/**
- * Igor stops where he is, walks to the place in front of the control panel (unless he is already there) and
- * uses it.
- */
void IgorEngine::PART_32_ACTION_106_walkToControls() {
if (_gameState.igorMoving) {
_walkDataLastIndex = _walkDataCurrentIndex + 1;
@@ -166,24 +160,26 @@ void IgorEngine::PART_32_ACTION_103_useControls() {
fadeOut(624);
memcpy(_animFramesBuffer, _screenVGA, 64000);
memcpy(_animFramesBuffer + 64000, _paletteBuffer, 768);
- PART_32_CONTROLS();
- if (_part32Result >= kPart32ResultTower && _part32Result <= kPart32ResultFinal) {
+ PART_32_controls();
+ if (_part32Result >= kPart32ResultTower && _part32Result <= kPart32ResultChick) {
PART_32_SCENE();
}
loadRoomData(PAL_Part32, IMG_Part32, BOX_Part32, MSK_Part32, TXT_Part32);
memcpy(_screenVGA, _animFramesBuffer, 64000);
memcpy(_paletteBuffer, _animFramesBuffer + 64000, 768);
fadeIn(768);
+
if (_part32Result == kPart32ResultTower) {
if (_objectsState[kBellTowerConversationSeenStateIndex] == 0 && _objectsState[kAstronomyBookStateIndex] == 2) {
igorSay(206, 3, 831);
_objectsState[kBellTowerConversationSeenStateIndex] = 1;
}
}
- if (_part32Result == kPart32ResultFinal) {
- if (_objectsState[kFinalCoordinatesSceneSeenStateIndex] == 0) {
+
+ if (_part32Result == kPart32ResultChick) {
+ if (_objectsState[kSeenChickThroughTelescopeStateIndex] == 0) {
igorSay({ { 209, 1, 832 }, { 210, 1, 833 } });
- _objectsState[kFinalCoordinatesSceneSeenStateIndex] = 1;
+ _objectsState[kSeenChickThroughTelescopeStateIndex] = 1;
} else {
igorSay(211, 1, 834);
}
@@ -193,15 +189,10 @@ void IgorEngine::PART_32_ACTION_103_useControls() {
}
}
-// The control panel
-
-void IgorEngine::PART_32_CONTROLS_COPY_COLOR(int dstColor, int srcColor) {
+void IgorEngine::PART_32_CONTROLS_copyColor(int dstColor, int srcColor) {
memcpy(_currentPalette + dstColor * 3, _currentPalette + srcColor * 3, 3);
}
-/**
- * The button under the cursor; the part of the screen below the picture has none.
- */
int IgorEngine::PART_32_CONTROLS_KEY_AT_CURSOR() const {
const int x = _inputVars[kInputCursorXPos];
const int y = _inputVars[kInputCursorYPos];
@@ -211,30 +202,26 @@ int IgorEngine::PART_32_CONTROLS_KEY_AT_CURSOR() const {
return _screenLayer2[y * 320 + x];
}
-void IgorEngine::PART_32_CONTROLS_DRAW_DIGIT(int fieldOffset, int index, int key) {
+void IgorEngine::PART_32_drawDigit(int fieldOffset, int index, int key) {
copyArea(_screenVGA, fieldOffset + index * kPart32DigitPitch, 320, _part32Glyphs + (key - 1) * kPart32GlyphSize,
kPart32GlyphWidth, kPart32GlyphWidth, kPart32GlyphHeight);
}
-void IgorEngine::PART_32_CONTROLS_ERASE_DIGIT(int fieldOffset, int index) {
+void IgorEngine::PART_32_eraseDigit(int fieldOffset, int index) {
for (int row = 0; row < kPart32GlyphHeight; ++row) {
memset(_screenVGA + fieldOffset + index * kPart32DigitPitch + row * 320, 0, kPart32GlyphWidth);
}
}
-/**
- * What every pass of a selected field does after its click: the escape key leaves the panel, the color that
- * marks the field blinks once in a while and the game waits for the next tick.
- */
-void IgorEngine::PART_32_CONTROLS_IDLE(int fieldColor) {
+void IgorEngine::PART_32_controlsIdle(int fieldColor) {
if (_inputVars[kInputEscape]) {
- PART_32_CONTROLS_EXIT();
+ PART_32_exitControls();
}
if (compareGameTick(0)) {
if (_part32Blink == 1) {
- PART_32_CONTROLS_COPY_COLOR(fieldColor, kPart32FieldColor);
+ PART_32_CONTROLS_copyColor(fieldColor, kPart32FieldColor);
} else if (_part32Blink == 2) {
- PART_32_CONTROLS_COPY_COLOR(fieldColor, 0);
+ PART_32_CONTROLS_copyColor(fieldColor, 0);
}
setPaletteRange(fieldColor, fieldColor);
_part32Blink = _part32Blink == 1 ? 2 : 1;
@@ -242,21 +229,19 @@ void IgorEngine::PART_32_CONTROLS_IDLE(int fieldColor) {
waitForTimer();
}
-void IgorEngine::PART_32_CONTROLS_EXIT() {
+void IgorEngine::PART_32_exitControls() {
playSound(getRandomNumber(1) + 0x42, 1);
- PART_32_CONTROLS_COPY_COLOR(kPart32DeclinationColor, kPart32FieldColor);
- PART_32_CONTROLS_COPY_COLOR(kPart32AscensionColor, kPart32FieldColor);
+ PART_32_CONTROLS_copyColor(kPart32DeclinationColor, kPart32FieldColor);
+ PART_32_CONTROLS_copyColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
_part32Done = true;
}
-/**
- * The declination field is selected: the digits typed go to it until the other field or a button is chosen.
- */
-void IgorEngine::PART_32_CONTROLS_SELECT_DECLINATION() {
+
+void IgorEngine::PART_32_CONTROLS_selectDeclination() {
playSound(31, 1);
- PART_32_CONTROLS_COPY_COLOR(kPart32DeclinationColor, kPart32FieldColor);
- PART_32_CONTROLS_COPY_COLOR(kPart32AscensionColor, kPart32FieldColor);
+ PART_32_CONTROLS_copyColor(kPart32DeclinationColor, kPart32FieldColor);
+ PART_32_CONTROLS_copyColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32AscensionColor, kPart32AscensionColor);
_part32Blink = 2;
do {
@@ -271,7 +256,7 @@ void IgorEngine::PART_32_CONTROLS_SELECT_DECLINATION() {
if (_part32DeclinationIndex == 1 && _part32DeclinationDigits[0] == 9 && key < 10) {
continue;
}
- PART_32_CONTROLS_DRAW_DIGIT(kPart32DeclinationDigitsOffset, _part32DeclinationIndex, key);
+ PART_32_drawDigit(kPart32DeclinationDigitsOffset, _part32DeclinationIndex, key);
_part32DeclinationDigits[_part32DeclinationIndex] = key % 10;
if (_part32DeclinationIndex < 1) {
++_part32DeclinationIndex;
@@ -280,26 +265,23 @@ void IgorEngine::PART_32_CONTROLS_SELECT_DECLINATION() {
if (_part32DeclinationDigits[_part32DeclinationIndex] == 0xFF && _part32DeclinationIndex > 0) {
--_part32DeclinationIndex;
}
- PART_32_CONTROLS_ERASE_DIGIT(kPart32DeclinationDigitsOffset, _part32DeclinationIndex);
+ PART_32_eraseDigit(kPart32DeclinationDigitsOffset, _part32DeclinationIndex);
_part32DeclinationDigits[_part32DeclinationIndex] = 0xFF;
} else if (key == kPart32KeyAscension) {
- PART_32_CONTROLS_SELECT_ASCENSION();
+ PART_32_CONTROLS_selectAscension();
} else if (key == kPart32KeyConfirm) {
- PART_32_CONTROLS_CONFIRM();
+ PART_32_CONTROLS_enterCoordinates();
} else if (key == kPart32KeyExit) {
- PART_32_CONTROLS_EXIT();
+ PART_32_exitControls();
}
}
- PART_32_CONTROLS_IDLE(kPart32DeclinationColor);
+ PART_32_controlsIdle(kPart32DeclinationColor);
} while (!_part32Done);
}
-/**
- * The ascension field is selected.
- */
-void IgorEngine::PART_32_CONTROLS_SELECT_ASCENSION() {
+void IgorEngine::PART_32_CONTROLS_selectAscension() {
playSound(31, 1);
- PART_32_CONTROLS_COPY_COLOR(kPart32DeclinationColor, kPart32FieldColor);
+ PART_32_CONTROLS_copyColor(kPart32DeclinationColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32DeclinationColor);
_part32Blink = 2;
do {
@@ -320,7 +302,7 @@ void IgorEngine::PART_32_CONTROLS_SELECT_ASCENSION() {
if (_part32AscensionIndex == 2 && _part32AscensionDigits[0] == 3 && _part32AscensionDigits[1] == 6 && key < 10) {
continue;
}
- PART_32_CONTROLS_DRAW_DIGIT(kPart32AscensionDigitsOffset, _part32AscensionIndex, key);
+ PART_32_drawDigit(kPart32AscensionDigitsOffset, _part32AscensionIndex, key);
_part32AscensionDigits[_part32AscensionIndex] = key % 10;
if (_part32AscensionIndex < 2) {
++_part32AscensionIndex;
@@ -329,45 +311,39 @@ void IgorEngine::PART_32_CONTROLS_SELECT_ASCENSION() {
if (_part32AscensionDigits[_part32AscensionIndex] == 0xFF && _part32AscensionIndex > 0) {
--_part32AscensionIndex;
}
- PART_32_CONTROLS_ERASE_DIGIT(kPart32AscensionDigitsOffset, _part32AscensionIndex);
+ PART_32_eraseDigit(kPart32AscensionDigitsOffset, _part32AscensionIndex);
_part32AscensionDigits[_part32AscensionIndex] = 0xFF;
} else if (key == kPart32KeyDeclination) {
- PART_32_CONTROLS_SELECT_DECLINATION();
+ PART_32_CONTROLS_selectDeclination();
} else if (key == kPart32KeyConfirm) {
- PART_32_CONTROLS_CONFIRM();
+ PART_32_CONTROLS_enterCoordinates();
} else if (key == kPart32KeyExit) {
- PART_32_CONTROLS_EXIT();
+ PART_32_exitControls();
}
}
- PART_32_CONTROLS_IDLE(kPart32AscensionColor);
+ PART_32_controlsIdle(kPart32AscensionColor);
} while (!_part32Done);
}
-/**
- * The coordinates are set: the two lines move to them and the scene that belongs to them is chosen.
- */
-void IgorEngine::PART_32_CONTROLS_CONFIRM() {
+void IgorEngine::PART_32_CONTROLS_enterCoordinates() {
playSound(getRandomNumber(1) + 0x42, 1);
- PART_32_CONTROLS_COPY_COLOR(kPart32DeclinationColor, kPart32FieldColor);
- PART_32_CONTROLS_COPY_COLOR(kPart32AscensionColor, kPart32FieldColor);
+ PART_32_CONTROLS_copyColor(kPart32DeclinationColor, kPart32FieldColor);
+ PART_32_CONTROLS_copyColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
- const int declination = PART_32_CONTROLS_ANIMATE_DECLINATION();
- const int ascension = PART_32_CONTROLS_ANIMATE_ASCENSION();
+ const int declination = PART_32_CONTROLS_animateDeclination();
+ const int ascension = PART_32_CONTROLS_animateAscension();
waitForTimer(100);
if (declination == kPart32TowerDeclination && ascension == kPart32TowerAscension) {
_part32Result = kPart32ResultTower;
} else if (declination == kPart32FinalDeclination && ascension == kPart32FinalAscension) {
- _part32Result = kPart32ResultFinal;
+ _part32Result = kPart32ResultChick;
} else {
_part32Result = kPart32ResultNothing;
}
_part32Done = true;
}
-/**
- * The declination typed (a single digit is the unit) and the horizontal line rising to it, 1 row per step.
- */
-int IgorEngine::PART_32_CONTROLS_ANIMATE_DECLINATION() {
+int IgorEngine::PART_32_CONTROLS_animateDeclination() {
playSound(30, 1);
uint8 *digits = _part32DeclinationDigits;
if (digits[1] == 0xFF) {
@@ -392,11 +368,7 @@ int IgorEngine::PART_32_CONTROLS_ANIMATE_DECLINATION() {
return declination;
}
-/**
- * The ascension typed (the last digit is the unit) and the vertical line moving to it, 1 column per step. It is
- * cut at the row of the horizontal line.
- */
-int IgorEngine::PART_32_CONTROLS_ANIMATE_ASCENSION() {
+int IgorEngine::PART_32_CONTROLS_animateAscension() {
playSound(30, 1);
uint8 *digits = _part32AscensionDigits;
if (digits[2] == 0xFF) {
@@ -435,10 +407,9 @@ int IgorEngine::PART_32_CONTROLS_ANIMATE_ASCENSION() {
}
/**
- * The picture with the digit boxes. Clicking a button of it does what the button says; the escape key and the exit
- * button leave.
+ * The picture with the digit boxes.
*/
-void IgorEngine::PART_32_CONTROLS() {
+void IgorEngine::PART_32_controls() {
loadData(PAL_Part32Lock, _paletteBuffer);
loadData(IMG_Part32Lock, _screenLayer1);
uint8 *mask = loadData(MSK_Part32Lock);
@@ -461,24 +432,24 @@ void IgorEngine::PART_32_CONTROLS() {
_inputVars[kInputClick] = 0;
switch (PART_32_CONTROLS_KEY_AT_CURSOR()) {
case kPart32KeyDeclination:
- PART_32_CONTROLS_SELECT_DECLINATION();
+ PART_32_CONTROLS_selectDeclination();
break;
case kPart32KeyAscension:
- PART_32_CONTROLS_SELECT_ASCENSION();
+ PART_32_CONTROLS_selectAscension();
break;
case kPart32KeyConfirm:
- PART_32_CONTROLS_CONFIRM();
+ PART_32_CONTROLS_enterCoordinates();
break;
case kPart32KeyExit:
- PART_32_CONTROLS_EXIT();
+ PART_32_exitControls();
break;
}
}
if (_inputVars[kInputEscape]) {
- PART_32_CONTROLS_EXIT();
+ PART_32_exitControls();
}
- PART_32_CONTROLS_COPY_COLOR(kPart32DeclinationColor, kPart32FieldColor);
- PART_32_CONTROLS_COPY_COLOR(kPart32AscensionColor, kPart32FieldColor);
+ PART_32_CONTROLS_copyColor(kPart32DeclinationColor, kPart32FieldColor);
+ PART_32_CONTROLS_copyColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
// the original polls the input here without waiting
waitForTimer();
@@ -490,10 +461,9 @@ void IgorEngine::PART_32_CONTROLS() {
// The scenes
/**
- * The tower scenes and the final one have their own pictures and palettes. The tower scenes also have their
- * own texts, which replace the ones of the room until it is loaded again.
+ * The tower scenes and the girl one have their own pictures and palettes.
*/
-void IgorEngine::PART_32_LOAD_TOWER() {
+void IgorEngine::PART_32_loadTowerScene() {
loadData(PAL_Part32Tower, _paletteBuffer);
// the pictures start 1 byte into the buffer; the table of the offsets of the frames follows them
loadData(ANM_Part32Tower, _screenLayer1 + 1);
@@ -502,109 +472,99 @@ void IgorEngine::PART_32_LOAD_TOWER() {
free(texts);
}
-void IgorEngine::PART_32_LOAD_FINAL() {
- loadData(PAL_Part32Final, _paletteBuffer);
- loadData(IMG_Part32Final, _screenLayer1);
+void IgorEngine::PART_32_loadGirlScene() {
+ loadData(PAL_Part32Girl, _paletteBuffer);
+ loadData(IMG_Part32Girl, _screenLayer1);
// the offsets of the frames, and the frames after them
- loadData(ANM_Part32Final, _screenLayer2);
+ loadData(ANM_Part32Girl, _screenLayer2);
}
-void IgorEngine::PART_32_DRAW_TOWER_FRAME(int frame) {
+void IgorEngine::PART_32_drawTowerConversationFrame(int frame) {
const uint8 *src = _screenLayer1 + READ_LE_UINT16(_screenLayer1 + kPart32TowerFramesTable + frame * 2);
decodeAnimFrame(src, _screenVGA, true);
}
-/**
- * The man in the tower talks: his mouth is closed when a sentence ends and open in one of 5 ways while it goes on.
- */
-void IgorEngine::PART_32_UPDATE_DIALOGUE_SPEAKER_A(int action) {
+void IgorEngine::PART_32_updateDialogueSpeakerA(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_32_DRAW_TOWER_FRAME(9);
+ PART_32_drawTowerConversationFrame(9);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_32_DRAW_TOWER_FRAME(getRandomNumber(4) + 9);
+ PART_32_drawTowerConversationFrame(getRandomNumber(4) + 9);
break;
}
}
-/**
- * The other man in the tower talks.
- */
-void IgorEngine::PART_32_UPDATE_DIALOGUE_SPEAKER_B(int action) {
+void IgorEngine::PART_32_updateDialogueSpeakerB(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_32_DRAW_TOWER_FRAME(4);
+ PART_32_drawTowerConversationFrame(4);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_32_DRAW_TOWER_FRAME(getRandomNumber(4) + 4);
+ PART_32_drawTowerConversationFrame(getRandomNumber(4) + 4);
break;
}
}
-void IgorEngine::PART_32_SPEAKER_A_SAYS(const Common::Array<DialogueText> &lines) {
+void IgorEngine::PART_32_speakerASays(const Common::Array<DialogueText> &lines) {
cutsceneSayWithCallback(kPart32SpeakerAX, kPart32SpeakerAY, 63, 59, 0, lines,
- &IgorEngine::PART_32_UPDATE_DIALOGUE_SPEAKER_A);
+ &IgorEngine::PART_32_updateDialogueSpeakerA);
}
-void IgorEngine::PART_32_SPEAKER_B_SAYS(const Common::Array<DialogueText> &lines) {
+void IgorEngine::PART_32_speakerBSays(const Common::Array<DialogueText> &lines) {
cutsceneSayWithCallback(kPart32SpeakerBX, kPart32SpeakerBY, 63, 21, 21, lines,
- &IgorEngine::PART_32_UPDATE_DIALOGUE_SPEAKER_B);
+ &IgorEngine::PART_32_updateDialogueSpeakerB);
}
/**
* The scene of the coordinates that were set.
*/
void IgorEngine::PART_32_SCENE() {
- const bool tower = _part32Result != kPart32ResultFinal;
+ const bool tower = _part32Result != kPart32ResultChick;
if (tower) {
- PART_32_LOAD_TOWER();
+ PART_32_loadTowerScene();
} else {
- PART_32_LOAD_FINAL();
+ PART_32_loadGirlScene();
}
memset(_screenVGA, 0, 46080);
switch (_part32Result) {
case kPart32ResultTower:
if (_objectsState[kBellTowerConversationSeenStateIndex] == 0 && _objectsState[kAstronomyBookStateIndex] == 2) {
- PART_32_SCENE_TOWER_CONVERSATION();
+ PART_32_sceneTowerConversation();
} else {
- PART_32_SCENE_TOWER_EMPTY();
+ PART_32_sceneTowerEmpty();
}
break;
case kPart32ResultNothing:
- PART_32_SCENE_NOTHING();
+ PART_32_sceneNothing();
break;
- case kPart32ResultFinal:
- PART_32_SCENE_FINAL();
+ case kPart32ResultChick:
+ PART_32_sceneGirl();
break;
}
fadeOut(tower ? 624 : 768);
}
-/**
- * The two men in the bell tower talk about the signal hidden in the bell. Seen once.
- */
-void IgorEngine::PART_32_SCENE_TOWER_CONVERSATION() {
- PART_32_DRAW_TOWER_FRAME(2);
- PART_32_DRAW_TOWER_FRAME(3);
+
+void IgorEngine::PART_32_sceneTowerConversation() {
+ PART_32_drawTowerConversationFrame(2);
+ PART_32_drawTowerConversationFrame(3);
fadeIn(624);
- PART_32_SPEAKER_A_SAYS({ { 201, 2, 835 } });
- PART_32_SPEAKER_B_SAYS({ { 203, 1, 836 }, { 204, 1, 837 }, { 205, 1, 838 }, { 206, 2, 839 } });
- PART_32_SPEAKER_A_SAYS({ { 208, 1, 840 } });
- PART_32_SPEAKER_B_SAYS({ { 209, 2, 841 }, { 211, 1, 842 } });
- PART_32_SPEAKER_A_SAYS({ { 212, 1, 843 } });
- PART_32_SPEAKER_B_SAYS({ { 213, 2, 844 }, { 215, 2, 845 } });
- PART_32_SPEAKER_A_SAYS({ { 217, 1, 846 } });
- PART_32_SPEAKER_B_SAYS({ { 218, 1, 847 }, { 219, 2, 848 }, { 221, 1, 849 }, { 222, 2, 850 } });
- PART_32_SPEAKER_A_SAYS({ { 224, 1, 851 } });
+ PART_32_speakerASays({ { 201, 2, 835 } });
+ PART_32_speakerBSays({ { 203, 1, 836 }, { 204, 1, 837 }, { 205, 1, 838 }, { 206, 2, 839 } });
+ PART_32_speakerASays({ { 208, 1, 840 } });
+ PART_32_speakerBSays({ { 209, 2, 841 }, { 211, 1, 842 } });
+ PART_32_speakerASays({ { 212, 1, 843 } });
+ PART_32_speakerBSays({ { 213, 2, 844 }, { 215, 2, 845 } });
+ PART_32_speakerASays({ { 217, 1, 846 } });
+ PART_32_speakerBSays({ { 218, 1, 847 }, { 219, 2, 848 }, { 221, 1, 849 }, { 222, 2, 850 } });
+ PART_32_speakerASays({ { 224, 1, 851 } });
waitForTimer(255);
}
-/**
- * The tower again, with nobody there.
- */
-void IgorEngine::PART_32_SCENE_TOWER_EMPTY() {
- PART_32_DRAW_TOWER_FRAME(2);
+
+void IgorEngine::PART_32_sceneTowerEmpty() {
+ PART_32_drawTowerConversationFrame(2);
fadeIn(624);
waitForTimer(255);
cutsceneSayStart(160, 70, 63, 63, 63, 227, 1, 853);
@@ -612,11 +572,9 @@ void IgorEngine::PART_32_SCENE_TOWER_EMPTY() {
waitForTimer(255);
}
-/**
- * Coordinates without anything special.
- */
-void IgorEngine::PART_32_SCENE_NOTHING() {
- PART_32_DRAW_TOWER_FRAME(1);
+
+void IgorEngine::PART_32_sceneNothing() {
+ PART_32_drawTowerConversationFrame(1);
fadeIn(624);
waitForTimer(255);
cutsceneSayStart(160, 70, 63, 63, 63, 225, 2, 852);
@@ -625,15 +583,15 @@ void IgorEngine::PART_32_SCENE_NOTHING() {
}
/**
- * The animation of the last coordinates.
+ * The animation of the girl
*/
-void IgorEngine::PART_32_SCENE_FINAL() {
+void IgorEngine::PART_32_sceneGirl() {
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
memcpy(_screenVGA, _screenLayer1, 46080);
fadeIn(768);
- for (int i = 0; i < ARRAYSIZE(kPart32FinalFrames); ++i) {
- const int frame = kPart32FinalFrames[i];
+ for (int i = 0; i < ARRAYSIZE(kPart32GirlFrames); ++i) {
+ const int frame = kPart32GirlFrames[i];
decodeAnimFrame(_screenLayer2 + READ_LE_UINT16(_screenLayer2 + frame * 2 - 2) + 9, _screenVGA, false);
waitForTimer(50);
}
@@ -655,7 +613,7 @@ void IgorEngine::PART_32() {
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_32_ENTER();
+ PART_32_walkIn();
}
enterPartLoop();
while (_currentPart == 320 && !_gameStateLoaded) {
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 4ad1e5d1572..957891364de 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -765,9 +765,9 @@
#define ANM_Part32Tower 1155
#define TXT_Part32Tower 1156
#define PAL_Part32Tower 1157
-#define IMG_Part32Final 1158
-#define PAL_Part32Final 1159
-#define ANM_Part32Final 1160
+#define IMG_Part32Girl 1158
+#define PAL_Part32Girl 1159
+#define ANM_Part32Girl 1160
// State 770 (PART_77)
#define DAT_Part77 1161
Commit: 406ee796087fcb9df0c9dd150d9206bcbf29a204
https://github.com/scummvm/scummvm/commit/406ee796087fcb9df0c9dd150d9206bcbf29a204
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:55+01:00
Commit Message:
IGOR: Make bottle not play shatter sound when net is placed
Changed paths:
engines/igor/parts/part_73.cpp
engines/igor/parts/part_8.cpp
diff --git a/engines/igor/parts/part_73.cpp b/engines/igor/parts/part_73.cpp
index 84ed033a35c..edd248ad325 100644
--- a/engines/igor/parts/part_73.cpp
+++ b/engines/igor/parts/part_73.cpp
@@ -100,6 +100,8 @@ void IgorEngine::PART_73_CUTSCENE() {
PART_80();
setupDefaultPalette();
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index ef800f3c5f7..49e49cc7b68 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -306,12 +306,14 @@ void IgorEngine::PART_08_EXEC_ACTION(int action) {
if (pendingDeanDrink != kPart08PendingDeanDrinkNone) {
waitForTimer(251);
PART_08_deanDrinksBottle();
- if (_objectsState[kButterflyNetStateIndex] == 1)
+ const bool bottleCaught = _objectsState[kButterflyNetStateIndex] == 1;
+ if (bottleCaught)
_objectsState[kButterflyNetStateIndex] = 2;
else
_objectsState[kGlassShardsPresentStateIndex] = 1;
waitForTimer(101);
- playSound(16, 1);
+ if (!bottleCaught)
+ playSound(16, 1);
if (pendingDeanDrink == kPart08PendingDeanDrinkWater) {
PART_08_deanPassesOut();
_objectsState[kDeanPassedOutStateIndex] = 1;
Commit: d7f55af9e1284c1fc5bfc0a511a311c746ab065f
https://github.com/scummvm/scummvm/commit/d7f55af9e1284c1fc5bfc0a511a311c746ab065f
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:56+01:00
Commit Message:
IGOR: Consolidate a naming convention for parts
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/part_main.cpp
engines/igor/parts/part_0.cpp
engines/igor/parts/part_1.cpp
engines/igor/parts/part_10.cpp
engines/igor/parts/part_11.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_13.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_15.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_18.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_22.cpp
engines/igor/parts/part_23.cpp
engines/igor/parts/part_24.cpp
engines/igor/parts/part_25.cpp
engines/igor/parts/part_26.cpp
engines/igor/parts/part_27.cpp
engines/igor/parts/part_28.cpp
engines/igor/parts/part_30.cpp
engines/igor/parts/part_31.cpp
engines/igor/parts/part_32.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
engines/igor/parts/part_36.cpp
engines/igor/parts/part_37.cpp
engines/igor/parts/part_4.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_50.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_69.cpp
engines/igor/parts/part_7.cpp
engines/igor/parts/part_70.cpp
engines/igor/parts/part_71.cpp
engines/igor/parts/part_72.cpp
engines/igor/parts/part_73.cpp
engines/igor/parts/part_74.cpp
engines/igor/parts/part_75.cpp
engines/igor/parts/part_76.cpp
engines/igor/parts/part_77.cpp
engines/igor/parts/part_78.cpp
engines/igor/parts/part_79.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_80.cpp
engines/igor/parts/part_81.cpp
engines/igor/parts/part_85.cpp
engines/igor/parts/part_9.cpp
engines/igor/parts/part_90.cpp
engines/igor/parts/part_credits.cpp
engines/igor/parts/part_margaret.cpp
engines/igor/parts/part_maze.cpp
engines/igor/parts/part_maze_data.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index e4f47481752..baad73dbea9 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -237,7 +237,7 @@ Common::Error IgorEngine::run() {
if (saveSlot != -1)
(void)loadGameState(saveSlot);
- PART_MAIN();
+ partMain();
_ovlFile.close();
_sndFile.close();
@@ -287,7 +287,7 @@ void IgorEngine::leavePartLoop() {
_roomClickFix.enabled = false;
_roomGiveObjectSize = 0;
hideCursor();
- SET_EXEC_ACTION_FUNC(1, 0);
+ partMainSetExecuteAction(1, 0);
_updateRoomBackground = 0;
}
@@ -579,7 +579,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
fadeOut(768);
_gameStateLoaded = true;
memcpy(_igorPalette, (_currentPart == 760) ? PAL_IGOR_2 : PAL_IGOR_1, 48);
- UPDATE_OBJECT_STATE(255);
+ partMainUpdateObjectState(255);
playMusic(_gameState.musicNum, true);
_system->warpMouse(_inputVars[kInputCursorXPos], _inputVars[kInputCursorYPos]);
if (_currentPart < 900) {
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 04b4cfabe4e..2c29ef653e5 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -754,7 +754,7 @@ private:
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 partMainSetExecuteAction(int i, ExecuteActionProc p);
// One-call dialogue helpers. Each queues the given lines as consecutive pages and starts them.
@@ -790,745 +790,745 @@ private:
void stopDialogueSpeech();
void cancelDialogue();
- void PART_MAIN();
- void moveScreenUp(int offset);
- void lookAtPapyrus(bool reveal);
- void EXEC_MAIN_ACTION(int action);
- void EXEC_MAIN_ACTION_38_lookAtNewspaper();
- void EXEC_MAIN_ACTION_43_lookAtPhoto();
+ void partMain();
+ void partMainMoveScreenUp(int offset);
+ void partMainLookAtPapyrus(bool reveal);
+ void partMainExecuteAction(int action);
+ void partMainLookAtNewspaper();
+ void partMainLookAtPhoto();
// map
- void PART_04_EXEC_ACTION(int action);
- void PART_04();
+ void part4ExecuteAction(int action);
+ void part4();
// Igors room
- void PART_00();
- void PART_00_EXEC_ACTION(int action);
- void PART_00_APPLY_OBJECT_STATE(int num);
- void PART_00_ENTRY_ANIMATION();
- void PART_00_WALK_IN_FROM_CLOSET();
- void PART_00_ENTER_FROM_BELOW();
+ void part0();
+ void part0ExecuteAction(int action);
+ void part0ApplyObjectState(int num);
+ void part0EntryAnimation();
+ void part0WalkInFromCloset();
+ void part0EnterFromBelow();
// Rooftop
- void PART_01();
- void PART_01_EXEC_ACTION(int action);
- void PART_01_CLOSE_WINDOW();
- void PART_01_STATE_11_BLIT_blitIgor();
- void PART_01_STATE_11_BLIT_blitRoof();
- void PART_01_STATE_11_BLIT_drawIgorsEyes(int frame);
- void PART_01_STATE_11_DRAW_drawPigeons(int index);
- void PART_01_STATE_11_pigeonsCutscene();
- void PART_01_STATE_12_explosion();
+ void part1();
+ void part1ExecuteAction(int action);
+ void part1CloseWindow();
+ void part1DrawIgor();
+ void part1DrawRoof();
+ void part1DrawIgorsEyes(int frame);
+ void part1DrawPigeons(int index);
+ void part1PigeonsCutscene();
+ void part1Explosion();
// junk room
- void PART_02();
- void PART_02_EXEC_ACTION(int action);
- void PART_02_lightUpDynamite();
- void PART_02_APPLY_OBJECT_STATE(int num);
- void PART_02_searchTrunk();
- void PART_02_drawFuseSpark(int frame);
- void PART_02_updateFuse();
- void PART_02_walkWhileFuseBurns(int srcX, int srcY, int dstX, int dstY);
+ void part2();
+ void part2ExecuteAction(int action);
+ void part2LightUpDynamite();
+ void part2ApplyObjectState(int num);
+ void part2SearchTrunk();
+ void part2DrawFuseSpark(int frame);
+ void part2UpdateFuse();
+ void part2WalkWhileFuseBurns(int srcX, int srcY, int dstX, int dstY);
// spring bridge
- void PART_05_HELPER_4_drawPaperOrNot(int num);
- void PART_05_HELPER_6_walkIgorToScene();
- void PART_05_06_drawPaperFrame(int frame);
- void PART_05_06_SAVE_PHOTOGRAPHER_BACKGROUND();
- void PART_05_06_DRAW_PHOTOGRAPHER();
- void PART_05_06_DRAW_CAMERA(int frame);
- void PART_05_06_DRAW_TRIPOD(bool drawToScreen);
- void PART_05();
- void PART_05_EXEC_ACTION(int action);
- void PART_05_ACTION_103_pickPaper();
- void PART_05_ACTION_102_scrollRight();
- void PART_05_UPDATE_ROOM_BACKGROUND();
+ void part5ApplyPaperState(int num);
+ void part5WalkIgorToScene();
+ void part5And6DrawPaperFrame(int frame);
+ void part5And6SavePhotographerBackground();
+ void part5And6DrawPhotographer();
+ void part5And6DrawCamera(int frame);
+ void part5And6DrawTripod(bool drawToScreen);
+ void part5();
+ void part5ExecuteAction(int action);
+ void part5TakePaper();
+ void part5ScrollRight();
+ void part5UpdateBackground();
// spring rock
- void PART_06();
- void PART_06_UPDATE_ROOM_BACKGROUND();
- void PART_06_EXEC_ACTION(int action);
- void PART_06_ACTION_103_talkToPhotographer();
- void PART_06_HANDLE_DIALOGUE_PHOTOGRAPHER();
- void PART_06_UPDATE_DIALOGUE_PHOTOGRAPHER(int action);
- void PART_06_HELPER_7_decodePhotographerTalkingFrame(int frame);
- void PART_06_ACTION_105_pickCamera();
- void PART_06_ACTION_107_giveAnythingToPhotographer();
- void PART_06_ACTION_108_giveRocketToPhotographer();
- void PART_06_ACTION_102_scrollLeft();
- void PART_06_HELPER_6_setPhotographerState(int num);
- void PART_06_HELPER_8_animatePhotographer(int frame);
- void PART_06_HELPER_12_drawBackgroundOverPhotographer();
-
- void PART_07();
- void PART_07_EXEC_ACTION(int action);
- void PART_07_DRAW_DOOR_STATE(int num);
- void PART_07_openCloseDoor(int door, bool open);
- void PART_07_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame, int dyPos);
- void PART_07_enterFromOutside();
- void PART_07_exitToOutside();
+ void part6();
+ void part6UpdateBackground();
+ void part6ExecuteAction(int action);
+ void part6TalkToPhotographer();
+ void part6HandlePhotographerDialogue();
+ void part6UpdatePhotographerDialogue(int action);
+ void part6DecodePhotographerTalkingFrame(int frame);
+ void part6TakeCamera();
+ void part6GiveAnythingToPhotographer();
+ void part6GiveRocketToPhotographer();
+ void part6ScrollLeft();
+ void part6SetPhotographerState(int num);
+ void part6AnimatePhotographer(int frame);
+ void part6DrawBackgroundOverPhotographer();
+
+ void part7();
+ void part7ExecuteAction(int action);
+ void part7DrawDoorState(int num);
+ void part7OpenCloseDoor(int door, bool open);
+ void part7DrawScaledIgor(int scaleStep, int facing, int frame, int dyPos);
+ void part7EnterFromOutside();
+ void part7ExitToOutside();
// Dean's office
- void PART_08();
- void PART_08_EXEC_ACTION(int action);
- void PART_08_APPLY_OBJECT_STATE(int num);
- void drawDoor(bool open);
- void PART_08_ACTION_pickNewspaper();
- void PART_08_ACTION_108_deanCallsSecretary();
- void PART_08_ACTION_pickBook();
- void PART_08_ACTION_103_talkToDean();
- void giveBottleToDean();
- void PART_08_deanDrinksBottle();
- void PART_08_deanPassesOut();
- void PART_08_HANDLE_DIALOGUE_DEAN();
- void PART_08_HANDLE_DIALOGUE_INTERCOM();
- void drawDean();
- void drawDeanTalkingFrame(int frame);
- void PART_08_UPDATE_DIALOGUE_DEAN(int action);
- void drawSecretaryTalkingFrame(int frame);
- void PART_08_UPDATE_DIALOGUE_SECRETARY(int action);
- void PART_09();
- void PART_09_EXEC_ACTION(int action);
- void PART_09_APPLY_OBJECT_STATE(int num);
- void PART_09_ANIMATE_DOOR(bool open);
- void PART_09_drawSecretaryFrame(int frame, bool background);
- void PART_09_DRAW_openClosetFrame(int frame);
- void PART_09_ACTION_101_openFileCabinet();
- void PART_09_ACTION_106_openCloset(bool search);
- void PART_09_ACTION_110_pickCostumeFromCloset();
- void PART_09_UPDATE_DIALOGUE_SECRETARY(int action);
- void PART_09_DRAW_secretaryTalkingFrame(int frame);
- void PART_09_secretarySearchesFile();
- void PART_09_UPDATE_ROOM_BACKGROUND();
+ void part8();
+ void part8ExecuteAction(int action);
+ void part8ApplyObjectState(int num);
+ void part8DrawDoor(bool open);
+ void part8TakeNewspaper();
+ void part8DeanCallsSecretary();
+ void part8TakeBook();
+ void part8TalkToDean();
+ void part8GiveBottleToDean();
+ void part8DeanDrinksBottle();
+ void part8DeanPassesOut();
+ void part8HandleDeanDialogue();
+ void part8HandleIntercomDialogue();
+ void part8DrawDean();
+ void part8DrawDeanTalkingFrame(int frame);
+ void part8UpdateDeanDialogue(int action);
+ void part8DrawSecretaryTalkingFrame(int frame);
+ void part8UpdateSecretaryDialogue(int action);
+ void part9();
+ void part9ExecuteAction(int action);
+ void part9ApplyObjectState(int num);
+ void part9AnimateDoor(bool open);
+ void part9DrawSecretaryFrame(int frame, bool background);
+ void part9DrawOpenClosetFrame(int frame);
+ void part9OpenFileCabinet();
+ void part9OpenCloset(bool search);
+ void part9TakeCostumeFromCloset();
+ void part9UpdateSecretaryDialogue(int action);
+ void part9DrawSecretaryTalkingFrame(int frame);
+ void part9SecretarySearchesFile();
+ void part9UpdateBackground();
// Decanato right
- void PART_10();
- void PART_10_EXEC_ACTION(int action);
- void PART_10_ACTION_104_pickHamburger();
- void PART_10_ACTION_108_scrollLeft();
- void PART_10_11_DRAW_OBJECT_STATE(int num);
+ void part10();
+ void part10ExecuteAction(int action);
+ void part10TakeHamburger();
+ void part10ScrollLeft();
+ void part10And11DrawObjectState(int num);
// Decanato left
- void PART_11();
- void PART_11_EXEC_ACTION(int action);
- void PART_11_ACTION_105_pickSlug();
- void PART_11_ACTION_107_useButterflyNetWithHole();
- void PART_11_ACTION_108_scrollRight();
- void PART_11_ACTION_112_pickBottle();
- void PART_11_APPLY_OBJECT_STATE(int num);
+ void part11();
+ void part11ExecuteAction(int action);
+ void part11TakeSlug();
+ void part11UseButterflyNetWithHole();
+ void part11ScrollRight();
+ void part11TakeBottle();
+ void part11ApplyObjectState(int num);
// outside church
- void PART_12_EXEC_ACTION(int action);
- void PART_12_ACTION_goToPath();
- void PART_12_ACTION_104_tryEnterChurch();
- void PART_12_ACTION_105_useResinWithStone();
- void PART_12_ACTION_108_enterChurch();
- void PART_12_UPDATE_ROOM_BACKGROUND();
- void PART_12_UPDATE_DIALOGUE_PRIEST(int action);
- void PART_12_HANDLE_DIALOGUE_PRIEST();
- void PART_12_OBJECT_STATE(int num);
- void PART_12_HELPER_2_disablePathBehindChurch();
- void PART_12_HELPER_3_paintOverLizard();
- void PART_12_HELPER_4_exorcismCutscene();
- void PART_12_HELPER_5_enterFromPath();
- void PART_12_HELPER_6_enterFromChurch();
- void PART_12_HELPER_8_drawIdlePriest();
- void PART_12_HELPER_9_drawEntrance();
- void PART_12_HELPER_10_drawPriestTalkingFrame(int frame);
- void PART_12();
+ void part12ExecuteAction(int action);
+ void part12GoToPath();
+ void part12TryEnterChurch();
+ void part12UseResinWithStone();
+ void part12EnterChurch();
+ void part12UpdateBackground();
+ void part12UpdatePriestDialogue(int action);
+ void part12HandlePriestDialogue();
+ void part12ApplyObjectState(int num);
+ void part12DisablePathBehindChurch();
+ void part12PaintOverLizard();
+ void part12ExorcismCutscene();
+ void part12EnterFromPath();
+ void part12EnterFromChurch();
+ void part12DrawIdlePriest();
+ void part12DrawEntrance();
+ void part12DrawPriestTalkingFrame(int frame);
+ void part12();
// inside church
- void PART_13_EXEC_ACTION(int action);
- void PART_13_ACTION_101_103_goToPlatform();
- void PART_13_ACTION_104_exitChurch();
- void PART_13_HELPER_OBJECT_STATE(int num);
- void PART_13_HELPER_2_enterFromRight();
- void PART_13_HELPER_3_enterFromBelow();
- void PART_13();
+ void part13ExecuteAction(int action);
+ void part13GoToPlatform();
+ void part13ExitChurch();
+ void part13ApplyObjectState(int num);
+ void part13EnterFromRight();
+ void part13EnterFromBelow();
+ void part13();
// church puzzle
- void PART_14_EXEC_ACTION(int action);
- void PART_14_UPDATE_ROOM_BACKGROUND_ACTION_108();
- void PART_14_ACTION_101_goToChurchBell();
- void PART_14_ACTION_103_lookAtPuzzle();
- void PART_14_ACTION_105_goBackToChurch();
- void PART_14_ACTION_106_enterMaze();
- void PART_14_ACTION_108_useMatchesOnCandles();
- void PART_14_HELPER_1_OBJECT_STATE(int num);
- void PART_14_HELPER_2_enterFromChurch();
- void PART_14_HELPER_3_enterFromChurchBell();
- void PART_14_HELPER_4_enterFromMaze();
- void PART_14_HELPER_6_drawEntrance();
- void PART_14_HELPER_7_candleFlicker(int frame);
- void PART_14_HELPER_8_brotherReveal(int start, int end);
- void PART_14_HELPER_9_showPuzzle();
- void PART_14_HELPER_10_loadChurchMosaicData();
- void PART_14_pushStone(int screenOffset, int w, int h, int animOffset);
- void PART_14();
- void loadResourceData__ROOM_ChurchPuzzle();
- void loadResourceData__ANIM_ChurchPuzzle();
+ void part14ExecuteAction(int action);
+ void part14UpdateCandleFlicker();
+ void part14GoToChurchBell();
+ void part14LookAtPuzzle();
+ void part14GoBackToChurch();
+ void part14EnterMaze();
+ void part14UseMatchesOnCandles();
+ void part14ApplyObjectState(int num);
+ void part14EnterFromChurch();
+ void part14EnterFromChurchBell();
+ void part14EnterFromMaze();
+ void part14DrawEntrance();
+ void part14CandleFlicker(int frame);
+ void part14BrotherReveal(int start, int end);
+ void part14ShowPuzzle();
+ void part14LoadChurchMosaicData();
+ void part14PushStone(int screenOffset, int w, int h, int animOffset);
+ void part14();
+ void part14LoadRoom();
+ void part14LoadAnimation();
// tobias office
- void PART_15_EXEC_ACTION(int action);
- void PART_15_ACTION_101_leaveRoom();
- void PART_15_ACTION_107_talkToTobias();
- void PART_15_ACTION_115_giveProjectToTobias();
- void PART_15_ACTION_116_giveMoneyToTobias();
- 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_OBJECT_STATE(int num);
- void PART_15_HELPER_2_walkIn();
- void PART_15_HELPER_3_updateCuckooClock();
- void PART_15_waitForCuckooClock();
- void PART_15_HELPER_5_animateTobiasIdle();
- void PART_15_HELPER_6_drawCuckooFrame(int frame);
- void PART_15_HELPER_7_drawIgorAndTobiasScene(int frame);
- void PART_15_HELPER_8_drawTobiasTalking(int frame);
- void PART_15_PART_15_HELPER_9_drawTobiasIdleFrame(int frame);
- void PART_15();
+ void part15ExecuteAction(int action);
+ void part15LeaveRoom();
+ void part15TalkToTobias();
+ void part15GiveProjectToTobias();
+ void part15GiveMoneyToTobias();
+ void part15UpdateBackground();
+ void part15UpdateTobiasDialogue(int action);
+ void part15HandleTobiasDialogue();
+ void part15ApplyObjectState(int num);
+ void part15WalkIn();
+ void part15UpdateCuckooClock();
+ void part15WaitForCuckooClock();
+ void part15AnimateTobiasIdle();
+ void part15DrawCuckooFrame(int frame);
+ void part15DrawIgorAndTobiasScene(int frame);
+ void part15DrawTobiasTalking(int frame);
+ void part15DrawTobiasIdleFrame(int frame);
+ void part15();
// laboratory
- void PART_16_EXEC_ACTION(int action);
- void PART_16_ACTION_101_pickUpFlask();
- void PART_16_UPDATE_DIALOGUE_MARGARET_HARRISON(int action);
- void PART_16_UPDATE_DIALOGUE_MARGARET(int action);
- void PART_16_HELPER_1_OBJECT_STATE(int num);
- void PART_16_HELPER_2_enterScene();
- void PART_16_HELPER_3_photoCutscene();
- void PART_16_HELPER_5_displayPhoto();
- void PART_16_HELPER_6_drawTalkingFrame(int frame);
- void PART_16();
- void loadResourceData__ROOM_Laboratory();
- void loadResourceData__ANIM_Laboratory();
+ void part16ExecuteAction(int action);
+ void part16TakeFlask();
+ void part16UpdateMargaretHarrisonDialogue(int action);
+ void part16UpdateMargaretDialogue(int action);
+ void part16ApplyObjectState(int num);
+ void part16EnterScene();
+ void part16PhotoCutscene();
+ void part16DisplayPhoto();
+ void part16DrawTalkingFrame(int frame);
+ void part16();
+ void part16LoadRoom();
+ void part16LoadAnimation();
// outside college
- void PART_17_EXEC_ACTION(int action);
- void PART_17_ACTION_101_walkIn(bool lateGame = false);
- void PART_17_ACTION_103_talkPhilipJimmy();
- void PART_17_ACTION_105_leaveThroughPath(bool lateGame = false);
- void PART_17_ACTION_106_swapFolders();
- void PART_17_HANDLE_DIALOGUE_PHILIP();
- void PART_17_UPDATE_DIALOGUE_Jimmy(int action);
- void PART_17_UPDATE_DIALOGUE_Philip(int action);
- void PART_17_UPDATE_ROOM_BACKGROUND();
- void PART_17_HELPER_1_OBJECT_STATE(int num);
- void PART_17_HELPER_2_walkFromMap(bool lateGame = false);
- void PART_17_HELPER_2_setYScaleRamp();
- void PART_17_HELPER_2_clearEntryAreas();
- void PART_17_HELPER_3_disableArea(int lum);
- void PART_17_HELPER_4_paintFirsFrameOfPhilipAndJimmy();
- void PART_17_HELPER_5_changeZindexOfPath(int lum);
- void PART_17_HELPER_6_walkFromCollege();
- void PART_17_HELPER_8_PhillipToJimmyAnimFrame(int num);
- void PART_17_HELPER_9_JimmyTalkingAnimFrame(int num);
- void PART_17_HELPER_11_PhillipToIgor(int frame);
- void PART_17();
+ void part17ExecuteAction(int action);
+ void part17WalkIn(bool lateGame = false);
+ void part17TalkToPhilipAndJimmy();
+ void part17LeaveThroughPath(bool lateGame = false);
+ void part17SwapFolders();
+ void part17HandlePhilipDialogue();
+ void part17UpdateJimmyDialogue(int action);
+ void part17UpdatePhilipDialogue(int action);
+ void part17UpdateBackground();
+ void part17ApplyObjectState(int num);
+ void part17WalkFromMap(bool lateGame = false);
+ void part17SetYScaleRamp();
+ void part17ClearEntryAreas();
+ void part17DisableArea(int lum);
+ void part17PaintFirstFrameOfPhilipAndJimmy();
+ void part17ChangePathZIndex(int lum);
+ void part17WalkFromCollege();
+ void part17PhilipToJimmyAnimFrame(int num);
+ void part17JimmyTalkingAnimFrame(int num);
+ void part17PhilipToIgor(int frame);
+ void part17();
// men toilets
- void PART_18_EXEC_ACTION(int action);
- void PART_18_ACTION_109_useSlugOnGrating();
- void PART_18_ACTION_111_useBottleOnTap();
- void PART_18_HELPER_1_OBJECT_STATE(int num);
- void PART_18_HELPER_2_walkIn();
- void PART_18();
- void loadResourceData__ROOM_MenToilets();
- void loadResourceData__ANIM_MenToilets();
+ void part18ExecuteAction(int action);
+ void part18UseSlugOnGrating();
+ void part18UseBottleOnTap();
+ void part18ApplyObjectState(int num);
+ void part18WalkIn();
+ void part18();
+ void part18LoadRoom();
+ void part18LoadAnimation();
// women toilets
- void PART_19_EXEC_ACTION(int action);
- void PART_19_ACTION_107_lookAtSink();
- void PART_19_ACTION_109_usePapyrusOnDryer();
- void PART_19_UPDATE_DIALOGUE_WOMEN(int action);
- void PART_19_UPDATE_BACKGROUND_HELPER_9();
- void PART_19_HELPER_1_OBJECT_STATE(int num);
- void PART_19_HELPER_2_slugCutscene();
- void PART_19_HELPER_3_walkIn();
- void PART_19_HELPER_4_enterAndLeave();
- void PART_19_HELPER_7_drawTalkingFrame(int frame);
- void PART_19();
+ void part19ExecuteAction(int action);
+ void part19LookAtSink();
+ void part19UsePapyrusOnDryer();
+ void part19UpdateWomenDialogue(int action);
+ void part19UpdateBackground();
+ void part19ApplyObjectState(int num);
+ void part19SlugCutscene();
+ void part19WalkIn();
+ void part19EnterAndLeave();
+ void part19DrawTalkingFrame(int frame);
+ void part19();
// college corridor margaret
- void PART_21_EXEC_ACTION(int action);
- void PART_21_ACTION_101_leaveLeft();
- void PART_21_ACTION_102_talkToMargaret();
- void PART_21_ACTION_107_openPhysicsDoor();
- void PART_21_ACTION_108_closePhysicsDoor();
- void PART_21_ACTION_110_leaveRight();
- void PART_21_ACTION_111_useNoteWithSandwhiches();
- void PART_21_ACTION_113_enterPhysicsClass();
- 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_OBJECT_STATE(int num);
- void PART_21_HELPER_2_enterFromLeft();
- void PART_21_HELPER_3_enterFromRight();
- void PART_21_HELPER_4_enterFromPhysicsClass();
- void PART_21_HELPER_5_waitForIgorWalkWithAnimation();
- void PART_21_HELPER_6_drawMargaretFrameComposited(int frame);
- void PART_21_HELPER_7_drawClosedDoor();
- void PART_21_HELPER_8_drawOpenDoor();
- void PART_21_HELPER_9_drawMargaret();
- void PART_21_HELPER_10_MargaretTakesNote();
- void PART_21_HELPER_11_setMargaretBackgroundFrame(int frame);
- void PART_21();
+ void part21ExecuteAction(int action);
+ void part21LeaveLeft();
+ void part21TalkToMargaret();
+ void part21OpenPhysicsDoor();
+ void part21ClosePhysicsDoor();
+ void part21LeaveRight();
+ void part21UseNoteWithSandwiches();
+ void part21EnterPhysicsClass();
+ void part21UpdateBackground();
+ void part21UpdateMargaretBackgroundDialogue(int action);
+ void part21UpdateMargaretCompositedDialogue(int action);
+ void part21UpdateMargaretNoteDialogue(int action);
+ void part21HandleMargaretDialogue();
+ void part21ApplyObjectState(int num);
+ void part21EnterFromLeft();
+ void part21EnterFromRight();
+ void part21EnterFromPhysicsClass();
+ void part21WaitForIgorWalkWithAnimation();
+ void part21DrawMargaretFrameComposited(int frame);
+ void part21DrawClosedDoor();
+ void part21DrawOpenDoor();
+ void part21DrawMargaret();
+ void part21MargaretTakesNote();
+ void part21SetMargaretBackgroundFrame(int frame);
+ void part21();
// church bell tower
- void PART_22_EXEC_ACTION(int action);
- void PART_22_ACTION_101_lookAtBell();
- void PART_22_ACTION_102_leave();
- void PART_22_APPLY_OBJECT_STATE(int num);
- void PART_22_IGOR_STEP(int facing, int step);
- void PART_22_SCROLL_STEP(int step);
- void PART_22_enter();
- void PART_22();
+ void part22ExecuteAction(int action);
+ void part22LookAtBell();
+ void part22Leave();
+ void part22ApplyObjectState(int num);
+ void part22IgorStep(int facing, int step);
+ void part22ScrollStep(int step);
+ void part22Enter();
+ void part22();
// college corridor lucas
- void PART_23_EXEC_ACTION(int action);
- void PART_23_ACTION_105_enterLadiesRoom();
- void PART_23_ACTION_107_openDoor();
- void PART_23_ACTION_108_closeDoor();
- void PART_23_UPDATE_ROOM_BACKGROUND();
- void PART_23_HELPER_1_APPLY_OBJECT_STATE(int num);
- void PART_23_HELPER_2_drawDoor(int frame);
- void PART_23_HELPER_3_drawLucas();
- void PART_23_HELPER_4_walkFromDoor();
- void PART_23_HELPER_5_walkFromLeft();
- void PART_23_HELPER_6_walkFromRight();
- void PART_23_HELPER_7_drawLucasFrame(int frame);
- void PART_23();
+ void part23ExecuteAction(int action);
+ void part23EnterLadiesRoom();
+ void part23OpenDoor();
+ void part23CloseDoor();
+ void part23UpdateBackground();
+ void part23ApplyObjectState(int num);
+ void part23DrawDoor(int frame);
+ void part23DrawLucas();
+ void part23WalkFromDoor();
+ void part23WalkFromLeft();
+ void part23WalkFromRight();
+ void part23DrawLucasFrame(int frame);
+ void part23();
// college corridor sharon michael
- void PART_24_EXEC_ACTION(int action);
- void PART_24_ACTION_102_enterChemistryClass();
- void PART_24_ACTION_104_closeDoor();
- void PART_24_ACTION_105_openDoor();
- void PART_24_ACTION_107_goToLibrary();
- void PART_24_UPDATE_ROOM_BACKGROUND();
- void PART_24_HELPER_1_OBJECT_STATE(int num);
- void PART_24_HELPER_2_talkingFrameSharon(int frame);
- void PART_24_HELPER_3_talkingFrameMichael(int frame);
- void PART_24_HELPER_4_drawClosedDoor();
- void PART_24_HELPER_5_drawOpenDoor();
- void PART_24_HELPER_7_enterFromLeft();
- void PART_24_HELPER_8_enterFromRight();
- void PART_24_HELPER_9_enterFromChemistryClass();
- void PART_24();
+ void part24ExecuteAction(int action);
+ void part24EnterChemistryClass();
+ void part24CloseDoor();
+ void part24OpenDoor();
+ void part24GoToLibrary();
+ void part24UpdateBackground();
+ void part24ApplyObjectState(int num);
+ void part24DrawSharonTalkingFrame(int frame);
+ void part24DrawMichaelTalkingFrame(int frame);
+ void part24DrawClosedDoor();
+ void part24DrawOpenDoor();
+ void part24EnterFromLeft();
+ void part24EnterFromRight();
+ void part24EnterFromChemistryClass();
+ void part24();
// college corridor announcement board
- void PART_25_EXEC_ACTION(int action);
- void PART_25_ACTION_105_enterMensToilet();
- void PART_25_ACTION_107_openDoor();
- void PART_25_ACTION_108_closeDoor();
- void PART_25_HELPER_1_OBJECT_STATE(int num);
- void PART_25_HELPER_2_enterFromLeft();
- void PART_25_HELPER_3_enterFromRight();
- void PART_25_HELPER_4_enterFromMensToilet();
- void PART_25_HELPER_5_drawClosedDoor();
- void PART_25_HELPER_7_drawOpenDoor();
- void PART_25();
+ void part25ExecuteAction(int action);
+ void part25EnterMensToilet();
+ void part25OpenDoor();
+ void part25CloseDoor();
+ void part25ApplyObjectState(int num);
+ void part25EnterFromLeft();
+ void part25EnterFromRight();
+ void part25EnterFromMensToilet();
+ void part25DrawClosedDoor();
+ void part25DrawOpenDoor();
+ void part25();
// college corridor miss barrymore
- void PART_26_EXEC_ACTION(int action);
- void PART_26_ACTION_103_openDoor();
- void PART_26_ACTION_104_closeDoor();
- void PART_26_ACTION_107();
- void PART_26_UPDATE_ROOM_BACKGROUND();
- void PART_26_HELPER_1_OBJECT_STATE(int num);
- void PART_26_HELPER_2_drawClosedDoor();
- void PART_26_HELPER_3_drawOpenDoor();
- void PART_26_HELPER_4_enterFromRight();
- void PART_26_HELPER_5_enterFromLaboratory();
- void PART_26_HELPER_7_drawMissSullivanFrame(int frame);
- void PART_26();
+ void part26ExecuteAction(int action);
+ void part26OpenDoor();
+ void part26CloseDoor();
+ void part26EnterLab();
+ void part26UpdateBackground();
+ void part26ApplyObjectState(int num);
+ void part26DrawClosedDoor();
+ void part26DrawOpenDoor();
+ void part26EnterFromRight();
+ void part26EnterFromLaboratory();
+ void part26DrawMissSullivanFrame(int frame);
+ void part26();
// college lockers
- void PART_27_EXEC_ACTION(int action);
- void PART_27_ACTION_106_openPhilipLocker();
- void PART_27_ACTION_107_closeLocker();
- void PART_27_ACTION_108_openLocker();
- void PART_27_ACTION_110_useFlaskOnLocker();
- void PART_27_HELPER_1_OBJECT_STATE(int num);
- void PART_27_HELPER_2_enterFromLeft();
- void PART_27_HELPER_3_drawClosedLocker();
- void PART_27_HELPER_4_drawOpenLocker();
- void PART_27_HELPER_5_enterFromLibrary();
- void PART_27();
+ void part27ExecuteAction(int action);
+ void part27OpenPhilipLocker();
+ void part27CloseLocker();
+ void part27OpenLocker();
+ void part27UseFlaskOnLocker();
+ void part27ApplyObjectState(int num);
+ void part27EnterFromLeft();
+ void part27DrawClosedLocker();
+ void part27DrawOpenLocker();
+ void part27EnterFromLibrary();
+ void part27();
// college corridor caroline
- void PART_28_EXEC_ACTION(int action);
- void PART_28_ACTION_108_talkCaroline();
- void PART_28_ACTION_109_takeFolder();
- void PART_28_UPDATE_DIALOGUE_CAROLINE(int action);
- void PART_28_UPDATE_ROOM_BACKGROUND();
- void PART_28_HELPER_1_OBJECT_STATE(int num);
- void PART_28_HELPER_2_drawCaroline();
- void PART_28_HELPER_3_enterFromRight();
- void PART_28_HELPER_5_drawCarolineTalkingFrame(int frame);
- void PART_28_HELPER_6_enterAndCheckGrades();
- void PART_28_HELPER_8(int frame);
- void PART_28();
+ void part28ExecuteAction(int action);
+ void part28TalkToCaroline();
+ void part28TakeFolder();
+ void part28UpdateCarolineDialogue(int action);
+ void part28UpdateBackground();
+ void part28ApplyObjectState(int num);
+ void part28DrawCaroline();
+ void part28EnterFromRight();
+ void part28DrawCarolineTalkingFrame(int frame);
+ void part28EnterAndCheckGrades();
+ void part28DrawFolder(int frame);
+ void part28();
// college corridor stairs first floor
- void PART_30_EXEC_ACTION(int action);
- void PART_30_ACTION_102_goUpstairs();
- void PART_30_ACTION_104_goDownstairs();
- void PART_30_UPDATE_DIALOGUE_LAURA(int action);
- void PART_30_HANDLE_DIALOGUE_LAURA();
- void PART_30_HELPER_1_OBJECT_STATE(int num);
- void PART_30_HELPER_2_walkInFromLeft();
- void PART_30_HELPER_3_walkInFromUpstairs();
- void PART_30_HELPER_2_walkInFromOutside();
- void PART_30_HELPER_5_walkInFromRight();
- void PART_30_HELPER_8_LauraCutscene();
- void lauraAndIgorBumpIntoEachOther();
- void igorCrossesArms();
- void lauraLeaves();
- void PART_30_HELPER_9_setLauraFrame(int frame);
- void PART_30();
+ void part30ExecuteAction(int action);
+ void part30GoUpstairs();
+ void part30GoDownstairs();
+ void part30UpdateLauraDialogue(int action);
+ void part30HandleLauraDialogue();
+ void part30ApplyObjectState(int num);
+ void part30WalkInFromLeft();
+ void part30WalkInFromUpstairs();
+ void part30WalkInFromOutside();
+ void part30WalkInFromRight();
+ void part30LauraCutscene();
+ void part30LauraAndIgorBumpIntoEachOther();
+ void part30IgorCrossesArms();
+ void part30LauraLeaves();
+ void part30SetLauraFrame(int frame);
+ void part30();
// college corridor stairs second floor
- void PART_31_EXEC_ACTION(int action);
- void PART_31_ACTION_102_enterAstronomyLab();
- void PART_31_ACTION_103_openDoor();
- void PART_31_ACTION_106_goDownstairs();
- void PART_31_ACTION_110_openDoor2();
- void PART_31_UPDATE_ROOM_BACKGROUND();
- void PART_31_HELPER_1_OBJECT_STATE(int num);
- void PART_31_HELPER_2_drawJohnnyFrame(int frame);
- void PART_31_HELPER_3_enterFromLeft();
- void PART_31_HELPER_4_enterFromAstronomyLab();
- void PART_31_HELPER_5_enterFromDownstairs();
- void PART_31_HELPER_6_enterFromRight();
- void PART_31_HELPER_9_drawOpenDoor();
- void PART_31();
+ void part31ExecuteAction(int action);
+ void part31EnterAstronomyLab();
+ void part31OpenDoor();
+ void part31GoDownstairs();
+ void part31UseKeysWithDoor();
+ void part31UpdateBackground();
+ void part31ApplyObjectState(int num);
+ void part31DrawJohnnyFrame(int frame);
+ void part31EnterFromLeft();
+ void part31EnterFromAstronomyLab();
+ void part31EnterFromDownstairs();
+ void part31EnterFromRight();
+ void part31DrawOpenDoor();
+ void part31();
// telescope room
- void PART_32_EXEC_ACTION(int action);
- void PART_32_walkIn();
- void PART_32_ACTION_103_useControls();
- void PART_32_ACTION_106_walkToControls();
- void PART_32_controls();
- void PART_32_CONTROLS_copyColor(int dstColor, int srcColor);
- int PART_32_CONTROLS_KEY_AT_CURSOR() const;
- void PART_32_drawDigit(int fieldOffset, int index, int key);
- void PART_32_eraseDigit(int fieldOffset, int index);
- void PART_32_controlsIdle(int fieldColor);
- void PART_32_exitControls();
- void PART_32_CONTROLS_selectDeclination();
- void PART_32_CONTROLS_selectAscension();
- void PART_32_CONTROLS_enterCoordinates();
- int PART_32_CONTROLS_animateDeclination();
- int PART_32_CONTROLS_animateAscension();
- void PART_32_loadTowerScene();
- void PART_32_loadGirlScene();
- void PART_32_drawTowerConversationFrame(int frame);
- void PART_32_updateDialogueSpeakerA(int action);
- void PART_32_updateDialogueSpeakerB(int action);
- void PART_32_speakerASays(const Common::Array<DialogueText> &lines);
- void PART_32_speakerBSays(const Common::Array<DialogueText> &lines);
- void PART_32_SCENE();
- void PART_32_sceneTowerConversation();
- void PART_32_sceneTowerEmpty();
- void PART_32_sceneNothing();
- void PART_32_sceneGirl();
- void PART_32();
+ void part32ExecuteAction(int action);
+ void part32WalkIn();
+ void part32UseControls();
+ void part32WalkToControls();
+ void part32Controls();
+ void part32CopyControlColor(int dstColor, int srcColor);
+ int part32ControlKeyAtCursor() const;
+ void part32DrawDigit(int fieldOffset, int index, int key);
+ void part32EraseDigit(int fieldOffset, int index);
+ void part32ControlsIdle(int fieldColor);
+ void part32ExitControls();
+ void part32SelectDeclination();
+ void part32SelectAscension();
+ void part32EnterCoordinates();
+ int part32AnimateDeclination();
+ int part32AnimateAscension();
+ void part32LoadTowerScene();
+ void part32LoadGirlScene();
+ void part32DrawTowerConversationFrame(int frame);
+ void part32UpdateSpeakerADialogue(int action);
+ void part32UpdateSpeakerBDialogue(int action);
+ void part32SaySpeakerA(const Common::Array<DialogueText> &lines);
+ void part32SaySpeakerB(const Common::Array<DialogueText> &lines);
+ void part32Scene();
+ void part32SceneTowerConversation();
+ void part32SceneTowerEmpty();
+ void part32SceneNothing();
+ void part32SceneGirl();
+ void part32();
// library
- void PART_33_EXEC_ACTION(int action);
- void PART_33_ACTION_109_takeAstronomyBooks();
- void PART_33_ACTION_111_talkToHarrison();
- void PART_33_ACTION_113_walkOut();
- void PART_33_ACTION_114_showPhotoToHarrison();
- void PART_33_ACTION_115_giveNoteToHarrison();
- 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_HarrisonSay(const Common::Array<DialogueText> &lines);
- void PART_33_HANDLE_DIALOGUE_HARRISON();
- void PART_33_UPDATE_ROOM_BACKGROUND();
- void PART_33_HELPER_1_OBJECTS_STATE(int num);
- void PART_33_HELPER_2_HarrisonWalksOut();
- void PART_33_HELPER_3_drawHarrisonFrame();
- void PART_33_HELPER_4_drawHarrisonBodyFrame(int frame);
- void PART_33_HELPER_5_drawHarrisonHeadFrame(int frame);
- void PART_33_HELPER_7_walkIn();
- void PART_33_HELPER_9_loadExtraTexts();
- void PART_33();
- void loadResourceData__ROOM_Library();
- void loadResourceData__ANIM_Library();
+ void part33ExecuteAction(int action);
+ void part33TakeAstronomyBooks();
+ void part33TalkToHarrison();
+ void part33WalkOut();
+ void part33ShowPhotoToHarrison();
+ void part33GiveNoteToHarrison();
+ void part33UpdateHarrisonBodyDialogue(int action);
+ void part33UpdateHarrisonHeadDialogue(int action);
+ void part33UpdateHarrisonHeadDialogueWithStanding(int action);
+ void part33SayHarrison(const Common::Array<DialogueText> &lines);
+ void part33HandleHarrisonDialogue();
+ void part33UpdateBackground();
+ void part33ApplyObjectState(int num);
+ void part33HarrisonWalksOut();
+ void part33DrawHarrisonFrame();
+ void part33DrawHarrisonBodyFrame(int frame);
+ void part33DrawHarrisonHeadFrame(int frame);
+ void part33WalkIn();
+ void part33LoadExtraTexts();
+ void part33();
+ void part33LoadRoom();
+ void part33LoadAnimation();
// park
- void PARK_DRAW_drawOldLadyFrame(uint8 *dst, int frame);
- void PARK_DRAW_LAURA_FRAME(int frame);
- void PARK_PICK_UP_ANIMATION(int screenOffset, int framesOffset);
- void PARK_UPDATE_AMBIENT_SOUND();
- void PARK_UPDATE_DIALOGUE_LADY(int action);
- void PARK_UPDATE_DIALOGUE_LAURA(int action);
- void PARK_QUEUE_REPLY_TEXT(int reply, int count, int sound, int &textIndex);
- void PARK_WAIT_FOR_IGOR_DIALOGUE();
- void PARK_WAIT_FOR_LADY_DIALOGUE();
- void PARK_WAIT_FOR_LAURA_DIALOGUE();
- void PART_34();
- void PART_34_EXEC_ACTION(int action);
- void PART_34_ACTION_103_takeResin();
- void PART_34_ACTION_105_talkToOldLady();
- void PART_34_ACTION_108_giveLizardToOldLady();
- void PART_34_ACTION_109_scrollRight();
- void PART_34_APPLY_OBJECT_STATE(int num);
- void PART_34_oldLadyIdleAnimationFrame(int step);
- void PART_34_LAURA_CONVERSATION();
- void PART_34_OLD_LADY_CONVERSATION();
- void PART_34_UPDATE_ROOM_BACKGROUND();
- void PART_35();
- void PART_35_EXEC_ACTION(int action);
- void PART_35_ACTION_102_takeResin();
- void PART_35_ACTION_106_exitToMap();
- void PART_35_ACTION_107_scrollLeft();
- void PART_35_APPLY_OBJECT_STATE(int num);
+ void part34And35DrawOldLadyFrame(uint8 *dst, int frame);
+ void part34DrawLauraFrame(int frame);
+ void part34And35PickUpAnimation(int screenOffset, int framesOffset);
+ void part34And35UpdateAmbientSound();
+ void part34UpdateLadyDialogue(int action);
+ void part34UpdateLauraDialogue(int action);
+ void part34QueueReplyText(int reply, int count, int sound, int &textIndex);
+ void part34WaitForIgorDialogue();
+ void part34WaitForLadyDialogue();
+ void part34WaitForLauraDialogue();
+ void part34();
+ void part34ExecuteAction(int action);
+ void part34TakeResin();
+ void part34TalkToOldLady();
+ void part34GiveLizardToOldLady();
+ void part34ScrollRight();
+ void part34ApplyObjectState(int num);
+ void part34OldLadyIdleAnimationFrame(int step);
+ void part34LauraConversation();
+ void part34OldLadyConversation();
+ void part34UpdateBackground();
+ void part35();
+ void part35ExecuteAction(int action);
+ void part35TakeResin();
+ void part35ExitToMap();
+ void part35ScrollLeft();
+ void part35ApplyObjectState(int num);
// chemistry classroom
- void PART_36_EXEC_ACTION(int action);
- void PART_36_ACTION_102_takePen();
- void PART_36_HELPER_1_OBJECT_STATE(int num);
- void PART_36_HELPER_2_walkIn();
- void PART_36_HELPER_4_drawPen(int frame);
- void PART_36();
+ void part36ExecuteAction(int action);
+ void part36TakePen();
+ void part36ApplyObjectState(int num);
+ void part36WalkIn();
+ void part36DrawPen(int frame);
+ void part36();
// physics classroom
- void PART_37_EXEC_ACTION(int action);
- void PART_37_ACTION_102_lookAtPaperBinTakePaper();
- void PART_37_HELPER_1_OBJECT_STATE(int num);
- void PART_37_HELPER_2_walkIn();
- void PART_37();
+ void part37ExecuteAction(int action);
+ void part37LookAtPaperBinTakePaper();
+ void part37ApplyObjectState(int num);
+ void part37WalkIn();
+ void part37();
// outside the maze
- void PART_50_EXEC_ACTION(int action);
- void PART_50_ACTION_101_enterMaze();
- void PART_50_enterFromDoor();
- void PART_50_enterFromHill();
- void PART_50_UPDATE_ROOM_BACKGROUND();
- void PART_50();
+ void part50ExecuteAction(int action);
+ void part50EnterMaze();
+ void part50EnterFromDoor();
+ void part50EnterFromHill();
+ void part50UpdateBackground();
+ void part50();
// cemetery entrance
- void PART_68_EXEC_ACTION(int action);
- void PART_68_LOAD_ROOM();
- void PART_68_APPLY_OBJECT_STATE(int num);
- void PART_68_drawUndertaker(int frame);
- void PART_68_DRAW_AMBIENT(int frame);
- void PART_68_drawVase(int frame);
- void PART_68_drawPose(int frame);
- void PART_68_updateOwlsEyes();
- void PART_68_UPDATE_ROOM_BACKGROUND();
- void PART_68_UPDATE_ROOM_BACKGROUND_TALK();
- void PART_68_BorisSayReplies(int action);
- void PART_68_sayBoris(const Common::Array<DialogueText> &lines);
- void PART_68_BorisSayReplies(const int *replies, const int *sounds, int count);
- void PART_68_enterFromRight();
- void PART_68_enterFromLeft();
- void PART_68_enterFromCemetery();
- void PART_68_ACTION_102_takeVase();
- void PART_68_ACTION_104_talkToBoris();
- void PART_68_ACTION_106_enterCemetery();
- void PART_68_ACTION_108_giveRecordsToBoris();
- void PART_68_CONVERSATION();
- void PART_68_chooseRandomNames(int code);
- void PART_68_BorisLeaves();
- void PART_68();
+ void part68ExecuteAction(int action);
+ void part68LoadRoom();
+ void part68ApplyObjectState(int num);
+ void part68DrawUndertaker(int frame);
+ void part68DrawAmbient(int frame);
+ void part68DrawVase(int frame);
+ void part68DrawPose(int frame);
+ void part68UpdateOwlsEyes();
+ void part68UpdateBackground();
+ void part68UpdateBackgroundTalk();
+ void part68SayBorisReplies(int action);
+ void part68SayBoris(const Common::Array<DialogueText> &lines);
+ void part68SayBorisReplies(const int *replies, const int *sounds, int count);
+ void part68EnterFromRight();
+ void part68EnterFromLeft();
+ void part68EnterFromCemetery();
+ void part68TakeVase();
+ void part68TalkToBoris();
+ void part68EnterCemetery();
+ void part68GiveRecordsToBoris();
+ void part68Conversation();
+ void part68ChooseRandomNames(int code);
+ void part68BorisLeaves();
+ void part68();
// swamp
- void PART_69_EXEC_ACTION(int action);
- void PART_69_APPLY_OBJECT_STATE();
- void PART_69_drawSwarm(int frame);
- void PART_69_drawMainFirefly(int frame);
- void PART_69_animateFireflies();
- void PART_69_ACTION_107_useVaseWithFireflies();
- void PART_69_takeVaseBack(int num, int sound);
- void PART_69_enterFromRight();
- void PART_69_UPDATE_ROOM_BACKGROUND();
- void PART_69();
+ void part69ExecuteAction(int action);
+ void part69ApplyObjectState();
+ void part69DrawSwarm(int frame);
+ void part69DrawMainFirefly(int frame);
+ void part69AnimateFireflies();
+ void part69UseVaseWithFireflies();
+ void part69TakeVaseBack(int num, int sound);
+ void part69EnterFromRight();
+ void part69UpdateBackground();
+ void part69();
// map of second area
- void PART_70_EXEC_ACTION(int action);
- void PART_70_DRAW_OBJECT_STATE();
- void PART_70_UPDATE_ROOM_BACKGROUND();
- void PART_70();
-
- void PART_71_EXEC_ACTION(int action);
- void PART_71_APPLY_OBJECT_STATE(int what);
- void PART_71_DRAW_OBJECT(int frame);
- void PART_71_ACTION_102_takeObject();
- void PART_71_ACTION_103_look();
- void PART_71_enterFromRight();
- void PART_71_LIGHTNING();
- void PART_71_UPDATE_ROOM_BACKGROUND();
- void PART_71();
-
- void PART_72_EXEC_ACTION(int action);
- void PART_72_APPLY_OBJECT_STATE();
- void PART_72_ACTION_102_takeFlower();
- void PART_72_enterFromMap();
- void PART_72_enterFromSwamp();
- void PART_72_updateBlinkingEyes();
- void PART_72_UPDATE_ROOM_BACKGROUND();
- void PART_72();
- void PART_72_paintBlinkingEyes();
-
- void PART_73_drawPoliceman(int frame);
- void PART_73_UPDATE_DIALOGUE(int action);
- void PART_73_CUTSCENE();
-
- void PART_74_CYCLE_COLORS();
- void PART_74_drawCharacterFrame(int frame);
- void PART_74_UPDATE_DIALOGUE_Sailor(int action);
- void PART_74_UPDATE_DIALOGUE_CaptainA(int action);
- void PART_74_UPDATE_DIALOGUE_CaptainB(int action);
- void PART_74_SAY(int who, const Common::Array<DialogueText> &lines);
- void PART_74_shipCutscene();
+ void part70ExecuteAction(int action);
+ void part70DrawObjectState();
+ void part70UpdateBackground();
+ void part70();
+
+ void part71ExecuteAction(int action);
+ void part71ApplyObjectState(int what);
+ void part71DrawObject(int frame);
+ void part71TakeObject();
+ void part71Look();
+ void part71EnterFromRight();
+ void part71Lightning();
+ void part71UpdateBackground();
+ void part71();
+
+ void part72ExecuteAction(int action);
+ void part72ApplyObjectState();
+ void part72TakeFlower();
+ void part72EnterFromMap();
+ void part72EnterFromSwamp();
+ void part72UpdateBlinkingEyes();
+ void part72UpdateBackground();
+ void part72();
+ void part72PaintBlinkingEyes();
+
+ void part73DrawPoliceman(int frame);
+ void part73UpdateDialogue(int action);
+ void part73Cutscene();
+
+ void part74CycleColors();
+ void part74DrawCharacterFrame(int frame);
+ void part74UpdateSailorDialogue(int action);
+ void part74UpdateCaptainADialogue(int action);
+ void part74UpdateCaptainBDialogue(int action);
+ void part74Say(int who, const Common::Array<DialogueText> &lines);
+ void part74ShipCutscene();
// philip vodka cutscene
- void PART_75_UPDATE_DIALOGUE_PHILIP(int action);
- void PART_75_HELPER_drawPhilipFrame(int frame);
- void PART_75();
-
- void PART_76_EXEC_ACTION(int action);
- void PART_76_APPLY_OBJECT_STATE();
- void PART_76_drawParachuteFrame(int frame);
- void PART_76_drawOpenDoorFrame(int frame);
- void PART_76_ACTION_103_openDoor();
- void PART_76_ACTION_104_takeParachute();
- void PART_76_ACTION_106_useParachute();
- void PART_76_ENTRY();
- void PART_76();
-
- void PART_77_EXEC_ACTION(int action);
- void PART_77_APPLY_OBJECT_STATE();
- void PART_77_drawMonkeyFrame(int frame);
- void PART_77_UPDATE_DIALOGUE(int action);
- void PART_77_ACTION_106_monkeyCageCutscene();
- void PART_77_enterFromCollege();
- void PART_77();
-
- void PART_78_drawProfessorFrame(int frame);
- void PART_78_drawAlumniFrame(int frame);
- void PART_78_drawIgorFrame(int frame);
- void PART_78_drawPhilipFrame(int frame);
- void PART_78_updateProfessorDialogueLeft(int action);
- void PART_78_updateProfessorDialogueFromDesk(int action);
- void PART_78_updateProfessorDialogueToIgor(int action);
- void PART_78_updateIgorDialogueLeft(int action);
- void PART_78_updateIgorDialogueRight(int action);
- void PART_78_updatePhilipDialogue(int action);
- void PART_78_sayStart(int speaker, const Common::Array<DialogueText> &lines);
- void PART_78_waitForLines(int speaker);
- void PART_78_say(int speaker, const Common::Array<DialogueText> &lines);
- void PART_78_professorWarnings(int which);
- void PART_78();
-
- void PART_79_drawLauraInWater(int frame);
- void PART_79_drawReflection(int step);
- void PART_79_clearReflection();
- void PART_79_updateReflection();
- void PART_79_updateLauraInWaterDialogue(int action);
- void PART_79_sayLaura(const Common::Array<DialogueText> &lines);
- void PART_79_scroll();
- void PART_79_LauraInWater();
- void PART_79_drawGroupFrame(const uint8 *buffer, int table, int base, int frame);
- void PART_79_drawBoomerangScene(int frame);
- void PART_79_drawKiss(int frame);
- void PART_79_drawCircularClosingTransition(int frame);
- void PART_79_drawPhilipSharkScene(const void *group, int frame);
- void PART_79_animateIgorHead(int frame);
- void PART_79_UPDATE_DIALOGUE_SPEAKER(int action);
- void PART_79_UPDATE_DIALOGUE_FIRST_SPEAKER(int action);
- void PART_79_UPDATE_DIALOGUE_THIRD_SPEAKER(int action);
- void PART_79_animatePhilipShaking();
- void PART_79_SAY_SPEAKER(int startX, int startY, int x, int y, int r, int g, int b, int endFrame, int baseFrame, const Common::Array<DialogueText> &lines);
- void PART_79_sayLaura(int startX, int startY, const Common::Array<DialogueText> &lines);
- void PART_79_sayPhilip(const Common::Array<DialogueText> &lines);
- void PART_79_sayIgor(const Common::Array<DialogueText> &lines);
- void PART_79_setIgorPos(int x, int y);
- void PART_79_FADE_COLORS(int first, int last, bool fadeInColors);
- void PART_79_FADE_IN_PAIR(int firstColor);
- void PART_79_beachScene();
- void PART_79();
-
- void PART_80_drawFrame(int frame);
- void PART_80_updateDialogueFriend(int action);
- void PART_80_updateDialogueLaura(int action);
- void PART_80_say(int who, const Common::Array<DialogueText> &lines);
- void PART_80();
-
- void PART_81_EXEC_ACTION(int action);
- void PART_81_loadRoom();
- void PART_81_loadAnimation();
- void PART_81_drawLighthouseKeeperHead(int frame);
- void PART_81_drawLighthouseKeeper(int frame);
- void PART_81_drawIgor(int offset);
- void PART_81_drawLighthouseFrame(int frame);
- void PART_81_UPDATE_ROOM_BACKGROUND();
- void PART_81_updateDialogueLighthouseKeeper(int action);
- void PART_81_lighthouseKeeperSay(const Common::Array<DialogueText> &lines);
- void PART_81_igorSay(int num, int count, int sound);
- void PART_81_APPLY_OBJECT_STATE(int num);
- void PART_81_scrollIn();
- void PART_81_transitionScrollUp();
- void PART_81_transitionScrollDown();
- void PART_81_lighthouseSendMessage();
- void PART_81_ACTION_109_giveLampToLighthouseKeeper();
- void PART_81_ACTION_110_rejectItem();
- void PART_81_ACTION_102_talk();
- void PART_81_DIALOGUE_CODE(int code);
- void PART_81_handleDialogue();
- void PART_81_walkIn();
- void PART_81();
+ void part75UpdatePhilipDialogue(int action);
+ void part75DrawPhilipFrame(int frame);
+ void part75();
+
+ void part76ExecuteAction(int action);
+ void part76ApplyObjectState();
+ void part76DrawParachuteFrame(int frame);
+ void part76DrawOpenDoorFrame(int frame);
+ void part76OpenDoor();
+ void part76TakeParachute();
+ void part76UseParachute();
+ void part76Entry();
+ void part76();
+
+ void part77ExecuteAction(int action);
+ void part77ApplyObjectState();
+ void part77DrawMonkeyFrame(int frame);
+ void part77UpdateDialogue(int action);
+ void part77MonkeyCageCutscene();
+ void part77EnterFromCollege();
+ void part77();
+
+ void part78DrawProfessorFrame(int frame);
+ void part78DrawAlumniFrame(int frame);
+ void part78DrawIgorFrame(int frame);
+ void part78DrawPhilipFrame(int frame);
+ void part78UpdateProfessorDialogueLeft(int action);
+ void part78UpdateProfessorDialogueFromDesk(int action);
+ void part78UpdateProfessorDialogueToIgor(int action);
+ void part78UpdateIgorDialogueLeft(int action);
+ void part78UpdateIgorDialogueRight(int action);
+ void part78UpdatePhilipDialogue(int action);
+ void part78SayStart(int speaker, const Common::Array<DialogueText> &lines);
+ void part78WaitForLines(int speaker);
+ void part78Say(int speaker, const Common::Array<DialogueText> &lines);
+ void part78ProfessorWarnings(int which);
+ void part78();
+
+ void part79DrawLauraInWater(int frame);
+ void part79DrawReflection(int step);
+ void part79ClearReflection();
+ void part79UpdateReflection();
+ void part79UpdateLauraInWaterDialogue(int action);
+ void part79SayLaura(const Common::Array<DialogueText> &lines);
+ void part79Scroll();
+ void part79LauraInWater();
+ void part79DrawGroupFrame(const uint8 *buffer, int table, int base, int frame);
+ void part79DrawBoomerangScene(int frame);
+ void part79DrawKiss(int frame);
+ void part79DrawCircularClosingTransition(int frame);
+ void part79DrawPhilipSharkScene(const void *group, int frame);
+ void part79AnimateIgorHead(int frame);
+ void part79UpdateSpeakerDialogue(int action);
+ void part79UpdateLauraDialogue(int action);
+ void part79UpdatePhilipDialogue(int action);
+ void part79AnimatePhilipShaking();
+ void part79SaySpeaker(int startX, int startY, int x, int y, int r, int g, int b, int endFrame, int baseFrame, const Common::Array<DialogueText> &lines);
+ void part79SayLaura(int startX, int startY, const Common::Array<DialogueText> &lines);
+ void part79SayPhilip(const Common::Array<DialogueText> &lines);
+ void part79SayIgor(const Common::Array<DialogueText> &lines);
+ void part79SetIgorPos(int x, int y);
+ void part79FadeColors(int first, int last, bool fadeInColors);
+ void part79FadeInPair(int firstColor);
+ void part79BeachScene();
+ void part79();
+
+ void part80DrawFrame(int frame);
+ void part80UpdateFriendDialogue(int action);
+ void part80UpdateLauraDialogue(int action);
+ void part80Say(int who, const Common::Array<DialogueText> &lines);
+ void part80();
+
+ void part81ExecuteAction(int action);
+ void part81LoadRoom();
+ void part81LoadAnimation();
+ void part81DrawLighthouseKeeperHead(int frame);
+ void part81DrawLighthouseKeeper(int frame);
+ void part81DrawIgor(int offset);
+ void part81DrawLighthouseFrame(int frame);
+ void part81UpdateBackground();
+ void part81UpdateLighthouseKeeperDialogue(int action);
+ void part81SayLighthouseKeeper(const Common::Array<DialogueText> &lines);
+ void part81SayIgor(int num, int count, int sound);
+ void part81ApplyObjectState(int num);
+ void part81ScrollIn();
+ void part81TransitionScrollUp();
+ void part81TransitionScrollDown();
+ void part81LighthouseSendMessage();
+ void part81GiveLampToLighthouseKeeper();
+ void part81RejectItem();
+ void part81Talk();
+ void part81DialogueCode(int code);
+ void part81HandleDialogue();
+ void part81WalkIn();
+ void part81();
// maze
static const MazeNode MAZE_NODES[108];
- static const MazeRoom *getMazeRoom(int part);
- void PART_MAZE();
- void PART_MAZE_EXEC_ACTION(int action);
- void PART_MAZE_UPDATE_ROOM_BACKGROUND();
- void maybeUpdateFlicker();
- void mazeFlicker();
- void mazeDrawFlameFrame(int x, int y, int frame);
- void MAZE_walkIn(const MazeEntry &entry);
- void enterFromStairs(const MazeEntry &entry);
- void mazeWalkToExit(const MazeAction &action);
- void mazeExitThroughStairs(const MazeAction &action);
- void mazeGoToNeighbor(int dir);
- int MAZE_getMusicTrack() const;
+ static const MazeRoom *partMazeGetRoom(int part);
+ void partMaze();
+ void partMazeExecuteAction(int action);
+ void partMazeUpdateBackground();
+ void partMazeMaybeUpdateFlicker();
+ void partMazeFlicker();
+ void partMazeDrawFlameFrame(int x, int y, int frame);
+ void partMazeWalkIn(const MazeEntry &entry);
+ void partMazeEnterFromStairs(const MazeEntry &entry);
+ void partMazeWalkToExit(const MazeAction &action);
+ void partMazeExitThroughStairs(const MazeAction &action);
+ void partMazeGoToNeighbor(int dir);
+ int partMazeGetMusicTrack() const;
void setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp, int yBottom = 143);
- void UPDATE_OBJECT_STATE(int num);
- void PART_UPDATE_FIGURES_ON_PAPER(int delay);
+ void partMainUpdateObjectState(int num);
+ void partMainUpdateFiguresOnPaper(int delay);
- void PART_meanwhile(int img = IMG_Meanwhile);
+ void partMainMeanwhile(int img = IMG_Meanwhile);
// Margaret cutscenes
- void PART_MARGARET_ROOM_CUTSCENE_drawMargaretBasePose();
- void PART_MARGARET_ROOM_CUTSCENE_drawMargaretFrame(int frame);
- void PART_MARGARET_ROOM_CUTSCENE_UPDATE_DIALOGUE_MARGARET(int action);
- void PART_MARGARET_ROOM_CUTSCENE();
+ void partMargaretDrawBasePose();
+ void partMargaretDrawFrame(int frame);
+ void partMargaretUpdateDialogue(int action);
+ void partMargaret();
// Intro
- void PART_85();
- void PART_85_HELPER_1_playAnimationFrame(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
- void PART_85_HELPER_2_scrollRight();
- void displayLogo();
- void PART_85_UPDATE_DIALOGUE_PHILIP_LAURA(int action);
- void PART_85_UPDATE_ROOM_BACKGROUND();
+ void part85();
+ void part85PlayAnimationFrame(int frameOffset2, int frameOffset1, int firstFrame, int lastFrame, int delay);
+ void part85ScrollRight();
+ void part85DisplayLogo();
+ void part85UpdatePhilipLauraDialogue(int action);
+ void part85UpdateBackground();
- void PART_85_HELPER_6_animateIgorHead(int frame);
+ void part85AnimateIgorHead(int frame);
// Splash screens
- void PART_90();
- void PART_90_FADE_PALETTE(bool fadeInColors);
+ void part90();
+ void part90FadePalette(bool fadeInColors);
// End credits
- void PART_CREDITS();
- void PART_CREDITS_DRAW_TEXT(int x, int y, uint8 color, bool underline, const char *str);
+ void partCredits();
+ void partCreditsDrawText(int x, int y, uint8 color, bool underline, const char *str);
void handleRoomInput();
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 55ce53695fe..22ed8eea4e1 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -21,7 +21,7 @@
#include "igor/igor.h"
namespace Igor {
-void IgorEngine::EXEC_MAIN_ACTION(int action) {
+void IgorEngine::partMainExecuteAction(int action) {
switch (action) {
case 0:
case 1:
@@ -153,7 +153,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
igorSay(69, 1, 46);
break;
case 38:
- EXEC_MAIN_ACTION_38_lookAtNewspaper();
+ partMainLookAtNewspaper();
break;
case 39:
igorSay(70, 1, 47);
@@ -168,7 +168,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
igorSay(73, 1, 50);
break;
case 43:
- EXEC_MAIN_ACTION_43_lookAtPhoto();
+ partMainLookAtPhoto();
break;
case 44:
igorSay(156, 1, 80);
@@ -212,7 +212,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
igorSay(88, 1, 62);
break;
case 54:
- lookAtPapyrus(false);
+ partMainLookAtPapyrus(false);
break;
case 55:
igorSay(159, 1, 83);
@@ -249,7 +249,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
_inventoryInfo[59] = 0;
packInventory();
_objectsState[kLizardFedStateIndex] = 1;
- UPDATE_OBJECT_STATE(2);
+ partMainUpdateObjectState(2);
addObjectToInventory(kInventoryObjectMoney, 59);
igorSay(169, 1, 93);
break;
@@ -262,7 +262,7 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
_inventoryInfo[69] = 0;
packInventory();
_objectsState[kVaseStateIndex] = 1;
- UPDATE_OBJECT_STATE(7);
+ partMainUpdateObjectState(7);
addObjectToInventory(kInventoryObjectVase, 69);
break;
case 64: // look at vase
@@ -293,12 +293,12 @@ void IgorEngine::EXEC_MAIN_ACTION(int action) {
break;
default:
- warning("EXEC_MAIN_ACTION() Unhandled action %d", action);
+ warning("partMainExecuteAction() Unhandled action %d", action);
break;
}
}
-void IgorEngine::EXEC_MAIN_ACTION_38_lookAtNewspaper() {
+void IgorEngine::partMainLookAtNewspaper() {
memcpy(_paletteBuffer, _currentPalette, 624);
fadeOut(624);
uint8 *tmp = (uint8 *)malloc(64000 + 768);
@@ -345,7 +345,7 @@ void IgorEngine::EXEC_MAIN_ACTION_38_lookAtNewspaper() {
}
}
-void IgorEngine::EXEC_MAIN_ACTION_43_lookAtPhoto() {
+void IgorEngine::partMainLookAtPhoto() {
memcpy(_paletteBuffer, _currentPalette, 624);
fadeOut(624);
uint8 *tmp = (uint8 *)malloc(64000 + 768);
@@ -378,7 +378,7 @@ void IgorEngine::EXEC_MAIN_ACTION_43_lookAtPhoto() {
fadeIn(624);
}
-void IgorEngine::SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p) {
+void IgorEngine::partMainSetExecuteAction(int i, ExecuteActionProc p) {
switch (i) {
case 0:
_executeMainAction = p;
@@ -389,7 +389,7 @@ void IgorEngine::SET_EXEC_ACTION_FUNC(int i, ExecuteActionProc p) {
}
}
-void IgorEngine::UPDATE_OBJECT_STATE(int num) {
+void IgorEngine::partMainUpdateObjectState(int num) {
if (num == 1 || num == 255) {
switch (_objectsState[kBottleStateIndex]) {
case 0:
@@ -449,8 +449,8 @@ void IgorEngine::UPDATE_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_MAIN() {
- SET_EXEC_ACTION_FUNC(0, &IgorEngine::EXEC_MAIN_ACTION);
+void IgorEngine::partMain() {
+ partMainSetExecuteAction(0, &IgorEngine::partMainExecuteAction);
if (!_gameStateLoaded) {
memset(_objectsState, 0, 112);
_objectsState[kAtticNailHotspotActiveStateIndex] = 1;
@@ -465,7 +465,7 @@ void IgorEngine::PART_MAIN() {
_inventoryInfo[72] = 1; // first object
_inventoryInfo[73] = 3; // last object
}
- UPDATE_OBJECT_STATE(255);
+ partMainUpdateObjectState(255);
if (_currentPart != kStartupPart) { // boot param
SET_PAL_208_96_1();
SET_PAL_240_48_1();
@@ -474,162 +474,162 @@ void IgorEngine::PART_MAIN() {
}
do {
- debugC(9, kDebugGame, "PART_MAIN _currentPart %d", _currentPart);
+ debugC(9, kDebugGame, "partMain _currentPart %d", _currentPart);
switch (_currentPart) {
case 0:
case 1:
- PART_00(); // Student dormitory
+ part0(); // Student dormitory
break;
case 10:
case 11:
case 12:
- PART_01(); // Outside the dormitory window
+ part1(); // Outside the dormitory window
break;
case 20:
case 21:
case 22:
case 23:
case 24:
- PART_02(); // Dormitory attic
+ part2(); // Dormitory attic
break;
case 40:
- PART_04(); // Map
+ part4(); // Map
break;
case 50: // arrive from map
case 51: // arrive from SpringRock through scroll
case 52:
- PART_05(); // SpringBridge
+ part5(); // SpringBridge
break;
case 60: // arrive through scroll
case 61: // arrive from intro
case 62:
- PART_06(); // SpringRock
+ part6(); // SpringRock
break;
case 70: // enter from outside the administration corridor
case 71: // enter from deans door
case 72: // enter from secretary
- PART_07(); // Administration corridor
+ part7(); // Administration corridor
break;
case 80:
- PART_08(); // Dean Pepper office
+ part8(); // Dean Pepper office
break;
case 90:
case 91:
- PART_09(); // Administration secretary room
+ part9(); // Administration secretary room
break;
case 100: // enter from map
case 101:
case 102:
- PART_10(); // OutsideAdministrationBuilding street, right panel
+ part10(); // OutsideAdministrationBuilding street, right panel
break;
case 110:
- PART_11(); // OutsideAdministrationBuilding street, left panel
+ part11(); // OutsideAdministrationBuilding street, left panel
break;
case 120:
case 121:
case 122:
- PART_12(); // outside church
+ part12(); // outside church
break;
case 130:
case 131:
- PART_13();
+ part13();
break;
case 140:
case 141:
case 142:
- PART_14();
+ part14();
break;
case 150:
- PART_15();
+ part15();
break;
case 160:
- PART_16();
+ part16();
break;
case 170:
case 171:
- PART_17(); // College entrance
+ part17(); // College entrance
break;
case 180:
case 181:
- PART_18(); // men toilets
+ part18(); // men toilets
break;
case 190:
case 191:
- PART_19(); // women toilets
+ part19(); // women toilets
break;
case 210:
case 211:
case 212:
- PART_21(); //college corridor margaret
+ part21(); //college corridor margaret
break;
case 220:
case 221:
- PART_22(); // church bell tower
+ part22(); // church bell tower
break;
case 230:
case 231:
case 232:
- PART_23(); // college corridor lucas
+ part23(); // college corridor lucas
break;
case 240:
case 241:
case 242:
- PART_24();
+ part24();
break;
case 250:
case 251:
case 252:
- PART_25();
+ part25();
break;
case 260:
case 261:
- PART_26();
+ part26();
break;
case 270:
case 271:
- PART_27();
+ part27();
break;
case 280:
case 281:
- PART_28(); // college corridor caroline
+ part28(); // college corridor caroline
break;
case 300:
case 301:
case 302:
case 303:
- PART_30(); // college stairs first floor
+ part30(); // college stairs first floor
break;
case 310:
case 311:
case 312:
case 313:
- PART_31();
+ part31();
break;
case 320:
- PART_32(); // telescope room
+ part32(); // telescope room
break;
case 330:
case 331:
- PART_33();
+ part33();
break;
case 340:
- PART_34(); // Park, left panel
+ part34(); // Park, left panel
break;
case 350:
case 351:
- PART_35(); // Park, right panel
+ part35(); // Park, right panel
break;
case 360:
- PART_36();
+ part36();
break;
case 370:
- PART_37();
+ part37();
break;
case 500:
case 501:
- PART_50(); // outside the maze
+ part50(); // outside the maze
break;
case 510:
case 521:
@@ -667,53 +667,53 @@ void IgorEngine::PART_MAIN() {
case 663:
case 670:
case 671:
- PART_MAZE(); // maze, 670 and 671 are the entrance
+ partMaze(); // maze, 670 and 671 are the entrance
break;
case 680:
case 681:
- PART_68();
+ part68();
break;
case 690:
- PART_69();
+ part69();
break;
case 700:
- PART_70();
+ part70();
break;
case 710:
- PART_71();
+ part71();
break;
case 720:
case 721:
- PART_72();
+ part72();
break;
case 730:
- PART_73_CUTSCENE(); // Cutscene followed by PART_80
+ part73Cutscene(); // Cutscene followed by part80
break;
case 740:
- PART_74_shipCutscene();
+ part74ShipCutscene();
break;
case 750:
- PART_75(); // philip vodka cutscene
+ part75(); // philip vodka cutscene
break;
case 760:
- PART_76(); // room reached after the scene of the college garden
+ part76(); // room reached after the scene of the college garden
break;
case 770:
case 771:
- PART_77();
+ part77();
break;
case 780:
- PART_78(); // cutscene in the lecture hall
+ part78(); // cutscene in the lecture hall
break;
case 790:
case 791:
- PART_79(); // two scenes, shown below a black band
+ part79(); // two scenes, shown below a black band
break;
case 800:
- PART_80();
+ part80();
break;
case 810:
- PART_81();
+ part81();
break;
case 850: // Intro cutscene
// Clear the entire screen buffer before starting the intro cutscene
@@ -723,10 +723,10 @@ void IgorEngine::PART_MAIN() {
// copy the initial portion of the screen to the display, with the vertical offset
_system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, _screenVGAVOffset);
g_engine->_screen->updateScreen();
- PART_85();
+ part85();
// Clears the bottom portion of the screen
memset(_screenVGA + 46080, 0, 17920);
- moveScreenUp(_screenVGAVOffset);
+ partMainMoveScreenUp(_screenVGAVOffset);
_screenVGAVOffset = 0;
_inputVars[kInputCursorXPos] = 160;
_inputVars[kInputCursorYPos] = 72;
@@ -737,7 +737,7 @@ void IgorEngine::PART_MAIN() {
case 902:
case 903:
case 904:
- PART_90();
+ part90();
break;
case 910: // End credits
case 920:
@@ -746,11 +746,11 @@ void IgorEngine::PART_MAIN() {
case 950:
case 960:
case 970:
- PART_CREDITS();
+ partCredits();
break;
default:
- error("PART_MAIN() Unhandled part %d", _currentPart);
+ error("partMain() Unhandled part %d", _currentPart);
break;
}
// These scheduler exclusions compare only the low byte of the state.
@@ -780,8 +780,8 @@ void IgorEngine::PART_MAIN() {
++_gameState.shouldShowCutsceneCounter;
} else {
playMusic(8);
- PART_meanwhile();
- PART_MARGARET_ROOM_CUTSCENE();
+ partMainMeanwhile();
+ partMargaret();
_gameState.shouldShowCutsceneCounter = 0;
}
} while (_currentPart != kInvalidPart && !_eventQuitGame);
@@ -790,7 +790,7 @@ void IgorEngine::PART_MAIN() {
/**
* Moves the screen up line by line from the selected offset down to 0
*/
-void IgorEngine::moveScreenUp(int offset) {
+void IgorEngine::partMainMoveScreenUp(int offset) {
_nextTimer = _system->getMillis() + 1000 / 60;
for (int y = offset; y >= 0; --y) {
_system->copyRectToScreen(_screenVGA, 320, 0, y, 320, 145);
@@ -805,7 +805,7 @@ void IgorEngine::moveScreenUp(int offset) {
// Shows the papyrus full screen. With reveal set (dryer) the figures appear
// slowly and are remembered as seen
-void IgorEngine::lookAtPapyrus(bool reveal) {
+void IgorEngine::partMainLookAtPapyrus(bool reveal) {
memcpy(_paletteBuffer, _currentPalette, 624);
fadeOut(624);
// reserve for entire screen + palette, to save current screen
@@ -819,13 +819,13 @@ void IgorEngine::lookAtPapyrus(bool reveal) {
loadData(PAL_RomanNumbersPaper, _paletteBuffer);
if (reveal) {
fadeIn(624);
- PART_UPDATE_FIGURES_ON_PAPER(60);
+ partMainUpdateFiguresOnPaper(60);
_objectsState[kPapyrusFiguresVisibleStateIndex] = 1;
waitForTimer(255);
} else {
if (_objectsState[kPapyrusFiguresVisibleStateIndex] == 1) {
- PART_UPDATE_FIGURES_ON_PAPER(0);
+ partMainUpdateFiguresOnPaper(0);
}
fadeIn(624);
WalkData *wd = &_walkData[_walkDataLastIndex - 1];
@@ -867,7 +867,7 @@ void IgorEngine::lookAtPapyrus(bool reveal) {
}
// loads and displays the figures on the paper
-void IgorEngine::PART_UPDATE_FIGURES_ON_PAPER(int delay) {
+void IgorEngine::partMainUpdateFiguresOnPaper(int delay) {
uint8 *framesData = loadData(FRM_NumbersPaper1);
uint8 *framesOffsets = loadData(FRM_NumbersPaper2);
for (int i = 1; i <= 20; ++i) {
@@ -879,7 +879,7 @@ void IgorEngine::PART_UPDATE_FIGURES_ON_PAPER(int delay) {
free(framesOffsets);
}
-void IgorEngine::PART_meanwhile(int img) {
+void IgorEngine::partMainMeanwhile(int img) {
hideCursor();
memset(_currentPalette, 0, 768);
setPaletteRange(208, 255);
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 8b51a0517a9..31137615019 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -23,7 +23,7 @@
namespace Igor {
-void IgorEngine::PART_00_APPLY_OBJECT_STATE(int num) {
+void IgorEngine::part0ApplyObjectState(int num) {
if (num == 1 || num == 255) {
const bool open = _objectsState[kBedroomNightstandOpenStateIndex] != 0;
const int src = open ? 0x4CFA : 0x4C6A; // open or closed bedside table depending on the flag
@@ -48,22 +48,22 @@ void IgorEngine::PART_00_APPLY_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_00_EXEC_ACTION(int action) {
- debugC(9, kDebugGame, "PART_00_EXEC_ACTION %d", action);
+void IgorEngine::part0ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part0ExecuteAction %d", action);
switch (action) {
case 101: // open window
if (_objectsState[kBedroomWindowStateIndex] != 1) {
animateLitAnimFrames(0, 1, 3, 0x480, 36, 32, 0x6B2C, 62, 2, 1);
_objectsState[kBedroomWindowStateIndex] = 1;
- PART_00_APPLY_OBJECT_STATE(6);
+ part0ApplyObjectState(6);
}
break;
case 102: // close window
if (_objectsState[kBedroomWindowStateIndex] == 1) {
animateLitAnimFrames(0, 2, 0, 0x480, 36, 32, 0x6B2C, 62, 2, 2);
_objectsState[kBedroomWindowStateIndex] = 2;
- PART_00_APPLY_OBJECT_STATE(6);
+ part0ApplyObjectState(6);
}
break;
case 103: // look at window
@@ -88,14 +88,14 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
if (_objectsState[kBedroomNightstandOpenStateIndex] == 0) {
animateLitAnimFrames(0x3FC8, 0, 2, 0x436, 22, 49, 0x693C, 126, 2, 6);
_objectsState[kBedroomNightstandOpenStateIndex] = 1;
- PART_00_APPLY_OBJECT_STATE(1);
+ part0ApplyObjectState(1);
}
break;
case 107: // close bedside table
if (_objectsState[kBedroomNightstandOpenStateIndex] != 0) {
animateLitAnimFrames(0x3FC8, 2, 0, 0x436, 22, 49, 0x693C, 126, 1, 6);
_objectsState[kBedroomNightstandOpenStateIndex] = 0;
- PART_00_APPLY_OBJECT_STATE(1);
+ part0ApplyObjectState(1);
}
break;
case 108: // look bedside table
@@ -113,21 +113,21 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
animateLitAnimFrames(0x8410, 0, 1, 0x405, 21, 49, 0x693D, 126, -1, 0);
addObjectToInventory(kInventoryObjectAlarmClock, 41);
_objectsState[kAlarmClockTakenStateIndex] = 1;
- PART_00_APPLY_OBJECT_STATE(1);
+ part0ApplyObjectState(1);
}
break;
case 110: // open closet
if (_objectsState[kBedroomClosetOpenStateIndex] == 0) {
animateLitAnimFrames(0x1678, 0, 2, 0x940, 37, 64, 0x556C, 126, 2, 3);
_objectsState[kBedroomClosetOpenStateIndex] = 1;
- PART_00_APPLY_OBJECT_STATE(3);
+ part0ApplyObjectState(3);
}
break;
case 111: // close closet
if (_objectsState[kBedroomClosetOpenStateIndex] != 0) {
animateLitAnimFrames(0x1678, 2, 0, 0x940, 37, 64, 0x556C, 126, 1, 4);
_objectsState[kBedroomClosetOpenStateIndex] = 0;
- PART_00_APPLY_OBJECT_STATE(3);
+ part0ApplyObjectState(3);
}
break;
case 112: // look at closet
@@ -138,7 +138,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
break;
case 114: // go through hole
if (_objectsState[kBedroomClosetOpenStateIndex] == 0)
- PART_00_EXEC_ACTION(110);
+ part0ExecuteAction(110);
animateLitAnimFrames(0x5942, 0, 2, 0x44C, 22, 50, 0x66EE, 30, -1, 0);
_currentPart = 24;
break;
@@ -150,7 +150,7 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
animateLitAnimFrames(0x7C06, 0, 1, 0x405, 21, 49, 0x7146, 126, -1, 0);
addObjectToInventory(kInventoryObjectRecords, 40);
_objectsState[kRecordTakenStateIndex] = 1;
- PART_00_APPLY_OBJECT_STATE(255);
+ part0ApplyObjectState(255);
} else {
igorSay(213, 2, 102);
}
@@ -182,25 +182,25 @@ void IgorEngine::PART_00_EXEC_ACTION(int action) {
igorSay({ { 219, 1, 106 }, { 220, 1, 107 } });
break;
default:
- error("PART_00_EXEC_ACTION unhandled action %d", action);
+ error("part0ExecuteAction unhandled action %d", action);
}
}
-void IgorEngine::PART_00_ENTRY_ANIMATION() {
+void IgorEngine::part0EntryAnimation() {
waitForTimer(62);
if (_objectsState[kBedroomClosetOpenStateIndex] == 0) {
drawAnimRect(0x5572, 0x3900, 31, 56);
// leave closet open
_objectsState[kBedroomClosetOpenStateIndex] = 1;
- PART_00_APPLY_OBJECT_STATE(3);
+ part0ApplyObjectState(3);
playSound(3, 1);
waitForTimer(30);
}
animateLitAnimFrames(0x6626, 0, 3, 0x578, 25, 56, 0x5F6E, 30, -1, 0);
}
-void IgorEngine::PART_00_WALK_IN_FROM_CLOSET() {
- PART_00_ENTRY_ANIMATION();
+void IgorEngine::part0WalkInFromCloset() {
+ part0EntryAnimation();
WalkData *wd = &_walkData[0];
wd->setPos(120, 131, kFacingPositionFront, 0);
wd->clipSkipX = 1;
@@ -221,12 +221,12 @@ void IgorEngine::PART_00_WALK_IN_FROM_CLOSET() {
igorSay(215, 2, 103);
_objectsState[kRatSkinHatSeenStateIndex] = 1;
} else {
- PART_00_ENTER_FROM_BELOW();
+ part0EnterFromBelow();
}
}
-void IgorEngine::PART_00_ENTER_FROM_BELOW() {
- PART_00_APPLY_OBJECT_STATE(255);
+void IgorEngine::part0EnterFromBelow() {
+ part0ApplyObjectState(255);
_walkDataCurrentIndex = 0;
int walkFrame = 1;
for (int i = 0; i <= 9; ++i) {
@@ -252,7 +252,7 @@ void IgorEngine::PART_00_ENTER_FROM_BELOW() {
waitForIgorMove();
}
-void IgorEngine::PART_00() {
+void IgorEngine::part0() {
playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_StudentDormitoryRoom);
@@ -272,8 +272,8 @@ void IgorEngine::PART_00() {
// horizontal edges also clamp to y >= 141/138
setRoomWalkBounds(41, 0, 253, 143, 141, 138);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_00_EXEC_ACTION);
- PART_00_APPLY_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part0ExecuteAction);
+ part0ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
@@ -281,9 +281,9 @@ void IgorEngine::PART_00() {
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
if (_currentPart == 1)
- PART_00_WALK_IN_FROM_CLOSET();
+ part0WalkInFromCloset();
else
- PART_00_ENTER_FROM_BELOW();
+ part0EnterFromBelow();
}
enterPartLoop();
diff --git a/engines/igor/parts/part_1.cpp b/engines/igor/parts/part_1.cpp
index 1f7aae2b98e..934f2a537c6 100644
--- a/engines/igor/parts/part_1.cpp
+++ b/engines/igor/parts/part_1.cpp
@@ -10,7 +10,7 @@
namespace Igor {
-void IgorEngine::PART_01_CLOSE_WINDOW() {
+void IgorEngine::part1CloseWindow() {
static const uint8 windowFrames[] = { 0, 1, 2, 1 };
for (int i = 0; i < 4; ++i) {
drawAnimRect(0x5919, 216 + windowFrames[i] * 1204, 28, 43, false, kBlendLitSprite);
@@ -28,30 +28,30 @@ void IgorEngine::PART_01_CLOSE_WINDOW() {
igorSayAndWait({ { 203, 1, 132 }, { 204, 1, 133 } });
}
-void IgorEngine::PART_01_STATE_11_BLIT_blitIgor() {
+void IgorEngine::part1DrawIgor() {
drawAnimRect(0x5476, 0x1859, 16, 13);
}
-void IgorEngine::PART_01_STATE_11_BLIT_blitRoof() {
+void IgorEngine::part1DrawRoof() {
drawAnimRect(0x118F, 0xA7F9, 0xDA, 40);
}
//
-void IgorEngine::PART_01_STATE_11_BLIT_drawIgorsEyes(int frame) {
+void IgorEngine::part1DrawIgorsEyes(int frame) {
drawAnimRect(0x55BB, 0xA7A9 + frame * 20, 5, 4);
}
//
-void IgorEngine::PART_01_STATE_11_DRAW_drawPigeons(int index) {
+void IgorEngine::part1DrawPigeons(int index) {
memcpy(_screenVGA + 0x6F40, _animFramesBuffer + 0x1929 + index * 0x2F80, 0x2F80);
}
// 11: the window-pigeons cutscene It blits two regions,
// restores the current palette from the saved one, then runs a 1000-tick
// animation loop before handing over to state 22.
-void IgorEngine::PART_01_STATE_11_pigeonsCutscene() {
- PART_01_STATE_11_BLIT_blitIgor();
- PART_01_STATE_11_BLIT_blitRoof();
+void IgorEngine::part1PigeonsCutscene() {
+ part1DrawIgor();
+ part1DrawRoof();
memcpy(_currentPalette, _paletteBuffer, 768);
updatePalette(768);
@@ -67,10 +67,10 @@ void IgorEngine::PART_01_STATE_11_pigeonsCutscene() {
pendingTicks = 0;
}
if (drawIgorsEyes) {
- PART_01_STATE_11_BLIT_drawIgorsEyes(getRandomNumber(3));
+ part1DrawIgorsEyes(getRandomNumber(3));
}
if (drawPigeons) {
- PART_01_STATE_11_DRAW_drawPigeons(getRandomNumber(2));
+ part1DrawPigeons(getRandomNumber(2));
}
++pendingTicks;
@@ -88,7 +88,7 @@ void IgorEngine::PART_01_STATE_11_pigeonsCutscene() {
/**
* Just a screen shaking effect
*/
-void IgorEngine::PART_01_STATE_12_explosion() {
+void IgorEngine::part1Explosion() {
int shakeY = 0;
int elapsed = 0;
for (int nextShake = 15; nextShake < 500; nextShake += 16) {
@@ -102,8 +102,8 @@ void IgorEngine::PART_01_STATE_12_explosion() {
waitForTimer(16);
}
-void IgorEngine::PART_01_EXEC_ACTION(int action) {
- debugC(9, kDebugGame, "PART_01_EXEC_ACTION %d", action);
+void IgorEngine::part1ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part1ExecuteAction %d", action);
switch (action) {
case 101: // walk past pigeon
igorSay(201, 2, 131);
@@ -137,12 +137,12 @@ void IgorEngine::PART_01_EXEC_ACTION(int action) {
igorSay(211, 2, 139);
break;
default:
- warning("PART_01_EXEC_ACTION unhandled action %d", action);
+ warning("part1ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_01() {
+void IgorEngine::part1() {
playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_OutsideStudentDormitory);
@@ -159,7 +159,7 @@ void IgorEngine::PART_01() {
// clamps clicks to x 60..276 and y <= 143 before consulting
// the room mask
setRoomWalkBounds(60, 0, 276, 143);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_01_EXEC_ACTION);
+ partMainSetExecuteAction(1, &IgorEngine::part1ExecuteAction);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
@@ -179,15 +179,15 @@ void IgorEngine::PART_01() {
moveIgor(_walkData[0].posNum, _walkData[0].frameNum);
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
- PART_01_CLOSE_WINDOW();
+ part1CloseWindow();
} else {
if (_currentPart == 11)
- PART_01_STATE_11_pigeonsCutscene();
+ part1PigeonsCutscene();
else if (_currentPart == 12) {
memcpy(_currentPalette, _paletteBuffer, 768);
updatePalette(768);
playSound(12, 1);
- PART_01_STATE_12_explosion();
+ part1Explosion();
_currentPart = 23;
}
}
diff --git a/engines/igor/parts/part_10.cpp b/engines/igor/parts/part_10.cpp
index dda46a2351e..7fc6f96137e 100644
--- a/engines/igor/parts/part_10.cpp
+++ b/engines/igor/parts/part_10.cpp
@@ -27,7 +27,7 @@ namespace Igor {
const uint32 kPart10PanelLeft = 0x0000;
-void IgorEngine::PART_10_11_DRAW_OBJECT_STATE(int num) {
+void IgorEngine::part10And11DrawObjectState(int num) {
// These three original blitters are byte-for-byte duplicates in the two
// halves of the room
@@ -46,7 +46,7 @@ void IgorEngine::PART_10_11_DRAW_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_10_EXEC_ACTION(int action) {
+void IgorEngine::part10ExecuteAction(int action) {
switch (action) {
case 101: // look at plaque
igorSayAndWait(201, 1, 626);
@@ -67,7 +67,7 @@ void IgorEngine::PART_10_EXEC_ACTION(int action) {
igorSayAndWait(202, 1, 627);
break;
case 104: // pick burger
- PART_10_ACTION_104_pickHamburger();
+ part10TakeHamburger();
break;
case 105: // use anything with paperbin
igorSayAndWait(206, 1, 630);
@@ -79,18 +79,18 @@ void IgorEngine::PART_10_EXEC_ACTION(int action) {
igorSayAndWait(207, 1, 631);
break;
case 108:
- PART_10_ACTION_108_scrollLeft();
+ part10ScrollLeft();
break;
case 109: // back to map
_currentPart = 40;
break;
default:
- warning("PART_10_EXEC_ACTION unhandled action %d", action);
+ warning("part10ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_10_ACTION_104_pickHamburger() {
+void IgorEngine::part10TakeHamburger() {
if (_objectsState[kHamburgerTakenStateIndex] == 1) { // already picked hamburger
igorSayAndWait(205, 1, 629);
return;
@@ -108,7 +108,7 @@ void IgorEngine::PART_10_ACTION_104_pickHamburger() {
_objectsState[kHamburgerTakenStateIndex] = 1;
}
-void IgorEngine::PART_10_ACTION_108_scrollLeft() {
+void IgorEngine::part10ScrollLeft() {
uint8 *walkTable = loadData(WLK_DecanatoLeft);
int xPos = 329;
int yPos = 0;
@@ -145,7 +145,7 @@ void IgorEngine::PART_10_ACTION_108_scrollLeft() {
_currentPart = 110;
}
-void IgorEngine::PART_10() {
+void IgorEngine::part10() {
playMusic(1);
_gameState.enableLight = 1;
@@ -162,7 +162,7 @@ void IgorEngine::PART_10() {
loadAnimData(frames4, kPart10_11_Frm4);
loadAnimData(frames5, kPart10_11_Frm5);
- PART_10_11_DRAW_OBJECT_STATE(255);
+ part10And11DrawObjectState(255);
// Preserve the complete left panel at ANM+0, then make the right panel
// active. The original load order is unconditional.
@@ -175,7 +175,7 @@ void IgorEngine::PART_10() {
SET_PAL_240_48_1();
SET_PAL_208_96_1();
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_10_EXEC_ACTION);
+ partMainSetExecuteAction(1, &IgorEngine::part10ExecuteAction);
_roomDataOffsets = PART_10_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index da5ee0c5732..fdae794a81a 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -26,8 +26,8 @@ namespace Igor {
const uint32 kPart11PanelRight = 0x0000;
-void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
- PART_10_11_DRAW_OBJECT_STATE(num);
+void IgorEngine::part11ApplyObjectState(int num) {
+ part10And11DrawObjectState(num);
if (num == 1 || num == 255)
_roomObjectAreasTable[13].object = _objectsState[kSlugTakenStateIndex] == 0 ? 4 : 3;
@@ -58,27 +58,27 @@ void IgorEngine::PART_11_APPLY_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_11_ACTION_105_pickSlug() {
+void IgorEngine::part11TakeSlug() {
for (int frame = 0; frame <= 1; ++frame) {
drawAnimRect(0x6167, kPart10_11_Frm1 + frame * 0x405, 21, 49);
waitForTimer(127);
}
addObjectToInventory(kInventoryObjectSlug, 53);
_objectsState[kSlugTakenStateIndex] = 1;
- PART_11_APPLY_OBJECT_STATE(255);
+ part11ApplyObjectState(255);
}
-void IgorEngine::PART_11_ACTION_107_useButterflyNetWithHole() {
+void IgorEngine::part11UseButterflyNetWithHole() {
for (int frame = 0; frame <= 2; ++frame) {
drawAnimRect(0x47E3, kPart10_11_Frm5 + frame * 0x348, 30, 28);
waitForTimer(61);
}
removeObjectFromInventory(42);
_objectsState[kButterflyNetStateIndex] = 1;
- PART_11_APPLY_OBJECT_STATE(255);
+ part11ApplyObjectState(255);
}
-void IgorEngine::PART_11_ACTION_108_scrollRight() {
+void IgorEngine::part11ScrollRight() {
uint8 *walkTable = loadData(WLK_DecanatoRight);
int xPos = 310;
int yPos = 0;
@@ -115,19 +115,19 @@ void IgorEngine::PART_11_ACTION_108_scrollRight() {
_currentPart = 102;
}
-void IgorEngine::PART_11_ACTION_112_pickBottle() {
+void IgorEngine::part11TakeBottle() {
for (int frame = 0; frame <= 2; ++frame) {
drawAnimRect(0x47E3, kPart10_11_Frm2 + frame * 0x348, 30, 28);
waitForTimer(61);
}
addObjectToInventory(kInventoryObjectBottle, 58);
_objectsState[kButterflyNetStateIndex] = 1;
- PART_11_APPLY_OBJECT_STATE(3);
+ part11ApplyObjectState(3);
_objectsState[kBottleStateIndex] = 1;
- UPDATE_OBJECT_STATE(1);
+ partMainUpdateObjectState(1);
}
-void IgorEngine::PART_11_EXEC_ACTION(int action) {
+void IgorEngine::part11ExecuteAction(int action) {
switch (action) {
case 101: // look at window
ADD_DIALOGUE_TEXT(201, 2, 616);
@@ -145,16 +145,16 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
igorSayAndWait({ { 205, 1, 619 }, { 206, 1, 620 } });
break;
case 105:
- PART_11_ACTION_105_pickSlug();
+ part11TakeSlug();
break;
case 106: // look at slug
igorSayAndWait(73, 1, 50);
break;
case 107:
- PART_11_ACTION_107_useButterflyNetWithHole();
+ part11UseButterflyNetWithHole();
break;
case 108:
- PART_11_ACTION_108_scrollRight();
+ part11ScrollRight();
break;
case 109: // Look at hole
igorSayAndWait(207, 1, 621);
@@ -166,7 +166,7 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
igorSayAndWait(210, 1, 624);
break;
case 112:
- PART_11_ACTION_112_pickBottle();
+ part11TakeBottle();
break;
case 113:
igorSayAndWait(211, 1, 625);
@@ -175,12 +175,12 @@ void IgorEngine::PART_11_EXEC_ACTION(int action) {
igorSayAndWait(29, 1, 29);
break;
default:
- warning("PART_11_EXEC_ACTION unhandled action %d", action);
+ warning("part11ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_11() {
+void IgorEngine::part11() {
playMusic(1);
_gameState.enableLight = 1;
loadActionData(DAT_DecanatoPart11);
@@ -199,10 +199,10 @@ void IgorEngine::PART_11() {
loadAnimData(frames4, kPart10_11_Frm4);
loadAnimData(frames5, kPart10_11_Frm5);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_11_EXEC_ACTION);
+ partMainSetExecuteAction(1, &IgorEngine::part11ExecuteAction);
_roomDataOffsets = PART_11_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
- PART_11_APPLY_OBJECT_STATE(255);
+ part11ApplyObjectState(255);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
if (!restoreRoomAfterLoad()) {
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index cda281633eb..e88e4b5b1d6 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -26,11 +26,11 @@ 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);
+void IgorEngine::part12ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part12ExecuteAction %d", action);
switch (action) {
case 101:
- PART_12_ACTION_goToPath();
+ part12GoToPath();
break;
case 102: // look at portal
igorSay(201, 1, 789);
@@ -45,10 +45,10 @@ void IgorEngine::PART_12_EXEC_ACTION(int action) {
startIgorDialogue();
break;
case 104:
- PART_12_ACTION_104_tryEnterChurch();
+ part12TryEnterChurch();
break;
case 105:
- PART_12_ACTION_105_useResinWithStone();
+ part12UseResinWithStone();
break;
case 106: // look at door
igorSay(207, 2, 793);
@@ -57,15 +57,15 @@ void IgorEngine::PART_12_EXEC_ACTION(int action) {
igorSay(206, 1, 792);
break;
case 108:
- PART_12_ACTION_108_enterChurch();
+ part12EnterChurch();
break;
default:
- error("PART_12_EXEC_ACTION unhandled action %d", action);
+ error("part12ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_12_ACTION_goToPath() {
+void IgorEngine::part12GoToPath() {
for (int i = 9; i <= 10; ++i) {
_roomObjectAreasTable[i].area = 3;
}
@@ -99,7 +99,7 @@ void IgorEngine::PART_12_ACTION_goToPath() {
_currentPart = 40;
}
-void IgorEngine::PART_12_ACTION_104_tryEnterChurch() {
+void IgorEngine::part12TryEnterChurch() {
_walkCurrentFrame = 2;
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[33390]].area = _roomObjectAreasTable[_screenLayer2[34686]].area;
@@ -140,7 +140,7 @@ void IgorEngine::PART_12_ACTION_104_tryEnterChurch() {
decodeAnimFrame(src, _screenVGA);
decodeAnimFrame(src, _screenLayer1);
moveIgor(4, 0);
- PART_12_HANDLE_DIALOGUE_PRIEST();
+ part12HandlePriestDialogue();
for (int i = 4; i >= 1; --i) {
src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + i * 2) - 1;
decodeAnimFrame(src, _screenVGA);
@@ -152,10 +152,10 @@ void IgorEngine::PART_12_ACTION_104_tryEnterChurch() {
}
src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA440) - 1;
decodeAnimFrame(src, _screenLayer1);
- PART_12_OBJECT_STATE(255);
+ part12ApplyObjectState(255);
}
-void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
+void IgorEngine::part12UseResinWithStone() {
if (_objectsState[kLizardTakenStateIndex] == 1) {
ADD_DIALOGUE_TEXT(219, 1, 801);
SET_DIALOGUE_TEXT(1, 1);
@@ -199,7 +199,7 @@ void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
} while (_gameState.unk10 != 8);
--_walkDataLastIndex;
buildWalkPath(196, 64, 95, 142);
- PART_12_HELPER_2_disablePathBehindChurch();
+ part12DisablePathBehindChurch();
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
@@ -242,13 +242,13 @@ void IgorEngine::PART_12_ACTION_105_useResinWithStone() {
_currentAction.verb = kVerbWalk;
addObjectToInventory(kInventoryObjectMoney, 59);
_objectsState[kLizardTakenStateIndex] = 1;
- PART_12_OBJECT_STATE(255);
+ part12ApplyObjectState(255);
ADD_DIALOGUE_TEXT(211, 1, 795);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
-void IgorEngine::PART_12_ACTION_108_enterChurch() {
+void IgorEngine::part12EnterChurch() {
_walkCurrentFrame = 2;
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[28555]].area = _roomObjectAreasTable[_screenLayer2[34686]].area;
@@ -280,7 +280,7 @@ void IgorEngine::PART_12_ACTION_108_enterChurch() {
_currentPart = 130;
}
-void IgorEngine::PART_12_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part12UpdateBackground() {
if (compareGameTick(1) && getRandomNumber(14) == 0) {
switch (getRandomNumber(3)) {
case 0:
@@ -299,28 +299,28 @@ void IgorEngine::PART_12_UPDATE_ROOM_BACKGROUND() {
}
}
-void IgorEngine::PART_12_UPDATE_DIALOGUE_PRIEST(int action) {
+void IgorEngine::part12UpdatePriestDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_12_HELPER_8_drawIdlePriest();
+ part12DrawIdlePriest();
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_12_HELPER_10_drawPriestTalkingFrame(6 + getRandomNumber(5));
+ part12DrawPriestTalkingFrame(6 + getRandomNumber(5));
break;
case kUpdateDialogueAnimStanding:
- PART_12_HELPER_8_drawIdlePriest();
+ part12DrawIdlePriest();
break;
}
}
-void IgorEngine::PART_12_HANDLE_DIALOGUE_PRIEST() {
+void IgorEngine::part12HandlePriestDialogue() {
loadDialogueData(DLG_OutsideChurch);
- _updateDialogue = &IgorEngine::PART_12_UPDATE_DIALOGUE_PRIEST;
+ _updateDialogue = &IgorEngine::part12UpdatePriestDialogue;
handleDialogue(95, 55, 51, 28, 63);
_updateDialogue = 0;
}
-void IgorEngine::PART_12_OBJECT_STATE(int num) {
+void IgorEngine::part12ApplyObjectState(int num) {
if (num == 2 || num == 255) {
if (_objectsState[kChurchDoorOpenStateIndex] == 0) {
_roomActionsTable[169] = 104;
@@ -338,7 +338,7 @@ void IgorEngine::PART_12_OBJECT_STATE(int num) {
_roomActionsTable[186] = 3;
_roomActionsTable[188] = 3;
} else {
- PART_12_HELPER_9_drawEntrance();
+ part12DrawEntrance();
_roomActionsTable[169] = 108;
_roomActionsTable[175] = 106;
_roomActionsTable[177] = 2;
@@ -359,17 +359,17 @@ void IgorEngine::PART_12_OBJECT_STATE(int num) {
// Disables the path behind the church, which shall only be enabled
// in the cutscene where we pick the lizard
-void IgorEngine::PART_12_HELPER_2_disablePathBehindChurch() {
+void IgorEngine::part12DisablePathBehindChurch() {
for (int i = 9; i <= 10; ++i) {
_roomObjectAreasTable[i].area = 0;
}
}
-void IgorEngine::PART_12_HELPER_3_paintOverLizard() {
+void IgorEngine::part12PaintOverLizard() {
decodeAnimFrame(_animFramesBuffer, _screenVGA, true);
}
-void IgorEngine::PART_12_HELPER_4_exorcismCutscene() {
+void IgorEngine::part12ExorcismCutscene() {
SET_PAL_240_48_1();
SET_PAL_208_96_1();
fadeIn(768);
@@ -390,7 +390,7 @@ void IgorEngine::PART_12_HELPER_4_exorcismCutscene() {
waitForTimer(30);
}
}
- cutsceneSayWithCallback(95, 55, 51, 28, 63, { { 212, 2, 796 }, { 214, 1, 797 }, { 215, 1, 798 } }, &IgorEngine::PART_12_UPDATE_DIALOGUE_PRIEST);
+ cutsceneSayWithCallback(95, 55, 51, 28, 63, { { 212, 2, 796 }, { 214, 1, 797 }, { 215, 1, 798 } }, &IgorEngine::part12UpdatePriestDialogue);
for (int i = 12; i <= 29; ++i){
const uint8 *src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + i * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
@@ -412,7 +412,7 @@ void IgorEngine::PART_12_HELPER_4_exorcismCutscene() {
_currentPart = 40;
}
-void IgorEngine::PART_12_HELPER_5_enterFromPath() {
+void IgorEngine::part12EnterFromPath() {
_walkData[0].setPos(196, 64, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
@@ -448,8 +448,8 @@ void IgorEngine::PART_12_HELPER_5_enterFromPath() {
} while (_gameState.igorMoving || _gameState.unk10 != 11);
}
-void IgorEngine::PART_12_HELPER_6_enterFromChurch() {
- PART_12_OBJECT_STATE(255);
+void IgorEngine::part12EnterFromChurch() {
+ part12ApplyObjectState(255);
_walkData[0].setPos(75, 89, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
@@ -486,19 +486,19 @@ void IgorEngine::PART_12_HELPER_6_enterFromChurch() {
} while (_gameState.igorMoving || _gameState.unk10 != 11);
}
-void IgorEngine::PART_12_HELPER_8_drawIdlePriest() {
+void IgorEngine::part12DrawIdlePriest() {
decodeAnimFrame(_animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA454) - 1, _screenVGA, true);
}
-void IgorEngine::PART_12_HELPER_9_drawEntrance() {
+void IgorEngine::part12DrawEntrance() {
decodeAnimFrame(_animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA442) - 1, _screenLayer1, true);
}
-void IgorEngine::PART_12_HELPER_10_drawPriestTalkingFrame(int frame) {
+void IgorEngine::part12DrawPriestTalkingFrame(int frame) {
decodeAnimFrame(_animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + frame * 2) - 1, _screenVGA, true);
}
-void IgorEngine::PART_12() {
+void IgorEngine::part12() {
if (_currentPart != 122) {
playMusic(1);
}
@@ -517,25 +517,25 @@ void IgorEngine::PART_12() {
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part12ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part12UpdateBackground;
+ part12ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (_objectsState[kLizardTakenStateIndex] == 0) {
- PART_12_HELPER_3_paintOverLizard();
+ part12PaintOverLizard();
}
if (_currentPart == 122 && !_gameStateLoaded) {
- PART_12_HELPER_4_exorcismCutscene();
+ part12ExorcismCutscene();
return;
}
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 120) {
- PART_12_HELPER_5_enterFromPath();
+ part12EnterFromPath();
}
if (_currentPart == 121) {
- PART_12_HELPER_6_enterFromChurch();
+ part12EnterFromChurch();
if (_objectsState[kStatuetteTaken2StateIndex] == 1) {
ADD_DIALOGUE_TEXT(216, 2, 799);
ADD_DIALOGUE_TEXT(218, 1, 800);
@@ -553,7 +553,7 @@ void IgorEngine::PART_12() {
}
}
}
- PART_12_HELPER_2_disablePathBehindChurch();
+ part12DisablePathBehindChurch();
enterPartLoop();
while (_currentPart >= 120 && _currentPart <= 122 && !_gameStateLoaded) {
runPartLoop();
diff --git a/engines/igor/parts/part_13.cpp b/engines/igor/parts/part_13.cpp
index c73b722ea6c..b9d8c37705d 100644
--- a/engines/igor/parts/part_13.cpp
+++ b/engines/igor/parts/part_13.cpp
@@ -23,31 +23,31 @@
namespace Igor {
-void IgorEngine::PART_13_EXEC_ACTION(int action) {
- debugC(9, kDebugGame, "PART_13_EXEC_ACTION %d", action);
+void IgorEngine::part13ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part13ExecuteAction %d", action);
switch (action) {
case 101: // go to platform
- PART_13_ACTION_101_103_goToPlatform();
+ part13GoToPlatform();
break;
case 102: // look at stained glass
igorSay(201, 2, 858);
break;
case 103: // look at platform
- PART_13_ACTION_101_103_goToPlatform();
+ part13GoToPlatform();
break;
case 104:
- PART_13_ACTION_104_exitChurch();
+ part13ExitChurch();
break;
case 105: // go to church puzzle
_currentPart = 140;
break;
default:
- error("PART_13_EXEC_ACTION unhandled action %d", action);
+ error("part13ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_13_ACTION_101_103_goToPlatform() {
+void IgorEngine::part13GoToPlatform() {
waitForTimer(255);
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
@@ -126,7 +126,7 @@ void IgorEngine::PART_13_ACTION_101_103_goToPlatform() {
} while (_gameState.igorMoving);
}
-void IgorEngine::PART_13_ACTION_104_exitChurch() {
+void IgorEngine::part13ExitChurch() {
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
for (int i = 9; i >= 0; --i) {
@@ -149,10 +149,10 @@ void IgorEngine::PART_13_ACTION_104_exitChurch() {
_currentPart = 121;
}
-void IgorEngine::PART_13_HELPER_OBJECT_STATE(int num) {
+void IgorEngine::part13ApplyObjectState(int num) {
}
-void IgorEngine::PART_13_HELPER_2_enterFromRight() {
+void IgorEngine::part13EnterFromRight() {
WalkData *wd = &_walkData[0];
wd->setPos(314, 127, 4, 0);
wd->clipSkipX = 1;
@@ -171,8 +171,8 @@ void IgorEngine::PART_13_HELPER_2_enterFromRight() {
waitForIgorMove();
}
-void IgorEngine::PART_13_HELPER_3_enterFromBelow() {
- PART_13_HELPER_OBJECT_STATE(255);
+void IgorEngine::part13EnterFromBelow() {
+ part13ApplyObjectState(255);
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
for (int i = 0; i <= 9; ++i) {
@@ -197,23 +197,23 @@ void IgorEngine::PART_13_HELPER_3_enterFromBelow() {
_walkDataCurrentIndex = 1;
}
-void IgorEngine::PART_13() {
+void IgorEngine::part13() {
playMusic(3);
_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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part13ExecuteAction);
+ part13ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 130) {
- PART_13_HELPER_3_enterFromBelow();
+ part13EnterFromBelow();
} else {
- PART_13_HELPER_2_enterFromRight();
+ part13EnterFromRight();
}
enterPartLoop();
}
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index e9926a8c82c..e858619bd37 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -29,40 +29,40 @@ 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);
+void IgorEngine::part14ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part14ExecuteAction %d", action);
switch (action) {
case 101:
- PART_14_ACTION_101_goToChurchBell();
+ part14GoToChurchBell();
break;
case 102: // look at stairs
igorSay(201, 1, 860);
break;
case 103:
- PART_14_ACTION_103_lookAtPuzzle();
+ part14LookAtPuzzle();
break;
case 104: // look at candles
igorSay(202, 1, 861);
break;
case 105:
- PART_14_ACTION_105_goBackToChurch();
+ part14GoBackToChurch();
break;
case 106:
- PART_14_ACTION_106_enterMaze();
+ part14EnterMaze();
break;
case 107:
igorSay(203, 1, 862);
break;
case 108:
- PART_14_ACTION_108_useMatchesOnCandles();
+ part14UseMatchesOnCandles();
break;
default:
- error("PART_14_EXEC_ACTION unhandled action %d", action);
+ error("part14ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_14_ACTION_101_goToChurchBell() {
+void IgorEngine::part14GoToChurchBell() {
_roomObjectAreasTable[_screenLayer2[22156]].area = 1;
_roomObjectAreasTable[_screenLayer2[27895]].area = 1;
--_walkDataLastIndex;
@@ -86,10 +86,10 @@ void IgorEngine::PART_14_ACTION_101_goToChurchBell() {
_currentPart = 220;
}
-void IgorEngine::PART_14_ACTION_103_lookAtPuzzle() {
+void IgorEngine::part14LookAtPuzzle() {
fadeOut(768);
- PART_14_HELPER_9_showPuzzle();
- loadResourceData__ROOM_ChurchPuzzle();
+ part14ShowPuzzle();
+ part14LoadRoom();
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
@@ -104,11 +104,11 @@ void IgorEngine::PART_14_ACTION_103_lookAtPuzzle() {
igorSay(227, 1, 1292);
_objectsState[kSecretPassageEntranceOpenStateIndex] = 1;
}
- PART_14_HELPER_1_OBJECT_STATE(255);
+ part14ApplyObjectState(255);
_currentPart = 140;
}
-void IgorEngine::PART_14_ACTION_105_goBackToChurch() {
+void IgorEngine::part14GoBackToChurch() {
_walkDataCurrentIndex = 0;
for (int i = 9; i >= 0; --i) {
WalkData *wd = &_walkData[0];
@@ -131,7 +131,7 @@ void IgorEngine::PART_14_ACTION_105_goBackToChurch() {
_currentPart = 131;
}
-void IgorEngine::PART_14_ACTION_106_enterMaze() {
+void IgorEngine::part14EnterMaze() {
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[35684]].area = 2;
buildWalkPath(164, 126, 164, 111);
@@ -170,9 +170,9 @@ void IgorEngine::PART_14_ACTION_106_enterMaze() {
}
// cutscene where the brother gives us the papyrus
-void IgorEngine::PART_14_ACTION_108_useMatchesOnCandles() {
+void IgorEngine::part14UseMatchesOnCandles() {
_gameState.unkF = false;
- _updateRoomBackground = &IgorEngine::PART_14_UPDATE_ROOM_BACKGROUND_ACTION_108;
+ _updateRoomBackground = &IgorEngine::part14UpdateCandleFlicker;
igorSayAndWait(226, 1, 880);
removeObjectFromInventory(43);
for (int i = 1; i <= 3; ++i) {
@@ -182,11 +182,11 @@ void IgorEngine::PART_14_ACTION_108_useMatchesOnCandles() {
}
_gameState.unkF = true;
playSound(33, 1);
- PART_14_HELPER_8_brotherReveal(4, 24);
+ part14BrotherReveal(4, 24);
stopSound();
cutsceneSay(221, 85, 12, 33, 63, 205, 1, 864);
- PART_14_HELPER_8_brotherReveal(25, 26);
- PART_14_HELPER_8_brotherReveal(60, 60);
+ part14BrotherReveal(25, 26);
+ part14BrotherReveal(60, 60);
WalkData *wd = &_walkData[_walkDataLastIndex - 1];
wd->x = 250;
wd->y = 138;
@@ -203,27 +203,27 @@ void IgorEngine::PART_14_ACTION_108_useMatchesOnCandles() {
addObjectToInventory(kInventoryObjectPapyrus, 63);
igorSayAndWait({ { 217, 1, 872 }, { 218, 1, 873 }, { 219, 1, 874 } });
cutsceneSay(221, 85, 12, 33, 63, 220, 2, 875);
- PART_14_HELPER_7_candleFlicker(0);
+ part14CandleFlicker(0);
_gameState.unkF = false;
_screenVGA[32865] = _screenLayer1[32865];
playSound(33, 1);
- PART_14_HELPER_8_brotherReveal(36, 60);
+ part14BrotherReveal(36, 60);
stopSound();
igorSayAndWait({ { 222, 1, 876 }, { 223, 1, 877 }, { 224, 1, 878 }, { 225, 1, 879 } });
- PART_14_HELPER_1_OBJECT_STATE(255);
+ part14ApplyObjectState(255);
_updateRoomBackground = 0;
}
-void IgorEngine::PART_14_UPDATE_ROOM_BACKGROUND_ACTION_108() {
+void IgorEngine::part14UpdateCandleFlicker() {
if (compareGameTick(2, 16) && _gameState.unkF) {
- PART_14_HELPER_7_candleFlicker(getRandomNumber(1) + 1);
+ part14CandleFlicker(getRandomNumber(1) + 1);
}
}
-void IgorEngine::PART_14_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part14ApplyObjectState(int num) {
if (num == 1 || num == 255) {
if (_objectsState[kSecretPassageEntranceOpenStateIndex] == 1) {
- PART_14_HELPER_6_drawEntrance();
+ part14DrawEntrance();
_roomObjectAreasTable[3].object = 5;
_roomObjectAreasTable[4].object = 5;
_roomObjectAreasTable[7].object = 5;
@@ -237,7 +237,7 @@ void IgorEngine::PART_14_HELPER_1_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_14_HELPER_2_enterFromChurch() {
+void IgorEngine::part14EnterFromChurch() {
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
for (int i = 0; i <= 9; ++i) {
@@ -267,7 +267,7 @@ void IgorEngine::PART_14_HELPER_2_enterFromChurch() {
waitForIgorMove();
}
-void IgorEngine::PART_14_HELPER_3_enterFromChurchBell() {
+void IgorEngine::part14EnterFromChurchBell() {
for (int i = 192 * 3; i <= 207 * 3; ++i) {
if (_paletteBuffer[i] > 5) {
_currentPalette[i] -= 5;
@@ -307,8 +307,8 @@ void IgorEngine::PART_14_HELPER_3_enterFromChurchBell() {
_roomObjectAreasTable[_screenLayer2[27895]].area = 0;
}
-void IgorEngine::PART_14_HELPER_4_enterFromMaze() {
- PART_14_HELPER_1_OBJECT_STATE(255);
+void IgorEngine::part14EnterFromMaze() {
+ part14ApplyObjectState(255);
for (int i = 192 * 3; i <= 207 * 3; ++i) {
if (_paletteBuffer[i] > 5) {
_currentPalette[i] -= 5;
@@ -352,19 +352,19 @@ void IgorEngine::PART_14_HELPER_4_enterFromMaze() {
waitForIgorMove();
}
-void IgorEngine::PART_14_HELPER_6_drawEntrance() {
+void IgorEngine::part14DrawEntrance() {
const int offset = 18382;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xD5BA, 44, 44, 66);
}
-void IgorEngine::PART_14_HELPER_7_candleFlicker(int frame) {
+void IgorEngine::part14CandleFlicker(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_brotherReveal(int start, int end) {
+void IgorEngine::part14BrotherReveal(int start, int end) {
_gameState.counter[0] = start - 1;
do {
if (compareGameTick(1, 16)) {
@@ -373,14 +373,14 @@ void IgorEngine::PART_14_HELPER_8_brotherReveal(int start, int end) {
decodeAnimFrame(src, _screenVGA, true);
}
if (compareGameTick(2, 16) && _gameState.unkF) {
- PART_14_HELPER_7_candleFlicker(getRandomNumber(1) + 1);
+ part14CandleFlicker(getRandomNumber(1) + 1);
}
waitForTimer();
} while (_gameState.counter[0] != end);
}
-void IgorEngine::PART_14_HELPER_9_showPuzzle() {
- PART_14_HELPER_10_loadChurchMosaicData();
+void IgorEngine::part14ShowPuzzle() {
+ part14LoadChurchMosaicData();
memcpy(_screenTextLayer, _screenVGA, 46080);
memcpy(_screenVGA, _screenLayer1, 46080);
memcpy(_screenLayer1, _screenTextLayer, 46080);
@@ -429,28 +429,28 @@ void IgorEngine::PART_14_HELPER_9_showPuzzle() {
playSound(34, 1);
switch (area) {
case 1:
- PART_14_pushStone(33359, 28, 34, 0);
+ part14PushStone(33359, 28, 34, 0);
break;
case 2:
- PART_14_pushStone(22800, 27, 34, 0x3D4);
+ part14PushStone(22800, 27, 34, 0x3D4);
break;
case 3:
- PART_14_pushStone(10642, 39, 45, 0x785);
+ part14PushStone(10642, 39, 45, 0x785);
break;
case 4:
- PART_14_pushStone(3624, 56, 39, 0xCCFA);
+ part14PushStone(3624, 56, 39, 0xCCFA);
break;
case 5:
- PART_14_pushStone(3679, 54, 38, 0xE87);
+ part14PushStone(3679, 54, 38, 0xE87);
break;
case 6:
- PART_14_pushStone(11077, 35, 35, 0x1D8F);
+ part14PushStone(11077, 35, 35, 0x1D8F);
break;
case 7:
- PART_14_pushStone(20688, 28, 36, 0x227B);
+ part14PushStone(20688, 28, 36, 0x227B);
break;
case 8:
- PART_14_pushStone(31889, 27, 38, 0x2687);
+ part14PushStone(31889, 27, 38, 0x2687);
break;
}
stopSound();
@@ -496,7 +496,7 @@ void IgorEngine::PART_14_HELPER_9_showPuzzle() {
SET_PAL_208_96_1();
}
-void IgorEngine::PART_14_HELPER_10_loadChurchMosaicData() {
+void IgorEngine::part14LoadChurchMosaicData() {
loadData(PAL_ChurchMosaic, _paletteBuffer);
loadData(IMG_ChurchMosaic, _screenLayer1);
uint8 *p = loadData(MSK_ChurchMosaic);
@@ -504,7 +504,7 @@ void IgorEngine::PART_14_HELPER_10_loadChurchMosaicData() {
free(p);
}
-void IgorEngine::PART_14_pushStone(int screenOffset, int w, int h, int animOffset) {
+void IgorEngine::part14PushStone(int screenOffset, int w, int h, int animOffset) {
for (int i = 0; i <= h; ++i) {
memcpy(_screenTempLayer + i * 100, _screenVGA + i * 320 + screenOffset, w);
memcpy(_screenVGA + i * 320 + screenOffset, _animFramesBuffer + animOffset + i * w, w);
@@ -515,28 +515,28 @@ void IgorEngine::PART_14_pushStone(int screenOffset, int w, int h, int animOffse
}
}
-void IgorEngine::PART_14() {
+void IgorEngine::part14() {
playMusic(3);
_gameState.enableLight = 1;
- loadResourceData__ROOM_ChurchPuzzle();
- loadResourceData__ANIM_ChurchPuzzle();
+ part14LoadRoom();
+ part14LoadAnimation();
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part14ExecuteAction);
+ part14ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 140) {
- PART_14_HELPER_2_enterFromChurch();
+ part14EnterFromChurch();
}
if (_currentPart == 141) {
- PART_14_HELPER_3_enterFromChurchBell();
+ part14EnterFromChurchBell();
}
if (_currentPart == 142) {
- PART_14_HELPER_4_enterFromMaze();
+ part14EnterFromMaze();
}
enterPartLoop();
}
@@ -548,11 +548,11 @@ void IgorEngine::PART_14() {
fadeOut(624);
}
-void IgorEngine::loadResourceData__ROOM_ChurchPuzzle() {
+void IgorEngine::part14LoadRoom() {
loadRoomData(PAL_ChurchPuzzle, IMG_ChurchPuzzle, BOX_ChurchPuzzle, MSK_ChurchPuzzle, TXT_ChurchPuzzle);
}
-void IgorEngine::loadResourceData__ANIM_ChurchPuzzle() {
+void IgorEngine::part14LoadAnimation() {
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, 0 };
diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp
index 9222912c3cb..214b3992f1e 100644
--- a/engines/igor/parts/part_15.cpp
+++ b/engines/igor/parts/part_15.cpp
@@ -34,10 +34,10 @@ 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) {
+void IgorEngine::part15ExecuteAction(int action) {
switch (action) {
case 101:
- PART_15_ACTION_101_leaveRoom();
+ part15LeaveRoom();
break;
case 102: // look at door
igorSay(204, 1, 324);
@@ -55,7 +55,7 @@ void IgorEngine::PART_15_EXEC_ACTION(int action) {
igorSay(205, 2, 325);
break;
case 107:
- PART_15_ACTION_107_talkToTobias();
+ part15TalkToTobias();
break;
case 108: // Take tobias
igorSay(208, 1, 327);
@@ -79,18 +79,18 @@ void IgorEngine::PART_15_EXEC_ACTION(int action) {
igorSay(240, 1, 350);
break;
case 115:
- PART_15_ACTION_115_giveProjectToTobias();
+ part15GiveProjectToTobias();
break;
case 116:
- PART_15_ACTION_116_giveMoneyToTobias();
+ part15GiveMoneyToTobias();
break;
default:
- error("PART_15_EXEC_ACTION unhandled action %d", action);
+ error("part15ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_15_ACTION_101_leaveRoom() {
+void IgorEngine::part15LeaveRoom() {
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[34560]].area = 1;
buildWalkPathSimple(34, 108, 0, 108);
@@ -102,24 +102,24 @@ void IgorEngine::PART_15_ACTION_101_leaveRoom() {
_currentPart = 271;
}
-void IgorEngine::PART_15_ACTION_107_talkToTobias() {
- PART_15_waitForCuckooClock();
- PART_15_HELPER_7_drawIgorAndTobiasScene(6);
- PART_15_HANDLE_DIALOGUE_TOBIAS();
+void IgorEngine::part15TalkToTobias() {
+ part15WaitForCuckooClock();
+ part15DrawIgorAndTobiasScene(6);
+ part15HandleTobiasDialogue();
}
-void IgorEngine::PART_15_ACTION_115_giveProjectToTobias() {
- PART_15_waitForCuckooClock();
- PART_15_HELPER_7_drawIgorAndTobiasScene(6);
+void IgorEngine::part15GiveProjectToTobias() {
+ part15WaitForCuckooClock();
+ part15DrawIgorAndTobiasScene(6);
igorSayAndWait({ { 209, 1, 328 }, { 210, 1, 329 } });
- cutsceneSayWithCallback(133, 67, 0, 63, 19, 212, 1, 331, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 212, 1, 331, &IgorEngine::part15UpdateTobiasDialogue);
igorSayAndWait(213, 1, 332);
- cutsceneSayWithCallback(133, 67, 0, 63, 19, 214, 1, 333, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 214, 1, 333, &IgorEngine::part15UpdateTobiasDialogue);
for (int i = 1; i <= 11; ++i) {
- PART_15_PART_15_HELPER_9_drawTobiasIdleFrame(PART_15_ANIM_DATA_3[i]);
+ part15DrawTobiasIdleFrame(PART_15_ANIM_DATA_3[i]);
waitForTimer(60);
}
- PART_15_HELPER_7_drawIgorAndTobiasScene(6);
+ part15DrawIgorAndTobiasScene(6);
if (_objectsState[kPersonalFileChangedStateIndex] == 0) {
ADD_DIALOGUE_TEXT(215, 2, 334);
ADD_DIALOGUE_TEXT(217, 1, 335);
@@ -129,41 +129,41 @@ void IgorEngine::PART_15_ACTION_115_giveProjectToTobias() {
}
SET_DIALOGUE_TEXT(1, 2);
startCutsceneDialogue(133, 67, 0, 63, 19);
- _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS;
+ _updateDialogue = &IgorEngine::part15UpdateTobiasDialogue;
waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19);
_updateDialogue = 0;
if (_objectsState[kPersonalFileChangedStateIndex] == 0) {
return;
}
for (int i = 1; i <= 7; ++i) {
- PART_15_HELPER_7_drawIgorAndTobiasScene(PART_15_ANIM_DATA_2[i]);
+ part15DrawIgorAndTobiasScene(PART_15_ANIM_DATA_2[i]);
waitForTimer(40);
}
removeObjectFromInventory(70);
_objectsState[kProjectHandedToTobiasStateIndex] = 1;
if (_objectsState[kMoneyHandedToTobiasStateIndex] == 0) {
- cutsceneSayWithCallback(133, 67, 0, 63, 19, 221, 2, 338, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 221, 2, 338, &IgorEngine::part15UpdateTobiasDialogue);
return;
}
- cutsceneSayWithCallback(133, 67, 0, 63, 19, 226, 2, 341, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 226, 2, 341, &IgorEngine::part15UpdateTobiasDialogue);
igorSayAndWait(228, 1, 342);
- cutsceneSayWithCallback(133, 67, 0, 63, 19, 229, 1, 343, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 229, 1, 343, &IgorEngine::part15UpdateTobiasDialogue);
igorSayAndWait(230, 1, 344);
_currentPart = 780;
}
-void IgorEngine::PART_15_ACTION_116_giveMoneyToTobias() {
- PART_15_waitForCuckooClock();
- PART_15_HELPER_7_drawIgorAndTobiasScene(6);
+void IgorEngine::part15GiveMoneyToTobias() {
+ part15WaitForCuckooClock();
+ part15DrawIgorAndTobiasScene(6);
igorSayAndWait({ { 209, 1, 328 }, { 211, 1, 330 } });
- cutsceneSayWithCallback(133, 67, 0, 63, 19, 212, 1, 331, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 212, 1, 331, &IgorEngine::part15UpdateTobiasDialogue);
igorSayAndWait(213, 1, 332);
- cutsceneSayWithCallback(133, 67, 0, 63, 19, 214, 1, 333, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 214, 1, 333, &IgorEngine::part15UpdateTobiasDialogue);
for (int i = 1; i <= 11; ++i) {
- PART_15_PART_15_HELPER_9_drawTobiasIdleFrame(PART_15_ANIM_DATA_5[i]);
+ part15DrawTobiasIdleFrame(PART_15_ANIM_DATA_5[i]);
waitForTimer(60);
}
- PART_15_HELPER_7_drawIgorAndTobiasScene(6);
+ part15DrawIgorAndTobiasScene(6);
if (_objectsState[kPersonalFileChangedStateIndex] == 0) {
ADD_DIALOGUE_TEXT(215, 2, 334);
ADD_DIALOGUE_TEXT(217, 1, 335);
@@ -173,64 +173,64 @@ void IgorEngine::PART_15_ACTION_116_giveMoneyToTobias() {
}
SET_DIALOGUE_TEXT(1, 2);
startCutsceneDialogue(133, 67, 0, 63, 19);
- _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS;
+ _updateDialogue = &IgorEngine::part15UpdateTobiasDialogue;
waitForEndOfCutsceneDialogue(133, 67, 0, 63, 19);
_updateDialogue = 0;
if (_objectsState[kPersonalFileChangedStateIndex] == 0) {
return;
}
for (int i = 1; i <= 7; ++i) {
- PART_15_HELPER_7_drawIgorAndTobiasScene(PART_15_ANIM_DATA_4[i]);
+ part15DrawIgorAndTobiasScene(PART_15_ANIM_DATA_4[i]);
waitForTimer(40);
}
removeObjectFromInventory(60);
_objectsState[kMoneyHandedToTobiasStateIndex] = 1;
if (_objectsState[kProjectHandedToTobiasStateIndex] == 0) {
- cutsceneSayWithCallback(133, 67, 0, 63, 19, 224, 2, 340, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 224, 2, 340, &IgorEngine::part15UpdateTobiasDialogue);
return;
}
- cutsceneSayWithCallback(133, 67, 0, 63, 19, 226, 2, 341, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 226, 2, 341, &IgorEngine::part15UpdateTobiasDialogue);
igorSayAndWait(228, 1, 342);
- cutsceneSayWithCallback(133, 67, 0, 63, 19, 229, 1, 343, &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS);
+ cutsceneSayWithCallback(133, 67, 0, 63, 19, 229, 1, 343, &IgorEngine::part15UpdateTobiasDialogue);
igorSayAndWait(230, 1, 344);
_currentPart = 780;
}
-void IgorEngine::PART_15_UPDATE_ROOM_BACKGROUND() {
- PART_15_HELPER_5_animateTobiasIdle();
+void IgorEngine::part15UpdateBackground() {
+ part15AnimateTobiasIdle();
if (compareGameTick(38) || compareGameTick(60)) {
if (_objectsState[kCuckooClockTriggeredStateIndex] != 1 && getRandomNumber(199) == 0 && _gameState.counter[3] == 0) {
_gameState.counter[3] = 1;
}
}
- PART_15_HELPER_3_updateCuckooClock();
+ part15UpdateCuckooClock();
}
-void IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS(int action) {
+void IgorEngine::part15UpdateTobiasDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_15_HELPER_8_drawTobiasTalking(0);
+ part15DrawTobiasTalking(0);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_15_HELPER_8_drawTobiasTalking(getRandomNumber(4));
+ part15DrawTobiasTalking(getRandomNumber(4));
break;
case kUpdateDialogueAnimStanding:
- PART_15_HELPER_8_drawTobiasTalking(0);
+ part15DrawTobiasTalking(0);
break;
}
}
-void IgorEngine::PART_15_HANDLE_DIALOGUE_TOBIAS() {
+void IgorEngine::part15HandleTobiasDialogue() {
loadDialogueData(DLG_TobiasOffice);
- _updateDialogue = &IgorEngine::PART_15_UPDATE_DIALOGUE_TOBIAS;
+ _updateDialogue = &IgorEngine::part15UpdateTobiasDialogue;
handleDialogue(133, 67, 0, 63, 19);
_updateDialogue = 0;
}
-void IgorEngine::PART_15_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part15ApplyObjectState(int num) {
}
-void IgorEngine::PART_15_HELPER_2_walkIn() {
+void IgorEngine::part15WalkIn() {
_walkData[0].setPos(0, 108, 2, 0);
_walkData[0].clipSkipX = 1;
_walkData[0].clipWidth = 15;
@@ -250,7 +250,7 @@ void IgorEngine::PART_15_HELPER_2_walkIn() {
waitForIgorMove();
}
-void IgorEngine::PART_15_HELPER_3_updateCuckooClock() {
+void IgorEngine::part15UpdateCuckooClock() {
if (compareGameTick(38) || compareGameTick(60)) {
if (_objectsState[kCuckooClockTriggeredStateIndex] != 1 && _gameState.counter[3] == 1) {
if (_gameState.unk11 == 0) {
@@ -258,7 +258,7 @@ void IgorEngine::PART_15_HELPER_3_updateCuckooClock() {
_objectsState[kCuckooAnimationControlStateIndex] = 1;
_gameState.counter[3] = 0;
} else {
- PART_15_HELPER_6_drawCuckooFrame(_gameState.unk11);
+ part15DrawCuckooFrame(_gameState.unk11);
}
if (_gameState.unk11 == 7) {
_objectsState[kCuckooAnimationControlStateIndex] = 2;
@@ -286,19 +286,19 @@ void IgorEngine::PART_15_HELPER_3_updateCuckooClock() {
}
}
-void IgorEngine::PART_15_waitForCuckooClock() {
+void IgorEngine::part15WaitForCuckooClock() {
if (_gameState.counter[3] == 1) {
do {
- PART_15_HELPER_3_updateCuckooClock();
+ part15UpdateCuckooClock();
waitForTimer();
} while (_gameState.counter[3] != 0);
}
}
-void IgorEngine::PART_15_HELPER_5_animateTobiasIdle() {
+void IgorEngine::part15AnimateTobiasIdle() {
if (compareGameTick(7) || compareGameTick(29) || compareGameTick(61)) {
if (_gameState.unk10 >= 3) {
- PART_15_PART_15_HELPER_9_drawTobiasIdleFrame(PART_15_ANIM_DATA_1[_gameState.unk10]);
+ part15DrawTobiasIdleFrame(PART_15_ANIM_DATA_1[_gameState.unk10]);
++_gameState.unk10;
if (_gameState.unk10 == 8) {
_gameState.unk10 = 1;
@@ -307,7 +307,7 @@ void IgorEngine::PART_15_HELPER_5_animateTobiasIdle() {
}
if (compareGameTick(5)) {
if (_gameState.unk10 >= 1 && _gameState.unk10 <= 2) {
- PART_15_PART_15_HELPER_9_drawTobiasIdleFrame(_gameState.unk10);
+ part15DrawTobiasIdleFrame(_gameState.unk10);
if (_gameState.unk10 == 1 && getRandomNumber(9) == 0) {
_gameState.unk10 = 2;
} else {
@@ -320,7 +320,7 @@ void IgorEngine::PART_15_HELPER_5_animateTobiasIdle() {
}
}
-void IgorEngine::PART_15_HELPER_6_drawCuckooFrame(int frame) {
+void IgorEngine::part15DrawCuckooFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 17; ++i) {
for (int j = 0; j <= 52; ++j) {
@@ -343,22 +343,22 @@ void IgorEngine::PART_15_HELPER_6_drawCuckooFrame(int frame) {
}
}
-void IgorEngine::PART_15_HELPER_7_drawIgorAndTobiasScene(int frame) {
+void IgorEngine::part15DrawIgorAndTobiasScene(int frame) {
int offset = 20887;
drawAnimRect(offset, 0x49A + frame * 2124, 59, 36);
}
-void IgorEngine::PART_15_HELPER_8_drawTobiasTalking(int frame) {
+void IgorEngine::part15DrawTobiasTalking(int frame) {
int offset = 22847;
drawAnimRect(offset, 0x958 + frame * 182, 14, 13);
}
-void IgorEngine::PART_15_PART_15_HELPER_9_drawTobiasIdleFrame(int frame) {
+void IgorEngine::part15DrawTobiasIdleFrame(int frame) {
int offset = 22835;
drawAnimRect(offset, frame * 598, 26, 23);
}
-void IgorEngine::PART_15() {
+void IgorEngine::part15() {
playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_TobiasOffice, IMG_TobiasOffice, BOX_TobiasOffice, MSK_TobiasOffice, TXT_TobiasOffice);
@@ -367,9 +367,9 @@ void IgorEngine::PART_15() {
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part15ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part15UpdateBackground;
+ part15ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
@@ -378,7 +378,7 @@ void IgorEngine::PART_15() {
_gameState.unk11 = 2;
_gameState.counter[3] = 0;
_gameState.counter[4] = 0;
- PART_15_HELPER_2_walkIn();
+ part15WalkIn();
enterPartLoop();
}
while (_currentPart == 150 && !_gameStateLoaded) {
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index ea26462ec78..081d4ce5a9a 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -26,11 +26,11 @@ 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);
+void IgorEngine::part16ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part16ExecuteAction %d", action);
switch (action) {
case 101: // pick up things
- PART_16_ACTION_101_pickUpFlask();
+ part16TakeFlask();
break;
case 102: // look at things
igorSay(208, 2, 730);
@@ -39,12 +39,12 @@ void IgorEngine::PART_16_EXEC_ACTION(int action) {
_currentPart = 261;
break;
default:
- error("PART_16_EXEC_ACTION unhandled action %d", action);
+ error("part16ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_16_ACTION_101_pickUpFlask() {
+void IgorEngine::part16TakeFlask() {
if (_objectsState[kFlaskTakenStateIndex] == 1) {
igorSay(207, 1, 729);
return;
@@ -63,32 +63,32 @@ void IgorEngine::PART_16_ACTION_101_pickUpFlask() {
igorSay(204, 3, 728);
}
-void IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET_HARRISON(int action) {
+void IgorEngine::part16UpdateMargaretHarrisonDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_16_HELPER_6_drawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? 34 : 48);
+ part16DrawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? 34 : 48);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_16_HELPER_6_drawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? getRandomNumber(4) + 30 : getRandomNumber(4) + 44);
+ part16DrawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? getRandomNumber(4) + 30 : getRandomNumber(4) + 44);
break;
}
}
-void IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET(int action) {
+void IgorEngine::part16UpdateMargaretDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_16_HELPER_6_drawTalkingFrame(49);
+ part16DrawTalkingFrame(49);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_16_HELPER_6_drawTalkingFrame(getRandomNumber(3) + 49);
+ part16DrawTalkingFrame(getRandomNumber(3) + 49);
break;
}
}
-void IgorEngine::PART_16_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part16ApplyObjectState(int num) {
}
-void IgorEngine::PART_16_HELPER_2_enterScene() {
+void IgorEngine::part16EnterScene() {
WalkData *wd = &_walkData[0];
wd->setPos(0, 135, 2, 0);
wd->clipSkipX = 1;
@@ -107,7 +107,7 @@ void IgorEngine::PART_16_HELPER_2_enterScene() {
waitForIgorMove();
}
-void IgorEngine::PART_16_HELPER_3_photoCutscene() {
+void IgorEngine::part16PhotoCutscene() {
memset(_screenVGA + 46080, 0, 17920);
igorSayAndWait({ { 210, 1, 731 }, { 211, 1, 732 }, { 212, 1, 733 }, { 213, 2, 734 } });
--_walkDataLastIndex;
@@ -136,19 +136,19 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
fadeOut(768);
playMusic(8);
_currentPart = 331;
- PART_33();
+ part33();
memset(_currentPalette, 0, 768);
setPaletteRange(208, 255);
do {
- PART_MARGARET_ROOM_CUTSCENE();
+ partMargaret();
} while (_objectsState[kMargaretSceneStateIndex] != 9);
setupDefaultPalette();
SET_PAL_240_48_1();
SET_PAL_208_96_1();
- loadResourceData__ROOM_Laboratory();
- loadResourceData__ANIM_Laboratory();
+ part16LoadRoom();
+ part16LoadAnimation();
memcpy(_screenVGA, _screenLayer1, 46080);
- PART_16_HELPER_1_OBJECT_STATE(255);
+ part16ApplyObjectState(255);
fadeIn(768);
waitForTimer(255);
for (int i = 1; i <= 29; ++i) {
@@ -156,19 +156,19 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
waitForTimer(25);
}
VAR_CURRENT_TALKING_ACTOR = 0;
- cutsceneSayWithCallback(175, 78, 0, 58, 40, { { 215, 1, 735 }, { 216, 1, 736 }, { 217, 1, 737 } }, &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET_HARRISON);
+ cutsceneSayWithCallback(175, 78, 0, 58, 40, { { 215, 1, 735 }, { 216, 1, 736 }, { 217, 1, 737 } }, &IgorEngine::part16UpdateMargaretHarrisonDialogue);
for (int i = 35; i <= 41; ++i) {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true);
waitForTimer(35);
}
- cutsceneSayWithCallback(88, 69, 63, 32, 0, 218, 2, 738, &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET);
+ cutsceneSayWithCallback(88, 69, 63, 32, 0, 218, 2, 738, &IgorEngine::part16UpdateMargaretDialogue);
for (int i = 42; i <= 43; ++i) {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true);
waitForTimer(35);
}
VAR_CURRENT_TALKING_ACTOR = 1;
- cutsceneSayWithCallback(175, 78, 0, 58, 40, { { 220, 1, 739 }, { 221, 1, 740 } }, &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET_HARRISON);
- cutsceneSayWithCallback(88, 69, 63, 32, 0, 222, 2, 741, &IgorEngine::PART_16_UPDATE_DIALOGUE_MARGARET);
+ cutsceneSayWithCallback(175, 78, 0, 58, 40, { { 220, 1, 739 }, { 221, 1, 740 } }, &IgorEngine::part16UpdateMargaretHarrisonDialogue);
+ cutsceneSayWithCallback(88, 69, 63, 32, 0, 222, 2, 741, &IgorEngine::part16UpdateMargaretDialogue);
playSound(26, 1);
for (int i = 53; i <= 61; ++i) {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true);
@@ -181,11 +181,11 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
waitForTimer(15);
}
playSound(27, 1);
- PART_16_HELPER_5_displayPhoto();
+ part16DisplayPhoto();
for (int i = 1; i <= 3; ++i) {
waitForTimer(255);
}
- PART_16_HELPER_1_OBJECT_STATE(255);
+ part16ApplyObjectState(255);
// Data-only inventory update: the panel is redrawn later together with the verbs
++_inventoryInfo[73];
_inventoryInfo[_inventoryInfo[73] - 1] = kInventoryObjectPhoto;
@@ -196,7 +196,7 @@ void IgorEngine::PART_16_HELPER_3_photoCutscene() {
_currentPart = 261;
}
-void IgorEngine::PART_16_HELPER_5_displayPhoto() {
+void IgorEngine::part16DisplayPhoto() {
memset(&_currentPalette[3], 63, 621);
setPaletteRange(1, 207);
loadData(IMG_PhotoHarrisonMargaret, _screenVGA);
@@ -212,28 +212,28 @@ void IgorEngine::PART_16_HELPER_5_displayPhoto() {
}
}
-void IgorEngine::PART_16_HELPER_6_drawTalkingFrame(int frame) {
+void IgorEngine::part16DrawTalkingFrame(int frame) {
const uint8 *src = _animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + frame * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
-void IgorEngine::PART_16() {
+void IgorEngine::part16() {
playMusic(2);
_gameState.enableLight = 1;
- loadResourceData__ROOM_Laboratory();
- loadResourceData__ANIM_Laboratory();
+ part16LoadRoom();
+ part16LoadAnimation();
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part16ExecuteAction);
+ part16ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_16_HELPER_2_enterScene();
+ part16EnterScene();
if (_objectsState[kMargaretStateIndex] == kMargaretStateReadNote && _inventoryInfo[71] != 0 && _objectsState[kHarrisonNoteShownStateIndex] == 1) {
- PART_16_HELPER_3_photoCutscene();
+ part16PhotoCutscene();
}
enterPartLoop();
}
@@ -245,11 +245,11 @@ void IgorEngine::PART_16() {
fadeOut(624);
}
-void IgorEngine::loadResourceData__ROOM_Laboratory() {
+void IgorEngine::part16LoadRoom() {
loadRoomData(PAL_Laboratory, IMG_Laboratory, BOX_Laboratory, MSK_Laboratory, TXT_Laboratory);
}
-void IgorEngine::loadResourceData__ANIM_Laboratory() {
+void IgorEngine::part16LoadAnimation() {
static const int anm[] = { FRM_Laboratory1, FRM_Laboratory2, FRM_Laboratory3, 0 };
loadAnimData(anm);
}
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 88ebd1014a2..b5ee22d4001 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -24,35 +24,35 @@ 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);
+void IgorEngine::part17ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part17ExecuteAction %d", action);
switch (action) {
case 101: // walk to door
- PART_17_ACTION_101_walkIn();
+ part17WalkIn();
break;
case 102: // look at door
igorSay(225, 1, 648);
break;
case 103: // talk to philip and jimmy
- PART_17_ACTION_103_talkPhilipJimmy();
+ part17TalkToPhilipAndJimmy();
break;
case 104: // look at file
igorSay(220, 3, 646);
break;
case 105:
- PART_17_ACTION_105_leaveThroughPath();
+ part17LeaveThroughPath();
break;
case 106: // exchange files
- PART_17_ACTION_106_swapFolders();
+ part17SwapFolders();
break;
default:
- error("PART_17_EXEC_ACTION unhandled action %d", action);
+ error("part17ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_17_ACTION_101_walkIn(bool lateGame) {
- const IgorMoveTick tick = lateGame ? 0 : &IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND;
+void IgorEngine::part17WalkIn(bool lateGame) {
+ const IgorMoveTick tick = lateGame ? 0 : &IgorEngine::part17UpdateBackground;
_roomObjectAreasTable[_screenLayer2[22034]].area = 8;
_roomObjectAreasTable[_screenLayer2[23923]].area = 8;
--_walkDataLastIndex;
@@ -70,46 +70,46 @@ void IgorEngine::PART_17_ACTION_101_walkIn(bool lateGame) {
_currentPart = 302;
}
-void IgorEngine::PART_17_ACTION_103_talkPhilipJimmy() {
- PART_17_HELPER_8_PhillipToJimmyAnimFrame(0);
+void IgorEngine::part17TalkToPhilipAndJimmy() {
+ part17PhilipToJimmyAnimFrame(0);
if (_gameState.counter[4] == 1) {
- cutsceneSayWithCallback(156, 32, 35, 38, 47, 201, 2, 633, &IgorEngine::PART_17_UPDATE_DIALOGUE_Jimmy);
+ cutsceneSayWithCallback(156, 32, 35, 38, 47, 201, 2, 633, &IgorEngine::part17UpdateJimmyDialogue);
} else if (_gameState.counter[4] == 2) {
- cutsceneSayWithCallback(156, 32, 35, 38, 47, 206, 2, 636, &IgorEngine::PART_17_UPDATE_DIALOGUE_Jimmy);
+ cutsceneSayWithCallback(156, 32, 35, 38, 47, 206, 2, 636, &IgorEngine::part17UpdateJimmyDialogue);
} else if (_gameState.counter[4] == 3) {
- cutsceneSayWithCallback(156, 32, 35, 38, 47, 210, 2, 638, &IgorEngine::PART_17_UPDATE_DIALOGUE_Jimmy);
+ cutsceneSayWithCallback(156, 32, 35, 38, 47, 210, 2, 638, &IgorEngine::part17UpdateJimmyDialogue);
}
VAR_CURRENT_TALKING_ACTOR = 0;
if (_gameState.counter[4] == 1) {
- debug("PART_17_ACTION_103_talkPhilipJimmy: counter[4] == 1");
- cutsceneSayWithCallback(135, 33, 63, 63, 0, { { 203, 1, 634 }, { 204, 2, 635 } }, &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip);
+ debug("part17TalkToPhilipAndJimmy: counter[4] == 1");
+ cutsceneSayWithCallback(135, 33, 63, 63, 0, { { 203, 1, 634 }, { 204, 2, 635 } }, &IgorEngine::part17UpdatePhilipDialogue);
} else if (_gameState.counter[4] == 2) {
- debug("PART_17_ACTION_103_talkPhilipJimmy: counter[4] == 2");
- cutsceneSayWithCallback(135, 33, 63, 63, 0, 208, 2, 637, &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip);
+ debug("part17TalkToPhilipAndJimmy: counter[4] == 2");
+ cutsceneSayWithCallback(135, 33, 63, 63, 0, 208, 2, 637, &IgorEngine::part17UpdatePhilipDialogue);
} else if (_gameState.counter[4] == 3) {
- debug("PART_17_ACTION_103_talkPhilipJimmy: counter[4] == 3");
- cutsceneSayWithCallback(135, 33, 63, 63, 0, { { 212, 2, 639 }, { 214, 1, 640 } }, &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip);
+ debug("part17TalkToPhilipAndJimmy: counter[4] == 3");
+ cutsceneSayWithCallback(135, 33, 63, 63, 0, { { 212, 2, 639 }, { 214, 1, 640 } }, &IgorEngine::part17UpdatePhilipDialogue);
}
- PART_17_HELPER_11_PhillipToIgor(0);
+ part17PhilipToIgor(0);
waitForTimer(255);
const int randomDialogue = getRandomNumber(3);
VAR_CURRENT_TALKING_ACTOR = 1;
- cutsceneSayWithCallback(135, 33, 63, 63, 0, 215 + randomDialogue, 1, 641 + randomDialogue, &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip);
+ cutsceneSayWithCallback(135, 33, 63, 63, 0, 215 + randomDialogue, 1, 641 + randomDialogue, &IgorEngine::part17UpdatePhilipDialogue);
- PART_17_HANDLE_DIALOGUE_PHILIP();
- PART_17_HELPER_1_OBJECT_STATE(255);
- PART_17_HELPER_8_PhillipToJimmyAnimFrame(0);
+ part17HandlePhilipDialogue();
+ part17ApplyObjectState(255);
+ part17PhilipToJimmyAnimFrame(0);
--_walkDataLastIndex;
buildWalkPath(104, 87, 143, 123);
_walkDataCurrentIndex = 1;
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
+ waitForIgorMove(&IgorEngine::part17UpdateBackground);
igorSayAndWait(219, 1, 645);
if (_gameState.counter[4] == 3) {
_gameState.counter[4] = 1;
@@ -118,8 +118,8 @@ void IgorEngine::PART_17_ACTION_103_talkPhilipJimmy() {
}
}
-void IgorEngine::PART_17_ACTION_105_leaveThroughPath(bool lateGame) {
- const IgorMoveTick tick = lateGame ? 0 : &IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND;
+void IgorEngine::part17LeaveThroughPath(bool lateGame) {
+ const IgorMoveTick tick = lateGame ? 0 : &IgorEngine::part17UpdateBackground;
bool escaped = false;
_roomObjectAreasTable[5].area = 1;
_roomObjectAreasTable[10].area = 2;
@@ -135,7 +135,7 @@ void IgorEngine::PART_17_ACTION_105_leaveThroughPath(bool lateGame) {
_walkData[_walkDataLastIndex].frameNum = lateGame ? 0 : 1;
_gameState.igorMoving = true;
escaped |= waitForIgorMove(tick, true, escaped);
- PART_17_HELPER_5_changeZindexOfPath(143);
+ part17ChangePathZIndex(143);
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[44836]].area = 4;
buildWalkPath(41, 86, 36, 143);
@@ -148,7 +148,7 @@ void IgorEngine::PART_17_ACTION_105_leaveThroughPath(bool lateGame) {
}
}
escaped |= waitForIgorMove(tick, true, escaped, lateGame ? kFacingPositionBack : -1);
- PART_17_HELPER_2_setYScaleRamp();
+ part17SetYScaleRamp();
_walkData[0].setPos(65, 115, 1, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
@@ -165,7 +165,7 @@ void IgorEngine::PART_17_ACTION_105_leaveThroughPath(bool lateGame) {
_currentPart = 40;
}
-void IgorEngine::PART_17_ACTION_106_swapFolders() {
+void IgorEngine::part17SwapFolders() {
// folder already exchanged
if (_objectsState[kCollegeEntranceFoldersSwappedStateIndex] == 1) {
igorSay(226, 1, 649);
@@ -188,8 +188,8 @@ void IgorEngine::PART_17_ACTION_106_swapFolders() {
_objectsState[kCollegeEntranceFoldersSwappedStateIndex] = 1;
_objectsState[kFolderSwappedStateIndex] = 1;
- PART_17_HELPER_1_OBJECT_STATE(255);
- UPDATE_OBJECT_STATE(4);
+ part17ApplyObjectState(255);
+ partMainUpdateObjectState(4);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
@@ -200,65 +200,65 @@ void IgorEngine::PART_17_ACTION_106_swapFolders() {
_walkDataCurrentIndex = 1;
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
+ waitForIgorMove(&IgorEngine::part17UpdateBackground);
// Creo q no ha notado nada
ADD_DIALOGUE_TEXT(223, 2, 647);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
}
-void IgorEngine::PART_17_HANDLE_DIALOGUE_PHILIP() {
+void IgorEngine::part17HandlePhilipDialogue() {
loadDialogueData(DLG_OutsideCollege);
- _updateDialogue = &IgorEngine::PART_17_UPDATE_DIALOGUE_Philip;
+ _updateDialogue = &IgorEngine::part17UpdatePhilipDialogue;
handleDialogue(135, 33, 63, 63, 0);
_updateDialogue = 0;
}
-void IgorEngine::PART_17_UPDATE_DIALOGUE_Jimmy(int action) {
- debug("PART_17_UPDATE_DIALOGUE_Jimmy action: %d", action);
+void IgorEngine::part17UpdateJimmyDialogue(int action) {
+ debug("part17UpdateJimmyDialogue action: %d", action);
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_17_HELPER_9_JimmyTalkingAnimFrame(0);
+ part17JimmyTalkingAnimFrame(0);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_17_HELPER_9_JimmyTalkingAnimFrame(getRandomNumber(6));
+ part17JimmyTalkingAnimFrame(getRandomNumber(6));
break;
}
}
-void IgorEngine::PART_17_UPDATE_DIALOGUE_Philip(int action) {
+void IgorEngine::part17UpdatePhilipDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
if (VAR_CURRENT_TALKING_ACTOR == 0) {
- PART_17_HELPER_8_PhillipToJimmyAnimFrame(0);
+ part17PhilipToJimmyAnimFrame(0);
} else {
- PART_17_HELPER_11_PhillipToIgor(0);
+ part17PhilipToIgor(0);
}
break;
case kUpdateDialogueAnimMiddleOfSentence:
if (VAR_CURRENT_TALKING_ACTOR == 0) {
- debug("PART_17_HELPER_8_PhillipToJimmyAnimFrame");
- PART_17_HELPER_8_PhillipToJimmyAnimFrame(getRandomNumber(6));
+ debug("part17PhilipToJimmyAnimFrame");
+ part17PhilipToJimmyAnimFrame(getRandomNumber(6));
} else {
- debug("PART_17_HELPER_11_PhillipToIgor");
- PART_17_HELPER_11_PhillipToIgor(getRandomNumber(5));
+ debug("part17PhilipToIgor");
+ part17PhilipToIgor(getRandomNumber(5));
}
break;
}
}
-void IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part17UpdateBackground() {
if (!_gameState.dialogueTextRunning && compareGameTick(3, 32) && _gameState.unkF) {
// Counter (unk10) values 0 through 15 animate one character while holding the other on its resting frame.
// Counter (unk10) values 16 through 31 animate the other character.
switch (_gameState.unk10 / 16) {
case 0: // animate jimmy
- PART_17_HELPER_8_PhillipToJimmyAnimFrame(0);
- PART_17_HELPER_9_JimmyTalkingAnimFrame(getRandomNumber(6));
+ part17PhilipToJimmyAnimFrame(0);
+ part17JimmyTalkingAnimFrame(getRandomNumber(6));
break;
case 1: // animate philip
- PART_17_HELPER_8_PhillipToJimmyAnimFrame(getRandomNumber(6));
- PART_17_HELPER_9_JimmyTalkingAnimFrame(0);
+ part17PhilipToJimmyAnimFrame(getRandomNumber(6));
+ part17JimmyTalkingAnimFrame(0);
}
if (_gameState.unk10 == 31) {
_gameState.unk10 = 0;
@@ -268,13 +268,13 @@ void IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND() {
}
}
-void IgorEngine::PART_17_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part17ApplyObjectState(int num) {
// Enable or disable phillip and jimmy animation
if (num == 1 || num == 255) {
if (_objectsState[kPhillipAndJimmyPresentStateIndex] == 0) {
_gameState.unkF = false;
} else {
- PART_17_HELPER_3_disableArea(0);
+ part17DisableArea(0);
_gameState.unkF = true;
}
}
@@ -287,15 +287,15 @@ void IgorEngine::PART_17_HELPER_1_OBJECT_STATE(int num) {
if (num == 3 || num == 255) {
if (_objectsState[kPhillipAndJimmyHaveLeftStateIndex] == 1) {
_gameState.unkF = false;
- PART_17_HELPER_3_disableArea(6);
+ part17DisableArea(6);
}
}
}
-void IgorEngine::PART_17_HELPER_2_walkFromMap(bool lateGame) {
- const IgorMoveTick tick = lateGame ? 0 : &IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND;
+void IgorEngine::part17WalkFromMap(bool lateGame) {
+ const IgorMoveTick tick = lateGame ? 0 : &IgorEngine::part17UpdateBackground;
bool escaped = false;
- PART_17_HELPER_2_setYScaleRamp();
+ part17SetYScaleRamp();
WalkData *wd = &_walkData[0];
wd->setPos(21, 17, 3, 0);
wd->clipSkipX = 1;
@@ -335,7 +335,7 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap(bool lateGame) {
}
}
escaped |= waitForIgorMove(tick, true, escaped, lateGame ? kFacingPositionFront : -1);
- PART_17_HELPER_5_changeZindexOfPath(0);
+ part17ChangePathZIndex(0);
--_walkDataLastIndex;
buildWalkPath(41, 86, 45, 95);
@@ -343,10 +343,10 @@ void IgorEngine::PART_17_HELPER_2_walkFromMap(bool lateGame) {
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
escaped |= waitForIgorMove(tick, true, escaped);
- PART_17_HELPER_2_clearEntryAreas();
+ part17ClearEntryAreas();
}
-void IgorEngine::PART_17_HELPER_2_setYScaleRamp() {
+void IgorEngine::part17SetYScaleRamp() {
for (int i = 17; i <= 85; ++i) {
_walkYScaleRoom[i] = ((i - 13) / 4) + 5;
}
@@ -355,7 +355,7 @@ void IgorEngine::PART_17_HELPER_2_setYScaleRamp() {
}
}
-void IgorEngine::PART_17_HELPER_2_clearEntryAreas() {
+void IgorEngine::part17ClearEntryAreas() {
_roomObjectAreasTable[5].area = 0;
_roomObjectAreasTable[10].area = 0;
_roomObjectAreasTable[11].area = 0;
@@ -366,27 +366,27 @@ void IgorEngine::PART_17_HELPER_2_clearEntryAreas() {
_roomObjectAreasTable[28].area = 0;
}
-void IgorEngine::PART_17_HELPER_3_disableArea(int lum) {
+void IgorEngine::part17DisableArea(int lum) {
_roomObjectAreasTable[18].area = lum;
_roomObjectAreasTable[19].area = lum;
_roomObjectAreasTable[20].area = lum;
}
-void IgorEngine::PART_17_HELPER_4_paintFirsFrameOfPhilipAndJimmy() {
+void IgorEngine::part17PaintFirstFrameOfPhilipAndJimmy() {
int offset = 11642;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 44, 44, 49);
drawAnimRect(offset, 0, 44, 49);
}
-void IgorEngine::PART_17_HELPER_5_changeZindexOfPath(int lum) {
+void IgorEngine::part17ChangePathZIndex(int lum) {
_roomObjectAreasTable[23].y1Lum = lum;
_roomObjectAreasTable[26].y1Lum = lum;
_roomObjectAreasTable[27].y1Lum = lum;
_roomObjectAreasTable[32].y1Lum = lum;
}
-void IgorEngine::PART_17_HELPER_6_walkFromCollege() {
- PART_17_HELPER_1_OBJECT_STATE(255);
+void IgorEngine::part17WalkFromCollege() {
+ part17ApplyObjectState(255);
fadeIn(768);
_walkData[0].setPos(274, 68, 4, 1);
_walkData[0].setDefaultScale();
@@ -401,19 +401,19 @@ void IgorEngine::PART_17_HELPER_6_walkFromCollege() {
_roomObjectAreasTable[_screenLayer2[22034]].area = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
+ waitForIgorMove(&IgorEngine::part17UpdateBackground);
--_walkDataLastIndex;
buildWalkPath(243, 74, 205, 124);
_roomObjectAreasTable[_screenLayer2[23923]].area = 0;
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_17_UPDATE_ROOM_BACKGROUND);
- PART_17_HELPER_5_changeZindexOfPath(0);
- PART_17_HELPER_2_clearEntryAreas();
+ waitForIgorMove(&IgorEngine::part17UpdateBackground);
+ part17ChangePathZIndex(0);
+ part17ClearEntryAreas();
}
-void IgorEngine::PART_17_HELPER_8_PhillipToJimmyAnimFrame(int num) {
+void IgorEngine::part17PhilipToJimmyAnimFrame(int num) {
for (int i = 0; i <= 8; ++i) {
for (int j = 0; j <= 10; ++j) {
int offset = (36 + i) * 320 + 130 + j;
@@ -430,11 +430,11 @@ void IgorEngine::PART_17_HELPER_8_PhillipToJimmyAnimFrame(int num) {
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + num * 99 + 0x1967, 11, 11, 9);
}
-void IgorEngine::PART_17_HELPER_9_JimmyTalkingAnimFrame(int num) {
+void IgorEngine::part17JimmyTalkingAnimFrame(int num) {
drawAnimRect(11663, num * 621 + 0x86C, 23, 27, true, kBlendBehindIgorAndText);
}
-void IgorEngine::PART_17_HELPER_11_PhillipToIgor(int frame) {
+void IgorEngine::part17PhilipToIgor(int frame) {
for (int i = 0; i <= 8; ++i) {
for (int j = 0; j <= 10; ++j) {
int offset = (i + 36) * 320 + j + 130;
@@ -452,7 +452,7 @@ void IgorEngine::PART_17_HELPER_11_PhillipToIgor(int frame) {
}
}
-void IgorEngine::PART_17() {
+void IgorEngine::part17() {
playMusic(1);
_gameState.enableLight = 1;
loadRoomData(PAL_OutsideCollege, IMG_OutsideCollege, BOX_OutsideCollege, MSK_OutsideCollege, TXT_OutsideCollege);
@@ -463,22 +463,22 @@ void IgorEngine::PART_17() {
_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;
+ partMainSetExecuteAction(1, &IgorEngine::part17ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part17UpdateBackground;
- PART_17_HELPER_1_OBJECT_STATE(255);
+ part17ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (_objectsState[kPhillipAndJimmyHaveLeftStateIndex] == 1) {
_gameState.unkF = false;
- PART_17_HELPER_3_disableArea(6);
+ part17DisableArea(6);
_roomObjectAreasTable[14].object = 0;
_roomObjectAreasTable[15].object = 0;
_roomObjectAreasTable[19].object = 0;
} else if (_gameState.unkF) {
- PART_17_HELPER_4_paintFirsFrameOfPhilipAndJimmy();
+ part17PaintFirstFrameOfPhilipAndJimmy();
_gameState.counter[4] = 1;
} else {
_roomObjectAreasTable[14].object = 0;
@@ -488,17 +488,17 @@ void IgorEngine::PART_17() {
if (_gameStateLoaded) {
// Restore the path depth before drawing Igor at his saved position.
- PART_17_HELPER_5_changeZindexOfPath(0);
+ part17ChangePathZIndex(0);
}
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
if (_currentPart == 170) {
// from map
fadeIn(768);
- PART_17_HELPER_2_walkFromMap();
+ part17WalkFromMap();
} else if (_currentPart == 171) {
// from inside college
- PART_17_HELPER_6_walkFromCollege();
+ part17WalkFromCollege();
}
}
enterPartLoop();
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index 7e6f5b3c511..71544cc7c8a 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -23,7 +23,7 @@
namespace Igor {
-void IgorEngine::PART_18_EXEC_ACTION(int action) {
+void IgorEngine::part18ExecuteAction(int action) {
switch (action) {
case 101: // look at grating
igorSay(201, 1, 896);
@@ -50,21 +50,21 @@ void IgorEngine::PART_18_EXEC_ACTION(int action) {
igorSay(210, 1, 904);
break;
case 109: // use slug on grating
- PART_18_ACTION_109_useSlugOnGrating();
+ part18UseSlugOnGrating();
break;
case 110: // leave
_currentPart = 252;
break;
case 111:
- PART_18_ACTION_111_useBottleOnTap();
+ part18UseBottleOnTap();
break;
default:
- error("PART_18_EXEC_ACTION unhandled action %d", action);
+ error("part18ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_18_ACTION_109_useSlugOnGrating() {
+void IgorEngine::part18UseSlugOnGrating() {
const int offset = 29480;
for (int i = 1; i <= 2; ++i) {
drawAnimRect(offset + 320, (i - 1) * 1519 + 31, 31, 48);
@@ -74,17 +74,17 @@ void IgorEngine::PART_18_ACTION_109_useSlugOnGrating() {
_currentPart = 191;
fadeOut(768);
// loads part 19
- PART_19();
+ part19();
memcpy(_screenVGA, _screenLayer2, 46080);
- loadResourceData__ROOM_MenToilets();
- loadResourceData__ANIM_MenToilets();
+ part18LoadRoom();
+ part18LoadAnimation();
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part18ExecuteAction);
+ part18ApplyObjectState(255);
// paints bottom of screen black
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
@@ -95,7 +95,7 @@ void IgorEngine::PART_18_ACTION_109_useSlugOnGrating() {
igorSay(215, 1, 908);
}
-void IgorEngine::PART_18_ACTION_111_useBottleOnTap() {
+void IgorEngine::part18UseBottleOnTap() {
if (_objectsState[kBottleStateIndex] == 0) {
igorSay(211, 1, 905);
return;
@@ -113,13 +113,13 @@ void IgorEngine::PART_18_ACTION_111_useBottleOnTap() {
drawAnimRect(offset, 0xBDE, 28, 29);
igorSay(213, 2, 907);
_objectsState[kBottleStateIndex] = 2;
- UPDATE_OBJECT_STATE(1);
+ partMainUpdateObjectState(1);
}
-void IgorEngine::PART_18_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part18ApplyObjectState(int num) {
}
-void IgorEngine::PART_18_HELPER_2_walkIn() {
+void IgorEngine::part18WalkIn() {
_walkData[0].setPos(319, 142, 4, 0);
_walkData[0].clipSkipX = 1;
_walkData[0].clipWidth = 15;
@@ -137,21 +137,21 @@ void IgorEngine::PART_18_HELPER_2_walkIn() {
waitForIgorMove();
}
-void IgorEngine::PART_18() {
+void IgorEngine::part18() {
playMusic(2);
_gameState.enableLight = 1;
- loadResourceData__ROOM_MenToilets();
- loadResourceData__ANIM_MenToilets();
+ part18LoadRoom();
+ part18LoadAnimation();
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part18ExecuteAction);
+ part18ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_18_HELPER_2_walkIn();
+ part18WalkIn();
enterPartLoop();
}
while (_currentPart == 180 && !_gameStateLoaded) {
@@ -162,11 +162,11 @@ void IgorEngine::PART_18() {
fadeOut(624);
}
-void IgorEngine::loadResourceData__ROOM_MenToilets() {
+void IgorEngine::part18LoadRoom() {
loadRoomData(PAL_MenToilets, IMG_MenToilets, BOX_MenToilets, MSK_MenToilets, TXT_MenToilets);
}
-void IgorEngine::loadResourceData__ANIM_MenToilets() {
+void IgorEngine::part18LoadAnimation() {
static const int anm[] = { FRM_MenToilets1, FRM_MenToilets2, 0 };
loadAnimData(anm);
}
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index e1b9b181bf9..8382ae2c4b6 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -24,7 +24,7 @@ namespace Igor {
static int VAR_CURRENT_TALKING_ACTOR;
-void IgorEngine::PART_19_EXEC_ACTION(int action) {
+void IgorEngine::part19ExecuteAction(int action) {
switch (action) {
case 101:
igorSay(201, 1, 909);
@@ -45,21 +45,21 @@ void IgorEngine::PART_19_EXEC_ACTION(int action) {
_currentPart = 232;
break;
case 107:
- PART_19_ACTION_107_lookAtSink();
+ part19LookAtSink();
break;
case 108:
igorSay(208, 1, 916);
break;
case 109:
- PART_19_ACTION_109_usePapyrusOnDryer();
+ part19UsePapyrusOnDryer();
break;
default:
- error("PART_19_EXEC_ACTION unhandled action %d", action);
+ error("part19ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_19_ACTION_107_lookAtSink() {
+void IgorEngine::part19LookAtSink() {
if (_objectsState[kHairpinTakenStateIndex] == 1) {
igorSay(211, 1, 919);
return;
@@ -74,10 +74,10 @@ void IgorEngine::PART_19_ACTION_107_lookAtSink() {
}
addObjectToInventory(kInventoryObjectHairpin, 47);
_objectsState[kHairpinTakenStateIndex] = 1;
- PART_19_HELPER_1_OBJECT_STATE(255);
+ part19ApplyObjectState(255);
}
-void IgorEngine::PART_19_ACTION_109_usePapyrusOnDryer() {
+void IgorEngine::part19UsePapyrusOnDryer() {
if (_objectsState[kPapyrusFiguresVisibleStateIndex] == 1) {
igorSay(210, 1, 918);
return;
@@ -89,25 +89,25 @@ void IgorEngine::PART_19_ACTION_109_usePapyrusOnDryer() {
}
decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x35E) - 1, _screenVGA, true);
playSound(45, 1);
- lookAtPapyrus(true);
- PART_19_HELPER_1_OBJECT_STATE(255);
+ partMainLookAtPapyrus(true);
+ part19ApplyObjectState(255);
stopSound();
decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x360) - 1, _screenVGA, true);
igorSayAndWait(209, 1, 917);
}
-void IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN(int action) {
+void IgorEngine::part19UpdateWomenDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_19_HELPER_7_drawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? 35 : 40);
+ part19DrawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? 35 : 40);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_19_HELPER_7_drawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? 35 + getRandomNumber(4) : 40 + getRandomNumber(4));
+ part19DrawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? 35 + getRandomNumber(4) : 40 + getRandomNumber(4));
break;
}
}
-void IgorEngine::PART_19_UPDATE_BACKGROUND_HELPER_9() {
+void IgorEngine::part19UpdateBackground() {
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);
@@ -115,7 +115,7 @@ void IgorEngine::PART_19_UPDATE_BACKGROUND_HELPER_9() {
}
}
-void IgorEngine::PART_19_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part19ApplyObjectState(int num) {
if (num == 2 || num == 255) {
if (_objectsState[kToiletGirlsHaveLeftStateIndex] == 0) {
decodeAnimFrame(_animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x4051) - 1, _screenLayer1, true);
@@ -123,7 +123,7 @@ void IgorEngine::PART_19_HELPER_1_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_19_HELPER_2_slugCutscene() { // sub_137_07AD
+void IgorEngine::part19SlugCutscene() { // sub_137_07AD
int talkSpeed = _gameState.talkSpeed;
_gameState.talkSpeed = 5;
memcpy(_screenLayer2, _screenVGA, 46080);
@@ -133,7 +133,7 @@ void IgorEngine::PART_19_HELPER_2_slugCutscene() { // sub_137_07AD
memcpy(_screenLayer1, _screenVGA, 46080);
fadeIn(624);
VAR_CURRENT_TALKING_ACTOR = 0;
- cutsceneSayWithCallback(243, 92, 63, 23, 33, 212, 3, 920, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
+ cutsceneSayWithCallback(243, 92, 63, 23, 33, 212, 3, 920, &IgorEngine::part19UpdateWomenDialogue);
for (int i = 2; i <= 9; ++i) {
src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x404F + i * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
@@ -142,11 +142,11 @@ void IgorEngine::PART_19_HELPER_2_slugCutscene() { // sub_137_07AD
cutsceneSayStart(227, 91, 0, 63, 63, { { 215, 1, 921 }, { 216, 2, 922 } });
_gameState.counter[1] = 10;
VAR_CURRENT_TALKING_ACTOR = 1;
- _updateRoomBackground = &IgorEngine::PART_19_UPDATE_BACKGROUND_HELPER_9;
+ _updateRoomBackground = &IgorEngine::part19UpdateBackground;
waitForEndOfCutsceneDialogue(227, 91, 0, 63, 63);
_updateRoomBackground = 0;
while (_gameState.counter[1] != 35) {
- PART_19_UPDATE_BACKGROUND_HELPER_9();
+ part19UpdateBackground();
waitForTimer();
}
for (int i = 47; i <= 48; ++i) {
@@ -168,19 +168,19 @@ void IgorEngine::PART_19_HELPER_2_slugCutscene() { // sub_137_07AD
decodeAnimFrame(src, _screenVGA, true);
waitForTimer(30);
VAR_CURRENT_TALKING_ACTOR = 0;
- cutsceneSayWithCallback(243, 92, 63, 23, 33, 218, 1, 923, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
+ cutsceneSayWithCallback(243, 92, 63, 23, 33, 218, 1, 923, &IgorEngine::part19UpdateWomenDialogue);
VAR_CURRENT_TALKING_ACTOR = 1;
- cutsceneSayWithCallback(227, 91, 0, 63, 63, 219, 2, 924, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
+ cutsceneSayWithCallback(227, 91, 0, 63, 63, 219, 2, 924, &IgorEngine::part19UpdateWomenDialogue);
VAR_CURRENT_TALKING_ACTOR = 0;
- cutsceneSayWithCallback(243, 92, 63, 23, 33, 221, 2, 925, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
+ cutsceneSayWithCallback(243, 92, 63, 23, 33, 221, 2, 925, &IgorEngine::part19UpdateWomenDialogue);
VAR_CURRENT_TALKING_ACTOR = 1;
- cutsceneSayWithCallback(227, 91, 0, 63, 63, 223, 2, 926, &IgorEngine::PART_19_UPDATE_DIALOGUE_WOMEN);
+ cutsceneSayWithCallback(227, 91, 0, 63, 63, 223, 2, 926, &IgorEngine::part19UpdateWomenDialogue);
_objectsState[kToiletGirlsHaveLeftStateIndex] = 1;
fadeOut(624);
_gameState.talkSpeed = talkSpeed;
}
-void IgorEngine::PART_19_HELPER_3_walkIn() {
+void IgorEngine::part19WalkIn() {
_walkData[0].setPos(319, 142, 1, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
@@ -193,7 +193,7 @@ void IgorEngine::PART_19_HELPER_3_walkIn() {
waitForIgorMove();
}
-void IgorEngine::PART_19_HELPER_4_enterAndLeave() {
+void IgorEngine::part19EnterAndLeave() {
decodeAnimFrame(_animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x40AB) - 1, _screenVGA, true);
waitForTimer(60);
igorSayAndWait(225, 1, 927);
@@ -205,12 +205,12 @@ void IgorEngine::PART_19_HELPER_4_enterAndLeave() {
_currentPart = 232;
}
-void IgorEngine::PART_19_HELPER_7_drawTalkingFrame(int frame) {
+void IgorEngine::part19DrawTalkingFrame(int frame) {
const uint8 *src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x404F + frame * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
-void IgorEngine::PART_19() {
+void IgorEngine::part19() {
playMusic(2);
_gameState.enableLight = 1;
loadRoomData(PAL_WomenToilets, IMG_WomenToilets, BOX_WomenToilets, MSK_WomenToilets, TXT_WomenToilets);
@@ -221,18 +221,18 @@ void IgorEngine::PART_19() {
setRoomWalkBounds(0, 0, 319, 143);
if (_currentPart == 191) {
// cutscene only: it fades out by itself and returns to the caller
- PART_19_HELPER_2_slugCutscene();
+ part19SlugCutscene();
return;
}
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_19_EXEC_ACTION);
- PART_19_HELPER_1_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part19ExecuteAction);
+ part19ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_19_HELPER_3_walkIn();
+ part19WalkIn();
if (_objectsState[kToiletGirlsHaveLeftStateIndex] == 0) {
- PART_19_HELPER_4_enterAndLeave();
+ part19EnterAndLeave();
if (!_gameStateLoaded && _currentPart != 191)
fadeOut(624);
return;
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index f96dfaa5f53..cdbd9297e39 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -10,7 +10,7 @@
namespace Igor {
-void IgorEngine::PART_02_searchTrunk() {
+void IgorEngine::part2SearchTrunk() {
for (int frame = 0; frame <= 2; ++frame) {
animateLitAnimFrames(0x3C0 + frame * 0x715, 0, 0, 0x715, 37, 49, 0x608C, 0, -1, 0);
if (frame > 0)
@@ -18,7 +18,7 @@ void IgorEngine::PART_02_searchTrunk() {
}
}
-void IgorEngine::PART_02_drawFuseSpark(int frame) {
+void IgorEngine::part2DrawFuseSpark(int frame) {
// Four 12x12 spark frames are stored at animation offset 0x7FCB and are
// composited over the fuse at screen offset 0x5996.
const uint8 *src = _animFramesBuffer + 0x7FCB + frame * 0x90;
@@ -34,11 +34,11 @@ void IgorEngine::PART_02_drawFuseSpark(int frame) {
}
}
-void IgorEngine::PART_02_updateFuse() {
- PART_02_drawFuseSpark(getRandomNumber(3));
+void IgorEngine::part2UpdateFuse() {
+ part2DrawFuseSpark(getRandomNumber(3));
}
-void IgorEngine::PART_02_walkWhileFuseBurns(int srcX, int srcY, int dstX, int dstY) {
+void IgorEngine::part2WalkWhileFuseBurns(int srcX, int srcY, int dstX, int dstY) {
--_walkDataLastIndex;
buildWalkPath(srcX, srcY, dstX, dstY);
_walkDataCurrentIndex = 1;
@@ -56,12 +56,12 @@ void IgorEngine::PART_02_walkWhileFuseBurns(int srcX, int srcY, int dstX, int ds
++_walkDataCurrentIndex;
}
}
- PART_02_updateFuse();
+ part2UpdateFuse();
waitForTimer();
} while (_gameState.igorMoving);
}
-void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
+void IgorEngine::part2ApplyObjectState(int num) {
if (num == 1 || num == 255) {
// redraws the closed/open trunk into the persistent room background.
const int srcOffset = _objectsState[kAtticTrunkOpenStateIndex] == 0 ? 0x2E3E : 0x30FC;
@@ -112,8 +112,8 @@ void IgorEngine::PART_02_APPLY_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_02_EXEC_ACTION(int action) {
- debugC(9, kDebugGame, "PART_02_EXEC_ACTION %d", action);
+void IgorEngine::part2ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part2ExecuteAction %d", action);
switch (action) {
case 101: // open trunk
if (_objectsState[kAtticTrunkOpenStateIndex] == 1) {
@@ -122,7 +122,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
animateLitAnimFrames(0x18FF, 1, 2, 0x715, 37, 49, 0x608C, 127, 1, 7);
_objectsState[kAtticTrunkOpenStateIndex] = 1;
- PART_02_APPLY_OBJECT_STATE(1);
+ part2ApplyObjectState(1);
break;
case 102: // close trunk
if (_objectsState[kAtticTrunkOpenStateIndex] == 0) {
@@ -132,7 +132,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
playSound(8, 1);
animateLitAnimFrames(0x18FF, 1, 0, 0x715, 37, 49, 0x608C, 127, -1, 0);
_objectsState[kAtticTrunkOpenStateIndex] = 0;
- PART_02_APPLY_OBJECT_STATE(1);
+ part2ApplyObjectState(1);
break;
case 103: { // hammer the nail
for (int step = 1; step <= 21; ++step) {
@@ -144,14 +144,14 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
_objectsState[kAtticSmallCrackPresentStateIndex] = 1;
_objectsState[kAtticNailHotspotActiveStateIndex] = 0;
- PART_02_APPLY_OBJECT_STATE(5);
- PART_02_APPLY_OBJECT_STATE(6);
+ part2ApplyObjectState(5);
+ part2ApplyObjectState(6);
igorSay(217, 1, 121);
break;
}
case 104: { // use the pick on the crack;
if (_objectsState[kDynamitePlacedStateIndex] == 1) {
- EXEC_MAIN_ACTION(2);
+ partMainExecuteAction(2);
break;
}
@@ -164,9 +164,9 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
}
_objectsState[kAtticLargeCrackPresentStateIndex] = 1;
_objectsState[kAtticSmallCrackPresentStateIndex] = 0;
- PART_02_APPLY_OBJECT_STATE(4);
- PART_02_APPLY_OBJECT_STATE(5);
- PART_02_APPLY_OBJECT_STATE(6);
+ part2ApplyObjectState(4);
+ part2ApplyObjectState(5);
+ part2ApplyObjectState(6);
igorSay(218, 1, 122);
break;
}
@@ -183,10 +183,10 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
if (_objectsState[kAtticNailExaminedStateIndex] == 0) {
igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
- PART_02_searchTrunk();
+ part2SearchTrunk();
igorSay(204, 1, 111);
addObjectToInventory(kInventoryObjectHammer, 44);
- PART_02_APPLY_OBJECT_STATE(255);
+ part2ApplyObjectState(255);
}
break;
}
@@ -194,17 +194,17 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
if (_objectsState[kAtticSmallCrackPresentStateIndex] == 0) {
igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
- PART_02_searchTrunk();
+ part2SearchTrunk();
igorSay(205, 1, 112);
removeObjectFromInventory(44);
playSound(63, 1);
addObjectToInventory(kInventoryObjectPickaxe, 45);
- PART_02_APPLY_OBJECT_STATE(255);
+ part2ApplyObjectState(255);
}
break;
}
if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 && _inventoryInfo[46] == 0 && _objectsState[kDynamitePlacedStateIndex] == 0 && _objectsState[kAtticLargeCrackPresentStateIndex] != 0) {
- PART_02_searchTrunk();
+ part2SearchTrunk();
igorSay(206, 1, 113);
addObjectToInventory(kInventoryObjectDynamite, 46);
} else if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 && _inventoryInfo[46] == 0 && _objectsState[kDynamitePlacedStateIndex] == 0) {
@@ -218,7 +218,7 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
waitForTimer(127);
addObjectToInventory(kInventoryObjectButterflyNet, 42);
_objectsState[kButterflyNetTakenStateIndex] = 1;
- PART_02_APPLY_OBJECT_STATE(2);
+ part2ApplyObjectState(2);
break;
case 108: // Look at old junk
igorSay(210, 1, 116);
@@ -239,10 +239,10 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
animateLitAnimFrames(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
waitForTimer(127);
_objectsState[kDynamitePlacedStateIndex] = 1;
- PART_02_APPLY_OBJECT_STATE(8);
+ part2ApplyObjectState(8);
removeObjectFromInventory(46);
playSound(63, 1);
- PART_02_APPLY_OBJECT_STATE(255);
+ part2ApplyObjectState(255);
break;
case 114:
igorSay(219, 1, 123);
@@ -280,18 +280,18 @@ void IgorEngine::PART_02_EXEC_ACTION(int action) {
break;
case 117: // light the dynamite
if (_objectsState[kDynamitePlacedStateIndex] == 0) {
- EXEC_MAIN_ACTION(2);
+ partMainExecuteAction(2);
} else {
- PART_02_lightUpDynamite();
+ part2LightUpDynamite();
}
break;
default:
- warning("PART_02_EXEC_ACTION unhandled action %d", action);
+ warning("part2ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_02_lightUpDynamite() {
+void IgorEngine::part2LightUpDynamite() {
memset(_screenVGA + 0xB400, 0, 0x4BFF);
playSound(68, 1);
animateLitAnimFrames(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
@@ -300,7 +300,7 @@ void IgorEngine::PART_02_lightUpDynamite() {
igorSay(221, 1, 125);
if (_gameState.talkMode == kTalkModeTextOnly)
playSound(11, 1);
- _updateRoomBackground = &IgorEngine::PART_02_updateFuse;
+ _updateRoomBackground = &IgorEngine::part2UpdateFuse;
waitForEndOfIgorDialogue();
_updateRoomBackground = 0;
@@ -308,9 +308,9 @@ void IgorEngine::PART_02_lightUpDynamite() {
if (_gameState.talkMode != kTalkModeTextOnly)
playSound(11, 1);
- PART_02_walkWhileFuseBurns(211, 120, 0, 143);
+ part2WalkWhileFuseBurns(211, 120, 0, 143);
for (int elapsed = 0; elapsed < 255; elapsed += kTimerTicksCount) {
- PART_02_updateFuse();
+ part2UpdateFuse();
waitForTimer();
}
copyArea(_screenVGA, 0x5996, 320, _screenLayer1 + 0x5996, 320, 12, 12);
@@ -336,15 +336,15 @@ void IgorEngine::PART_02_lightUpDynamite() {
_objectsState[kAtticLargeCrackPresentStateIndex] = 0;
_objectsState[kDynamitePlacedStateIndex] = 0;
_objectsState[kBedroomHoleOpenStateIndex] = 1;
- PART_02_APPLY_OBJECT_STATE(3);
- PART_02_APPLY_OBJECT_STATE(4);
- PART_02_APPLY_OBJECT_STATE(5);
+ part2ApplyObjectState(3);
+ part2ApplyObjectState(4);
+ part2ApplyObjectState(5);
memset(_currentPalette + 240 * 3, 0, 16 * 3);
setPaletteRange(240, 255);
_currentPart = 12;
}
-void IgorEngine::PART_02() {
+void IgorEngine::part2() {
playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_StudentDormitoryAttic);
@@ -363,8 +363,8 @@ void IgorEngine::PART_02() {
// clamps clicks to x 41..253 and y <= 143; clicks past the
// horizontal edges also clamp to y >= 141/138.
setRoomWalkBounds(41, 0, 253, 143, 141, 138);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_02_EXEC_ACTION);
- PART_02_APPLY_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part2ExecuteAction);
+ part2ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
@@ -431,7 +431,7 @@ void IgorEngine::PART_02() {
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
if (_currentPart == 22)
- PART_02_EXEC_ACTION(118);
+ part2ExecuteAction(118);
}
enterPartLoop();
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index df4b1523f62..3e39282b500 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -28,13 +28,13 @@ 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) {
+void IgorEngine::part21ExecuteAction(int action) {
switch (action) {
case 101:
- PART_21_ACTION_101_leaveLeft();
+ part21LeaveLeft();
break;
case 102:
- PART_21_ACTION_102_talkToMargaret();
+ part21TalkToMargaret();
break;
case 103:
igorSay(201, 1, 1177);
@@ -49,58 +49,58 @@ void IgorEngine::PART_21_EXEC_ACTION(int action) {
igorSay(204, 1, 1180);
break;
case 107:
- PART_21_ACTION_107_openPhysicsDoor();
+ part21OpenPhysicsDoor();
break;
case 108:
- PART_21_ACTION_108_closePhysicsDoor();
+ part21ClosePhysicsDoor();
break;
case 109:
igorSay(205, 1, 1181);
break;
case 110:
- PART_21_ACTION_110_leaveRight();
+ part21LeaveRight();
break;
case 111:
- PART_21_ACTION_111_useNoteWithSandwhiches();
+ part21UseNoteWithSandwiches();
break;
case 112:
igorSay(222, 1, 1195);
break;
case 113:
- PART_21_ACTION_113_enterPhysicsClass();
+ part21EnterPhysicsClass();
break;
default:
- error("PART_21_EXEC_ACTION unhandled action %d", action);
+ error("part21ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_21_ACTION_101_leaveLeft() {
+void IgorEngine::part21LeaveLeft() {
if (_objectsState[kMargaretStateIndex] == 1) {
const int offset = 29440;
copyArea(_screenVGA, offset, 320, _screenLayer1 + offset, 320, 20, 51);
- PART_21_HELPER_10_MargaretTakesNote();
+ part21MargaretTakesNote();
}
_currentPart = 303;
}
-void IgorEngine::PART_21_ACTION_102_talkToMargaret() {
- PART_21_HELPER_6_drawMargaretFrameComposited(1);
+void IgorEngine::part21TalkToMargaret() {
+ part21DrawMargaretFrameComposited(1);
igorSayAndWait(226, 1, 1197);
cutsceneSayStart(76, 87, 63, 32, 0, 227, 1, 1198);
- _updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_2;
+ _updateDialogue = &IgorEngine::part21UpdateMargaretCompositedDialogue;
// The cutscene dialogue wait does not run Margaret's idle animation
_updateRoomBackground = 0;
waitForEndOfCutsceneDialogue(76, 87, 63, 32, 0);
- _updateRoomBackground = &IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND;
+ _updateRoomBackground = &IgorEngine::part21UpdateBackground;
_updateDialogue = 0;
- PART_21_HANDLE_DIALOGUE_MARGARET();
- PART_21_HELPER_1_OBJECT_STATE(255);
+ part21HandleMargaretDialogue();
+ part21ApplyObjectState(255);
}
-void IgorEngine::PART_21_ACTION_107_openPhysicsDoor() {
+void IgorEngine::part21OpenPhysicsDoor() {
if (_objectsState[kPhysicsClassDoorStateIndex] == 1) {
- EXEC_MAIN_ACTION(11);
+ partMainExecuteAction(11);
return;
}
for (int i = 2; i <= 3; ++i) {
@@ -113,12 +113,12 @@ void IgorEngine::PART_21_ACTION_107_openPhysicsDoor() {
}
}
_objectsState[kPhysicsClassDoorStateIndex] = 1;
- PART_21_HELPER_1_OBJECT_STATE(1);
+ part21ApplyObjectState(1);
}
-void IgorEngine::PART_21_ACTION_108_closePhysicsDoor() {
+void IgorEngine::part21ClosePhysicsDoor() {
if (_objectsState[kPhysicsClassDoorStateIndex] == 0) {
- EXEC_MAIN_ACTION(14);
+ partMainExecuteAction(14);
return;
}
for (int i = 2; i >= 1; --i) {
@@ -130,19 +130,19 @@ void IgorEngine::PART_21_ACTION_108_closePhysicsDoor() {
}
}
_objectsState[kPhysicsClassDoorStateIndex] = 0;
- PART_21_HELPER_1_OBJECT_STATE(1);
+ part21ApplyObjectState(1);
}
-void IgorEngine::PART_21_ACTION_110_leaveRight() {
+void IgorEngine::part21LeaveRight() {
if (_objectsState[kMargaretStateIndex] == 1) {
const int offset = 27180;
copyArea(_screenVGA, offset, 320, _screenLayer1 + offset, 320, 20, 51);
- PART_21_HELPER_10_MargaretTakesNote();
+ part21MargaretTakesNote();
}
_currentPart = 270;
}
-void IgorEngine::PART_21_ACTION_111_useNoteWithSandwhiches() {
+void IgorEngine::part21UseNoteWithSandwiches() {
if (_inventoryInfo[65] == 0) {
igorSay(223, 2, 1196);
return;
@@ -161,91 +161,91 @@ void IgorEngine::PART_21_ACTION_111_useNoteWithSandwhiches() {
drawAnimRect(offset, 0xBCA5 + PART_21_ANIM_DATA_2[k] * 1300, 26, 50);
++k;
}
- PART_21_UPDATE_ROOM_BACKGROUND();
+ part21UpdateBackground();
waitForTimer();
} while (k != 10);
removeObjectFromInventory(56);
_objectsState[kMargaretStateIndex] = 1;
- PART_21_HELPER_1_OBJECT_STATE(255);
+ part21ApplyObjectState(255);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
igorSay(210, 2, 1186);
}
-void IgorEngine::PART_21_ACTION_113_enterPhysicsClass() {
+void IgorEngine::part21EnterPhysicsClass() {
if (_objectsState[kPhysicsClassDoorStateIndex] != 0) {
_roomObjectAreasTable[_screenLayer2[34679]].area = 1;
--_walkDataLastIndex;
buildWalkPathSimple(165, 126, 119, 108);
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- PART_21_HELPER_5_waitForIgorWalkWithAnimation();
+ part21WaitForIgorWalkWithAnimation();
if (_objectsState[kMargaretStateIndex] == 1) {
- PART_21_HELPER_10_MargaretTakesNote();
+ part21MargaretTakesNote();
}
_currentPart = 370;
}
}
-void IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_1(int action) {
+void IgorEngine::part21UpdateMargaretBackgroundDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_21_HELPER_11_setMargaretBackgroundFrame(6);
+ part21SetMargaretBackgroundFrame(6);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_21_HELPER_11_setMargaretBackgroundFrame(getRandomNumber(4) + 6);
+ part21SetMargaretBackgroundFrame(getRandomNumber(4) + 6);
break;
case kUpdateDialogueAnimStanding:
- PART_21_HELPER_11_setMargaretBackgroundFrame(1);
+ part21SetMargaretBackgroundFrame(1);
break;
}
}
-void IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_2(int action) {
+void IgorEngine::part21UpdateMargaretCompositedDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_21_HELPER_6_drawMargaretFrameComposited(6);
+ part21DrawMargaretFrameComposited(6);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_21_HELPER_6_drawMargaretFrameComposited(getRandomNumber(4) + 6);
+ part21DrawMargaretFrameComposited(getRandomNumber(4) + 6);
break;
}
}
-void IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_3(int action) {
+void IgorEngine::part21UpdateMargaretNoteDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_21_HELPER_6_drawMargaretFrameComposited(15);
+ part21DrawMargaretFrameComposited(15);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_21_HELPER_6_drawMargaretFrameComposited(getRandomNumber(4) + 15);
+ part21DrawMargaretFrameComposited(getRandomNumber(4) + 15);
break;
}
}
-void IgorEngine::PART_21_HANDLE_DIALOGUE_MARGARET() {
+void IgorEngine::part21HandleMargaretDialogue() {
loadDialogueData(DLG_CollegeCorridorMargaret);
- _updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_1;
+ _updateDialogue = &IgorEngine::part21UpdateMargaretBackgroundDialogue;
handleDialogue(81, 76, 63, 32, 0);
_updateDialogue = 0;
}
-void IgorEngine::PART_21_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part21ApplyObjectState(int num) {
if (num == 1 || num == 255) {
// physics class door
if (_objectsState[kPhysicsClassDoorStateIndex] == 0) {
- PART_21_HELPER_7_drawClosedDoor();
+ part21DrawClosedDoor();
_roomActionsTable[4] = 6;
} else {
- PART_21_HELPER_8_drawOpenDoor();
+ part21DrawOpenDoor();
_roomActionsTable[4] = 7;
}
}
if (num == 2 || num == 255) {
// is margaret present?
if (_objectsState[kMargaretStateIndex] <= 1) {
- PART_21_HELPER_9_drawMargaret();
+ part21DrawMargaret();
}
if (_objectsState[kMargaretStateIndex] == 2 || _objectsState[kMargaretStateIndex] == 4) {
_roomObjectAreasTable[9].object = 0;
@@ -254,7 +254,7 @@ void IgorEngine::PART_21_HELPER_1_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_21_HELPER_2_enterFromLeft() {
+void IgorEngine::part21EnterFromLeft() {
_walkData[0].setPos(0, 141, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 15;
@@ -264,10 +264,10 @@ void IgorEngine::PART_21_HELPER_2_enterFromLeft() {
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- PART_21_HELPER_5_waitForIgorWalkWithAnimation();
+ part21WaitForIgorWalkWithAnimation();
}
-void IgorEngine::PART_21_HELPER_3_enterFromRight() {
+void IgorEngine::part21EnterFromRight() {
_walkData[0].setPos(319, 133, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -276,10 +276,10 @@ void IgorEngine::PART_21_HELPER_3_enterFromRight() {
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- PART_21_HELPER_5_waitForIgorWalkWithAnimation();
+ part21WaitForIgorWalkWithAnimation();
}
-void IgorEngine::PART_21_HELPER_4_enterFromPhysicsClass() {
+void IgorEngine::part21EnterFromPhysicsClass() {
_walkData[0].setPos(119, 108, 2, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 0;
@@ -289,10 +289,10 @@ void IgorEngine::PART_21_HELPER_4_enterFromPhysicsClass() {
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- PART_21_HELPER_5_waitForIgorWalkWithAnimation();
+ part21WaitForIgorWalkWithAnimation();
}
-void IgorEngine::PART_21_HELPER_5_waitForIgorWalkWithAnimation() {
+void IgorEngine::part21WaitForIgorWalkWithAnimation() {
// Same walk loop as waitForIgorMove(), but the room background keeps
// animating (Margaret) while Igor walks.
_gameTicks = 0;
@@ -307,12 +307,12 @@ void IgorEngine::PART_21_HELPER_5_waitForIgorWalkWithAnimation() {
++_walkDataCurrentIndex;
}
}
- PART_21_UPDATE_ROOM_BACKGROUND();
+ part21UpdateBackground();
waitForTimer();
} while (_gameState.igorMoving);
}
-void IgorEngine::PART_21_HELPER_6_drawMargaretFrameComposited(int frame) {
+void IgorEngine::part21DrawMargaretFrameComposited(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 42; ++i) {
for (int j = 0; j <= 48; ++j) {
@@ -333,57 +333,57 @@ void IgorEngine::PART_21_HELPER_6_drawMargaretFrameComposited(int frame) {
}
}
-void IgorEngine::PART_21_HELPER_7_drawClosedDoor() {
+void IgorEngine::part21DrawClosedDoor() {
const int offset = 21901;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xE031, 33, 33, 54);
}
-void IgorEngine::PART_21_HELPER_8_drawOpenDoor() {
+void IgorEngine::part21DrawOpenDoor() {
const int offset = 21901;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xE727, 33, 33, 54);
}
-void IgorEngine::PART_21_HELPER_9_drawMargaret() {
+void IgorEngine::part21DrawMargaret() {
const int offset = 28520;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x14E2, 49, 49, 43);
}
-void IgorEngine::PART_21_HELPER_10_MargaretTakesNote() {
- PART_21_HELPER_6_drawMargaretFrameComposited(1);
+void IgorEngine::part21MargaretTakesNote() {
+ part21DrawMargaretFrameComposited(1);
memset(_screenVGA + 46080, 0, 17920);
waitForTimer(120);
for (int i = 1; i <= 6; ++i) {
- PART_21_HELPER_6_drawMargaretFrameComposited(PART_21_ANIM_DATA_1[i]);
+ part21DrawMargaretFrameComposited(PART_21_ANIM_DATA_1[i]);
if (i < 6) {
waitForTimer(100);
}
}
cutsceneSayStart(76, 87, 63, 32, 0, { { 212, 1, 1187 }, { 213, 1, 1188 }, { 214, 1, 1189 }, { 215, 2, 1190 }, { 217, 2, 1191 } });
- _updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_3;
+ _updateDialogue = &IgorEngine::part21UpdateMargaretNoteDialogue;
_updateRoomBackground = 0;
waitForEndOfCutsceneDialogue(76, 87, 63, 32, 0);
- _updateRoomBackground = &IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND;
+ _updateRoomBackground = &IgorEngine::part21UpdateBackground;
_updateDialogue = 0;
cutsceneSayStart(76, 87, 63, 32, 0, { { 219, 1, 1192 }, { 220, 1, 1193 }, { 221, 1, 1194 } });
- _updateDialogue = &IgorEngine::PART_21_UPDATE_DIALOGUE_MARGARET_3;
+ _updateDialogue = &IgorEngine::part21UpdateMargaretNoteDialogue;
_updateRoomBackground = 0;
waitForEndOfCutsceneDialogue(76, 87, 63, 32, 0);
- _updateRoomBackground = &IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND;
+ _updateRoomBackground = &IgorEngine::part21UpdateBackground;
_updateDialogue = 0;
_objectsState[kMargaretStateIndex] = 2;
drawVerbsPanel();
_currentAction.verb = kVerbWalk;
drawInventory(_inventoryInfo[72], 0);
- PART_21_HELPER_1_OBJECT_STATE(255);
+ part21ApplyObjectState(255);
_objectsState[kMargaretSceneStateIndex] = 1;
}
-void IgorEngine::PART_21_HELPER_11_setMargaretBackgroundFrame(int frame) {
+void IgorEngine::part21SetMargaretBackgroundFrame(int frame) {
const int offset = 28520;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + frame * 2107 + 0xCA7, 49, 49, 43);
}
-void IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part21UpdateBackground() {
if (IN_ACTION_111 && compareGameTick(3, 24)) {
const int offset = 28183;
int i = getRandomNumber(1) + 1;
@@ -392,7 +392,7 @@ void IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND() {
}
if (compareGameTick(61) && _objectsState[kMargaretStateIndex] <= 1) {
if (_gameState.unk10 > 2) {
- PART_21_HELPER_6_drawMargaretFrameComposited(_gameState.unk10);
+ part21DrawMargaretFrameComposited(_gameState.unk10);
++_gameState.unk10;
if (_gameState.unk10 == 6) {
++_gameState.counter[4];
@@ -404,7 +404,7 @@ void IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND() {
}
}
} else {
- PART_21_HELPER_6_drawMargaretFrameComposited(_gameState.unk10);
+ part21DrawMargaretFrameComposited(_gameState.unk10);
++_gameState.unk10;
if (_gameState.unk10 == 3 && getRandomNumber(5) != 0) {
_gameState.unk10 = 1;
@@ -413,7 +413,7 @@ void IgorEngine::PART_21_UPDATE_ROOM_BACKGROUND() {
}
}
-void IgorEngine::PART_21() {
+void IgorEngine::part21() {
playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeCorridorMargaret, IMG_CollegeCorridorMargaret, BOX_CollegeCorridorMargaret, MSK_CollegeCorridorMargaret, TXT_CollegeCorridorMargaret);
@@ -422,20 +422,20 @@ void IgorEngine::PART_21() {
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part21ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part21UpdateBackground;
+ part21ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
_gameState.unk10 = 1;
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 210) {
- PART_21_HELPER_2_enterFromLeft();
+ part21EnterFromLeft();
} else if (_currentPart == 211) {
- PART_21_HELPER_3_enterFromRight();
+ part21EnterFromRight();
} else if (_currentPart == 212) {
- PART_21_HELPER_4_enterFromPhysicsClass();
+ part21EnterFromPhysicsClass();
}
}
enterPartLoop();
diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp
index 6be866935d8..56453d6eaf8 100644
--- a/engines/igor/parts/part_22.cpp
+++ b/engines/igor/parts/part_22.cpp
@@ -30,16 +30,16 @@ static const int kPart22PickUpFrameSize = 35 * 30;
static const uint8 PART_22_PICK_UP_FRAMES[3] = { 1, 2, 1 };
-void IgorEngine::PART_22_EXEC_ACTION(int action) {
+void IgorEngine::part22ExecuteAction(int action) {
switch (action) {
case 101:
- PART_22_ACTION_101_lookAtBell();
+ part22LookAtBell();
break;
case 102:
- PART_22_ACTION_102_leave();
+ part22Leave();
break;
default:
- error("PART_22_EXEC_ACTION unhandled action %d", action);
+ error("part22ExecuteAction unhandled action %d", action);
break;
}
}
@@ -47,7 +47,7 @@ void IgorEngine::PART_22_EXEC_ACTION(int action) {
/**
* Takes the object (inventory object 29) from the bell tower.
*/
-void IgorEngine::PART_22_ACTION_101_lookAtBell() {
+void IgorEngine::part22LookAtBell() {
if (_objectsState[kBellTowerConversationSeenStateIndex] == 1 && _inventoryInfo[64] == 0) {
igorSayAndWait(203, 2, 855);
for (int i = 0; i < 3; ++i) {
@@ -58,7 +58,7 @@ void IgorEngine::PART_22_ACTION_101_lookAtBell() {
waitForTimer(60);
}
addObjectToInventory(kInventoryObjectPassword, 64);
- PART_22_APPLY_OBJECT_STATE(255);
+ part22ApplyObjectState(255);
igorSay({ { 205, 1, 856 }, { 206, 1, 857 } });
_objectsState[kChurchBellMessageSeenStateIndex] = 1;
} else {
@@ -69,16 +69,16 @@ void IgorEngine::PART_22_ACTION_101_lookAtBell() {
/**
* Igor leaves the tower
*/
-void IgorEngine::PART_22_ACTION_102_leave() {
+void IgorEngine::part22Leave() {
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
for (int i = 9; i >= 0; --i) {
- PART_22_IGOR_STEP(kFacingPositionBack, i);
+ part22IgorStep(kFacingPositionBack, i);
waitForTimer(15);
}
for (int i = 16; i >= 0;) {
if (compareGameTick(1, 16)) {
- PART_22_SCROLL_STEP(i);
+ part22ScrollStep(i);
--i;
}
waitForTimer();
@@ -89,13 +89,13 @@ void IgorEngine::PART_22_ACTION_102_leave() {
/**
* Nothing to redraw for this room: the object state has no visual effect.
*/
-void IgorEngine::PART_22_APPLY_OBJECT_STATE(int num) {
+void IgorEngine::part22ApplyObjectState(int num) {
}
/**
* One step of Igor walking in place, scaled by the number of steps left to the ground.
*/
-void IgorEngine::PART_22_IGOR_STEP(int facing, int step) {
+void IgorEngine::part22IgorStep(int facing, int step) {
WalkData *wd = &_walkData[0];
wd->setPos(138, 123, facing, _walkCurrentFrame);
WalkData::setNextFrame(facing, _walkCurrentFrame);
@@ -114,7 +114,7 @@ void IgorEngine::PART_22_IGOR_STEP(int facing, int step) {
* Shows the bottom (step * 8 + 16) rows of the room picture on top of the top
* (128 - step * 8) rows of the neighbouring picture.
*/
-void IgorEngine::PART_22_SCROLL_STEP(int step) {
+void IgorEngine::part22ScrollStep(int step) {
const int roomRows = step * 8 + 16;
const int pictureRows = kPart22PictureRows - step * 8;
memcpy(_screenTextLayer, _screenLayer1 + pictureRows * 320, roomRows * 320);
@@ -125,7 +125,7 @@ void IgorEngine::PART_22_SCROLL_STEP(int step) {
/**
* The first screen shows the church and scrolls up to church bell tower
*/
-void IgorEngine::PART_22_enter() {
+void IgorEngine::part22Enter() {
memcpy(_screenVGA, _screenLayer1 + kPart22PictureRows * 320, 16 * 320);
memcpy(_screenVGA + 16 * 320, _animFramesBuffer, kPart22PictureRows * 320);
_currentAction.verb = kVerbWalk;
@@ -133,7 +133,7 @@ void IgorEngine::PART_22_enter() {
for (int i = 0; i <= 16;) {
if (compareGameTick(1, 16)) {
- PART_22_SCROLL_STEP(i);
+ part22ScrollStep(i);
++i;
}
waitForTimer();
@@ -145,7 +145,7 @@ void IgorEngine::PART_22_enter() {
if (i == 9) {
_walkCurrentFrame = 0;
}
- PART_22_IGOR_STEP(kFacingPositionFront, i);
+ part22IgorStep(kFacingPositionFront, i);
waitForTimer(15);
}
_walkDataLastIndex = 0;
@@ -156,7 +156,7 @@ void IgorEngine::PART_22_enter() {
waitForIgorMove();
}
-void IgorEngine::PART_22() {
+void IgorEngine::part22() {
playMusic(3);
_gameState.enableLight = 1;
loadRoomData(PAL_BellChurch, IMG_BellChurch, BOX_BellChurch, MSK_BellChurch, TXT_BellChurch);
@@ -166,10 +166,10 @@ void IgorEngine::PART_22() {
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_APPLY_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part22ExecuteAction);
+ part22ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- PART_22_enter();
+ part22Enter();
}
enterPartLoop();
while (_currentPart == 220 && !_gameStateLoaded) {
diff --git a/engines/igor/parts/part_23.cpp b/engines/igor/parts/part_23.cpp
index f1b6eff0561..969847d4c87 100644
--- a/engines/igor/parts/part_23.cpp
+++ b/engines/igor/parts/part_23.cpp
@@ -25,7 +25,7 @@ namespace Igor {
static const uint8 PART_23_ANIM_DATA_1[3] = { 0, 4, 1 };
-void IgorEngine::PART_23_EXEC_ACTION(int action) {
+void IgorEngine::part23ExecuteAction(int action) {
switch (action) {
case 101:
_currentPart = 280;
@@ -34,16 +34,16 @@ void IgorEngine::PART_23_EXEC_ACTION(int action) {
igorSay(201, 2, 1217);
break;
case 105:
- PART_23_ACTION_105_enterLadiesRoom();
+ part23EnterLadiesRoom();
break;
case 106: // look at door
igorSay(205, 1, 1220);
break;
case 107: // open door
- PART_23_ACTION_107_openDoor();
+ part23OpenDoor();
break;
case 108: // close door
- PART_23_ACTION_108_closeDoor();
+ part23CloseDoor();
break;
case 109: // go through right corridor
_currentPart = 300;
@@ -61,12 +61,12 @@ void IgorEngine::PART_23_EXEC_ACTION(int action) {
igorSay(212, 1, 1225);
break;
default:
- error("PART_23_EXEC_ACTION unhandled action %d", action);
+ error("part23ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_23_ACTION_105_enterLadiesRoom() {
+void IgorEngine::part23EnterLadiesRoom() {
if (_objectsState[kLadiesRoomDoorStateIndex] != 0) {
_roomObjectAreasTable[_screenLayer2[38633]].area = 1;
--_walkDataLastIndex;
@@ -78,9 +78,9 @@ void IgorEngine::PART_23_ACTION_105_enterLadiesRoom() {
}
}
-void IgorEngine::PART_23_ACTION_107_openDoor() {
+void IgorEngine::part23OpenDoor() {
if (_objectsState[kLadiesRoomDoorStateIndex] == 1) {
- EXEC_MAIN_ACTION(11);
+ partMainExecuteAction(11);
return;
}
const int offset = 23901;
@@ -94,12 +94,12 @@ void IgorEngine::PART_23_ACTION_107_openDoor() {
}
}
_objectsState[kLadiesRoomDoorStateIndex] = 1;
- PART_23_HELPER_1_APPLY_OBJECT_STATE(1);
+ part23ApplyObjectState(1);
}
-void IgorEngine::PART_23_ACTION_108_closeDoor() {
+void IgorEngine::part23CloseDoor() {
if (_objectsState[kLadiesRoomDoorStateIndex] == 0) {
- EXEC_MAIN_ACTION(14);
+ partMainExecuteAction(14);
return;
}
const int offset = 23901;
@@ -113,10 +113,10 @@ void IgorEngine::PART_23_ACTION_108_closeDoor() {
}
}
_objectsState[kLadiesRoomDoorStateIndex] = 0;
- PART_23_HELPER_1_APPLY_OBJECT_STATE(1);
+ part23ApplyObjectState(1);
}
-void IgorEngine::PART_23_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part23UpdateBackground() {
if (compareGameTick(29) || compareGameTick(61)) {
int rnd = getRandomNumber(10);
if (rnd <= 4) {
@@ -130,34 +130,34 @@ void IgorEngine::PART_23_UPDATE_ROOM_BACKGROUND() {
_gameState.unk10 = getRandomNumber(1) + 1;
}
}
- PART_23_HELPER_7_drawLucasFrame(_gameState.unk10);
+ part23DrawLucasFrame(_gameState.unk10);
}
}
-void IgorEngine::PART_23_HELPER_1_APPLY_OBJECT_STATE(int num) {
+void IgorEngine::part23ApplyObjectState(int num) {
if (num == 1 || num == 255) {
if (_objectsState[kLadiesRoomDoorStateIndex] == 0) {
- PART_23_HELPER_2_drawDoor(1);
+ part23DrawDoor(1);
_roomActionsTable[4] = 6;
} else {
- PART_23_HELPER_2_drawDoor(2);
+ part23DrawDoor(2);
_roomActionsTable[4] = 7;
}
}
- PART_23_HELPER_3_drawLucas();
+ part23DrawLucas();
}
-void IgorEngine::PART_23_HELPER_2_drawDoor(int frame) {
+void IgorEngine::part23DrawDoor(int frame) {
const int offset = 23907;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + (frame - 1) * 1296, 24, 24, 54);
}
-void IgorEngine::PART_23_HELPER_3_drawLucas() {
+void IgorEngine::part23DrawLucas() {
const int offset = 25763;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xA20, 25, 25, 49);
}
-void IgorEngine::PART_23_HELPER_4_walkFromDoor() {
+void IgorEngine::part23WalkFromDoor() {
_walkData[0].setPos(233, 120, 3, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 0;
@@ -172,12 +172,12 @@ void IgorEngine::PART_23_HELPER_4_walkFromDoor() {
drawAnimRect(23907, 0, 24, 54, false, kBlendBehindIgor);
playSound(14, 1);
_objectsState[kLadiesRoomDoorStateIndex] = 0;
- PART_23_HELPER_1_APPLY_OBJECT_STATE(1);
+ part23ApplyObjectState(1);
igorSay(206, 2, 1221);
}
}
-void IgorEngine::PART_23_HELPER_5_walkFromLeft() {
+void IgorEngine::part23WalkFromLeft() {
_walkData[0].setPos(0, 134, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 15;
@@ -190,7 +190,7 @@ void IgorEngine::PART_23_HELPER_5_walkFromLeft() {
waitForIgorMove();
}
-void IgorEngine::PART_23_HELPER_6_walkFromRight() {
+void IgorEngine::part23WalkFromRight() {
_walkData[0].setPos(319, 134, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -202,7 +202,7 @@ void IgorEngine::PART_23_HELPER_6_walkFromRight() {
waitForIgorMove();
}
-void IgorEngine::PART_23_HELPER_7_drawLucasFrame(int frame) {
+void IgorEngine::part23DrawLucasFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 18; ++i) {
for (int j = 0; j <= 14; ++j) {
@@ -223,7 +223,7 @@ void IgorEngine::PART_23_HELPER_7_drawLucasFrame(int frame) {
}
}
-void IgorEngine::PART_23() {
+void IgorEngine::part23() {
playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeCorridorLucas, IMG_CollegeCorridorLucas, BOX_CollegeCorridorLucas, MSK_CollegeCorridorLucas, TXT_CollegeCorridorLucas);
@@ -237,19 +237,19 @@ void IgorEngine::PART_23() {
_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_APPLY_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part23ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part23UpdateBackground;
+ part23ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 230) {
- PART_23_HELPER_5_walkFromLeft();
+ part23WalkFromLeft();
} else if (_currentPart == 231) {
- PART_23_HELPER_6_walkFromRight();
+ part23WalkFromRight();
} else if (_currentPart == 232) {
- PART_23_HELPER_4_walkFromDoor();
+ part23WalkFromDoor();
}
}
enterPartLoop();
diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp
index 3728e3abe6c..fc14e2248ed 100644
--- a/engines/igor/parts/part_24.cpp
+++ b/engines/igor/parts/part_24.cpp
@@ -23,28 +23,28 @@
namespace Igor {
-void IgorEngine::PART_24_EXEC_ACTION(int action) {
+void IgorEngine::part24ExecuteAction(int action) {
switch (action) {
case 101: // go to corridor
_currentPart = 313;
break;
case 102:
- PART_24_ACTION_102_enterChemistryClass();
+ part24EnterChemistryClass();
break;
case 103: // look at chemistry door
igorSay(201, 1, 1257);
break;
case 104:
- PART_24_ACTION_104_closeDoor();
+ part24CloseDoor();
break;
case 105:
- PART_24_ACTION_105_openDoor();
+ part24OpenDoor();
break;
case 106: // look at chemistry plaque
igorSay(202, 1, 1258);
break;
case 107:
- PART_24_ACTION_107_goToLibrary();
+ part24GoToLibrary();
break;
case 108: // look at library plaque
igorSay(203, 1, 1259);
@@ -62,12 +62,12 @@ void IgorEngine::PART_24_EXEC_ACTION(int action) {
igorSay(212, 2, 1265);
break;
default:
- error("PART_24_EXEC_ACTION unhandled action %d", action);
+ error("part24ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_24_ACTION_102_enterChemistryClass() {
+void IgorEngine::part24EnterChemistryClass() {
if (_objectsState[kChemistryDoorStateIndex] != 0) {
_roomObjectAreasTable[_screenLayer2[37188]].area = 1;
--_walkDataLastIndex;
@@ -79,7 +79,7 @@ void IgorEngine::PART_24_ACTION_102_enterChemistryClass() {
}
}
-void IgorEngine::PART_24_ACTION_104_closeDoor() {
+void IgorEngine::part24CloseDoor() {
if (_objectsState[kChemistryDoorStateIndex] == 1) {
executeAction(11);
return;
@@ -94,10 +94,10 @@ void IgorEngine::PART_24_ACTION_104_closeDoor() {
}
}
_objectsState[kChemistryDoorStateIndex] = 1;
- PART_24_HELPER_1_OBJECT_STATE(1);
+ part24ApplyObjectState(1);
}
-void IgorEngine::PART_24_ACTION_105_openDoor() {
+void IgorEngine::part24OpenDoor() {
if (_objectsState[kChemistryDoorStateIndex] == 0) {
executeAction(14);
return;
@@ -112,10 +112,10 @@ void IgorEngine::PART_24_ACTION_105_openDoor() {
}
}
_objectsState[kChemistryDoorStateIndex] = 0;
- PART_24_HELPER_1_OBJECT_STATE(1);
+ part24ApplyObjectState(1);
}
-void IgorEngine::PART_24_ACTION_107_goToLibrary() {
+void IgorEngine::part24GoToLibrary() {
_roomObjectAreasTable[_screenLayer2[38719]].area = 1;
--_walkDataLastIndex;
buildWalkPathSimple(266, 123, 319, 120);
@@ -125,41 +125,41 @@ void IgorEngine::PART_24_ACTION_107_goToLibrary() {
_currentPart = 330;
}
-void IgorEngine::PART_24_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part24UpdateBackground() {
if (compareGameTick(29) || compareGameTick(61)) {
if (_gameState.unk10 == _gameState.counter[4]) {
_gameState.counter[4] = getRandomNumber(89) + 10;
_gameState.unk10 = 0;
if (_gameState.unkF) {
- PART_24_HELPER_3_talkingFrameMichael(1);
+ part24DrawMichaelTalkingFrame(1);
} else {
- PART_24_HELPER_3_talkingFrameMichael(2);
+ part24DrawMichaelTalkingFrame(2);
}
_gameState.unkF = !_gameState.unkF;
} else {
++_gameState.unk10;
}
if (_gameState.unkF) {
- PART_24_HELPER_3_talkingFrameMichael(getRandomNumber(5) + 1);
+ part24DrawMichaelTalkingFrame(getRandomNumber(5) + 1);
} else {
- PART_24_HELPER_2_talkingFrameSharon(getRandomNumber(5) + 1);
+ part24DrawSharonTalkingFrame(getRandomNumber(5) + 1);
}
}
}
-void IgorEngine::PART_24_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part24ApplyObjectState(int num) {
if (num == 1 || num == 255) { // door
if (_objectsState[kChemistryDoorStateIndex] == 0) {
- PART_24_HELPER_4_drawClosedDoor();
+ part24DrawClosedDoor();
_roomActionsTable[2] = 6;
} else {
- PART_24_HELPER_5_drawOpenDoor();
+ part24DrawOpenDoor();
_roomActionsTable[2] = 7;
}
}
}
-void IgorEngine::PART_24_HELPER_2_talkingFrameSharon(int frame) {
+void IgorEngine::part24DrawSharonTalkingFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 48; ++i) {
for (int j = 0; j <= 22; ++j) {
@@ -183,7 +183,7 @@ void IgorEngine::PART_24_HELPER_2_talkingFrameSharon(int frame) {
}
}
-void IgorEngine::PART_24_HELPER_3_talkingFrameMichael(int frame) {
+void IgorEngine::part24DrawMichaelTalkingFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 42; ++i) {
for (int j = 0; j <= 21; ++j) {
@@ -207,17 +207,17 @@ void IgorEngine::PART_24_HELPER_3_talkingFrameMichael(int frame) {
}
}
-void IgorEngine::PART_24_HELPER_4_drawClosedDoor() {
+void IgorEngine::part24DrawClosedDoor() {
const int offset = 22785;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 33, 33, 55);
}
-void IgorEngine::PART_24_HELPER_5_drawOpenDoor() {
+void IgorEngine::part24DrawOpenDoor() {
const int offset = 22785;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x717, 33, 33, 55);
}
-void IgorEngine::PART_24_HELPER_7_enterFromLeft() {
+void IgorEngine::part24EnterFromLeft() {
_walkData[0].setPos(0, 138, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 15;
@@ -230,7 +230,7 @@ void IgorEngine::PART_24_HELPER_7_enterFromLeft() {
waitForIgorMove();
}
-void IgorEngine::PART_24_HELPER_8_enterFromRight() {
+void IgorEngine::part24EnterFromRight() {
_walkData[0].setPos(319, 123, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
@@ -245,7 +245,7 @@ void IgorEngine::PART_24_HELPER_8_enterFromRight() {
waitForIgorMove();
}
-void IgorEngine::PART_24_HELPER_9_enterFromChemistryClass() {
+void IgorEngine::part24EnterFromChemistryClass() {
_walkData[0].setPos(68, 116, 3, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 1;
@@ -261,7 +261,7 @@ void IgorEngine::PART_24_HELPER_9_enterFromChemistryClass() {
waitForIgorMove();
}
-void IgorEngine::PART_24() {
+void IgorEngine::part24() {
playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeCorridorSharonMichael, IMG_CollegeCorridorSharonMichael, BOX_CollegeCorridorSharonMichael, MSK_CollegeCorridorSharonMichael, TXT_CollegeCorridorSharonMichael);
@@ -270,19 +270,19 @@ void IgorEngine::PART_24() {
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part24ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part24UpdateBackground;
+ part24ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 240) {
- PART_24_HELPER_7_enterFromLeft();
+ part24EnterFromLeft();
} else if (_currentPart == 241) {
- PART_24_HELPER_8_enterFromRight();
+ part24EnterFromRight();
} else if (_currentPart == 242) {
- PART_24_HELPER_9_enterFromChemistryClass();
+ part24EnterFromChemistryClass();
}
enterPartLoop();
}
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index 4c36923c19f..29a515c5977 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -23,7 +23,7 @@
namespace Igor {
-void IgorEngine::PART_25_EXEC_ACTION(int action) {
+void IgorEngine::part25ExecuteAction(int action) {
switch (action) {
case 101: // go to left-side
_currentPart = 260;
@@ -47,27 +47,27 @@ void IgorEngine::PART_25_EXEC_ACTION(int action) {
case 104: // walk to board: nothing happens on arrival
break;
case 105: // enter men's toilet
- PART_25_ACTION_105_enterMensToilet();
+ part25EnterMensToilet();
break;
case 106: // look at door
igorSay(203, 1, 1272);
break;
case 107: // open door
- PART_25_ACTION_107_openDoor();
+ part25OpenDoor();
break;
case 108: // close door
- PART_25_ACTION_108_closeDoor();
+ part25CloseDoor();
break;
case 109: // go to corridor
_currentPart = 310;
break;
default:
- error("PART_25_EXEC_ACTION unhandled action %d", action);
+ error("part25ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_25_ACTION_105_enterMensToilet() {
+void IgorEngine::part25EnterMensToilet() {
if (_objectsState[kMensRoomDoorStateIndex] != 0) {
_roomObjectAreasTable[_screenLayer2[34370]].area = 1;
--_walkDataLastIndex;
@@ -79,9 +79,9 @@ void IgorEngine::PART_25_ACTION_105_enterMensToilet() {
}
}
-void IgorEngine::PART_25_ACTION_107_openDoor() {
+void IgorEngine::part25OpenDoor() {
if (_objectsState[kMensRoomDoorStateIndex] == 1) {
- EXEC_MAIN_ACTION(11);
+ partMainExecuteAction(11);
return;
}
for (int i = 1; i <= 2; ++i) {
@@ -95,12 +95,12 @@ void IgorEngine::PART_25_ACTION_107_openDoor() {
}
}
_objectsState[kMensRoomDoorStateIndex] = 1;
- PART_25_HELPER_1_OBJECT_STATE(1);
+ part25ApplyObjectState(1);
}
-void IgorEngine::PART_25_ACTION_108_closeDoor() {
+void IgorEngine::part25CloseDoor() {
if (_objectsState[kMensRoomDoorStateIndex] == 0) {
- EXEC_MAIN_ACTION(14);
+ partMainExecuteAction(14);
return;
}
for (int i = 3; i <= 4; ++i) {
@@ -114,22 +114,22 @@ void IgorEngine::PART_25_ACTION_108_closeDoor() {
}
}
_objectsState[kMensRoomDoorStateIndex] = 0;
- PART_25_HELPER_1_OBJECT_STATE(1);
+ part25ApplyObjectState(1);
}
-void IgorEngine::PART_25_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part25ApplyObjectState(int num) {
if (num == 1 || num == 255) { // door state
if (_objectsState[kMensRoomDoorStateIndex] == 0) {
- PART_25_HELPER_5_drawClosedDoor();
+ part25DrawClosedDoor();
_roomActionsTable[31] = 6;
} else {
- PART_25_HELPER_7_drawOpenDoor();
+ part25DrawOpenDoor();
_roomActionsTable[31] = 7;
}
}
}
-void IgorEngine::PART_25_HELPER_2_enterFromLeft() {
+void IgorEngine::part25EnterFromLeft() {
_walkData[0].setPos(0, 130, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 15;
@@ -142,7 +142,7 @@ void IgorEngine::PART_25_HELPER_2_enterFromLeft() {
waitForIgorMove();
}
-void IgorEngine::PART_25_HELPER_3_enterFromRight() {
+void IgorEngine::part25EnterFromRight() {
_walkData[0].setPos(319, 138, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -154,7 +154,7 @@ void IgorEngine::PART_25_HELPER_3_enterFromRight() {
waitForIgorMove();
}
-void IgorEngine::PART_25_HELPER_4_enterFromMensToilet() {
+void IgorEngine::part25EnterFromMensToilet() {
_walkData[0].setPos(130, 107, 3, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 0;
@@ -167,17 +167,17 @@ void IgorEngine::PART_25_HELPER_4_enterFromMensToilet() {
waitForIgorMove();
}
-void IgorEngine::PART_25_HELPER_5_drawClosedDoor() {
+void IgorEngine::part25DrawClosedDoor() {
const int offset = 22208;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 23, 23, 52);
}
-void IgorEngine::PART_25_HELPER_7_drawOpenDoor() {
+void IgorEngine::part25DrawOpenDoor() {
const int offset = 22208;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x4AC, 23, 23, 52);
}
-void IgorEngine::PART_25() {
+void IgorEngine::part25() {
playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeCorridorAnnouncementBoard, IMG_CollegeCorridorAnnouncementBoard, BOX_CollegeCorridorAnnouncementBoard, MSK_CollegeCorridorAnnouncementBoard, TXT_CollegeCorridorAnnouncementBoard);
@@ -186,18 +186,18 @@ void IgorEngine::PART_25() {
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part25ExecuteAction);
+ part25ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 250) {
- PART_25_HELPER_2_enterFromLeft();
+ part25EnterFromLeft();
} else if (_currentPart == 251) {
- PART_25_HELPER_3_enterFromRight();
+ part25EnterFromRight();
} else if (_currentPart == 252) {
- PART_25_HELPER_4_enterFromMensToilet();
+ part25EnterFromMensToilet();
}
enterPartLoop();
}
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index cad2b2836cb..9aa3d9482b6 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -25,7 +25,7 @@ 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) {
+void IgorEngine::part26ExecuteAction(int action) {
switch (action) {
case 101: // look at plaque
igorSay(202, 1, 1279);
@@ -34,10 +34,10 @@ void IgorEngine::PART_26_EXEC_ACTION(int action) {
igorSay(203, 1, 1280);
break;
case 103:
- PART_26_ACTION_103_openDoor();
+ part26OpenDoor();
break;
case 104:
- PART_26_ACTION_104_closeDoor();
+ part26CloseDoor();
break;
case 105: // look at picture
igorSay(224, 2, 1290);
@@ -46,7 +46,7 @@ void IgorEngine::PART_26_EXEC_ACTION(int action) {
_currentPart = 250;
break;
case 107:
- PART_26_ACTION_107();
+ part26EnterLab();
break;
case 108: // talk to miss sullivan
igorSay({ { 216, 2, 1284 }, { 218, 1, 1285 } });
@@ -61,14 +61,14 @@ void IgorEngine::PART_26_EXEC_ACTION(int action) {
igorSay(223, 1, 1289);
break;
default:
- error("PART_26_EXEC_ACTION unhandled action %d", action);
+ error("part26ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_26_ACTION_103_openDoor() {
+void IgorEngine::part26OpenDoor() {
if (_objectsState[kLaboratoryDoorOpenStateIndex] == 1) {
- EXEC_MAIN_ACTION(11);
+ partMainExecuteAction(11);
return;
}
for (int i = 1; i <= 2; ++i) {
@@ -81,12 +81,12 @@ void IgorEngine::PART_26_ACTION_103_openDoor() {
}
}
_objectsState[kLaboratoryDoorOpenStateIndex] = 1;
- PART_26_HELPER_1_OBJECT_STATE(1);
+ part26ApplyObjectState(1);
}
-void IgorEngine::PART_26_ACTION_104_closeDoor() {
+void IgorEngine::part26CloseDoor() {
if (_objectsState[kLaboratoryDoorOpenStateIndex] == 0) {
- EXEC_MAIN_ACTION(14);
+ partMainExecuteAction(14);
return;
}
for (int i = 3; i <= 4; ++i) {
@@ -99,10 +99,10 @@ void IgorEngine::PART_26_ACTION_104_closeDoor() {
}
}
_objectsState[kLaboratoryDoorOpenStateIndex] = 0;
- PART_26_HELPER_1_OBJECT_STATE(1);
+ part26ApplyObjectState(1);
}
-void IgorEngine::PART_26_ACTION_107() {
+void IgorEngine::part26EnterLab() {
if (_objectsState[kLaboratoryDoorOpenStateIndex] != 0) {
_roomObjectAreasTable[_screenLayer2[36800]].area = 1;
--_walkDataLastIndex;
@@ -115,51 +115,51 @@ void IgorEngine::PART_26_ACTION_107() {
}
}
-void IgorEngine::PART_26_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part26UpdateBackground() {
if (compareGameTick(29) || compareGameTick(61)) {
if (_gameState.unk10 > 2) {
if (_gameState.unk10 == 11) {
_gameState.unk10 = 2;
}
- PART_26_HELPER_7_drawMissSullivanFrame(PART_26_ANIM_DATA_1[_gameState.unk10]);
+ part26DrawMissSullivanFrame(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_drawMissSullivanFrame(_gameState.unk10);
+ part26DrawMissSullivanFrame(_gameState.unk10);
} else if (getRandomNumber(24) == 0) {
_gameState.unk10 = 1;
- PART_26_HELPER_7_drawMissSullivanFrame(_gameState.unk10);
+ part26DrawMissSullivanFrame(_gameState.unk10);
} else if (getRandomNumber(29) == 0) {
_gameState.unk10 = 3;
}
}
}
-void IgorEngine::PART_26_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part26ApplyObjectState(int num) {
if (num == 1 || num == 255) {
if (_objectsState[kLaboratoryDoorOpenStateIndex] == 0) {
- PART_26_HELPER_2_drawClosedDoor();
+ part26DrawClosedDoor();
_roomActionsTable[0x1E] = 6;
} else {
- PART_26_HELPER_3_drawOpenDoor();
+ part26DrawOpenDoor();
_roomActionsTable[0x1E] = 7;
}
}
}
-void IgorEngine::PART_26_HELPER_2_drawClosedDoor() {
+void IgorEngine::part26DrawClosedDoor() {
const int offset = 19870;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 25, 25, 65);
}
-void IgorEngine::PART_26_HELPER_3_drawOpenDoor() {
+void IgorEngine::part26DrawOpenDoor() {
const int offset = 19870;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x659, 25, 25, 65);
}
-void IgorEngine::PART_26_HELPER_4_enterFromRight() {
+void IgorEngine::part26EnterFromRight() {
_walkData[0].setPos(319, 125, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -171,7 +171,7 @@ void IgorEngine::PART_26_HELPER_4_enterFromRight() {
waitForIgorMove();
}
-void IgorEngine::PART_26_HELPER_5_enterFromLaboratory() {
+void IgorEngine::part26EnterFromLaboratory() {
_walkData[0].setPos(0, 115, 3, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 2;
@@ -192,11 +192,11 @@ void IgorEngine::PART_26_HELPER_5_enterFromLaboratory() {
_currentAction.verb = kVerbWalk;
drawInventory(_inventoryInfo[72], 0);
playSound(51, 1);
- PART_26_HELPER_1_OBJECT_STATE(255);
+ part26ApplyObjectState(255);
}
}
-void IgorEngine::PART_26_HELPER_7_drawMissSullivanFrame(int frame) {
+void IgorEngine::part26DrawMissSullivanFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 39; ++i) {
for (int j = 0; j <= 21; ++j) {
@@ -218,7 +218,7 @@ void IgorEngine::PART_26_HELPER_7_drawMissSullivanFrame(int frame) {
}
}
-void IgorEngine::PART_26() {
+void IgorEngine::part26() {
playMusic(2);
_gameState.enableLight = 1;
loadRoomData(PAL_CollegeCorridorMissBarrymore, IMG_CollegeCorridorMissBarrymore, BOX_CollegeCorridorMissBarrymore, MSK_CollegeCorridorMissBarrymore, TXT_CollegeCorridorMissBarrymore);
@@ -227,18 +227,18 @@ void IgorEngine::PART_26() {
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part26ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part26UpdateBackground;
+ part26ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
_gameState.unk10 = true;
fadeIn(768);
if (_currentPart == 260) {
- PART_26_HELPER_4_enterFromRight();
+ part26EnterFromRight();
} else {
- PART_26_HELPER_5_enterFromLaboratory();
+ part26EnterFromLaboratory();
}
enterPartLoop();
}
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index 3fc77039562..280ddf65991 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -23,7 +23,7 @@
namespace Igor {
-void IgorEngine::PART_27_EXEC_ACTION(int action) {
+void IgorEngine::part27ExecuteAction(int action) {
switch (action) {
case 101: // go to right
_currentPart = 211;
@@ -32,7 +32,7 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
if (_objectsState[kLockersExaminedStateIndex] == 0) {
igorSay(216, 2, 1173);
_objectsState[kLockersExaminedStateIndex] = 1;
- PART_27_HELPER_1_OBJECT_STATE(255);
+ part27ApplyObjectState(255);
} else {
igorSay(201, 1, 1162);
}
@@ -47,19 +47,19 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
igorSay(205, 1, 1165);
break;
case 106: // open Philip's locker
- PART_27_ACTION_106_openPhilipLocker();
+ part27OpenPhilipLocker();
break;
case 107:
- PART_27_ACTION_107_closeLocker();
+ part27CloseLocker();
break;
case 108:
- PART_27_ACTION_108_openLocker();
+ part27OpenLocker();
break;
case 109: // look at bottles
igorSay(215, 1, 1172);
break;
case 110:
- PART_27_ACTION_110_useFlaskOnLocker();
+ part27UseFlaskOnLocker();
break;
case 111: // look at messageboard
igorSay(218, 2, 1174);
@@ -71,14 +71,14 @@ void IgorEngine::PART_27_EXEC_ACTION(int action) {
_currentPart = 150;
break;
default:
- error("PART_27_EXEC_ACTION unhandled action %d", action);
+ error("part27ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_27_ACTION_106_openPhilipLocker() {
+void IgorEngine::part27OpenPhilipLocker() {
if (_objectsState[kPhillipLockerStateIndex] == 1) {
- EXEC_MAIN_ACTION(11);
+ partMainExecuteAction(11);
return;
}
if (_objectsState[kPhillipLockerCombinationLearnedStateIndex] == 0) {
@@ -100,12 +100,12 @@ void IgorEngine::PART_27_ACTION_106_openPhilipLocker() {
}
}
_objectsState[kPhillipLockerStateIndex] = 1;
- PART_27_HELPER_1_OBJECT_STATE(1);
+ part27ApplyObjectState(1);
}
-void IgorEngine::PART_27_ACTION_107_closeLocker() {
+void IgorEngine::part27CloseLocker() {
if (_objectsState[kPhillipLockerStateIndex] == 0) {
- EXEC_MAIN_ACTION(14);
+ partMainExecuteAction(14);
return;
}
const int offset = 21810;
@@ -117,10 +117,10 @@ void IgorEngine::PART_27_ACTION_107_closeLocker() {
}
}
_objectsState[kPhillipLockerStateIndex] = 0;
- PART_27_HELPER_1_OBJECT_STATE(1);
+ part27ApplyObjectState(1);
}
-void IgorEngine::PART_27_ACTION_108_openLocker() {
+void IgorEngine::part27OpenLocker() {
if (_inventoryInfo[58] > 0 || _objectsState[kButterflyNetStateIndex] == 2) {
igorSay(208, 1, 1168);
return;
@@ -134,13 +134,13 @@ void IgorEngine::PART_27_ACTION_108_openLocker() {
}
}
addObjectToInventory(kInventoryObjectBottle, 58);
- PART_27_HELPER_1_OBJECT_STATE(1);
+ part27ApplyObjectState(1);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
}
-void IgorEngine::PART_27_ACTION_110_useFlaskOnLocker() {
+void IgorEngine::part27UseFlaskOnLocker() {
igorSayAndWait({ { 212, 1, 1170 }, { 213, 2, 1171 } });
const int offset = 25012;
for (int i = 1; i <= 2; ++i) {
@@ -150,21 +150,21 @@ void IgorEngine::PART_27_ACTION_110_useFlaskOnLocker() {
}
}
removeObjectFromInventory(55);
- PART_27_HELPER_1_OBJECT_STATE(255);
+ part27ApplyObjectState(255);
_objectsState[kFlaskLeftInPhillipLockerStateIndex] = 1;
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
}
-void IgorEngine::PART_27_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part27ApplyObjectState(int num) {
if (num == 1 || num == 255) {
if (_objectsState[kPhillipLockerStateIndex] == 0) {
- PART_27_HELPER_3_drawClosedLocker();
+ part27DrawClosedLocker();
_roomActionsTable[3] = 6;
_roomObjectAreasTable[6].object = 3;
} else {
- PART_27_HELPER_4_drawOpenLocker();
+ part27DrawOpenLocker();
_roomActionsTable[3] = 7;
_roomObjectAreasTable[6].object = 4;
}
@@ -179,7 +179,7 @@ void IgorEngine::PART_27_HELPER_1_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_27_HELPER_2_enterFromLeft() {
+void IgorEngine::part27EnterFromLeft() {
_walkData[0].setPos(0, 132, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -191,17 +191,17 @@ void IgorEngine::PART_27_HELPER_2_enterFromLeft() {
waitForIgorMove();
}
-void IgorEngine::PART_27_HELPER_3_drawClosedLocker() {
+void IgorEngine::part27DrawClosedLocker() {
const int offset = 21816;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 26, 26, 48);
}
-void IgorEngine::PART_27_HELPER_4_drawOpenLocker() {
+void IgorEngine::part27DrawOpenLocker() {
const int offset = 21816;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x4E0, 26, 26, 48);
}
-void IgorEngine::PART_27_HELPER_5_enterFromLibrary() {
+void IgorEngine::part27EnterFromLibrary() {
_walkData[0].setPos(270, 134, 4, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 0;
@@ -212,7 +212,7 @@ void IgorEngine::PART_27_HELPER_5_enterFromLibrary() {
waitForIgorMove();
}
-void IgorEngine::PART_27() {
+void IgorEngine::part27() {
playMusic(2);
_gameState.enableLight = 1;
loadRoomData(PAL_CollegeLockers, IMG_CollegeLockers, BOX_CollegeLockers, MSK_CollegeLockers, TXT_CollegeLockers);
@@ -221,16 +221,16 @@ void IgorEngine::PART_27() {
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part27ExecuteAction);
+ part27ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 270) {
- PART_27_HELPER_2_enterFromLeft();
+ part27EnterFromLeft();
} else {
- PART_27_HELPER_5_enterFromLibrary();
+ part27EnterFromLibrary();
}
enterPartLoop();
}
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index f8f94277cd0..94fdf0b5e45 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -24,7 +24,7 @@
namespace Igor {
-void IgorEngine::PART_28_EXEC_ACTION(int action) {
+void IgorEngine::part28ExecuteAction(int action) {
switch (action) {
case 101: // leave
_currentPart = 230;
@@ -52,10 +52,10 @@ void IgorEngine::PART_28_EXEC_ACTION(int action) {
igorSay(237, 1, 1256);
break;
case 108:
- PART_28_ACTION_108_talkCaroline();
+ part28TalkToCaroline();
break;
case 109:
- PART_28_ACTION_109_takeFolder();
+ part28TakeFolder();
break;
case 110: // open door
igorSay({ { 228, 1, 1248 }, { 229, 1, 1249 } });
@@ -74,20 +74,20 @@ void IgorEngine::PART_28_EXEC_ACTION(int action) {
igorSay(236, 1, 1255);
break;
default:
- error("PART_28_EXEC_ACTION unhandled action %d", action);
+ error("part28ExecuteAction unhandled action %d", action);
break;
}
}
// Caroline's idle animation is only driven by the room loop and while Igor speaks;
// her own talking loops never run it, otherwise it fights the talking frames.
-void IgorEngine::PART_28_ACTION_108_talkCaroline() {
+void IgorEngine::part28TalkToCaroline() {
const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
if (_objectsState[kExamCompletedStateIndex] == 1) {
igorSayAndWait(218, 1, 1241);
_updateRoomBackground = 0;
cutsceneSayStart(182, 81, 63, 17, 17, { { 211, 1, 1235 }, { 212, 1, 1236 }, { 213, 2, 1237 }, { 215, 1, 1238 }, { 216, 1, 1239 } });
- _updateDialogue = &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE;
+ _updateDialogue = &IgorEngine::part28UpdateCarolineDialogue;
waitForEndOfCutsceneDialogue(182, 81, 63, 17, 17);
ADD_DIALOGUE_TEXT(217, 1, 1240);
SET_DIALOGUE_TEXT(1, 5);
@@ -112,14 +112,14 @@ void IgorEngine::PART_28_ACTION_108_talkCaroline() {
}
_updateRoomBackground = 0;
if (_objectsState[kCarolineFolderStateIndex] < 2) {
- cutsceneSayWithCallback(182, 81, 63, 17, 17, 208, 1, 1233, &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE);
+ cutsceneSayWithCallback(182, 81, 63, 17, 17, 208, 1, 1233, &IgorEngine::part28UpdateCarolineDialogue);
} else {
- cutsceneSayWithCallback(182, 81, 63, 17, 17, { { 219, 2, 1242 }, { 221, 1, 1243 } }, &IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE);
+ cutsceneSayWithCallback(182, 81, 63, 17, 17, { { 219, 2, 1242 }, { 221, 1, 1243 } }, &IgorEngine::part28UpdateCarolineDialogue);
}
_updateRoomBackground = updateRoomBackground;
}
-void IgorEngine::PART_28_ACTION_109_takeFolder() {
+void IgorEngine::part28TakeFolder() {
for (int i = 1; i <= 7; ++i) {
const int offset = 25067;
drawAnimRect(offset, i * 1085 + 0x5EC9, 31, 35);
@@ -129,35 +129,35 @@ void IgorEngine::PART_28_ACTION_109_takeFolder() {
}
addObjectToInventory(kInventoryObjectFolder, 57);
_objectsState[kCarolineFolderStateIndex] = 1;
- PART_28_HELPER_1_OBJECT_STATE(255);
+ part28ApplyObjectState(255);
igorSay(230, 1, 1250);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
}
-void IgorEngine::PART_28_UPDATE_DIALOGUE_CAROLINE(int action) {
+void IgorEngine::part28UpdateCarolineDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_28_HELPER_5_drawCarolineTalkingFrame(7);
+ part28DrawCarolineTalkingFrame(7);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_28_HELPER_5_drawCarolineTalkingFrame(getRandomNumber(4) + 7);
+ part28DrawCarolineTalkingFrame(getRandomNumber(4) + 7);
break;
}
}
-void IgorEngine::PART_28_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part28UpdateBackground() {
if (compareGameTick(61)) {
if (_gameState.unk10 > 2) {
- PART_28_HELPER_5_drawCarolineTalkingFrame(_gameState.unk10);
+ part28DrawCarolineTalkingFrame(_gameState.unk10);
if (_gameState.unk10 < 6) {
++_gameState.unk10;
} else {
_gameState.unk10 = 1;
}
} else {
- PART_28_HELPER_5_drawCarolineTalkingFrame(_gameState.unk10);
+ part28DrawCarolineTalkingFrame(_gameState.unk10);
if (_gameState.unk10 == 1) {
_gameState.unk10 = 2;
} else {
@@ -170,24 +170,24 @@ void IgorEngine::PART_28_UPDATE_ROOM_BACKGROUND() {
}
}
-void IgorEngine::PART_28_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part28ApplyObjectState(int num) {
WRITE_LE_UINT16(_roomActionsTable + 0x56, 42133);
if (num == 2 || num == 255) {
if (_objectsState[kCarolineFolderStateIndex] == 0) {
- PART_28_HELPER_8(1);
+ part28DrawFolder(1);
} else {
- PART_28_HELPER_8(0);
+ part28DrawFolder(0);
_roomObjectAreasTable[7].object = 0;
}
}
}
-void IgorEngine::PART_28_HELPER_2_drawCaroline() {
+void IgorEngine::part28DrawCaroline() {
const int offset = 27374;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer, 30, 30, 44);
}
-void IgorEngine::PART_28_HELPER_3_enterFromRight() {
+void IgorEngine::part28EnterFromRight() {
_walkData[0].setPos(319, 142, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -200,7 +200,7 @@ void IgorEngine::PART_28_HELPER_3_enterFromRight() {
waitForIgorMove();
}
-void IgorEngine::PART_28_HELPER_5_drawCarolineTalkingFrame(int frame) {
+void IgorEngine::part28DrawCarolineTalkingFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 43; ++i) {
for (int j = 0; j <= 29; ++j) {
@@ -224,13 +224,13 @@ void IgorEngine::PART_28_HELPER_5_drawCarolineTalkingFrame(int frame) {
}
}
-void IgorEngine::PART_28_HELPER_6_enterAndCheckGrades() {
+void IgorEngine::part28EnterAndCheckGrades() {
setupDefaultPalette();
SET_PAL_240_48_1();
SET_PAL_208_96_1();
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
- PART_28_HELPER_1_OBJECT_STATE(255);
+ part28ApplyObjectState(255);
fadeIn(768);
_walkData[0].setPos(319, 142, 4, 0);
_walkData[0].setDefaultScale();
@@ -255,12 +255,12 @@ void IgorEngine::PART_28_HELPER_6_enterAndCheckGrades() {
igorSayAndWait({ { 224, 2, 1245 }, { 232, 2, 1252 } });
}
-void IgorEngine::PART_28_HELPER_8(int frame) {
+void IgorEngine::part28DrawFolder(int frame) {
const int offset = 33387;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + frame * 135 + 0x61F8, 15, 15, 9);
}
-void IgorEngine::PART_28() {
+void IgorEngine::part28() {
playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeCorridorCaroline, IMG_CollegeCorridorCaroline, BOX_CollegeCorridorCaroline, MSK_CollegeCorridorCaroline, TXT_CollegeCorridorCaroline);
@@ -269,10 +269,10 @@ void IgorEngine::PART_28() {
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_drawCaroline();
- PART_28_HELPER_1_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part28ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part28UpdateBackground;
+ part28DrawCaroline();
+ part28ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
@@ -280,9 +280,9 @@ void IgorEngine::PART_28() {
_currentAction.verb = kVerbWalk;
if (_currentPart == 280) {
fadeIn(768);
- PART_28_HELPER_3_enterFromRight();
+ part28EnterFromRight();
} else if (_currentPart == 281) {
- PART_28_HELPER_6_enterAndCheckGrades();
+ part28EnterAndCheckGrades();
}
}
enterPartLoop();
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index 0b4aca12aa8..d758d99692f 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -24,19 +24,19 @@
namespace Igor {
-void IgorEngine::PART_30_EXEC_ACTION(int action) {
+void IgorEngine::part30ExecuteAction(int action) {
switch (action) {
case 101:
_currentPart = 231;
break;
case 102:
- PART_30_ACTION_102_goUpstairs();
+ part30GoUpstairs();
break;
case 103: // look at upward stairs
igorSay(201, 1, 450);
break;
case 104:
- PART_30_ACTION_104_goDownstairs();
+ part30GoDownstairs();
break;
case 105: // look at downward stairs
igorSay(202, 1, 451);
@@ -45,12 +45,12 @@ void IgorEngine::PART_30_EXEC_ACTION(int action) {
_currentPart = 210;
break;
default:
- error("PART_30_EXEC_ACTION unhandled action %d", action);
+ error("part30ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_30_ACTION_102_goUpstairs() {
+void IgorEngine::part30GoUpstairs() {
_roomObjectAreasTable[_screenLayer2[24108]].area = 2;
--_walkDataLastIndex;
buildWalkPath(99, 119, 108, 75);
@@ -66,7 +66,7 @@ void IgorEngine::PART_30_ACTION_102_goUpstairs() {
_currentPart = 312;
}
-void IgorEngine::PART_30_ACTION_104_goDownstairs() {
+void IgorEngine::part30GoDownstairs() {
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[36318]].area = 2;
buildWalkPath(158, 119, 158, 113);
@@ -91,31 +91,31 @@ void IgorEngine::PART_30_ACTION_104_goDownstairs() {
_currentPart = (_objectsState[kExamCompletedStateIndex] == 0) ? 171 : 771;
}
-void IgorEngine::PART_30_UPDATE_DIALOGUE_LAURA(int action) {
+void IgorEngine::part30UpdateLauraDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_30_HELPER_9_setLauraFrame(42);
+ part30SetLauraFrame(42);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_30_HELPER_9_setLauraFrame(getRandomNumber(8) + 42);
+ part30SetLauraFrame(getRandomNumber(8) + 42);
break;
case kUpdateDialogueAnimStanding:
- PART_30_HELPER_9_setLauraFrame(33);
+ part30SetLauraFrame(33);
break;
}
}
-void IgorEngine::PART_30_HANDLE_DIALOGUE_LAURA() {
+void IgorEngine::part30HandleLauraDialogue() {
loadDialogueData(DLG_CollegeStairsFirstFloor);
- _updateDialogue = &IgorEngine::PART_30_UPDATE_DIALOGUE_LAURA;
+ _updateDialogue = &IgorEngine::part30UpdateLauraDialogue;
handleDialogue(201, 85, 63, 0, 38, false);
_updateDialogue = 0;
}
-void IgorEngine::PART_30_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part30ApplyObjectState(int num) {
}
-void IgorEngine::PART_30_HELPER_2_walkInFromLeft() {
+void IgorEngine::part30WalkInFromLeft() {
_walkData[0].setPos(0, 138, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -128,7 +128,7 @@ void IgorEngine::PART_30_HELPER_2_walkInFromLeft() {
waitForIgorMove();
}
-void IgorEngine::PART_30_HELPER_3_walkInFromUpstairs() {
+void IgorEngine::part30WalkInFromUpstairs() {
_roomObjectAreasTable[_screenLayer2[24170]].area = 2;
_walkData[0].setPos(170, 75, 4, 0);
_walkData[0].setDefaultScale();
@@ -153,7 +153,7 @@ void IgorEngine::PART_30_HELPER_3_walkInFromUpstairs() {
waitForIgorMove();
}
-void IgorEngine::PART_30_HELPER_2_walkInFromOutside() {
+void IgorEngine::part30WalkInFromOutside() {
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
_walkCurrentPos = 3;
@@ -180,7 +180,7 @@ void IgorEngine::PART_30_HELPER_2_walkInFromOutside() {
waitForIgorMove();
}
-void IgorEngine::PART_30_HELPER_5_walkInFromRight() {
+void IgorEngine::part30WalkInFromRight() {
_walkData[0].setPos(319, 138, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -192,22 +192,22 @@ void IgorEngine::PART_30_HELPER_5_walkInFromRight() {
waitForIgorMove();
}
-void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
+void IgorEngine::part30LauraCutscene() {
memset(_screenVGA + 46080, 0, 17920);
fadeIn(768);
- lauraAndIgorBumpIntoEachOther();
+ part30LauraAndIgorBumpIntoEachOther();
_walkData[0].setPos(172, 134, 2, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
- _updateDialogue = &IgorEngine::PART_30_UPDATE_DIALOGUE_LAURA;
+ _updateDialogue = &IgorEngine::part30UpdateLauraDialogue;
igorSayAndWait({ { 203, 1, 452 }, { 204, 1, 453 }, { 205, 1, 454 } });
cutsceneSay(201, 85, 63, 0, 38, 206, 1, 455);
// igor crosses arms
- igorCrossesArms();
+ part30IgorCrossesArms();
// real dialogue
- PART_30_HANDLE_DIALOGUE_LAURA();
+ part30HandleLauraDialogue();
if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart)
return;
// "Nunca me habian descrito tan bien"
@@ -216,7 +216,7 @@ void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
cutsceneSay(201, 85, 63, 0, 38, { { 208, 1, 457 }, { 209, 1, 458 } });
_updateDialogue = 0;
// Laura leaves
- lauraLeaves();
+ part30LauraLeaves();
_walkData[0].setPos(164, 135, 3, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 1;
@@ -229,10 +229,10 @@ void IgorEngine::PART_30_HELPER_8_LauraCutscene() {
drawInventory(_inventoryInfo[72], 0);
_currentAction.verb = kVerbWalk;
_objectsState[kLauraMetAtCollegeStateIndex] = 1;
- PART_30_HELPER_1_OBJECT_STATE(255);
+ part30ApplyObjectState(255);
}
-void IgorEngine::lauraAndIgorBumpIntoEachOther() {
+void IgorEngine::part30LauraAndIgorBumpIntoEachOther() {
// they both walk in
for (int i = 1; i <= 40; ++i) {
const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0xBE94 + i * 2) - 1;
@@ -245,7 +245,7 @@ void IgorEngine::lauraAndIgorBumpIntoEachOther() {
}
}
-void IgorEngine::igorCrossesArms() {
+void IgorEngine::part30IgorCrossesArms() {
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;
@@ -253,7 +253,7 @@ void IgorEngine::igorCrossesArms() {
}
}
-void IgorEngine::lauraLeaves() {
+void IgorEngine::part30LauraLeaves() {
for (int i = 51; i <= 70; ++i) {
const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0xBE94 + i * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
@@ -263,12 +263,12 @@ void IgorEngine::lauraLeaves() {
}
}
-void IgorEngine::PART_30_HELPER_9_setLauraFrame(int frame) {
+void IgorEngine::part30SetLauraFrame(int frame) {
const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0xBE94 + frame * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
-void IgorEngine::PART_30() {
+void IgorEngine::part30() {
playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeStairsFirstFloor, IMG_CollegeStairsFirstFloor, BOX_CollegeStairsFirstFloor, MSK_CollegeStairsFirstFloor, TXT_CollegeStairsFirstFloor);
@@ -277,26 +277,26 @@ void IgorEngine::PART_30() {
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part30ExecuteAction);
+ part30ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
if (_objectsState[kLauraMetAtCollegeStateIndex] == 0) {
- PART_30_HELPER_8_LauraCutscene();
+ part30LauraCutscene();
} else {
if (_currentPart != 302) {
fadeIn(768);
}
if (_currentPart == 300) { // enter from outside
- PART_30_HELPER_2_walkInFromLeft();
+ part30WalkInFromLeft();
} else if (_currentPart == 301) {
- PART_30_HELPER_3_walkInFromUpstairs();
+ part30WalkInFromUpstairs();
} else if (_currentPart == 302) {
fadeIn(768);
- PART_30_HELPER_2_walkInFromOutside();
+ part30WalkInFromOutside();
} else if (_currentPart == 303) {
- PART_30_HELPER_5_walkInFromRight();
+ part30WalkInFromRight();
}
}
}
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index c3d4a29fd1b..694a41f3ff1 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -28,20 +28,20 @@ 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) {
+void IgorEngine::part31ExecuteAction(int action) {
switch (action) {
case 101:
_currentPart = 251;
break;
case 102:
- PART_31_ACTION_102_enterAstronomyLab();
+ part31EnterAstronomyLab();
break;
case 103:
- PART_31_ACTION_103_openDoor();
+ part31OpenDoor();
break;
case 104:
if (_objectsState[kAstronomyLabDoorStateIndex] == 0) {
- EXEC_MAIN_ACTION(14);
+ partMainExecuteAction(14);
} else {
igorSay(205, 1, 885);
}
@@ -50,7 +50,7 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
igorSay(201, 1, 881);
break;
case 106:
- PART_31_ACTION_106_goDownstairs();
+ part31GoDownstairs();
break;
case 107:
igorSay(203, 1, 883);
@@ -62,7 +62,7 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
igorSay(204, 1, 884);
break;
case 110:
- PART_31_ACTION_110_openDoor2();
+ part31UseKeysWithDoor();
break;
case 111:
igorSay(206, 2, 886);
@@ -83,12 +83,12 @@ void IgorEngine::PART_31_EXEC_ACTION(int action) {
igorSay(218, 2, 894);
break;
default:
- error("PART_31_EXEC_ACTION unhandled action %d", action);
+ error("part31ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_31_ACTION_102_enterAstronomyLab() {
+void IgorEngine::part31EnterAstronomyLab() {
if (_objectsState[kAstronomyLabDoorStateIndex] == 0) {
return;
}
@@ -110,9 +110,9 @@ void IgorEngine::PART_31_ACTION_102_enterAstronomyLab() {
_currentPart = 320;
}
-void IgorEngine::PART_31_ACTION_103_openDoor() {
+void IgorEngine::part31OpenDoor() {
if (_objectsState[kAstronomyLabDoorStateIndex] == 1) {
- EXEC_MAIN_ACTION(11);
+ partMainExecuteAction(11);
return;
}
playSound(49, 1);
@@ -126,7 +126,7 @@ void IgorEngine::PART_31_ACTION_103_openDoor() {
igorSay(202, 1, 882);
}
-void IgorEngine::PART_31_ACTION_106_goDownstairs() {
+void IgorEngine::part31GoDownstairs() {
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[36326]].area = 2;
buildWalkPath(166, 120, 166, 113);
@@ -155,9 +155,9 @@ void IgorEngine::PART_31_ACTION_106_goDownstairs() {
_currentPart = 301;
}
-void IgorEngine::PART_31_ACTION_110_openDoor2() {
+void IgorEngine::part31UseKeysWithDoor() {
if (_objectsState[kAstronomyLabDoorStateIndex] == 1) {
- EXEC_MAIN_ACTION(11);
+ partMainExecuteAction(11);
return;
}
const int offset = 20250;
@@ -172,10 +172,10 @@ void IgorEngine::PART_31_ACTION_110_openDoor2() {
}
}
_objectsState[kAstronomyLabDoorStateIndex] = 1;
- PART_31_HELPER_1_OBJECT_STATE(1);
+ part31ApplyObjectState(1);
}
-void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part31UpdateBackground() {
int xPos, pos;
if (_gameState.igorMoving) {
xPos = _walkData[_walkDataCurrentIndex - 1].x;
@@ -188,34 +188,34 @@ void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() {
if (pos == 2) {
if (_gameState.unk10 == 4 || _gameState.unk10 == 5) {
_gameState.unk10 = 3;
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ part31DrawJohnnyFrame(_gameState.unk10);
return;
}
if (_gameState.unk10 == 1 || _gameState.unk10 == 3) {
_gameState.unk10 = 2;
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ part31DrawJohnnyFrame(_gameState.unk10);
return;
}
} else if (!_gameState.igorMoving) {
if (_gameState.unk10 == 1 || _gameState.unk10 == 2) {
_gameState.unk10 = 3;
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ part31DrawJohnnyFrame(_gameState.unk10);
return;
} else if (_gameState.unk10 == 3) {
_gameState.unk10 = 4;
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ part31DrawJohnnyFrame(_gameState.unk10);
return;
} else if (_gameState.unk10 == 4) {
if (getRandomNumber(29) == 0) {
_gameState.unk10 = 5;
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ part31DrawJohnnyFrame(_gameState.unk10);
_gameState.counter[4] = 0;
return;
}
} else if (_gameState.unk10 == 5) {
if (_gameState.counter[4] == 20) {
_gameState.unk10 = 4;
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ part31DrawJohnnyFrame(_gameState.unk10);
return;
} else {
++_gameState.counter[4];
@@ -230,7 +230,7 @@ void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() {
} else {
_gameState.unk10 = 2;
}
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ part31DrawJohnnyFrame(_gameState.unk10);
return;
}
}
@@ -240,22 +240,22 @@ void IgorEngine::PART_31_UPDATE_ROOM_BACKGROUND() {
} else {
_gameState.unk10 = 1;
}
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ part31DrawJohnnyFrame(_gameState.unk10);
}
}
-void IgorEngine::PART_31_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part31ApplyObjectState(int num) {
if (num == 1 || num == 255) {
if (_objectsState[kAstronomyLabDoorStateIndex] == 0) {
_roomActionsTable[74] = 6;
} else {
- PART_31_HELPER_9_drawOpenDoor();
+ part31DrawOpenDoor();
_roomActionsTable[74] = 7;
}
}
}
-void IgorEngine::PART_31_HELPER_2_drawJohnnyFrame(int frame) {
+void IgorEngine::part31DrawJohnnyFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 42; ++i) {
for (int j = 0; j <= 30; ++j) {
@@ -277,7 +277,7 @@ void IgorEngine::PART_31_HELPER_2_drawJohnnyFrame(int frame) {
}
}
-void IgorEngine::PART_31_HELPER_3_enterFromLeft() {
+void IgorEngine::part31EnterFromLeft() {
_walkData[0].setPos(0, 137, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 15;
@@ -290,7 +290,7 @@ void IgorEngine::PART_31_HELPER_3_enterFromLeft() {
waitForIgorMove();
}
-void IgorEngine::PART_31_HELPER_4_enterFromAstronomyLab() {
+void IgorEngine::part31EnterFromAstronomyLab() {
_walkData[0].setPos(47, 63, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 30;
@@ -315,7 +315,7 @@ void IgorEngine::PART_31_HELPER_4_enterFromAstronomyLab() {
waitForIgorMove();
}
-void IgorEngine::PART_31_HELPER_5_enterFromDownstairs() {
+void IgorEngine::part31EnterFromDownstairs() {
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
_walkCurrentPos = 3;
@@ -349,7 +349,7 @@ void IgorEngine::PART_31_HELPER_5_enterFromDownstairs() {
waitForIgorMove();
}
-void IgorEngine::PART_31_HELPER_6_enterFromRight() {
+void IgorEngine::part31EnterFromRight() {
_walkData[0].setPos(319, 138, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -361,12 +361,12 @@ void IgorEngine::PART_31_HELPER_6_enterFromRight() {
waitForIgorMove();
}
-void IgorEngine::PART_31_HELPER_9_drawOpenDoor() {
+void IgorEngine::part31DrawOpenDoor() {
const int offset = 20256;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x562, 26, 26, 53);
}
-void IgorEngine::PART_31() {
+void IgorEngine::part31() {
playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeStairsSecondFloor, IMG_CollegeStairsSecondFloor, BOX_CollegeStairsSecondFloor, MSK_CollegeStairsSecondFloor, TXT_CollegeStairsSecondFloor);
@@ -375,23 +375,23 @@ void IgorEngine::PART_31() {
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part31ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part31UpdateBackground;
+ part31ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
_gameState.unk10 = 4;
- PART_31_HELPER_2_drawJohnnyFrame(_gameState.unk10);
+ part31DrawJohnnyFrame(_gameState.unk10);
fadeIn(768);
if (_currentPart == 310) {
- PART_31_HELPER_3_enterFromLeft();
+ part31EnterFromLeft();
} else if (_currentPart == 311) {
- PART_31_HELPER_4_enterFromAstronomyLab();
+ part31EnterFromAstronomyLab();
} else if (_currentPart == 312) {
- PART_31_HELPER_5_enterFromDownstairs();
+ part31EnterFromDownstairs();
} else if (_currentPart == 313) {
- PART_31_HELPER_6_enterFromRight();
+ part31EnterFromRight();
}
enterPartLoop();
}
diff --git a/engines/igor/parts/part_32.cpp b/engines/igor/parts/part_32.cpp
index a539e3ee42a..345fe611b5c 100644
--- a/engines/igor/parts/part_32.cpp
+++ b/engines/igor/parts/part_32.cpp
@@ -87,7 +87,7 @@ static const int kPart32SpeakerAY = 70;
static const int kPart32SpeakerBX = 166;
static const int kPart32SpeakerBY = 67;
-void IgorEngine::PART_32_EXEC_ACTION(int action) {
+void IgorEngine::part32ExecuteAction(int action) {
switch (action) {
case 101:
_currentPart = 311;
@@ -96,7 +96,7 @@ void IgorEngine::PART_32_EXEC_ACTION(int action) {
igorSay(201, 1, 828);
break;
case 103:
- PART_32_ACTION_103_useControls();
+ part32UseControls();
break;
case 104:
igorSay(202, 2, 829);
@@ -105,16 +105,16 @@ void IgorEngine::PART_32_EXEC_ACTION(int action) {
igorSay(204, 2, 830);
break;
case 106:
- PART_32_ACTION_106_walkToControls();
+ part32WalkToControls();
break;
default:
- error("PART_32_EXEC_ACTION unhandled action %d", action);
+ error("part32ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_32_walkIn() {
+void IgorEngine::part32WalkIn() {
WalkData *wd = &_walkData[0];
wd->setPos(0, 143, kFacingPositionLeft, 0);
wd->clipSkipX = 11;
@@ -133,7 +133,7 @@ void IgorEngine::PART_32_walkIn() {
waitForIgorMove();
}
-void IgorEngine::PART_32_ACTION_106_walkToControls() {
+void IgorEngine::part32WalkToControls() {
if (_gameState.igorMoving) {
_walkDataLastIndex = _walkDataCurrentIndex + 1;
_walkData[_walkDataCurrentIndex].frameNum = 0;
@@ -149,20 +149,20 @@ void IgorEngine::PART_32_ACTION_106_walkToControls() {
_gameState.igorMoving = true;
waitForIgorMove();
}
- PART_32_ACTION_103_useControls();
+ part32UseControls();
}
/**
* The room is faded out and its screen and palette are kept; the control panel takes the screen and, depending
* on the coordinates that were set, a scene follows. Then the room is loaded again and faded in.
*/
-void IgorEngine::PART_32_ACTION_103_useControls() {
+void IgorEngine::part32UseControls() {
fadeOut(624);
memcpy(_animFramesBuffer, _screenVGA, 64000);
memcpy(_animFramesBuffer + 64000, _paletteBuffer, 768);
- PART_32_controls();
+ part32Controls();
if (_part32Result >= kPart32ResultTower && _part32Result <= kPart32ResultChick) {
- PART_32_SCENE();
+ part32Scene();
}
loadRoomData(PAL_Part32, IMG_Part32, BOX_Part32, MSK_Part32, TXT_Part32);
memcpy(_screenVGA, _animFramesBuffer, 64000);
@@ -189,11 +189,11 @@ void IgorEngine::PART_32_ACTION_103_useControls() {
}
}
-void IgorEngine::PART_32_CONTROLS_copyColor(int dstColor, int srcColor) {
+void IgorEngine::part32CopyControlColor(int dstColor, int srcColor) {
memcpy(_currentPalette + dstColor * 3, _currentPalette + srcColor * 3, 3);
}
-int IgorEngine::PART_32_CONTROLS_KEY_AT_CURSOR() const {
+int IgorEngine::part32ControlKeyAtCursor() const {
const int x = _inputVars[kInputCursorXPos];
const int y = _inputVars[kInputCursorYPos];
if (x < 0 || x >= 320 || y < 0 || y >= 144) {
@@ -202,26 +202,26 @@ int IgorEngine::PART_32_CONTROLS_KEY_AT_CURSOR() const {
return _screenLayer2[y * 320 + x];
}
-void IgorEngine::PART_32_drawDigit(int fieldOffset, int index, int key) {
+void IgorEngine::part32DrawDigit(int fieldOffset, int index, int key) {
copyArea(_screenVGA, fieldOffset + index * kPart32DigitPitch, 320, _part32Glyphs + (key - 1) * kPart32GlyphSize,
kPart32GlyphWidth, kPart32GlyphWidth, kPart32GlyphHeight);
}
-void IgorEngine::PART_32_eraseDigit(int fieldOffset, int index) {
+void IgorEngine::part32EraseDigit(int fieldOffset, int index) {
for (int row = 0; row < kPart32GlyphHeight; ++row) {
memset(_screenVGA + fieldOffset + index * kPart32DigitPitch + row * 320, 0, kPart32GlyphWidth);
}
}
-void IgorEngine::PART_32_controlsIdle(int fieldColor) {
+void IgorEngine::part32ControlsIdle(int fieldColor) {
if (_inputVars[kInputEscape]) {
- PART_32_exitControls();
+ part32ExitControls();
}
if (compareGameTick(0)) {
if (_part32Blink == 1) {
- PART_32_CONTROLS_copyColor(fieldColor, kPart32FieldColor);
+ part32CopyControlColor(fieldColor, kPart32FieldColor);
} else if (_part32Blink == 2) {
- PART_32_CONTROLS_copyColor(fieldColor, 0);
+ part32CopyControlColor(fieldColor, 0);
}
setPaletteRange(fieldColor, fieldColor);
_part32Blink = _part32Blink == 1 ? 2 : 1;
@@ -229,25 +229,25 @@ void IgorEngine::PART_32_controlsIdle(int fieldColor) {
waitForTimer();
}
-void IgorEngine::PART_32_exitControls() {
+void IgorEngine::part32ExitControls() {
playSound(getRandomNumber(1) + 0x42, 1);
- PART_32_CONTROLS_copyColor(kPart32DeclinationColor, kPart32FieldColor);
- PART_32_CONTROLS_copyColor(kPart32AscensionColor, kPart32FieldColor);
+ part32CopyControlColor(kPart32DeclinationColor, kPart32FieldColor);
+ part32CopyControlColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
_part32Done = true;
}
-void IgorEngine::PART_32_CONTROLS_selectDeclination() {
+void IgorEngine::part32SelectDeclination() {
playSound(31, 1);
- PART_32_CONTROLS_copyColor(kPart32DeclinationColor, kPart32FieldColor);
- PART_32_CONTROLS_copyColor(kPart32AscensionColor, kPart32FieldColor);
+ part32CopyControlColor(kPart32DeclinationColor, kPart32FieldColor);
+ part32CopyControlColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32AscensionColor, kPart32AscensionColor);
_part32Blink = 2;
do {
if (_inputVars[kInputClick]) {
_inputVars[kInputClick] = 0;
- const int key = PART_32_CONTROLS_KEY_AT_CURSOR();
+ const int key = part32ControlKeyAtCursor();
if (key != kPart32KeyAscension) {
playSound(getRandomNumber(1) + 0x42, 1);
}
@@ -256,7 +256,7 @@ void IgorEngine::PART_32_CONTROLS_selectDeclination() {
if (_part32DeclinationIndex == 1 && _part32DeclinationDigits[0] == 9 && key < 10) {
continue;
}
- PART_32_drawDigit(kPart32DeclinationDigitsOffset, _part32DeclinationIndex, key);
+ part32DrawDigit(kPart32DeclinationDigitsOffset, _part32DeclinationIndex, key);
_part32DeclinationDigits[_part32DeclinationIndex] = key % 10;
if (_part32DeclinationIndex < 1) {
++_part32DeclinationIndex;
@@ -265,29 +265,29 @@ void IgorEngine::PART_32_CONTROLS_selectDeclination() {
if (_part32DeclinationDigits[_part32DeclinationIndex] == 0xFF && _part32DeclinationIndex > 0) {
--_part32DeclinationIndex;
}
- PART_32_eraseDigit(kPart32DeclinationDigitsOffset, _part32DeclinationIndex);
+ part32EraseDigit(kPart32DeclinationDigitsOffset, _part32DeclinationIndex);
_part32DeclinationDigits[_part32DeclinationIndex] = 0xFF;
} else if (key == kPart32KeyAscension) {
- PART_32_CONTROLS_selectAscension();
+ part32SelectAscension();
} else if (key == kPart32KeyConfirm) {
- PART_32_CONTROLS_enterCoordinates();
+ part32EnterCoordinates();
} else if (key == kPart32KeyExit) {
- PART_32_exitControls();
+ part32ExitControls();
}
}
- PART_32_controlsIdle(kPart32DeclinationColor);
+ part32ControlsIdle(kPart32DeclinationColor);
} while (!_part32Done);
}
-void IgorEngine::PART_32_CONTROLS_selectAscension() {
+void IgorEngine::part32SelectAscension() {
playSound(31, 1);
- PART_32_CONTROLS_copyColor(kPart32DeclinationColor, kPart32FieldColor);
+ part32CopyControlColor(kPart32DeclinationColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32DeclinationColor);
_part32Blink = 2;
do {
if (_inputVars[kInputClick]) {
_inputVars[kInputClick] = 0;
- const int key = PART_32_CONTROLS_KEY_AT_CURSOR();
+ const int key = part32ControlKeyAtCursor();
if (key != kPart32KeyDeclination) {
playSound(getRandomNumber(1) + 0x42, 1);
}
@@ -302,7 +302,7 @@ void IgorEngine::PART_32_CONTROLS_selectAscension() {
if (_part32AscensionIndex == 2 && _part32AscensionDigits[0] == 3 && _part32AscensionDigits[1] == 6 && key < 10) {
continue;
}
- PART_32_drawDigit(kPart32AscensionDigitsOffset, _part32AscensionIndex, key);
+ part32DrawDigit(kPart32AscensionDigitsOffset, _part32AscensionIndex, key);
_part32AscensionDigits[_part32AscensionIndex] = key % 10;
if (_part32AscensionIndex < 2) {
++_part32AscensionIndex;
@@ -311,27 +311,27 @@ void IgorEngine::PART_32_CONTROLS_selectAscension() {
if (_part32AscensionDigits[_part32AscensionIndex] == 0xFF && _part32AscensionIndex > 0) {
--_part32AscensionIndex;
}
- PART_32_eraseDigit(kPart32AscensionDigitsOffset, _part32AscensionIndex);
+ part32EraseDigit(kPart32AscensionDigitsOffset, _part32AscensionIndex);
_part32AscensionDigits[_part32AscensionIndex] = 0xFF;
} else if (key == kPart32KeyDeclination) {
- PART_32_CONTROLS_selectDeclination();
+ part32SelectDeclination();
} else if (key == kPart32KeyConfirm) {
- PART_32_CONTROLS_enterCoordinates();
+ part32EnterCoordinates();
} else if (key == kPart32KeyExit) {
- PART_32_exitControls();
+ part32ExitControls();
}
}
- PART_32_controlsIdle(kPart32AscensionColor);
+ part32ControlsIdle(kPart32AscensionColor);
} while (!_part32Done);
}
-void IgorEngine::PART_32_CONTROLS_enterCoordinates() {
+void IgorEngine::part32EnterCoordinates() {
playSound(getRandomNumber(1) + 0x42, 1);
- PART_32_CONTROLS_copyColor(kPart32DeclinationColor, kPart32FieldColor);
- PART_32_CONTROLS_copyColor(kPart32AscensionColor, kPart32FieldColor);
+ part32CopyControlColor(kPart32DeclinationColor, kPart32FieldColor);
+ part32CopyControlColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
- const int declination = PART_32_CONTROLS_animateDeclination();
- const int ascension = PART_32_CONTROLS_animateAscension();
+ const int declination = part32AnimateDeclination();
+ const int ascension = part32AnimateAscension();
waitForTimer(100);
if (declination == kPart32TowerDeclination && ascension == kPart32TowerAscension) {
_part32Result = kPart32ResultTower;
@@ -343,7 +343,7 @@ void IgorEngine::PART_32_CONTROLS_enterCoordinates() {
_part32Done = true;
}
-int IgorEngine::PART_32_CONTROLS_animateDeclination() {
+int IgorEngine::part32AnimateDeclination() {
playSound(30, 1);
uint8 *digits = _part32DeclinationDigits;
if (digits[1] == 0xFF) {
@@ -368,7 +368,7 @@ int IgorEngine::PART_32_CONTROLS_animateDeclination() {
return declination;
}
-int IgorEngine::PART_32_CONTROLS_animateAscension() {
+int IgorEngine::part32AnimateAscension() {
playSound(30, 1);
uint8 *digits = _part32AscensionDigits;
if (digits[2] == 0xFF) {
@@ -409,7 +409,7 @@ int IgorEngine::PART_32_CONTROLS_animateAscension() {
/**
* The picture with the digit boxes.
*/
-void IgorEngine::PART_32_controls() {
+void IgorEngine::part32Controls() {
loadData(PAL_Part32Lock, _paletteBuffer);
loadData(IMG_Part32Lock, _screenLayer1);
uint8 *mask = loadData(MSK_Part32Lock);
@@ -430,26 +430,26 @@ void IgorEngine::PART_32_controls() {
do {
if (_inputVars[kInputClick] && _inputVars[kInputCursorYPos] < 144) {
_inputVars[kInputClick] = 0;
- switch (PART_32_CONTROLS_KEY_AT_CURSOR()) {
+ switch (part32ControlKeyAtCursor()) {
case kPart32KeyDeclination:
- PART_32_CONTROLS_selectDeclination();
+ part32SelectDeclination();
break;
case kPart32KeyAscension:
- PART_32_CONTROLS_selectAscension();
+ part32SelectAscension();
break;
case kPart32KeyConfirm:
- PART_32_CONTROLS_enterCoordinates();
+ part32EnterCoordinates();
break;
case kPart32KeyExit:
- PART_32_exitControls();
+ part32ExitControls();
break;
}
}
if (_inputVars[kInputEscape]) {
- PART_32_exitControls();
+ part32ExitControls();
}
- PART_32_CONTROLS_copyColor(kPart32DeclinationColor, kPart32FieldColor);
- PART_32_CONTROLS_copyColor(kPart32AscensionColor, kPart32FieldColor);
+ part32CopyControlColor(kPart32DeclinationColor, kPart32FieldColor);
+ part32CopyControlColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
// the original polls the input here without waiting
waitForTimer();
@@ -463,7 +463,7 @@ void IgorEngine::PART_32_controls() {
/**
* The tower scenes and the girl one have their own pictures and palettes.
*/
-void IgorEngine::PART_32_loadTowerScene() {
+void IgorEngine::part32LoadTowerScene() {
loadData(PAL_Part32Tower, _paletteBuffer);
// the pictures start 1 byte into the buffer; the table of the offsets of the frames follows them
loadData(ANM_Part32Tower, _screenLayer1 + 1);
@@ -472,99 +472,99 @@ void IgorEngine::PART_32_loadTowerScene() {
free(texts);
}
-void IgorEngine::PART_32_loadGirlScene() {
+void IgorEngine::part32LoadGirlScene() {
loadData(PAL_Part32Girl, _paletteBuffer);
loadData(IMG_Part32Girl, _screenLayer1);
// the offsets of the frames, and the frames after them
loadData(ANM_Part32Girl, _screenLayer2);
}
-void IgorEngine::PART_32_drawTowerConversationFrame(int frame) {
+void IgorEngine::part32DrawTowerConversationFrame(int frame) {
const uint8 *src = _screenLayer1 + READ_LE_UINT16(_screenLayer1 + kPart32TowerFramesTable + frame * 2);
decodeAnimFrame(src, _screenVGA, true);
}
-void IgorEngine::PART_32_updateDialogueSpeakerA(int action) {
+void IgorEngine::part32UpdateSpeakerADialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_32_drawTowerConversationFrame(9);
+ part32DrawTowerConversationFrame(9);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_32_drawTowerConversationFrame(getRandomNumber(4) + 9);
+ part32DrawTowerConversationFrame(getRandomNumber(4) + 9);
break;
}
}
-void IgorEngine::PART_32_updateDialogueSpeakerB(int action) {
+void IgorEngine::part32UpdateSpeakerBDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_32_drawTowerConversationFrame(4);
+ part32DrawTowerConversationFrame(4);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_32_drawTowerConversationFrame(getRandomNumber(4) + 4);
+ part32DrawTowerConversationFrame(getRandomNumber(4) + 4);
break;
}
}
-void IgorEngine::PART_32_speakerASays(const Common::Array<DialogueText> &lines) {
+void IgorEngine::part32SaySpeakerA(const Common::Array<DialogueText> &lines) {
cutsceneSayWithCallback(kPart32SpeakerAX, kPart32SpeakerAY, 63, 59, 0, lines,
- &IgorEngine::PART_32_updateDialogueSpeakerA);
+ &IgorEngine::part32UpdateSpeakerADialogue);
}
-void IgorEngine::PART_32_speakerBSays(const Common::Array<DialogueText> &lines) {
+void IgorEngine::part32SaySpeakerB(const Common::Array<DialogueText> &lines) {
cutsceneSayWithCallback(kPart32SpeakerBX, kPart32SpeakerBY, 63, 21, 21, lines,
- &IgorEngine::PART_32_updateDialogueSpeakerB);
+ &IgorEngine::part32UpdateSpeakerBDialogue);
}
/**
* The scene of the coordinates that were set.
*/
-void IgorEngine::PART_32_SCENE() {
+void IgorEngine::part32Scene() {
const bool tower = _part32Result != kPart32ResultChick;
if (tower) {
- PART_32_loadTowerScene();
+ part32LoadTowerScene();
} else {
- PART_32_loadGirlScene();
+ part32LoadGirlScene();
}
memset(_screenVGA, 0, 46080);
switch (_part32Result) {
case kPart32ResultTower:
if (_objectsState[kBellTowerConversationSeenStateIndex] == 0 && _objectsState[kAstronomyBookStateIndex] == 2) {
- PART_32_sceneTowerConversation();
+ part32SceneTowerConversation();
} else {
- PART_32_sceneTowerEmpty();
+ part32SceneTowerEmpty();
}
break;
case kPart32ResultNothing:
- PART_32_sceneNothing();
+ part32SceneNothing();
break;
case kPart32ResultChick:
- PART_32_sceneGirl();
+ part32SceneGirl();
break;
}
fadeOut(tower ? 624 : 768);
}
-void IgorEngine::PART_32_sceneTowerConversation() {
- PART_32_drawTowerConversationFrame(2);
- PART_32_drawTowerConversationFrame(3);
+void IgorEngine::part32SceneTowerConversation() {
+ part32DrawTowerConversationFrame(2);
+ part32DrawTowerConversationFrame(3);
fadeIn(624);
- PART_32_speakerASays({ { 201, 2, 835 } });
- PART_32_speakerBSays({ { 203, 1, 836 }, { 204, 1, 837 }, { 205, 1, 838 }, { 206, 2, 839 } });
- PART_32_speakerASays({ { 208, 1, 840 } });
- PART_32_speakerBSays({ { 209, 2, 841 }, { 211, 1, 842 } });
- PART_32_speakerASays({ { 212, 1, 843 } });
- PART_32_speakerBSays({ { 213, 2, 844 }, { 215, 2, 845 } });
- PART_32_speakerASays({ { 217, 1, 846 } });
- PART_32_speakerBSays({ { 218, 1, 847 }, { 219, 2, 848 }, { 221, 1, 849 }, { 222, 2, 850 } });
- PART_32_speakerASays({ { 224, 1, 851 } });
+ part32SaySpeakerA({ { 201, 2, 835 } });
+ part32SaySpeakerB({ { 203, 1, 836 }, { 204, 1, 837 }, { 205, 1, 838 }, { 206, 2, 839 } });
+ part32SaySpeakerA({ { 208, 1, 840 } });
+ part32SaySpeakerB({ { 209, 2, 841 }, { 211, 1, 842 } });
+ part32SaySpeakerA({ { 212, 1, 843 } });
+ part32SaySpeakerB({ { 213, 2, 844 }, { 215, 2, 845 } });
+ part32SaySpeakerA({ { 217, 1, 846 } });
+ part32SaySpeakerB({ { 218, 1, 847 }, { 219, 2, 848 }, { 221, 1, 849 }, { 222, 2, 850 } });
+ part32SaySpeakerA({ { 224, 1, 851 } });
waitForTimer(255);
}
-void IgorEngine::PART_32_sceneTowerEmpty() {
- PART_32_drawTowerConversationFrame(2);
+void IgorEngine::part32SceneTowerEmpty() {
+ part32DrawTowerConversationFrame(2);
fadeIn(624);
waitForTimer(255);
cutsceneSayStart(160, 70, 63, 63, 63, 227, 1, 853);
@@ -573,8 +573,8 @@ void IgorEngine::PART_32_sceneTowerEmpty() {
}
-void IgorEngine::PART_32_sceneNothing() {
- PART_32_drawTowerConversationFrame(1);
+void IgorEngine::part32SceneNothing() {
+ part32DrawTowerConversationFrame(1);
fadeIn(624);
waitForTimer(255);
cutsceneSayStart(160, 70, 63, 63, 63, 225, 2, 852);
@@ -585,7 +585,7 @@ void IgorEngine::PART_32_sceneNothing() {
/**
* The animation of the girl
*/
-void IgorEngine::PART_32_sceneGirl() {
+void IgorEngine::part32SceneGirl() {
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
memcpy(_screenVGA, _screenLayer1, 46080);
@@ -599,7 +599,7 @@ void IgorEngine::PART_32_sceneGirl() {
waitForTimer(255);
}
-void IgorEngine::PART_32() {
+void IgorEngine::part32() {
playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_Part32);
@@ -607,13 +607,13 @@ void IgorEngine::PART_32() {
SET_PAL_240_48_1();
_roomDataOffsets = PART_32_ROOM_DATA_OFFSETS;
setRoomClickFix(143, 10, 120, true);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_32_EXEC_ACTION);
+ partMainSetExecuteAction(1, &IgorEngine::part32ExecuteAction);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_32_walkIn();
+ part32WalkIn();
}
enterPartLoop();
while (_currentPart == 320 && !_gameStateLoaded) {
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index c046b153510..4d9317b05d8 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -28,7 +28,7 @@ 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) {
+void IgorEngine::part33ExecuteAction(int action) {
switch (action) {
case 101: // take any book
igorSay(201, 1, 396);
@@ -55,33 +55,33 @@ void IgorEngine::PART_33_EXEC_ACTION(int action) {
igorSay(208, 1, 403);
break;
case 109: // take astronomy books
- PART_33_ACTION_109_takeAstronomyBooks();
+ part33TakeAstronomyBooks();
break;
case 110: // take philosophy books
igorSay(209, 1, 404);
break;
case 111: // talk to harrison
- PART_33_ACTION_111_talkToHarrison();
+ part33TalkToHarrison();
break;
case 112: // look at harrison
igorSay(213, 2, 407);
break;
case 113:
- PART_33_ACTION_113_walkOut();
+ part33WalkOut();
break;
case 114:
- PART_33_ACTION_114_showPhotoToHarrison();
+ part33ShowPhotoToHarrison();
break;
case 115:
- PART_33_ACTION_115_giveNoteToHarrison();
+ part33GiveNoteToHarrison();
break;
default:
- error("PART_33_EXEC_ACTION unhandled action %d", action);
+ error("part33ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_33_ACTION_109_takeAstronomyBooks() {
+void IgorEngine::part33TakeAstronomyBooks() {
if (_objectsState[kAstronomyBookStateIndex] == 0) {
igorSay(201, 1, 396);
return;
@@ -98,25 +98,25 @@ void IgorEngine::PART_33_ACTION_109_takeAstronomyBooks() {
}
addObjectToInventory(kInventoryObjectAstronomyBook, 66);
_objectsState[kAstronomyBookTakenStateIndex] = 1;
- PART_33_HELPER_1_OBJECTS_STATE(255);
+ part33ApplyObjectState(255);
igorSayAndWait({ { 210, 1, 405 }, { 211, 2, 406 } });
}
-void IgorEngine::PART_33_ACTION_111_talkToHarrison() {
+void IgorEngine::part33TalkToHarrison() {
if (_objectsState[kHarrisonPhotoStateIndex] == 1) {
- PART_33_HELPER_9_loadExtraTexts();
- PART_33_HELPER_1_OBJECTS_STATE(255);
+ part33LoadExtraTexts();
+ part33ApplyObjectState(255);
igorSayAndWait(201, 1, 447);
- PART_33_HarrisonSay({ { 202, 2, 448 }, { 204, 2, 449 } });
- loadResourceData__ROOM_Library();
- PART_33_HELPER_1_OBJECTS_STATE(255);
+ part33SayHarrison({ { 202, 2, 448 }, { 204, 2, 449 } });
+ part33LoadRoom();
+ part33ApplyObjectState(255);
} else {
- PART_33_HANDLE_DIALOGUE_HARRISON();
- PART_33_HELPER_1_OBJECTS_STATE(255);
+ part33HandleHarrisonDialogue();
+ part33ApplyObjectState(255);
}
}
-void IgorEngine::PART_33_ACTION_113_walkOut() {
+void IgorEngine::part33WalkOut() {
_walkDataCurrentIndex = 0;
for (int i = 9; i >= 0; --i) {
if (i == 9) {
@@ -139,32 +139,32 @@ void IgorEngine::PART_33_ACTION_113_walkOut() {
_currentPart = 241;
}
-void IgorEngine::PART_33_ACTION_114_showPhotoToHarrison() {
+void IgorEngine::part33ShowPhotoToHarrison() {
copyArea(_screenVGA, 26279, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
igorSayAndWait(223, 1, 414);
- PART_33_HarrisonSay({ { 224, 1, 415 } });
+ part33SayHarrison({ { 224, 1, 415 } });
for (int i = 2; i <= 5; ++i) {
copyArea(_screenVGA, 26279, 320, _animFramesBuffer + i * 1827 + 0x5104, 63, 62, 29);
waitForTimer(60);
}
removeObjectFromInventory(54);
- PART_33_HarrisonSay({ { 225, 1, 416 } });
+ part33SayHarrison({ { 225, 1, 416 } });
copyArea(_screenVGA, 26279, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
igorSayAndWait(226, 1, 417);
- PART_33_HarrisonSay({ { 227, 1, 418 } });
+ part33SayHarrison({ { 227, 1, 418 } });
igorSayAndWait(228, 1, 419);
- PART_33_HarrisonSay({ { 229, 2, 420 }, { 231, 2, 421 } });
+ part33SayHarrison({ { 229, 2, 420 }, { 231, 2, 421 } });
for (int i = 1; i <= 4; ++i) {
copyArea(_screenVGA, 26279, 320, _animFramesBuffer + PART_33_ANIM_DATA_5[i] * 1827 + 0x5104, 63, 62, 29);
waitForTimer(60);
}
addObjectToInventory(kInventoryObjectBiologyProject, 70);
- PART_33_HELPER_1_OBJECTS_STATE(255);
- PART_33_HarrisonSay({ { 233, 2, 422 } });
+ part33ApplyObjectState(255);
+ part33SayHarrison({ { 233, 2, 422 } });
_objectsState[kHarrisonPhotoStateIndex] = 1;
}
-void IgorEngine::PART_33_ACTION_115_giveNoteToHarrison() {
+void IgorEngine::part33GiveNoteToHarrison() {
const int offset = 26279;
copyArea(_screenVGA, offset, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
waitForTimer(60);
@@ -174,75 +174,75 @@ void IgorEngine::PART_33_ACTION_115_giveNoteToHarrison() {
waitForTimer(60);
}
removeObjectFromInventory(67);
- PART_33_HELPER_1_OBJECTS_STATE(255);
+ part33ApplyObjectState(255);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
- PART_33_HarrisonSay({ { 217, 2, 409 } });
+ part33SayHarrison({ { 217, 2, 409 } });
copyArea(_screenVGA, offset, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
- PART_33_HarrisonSay({ { 219, 1, 410 } });
+ part33SayHarrison({ { 219, 1, 410 } });
copyArea(_screenVGA, offset, 320, _animFramesBuffer + 0x5827, 63, 62, 29);
_objectsState[kHarrisonNoteShownStateIndex] = 1;
}
// The room's idle animation of Harrison is only driven by the room loop; the
// blocking dialogue loops never run it, otherwise it fights the talking frames.
-void IgorEngine::PART_33_HarrisonSay(const Common::Array<DialogueText> &lines) {
+void IgorEngine::part33SayHarrison(const Common::Array<DialogueText> &lines) {
const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
_updateRoomBackground = 0;
- cutsceneSayWithCallback(47, 82, 0, 58, 40, lines, &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2);
+ cutsceneSayWithCallback(47, 82, 0, 58, 40, lines, &IgorEngine::part33UpdateHarrisonHeadDialogue);
_updateRoomBackground = updateRoomBackground;
}
-void IgorEngine::PART_33_HANDLE_DIALOGUE_HARRISON() {
+void IgorEngine::part33HandleHarrisonDialogue() {
const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
_updateRoomBackground = 0;
loadDialogueData(DLG_Library);
- _updateDialogue = &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_3;
+ _updateDialogue = &IgorEngine::part33UpdateHarrisonHeadDialogueWithStanding;
handleDialogue(47, 82, 0, 58, 40);
_updateDialogue = 0;
_updateRoomBackground = updateRoomBackground;
}
-void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_1(int action) {
+void IgorEngine::part33UpdateHarrisonBodyDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_33_HELPER_4_drawHarrisonBodyFrame(1);
+ part33DrawHarrisonBodyFrame(1);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_33_HELPER_4_drawHarrisonBodyFrame(getRandomNumber(3) + 2);
+ part33DrawHarrisonBodyFrame(getRandomNumber(3) + 2);
break;
}
}
-void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_2(int action) {
+void IgorEngine::part33UpdateHarrisonHeadDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_33_HELPER_5_drawHarrisonHeadFrame(4);
+ part33DrawHarrisonHeadFrame(4);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_33_HELPER_5_drawHarrisonHeadFrame(4 + getRandomNumber(2));
+ part33DrawHarrisonHeadFrame(4 + getRandomNumber(2));
break;
}
}
-void IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_3(int action) {
+void IgorEngine::part33UpdateHarrisonHeadDialogueWithStanding(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_33_HELPER_5_drawHarrisonHeadFrame(4);
+ part33DrawHarrisonHeadFrame(4);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_33_HELPER_5_drawHarrisonHeadFrame(4 + getRandomNumber(2));
+ part33DrawHarrisonHeadFrame(4 + getRandomNumber(2));
break;
case kUpdateDialogueAnimStanding:
- PART_33_HELPER_5_drawHarrisonHeadFrame(4);
+ part33DrawHarrisonHeadFrame(4);
break;
}
}
-void IgorEngine::PART_33_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part33UpdateBackground() {
if (compareGameTick(61) && _objectsState[kHarrisonPhotoStateIndex] != 2) {
- PART_33_HELPER_5_drawHarrisonHeadFrame(_gameState.unk10);
+ part33DrawHarrisonHeadFrame(_gameState.unk10);
_gameState.unk10 = getRandomNumber(3) + 1;
if (_gameState.unk10 >= 1 && _gameState.unk10 <= 2) {
_gameState.unk10 = 1;
@@ -252,24 +252,24 @@ void IgorEngine::PART_33_UPDATE_ROOM_BACKGROUND() {
}
}
-void IgorEngine::PART_33_HELPER_1_OBJECTS_STATE(int num) {
+void IgorEngine::part33ApplyObjectState(int num) {
if (num == 2 || num == 255) {
// is harrison here or not
if (_objectsState[kHarrisonPhotoStateIndex] <= 1) {
- PART_33_HELPER_3_drawHarrisonFrame();
+ part33DrawHarrisonFrame();
} else {
_roomObjectAreasTable[27].object = 0;
}
}
}
-void IgorEngine::PART_33_HELPER_2_HarrisonWalksOut() {
+void IgorEngine::part33HarrisonWalksOut() {
memcpy(_screenLayer2, _screenVGA, 46080);
memcpy(_screenVGA, _screenLayer1, 46080);
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5255) - 1, _screenVGA, true);
memcpy(_screenLayer1, _screenVGA, 46080);
fadeIn(624);
- cutsceneSayWithCallback(92, 79, 0, 58, 40, { { 220, 1, 411 }, { 221, 1, 412 } }, &IgorEngine::PART_33_UPDATE_DIALOGUE_HARRISON_1);
+ cutsceneSayWithCallback(92, 79, 0, 58, 40, { { 220, 1, 411 }, { 221, 1, 412 } }, &IgorEngine::part33UpdateHarrisonBodyDialogue);
// Harrison walks out
for (int i = 6; i <= 25; ++i) {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5253 + i * 2) - 1, _screenVGA, true);
@@ -278,11 +278,11 @@ void IgorEngine::PART_33_HELPER_2_HarrisonWalksOut() {
fadeOut(624);
}
-void IgorEngine::PART_33_HELPER_4_drawHarrisonBodyFrame(int frame) {
+void IgorEngine::part33DrawHarrisonBodyFrame(int frame) {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5253 + frame * 2) - 1, _screenVGA, true);
}
-void IgorEngine::PART_33_HELPER_5_drawHarrisonHeadFrame(int frame) {
+void IgorEngine::part33DrawHarrisonHeadFrame(int frame) {
_roomCursorOn = false;
for (int i = 0; i <= 14; ++i) {
for (int j = 0; j <= 15; ++j) {
@@ -305,7 +305,7 @@ void IgorEngine::PART_33_HELPER_5_drawHarrisonHeadFrame(int frame) {
}
-void IgorEngine::PART_33_HELPER_7_walkIn() {
+void IgorEngine::part33WalkIn() {
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
_walkCurrentPos = 1;
@@ -334,40 +334,40 @@ void IgorEngine::PART_33_HELPER_7_walkIn() {
waitForIgorMove();
}
-void IgorEngine::PART_33_HELPER_3_drawHarrisonFrame() {
+void IgorEngine::part33DrawHarrisonFrame() {
const int offset = 29479;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x5287, 16, 16, 15);
}
-void IgorEngine::PART_33_HELPER_9_loadExtraTexts() {
+void IgorEngine::part33LoadExtraTexts() {
uint8 *p = loadData(TXT_Library2);
decodeRoomStrings(p, true);
free(p);
}
-void IgorEngine::PART_33() {
+void IgorEngine::part33() {
if (_currentPart != 331) {
playMusic(2);
}
_gameState.enableLight = 1;
_gameState.unk10 = 1;
- loadResourceData__ROOM_Library();
- loadResourceData__ANIM_Library();
+ part33LoadRoom();
+ part33LoadAnimation();
loadActionData(DAT_Library);
_roomDataOffsets = PART_33_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 276, 143);
if (_currentPart == 331) {
- PART_33_HELPER_2_HarrisonWalksOut();
+ part33HarrisonWalksOut();
return;
}
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_33_EXEC_ACTION);
- _updateRoomBackground = &IgorEngine::PART_33_UPDATE_ROOM_BACKGROUND;
- PART_33_HELPER_1_OBJECTS_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part33ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part33UpdateBackground;
+ part33ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_33_HELPER_7_walkIn();
+ part33WalkIn();
enterPartLoop();
}
while (_currentPart == 330 && !_gameStateLoaded) {
@@ -384,11 +384,11 @@ void IgorEngine::PART_33() {
_updateRoomBackground = 0;
}
-void IgorEngine::loadResourceData__ROOM_Library() {
+void IgorEngine::part33LoadRoom() {
loadRoomData(PAL_Library, IMG_Library, BOX_Library, MSK_Library, TXT_Library);
}
-void IgorEngine::loadResourceData__ANIM_Library() {
+void IgorEngine::part33LoadAnimation() {
static const int anm[] = { FRM_Library1, FRM_Library2, FRM_Library3, FRM_Library4, FRM_Library5, 0 };
loadAnimData(anm);
}
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index 73c52065bd3..e5e37d6fe63 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -59,14 +59,14 @@ static const uint8 kOldLadyBagFrames[] = { 11, 15, 16, 6, 17, 1 };
/**
* Draws a frame of FRM_Park1 (old lady and Igor) preserving the dialogue text colors.
*/
-void IgorEngine::PARK_DRAW_drawOldLadyFrame(uint8 *dst, int frame) {
+void IgorEngine::part34And35DrawOldLadyFrame(uint8 *dst, int frame) {
decodeAnimFrame(getAnimFrame(kParkFrames, kParkFrameTable, frame), dst, true);
}
/**
* Draws a frame of FRM_ParkLaura1 on the screen preserving the dialogue text colors.
*/
-void IgorEngine::PARK_DRAW_LAURA_FRAME(int frame) {
+void IgorEngine::part34DrawLauraFrame(int frame) {
decodeAnimFrame(getAnimFrame(kParkLauraFrames, kParkLauraFrameTable, frame), _screenVGA, true);
}
@@ -74,7 +74,7 @@ void IgorEngine::PARK_DRAW_LAURA_FRAME(int frame) {
* Plays the pick up animation, one raw 27x49 frame at a time. The first row of every frame is
* not drawn.
*/
-void IgorEngine::PARK_PICK_UP_ANIMATION(int screenOffset, int framesOffset) {
+void IgorEngine::part34And35PickUpAnimation(int screenOffset, int framesOffset) {
for (uint i = 0; i < ARRAYSIZE(kPickUpFrames); ++i) {
drawAnimRect(screenOffset + 320, framesOffset + kPickUpFrames[i] * 1323 + 27, 27, 48);
waitForTimer(30);
@@ -84,7 +84,7 @@ void IgorEngine::PARK_PICK_UP_ANIMATION(int screenOffset, int framesOffset) {
/**
* Birds chirp.
*/
-void IgorEngine::PARK_UPDATE_AMBIENT_SOUND() {
+void IgorEngine::part34And35UpdateAmbientSound() {
if (compareGameTick(1) && getRandomNumber(14) == 0) {
switch (getRandomNumber(3)) {
case 0:
@@ -103,26 +103,26 @@ void IgorEngine::PARK_UPDATE_AMBIENT_SOUND() {
}
}
-void IgorEngine::PARK_UPDATE_DIALOGUE_LADY(int action) {
+void IgorEngine::part34UpdateLadyDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PARK_DRAW_drawOldLadyFrame(_screenVGA, 1);
+ part34And35DrawOldLadyFrame(_screenVGA, 1);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PARK_DRAW_drawOldLadyFrame(_screenVGA, getRandomNumber(4) + 1);
+ part34And35DrawOldLadyFrame(_screenVGA, getRandomNumber(4) + 1);
break;
}
}
-void IgorEngine::PARK_UPDATE_DIALOGUE_LAURA(int action) {
+void IgorEngine::part34UpdateLauraDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PARK_DRAW_LAURA_FRAME(20);
+ part34DrawLauraFrame(20);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PARK_DRAW_LAURA_FRAME(20 + getRandomNumber(5));
+ part34DrawLauraFrame(20 + getRandomNumber(5));
break;
}
}
@@ -131,7 +131,7 @@ void IgorEngine::PARK_UPDATE_DIALOGUE_LAURA(int action) {
* Copies lines of the loaded conversation replies to the dialogue texts pool and queues them
* as one dialogue text.
*/
-void IgorEngine::PARK_QUEUE_REPLY_TEXT(int reply, int count, int sound, int &textIndex) {
+void IgorEngine::part34QueueReplyText(int reply, int count, int sound, int &textIndex) {
for (int i = 0; i < count; ++i) {
Common::strlcpy(_globalDialogueTexts[textIndex + i], _dialogueReplies[reply - 1 + i],
sizeof(_globalDialogueTexts[0]));
@@ -143,36 +143,36 @@ void IgorEngine::PARK_QUEUE_REPLY_TEXT(int reply, int count, int sound, int &tex
/**
* Igor's blocking dialogues do not run the birds' sound.
*/
-void IgorEngine::PARK_WAIT_FOR_IGOR_DIALOGUE() {
+void IgorEngine::part34WaitForIgorDialogue() {
UpdateRoomBackgroundProc roomBackground = _updateRoomBackground;
_updateRoomBackground = 0;
waitForEndOfIgorDialogue();
_updateRoomBackground = roomBackground;
}
-void IgorEngine::PARK_WAIT_FOR_LADY_DIALOGUE() {
+void IgorEngine::part34WaitForLadyDialogue() {
UpdateRoomBackgroundProc roomBackground = _updateRoomBackground;
- _updateRoomBackground = &IgorEngine::PARK_UPDATE_AMBIENT_SOUND;
- _updateDialogue = &IgorEngine::PARK_UPDATE_DIALOGUE_LADY;
+ _updateRoomBackground = &IgorEngine::part34And35UpdateAmbientSound;
+ _updateDialogue = &IgorEngine::part34UpdateLadyDialogue;
waitForEndOfCutsceneDialogue(121, 68, 63, 23, 0);
_updateDialogue = 0;
_updateRoomBackground = roomBackground;
}
-void IgorEngine::PARK_WAIT_FOR_LAURA_DIALOGUE() {
+void IgorEngine::part34WaitForLauraDialogue() {
UpdateRoomBackgroundProc roomBackground = _updateRoomBackground;
- _updateRoomBackground = &IgorEngine::PARK_UPDATE_AMBIENT_SOUND;
- _updateDialogue = &IgorEngine::PARK_UPDATE_DIALOGUE_LAURA;
+ _updateRoomBackground = &IgorEngine::part34And35UpdateAmbientSound;
+ _updateDialogue = &IgorEngine::part34UpdateLauraDialogue;
waitForEndOfCutsceneDialogue(185, 69, 63, 0, 38);
_updateDialogue = 0;
_updateRoomBackground = roomBackground;
}
-void IgorEngine::PART_34_EXEC_ACTION(int action) {
- debugC(9, kDebugGame, "PART_34_EXEC_ACTION %d", action);
+void IgorEngine::part34ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part34ExecuteAction %d", action);
// Only the birds keep chirping while an action takes over the room
UpdateRoomBackgroundProc roomBackground = _updateRoomBackground;
- _updateRoomBackground = &IgorEngine::PARK_UPDATE_AMBIENT_SOUND;
+ _updateRoomBackground = &IgorEngine::part34And35UpdateAmbientSound;
switch (action) {
case 101: // look at statue
igorSay(201, 2, 562);
@@ -180,16 +180,16 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
case 102: // look at tree
igorSay(203, 2, 563);
_objectsState[kTreeResinDiscoveredStateIndex] = 1;
- PART_34_APPLY_OBJECT_STATE(3);
+ part34ApplyObjectState(3);
break;
case 103:
- PART_34_ACTION_103_takeResin();
+ part34TakeResin();
break;
case 104: // look at roses
igorSay(205, 1, 564);
break;
case 105:
- PART_34_ACTION_105_talkToOldLady();
+ part34TalkToOldLady();
break;
case 106: // look at old lady
igorSay(206, 2, 565);
@@ -198,67 +198,67 @@ void IgorEngine::PART_34_EXEC_ACTION(int action) {
igorSay(208, 2, 566);
break;
case 108:
- PART_34_ACTION_108_giveLizardToOldLady();
+ part34GiveLizardToOldLady();
break;
case 109:
- PART_34_ACTION_109_scrollRight();
+ part34ScrollRight();
break;
default:
- warning("PART_34_EXEC_ACTION unhandled action %d", action);
+ warning("part34ExecuteAction unhandled action %d", action);
break;
}
_updateRoomBackground = roomBackground;
}
-void IgorEngine::PART_34_ACTION_103_takeResin() {
+void IgorEngine::part34TakeResin() {
if (_inventoryInfo[62] != 0) {
igorSay(210, 1, 567);
return;
}
- PARK_PICK_UP_ANIMATION(16499, kParkPickUpFrames);
+ part34And35PickUpAnimation(16499, kParkPickUpFrames);
addObjectToInventory(kInventoryObjectResin, 62);
- PART_34_APPLY_OBJECT_STATE(255);
+ part34ApplyObjectState(255);
}
-void IgorEngine::PART_34_ACTION_105_talkToOldLady() {
- PART_34_OLD_LADY_CONVERSATION();
- PART_34_APPLY_OBJECT_STATE(255);
+void IgorEngine::part34TalkToOldLady() {
+ part34OldLadyConversation();
+ part34ApplyObjectState(255);
_parkLadyIdleStep = 4;
- PART_34_oldLadyIdleAnimationFrame(4);
+ part34OldLadyIdleAnimationFrame(4);
}
-void IgorEngine::PART_34_ACTION_108_giveLizardToOldLady() {
- PARK_DRAW_drawOldLadyFrame(_screenVGA, 1);
+void IgorEngine::part34GiveLizardToOldLady() {
+ part34And35DrawOldLadyFrame(_screenVGA, 1);
igorSay(211, 2, 568);
- PARK_WAIT_FOR_IGOR_DIALOGUE();
+ part34WaitForIgorDialogue();
for (int frame = 12; frame <= 13; ++frame) {
- PARK_DRAW_drawOldLadyFrame(_screenVGA, frame);
+ part34And35DrawOldLadyFrame(_screenVGA, frame);
waitForTimer(45);
}
if (_objectsState[kLizardFedStateIndex] == 0) {
cutsceneSayStart(121, 58, 63, 23, 0, { { 213, 1, 569 }, { 216, 1, 570 } });
- PARK_WAIT_FOR_LADY_DIALOGUE();
+ part34WaitForLadyDialogue();
for (int frame = 14; frame >= 12; --frame) {
- PARK_DRAW_drawOldLadyFrame(_screenVGA, frame);
+ part34And35DrawOldLadyFrame(_screenVGA, frame);
waitForTimer(45);
}
- PARK_DRAW_drawOldLadyFrame(_screenVGA, 17);
+ part34And35DrawOldLadyFrame(_screenVGA, 17);
_parkLadyIdleStep = 1;
return;
}
cutsceneSayStart(121, 58, 63, 23, 0, { { 217, 1, 571 }, { 218, 1, 572 } });
- PARK_WAIT_FOR_LADY_DIALOGUE();
+ part34WaitForLadyDialogue();
_parkLadyIdleStep = 1;
for (uint i = 0; i < ARRAYSIZE(kOldLadyPetFrames); ++i) {
- PARK_DRAW_drawOldLadyFrame(_screenVGA, kOldLadyPetFrames[i]);
+ part34And35DrawOldLadyFrame(_screenVGA, kOldLadyPetFrames[i]);
waitForTimer(45);
}
removeObjectFromInventory(59);
cutsceneSayStart(121, 58, 63, 23, 0, { { 219, 2, 573 }, { 221, 2, 574 }, { 223, 1, 575 }, { 224, 2, 576 } });
- PARK_WAIT_FOR_LADY_DIALOGUE();
+ part34WaitForLadyDialogue();
for (uint i = 0; i < ARRAYSIZE(kOldLadyBagFrames); ++i) {
- PARK_DRAW_drawOldLadyFrame(_screenVGA, kOldLadyBagFrames[i]);
+ part34And35DrawOldLadyFrame(_screenVGA, kOldLadyBagFrames[i]);
waitForTimer(30);
}
while (isDialogueSpeechPlaying() && !_eventQuitGame) {
@@ -266,54 +266,54 @@ void IgorEngine::PART_34_ACTION_108_giveLizardToOldLady() {
}
addObjectToInventory(kInventoryObjectRocket, 61);
igorSay(226, 1, 577);
- PARK_WAIT_FOR_IGOR_DIALOGUE();
+ part34WaitForIgorDialogue();
cutsceneSayStart(121, 58, 63, 23, 0, { { 227, 2, 578 }, { 229, 1, 579 } });
- PARK_WAIT_FOR_LADY_DIALOGUE();
+ part34WaitForLadyDialogue();
igorSay(230, 1, 580);
- PARK_WAIT_FOR_IGOR_DIALOGUE();
+ part34WaitForIgorDialogue();
for (int frame = 18; frame <= 31; ++frame) {
- PARK_DRAW_drawOldLadyFrame(_screenVGA, frame);
+ part34And35DrawOldLadyFrame(_screenVGA, frame);
waitForTimer(30);
}
_objectsState[kLizardGivenStateIndex] = 1;
- PART_34_LAURA_CONVERSATION();
+ part34LauraConversation();
loadActionData(DAT_ParkLeft);
loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park);
SET_PAL_240_48_1();
static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
loadAnimData(frames, kParkFrames);
- PART_34_APPLY_OBJECT_STATE(255);
+ part34ApplyObjectState(255);
}
-void IgorEngine::PART_34_OLD_LADY_CONVERSATION() {
+void IgorEngine::part34OldLadyConversation() {
_roomDataOffsets.dlg = kOldLadyDialogueData;
loadDialogueData(DLG_ParkLady);
if (_objectsState[kOldLadyConversationSeenStateIndex] == 0) {
memset(_screenVGA + 46080, 0, 17920);
}
int textIndex = 250;
- PARK_QUEUE_REPLY_TEXT(1, 1, 584, textIndex);
+ part34QueueReplyText(1, 1, 584, textIndex);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(160, 58, 63, 63, 63);
- PARK_WAIT_FOR_IGOR_DIALOGUE();
+ part34WaitForIgorDialogue();
if (_objectsState[kOldLadyConversationSeenStateIndex] == 0) {
textIndex = 250;
- PARK_QUEUE_REPLY_TEXT(2, 1, 585, textIndex);
- PARK_QUEUE_REPLY_TEXT(3, 1, 586, textIndex);
+ part34QueueReplyText(2, 1, 585, textIndex);
+ part34QueueReplyText(3, 1, 586, textIndex);
SET_DIALOGUE_TEXT(1, 2);
startCutsceneDialogue(121, 68, 63, 23, 0);
- PARK_WAIT_FOR_LADY_DIALOGUE();
- _updateDialogue = &IgorEngine::PARK_UPDATE_DIALOGUE_LADY;
+ part34WaitForLadyDialogue();
+ _updateDialogue = &IgorEngine::part34UpdateLadyDialogue;
handleDialogue(121, 68, 63, 23, 0, false);
_updateDialogue = 0;
}
textIndex = 250;
- PARK_QUEUE_REPLY_TEXT(4, 2, 587, textIndex);
+ part34QueueReplyText(4, 2, 587, textIndex);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(121, 68, 63, 23, 0);
- PARK_WAIT_FOR_LADY_DIALOGUE();
+ part34WaitForLadyDialogue();
if (_objectsState[kOldLadyConversationSeenStateIndex] == 0) {
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
@@ -327,7 +327,7 @@ void IgorEngine::PART_34_OLD_LADY_CONVERSATION() {
/**
* Laura walks into the park, talks with Igor and leaves.
*/
-void IgorEngine::PART_34_LAURA_CONVERSATION() {
+void IgorEngine::part34LauraConversation() {
static const int frames[] = { FRM_ParkLaura1, FRM_ParkLaura2, FRM_ParkLaura3, 0 };
loadAnimData(frames, kParkLauraFrames);
memcpy(_paletteBuffer + 176 * 3, _animFramesBuffer + kParkLauraPalette, 48);
@@ -338,50 +338,50 @@ void IgorEngine::PART_34_LAURA_CONVERSATION() {
loadDialogueData(DLG_ParkLaura);
memset(_screenVGA + 46080, 0, 17920);
for (int frame = 1; frame <= 19; ++frame) {
- PARK_DRAW_LAURA_FRAME(frame);
+ part34DrawLauraFrame(frame);
waitForTimer(30);
}
int textIndex = 250;
- PARK_QUEUE_REPLY_TEXT(1, 1, 600, textIndex);
+ part34QueueReplyText(1, 1, 600, textIndex);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(185, 69, 63, 0, 38);
- PARK_WAIT_FOR_LAURA_DIALOGUE();
+ part34WaitForLauraDialogue();
for (int frame = 26; frame <= 29; ++frame) {
- PARK_DRAW_LAURA_FRAME(frame);
+ part34DrawLauraFrame(frame);
waitForTimer(5);
}
textIndex = 250;
- PARK_QUEUE_REPLY_TEXT(2, 1, 601, textIndex);
+ part34QueueReplyText(2, 1, 601, textIndex);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(162, 64, 63, 63, 63);
WalkData *wd = &_walkData[_walkDataLastIndex - 1];
wd->x = 162;
wd->y = 117;
wd->posNum = kFacingPositionRight;
- PARK_WAIT_FOR_IGOR_DIALOGUE();
+ part34WaitForIgorDialogue();
textIndex = 250;
- PARK_QUEUE_REPLY_TEXT(3, 1, 602, textIndex);
+ part34QueueReplyText(3, 1, 602, textIndex);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(185, 69, 63, 0, 38);
- PARK_WAIT_FOR_LAURA_DIALOGUE();
- _updateDialogue = &IgorEngine::PARK_UPDATE_DIALOGUE_LAURA;
+ part34WaitForLauraDialogue();
+ _updateDialogue = &IgorEngine::part34UpdateLauraDialogue;
handleDialogue(185, 69, 63, 0, 38, false);
_updateDialogue = 0;
- PARK_DRAW_LAURA_FRAME(29);
+ part34DrawLauraFrame(29);
textIndex = 250;
- PARK_QUEUE_REPLY_TEXT(4, 1, 603, textIndex);
+ part34QueueReplyText(4, 1, 603, textIndex);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(162, 64, 63, 63, 63);
- PARK_WAIT_FOR_IGOR_DIALOGUE();
+ part34WaitForIgorDialogue();
for (int frame = 31; frame <= 57; ++frame) {
- PARK_DRAW_LAURA_FRAME(frame);
+ part34DrawLauraFrame(frame);
waitForTimer(30);
}
textIndex = 250;
- PARK_QUEUE_REPLY_TEXT(5, 1, 604, textIndex);
+ part34QueueReplyText(5, 1, 604, textIndex);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(162, 64, 63, 63, 63);
- PARK_WAIT_FOR_IGOR_DIALOGUE();
+ part34WaitForIgorDialogue();
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
@@ -389,7 +389,7 @@ void IgorEngine::PART_34_LAURA_CONVERSATION() {
_roomDataOffsets.dlg = kNoDialogueData;
}
-void IgorEngine::PART_34_ACTION_109_scrollRight() {
+void IgorEngine::part34ScrollRight() {
int xPos = 240;
const int yPos = 124;
int step = 1;
@@ -429,10 +429,10 @@ void IgorEngine::PART_34_ACTION_109_scrollRight() {
/**
* Redraws the old lady if she is in the park and updates the state dependent objects.
*/
-void IgorEngine::PART_34_APPLY_OBJECT_STATE(int num) {
+void IgorEngine::part34ApplyObjectState(int num) {
if (num == 1 || num == 255) {
if (_objectsState[kLizardGivenStateIndex] == 0 && _objectsState[kLauraMetAtCollegeStateIndex] == 1) {
- PARK_DRAW_drawOldLadyFrame(_screenLayer1, 1);
+ part34And35DrawOldLadyFrame(_screenLayer1, 1);
} else {
_roomObjectAreasTable[5].object = 0;
}
@@ -442,19 +442,19 @@ void IgorEngine::PART_34_APPLY_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_34_oldLadyIdleAnimationFrame(int step) {
+void IgorEngine::part34OldLadyIdleAnimationFrame(int step) {
drawAnimRect(73 * 320 + 112, kParkIdleFrames + kOldLadyIdleFrames[step - 1] * 630, 18, 35, true, kBlendBehindIgorAndText);
}
-void IgorEngine::PART_34_UPDATE_ROOM_BACKGROUND() {
- PARK_UPDATE_AMBIENT_SOUND();
+void IgorEngine::part34UpdateBackground() {
+ part34And35UpdateAmbientSound();
if (compareGameTick(61) && _objectsState[kLizardGivenStateIndex] == 0 && _objectsState[kLauraMetAtCollegeStateIndex] == 1 && getRandomNumber(4) == 0) {
- PART_34_oldLadyIdleAnimationFrame(_parkLadyIdleStep);
+ part34OldLadyIdleAnimationFrame(_parkLadyIdleStep);
_parkLadyIdleStep = (_parkLadyIdleStep == 6) ? 1 : _parkLadyIdleStep + 1;
}
}
-void IgorEngine::PART_34() {
+void IgorEngine::part34() {
playMusic(1);
_gameState.enableLight = 1;
loadActionData(DAT_ParkLeft);
@@ -465,12 +465,12 @@ void IgorEngine::PART_34() {
loadAnimData(frames, kParkFrames);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_34_EXEC_ACTION);
- _updateRoomBackground = &IgorEngine::PART_34_UPDATE_ROOM_BACKGROUND;
+ partMainSetExecuteAction(1, &IgorEngine::part34ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part34UpdateBackground;
_parkLadyIdleStep = 1;
_roomDataOffsets = PART_34_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
- PART_34_APPLY_OBJECT_STATE(255);
+ part34ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
_walkDataLastIndex = 1;
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index d299abf5ebd..d982c15227a 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -24,16 +24,16 @@
namespace Igor {
-void IgorEngine::PART_35_EXEC_ACTION(int action) {
- debugC(9, kDebugGame, "PART_35_EXEC_ACTION %d", action);
+void IgorEngine::part35ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part35ExecuteAction %d", action);
switch (action) {
case 101: // look at tree
igorSay(201, 2, 611);
_objectsState[kTreeResinDiscoveredStateIndex] = 1;
- PART_35_APPLY_OBJECT_STATE(3);
+ part35ApplyObjectState(3);
break;
case 102: // take resin
- PART_35_ACTION_102_takeResin();
+ part35TakeResin();
break;
case 103: // look at resin
igorSay(203, 1, 612);
@@ -45,28 +45,28 @@ void IgorEngine::PART_35_EXEC_ACTION(int action) {
igorSay(205, 1, 614);
break;
case 106:
- PART_35_ACTION_106_exitToMap();
+ part35ExitToMap();
break;
case 107:
- PART_35_ACTION_107_scrollLeft();
+ part35ScrollLeft();
break;
default:
- warning("PART_35_EXEC_ACTION unhandled action %d", action);
+ warning("part35ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_35_ACTION_102_takeResin() {
+void IgorEngine::part35TakeResin() {
if (_inventoryInfo[62] != 0) {
igorSay(206, 1, 615);
return;
}
- PARK_PICK_UP_ANIMATION(16339, kParkFrames);
+ part34And35PickUpAnimation(16339, kParkFrames);
addObjectToInventory(kInventoryObjectResin, 62);
- PART_35_APPLY_OBJECT_STATE(255);
+ part35ApplyObjectState(255);
}
-void IgorEngine::PART_35_ACTION_107_scrollLeft() {
+void IgorEngine::part35ScrollLeft() {
int xPos = 183;
const int yPos = 124;
int step = 1;
@@ -103,7 +103,7 @@ void IgorEngine::PART_35_ACTION_107_scrollLeft() {
_currentPart = 340;
}
-void IgorEngine::PART_35_ACTION_106_exitToMap() {
+void IgorEngine::part35ExitToMap() {
--_walkDataLastIndex;
const uint8 area = _screenLayer2[10879]; // (319, 33)
_roomObjectAreasTable[area].area = 1;
@@ -115,13 +115,13 @@ void IgorEngine::PART_35_ACTION_106_exitToMap() {
_currentPart = 40;
}
-void IgorEngine::PART_35_APPLY_OBJECT_STATE(int num) {
+void IgorEngine::part35ApplyObjectState(int num) {
if (num == 3 || num == 255) {// disable hotspot if resin taken
_roomObjectAreasTable[7].object = (_objectsState[kTreeResinDiscoveredStateIndex] == 0) ? 1 : 2;
}
}
-void IgorEngine::PART_35() {
+void IgorEngine::part35() {
playMusic(1);
_gameState.enableLight = 1;
loadActionData(DAT_ParkRight);
@@ -129,7 +129,7 @@ void IgorEngine::PART_35() {
static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
loadAnimData(frames, kParkFrames);
if (_objectsState[kLizardGivenStateIndex] == 0 && _objectsState[kLauraMetAtCollegeStateIndex] == 1) {
- PARK_DRAW_drawOldLadyFrame(_screenLayer1, 1);
+ part34And35DrawOldLadyFrame(_screenLayer1, 1);
}
copyArea(_animFramesBuffer, 0, 160, _screenLayer1, 320, 160, 144);
loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight, TXT_ParkRight); // active right panel
@@ -138,11 +138,11 @@ void IgorEngine::PART_35() {
loadAnimData(pickUpFrames, kParkFrames);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_35_EXEC_ACTION);
- _updateRoomBackground = &IgorEngine::PARK_UPDATE_AMBIENT_SOUND;
+ partMainSetExecuteAction(1, &IgorEngine::part35ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part34And35UpdateAmbientSound;
_roomDataOffsets = PART_35_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 281, 143); // rightmost walkable column is 281
- PART_35_APPLY_OBJECT_STATE(255);
+ part35ApplyObjectState(255);
if (_currentPart != 351 && !_gameStateLoaded) {
memcpy(_screenVGA, _screenLayer1, 46080);
diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp
index 42a41b45946..5a21d38da17 100644
--- a/engines/igor/parts/part_36.cpp
+++ b/engines/igor/parts/part_36.cpp
@@ -24,13 +24,13 @@
namespace Igor {
-void IgorEngine::PART_36_EXEC_ACTION(int action) {
+void IgorEngine::part36ExecuteAction(int action) {
switch (action) {
case 101: // look at desk
igorSay(201, 1, 655);
break;
case 102:
- PART_36_ACTION_102_takePen();
+ part36TakePen();
break;
case 103: // look at pen
igorSay(202, 1, 656);
@@ -54,12 +54,12 @@ void IgorEngine::PART_36_EXEC_ACTION(int action) {
_currentPart = 242;
break;
default:
- error("PART_36_EXEC_ACTION unhandled action %d", action);
+ error("part36ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_36_ACTION_102_takePen() {
+void IgorEngine::part36TakePen() {
for (int i = 1; i >= 0; --i) {
for (int j = 0; j <= 48; ++j) {
for (int k = 0; k <= 33; ++k) {
@@ -85,25 +85,25 @@ void IgorEngine::PART_36_ACTION_102_takePen() {
}
addObjectToInventory(kInventoryObjectPen, 65);
_objectsState[kPenTakenStateIndex] = 1;
- PART_36_HELPER_1_OBJECT_STATE(255);
+ part36ApplyObjectState(255);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
}
-void IgorEngine::PART_36_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part36ApplyObjectState(int num) {
if (num == 1 || num == 255) {
if (_objectsState[kPenTakenStateIndex] == 0) {
- PART_36_HELPER_4_drawPen(1);
+ part36DrawPen(1);
} else {
- PART_36_HELPER_4_drawPen(0);
+ part36DrawPen(0);
_roomObjectAreasTable[6].object = 1;
_roomObjectAreasTable[7].object = 1;
}
}
}
-void IgorEngine::PART_36_HELPER_2_walkIn() {
+void IgorEngine::part36WalkIn() {
_walkData[0].setPos(319, 143, 4, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipWidth = 15;
@@ -116,7 +116,7 @@ void IgorEngine::PART_36_HELPER_2_walkIn() {
waitForIgorMove();
}
-void IgorEngine::PART_36_HELPER_4_drawPen(int frame) {
+void IgorEngine::part36DrawPen(int frame) {
if (frame == 0) {
memcpy(_screenLayer1 + 31430, _animFramesBuffer, 7);
} else if (frame == 1) {
@@ -124,7 +124,7 @@ void IgorEngine::PART_36_HELPER_4_drawPen(int frame) {
}
}
-void IgorEngine::PART_36() {
+void IgorEngine::part36() {
playMusic(2);
_gameState.enableLight = 1;
loadRoomData(PAL_ChemistryClassroom, IMG_ChemistryClassroom, BOX_ChemistryClassroom, MSK_ChemistryClassroom, TXT_ChemistryClassroom);
@@ -133,13 +133,13 @@ void IgorEngine::PART_36() {
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part36ExecuteAction);
+ part36ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_36_HELPER_2_walkIn();
+ part36WalkIn();
enterPartLoop();
}
while (_currentPart == 360 && !_gameStateLoaded) {
diff --git a/engines/igor/parts/part_37.cpp b/engines/igor/parts/part_37.cpp
index 0318aacfefd..8da9a57539b 100644
--- a/engines/igor/parts/part_37.cpp
+++ b/engines/igor/parts/part_37.cpp
@@ -24,13 +24,13 @@
namespace Igor {
-void IgorEngine::PART_37_EXEC_ACTION(int action) {
+void IgorEngine::part37ExecuteAction(int action) {
switch (action) {
case 101: // exit
_currentPart = 212;
break;
case 102:
- PART_37_ACTION_102_lookAtPaperBinTakePaper();
+ part37LookAtPaperBinTakePaper();
break;
case 103: // look at blackboard
igorSay(203, 2, 664);
@@ -45,12 +45,12 @@ void IgorEngine::PART_37_EXEC_ACTION(int action) {
igorSay(206, 1, 666);
break;
default:
- error("PART_37_EXEC_ACTION unhandled action %d", action);
+ error("part37ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_37_ACTION_102_lookAtPaperBinTakePaper() {
+void IgorEngine::part37LookAtPaperBinTakePaper() {
if (_objectsState[kPhysicsClassPaperTakenStateIndex] == 1) {
igorSay(202, 1, 663);
return;
@@ -63,16 +63,16 @@ void IgorEngine::PART_37_ACTION_102_lookAtPaperBinTakePaper() {
}
addObjectToInventory(kInventoryObjectLabNote, 67);
_objectsState[kPhysicsClassPaperTakenStateIndex] = 1;
- PART_37_HELPER_1_OBJECT_STATE(255);
+ part37ApplyObjectState(255);
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
}
-void IgorEngine::PART_37_HELPER_1_OBJECT_STATE(int num) {
+void IgorEngine::part37ApplyObjectState(int num) {
}
-void IgorEngine::PART_37_HELPER_2_walkIn() {
+void IgorEngine::part37WalkIn() {
_walkData[0].setPos(0, 143, 2, 0);
_walkData[0].setDefaultScale();
_walkData[0].clipSkipX = 16;
@@ -86,7 +86,7 @@ void IgorEngine::PART_37_HELPER_2_walkIn() {
waitForIgorMove();
}
-void IgorEngine::PART_37() {
+void IgorEngine::part37() {
playMusic(2);
_gameState.enableLight = 1;
loadRoomData(PAL_PhysicsClassroom, IMG_PhysicsClassroom, BOX_PhysicsClassroom, MSK_PhysicsClassroom, TXT_PhysicsClassroom);
@@ -95,13 +95,13 @@ void IgorEngine::PART_37() {
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_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part37ExecuteAction);
+ part37ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_37_HELPER_2_walkIn();
+ part37WalkIn();
enterPartLoop();
}
while (_currentPart == 370 && !_gameStateLoaded) {
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index d0e8413ba77..223d968a344 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -22,8 +22,8 @@
namespace Igor {
-void IgorEngine::PART_04_EXEC_ACTION(int action) {
- debugC(9, kDebugGame, "PART_04_EXEC_ACTION %d", action);
+void IgorEngine::part4ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part4ExecuteAction %d", action);
switch (action) {
case 101: // church
_currentPart = 120;
@@ -50,7 +50,7 @@ void IgorEngine::PART_04_EXEC_ACTION(int action) {
_currentPart = 50;
break;
default:
- error("PART_04_EXEC_ACTION unhandled action %d", action);
+ error("part4ExecuteAction unhandled action %d", action);
break;
}
}
@@ -59,7 +59,7 @@ void IgorEngine::PART_04_EXEC_ACTION(int action) {
/**
* MAP
* */
-void IgorEngine::PART_04() {
+void IgorEngine::part4() {
if (_objectsState[kStatuetteTaken2StateIndex] == 1) { // police custcene
_currentPart = 730;
@@ -76,7 +76,7 @@ void IgorEngine::PART_04() {
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);
+ partMainSetExecuteAction(1, &IgorEngine::part4ExecuteAction);
// closes Philips locker
_objectsState[kPhillipLockerStateIndex] = 0;
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index 76f6c691c7b..b86a18f729e 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -22,8 +22,8 @@
namespace Igor {
- void IgorEngine::PART_05_EXEC_ACTION(int action) {
- debugC(9, kDebugGame, "PART_05_EXEC_ACTION %d", action);
+ void IgorEngine::part5ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part5ExecuteAction %d", action);
switch (action) {
case 101: {
// Look at water
@@ -32,10 +32,10 @@ namespace Igor {
}
case 102:
//scrolling action for Igor on the bridge
- PART_05_ACTION_102_scrollRight();
+ part5ScrollRight();
break;
case 103:
- PART_05_ACTION_103_pickPaper();
+ part5TakePaper();
break;
case 104:
// Look at photographer
@@ -46,20 +46,20 @@ namespace Igor {
_currentPart = 40;
break;
default:
- error("PART_05_EXEC_ACTION unhandled action %d", action);
+ error("part5ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_05_HELPER_4_drawPaperOrNot(int num) {
+void IgorEngine::part5ApplyPaperState(int num) {
if (_objectsState[kSpringBridgePaperStateIndex] == 0) {
// paper not taken, paint "frame 0"
- PART_05_06_drawPaperFrame(0);
+ part5And6DrawPaperFrame(0);
return;
}
// paper taken, paint "frame 1"
- PART_05_06_drawPaperFrame(1);
+ part5And6DrawPaperFrame(1);
// disable object
_roomObjectAreasTable[24].object = 0;
for (int i = 27; i <= 29; ++i) {
@@ -67,35 +67,35 @@ void IgorEngine::PART_05_HELPER_4_drawPaperOrNot(int num) {
}
}
-void IgorEngine::PART_05_06_drawPaperFrame(int frame) {
+void IgorEngine::part5And6DrawPaperFrame(int frame) {
const int offset = 41926;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x7E00 + frame * 12, 4, 4, 3);
}
-void IgorEngine::PART_05_06_SAVE_PHOTOGRAPHER_BACKGROUND() {
+void IgorEngine::part5And6SavePhotographerBackground() {
const int offset = 23521;
copyArea(_animFramesBuffer, 0xDEA8 - 1, 23, _screenLayer1 + offset, 320, 23, 49);
}
-void IgorEngine::PART_05_06_DRAW_PHOTOGRAPHER() {
+void IgorEngine::part5And6DrawPhotographer() {
const int offset = 23521;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x95C7, 23, 23, 49);
}
-void IgorEngine::PART_05_06_DRAW_TRIPOD(bool drawToScreen) {
+void IgorEngine::part5And6DrawTripod(bool drawToScreen) {
const int offset = 28668;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x7E54, 23, 23, 33);
if (drawToScreen)
drawAnimRect(offset, 0x7E54, 23, 33);
}
-void IgorEngine::PART_05_06_DRAW_CAMERA(int frame) {
+void IgorEngine::part5And6DrawCamera(int frame) {
const int offset = 26756;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0x7E00 + frame * 42, 7, 7, 6);
}
-void IgorEngine::PART_05_HELPER_6_walkIgorToScene() {
+void IgorEngine::part5WalkIgorToScene() {
_walkData[0].setPos(0, 141, 2, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 0;
@@ -107,7 +107,7 @@ void IgorEngine::PART_05_HELPER_6_walkIgorToScene() {
waitForIgorMove();
}
-void IgorEngine::PART_05() {
+void IgorEngine::part5() {
playMusic(10);
_gameState.enableLight = 1;
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
@@ -123,14 +123,14 @@ void IgorEngine::PART_05() {
// Draws photographer and objects before copying the screenLayer
if (_objectsState[kPhotographerGoneStateIndex] != 0) {
- PART_05_06_SAVE_PHOTOGRAPHER_BACKGROUND();
- PART_05_06_DRAW_PHOTOGRAPHER();
+ part5And6SavePhotographerBackground();
+ part5And6DrawPhotographer();
}
if (_objectsState[kCameraStateIndex] != 0) {
- PART_05_06_DRAW_TRIPOD(false);
+ part5And6DrawTripod(false);
}
if (_objectsState[kTripodStateIndex] != 0) {
- PART_05_06_DRAW_CAMERA(0);
+ part5And6DrawCamera(0);
}
// copying a patch of 224 pixels width and 144 height into the backup buffer for later scroll
@@ -140,9 +140,9 @@ void IgorEngine::PART_05() {
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_drawPaperOrNot(255);
+ partMainSetExecuteAction(1, &IgorEngine::part5ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part5UpdateBackground;
+ part5ApplyPaperState(255);
loadActionData(DAT_SpringRock);
_roomDataOffsets = PART_05_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
@@ -158,7 +158,7 @@ void IgorEngine::PART_05() {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
fadeIn(624);
- PART_05_HELPER_6_walkIgorToScene();
+ part5WalkIgorToScene();
}
enterPartLoop();
}
@@ -181,7 +181,7 @@ void IgorEngine::PART_05() {
}
}
-void IgorEngine::PART_05_ACTION_103_pickPaper() {
+void IgorEngine::part5TakePaper() {
_gameTicks = 0;
int i = 0;
do {
@@ -190,7 +190,7 @@ void IgorEngine::PART_05_ACTION_103_pickPaper() {
drawAnimRect(offset, 0x7E18 + i * 1470, 30, 49);
++i;
}
- PART_05_UPDATE_ROOM_BACKGROUND();
+ part5UpdateBackground();
waitForTimer();
} while (i != 3);
addObjectToInventory(kInventoryObjectLoveNote, 56);
@@ -198,10 +198,10 @@ void IgorEngine::PART_05_ACTION_103_pickPaper() {
if (_game.version == kIdEngDemo110) {
++_demoActionsCounter;
}
- PART_05_HELPER_4_drawPaperOrNot(255);
+ part5ApplyPaperState(255);
}
-void IgorEngine::PART_05_ACTION_102_scrollRight() {
+void IgorEngine::part5ScrollRight() {
uint8 *walkTable3 = loadData(WLK_Bridge3);
uint8 *walkTable4 = loadData(WLK_Bridge4);
int xPos = 220;
@@ -239,7 +239,7 @@ void IgorEngine::PART_05_ACTION_102_scrollRight() {
memcpy(_screenVGA, _screenLayer2, 46080);
++i;
}
- PART_05_UPDATE_ROOM_BACKGROUND();
+ part5UpdateBackground();
waitForTimer();
} while (i != 29);
free(walkTable3);
@@ -250,7 +250,7 @@ void IgorEngine::PART_05_ACTION_102_scrollRight() {
_currentPart = 60;
}
-void IgorEngine::PART_05_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part5UpdateBackground() {
if (compareGameTick(61)) {
scrollPalette(160, 167);
setPaletteRange(160, 167);
diff --git a/engines/igor/parts/part_50.cpp b/engines/igor/parts/part_50.cpp
index bbae4cfe87f..656123f3213 100644
--- a/engines/igor/parts/part_50.cpp
+++ b/engines/igor/parts/part_50.cpp
@@ -31,10 +31,10 @@ static const int kPart50DoorArea = 7;
static const int kPart50DoorX = 264;
static const int kPart50DoorY = 89;
-void IgorEngine::PART_50_EXEC_ACTION(int action) {
+void IgorEngine::part50ExecuteAction(int action) {
switch (action) {
case 101:
- PART_50_ACTION_101_enterMaze();
+ part50EnterMaze();
break;
case 102: // look at maze door
igorSay(201, 1, 1083);
@@ -44,12 +44,12 @@ void IgorEngine::PART_50_EXEC_ACTION(int action) {
_currentPart = 700;
break;
default:
- error("PART_50_EXEC_ACTION unhandled action %d", action);
+ error("part50ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_50_ACTION_101_enterMaze() {
+void IgorEngine::part50EnterMaze() {
_roomObjectAreasTable[_screenLayer2[kPart50DoorY * 320 + kPart50DoorX]].area = kPart50DoorArea;
--_walkDataLastIndex;
buildWalkPath(222, 102, kPart50DoorX, kPart50DoorY);
@@ -61,7 +61,7 @@ void IgorEngine::PART_50_ACTION_101_enterMaze() {
_objectsState[kMazeEntryDirectionStateIndex] = 1;
}
-void IgorEngine::PART_50_enterFromDoor() {
+void IgorEngine::part50EnterFromDoor() {
WalkData *wd = &_walkData[0];
wd->setPos(kPart50DoorX, kPart50DoorY, kFacingPositionLeft, 0);
wd->setDefaultScale();
@@ -76,7 +76,7 @@ void IgorEngine::PART_50_enterFromDoor() {
waitForIgorMove();
}
-void IgorEngine::PART_50_enterFromHill() {
+void IgorEngine::part50EnterFromHill() {
WalkData *wd = &_walkData[0];
wd->setPos(45, 22, kFacingPositionFront, 0);
wd->clipSkipX = 1;
@@ -99,13 +99,13 @@ void IgorEngine::PART_50_enterFromHill() {
/**
* Something is heard from time to time.
*/
-void IgorEngine::PART_50_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part50UpdateBackground() {
if (compareGameTick(0x3D) && getRandomNumber(49) == 0) {
playSound(44, 1);
}
}
-void IgorEngine::PART_50() {
+void IgorEngine::part50() {
playMusic(4);
_gameState.enableLight = 2;
loadRoomData(PAL_OutsideMaze, IMG_OutsideMaze, BOX_OutsideMaze, MSK_OutsideMaze, TXT_OutsideMaze);
@@ -114,8 +114,8 @@ void IgorEngine::PART_50() {
loadActionData(DAT_OutsideMaze);
_roomDataOffsets = PART_50_ROOM_DATA_OFFSETS;
setRoomWalkBounds(49, 22, 224, 119);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_50_EXEC_ACTION);
- _updateRoomBackground = &IgorEngine::PART_50_UPDATE_ROOM_BACKGROUND;
+ partMainSetExecuteAction(1, &IgorEngine::part50ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part50UpdateBackground;
memcpy(_screenVGA, _screenLayer1, 46080);
// the whole room is darker than its palette
@@ -125,9 +125,9 @@ void IgorEngine::PART_50() {
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 500) {
- PART_50_enterFromDoor();
+ part50EnterFromDoor();
} else {
- PART_50_enterFromHill();
+ part50EnterFromHill();
}
}
enterPartLoop();
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index 9328b55ceb6..c16284c1c2c 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -22,7 +22,7 @@
namespace Igor {
-void IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part6UpdateBackground() {
if (compareGameTick(61)) {
scrollPalette(160, 167);
setPaletteRange(160, 167);
@@ -59,92 +59,92 @@ void IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND() {
}
}
-void IgorEngine::PART_06_HELPER_8_animatePhotographer(int frame) {
+void IgorEngine::part6AnimatePhotographer(int frame) {
const int offset = 23521;
drawAnimRect(offset, 0x95C7 + frame * 1127, 23, 49);
}
-void IgorEngine::PART_06_EXEC_ACTION(int action) {
- debugC(9, kDebugGame, "PART_06_EXEC_ACTION %d", action);
+void IgorEngine::part6ExecuteAction(int action) {
+ debugC(9, kDebugGame, "part6ExecuteAction %d", action);
switch (action) {
case 101:
//Look at water
igorSay(201, 2, 480);
break;
case 102:
- PART_06_ACTION_102_scrollLeft();
+ part6ScrollLeft();
break;
case 103:
- PART_06_ACTION_103_talkToPhotographer();
+ part6TalkToPhotographer();
break;
case 104: // look at photographer
igorSay(203, 1, 481);
break;
case 105: // pick camera
- PART_06_ACTION_105_pickCamera();
+ part6TakeCamera();
break;
case 106: // Look at camera
igorSay(204, 1, 482);
break;
case 107:
- PART_06_ACTION_107_giveAnythingToPhotographer();
+ part6GiveAnythingToPhotographer();
break;
case 108:
- PART_06_ACTION_108_giveRocketToPhotographer();
+ part6GiveRocketToPhotographer();
break;
default:
- error("PART_06_EXEC_ACTION unhandled action %d", action);
+ error("part6ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_06_ACTION_103_talkToPhotographer() {
+void IgorEngine::part6TalkToPhotographer() {
igorSayAndWait(215, 1, 489);
- PART_06_HELPER_8_animatePhotographer(0);
+ part6AnimatePhotographer(0);
cutsceneSay(170, 69, 55, 37, 63, 216, 1, 490);
- PART_06_HANDLE_DIALOGUE_PHOTOGRAPHER();
- PART_06_HELPER_6_setPhotographerState(255);
+ part6HandlePhotographerDialogue();
+ part6SetPhotographerState(255);
}
-void IgorEngine::PART_06_HANDLE_DIALOGUE_PHOTOGRAPHER() {
+void IgorEngine::part6HandlePhotographerDialogue() {
loadDialogueData(DLG_SpringPhotographer);
- _updateDialogue = &IgorEngine::PART_06_UPDATE_DIALOGUE_PHOTOGRAPHER;
+ _updateDialogue = &IgorEngine::part6UpdatePhotographerDialogue;
handleDialogue(170, 69, 55, 37, 63);
_updateDialogue = 0;
}
-void IgorEngine::PART_06_UPDATE_DIALOGUE_PHOTOGRAPHER(int action) {
+void IgorEngine::part6UpdatePhotographerDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- PART_06_HELPER_7_decodePhotographerTalkingFrame(1);
+ part6DecodePhotographerTalkingFrame(1);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_06_HELPER_7_decodePhotographerTalkingFrame(getRandomNumber(5) + 1);
+ part6DecodePhotographerTalkingFrame(getRandomNumber(5) + 1);
break;
case kUpdateDialogueAnimStanding:
- PART_06_HELPER_7_decodePhotographerTalkingFrame(1);
+ part6DecodePhotographerTalkingFrame(1);
break;
}
}
-void IgorEngine::PART_06_HELPER_7_decodePhotographerTalkingFrame(int frame) {
+void IgorEngine::part6DecodePhotographerTalkingFrame(int frame) {
const uint8 *src = _animFramesBuffer + 0xA763 + READ_LE_UINT16(_animFramesBuffer + 0xDB95 + frame * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
}
-void IgorEngine::PART_06_HELPER_6_setPhotographerState(int num) {
+void IgorEngine::part6SetPhotographerState(int num) {
if (num == 2 || num == 255) {
if (_objectsState[kPhotographerGoneStateIndex] == 1) {
- PART_05_06_DRAW_PHOTOGRAPHER();
+ part5And6DrawPhotographer();
_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_drawBackgroundOverPhotographer();
+ part6DrawBackgroundOverPhotographer();
_roomObjectAreasTable[2].object = 0;
_roomObjectAreasTable[15].object = 0;
_roomObjectAreasTable[18].object = 0;
@@ -158,15 +158,15 @@ void IgorEngine::PART_06_HELPER_6_setPhotographerState(int num) {
}
if (num == 3 || num == 255) {
if (_objectsState[kTripodStateIndex] == 1) {
- PART_05_06_DRAW_CAMERA(0);
+ part5And6DrawCamera(0);
} else {
- PART_05_06_DRAW_CAMERA(1);
+ part5And6DrawCamera(1);
_roomObjectAreasTable[3].object = 0;
}
}
}
-void IgorEngine::PART_06_ACTION_105_pickCamera() {
+void IgorEngine::part6TakeCamera() {
_gameTicks = 0;
int i = 0;
do {
@@ -178,23 +178,23 @@ void IgorEngine::PART_06_ACTION_105_pickCamera() {
}
++i;
}
- PART_06_UPDATE_ROOM_BACKGROUND();
+ part6UpdateBackground();
waitForTimer();
} while (i != 3);
addObjectToInventory(kInventoryObjectCamera, 71);
_objectsState[kTripodStateIndex] = 0;
- PART_06_HELPER_6_setPhotographerState(255);
+ part6SetPhotographerState(255);
}
-void IgorEngine::PART_06_ACTION_107_giveAnythingToPhotographer() {
- PART_06_HELPER_8_animatePhotographer(0);
+void IgorEngine::part6GiveAnythingToPhotographer() {
+ part6AnimatePhotographer(0);
igorSayAndWait(205, 1, 483);
cutsceneSay(170, 69, 55, 37, 63, 206, 2, 484);
}
-void IgorEngine::PART_06_ACTION_108_giveRocketToPhotographer() {
+void IgorEngine::part6GiveRocketToPhotographer() {
// first frame of photographer
- PART_06_HELPER_8_animatePhotographer(0);
+ part6AnimatePhotographer(0);
igorSayAndWait({ { 208, 2, 485 }, { 210, 2, 486 } });
cutsceneSay(170, 69, 55, 37, 63, 212, 1, 487);
int i = 7;
@@ -209,18 +209,18 @@ void IgorEngine::PART_06_ACTION_108_giveRocketToPhotographer() {
playSound(19, 1);
}
}
- PART_06_UPDATE_ROOM_BACKGROUND();
+ part6UpdateBackground();
waitForTimer();
} while (i != 28);
// removes rocket
removeObjectFromInventory(61);
_objectsState[kPhotographerGoneStateIndex] = 0;
- PART_06_HELPER_6_setPhotographerState(255);
+ part6SetPhotographerState(255);
_gameState.unkF = false;
igorSay(213, 2, 488);
}
-void IgorEngine::PART_06_ACTION_102_scrollLeft() {
+void IgorEngine::part6ScrollLeft() {
uint8 *walkTable1 = loadData(WLK_Bridge1);
uint8 *walkTable2 = loadData(WLK_Bridge2);
int xPos = 323;
@@ -258,7 +258,7 @@ void IgorEngine::PART_06_ACTION_102_scrollLeft() {
memcpy(_screenVGA, _screenLayer2, 46080);
++i;
}
- PART_06_UPDATE_ROOM_BACKGROUND();
+ part6UpdateBackground();
waitForTimer();
} while (i != 29);
free(walkTable1);
@@ -269,15 +269,15 @@ void IgorEngine::PART_06_ACTION_102_scrollLeft() {
_currentPart = 51;
}
-void IgorEngine::PART_06_HELPER_12_drawBackgroundOverPhotographer() {
+void IgorEngine::part6DrawBackgroundOverPhotographer() {
const int offset = 23521;
copyArea(_screenLayer1, offset, 320, _animFramesBuffer + 0xDEA7, 23, 23, 49);
}
-void IgorEngine::PART_06() {
+void IgorEngine::part6() {
playMusic(10);
- debug("Entering PART_06");
+ debug("Entering part6");
_gameState.enableLight = 1;
loadRoomData(PAL_SpringBridge, IMG_SpringBridge, BOX_SpringBridge, MSK_SpringBridge, TXT_SpringBridge);
@@ -285,7 +285,7 @@ void IgorEngine::PART_06() {
// loads from offset 32256
loadAnimData(anm1, 0x7E00);
if (_objectsState[kSpringBridgePaperStateIndex] == 0) {
- PART_05_06_drawPaperFrame(0);
+ part5And6DrawPaperFrame(0);
}
// copying a patch of 224 pixels width and 144 height into the backup buffer for later scroll
// then it loads the actual current scene, SpringRock
@@ -302,13 +302,13 @@ void IgorEngine::PART_06() {
static const int anm4[] = {FRM_SpringRock5, FRM_SpringRock6, 0};
loadAnimData(anm4, 0xA763);
- PART_05_06_SAVE_PHOTOGRAPHER_BACKGROUND();
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_06_EXEC_ACTION);
- _updateRoomBackground = &IgorEngine::PART_06_UPDATE_ROOM_BACKGROUND;
- PART_06_HELPER_6_setPhotographerState(255);
+ part5And6SavePhotographerBackground();
+ partMainSetExecuteAction(1, &IgorEngine::part6ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part6UpdateBackground;
+ part6SetPhotographerState(255);
if (_objectsState[kCameraStateIndex] == 1) {
- PART_05_06_DRAW_TRIPOD(true);
+ part5And6DrawTripod(true);
}
if (_currentPart == 61 && !_gameStateLoaded) {
@@ -346,10 +346,10 @@ void IgorEngine::PART_06() {
if (compareGameTick(1)) {
handleIgorIdleAnimation();
}
- PART_06_UPDATE_ROOM_BACKGROUND();
+ part6UpdateBackground();
if (compareGameTick(61) && _gameState.unkF && getRandomNumber(9) == 0) {
- PART_06_HELPER_8_animatePhotographer(getRandomNumber(3));
+ part6AnimatePhotographer(getRandomNumber(3));
}
waitForTimer();
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 4c2eb496a92..b82aa4ba94e 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -68,36 +68,36 @@ static const int kPart68GiveInventoryIndex = 40;
static const int kPart68TalkCodeEnd = 100;
-void IgorEngine::PART_68_LOAD_ROOM() {
+void IgorEngine::part68LoadRoom() {
loadRoomData(PAL_Part68, IMG_Part68, BOX_Part68, MSK_Part68, TXT_Part68);
SET_PAL_240_48_1();
}
-void IgorEngine::PART_68_drawUndertaker(int frame) {
+void IgorEngine::part68DrawUndertaker(int frame) {
drawAnimRect(kPart68NBorisOffset, kPart68BorisFramesOffset + frame * kPart68BorisFrameSize, kPart68BorisWidth, kPart68BorisHeight,
true, kBlendBehindIgorAndText);
}
-void IgorEngine::PART_68_DRAW_AMBIENT(int frame) {
+void IgorEngine::part68DrawAmbient(int frame) {
drawAnimRect(kPart68OwlsEyesOffset, kPart68OwlsEyesFramesOffset + frame * kPart68OwlsEyesWidth * kPart68OwlsEyesHeight,
kPart68OwlsEyesWidth, kPart68OwlsEyesHeight);
}
-void IgorEngine::PART_68_drawVase(int frame) {
+void IgorEngine::part68DrawVase(int frame) {
copyArea(_screenLayer1, kPart68VaseOffset, 320, _animFramesBuffer + frame * kPart68VaseWidth * kPart68VaseHeight,
kPart68VaseWidth, kPart68VaseWidth, kPart68VaseHeight);
}
-void IgorEngine::PART_68_drawPose(int frame) {
+void IgorEngine::part68DrawPose(int frame) {
drawAnimRect(kPart68PoseOffset, kPart68PoseFramesOffset + frame * kPart68PoseWidth * kPart68PoseHeight,
kPart68PoseWidth, kPart68PoseHeight);
}
-void IgorEngine::PART_68_APPLY_OBJECT_STATE(int num) {
+void IgorEngine::part68ApplyObjectState(int num) {
if (num == 3 || num == 255) {
// undertaker is still in the room
if (_objectsState[kUndertakerLeftStateIndex] == 0) {
- PART_68_drawUndertaker(0);
+ part68DrawUndertaker(0);
for (int i = 0; i < MAX_ROOM_OBJECT_AREAS; ++i) {
if (_roomObjectAreasTable[i].area >= 3 && _roomObjectAreasTable[i].area <= 4) {
_roomObjectAreasTable[i].area = 0;
@@ -108,7 +108,7 @@ void IgorEngine::PART_68_APPLY_OBJECT_STATE(int num) {
_part68NpcPresent = true;
} else {
loadActionData(DAT_Part68);
- PART_68_LOAD_ROOM();
+ part68LoadRoom();
WRITE_LE_UINT16(_roomActionsTable + 156, 0x9081);
_roomActionsTable[246] = 3;
// disable undertaker hotspot
@@ -122,9 +122,9 @@ void IgorEngine::PART_68_APPLY_OBJECT_STATE(int num) {
}
if (num == 2 || num == 255) {
if (_objectsState[kVaseTakenStateIndex] == 0) {
- PART_68_drawVase(0);
+ part68DrawVase(0);
} else {
- PART_68_drawVase(1);
+ part68DrawVase(1);
for (int i = 0; i < MAX_ROOM_OBJECT_AREAS; ++i) {
if (_roomObjectAreasTable[i].object == 2) {
_roomObjectAreasTable[i].object = 0;
@@ -134,69 +134,69 @@ void IgorEngine::PART_68_APPLY_OBJECT_STATE(int num) {
}
}
-void IgorEngine::PART_68_updateOwlsEyes() {
+void IgorEngine::part68UpdateOwlsEyes() {
if (compareGameTick(0x3D)) {
if (_roomAmbientIndex == 3) {
_roomAmbientIndex = 0;
- PART_68_DRAW_AMBIENT(0);
+ part68DrawAmbient(0);
} else if (getRandomNumber(9) == 0) {
_roomAmbientIndex = getRandomNumber(3);
- PART_68_DRAW_AMBIENT(_roomAmbientIndex);
+ part68DrawAmbient(_roomAmbientIndex);
}
}
}
-void IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND_TALK() {
+void IgorEngine::part68UpdateBackgroundTalk() {
if (compareGameTick(1) && getRandomNumber(49) == 0) {
playSound(41, 1);
}
- PART_68_updateOwlsEyes();
+ part68UpdateOwlsEyes();
}
-void IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part68UpdateBackground() {
if (compareGameTick(1) && getRandomNumber(49) == 0) {
playSound(41, 1);
}
if (compareGameTick(0x3D) && _part68NpcPresent) {
- PART_68_drawUndertaker(getRandomNumber(2));
+ part68DrawUndertaker(getRandomNumber(2));
}
- PART_68_updateOwlsEyes();
+ part68UpdateOwlsEyes();
}
-void IgorEngine::PART_68_BorisSayReplies(int action) {
+void IgorEngine::part68SayBorisReplies(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
case kUpdateDialogueAnimStanding:
- PART_68_drawUndertaker(kPart68BorisStanding);
+ part68DrawUndertaker(kPart68BorisStanding);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- PART_68_drawUndertaker(kPart68BorisStanding + getRandomNumber(4));
+ part68DrawUndertaker(kPart68BorisStanding + getRandomNumber(4));
break;
}
}
-void IgorEngine::PART_68_sayBoris(const Common::Array<DialogueText> &lines) {
+void IgorEngine::part68SayBoris(const Common::Array<DialogueText> &lines) {
UpdateRoomBackgroundProc previous = _updateRoomBackground;
- _updateRoomBackground = &IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND_TALK;
+ _updateRoomBackground = &IgorEngine::part68UpdateBackgroundTalk;
cutsceneSayWithCallback(kPart68TextX, kPart68TextY, kPart68TextR, kPart68TextG, kPart68TextB, lines,
- &IgorEngine::PART_68_BorisSayReplies);
+ &IgorEngine::part68SayBorisReplies);
_updateRoomBackground = previous;
}
/**
* Since Boris speaks in four separate pages, utility function to help on that
*/
-void IgorEngine::PART_68_BorisSayReplies(const int *replies, const int *sounds, int count) {
+void IgorEngine::part68SayBorisReplies(const int *replies, const int *sounds, int count) {
Common::Array<DialogueText> lines;
for (int i = 0; i < count; ++i) {
Common::strlcpy(_globalDialogueTexts[250 + i], _dialogueReplies[replies[i] - 1], sizeof(_globalDialogueTexts[250 + i]));
DialogueText line = { 250 + i, 1, sounds[i] };
lines.push_back(line);
}
- PART_68_sayBoris(lines);
+ part68SayBoris(lines);
}
-void IgorEngine::PART_68_enterFromRight() {
+void IgorEngine::part68EnterFromRight() {
WalkData *wd = &_walkData[0];
wd->setPos(319, 143, kFacingPositionLeft, 0);
wd->clipSkipX = 1;
@@ -212,10 +212,10 @@ void IgorEngine::PART_68_enterFromRight() {
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND);
+ waitForIgorMove(&IgorEngine::part68UpdateBackground);
}
-void IgorEngine::PART_68_enterFromLeft() {
+void IgorEngine::part68EnterFromLeft() {
WalkData *wd = &_walkData[0];
wd->setPos(0, 143, kFacingPositionRight, 0);
wd->clipSkipX = 16;
@@ -231,10 +231,10 @@ void IgorEngine::PART_68_enterFromLeft() {
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND);
+ waitForIgorMove(&IgorEngine::part68UpdateBackground);
}
-void IgorEngine::PART_68_enterFromCemetery() {
+void IgorEngine::part68EnterFromCemetery() {
WalkData *wd = &_walkData[0];
wd->setPos(193, 115, kFacingPositionRight, 0);
wd->clipSkipX = 1;
@@ -250,18 +250,18 @@ void IgorEngine::PART_68_enterFromCemetery() {
_walkData[_walkDataLastIndex].frameNum = 0;
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND);
+ waitForIgorMove(&IgorEngine::part68UpdateBackground);
}
-void IgorEngine::PART_68_ACTION_102_takeVase() {
+void IgorEngine::part68TakeVase() {
// will only let us take the vase if the records have been given to him
if (_objectsState[kRecordGivenToUndertakerStateIndex] == 0) {
- PART_68_drawPose(0);
- PART_68_drawUndertaker(kPart68BorisFacing);
+ part68DrawPose(0);
+ part68DrawUndertaker(kPart68BorisFacing);
waitForTimer(30);
- PART_68_sayBoris({ { 202, 1, 1008 }, { 203, 1, 1009 }, { 204, 1, 1010 }, { 205, 1, 1011 } });
- PART_68_drawPose(1);
+ part68SayBoris({ { 202, 1, 1008 }, { 203, 1, 1009 }, { 204, 1, 1010 }, { 205, 1, 1011 } });
+ part68DrawPose(1);
waitForTimer(30);
// Igor turns to the right
@@ -270,25 +270,25 @@ void IgorEngine::PART_68_ACTION_102_takeVase() {
moveIgor(kFacingPositionRight, 0);
_walkDataCurrentIndex = _walkDataLastIndex;
igorSayAndWait({ { 206, 1, 1012 }, { 207, 1, 1013 } });
- PART_68_sayBoris({ { 208, 1, 1014 }, { 209, 1, 1015 }, { 210, 1, 1016 }, { 211, 1, 1017 } });
- PART_68_drawUndertaker(kPart68BorisFacing);
+ part68SayBoris({ { 208, 1, 1014 }, { 209, 1, 1015 }, { 210, 1, 1016 }, { 211, 1, 1017 } });
+ part68DrawUndertaker(kPart68BorisFacing);
waitForTimer(30);
return;
}
for (int frame = 0; frame <= 1; ++frame) {
- PART_68_drawPose(frame);
+ part68DrawPose(frame);
waitForTimer(120);
}
addObjectToInventory(kInventoryObjectVase, kPart68TakenObjectIndex);
_objectsState[kVaseTakenStateIndex] = 1;
- PART_68_APPLY_OBJECT_STATE(255);
+ part68ApplyObjectState(255);
}
/**
* Igor gives the object to the character.
*/
-void IgorEngine::PART_68_ACTION_108_giveRecordsToBoris() {
- PART_68_drawUndertaker(kPart68BorisFacing);
+void IgorEngine::part68GiveRecordsToBoris() {
+ part68DrawUndertaker(kPart68BorisFacing);
waitForTimer(30);
drawAnimRect(kPart68GiveAnimOffset, kPart68GiveFramesOffset, kPart68GiveWidth, kPart68GiveHeight);
if (_inventoryInfo[kPart68GiveInventoryIndex] != 0) {
@@ -297,22 +297,22 @@ void IgorEngine::PART_68_ACTION_108_giveRecordsToBoris() {
}
playSound(63, 1);
igorSayAndWait(214, 1, 1019);
- PART_68_sayBoris({ { 215, 1, 1020 }, { 216, 1, 1021 }, { 217, 1, 1022 }, { 218, 1, 1023 } });
+ part68SayBoris({ { 215, 1, 1020 }, { 216, 1, 1021 }, { 217, 1, 1022 }, { 218, 1, 1023 } });
for (int frame = 1; frame <= 3; ++frame) {
drawAnimRect(kPart68GiveAnimOffset, kPart68GiveFramesOffset + frame * kPart68GiveFrameSize, kPart68GiveWidth, kPart68GiveHeight);
waitForTimer(40);
}
- PART_68_sayBoris({ { 219, 1, 1024 }, { 220, 1, 1025 }, { 221, 1, 1026 }, { 222, 1, 1027 } });
- PART_68_drawUndertaker(kPart68BorisFacing);
+ part68SayBoris({ { 219, 1, 1024 }, { 220, 1, 1025 }, { 221, 1, 1026 }, { 222, 1, 1027 } });
+ part68DrawUndertaker(kPart68BorisFacing);
waitForTimer(30);
_objectsState[kRecordGivenToUndertakerStateIndex] = 1;
- PART_68_APPLY_OBJECT_STATE(255);
+ part68ApplyObjectState(255);
}
/**
* Chooses names at random for the replies
*/
-void IgorEngine::PART_68_chooseRandomNames(int code) {
+void IgorEngine::part68ChooseRandomNames(int code) {
uint8 *data = _gameState.dialogueData;
if (code == 10) {
const int entries = _objectsState[kLighthouseMessageSentStateIndex] == 1 ? 4 : 5;
@@ -341,20 +341,20 @@ void IgorEngine::PART_68_chooseRandomNames(int code) {
/**
* The sprites of the character going away.
*/
-void IgorEngine::PART_68_BorisLeaves() {
+void IgorEngine::part68BorisLeaves() {
for (int frame = 1; frame <= 6; ++frame) {
decodeAnimFrame(getAnimFrame(kPart68LeaveBase, kPart68LeaveTable, frame), _screenVGA, true);
waitForTimer(30);
}
}
-void IgorEngine::PART_68_CONVERSATION() {
+void IgorEngine::part68Conversation() {
UpdateRoomBackgroundProc previousBackground = _updateRoomBackground;
- _updateRoomBackground = &IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND_TALK;
- _updateDialogue = &IgorEngine::PART_68_BorisSayReplies;
+ _updateRoomBackground = &IgorEngine::part68UpdateBackgroundTalk;
+ _updateDialogue = &IgorEngine::part68SayBorisReplies;
loadDialogueData(DLG_Part68);
_part68QuestionCounter = 1;
- PART_68_drawUndertaker(kPart68BorisStanding);
+ part68DrawUndertaker(kPart68BorisStanding);
memset(_screenVGA + 46080, 0, 17920);
_gameState.dialogueStarted = true;
@@ -365,19 +365,19 @@ void IgorEngine::PART_68_CONVERSATION() {
igorSayAndWait(225, 1, 1029);
static const int replies[4] = { 1, 2, 3, 4 };
static const int sounds[4] = { 1051, 1052, 1053, 1054 };
- PART_68_BorisSayReplies(replies, sounds, 4);
+ part68SayBorisReplies(replies, sounds, 4);
_objectsState[kBorisIntroducedStateIndex] = 1;
} else {
igorSayAndWait(226, 1, 1030);
static const int replies[4] = { 5, 6, 7, 8 };
static const int sounds[4] = { 1055, 1056, 1057, 1058 };
- PART_68_BorisSayReplies(replies, sounds, 4);
+ part68SayBorisReplies(replies, sounds, 4);
}
bool done = false;
do {
drawDialogueChoices();
- PART_68_drawUndertaker(kPart68BorisStanding);
+ part68DrawUndertaker(kPart68BorisStanding);
const int choice = selectDialogue();
if (choice == 0) {
break;
@@ -394,7 +394,7 @@ void IgorEngine::PART_68_CONVERSATION() {
(_gameState.dialogueChoiceStart - 1) * 30;
_part68LastDialogueCode = _gameState.dialogueData[offset + 5];
if (_part68LastDialogueCode != 0) {
- PART_68_chooseRandomNames(_part68LastDialogueCode);
+ part68ChooseRandomNames(_part68LastDialogueCode);
}
switch (_gameState.dialogueData[offset + 2]) {
case 1:
@@ -418,8 +418,8 @@ void IgorEngine::PART_68_CONVERSATION() {
if (_part68LastDialogueCode == kPart68TalkCodeEnd) {
static const int replies[4] = { 29, 30, 31, 32 };
static const int sounds[4] = { 1079, 1080, 1081, 1082 };
- PART_68_BorisSayReplies(replies, sounds, 4);
- PART_68_BorisLeaves();
+ part68SayBorisReplies(replies, sounds, 4);
+ part68BorisLeaves();
_objectsState[kUndertakerLeftStateIndex] = 2;
}
memset(_screenVGA + 46080, 0, 17920);
@@ -431,69 +431,69 @@ void IgorEngine::PART_68_CONVERSATION() {
_updateRoomBackground = previousBackground;
}
-void IgorEngine::PART_68_ACTION_104_talkToBoris() {
- PART_68_CONVERSATION();
+void IgorEngine::part68TalkToBoris() {
+ part68Conversation();
if (_objectsState[kUndertakerLeftStateIndex] == 2) {
_objectsState[kUndertakerLeftStateIndex] = 1;
- PART_68_APPLY_OBJECT_STATE(255);
+ part68ApplyObjectState(255);
}
}
-void IgorEngine::PART_68_ACTION_106_enterCemetery() {
+void IgorEngine::part68EnterCemetery() {
if (_objectsState[kUndertakerLeftStateIndex] == 0) {
igorSayAndWait(223, 2, 1028);
- PART_68_ACTION_104_talkToBoris();
+ part68TalkToBoris();
} else {
_currentPart = 710;
}
}
-void IgorEngine::PART_68_EXEC_ACTION(int action) {
+void IgorEngine::part68ExecuteAction(int action) {
switch (action) {
case 101: // exit through either side will cause next entry to be that side
_objectsState[kCemeteryEntrySideStateIndex] = 1;
_currentPart = 700;
break;
case 102: // take vase
- PART_68_ACTION_102_takeVase();
+ part68TakeVase();
break;
case 103: // look at vase
igorSay(201, 1, 1007);
break;
case 104: // talk to Boris
- PART_68_ACTION_104_talkToBoris();
+ part68TalkToBoris();
break;
case 105: // look at Boris
igorSay(212, 2, 1018);
break;
case 106:
- PART_68_ACTION_106_enterCemetery();
+ part68EnterCemetery();
break;
case 108:
- PART_68_ACTION_108_giveRecordsToBoris();
+ part68GiveRecordsToBoris();
break;
case 109:
_objectsState[kCemeteryEntrySideStateIndex] = 0;
_currentPart = 700;
break;
default:
- error("PART_68_EXEC_ACTION unhandled action %d", action);
+ error("part68ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_68() {
+void IgorEngine::part68() {
playMusic(4);
_gameState.enableLight = 2;
loadActionData(DAT_Part68);
- PART_68_LOAD_ROOM();
+ part68LoadRoom();
static const int anim[] = { ANM_Part68, 0 };
loadAnimData(anim);
_roomDataOffsets = PART_68_ROOM_DATA_OFFSETS;
setRoomClickFix(143, -1, -1, false);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_68_EXEC_ACTION);
- _updateRoomBackground = &IgorEngine::PART_68_UPDATE_ROOM_BACKGROUND;
- PART_68_APPLY_OBJECT_STATE(255);
+ partMainSetExecuteAction(1, &IgorEngine::part68ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part68UpdateBackground;
+ part68ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
// the colors that change are darker than their palette
@@ -504,12 +504,12 @@ void IgorEngine::PART_68() {
fadeIn(768);
if (_currentPart == 680) {
if (_objectsState[kCemeteryEntrySideStateIndex] == 0) {
- PART_68_enterFromRight();
+ part68EnterFromRight();
} else {
- PART_68_enterFromLeft();
+ part68EnterFromLeft();
}
} else {
- PART_68_enterFromCemetery();
+ part68EnterFromCemetery();
}
}
enterPartLoop();
diff --git a/engines/igor/parts/part_69.cpp b/engines/igor/parts/part_69.cpp
index ef7cb5f6d45..2b8231444cb 100644
--- a/engines/igor/parts/part_69.cpp
+++ b/engines/igor/parts/part_69.cpp
@@ -65,7 +65,7 @@ static const int kPart69TransformFrameLast = 0x16;
static const int kPart69EndingFrameFirst = 1;
static const int kPart69EndingFrameLast = 0xE;
-void IgorEngine::PART_69_EXEC_ACTION(int action) {
+void IgorEngine::part69ExecuteAction(int action) {
switch (action) {
case 101:
_currentPart = 721;
@@ -87,13 +87,13 @@ void IgorEngine::PART_69_EXEC_ACTION(int action) {
igorSay(210, 1, 1089);
break;
case 107:
- PART_69_ACTION_107_useVaseWithFireflies();
+ part69UseVaseWithFireflies();
break;
case 108:
igorSay(215, 2, 1092);
break;
default:
- error("PART_69_EXEC_ACTION unhandled action %d", action);
+ error("part69ExecuteAction unhandled action %d", action);
break;
}
}
@@ -101,7 +101,7 @@ void IgorEngine::PART_69_EXEC_ACTION(int action) {
/**
* Once the scene is over the places of the fireflies are not objects anymore.
*/
-void IgorEngine::PART_69_APPLY_OBJECT_STATE() {
+void IgorEngine::part69ApplyObjectState() {
if (_objectsState[kPart69FireflyCapturedStateIndex] != 1) {
return;
}
@@ -116,15 +116,15 @@ void IgorEngine::PART_69_APPLY_OBJECT_STATE() {
}
}
-void IgorEngine::PART_69_drawSwarm(int frame) {
+void IgorEngine::part69DrawSwarm(int frame) {
decodeAnimFrame(getAnimFrame(kPart69SwarmFramesBase, kPart69SwarmFramesTable, frame), _screenVGA, true);
}
-void IgorEngine::PART_69_drawMainFirefly(int frame) {
+void IgorEngine::part69DrawMainFirefly(int frame) {
decodeAnimFrame(getAnimFrame(kPart69MainFireflyFramesBase, kPart69MainFireflyFramesTable, frame), _screenVGA, true);
}
-void IgorEngine::PART_69_animateFireflies() {
+void IgorEngine::part69AnimateFireflies() {
if (!compareGameTick(13, 16)) {
return;
}
@@ -139,7 +139,7 @@ void IgorEngine::PART_69_animateFireflies() {
_part69FireflyStepCount = 0;
}
if (secondFirefly > 0) {
- PART_69_drawMainFirefly(_part69FireflyFrameB);
+ part69DrawMainFirefly(_part69FireflyFrameB);
if (kPart69MainFireflyStepLastFrame[secondFirefly] == _part69FireflyFrameB) {
secondFirefly = 0;
sequence += 3;
@@ -147,7 +147,7 @@ void IgorEngine::PART_69_animateFireflies() {
++_part69FireflyFrameB;
}
}
- PART_69_drawSwarm(_part69FireflyFrameA);
+ part69DrawSwarm(_part69FireflyFrameA);
if (kPart69SwarmStepLastFrame[sequence] == _part69FireflyFrameA) {
if (sequence > 3) {
sequence = kPart69SwarmStepNext[sequence];
@@ -180,7 +180,7 @@ void IgorEngine::PART_69_animateFireflies() {
}
-void IgorEngine::PART_69_takeVaseBack(int num, int sound) {
+void IgorEngine::part69TakeVaseBack(int num, int sound) {
for (int frame = kPart69EndingFrameLast; frame <= kPart69EndingFrameLast + 1; ++frame) {
decodeAnimFrame(getAnimFrame(kPart69FramesDBase, kPart69FramesDTable, frame), _screenVGA, true);
waitForTimer(46);
@@ -189,26 +189,26 @@ void IgorEngine::PART_69_takeVaseBack(int num, int sound) {
}
-void IgorEngine::PART_69_ACTION_107_useVaseWithFireflies() {
+void IgorEngine::part69UseVaseWithFireflies() {
drawAnimRect(kPart69PictureOffset, kPart69PictureAnimOffset, kPart69PictureWidth, kPart69PictureHeight);
if (_objectsState[kVaseStateIndex] == 0) {
for (int i = 0; i < 1000 / kTimerTicksCount && !_eventQuitGame; ++i) {
- PART_69_animateFireflies();
+ part69AnimateFireflies();
waitForTimer();
}
- PART_69_takeVaseBack(211, 1090);
+ part69TakeVaseBack(211, 1090);
return;
}
do {
- PART_69_animateFireflies();
+ part69AnimateFireflies();
waitForTimer();
} while (!(_objectsState[kPart69SwarmAnimationPhaseStateIndex] == 3 && _objectsState[kPart69LeaderFireflyPathStateIndex] == 0) && !_eventQuitGame);
uint8 frameC = 1;
do {
if (compareGameTick(13, 16)) {
- PART_69_drawSwarm(_part69FireflyFrameA);
+ part69DrawSwarm(_part69FireflyFrameA);
_part69FireflyFrameA = _part69FireflyFrameA == kPart69TalkFrameLast ? kPart69TalkFrameFirst : _part69FireflyFrameA + 1;
decodeAnimFrame(getAnimFrame(kPart69FramesCBase, kPart69FramesCTable, frameC), _screenVGA, true);
if (frameC < kPart69TransformFrameLast) {
@@ -230,21 +230,21 @@ void IgorEngine::PART_69_ACTION_107_useVaseWithFireflies() {
waitForTimer(255);
_objectsState[kPart69FireflyCapturedStateIndex] = 1;
_objectsState[kVaseStateIndex] = 2;
- UPDATE_OBJECT_STATE(7);
+ partMainUpdateObjectState(7);
drawInventory(_inventoryInfo[72], 0);
playSound(63, 1);
while (_mixer->isSoundHandleActive(_sfxHandle) && !_eventQuitGame) {
waitForTimer(1);
}
playSound(51, 1);
- PART_69_APPLY_OBJECT_STATE();
- PART_69_takeVaseBack(213, 1091);
+ part69ApplyObjectState();
+ part69TakeVaseBack(213, 1091);
}
/**
* Igor comes from the right edge, walking to the left, while the fireflies move.
*/
-void IgorEngine::PART_69_enterFromRight() {
+void IgorEngine::part69EnterFromRight() {
WalkData *wd = &_walkData[0];
wd->setPos(319, kPart69EntryY, kFacingPositionLeft, 0);
wd->clipSkipX = 1;
@@ -260,10 +260,10 @@ void IgorEngine::PART_69_enterFromRight() {
buildWalkPath(319, kPart69EntryY, kPart69EntryDstX, kPart69EntryY);
_walkData[_walkDataLastIndex].frameNum = 0;
_gameState.igorMoving = true;
- waitForIgorMove(&IgorEngine::PART_69_animateFireflies);
+ waitForIgorMove(&IgorEngine::part69AnimateFireflies);
}
-void IgorEngine::PART_69_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part69UpdateBackground() {
if (compareGameTick(1)) {
if (getRandomNumber(14) == 0 && !isDialogueSpeechPlaying()) {
switch (getRandomNumber(2)) {
@@ -279,10 +279,10 @@ void IgorEngine::PART_69_UPDATE_ROOM_BACKGROUND() {
}
}
}
- PART_69_animateFireflies();
+ part69AnimateFireflies();
}
-void IgorEngine::PART_69() {
+void IgorEngine::part69() {
playMusic(4);
_gameState.enableLight = 2;
loadActionData(DAT_Part69);
@@ -294,13 +294,13 @@ void IgorEngine::PART_69() {
loadAnimData(anim);
_roomDataOffsets = PART_69_ROOM_DATA_OFFSETS;
setRoomClickFix(130, 166, -1, false, 130);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_69_EXEC_ACTION);
- _updateRoomBackground = &IgorEngine::PART_69_UPDATE_ROOM_BACKGROUND;
- PART_69_APPLY_OBJECT_STATE();
+ partMainSetExecuteAction(1, &IgorEngine::part69ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part69UpdateBackground;
+ part69ApplyObjectState();
memcpy(_screenVGA, _screenLayer1, 46080);
if (_objectsState[kPart69FireflyCapturedStateIndex] == 0) {
- PART_69_drawSwarm(kPart69SwarmInitialFrame);
- PART_69_drawMainFirefly(kPart69MainFireflyInitialFrame);
+ part69DrawSwarm(kPart69SwarmInitialFrame);
+ part69DrawMainFirefly(kPart69MainFireflyInitialFrame);
}
_part69FireflyStepCount = 0;
_part69FireflyFrameB = 0;
@@ -314,7 +314,7 @@ void IgorEngine::PART_69() {
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
- PART_69_enterFromRight();
+ part69EnterFromRight();
}
enterPartLoop();
while (_currentPart == 690 && !_gameStateLoaded) {
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index cf1f87b444e..d993667cdd9 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -15,7 +15,7 @@ const uint32 kDoor1Open = 0x23F1;
const uint32 kDoor2Closed = 0x266D;
const uint32 kDoor2Open = 0x28DD;
-void IgorEngine::PART_07_DRAW_DOOR_STATE(int num) {
+void IgorEngine::part7DrawDoorState(int num) {
_roomActionsTable[297] = 109;
if (num == 1 || num == 255) { // draws open or closed door depending on the flag
const uint32 srcOffset = _objectsState[kDeanDoorOpenStateIndex] == 0 ? kDoor1Closed : kDoor1Open;
@@ -29,7 +29,7 @@ void IgorEngine::PART_07_DRAW_DOOR_STATE(int num) {
}
}
-void IgorEngine::PART_07_openCloseDoor(int door, bool open) {
+void IgorEngine::part7OpenCloseDoor(int door, bool open) {
const int stateIndex = door == 1 ? kDeanDoorOpenStateIndex : kSecretaryDoorOpenStateIndex;
if ((_objectsState[stateIndex] != 0) == open) {
const int text = open ? 19 : 23;
@@ -52,10 +52,10 @@ void IgorEngine::PART_07_openCloseDoor(int door, bool open) {
waitForTimer(127);
}
_objectsState[stateIndex] = open ? 1 : 0;
- PART_07_DRAW_DOOR_STATE(door);
+ part7DrawDoorState(door);
}
-void IgorEngine::PART_07_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame, int dyPos) {
+void IgorEngine::part7DrawScaledIgor(int scaleStep, int facing, int frame, int dyPos) {
WalkData &wd = _walkData[0];
wd.setPos(109, 143, facing, frame);
wd.clipSkipX = 1;
@@ -70,14 +70,14 @@ void IgorEngine::PART_07_DRAW_SCALED_IGOR(int scaleStep, int facing, int frame,
moveIgor(facing, frame);
}
-void IgorEngine::PART_07_enterFromOutside() {
- PART_07_DRAW_DOOR_STATE(255);
+void IgorEngine::part7EnterFromOutside() {
+ part7DrawDoorState(255);
for (int area = 11; area <= 13; ++area)
_roomObjectAreasTable[area].area = 0;
int frame = 1;
for (int step = 0; step <= 9; ++step) {
- PART_07_DRAW_SCALED_IGOR(step, kFacingPositionBack, frame, 0);
+ part7DrawScaledIgor(step, kFacingPositionBack, frame, 0);
frame = frame == 6 ? 1 : frame + 1;
waitForTimer(15);
}
@@ -102,19 +102,19 @@ void IgorEngine::PART_07_enterFromOutside() {
}
}
-void IgorEngine::PART_07_exitToOutside() {
+void IgorEngine::part7ExitToOutside() {
int frame = 1;
for (int step = 9; step >= 0; --step) {
if (step == 9)
frame = 0;
- PART_07_DRAW_SCALED_IGOR(step, kFacingPositionFront, frame, 3);
+ part7DrawScaledIgor(step, kFacingPositionFront, frame, 3);
frame = frame == 6 ? 1 : frame + 1;
waitForTimer(15);
}
_currentPart = 101;
}
-void IgorEngine::PART_07_EXEC_ACTION(int action) {
+void IgorEngine::part7ExecuteAction(int action) {
switch (action) {
case 101: // Look at dean's plaque
igorSayAndWait(201, 1, 140);
@@ -123,16 +123,16 @@ void IgorEngine::PART_07_EXEC_ACTION(int action) {
igorSayAndWait(202, 2, 141);
break;
case 103:
- PART_07_openCloseDoor(1, true);
+ part7OpenCloseDoor(1, true);
break;
case 104:
- PART_07_openCloseDoor(1, false);
+ part7OpenCloseDoor(1, false);
break;
case 105:
- PART_07_openCloseDoor(2, true);
+ part7OpenCloseDoor(2, true);
break;
case 106:
- PART_07_openCloseDoor(2, false);
+ part7OpenCloseDoor(2, false);
break;
case 107: // Secretary's plaque
igorSayAndWait(204, 1, 142);
@@ -154,7 +154,7 @@ void IgorEngine::PART_07_EXEC_ACTION(int action) {
igorSayAndWait(212, 1, 146);
break;
case 110:
- PART_07_exitToOutside();
+ part7ExitToOutside();
break;
case 111: // Go through dean's door
if (_objectsState[kDeanDoorOpenStateIndex] != 0) {
@@ -183,12 +183,12 @@ void IgorEngine::PART_07_EXEC_ACTION(int action) {
}
break;
default:
- warning("PART_07_EXEC_ACTION unhandled action %d", action);
+ warning("part7ExecuteAction unhandled action %d", action);
break;
}
}
-void IgorEngine::PART_07() {
+void IgorEngine::part7() {
playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_AdministrationCorridor);
@@ -197,10 +197,10 @@ void IgorEngine::PART_07() {
TXT_AdministrationCorridor);
static const int anim[] = {ANM_AdministrationCorridor, 0};
loadAnimData(anim);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_07_EXEC_ACTION);
+ partMainSetExecuteAction(1, &IgorEngine::part7ExecuteAction);
_roomDataOffsets = PART_07_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
- PART_07_DRAW_DOOR_STATE(255);
+ part7DrawDoorState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
@@ -225,7 +225,7 @@ void IgorEngine::PART_07() {
_walkDataCurrentIndex = 1;
fadeIn(768);
if (_currentPart == 70) { // enter from outside
- PART_07_enterFromOutside();
+ part7EnterFromOutside();
}
}
enterPartLoop();
diff --git a/engines/igor/parts/part_70.cpp b/engines/igor/parts/part_70.cpp
index 2b01db9a521..cfdb81c91b1 100644
--- a/engines/igor/parts/part_70.cpp
+++ b/engines/igor/parts/part_70.cpp
@@ -29,7 +29,7 @@ static const int kPart70BoatHeight = 39;
static const int kPart70ExitStates[4] = { 501, 720, 680, 810 };
-void IgorEngine::PART_70_EXEC_ACTION(int action) {
+void IgorEngine::part70ExecuteAction(int action) {
switch (action) {
case 101:
case 102:
@@ -38,7 +38,7 @@ void IgorEngine::PART_70_EXEC_ACTION(int action) {
_currentPart = kPart70ExitStates[action - 101];
break;
default:
- error("PART_70_EXEC_ACTION unhandled action %d", action);
+ error("part70ExecuteAction unhandled action %d", action);
break;
}
}
@@ -46,7 +46,7 @@ void IgorEngine::PART_70_EXEC_ACTION(int action) {
/**
* Draws the boat if we havent sent the message yet
*/
-void IgorEngine::PART_70_DRAW_OBJECT_STATE() {
+void IgorEngine::part70DrawObjectState() {
const int frameSize = kPart70BoatWidth * kPart70BoatHeight;
const int frame = _objectsState[kLighthouseMessageSentStateIndex] == 0 ? 0 : 1;
copyArea(_screenLayer1, kPart70BoatOffset, 320, _animFramesBuffer + frame * frameSize, kPart70BoatWidth,
@@ -56,14 +56,14 @@ void IgorEngine::PART_70_DRAW_OBJECT_STATE() {
/**
* The colors 192 to 207 rotate for the water animation.
*/
-void IgorEngine::PART_70_UPDATE_ROOM_BACKGROUND() {
+void IgorEngine::part70UpdateBackground() {
if (compareGameTick(3, 32)) {
scrollPalette(192, 207);
setPaletteRange(192, 207);
}
}
-void IgorEngine::PART_70() {
+void IgorEngine::part70() {
playMusic(4);
_gameState.enableLight = 2;
loadActionData(DAT_Part70);
@@ -73,9 +73,9 @@ void IgorEngine::PART_70() {
loadAnimData(anim);
_roomDataOffsets = PART_70_ROOM_DATA_OFFSETS;
setRoomClickFix(143, -1, -1, false);
- SET_EXEC_ACTION_FUNC(1, &IgorEngine::PART_70_EXEC_ACTION);
- _updateRoomBackground = &IgorEngine::PART_70_UPDATE_ROOM_BACKGROUND;
- PART_70_DRAW_OBJECT_STATE();
+ partMainSetExecuteAction(1, &IgorEngine::part70ExecuteAction);
+ _updateRoomBackground = &IgorEngine::part70UpdateBackground;
+ part70DrawObjectState();
Commit: 93e7a2b4201b7acd9fdc58d3d914e365bb2992b1
https://github.com/scummvm/scummvm/commit/93e7a2b4201b7acd9fdc58d3d914e365bb2992b1
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:56+01:00
Commit Message:
IGOR: Reutilize drawing functions where possible
Changed paths:
engines/igor/parts/part_21.cpp
engines/igor/parts/part_28.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_36.cpp
engines/igor/parts/part_6.cpp
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index 3e39282b500..a3915aeff95 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -314,20 +314,7 @@ void IgorEngine::part21WaitForIgorWalkWithAnimation() {
void IgorEngine::part21DrawMargaretFrameComposited(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;
- copyArea(_screenVGA, offset, 320, _screenTempLayer, 100, 49, 43);
- copyArea(_screenLayer1, offset, 320, _animFramesBuffer + frame * 2107 + 0xCA7, 49, 49, 43);
+ drawAnimRect(28520, 0xCA7 + frame * 2107, 49, 43, true, kBlendBehindIgorAndText);
if (_dialogueCursorOn) {
_roomCursorOn = true;
}
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index 94fdf0b5e45..df6f33e4668 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -202,20 +202,7 @@ void IgorEngine::part28EnterFromRight() {
void IgorEngine::part28DrawCarolineTalkingFrame(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;
- copyArea(_screenVGA, offset, 320, _screenTempLayer, 100, 30, 44);
- copyArea(_screenLayer1, offset, 320, _animFramesBuffer + (frame - 1) * 1320, 30, 30, 44);
+ drawAnimRect(27374, (frame - 1) * 1320, 30, 44, true, kBlendBehindIgorAndText);
if (_gameState.dialogueTextRunning) {
memcpy(_screenTextLayer + 23040, _screenLayer1 + _dialogueDirtyRectY, _dialogueDirtyRectSize);
}
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index 4d9317b05d8..82989cb1440 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -91,9 +91,7 @@ void IgorEngine::part33TakeAstronomyBooks() {
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);
- }
+ drawAnimRect(23448, 0x467 * (PART_33_ANIM_DATA_4[i] - 1), 23, 49);
waitForTimer(120);
}
addObjectToInventory(kInventoryObjectAstronomyBook, 66);
diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp
index 5a21d38da17..cacc1786c6b 100644
--- a/engines/igor/parts/part_36.cpp
+++ b/engines/igor/parts/part_36.cpp
@@ -61,26 +61,7 @@ void IgorEngine::part36ExecuteAction(int action) {
void IgorEngine::part36TakePen() {
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;
- }
- }
- }
- copyArea(_screenVGA, 23750, 320, _screenTempLayer, 100, 34, 49);
+ drawAnimRect(23750, 14 + i * 1666, 34, 49, false, kBlendLitSprite);
waitForTimer(45);
}
addObjectToInventory(kInventoryObjectPen, 65);
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index c16284c1c2c..28dc1dc098b 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -171,11 +171,7 @@ void IgorEngine::part6TakeCamera() {
int i = 0;
do {
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);
- }
+ drawAnimRect(22568, 0x81AE + i * 1715, 35, 49);
++i;
}
part6UpdateBackground();
Commit: a6bdf04b4ebe1a2c8cf01c105564261918960412
https://github.com/scummvm/scummvm/commit/a6bdf04b4ebe1a2c8cf01c105564261918960412
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:56+01:00
Commit Message:
IGOR: Take screenshot before saving so the menu isnt visible
Changed paths:
engines/igor/igor.h
engines/igor/metaengine.cpp
engines/igor/metaengine.h
engines/igor/options.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 2c29ef653e5..4a7d0c53f16 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -647,6 +647,7 @@ private:
int _walkToObjectPosX, _walkToObjectPosY;
int16 _currentPart;
+ const Graphics::Surface *_optionsMenuThumbnail = nullptr;
int _talkDelay;
int _talkSpeechCounter;
int _talkDelayCounter;
@@ -1641,6 +1642,12 @@ private:
public:
Graphics::Screen *_screen = nullptr;
+ bool copyOptionsMenuThumbnail(Graphics::Surface &thumb) const {
+ if (!_optionsMenuThumbnail)
+ return false;
+ thumb.copyFrom(*_optionsMenuThumbnail);
+ return true;
+ }
void handleOptionsMenu_paintQuit();
bool handleOptionsMenu_handleKeyDownQuit(int key);
diff --git a/engines/igor/metaengine.cpp b/engines/igor/metaengine.cpp
index 6b835c310bf..8bc42520a86 100644
--- a/engines/igor/metaengine.cpp
+++ b/engines/igor/metaengine.cpp
@@ -48,6 +48,12 @@ const char *IgorMetaEngine::getName() const {
return "igor";
}
+void IgorMetaEngine::getSavegameThumbnail(Graphics::Surface &thumb) {
+ if (Igor::g_engine && Igor::g_engine->copyOptionsMenuThumbnail(thumb))
+ return;
+ MetaEngine::getSavegameThumbnail(thumb);
+}
+
const ADExtraGuiOptionsMap *IgorMetaEngine::getAdvancedExtraGuiOptions() const {
return Igor::optionsList;
}
diff --git a/engines/igor/metaengine.h b/engines/igor/metaengine.h
index 7d8c741d45e..d065e579317 100644
--- a/engines/igor/metaengine.h
+++ b/engines/igor/metaengine.h
@@ -36,6 +36,7 @@ public:
* Used by e.g. the launcher to determine whether to enable the Load button.
*/
bool hasFeature(MetaEngineFeature f) const override;
+ void getSavegameThumbnail(Graphics::Surface &thumb) override;
const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override;
};
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 3bb18d82521..ca098504e9d 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -20,11 +20,27 @@
*/
#include "common/config-manager.h"
#include "common/events.h"
+#include "graphics/scaler.h"
#include "igor/igor.h"
namespace Igor {
+class OptionsThumbnailScope {
+ const Graphics::Surface *&_slot;
+ const Graphics::Surface *_previous;
+ Graphics::Surface _thumbnail;
+public:
+ explicit OptionsThumbnailScope(const Graphics::Surface *&slot) : _slot(slot), _previous(slot) {
+ if (::createThumbnailFromScreen(&_thumbnail))
+ _slot = &_thumbnail;
+ }
+ ~OptionsThumbnailScope() {
+ _slot = _previous;
+ _thumbnail.free();
+ }
+};
+
static const struct {
int y;
int h;
@@ -273,6 +289,8 @@ static void drawButtonsBar(uint8 *dst, const uint8 *src) {
}
void IgorEngine::handleOptionsMenu() {
+ // Retain the gameplay view before the menu draws or dims its palette.
+ OptionsThumbnailScope thumbnailScope(_optionsMenuThumbnail);
loadOptionsMenuTexts();
PauseToken pauseToken = pauseEngine();
hideCursor();
Commit: fecaed5199bc134cec6169213a19833b52a056ce
https://github.com/scummvm/scummvm/commit/fecaed5199bc134cec6169213a19833b52a056ce
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:57+01:00
Commit Message:
IGOR: Disallow saving during cutscenes
Changed paths:
engines/igor/igor.h
engines/igor/part_main.cpp
engines/igor/parts/part_73.cpp
engines/igor/parts/part_74.cpp
engines/igor/parts/part_75.cpp
engines/igor/parts/part_78.cpp
engines/igor/parts/part_79.cpp
engines/igor/parts/part_80.cpp
engines/igor/parts/part_85.cpp
engines/igor/parts/part_90.cpp
engines/igor/parts/part_credits.cpp
engines/igor/parts/part_margaret.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 4a7d0c53f16..35ca99f8c39 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -647,6 +647,7 @@ private:
int _walkToObjectPosX, _walkToObjectPosY;
int16 _currentPart;
+ bool _canSaveGame = true;
const Graphics::Surface *_optionsMenuThumbnail = nullptr;
int _talkDelay;
int _talkSpeechCounter;
@@ -1682,7 +1683,7 @@ public:
return true;
}
bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override {
- return true;
+ return _canSaveGame;
}
void handlePause();
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 22ed8eea4e1..ec1488ca713 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -715,7 +715,9 @@ void IgorEngine::partMain() {
case 810:
part81();
break;
- case 850: // Intro cutscene
+ case 850: { // Intro cutscene
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
// Clear the entire screen buffer before starting the intro cutscene
memset(_screenVGA, 0, 64000);
g_engine->_screen->updateScreen();
@@ -731,7 +733,9 @@ void IgorEngine::partMain() {
_inputVars[kInputCursorXPos] = 160;
_inputVars[kInputCursorYPos] = 72;
_system->warpMouse(_inputVars[kInputCursorXPos], _inputVars[kInputCursorYPos]);
+ _canSaveGame = savingWasAllowed;
break;
+ }
case 900: // Logo slideshow
case 901:
case 902:
@@ -880,6 +884,8 @@ void IgorEngine::partMainUpdateFiguresOnPaper(int delay) {
}
void IgorEngine::partMainMeanwhile(int img) {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
hideCursor();
memset(_currentPalette, 0, 768);
setPaletteRange(208, 255);
@@ -897,6 +903,7 @@ void IgorEngine::partMainMeanwhile(int img) {
waitForTimer(250);
}
fadeOut(9);
+ _canSaveGame = savingWasAllowed;
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_73.cpp b/engines/igor/parts/part_73.cpp
index 883c9e896fd..68167fc4efe 100644
--- a/engines/igor/parts/part_73.cpp
+++ b/engines/igor/parts/part_73.cpp
@@ -47,6 +47,8 @@ void IgorEngine::part73UpdateDialogue(int action) {
}
void IgorEngine::part73Cutscene() {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
playMusic(8);
_gameState.enableLight = 1;
loadRoomData(PAL_Part73, IMG_Part73, BOX_Part73, MSK_Part73, TXT_Part73);
@@ -107,6 +109,7 @@ void IgorEngine::part73Cutscene() {
_currentAction.verb = kVerbWalk;
_objectsState[kStatuetteTaken2StateIndex] = 0;
_currentPart = 40;
+ _canSaveGame = savingWasAllowed;
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_74.cpp b/engines/igor/parts/part_74.cpp
index 98ae2fdaa7c..d32794f1363 100644
--- a/engines/igor/parts/part_74.cpp
+++ b/engines/igor/parts/part_74.cpp
@@ -109,6 +109,8 @@ void IgorEngine::part74Say(int who, const Common::Array<DialogueText> &lines) {
* Boat scene
*/
void IgorEngine::part74ShipCutscene() {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
UpdateRoomBackgroundProc previousBackground = _updateRoomBackground;
playMusic(4);
_gameState.enableLight = 1;
@@ -172,6 +174,7 @@ void IgorEngine::part74ShipCutscene() {
fadeIn(624);
_gameState.enableLight = 2;
_updateRoomBackground = previousBackground;
+ _canSaveGame = savingWasAllowed;
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_75.cpp b/engines/igor/parts/part_75.cpp
index b20e52c83bc..de2c429666f 100644
--- a/engines/igor/parts/part_75.cpp
+++ b/engines/igor/parts/part_75.cpp
@@ -49,6 +49,8 @@ void IgorEngine::part75DrawPhilipFrame(int frame) {
}
void IgorEngine::part75() {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
playMusic(8);
partMainMeanwhile();
_gameState.enableLight = 1;
@@ -99,6 +101,7 @@ void IgorEngine::part75() {
_talkShadowIndex = kTalkShadowColor;
_currentPart = 122;
fadeOut(768);
+ _canSaveGame = savingWasAllowed;
}
diff --git a/engines/igor/parts/part_78.cpp b/engines/igor/parts/part_78.cpp
index af4872ab4d7..c775d08b58a 100644
--- a/engines/igor/parts/part_78.cpp
+++ b/engines/igor/parts/part_78.cpp
@@ -199,6 +199,8 @@ void IgorEngine::part78ProfessorWarnings(int which) {
}
void IgorEngine::part78() {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
playMusic(11);
partMainMeanwhile(IMG_Part78MinutesLater);
memset(_currentPalette, 0, 768);
@@ -295,6 +297,7 @@ void IgorEngine::part78() {
// the card with the time that has passed
partMainMeanwhile(IMG_Part78NextDay);
_currentPart = 281;
+ _canSaveGame = savingWasAllowed;
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_79.cpp b/engines/igor/parts/part_79.cpp
index 2895c7c57eb..c0d19577929 100644
--- a/engines/igor/parts/part_79.cpp
+++ b/engines/igor/parts/part_79.cpp
@@ -554,6 +554,8 @@ void IgorEngine::part79BeachScene() {
}
void IgorEngine::part79() {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
// the picture is shown below a black band
if (_currentPart == 790) {
memset(_screenVGA, 0, 64000);
@@ -568,6 +570,7 @@ void IgorEngine::part79() {
part79BeachScene();
}
_screenVGAVOffset = 0;
+ _canSaveGame = savingWasAllowed;
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_80.cpp b/engines/igor/parts/part_80.cpp
index 6f3b6717e60..c20c443a18a 100644
--- a/engines/igor/parts/part_80.cpp
+++ b/engines/igor/parts/part_80.cpp
@@ -80,6 +80,8 @@ void IgorEngine::part80Say(int who, const Common::Array<DialogueText> &lines) {
* Larua and Friend discuss the great dosicua recovery.
*/
void IgorEngine::part80() {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
playMusic(8);
_gameState.enableLight = 1;
loadRoomData(PAL_Part80, IMG_Part80, BOX_Part80, MSK_Part80, TXT_Part80);
@@ -122,6 +124,7 @@ void IgorEngine::part80() {
}
memcpy(_paletteBuffer, _currentPalette, 624);
fadeOut(768);
+ _canSaveGame = savingWasAllowed;
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_85.cpp b/engines/igor/parts/part_85.cpp
index d0d63451887..618096b33d0 100644
--- a/engines/igor/parts/part_85.cpp
+++ b/engines/igor/parts/part_85.cpp
@@ -202,6 +202,8 @@ void IgorEngine::part85AnimateIgorHead(int frame) {
// Introduction cutscene
void IgorEngine::part85() {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
if(_game.flags & kFlagFloppy) {
playMusic(2);
} else playMusic(10);
@@ -315,6 +317,7 @@ PART_85_EXIT:
_currentPart = 61;
_updateDialogue = 0;
_updateRoomBackground = 0;
+ _canSaveGame = savingWasAllowed;
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp
index 980cde4455b..87627751559 100644
--- a/engines/igor/parts/part_90.cpp
+++ b/engines/igor/parts/part_90.cpp
@@ -45,6 +45,8 @@ void IgorEngine::part90FadePalette(bool fadeInColors) {
}
void IgorEngine::part90() {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
static const uint16 holdTicks[] = { 2000, 500, 500, 2500, 2000 };
const uint16 duration = holdTicks[_currentPart - 900];
const char *str;
@@ -123,16 +125,19 @@ void IgorEngine::part90() {
fadeOut(768);
SET_PAL_208_96_1();
SET_PAL_240_48_1();
+ _canSaveGame = savingWasAllowed;
return;
}
part90FadePalette(false);
if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart) {
+ _canSaveGame = savingWasAllowed;
return;
}
++_currentPart;
if ((_game.version == kIdSpaCD && _currentPart == 904) || _currentPart == 905) {
_currentPart = 850;
}
+ _canSaveGame = savingWasAllowed;
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_credits.cpp b/engines/igor/parts/part_credits.cpp
index 753e24dc3ec..ea5543992d5 100644
--- a/engines/igor/parts/part_credits.cpp
+++ b/engines/igor/parts/part_credits.cpp
@@ -170,6 +170,8 @@ void IgorEngine::partCreditsDrawText(int x, int y, uint8 color, bool underline,
* pictures), then the logos again.
*/
void IgorEngine::partCredits() {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
const CreditsPage &page = kCreditsPages[(_currentPart - 910) / 10];
playMusic(kCreditsMusic);
@@ -215,6 +217,7 @@ void IgorEngine::partCredits() {
// a game was loaded or the game is quit: the state is not changed
fadeOut(768);
SET_PAL_208_96_1();
+ _canSaveGame = savingWasAllowed;
return;
}
@@ -225,6 +228,7 @@ void IgorEngine::partCredits() {
} else {
_currentPart += 10;
}
+ _canSaveGame = savingWasAllowed;
}
} // End of namespace Igor
diff --git a/engines/igor/parts/part_margaret.cpp b/engines/igor/parts/part_margaret.cpp
index 5b8d8fb260a..7dfe0ca70bd 100644
--- a/engines/igor/parts/part_margaret.cpp
+++ b/engines/igor/parts/part_margaret.cpp
@@ -49,6 +49,8 @@ void IgorEngine::partMargaretUpdateDialogue(int action) {
}
void IgorEngine::partMargaret() {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
playMusic(8);
_gameState.enableLight = 1;
VAR_MARGARET_ROOM_ANIM_COUNTER = _objectsState[kMargaretSceneStateIndex] + 1;
@@ -122,6 +124,7 @@ void IgorEngine::partMargaret() {
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
}
+ _canSaveGame = savingWasAllowed;
}
} // End of namespace Igor
Commit: f62b986b9b41b6a025e57c874e39df3efecd7664
https://github.com/scummvm/scummvm/commit/f62b986b9b41b6a025e57c874e39df3efecd7664
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:57+01:00
Commit Message:
IGOR: Spacing fixes, licence fixes
Changed paths:
engines/igor/input.cpp
engines/igor/parts/part_1.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_30.cpp
engines/igor/parts/part_4.cpp
engines/igor/parts/part_7.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_9.cpp
engines/igor/sound.cpp
engines/igor/statics.h
engines/igor/text.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index c550b104369..2145eabb2a0 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -507,7 +507,6 @@ void IgorEngine::handleRoomInput() {
_actionCode = 0;
return;
}
- // verbatim from reference/scummvm-igor-engine/igor.cpp:1611
debugC(9, kDebugEngine, "handleRoomInput() actionCode %d", _actionCode);
// expanded: shows what the clicks resolved to and how the offset was built
debugC(9, kDebugEngine, " verb %d verbType %d | obj1: type %d num %d (row %d) | obj2: type %d num %d (col %d) | verbBase %d offset %d -> %d",
diff --git a/engines/igor/parts/part_1.cpp b/engines/igor/parts/part_1.cpp
index 934f2a537c6..591cf64a620 100644
--- a/engines/igor/parts/part_1.cpp
+++ b/engines/igor/parts/part_1.cpp
@@ -1,9 +1,22 @@
/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
*/
#include "igor/igor.h"
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index cdbd9297e39..66c79dc8240 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -1,9 +1,22 @@
/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
*/
#include "igor/igor.h"
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index d758d99692f..2090d50c607 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -195,7 +195,7 @@ void IgorEngine::part30WalkInFromRight() {
void IgorEngine::part30LauraCutscene() {
memset(_screenVGA + 46080, 0, 17920);
fadeIn(768);
- part30LauraAndIgorBumpIntoEachOther();
+ part30LauraAndIgorBumpIntoEachOther();
_walkData[0].setPos(172, 134, 2, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 1;
@@ -203,26 +203,26 @@ void IgorEngine::part30LauraCutscene() {
_updateDialogue = &IgorEngine::part30UpdateLauraDialogue;
igorSayAndWait({ { 203, 1, 452 }, { 204, 1, 453 }, { 205, 1, 454 } });
cutsceneSay(201, 85, 63, 0, 38, 206, 1, 455);
- // igor crosses arms
+ // igor crosses arms
part30IgorCrossesArms();
// real dialogue
part30HandleLauraDialogue();
if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart)
return;
- // "Nunca me habian descrito tan bien"
+ // "Nunca me habian descrito tan bien"
igorSayAndWait(207, 1, 456);
- // at least you're funny
+ // at least you're funny
cutsceneSay(201, 85, 63, 0, 38, { { 208, 1, 457 }, { 209, 1, 458 } });
_updateDialogue = 0;
- // Laura leaves
+ // Laura leaves
part30LauraLeaves();
_walkData[0].setPos(164, 135, 3, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 1;
drawVerbsPanel();
drawInventory(_inventoryInfo[72], 0);
- // Que caracter
+ // Que caracter
igorSay(210, 1, 459);
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
@@ -246,7 +246,7 @@ void IgorEngine::part30LauraAndIgorBumpIntoEachOther() {
}
void IgorEngine::part30IgorCrossesArms() {
- decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0xBEE6) - 1, _screenVGA, true);
+ 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);
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index 223d968a344..4d8b8aec560 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -23,8 +23,8 @@
namespace Igor {
void IgorEngine::part4ExecuteAction(int action) {
- debugC(9, kDebugGame, "part4ExecuteAction %d", action);
- switch (action) {
+ debugC(9, kDebugGame, "part4ExecuteAction %d", action);
+ switch (action) {
case 101: // church
_currentPart = 120;
break;
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index d993667cdd9..14942850a0d 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -1,9 +1,22 @@
/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
*/
#include "igor/igor.h"
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index fb71bd58d71..ccf34a55745 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -1,9 +1,22 @@
/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
*/
#include "igor/igor.h"
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index 66e4e3db7e9..eca487f41e3 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -1,9 +1,22 @@
/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
*/
#include "igor/igor.h"
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 8f82c03df81..1d95dc370ff 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -114,7 +114,7 @@ void IgorEngine::playSound(int num, int type) {
soundHandle = &_sfxHandle;
} else if (type == 0) {
if (_mixer->isSoundHandleActive(_speechHandle)) {
- debugC(9, kDebugEngine, "stopping previous handle");
+ debugC(9, kDebugEngine, "stopping previous handle");
_mixer->stopHandle(_speechHandle);
}
if ((_game.flags & kFlagTalkie) == 0) {
diff --git a/engines/igor/statics.h b/engines/igor/statics.h
index 777612d0d6f..b310aec8f7a 100644
--- a/engines/igor/statics.h
+++ b/engines/igor/statics.h
@@ -27,11 +27,11 @@
namespace Igor {
// Shared animation frame buffer offsets for Part 10 & Part 11
-const uint32 kPart10_11_Frm1 = 0xB400; // cseg175:2815
-const uint32 kPart10_11_Frm2 = 0xBC0A; // cseg177:0064
-const uint32 kPart10_11_Frm3 = 0xC5E2; // cseg177:0097
-const uint32 kPart10_11_Frm4 = 0xC786; // cseg177:00CA
-const uint32 kPart10_11_Frm5 = 0xC8AE; // cseg177:00FD
+const uint32 kPart10_11_Frm1 = 0xB400;
+const uint32 kPart10_11_Frm2 = 0xBC0A;
+const uint32 kPart10_11_Frm3 = 0xC5E2;
+const uint32 kPart10_11_Frm4 = 0xC786;
+const uint32 kPart10_11_Frm5 = 0xC8AE;
// Layout of the animation buffer while the park is loaded: FRM_Park1..4 follow each other
// from kParkFrames on, and the frames of Laura's entrance replace them while she is on screen.
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 5217e9d64bc..1a71e3c9327 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -706,7 +706,7 @@ void IgorEngine::dialogueAskQuestion() {
question = 5;
}
const int num = question - 1;
- const int sound = _dialogueQuestionSounds[question - 1]; // cseg172:043B-0460, 0B34-0B43
+ const int sound = _dialogueQuestionSounds[question - 1];
debugC(9, kDebugEngine, "dialogueAskQuestion() num %d offset %d", num, offset);
Common::strlcpy(_globalDialogueTexts[250], _dialogueQuestions[num][0], sizeof(_globalDialogueTexts[250]));
Common::strlcpy(_globalDialogueTexts[251], _dialogueQuestions[num][1], sizeof(_globalDialogueTexts[251]));
@@ -754,7 +754,7 @@ void IgorEngine::dialogueReplyToQuestion(int x, int y, int r, int g, int b, int
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, _dialogueReplySounds[num]); // cseg172:0A59-0A82
+ ADD_DIALOGUE_TEXT(dialogueIndex, len, _dialogueReplySounds[num]);
for (int j = 0; j < len; ++j) {
Common::strlcpy(_globalDialogueTexts[dialogueIndex], _dialogueReplies[num + j], sizeof(_globalDialogueTexts[dialogueIndex]));
++dialogueIndex;
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 1b532a0ab88..febc660a0bf 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -210,7 +210,7 @@ void IgorEngine::moveIgor(int pos, int frame) {
};
uint16 screenIgorDrawOffset = _walkDataDrawOffset;
uint16 igorScaledWidth = _walkDxPos + _walkClipWidth;
- uint16 igorScaledHeight = _walkScaleWidth + _walkDyPos; // cseg229:4B48-4B4F
+ uint16 igorScaledHeight = _walkScaleWidth + _walkDyPos;
uint16 igorBodyScanLine = 0;
if (_walkYPosChanged != 0) {
for (int i = 1; i <= _walkDyPos; ++i) {
@@ -791,7 +791,7 @@ void IgorEngine::buildWalkPathAreaRightDirection(int srcX, int srcY, int dstX, i
wd->setScale(scale, scale);
wd->yPosChanged = 0;
wd->dyPos = _walkData[_walkDataLastIndex - 1].y - wd->y;
- int x = xScale - xScale / 2 + dstX - 1; // cseg229:0A49-0A78
+ int x = xScale - xScale / 2 + dstX - 1;
if (x > 319) {
wd->clipSkipX = 1;
wd->clipWidth = 319 - (x - xScale);
Commit: 40f69aba1057c9552807d280d0e30d7e075b94df
https://github.com/scummvm/scummvm/commit/40f69aba1057c9552807d280d0e30d7e075b94df
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:58+01:00
Commit Message:
IGOR: Prevent pause on Igor CD
Changed paths:
engines/igor/igor.cpp
engines/igor/input.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index baad73dbea9..222e85a5eb1 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -63,8 +63,8 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
_game.flags = gameDesc->gameFlags;
_game.language = gameDesc->desc.language;
- _currentPart = 850;
- // _currentPart = kStartupPart;
+ // _currentPart = 850;
+ _currentPart = kStartupPart;
// _currentPart = 171;
// _currentPart = 62;
@@ -443,6 +443,10 @@ void IgorEngine::executeAction(int action) {
void IgorEngine::handlePause() {
+ // The CD version's pause routine returns without doing anything.
+ if (_game.version == kIdEngCD || _game.version == kIdSpaCD)
+ return;
+
drawActionSentence(getString(STR_GamePaused), 0xFB);
do {
waitForTimer();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 2145eabb2a0..01c25c4249b 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -142,7 +142,9 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
if (ticks != -1) {
return;
}
- _gameTicks += kTimerTicksCount;
+ // Splash screens advance one tick at a time. Resume the aligned timer
+ // steps used by the animation and room-loop checks.
+ _gameTicks += kTimerTicksCount - _gameTicks % kTimerTicksCount;
// Update cursor mask
if ((_gameTicks & 31) == 0 && !_eventQuitGame) {
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 1a71e3c9327..5b3135f3828 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -81,7 +81,6 @@ const uint8 IgorEngine::_sentenceColorIndex[] = {0xFD, 0xFB, 0xF1};
/**
* appends one DialogueText{num, count, sound} record to the batch being built.
- * MAX_DIALOGUE_TEXTS = 6
* Game accumulates texts in _dialogeTextsTable, then displays them during dialogues.
*
* each call to ADD_DIALOGUE_TEXT is one screen of dialogue. Each dialogue
@@ -104,9 +103,6 @@ void IgorEngine::SET_DIALOGUE_TEXT(int start, int count) {
_dialogueTextsBuildCount = 0;
_dialogueTextsStart = start - 1;
_dialogueTextsCount = count;
- // _talkSpeechCounter is the engine-side state used only by the blocking
- // dialogue loops to pause between pages. A skipped previous dialogue can
- // leave it at -1
_talkSpeechCounter = 3;
}
@@ -114,7 +110,6 @@ void IgorEngine::SET_DIALOGUE_TEXT(int start, int count) {
* sets the positional state of the text to be displayed
*/
void IgorEngine::fixDialogueTextPosition(int num, int count, int *x, int *y) {
- debugC(9, kDebugEngine, "fixDialogueTextPosition() for line %s, count %d, x %d, y %d", _globalDialogueTexts[num], count, *x, *y);
int textLineWidth = 0;
for (int i = 0; i < count; ++i) {
int w = _font.getStringWidth(_globalDialogueTexts[num + i]);
Commit: 096f138d582b654461bb3add251b962169826acb
https://github.com/scummvm/scummvm/commit/096f138d582b654461bb3add251b962169826acb
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:58+01:00
Commit Message:
IGOR: Detect English demos and limit map access
Changed paths:
engines/igor/detection_tables.h
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/parts/part_4.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/detection_tables.h b/engines/igor/detection_tables.h
index 918851114da..e8f96148539 100644
--- a/engines/igor/detection_tables.h
+++ b/engines/igor/detection_tables.h
@@ -27,6 +27,42 @@ const PlainGameDescriptor igorGames[] = {
};
const IgorGameDescription gameDescriptions[] = {
+ {
+ {
+ "igor",
+ "Demo 1.00s",
+ AD_ENTRY2s(
+ "IGOR.DAT", nullptr, 4086790,
+ "IGOR.FSD", nullptr, 462564
+ ),
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ ADGF_UNSTABLE | ADGF_DEMO,
+ GUIO1(GUIO_NOSPEECH)
+ },
+ kIdEngDemo100,
+ kFlagDemo | kFlagFloppy,
+ "IGOR.DAT",
+ "IGOR.FSD"
+ },
+ {
+ {
+ "igor",
+ "Demo 1.10s",
+ AD_ENTRY2s(
+ "IGOR.DAT", nullptr, 4094103,
+ "IGOR.FSD", nullptr, 462564
+ ),
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ ADGF_UNSTABLE | ADGF_DEMO,
+ GUIO1(GUIO_NOSPEECH)
+ },
+ kIdEngDemo110,
+ kFlagDemo | kFlagFloppy,
+ "IGOR.DAT",
+ "IGOR.FSD"
+ },
{
{
"igor",
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 222e85a5eb1..3be5be609a7 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -121,8 +121,8 @@ void IgorEngine::restart() {
_mazeLocation = 0;
_mazeSavedLocation = 0;
_mazeRoom = 0;
- memset(&_roomClickFix, 0, sizeof(_roomClickFix));
- _roomClickFixBottom = 143;
+ memset(&_roomWalkTargetRules, 0, sizeof(_roomWalkTargetRules));
+ _roomWalkTargetBottom = 143;
_roomGiveObjectSize = 0;
_nextTimer = 0;
_fastMode = 1;
@@ -284,7 +284,7 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
}
void IgorEngine::leavePartLoop() {
- _roomClickFix.enabled = false;
+ _roomWalkTargetRules.enabled = false;
_roomGiveObjectSize = 0;
hideCursor();
partMainSetExecuteAction(1, 0);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 35ca99f8c39..b8f33a6c865 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -103,6 +103,7 @@ struct RoomWalkBounds {
int x1, y1;
int x2, y2;
// Minimum y after clamping a click past the corresponding horizontal edge.
+ // e.g. clamped to x1? then x1MinY is used to determine the minimum y.
int x1MinY, x2MinY;
};
@@ -172,11 +173,11 @@ struct Action {
};
struct DialogueDataOffsets {
- int questionsOffset;
+ int questionsOffset; // Base offset used to locate question text
int questionsSize;
- int repliesOffset;
+ int repliesOffset; // Base offset used to locate reply text
int repliesSize;
- int matSize;
+ int matSize; // Stride used to index the conversation choices matrix
int replyDataOffset;
int questionSoundsOffset;
int replySoundsOffset;
@@ -207,7 +208,7 @@ struct RoomDataOffsets {
// The click fix of a room that clamps the clicked position: y is limited, x is limited to [xMin, xMax]
// (-1: no limit), then the first walkable row below is looked for (and above if scanUp).
-struct RoomClickFix {
+struct RoomWalkTargetRules {
int yMax;
int xMin;
int xMax;
@@ -215,8 +216,6 @@ struct RoomClickFix {
bool enabled;
};
-// The maze: a grid of locations, each with the location to the north, east, south and west (0: none)
-// and the shape of the room that shows it (the part of the room is 50 + shape).
struct MazeNode {
uint8 neighbors[4];
uint8 shape;
@@ -285,7 +284,7 @@ struct MazeFlame {
struct MazeRoom {
uint8 part;
int dat, txt, img, pal, msk, box;
- int8 music; // -1: depends on the location
+ int8 music;
uint8 darkness;
uint8 flameMode;
uint8 numFlames;
@@ -295,13 +294,14 @@ struct MazeRoom {
bool saveLocation; // the room ends when the location changes
const RoomDataOffsets *offsets;
int giveObjectSize; // stride of the give matrix when it is not the one of the use matrix
- RoomClickFix clickFix;
+ RoomWalkTargetRules clickFix;
const MazeEntry *entries;
uint8 numEntries;
const MazeAction *actions;
uint8 numActions;
const char *objectName3;
};
+
enum {
kUpdateDialogueAnimEndOfSentence = 1,
kUpdateDialogueAnimMiddleOfSentence,
@@ -353,6 +353,9 @@ enum InventoryObjectNumber {
kInventoryObjectCamera = 36
};
+/**
+ * Indices for global game objects state, for better readability
+ */
enum ObjectStateIndex {
kBottleStateIndex = 0,
kLizardFedStateIndex = 1,
@@ -551,20 +554,19 @@ struct WalkData {
};
enum AnimBlend {
- kBlendCopy,
- kBlendLitSprite,
- kBlendLitSpriteNoShade,
- kBlendBehindIgor,
- kBlendBehindIgorAndText
+ kBlendCopy, // blit the entire rectangle
+ kBlendLitSprite, // Igor colors follow the roomâs masking and shading rules.
+ kBlendLitSpriteNoShade, // same as above, but no shading on igor
+ kBlendBehindIgor, // igor colors survive, the rest is replaced
+ kBlendBehindIgorAndText // igor colors AND text survive
};
class IgorEngine : public Engine {
public:
- typedef void (IgorEngine::*ExecuteActionProc)(int action);
- typedef void (IgorEngine::*UpdateRoomBackgroundProc)();
+ typedef void (IgorEngine::*ExecuteActionProc)(int action); // pointer to room action function
+ typedef void (IgorEngine::*UpdateRoomBackgroundProc)(); // pointer to function that executes on every frame
-
- typedef void (IgorEngine::*UpdateDialogueProc)(int action);
+ typedef void (IgorEngine::*UpdateDialogueProc)(int action); // pointer to function that executes on every frame during dialogue
void syncSoundSettings() override;
private:
@@ -597,17 +599,17 @@ private:
bool _eventQuitGame;
bool _gameStateLoaded;
+
// pass of the end credits: 0 for the first one (set when the ending is over), the pages are shown again after it
uint8 _creditsPass;
GameStateData _gameState;
+
uint8 _mazeLocation;
uint8 _mazeSavedLocation;
const MazeRoom *_mazeRoom;
int _mazeFlameFrame[2];
uint32 _nextTimer;
- // Speed multiplier, 1 = original timing. Divides the millisecond
- // deadlines in waitForTimer();
// Toggled with Ctrl+F (1 <-> kFastModeFactor), or set to any 1..kFastModeMaxFactor
// with the console's fast_mode command.
int _fastMode;
@@ -659,15 +661,23 @@ private:
int _dialogueDirtyRectY;
int _dialogueDirtyRectSize;
char _dialogueQuestions[MAX_DIALOGUE_QUESTIONS][2][41];
- uint16 _dialogueQuestionSounds[MAX_DIALOGUE_QUESTIONS];
char _dialogueReplies[MAX_DIALOGUE_REPLIES][51];
+ uint16 _dialogueQuestionSounds[MAX_DIALOGUE_QUESTIONS];
uint16 _dialogueReplySounds[MAX_DIALOGUE_REPLIES];
bool _dialogueEnded;
int _dialogueChoiceSelected;
uint8 _dialogueInfo[6];
uint8 _objectsState[112];
+ uint8 _inventoryImages[36];
+ uint8 _inventoryInfo[74];
+ char _verbPrepositions[3][7];
+ char _roomObjectNames[20][MAX_OBJECT_NAME_LENGTH];
+ char _globalObjectNames[37][MAX_OBJECT_NAME_LENGTH];
+ char _verbsName[9][MAX_VERB_NAME_LENGTH];
+
bool _part07FirstVisitDone;
+
// scratch of the room loops: the current ambient frame (a star in part 72, the screen in part 68)
uint8 _roomAmbientIndex;
// the two fireflies of room 69: the current frame of each and the steps of the first one since the second one started
@@ -691,12 +701,6 @@ private:
uint8 _part68LastDialogueCode;
bool _part68NpcPresent;
uint8 _parkLadyIdleStep;
- uint8 _inventoryImages[36];
- uint8 _inventoryInfo[74];
- char _verbPrepositions[3][7];
- char _roomObjectNames[20][MAX_OBJECT_NAME_LENGTH];
- char _globalObjectNames[37][MAX_OBJECT_NAME_LENGTH];
- char _verbsName[9][MAX_VERB_NAME_LENGTH];
uint8 _currentPalette[768];
uint8 _paletteBuffer[768];
@@ -704,12 +708,14 @@ private:
uint8 *_igorTempFrames;
RoomWalkBounds _roomWalkBounds;
- RoomClickFix _roomClickFix;
- int _roomClickFixBottom; // the last row the click fix scans
+ RoomWalkTargetRules _roomWalkTargetRules;
+ int _roomWalkTargetBottom; // the last row the click fix scans
+
// stride of the give matrix of the room when it differs from the use matrix (0: same)
int _roomGiveObjectSize;
RoomDataOffsets _roomDataOffsets;
UpdateDialogueProc _updateDialogue;
+
// palette indices used to draw cutscene dialogue text and its outline
uint8 _talkColorIndex;
uint8 _talkShadowIndex;
@@ -733,13 +739,11 @@ private:
void readTableFile();
-
void copyArea(uint8 *dst, int dstOffset, int dstPitch, const uint8 *src, int srcPitch, int w, int h, bool transparent = false);
void drawAnimRect(int dstOffset, int animOffset, int w, int h, bool alsoBackground = false, AnimBlend blend = kBlendCopy);
void animateLitAnimFrames(int srcOffset, int firstFrame, int lastFrame, int frameSize, int width, int height, int dstOffset, int delay, int soundFrame, int sound);
void updateIgorIdleAnimation(int fl);
-
void loadDialogueData(int dlg);
void loadMainTexts();
const char *getString(int id) const;
@@ -1501,6 +1505,8 @@ private:
void partMazeExitThroughStairs(const MazeAction &action);
void partMazeGoToNeighbor(int dir);
int partMazeGetMusicTrack() const;
+
+
void setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp, int yBottom = 143);
void partMainUpdateObjectState(int num);
@@ -1569,7 +1575,6 @@ private:
void handleIgorIdleAnimation();
-
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);
@@ -1585,8 +1590,9 @@ private:
void buildWalkPathAreaRightDirection(int srcX, int srcY, int dstX, int dstY);
void buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, int dstY);
typedef void (IgorEngine::*IgorMoveTick)();
- // tick: room effect that runs on every iteration while Igor walks (rooms with their own wait loop)
- bool waitForIgorMove(IgorMoveTick tick = 0, bool escapeSkips = false, bool forceSkip = false, int fixedPosNum = -1);
+
+ // tickFunc: function that runs on every iteration while Igor walks (rooms with their own wait loop)
+ bool waitForIgorMove(IgorMoveTick tickFunc = 0, bool escapeSkips = false, bool forceSkip = false, int fixedPosNum = -1);
void moveIgor(int pos, int frame);
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index 4d8b8aec560..27a46513ee0 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -24,6 +24,12 @@ namespace Igor {
void IgorEngine::part4ExecuteAction(int action) {
debugC(9, kDebugGame, "part4ExecuteAction %d", action);
+ if ((_game.flags & kFlagDemo) && (action == 102 || action == 103 || action == 104)) {
+ ADD_DIALOGUE_TEXT(102, 2);
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ return;
+ }
switch (action) {
case 101: // church
_currentPart = 120;
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index febc660a0bf..52fde771a23 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -43,12 +43,12 @@ void IgorEngine::setRoomWalkBounds(int x1, int y1, int x2, int y2,
}
void IgorEngine::setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp, int yBottom) {
- _roomClickFix.yMax = yMax;
- _roomClickFixBottom = yBottom;
- _roomClickFix.xMin = xMin;
- _roomClickFix.xMax = xMax;
- _roomClickFix.scanUp = scanUp;
- _roomClickFix.enabled = true;
+ _roomWalkTargetRules.yMax = yMax;
+ _roomWalkTargetBottom = yBottom;
+ _roomWalkTargetRules.xMin = xMin;
+ _roomWalkTargetRules.xMax = xMax;
+ _roomWalkTargetRules.scanUp = scanUp;
+ _roomWalkTargetRules.enabled = true;
}
void IgorEngine::buildWalkPath(int srcX, int srcY, int dstX, int dstY) {
@@ -1211,27 +1211,27 @@ void IgorEngine::fixWalkPosition(int *x, int *y) {
*y = yPos;
return;
}
- if (_roomClickFix.enabled) {
+ if (_roomWalkTargetRules.enabled) {
// The click is clamped, then the picture is scanned for the first walkable row strictly below it (the
// scan starts one row down, whatever the row is) and, if none is found down to the last row and the
// room says so, upwards from the last row.
int xPos = *x;
- if (_roomClickFix.xMax >= 0) {
- xPos = MIN(xPos, _roomClickFix.xMax);
+ if (_roomWalkTargetRules.xMax >= 0) {
+ xPos = MIN(xPos, _roomWalkTargetRules.xMax);
}
- if (_roomClickFix.xMin >= 0) {
- xPos = MAX(xPos, _roomClickFix.xMin);
+ if (_roomWalkTargetRules.xMin >= 0) {
+ xPos = MAX(xPos, _roomWalkTargetRules.xMin);
}
- int yPos = MIN(*y, _roomClickFix.yMax);
+ int yPos = MIN(*y, _roomWalkTargetRules.yMax);
do {
- if (yPos < _roomClickFixBottom) {
+ if (yPos < _roomWalkTargetBottom) {
++yPos;
}
if (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area > 0) {
break;
}
- } while (yPos != _roomClickFixBottom);
- if (_roomClickFix.scanUp && yPos == _roomClickFixBottom && _roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0) {
+ } while (yPos != _roomWalkTargetBottom);
+ if (_roomWalkTargetRules.scanUp && yPos == _roomWalkTargetBottom && _roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0) {
do {
--yPos;
} while (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0 && yPos > 0);
Commit: 8d4017eb15a1bf17e2b2b0d6df6f43d7a25f8521
https://github.com/scummvm/scummvm/commit/8d4017eb15a1bf17e2b2b0d6df6f43d7a25f8521
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:58+01:00
Commit Message:
IGOR: Import midi player from legacy engine
Changed paths:
A engines/igor/midi.cpp
A engines/igor/midi.h
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/sound.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 3be5be609a7..cdbce9f1106 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -29,6 +29,7 @@
#include "igor/igor.h"
#include "igor/console.h"
#include "igor/detection.h"
+#include "igor/midi.h"
namespace Igor {
@@ -70,16 +71,15 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
// _currentPart = 62;
// _currentPart = 40;
- // if (_game.flags & kFlagFloppy) {
- // _midiPlayer = new Midi(this);
- // } else {
- // _midiPlayer = 0;
- // }
+ _midiPlayer = nullptr;
+ _musicData = nullptr;
_fastMode = 1;
}
IgorEngine::~IgorEngine() {
+ delete _midiPlayer;
+ free(_musicData);
free(_resourceEntries);
free(_soundOffsets);
free(_screenVGA);
@@ -99,7 +99,6 @@ IgorEngine::~IgorEngine() {
// DebugMan.clearAllDebugChannels();
- // delete _midiPlayer;
delete _screen;
}
@@ -223,6 +222,8 @@ Common::Error IgorEngine::run() {
}
readTableFile();
+ if (_game.flags & kFlagDemo)
+ _midiPlayer = new MidiPlayer(_mixer);
loadMainTexts();
loadIgorFrames();
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index b8f33a6c865..fa94687b013 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -561,6 +561,8 @@ enum AnimBlend {
kBlendBehindIgorAndText // igor colors AND text survive
};
+class MidiPlayer;
+
class IgorEngine : public Engine {
public:
typedef void (IgorEngine::*ExecuteActionProc)(int action); // pointer to room action function
@@ -572,7 +574,8 @@ public:
private:
const IgorGameDescription *_gameDescription;
Common::RandomSource _randomSource;
- // MidiPlayer *_midiPlayer;
+ MidiPlayer *_midiPlayer;
+ uint8 *_musicData;
Common::File _ovlFile;
Common::File _sndFile;
diff --git a/engines/igor/midi.cpp b/engines/igor/midi.cpp
new file mode 100644
index 00000000000..b0150f0e68e
--- /dev/null
+++ b/engines/igor/midi.cpp
@@ -0,0 +1,362 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "common/endian.h"
+#include "common/textconsole.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(const 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
+ _numTracks = 1;
+ _tracks[0][0] = data + _midiDataOffset;
+ _ppqn = _ticksPerQuarter;
+ setTempo(500000);
+ setTrack(0);
+ return true;
+ }
+ return false;
+}
+
+void MidiParser_CTMF::parseNextEvent(EventInfo &info) {
+ info.start = _position._subtracks[0]._playPos;
+ info.delta = readVLQ(_position._subtracks[0]._playPos);
+
+ if ((_position._subtracks[0]._playPos[0] & 0xF0) >= 0x80) {
+ info.event = *_position._subtracks[0]._playPos++;
+ } else {
+ info.event = _position._subtracks[0]._runningStatus;
+ }
+
+ if ((info.event & 0x80) == 0) {
+ return;
+ }
+
+ _position._subtracks[0]._runningStatus = info.event;
+ switch (info.command()) {
+ case 0x8: // Note Off
+ case 0x9: // Note On
+ case 0xB: // Control Mode Change
+ info.basic.param1 = *_position._subtracks[0]._playPos++;
+ info.basic.param2 = *_position._subtracks[0]._playPos++;
+ if (info.command() == 0x9 && info.basic.param2 == 0) {
+ info.event = info.channel() | 0x80; // Note Off
+ }
+ return;
+ case 0xC: // Program Change
+ info.basic.param1 = *(_position._subtracks[0]._playPos++);
+ info.basic.param2 = 0;
+ return;
+ case 0xF:
+ switch (info.event & 15) {
+ case 0xF:
+ info.ext.type = *(_position._subtracks[0]._playPos++);
+ info.length = readVLQ(_position._subtracks[0]._playPos);
+ info.ext.data = _position._subtracks[0]._playPos;
+ _position._subtracks[0]._playPos += info.length;
+ return;
+ }
+ }
+ warning("MidiParser_CTMF::parseNextEvent: Unhandled event code %x", info.event);
+}
+
+int AdlibMidiDriver::open() {
+ MidiDriver_Emulated::open();
+ _opl = OPL::MAME::makeAdLibOPL(getRate());
+ if (!_opl)
+ error("Unable to initialize Igor AdLib music");
+ 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->playStream(Audio::Mixer::kMusicSoundType, &_mixerSoundHandle, this, -1,
+ Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO, true);
+ return 0;
+}
+
+void AdlibMidiDriver::close() {
+ _mixer->stopHandle(_mixerSoundHandle);
+ OPL::MAME::OPLDestroy(_opl);
+ _opl = nullptr;
+ _isOpen = false;
+}
+
+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);
+ OPL::MAME::YM3812UpdateOne(_opl, data, len);
+}
+
+void AdlibMidiDriver::adlibWrite(int port, int value) {
+ OPL::MAME::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(Audio::Mixer *mixer) : _isPlaying(false) {
+ _driver = new AdlibMidiDriver(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 = _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
new file mode 100644
index 00000000000..ccc3a034fb6
--- /dev/null
+++ b/engines/igor/midi.h
@@ -0,0 +1,157 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#ifndef IGOR_MIDI_H
+#define IGOR_MIDI_H
+
+#include "common/util.h"
+#include "common/mutex.h"
+
+#include "audio/softsynth/opl/mame.h"
+#include "audio/softsynth/emumidi.h"
+#include "audio/mididrv.h"
+#include "audio/midiparser.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(const byte *data, uint32 size) override;
+
+ AdlibInstrument _instruments[kMaxInstruments];
+ int _instrumentsCount;
+
+protected:
+
+ void decodeHeader(const uint8 *p);
+ void decodeAdlibInstrument(struct AdlibInstrument *ins, const uint8 *p);
+
+ void parseNextEvent(EventInfo &info) override;
+
+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), _opl(nullptr) {}
+ ~AdlibMidiDriver() {}
+
+ // MidiDriver
+ int open() override;
+ void close() override;
+ void send(uint32 b) override;
+ void metaEvent(byte type, const byte *data, uint16 length) override {}
+ void sysEx(const byte *msg, uint16 length) override {}
+ MidiChannel *allocateChannel() override { return 0; }
+ MidiChannel *getPercussionChannel() override { return 0; }
+
+ bool isStereo() const override { return false; }
+ int getRate() const override { return _mixer->getOutputRate(); }
+ void generateSamples(int16 *buf, int len) override;
+
+ 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);
+
+ OPL::MAME::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 MidiPlayer {
+public:
+
+ MidiPlayer(Audio::Mixer *mixer);
+ ~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
index 5ee05239a40..ee89ee26cdf 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -73,6 +73,7 @@ MODULE_OBJS = \
parts/part_margaret.o \
text.o \
part_main.o \
+ midi.o \
sound.o
# This module can be built as a plugin
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 1d95dc370ff..2d952bcea17 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -24,6 +24,7 @@
#include "common/config-manager.h"
#include "igor/igor.h"
+#include "igor/midi.h"
namespace Igor {
@@ -66,6 +67,14 @@ void IgorEngine::syncSoundSettings() {
}
}
+void IgorEngine::startMusic(int cmf) {
+ _midiPlayer->stopMusic();
+ free(_musicData);
+ int musicDataSize;
+ _musicData = loadData(cmf, nullptr, &musicDataSize);
+ _midiPlayer->playMusic(_musicData, musicDataSize);
+}
+
void IgorEngine::playMusic(int num, bool restart) {
debugC(9, kDebugEngine, "playMusic() %d", num);
if (_gameState.musicNum == num && !restart)
@@ -75,8 +84,16 @@ void IgorEngine::playMusic(int num, bool restart) {
_gameState.musicSequenceIndex = 1;
}
if (_game.flags & kFlagFloppy) {
- // TODO: the track number -> CMF file mapping is not known yet
- // startMusic(...);
+ if (_midiPlayer) {
+ 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 };
+ if (num < 0 || num >= (int)ARRAYSIZE(cmf) || cmf[num] == 0) {
+ // TODO: Restore the remaining demo music selections once verified.
+ return;
+ }
+ startMusic(cmf[num]);
+ } else {
+ // TODO: Verify the full floppy game's music resource mapping.
+ }
} else {
g_system->getAudioCDManager()->stop();
// the first CD track is the data track: music number N is CD track N + 1
Commit: cbe4de8b046f64bdf34ddddef9a0e48d8e4a368c
https://github.com/scummvm/scummvm/commit/cbe4de8b046f64bdf34ddddef9a0e48d8e4a368c
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:59+01:00
Commit Message:
IGOR: Selected the right music for demo
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_main.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_13.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_15.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_18.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_22.cpp
engines/igor/parts/part_23.cpp
engines/igor/parts/part_24.cpp
engines/igor/parts/part_25.cpp
engines/igor/parts/part_26.cpp
engines/igor/parts/part_27.cpp
engines/igor/parts/part_28.cpp
engines/igor/parts/part_30.cpp
engines/igor/parts/part_31.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_36.cpp
engines/igor/parts/part_37.cpp
engines/igor/parts/part_4.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_75.cpp
engines/igor/parts/part_90.cpp
engines/igor/parts/part_margaret.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index cdbce9f1106..a6c29303517 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -179,7 +179,7 @@ void IgorEngine::restart() {
memset(_roomActionsTable, 0, sizeof(_roomActionsTable));
_executeMainAction = 0;
_executeRoomAction = 0;
- // _previousMusic = 0;
+ _previousMusic = 0;
// _musicData = 0;
_scrollInventory = false;
_roomCursorOn = true;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index fa94687b013..a032def2c7b 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -576,6 +576,7 @@ private:
Common::RandomSource _randomSource;
MidiPlayer *_midiPlayer;
uint8 *_musicData;
+ int _previousMusic;
Common::File _ovlFile;
Common::File _sndFile;
@@ -1621,6 +1622,7 @@ private:
void debugApplyOverlay();
+ bool isCDVersion() const { return !(_game.flags & kFlagFloppy); }
int getPart() const { return _currentPart / 10; }
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; }
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 01c25c4249b..cb2743d5b8e 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -41,9 +41,8 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
_system->updateScreen();
}
- // wait till next timer if no param is passed, ticks if not
- // _fastMode divides the wall-clock deadlines. An absolute deadline avoids
- // accumulating rounding error when repeating short waits.
+ // wait till next timer if no param is passed, [ticks] if not
+ // _fastMode divides the wall-clock deadlines.
uint32 endTicks = deadline ? deadline : ((ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay / _fastMode);
do {
Common::Event ev;
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index ec1488ca713..2931fed3902 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -783,9 +783,18 @@ void IgorEngine::partMain() {
if (_gameState.shouldShowCutsceneCounter != 5) {
++_gameState.shouldShowCutsceneCounter;
} else {
- playMusic(8);
+ if (!isCDVersion()) {
+ if (_gameState.musicNum != 11) {
+ _previousMusic = _gameState.musicNum;
+ playMusic(11);
+ }
+ } else {
+ playMusic(8);
+ }
partMainMeanwhile();
partMargaret();
+ if (!isCDVersion() && _previousMusic != 11)
+ playMusic(_previousMusic, true);
_gameState.shouldShowCutsceneCounter = 0;
}
} while (_currentPart != kInvalidPart && !_eventQuitGame);
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index e88e4b5b1d6..20245bfb27c 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -449,6 +449,8 @@ void IgorEngine::part12EnterFromPath() {
}
void IgorEngine::part12EnterFromChurch() {
+ if (!isCDVersion())
+ playMusic(2, true);
part12ApplyObjectState(255);
_walkData[0].setPos(75, 89, 2, 0);
_walkData[0].setDefaultScale();
@@ -499,7 +501,7 @@ void IgorEngine::part12DrawPriestTalkingFrame(int frame) {
}
void IgorEngine::part12() {
- if (_currentPart != 122) {
+ if (_currentPart != 122 && isCDVersion()) {
playMusic(1);
}
_gameState.enableLight = 1;
diff --git a/engines/igor/parts/part_13.cpp b/engines/igor/parts/part_13.cpp
index b9d8c37705d..ef1fc4c04ef 100644
--- a/engines/igor/parts/part_13.cpp
+++ b/engines/igor/parts/part_13.cpp
@@ -172,6 +172,8 @@ void IgorEngine::part13EnterFromRight() {
}
void IgorEngine::part13EnterFromBelow() {
+ if (!isCDVersion())
+ playMusic(4, true);
part13ApplyObjectState(255);
_walkDataCurrentIndex = 0;
_walkCurrentFrame = 1;
@@ -198,7 +200,8 @@ void IgorEngine::part13EnterFromBelow() {
}
void IgorEngine::part13() {
- playMusic(3);
+ if (isCDVersion())
+ playMusic(3);
_gameState.enableLight = 1;
loadRoomData(PAL_InsideChurch, IMG_InsideChurch, BOX_InsideChurch, MSK_InsideChurch, TXT_InsideChurch);
loadActionData(DAT_InsideChurch);
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index e858619bd37..17820a710ab 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -308,6 +308,8 @@ void IgorEngine::part14EnterFromChurchBell() {
}
void IgorEngine::part14EnterFromMaze() {
+ if (!isCDVersion())
+ playMusic(4, true);
part14ApplyObjectState(255);
for (int i = 192 * 3; i <= 207 * 3; ++i) {
if (_paletteBuffer[i] > 5) {
@@ -516,7 +518,8 @@ void IgorEngine::part14PushStone(int screenOffset, int w, int h, int animOffset)
}
void IgorEngine::part14() {
- playMusic(3);
+ if (isCDVersion())
+ playMusic(3);
_gameState.enableLight = 1;
part14LoadRoom();
part14LoadAnimation();
diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp
index 214b3992f1e..32e2fb15a40 100644
--- a/engines/igor/parts/part_15.cpp
+++ b/engines/igor/parts/part_15.cpp
@@ -359,7 +359,8 @@ void IgorEngine::part15DrawTobiasIdleFrame(int frame) {
}
void IgorEngine::part15() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index 081d4ce5a9a..68325899c01 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -134,7 +134,8 @@ void IgorEngine::part16PhotoCutscene() {
waitForTimer(15);
}
fadeOut(768);
- playMusic(8);
+ if (isCDVersion())
+ playMusic(8);
_currentPart = 331;
part33();
memset(_currentPalette, 0, 768);
@@ -193,6 +194,8 @@ void IgorEngine::part16PhotoCutscene() {
_inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
_objectsState[kPhotoCutsceneSeenStateIndex] = 1;
_objectsState[kMargaretStateIndex] = kMargaretStatePhotoTaken;
+ if (!isCDVersion())
+ playMusic(3, true);
_currentPart = 261;
}
@@ -218,7 +221,8 @@ void IgorEngine::part16DrawTalkingFrame(int frame) {
}
void IgorEngine::part16() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 1;
part16LoadRoom();
part16LoadAnimation();
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index b5ee22d4001..64c4e5fd879 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -386,6 +386,8 @@ void IgorEngine::part17ChangePathZIndex(int lum) {
}
void IgorEngine::part17WalkFromCollege() {
+ if (!isCDVersion())
+ playMusic(2, true);
part17ApplyObjectState(255);
fadeIn(768);
_walkData[0].setPos(274, 68, 4, 1);
@@ -453,7 +455,8 @@ void IgorEngine::part17PhilipToIgor(int frame) {
}
void IgorEngine::part17() {
- playMusic(1);
+ if (isCDVersion())
+ playMusic(1);
_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 };
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index 71544cc7c8a..227d6fc06cc 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -138,7 +138,8 @@ void IgorEngine::part18WalkIn() {
}
void IgorEngine::part18() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 1;
part18LoadRoom();
part18LoadAnimation();
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index 8382ae2c4b6..835e2f78779 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -211,7 +211,8 @@ void IgorEngine::part19DrawTalkingFrame(int frame) {
}
void IgorEngine::part19() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index a3915aeff95..999e0d706a3 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -401,7 +401,8 @@ void IgorEngine::part21UpdateBackground() {
}
void IgorEngine::part21() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp
index 56453d6eaf8..98dda32e896 100644
--- a/engines/igor/parts/part_22.cpp
+++ b/engines/igor/parts/part_22.cpp
@@ -157,7 +157,8 @@ void IgorEngine::part22Enter() {
}
void IgorEngine::part22() {
- playMusic(3);
+ if (isCDVersion())
+ playMusic(3);
_gameState.enableLight = 1;
loadRoomData(PAL_BellChurch, IMG_BellChurch, BOX_BellChurch, MSK_BellChurch, TXT_BellChurch);
SET_PAL_240_48_1();
diff --git a/engines/igor/parts/part_23.cpp b/engines/igor/parts/part_23.cpp
index 969847d4c87..f78bad575f9 100644
--- a/engines/igor/parts/part_23.cpp
+++ b/engines/igor/parts/part_23.cpp
@@ -224,7 +224,8 @@ void IgorEngine::part23DrawLucasFrame(int frame) {
}
void IgorEngine::part23() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeCorridorLucas, IMG_CollegeCorridorLucas, BOX_CollegeCorridorLucas, MSK_CollegeCorridorLucas, TXT_CollegeCorridorLucas);
static const int anm[] = {
diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp
index fc14e2248ed..706377d0e3a 100644
--- a/engines/igor/parts/part_24.cpp
+++ b/engines/igor/parts/part_24.cpp
@@ -262,7 +262,8 @@ void IgorEngine::part24EnterFromChemistryClass() {
}
void IgorEngine::part24() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index 29a515c5977..6d451bf6536 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -178,7 +178,8 @@ void IgorEngine::part25DrawOpenDoor() {
}
void IgorEngine::part25() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeCorridorAnnouncementBoard, IMG_CollegeCorridorAnnouncementBoard, BOX_CollegeCorridorAnnouncementBoard, MSK_CollegeCorridorAnnouncementBoard, TXT_CollegeCorridorAnnouncementBoard);
static const int anm[] = { FRM_CollegeCorridorAnnouncementBoard1, FRM_CollegeCorridorAnnouncementBoard2, 0 };
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index 9aa3d9482b6..1ed15e2423a 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -219,7 +219,8 @@ void IgorEngine::part26DrawMissSullivanFrame(int frame) {
}
void IgorEngine::part26() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index 280ddf65991..cc315bc86e7 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -213,7 +213,8 @@ void IgorEngine::part27EnterFromLibrary() {
}
void IgorEngine::part27() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index df6f33e4668..c606ee28986 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -248,7 +248,8 @@ void IgorEngine::part28DrawFolder(int frame) {
}
void IgorEngine::part28() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index 2090d50c607..f0b9de90e5e 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -193,6 +193,8 @@ void IgorEngine::part30WalkInFromRight() {
}
void IgorEngine::part30LauraCutscene() {
+ if (!isCDVersion())
+ playMusic(3, true);
memset(_screenVGA + 46080, 0, 17920);
fadeIn(768);
part30LauraAndIgorBumpIntoEachOther();
@@ -269,7 +271,8 @@ void IgorEngine::part30SetLauraFrame(int frame) {
}
void IgorEngine::part30() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeStairsFirstFloor, IMG_CollegeStairsFirstFloor, BOX_CollegeStairsFirstFloor, MSK_CollegeStairsFirstFloor, TXT_CollegeStairsFirstFloor);
static const int anm[] = { FRM_CollegeStairsFirstFloor1, FRM_CollegeStairsFirstFloor2, 0 };
@@ -293,6 +296,8 @@ void IgorEngine::part30() {
} else if (_currentPart == 301) {
part30WalkInFromUpstairs();
} else if (_currentPart == 302) {
+ if (!isCDVersion())
+ playMusic(3, true);
fadeIn(768);
part30WalkInFromOutside();
} else if (_currentPart == 303) {
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index 694a41f3ff1..d1eab76311a 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -367,7 +367,8 @@ void IgorEngine::part31DrawOpenDoor() {
}
void IgorEngine::part31() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_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 };
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index 82989cb1440..adac5446012 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -262,6 +262,8 @@ void IgorEngine::part33ApplyObjectState(int num) {
}
void IgorEngine::part33HarrisonWalksOut() {
+ if (!isCDVersion())
+ playMusic(11, true);
memcpy(_screenLayer2, _screenVGA, 46080);
memcpy(_screenVGA, _screenLayer1, 46080);
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5255) - 1, _screenVGA, true);
@@ -344,7 +346,7 @@ void IgorEngine::part33LoadExtraTexts() {
}
void IgorEngine::part33() {
- if (_currentPart != 331) {
+ if (_currentPart != 331 && isCDVersion()) {
playMusic(2);
}
_gameState.enableLight = 1;
diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp
index cacc1786c6b..06c126829e0 100644
--- a/engines/igor/parts/part_36.cpp
+++ b/engines/igor/parts/part_36.cpp
@@ -106,7 +106,8 @@ void IgorEngine::part36DrawPen(int frame) {
}
void IgorEngine::part36() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 1;
loadRoomData(PAL_ChemistryClassroom, IMG_ChemistryClassroom, BOX_ChemistryClassroom, MSK_ChemistryClassroom, TXT_ChemistryClassroom);
static const int anm[] = { FRM_ChemistryClassroom1, FRM_ChemistryClassroom2, 0 };
diff --git a/engines/igor/parts/part_37.cpp b/engines/igor/parts/part_37.cpp
index 8da9a57539b..2e0ba7563f8 100644
--- a/engines/igor/parts/part_37.cpp
+++ b/engines/igor/parts/part_37.cpp
@@ -87,7 +87,8 @@ void IgorEngine::part37WalkIn() {
}
void IgorEngine::part37() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 1;
loadRoomData(PAL_PhysicsClassroom, IMG_PhysicsClassroom, BOX_PhysicsClassroom, MSK_PhysicsClassroom, TXT_PhysicsClassroom);
static const int anm[] = { FRM_PhysicsClassroom1, 0 };
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index 27a46513ee0..d3dfdc910be 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -69,6 +69,8 @@ void IgorEngine::part4() {
if (_objectsState[kStatuetteTaken2StateIndex] == 1) { // police custcene
_currentPart = 730;
+ if (!isCDVersion())
+ playMusic(11, true);
return;
}
@@ -76,6 +78,8 @@ void IgorEngine::part4() {
if (_objectsState[kFlaskLeftInPhillipLockerStateIndex] == 1) {
_objectsState[kFlaskLeftInPhillipLockerStateIndex] = 0;
_currentPart = 750;
+ if (!isCDVersion())
+ playMusic(11, true);
return;
}
_gameState.enableLight = 1;
@@ -88,10 +92,14 @@ void IgorEngine::part4() {
_objectsState[kPhillipLockerStateIndex] = 0;
memcpy(_screenVGA, _screenLayer1, 46080);
- playMusic(1);
+ if (isCDVersion())
+
+ playMusic(1);
if (!restoreRoomAfterLoad(false)) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
+ if (!isCDVersion())
+ playMusic(2);
_walkData[0].x = 160;
_walkData[0].y = 133;
_walkData[0].scaleWidth = 49;
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index b86a18f729e..84bbae2e787 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -108,7 +108,8 @@ void IgorEngine::part5WalkIgorToScene() {
}
void IgorEngine::part5() {
- playMusic(10);
+ if (isCDVersion())
+ playMusic(10);
_gameState.enableLight = 1;
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
SET_PAL_240_48_1();
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index 28dc1dc098b..da1a78e4a9c 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -272,7 +272,8 @@ void IgorEngine::part6DrawBackgroundOverPhotographer() {
}
void IgorEngine::part6() {
- playMusic(10);
+ if (isCDVersion())
+ playMusic(10);
debug("Entering part6");
_gameState.enableLight = 1;
diff --git a/engines/igor/parts/part_75.cpp b/engines/igor/parts/part_75.cpp
index de2c429666f..271dfa09fa4 100644
--- a/engines/igor/parts/part_75.cpp
+++ b/engines/igor/parts/part_75.cpp
@@ -51,7 +51,8 @@ void IgorEngine::part75DrawPhilipFrame(int frame) {
void IgorEngine::part75() {
const bool savingWasAllowed = _canSaveGame;
_canSaveGame = false;
- playMusic(8);
+ if (isCDVersion())
+ playMusic(8);
partMainMeanwhile();
_gameState.enableLight = 1;
_talkColorIndex = 255;
diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp
index 87627751559..f50418c4e76 100644
--- a/engines/igor/parts/part_90.cpp
+++ b/engines/igor/parts/part_90.cpp
@@ -51,7 +51,7 @@ void IgorEngine::part90() {
const uint16 duration = holdTicks[_currentPart - 900];
const char *str;
- if (_currentPart == 900) {
+ if (_currentPart == 900 && isCDVersion()) {
playMusic(14);
}
diff --git a/engines/igor/parts/part_margaret.cpp b/engines/igor/parts/part_margaret.cpp
index 7dfe0ca70bd..88368554264 100644
--- a/engines/igor/parts/part_margaret.cpp
+++ b/engines/igor/parts/part_margaret.cpp
@@ -51,7 +51,8 @@ void IgorEngine::partMargaretUpdateDialogue(int action) {
void IgorEngine::partMargaret() {
const bool savingWasAllowed = _canSaveGame;
_canSaveGame = false;
- playMusic(8);
+ if (isCDVersion())
+ playMusic(8);
_gameState.enableLight = 1;
VAR_MARGARET_ROOM_ANIM_COUNTER = _objectsState[kMargaretSceneStateIndex] + 1;
if (VAR_MARGARET_ROOM_ANIM_COUNTER == 9) {
Commit: d110d4127b7346d9ab1aa6b07ee050dca80b28c1
https://github.com/scummvm/scummvm/commit/d110d4127b7346d9ab1aa6b07ee050dca80b28c1
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:59+01:00
Commit Message:
IGOR: Implements demo options menu
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/options.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index a6c29303517..5f9dfd36820 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -78,6 +78,7 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
}
IgorEngine::~IgorEngine() {
+ _optionsMenuThumbnail.free();
delete _midiPlayer;
free(_musicData);
free(_resourceEntries);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index a032def2c7b..f9965daccdc 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -654,7 +654,7 @@ private:
int16 _currentPart;
bool _canSaveGame = true;
- const Graphics::Surface *_optionsMenuThumbnail = nullptr;
+ Graphics::Surface _optionsMenuThumbnail;
int _talkDelay;
int _talkSpeechCounter;
int _talkDelayCounter;
@@ -1655,9 +1655,9 @@ private:
public:
Graphics::Screen *_screen = nullptr;
bool copyOptionsMenuThumbnail(Graphics::Surface &thumb) const {
- if (!_optionsMenuThumbnail)
+ if (!_optionsMenuThumbnail.getPixels())
return false;
- thumb.copyFrom(*_optionsMenuThumbnail);
+ thumb.copyFrom(_optionsMenuThumbnail);
return true;
}
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index ca098504e9d..b9c0b984356 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+#include "audio/softsynth/pcspk.h"
#include "common/config-manager.h"
#include "common/events.h"
#include "graphics/scaler.h"
@@ -26,21 +27,6 @@
namespace Igor {
-class OptionsThumbnailScope {
- const Graphics::Surface *&_slot;
- const Graphics::Surface *_previous;
- Graphics::Surface _thumbnail;
-public:
- explicit OptionsThumbnailScope(const Graphics::Surface *&slot) : _slot(slot), _previous(slot) {
- if (::createThumbnailFromScreen(&_thumbnail))
- _slot = &_thumbnail;
- }
- ~OptionsThumbnailScope() {
- _slot = _previous;
- _thumbnail.free();
- }
-};
-
static const struct {
int y;
int h;
@@ -107,6 +93,7 @@ enum OptionsMenuText {
kOptionsSaveTitle,
kOptionsNoSavedGames,
kOptionsLoadTitle,
+ kOptionsUnavailable,
kOptionsTextCount
};
@@ -121,7 +108,7 @@ static const Page pages[] = {
{
{ kOptionsSave, kOptionsSaveTitle },
{ 67, 159 },
- 0,
+ 0, // todo: native save/load screens
0
},
{
@@ -150,23 +137,29 @@ static const Page pages[] = {
}
};
-
+// Load the texts from the resources of each game version
void IgorEngine::loadOptionsMenuTexts() {
if (!_optionsMenuTexts.empty())
return;
+ const bool demo = _game.flags & kFlagDemo;
+ _optionsMenuTexts.resize(kOptionsTextCount);
const struct {
int resource;
int count;
+ int firstText;
} groups[] = {
- { TXT_OptionsButtons, 5 },
- { TXT_OptionsSettings, 17 },
- { TXT_OptionsTitle, 1 },
- { TXT_OptionsQuit, 3 },
- { TXT_OptionsSaveTitle, 1 },
- { TXT_OptionsLoadTitle, 2 }
+ { TXT_OptionsButtons, 5, kOptionsSave },
+ { TXT_OptionsSettings, demo ? 12 : 17, kOptionsSoundOff },
+ { TXT_OptionsTitle, 1, kOptionsCtrlTitle },
+ { TXT_OptionsQuit, 3, kOptionsQuitTitle },
+ { TXT_OptionsSaveTitle, 1, kOptionsSaveTitle },
+ { TXT_OptionsLoadTitle, demo ? 1 : 2, demo ? kOptionsLoadTitle : kOptionsNoSavedGames },
+ { TXT_OptionsUnavailable, demo ? 1 : 0, kOptionsUnavailable }
};
for (uint i = 0; i < ARRAYSIZE(groups); ++i) {
+ if (groups[i].count == 0)
+ continue;
int size;
uint8 *data = loadData(groups[i].resource, 0, &size);
int offset = 0;
@@ -174,7 +167,12 @@ void IgorEngine::loadOptionsMenuTexts() {
if (offset >= size || data[offset] > size - offset - 1)
error("Invalid options menu text resource %d", groups[i].resource);
int length = data[offset++];
- _optionsMenuTexts.push_back(Common::String((const char *)data + offset, length));
+ int text = groups[i].firstText + j;
+ if (demo && groups[i].resource == TXT_OptionsSettings && j >= 3) {
+ // The demo has one text-only label in place of the CD speech choices.
+ text = kOptionsSpeechUnavailable + j - 3;
+ }
+ _optionsMenuTexts[text] = Common::String((const char *)data + offset, length);
offset += length;
}
if (offset != size)
@@ -186,6 +184,7 @@ void IgorEngine::loadOptionsMenuTexts() {
void IgorEngine::drawOptionsMenuText(int text, int x, int y, int color) {
const char *str = _optionsMenuTexts[text].c_str();
+ // center horizontally
_font.drawString(_screenTextLayer, str, x - _font.getStringWidth(str) / 2, y, color, -1, 0);
}
@@ -195,9 +194,10 @@ void IgorEngine::handleOptionsMenu_paintQuit() {
}
bool IgorEngine::handleOptionsMenu_handleKeyDownQuit(int key) {
- if (key == Common::KEYCODE_s)
+ const int yesKey = (_game.language == Common::ES_ESP) ? Common::KEYCODE_s : Common::KEYCODE_y;
+ if (key == yesKey)
_currentPart = kInvalidPart;
- return key == Common::KEYCODE_s || key == Common::KEYCODE_n || key == Common::KEYCODE_ESCAPE;
+ return key == yesKey || key == Common::KEYCODE_n || key == Common::KEYCODE_ESCAPE;
}
static void redrawRect(uint8 *dst, int num, bool border) {
@@ -217,6 +217,19 @@ static void redrawRect(uint8 *dst, int num, bool border) {
}
void IgorEngine::handleOptionsMenu_paintCtrl() {
+ if (_game.flags & kFlagDemo) {
+ const int labels[] = {
+ kOptionsSoundOff + CLIP<int>(_gameState.configSoundEnabled, 0, 2),
+ kOptionsSpeechUnavailable,
+ kOptionsMusicOn,
+ kOptionsSpeedVerySlow + CLIP<int>(_gameState.talkSpeed, 1, 5) - 1 //choose option from the enum with base value + delta
+ };
+ for (int row = 1; row <= 4; ++row) {
+ redrawRect(_screenTextLayer, row, row == 4);
+ drawOptionsMenuText(labels[row - 1], 159, 22 * row + 4, row == 4 ? 0xF6 : 0xF7);
+ }
+ return;
+ }
const int talkMode = getTalkMode();
const int labels[] = {
kOptionsSoundOff + CLIP<int>(_gameState.configSoundEnabled, 0, 2),
@@ -234,6 +247,15 @@ void IgorEngine::handleOptionsMenu_paintCtrl() {
}
bool IgorEngine::handleOptionsMenu_handleKeyDownCtrl(int key) {
+ if (_game.flags & kFlagDemo) {
+ if (key == Common::KEYCODE_ESCAPE)
+ return true;
+ if (key == Common::KEYCODE_RETURN) {
+ _gameState.talkSpeed = _gameState.talkSpeed == 5 ? 1 : _gameState.talkSpeed + 1;
+ handleOptionsMenu_paintCtrl();
+ }
+ return false;
+ }
const int firstRow = (_game.flags & kFlagTalkie) ? 1 : 4;
const int lastRow = getTalkMode() == kTalkModeTextOnly ? 4 : 3;
switch (key) {
@@ -290,9 +312,14 @@ static void drawButtonsBar(uint8 *dst, const uint8 *src) {
void IgorEngine::handleOptionsMenu() {
// Retain the gameplay view before the menu draws or dims its palette.
- OptionsThumbnailScope thumbnailScope(_optionsMenuThumbnail);
+ _optionsMenuThumbnail.free();
+ ::createThumbnailFromScreen(&_optionsMenuThumbnail);
loadOptionsMenuTexts();
PauseToken pauseToken = pauseEngine();
+
+ Audio::PCSpeaker speaker;
+ const bool speakerReady = (_game.flags & kFlagFloppy) && speaker.init();
+
hideCursor();
// End the room's spoken line before reusing its text backing store.
if (_gameState.dialogueTextRunning) {
@@ -358,7 +385,8 @@ void IgorEngine::handleOptionsMenu() {
break;
case Common::EVENT_KEYDOWN:
if (focusOnPage) {
- if ((this->*pages[currentPage].handleKeyDownProc)(ev.kbd.keycode)) {
+ const bool unavailable = (_game.flags & kFlagDemo) && (currentPage == kPageSave || currentPage == kPageLoad);
+ if (unavailable || (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);
@@ -371,11 +399,13 @@ void IgorEngine::handleOptionsMenu() {
menuLoop = false;
break;
case Common::KEYCODE_RETURN:
- if (currentPage == kPageSave) {
+ if (currentPage == kPageSave && !(_game.flags & kFlagDemo)) {
saveGameDialog();
- } else if (currentPage == kPageLoad) {
- if (loadGameDialog())
+ } else if (currentPage == kPageLoad && !(_game.flags & kFlagDemo)) {
+ if (loadGameDialog()) {
+ _optionsMenuThumbnail.free();
return;
+ }
} else if (currentPage == kPagePlay) {
menuLoop = false;
} else {
@@ -386,7 +416,17 @@ void IgorEngine::handleOptionsMenu() {
drawOptionsMenuText(pages[currentPage].captions[1], pages[currentPage].xPos[1], yPosCaption, 0xFB);
if (currentPage == kPageCtrl)
_optionsControlRow = (_game.flags & kFlagTalkie) ? 1 : 4;
- (this->*pages[currentPage].paintProc)();
+ if ((_game.flags & kFlagDemo) && (currentPage == kPageSave || currentPage == kPageLoad)) {
+ drawOptionsMenuText(kOptionsUnavailable, 159, 70 - 16, 0xF6);
+ _system->copyRectToScreen(_screenTextLayer, 320, 0, 15, 320, 115);
+ _system->updateScreen();
+ // The unavailable page requests a PCSpeaker beep before accepting another key.
+ if (speakerReady)
+ speaker.playQueue(Audio::PCSpeaker::kWaveFormSquare, 1193182.0f / 1320, 333000);
+ _system->delayMillis(333);
+ } else {
+ (this->*pages[currentPage].paintProc)();
+ }
focusOnPage = true;
}
break;
@@ -420,6 +460,7 @@ void IgorEngine::handleOptionsMenu() {
_system->updateScreen();
}
+ _optionsMenuThumbnail.free();
_inputVars[kInputClick] = 0;
_inputVars[kInputRightClick] = 0;
_inputVars[kInputSkipDialogue] = 0;
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 957891364de..273d105f7f4 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -899,5 +899,6 @@
#define TXT_OptionsQuit 1228
#define TXT_OptionsSaveTitle 1229
#define TXT_OptionsLoadTitle 1230
+#define TXT_OptionsUnavailable 1232
#endif // IGOR_RESOURCE_IDS
Commit: b7ffbd4926e427ef788a5a3ec156a78e85103857
https://github.com/scummvm/scummvm/commit/b7ffbd4926e427ef788a5a3ec156a78e85103857
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:06:59+01:00
Commit Message:
IGOR: For non-talkies, skip non-existant speech tables to avoid a crash
Changed paths:
engines/igor/resource.cpp
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 5e1105447ce..acfa0a745e2 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -130,27 +130,31 @@ void IgorEngine::loadDialogueData(int dlg) {
assert(dialogueDataSize <= (int)sizeof(_gameState.dialogueData));
memcpy(_gameState.dialogueData, p, dialogueDataSize);
assert(_roomDataOffsets.dlg.questionsSize <= MAX_DIALOGUE_QUESTIONS);
- // A zero speech layout retains the legacy packed-tail layout for dialogue
- // rooms that have not yet had their original offsets added to RoomDataOffsets.
- int questionSoundsOffset = _roomDataOffsets.dlg.questionSoundsOffset;
- int replySoundsOffset = _roomDataOffsets.dlg.replySoundsOffset;
- int replySoundsSize = _roomDataOffsets.dlg.replySoundsSize;
- if (questionSoundsOffset == 0) {
- // The packed tail shares the last question word with the reply table's
- // leading residue word.
- questionSoundsOffset = dataSize - (_roomDataOffsets.dlg.questionsSize + _roomDataOffsets.dlg.repliesSize + 1) * 2;
- replySoundsOffset = questionSoundsOffset + _roomDataOffsets.dlg.questionsSize * 2;
- replySoundsSize = _roomDataOffsets.dlg.repliesSize;
- }
- assert(questionSoundsOffset >= 0);
- assert(questionSoundsOffset + (_roomDataOffsets.dlg.questionsSize + 1) * 2 <= dataSize);
- for (int i = 0; i < _roomDataOffsets.dlg.questionsSize; ++i) {
- _dialogueQuestionSounds[i] = READ_LE_UINT16(p + questionSoundsOffset + (i + 1) * 2);
- }
assert(_roomDataOffsets.dlg.repliesSize <= MAX_DIALOGUE_REPLIES);
- assert(replySoundsOffset + (replySoundsSize + 1) * 2 <= dataSize);
- for (int i = 0; i < replySoundsSize; ++i) {
- _dialogueReplySounds[i] = READ_LE_UINT16(p + replySoundsOffset + (i + 1) * 2);
+ memset(_dialogueQuestionSounds, 0, sizeof(_dialogueQuestionSounds));
+ memset(_dialogueReplySounds, 0, sizeof(_dialogueReplySounds));
+ if (_game.flags & kFlagTalkie) {
+ // A zero speech layout retains the legacy packed-tail layout for dialogue
+ // rooms that have not yet had their original offsets added to RoomDataOffsets.
+ int questionSoundsOffset = _roomDataOffsets.dlg.questionSoundsOffset;
+ int replySoundsOffset = _roomDataOffsets.dlg.replySoundsOffset;
+ int replySoundsSize = _roomDataOffsets.dlg.replySoundsSize;
+ if (questionSoundsOffset == 0) {
+ // The packed tail shares the last question word with the reply table's
+ // leading residue word.
+ questionSoundsOffset = dataSize - (_roomDataOffsets.dlg.questionsSize + _roomDataOffsets.dlg.repliesSize + 1) * 2;
+ replySoundsOffset = questionSoundsOffset + _roomDataOffsets.dlg.questionsSize * 2;
+ replySoundsSize = _roomDataOffsets.dlg.repliesSize;
+ }
+ assert(questionSoundsOffset >= 0);
+ assert(questionSoundsOffset + (_roomDataOffsets.dlg.questionsSize + 1) * 2 <= dataSize);
+ for (int i = 0; i < _roomDataOffsets.dlg.questionsSize; ++i) {
+ _dialogueQuestionSounds[i] = READ_LE_UINT16(p + questionSoundsOffset + (i + 1) * 2);
+ }
+ assert(replySoundsOffset + (replySoundsSize + 1) * 2 <= dataSize);
+ for (int i = 0; i < replySoundsSize; ++i) {
+ _dialogueReplySounds[i] = READ_LE_UINT16(p + replySoundsOffset + (i + 1) * 2);
+ }
}
for (int i = 0; i < _roomDataOffsets.dlg.questionsSize; ++i) {
for (int n = 0; n < 2; ++n) {
Commit: 9220f015f39b58f42436ee6d4cd1dee59ed164fa
https://github.com/scummvm/scummvm/commit/9220f015f39b58f42436ee6d4cd1dee59ed164fa
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:00+01:00
Commit Message:
IGOR: Add action counter for demo 1.10
Changed paths:
engines/igor/igor.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 5f9dfd36820..8de5682934c 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -252,9 +252,12 @@ void IgorEngine::enterPartLoop() {
showCursor();
}
_gameState.igorMoving = false;
- // if (_game.version == kIdEngDemo110) {
- // CHECK_FOR_END_OF_DEMO();
- // }
+ if (_game.version == kIdEngDemo110 && _demoActionsCounter >= 10) {
+ ADD_DIALOGUE_TEXT(104, 2);
+ ADD_DIALOGUE_TEXT(106, 2);
+ SET_DIALOGUE_TEXT(1, 2);
+ startIgorDialogue();
+ }
}
bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
Commit: 1ccbf371b4941b6df2ed39841917cf0399b656e6
https://github.com/scummvm/scummvm/commit/1ccbf371b4941b6df2ed39841917cf0399b656e6
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:00+01:00
Commit Message:
IGOR: Bring in shareware slideshow from legacy engine
Changed paths:
A engines/igor/parts/part_95.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index f9965daccdc..c1756c7b774 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1535,6 +1535,7 @@ private:
void part85AnimateIgorHead(int frame);
// Splash screens
+ void part95();
void part90();
void part90FadePalette(bool fadeInColors);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index ee89ee26cdf..baca8e664f6 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -67,6 +67,7 @@ MODULE_OBJS = \
parts/part_81.o \
parts/part_85.o \
parts/part_90.o \
+ parts/part_95.o \
parts/part_credits.o \
parts/part_maze.o \
parts/part_maze_data.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 2931fed3902..9bab1e376cd 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -798,6 +798,14 @@ void IgorEngine::partMain() {
_gameState.shouldShowCutsceneCounter = 0;
}
} while (_currentPart != kInvalidPart && !_eventQuitGame);
+ if (_game.flags & kFlagDemo) {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
+ for (_currentPart = kSharewarePart; !_eventQuitGame && _currentPart <= kSharewarePart + 6; ++_currentPart)
+ part95();
+ _currentPart = kInvalidPart;
+ _canSaveGame = savingWasAllowed;
+ }
}
/**
diff --git a/engines/igor/parts/part_95.cpp b/engines/igor/parts/part_95.cpp
new file mode 100644
index 00000000000..2f3e44debd2
--- /dev/null
+++ b/engines/igor/parts/part_95.cpp
@@ -0,0 +1,223 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+#include "igor/igor.h"
+#include "common/system.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 },
+};
+
+static const struct {
+ int strId;
+ int offset;
+ int length;
+ int extraSpacing;
+} sharewareHighlights[] = {
+ { STR_SharewareOrder1, 34, 6, 0 },
+ { STR_SharewareOrder2, 0, 5, 0 },
+ { STR_SharewareOrder3, 11, 5, 0 },
+ { STR_SharewareShipping7, 7, 14, 0 },
+ { STR_SharewareShipping10, 16, 14, 5 },
+ { STR_SharewareOptikAddress7, 13, 25, 0 },
+ { STR_SharewareOptikAddress8, 5, 14, 0 },
+ { STR_SharewarePlaceOrder, 19, 14, 0 },
+ { STR_SharewareOrder4, 19, 14, 0 },
+};
+
+void IgorEngine::part95() {
+ 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 + ((_game.version == kIdEngDemo110) ? 29 : 28) * 320);
+ if (_game.version == kIdEngDemo110) {
+ startStr = 0;
+ endStr = 6;
+ }
+ break;
+ case 951:
+ loadData(PAL_Shareware2, _paletteBuffer);
+ loadData(IMG_Shareware2, _screenVGA + ((_game.version == kIdEngDemo110) ? 29 : 28) * 320);
+ if (_game.version == kIdEngDemo110) {
+ startStr = 7;
+ endStr = 12;
+ }
+ break;
+ case 952:
+ loadData(PAL_Shareware3, _paletteBuffer);
+ loadData(IMG_Shareware3, _screenVGA + ((_game.version == kIdEngDemo110) ? 29 : 28) * 320);
+ if (_game.version == kIdEngDemo110) {
+ startStr = 13;
+ endStr = 20;
+ }
+ break;
+ case 953:
+ loadData(PAL_Shareware4, _paletteBuffer);
+ loadData(IMG_Shareware4, _screenVGA + ((_game.version == kIdEngDemo110) ? 29 : 28) * 320);
+ if (_game.version == kIdEngDemo110) {
+ startStr = 21;
+ endStr = 28;
+ }
+ break;
+ case 954:
+ loadData(PAL_Shareware5, _paletteBuffer);
+ loadData(IMG_Shareware5, _screenVGA + ((_game.version == kIdEngDemo110) ? 29 : 28) * 320);
+ if (_game.version == kIdEngDemo110) {
+ startStr = 29;
+ endStr = 36;
+ }
+ break;
+ case 955:
+ loadData(PAL_Shareware6, _paletteBuffer);
+ loadData(IMG_Shareware6, _screenVGA + ((_game.version == kIdEngDemo110) ? 29 : 28) * 320);
+ if (_game.version == kIdEngDemo110) {
+ startStr = 37;
+ endStr = 43;
+ }
+ break;
+ case 956:
+ loadData(PAL_Shareware7, _paletteBuffer);
+ loadData(IMG_Shareware7, _screenVGA + ((_game.version == kIdEngDemo110) ? 29 : 28) * 320);
+ if (_game.version == kIdEngDemo110) {
+ startStr = 44;
+ endStr = 52;
+ }
+ break;
+ }
+ if (startStr != -1) {
+ for (int i = startStr; i <= endStr; ++i) {
+ const SharewareScreenString *s = &STR_SHAREWARE[i];
+ const char *str = getString(s->strId);
+ const int x = (320 - _font.getStringWidth(str)) / 2;
+ bool highlighted = false;
+ for (uint j = 0; j < ARRAYSIZE(sharewareHighlights); ++j) {
+ if (sharewareHighlights[j].strId == s->strId) {
+ const Common::String prefix(str, sharewareHighlights[j].offset);
+ const Common::String text(str + sharewareHighlights[j].offset, sharewareHighlights[j].length);
+ const int highlightX = x + _font.getStringWidth(prefix.c_str()) + sharewareHighlights[j].extraSpacing;
+ _font.drawString(_screenVGA, prefix.c_str(), x, s->y, s->color, 0, 0);
+ _font.drawString(_screenVGA, text.c_str(), highlightX, s->y, s->color == 240 ? 239 : 223, 0, 0);
+ _font.drawString(_screenVGA, str + sharewareHighlights[j].offset + sharewareHighlights[j].length,
+ highlightX + _font.getStringWidth(text.c_str()), s->y, s->color, 0, 0);
+ highlighted = true;
+ break;
+ }
+ }
+ if (!highlighted)
+ _font.drawString(_screenVGA, str, x, s->y, s->color, 0, 0);
+ }
+ }
+ part90FadePalette(true);
+ _inputVars[kInputEscape] = 0;
+ _inputVars[kInputConfirm] = 0;
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputRightClick] = 0;
+ const uint32 timerStart = _system->getMillis();
+ for (int i = 0; !_eventQuitGame && i < 3000; ++i) {
+ const uint32 deadline = timerStart + (uint64)(i + 1) * 1000 / kTickDelay / _fastMode;
+ waitForTimer(0, true, deadline);
+ _gameTicks = (_gameTicks + 1) & 63;
+ if (_inputVars[kInputEscape] || _inputVars[kInputConfirm] || _inputVars[kInputClick] || _inputVars[kInputRightClick])
+ break;
+ _inputVars[kInputEscape] = 0;
+ _inputVars[kInputConfirm] = 0;
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputRightClick] = 0;
+ }
+ _inputVars[kInputEscape] = 0;
+ _inputVars[kInputConfirm] = 0;
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputRightClick] = 0;
+ part90FadePalette(false);
+}
+
+} // namespace Igor
Commit: d65eb2a178833179646ac1ce7e01781bea4692e7
https://github.com/scummvm/scummvm/commit/d65eb2a178833179646ac1ce7e01781bea4692e7
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:00+01:00
Commit Message:
IGOR: Fix palette issue on the demo map
Changed paths:
engines/igor/parts/part_4.cpp
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index d3dfdc910be..aec7331a34c 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -84,6 +84,10 @@ void IgorEngine::part4() {
}
_gameState.enableLight = 1;
loadRoomData(PAL_Map, IMG_Map, BOX_Map, MSK_Map, TXT_Map);
+ if (!isCDVersion()) {
+ SET_PAL_208_96_1();
+ SET_PAL_240_48_1();
+ }
loadActionData(DAT_Map);
_roomDataOffsets = PART_04_ROOM_DATA_OFFSETS;
partMainSetExecuteAction(1, &IgorEngine::part4ExecuteAction);
Commit: 139647dfdd1c9e37cacfdfeec24649a44a6c991a
https://github.com/scummvm/scummvm/commit/139647dfdd1c9e37cacfdfeec24649a44a6c991a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:01+01:00
Commit Message:
IGOR: Remove debug overlays
Changed paths:
R engines/igor/debug.cpp
engines/igor/console.cpp
engines/igor/detection_tables.h
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/module.mk
engines/igor/options.cpp
diff --git a/engines/igor/console.cpp b/engines/igor/console.cpp
index 24254132719..38c6a39d6f1 100644
--- a/engines/igor/console.cpp
+++ b/engines/igor/console.cpp
@@ -26,12 +26,6 @@ namespace Igor {
Console::Console() : GUI::Debugger() {
registerCmd("test", WRAP_METHOD(Console, Cmd_test));
- registerCmd("paint_walk", WRAP_METHOD(Console, Cmd_paintWalk));
- registerCmd("paint_hotspots", WRAP_METHOD(Console, Cmd_paintHotspots));
- registerCmd("paint_y1lum", WRAP_METHOD(Console, Cmd_paintY1Lum));
- registerCmd("paint_y2lum", WRAP_METHOD(Console, Cmd_paintY2Lum));
- registerCmd("paint_deltalum", WRAP_METHOD(Console, Cmd_paintDeltaLum));
- registerCmd("paint_off", WRAP_METHOD(Console, Cmd_paintOff));
registerCmd("fast_mode", WRAP_METHOD(Console, Cmd_fastMode));
registerCmd("room", WRAP_METHOD(Console, Cmd_changePart));
registerCmd("give", WRAP_METHOD(Console, Cmd_addObjectToInventory));
@@ -46,44 +40,6 @@ bool Console::Cmd_test(int argc, const char **argv) {
return true;
}
-bool Console::Cmd_paintWalk(int argc, const char **argv) {
- debugPrintf("Overlay: walk areas (BOX .area != 0); colours are the area id\n");
- g_engine->debugPaintWalkAreas();
- return true;
-}
-
-bool Console::Cmd_paintHotspots(int argc, const char **argv) {
- debugPrintf("Overlay: hotspots (BOX .object != 0); colours are the object id\n");
- g_engine->debugPaintHotspots();
- return true;
-}
-
-bool Console::Cmd_paintY1Lum(int argc, const char **argv) {
- debugPrintf("Overlay: y1Lum (BOX .y1Lum != 0); colour index is value / 16\n");
- g_engine->debugPaintY1Lum();
- return true;
-}
-
-bool Console::Cmd_paintY2Lum(int argc, const char **argv) {
-
- debugPrintf("Overlay: y2Lum (BOX .y2Lum != 0); colour index is value / 16\n");
- g_engine->debugPaintY2Lum();
- return true;
-}
-
-bool Console::Cmd_paintDeltaLum(int argc, const char **argv) {
-
- debugPrintf("Overlay: deltaLum (BOX .deltaLum != 0); colour index is value & 0x0F\n");
- g_engine->debugPaintDeltaLum();
- return true;
-}
-
-bool Console::Cmd_paintOff(int argc, const char **argv) {
- g_engine->debugClearOverlay();
- debugPrintf("Overlay off\n");
- return true;
-}
-
bool Console::Cmd_fastMode(int argc, const char **argv) {
if (argc != 2) {
diff --git a/engines/igor/debug.cpp b/engines/igor/debug.cpp
deleted file mode 100644
index a05bb37c93c..00000000000
--- a/engines/igor/debug.cpp
+++ /dev/null
@@ -1,141 +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 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "igor/igor.h"
-#include "common/system.h"
-#include "graphics/paletteman.h"
-
-namespace Igor {
-
-// Debug overlays for the scene mask.
-//
-// The decoded MSK (kept in _screenLayer2, see SCENE_LAYERS_MASK_AREAS.md) holds
-// a region id per pixel; that id indexes _roomObjectAreasTable (the BOX table).
-// These overlays recolour the regions so the data is visible on screen:
-//
-// debugPaintWalkAreas() -> regions whose BOX record has area != 0
-// debugPaintHotspots() -> regions whose BOX record has object != 0
-// debugPaintY1Lum() -> regions whose BOX record has y1Lum != 0
-// debugPaintY2Lum() -> regions whose BOX record has y2Lum != 0
-// debugPaintDeltaLum() -> regions whose BOX record has deltaLum != 0
-//
-// y1Lum / y2Lum are the depth thresholds of the enableLight == 1 shading
-// (`wd->y > y1Lum && wd->y <= y2Lum`, see ROOM_LIGHTING.md) and are compared
-// against Igor's scanline, so they are quantised into 16 buckets of 16 lines
-// (value >> 4). deltaLum is the amount subtracted from the pixel colour, whose
-// observed range is 0..15 (e.g. part_10.cpp:62 sets 3), so its low nibble is
-// painted directly. Regions with a zero value are left untouched, which also
-// means "no threshold" and "no darkening" show up as background.
-// Each region/object id gets a distinct colour from the 16-entry ramp written
-// to palette entries 240..255, so different walk areas (and different objects)
-// are told apart. debugClearOverlay() restores those palette entries from
-// _currentPalette.
-//
-// The overlay is (re)applied by debugApplyOverlay(), called from waitForTimer()
-// right before the frame is presented, so it survives scene redraws and Igor
-// movement. It composites onto _screenVGA's top 144 rows into a scratch buffer;
-// _screenVGA itself is left untouched.
-
-static const uint8 kDebugOverlayPalette[16 * 3] = {
- 63, 0, 0, 63, 32, 0, 63, 63, 0, 32, 63, 0,
- 0, 63, 0, 0, 63, 32, 0, 63, 63, 0, 32, 63,
- 0, 0, 63, 32, 0, 63, 63, 0, 63, 63, 0, 32,
- 63, 63, 63, 32, 32, 32, 63, 32, 32, 32, 63, 32
-};
-
-void IgorEngine::debugPaintWalkAreas() {
- _debugOverlayMode = kOverlayWalkAreas;
- debugApplyOverlay();
-}
-
-void IgorEngine::debugPaintHotspots() {
- _debugOverlayMode = kOverlayHotspots;
- debugApplyOverlay();
-}
-
-void IgorEngine::debugPaintY1Lum() {
- _debugOverlayMode = kOverlayY1Lum;
- debugApplyOverlay();
-}
-
-void IgorEngine::debugPaintY2Lum() {
- _debugOverlayMode = kOverlayY2Lum;
- debugApplyOverlay();
-}
-
-void IgorEngine::debugPaintDeltaLum() {
- _debugOverlayMode = kOverlayDeltaLum;
- debugApplyOverlay();
-}
-
-void IgorEngine::debugClearOverlay() {
- _debugOverlayMode = kOverlayOff;
- // Undo the palette ramp written by debugApplyOverlay().
- setPaletteRange(240, 255);
-}
-
-void IgorEngine::debugApplyOverlay() {
- if (_debugOverlayMode == kOverlayOff) {
- return;
- }
-
- // Recolour palette entries 240..255 (6-bit -> 8-bit, same expansion as
- // updatePalette()) so each id is a distinct colour.
- uint8 pal[16 * 3];
- for (int i = 0; i < 16 * 3; ++i) {
- uint8 v = kDebugOverlayPalette[i];
- pal[i] = (v << 2) | (v >> 4);
- }
- _system->getPaletteManager()->setPalette(pal, 240, 16);
-
- memcpy(_debugOverlayBuffer, _screenVGA, 320 * 144);
- for (int y = 0; y < 144; ++y) {
- const uint8 *mask = _screenLayer2 + y * 320;
- uint8 *dst = _debugOverlayBuffer + y * 320;
- for (int x = 0; x < 320; ++x) {
- const RoomObjectArea &roa = _roomObjectAreasTable[mask[x]];
- uint8 id;
- switch (_debugOverlayMode) {
- case kOverlayWalkAreas:
- id = roa.area;
- break;
- case kOverlayHotspots:
- id = roa.object;
- break;
- case kOverlayY1Lum:
- id = roa.y1Lum >> 4;
- break;
- case kOverlayY2Lum:
- id = roa.y2Lum >> 4;
- break;
- default:
- id = roa.deltaLum & 0x0F;
- break;
- }
- if (id != 0) {
- dst[x] = 240 + (id & 0x0F);
- }
- }
- }
- _system->copyRectToScreen(_debugOverlayBuffer, 320, 0, _screenVGAVOffset, 320, 144);
-}
-
-} // End of namespace Igor
diff --git a/engines/igor/detection_tables.h b/engines/igor/detection_tables.h
index e8f96148539..331284db93e 100644
--- a/engines/igor/detection_tables.h
+++ b/engines/igor/detection_tables.h
@@ -100,6 +100,25 @@ const IgorGameDescription gameDescriptions[] = {
"IGOR.FSD"
},
+ {
+ {
+ "igor",
+ "Floppy",
+ AD_ENTRY2s(
+ "IGOR.DAT", "dbbac4257430da5d616ae946a37750ef", 8819339,
+ "IGOR.FSD", "d081e286da14913379f0d7f58a6a5686", 1324850
+ ),
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ ADGF_UNSTABLE,
+ GUIO1(GUIO_NOSPEECH)
+ },
+ kIdEngFloppy,
+ kFlagFloppy,
+ "IGOR.DAT",
+ "IGOR.FSD"
+ },
+
{ AD_TABLE_END_MARKER, 0, 0, nullptr, nullptr }
};
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 8de5682934c..acd443bdc2b 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -56,7 +56,6 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
_inventoryPanelBuffer = (uint8 *)malloc(9600 * 2);
_inventoryImagesBuffer = (uint8 *)malloc(48000);
_verbsPanelBuffer = (uint8 *)malloc(3840);
- _debugOverlayBuffer = (uint8 *)malloc(320 * 144);
_game.ovlFileName = gameDesc->ovlFileName;
_game.sfxFileName = gameDesc->sfxFileName;
@@ -96,7 +95,6 @@ IgorEngine::~IgorEngine() {
free(_inventoryPanelBuffer);
free(_inventoryImagesBuffer);
free(_verbsPanelBuffer);
- free(_debugOverlayBuffer);
// DebugMan.clearAllDebugChannels();
@@ -113,7 +111,6 @@ Common::String IgorEngine::getGameId() const {
void IgorEngine::restart() {
_screenVGAVOffset = 0;
- _debugOverlayMode = kOverlayOff;
_gameStateLoaded = false;
_creditsPass = 0;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index c1756c7b774..4da154972ff 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -480,15 +480,6 @@ enum Verb {
kVerbGive
};
-enum DebugOverlay {
- kOverlayOff = 0,
- kOverlayWalkAreas,
- kOverlayHotspots,
- kOverlayY1Lum,
- kOverlayY2Lum,
- kOverlayDeltaLum
-};
-
struct DialogueText {
int num;
int count;
@@ -598,9 +589,6 @@ private:
uint8 *_verbsPanelBuffer;
int _screenVGAVOffset;
- uint8 *_debugOverlayBuffer;
- int _debugOverlayMode;
-
bool _eventQuitGame;
bool _gameStateLoaded;
@@ -1700,17 +1688,6 @@ public:
void handlePause();
- // Debug overlays (console: paint_walk / paint_hotspots / paint_y1lum /
- // paint_y2lum / paint_deltalum / paint_off).
- // Paint the mask regions whose BOX record has a non-zero walk area or
- // object, or whose y1Lum / y2Lum / deltaLum threshold is set; applied on
- // top of the presented frame until cleared.
- void debugPaintWalkAreas();
- void debugPaintHotspots();
- void debugPaintY1Lum();
- void debugPaintY2Lum();
- void debugPaintDeltaLum();
- void debugClearOverlay();
void debugSetFastMode(int factor) { _fastMode = factor; }
int debugGetFastMode() const { return _fastMode; }
void debugChangePart(int state);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index cb2743d5b8e..184a453947e 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -34,10 +34,6 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
if (presentScreen && !_eventQuitGame) {
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
- if (_debugOverlayMode != kOverlayOff) {
- debugApplyOverlay();
- }
-
_system->updateScreen();
}
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index baca8e664f6..5fb93376b5e 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -3,7 +3,6 @@ MODULE := engines/igor
MODULE_OBJS = \
igor.o \
console.o \
- debug.o \
metaengine.o \
walk.o \
palette.o \
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index b9c0b984356..7a3bfa8dc74 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -143,6 +143,7 @@ void IgorEngine::loadOptionsMenuTexts() {
return;
const bool demo = _game.flags & kFlagDemo;
+ const bool talkie = _game.flags & kFlagTalkie;
_optionsMenuTexts.resize(kOptionsTextCount);
const struct {
int resource;
@@ -150,11 +151,11 @@ void IgorEngine::loadOptionsMenuTexts() {
int firstText;
} groups[] = {
{ TXT_OptionsButtons, 5, kOptionsSave },
- { TXT_OptionsSettings, demo ? 12 : 17, kOptionsSoundOff },
+ { TXT_OptionsSettings, talkie ? 17 : 12, kOptionsSoundOff },
{ TXT_OptionsTitle, 1, kOptionsCtrlTitle },
{ TXT_OptionsQuit, 3, kOptionsQuitTitle },
{ TXT_OptionsSaveTitle, 1, kOptionsSaveTitle },
- { TXT_OptionsLoadTitle, demo ? 1 : 2, demo ? kOptionsLoadTitle : kOptionsNoSavedGames },
+ { TXT_OptionsLoadTitle, talkie ? 2 : 1, talkie ? kOptionsNoSavedGames : kOptionsLoadTitle },
{ TXT_OptionsUnavailable, demo ? 1 : 0, kOptionsUnavailable }
};
for (uint i = 0; i < ARRAYSIZE(groups); ++i) {
@@ -168,8 +169,8 @@ void IgorEngine::loadOptionsMenuTexts() {
error("Invalid options menu text resource %d", groups[i].resource);
int length = data[offset++];
int text = groups[i].firstText + j;
- if (demo && groups[i].resource == TXT_OptionsSettings && j >= 3) {
- // The demo has one text-only label in place of the CD speech choices.
+ if (!talkie && groups[i].resource == TXT_OptionsSettings && j >= 3) {
+ // Non-talkie versions have one text-only label in place of the CD speech choices.
text = kOptionsSpeechUnavailable + j - 3;
}
_optionsMenuTexts[text] = Common::String((const char *)data + offset, length);
Commit: 35fc27f700c3bcbd27c569afef1308d44345855a
https://github.com/scummvm/scummvm/commit/35fc27f700c3bcbd27c569afef1308d44345855a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:01+01:00
Commit Message:
IGOR: Fix small isue in part 81 with hotspot names
Changed paths:
engines/igor/parts/part_81.cpp
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index 83f117ebd06..6beecd2c236 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -128,7 +128,7 @@ void IgorEngine::part81ApplyObjectState(int num) {
// change door hotspot to lighthouse keeper and vice-versa
uint8 objectNames[16];
loadData(TXT_Part81ObjectNames, objectNames);
- const uint8 *name = objectNames + (_objectsState[kChurchBellMessageSeenStateIndex] == 1 ? 0 : 8);
+ const uint8 *name = objectNames + (_objectsState[kChurchBellMessageSeenStateIndex] == 1 ? 0 : objectNames[0] + 1);
memcpy(_roomObjectNames[2], name + 1, name[0]);
_roomObjectNames[2][name[0]] = '\0';
// show lighthouse keeper if the player has seen the church bell message
Commit: c08071a8762475a720aabc25d9fb2f31e683ee96
https://github.com/scummvm/scummvm/commit/c08071a8762475a720aabc25d9fb2f31e683ee96
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:01+01:00
Commit Message:
IGOR: Make music work in English floppy
Changed paths:
engines/igor/igor.cpp
engines/igor/parts/part_0.cpp
engines/igor/parts/part_1.cpp
engines/igor/parts/part_10.cpp
engines/igor/parts/part_11.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_32.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
engines/igor/parts/part_50.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_69.cpp
engines/igor/parts/part_7.cpp
engines/igor/parts/part_70.cpp
engines/igor/parts/part_71.cpp
engines/igor/parts/part_72.cpp
engines/igor/parts/part_73.cpp
engines/igor/parts/part_74.cpp
engines/igor/parts/part_76.cpp
engines/igor/parts/part_77.cpp
engines/igor/parts/part_78.cpp
engines/igor/parts/part_79.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_80.cpp
engines/igor/parts/part_81.cpp
engines/igor/parts/part_9.cpp
engines/igor/parts/part_credits.cpp
engines/igor/parts/part_maze.cpp
engines/igor/sound.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index acd443bdc2b..8c77a4449f4 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -220,7 +220,7 @@ Common::Error IgorEngine::run() {
}
readTableFile();
- if (_game.flags & kFlagDemo)
+ if (_game.flags & kFlagFloppy)
_midiPlayer = new MidiPlayer(_mixer);
loadMainTexts();
loadIgorFrames();
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 31137615019..6fd1c38960d 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -226,6 +226,8 @@ void IgorEngine::part0WalkInFromCloset() {
}
void IgorEngine::part0EnterFromBelow() {
+ if (!isCDVersion())
+ playMusic(3, true);
part0ApplyObjectState(255);
_walkDataCurrentIndex = 0;
int walkFrame = 1;
@@ -253,7 +255,8 @@ void IgorEngine::part0EnterFromBelow() {
}
void IgorEngine::part0() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_StudentDormitoryRoom);
loadRoomData(PAL_StudentDormitoryRoom, IMG_StudentDormitoryRoom, BOX_StudentDormitoryRoom, MSK_StudentDormitoryRoom, TXT_StudentDormitoryRoom);
diff --git a/engines/igor/parts/part_1.cpp b/engines/igor/parts/part_1.cpp
index 591cf64a620..fb102e0a30a 100644
--- a/engines/igor/parts/part_1.cpp
+++ b/engines/igor/parts/part_1.cpp
@@ -156,7 +156,8 @@ void IgorEngine::part1ExecuteAction(int action) {
}
void IgorEngine::part1() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_OutsideStudentDormitory);
loadRoomData(PAL_OutsideStudentDormitory, IMG_OutsideStudentDormitory, BOX_OutsideStudentDormitory, MSK_OutsideStudentDormitory, TXT_OutsideStudentDormitory);
diff --git a/engines/igor/parts/part_10.cpp b/engines/igor/parts/part_10.cpp
index 7fc6f96137e..21edaa1d244 100644
--- a/engines/igor/parts/part_10.cpp
+++ b/engines/igor/parts/part_10.cpp
@@ -146,7 +146,8 @@ void IgorEngine::part10ScrollLeft() {
}
void IgorEngine::part10() {
- playMusic(1);
+ if (isCDVersion())
+ playMusic(1);
_gameState.enableLight = 1;
loadActionData(DAT_Decanato);
@@ -199,6 +200,8 @@ void IgorEngine::part10() {
_gameState.igorMoving = true;
waitForIgorMove();
} else if (_currentPart == 101) {
+ if (!isCDVersion())
+ playMusic(2, true);
// Enter from the adjacent panel and walk right into the room.
_walkData[0].setPos(136, 86, kFacingPositionRight, 0);
_walkData[0].setDefaultScale();
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index fdae794a81a..822bff85a68 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -181,7 +181,8 @@ void IgorEngine::part11ExecuteAction(int action) {
}
void IgorEngine::part11() {
- playMusic(1);
+ if (isCDVersion())
+ playMusic(1);
_gameState.enableLight = 1;
loadActionData(DAT_DecanatoPart11);
loadRoomData(PAL_DecanatoRight, IMG_DecanatoRight, BOX_DecanatoRight, MSK_DecanatoRight, TXT_DecanatoRight);
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index 66c79dc8240..3a31dd78153 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -358,7 +358,8 @@ void IgorEngine::part2LightUpDynamite() {
}
void IgorEngine::part2() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_StudentDormitoryAttic);
loadRoomData(PAL_StudentDormitoryAttic, IMG_StudentDormitoryAttic, BOX_StudentDormitoryAttic, MSK_StudentDormitoryAttic, TXT_StudentDormitoryAttic);
diff --git a/engines/igor/parts/part_32.cpp b/engines/igor/parts/part_32.cpp
index 345fe611b5c..54b21de6ec2 100644
--- a/engines/igor/parts/part_32.cpp
+++ b/engines/igor/parts/part_32.cpp
@@ -600,7 +600,8 @@ void IgorEngine::part32SceneGirl() {
}
void IgorEngine::part32() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_Part32);
loadRoomData(PAL_Part32, IMG_Part32, BOX_Part32, MSK_Part32, TXT_Part32);
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index e5e37d6fe63..7eb92a8347b 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -455,7 +455,8 @@ void IgorEngine::part34UpdateBackground() {
}
void IgorEngine::part34() {
- playMusic(1);
+ if (isCDVersion())
+ playMusic(1);
_gameState.enableLight = 1;
loadActionData(DAT_ParkLeft);
loadRoomData(PAL_ParkRight, IMG_ParkRight, BOX_ParkRight, MSK_ParkRight, TXT_ParkRight);
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index d982c15227a..6dd17616686 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -122,7 +122,8 @@ void IgorEngine::part35ApplyObjectState(int num) {
}
void IgorEngine::part35() {
- playMusic(1);
+ if (isCDVersion())
+ playMusic(1);
_gameState.enableLight = 1;
loadActionData(DAT_ParkRight);
loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // left panel
diff --git a/engines/igor/parts/part_50.cpp b/engines/igor/parts/part_50.cpp
index 656123f3213..a98c8a27a0a 100644
--- a/engines/igor/parts/part_50.cpp
+++ b/engines/igor/parts/part_50.cpp
@@ -62,6 +62,8 @@ void IgorEngine::part50EnterMaze() {
}
void IgorEngine::part50EnterFromDoor() {
+ if (!isCDVersion())
+ playMusic(7, true);
WalkData *wd = &_walkData[0];
wd->setPos(kPart50DoorX, kPart50DoorY, kFacingPositionLeft, 0);
wd->setDefaultScale();
@@ -106,7 +108,8 @@ void IgorEngine::part50UpdateBackground() {
}
void IgorEngine::part50() {
- playMusic(4);
+ if (isCDVersion())
+ playMusic(4);
_gameState.enableLight = 2;
loadRoomData(PAL_OutsideMaze, IMG_OutsideMaze, BOX_OutsideMaze, MSK_OutsideMaze, TXT_OutsideMaze);
memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index b82aa4ba94e..4ca6d77f710 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -483,7 +483,8 @@ void IgorEngine::part68ExecuteAction(int action) {
}
void IgorEngine::part68() {
- playMusic(4);
+ if (isCDVersion())
+ playMusic(4);
_gameState.enableLight = 2;
loadActionData(DAT_Part68);
part68LoadRoom();
diff --git a/engines/igor/parts/part_69.cpp b/engines/igor/parts/part_69.cpp
index 2b8231444cb..d83ec6ed9f8 100644
--- a/engines/igor/parts/part_69.cpp
+++ b/engines/igor/parts/part_69.cpp
@@ -283,7 +283,8 @@ void IgorEngine::part69UpdateBackground() {
}
void IgorEngine::part69() {
- playMusic(4);
+ if (isCDVersion())
+ playMusic(4);
_gameState.enableLight = 2;
loadActionData(DAT_Part69);
loadRoomData(PAL_Part69, IMG_Part69, BOX_Part69, MSK_Part69, TXT_Part69);
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index 14942850a0d..34489bceac9 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -84,6 +84,8 @@ void IgorEngine::part7DrawScaledIgor(int scaleStep, int facing, int frame, int d
}
void IgorEngine::part7EnterFromOutside() {
+ if (!isCDVersion())
+ playMusic(3, true);
part7DrawDoorState(255);
for (int area = 11; area <= 13; ++area)
_roomObjectAreasTable[area].area = 0;
@@ -202,7 +204,8 @@ void IgorEngine::part7ExecuteAction(int action) {
}
void IgorEngine::part7() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_AdministrationCorridor);
loadRoomData(PAL_AdministrationCorridor, IMG_AdministrationCorridor,
diff --git a/engines/igor/parts/part_70.cpp b/engines/igor/parts/part_70.cpp
index cfdb81c91b1..2b095f07aff 100644
--- a/engines/igor/parts/part_70.cpp
+++ b/engines/igor/parts/part_70.cpp
@@ -64,7 +64,8 @@ void IgorEngine::part70UpdateBackground() {
}
void IgorEngine::part70() {
- playMusic(4);
+ if (isCDVersion())
+ playMusic(4);
_gameState.enableLight = 2;
loadActionData(DAT_Part70);
loadRoomData(PAL_Part70, IMG_Part70, BOX_Part70, MSK_Part70, TXT_Part70);
diff --git a/engines/igor/parts/part_71.cpp b/engines/igor/parts/part_71.cpp
index 9f9ec6c1976..58d526d802f 100644
--- a/engines/igor/parts/part_71.cpp
+++ b/engines/igor/parts/part_71.cpp
@@ -187,7 +187,8 @@ void IgorEngine::part71UpdateBackground() {
}
void IgorEngine::part71() {
- playMusic(4);
+ if (isCDVersion())
+ playMusic(4);
_gameState.enableLight = 1;
loadActionData(DAT_Part71);
loadRoomData(PAL_Part71, IMG_Part71, BOX_Part71, MSK_Part71, TXT_Part71);
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
index e2d17e62c12..8a302dfe437 100644
--- a/engines/igor/parts/part_72.cpp
+++ b/engines/igor/parts/part_72.cpp
@@ -175,7 +175,8 @@ void IgorEngine::part72UpdateBackground() {
}
void IgorEngine::part72() {
- playMusic(4);
+ if (isCDVersion())
+ playMusic(4);
_gameState.enableLight = 2;
_roomAmbientIndex = 1;
loadActionData(DAT_Part72);
diff --git a/engines/igor/parts/part_73.cpp b/engines/igor/parts/part_73.cpp
index 68167fc4efe..2b5fa881878 100644
--- a/engines/igor/parts/part_73.cpp
+++ b/engines/igor/parts/part_73.cpp
@@ -49,7 +49,8 @@ void IgorEngine::part73UpdateDialogue(int action) {
void IgorEngine::part73Cutscene() {
const bool savingWasAllowed = _canSaveGame;
_canSaveGame = false;
- playMusic(8);
+ if (isCDVersion())
+ playMusic(8);
_gameState.enableLight = 1;
loadRoomData(PAL_Part73, IMG_Part73, BOX_Part73, MSK_Part73, TXT_Part73);
// the colors of Igor
diff --git a/engines/igor/parts/part_74.cpp b/engines/igor/parts/part_74.cpp
index d32794f1363..aeac0c92e61 100644
--- a/engines/igor/parts/part_74.cpp
+++ b/engines/igor/parts/part_74.cpp
@@ -112,7 +112,8 @@ void IgorEngine::part74ShipCutscene() {
const bool savingWasAllowed = _canSaveGame;
_canSaveGame = false;
UpdateRoomBackgroundProc previousBackground = _updateRoomBackground;
- playMusic(4);
+ if (isCDVersion())
+ playMusic(4);
_gameState.enableLight = 1;
fadeOut(624);
uint8 savedPalette[624];
diff --git a/engines/igor/parts/part_76.cpp b/engines/igor/parts/part_76.cpp
index bb0ab949a42..6656e00b769 100644
--- a/engines/igor/parts/part_76.cpp
+++ b/engines/igor/parts/part_76.cpp
@@ -64,7 +64,7 @@ static const int kPart76WalkEndY = 119;
static const int kPart76ParachuteInventoryIndex = 38;
void IgorEngine::part76ExecuteAction(int action) {
- if (action != 103) {
+ if (isCDVersion() && action != 103) {
// the music of the room is started again by every action but the third one
playMusic(12);
}
@@ -275,7 +275,8 @@ void IgorEngine::part76Entry() {
}
void IgorEngine::part76() {
- playMusic(12);
+ if (isCDVersion())
+ playMusic(12);
if (!_gameStateLoaded) {
// the card that opens the part
partMainMeanwhile(IMG_Part76Card);
diff --git a/engines/igor/parts/part_77.cpp b/engines/igor/parts/part_77.cpp
index 7e107a996ef..b4b036b74d5 100644
--- a/engines/igor/parts/part_77.cpp
+++ b/engines/igor/parts/part_77.cpp
@@ -125,6 +125,8 @@ void IgorEngine::part77MonkeyCageCutscene() {
}
void IgorEngine::part77EnterFromCollege() {
+ if (!isCDVersion())
+ playMusic(2, true);
part77ApplyObjectState();
WalkData *wd = &_walkData[0];
wd->setPos(225, 100, 3, 1);
@@ -152,7 +154,8 @@ void IgorEngine::part77EnterFromCollege() {
}
void IgorEngine::part77() {
- playMusic(1);
+ if (isCDVersion())
+ playMusic(1);
_gameState.enableLight = 1;
loadActionData(DAT_Part77);
loadRoomData(PAL_Part77, IMG_Part77, BOX_Part77, MSK_Part77, TXT_Part77);
diff --git a/engines/igor/parts/part_78.cpp b/engines/igor/parts/part_78.cpp
index c775d08b58a..bd22187e651 100644
--- a/engines/igor/parts/part_78.cpp
+++ b/engines/igor/parts/part_78.cpp
@@ -201,7 +201,8 @@ void IgorEngine::part78ProfessorWarnings(int which) {
void IgorEngine::part78() {
const bool savingWasAllowed = _canSaveGame;
_canSaveGame = false;
- playMusic(11);
+ if (isCDVersion())
+ playMusic(11);
partMainMeanwhile(IMG_Part78MinutesLater);
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
@@ -293,7 +294,8 @@ void IgorEngine::part78() {
memcpy(_paletteBuffer, _currentPalette, 624);
fadeOut(768);
_objectsState[kExamCompletedStateIndex] = 1;
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
// the card with the time that has passed
partMainMeanwhile(IMG_Part78NextDay);
_currentPart = 281;
diff --git a/engines/igor/parts/part_79.cpp b/engines/igor/parts/part_79.cpp
index c0d19577929..cf96f949b63 100644
--- a/engines/igor/parts/part_79.cpp
+++ b/engines/igor/parts/part_79.cpp
@@ -129,7 +129,10 @@ void IgorEngine::part79Scroll() {
// Laura in the water
void IgorEngine::part79LauraInWater() {
- playMusic(13);
+ if (isCDVersion())
+ playMusic(13);
+ else
+ playMusic(11, true);
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
loadRoomData(PAL_Part79, IMG_Part79, 0, 0, 0);
@@ -351,7 +354,8 @@ void IgorEngine::part79FadeInPair(int firstColor) {
}
void IgorEngine::part79BeachScene() {
- playMusic(13);
+ if (isCDVersion())
+ playMusic(13);
_gameState.enableLight = 2;
// The ending uses the beach clothes, including when entered directly.
loadIgorBeachFrames();
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index ccf34a55745..c7343040a8d 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -397,7 +397,8 @@ void IgorEngine::part8ExecuteAction(int action) {
}
void IgorEngine::part8() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_DeanPepperOffice);
loadRoomData(PAL_DeanPepperOffice, IMG_DeanPepperOffice, BOX_DeanPepperOffice, MSK_DeanPepperOffice, TXT_DeanPepperOffice);
diff --git a/engines/igor/parts/part_80.cpp b/engines/igor/parts/part_80.cpp
index c20c443a18a..1edea0d7c42 100644
--- a/engines/igor/parts/part_80.cpp
+++ b/engines/igor/parts/part_80.cpp
@@ -82,7 +82,8 @@ void IgorEngine::part80Say(int who, const Common::Array<DialogueText> &lines) {
void IgorEngine::part80() {
const bool savingWasAllowed = _canSaveGame;
_canSaveGame = false;
- playMusic(8);
+ if (isCDVersion())
+ playMusic(8);
_gameState.enableLight = 1;
loadRoomData(PAL_Part80, IMG_Part80, BOX_Part80, MSK_Part80, TXT_Part80);
static const int anim[] = { ANM_Part80, 0 };
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index 6beecd2c236..0d609c40e66 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -509,7 +509,8 @@ void IgorEngine::part81ExecuteAction(int action) {
}
void IgorEngine::part81() {
- playMusic(4);
+ if (isCDVersion())
+ playMusic(4);
_gameState.enableLight = 2;
loadActionData(DAT_Part81);
part81LoadRoom();
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index eca487f41e3..8fc63a93bda 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -271,7 +271,8 @@ void IgorEngine::part9ExecuteAction(int action) {
}
void IgorEngine::part9() {
- playMusic(2);
+ if (isCDVersion())
+ playMusic(2);
_gameState.enableLight = 1;
loadActionData(DAT_AdministrationSecretaryRoom);
loadRoomData(PAL_AdministrationSecretaryRoom, IMG_AdministrationSecretaryRoom,
diff --git a/engines/igor/parts/part_credits.cpp b/engines/igor/parts/part_credits.cpp
index ea5543992d5..6631a78a0c4 100644
--- a/engines/igor/parts/part_credits.cpp
+++ b/engines/igor/parts/part_credits.cpp
@@ -174,7 +174,10 @@ void IgorEngine::partCredits() {
_canSaveGame = false;
const CreditsPage &page = kCreditsPages[(_currentPart - 910) / 10];
- playMusic(kCreditsMusic);
+ if (isCDVersion())
+ playMusic(kCreditsMusic);
+ else
+ playMusic(12, true);
memset(_screenVGA, 0, 64000);
memset(_currentPalette, 0, 768);
diff --git a/engines/igor/parts/part_maze.cpp b/engines/igor/parts/part_maze.cpp
index a3f319c3511..e033bc5457c 100644
--- a/engines/igor/parts/part_maze.cpp
+++ b/engines/igor/parts/part_maze.cpp
@@ -42,7 +42,7 @@ int IgorEngine::partMazeGetMusicTrack() const {
location -= 21;
}
--location;
- return location / 7 + 5;
+ return location / 7 + (isCDVersion() ? 5 : 8);
}
/**
@@ -306,7 +306,8 @@ void IgorEngine::partMaze() {
assert(room);
_mazeRoom = room;
- playMusic(room->music >= 0 ? room->music : partMazeGetMusicTrack());
+ if (isCDVersion())
+ playMusic(room->music >= 0 ? room->music : partMazeGetMusicTrack());
_gameState.enableLight = 1;
if (room->saveLocation) {
_mazeSavedLocation = _mazeLocation;
@@ -341,6 +342,12 @@ void IgorEngine::partMaze() {
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
+ if (!isCDVersion()) {
+ if (_currentPart == 670)
+ playMusic(8, true);
+ else if (_currentPart == 663)
+ playMusic(10, true);
+ }
for (int i = 0; i < room->numEntries; ++i) {
const MazeEntry &entry = room->entries[i];
if (entry.state == _currentPart) {
@@ -368,6 +375,8 @@ void IgorEngine::partMaze() {
_currentPart = (_objectsState[kMazeBeatenStateIndex] == 1 && _objectsState[kMazeEntryDirectionStateIndex] == 0) ? 500 : 142;
break;
}
+ if (!isCDVersion() && room->music < 0)
+ playMusic(partMazeGetMusicTrack());
runPartLoop();
}
leavePartLoop();
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 2d952bcea17..4b676fa349f 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -87,12 +87,10 @@ void IgorEngine::playMusic(int num, bool restart) {
if (_midiPlayer) {
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 };
if (num < 0 || num >= (int)ARRAYSIZE(cmf) || cmf[num] == 0) {
- // TODO: Restore the remaining demo music selections once verified.
+ // TODO: Restore unsupported music selections once verified.
return;
}
startMusic(cmf[num]);
- } else {
- // TODO: Verify the full floppy game's music resource mapping.
}
} else {
g_system->getAudioCDManager()->stop();
Commit: edc4fc2b8a236bf1de929c744012d4d88ad5290f
https://github.com/scummvm/scummvm/commit/edc4fc2b8a236bf1de929c744012d4d88ad5290f
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:02+01:00
Commit Message:
IGOR: Do not trigger Margaret cutscenes right after loading a game
Changed paths:
engines/igor/part_main.cpp
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 9bab1e376cd..094d6842295 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -757,6 +757,8 @@ void IgorEngine::partMain() {
error("partMain() Unhandled part %d", _currentPart);
break;
}
+ if (_gameStateLoaded)
+ continue;
// These scheduler exclusions compare only the low byte of the state.
// Margaret cutscenes trigger between room changes, but scrollable
// areas are omitted so it doesnt trigger after a scroll
Commit: e25e151c5b89fd53d1a3068724474908af85d6c4
https://github.com/scummvm/scummvm/commit/e25e151c5b89fd53d1a3068724474908af85d6c4
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:02+01:00
Commit Message:
IGOR: Fix double entry animation in room 0
Changed paths:
engines/igor/parts/part_0.cpp
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 6fd1c38960d..91ecf716528 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -211,17 +211,18 @@ void IgorEngine::part0WalkInFromCloset() {
wd->yPosChanged = 1;
wd->dyPos = 0;
wd->scaleHeight = 50;
- _walkDataLastIndex = 0;
- buildWalkPath(120, 131, 120, 136);
- _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
- _gameState.igorMoving = true;
- waitForIgorMove();
+ if (isCDVersion()) {
+ _walkDataLastIndex = 0;
+ buildWalkPath(120, 131, 120, 136);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ }
if (_objectsState[kRatSkinHatSeenStateIndex] == 0) {
igorSay(215, 2, 103);
_objectsState[kRatSkinHatSeenStateIndex] = 1;
- } else {
- part0EnterFromBelow();
}
}
Commit: fc4e5e7616c827e266f663ded0fae3590c054906
https://github.com/scummvm/scummvm/commit/fc4e5e7616c827e266f663ded0fae3590c054906
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:02+01:00
Commit Message:
IGOR: Allow skipping splash screens in floppy version
Changed paths:
engines/igor/parts/part_90.cpp
diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp
index f50418c4e76..b0167b2cedb 100644
--- a/engines/igor/parts/part_90.cpp
+++ b/engines/igor/parts/part_90.cpp
@@ -93,6 +93,8 @@ void IgorEngine::part90() {
_inputVars[kInputEscape] = 0;
_inputVars[kInputOptions] = 0;
_inputVars[kInputClick] = 0;
+ if (!isCDVersion())
+ _inputVars[kInputConfirm] = 0;
const uint32 timerStart = _system->getMillis();
uint8 observedTimer = 0;
for (uint16 elapsed = 0; elapsed < duration; ++elapsed) {
@@ -101,7 +103,8 @@ void IgorEngine::part90() {
_inputVars[kInputOptions] = 0;
waitForTimer(0);
}
- while (!_gameStateLoaded && !_eventQuitGame && _currentPart != kInvalidPart) {
+ while (!_gameStateLoaded && !_eventQuitGame && _currentPart != kInvalidPart &&
+ (isCDVersion() || !_inputVars[kInputConfirm])) {
waitForTimer(0, false);
const uint32 timerMillis = _system->getMillis() - timerStart;
const uint64 timerRate = (uint64)kTickDelay * _fastMode;
@@ -115,10 +118,13 @@ void IgorEngine::part90() {
waitForTimer(0, false, deadline);
}
_gameTicks = (_gameTicks + 1) & 63;
- if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart) {
+ if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart ||
+ (!isCDVersion() && _inputVars[kInputConfirm])) {
break;
}
}
+ if (!isCDVersion())
+ _inputVars[kInputConfirm] = 0;
}
if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart) {
if (!_gameStateLoaded)
Commit: 7619a86f4386faf94ea8a19977ec46a8e9aaf110
https://github.com/scummvm/scummvm/commit/7619a86f4386faf94ea8a19977ec46a8e9aaf110
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:03+01:00
Commit Message:
IGOR: Fix sound indices above 63 on floppy version
Changed paths:
engines/igor/sound.cpp
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 4b676fa349f..d4d28ed5431 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -120,6 +120,8 @@ void IgorEngine::playSound(int num, int type) {
Audio::SoundHandle *soundHandle = 0;
if (type == 1) {
// debugC(9, kDebugEngine, "playSound() %d -> sfx offset %d", num + 1, num);
+ if (!isCDVersion() && num >= _soundOffsetsCount)
+ return;
if (_mixer->isSoundHandleActive(_sfxHandle)) {
return;
}
Commit: 679f1d86422d0d4d6b772c5801c5946b371e440b
https://github.com/scummvm/scummvm/commit/679f1d86422d0d4d6b772c5801c5946b371e440b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:03+01:00
Commit Message:
IGOR: Proper detection name
Changed paths:
engines/igor/detection.h
engines/igor/detection_tables.h
diff --git a/engines/igor/detection.h b/engines/igor/detection.h
index 72df6e2493f..4a6597fa758 100644
--- a/engines/igor/detection.h
+++ b/engines/igor/detection.h
@@ -94,11 +94,11 @@ public:
}
const char *getEngineName() const override {
- return "Igor";
+ return "Igor: Objective Uikokahonia";
}
const char *getOriginalCopyright() const override {
- return "Igor (C)";
+ return "Igor: Objetivo Uikokahonia (C) 1994 Péndulo Studios";
}
const DebugChannelDef *getDebugChannels() const override {
diff --git a/engines/igor/detection_tables.h b/engines/igor/detection_tables.h
index 331284db93e..d7df6c29fb7 100644
--- a/engines/igor/detection_tables.h
+++ b/engines/igor/detection_tables.h
@@ -22,7 +22,7 @@
namespace Igor {
const PlainGameDescriptor igorGames[] = {
- { "igor", "Igor" },
+ { "igor", "Igor: Objective Uikokahonia" },
{ 0, 0 }
};
Commit: 6d053b0223e34b249767792bcc139cb87354a7c1
https://github.com/scummvm/scummvm/commit/6d053b0223e34b249767792bcc139cb87354a7c1
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:03+01:00
Commit Message:
IGOR: Fix The End inserts broken on floppy versions
Changed paths:
engines/igor/parts/part_79.cpp
diff --git a/engines/igor/parts/part_79.cpp b/engines/igor/parts/part_79.cpp
index cf96f949b63..a5be9727801 100644
--- a/engines/igor/parts/part_79.cpp
+++ b/engines/igor/parts/part_79.cpp
@@ -141,6 +141,8 @@ void IgorEngine::part79LauraInWater() {
free(text);
loadData(IMG_Part79Layer2, _screenLayer2);
loadData(ANM_Part79, _animFramesBuffer);
+ if (!isCDVersion())
+ memset(_screenVGA, 0, 64000);
memcpy(_screenVGA, _screenLayer1, 46080);
part79DrawLauraInWater(1);
fadeIn(768);
@@ -203,6 +205,8 @@ static const int kPart79Block1Offset = 53 * 320 + 115;
static const int kPart79Block1Width = 90;
static const int kPart79Block1Height = 23;
static const int kPart79Block1Frames = 0xC0A3;
+static const int kPart79Block1FloppyOffset = 53 * 320 + 84;
+static const int kPart79Block1FloppyWidth = 151;
static const int kPart79Block2Offset = 108 * 320 + 201;
static const int kPart79Block2Width = 13;
static const int kPart79Block2Height = 11;
@@ -211,6 +215,9 @@ static const int kPart79Block3Offset = 53 * 320 + 138;
static const int kPart79Block3Width = 44;
static const int kPart79Block3Height = 23;
static const int kPart79Block3Frames = 0xC8B9;
+static const int kPart79Block3FloppyOffset = 53 * 320 + 93;
+static const int kPart79Block3FloppyWidth = 133;
+static const int kPart79Block3FloppyFrames = 0xCE34;
static const int kPart79FadeFirstColor = 0xF5;
static const int kPart79FadeLastColor = 0xFE;
@@ -491,8 +498,11 @@ void IgorEngine::part79BeachScene() {
// the second animation resource replaces the first one
loadData(ANM_Part79bScenes, _animFramesBuffer);
- copyArea(_screenVGA, kPart79Block1Offset, 320, _animFramesBuffer + kPart79Block1Frames, kPart79Block1Width,
- kPart79Block1Width, kPart79Block1Height);
+ const bool englishFloppy = _game.version == kIdEngFloppy;
+ const int titleOffset = englishFloppy ? kPart79Block1FloppyOffset : kPart79Block1Offset;
+ const int titleWidth = englishFloppy ? kPart79Block1FloppyWidth : kPart79Block1Width;
+ copyArea(_screenVGA, titleOffset, 320, _animFramesBuffer + kPart79Block1Frames, titleWidth,
+ titleWidth, kPart79Block1Height);
part79FadeInPair(0xF5);
for (int i = 0; i < 5; ++i) {
@@ -544,8 +554,11 @@ void IgorEngine::part79BeachScene() {
part79DrawPhilipSharkScene(&kPart79Anim2D, frame);
waitForTimer(31);
}
- copyArea(_screenVGA, kPart79Block3Offset, 320, _animFramesBuffer + kPart79Block3Frames, kPart79Block3Width,
- kPart79Block3Width, kPart79Block3Height);
+ const int finalTitleOffset = englishFloppy ? kPart79Block3FloppyOffset : kPart79Block3Offset;
+ const int finalTitleWidth = englishFloppy ? kPart79Block3FloppyWidth : kPart79Block3Width;
+ const int finalTitleFrames = englishFloppy ? kPart79Block3FloppyFrames : kPart79Block3Frames;
+ copyArea(_screenVGA, finalTitleOffset, 320, _animFramesBuffer + finalTitleFrames, finalTitleWidth,
+ finalTitleWidth, kPart79Block3Height);
part79FadeColors(kPart79FadeFirstColor, kPart79FadeLastColor, true);
for (int i = 0; i < 8; ++i) {
waitForTimer(255);
Commit: b2fcb20a686e5be7ee9f39ce00b931ecabfea9ee
https://github.com/scummvm/scummvm/commit/b2fcb20a686e5be7ee9f39ce00b931ecabfea9ee
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:04+01:00
Commit Message:
IGOR: Rework credits scene so it fits both CD and floppy
Changed paths:
engines/igor/parts/part_credits.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/parts/part_credits.cpp b/engines/igor/parts/part_credits.cpp
index 6631a78a0c4..fa84c440f57 100644
--- a/engines/igor/parts/part_credits.cpp
+++ b/engines/igor/parts/part_credits.cpp
@@ -22,123 +22,28 @@
namespace Igor {
-// Texts of the end credits: every page is a picture with the texts of the first or of the second pass drawn over
-// it. Positions are the centre of every line.
-
-struct CreditsLine {
+struct CreditsLayout {
int16 x;
int16 y;
- uint8 color;
- bool underline;
- uint16 strId;
+ uint8 count;
};
struct CreditsPage {
uint16 imgId;
uint16 palId;
- const CreditsLine *lines[2];
- int count[2];
-};
-
-static const CreditsLine kCredits1Pass0[] = {
- { 232, 90, 0xC2, true, STR_CreditsHistoriaYDiseno },
- { 232, 118, 0xC3, false, STR_CreditsRamonHernaez },
- { 232, 133, 0xC3, false, STR_CreditsFelipeGomez },
- { 232, 148, 0xC3, false, STR_CreditsRafaelLatiegui },
- { 232, 163, 0xC3, false, STR_CreditsMiguelAngelRamos },
-};
-
-static const CreditsLine kCredits1Pass1[] = {
- { 210, 5, 0xC2, true, STR_CreditsProduccionYDireccionDeVoces },
- { 210, 33, 0xC3, false, STR_CreditsLunaFaraco },
-};
-
-static const CreditsLine kCredits2Pass0[] = {
- { 74, 105, 0xC2, true, STR_CreditsProgramacion },
- { 74, 133, 0xC3, false, STR_CreditsRamonHernaez },
- { 74, 148, 0xC3, false, STR_CreditsFelipeGomez },
- { 74, 163, 0xC3, false, STR_CreditsMiguelAngelRamos },
-};
-
-static const CreditsLine kCredits2Pass1[] = {
- { 74, 20, 0xC2, true, STR_CreditsVoces },
- { 74, 48, 0xC3, false, STR_CreditsAngieDeBirch },
- { 74, 63, 0xC3, false, STR_CreditsAntonioFdezMunoz },
- { 74, 78, 0xC3, false, STR_CreditsArantxaFranco },
- { 74, 93, 0xC3, false, STR_CreditsAlfredoGabrieli },
- { 74, 108, 0xC3, false, STR_CreditsFernandoLuna },
- { 74, 123, 0xC3, false, STR_CreditsAnaOlivares },
- { 74, 138, 0xC3, false, STR_CreditsAdolfoPastor },
-};
-
-static const CreditsLine kCredits3Pass0[] = {
- { 244, 30, 0xC2, true, STR_CreditsFondos },
- { 244, 58, 0xC3, false, STR_CreditsCarlosVeredas },
-};
-
-static const CreditsLine kCredits3Pass1[] = {
- { 244, 30, 0xC2, true, STR_CreditsVoces },
- { 244, 58, 0xC3, false, STR_CreditsMiguelAngelPerez },
- { 244, 73, 0xC3, false, STR_CreditsAntonioRamos },
- { 244, 88, 0xC3, false, STR_CreditsPatriciaReija },
- { 244, 103, 0xC3, false, STR_CreditsAparicioRivero },
- { 244, 118, 0xC3, false, STR_CreditsDanielSanchez },
- { 244, 133, 0xC3, false, STR_CreditsEnriqueSantaren },
- { 244, 148, 0xC3, false, STR_CreditsCarlosViaga },
-};
-
-static const CreditsLine kCredits4Pass0[] = {
- { 74, 23, 0xC2, true, STR_CreditsAnimaciones },
- { 74, 51, 0xC3, false, STR_CreditsRafaelLatiegui },
-};
-
-static const CreditsLine kCredits4Pass1[] = {
- { 74, 23, 0xC2, true, STR_CreditsProductorAsociado },
- { 74, 51, 0xC3, false, STR_CreditsPabloDeLaNuez },
-};
-
-static const CreditsLine kCredits5Pass0[] = {
- { 210, 20, 0xC2, true, STR_CreditsMusicaOriginalYArreglos },
- { 210, 48, 0xC3, false, STR_CreditsEstebanMoreno },
-};
-
-static const CreditsLine kCredits5Pass1[] = {
- { 240, 20, 0xC2, true, STR_CreditsDistribuidoPor },
- { 240, 48, 0xC3, false, STR_CreditsDinamicMultimedia },
-};
-
-static const CreditsLine kCredits6Pass0[] = {
- { 90, 5, 0xC2, true, STR_CreditsProduccionMusicaDigital },
- { 90, 33, 0xC3, false, STR_CreditsAgpDigital },
-};
-
-static const CreditsLine kCredits6Pass1[] = {
- { 74, 72, 0xC2, true, STR_CreditsAgradecimientos },
- { 74, 100, 0xC3, false, STR_CreditsThePromisedLand },
- { 74, 115, 0xC3, false, STR_CreditsRaquelAlvarez },
- { 74, 130, 0xC3, false, STR_CreditsPilarRomero },
- { 74, 145, 0xC3, false, STR_CreditsDouglasPrats },
- { 74, 160, 0xC3, false, STR_CreditsEnriqueRAtienzar },
-};
-
-static const CreditsLine kCredits7Pass0[] = {
- { 240, 142, 0xC2, true, STR_CreditsEfectosDeSonido },
- { 240, 170, 0xC3, false, STR_CreditsLunaFaraco },
-};
-
-static const CreditsLine kCredits7Pass1[] = {
- { 238, 140, 0xC2, true, STR_CreditsCreadoYProducidoPor },
- { 238, 168, 0xC3, false, STR_CreditsPenduloStudios },
+ uint16 textId;
+ CreditsLayout cd[2];
+ CreditsLayout floppy;
};
static const CreditsPage kCreditsPages[7] = {
- { IMG_Credits1, PAL_Credits1, { kCredits1Pass0, kCredits1Pass1 }, { ARRAYSIZE(kCredits1Pass0), ARRAYSIZE(kCredits1Pass1) } },
- { IMG_Credits2, PAL_Credits2, { kCredits2Pass0, kCredits2Pass1 }, { ARRAYSIZE(kCredits2Pass0), ARRAYSIZE(kCredits2Pass1) } },
- { IMG_Credits3, PAL_Credits3, { kCredits3Pass0, kCredits3Pass1 }, { ARRAYSIZE(kCredits3Pass0), ARRAYSIZE(kCredits3Pass1) } },
- { IMG_Credits4, PAL_Credits4, { kCredits4Pass0, kCredits4Pass1 }, { ARRAYSIZE(kCredits4Pass0), ARRAYSIZE(kCredits4Pass1) } },
- { IMG_Credits5, PAL_Credits5, { kCredits5Pass0, kCredits5Pass1 }, { ARRAYSIZE(kCredits5Pass0), ARRAYSIZE(kCredits5Pass1) } },
- { IMG_Credits6, PAL_Credits6, { kCredits6Pass0, kCredits6Pass1 }, { ARRAYSIZE(kCredits6Pass0), ARRAYSIZE(kCredits6Pass1) } },
- { IMG_Credits7, PAL_Credits7, { kCredits7Pass0, kCredits7Pass1 }, { ARRAYSIZE(kCredits7Pass0), ARRAYSIZE(kCredits7Pass1) } },
+ { IMG_Credits1, PAL_Credits1, TXT_Credits1, { { 232, 90, 5 }, { 210, 5, 2 } }, { 232, 90, 5 } },
+ { IMG_Credits2, PAL_Credits2, TXT_Credits2, { { 74, 105, 4 }, { 74, 20, 8 } }, { 74, 105, 4 } },
+ { IMG_Credits3, PAL_Credits3, TXT_Credits3, { { 244, 30, 2 }, { 244, 30, 8 } }, { 244, 30, 2 } },
+ { IMG_Credits4, PAL_Credits4, TXT_Credits4, { { 74, 23, 2 }, { 74, 23, 2 } }, { 74, 23, 2 } },
+ { IMG_Credits5, PAL_Credits5, TXT_Credits5, { { 210, 20, 2 }, { 240, 20, 2 } }, { 210, 20, 2 } },
+ { IMG_Credits6, PAL_Credits6, TXT_Credits6, { { 90, 5, 2 }, { 74, 72, 6 } }, { 74, 142, 2 } },
+ { IMG_Credits7, PAL_Credits7, TXT_Credits7, { { 240, 142, 2 }, { 238, 140, 2 } }, { 238, 90, 5 } }
};
// Number of timer units a page stays on the screen
@@ -177,7 +82,7 @@ void IgorEngine::partCredits() {
if (isCDVersion())
playMusic(kCreditsMusic);
else
- playMusic(12, true);
+ playMusic(12);
memset(_screenVGA, 0, 64000);
memset(_currentPalette, 0, 768);
@@ -188,11 +93,27 @@ void IgorEngine::partCredits() {
SET_PAL_240_48_1();
memset(_paletteBuffer + kCreditsNameColor * 3, 0x3F, 3);
+ const bool englishFloppy = _game.version == kIdEngFloppy;
const int pass = (_creditsPass == 0) ? 0 : 1;
- for (int i = 0; i < page.count[pass]; ++i) {
- const CreditsLine &line = page.lines[pass][i];
- partCreditsDrawText(line.x, line.y, line.color, line.underline, getString(line.strId));
+ const CreditsLayout &layout = englishFloppy ? page.floppy : page.cd[pass];
+ const int skip = !englishFloppy && pass == 1 ? page.cd[0].count : 0;
+ int size;
+ uint8 *texts = loadData(page.textId, nullptr, &size);
+ int offset = 0;
+ for (int i = 0; i < skip + layout.count; ++i) {
+ assert(offset < size);
+ const int length = texts[offset++];
+ assert(offset + length <= size);
+ if (i >= skip) {
+ const int line = i - skip;
+ const Common::String text(reinterpret_cast<const char *>(texts + offset), length);
+ const int y = layout.y + (line == 0 ? 0 : 28 + (line - 1) * 15);
+ const uint8 color = line == 0 ? 0xC2 : (englishFloppy ? 0xFF : kCreditsNameColor);
+ partCreditsDrawText(layout.x, y, color, line == 0, text.c_str());
+ }
+ offset += length;
}
+ free(texts);
if (_gameStateLoaded) {
fadeIn(768);
@@ -201,7 +122,8 @@ void IgorEngine::partCredits() {
part79FadeColors(0, 255, true);
}
- for (int ticks = 0; ticks < kCreditsPageTicks; ticks += kTimerTicksCount) {
+ const int pageTicks = _game.version == kIdEngFloppy ? 3928 : kCreditsPageTicks;
+ for (int ticks = 0; ticks < pageTicks; ticks += kTimerTicksCount) {
if (_inputVars[kInputOptions]) {
_inputVars[kInputOptions] = 0;
handleOptionsMenu();
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 273d105f7f4..47cc73c2122 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -846,50 +846,6 @@
#define IMG_Credits7 1222
#define PAL_Credits7 1223
-// Credit texts (Spanish)
-#define STR_CreditsHistoriaYDiseno 450
-#define STR_CreditsRamonHernaez 451
-#define STR_CreditsFelipeGomez 452
-#define STR_CreditsRafaelLatiegui 453
-#define STR_CreditsMiguelAngelRamos 454
-#define STR_CreditsProduccionYDireccionDeVoces 455
-#define STR_CreditsLunaFaraco 456
-#define STR_CreditsProgramacion 457
-#define STR_CreditsVoces 458
-#define STR_CreditsAngieDeBirch 459
-#define STR_CreditsAntonioFdezMunoz 460
-#define STR_CreditsArantxaFranco 461
-#define STR_CreditsAlfredoGabrieli 462
-#define STR_CreditsFernandoLuna 463
-#define STR_CreditsAnaOlivares 464
-#define STR_CreditsAdolfoPastor 465
-#define STR_CreditsFondos 466
-#define STR_CreditsCarlosVeredas 467
-#define STR_CreditsMiguelAngelPerez 468
-#define STR_CreditsAntonioRamos 469
-#define STR_CreditsPatriciaReija 470
-#define STR_CreditsAparicioRivero 471
-#define STR_CreditsDanielSanchez 472
-#define STR_CreditsEnriqueSantaren 473
-#define STR_CreditsCarlosViaga 474
-#define STR_CreditsAnimaciones 475
-#define STR_CreditsProductorAsociado 476
-#define STR_CreditsPabloDeLaNuez 477
-#define STR_CreditsMusicaOriginalYArreglos 478
-#define STR_CreditsEstebanMoreno 479
-#define STR_CreditsDistribuidoPor 480
-#define STR_CreditsDinamicMultimedia 481
-#define STR_CreditsProduccionMusicaDigital 482
-#define STR_CreditsAgpDigital 483
-#define STR_CreditsAgradecimientos 484
-#define STR_CreditsThePromisedLand 485
-#define STR_CreditsRaquelAlvarez 486
-#define STR_CreditsPilarRomero 487
-#define STR_CreditsDouglasPrats 488
-#define STR_CreditsEnriqueRAtienzar 489
-#define STR_CreditsEfectosDeSonido 490
-#define STR_CreditsCreadoYProducidoPor 491
-#define STR_CreditsPenduloStudios 492
#define DLG_Part8Intercom 1224
@@ -901,4 +857,12 @@
#define TXT_OptionsLoadTitle 1230
#define TXT_OptionsUnavailable 1232
+#define TXT_Credits1 1233
+#define TXT_Credits2 1234
+#define TXT_Credits3 1235
+#define TXT_Credits4 1236
+#define TXT_Credits5 1237
+#define TXT_Credits6 1238
+#define TXT_Credits7 1239
+
#endif // IGOR_RESOURCE_IDS
Commit: 308da477a84e7219d934c8db635379f0cd7640cb
https://github.com/scummvm/scummvm/commit/308da477a84e7219d934c8db635379f0cd7640cb
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:04+01:00
Commit Message:
IGOR: Reorder walk code
Changed paths:
engines/igor/walk.cpp
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 52fde771a23..20259ff4c55 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -31,17 +31,6 @@ static int16 truncReal(float f) {
return (int16)f;
}
-void IgorEngine::setRoomWalkBounds(int x1, int y1, int x2, int y2,
- int x1MinY, int x2MinY) {
- assert(x1 <= x2 && y1 <= y2);
- _roomWalkBounds.x1 = x1;
- _roomWalkBounds.x2 = x2;
- _roomWalkBounds.y1 = y1;
- _roomWalkBounds.y2 = y2;
- _roomWalkBounds.x1MinY = x1MinY < 0 ? y1 : x1MinY;
- _roomWalkBounds.x2MinY = x2MinY < 0 ? y1 : x2MinY;
-}
-
void IgorEngine::setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp, int yBottom) {
_roomWalkTargetRules.yMax = yMax;
_roomWalkTargetBottom = yBottom;
@@ -51,81 +40,6 @@ void IgorEngine::setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp, int
_roomWalkTargetRules.enabled = true;
}
-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;
- // Area 0 means the point is outside any walk area: there is no route
- // through the area table, so walk straight to the destination
- for (int i = 1; srcArea >= 1 && dstArea >= 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::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);
-}
-
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];
@@ -134,20 +48,10 @@ int IgorEngine::lookupScale(int xOffset, int yOffset, int h) const {
return offset;
}
-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::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);
if (pos < 1 || pos > 4) {
- // The facing selects one of the four frame sets; any other value (a walk step whose
- // facing byte came from a room object without a walk target) has no frames to draw.
- // TODO: the original indexes its table of frame sets without a bounds check, so what
- // it draws for such a facing is not derived.
warning("moveIgor: invalid facing %d, step not drawn", pos);
return;
}
@@ -286,8 +190,7 @@ void IgorEngine::moveIgor(int pos, int frame) {
}
}
for (igorBodyScanLine = 0; igorBodyScanLine < igorScaledHeight; ++igorBodyScanLine) {
- // Pixels wrapping past the last room row would land in the panel area and
- // come from unrelated memory, so never draw them.
+ .
if (screenIgorDrawOffset < 320 * 144) {
const int len = MIN<int>(igorScaledWidth, 320 * 144 - screenIgorDrawOffset);
memcpy(_screenVGA + screenIgorDrawOffset, _igorTempFrames + igorBodyScanLine * 50, len);
@@ -295,6 +198,89 @@ void IgorEngine::moveIgor(int pos, int frame) {
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;
+ // Area 0 means the point is outside any walk area: there is no route
+ // through the area table, so walk straight to the destination
+ for (int i = 1; srcArea >= 1 && dstArea >= 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) {
@@ -374,6 +360,12 @@ int IgorEngine::getHorizontalStepsCount(int minX, int minY, int maxX, int maxY)
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) {
@@ -1090,12 +1082,13 @@ bool IgorEngine::waitForIgorMove(IgorMoveTick tick, bool escapeSkips, bool force
++_walkDataCurrentIndex;
}
}
- if (tick) {
+ if (tick) { // run the update function if necessary
(this->*tick)();
}
if (escapeSkips && ((_inputVars[kInputEscape] && !_eventQuitGame) || forceSkip)) {
// Escape draws the remaining walk frames at once, without waiting for the timer.
// Once pressed, the walks that follow in the same sequence are skipped the same way.
+ // this is done in the college entrance, for instance.
_inputVars[kInputEscape] = 0;
skipped = true;
while (_gameState.igorMoving && _walkDataCurrentIndex <= _walkDataLastIndex) {
@@ -1112,41 +1105,19 @@ bool IgorEngine::waitForIgorMove(IgorMoveTick tick, bool escapeSkips, bool force
return skipped;
}
-void IgorEngine::handleRoomIgorWalk() {
- if (_walkDataCurrentIndex > _walkDataLastIndex) {
- _gameState.igorMoving = false;
- _walkDataLastIndex = _walkDataCurrentIndex;
- if (_actionCode > 0) {
- hideCursor();
- debugC(9, kDebugEngine, "Executing action code %d", _actionCode);
- const int actionPart = _currentPart;
- executeAction(_actionCode);
- if (!_gameState.dialogueTextRunning) {
- showCursor();
- }
- clearAction(_currentPart == actionPart);
- }
- }
- if (_gameState.igorMoving) {
- moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
- ++_walkDataCurrentIndex;
- }
-}
-
-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::setRoomWalkBounds(int x1, int y1, int x2, int y2, int x1MinY, int x2MinY) {
+ assert(x1 <= x2 && y1 <= y2);
+ _roomWalkBounds.x1 = x1;
+ _roomWalkBounds.x2 = x2;
+ _roomWalkBounds.y1 = y1;
+ _roomWalkBounds.y2 = y2;
+ _roomWalkBounds.x1MinY = x1MinY < 0 ? y1 : x1MinY;
+ _roomWalkBounds.x2MinY = x2MinY < 0 ? y1 : x2MinY;
}
void IgorEngine::fixWalkPosition(int *x, int *y) {
+ // some rooms had specific walk behavior that needs to be handled differently
if (getPart() == 50) {
- // The click is clamped to a rectangle. On the right half the first walkable row is looked for below it and,
- // if there is none, above; on the left half the first walkable column to the right and then to the left.
int xPos = MAX(MIN(*x, 224), 49);
int yPos = MAX(MIN(MIN(*y, 143), 119), 22);
if (xPos > 144) {
@@ -1174,8 +1145,7 @@ void IgorEngine::fixWalkPosition(int *x, int *y) {
return;
}
if (getPart() == 81) {
- // The click is clamped to the floor: on the left part the first walkable row is looked for below it (starting
- // one row down) and, if there is none, above; on the right part a click above row 93 goes to a fixed
+ // Clamps clicks to the floor; on the right part a click above row 93 goes to a fixed
// place and any other goes to the first walkable column to the left.
int xPos = *x;
int yPos = MIN(*y, 143);
@@ -1189,7 +1159,6 @@ void IgorEngine::fixWalkPosition(int *x, int *y) {
}
} while (yPos != 143);
if (_roomObjectAreasTable[_screenLayer2[yPos * 320 + xPos]].area == 0) {
- // the scan upwards never stops by itself in the original when nothing is walkable
do {
if (yPos > 0) {
--yPos;
@@ -1200,7 +1169,6 @@ void IgorEngine::fixWalkPosition(int *x, int *y) {
xPos = 128;
yPos = 93;
} else {
- // the scan to the left never stops by itself in the original when nothing is walkable
do {
if (xPos > 0) {
--xPos;
@@ -1212,7 +1180,7 @@ void IgorEngine::fixWalkPosition(int *x, int *y) {
return;
}
if (_roomWalkTargetRules.enabled) {
- // The click is clamped, then the picture is scanned for the first walkable row strictly below it (the
+ // The click is clamped; then the picture is scanned for the first walkable row strictly below it (the
// scan starts one row down, whatever the row is) and, if none is found down to the last row and the
// room says so, upwards from the last row.
int xPos = *x;
@@ -1287,4 +1255,25 @@ void IgorEngine::fixWalkPosition(int *x, int *y) {
*y = yPos;
}
+void IgorEngine::handleRoomIgorWalk() {
+ if (_walkDataCurrentIndex > _walkDataLastIndex) {
+ _gameState.igorMoving = false;
+ _walkDataLastIndex = _walkDataCurrentIndex;
+ if (_actionCode > 0) {
+ hideCursor();
+ debugC(9, kDebugEngine, "Executing action code %d", _actionCode);
+ const int actionPart = _currentPart;
+ executeAction(_actionCode);
+ if (!_gameState.dialogueTextRunning) {
+ showCursor();
+ }
+ clearAction(_currentPart == actionPart);
+ }
+ }
+ if (_gameState.igorMoving) {
+ moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
+ ++_walkDataCurrentIndex;
+ }
+}
+
} // End of namespace Igor
Commit: a9023660169d833752129af2cb390a6dea723794
https://github.com/scummvm/scummvm/commit/a9023660169d833752129af2cb390a6dea723794
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:04+01:00
Commit Message:
IGOR: Consolidate statics
Changed paths:
A engines/igor/static_inventory.cpp
A engines/igor/static_palette.cpp
A engines/igor/static_room.cpp
A engines/igor/static_text.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/static_cursor.cpp
engines/igor/static_walk.cpp
engines/igor/text.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 4da154972ff..98d9f032d81 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1775,8 +1775,6 @@ protected:
extern IgorEngine *g_engine;
#define SHOULD_QUIT ::Igor::g_engine->shouldQuit()
-// Static data tables (defined in static_walk.cpp, static_cursor.cpp)
-
} // End of namespace Igor
#endif // IGOR_H
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 5fb93376b5e..6c7a17541c9 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -13,6 +13,10 @@ MODULE_OBJS = \
input.o \
static_walk.o \
static_cursor.o \
+ static_room.o \
+ static_inventory.o \
+ static_palette.o \
+ static_text.o \
options.o \
parts/part_0.o \
parts/part_1.o \
diff --git a/engines/igor/static_cursor.cpp b/engines/igor/static_cursor.cpp
index 60a8eb7c77f..67ed2944c9a 100644
--- a/engines/igor/static_cursor.cpp
+++ b/engines/igor/static_cursor.cpp
@@ -38,36 +38,4 @@ const uint8 IgorEngine::_mouseCursorData[] = {
0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x05
};
-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::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_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::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
-};
-
} // End of namespace Igor
diff --git a/engines/igor/static_inventory.cpp b/engines/igor/static_inventory.cpp
new file mode 100644
index 00000000000..c5056548581
--- /dev/null
+++ b/engines/igor/static_inventory.cpp
@@ -0,0 +1,82 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+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 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};
+
+} // End of namespace Igor
diff --git a/engines/igor/static_palette.cpp b/engines/igor/static_palette.cpp
new file mode 100644
index 00000000000..4c2088c444c
--- /dev/null
+++ b/engines/igor/static_palette.cpp
@@ -0,0 +1,53 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+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::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_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
+};
+
+} // End of namespace Igor
diff --git a/engines/igor/static_room.cpp b/engines/igor/static_room.cpp
new file mode 100644
index 00000000000..9e5a5bb5a67
--- /dev/null
+++ b/engines/igor/static_room.cpp
@@ -0,0 +1,364 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+const RoomDataOffsets IgorEngine::PART_00_ROOM_DATA_OFFSETS = {
+ { 45, 3, 6, 2 },
+ { 79, 96 },
+ { 103, 347, 3503, 247, 323, 88 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_01_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 }, // no area-transition table
+ { 4, 15 },
+ { 19, 103, 3155, 209, 179, 82 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // no room-specific dialogue matrix
+};
+
+const RoomDataOffsets IgorEngine::PART_02_ROOM_DATA_OFFSETS = {
+ { 125, 5, 20, 4 }, // five-area transition table
+ { 259, 280 },
+ { 289, 565, 4193, 473, 549, 96 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // no room-specific dialogue matrix
+};
+
+const RoomDataOffsets IgorEngine::PART_04_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 5, 18 }, // walk points and facing positions of the room objects
+ { 23, 231, 3247, 127, 203, 84 },
+ { 0, 0, 0, 0, 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, 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,
+ 240,
+ 15458,
+ 15518,
+ 35
+ }
+};
+
+const RoomDataOffsets IgorEngine::PART_07_ROOM_DATA_OFFSETS = {
+ { 80, 4, 12, 3 },
+ { 151, 168 },
+ { 175, 419, 3575, 319, 395, 88 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // no room-specific question/reply matrix
+};
+
+const RoomDataOffsets IgorEngine::PART_08_ROOM_DATA_OFFSETS = {
+ { 80, 4, 12, 3 },
+ { 149, 162 },
+ { 167, 375, 3391, 271, 347, 84 },
+ {
+ 165, 30,
+ 5188, 100,
+ 90,
+ 270,
+ 15488,
+ 15548,
+ 100
+ }
+};
+
+const RoomDataOffsets IgorEngine::PART_09_ROOM_DATA_OFFSETS = {
+ { 80, 4, 12, 3 },
+ { 149, 162 },
+ { 167, 375, 3391, 271, 347, 84 },
+ { 378, 29, 5237, 46, 120, 480, 10029, 10087, 46 }
+};
+
+const RoomDataOffsets IgorEngine::PART_10_ROOM_DATA_OFFSETS = {
+ { 45, 3, 6, 2 },
+ { 77, 90 },
+ { 95, 303, 3319, 199, 275, 84 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_11_ROOM_DATA_OFFSETS = {
+ { 20, 2, 2, 1 },
+ { 35, 52 },
+ { 59, 309, 3255, 203, 279, 82 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+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,
+ 60,
+ 5230,
+ 5260,
+ 25
+ }
+};
+
+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, 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, 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, 180, 10588, 10632, 66 }
+};
+
+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, 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, 0, 0, 0, 0 }
+};
+
+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, 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, 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, 90, 0, 0, 0 }
+};
+
+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, 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, 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, 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, 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, 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, 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, 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,
+ 90,
+ 2711,
+ 2729,
+ 11
+ }
+};
+
+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, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_32_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 4, 15 },
+ { 19, 209, 3155, 103, 179, 82 },
+ { 0, 0, 0, 0, 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, 120, 3571, 3589, 19 }
+};
+
+const RoomDataOffsets IgorEngine::PART_34_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 }, // walk paths are built directly by the room
+ { 4, 15 },
+ { 19, 211, 3087, 103, 179, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_35_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 }, // walk paths are built directly by the room
+ { 5, 18 },
+ { 23, 233, 3179, 127, 203, 82 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+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, 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, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_50_ROOM_DATA_OFFSETS = {
+ { 245, 7, 42, 6 },
+ { 589, 594 },
+ { 595, 731, 3467, 619, 695, 76 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_68_ROOM_DATA_OFFSETS = {
+ { 80, 4, 12, 3 },
+ { 148, 159 },
+ { 163, 355, 3231, 247, 323, 80 },
+ { -75, 21, 3472, 100, 30, 60, 13772, 13814, 100 }
+};
+
+const RoomDataOffsets IgorEngine::PART_69_ROOM_DATA_OFFSETS = {
+ { 45, 3, 6, 2 },
+ { 76, 87 },
+ { 91, 283, 3159, 175, 251, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_70_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 3, 12 },
+ { 15, 187, 3063, 79, 155, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_71_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 5, 18 },
+ { 23, 231, 3247, 127, 203, 84 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_72_ROOM_DATA_OFFSETS = {
+ { 45, 3, 6, 2 },
+ { 76, 87 },
+ { 91, 281, 3227, 175, 251, 82 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_76_ROOM_DATA_OFFSETS = {
+ { 20, 2, 2, 1 },
+ { 32, 43 },
+ { 47, 237, 3183, 131, 207, 82 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_77_ROOM_DATA_OFFSETS = {
+ { 320, 8, 56, 7 },
+ { 835, 844 },
+ { 847, 1019, 3895, 911, 987, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
+const RoomDataOffsets IgorEngine::PART_81_ROOM_DATA_OFFSETS = {
+ { 20, 2, 2, 1 },
+ { 32, 43 },
+ { 47, 237, 3183, 131, 207, 82 },
+ { -125, 10, 1618, 50, 30, 30, 6818, 6838, 50 }
+};
+
+} // End of namespace Igor
diff --git a/engines/igor/static_text.cpp b/engines/igor/static_text.cpp
new file mode 100644
index 00000000000..bb65be880ff
--- /dev/null
+++ b/engines/igor/static_text.cpp
@@ -0,0 +1,32 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+const uint8 IgorEngine::_talkDelays[] = {0, 27, 22, 17, 12, 7, 0};
+
+const uint8 IgorEngine::_dialogueColor[] = {0x3F, 0x3F, 0x3F};
+
+const uint8 IgorEngine::_sentenceColorIndex[] = {0xFD, 0xFB, 0xF1};
+
+} // End of namespace Igor
diff --git a/engines/igor/static_walk.cpp b/engines/igor/static_walk.cpp
index 2d577fe8d5d..0e5a60807d3 100644
--- a/engines/igor/static_walk.cpp
+++ b/engines/igor/static_walk.cpp
@@ -23,27 +23,6 @@
namespace Igor {
-const RoomDataOffsets IgorEngine::PART_00_ROOM_DATA_OFFSETS = {
- { 45, 3, 6, 2 },
- { 79, 96 },
- { 103, 347, 3503, 247, 323, 88 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_01_ROOM_DATA_OFFSETS = {
- { 0, 0, 0, 0 }, // no area-transition table
- { 4, 15 },
- { 19, 103, 3155, 209, 179, 82 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // no room-specific dialogue matrix
-};
-
-const RoomDataOffsets IgorEngine::PART_02_ROOM_DATA_OFFSETS = {
- { 125, 5, 20, 4 }, // five-area transition table
- { 259, 280 },
- { 289, 565, 4193, 473, 549, 96 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // no room-specific dialogue matrix
-};
-
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,
@@ -210,321 +189,4 @@ const float IgorEngine::_walkScaleSpeedTable[] = {
5.0000f, 5.2500f, 5.5000f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f
};
-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, 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,
- 240,
- 15458,
- 15518,
- 35
- }
-};
-
-const RoomDataOffsets IgorEngine::PART_07_ROOM_DATA_OFFSETS = {
- { 80, 4, 12, 3 }, // DAT+80, 4 records, 12-byte source, 3-byte destination
- { 151, 168 },
- { 175, 419, 3575, 319, 395, 88 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 } // no room-specific question/reply matrix
-};
-
-const RoomDataOffsets IgorEngine::PART_08_ROOM_DATA_OFFSETS = {
- { 80, 4, 12, 3 },
- { 149, 162 },
- { 167, 375, 3391, 271, 347, 84 },
- {
- 165, 30,
- 5188, 100,
- 90,
- 270,
- 15488,
- 15548,
- 100
- }
-};
-
-const RoomDataOffsets IgorEngine::PART_09_ROOM_DATA_OFFSETS = {
- { 80, 4, 12, 3 }, // transition table at DAT+80, four areas, strides 12 and 3
- { 149, 162 },
- { 167, 375, 3391, 271, 347, 84 },
- { 378, 29, 5237, 46, 120, 480, 10029, 10087, 46 }
-};
-
-const RoomDataOffsets IgorEngine::PART_04_ROOM_DATA_OFFSETS = {
- { 0, 0, 0, 0 },
- { 5, 18 }, // walk points and facing positions of the room objects
- { 23, 231, 3247, 127, 203, 84 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_10_ROOM_DATA_OFFSETS = {
- { 45, 3, 6, 2 }, // DAT+45, 3 records, 6-byte source, 2-byte destination
- { 77, 90 },
- { 95, 303, 3319, 199, 275, 84 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_11_ROOM_DATA_OFFSETS = {
- { 20, 2, 2, 1 }, // DAT+20, 2 areas, 2-byte source stride, 1-byte destination stride
- { 35, 52 },
- { 59, 309, 3255, 203, 279, 82 }, // +60 is the object's walk behavior
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-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,
- 60,
- 5230,
- 5260,
- 25
- }
-};
-
-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, 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, 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, 180, 10588, 10632, 66 }
-};
-
-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, 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, 0, 0, 0, 0 }
-};
-
-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, 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, 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, 90, 0, 0, 0 }
-};
-
-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, 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, 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, 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, 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, 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, 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, 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, // first question at blob+115
- 9,
- 1489, // first reply at blob+1591
- 11,
- 30,
- 90, // reply 4 starts at +94
- 2711, // derived from the packed-tail layout
- 2729,
- 11
- }
-};
-
-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, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_32_ROOM_DATA_OFFSETS = {
- { 0, 0, 0, 0 },
- { 4, 15 },
- { 19, 209, 3155, 103, 179, 82 },
- { 0, 0, 0, 0, 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, 120, 3571, 3589, 19 }
-};
-
-const RoomDataOffsets IgorEngine::PART_34_ROOM_DATA_OFFSETS = {
- { 0, 0, 0, 0 }, // walk paths are built directly by the room
- { 4, 15 },
- { 19, 211, 3087, 103, 179, 80 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_35_ROOM_DATA_OFFSETS = {
- { 0, 0, 0, 0 }, // walk paths are built directly by the room
- { 5, 18 },
- { 23, 233, 3179, 127, 203, 82 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-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, 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, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_50_ROOM_DATA_OFFSETS = {
- { 245, 7, 42, 6 },
- { 589, 594 },
- { 595, 731, 3467, 619, 695, 76 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_69_ROOM_DATA_OFFSETS = {
- { 45, 3, 6, 2 },
- { 76, 87 },
- { 91, 283, 3159, 175, 251, 80 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_70_ROOM_DATA_OFFSETS = {
- { 0, 0, 0, 0 },
- { 3, 12 },
- { 15, 187, 3063, 79, 155, 80 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_71_ROOM_DATA_OFFSETS = {
- { 0, 0, 0, 0 },
- { 5, 18 },
- { 23, 231, 3247, 127, 203, 84 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_72_ROOM_DATA_OFFSETS = {
- { 45, 3, 6, 2 },
- { 76, 87 },
- { 91, 281, 3227, 175, 251, 82 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_76_ROOM_DATA_OFFSETS = {
- { 20, 2, 2, 1 },
- { 32, 43 },
- { 47, 237, 3183, 131, 207, 82 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_77_ROOM_DATA_OFFSETS = {
- { 320, 8, 56, 7 },
- { 835, 844 },
- { 847, 1019, 3895, 911, 987, 80 },
- { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
-};
-
-const RoomDataOffsets IgorEngine::PART_68_ROOM_DATA_OFFSETS = {
- { 80, 4, 12, 3 },
- { 148, 159 },
- { 163, 355, 3231, 247, 323, 80 },
- { -75, 21, 3472, 100, 30, 60, 13772, 13814, 100 }
-};
-
-const RoomDataOffsets IgorEngine::PART_81_ROOM_DATA_OFFSETS = {
- { 20, 2, 2, 1 },
- { 32, 43 },
- { 47, 237, 3183, 131, 207, 82 },
- { -125, 10, 1618, 50, 30, 30, 6818, 6838, 50 }
-};
-
} // End of namespace Igor
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 5b3135f3828..60fcc70135d 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -22,63 +22,6 @@
namespace Igor {
-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::_dialogueColor[] = {0x3F, 0x3F, 0x3F};
-
-const uint8 IgorEngine::_sentenceColorIndex[] = {0xFD, 0xFB, 0xF1};
-
/**
* appends one DialogueText{num, count, sound} record to the batch being built.
* Game accumulates texts in _dialogeTextsTable, then displays them during dialogues.
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 20259ff4c55..6c7da93050d 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -190,7 +190,6 @@ void IgorEngine::moveIgor(int pos, int frame) {
}
}
for (igorBodyScanLine = 0; igorBodyScanLine < igorScaledHeight; ++igorBodyScanLine) {
- .
if (screenIgorDrawOffset < 320 * 144) {
const int len = MIN<int>(igorScaledWidth, 320 * 144 - screenIgorDrawOffset);
memcpy(_screenVGA + screenIgorDrawOffset, _igorTempFrames + igorBodyScanLine * 50, len);
Commit: 08002411c7dcf4c029a5f590004d469177952cc5
https://github.com/scummvm/scummvm/commit/08002411c7dcf4c029a5f590004d469177952cc5
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:05+01:00
Commit Message:
IGOR: Last minute renames
Changed paths:
engines/igor/graphics.cpp
engines/igor/input.cpp
engines/igor/options.cpp
engines/igor/palette.cpp
engines/igor/parts/part_34.cpp
engines/igor/resource.cpp
engines/igor/sound.cpp
engines/igor/statics.h
engines/igor/text.cpp
diff --git a/engines/igor/graphics.cpp b/engines/igor/graphics.cpp
index 2344016adea..55514b66d81 100644
--- a/engines/igor/graphics.cpp
+++ b/engines/igor/graphics.cpp
@@ -45,7 +45,7 @@ void IgorEngine::copyArea(uint8 *dst, int dstOffset, int dstPitch, const uint8 *
}
/**
- * Draws a block of w x h pixels stored row after row (pitch == w) in the animation frames buffer onto the screen at the given screen offset.
+ * Draws a block of w x h pixels stored row after row in the animation frames buffer onto the screen at the given screen offset.
* With alsoBackground the raw block is also written to the room background (_screenLayer1), so it persists when the screen is redrawn.
*
* "blend" selects how the block is combined with what is already there:
@@ -93,6 +93,7 @@ void IgorEngine::drawAnimRect(int dstOffset, int animOffset, int w, int h, bool
* Plays the frames from firstFrame to lastFrame (either direction) of a sprite strip with drawAnimRect(kBlendLitSprite)
* (frames of frameSize bytes starting at srcOffset, each width x height), waiting "delay" ticks between frames. When soundFrame is drawn,
* "sound" is played.
+ * Used for the shaded parts in room 0 and 2.
*/
void IgorEngine::animateLitAnimFrames(int srcOffset, int firstFrame, int lastFrame,
int frameSize, int width, int height, int dstOffset, int delay,
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 184a453947e..a2de927b06e 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -72,6 +72,7 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
break;
case Common::EVENT_MOUSEMOVE:
if (_rightButtonSelecting) {
+ // righ button selects a verb in the panel
if (ev.mouse.x < _rightButtonSelectCursorX) {
_inputVars[kInputRightMoveLeft] = 1;
} else if (ev.mouse.x > _rightButtonSelectCursorX) {
@@ -298,7 +299,6 @@ void IgorEngine::handleRoomInput() {
_inputVars[kInputEscape] = 0;
}
- // ESCAPE for pause
if (_inputVars[kInputPause]) {
_inputVars[kInputPause] = 0;
handlePause();
@@ -480,7 +480,7 @@ void IgorEngine::handleRoomInput() {
} else {
_actionCode = _roomActionsTable[_roomDataOffsets.action.defaultVerb + _currentAction.verb * 2 + _currentAction.object1Num * 20];
}
- // The original only exposes a room object when this action byte is
+ // Expose a room object when this action byte is
// non-zero; otherwise hover text is verb-only.
if (_actionCode == 0 && _currentAction.object1Type == kObjectTypeRoom) {
_currentAction.object1Num = 0;
@@ -505,17 +505,6 @@ void IgorEngine::handleRoomInput() {
return;
}
debugC(9, kDebugEngine, "handleRoomInput() actionCode %d", _actionCode);
- // expanded: shows what the clicks resolved to and how the offset was built
- debugC(9, kDebugEngine, " verb %d verbType %d | obj1: type %d num %d (row %d) | obj2: type %d num %d (col %d) | verbBase %d offset %d -> %d",
- _currentAction.verb, _currentAction.verbType,
- _currentAction.object1Type, _currentAction.object1Num,
- _currentAction.object1Type == 0 ? -1 : _roomActionsTable[_roomDataOffsets.action.object1 + _currentAction.object1Num + _currentAction.object1Type * 38],
- _currentAction.object2Type, _currentAction.object2Num,
- _currentAction.object2Type == 0 ? -1 : _roomActionsTable[_roomDataOffsets.action.object2 + _currentAction.object2Num + _currentAction.object2Type * 38],
- _currentAction.verbType == 1 ? _roomDataOffsets.action.useVerb : _roomDataOffsets.action.giveVerb,
- (_roomActionsTable[_roomDataOffsets.action.object2 + _currentAction.object2Num + _currentAction.object2Type * 38] * 2) +
- (_roomActionsTable[_roomDataOffsets.action.object1 + _currentAction.object1Num + _currentAction.object1Type * 38] * _roomDataOffsets.action.objectSize),
- _actionCode);
if (_actionCode == 0) {
debugC(9, kDebugEngine, "handleRoomInput() actionCode is 0, clearing action");
clearAction();
@@ -585,9 +574,6 @@ void IgorEngine::handleRoomInput() {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
}
- // Already at the target: the action is not run here. The walk index was
- // decremented above, so the per-tick walk handler resynchronizes it and
- // then executes the pending action.
return;
}
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 7a3bfa8dc74..055d8bc485b 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -45,6 +45,21 @@ static const struct {
{ 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) {
@@ -297,25 +312,13 @@ bool IgorEngine::handleOptionsMenu_handleKeyDownCtrl(int key) {
handleOptionsMenu_paintCtrl();
return false;
}
-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;
- }
- }
-}
void IgorEngine::handleOptionsMenu() {
- // Retain the gameplay view before the menu draws or dims its palette.
+ // get the gameplay screenshot before the menu draws or dims its palette.
_optionsMenuThumbnail.free();
::createThumbnailFromScreen(&_optionsMenuThumbnail);
loadOptionsMenuTexts();
+ // pause engine so no sounds keep playing while the options menu is active.
PauseToken pauseToken = pauseEngine();
Audio::PCSpeaker speaker;
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index c4ae0202190..597716e77cf 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -30,7 +30,6 @@ void IgorEngine::setupDefaultPalette() {
memset(_currentPalette, 0, 255 * 3);
memset(&_currentPalette[255 * 3], 63, 3);
updatePalette(768);
- // g_system->getPaletteManager()->setPalette(_currentPalette, 0, 256);
}
void IgorEngine::scrollPalette(int startColor, int endColor) {
@@ -53,7 +52,6 @@ void IgorEngine::darkenPalette(uint8 *palette, int firstColor, int lastColor, in
}
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]);
@@ -88,7 +86,7 @@ void IgorEngine::SET_PAL_240_48_1() {
}
void IgorEngine::fadeIn(int count) {
- debugC(9, kDebugScreen, "fadeInPalette(%d)", count);
+ debugC(9, kDebugScreen, "fadeIn(%d)", count);
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
int m = 66;
do {
@@ -109,7 +107,7 @@ void IgorEngine::fadeIn(int count) {
}
void IgorEngine::fadeOut(int count) {
- debugC(9, kDebugScreen, "fadeOutPalette(%d)", count);
+ debugC(9, kDebugScreen, "fadeOut(%d)", count);
_system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
// only the faded range is saved; the rest of the buffer is left untouched
memcpy(_paletteBuffer, _currentPalette, count);
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index 7eb92a8347b..90dad869bed 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -443,7 +443,7 @@ void IgorEngine::part34ApplyObjectState(int num) {
}
void IgorEngine::part34OldLadyIdleAnimationFrame(int step) {
- drawAnimRect(73 * 320 + 112, kParkIdleFrames + kOldLadyIdleFrames[step - 1] * 630, 18, 35, true, kBlendBehindIgorAndText);
+ drawAnimRect(73 * 320 + 112, kParkOldLadyIdleFrames + kOldLadyIdleFrames[step - 1] * 630, 18, 35, true, kBlendBehindIgorAndText);
}
void IgorEngine::part34UpdateBackground() {
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index acfa0a745e2..c23d8869d9a 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -134,14 +134,10 @@ void IgorEngine::loadDialogueData(int dlg) {
memset(_dialogueQuestionSounds, 0, sizeof(_dialogueQuestionSounds));
memset(_dialogueReplySounds, 0, sizeof(_dialogueReplySounds));
if (_game.flags & kFlagTalkie) {
- // A zero speech layout retains the legacy packed-tail layout for dialogue
- // rooms that have not yet had their original offsets added to RoomDataOffsets.
int questionSoundsOffset = _roomDataOffsets.dlg.questionSoundsOffset;
int replySoundsOffset = _roomDataOffsets.dlg.replySoundsOffset;
int replySoundsSize = _roomDataOffsets.dlg.replySoundsSize;
if (questionSoundsOffset == 0) {
- // The packed tail shares the last question word with the reply table's
- // leading residue word.
questionSoundsOffset = dataSize - (_roomDataOffsets.dlg.questionsSize + _roomDataOffsets.dlg.repliesSize + 1) * 2;
replySoundsOffset = questionSoundsOffset + _roomDataOffsets.dlg.questionsSize * 2;
replySoundsSize = _roomDataOffsets.dlg.repliesSize;
@@ -279,7 +275,7 @@ ResourceEntry *IgorEngine::findData(int id) {
* IGOR.TBL is produced externally using the same ids pointing to a given resource.
*/
uint8 *IgorEngine::loadData(int id, uint8 *dst, int *size) {
- // debugC(9, kDebugResource, "loadData() id %d", id);
+ debugC(9, kDebugResource, "loadData() id %d", id);
ResourceEntry *re = findData(id);
if (!dst) {
dst = (uint8 *)malloc(re->size);
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index d4d28ed5431..9c0fdaa0833 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -119,7 +119,6 @@ void IgorEngine::playSound(int num, int type) {
Audio::Mixer::SoundType soundType;
Audio::SoundHandle *soundHandle = 0;
if (type == 1) {
- // debugC(9, kDebugEngine, "playSound() %d -> sfx offset %d", num + 1, num);
if (!isCDVersion() && num >= _soundOffsetsCount)
return;
if (_mixer->isSoundHandleActive(_sfxHandle)) {
@@ -147,7 +146,7 @@ void IgorEngine::playSound(int num, int type) {
}
// two streams must never share one Common::File: the second stream's seek would
- // clobber the first one's cursor and the running sound would come out as
+ // fight for the first one's cursor and the running sound would come out as
// noise. Give each stream its own handle and let the stream dispose of it.
Common::File *sndFile = new Common::File;
if (!sndFile->open(_game.sfxFileName)) {
diff --git a/engines/igor/statics.h b/engines/igor/statics.h
index b310aec8f7a..a845c0dd1ec 100644
--- a/engines/igor/statics.h
+++ b/engines/igor/statics.h
@@ -33,15 +33,14 @@ const uint32 kPart10_11_Frm3 = 0xC5E2;
const uint32 kPart10_11_Frm4 = 0xC786;
const uint32 kPart10_11_Frm5 = 0xC8AE;
-// Layout of the animation buffer while the park is loaded: FRM_Park1..4 follow each other
-// from kParkFrames on, and the frames of Laura's entrance replace them while she is on screen.
-const uint32 kParkFrames = 0x5A00; // FRM_Park1: sparse frames, the old lady and Igor
-const uint32 kParkFrameTable = 0x76A8; // FRM_Park2: frame offset table, relative to kParkFrames
-const uint32 kParkPickUpFrames = 0xD0E6; // FRM_Park3: three raw 27x49 frames of the pick up animation
-const uint32 kParkIdleFrames = 0xE067; // FRM_Park4: five raw 18x35 frames of the old lady's idle animation
-const uint32 kParkLauraFrames = 0x5A00; // FRM_ParkLaura1: sparse frames
-const uint32 kParkLauraFrameTable = 0x9EAE; // FRM_ParkLaura2: frame offset table, relative to kParkLauraFrames
-const uint32 kParkLauraPalette = 0xF920; // FRM_ParkLaura3: 16 colors for Laura's sprites
+// Shared animation buffer while the park is loaded
+const uint32 kParkFrames = 0x5A00;
+const uint32 kParkFrameTable = 0x76A8;
+const uint32 kParkPickUpFrames = 0xD0E6;
+const uint32 kParkOldLadyIdleFrames = 0xE067;
+const uint32 kParkLauraFrames = 0x5A00;
+const uint32 kParkLauraFrameTable = 0x9EAE;
+const uint32 kParkLauraPalette = 0xF920;
} // End of namespace Igor
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 60fcc70135d..7d8d0614478 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -83,7 +83,7 @@ void IgorEngine::fixDialogueTextPosition(int num, int count, int *x, int *y) {
}
/**
- * Paints the text on the screen buffer
+ * Paints the text on the screen buffer for a NPC dialogue.
*/
void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
if (_eventQuitGame)
@@ -119,15 +119,14 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
for (int i = 0; i < dt->count; ++i) {
const char *textLine = _globalDialogueTexts[dt->num + i];
-
int textLineWidth = _font.getStringWidth(textLine);
- ;
int textX = talkX - textLineWidth / 2;
int textY = i * 10;
_font.drawString(_screenTextLayer, textLine, textX, textY, _talkColorIndex, _talkShadowIndex, _talkShadowIndex);
}
setPaletteColor(_talkColorIndex, r, g, b);
setPaletteColor(_talkShadowIndex, 0, 0, 0);
+
const int talkMode = prepareDialoguePlayback(*dt);
if (talkMode != kTalkModeSpeechOnly)
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer, _dialogueDirtyRectSize);
@@ -136,8 +135,9 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
}
void IgorEngine::queueDialogueLines(const Common::Array<DialogueText> &lines) {
- for (uint i = 0; i < lines.size(); ++i)
+ for (uint i = 0; i < lines.size(); ++i) {
ADD_DIALOGUE_TEXT(lines[i].num, lines[i].count, lines[i].sound);
+ }
SET_DIALOGUE_TEXT(1, lines.size());
}
@@ -201,9 +201,6 @@ void IgorEngine::cutsceneSayWithCallback(int x, int y, int r, int g, int b, int
* Loop for character talking
*/
void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b) {
- debugC(9, kDebugEngine, "waitForEndOfCutsceneDialogue() begin running %d start %d count %d speechCounter %d delay %d/%d",
- _gameState.dialogueTextRunning, _dialogueTextsStart, _dialogueTextsCount,
- _talkSpeechCounter, _talkDelayCounter, _talkDelay);
do {
if (_eventQuitGame) {
cancelDialogue();
@@ -263,16 +260,14 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
}
// Escape only aborts dialogue during the intro cutscene.
if (_inputVars[kInputEscape] && _currentPart == 850) {
- warning("waitForEndOfCutsceneDialogue() early exit with text active %d start %d count %d speechCounter %d delay %d/%d",
- _gameState.dialogueTextRunning, _dialogueTextsStart, _dialogueTextsCount,
- _talkSpeechCounter, _talkDelayCounter, _talkDelay);
return;
}
waitForTimer();
} while (_gameState.dialogueTextRunning);
- debugC(9, kDebugEngine, "waitForEndOfCutsceneDialogue() end running %d", _gameState.dialogueTextRunning);
+
}
+// Just fixes the dialogue position to that of igor's
void IgorEngine::fixIgorDialogueTextPosition(int num, int count, int *x, int *y) {
WalkData *wd = &_walkData[_walkDataLastIndex - 1];
*x = wd->x;
@@ -290,7 +285,7 @@ int IgorEngine::prepareDialoguePlayback(const DialogueText &text) {
if (!isDialogueSpeechPlaying())
talkMode = kTalkModeTextOnly;
// Speech modes use speed markers instead of a reading speed. Falling
- // back to text selects normal speed, as switching to text-only does.
+ // back to text selects normal speed, same as switching to text-only.
const int talkSpeed = (_gameState.talkSpeed >= 1 && _gameState.talkSpeed <= 5)
? _gameState.talkSpeed : 3;
_talkDelay = talkMode == kTalkModeTextOnly? 2 * text.count * _talkDelays[talkSpeed] : -1;
@@ -432,14 +427,14 @@ void IgorEngine::waitForEndOfIgorDialogue(bool animateHead, bool updateRoomBackg
}
void IgorEngine::animateIgorTalking(int frame) {
- if (getPart() == 4 || getPart() == 70) {
+ if (getPart() == 4 || getPart() == 70) { // maps
return;
}
- if (getPart() == 85) {
+ if (getPart() == 85) { // intro scene, igor behind rock
part85AnimateIgorHead(frame);
return;
}
- if (getPart() == 79) {
+ if (getPart() == 79) { // ending
part79AnimateIgorHead(frame);
return;
}
@@ -560,9 +555,6 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreU
}
void IgorEngine::drawDialogueChoices() {
- debugC(9, kDebugEngine, "drawDialogueChoices() enter running %d start %d count %d click %d skip %d escape %d quit %d",
- _gameState.dialogueTextRunning, _dialogueTextsStart, _dialogueTextsCount,
- _inputVars[kInputClick], _inputVars[kInputSkipDialogue], _inputVars[kInputEscape], _eventQuitGame);
if (_gameState.dialogueTextRunning) {
warning("drawDialogueChoices() entered while dialogue text is still active");
}
Commit: 13e997223182e04a3c95c2233203d2b24fe665ad
https://github.com/scummvm/scummvm/commit/13e997223182e04a3c95c2233203d2b24fe665ad
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:05+01:00
Commit Message:
IGOR: Restructure code
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/parts/part_credits.cpp
engines/igor/room.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 8c77a4449f4..7dfea17fa1b 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -40,9 +40,8 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
_gameDescription(gameDesc), _randomSource("Igor") {
g_engine = this;
- // The original draws the fifth Dean dialogue choice at y=190 into the
- // 64-KiB mode-13h VGA segment; its 11th font row is outside the visible
- // 320x200 area but still inside that segment.
+ // Some parts draw outside the visible 320x200 area, but still within 64kb segment
+ // hence allocate full 64-KiB VGA segment for the screen buffer
_screenVGA = (uint8 *)malloc(65536);
for (int i = 0; i < 4; i++) {
_facingIgorFrames[i] = (uint8 *)malloc(13500);
@@ -63,13 +62,8 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
_game.flags = gameDesc->gameFlags;
_game.language = gameDesc->desc.language;
- // _currentPart = 850;
_currentPart = kStartupPart;
- // _currentPart = 171;
- // _currentPart = 62;
- // _currentPart = 40;
-
_midiPlayer = nullptr;
_musicData = nullptr;
@@ -96,8 +90,6 @@ IgorEngine::~IgorEngine() {
free(_inventoryImagesBuffer);
free(_verbsPanelBuffer);
- // DebugMan.clearAllDebugChannels();
-
delete _screen;
}
@@ -178,7 +170,7 @@ void IgorEngine::restart() {
_executeMainAction = 0;
_executeRoomAction = 0;
_previousMusic = 0;
- // _musicData = 0;
+ _musicData = 0;
_scrollInventory = false;
_roomCursorOn = true;
_currentCursor = 0;
@@ -262,7 +254,7 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
return false;
memcpy(_screenVGA, _screenLayer1, 46080);
- if (drawIgor) {
+ if (drawIgor) { // position Igor in the room at the saved position
if (!_gameState.igorMoving)
_walkDataCurrentIndex = _walkDataLastIndex - 1;
WalkData *wd = &_walkData[_walkDataCurrentIndex];
@@ -270,7 +262,7 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
if (!_gameState.igorMoving)
_walkDataCurrentIndex = _walkDataLastIndex;
}
- if (!_gameState.dialogueStarted) {
+ if (!_gameState.dialogueStarted) { // if loading we need to redraw the room background and UI
memset(_screenVGA + 46080, 0, 17920);
SET_PAL_208_96_1();
SET_PAL_240_48_1();
@@ -317,34 +309,9 @@ void IgorEngine::runPartLoop() {
waitForTimer();
}
-void IgorEngine::handleRoomDialogue() {
- if (_gameState.dialogueTextRunning) {
- // Speech completion ends the sentence, exactly as in the two blocking
- // dialogue loops. Without this the sentence only ever ends on a click:
- if (_talkDelay < 0 && !isDialogueSpeechPlaying()) {
- _talkDelayCounter = _talkDelay;
- }
- if (_talkDelayCounter == _talkDelay) {
- animateIgorTalking(0);
- memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
- if (_dialogueTextsCount == 0) {
- // Speech must stop with the last line, otherwise it keeps playing
- // after the text is gone and nothing is left to stop it.
- stopDialogueSpeech();
- _gameState.dialogueTextRunning = false;
- showCursor();
- } else {
- ++_dialogueTextsStart;
- startIgorDialogue();
- }
- } else {
- animateIgorTalking(getRandomNumber(5));
- ++_talkDelayCounter;
- }
- }
-}
-
-
+/**
+ * igor's eyes blink when he is idle
+ */
void IgorEngine::handleIgorIdleAnimation() {
if (_gameState.dialogueTextRunning || _gameState.igorMoving) {
_gameState.updateLight = false;
@@ -363,7 +330,6 @@ void IgorEngine::handleRoomInventoryScroll() {
}
}
-
void IgorEngine::addObjectToInventory(int object, int index) {
debugC(9, kDebugEngine, "addObjectToInventory %d %d", object, index);
++_inventoryInfo[73];
@@ -392,6 +358,9 @@ bool IgorEngine::debugAddObjectToInventory(int object) {
return true;
}
+/**
+ * just removes without updating ui or playing the sound
+ */
void IgorEngine::removeInventoryEntry(int index) {
_inventoryInfo[_inventoryInfo[index] - 1] = 0;
_inventoryInfo[index] = 0;
@@ -457,9 +426,8 @@ void IgorEngine::handlePause() {
}
Common::Error IgorEngine::syncGame(Common::Serializer &s) {
- // Serialize in the same order as reference implementation
- // 1. Walk data (100 entries)
+ // Walk data (100 entries)
for (int i = 0; i < 100; ++i) {
s.skip(2);
s.syncAsSint16LE(_walkData[i].x);
@@ -476,7 +444,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
s.syncAsByte(_walkData[i].scaleHeight);
}
- // 2. Walk path state
+ // Walk path state
s.skip(20);
s.syncAsByte(_walkDataCurrentIndex);
s.syncAsByte(_walkDataLastIndex);
@@ -484,7 +452,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
s.syncAsByte(_walkCurrentPos);
s.skip(23);
- // 3. Current action
+ // Current action
s.syncAsByte(_currentAction.verb);
s.syncAsByte(_currentAction.object1Num);
s.syncAsByte(_currentAction.object1Type);
@@ -493,24 +461,24 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
s.syncAsByte(_currentAction.object2Type);
s.skip(10);
- // 4. Part/state
+ // Part/state
s.syncAsSint16LE(_currentPart);
- // the location in the maze is kept in the padding
+ // the location in the maze
s.syncAsByte(_mazeLocation);
- // whether Igor has already read the notice board in room 7 is also kept in the padding
+ // whether Igor has already read the notice board in room 7
s.syncAsByte(_part07FirstVisitDone);
s.skip(6);
- // 5. Action state
+ // Action state
s.syncAsByte(_actionCode);
s.syncAsByte(_actionWalkPoint);
s.skip(2);
- // 6. Cursor position
+ // Cursor position
s.syncAsSint16LE(_inputVars[kInputCursorXPos]);
s.syncAsSint16LE(_inputVars[kInputCursorYPos]);
- // 7. Game state
+ // Game state
s.syncAsByte(_gameState.enableLight);
s.syncAsByte(_gameState.colorLum);
for (int i = 0; i < 5; ++i) {
@@ -569,12 +537,12 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
s.syncAsByte(_gameState.musicNum);
s.syncAsByte(_gameState.musicSequenceIndex);
- // 8. Object states
+ // Global Object states
for (int i = 0; i < 112; ++i) {
s.syncAsByte(_objectsState[i]);
}
- // 9. Inventory
+ // Inventory
for (int i = 0; i < 74; ++i) {
s.syncAsByte(_inventoryInfo[i]);
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 98d9f032d81..152ed4305cf 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -45,7 +45,6 @@
namespace Igor {
-
enum {
kStartupPart = 900,
kInvalidPart = 255,
@@ -289,11 +288,11 @@ struct MazeRoom {
uint8 flameMode;
uint8 numFlames;
MazeFlame flames[2];
- uint8 flameFrames[2]; // frames drawn when the room starts
- uint8 secondFlameFrame; // the frame the second flame counts as having at the start
+ uint8 flameFrames[2];
+ uint8 secondFlameFrame;
bool saveLocation; // the room ends when the location changes
const RoomDataOffsets *offsets;
- int giveObjectSize; // stride of the give matrix when it is not the one of the use matrix
+ int giveObjectSize;
RoomWalkTargetRules clickFix;
const MazeEntry *entries;
uint8 numEntries;
@@ -592,7 +591,7 @@ private:
bool _eventQuitGame;
bool _gameStateLoaded;
- // pass of the end credits: 0 for the first one (set when the ending is over), the pages are shown again after it
+ // pass of the end credits: 0 for the first one (set when the ending is over), the same "pages" are shown again after it
uint8 _creditsPass;
GameStateData _gameState;
@@ -602,8 +601,6 @@ private:
int _mazeFlameFrame[2];
uint32 _nextTimer;
- // Toggled with Ctrl+F (1 <-> kFastModeFactor), or set to any 1..kFastModeMaxFactor
- // with the console's fast_mode command.
int _fastMode;
int _language;
@@ -670,10 +667,9 @@ private:
bool _part07FirstVisitDone;
- // scratch of the room loops: the current ambient frame (a star in part 72, the screen in part 68)
uint8 _roomAmbientIndex;
+
// the two fireflies of room 69: the current frame of each and the steps of the first one since the second one started
- // frames of the band drawn across the picture in state 780 (loaded while the scene lasts)
uint8 *_part78BandFrames = nullptr;
uint8 _part79EndFrame = 0;
uint8 _part79BaseFrame = 0;
@@ -1353,6 +1349,7 @@ private:
void part70UpdateBackground();
void part70();
+ // cemetery
void part71ExecuteAction(int action);
void part71ApplyObjectState(int what);
void part71DrawObject(int frame);
@@ -1363,6 +1360,7 @@ private:
void part71UpdateBackground();
void part71();
+ // forest
void part72ExecuteAction(int action);
void part72ApplyObjectState();
void part72TakeFlower();
@@ -1373,10 +1371,12 @@ private:
void part72();
void part72PaintBlinkingEyes();
+ // police cutscene
void part73DrawPoliceman(int frame);
void part73UpdateDialogue(int action);
void part73Cutscene();
+ // ship cutscene
void part74CycleColors();
void part74DrawCharacterFrame(int frame);
void part74UpdateSailorDialogue(int action);
@@ -1390,6 +1390,7 @@ private:
void part75DrawPhilipFrame(int frame);
void part75();
+ // plane
void part76ExecuteAction(int action);
void part76ApplyObjectState();
void part76DrawParachuteFrame(int frame);
@@ -1400,6 +1401,7 @@ private:
void part76Entry();
void part76();
+ // college entrance (with cage)
void part77ExecuteAction(int action);
void part77ApplyObjectState();
void part77DrawMonkeyFrame(int frame);
@@ -1408,6 +1410,7 @@ private:
void part77EnterFromCollege();
void part77();
+ // Exam cutscene
void part78DrawProfessorFrame(int frame);
void part78DrawAlumniFrame(int frame);
void part78DrawIgorFrame(int frame);
@@ -1424,6 +1427,7 @@ private:
void part78ProfessorWarnings(int which);
void part78();
+ // Ending
void part79DrawLauraInWater(int frame);
void part79DrawReflection(int step);
void part79ClearReflection();
@@ -1452,12 +1456,14 @@ private:
void part79BeachScene();
void part79();
+ // Library cutscene
void part80DrawFrame(int frame);
void part80UpdateFriendDialogue(int action);
void part80UpdateLauraDialogue(int action);
void part80Say(int who, const Common::Array<DialogueText> &lines);
void part80();
+ // Lighthouse
void part81ExecuteAction(int action);
void part81LoadRoom();
void part81LoadAnimation();
@@ -1499,11 +1505,6 @@ private:
int partMazeGetMusicTrack() const;
- void setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp, int yBottom = 143);
-
- void partMainUpdateObjectState(int num);
- void partMainUpdateFiguresOnPaper(int delay);
-
void partMainMeanwhile(int img = IMG_Meanwhile);
// Margaret cutscenes
@@ -1519,7 +1520,6 @@ private:
void part85DisplayLogo();
void part85UpdatePhilipLauraDialogue(int action);
void part85UpdateBackground();
-
void part85AnimateIgorHead(int frame);
// Splash screens
@@ -1531,6 +1531,11 @@ private:
void partCredits();
void partCreditsDrawText(int x, int y, uint8 color, bool underline, const char *str);
+ void setRoomClickFix(int yMax, int xMin, int xMax, bool scanUp, int yBottom = 143);
+
+ void partMainUpdateObjectState(int num);
+ void partMainUpdateFiguresOnPaper(int delay);
+
void handleRoomInput();
void executeAction(int action);
@@ -1613,8 +1618,8 @@ private:
bool isCDVersion() const { return !(_game.flags & kFlagFloppy); }
int getPart() const { return _currentPart / 10; }
- 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; }
+ bool compareGameTick(int add, int mod) const { return ((_gameTicks + (add & ~7)) % mod) == 0; }
+ bool compareGameTick(int eq) const { return _gameTicks == (eq & ~7); }
void waitForTimer(int ticks = -1, bool presentScreen = true, uint32 deadline = 0);
diff --git a/engines/igor/parts/part_credits.cpp b/engines/igor/parts/part_credits.cpp
index fa84c440f57..549396291c2 100644
--- a/engines/igor/parts/part_credits.cpp
+++ b/engines/igor/parts/part_credits.cpp
@@ -48,18 +48,16 @@ static const CreditsPage kCreditsPages[7] = {
// Number of timer units a page stays on the screen
static const int kCreditsPageTicks = 4000;
-static const int kCreditsMusic = 9;
// Color of the names, set to white in the palette of every page
static const int kCreditsNameColor = 0xC3;
/**
- * Centers the string on x. The underlined lines (the headings) have a bar of the text color, three rows high and
- * black at both ends, 18 rows below the top of the text.
+ * Centers the string horizontally
*/
void IgorEngine::partCreditsDrawText(int x, int y, uint8 color, bool underline, const char *str) {
const int width = _font.getStringWidth(str);
_font.drawString(_screenVGA, str, x - (width >> 1), y, color, 0, 0);
- if (underline) {
+ if (underline) { // headings have an underline of the same color as text
const int barX = x - (width >> 1) - 10;
const int barWidth = width + 21;
memset(_screenVGA + (y + 18) * 320 + barX, 0, barWidth);
@@ -71,7 +69,7 @@ void IgorEngine::partCreditsDrawText(int x, int y, uint8 color, bool underline,
}
/**
- * States 910 .. 970: seven pages with the credits, shown twice (the second pass has other texts over the same
+ * States 910-970: seven pages with the credits, shown twice (the second time has other texts over the same
* pictures), then the logos again.
*/
void IgorEngine::partCredits() {
@@ -80,7 +78,7 @@ void IgorEngine::partCredits() {
const CreditsPage &page = kCreditsPages[(_currentPart - 910) / 10];
if (isCDVersion())
- playMusic(kCreditsMusic);
+ playMusic(9);
else
playMusic(12);
diff --git a/engines/igor/room.cpp b/engines/igor/room.cpp
index f5173a38236..5b6c99a116f 100644
--- a/engines/igor/room.cpp
+++ b/engines/igor/room.cpp
@@ -86,6 +86,31 @@ static void decodeRoomString(const uint8 *src, char *dst, int sz) {
}
}
+void IgorEngine::handleRoomDialogue() {
+ if (_gameState.dialogueTextRunning) {
+ // Speech completion ends the sentence
+ if (_talkDelay < 0 && !isDialogueSpeechPlaying()) {
+ _talkDelayCounter = _talkDelay;
+ }
+ if (_talkDelayCounter == _talkDelay) {
+ animateIgorTalking(0);
+ memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 23040, _dialogueDirtyRectSize);
+ if (_dialogueTextsCount == 0) {
+ // Speech must stop with the last line
+ stopDialogueSpeech();
+ _gameState.dialogueTextRunning = false;
+ showCursor();
+ } else {
+ ++_dialogueTextsStart;
+ startIgorDialogue();
+ }
+ } else {
+ animateIgorTalking(getRandomNumber(5));
+ ++_talkDelayCounter;
+ }
+ }
+}
+
void IgorEngine::decodeRoomStrings(const uint8 *p, bool skipObjectNames) {
if (!skipObjectNames) {
for (int i = 0; i < 20; ++i) {
Commit: 674445bf4509aad5dbf98c5b2ea4c95cd643588a
https://github.com/scummvm/scummvm/commit/674445bf4509aad5dbf98c5b2ea4c95cd643588a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:06+01:00
Commit Message:
IGOR: Have midi employ configured OPL emulator
Changed paths:
engines/igor/midi.cpp
engines/igor/midi.h
diff --git a/engines/igor/midi.cpp b/engines/igor/midi.cpp
index b0150f0e68e..13b600ef18c 100644
--- a/engines/igor/midi.cpp
+++ b/engines/igor/midi.cpp
@@ -22,6 +22,10 @@
#include "common/textconsole.h"
#include "igor/midi.h"
+#ifndef DISABLE_NUKED_OPL
+#include "audio/softsynth/opl/nuked.h"
+#endif
+
namespace Igor {
MidiParser_CTMF::MidiParser_CTMF()
@@ -115,9 +119,16 @@ void MidiParser_CTMF::parseNextEvent(EventInfo &info) {
int AdlibMidiDriver::open() {
MidiDriver_Emulated::open();
- _opl = OPL::MAME::makeAdLibOPL(getRate());
- if (!_opl)
+ _opl = OPL::Config::create(OPL::Config::kOpl2);
+ if (!_opl || !_opl->init())
error("Unable to initialize Igor AdLib music");
+ _oplStream = dynamic_cast<Audio::EmulatedChip *>(_opl);
+#ifndef DISABLE_NUKED_OPL
+ // Nuked produces stereo samples even when emulating an OPL2 chip.
+ _oplStereo = dynamic_cast<OPL::NUKED::OPL *>(_opl) != nullptr;
+#endif
+ if (_oplStream)
+ _oplStream->setCallbackFrequency(_baseFreq);
memset(_adlibData, 0, sizeof(_adlibData));
_adlibRhythmMode = false;
for (int i = 0; i < kAdlibChannelsCount; ++i) {
@@ -133,8 +144,10 @@ int AdlibMidiDriver::open() {
void AdlibMidiDriver::close() {
_mixer->stopHandle(_mixerSoundHandle);
- OPL::MAME::OPLDestroy(_opl);
+ delete _opl;
_opl = nullptr;
+ _oplStream = nullptr;
+ _oplStereo = false;
_isOpen = false;
}
@@ -163,12 +176,15 @@ void AdlibMidiDriver::send(uint32 b) {
}
void AdlibMidiDriver::generateSamples(int16 *data, int len) {
- memset(data, 0, sizeof(int16) * len);
- OPL::MAME::YM3812UpdateOne(_opl, data, len);
+ const int samples = len * (isStereo() ? 2 : 1);
+ if (_oplStream)
+ _oplStream->readBuffer(data, samples);
+ else
+ memset(data, 0, sizeof(int16) * samples);
}
void AdlibMidiDriver::adlibWrite(int port, int value) {
- OPL::MAME::OPLWriteReg(_opl, port, value);
+ _opl->writeReg(port, value);
_adlibData[port & 255] = value & 255;
}
diff --git a/engines/igor/midi.h b/engines/igor/midi.h
index ccc3a034fb6..e249933a220 100644
--- a/engines/igor/midi.h
+++ b/engines/igor/midi.h
@@ -24,7 +24,7 @@
#include "common/util.h"
#include "common/mutex.h"
-#include "audio/softsynth/opl/mame.h"
+#include "audio/fmopl.h"
#include "audio/softsynth/emumidi.h"
#include "audio/mididrv.h"
#include "audio/midiparser.h"
@@ -83,7 +83,7 @@ public:
kAdlibChannelsCount = 18
};
- AdlibMidiDriver(Audio::Mixer *mixer) : MidiDriver_Emulated(mixer), _opl(nullptr) {}
+ AdlibMidiDriver(Audio::Mixer *mixer) : MidiDriver_Emulated(mixer), _opl(nullptr), _oplStream(nullptr), _oplStereo(false) {}
~AdlibMidiDriver() {}
// MidiDriver
@@ -95,7 +95,7 @@ public:
MidiChannel *allocateChannel() override { return 0; }
MidiChannel *getPercussionChannel() override { return 0; }
- bool isStereo() const override { return false; }
+ bool isStereo() const override { return _oplStereo; }
int getRate() const override { return _mixer->getOutputRate(); }
void generateSamples(int16 *buf, int len) override;
@@ -115,7 +115,9 @@ private:
void adlibControlChange(int channel, int control, int param);
void adlibProgramChange(int channel, int num);
- OPL::MAME::FM_OPL *_opl;
+ OPL::OPL *_opl;
+ Audio::EmulatedChip *_oplStream;
+ bool _oplStereo;
uint8 _adlibData[256];
bool _adlibRhythmMode;
struct {
Commit: ae6e36e47688bcc81e1a6ce3a360cec4699234a1
https://github.com/scummvm/scummvm/commit/ae6e36e47688bcc81e1a6ce3a360cec4699234a1
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:06+01:00
Commit Message:
IGOR: Fix midi music scheduling
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/midi.cpp
engines/igor/midi.h
engines/igor/parts/part_77.cpp
engines/igor/sound.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 7dfea17fa1b..3bc3661c694 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -114,6 +114,14 @@ void IgorEngine::restart() {
_roomWalkTargetBottom = 143;
_roomGiveObjectSize = 0;
_nextTimer = 0;
+ _musicUpdateMillis = _system->getMillis();
+ _musicTimerRemainder = 0;
+ _musicTimerDivisor = 65536;
+ _musicRestartCounter = 0xFF;
+ _musicRestartDelay = 50;
+ _musicSuspended = false;
+ if (_midiPlayer)
+ _midiPlayer->stopMusic();
_fastMode = 1;
_language = 0;
@@ -548,6 +556,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
}
if (s.isLoading()) {
+ _musicSuspended = true;
syncSoundSettings();
// Fade the outgoing screen before any loaded room redraws its pixels.
fadeOut(768);
@@ -555,6 +564,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
memcpy(_igorPalette, (_currentPart == 760) ? PAL_IGOR_2 : PAL_IGOR_1, 48);
partMainUpdateObjectState(255);
playMusic(_gameState.musicNum, true);
+ _musicSuspended = false;
_system->warpMouse(_inputVars[kInputCursorXPos], _inputVars[kInputCursorYPos]);
if (_currentPart < 900) {
showCursor();
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 152ed4305cf..fbfc0f5b1f2 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -560,11 +560,18 @@ public:
typedef void (IgorEngine::*UpdateDialogueProc)(int action); // pointer to function that executes on every frame during dialogue
void syncSoundSettings() override;
+ void pauseEngineIntern(bool pause) override;
private:
const IgorGameDescription *_gameDescription;
Common::RandomSource _randomSource;
MidiPlayer *_midiPlayer;
+ uint32 _musicUpdateMillis;
+ uint32 _musicTimerRemainder;
+ uint32 _musicTimerDivisor;
+ uint8 _musicRestartCounter;
+ uint8 _musicRestartDelay;
+ bool _musicSuspended;
uint8 *_musicData;
int _previousMusic;
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index a2de927b06e..eb4f0c98269 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -41,6 +41,7 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
// _fastMode divides the wall-clock deadlines.
uint32 endTicks = deadline ? deadline : ((ticks == -1) ? _nextTimer : _system->getMillis() + ticks * 1000 / kTickDelay / _fastMode);
do {
+ updateMusic();
Common::Event ev;
while (!_eventQuitGame && _eventMan->pollEvent(ev)) {
switch (ev.type) {
@@ -147,9 +148,6 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
setCursor(_currentCursor);
_currentCursor = (_currentCursor + 1) & 3;
}
- // if (_game.flags & kFlagFloppy) {
- // updateMusic();
- // }
if (_gameTicks == 64) {
_gameTicks = 0;
}
diff --git a/engines/igor/midi.cpp b/engines/igor/midi.cpp
index 13b600ef18c..0bc956d63e5 100644
--- a/engines/igor/midi.cpp
+++ b/engines/igor/midi.cpp
@@ -367,6 +367,11 @@ void MidiPlayer::stopMusic() {
_mutex.unlock();
}
+bool MidiPlayer::isPlaying() {
+ Common::StackLock lock(_mutex);
+ return _isPlaying && _parser->isPlaying();
+}
+
void MidiPlayer::updateTimer() {
_mutex.lock();
if (_isPlaying) {
diff --git a/engines/igor/midi.h b/engines/igor/midi.h
index e249933a220..bdf7ea61701 100644
--- a/engines/igor/midi.h
+++ b/engines/igor/midi.h
@@ -142,6 +142,7 @@ public:
void playMusic(uint8 *data, uint32 size);
void stopMusic();
+ bool isPlaying();
private:
diff --git a/engines/igor/parts/part_77.cpp b/engines/igor/parts/part_77.cpp
index b4b036b74d5..aa5c8609ce7 100644
--- a/engines/igor/parts/part_77.cpp
+++ b/engines/igor/parts/part_77.cpp
@@ -117,6 +117,8 @@ void IgorEngine::part77MonkeyCageCutscene() {
{ { 210, 2, 1126 }, { 212, 2, 1127 }, { 214, 1, 1128 }, { 215, 2, 1129 }, { 217, 2, 1130 } },
&IgorEngine::part77UpdateDialogue);
waitForTimer(255);
+ if (!isCDVersion())
+ playMusic(0);
// the colors 240 to 255 are black on the screen
for (int i = 240; i <= 255; ++i) {
setPaletteColor(i, 0, 0, 0);
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 9c0fdaa0833..175be38e2f6 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -68,6 +68,12 @@ void IgorEngine::syncSoundSettings() {
}
void IgorEngine::startMusic(int cmf) {
+ debugC(9, kDebugEngine, "startMusic() cue %d segment %d resource %d",
+ _gameState.musicNum, _gameState.musicSequenceIndex, cmf);
+ if (_musicTimerDivisor != 4096) {
+ _musicTimerDivisor = 4096;
+ _musicTimerRemainder = 0;
+ }
_midiPlayer->stopMusic();
free(_musicData);
int musicDataSize;
@@ -75,22 +81,42 @@ void IgorEngine::startMusic(int cmf) {
_midiPlayer->playMusic(_musicData, musicDataSize);
}
+static int getMusicResource(int num, int sequence) {
+ 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 };
+ if (num < 0 || num >= (int)ARRAYSIZE(cmf))
+ return 0;
+ if (num == 2 || num == 7) {
+ if (sequence < 1 || sequence > 4)
+ return 0;
+ return cmf[num] + sequence - 1;
+ }
+ return cmf[num];
+}
+
void IgorEngine::playMusic(int num, bool restart) {
debugC(9, kDebugEngine, "playMusic() %d", num);
if (_gameState.musicNum == num && !restart)
return;
+ if (_game.flags & kFlagFloppy)
+ updateMusic();
if (_gameState.musicNum != num) {
_gameState.musicNum = num;
_gameState.musicSequenceIndex = 1;
}
if (_game.flags & kFlagFloppy) {
- if (_midiPlayer) {
- 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 };
- if (num < 0 || num >= (int)ARRAYSIZE(cmf) || cmf[num] == 0) {
- // TODO: Restore unsupported music selections once verified.
- return;
- }
- startMusic(cmf[num]);
+ if (!_midiPlayer)
+ return;
+ const int cmf = getMusicResource(num, _gameState.musicSequenceIndex);
+ if (num != 0 && !cmf) {
+ // TODO: Restore unsupported music selections once verified.
+ return;
+ }
+ _midiPlayer->stopMusic();
+ _musicRestartCounter = 0;
+ if (num == 12) {
+ // Credits start directly and are excluded from automatic repetition.
+ startMusic(cmf);
+ _musicRestartCounter = 0xFF;
}
} else {
g_system->getAudioCDManager()->stop();
@@ -99,6 +125,65 @@ void IgorEngine::playMusic(int num, bool restart) {
}
}
+void IgorEngine::updateMusic() {
+ if (!_midiPlayer)
+ return;
+ const uint32 now = _system->getMillis();
+ const uint32 elapsed = now - _musicUpdateMillis;
+ _musicUpdateMillis = now;
+ if (isPaused() || _musicSuspended)
+ return;
+
+ // The music scheduler uses the BIOS timer, independently of game speed.
+ const uint64 timer = _musicTimerRemainder + (uint64)elapsed * 1193180;
+ const uint32 period = _musicTimerDivisor * 1000;
+ uint32 ticks = timer / period;
+ _musicTimerRemainder = timer % period;
+ while (ticks--) {
+ if (_musicRestartCounter != 0xFF) {
+ if (_musicRestartCounter == _musicRestartDelay) {
+ if (_gameState.musicNum > 0 && _gameState.musicNum < 12) {
+ const int cmf = getMusicResource(_gameState.musicNum, _gameState.musicSequenceIndex);
+ if (cmf)
+ startMusic(cmf);
+ }
+ _musicRestartCounter = 0xFF;
+ _musicRestartDelay = 50;
+ } else {
+ ++_musicRestartCounter;
+ }
+ } else if (_gameState.musicNum > 0 && _gameState.musicNum < 12 &&
+ getMusicResource(_gameState.musicNum, _gameState.musicSequenceIndex) && !_midiPlayer->isPlaying()) {
+ switch (_gameState.musicNum) {
+ case 2: {
+ const int previous = _gameState.musicSequenceIndex;
+ do {
+ _gameState.musicSequenceIndex = getRandomNumber(3) + 1;
+ } while (_gameState.musicSequenceIndex == previous);
+ _musicRestartDelay = 5;
+ break;
+ }
+ case 7:
+ _gameState.musicSequenceIndex = _gameState.musicSequenceIndex == 4 ? 1 : _gameState.musicSequenceIndex + 1;
+ _musicRestartDelay = 5;
+ break;
+ case 11:
+ _musicRestartDelay = 5;
+ break;
+ default:
+ _musicRestartDelay = 50;
+ break;
+ }
+ _musicRestartCounter = 0;
+ }
+ }
+}
+
+void IgorEngine::pauseEngineIntern(bool pause) {
+ Engine::pauseEngineIntern(pause);
+ _musicUpdateMillis = _system->getMillis();
+}
+
void IgorEngine::playSound(int num, int type) {
if (type == 1 && (ConfMan.getBool("mute") || ConfMan.getBool("sfx_mute")))
return;
Commit: e0d7236a8698d9da5819d917a6cea41c2784b4ea
https://github.com/scummvm/scummvm/commit/e0d7236a8698d9da5819d917a6cea41c2784b4ea
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:06+01:00
Commit Message:
IGOR: Floppy version does not enforce first visit bulletin board read
Changed paths:
engines/igor/parts/part_7.cpp
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index 34489bceac9..119e4195482 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -99,7 +99,7 @@ void IgorEngine::part7EnterFromOutside() {
_walkDataLastIndex = 0;
// first time read notice board
- if (!_part07FirstVisitDone) {
+ if (_game.version != kIdEngFloppy && !_part07FirstVisitDone) {
buildWalkPath(109, 143, 180, 129);
_walkData[_walkDataLastIndex].frameNum = 0;
_walkData[_walkDataLastIndex].posNum = kFacingPositionRight;
Commit: 3c4d18aa36679350ec79eff437e00dafbe09dad8
https://github.com/scummvm/scummvm/commit/3c4d18aa36679350ec79eff437e00dafbe09dad8
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:07+01:00
Commit Message:
IGOR: Fix lack of dialog when using resin on stone for the second time
Changed paths:
engines/igor/parts/part_12.cpp
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 20245bfb27c..562fc785ade 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -157,7 +157,10 @@ void IgorEngine::part12TryEnterChurch() {
void IgorEngine::part12UseResinWithStone() {
if (_objectsState[kLizardTakenStateIndex] == 1) {
- ADD_DIALOGUE_TEXT(219, 1, 801);
+ if (_game.version == kIdEngFloppy)
+ ADD_DIALOGUE_TEXT(216, 2, kNoSpeechSound);
+ else
+ ADD_DIALOGUE_TEXT(219, 1, 801);
SET_DIALOGUE_TEXT(1, 1);
startIgorDialogue();
return;
Commit: 7a5f429f3ca00a2500ce0ea91fd2013397b8b386
https://github.com/scummvm/scummvm/commit/7a5f429f3ca00a2500ce0ea91fd2013397b8b386
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:07+01:00
Commit Message:
IGOR: Fix line not being split in floppy vs. CD
Changed paths:
engines/igor/parts/part_2.cpp
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index 3a31dd78153..f3145fd6c71 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -194,7 +194,10 @@ void IgorEngine::part2ExecuteAction(int action) {
}
if (_inventoryInfo[44] == 0 && _inventoryInfo[45] == 0) {
if (_objectsState[kAtticNailExaminedStateIndex] == 0) {
- igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
+ if (_game.version == kIdEngFloppy)
+ igorSay(202, 2);
+ else
+ igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
part2SearchTrunk();
igorSay(204, 1, 111);
@@ -205,7 +208,10 @@ void IgorEngine::part2ExecuteAction(int action) {
}
if (_inventoryInfo[44] != 0 && _inventoryInfo[45] == 0) {
if (_objectsState[kAtticSmallCrackPresentStateIndex] == 0) {
- igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
+ if (_game.version == kIdEngFloppy)
+ igorSay(202, 2);
+ else
+ igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
part2SearchTrunk();
igorSay(205, 1, 112);
@@ -221,7 +227,10 @@ void IgorEngine::part2ExecuteAction(int action) {
igorSay(206, 1, 113);
addObjectToInventory(kInventoryObjectDynamite, 46);
} else if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 && _inventoryInfo[46] == 0 && _objectsState[kDynamitePlacedStateIndex] == 0) {
- igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
+ if (_game.version == kIdEngFloppy)
+ igorSay(202, 2);
+ else
+ igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
} else {
igorSay(207, 2, 114);
}
Commit: cb65587e51cbd979c2342546d9e3f1d8be8dad29
https://github.com/scummvm/scummvm/commit/cb65587e51cbd979c2342546d9e3f1d8be8dad29
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:07+01:00
Commit Message:
IGOR: Add Spanish floppy fonts
The Spanish floppy version draws text with two fonts of its own, neither
of which is the CD font: a 9x11 dialogue font and a 7x11 action sentence
font. Add them as FloppyDialogueFont and FloppySentenceFont with the
original glyph data built in, packed the same way as the CD font. They
share one character map and the drawing code through a FloppyFont base.
The fonts are not used by the engine yet.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Changed paths:
A engines/igor/floppy_font.cpp
A engines/igor/floppy_font.h
engines/igor/module.mk
diff --git a/engines/igor/floppy_font.cpp b/engines/igor/floppy_font.cpp
new file mode 100644
index 00000000000..713bda91c6b
--- /dev/null
+++ b/engines/igor/floppy_font.cpp
@@ -0,0 +1,368 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/floppy_font.h"
+#include "graphics/surface.h"
+
+namespace Igor {
+
+// Static font data
+
+const uint8 FloppyFont::_charIndex[] = {
+ 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,
+ 0x5B, 0x53, 0x51, 0x59, 0x63, 0x5A, 0x63, 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,
+ 0x63, 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, 0x5C, 0x63, 0x63, 0x63, 0x60,
+ 0x63, 0x63, 0x5E, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x5B, 0x63, 0x63, 0x63, 0x5D, 0x63, 0x63,
+ 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x5F, 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
+};
+
+const uint8 FloppyDialogueFont::_charWidth[] = {
+ 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, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06,
+ 0x07, 0x07, 0x05, 0x07, 0x07, 0x05, 0x08, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x07,
+ 0x07, 0x08, 0x08, 0x07, 0x07, 0x07, 0x07, 0x05, 0x07, 0x07, 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
+};
+
+const uint32 FloppyDialogueFont::_charData[] = {
+ 0x000000, 0x000AA0, 0x002968, 0x00A55A, 0x009696, 0x009696, 0x009556, 0x009696, 0x009696, 0x00AAAA,
+ 0x000000, 0x000000, 0x00AAAA, 0x029556, 0x025A5A, 0x025A58, 0x029558, 0x025A58, 0x025A5A, 0x029556,
+ 0x00AAAA, 0x000000, 0x000000, 0x00AAA8, 0x02955A, 0x025A96, 0x02A896, 0x000096, 0x02A896, 0x025A96,
+ 0x02955A, 0x00AAA8, 0x000000, 0x000000, 0x002AAA, 0x00A556, 0x02965A, 0x025A58, 0x025A58, 0x025A58,
+ 0x02965A, 0x00A556, 0x002AAA, 0x000000, 0x000000, 0x02AAAA, 0x025556, 0x026A5A, 0x02A658, 0x002558,
+ 0x02A658, 0x026A5A, 0x025556, 0x02AAAA, 0x000000, 0x000000, 0x02AAAA, 0x025556, 0x026A5A, 0x02A658,
+ 0x002558, 0x002658, 0x002A5A, 0x000956, 0x000AAA, 0x000000, 0x000000, 0x00AAA0, 0x029568, 0x025A5A,
+ 0x02AA96, 0x02AA96, 0x025696, 0x025A5A, 0x025568, 0x02AAA0, 0x000000, 0x000000, 0x00AAAA, 0x009696,
+ 0x009696, 0x009696, 0x009556, 0x009696, 0x009696, 0x009696, 0x00AAAA, 0x000000, 0x000000, 0x00AAAA,
+ 0x009556, 0x00A96A, 0x000960, 0x000960, 0x000960, 0x00A96A, 0x009556, 0x00AAAA, 0x000000, 0x000000,
+ 0x02AA80, 0x025580, 0x029680, 0x009600, 0x0096AA, 0x009696, 0x009696, 0x00A55A, 0x002AA8, 0x000000,
+ 0x000000, 0x02AAAA, 0x025A56, 0x025A5A, 0x029658, 0x00A558, 0x029658, 0x025A5A, 0x025A56, 0x02AAAA,
+ 0x000000, 0x000000, 0x000AAA, 0x000956, 0x000A5A, 0x000258, 0x02A258, 0x026A58, 0x025A5A, 0x025556,
+ 0x02AAAA, 0x000000, 0x000000, 0x02A8AA, 0x025A96, 0x025656, 0x025556, 0x025556, 0x025996, 0x025A96,
+ 0x025896, 0x02A8AA, 0x000000, 0x000000, 0x02A8AA, 0x025A96, 0x025A56, 0x025956, 0x025596, 0x025696,
+ 0x025A96, 0x025896, 0x02A8AA, 0x000000, 0x000000, 0x002AA0, 0x00A568, 0x02965A, 0x025A96, 0x025896,
+ 0x025A96, 0x02965A, 0x00A568, 0x002AA0, 0x000000, 0x000000, 0x00AAAA, 0x029556, 0x025A5A, 0x025A58,
+ 0x029558, 0x00AA58, 0x000A5A, 0x000956, 0x000AAA, 0x000000, 0x000000, 0x002AA8, 0x00A55A, 0x009696,
+ 0x009696, 0x009696, 0x009696, 0x009596, 0x00A55A, 0x0095A8, 0x00AA80, 0x000000, 0x00AAAA, 0x029556,
+ 0x025A5A, 0x025A58, 0x029558, 0x025A58, 0x025A5A, 0x025A56, 0x02AAAA, 0x000000, 0x000000, 0x002AA8,
+ 0x00A55A, 0x009696, 0x00AA96, 0x00A55A, 0x0096AA, 0x009696, 0x00A55A, 0x002AA8, 0x000000, 0x000000,
+ 0x00AAAA, 0x009556, 0x009966, 0x00A96A, 0x000960, 0x000960, 0x002968, 0x002558, 0x002AA8, 0x000000,
+ 0x000000, 0x00AAAA, 0x009696, 0x009696, 0x009696, 0x009696, 0x009696, 0x009696, 0x00A55A, 0x002AA8,
+ 0x000000, 0x000000, 0x00AAAA, 0x009696, 0x009696, 0x009696, 0x009696, 0x009696, 0x00A55A, 0x002968,
+ 0x000AA0, 0x000000, 0x000000, 0x02A8AA, 0x025896, 0x025896, 0x025A96, 0x025996, 0x025556, 0x025656,
+ 0x029A9A, 0x00A8A8, 0x000000, 0x000000, 0x02A8AA, 0x025896, 0x025A96, 0x00965A, 0x00A568, 0x02965A,
+ 0x025A96, 0x025896, 0x02A8AA, 0x000000, 0x000000, 0x00AAAA, 0x009696, 0x009696, 0x009696, 0x00A55A,
+ 0x002968, 0x002968, 0x002558, 0x002AA8, 0x000000, 0x000000, 0x02AAAA, 0x025556, 0x025696, 0x0295A6,
+ 0x02A56A, 0x02695A, 0x025A56, 0x025556, 0x02AAAA, 0x000000, 0x000000, 0x000000, 0x000000, 0x002AA8,
+ 0x00A558, 0x0096A8, 0x00955A, 0x009696, 0x00955A, 0x00AAA8, 0x000000, 0x000000, 0x0000AA, 0x000096,
+ 0x002A96, 0x00A556, 0x009696, 0x009696, 0x009696, 0x00A556, 0x002AAA, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x002AA8, 0x00A55A, 0x009696, 0x00AA96, 0x009696, 0x00A55A, 0x002AA8, 0x000000, 0x000000,
+ 0x00AA00, 0x009600, 0x0096A8, 0x00955A, 0x009696, 0x009696, 0x009696, 0x00955A, 0x00AAA8, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x002AA8, 0x00A55A, 0x009696, 0x009556, 0x00AA96, 0x00955A, 0x00AAA8,
+ 0x000000, 0x000000, 0x002AA0, 0x002568, 0x002A58, 0x000A5A, 0x000956, 0x000A5A, 0x000A5A, 0x000956,
+ 0x000AAA, 0x000000, 0x000000, 0x000000, 0x000000, 0x00AAA8, 0x00955A, 0x009696, 0x009696, 0x00955A,
+ 0x0096AA, 0x00A556, 0x002AAA, 0x000000, 0x0000AA, 0x000096, 0x002A96, 0x00A596, 0x009656, 0x009696,
+ 0x009696, 0x009696, 0x00AAAA, 0x000000, 0x000000, 0x0002A8, 0x000258, 0x0002AA, 0x000256, 0x00025A,
+ 0x000258, 0x000A5A, 0x000956, 0x000AAA, 0x000000, 0x000000, 0x00AA00, 0x009600, 0x00AA00, 0x009600,
+ 0x009600, 0x0096AA, 0x009696, 0x009696, 0x00A55A, 0x002AA8, 0x000000, 0x0000AA, 0x000096, 0x00AA96,
+ 0x009696, 0x00A596, 0x002956, 0x00A596, 0x009696, 0x00AAAA, 0x000000, 0x000000, 0x0002AA, 0x000256,
+ 0x00025A, 0x000258, 0x000258, 0x000258, 0x000A5A, 0x000956, 0x000AAA, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x00AAAA, 0x029656, 0x025556, 0x025996, 0x025996, 0x025A96, 0x02A8AA, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x002AAA, 0x00A556, 0x009696, 0x009696, 0x009696, 0x009696, 0x00AAAA, 0x000000,
+ 0x000000, 0x002AAA, 0x002556, 0x002AAA, 0x00A556, 0x009696, 0x009696, 0x009696, 0x009696, 0x00AAAA,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x002AA8, 0x00A55A, 0x009696, 0x009696, 0x009696, 0x00A55A,
+ 0x002AA8, 0x000000, 0x000000, 0x000000, 0x000000, 0x002AAA, 0x00A556, 0x009696, 0x009696, 0x00A556,
+ 0x002A96, 0x000296, 0x0002AA, 0x000000, 0x000000, 0x000000, 0x00AAA8, 0x00955A, 0x009696, 0x009696,
+ 0x00955A, 0x0096A8, 0x009680, 0x00AA80, 0x000000, 0x000000, 0x000000, 0x00AAAA, 0x009596, 0x00A95A,
+ 0x000A58, 0x000A5A, 0x000956, 0x000AAA, 0x000000, 0x000000, 0x000000, 0x000000, 0x00AAA8, 0x00955A,
+ 0x00AA96, 0x00A55A, 0x0096AA, 0x00A556, 0x002AAA, 0x000000, 0x000000, 0x0002A0, 0x000268, 0x002A5A,
+ 0x002556, 0x002A5A, 0x000258, 0x002A58, 0x002568, 0x002AA0, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x00AAAA, 0x009696, 0x009696, 0x009696, 0x009696, 0x00A55A, 0x002AA8, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x00AAAA, 0x009696, 0x009696, 0x009696, 0x00A55A, 0x002968, 0x000AA0, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x02A8AA, 0x025A96, 0x025996, 0x025996, 0x025556, 0x02965A, 0x00AAA8, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x02A8AA, 0x025A96, 0x02965A, 0x00A568, 0x02965A, 0x025A96, 0x02A8AA,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x00AAAA, 0x009696, 0x009696, 0x009696, 0x00955A, 0x0096AA,
+ 0x00A556, 0x002AAA, 0x000000, 0x000000, 0x000000, 0x00AAAA, 0x009556, 0x00A5A6, 0x00A96A, 0x009A5A,
+ 0x009556, 0x00AAAA, 0x000000, 0x002A80, 0x0025A0, 0x002960, 0x002AA8, 0x00A558, 0x0096A8, 0x00955A,
+ 0x009696, 0x00955A, 0x00AAA8, 0x000000, 0x002A80, 0x0025A0, 0x002960, 0x002AA8, 0x00A55A, 0x009696,
+ 0x009556, 0x00AA96, 0x00955A, 0x00AAA8, 0x000000, 0x000AA0, 0x000968, 0x000A58, 0x0002AA, 0x000256,
+ 0x00025A, 0x000258, 0x000A5A, 0x000956, 0x000AAA, 0x000000, 0x002A80, 0x0025A0, 0x002960, 0x002AA8,
+ 0x00A55A, 0x009696, 0x009696, 0x009696, 0x00A55A, 0x002AA8, 0x000000, 0x002A80, 0x0025A0, 0x002960,
+ 0x00AAAA, 0x009696, 0x009696, 0x009696, 0x009696, 0x00A55A, 0x002AA8, 0x000000, 0x000000, 0x00AAA8,
+ 0x02955A, 0x025A96, 0x025896, 0x025896, 0x025896, 0x025A96, 0x02955A, 0x00AAA8, 0x000000, 0x000000,
+ 0x000AA0, 0x000968, 0x000958, 0x000968, 0x000960, 0x000960, 0x00A96A, 0x009556, 0x00AAAA, 0x000000,
+ 0x000000, 0x002AA8, 0x00A55A, 0x009696, 0x0096AA, 0x00A568, 0x00AA5A, 0x009696, 0x009556, 0x00AAAA,
+ 0x000000, 0x000000, 0x002AA8, 0x00A55A, 0x009696, 0x0096AA, 0x00A560, 0x0096AA, 0x009696, 0x00A55A,
+ 0x002AA8, 0x000000, 0x000000, 0x00AA80, 0x0095A0, 0x009568, 0x00965A, 0x029696, 0x025556, 0x0296AA,
+ 0x025580, 0x02AA80, 0x000000, 0x000000, 0x00AAAA, 0x009556, 0x00AA96, 0x00A556, 0x0096AA, 0x0096AA,
+ 0x009696, 0x00A55A, 0x002AA8, 0x000000, 0x000000, 0x002AA0, 0x002568, 0x002A5A, 0x002A96, 0x00A556,
+ 0x009696, 0x009696, 0x00A55A, 0x002AA8, 0x000000, 0x000000, 0x00AAAA, 0x009556, 0x009696, 0x0096AA,
+ 0x00A5A0, 0x002960, 0x000960, 0x000960, 0x000AA0, 0x000000, 0x000000, 0x002AA8, 0x00A55A, 0x009696,
+ 0x009696, 0x00A55A, 0x009696, 0x009696, 0x00A55A, 0x002AA8, 0x000000, 0x000000, 0x002AA8, 0x00A55A,
+ 0x009696, 0x009696, 0x00955A, 0x0096A8, 0x00A5A8, 0x002958, 0x000AA8, 0x000000, 0x000AA0, 0x000968,
+ 0x000A5A, 0x000296, 0x000096, 0x000096, 0x000096, 0x000296, 0x000A5A, 0x000968, 0x000AA0, 0x0000AA,
+ 0x000296, 0x000A5A, 0x000968, 0x000960, 0x000960, 0x000960, 0x000968, 0x000A5A, 0x000296, 0x0000AA,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x00AAAA, 0x009556, 0x00AAAA, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000AA0, 0x000960, 0x00A96A, 0x009556, 0x00A96A, 0x000960, 0x000AA0,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x00AAAA, 0x009556, 0x00AAAA, 0x009556, 0x00AAAA,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x002A80, 0x0025A0, 0x002968, 0x000A5A, 0x000296, 0x000A5A,
+ 0x002968, 0x0025A0, 0x002A80, 0x000000, 0x000000, 0x0000AA, 0x000296, 0x000A5A, 0x002968, 0x0025A0,
+ 0x002968, 0x000A5A, 0x000296, 0x0000AA, 0x000000, 0x000000, 0x00A800, 0x009A00, 0x009680, 0x00A5A0,
+ 0x002968, 0x000A5A, 0x000296, 0x0000A6, 0x00002A, 0x000000, 0x000000, 0x00002A, 0x0000A6, 0x000296,
+ 0x000A5A, 0x002968, 0x00A5A0, 0x009680, 0x009A00, 0x00A800, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x0002A8, 0x000258, 0x00025A, 0x000296, 0x0000AA, 0x000000, 0x000000,
+ 0x000000, 0x0002A8, 0x000258, 0x000258, 0x0002A8, 0x000258, 0x00025A, 0x000296, 0x0000AA, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0000AA, 0x000096, 0x000096, 0x0000AA, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x0000AA, 0x000096, 0x000096, 0x0000AA, 0x000096, 0x000096, 0x0000AA,
+ 0x000000, 0x002AAA, 0x002596, 0x002596, 0x002596, 0x002AAA, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x0000AA, 0x000096, 0x0000AA, 0x000096, 0x000096, 0x000096, 0x000096,
+ 0x000096, 0x0000AA, 0x000000, 0x000000, 0x0000AA, 0x000096, 0x000096, 0x000096, 0x000096, 0x000096,
+ 0x0000AA, 0x000096, 0x0000AA, 0x000000, 0x000000, 0x000AA0, 0x000960, 0x000AA0, 0x000968, 0x000A5A,
+ 0x00AA96, 0x009696, 0x00A55A, 0x002AA8, 0x000000, 0x000000, 0x002AA8, 0x00A55A, 0x009696, 0x0096AA,
+ 0x00A5A0, 0x002960, 0x000AA0, 0x000960, 0x000AA0, 0x000000, 0x02AAAA, 0x025556, 0x02AAAA, 0x025A96,
+ 0x025A56, 0x025956, 0x025596, 0x025696, 0x025A96, 0x02A8AA, 0x000000, 0x000AAA, 0x000956, 0x000A96,
+ 0x000096, 0x000096, 0x000096, 0x000096, 0x000096, 0x000A96, 0x000956, 0x000AAA, 0x000AAA, 0x000956,
+ 0x00096A, 0x000960, 0x000960, 0x000960, 0x000960, 0x000960, 0x00096A, 0x000956, 0x000AAA, 0x000000,
+ 0x000000, 0x02AAAA, 0x02965A, 0x025556, 0x02965A, 0x025556, 0x02965A, 0x02AAAA, 0x000000, 0x000000,
+ 0x0002A8, 0x000258, 0x00025A, 0x000296, 0x0000AA, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000
+};
+
+const uint8 FloppySentenceFont::_charWidth[] = {
+ 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x04, 0x05, 0x05, 0x04, 0x06, 0x06, 0x05, 0x05,
+ 0x05, 0x05, 0x05, 0x04, 0x05, 0x06, 0x06, 0x06, 0x06, 0x05, 0x05, 0x05, 0x04, 0x05, 0x05, 0x04,
+ 0x05, 0x04, 0x02, 0x03, 0x04, 0x02, 0x06, 0x05, 0x05, 0x05, 0x05, 0x05, 0x03, 0x04, 0x03, 0x05,
+ 0x04, 0x06, 0x04, 0x04, 0x05, 0x05, 0x05, 0x03, 0x05, 0x05, 0x05, 0x03, 0x04, 0x04, 0x05, 0x04,
+ 0x05, 0x05, 0x05, 0x05, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x03, 0x03, 0x02,
+ 0x02, 0x04, 0x02, 0x02, 0x05, 0x05, 0x06, 0x03, 0x03, 0x06, 0x03
+};
+
+const uint32 FloppySentenceFont::_charData[] = {
+ 0x000000, 0x0002A8, 0x000A5A, 0x0009A6, 0x0009A6, 0x000956, 0x0009A6, 0x0009A6, 0x000AAA, 0x000000,
+ 0x000000, 0x000000, 0x0002AA, 0x000A56, 0x0009A6, 0x000A56, 0x0009A6, 0x0009A6, 0x000A56, 0x0002AA,
+ 0x000000, 0x000000, 0x000000, 0x000AA8, 0x00095A, 0x000AA6, 0x000026, 0x000026, 0x000AA6, 0x00095A,
+ 0x000AA8, 0x000000, 0x000000, 0x000000, 0x0002AA, 0x000A56, 0x0009A6, 0x0009A6, 0x0009A6, 0x0009A6,
+ 0x000A56, 0x0002AA, 0x000000, 0x000000, 0x000000, 0x000AA8, 0x00095A, 0x000AA6, 0x000256, 0x0002A6,
+ 0x000AA6, 0x00095A, 0x000AA8, 0x000000, 0x000000, 0x000000, 0x000AA8, 0x00095A, 0x000AA6, 0x000256,
+ 0x0002A6, 0x000026, 0x000026, 0x00002A, 0x000000, 0x000000, 0x000000, 0x000AA8, 0x00095A, 0x000AA6,
+ 0x000966, 0x0009A6, 0x0009A6, 0x000A5A, 0x0002A8, 0x000000, 0x000000, 0x000000, 0x000AAA, 0x0009A6,
+ 0x0009A6, 0x000956, 0x0009A6, 0x0009A6, 0x0009A6, 0x000AAA, 0x000000, 0x000000, 0x000000, 0x0002AA,
+ 0x000256, 0x00029A, 0x000098, 0x000098, 0x00029A, 0x000256, 0x0002AA, 0x000000, 0x000000, 0x000000,
+ 0x000AA8, 0x000958, 0x000A68, 0x000260, 0x00026A, 0x000266, 0x00029A, 0x0000A8, 0x000000, 0x000000,
+ 0x000000, 0x000AAA, 0x0009A6, 0x0009A6, 0x000A56, 0x0009A6, 0x0009A6, 0x0009A6, 0x000AAA, 0x000000,
+ 0x000000, 0x000000, 0x00002A, 0x000026, 0x000026, 0x000026, 0x000026, 0x0002A6, 0x00025A, 0x0002A8,
+ 0x000000, 0x000000, 0x000000, 0x002A2A, 0x0026A6, 0x002596, 0x002666, 0x0026A6, 0x002626, 0x002626,
+ 0x002A2A, 0x000000, 0x000000, 0x000000, 0x002A2A, 0x0026A6, 0x002696, 0x002666, 0x0025A6, 0x0026A6,
+ 0x002626, 0x002A2A, 0x000000, 0x000000, 0x000000, 0x0002A8, 0x000A5A, 0x0009A6, 0x0009A6, 0x0009A6,
+ 0x0009A6, 0x000A5A, 0x0002A8, 0x000000, 0x000000, 0x000000, 0x0002AA, 0x000A56, 0x0009A6, 0x0009A6,
+ 0x000A56, 0x0002A6, 0x000026, 0x00002A, 0x000000, 0x000000, 0x000000, 0x0002A8, 0x000A5A, 0x0009A6,
+ 0x0009A6, 0x0009A6, 0x0009A6, 0x000A5A, 0x0009A8, 0x000A80, 0x000000, 0x000000, 0x0002AA, 0x000A56,
+ 0x0009A6, 0x000A56, 0x0009A6, 0x0009A6, 0x0009A6, 0x000AAA, 0x000000, 0x000000, 0x000000, 0x000AA8,
+ 0x00095A, 0x000AA6, 0x00029A, 0x000A68, 0x0009AA, 0x000A56, 0x0002AA, 0x000000, 0x000000, 0x000000,
+ 0x0002AA, 0x000256, 0x00029A, 0x000098, 0x000098, 0x000098, 0x000098, 0x0000A8, 0x000000, 0x000000,
+ 0x000000, 0x000AAA, 0x0009A6, 0x0009A6, 0x0009A6, 0x0009A6, 0x0009A6, 0x000A5A, 0x0002A8, 0x000000,
+ 0x000000, 0x000000, 0x002A2A, 0x002626, 0x002626, 0x0026A6, 0x00299A, 0x000998, 0x000A68, 0x0002A0,
+ 0x000000, 0x000000, 0x000000, 0x002A2A, 0x002626, 0x0026A6, 0x002666, 0x002666, 0x002666, 0x00299A,
+ 0x000AA8, 0x000000, 0x000000, 0x000000, 0x002A2A, 0x0026A6, 0x00299A, 0x000A68, 0x000A68, 0x00299A,
+ 0x0026A6, 0x002A2A, 0x000000, 0x000000, 0x000000, 0x002A2A, 0x002626, 0x0026A6, 0x00299A, 0x000A68,
+ 0x000260, 0x000260, 0x0002A0, 0x000000, 0x000000, 0x000000, 0x000AAA, 0x000956, 0x0009AA, 0x000A68,
+ 0x00029A, 0x000AA6, 0x000956, 0x000AAA, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0002A8,
+ 0x000A5A, 0x0009A6, 0x0009A6, 0x00099A, 0x000AA8, 0x000000, 0x000000, 0x000000, 0x00002A, 0x000026,
+ 0x0002A6, 0x000A66, 0x0009A6, 0x0009A6, 0x000A5A, 0x0002A8, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x0002A8, 0x00025A, 0x0002A6, 0x0002A6, 0x00025A, 0x0002A8, 0x000000, 0x000000, 0x000000,
+ 0x000A80, 0x000980, 0x0009A8, 0x00099A, 0x0009A6, 0x0009A6, 0x000A5A, 0x0002A8, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x0002A8, 0x000A5A, 0x0009A6, 0x000A66, 0x00095A, 0x000AA8, 0x000000,
+ 0x000000, 0x000000, 0x0002A8, 0x00025A, 0x0002A6, 0x000096, 0x0000A6, 0x000026, 0x000026, 0x00002A,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0002A8, 0x000A5A, 0x0009A6, 0x0009A6, 0x00099A,
+ 0x0009A8, 0x000A58, 0x0002A8, 0x000000, 0x00002A, 0x000026, 0x0000A6, 0x000296, 0x000266, 0x000266,
+ 0x000266, 0x0002AA, 0x000000, 0x000000, 0x000000, 0x00002A, 0x000026, 0x00002A, 0x000026, 0x000026,
+ 0x000026, 0x000026, 0x00002A, 0x000000, 0x000000, 0x000000, 0x0000A8, 0x000098, 0x0000A8, 0x000098,
+ 0x000098, 0x000098, 0x000098, 0x00009A, 0x0000A6, 0x00002A, 0x000000, 0x00002A, 0x0002A6, 0x000266,
+ 0x000266, 0x000296, 0x000266, 0x000266, 0x0002AA, 0x000000, 0x000000, 0x000000, 0x00002A, 0x000026,
+ 0x000026, 0x000026, 0x000026, 0x000026, 0x000026, 0x00002A, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000AA8, 0x00299A, 0x002666, 0x002666, 0x002666, 0x002AAA, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x0002A8, 0x000A5A, 0x0009A6, 0x0009A6, 0x0009A6, 0x000AAA, 0x000000, 0x000000,
+ 0x000000, 0x0002A8, 0x000A5A, 0x0002A8, 0x000A5A, 0x0009A6, 0x0009A6, 0x0009A6, 0x000AAA, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x0002A8, 0x000A5A, 0x0009A6, 0x0009A6, 0x000A5A, 0x0002A8,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0002A8, 0x000A5A, 0x0009A6, 0x0009A6, 0x000A66,
+ 0x0002A6, 0x000026, 0x00002A, 0x000000, 0x000000, 0x000000, 0x0002A8, 0x000A5A, 0x0009A6, 0x0009A6,
+ 0x00099A, 0x0009A8, 0x000980, 0x000A80, 0x000000, 0x000000, 0x000000, 0x0000A8, 0x00009A, 0x0000A6,
+ 0x000026, 0x000026, 0x00002A, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0002A8, 0x00025A,
+ 0x0002A6, 0x00026A, 0x000296, 0x0000AA, 0x000000, 0x000000, 0x000000, 0x00002A, 0x0000A6, 0x000096,
+ 0x0000A6, 0x000026, 0x0000A6, 0x00009A, 0x0000A8, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000AAA, 0x0009A6, 0x0009A6, 0x0009A6, 0x000A5A, 0x0002A8, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x0002AA, 0x000266, 0x000266, 0x000266, 0x00029A, 0x0000A8, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x002A2A, 0x0026A6, 0x002666, 0x002666, 0x00299A, 0x000AA8, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x0002AA, 0x000266, 0x00029A, 0x00029A, 0x000266, 0x0002AA, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x0002AA, 0x000266, 0x000266, 0x000266, 0x00029A, 0x000098,
+ 0x000098, 0x0000A8, 0x000000, 0x000000, 0x000000, 0x000AAA, 0x000956, 0x000A6A, 0x000A9A, 0x000956,
+ 0x000AAA, 0x000000, 0x000000, 0x000A80, 0x0009A0, 0x000A60, 0x0002A8, 0x000A5A, 0x0009A6, 0x0009A6,
+ 0x00099A, 0x000AA8, 0x000000, 0x000000, 0x000A80, 0x0009A0, 0x000A60, 0x0002A8, 0x000A5A, 0x0009A6,
+ 0x000A66, 0x00095A, 0x000AA8, 0x000000, 0x000000, 0x0000A8, 0x00009A, 0x0000A6, 0x00002A, 0x000026,
+ 0x000026, 0x000026, 0x000026, 0x00002A, 0x000000, 0x000000, 0x000A80, 0x0009A0, 0x000A60, 0x0002A8,
+ 0x000A5A, 0x0009A6, 0x0009A6, 0x000A5A, 0x0002A8, 0x000000, 0x000000, 0x000A80, 0x0009A0, 0x000A60,
+ 0x000AAA, 0x0009A6, 0x0009A6, 0x0009A6, 0x000A5A, 0x0002A8, 0x000000, 0x000000, 0x000000, 0x0002A8,
+ 0x000A5A, 0x0009A6, 0x0009A6, 0x0009A6, 0x0009A6, 0x000A5A, 0x0002A8, 0x000000, 0x000000, 0x000000,
+ 0x0000A8, 0x00009A, 0x000096, 0x00009A, 0x000098, 0x000098, 0x000098, 0x0000A8, 0x000000, 0x000000,
+ 0x000000, 0x0002AA, 0x000256, 0x00026A, 0x000268, 0x00029A, 0x0002A6, 0x000256, 0x0002AA, 0x000000,
+ 0x000000, 0x000000, 0x0002AA, 0x000256, 0x00026A, 0x000298, 0x000268, 0x00026A, 0x000296, 0x0000AA,
+ 0x000000, 0x000000, 0x000000, 0x0002A8, 0x000298, 0x00029A, 0x0002A6, 0x000A66, 0x000956, 0x000A6A,
+ 0x0002A0, 0x000000, 0x000000, 0x000000, 0x0002AA, 0x000256, 0x0002A6, 0x000296, 0x00026A, 0x00026A,
+ 0x000296, 0x0000AA, 0x000000, 0x000000, 0x000000, 0x0002A0, 0x000268, 0x00029A, 0x000A66, 0x0009A6,
+ 0x0009A6, 0x000A5A, 0x0002A8, 0x000000, 0x000000, 0x000000, 0x000AAA, 0x000956, 0x0009AA, 0x000A68,
+ 0x00029A, 0x0000A6, 0x000026, 0x00002A, 0x000000, 0x000000, 0x000000, 0x0002A8, 0x000A5A, 0x0009A6,
+ 0x000A5A, 0x0009A6, 0x0009A6, 0x000A5A, 0x0002A8, 0x000000, 0x000000, 0x000000, 0x0002A8, 0x000A5A,
+ 0x0009A6, 0x0009A6, 0x00099A, 0x000A68, 0x000298, 0x0000A8, 0x000000, 0x000000, 0x000000, 0x0000A8,
+ 0x00009A, 0x0000A6, 0x000026, 0x000026, 0x000026, 0x0000A6, 0x00009A, 0x0000A8, 0x000000, 0x000000,
+ 0x00002A, 0x0000A6, 0x00009A, 0x000098, 0x000098, 0x000098, 0x00009A, 0x0000A6, 0x00002A, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x0002AA, 0x000256, 0x0002AA, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x0000A8, 0x00029A, 0x000256, 0x00029A, 0x0000A8, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0002AA, 0x000256, 0x0002AA, 0x000256, 0x0002AA,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x0002A0, 0x000268, 0x00029A, 0x0000A6, 0x00029A,
+ 0x000268, 0x0002A0, 0x000000, 0x000000, 0x000000, 0x000000, 0x00002A, 0x0000A6, 0x00029A, 0x000268,
+ 0x00029A, 0x0000A6, 0x00002A, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000A80, 0x0009A0,
+ 0x000A68, 0x00029A, 0x0000A6, 0x00002A, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x00002A,
+ 0x0000A6, 0x00029A, 0x000A68, 0x0009A0, 0x000A80, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x0000A8, 0x00009A, 0x0000A6, 0x00002A, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x0000A8, 0x000098, 0x0000A8, 0x00009A, 0x0000A6, 0x00002A, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x00002A, 0x000026, 0x00002A, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x000000, 0x000000, 0x00002A, 0x000026, 0x00002A, 0x000026, 0x00002A, 0x000000,
+ 0x000000, 0x0002AA, 0x000266, 0x000266, 0x0002AA, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000, 0x000000, 0x00002A, 0x000026, 0x00002A, 0x000026, 0x000026, 0x000026, 0x000026, 0x000026,
+ 0x00002A, 0x000000, 0x000000, 0x00002A, 0x000026, 0x000026, 0x000026, 0x000026, 0x000026, 0x00002A,
+ 0x000026, 0x00002A, 0x000000, 0x000000, 0x0002A0, 0x000260, 0x0002A0, 0x000268, 0x00029A, 0x000AA6,
+ 0x0009A6, 0x000A5A, 0x0002A8, 0x000000, 0x000000, 0x0002A8, 0x000A5A, 0x0009A6, 0x0009AA, 0x000A68,
+ 0x000298, 0x0000A8, 0x000098, 0x0000A8, 0x000000, 0x000000, 0x002AAA, 0x002556, 0x002AAA, 0x0026A6,
+ 0x002696, 0x002666, 0x0025A6, 0x0026A6, 0x002A2A, 0x000000, 0x000000, 0x000000, 0x0000AA, 0x000096,
+ 0x0000A6, 0x000026, 0x000026, 0x000026, 0x0000A6, 0x000096, 0x0000AA, 0x000000, 0x000000, 0x0000AA,
+ 0x000096, 0x00009A, 0x000098, 0x000098, 0x000098, 0x00009A, 0x000096, 0x0000AA, 0x000000, 0x000000,
+ 0x000000, 0x000AA8, 0x00299A, 0x002556, 0x00299A, 0x002556, 0x00299A, 0x000AA8, 0x000000, 0x000000,
+ 0x00002A, 0x000026, 0x000026, 0x00002A, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
+ 0x000000
+};
+
+FloppyFont::FloppyFont(const uint8 *widths, const uint32 *glyphs, int glyphWidth)
+ : _widths(widths), _glyphs(glyphs), _glyphWidth(glyphWidth) {
+}
+
+FloppyDialogueFont::FloppyDialogueFont() : FloppyFont(_charWidth, _charData, 9) {
+}
+
+FloppySentenceFont::FloppySentenceFont() : FloppyFont(_charWidth, _charData, 7) {
+}
+
+int FloppyFont::getGlyph(uint32 chr) const {
+ if (chr >= 256) {
+ return -1;
+ }
+ int glyph = _charIndex[chr];
+ // TODO: Some characters map past the 91 glyphs of the original arrays;
+ // how the original renders them is not established, so they are skipped.
+ if (glyph >= kGlyphCount) {
+ return -1;
+ }
+ return glyph;
+}
+
+int FloppyFont::getCharWidth(uint32 chr) const {
+ if (chr == ' ') {
+ return kSpaceWidth;
+ }
+ int glyph = getGlyph(chr);
+ if (glyph < 0) {
+ return 0;
+ }
+ return _widths[glyph];
+}
+
+void FloppyFont::drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const {
+ if (!dst || dst->format.bytesPerPixel != 1) {
+ return;
+ }
+ int glyph = getGlyph(chr);
+ if (glyph < 0) {
+ return;
+ }
+ for (int j = 0; j < kFontHeight; ++j) {
+ uint32 chrLineMask = _glyphs[glyph * kFontHeight + j];
+ for (int i = 0; i < _glyphWidth; ++i, chrLineMask >>= 2) {
+ if ((chrLineMask & 3) != 0 && x + i >= 0 && y + j >= 0 && x + i < dst->w && y + j < dst->h) {
+ ((byte *)dst->getBasePtr(x + i, y + j))[0] = (byte)color;
+ }
+ }
+ }
+}
+
+int FloppyFont::getStringWidth(const char *s) const {
+ int w = 0;
+ for (; *s; ++s) {
+ w += getCharWidth((uint8)*s);
+ }
+ return w;
+}
+
+void FloppyFont::drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2) const {
+ for (; *s; ++s) {
+ if (*s == ' ') {
+ x += kSpaceWidth;
+ } else {
+ int glyph = getGlyph((uint8)*s);
+ if (glyph < 0) {
+ continue;
+ }
+ drawChar(dst, glyph, x, y, color1, color2);
+ x += _widths[glyph];
+ }
+ }
+}
+
+void FloppyFont::drawChar(uint8 *dst, int chr, int x, int y, int color1, int color2) const {
+ dst += y * 320 + x;
+ for (int j = 0; j < kFontHeight; ++j, dst += 320) {
+ uint32 chrLineMask = _glyphs[chr * kFontHeight + j];
+ for (int i = 0; i < _glyphWidth; ++i, chrLineMask >>= 2) {
+ switch (chrLineMask & 3) {
+ case 1:
+ dst[i] = color1;
+ break;
+ case 2:
+ if (color2 != -1) {
+ dst[i] = color2;
+ }
+ break;
+ }
+ }
+ }
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/floppy_font.h b/engines/igor/floppy_font.h
new file mode 100644
index 00000000000..88821f518cf
--- /dev/null
+++ b/engines/igor/floppy_font.h
@@ -0,0 +1,89 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_FLOPPY_FONT_H
+#define IGOR_FLOPPY_FONT_H
+
+#include "graphics/font.h"
+
+namespace Igor {
+
+/**
+ * Common part of the two Spanish floppy fonts: the shared character map and
+ * the drawing code. Glyph pixels are 1 (text color) or 2 (shadow color).
+ */
+class FloppyFont : public Graphics::Font {
+public:
+ int getFontHeight() const override { return kFontHeight; }
+ int getMaxCharWidth() const override { return _glyphWidth; }
+ int getCharWidth(uint32 chr) const override;
+ void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const override;
+
+ // Engine-specific: raw buffer rendering with shadow color
+ using Graphics::Font::drawChar;
+ void drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2) const;
+ void drawChar(uint8 *dst, int chr, int x, int y, int color1, int color2) const;
+ int getStringWidth(const char *s) const;
+
+protected:
+ FloppyFont(const uint8 *widths, const uint32 *glyphs, int glyphWidth);
+
+private:
+ static const int kFontHeight = 11;
+ static const int kGlyphCount = 91;
+ static const int kSpaceWidth = 5;
+
+ int getGlyph(uint32 chr) const;
+
+ const uint8 *_widths;
+ const uint32 *_glyphs;
+ int _glyphWidth;
+
+ static const uint8 _charIndex[];
+};
+
+/**
+ * Spanish floppy dialogue font, 9x11 glyphs.
+ */
+class FloppyDialogueFont : public FloppyFont {
+public:
+ FloppyDialogueFont();
+
+private:
+ static const uint8 _charWidth[];
+ static const uint32 _charData[];
+};
+
+/**
+ * Spanish floppy action sentence font, 7x11 glyphs.
+ */
+class FloppySentenceFont : public FloppyFont {
+public:
+ FloppySentenceFont();
+
+private:
+ static const uint8 _charWidth[];
+ static const uint32 _charData[];
+};
+
+} // End of namespace Igor
+
+#endif // IGOR_FLOPPY_FONT_H
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 6c7a17541c9..e882bcee1e3 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -7,6 +7,7 @@ MODULE_OBJS = \
walk.o \
palette.o \
font.o \
+ floppy_font.o \
room.o \
graphics.o \
resource.o \
Commit: 8eeeed0b84cf206f0f241b48b65dd8c9c9f3821c
https://github.com/scummvm/scummvm/commit/8eeeed0b84cf206f0f241b48b65dd8c9c9f3821c
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:08+01:00
Commit Message:
IGOR: remove the need for IGOR.FSD in spanish floppy
Changed paths:
engines/igor/detection_tables.h
engines/igor/igor.cpp
diff --git a/engines/igor/detection_tables.h b/engines/igor/detection_tables.h
index d7df6c29fb7..b2458bf9f88 100644
--- a/engines/igor/detection_tables.h
+++ b/engines/igor/detection_tables.h
@@ -97,7 +97,7 @@ const IgorGameDescription gameDescriptions[] = {
kIdSpaFloppy,
kFlagFloppy,
"IGOR.DAT",
- "IGOR.FSD"
+ "IGOR.DAT" // no IGOR.FSD; the sound effects are stored in IGOR.DAT
},
{
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 3bc3661c694..4249b90ac75 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -220,7 +220,9 @@ Common::Error IgorEngine::run() {
}
readTableFile();
- if (_game.flags & kFlagFloppy)
+ // TODO: Spanish floppy music stays disabled until its music resources
+ // and their selection are identified.
+ if ((_game.flags & kFlagFloppy) && _game.version != kIdSpaFloppy)
_midiPlayer = new MidiPlayer(_mixer);
loadMainTexts();
loadIgorFrames();
Commit: 9ec43030a31dec7d660ef3ee07d55f40bb656b96
https://github.com/scummvm/scummvm/commit/9ec43030a31dec7d660ef3ee07d55f40bb656b96
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:08+01:00
Commit Message:
IGOR: Unpacker and loading main texts in Spanish floppy version
Changed paths:
A engines/igor/unpack.cpp
A engines/igor/unpack.h
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/palette.cpp
engines/igor/resource.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 4249b90ac75..6d13e480b07 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -62,8 +62,9 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
_game.flags = gameDesc->gameFlags;
_game.language = gameDesc->desc.language;
- _currentPart = kStartupPart;
+ // _currentPart = kStartupPart;
+ _currentPart = 850;
_midiPlayer = nullptr;
_musicData = nullptr;
@@ -219,6 +220,10 @@ Common::Error IgorEngine::run() {
error("Unable to open '%s'", _game.sfxFileName);
}
+ if (_game.version == kIdSpaFloppy) {
+ unpackExecutable();
+ }
+
readTableFile();
// TODO: Spanish floppy music stays disabled until its music resources
// and their selection are identified.
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index fbfc0f5b1f2..1d775f60cc1 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -114,10 +114,16 @@ struct DetectedGameVersion {
const char *sfxFileName;
};
+enum ResourceSource {
+ kResourceSourceContainer, // the game's resource container (IGOR.DAT, IGOR.EXE)
+ kResourceSourceExecutable // the unpacked executable image of the Spanish floppy version
+};
+
struct ResourceEntry {
int id;
uint32 offs;
uint32 size;
+ ResourceSource source;
};
struct StringEntry {
@@ -577,6 +583,7 @@ private:
Common::File _ovlFile;
Common::File _sndFile;
+ Common::Array<byte> _unpackedExe;
Audio::SoundHandle _sfxHandle;
Audio::SoundHandle _speechHandle;
@@ -1631,6 +1638,7 @@ private:
void waitForTimer(int ticks = -1, bool presentScreen = true, uint32 deadline = 0);
ResourceEntry *findData(int num);
+ void unpackExecutable();
uint8 *loadData(int num, uint8 *dst = 0, int *size = 0);
void loadAnimData(const int *anm, int loadOffset = 0);
void loadActionData(int act);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index e882bcee1e3..99b36e07f16 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -8,6 +8,7 @@ MODULE_OBJS = \
palette.o \
font.o \
floppy_font.o \
+ unpack.o \
room.o \
graphics.o \
resource.o \
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index 597716e77cf..bbc38bc97e4 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -77,12 +77,22 @@ void IgorEngine::updatePalette(int count) {
}
+// The inventory panel colors (208-239). The Spanish floppy version has its own.
void IgorEngine::SET_PAL_208_96_1() {
- memcpy(_paletteBuffer + 208 * 3, PAL_96_1, 96);
+ if (_game.version == kIdSpaFloppy) {
+ loadData(PAL_InventoryPanel, _paletteBuffer + 208 * 3);
+ } else {
+ memcpy(_paletteBuffer + 208 * 3, PAL_96_1, 96);
+ }
}
+// The verbs panel colors (240-255). The Spanish floppy version has its own.
void IgorEngine::SET_PAL_240_48_1() {
- memcpy(_paletteBuffer + 240 * 3, PAL_48_1, 48);
+ if (_game.version == kIdSpaFloppy) {
+ loadData(PAL_VerbsPanel, _paletteBuffer + 240 * 3);
+ } else {
+ memcpy(_paletteBuffer + 240 * 3, PAL_48_1, 48);
+ }
}
void IgorEngine::fadeIn(int count) {
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index c23d8869d9a..20aba5844d0 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -21,13 +21,37 @@
#include "igor/igor.h"
#include "common/debug-channels.h"
+#include "igor/unpack.h"
namespace Igor {
+// The Spanish floppy version keeps part of its resources inside its packed
+// executable. They are read from the memory image of IGOR.EXE, restored at startup.
+void IgorEngine::unpackExecutable() {
+ Common::File exeFile;
+ if (!exeFile.open("IGOR.EXE")) {
+ error("Unable to open 'IGOR.EXE'");
+ }
+ Common::Array<byte> packed;
+ packed.resize(exeFile.size());
+ if (exeFile.read(packed.data(), packed.size()) != packed.size()) {
+ error("Unable to read 'IGOR.EXE'");
+ }
+ Common::String unpackError;
+ if (!unpackSpanishFloppyExe(packed.data(), packed.size(), _unpackedExe, unpackError)) {
+ error("Unable to unpack 'IGOR.EXE': %s", unpackError.c_str());
+ }
+}
+
void IgorEngine::readTableFile() {
Common::File tblFile;
uint32 stringsEntriesOffset = 0, resourcesEntriesOffset = 0, soundEntriesOffset = 0;
- if (tblFile.open("IGOR.TBL") && tblFile.readUint32BE() == 'ITBL' && tblFile.readUint32BE() == 4) {
+ uint32 tableVersion = 0;
+ if (tblFile.open("IGOR.TBL") && tblFile.readUint32BE() == 'ITBL') {
+ tableVersion = tblFile.readUint32BE();
+ }
+ // version 5 adds the source of the data of each resource
+ if (tableVersion == 4 || tableVersion == 5) {
stringsEntriesOffset = tblFile.readUint32BE();
uint32 borlandOverlaySize = _ovlFile.size();
int gameVersionsCount = tblFile.readByte();
@@ -49,6 +73,14 @@ void IgorEngine::readTableFile() {
_resourceEntries[i].id = tblFile.readUint16BE();
_resourceEntries[i].offs = tblFile.readUint32BE();
_resourceEntries[i].size = tblFile.readUint32BE();
+ _resourceEntries[i].source = kResourceSourceContainer;
+ if (tableVersion >= 5) {
+ const int source = tblFile.readByte();
+ if (source != kResourceSourceContainer && source != kResourceSourceExecutable) {
+ error("Invalid resource source in 'IGOR.TBL'");
+ }
+ _resourceEntries[i].source = (ResourceSource)source;
+ }
}
tblFile.seek(soundEntriesOffset);
_soundOffsetsCount = tblFile.readUint16BE();
@@ -77,6 +109,18 @@ void IgorEngine::readTableFile() {
error("Unable to read 'IGOR.TBL'");
}
+// The unpacked executable of the Spanish floppy version stores each text as a
+// plain Pascal string (length byte, then the characters) in a slot with room for
+// both languages.
+static void decodeFloppyMainString(const uint8 *src, char *dst, uint slotSize) {
+ const uint length = *src;
+ if (length >= slotSize) {
+ error("Invalid text length in the unpacked executable");
+ }
+ memcpy(dst, src + 1, length);
+ dst[length] = '\0';
+}
+
static void decodeMainString(const uint8 *src, char *dst) {
int sz = *src - 0x6D;
if (sz != 0) {
@@ -203,6 +247,39 @@ void IgorEngine::loadMainTexts() {
}
int dataSize;
uint8 *p = loadData(TXT_MainTable, 0, &dataSize);
+ if (_game.version == kIdSpaFloppy) {
+ // it has 171 dialogue texts and its verbs are in a separate resource
+ const uint objectsOffset = 3 * 7 * 2;
+ const uint dialogueOffset = 0x8BA;
+ if ((uint)dataSize < dialogueOffset || (dataSize - dialogueOffset) % (51 * 2) != 0) {
+ error("Invalid main text resource");
+ }
+ const uint dialogueCount = (dataSize - dialogueOffset) / (51 * 2);
+ if (dialogueCount > ARRAYSIZE(_globalDialogueTexts) ||
+ objectsOffset + ARRAYSIZE(_globalObjectNames) * 31 * 2 > (uint)dataSize) {
+ error("Invalid main text resource");
+ }
+ for (uint i = 0; i < ARRAYSIZE(_verbPrepositions); ++i) {
+ decodeFloppyMainString(p + (i * 2 + _language) * 7, _verbPrepositions[i], 7);
+ }
+ for (uint i = 0; i < ARRAYSIZE(_globalObjectNames); ++i) {
+ decodeFloppyMainString(p + objectsOffset + (i * 2 + _language) * 31, _globalObjectNames[i], 31);
+ }
+ for (uint i = 0; i < dialogueCount; ++i) {
+ decodeFloppyMainString(p + dialogueOffset + (i * 2 + _language) * 51, _globalDialogueTexts[i], 51);
+ }
+ free(p);
+ p = loadData(TXT_MainVerbs, 0, &dataSize);
+ if (dataSize != (int)(ARRAYSIZE(_verbsName) - 1) * 12 * 2) {
+ error("Invalid verbs text resource");
+ }
+ for (uint i = 1; i < ARRAYSIZE(_verbsName); ++i) {
+ decodeFloppyMainString(p + ((i - 1) * 2 + _language) * 12, _verbsName[i], 12);
+ }
+ free(p);
+ debugC(9, kDebugResource, "loadMainTexts() %u dialogue texts", dialogueCount);
+ return;
+ }
const uint8 *src = &p[0] + _language * 7;
for (int i = 0; i < 3; ++i, src += 7 * 2) {
decodeMainString(src, _verbPrepositions[i]);
@@ -283,8 +360,16 @@ uint8 *IgorEngine::loadData(int id, uint8 *dst, int *size) {
error("Unable to allocate %d bytes", re->size);
}
}
- _ovlFile.seek(re->offs);
- _ovlFile.read(dst, re->size);
+ // copy directly from the in-memory unpacked executable if the resource is stored there
+ if (re->source == kResourceSourceExecutable) {
+ if (re->offs > _unpackedExe.size() || re->size > _unpackedExe.size() - re->offs) {
+ error("Resource %d lies outside the unpacked executable", id);
+ }
+ memcpy(dst, _unpackedExe.data() + re->offs, re->size);
+ } else {
+ _ovlFile.seek(re->offs);
+ _ovlFile.read(dst, re->size);
+ }
if (size) {
*size = re->size;
}
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 47cc73c2122..469be2f585b 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -865,4 +865,8 @@
#define TXT_Credits6 1238
#define TXT_Credits7 1239
+#define TXT_MainVerbs 1240
+#define PAL_VerbsPanel 1241
+#define PAL_InventoryPanel 1242
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/unpack.cpp b/engines/igor/unpack.cpp
new file mode 100644
index 00000000000..29007695df6
--- /dev/null
+++ b/engines/igor/unpack.cpp
@@ -0,0 +1,250 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/unpack.h"
+
+#include "common/crc.h"
+#include "common/endian.h"
+
+namespace Igor {
+namespace {
+
+const uint32 kSupportedFileSize = 39537;
+const uint32 kSupportedCRC32 = 0x8edcfa28;
+const uint32 kImageSize = kSpanishFloppyExeImageSize;
+const uint32 kEncodedWordBytes = 38972;
+const uint32 kCompressedDataOffset = 656;
+const uint32 kLengthTable = 586;
+const uint32 kExtendedLengthTable = 597;
+const uint32 kLongLengthTable = 608;
+const uint32 kDistanceTable = 624;
+
+class UnpackReader {
+public:
+ UnpackReader(const Common::Array<byte> &bytes)
+ : _bytes(bytes), _position(kCompressedDataOffset), _control(0),
+ _remaining(0), _error(nullptr) {
+ refill();
+ }
+
+ byte readByte() {
+ if (_position >= _bytes.size()) {
+ fail("Truncated compressed stream");
+ return 0;
+ }
+ return _bytes[_position++];
+ }
+
+ uint16 readWord() {
+ const uint16 low = readByte();
+ return low | (uint16(readByte()) << 8);
+ }
+
+ uint bit() {
+ const uint value = _control & 1;
+ _control >>= 1;
+ // Refill before reading a following literal or match distance.
+ if (--_remaining == 0)
+ refill();
+ return value;
+ }
+
+ uint bits(uint count) {
+ uint value = 0;
+ while (count--)
+ value = (value << 1) | bit();
+ return value;
+ }
+
+ uint appendBit(uint value) { return (value << 1) | bit(); }
+
+ uint table(uint32 base, uint index) {
+ if (index >= 32 || base + index >= _bytes.size()) {
+ fail("Invalid decompression table index");
+ return 0;
+ }
+ return _bytes[base + index];
+ }
+
+ void fail(const char *message) {
+ if (!_error)
+ _error = message;
+ }
+
+ const char *getError() const { return _error; }
+
+private:
+ void refill() {
+ _control = readWord();
+ _remaining = 16;
+ }
+
+ const Common::Array<byte> &_bytes;
+ uint32 _position;
+ uint16 _control;
+ uint _remaining;
+ const char *_error;
+};
+
+uint matchLength(UnpackReader &reader) {
+ uint code = reader.bits(2);
+ if (code >= 2)
+ return code;
+
+ code = reader.appendBit(code);
+ if (code != 0) {
+ code = reader.appendBit(code);
+ if (code >= 5)
+ code = reader.appendBit(code);
+ }
+ if (code <= 12)
+ return reader.table(kLengthTable, code);
+
+ code = reader.appendBit(code & 3);
+ if (code >= 5)
+ code = reader.appendBit(code);
+ if (code <= 12)
+ return reader.table(kExtendedLengthTable, code);
+
+ code = reader.appendBit(code & 3);
+ if (code >= 5)
+ code = reader.appendBit(code);
+ return reader.table(kLongLengthTable, code);
+}
+
+uint matchDistance(UnpackReader &reader, uint length) {
+ uint high = 0;
+ if (length != 2 && reader.bit() == 0) {
+ uint code = reader.bits(3);
+ if (code >= 2) {
+ code = reader.appendBit(code);
+ if (code >= 8) {
+ code = reader.appendBit(code);
+ if (code >= 23) {
+ code = reader.appendBit(code);
+ high = code & 0xdf;
+ } else {
+ high = reader.table(kDistanceTable, code);
+ }
+ } else {
+ high = reader.table(kDistanceTable, code);
+ }
+ } else {
+ high = reader.table(kDistanceTable, code);
+ }
+ }
+ return (high << 8) | reader.readByte();
+}
+
+void checkRelocations(UnpackReader &reader, uint32 imageSize) {
+ // Resources use the unrelocated image; validate the relocation metadata
+ // without changing pointers to depend on a DOS load address.
+ while (!reader.getError()) {
+ const uint count = reader.readByte();
+ if (count == 0)
+ return;
+ const uint32 segment = reader.readWord();
+ for (uint i = 0; i < count && !reader.getError(); ++i) {
+ const uint32 offset = reader.readWord();
+ const uint32 location = segment * 16 + offset;
+ if (location >= imageSize || imageSize - location < 2)
+ reader.fail("Relocation outside resident image");
+ }
+ }
+}
+
+} // End of anonymous namespace
+
+bool unpackSpanishFloppyExe(const byte *input, uint32 size,
+ Common::Array<byte> &image, Common::String &error) {
+ image.clear();
+ error.clear();
+ if (!input || size != kSupportedFileSize || Common::CRC32().crcFast(input, size) != kSupportedCRC32) {
+ error = "Unsupported packed Spanish floppy executable";
+ return false;
+ }
+
+ Common::Array<byte> decoded;
+ decoded.resize(size);
+ memcpy(decoded.data(), input, size);
+ // Restore the encoded prefix used by the native word transform.
+ decoded[0] = 0xcc;
+ decoded[1] = 0x2f;
+ decoded[2] = 0x3f;
+ uint16 key = 0x3ad8;
+ for (uint32 i = 0; i < kEncodedWordBytes; i += 2) {
+ const uint16 difference = uint16(READ_LE_UINT16(decoded.data() + i) - key);
+ key = difference;
+ WRITE_LE_UINT16(decoded.data() + i, uint16((difference << 1) | (difference >> 15)));
+ }
+
+ UnpackReader reader(decoded);
+ Common::Array<byte> result;
+ result.reserve(kImageSize);
+ bool ended = false;
+ for (uint32 token = 0; token < size * 2 && !reader.getError(); ++token) {
+ if (reader.bit() == 0) {
+ if (result.size() == kImageSize) {
+ reader.fail("Resident image exceeds supported size");
+ break;
+ }
+ result.push_back(reader.readByte());
+ continue;
+ }
+
+ uint length = matchLength(reader);
+ if (length == 25) {
+ const uint extension = reader.readByte();
+ if (extension >= 254) {
+ if (extension == 255) {
+ ended = true;
+ break;
+ }
+ // Segment refresh changes address representation only.
+ continue;
+ }
+ length += extension;
+ }
+ if (length < 2 || length > kImageSize - result.size()) {
+ reader.fail("Invalid match length");
+ break;
+ }
+ const uint distance = matchDistance(reader, length);
+ if (distance == 0 || distance > result.size()) {
+ reader.fail("Invalid match distance");
+ break;
+ }
+ for (uint i = 0; i < length; ++i)
+ result.push_back(result[result.size() - distance]);
+ }
+ if (!ended || result.size() != kImageSize)
+ reader.fail("Incomplete resident image");
+ if (!reader.getError())
+ checkRelocations(reader, result.size());
+ if (reader.getError()) {
+ error = reader.getError();
+ return false;
+ }
+ image.swap(result);
+ return true;
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/unpack.h b/engines/igor/unpack.h
new file mode 100644
index 00000000000..da3608bf3e5
--- /dev/null
+++ b/engines/igor/unpack.h
@@ -0,0 +1,41 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_UNPACK_H
+#define IGOR_UNPACK_H
+
+#include "common/array.h"
+#include "common/str.h"
+
+namespace Igor {
+
+enum {
+ kSpanishFloppyExeImageSize = 120864
+};
+
+// Reconstructs the resident image without applying load-address relocations.
+// Resource offsets are relative to this image. No game code is executed.
+bool unpackSpanishFloppyExe(const byte *input, uint32 size,
+ Common::Array<byte> &image, Common::String &error);
+
+} // End of namespace Igor
+
+#endif
Commit: dab277fac8657e6725f79d02e8f40c5ddeb24e5a
https://github.com/scummvm/scummvm/commit/dab277fac8657e6725f79d02e8f40c5ddeb24e5a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:08+01:00
Commit Message:
IGOR: Fix floppy version verb panels and inventory
Changed paths:
engines/igor/floppy_font.cpp
engines/igor/floppy_font.h
engines/igor/font.h
engines/igor/graphics.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/options.cpp
engines/igor/resource.cpp
engines/igor/resource_ids.h
engines/igor/room.cpp
engines/igor/text.cpp
diff --git a/engines/igor/floppy_font.cpp b/engines/igor/floppy_font.cpp
index 713bda91c6b..39278ab0d18 100644
--- a/engines/igor/floppy_font.cpp
+++ b/engines/igor/floppy_font.cpp
@@ -331,7 +331,7 @@ int FloppyFont::getStringWidth(const char *s) const {
return w;
}
-void FloppyFont::drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2) const {
+void FloppyFont::drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2, int color3) const {
for (; *s; ++s) {
if (*s == ' ') {
x += kSpaceWidth;
diff --git a/engines/igor/floppy_font.h b/engines/igor/floppy_font.h
index 88821f518cf..e72c205737f 100644
--- a/engines/igor/floppy_font.h
+++ b/engines/igor/floppy_font.h
@@ -22,7 +22,7 @@
#ifndef IGOR_FLOPPY_FONT_H
#define IGOR_FLOPPY_FONT_H
-#include "graphics/font.h"
+#include "igor/font.h"
namespace Igor {
@@ -30,18 +30,19 @@ namespace Igor {
* Common part of the two Spanish floppy fonts: the shared character map and
* the drawing code. Glyph pixels are 1 (text color) or 2 (shadow color).
*/
-class FloppyFont : public Graphics::Font {
+class FloppyFont : public IgorFont {
public:
int getFontHeight() const override { return kFontHeight; }
int getMaxCharWidth() const override { return _glyphWidth; }
int getCharWidth(uint32 chr) const override;
void drawChar(Graphics::Surface *dst, uint32 chr, int x, int y, uint32 color) const override;
- // Engine-specific: raw buffer rendering with shadow color
+ // Engine-specific: raw buffer rendering. The glyphs have no third pixel value,
+ // so color3 is not used.
using Graphics::Font::drawChar;
- void drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2) const;
+ void drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2, int color3) const override;
void drawChar(uint8 *dst, int chr, int x, int y, int color1, int color2) const;
- int getStringWidth(const char *s) const;
+ int getStringWidth(const char *s) const override;
protected:
FloppyFont(const uint8 *widths, const uint32 *glyphs, int glyphWidth);
@@ -61,7 +62,7 @@ private:
};
/**
- * Spanish floppy dialogue font, 9x11 glyphs.
+ * Dialogue font, 9x11 glyphs.
*/
class FloppyDialogueFont : public FloppyFont {
public:
@@ -73,7 +74,7 @@ private:
};
/**
- * Spanish floppy action sentence font, 7x11 glyphs.
+ * Action sentence font, 7x11 glyphs.
*/
class FloppySentenceFont : public FloppyFont {
public:
diff --git a/engines/igor/font.h b/engines/igor/font.h
index 4fedb37e24e..b106d9669f6 100644
--- a/engines/igor/font.h
+++ b/engines/igor/font.h
@@ -26,7 +26,19 @@
namespace Igor {
-class Font : public Graphics::Font {
+/**
+ * Interface of the fonts of the game. They draw directly into the 8-bit screen
+ * buffers using up to three colors, for the glyph pixel values 1, 2 and 3.
+ *
+ * Floppy fonts dont use the third color.
+ */
+class IgorFont : public Graphics::Font {
+public:
+ virtual int getStringWidth(const char *s) const = 0;
+ virtual void drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2, int color3) const = 0;
+};
+
+class Font : public IgorFont {
public:
Font();
@@ -37,9 +49,9 @@ public:
// Engine-specific: raw buffer rendering with shadow/highlight colors
using Graphics::Font::drawChar;
- void drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2, int color3) const;
+ void drawString(uint8 *dst, const char *s, int x, int y, int color1, int color2, int color3) const override;
void drawChar(uint8 *dst, int chr, int x, int y, int color1, int color2, int color3) const;
- int getStringWidth(const char *s) const;
+ int getStringWidth(const char *s) const override;
private:
static const int kFontHeight = 11;
diff --git a/engines/igor/graphics.cpp b/engines/igor/graphics.cpp
index 55514b66d81..b067307bf17 100644
--- a/engines/igor/graphics.cpp
+++ b/engines/igor/graphics.cpp
@@ -161,14 +161,27 @@ void IgorEngine::decodeAnimFrame(const uint8 *src, uint8 *dst, bool preserveText
}
void IgorEngine::drawVerbsPanel() {
- memcpy(_screenVGA + 320 * 156, _verbsPanelBuffer, 320 * 12);
+ memcpy(_screenVGA + 320 * 156, _verbsPanelBuffer, _verbsPanelSize);
}
void IgorEngine::redrawVerb(uint8 verb, bool highlight) {
+ if (_game.version == kIdSpaFloppy) {
+ if (verb < kVerbWalk || verb > kVerbGive)
+ return;
+ const int x = (verb - 1) * 40;
+ memset(_screenVGA + 155 * 320 + x, highlight ? 254 : 0, 40);
+ for (int y = 156; y <= 166; ++y) {
+ _screenVGA[y * 320 + x] = highlight ? 254 : 0;
+ _screenVGA[y * 320 + x + 39] = highlight ? 253 : 0;
+ }
+ memset(_screenVGA + 167 * 320 + x, highlight ? 253 : 0, 40);
+ return;
+ }
uint8 verbBitmap[44 * 12];
if (verb >= 2 && verb <= 8) {
verb -= 2;
- for (int i = 0; i <= 11; ++i) {
+ const int height = _verbsPanelSize / 320;
+ for (int i = 0; i < height; ++i) {
for (int j = 0; j <= 43; ++j) {
uint8 color = _verbsPanelBuffer[i * 320 + verb * 46 + j];
if (highlight && color != 0) {
@@ -177,7 +190,7 @@ void IgorEngine::redrawVerb(uint8 verb, bool highlight) {
verbBitmap[i * 44 + j] = color;
}
}
- copyArea(_screenVGA, 320 * 156 + verb * 46, 320, verbBitmap, 44, 44, 12);
+ copyArea(_screenVGA, 320 * 156 + verb * 46, 320, verbBitmap, 44, 44, height);
}
}
@@ -198,6 +211,22 @@ void IgorEngine::scrollInventory() {
void IgorEngine::drawInventory(int start, int mode) {
loadData(IMG_InventoryPanel, _inventoryPanelBuffer);
loadData(IMG_Objects, _inventoryImagesBuffer);
+ if (_game.version == kIdSpaFloppy) {
+ for (int slot = 0; slot < 8; ++slot) {
+ const int object = _inventoryInfo[start + slot - 1];
+ for (int row = 0; row < 30; ++row) {
+ uint8 *dst = _inventoryPanelBuffer + row * 320 + slot * 40;
+ if (object == 0) {
+ memset(dst, 0, 40);
+ } else {
+ memcpy(dst, _inventoryImagesBuffer + (_inventoryImages[object - 1] - 1) * 1200 + row * 40, 40);
+ }
+ }
+ }
+ memcpy(_screenVGA + 170 * 320, _inventoryPanelBuffer, 9600);
+ _scrollInventory = false;
+ return;
+ }
int y, i;
int end = start + 7; // seven slots
int x = 1;
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 6d13e480b07..aacf0b4e218 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -55,6 +55,7 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
_inventoryPanelBuffer = (uint8 *)malloc(9600 * 2);
_inventoryImagesBuffer = (uint8 *)malloc(48000);
_verbsPanelBuffer = (uint8 *)malloc(3840);
+ _verbsPanelSize = 0; // set when the panel is loaded
_game.ovlFileName = gameDesc->ovlFileName;
_game.sfxFileName = gameDesc->sfxFileName;
@@ -62,6 +63,15 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
_game.flags = gameDesc->gameFlags;
_game.language = gameDesc->desc.language;
+ if (_game.version == kIdSpaFloppy) {
+ _dialogueFont = &_floppyDialogueFont;
+ _sentenceFont = &_floppySentenceFont;
+ } else {
+ _dialogueFont = &_font;
+ _sentenceFont = &_font;
+ }
+ memset(_actionSentenceColors, 0, sizeof(_actionSentenceColors));
+
// _currentPart = kStartupPart;
_currentPart = 850;
@@ -350,7 +360,12 @@ 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];
+ if (_game.version == kIdSpaFloppy) {
+ if (_inventoryInfo[73] > 8)
+ _inventoryInfo[72] = _inventoryInfo[73] - 7;
+ } else {
+ _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
+ }
drawInventory(_inventoryInfo[72], 0);
playSound(51, 1);
}
@@ -380,7 +395,7 @@ void IgorEngine::removeInventoryEntry(int index) {
_inventoryInfo[_inventoryInfo[index] - 1] = 0;
_inventoryInfo[index] = 0;
packInventory();
- if (_inventoryInfo[72] > _inventoryInfo[73]) {
+ if (_game.version != kIdSpaFloppy && _inventoryInfo[72] > _inventoryInfo[73]) {
_inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
}
}
@@ -392,6 +407,14 @@ void IgorEngine::removeObjectFromInventory(int index) {
}
int IgorEngine::getObjectFromInventory(int x) const {
+ if (_game.version == kIdSpaFloppy) {
+ if (x >= 0 && x < 320) {
+ const int i = x / 40 + _inventoryInfo[72];
+ if (i <= _inventoryInfo[73])
+ return _inventoryInfo[i - 1];
+ }
+ return 0;
+ }
if (x >= 20 && x <= 299) {
int i = (x - 20) / 40 + _inventoryInfo[72];
if (i <= _inventoryInfo[73]) {
@@ -401,6 +424,21 @@ int IgorEngine::getObjectFromInventory(int x) const {
return 0;
}
+void IgorEngine::pageFloppyInventory(bool forward) {
+ const int count = _inventoryInfo[73];
+ const int start = _inventoryInfo[72];
+ if (forward) {
+ if (count <= start + 7 || start >= count - 7)
+ return;
+ _inventoryInfo[72] = (start < count - 11) ? start + 4 : count - 7;
+ } else {
+ if (count <= 8 || start <= 1)
+ return;
+ _inventoryInfo[72] = (start > 4) ? start - 4 : 1;
+ }
+ drawInventory(_inventoryInfo[72], 0);
+}
+
void IgorEngine::packInventory() {
for (int i = 1; i <= _inventoryInfo[73]; ++i) {
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 1d775f60cc1..e540be44943 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -41,6 +41,7 @@
#include "igor/detection.h"
#include "igor/font.h"
+#include "igor/floppy_font.h"
#include "igor/resource_ids.h"
namespace Igor {
@@ -600,6 +601,7 @@ private:
uint8 *_inventoryPanelBuffer;
uint8 *_inventoryImagesBuffer;
uint8 *_verbsPanelBuffer;
+ int _verbsPanelSize;
int _screenVGAVOffset;
bool _eventQuitGame;
@@ -728,7 +730,14 @@ private:
int _soundOffsetsCount;
uint32 *_soundOffsets;
+ // _dialogueFont and _sentenceFont are the same on all versions
+ // but the Spanish Floppy
Font _font;
+ FloppyDialogueFont _floppyDialogueFont;
+ FloppySentenceFont _floppySentenceFont;
+ const IgorFont *_dialogueFont;
+ const IgorFont *_sentenceFont;
+ uint8 _actionSentenceColors[3];
ResourceEntry *_resourceEntries;
Common::Array<StringEntry> _stringEntries;
@@ -1564,13 +1573,18 @@ private:
void updateRightButtonVerbPick();
void endRightButtonVerbPick();
void formatRightButtonSentence();
- int getVerbUnderCursor(int x) const { return ((x % 46) < 44) ? (kVerbTalk + x / 46) : 0; }
+ int getVerbUnderCursor(int x) const {
+ if (_game.version == kIdSpaFloppy)
+ return kVerbWalk + x / 40;
+ return ((x % 46) < 44) ? (kVerbTalk + x / 46) : 0;
+ }
void handleRoomInventoryScroll();
void loadOptionsMenuTexts();
void drawOptionsMenuText(int text, int x, int y, int color);
void handleOptionsMenu();
void scrollInventory();
void drawInventory(int start, int mode);
+ void pageFloppyInventory(bool forward);
void addObjectToInventory(int object, int index);
void removeInventoryEntry(int index);
void removeObjectFromInventory(int index);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index eb4f0c98269..faf1f9ac53a 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -27,8 +27,6 @@
namespace Igor {
-static const uint8 kSentenceColorIndex[] = {0xFD, 0xFB, 0xF1};
-
void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
if (presentScreen && !_eventQuitGame) {
@@ -188,8 +186,9 @@ void IgorEngine::beginRightButtonVerbPick() {
_inputVars[kInputRightMoveLeft] = 0;
_inputVars[kInputRightMoveRight] = 0;
- const bool inventorySlot = _rightButtonSelectCursorY >= 170 && _rightButtonSelectCursorY <= 199 &&
- _rightButtonSelectCursorX > 19 && _rightButtonSelectCursorX < 299;
+ const bool inventorySlot = _rightButtonSelectCursorY >= 170 &&
+ ((_game.version == kIdSpaFloppy) ? (_rightButtonSelectCursorY <= 197) :
+ (_rightButtonSelectCursorY <= 199 && _rightButtonSelectCursorX > 19 && _rightButtonSelectCursorX < 299));
int defaultVerb = 0;
// if in the scene, choose the hotspot's default verb as starting point
if (_rightButtonSelectCursorY < 144) {
@@ -235,7 +234,7 @@ void IgorEngine::beginRightButtonVerbPick() {
void IgorEngine::updateRightButtonVerbPick() {
if (_inputVars[kInputRightMoveLeft]) {
_inputVars[kInputRightMoveLeft] = 0;
- const int candidate = MAX<int>(_currentAction.verb - 1, kVerbTalk);
+ const int candidate = MAX<int>(_currentAction.verb - 1, (_game.version == kIdSpaFloppy) ? kVerbWalk : kVerbTalk);
if (candidate != _currentAction.verb) {
redrawVerb(_currentAction.verb, false);
redrawVerb(candidate, true);
@@ -324,6 +323,17 @@ void IgorEngine::handleRoomInput() {
if (!_roomCursorOn || _gameState.dialogueTextRunning || _scrollInventory) {
return;
}
+ // Spanish floppy inventory paging works with left and right mouse buttons pressed on the 2 last rows of the screen
+ if (_game.version == kIdSpaFloppy && !_rightButtonSelecting && _inputVars[kInputCursorYPos] >= 198) {
+ if (_inputVars[kInputClick])
+ pageFloppyInventory(false);
+ if (_inputVars[kInputRightClick])
+ pageFloppyInventory(true);
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputRightClick] = 0;
+ _inputVars[kInputRightRelease] = 0;
+ return;
+ }
if (_inputVars[kInputRightClick]) {
_inputVars[kInputRightClick] = 0;
if (!_rightButtonSelecting) {
@@ -341,7 +351,7 @@ void IgorEngine::handleRoomInput() {
}
_inputVars[kInputRightRelease] = 0;
// verbs panel click
- if (_inputVars[kInputCursorYPos] >= 156 && _inputVars[kInputCursorYPos] <= 167) {
+ if (_inputVars[kInputCursorYPos] >= 156 && _inputVars[kInputCursorYPos] <= ((_game.version == kIdSpaFloppy) ? 166 : 167)) {
if (_inputVars[kInputClick]) {
int verb = getVerbUnderCursor(_inputVars[kInputCursorXPos]);
if (verb != _currentAction.verb) {
@@ -359,7 +369,7 @@ void IgorEngine::handleRoomInput() {
return;
}
// Inventory arrows
- if (_inputVars[kInputCursorYPos] >= 172 && _inputVars[kInputCursorYPos] <= 183 && (_inputVars[kInputCursorXPos] < 15 || _inputVars[kInputCursorXPos] > 304)) {
+ if (_game.version != kIdSpaFloppy && _inputVars[kInputCursorYPos] >= 172 && _inputVars[kInputCursorYPos] <= 183 && (_inputVars[kInputCursorXPos] < 15 || _inputVars[kInputCursorXPos] > 304)) {
if (_inputVars[kInputClick]) {
if (_inventoryInfo[72] > 1) {
_inventoryInfo[72] -= 7;
@@ -370,7 +380,7 @@ void IgorEngine::handleRoomInput() {
return;
}
// Inventory arrows
- if (_inputVars[kInputCursorYPos] >= 186 && _inputVars[kInputCursorYPos] <= 197 && (_inputVars[kInputCursorXPos] < 15 || _inputVars[kInputCursorXPos] > 304)) {
+ if (_game.version != kIdSpaFloppy && _inputVars[kInputCursorYPos] >= 186 && _inputVars[kInputCursorYPos] <= 197 && (_inputVars[kInputCursorXPos] < 15 || _inputVars[kInputCursorXPos] > 304)) {
if (_inputVars[kInputClick]) {
if (_inventoryInfo[73] > _inventoryInfo[72] + 6) {
_inventoryInfo[72] += 7;
@@ -412,7 +422,7 @@ void IgorEngine::handleRoomInput() {
// Action previousAction = _currentAction;
// Handle inventory and room object selection based on cursor position and clicks
- if (_inputVars[kInputCursorYPos] >= 170 && _inputVars[kInputCursorYPos] <= 199) {
+ if (_inputVars[kInputCursorYPos] >= 170 && _inputVars[kInputCursorYPos] <= ((_game.version == kIdSpaFloppy) ? 197 : 199)) {
int object = getObjectFromInventory(_inputVars[kInputCursorXPos]);
if (_currentAction.verbType == 0) {
_currentAction.object1Num = object;
@@ -620,12 +630,12 @@ void IgorEngine::formatActionSentence(uint8 color) {
}
}
- drawActionSentence(actionSentence, kSentenceColorIndex[color]);
+ drawActionSentence(actionSentence, (_game.version == kIdSpaFloppy) ? _actionSentenceColors[color] : _sentenceColorIndex[color]);
}
void IgorEngine::drawActionSentence(const char *sentence, uint8 color) {
memset(_screenVGA + 144 * 320, 0, 11 * 320);
- int w = _font.getStringWidth(sentence);
+ int w = _sentenceFont->getStringWidth(sentence);
int x = (320 - w) / 2;
// A sentence wider than the screen would start at a negative offset and
// wrap into the previous scanline; keep it left-aligned and let drawString
@@ -633,7 +643,7 @@ void IgorEngine::drawActionSentence(const char *sentence, uint8 color) {
if (x < 0) {
x = 0;
}
- _font.drawString(_screenVGA, sentence, x, 144, color, 0, 0);
+ _sentenceFont->drawString(_screenVGA, sentence, x, 144, color, 0, 0);
}
} // End of namespace Igor
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 055d8bc485b..84b4c1d39eb 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -201,7 +201,7 @@ void IgorEngine::loadOptionsMenuTexts() {
void IgorEngine::drawOptionsMenuText(int text, int x, int y, int color) {
const char *str = _optionsMenuTexts[text].c_str();
// center horizontally
- _font.drawString(_screenTextLayer, str, x - _font.getStringWidth(str) / 2, y, color, -1, 0);
+ _dialogueFont->drawString(_screenTextLayer, str, x - _dialogueFont->getStringWidth(str) / 2, y, color, -1, 0);
}
void IgorEngine::handleOptionsMenu_paintQuit() {
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 20aba5844d0..53d263c0523 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -224,7 +224,13 @@ void IgorEngine::loadDialogueData(int dlg) {
}
void IgorEngine::loadMainTexts() {
- loadData(IMG_VerbsPanel, _verbsPanelBuffer);
+ // the panel of the Spanish floppy version has one row less than the CD one
+ const ResourceEntry *panel = findData(IMG_VerbsPanel);
+ if (panel->size > 320 * 12 || panel->size % 320 != 0) {
+ error("Invalid verbs panel dimensions");
+ }
+ // save the size in _verbsPanelSize
+ loadData(IMG_VerbsPanel, _verbsPanelBuffer, &_verbsPanelSize);
debugC(9, kDebugResource, "loadMainTexts()");
if (_game.version == kIdSpaCD) {
const struct {
@@ -241,13 +247,14 @@ void IgorEngine::loadMainTexts() {
};
for (int i = 0; i < 7; ++i) {
const char *s = getString(verbTexts[i].strId);
- int x = verbTexts[i].x - _font.getStringWidth(s) / 2;
- _font.drawString(_verbsPanelBuffer, s, x, 0, 0xF2, -1, 0);
+ int x = verbTexts[i].x - _dialogueFont->getStringWidth(s) / 2;
+ _dialogueFont->drawString(_verbsPanelBuffer, s, x, 0, 0xF2, -1, 0);
}
}
int dataSize;
uint8 *p = loadData(TXT_MainTable, 0, &dataSize);
if (_game.version == kIdSpaFloppy) {
+ loadData(DAT_FloppySentenceColors, _actionSentenceColors);
// it has 171 dialogue texts and its verbs are in a separate resource
const uint objectsOffset = 3 * 7 * 2;
const uint dialogueOffset = 0x8BA;
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 469be2f585b..d1fc9734682 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -868,5 +868,6 @@
#define TXT_MainVerbs 1240
#define PAL_VerbsPanel 1241
#define PAL_InventoryPanel 1242
+#define DAT_FloppySentenceColors 1246
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/room.cpp b/engines/igor/room.cpp
index 5b6c99a116f..8fc8b34c645 100644
--- a/engines/igor/room.cpp
+++ b/engines/igor/room.cpp
@@ -123,13 +123,15 @@ void IgorEngine::decodeRoomStrings(const uint8 *p, bool skipObjectNames) {
++index;
}
int len = *p++;
- if (len != 0) {
+ // The spanish floppy has two sets of object names, one for each language,
+ // so we only decode the one marked by the current language setting
+ if (len != 0 && code == 0xF4 + _language) {
assert(index >= 0);
decodeRoomString(p, _roomObjectNames[index], len);
- p += len;
_roomObjectNames[index][len] = '\0';
debugC(9, kDebugResource, "decodeRoomStrings() _roomObjectNames[%d] '%s'", index, _roomObjectNames[index]);
}
+ p += len;
code = *p++;
}
}
@@ -143,12 +145,12 @@ void IgorEngine::decodeRoomStrings(const uint8 *p, bool skipObjectNames) {
++index;
}
int len = *p++;
- if (len != 0) {
+ if (len != 0 && code == 0xF4 + _language) {
decodeRoomString(p, _globalDialogueTexts[index], len);
- p += len;
_globalDialogueTexts[index][len] = '\0';
debugC(9, kDebugResource, "decodeRoomStrings() _globalDialogueTexts[%d] '%s'", index, _globalDialogueTexts[index]);
}
+ p += len;
code = *p++;
}
}
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 7d8d0614478..0da5119cd29 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -55,7 +55,7 @@ void IgorEngine::SET_DIALOGUE_TEXT(int start, int count) {
void IgorEngine::fixDialogueTextPosition(int num, int count, int *x, int *y) {
int textLineWidth = 0;
for (int i = 0; i < count; ++i) {
- int w = _font.getStringWidth(_globalDialogueTexts[num + i]);
+ int w = _dialogueFont->getStringWidth(_globalDialogueTexts[num + i]);
if (w > textLineWidth) {
textLineWidth = w;
}
@@ -119,10 +119,10 @@ void IgorEngine::startCutsceneDialogue(int x, int y, int r, int g, int b) {
for (int i = 0; i < dt->count; ++i) {
const char *textLine = _globalDialogueTexts[dt->num + i];
- int textLineWidth = _font.getStringWidth(textLine);
+ int textLineWidth = _dialogueFont->getStringWidth(textLine);
int textX = talkX - textLineWidth / 2;
int textY = i * 10;
- _font.drawString(_screenTextLayer, textLine, textX, textY, _talkColorIndex, _talkShadowIndex, _talkShadowIndex);
+ _dialogueFont->drawString(_screenTextLayer, textLine, textX, textY, _talkColorIndex, _talkShadowIndex, _talkShadowIndex);
}
setPaletteColor(_talkColorIndex, r, g, b);
setPaletteColor(_talkShadowIndex, 0, 0, 0);
@@ -351,10 +351,10 @@ void IgorEngine::startIgorDialogue() {
}
for (int i = 0; i < dt->count; ++i) {
const char *textLine = _globalDialogueTexts[dt->num + i];
- int textLineWidth = _font.getStringWidth(textLine);
+ int textLineWidth = _dialogueFont->getStringWidth(textLine);
int textX = talkX - textLineWidth / 2;
int textY = i * 10;
- _font.drawString(_screenTextLayer, textLine, textX, textY, _talkColorIndex, _talkShadowIndex, _talkShadowIndex);
+ _dialogueFont->drawString(_screenTextLayer, textLine, textX, textY, _talkColorIndex, _talkShadowIndex, _talkShadowIndex);
}
setPaletteColor(_talkColorIndex, _dialogueColor[0], _dialogueColor[1], _dialogueColor[2]);
setPaletteColor(_talkShadowIndex, 0, 0, 0);
@@ -572,7 +572,7 @@ void IgorEngine::drawDialogueChoices() {
int num = _gameState.dialogueData[offset + 3] - 1;
char questionText[128];
snprintf(questionText, sizeof(questionText), "@%s %s", _dialogueQuestions[num][0], _dialogueQuestions[num][1]);
- _font.drawString(_screenVGA, questionText, 0, _dialogueInfo[0] * 11 + 135, 240, 0, 0);
+ _dialogueFont->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]);
}
Commit: 24b6839722b064aa3d7bdf598debcebb0fc6589c
https://github.com/scummvm/scummvm/commit/24b6839722b064aa3d7bdf598debcebb0fc6589c
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:09+01:00
Commit Message:
IGOR: Replace inventoryInfo special indices with constants
Changed paths:
engines/igor/graphics.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/part_main.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_26.cpp
engines/igor/parts/part_28.cpp
engines/igor/parts/part_30.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_69.cpp
engines/igor/parts/part_73.cpp
engines/igor/parts/part_76.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_81.cpp
engines/igor/parts/part_margaret.cpp
engines/igor/text.cpp
diff --git a/engines/igor/graphics.cpp b/engines/igor/graphics.cpp
index b067307bf17..7273e101a93 100644
--- a/engines/igor/graphics.cpp
+++ b/engines/igor/graphics.cpp
@@ -246,7 +246,7 @@ void IgorEngine::drawInventory(int start, int mode) {
++x;
}
// Hide arrows
- if (_inventoryInfo[72] == 1) {
+ if (_inventoryInfo[kInventoryFirstVisible] == 1) {
// 'hide' scroll up
for (y = 5; y <= 11; ++y) {
for (x = 4; x <= 12; ++x) {
@@ -259,7 +259,7 @@ void IgorEngine::drawInventory(int start, int mode) {
}
}
}
- if (_inventoryInfo[73] <= _inventoryInfo[72] + 6 || _inventoryInfo[72] >= _inventoryInfo[73] - 6) {
+ if (_inventoryInfo[kInventoryCount] <= _inventoryInfo[kInventoryFirstVisible] + 6 || _inventoryInfo[kInventoryFirstVisible] >= _inventoryInfo[kInventoryCount] - 6) {
// 'hide' scroll down
for (y = 19; y <= 25; ++y) {
for (x = 4; x <= 12; ++x) {
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index aacf0b4e218..d088dc75b35 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -293,7 +293,7 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
SET_PAL_240_48_1();
drawVerbsPanel();
redrawVerb(_currentAction.verb, true);
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
}
if (!_gameState.dialogueTextRunning)
showCursor();
@@ -357,16 +357,16 @@ void IgorEngine::handleRoomInventoryScroll() {
void IgorEngine::addObjectToInventory(int object, int index) {
debugC(9, kDebugEngine, "addObjectToInventory %d %d", object, index);
- ++_inventoryInfo[73];
- _inventoryInfo[_inventoryInfo[73] - 1] = object;
- _inventoryInfo[index] = _inventoryInfo[73];
+ ++_inventoryInfo[kInventoryCount];
+ _inventoryInfo[_inventoryInfo[kInventoryCount] - 1] = object;
+ _inventoryInfo[index] = _inventoryInfo[kInventoryCount];
if (_game.version == kIdSpaFloppy) {
- if (_inventoryInfo[73] > 8)
- _inventoryInfo[72] = _inventoryInfo[73] - 7;
+ if (_inventoryInfo[kInventoryCount] > 8)
+ _inventoryInfo[kInventoryFirstVisible] = _inventoryInfo[kInventoryCount] - 7;
} else {
- _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
+ _inventoryInfo[kInventoryFirstVisible] = _inventoryOffsetTable[(_inventoryInfo[kInventoryCount] - 1) / 7];
}
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
playSound(51, 1);
}
@@ -380,7 +380,7 @@ bool IgorEngine::debugAddObjectToInventory(int object) {
}
const int index = object + ARRAYSIZE(_inventoryImages) - 1;
- if (_inventoryInfo[index] != 0 || _inventoryInfo[73] >= ARRAYSIZE(_inventoryImages)) {
+ if (_inventoryInfo[index] != 0 || _inventoryInfo[kInventoryCount] >= ARRAYSIZE(_inventoryImages)) {
return false;
}
@@ -395,29 +395,29 @@ void IgorEngine::removeInventoryEntry(int index) {
_inventoryInfo[_inventoryInfo[index] - 1] = 0;
_inventoryInfo[index] = 0;
packInventory();
- if (_game.version != kIdSpaFloppy && _inventoryInfo[72] > _inventoryInfo[73]) {
- _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
+ if (_game.version != kIdSpaFloppy && _inventoryInfo[kInventoryFirstVisible] > _inventoryInfo[kInventoryCount]) {
+ _inventoryInfo[kInventoryFirstVisible] = _inventoryOffsetTable[(_inventoryInfo[kInventoryCount] - 1) / 7];
}
}
void IgorEngine::removeObjectFromInventory(int index) {
removeInventoryEntry(index);
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
playSound(63, 1);
}
int IgorEngine::getObjectFromInventory(int x) const {
if (_game.version == kIdSpaFloppy) {
if (x >= 0 && x < 320) {
- const int i = x / 40 + _inventoryInfo[72];
- if (i <= _inventoryInfo[73])
+ const int i = x / 40 + _inventoryInfo[kInventoryFirstVisible];
+ if (i <= _inventoryInfo[kInventoryCount])
return _inventoryInfo[i - 1];
}
return 0;
}
if (x >= 20 && x <= 299) {
- int i = (x - 20) / 40 + _inventoryInfo[72];
- if (i <= _inventoryInfo[73]) {
+ int i = (x - 20) / 40 + _inventoryInfo[kInventoryFirstVisible];
+ if (i <= _inventoryInfo[kInventoryCount]) {
return _inventoryInfo[i - 1];
}
}
@@ -425,33 +425,33 @@ int IgorEngine::getObjectFromInventory(int x) const {
}
void IgorEngine::pageFloppyInventory(bool forward) {
- const int count = _inventoryInfo[73];
- const int start = _inventoryInfo[72];
+ const int count = _inventoryInfo[kInventoryCount];
+ const int start = _inventoryInfo[kInventoryFirstVisible];
if (forward) {
if (count <= start + 7 || start >= count - 7)
return;
- _inventoryInfo[72] = (start < count - 11) ? start + 4 : count - 7;
+ _inventoryInfo[kInventoryFirstVisible] = (start < count - 11) ? start + 4 : count - 7;
} else {
if (count <= 8 || start <= 1)
return;
- _inventoryInfo[72] = (start > 4) ? start - 4 : 1;
+ _inventoryInfo[kInventoryFirstVisible] = (start > 4) ? start - 4 : 1;
}
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
}
void IgorEngine::packInventory() {
- for (int i = 1; i <= _inventoryInfo[73]; ++i) {
+ for (int i = 1; i <= _inventoryInfo[kInventoryCount]; ++i) {
if (_inventoryInfo[i - 1] != 0) {
continue;
}
- int count = _inventoryInfo[73] - 1;
+ int count = _inventoryInfo[kInventoryCount] - 1;
for (int index = i; index <= count; ++index) {
_inventoryInfo[index - 1] = _inventoryInfo[index];
_inventoryInfo[_inventoryInfo[index - 1] + ARRAYSIZE(_inventoryImages) - 1] = index;
}
- _inventoryInfo[_inventoryInfo[73] - 1] = 0;
- --_inventoryInfo[73];
+ _inventoryInfo[_inventoryInfo[kInventoryCount] - 1] = 0;
+ --_inventoryInfo[kInventoryCount];
}
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index e540be44943..b8d819b980c 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -475,6 +475,14 @@ enum MargaretState {
kMargaretStatePhotoSequenceComplete
};
+// Special Entries of _inventoryInfo after the objects: the number of the first
+// visible object of the inventory and the number of objects held.
+enum {
+ kInventoryFirstVisible = 72,
+ kInventoryCount = 73,
+ kInventoryInfoSize = 74
+};
+
enum Verb {
kVerbWalk = 1,
kVerbTalk,
@@ -675,7 +683,7 @@ private:
uint8 _objectsState[112];
uint8 _inventoryImages[36];
- uint8 _inventoryInfo[74];
+ uint8 _inventoryInfo[kInventoryInfoSize];
char _verbPrepositions[3][7];
char _roomObjectNames[20][MAX_OBJECT_NAME_LENGTH];
char _globalObjectNames[37][MAX_OBJECT_NAME_LENGTH];
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index faf1f9ac53a..cb7f2473fb4 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -371,9 +371,9 @@ void IgorEngine::handleRoomInput() {
// Inventory arrows
if (_game.version != kIdSpaFloppy && _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);
+ if (_inventoryInfo[kInventoryFirstVisible] > 1) {
+ _inventoryInfo[kInventoryFirstVisible] -= 7;
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 2);
}
_inputVars[kInputClick] = 0;
}
@@ -382,9 +382,9 @@ void IgorEngine::handleRoomInput() {
// Inventory arrows
if (_game.version != kIdSpaFloppy && _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);
+ if (_inventoryInfo[kInventoryCount] > _inventoryInfo[kInventoryFirstVisible] + 6) {
+ _inventoryInfo[kInventoryFirstVisible] += 7;
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 1);
}
_inputVars[kInputClick] = 0;
}
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 094d6842295..eb0668635bf 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -462,8 +462,8 @@ void IgorEngine::partMain() {
_inventoryInfo[36] = 1;
_inventoryInfo[37] = 2;
_inventoryInfo[39] = 3;
- _inventoryInfo[72] = 1; // first object
- _inventoryInfo[73] = 3; // last object
+ _inventoryInfo[kInventoryFirstVisible] = 1; // first object
+ _inventoryInfo[kInventoryCount] = 3; // last object
}
partMainUpdateObjectState(255);
if (_currentPart != kStartupPart) { // boot param
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 562fc785ade..a8d948deacf 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -411,7 +411,7 @@ void IgorEngine::part12ExorcismCutscene() {
// door open
_objectsState[kChurchDoorOpenStateIndex] = 1;
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentPart = 40;
}
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 17820a710ab..7d263686916 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -92,7 +92,7 @@ void IgorEngine::part14LookAtPuzzle() {
part14LoadRoom();
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
fadeIn(768);
if (_currentPart == 145) {
for (int i = 1; i <= 10; ++i) {
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index 68325899c01..a2e508dccb3 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -188,10 +188,10 @@ void IgorEngine::part16PhotoCutscene() {
}
part16ApplyObjectState(255);
// Data-only inventory update: the panel is redrawn later together with the verbs
- ++_inventoryInfo[73];
- _inventoryInfo[_inventoryInfo[73] - 1] = kInventoryObjectPhoto;
- _inventoryInfo[54] = _inventoryInfo[73];
- _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
+ ++_inventoryInfo[kInventoryCount];
+ _inventoryInfo[_inventoryInfo[kInventoryCount] - 1] = kInventoryObjectPhoto;
+ _inventoryInfo[54] = _inventoryInfo[kInventoryCount];
+ _inventoryInfo[kInventoryFirstVisible] = _inventoryOffsetTable[(_inventoryInfo[kInventoryCount] - 1) / 7];
_objectsState[kPhotoCutsceneSeenStateIndex] = 1;
_objectsState[kMargaretStateIndex] = kMargaretStatePhotoTaken;
if (!isCDVersion())
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index f3145fd6c71..d6f4ac1643c 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -433,7 +433,7 @@ void IgorEngine::part2() {
// Rebuild the panels erased above.
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_walkData[0].setPos(215, 134, kFacingPositionRight, 0);
break;
case 24: // From igor's room
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index 999e0d706a3..4a0555f367e 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -360,7 +360,7 @@ void IgorEngine::part21MargaretTakesNote() {
_objectsState[kMargaretStateIndex] = 2;
drawVerbsPanel();
_currentAction.verb = kVerbWalk;
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
part21ApplyObjectState(255);
_objectsState[kMargaretSceneStateIndex] = 1;
}
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index 1ed15e2423a..e27f8574e9a 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -190,7 +190,7 @@ void IgorEngine::part26EnterFromLaboratory() {
drawVerbsPanel();
redrawVerb(kVerbWalk, true);
_currentAction.verb = kVerbWalk;
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
playSound(51, 1);
part26ApplyObjectState(255);
}
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index c606ee28986..cff8660bbab 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -216,7 +216,7 @@ void IgorEngine::part28EnterAndCheckGrades() {
SET_PAL_240_48_1();
SET_PAL_208_96_1();
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
part28ApplyObjectState(255);
fadeIn(768);
_walkData[0].setPos(319, 142, 4, 0);
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index f0b9de90e5e..5d1e965bba2 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -223,12 +223,12 @@ void IgorEngine::part30LauraCutscene() {
_walkData[0].setDefaultScale();
_walkDataLastIndex = 1;
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
// Que caracter
igorSay(210, 1, 459);
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
_objectsState[kLauraMetAtCollegeStateIndex] = 1;
part30ApplyObjectState(255);
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index 90dad869bed..7302d6c1e3b 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -317,7 +317,7 @@ void IgorEngine::part34OldLadyConversation() {
if (_objectsState[kOldLadyConversationSeenStateIndex] == 0) {
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
_objectsState[kOldLadyConversationSeenStateIndex] = 1;
}
@@ -384,7 +384,7 @@ void IgorEngine::part34LauraConversation() {
part34WaitForIgorDialogue();
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
_roomDataOffsets.dlg = kNoDialogueData;
}
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 4ca6d77f710..9567c8bdf9d 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -293,7 +293,7 @@ void IgorEngine::part68GiveRecordsToBoris() {
drawAnimRect(kPart68GiveAnimOffset, kPart68GiveFramesOffset, kPart68GiveWidth, kPart68GiveHeight);
if (_inventoryInfo[kPart68GiveInventoryIndex] != 0) {
removeInventoryEntry(kPart68GiveInventoryIndex);
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
}
playSound(63, 1);
igorSayAndWait(214, 1, 1019);
@@ -424,7 +424,7 @@ void IgorEngine::part68Conversation() {
}
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
_gameState.dialogueStarted = false;
_updateDialogue = 0;
diff --git a/engines/igor/parts/part_69.cpp b/engines/igor/parts/part_69.cpp
index d83ec6ed9f8..eaa814f9b17 100644
--- a/engines/igor/parts/part_69.cpp
+++ b/engines/igor/parts/part_69.cpp
@@ -231,7 +231,7 @@ void IgorEngine::part69UseVaseWithFireflies() {
_objectsState[kPart69FireflyCapturedStateIndex] = 1;
_objectsState[kVaseStateIndex] = 2;
partMainUpdateObjectState(7);
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
playSound(63, 1);
while (_mixer->isSoundHandleActive(_sfxHandle) && !_eventQuitGame) {
waitForTimer(1);
diff --git a/engines/igor/parts/part_73.cpp b/engines/igor/parts/part_73.cpp
index 2b5fa881878..cf8163899c8 100644
--- a/engines/igor/parts/part_73.cpp
+++ b/engines/igor/parts/part_73.cpp
@@ -91,10 +91,10 @@ void IgorEngine::part73Cutscene() {
partMainUpdateObjectState(8);
// removes the great dosicua
removeInventoryEntry(kPart73InventoryIndex);
- ++_inventoryInfo[73];
- _inventoryInfo[_inventoryInfo[73] - 1] = kInventoryObjectLizard;
- _inventoryInfo[kPart73InventoryIndex] = _inventoryInfo[73];
- _inventoryInfo[72] = _inventoryOffsetTable[(_inventoryInfo[73] - 1) / 7];
+ ++_inventoryInfo[kInventoryCount];
+ _inventoryInfo[_inventoryInfo[kInventoryCount] - 1] = kInventoryObjectLizard;
+ _inventoryInfo[kPart73InventoryIndex] = _inventoryInfo[kInventoryCount];
+ _inventoryInfo[kInventoryFirstVisible] = _inventoryOffsetTable[(_inventoryInfo[kInventoryCount] - 1) / 7];
fadeOut(624);
// the card with the time that has passed
@@ -106,7 +106,7 @@ void IgorEngine::part73Cutscene() {
SET_PAL_240_48_1();
SET_PAL_208_96_1();
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
_objectsState[kStatuetteTaken2StateIndex] = 0;
_currentPart = 40;
diff --git a/engines/igor/parts/part_76.cpp b/engines/igor/parts/part_76.cpp
index 6656e00b769..281c09c8b7f 100644
--- a/engines/igor/parts/part_76.cpp
+++ b/engines/igor/parts/part_76.cpp
@@ -290,7 +290,7 @@ void IgorEngine::part76() {
loadAnimData(anim);
SET_PAL_208_96_1();
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_roomDataOffsets = PART_76_ROOM_DATA_OFFSETS;
setRoomClickFix(119, 153, 295, true, 119);
partMainSetExecuteAction(1, &IgorEngine::part76ExecuteAction);
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index c7343040a8d..29346cd842d 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -176,7 +176,7 @@ void IgorEngine::part8DeanCallsSecretary() {
free(roomScreen);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
fadeIn(768);
_currentPart = currentPart;
_objectsState[kIntercomUsedStateIndex] = 1;
@@ -286,14 +286,14 @@ void IgorEngine::part8GiveBottleToDean() {
if (_inventoryInfo[58] != 0) {
removeInventoryEntry(58);
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
}
cutsceneSayWithCallback(78, 75, 26, 58, 0, { { 216, 1, 162 }, { 217, 1, 163 }, { 218, 1, 164 }, { 219, 1, 165 } }, &IgorEngine::part8UpdateDeanDialogue);
const Part08PendingDeanDrink pendingDeanDrink =
_objectsState[kBottleStateIndex] < 2 ? kPart08PendingDeanDrinkWhisky : kPart08PendingDeanDrinkWater;
_objectsState[kPendingDeanDrinkStateIndex] = pendingDeanDrink;
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
playSound(63, 1);
part8ApplyObjectState(255);
}
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index 0d609c40e66..7180655148c 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -358,7 +358,7 @@ void IgorEngine::part81GiveLampToLighthouseKeeper() {
part81SayLighthouseKeeper({ { 230, 1, 970 } });
_objectsState[kLighthouseMessageSentStateIndex] = 1;
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
part81ApplyObjectState(255);
}
@@ -427,7 +427,7 @@ void IgorEngine::part81HandleDialogue() {
memset(_screenVGA + 46080, 0, 17920);
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
_gameState.dialogueStarted = false;
_updateDialogue = 0;
diff --git a/engines/igor/parts/part_margaret.cpp b/engines/igor/parts/part_margaret.cpp
index 88368554264..0d723d6b1ba 100644
--- a/engines/igor/parts/part_margaret.cpp
+++ b/engines/igor/parts/part_margaret.cpp
@@ -123,7 +123,7 @@ void IgorEngine::partMargaret() {
SET_PAL_240_48_1();
SET_PAL_208_96_1();
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
}
_canSaveGame = savingWasAllowed;
}
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 0da5119cd29..8da7e6be23f 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -548,7 +548,7 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreU
memset(_screenVGA + 46080, 0, 17920);
if(restoreUI) {
drawVerbsPanel();
- drawInventory(_inventoryInfo[72], 0);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
}
_currentAction.verb = kVerbWalk;
_gameState.dialogueStarted = false;
Commit: d71e8487c87b68bb4b9d60e203b0becea6b4226e
https://github.com/scummvm/scummvm/commit/d71e8487c87b68bb4b9d60e203b0becea6b4226e
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:09+01:00
Commit Message:
IGOR: Restore MIDI music in Spanish floppy
Changed paths:
engines/igor/igor.cpp
engines/igor/resource_ids.h
engines/igor/sound.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index d088dc75b35..1a3a57bea73 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -235,9 +235,7 @@ Common::Error IgorEngine::run() {
}
readTableFile();
- // TODO: Spanish floppy music stays disabled until its music resources
- // and their selection are identified.
- if ((_game.flags & kFlagFloppy) && _game.version != kIdSpaFloppy)
+ if (_game.flags & kFlagFloppy)
_midiPlayer = new MidiPlayer(_mixer);
loadMainTexts();
loadIgorFrames();
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index d1fc9734682..e0ba984c5ca 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -338,6 +338,7 @@
#define CMF_7_2 314
#define CMF_7_3 315
#define CMF_7_4 316
+#define CMF_1 1275
#define FRM_IgorDirBack 317
#define FRM_IgorDirRight 318
#define FRM_IgorDirFront 319
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 175be38e2f6..9d897082da8 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -81,12 +81,22 @@ void IgorEngine::startMusic(int cmf) {
_midiPlayer->playMusic(_musicData, musicDataSize);
}
-static int getMusicResource(int num, int sequence) {
+// Number of segments cycled for the given music number (the Spanish floppy
+// version only ships three segments for number 2).
+static int getMusicSegmentCount(int num, int version) {
+ if (num == 2)
+ return version == kIdSpaFloppy ? 3 : 4;
+ return num == 7 ? 4 : 1;
+}
+
+static int getMusicResource(int num, int sequence, int version) {
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 };
if (num < 0 || num >= (int)ARRAYSIZE(cmf))
return 0;
+ if (num == 1)
+ return version == kIdSpaFloppy ? CMF_1 : 0;
if (num == 2 || num == 7) {
- if (sequence < 1 || sequence > 4)
+ if (sequence < 1 || sequence > getMusicSegmentCount(num, version))
return 0;
return cmf[num] + sequence - 1;
}
@@ -106,14 +116,23 @@ void IgorEngine::playMusic(int num, bool restart) {
if (_game.flags & kFlagFloppy) {
if (!_midiPlayer)
return;
- const int cmf = getMusicResource(num, _gameState.musicSequenceIndex);
+ int cmf = getMusicResource(num, _gameState.musicSequenceIndex, _game.version);
+ // Selection 1 belongs to the Spanish floppy logo screen only.
+ if (num == 1 && _currentPart != 900)
+ cmf = 0;
if (num != 0 && !cmf) {
// TODO: Restore unsupported music selections once verified.
return;
}
_midiPlayer->stopMusic();
_musicRestartCounter = 0;
- if (num == 12) {
+ if (_game.version == kIdSpaFloppy) {
+ // The selection starts the segment right away; repetition is
+ // handled by updateMusic() without a restart delay.
+ if (num != 0)
+ startMusic(cmf);
+ _musicRestartCounter = 0xFF;
+ } else if (num == 12) {
// Credits start directly and are excluded from automatic repetition.
startMusic(cmf);
_musicRestartCounter = 0xFF;
@@ -140,10 +159,28 @@ void IgorEngine::updateMusic() {
uint32 ticks = timer / period;
_musicTimerRemainder = timer % period;
while (ticks--) {
+ if (_game.version == kIdSpaFloppy) {
+ // Selections 1 and 12 play once; all others repeat as soon as
+ // the segment ends, without a restart delay.
+ const int num = _gameState.musicNum;
+ if (num > 1 && num < 12 && !_midiPlayer->isPlaying() &&
+ getMusicResource(num, _gameState.musicSequenceIndex, _game.version)) {
+ if (num == 2) {
+ const int previous = _gameState.musicSequenceIndex;
+ do {
+ _gameState.musicSequenceIndex = getRandomNumber(getMusicSegmentCount(2, _game.version) - 1) + 1;
+ } while (_gameState.musicSequenceIndex == previous);
+ } else if (num == 7) {
+ _gameState.musicSequenceIndex = _gameState.musicSequenceIndex == getMusicSegmentCount(7, _game.version) ? 1 : _gameState.musicSequenceIndex + 1;
+ }
+ startMusic(getMusicResource(num, _gameState.musicSequenceIndex, _game.version));
+ }
+ continue;
+ }
if (_musicRestartCounter != 0xFF) {
if (_musicRestartCounter == _musicRestartDelay) {
if (_gameState.musicNum > 0 && _gameState.musicNum < 12) {
- const int cmf = getMusicResource(_gameState.musicNum, _gameState.musicSequenceIndex);
+ const int cmf = getMusicResource(_gameState.musicNum, _gameState.musicSequenceIndex, _game.version);
if (cmf)
startMusic(cmf);
}
@@ -153,18 +190,18 @@ void IgorEngine::updateMusic() {
++_musicRestartCounter;
}
} else if (_gameState.musicNum > 0 && _gameState.musicNum < 12 &&
- getMusicResource(_gameState.musicNum, _gameState.musicSequenceIndex) && !_midiPlayer->isPlaying()) {
+ getMusicResource(_gameState.musicNum, _gameState.musicSequenceIndex, _game.version) && !_midiPlayer->isPlaying()) {
switch (_gameState.musicNum) {
case 2: {
const int previous = _gameState.musicSequenceIndex;
do {
- _gameState.musicSequenceIndex = getRandomNumber(3) + 1;
+ _gameState.musicSequenceIndex = getRandomNumber(getMusicSegmentCount(2, _game.version) - 1) + 1;
} while (_gameState.musicSequenceIndex == previous);
_musicRestartDelay = 5;
break;
}
case 7:
- _gameState.musicSequenceIndex = _gameState.musicSequenceIndex == 4 ? 1 : _gameState.musicSequenceIndex + 1;
+ _gameState.musicSequenceIndex = _gameState.musicSequenceIndex == getMusicSegmentCount(7, _game.version) ? 1 : _gameState.musicSequenceIndex + 1;
_musicRestartDelay = 5;
break;
case 11:
Commit: c39876259b0015b46884a5d46fad5e46fa36e64a
https://github.com/scummvm/scummvm/commit/c39876259b0015b46884a5d46fad5e46fa36e64a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:09+01:00
Commit Message:
IGOR: Implement Splash logos on Spanish floppy
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/part_main.cpp
engines/igor/parts/part_90.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 1a3a57bea73..2212d952252 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -72,9 +72,9 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
}
memset(_actionSentenceColors, 0, sizeof(_actionSentenceColors));
- // _currentPart = kStartupPart;
+ _currentPart = kStartupPart;
- _currentPart = 850;
+ // _currentPart = 850;
_midiPlayer = nullptr;
_musicData = nullptr;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index b8d819b980c..98205829799 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1557,6 +1557,9 @@ private:
void part95();
void part90();
void part90FadePalette(bool fadeInColors);
+ bool part90Hold(uint16 duration, int skipMode, bool optionsMenu);
+ void part90Highlight(bool brighten);
+ void part90SetUserInterfacePalettes();
// End credits
void partCredits();
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index eb0668635bf..709504abe7c 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -741,6 +741,7 @@ void IgorEngine::partMain() {
case 902:
case 903:
case 904:
+ case 980: // Spanish floppy title screen
part90();
break;
case 910: // End credits
diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp
index b0167b2cedb..601e18e84cf 100644
--- a/engines/igor/parts/part_90.cpp
+++ b/engines/igor/parts/part_90.cpp
@@ -23,6 +23,8 @@
namespace Igor {
+static const int kSoundSpanishFloppyTitle = 64;
+
void IgorEngine::part90FadePalette(bool fadeInColors) {
for (int pass = 1; pass <= 63; ++pass) {
const int threshold = fadeInColors ? 64 - pass : pass;
@@ -44,20 +46,142 @@ void IgorEngine::part90FadePalette(bool fadeInColors) {
}
}
+enum {
+ kHoldNoSkip,
+ kHoldSkipConfirm, // Enter ends the hold
+ kHoldSkipAnyKey // Escape, Enter, Space or a mouse button ends the hold
+};
+
+/**
+ * Holds the current screen for [duration] timer ticks, one iteration per change of
+ * the timer counter. With [optionsMenu] the options menu can be opened meanwhile.
+ * Returns false if the game was loaded or quit meanwhile.
+ */
+bool IgorEngine::part90Hold(uint16 duration, int skipMode, bool optionsMenu) {
+ _inputVars[kInputSkipDialogue] = 0;
+ _inputVars[kInputEscape] = 0;
+ _inputVars[kInputOptions] = 0;
+ _inputVars[kInputClick] = 0;
+ if (!isCDVersion())
+ _inputVars[kInputConfirm] = 0;
+ if (skipMode == kHoldSkipAnyKey)
+ _inputVars[kInputRightClick] = 0;
+
+ auto skipRequested = [&]() -> bool {
+ switch (skipMode) {
+ case kHoldSkipConfirm:
+ return _inputVars[kInputConfirm] != 0;
+ case kHoldSkipAnyKey:
+ return _inputVars[kInputEscape] || _inputVars[kInputConfirm] || _inputVars[kInputClick] ||
+ _inputVars[kInputRightClick] || (!optionsMenu && _inputVars[kInputOptions]);
+ default:
+ return false;
+ }
+ };
+
+ const uint32 timerStart = _system->getMillis();
+ uint8 observedTimer = 0;
+ for (uint16 elapsed = 0; elapsed < duration; ++elapsed) {
+ if (optionsMenu && _inputVars[kInputOptions]) {
+ handleOptionsMenu();
+ _inputVars[kInputOptions] = 0;
+ waitForTimer(0);
+ }
+ while (!_gameStateLoaded && !_eventQuitGame && _currentPart != kInvalidPart && !skipRequested()) {
+ waitForTimer(0, false);
+ const uint32 timerMillis = _system->getMillis() - timerStart;
+ const uint64 timerRate = (uint64)kTickDelay * _fastMode;
+ const uint64 timerTicks = (uint64)timerMillis * timerRate / 1000;
+ const uint8 timerByte = (uint8)timerTicks;
+ if (timerByte != observedTimer) {
+ observedTimer = timerByte;
+ break;
+ }
+ const uint32 deadline = timerStart + ((timerTicks + 1) * 1000 + timerRate - 1) / timerRate;
+ waitForTimer(0, false, deadline);
+ }
+ _gameTicks = (_gameTicks + 1) & 63;
+ if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart || skipRequested()) {
+ break;
+ }
+ }
+ if (skipMode == kHoldSkipConfirm) {
+ _inputVars[kInputConfirm] = 0;
+ } else if (skipMode == kHoldSkipAnyKey) {
+ _inputVars[kInputEscape] = 0;
+ _inputVars[kInputConfirm] = 0;
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputRightClick] = 0;
+ _inputVars[kInputOptions] = 0;
+ }
+ return !_gameStateLoaded && !_eventQuitGame && _currentPart != kInvalidPart;
+}
+
+/**
+ * The first screen of the Spanish floppy raises the colors 121 to 239 of its
+ * palette towards white in steps (the highlight on the logo), 5 timer ticks
+ * apart.
+ */
+void IgorEngine::part90Highlight(bool brighten) {
+ for (int step = 0; step <= 55; ++step) {
+ const int level = brighten ? 55 - step : step;
+ for (int i = 121 * 3; i < 240 * 3; ++i) {
+ if (_paletteBuffer[i] <= level) {
+ if (brighten) {
+ ++_currentPalette[i];
+ } else {
+ --_currentPalette[i];
+ }
+ }
+ }
+ setPaletteRange(121, 239);
+ waitForTimer(brighten ? 5 : 0);
+ if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart) {
+ return;
+ }
+ }
+}
+
+
+void IgorEngine::part90SetUserInterfacePalettes() {
+ loadData(PAL_InventoryPanel, _paletteBuffer + 208 * 3);
+ loadData(PAL_VerbsPanel, _paletteBuffer + 240 * 3);
+}
+
void IgorEngine::part90() {
const bool savingWasAllowed = _canSaveGame;
_canSaveGame = false;
+
+ const bool spanishFloppy = (_game.version == kIdSpaFloppy);
static const uint16 holdTicks[] = { 2000, 500, 500, 2500, 2000 };
- const uint16 duration = holdTicks[_currentPart - 900];
+ const uint16 duration = spanishFloppy ? 0 : holdTicks[_currentPart - 900];
const char *str;
+ Common::Array<uint8> titleImage;
if (_currentPart == 900 && isCDVersion()) {
playMusic(14);
}
+ if (spanishFloppy && _currentPart == 980) {
+ // The title screen selection repeats until the intro starts.
+ playMusic(2);
+ }
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
- switch (_currentPart) {
+ // Spanish floppy has only two screens
+ if (spanishFloppy) {
+ if (_currentPart == 900) {
+ loadData(PAL_PenduloStudios, _paletteBuffer);
+ loadData(IMG_PenduloStudios, _screenVGA);
+ loadData(PAL_VerbsPanel, _paletteBuffer + 240 * 3);
+ } else {
+ // the title is drawn over the image shown first, with the same palette
+ loadData(PAL_TitleScreen, _paletteBuffer);
+ loadData(IMG_FloppyTitleBackdrop, _screenVGA);
+ titleImage.resize(320 * 200);
+ loadData(IMG_TitleScreen, titleImage.data());
+ }
+ } else switch (_currentPart) {
case 900:
loadData(PAL_OptikSoftware, _paletteBuffer);
loadData(IMG_OptikSoftware, _screenVGA);
@@ -88,49 +212,40 @@ void IgorEngine::part90() {
part90FadePalette(true);
}
if (!_gameStateLoaded && !_eventQuitGame && _currentPart != kInvalidPart) {
- memcpy(_paletteBuffer, _currentPalette, 768);
- _inputVars[kInputSkipDialogue] = 0;
- _inputVars[kInputEscape] = 0;
- _inputVars[kInputOptions] = 0;
- _inputVars[kInputClick] = 0;
- if (!isCDVersion())
- _inputVars[kInputConfirm] = 0;
- const uint32 timerStart = _system->getMillis();
- uint8 observedTimer = 0;
- for (uint16 elapsed = 0; elapsed < duration; ++elapsed) {
- if (_inputVars[kInputOptions]) {
- handleOptionsMenu();
- _inputVars[kInputOptions] = 0;
- waitForTimer(0);
+ if (spanishFloppy && _currentPart == 900) {
+ // no input is checked during the first hold
+ playMusic(1);
+ bool running = part90Hold(800, kHoldNoSkip, false);
+ if (running) {
+ part90Highlight(true);
+ playMusic(0);
+ memcpy(_paletteBuffer, _currentPalette, 768);
+ running = part90Hold(2000, kHoldSkipAnyKey, true);
}
- while (!_gameStateLoaded && !_eventQuitGame && _currentPart != kInvalidPart &&
- (isCDVersion() || !_inputVars[kInputConfirm])) {
- waitForTimer(0, false);
- const uint32 timerMillis = _system->getMillis() - timerStart;
- const uint64 timerRate = (uint64)kTickDelay * _fastMode;
- const uint64 timerTicks = (uint64)timerMillis * timerRate / 1000;
- const uint8 timerByte = (uint8)timerTicks;
- if (timerByte != observedTimer) {
- observedTimer = timerByte;
- break;
- }
- const uint32 deadline = timerStart + ((timerTicks + 1) * 1000 + timerRate - 1) / timerRate;
- waitForTimer(0, false, deadline);
+ if (running) {
+ part90Highlight(false);
}
- _gameTicks = (_gameTicks + 1) & 63;
- if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart ||
- (!isCDVersion() && _inputVars[kInputConfirm])) {
- break;
+ } else if (spanishFloppy) {
+ if (part90Hold(1000, kHoldSkipAnyKey, false)) {
+ memcpy(_screenVGA, titleImage.data(), 320 * 200);
+ playSound(kSoundSpanishFloppyTitle, 1);
+ waitForTimer(0);
+ part90Hold(1000, kHoldSkipAnyKey, false);
}
+ } else {
+ memcpy(_paletteBuffer, _currentPalette, 768);
+ part90Hold(duration, isCDVersion() ? kHoldNoSkip : kHoldSkipConfirm, true);
}
- if (!isCDVersion())
- _inputVars[kInputConfirm] = 0;
}
if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart) {
if (!_gameStateLoaded)
fadeOut(768);
- SET_PAL_208_96_1();
- SET_PAL_240_48_1();
+ if (spanishFloppy) {
+ part90SetUserInterfacePalettes();
+ } else {
+ SET_PAL_208_96_1();
+ SET_PAL_240_48_1();
+ }
_canSaveGame = savingWasAllowed;
return;
}
@@ -139,9 +254,13 @@ void IgorEngine::part90() {
_canSaveGame = savingWasAllowed;
return;
}
- ++_currentPart;
- if ((_game.version == kIdSpaCD && _currentPart == 904) || _currentPart == 905) {
- _currentPart = 850;
+ if (spanishFloppy) {
+ _currentPart = (_currentPart == 900) ? 980 : 850;
+ } else {
+ ++_currentPart;
+ if ((_game.version == kIdSpaCD && _currentPart == 904) || _currentPart == 905) {
+ _currentPart = 850;
+ }
}
_canSaveGame = savingWasAllowed;
}
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index e0ba984c5ca..55b831b7bfc 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -870,5 +870,6 @@
#define PAL_VerbsPanel 1241
#define PAL_InventoryPanel 1242
#define DAT_FloppySentenceColors 1246
+#define IMG_FloppyTitleBackdrop 1249
#endif // IGOR_RESOURCE_IDS
Commit: 9c7db9f5c00c34effa4cb3159b3705ae7eb0f0ee
https://github.com/scummvm/scummvm/commit/9c7db9f5c00c34effa4cb3159b3705ae7eb0f0ee
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:10+01:00
Commit Message:
IGOR: Implements part 30 for the floppy version
Changed paths:
A engines/igor/parts/part_30_floppy.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/static_room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 98205829799..2255c60043e 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1212,6 +1212,22 @@ private:
void part30LauraLeaves();
void part30SetLauraFrame(int frame);
void part30();
+ void part30Floppy();
+ void part30FloppyExecuteAction(int action);
+ void part30FloppyGoUpstairs();
+ void part30FloppyGoDownstairs();
+ void part30FloppyUpdateLauraDialogue(int action);
+ void part30FloppyHandleLauraDialogue();
+ void part30FloppyApplyObjectState(int num);
+ void part30FloppyWalkInFromLeft();
+ void part30FloppyWalkInFromUpstairs();
+ void part30FloppyWalkInFromOutside();
+ void part30FloppyWalkInFromRight();
+ void part30FloppyLauraCutscene();
+ void part30FloppyLauraAndIgorBumpIntoEachOther();
+ void part30FloppyIgorCrossesArms();
+ void part30FloppyLauraLeaves();
+ void part30FloppyDrawCutsceneFrame(int frame, bool keepTextColors);
// college corridor stairs second floor
void part31ExecuteAction(int action);
@@ -1785,6 +1801,7 @@ protected:
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_30_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_31_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_32_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_33_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 99b36e07f16..9de0ef069f5 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -48,6 +48,7 @@ MODULE_OBJS = \
parts/part_27.o \
parts/part_28.o \
parts/part_30.o \
+ parts/part_30_floppy.o \
parts/part_31.o \
parts/part_32.o \
parts/part_33.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 709504abe7c..650afa278ee 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -599,7 +599,11 @@ void IgorEngine::partMain() {
case 301:
case 302:
case 303:
- part30(); // college stairs first floor
+ if (_game.version == kIdSpaFloppy) {
+ part30Floppy();
+ } else {
+ part30(); // college stairs first floor
+ }
break;
case 310:
case 311:
diff --git a/engines/igor/parts/part_30_floppy.cpp b/engines/igor/parts/part_30_floppy.cpp
new file mode 100644
index 00000000000..41d8892fbcb
--- /dev/null
+++ b/engines/igor/parts/part_30_floppy.cpp
@@ -0,0 +1,314 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+// Part 30 in the Spanish floppy version was redone for the English release and
+// all subsequent versions.
+
+const int kLauraTalkX = 219;
+const int kLauraTalkY = 69;
+const int kLauraTalkR = 63;
+const int kLauraTalkG = 40;
+const int kLauraTalkB = 31;
+
+const int kLauraFramesTable = 0x9FB0;
+
+const int kUpstairsFirstCell = 67 * 320 + 141;
+const int kUpstairsSecondCell = 67 * 320 + 187;
+const int kDownstairsCell = 107 * 320 + 189;
+
+void IgorEngine::part30FloppyExecuteAction(int action) {
+ switch (action) {
+ case 101:
+ _currentPart = 231;
+ break;
+ case 102:
+ part30FloppyGoUpstairs();
+ break;
+ case 103: // look at upward stairs
+ igorSay(201, 1, 0);
+ break;
+ case 104:
+ part30FloppyGoDownstairs();
+ break;
+ case 105: // look at downward stairs
+ igorSay(202, 1, 0);
+ break;
+ case 106:
+ _currentPart = 210;
+ break;
+ default:
+ error("part30FloppyExecuteAction unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::part30FloppyGoUpstairs() {
+ _roomObjectAreasTable[_screenLayer2[kUpstairsFirstCell]].area = 1;
+ --_walkDataLastIndex;
+ buildWalkPathSimple(124, 120, 141, 67);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _roomObjectAreasTable[_screenLayer2[kUpstairsSecondCell]].area = 1;
+ --_walkDataLastIndex;
+ buildWalkPathSimple(141, 67, 187, 67);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _currentPart = 312;
+}
+
+void IgorEngine::part30FloppyGoDownstairs() {
+ --_walkDataLastIndex;
+ _roomObjectAreasTable[_screenLayer2[kDownstairsCell]].area = 1;
+ buildWalkPathSimple(189, 120, 189, 107);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _walkDataCurrentIndex = 0;
+ for (int i = 9; i >= 0; --i) {
+ if (i == 9) {
+ _walkCurrentFrame = 0;
+ }
+ _walkData[0].setPos(189, 107, 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);
+ }
+ // The room it leads to exists only in the Spanish floppy version and is not ported yet
+ _currentPart = 151;
+}
+
+void IgorEngine::part30FloppyDrawCutsceneFrame(int frame, bool keepTextColors) {
+ const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + kLauraFramesTable + frame * 2) - 1;
+ decodeAnimFrame(src, _screenVGA, keepTextColors);
+}
+
+void IgorEngine::part30FloppyUpdateLauraDialogue(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ part30FloppyDrawCutsceneFrame(33, true);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ part30FloppyDrawCutsceneFrame(getRandomNumber(5) + 33, true);
+ break;
+ case kUpdateDialogueAnimStanding:
+ part30FloppyDrawCutsceneFrame(33, true);
+ break;
+ }
+}
+
+void IgorEngine::part30FloppyHandleLauraDialogue() {
+ loadDialogueData(DLG_CollegeStairsFirstFloor);
+ _updateDialogue = &IgorEngine::part30FloppyUpdateLauraDialogue;
+ handleDialogue(kLauraTalkX, kLauraTalkY, kLauraTalkR, kLauraTalkG, kLauraTalkB, false);
+ _updateDialogue = 0;
+}
+
+void IgorEngine::part30FloppyApplyObjectState(int num) {
+}
+
+void IgorEngine::part30FloppyWalkInFromLeft() {
+ _walkData[0].setPos(0, 134, 2, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ _walkDataCurrentIndex = 1;
+ buildWalkPathSimple(0, 134, 30, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part30FloppyWalkInFromUpstairs() {
+ _roomObjectAreasTable[_screenLayer2[kUpstairsSecondCell]].area = 1;
+ _walkData[0].setPos(187, 67, 4, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataLastIndex = 0;
+ _roomObjectAreasTable[_screenLayer2[kUpstairsFirstCell]].area = 1;
+ buildWalkPathSimple(187, 67, 141, 67);
+ _roomObjectAreasTable[_screenLayer2[kUpstairsSecondCell]].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ --_walkDataLastIndex;
+ buildWalkPathSimple(141, 67, 124, 125);
+ _roomObjectAreasTable[_screenLayer2[kUpstairsFirstCell]].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part30FloppyWalkInFromOutside() {
+ _walkDataCurrentIndex = 0;
+ _walkCurrentFrame = 1;
+ _walkCurrentPos = 3;
+ for (int i = 0; i <= 9; ++i) {
+ if (i == 9) {
+ _walkCurrentFrame = 0;
+ }
+ _walkData[0].setPos(189, 107, 3, _walkCurrentFrame);
+ WalkData::setNextFrame(3, _walkCurrentFrame);
+ _walkData[0].setDefaultScale();
+ _walkData[0].dyPos = 3;
+ _walkData[0].scaleWidth = i * 3 + 23;
+ moveIgor(_walkData[0].posNum, _walkData[0].frameNum);
+ waitForTimer(15);
+ }
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ _roomObjectAreasTable[_screenLayer2[kDownstairsCell]].area = 1;
+ --_walkDataLastIndex;
+ buildWalkPathSimple(189, 107, 189, 125);
+ _roomObjectAreasTable[_screenLayer2[kDownstairsCell]].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part30FloppyWalkInFromRight() {
+ _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::part30FloppyLauraAndIgorBumpIntoEachOther() {
+ // they both walk in
+ for (int i = 1; i <= 17; ++i) {
+ part30FloppyDrawCutsceneFrame(i, true);
+ waitForTimer(26);
+ }
+ static const int frames[] = { 18, 25, 19, 26, 20, 27, 21, 28, 22, 29, 23, 30, 24, 31 };
+ for (int i = 0; i < ARRAYSIZE(frames); ++i) {
+ part30FloppyDrawCutsceneFrame(frames[i], true);
+ waitForTimer(14);
+ }
+}
+
+void IgorEngine::part30FloppyIgorCrossesArms() {
+ part30FloppyDrawCutsceneFrame(32, true);
+ for (int i = 1; i <= 32; ++i) {
+ part30FloppyDrawCutsceneFrame(i, false);
+ }
+}
+
+void IgorEngine::part30FloppyLauraLeaves() {
+ for (int i = 39; i <= 52; ++i) {
+ part30FloppyDrawCutsceneFrame(i, true);
+ if (i >= 43 && i <= 50) {
+ waitForTimer(41);
+ } else {
+ waitForTimer(26);
+ }
+ }
+}
+
+void IgorEngine::part30FloppyLauraCutscene() {
+ // The cutscene does not select any music, the current music keeps playing
+ memset(_screenVGA + 46080, 0, 17920);
+ fadeIn(768);
+ part30FloppyLauraAndIgorBumpIntoEachOther();
+ _walkData[0].setPos(190, 119, 2, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ igorSayAndWait({ { 203, 1, 0 }, { 204, 1, 0 }, { 205, 1, 0 } });
+ _updateDialogue = &IgorEngine::part30FloppyUpdateLauraDialogue;
+ cutsceneSay(kLauraTalkX, kLauraTalkY, kLauraTalkR, kLauraTalkG, kLauraTalkB, 206, 1, 0);
+ _updateDialogue = 0;
+ part30FloppyIgorCrossesArms();
+ part30FloppyHandleLauraDialogue();
+ if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart)
+ return;
+ igorSayAndWait(207, 1, 0);
+ _updateDialogue = &IgorEngine::part30FloppyUpdateLauraDialogue;
+ cutsceneSay(kLauraTalkX, kLauraTalkY, kLauraTalkR, kLauraTalkG, kLauraTalkB, { { 208, 1, 0 }, { 209, 1, 0 } });
+ _updateDialogue = 0;
+ part30FloppyLauraLeaves();
+ _walkData[0].setPos(179, 120, 3, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataLastIndex = 1;
+ igorSay(210, 1, 0);
+ memset(_screenVGA + 46080, 0, 17920);
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
+ _currentAction.verb = kVerbWalk;
+ _objectsState[kLauraMetAtCollegeStateIndex] = 1;
+ part30FloppyApplyObjectState(255);
+}
+
+void IgorEngine::part30Floppy() {
+ _gameState.enableLight = 1;
+ 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_FLOPPY_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143);
+ partMainSetExecuteAction(1, &IgorEngine::part30FloppyExecuteAction);
+ part30FloppyApplyObjectState(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ if (_objectsState[kLauraMetAtCollegeStateIndex] == 0) {
+ part30FloppyLauraCutscene();
+ } else {
+ fadeIn(768);
+ if (_currentPart == 300) {
+ part30FloppyWalkInFromLeft();
+ } else if (_currentPart == 301) {
+ part30FloppyWalkInFromUpstairs();
+ } else if (_currentPart == 302) {
+ part30FloppyWalkInFromOutside();
+ } else if (_currentPart == 303) {
+ part30FloppyWalkInFromRight();
+ }
+ }
+ }
+ enterPartLoop();
+ while (_currentPart >= 300 && _currentPart <= 303 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/static_room.cpp b/engines/igor/static_room.cpp
index 9e5a5bb5a67..737695f94a4 100644
--- a/engines/igor/static_room.cpp
+++ b/engines/igor/static_room.cpp
@@ -249,6 +249,23 @@ const RoomDataOffsets IgorEngine::PART_30_ROOM_DATA_OFFSETS = {
}
};
+const RoomDataOffsets IgorEngine::PART_30_FLOPPY_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 3, 12 },
+ { 15, 187, 3063, 79, 155, 80 },
+ {
+ -90,
+ 9,
+ 1489,
+ 11,
+ 30,
+ 90,
+ 2711,
+ 2729,
+ 11
+ }
+};
+
const RoomDataOffsets IgorEngine::PART_31_ROOM_DATA_OFFSETS = {
{ 45, 3, 6, 2 },
{ 79, 96 },
Commit: 15c2bea46c26c134b024aa708e66836a13480bab
https://github.com/scummvm/scummvm/commit/15c2bea46c26c134b024aa708e66836a13480bab
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:10+01:00
Commit Message:
IGOR: Implement room 21 for Spanish floppy
Changed paths:
A engines/igor/parts/part_21_floppy.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 2255c60043e..c5315781339 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1097,6 +1097,27 @@ private:
void part21MargaretTakesNote();
void part21SetMargaretBackgroundFrame(int frame);
void part21();
+ void part21Floppy();
+ void part21FloppyExecuteAction(int action);
+ void part21FloppyLeaveLeft();
+ void part21FloppyLeaveRight();
+ void part21FloppyTalkToMargaret();
+ void part21FloppyOpenPhysicsDoor();
+ void part21FloppyClosePhysicsDoor();
+ void part21FloppyUseNoteWithSandwiches();
+ void part21FloppyEnterPhysicsClass();
+ void part21FloppyUpdateBackground();
+ void part21FloppyUpdateMargaretDialogue(int action);
+ void part21FloppyUpdateMargaretNoteDialogue(int action);
+ void part21FloppyHandleMargaretDialogue();
+ void part21FloppyApplyObjectState(int num);
+ void part21FloppyEnterFromLeft();
+ void part21FloppyEnterFromRight();
+ void part21FloppyEnterFromPhysicsClass();
+ void part21FloppyDrawMargaretFrameComposited(int frame);
+ void part21FloppyDrawMargaretHead(int frame);
+ void part21FloppyDrawMargaretNoteHead(int frame);
+ void part21FloppyMargaretTakesNote();
// church bell tower
void part22ExecuteAction(int action);
@@ -1793,6 +1814,7 @@ protected:
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_21_FLOPPY_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;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 9de0ef069f5..da08514a1e5 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -40,6 +40,7 @@ MODULE_OBJS = \
parts/part_18.o \
parts/part_19.o \
parts/part_21.o \
+ parts/part_21_floppy.o \
parts/part_22.o \
parts/part_23.o \
parts/part_24.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 650afa278ee..943e64e034c 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -562,7 +562,11 @@ void IgorEngine::partMain() {
case 210:
case 211:
case 212:
- part21(); //college corridor margaret
+ if (_game.version == kIdSpaFloppy) {
+ part21Floppy();
+ } else {
+ part21(); //college corridor margaret
+ }
break;
case 220:
case 221:
diff --git a/engines/igor/parts/part_21_floppy.cpp b/engines/igor/parts/part_21_floppy.cpp
new file mode 100644
index 00000000000..408ee5ea541
--- /dev/null
+++ b/engines/igor/parts/part_21_floppy.cpp
@@ -0,0 +1,420 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+// Part 21 (college corridor with Margaret) as in the Spanish floppy version.
+
+const int kMargaretTalkX = 81;
+const int kMargaretTalkY = 76;
+const int kMargaretTalkR = 38;
+const int kMargaretTalkG = 48;
+const int kMargaretTalkB = 59;
+
+const int kMargaretBodyOffset = 25990;
+const int kMargaretAnimOffset = 25029;
+const int kMargaretHeadOffset = 25675;
+const int kMargaretNoteOffset = 25670;
+const int kPhysicsDoorOffset = 18409;
+const int kPhysicsDoorAnimOffset = 18724;
+const int kWritingOffset = 24751;
+
+const int kMargaretBodyFrame = 0x4ECD;
+const int kMargaretFrames = 0x20B3;
+const int kMargaretHeadFrames = 0x7DEF;
+const int kMargaretNoteFrames = 0x51A9;
+const int kMargaretNoteHeadFrames = 0x6FA5;
+const int kPhysicsDoorOpenFrame = 0x6CC;
+const int kPhysicsDoorAnimFrames = 0x59A;
+const int kWritingFrames = 0x3B1D;
+
+// Frames of the last part of the sandwiches action
+const uint8 kWritingEndFrames[5] = { 0, 1, 2, 6, 1 };
+const int kPhysicsDoorCell = 114 * 320 + 181;
+
+bool IN_ACTION_111;
+
+void IgorEngine::part21FloppyExecuteAction(int action) {
+ switch (action) {
+ case 101:
+ part21FloppyLeaveLeft();
+ break;
+ case 102:
+ part21FloppyTalkToMargaret();
+ break;
+ case 103: // Look at margaret
+ igorSay(201, 1, 0);
+ break;
+ case 104: // take sandwiches
+ igorSay(202, 1, 0);
+ break;
+ case 105: // look at sandwiches
+ igorSay(203, 1, 0);
+ break;
+ case 106: // look at physics door
+ igorSay(204, 1, 0);
+ break;
+ case 107:
+ part21FloppyOpenPhysicsDoor();
+ break;
+ case 108:
+ part21FloppyClosePhysicsDoor();
+ break;
+ case 109: // look at plaque
+ igorSay(205, 1, 0);
+ break;
+ case 110:
+ part21FloppyLeaveRight();
+ break;
+ case 111:
+ part21FloppyUseNoteWithSandwiches();
+ break;
+ case 112: // give anything to Margaret
+ igorSay(222, 1, 0);
+ break;
+ case 113:
+ part21FloppyEnterPhysicsClass();
+ break;
+ default:
+ error("part21FloppyExecuteAction unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::part21FloppyLeaveLeft() {
+ if (_objectsState[kMargaretStateIndex] == 1) {
+ const int offset = 26880;
+ copyArea(_screenVGA, offset, 320, _screenLayer1 + offset, 320, 20, 51);
+ part21FloppyMargaretTakesNote();
+ }
+ _currentPart = 303;
+}
+
+void IgorEngine::part21FloppyLeaveRight() {
+ if (_objectsState[kMargaretStateIndex] == 1) {
+ const int offset = 27180;
+ copyArea(_screenVGA, offset, 320, _screenLayer1 + offset, 320, 20, 51);
+ part21FloppyMargaretTakesNote();
+ }
+ _currentPart = 270;
+}
+
+void IgorEngine::part21FloppyTalkToMargaret() {
+ part21FloppyDrawMargaretFrameComposited(1);
+ part21FloppyDrawMargaretHead(1);
+ igorSayAndWait(226, 1, 0);
+ cutsceneSayStart(kMargaretTalkX, kMargaretTalkY, kMargaretTalkR, kMargaretTalkG, kMargaretTalkB, 227, 1, 0);
+ _updateDialogue = &IgorEngine::part21FloppyUpdateMargaretDialogue;
+ // The cutscene dialogue wait does not run Margaret's idle animation
+ _updateRoomBackground = 0;
+ waitForEndOfCutsceneDialogue(kMargaretTalkX, kMargaretTalkY, kMargaretTalkR, kMargaretTalkG, kMargaretTalkB);
+ _updateRoomBackground = &IgorEngine::part21FloppyUpdateBackground;
+ _updateDialogue = 0;
+ part21FloppyHandleMargaretDialogue();
+ part21FloppyApplyObjectState(255);
+}
+
+void IgorEngine::part21FloppyOpenPhysicsDoor() {
+ if (_objectsState[kPhysicsClassDoorStateIndex] == 1) {
+ partMainExecuteAction(11);
+ return;
+ }
+ for (int i = 2; i <= 3; ++i) {
+ drawAnimRect(kPhysicsDoorAnimOffset, kPhysicsDoorAnimFrames + i * 0x7FE, 33, 62);
+ if (i == 3) {
+ playSound(13, 1);
+ }
+ waitForTimer(127);
+ }
+ _objectsState[kPhysicsClassDoorStateIndex] = 1;
+ part21FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part21FloppyClosePhysicsDoor() {
+ if (_objectsState[kPhysicsClassDoorStateIndex] == 0) {
+ partMainExecuteAction(14);
+ return;
+ }
+ for (int i = 2; i >= 1; --i) {
+ drawAnimRect(kPhysicsDoorAnimOffset, kPhysicsDoorAnimFrames + i * 0x7FE, 33, 62);
+ if (i == 2) {
+ playSound(14, 1);
+ }
+ waitForTimer(127);
+ }
+ _objectsState[kPhysicsClassDoorStateIndex] = 0;
+ part21FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part21FloppyUseNoteWithSandwiches() {
+ if (_inventoryInfo[65] == 0) {
+ igorSay({ { 223, 2, 0 }, { 225, 1, 0 } });
+ return;
+ }
+ IN_ACTION_111 = true;
+ igorSay({ { 208, 1, 0 }, { 209, 1, 0 } });
+ // Igor's talking head is not animated here
+ waitForEndOfIgorDialogue(false);
+ IN_ACTION_111 = false;
+ int k = 1;
+ do {
+ if (compareGameTick(61) && k <= 4) {
+ drawAnimRect(kWritingOffset, kWritingFrames + kWritingEndFrames[k] * 720, 24, 30);
+ ++k;
+ }
+ part21FloppyUpdateBackground();
+ waitForTimer();
+ } while (k != 5);
+ removeInventoryEntry(56);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
+ _objectsState[kMargaretStateIndex] = 1;
+ part21FloppyApplyObjectState(255);
+ igorSay(210, 2, 0);
+}
+
+void IgorEngine::part21FloppyEnterPhysicsClass() {
+ if (_objectsState[kPhysicsClassDoorStateIndex] == 0) {
+ return;
+ }
+ _roomObjectAreasTable[_screenLayer2[kPhysicsDoorCell]].area = 2;
+ --_walkDataLastIndex;
+ buildWalkPath(176, 119, 181, 114);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ if (_objectsState[kMargaretStateIndex] == 1) {
+ drawAnimRect(kPhysicsDoorOffset, 0, 29, 60);
+ part21FloppyMargaretTakesNote();
+ }
+ _currentPart = 370;
+}
+
+void IgorEngine::part21FloppyUpdateMargaretDialogue(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ part21FloppyDrawMargaretHead(1);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ part21FloppyDrawMargaretHead(getRandomNumber(4) + 1);
+ break;
+ case kUpdateDialogueAnimStanding:
+ part21FloppyDrawMargaretHead(1);
+ break;
+ }
+}
+
+void IgorEngine::part21FloppyUpdateMargaretNoteDialogue(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ part21FloppyDrawMargaretNoteHead(1);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ part21FloppyDrawMargaretNoteHead(getRandomNumber(3) + 2);
+ break;
+ }
+}
+
+void IgorEngine::part21FloppyHandleMargaretDialogue() {
+ loadDialogueData(DLG_CollegeCorridorMargaret);
+ _updateDialogue = &IgorEngine::part21FloppyUpdateMargaretDialogue;
+ handleDialogue(kMargaretTalkX, kMargaretTalkY, kMargaretTalkR, kMargaretTalkG, kMargaretTalkB);
+ _updateDialogue = 0;
+}
+
+void IgorEngine::part21FloppyApplyObjectState(int num) {
+ if (num == 1 || num == 255) {
+ // physics class door
+ if (_objectsState[kPhysicsClassDoorStateIndex] == 0) {
+ copyArea(_screenLayer1, kPhysicsDoorOffset, 320, _animFramesBuffer, 29, 29, 60);
+ _roomActionsTable[32] = 6;
+ } else {
+ copyArea(_screenLayer1, kPhysicsDoorOffset, 320, _animFramesBuffer + kPhysicsDoorOpenFrame, 29, 29, 60);
+ _roomActionsTable[32] = 7;
+ }
+ }
+ if (num == 2 || num == 255) {
+ // is margaret present?
+ if (_objectsState[kMargaretStateIndex] <= 1) {
+ copyArea(_screenLayer1, kMargaretBodyOffset, 320, _animFramesBuffer + kMargaretBodyFrame, 48, 48, 40);
+ }
+ if (_objectsState[kMargaretStateIndex] == 2 || _objectsState[kMargaretStateIndex] == 4) {
+ _roomObjectAreasTable[5].object = 0;
+ _roomObjectAreasTable[6].object = 0;
+ }
+ }
+}
+
+void IgorEngine::part21FloppyEnterFromLeft() {
+ _walkData[0].setPos(0, 134, 2, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 15;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPath(0, 134, 30, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part21FloppyEnterFromRight() {
+ _walkData[0].setPos(319, 134, 4, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPath(319, 134, 289, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part21FloppyEnterFromPhysicsClass() {
+ _walkData[0].setPos(181, 114, 3, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataLastIndex = 0;
+ _roomObjectAreasTable[_screenLayer2[kPhysicsDoorCell]].area = 2;
+ buildWalkPath(181, 114, 181, 125);
+ _roomObjectAreasTable[_screenLayer2[kPhysicsDoorCell]].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part21FloppyDrawMargaretFrameComposited(int frame) {
+ _roomCursorOn = false;
+ drawAnimRect(kMargaretAnimOffset, kMargaretFrames + frame * 0x4DF, 29, 29, true, kBlendBehindIgorAndText);
+ if (_dialogueCursorOn) {
+ _roomCursorOn = true;
+ }
+}
+
+void IgorEngine::part21FloppyDrawMargaretHead(int frame) {
+ drawAnimRect(kMargaretHeadOffset, kMargaretHeadFrames + frame * 0xB6, 14, 13);
+}
+
+void IgorEngine::part21FloppyDrawMargaretNoteHead(int frame) {
+ drawAnimRect(kMargaretNoteOffset, kMargaretNoteHeadFrames + frame * 0x280, 32, 20);
+}
+
+void IgorEngine::part21FloppyMargaretTakesNote() {
+ part21FloppyDrawMargaretFrameComposited(1);
+ memset(_screenVGA + 46080, 0, 17920);
+ drawAnimRect(kMargaretBodyOffset, kMargaretBodyFrame, 48, 40);
+ waitForTimer(121);
+ for (int i = 1; i <= 6; ++i) {
+ drawAnimRect(kMargaretNoteOffset, kMargaretNoteFrames + i * 0x4A4, 44, 27);
+ if (i < 6) {
+ waitForTimer(121);
+ }
+ }
+ cutsceneSayStart(kMargaretTalkX, kMargaretTalkY, kMargaretTalkR, kMargaretTalkG, kMargaretTalkB,
+ { { 212, 1, 0 }, { 213, 1, 0 }, { 214, 1, 0 }, { 215, 2, 0 }, { 217, 2, 0 } });
+ _updateDialogue = &IgorEngine::part21FloppyUpdateMargaretNoteDialogue;
+ _updateRoomBackground = 0;
+ waitForEndOfCutsceneDialogue(kMargaretTalkX, kMargaretTalkY, kMargaretTalkR, kMargaretTalkG, kMargaretTalkB);
+ _updateRoomBackground = &IgorEngine::part21FloppyUpdateBackground;
+ _updateDialogue = 0;
+ cutsceneSayStart(kMargaretTalkX, kMargaretTalkY, kMargaretTalkR, kMargaretTalkG, kMargaretTalkB,
+ { { 219, 1, 0 }, { 220, 1, 0 }, { 221, 1, 0 } });
+ _updateDialogue = &IgorEngine::part21FloppyUpdateMargaretNoteDialogue;
+ _updateRoomBackground = 0;
+ waitForEndOfCutsceneDialogue(kMargaretTalkX, kMargaretTalkY, kMargaretTalkR, kMargaretTalkG, kMargaretTalkB);
+ _updateRoomBackground = &IgorEngine::part21FloppyUpdateBackground;
+ _updateDialogue = 0;
+ _objectsState[kMargaretStateIndex] = 2;
+ drawVerbsPanel();
+ _currentAction.verb = kVerbWalk;
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
+ part21FloppyApplyObjectState(255);
+ _objectsState[kMargaretSceneStateIndex] = 1;
+}
+
+void IgorEngine::part21FloppyUpdateBackground() {
+ if (IN_ACTION_111 && compareGameTick(61)) {
+ const int i = getRandomNumber(2) + 3;
+ drawAnimRect(kWritingOffset, kWritingFrames + i * 720, 24, 30);
+ }
+ if (compareGameTick(61) && _objectsState[kMargaretStateIndex] <= 1) {
+ if (_gameState.unk10 > 2) {
+ part21FloppyDrawMargaretFrameComposited(_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 {
+ part21FloppyDrawMargaretFrameComposited(_gameState.unk10);
+ ++_gameState.unk10;
+ if (_gameState.unk10 == 3 && getRandomNumber(5) != 0) {
+ _gameState.unk10 = 1;
+ }
+ }
+ }
+}
+
+void IgorEngine::part21Floppy() {
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_CollegeCorridorMargaret, IMG_CollegeCorridorMargaret, BOX_CollegeCorridorMargaret, MSK_CollegeCorridorMargaret, TXT_CollegeCorridorMargaret);
+ static const int anm[] = {
+ FRM_CollegeCorridorMargaretFloppy1, FRM_CollegeCorridorMargaretFloppy2,
+ FRM_CollegeCorridorMargaretFloppy3, FRM_CollegeCorridorMargaretFloppy4,
+ FRM_CollegeCorridorMargaretFloppy5, FRM_CollegeCorridorMargaretFloppy6,
+ FRM_CollegeCorridorMargaretFloppy7, FRM_CollegeCorridorMargaretFloppy8, 0
+ };
+ loadAnimData(anm);
+ loadActionData(DAT_CollegeCorridorMargaret);
+ _roomDataOffsets = PART_21_FLOPPY_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 248, 143);
+ partMainSetExecuteAction(1, &IgorEngine::part21FloppyExecuteAction);
+ _updateRoomBackground = &IgorEngine::part21FloppyUpdateBackground;
+ part21FloppyApplyObjectState(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ if (!restoreRoomAfterLoad()) {
+ _gameState.unk10 = 1;
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 210) {
+ part21FloppyEnterFromLeft();
+ } else if (_currentPart == 211) {
+ part21FloppyEnterFromRight();
+ } else if (_currentPart == 212) {
+ part21FloppyEnterFromPhysicsClass();
+ }
+ }
+ enterPartLoop();
+ while (_currentPart >= 210 && _currentPart <= 212 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 55b831b7bfc..67d85cd0f92 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -872,4 +872,15 @@
#define DAT_FloppySentenceColors 1246
#define IMG_FloppyTitleBackdrop 1249
+// Margaret's frames are more in the Spanish Floppy version so we
+// need new ids
+#define FRM_CollegeCorridorMargaretFloppy1 1259
+#define FRM_CollegeCorridorMargaretFloppy2 1260
+#define FRM_CollegeCorridorMargaretFloppy3 1261
+#define FRM_CollegeCorridorMargaretFloppy4 1262
+#define FRM_CollegeCorridorMargaretFloppy5 1263
+#define FRM_CollegeCorridorMargaretFloppy6 1264
+#define FRM_CollegeCorridorMargaretFloppy7 1265
+#define FRM_CollegeCorridorMargaretFloppy8 1266
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_room.cpp b/engines/igor/static_room.cpp
index 737695f94a4..ae4adcae829 100644
--- a/engines/igor/static_room.cpp
+++ b/engines/igor/static_room.cpp
@@ -183,6 +183,13 @@ const RoomDataOffsets IgorEngine::PART_21_ROOM_DATA_OFFSETS = {
{ -85, 10, 1658, 50, 30, 90, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_21_FLOPPY_ROOM_DATA_OFFSETS = {
+ { 20, 2, 2, 1 },
+ { 33, 46 },
+ { 51, 259, 3275, 155, 231, 84 },
+ { -85, 10, 1658, 50, 30, 90, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_22_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 },
{ 1, 6 },
Commit: 1b00c90bb7fb2ad0be0eeb9e36b368419f56df1b
https://github.com/scummvm/scummvm/commit/1b00c90bb7fb2ad0be0eeb9e36b368419f56df1b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:10+01:00
Commit Message:
IGOR: Use small font for dialogue options
Changed paths:
engines/igor/text.cpp
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 8da7e6be23f..51e5996bbde 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -572,7 +572,7 @@ void IgorEngine::drawDialogueChoices() {
int num = _gameState.dialogueData[offset + 3] - 1;
char questionText[128];
snprintf(questionText, sizeof(questionText), "@%s %s", _dialogueQuestions[num][0], _dialogueQuestions[num][1]);
- _dialogueFont->drawString(_screenVGA, questionText, 0, _dialogueInfo[0] * 11 + 135, 240, 0, 0);
+ _sentenceFont->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]);
}
Commit: c1847d8250d10160aadde717a8355b1bfadb5b7a
https://github.com/scummvm/scummvm/commit/c1847d8250d10160aadde717a8355b1bfadb5b7a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:11+01:00
Commit Message:
IGOR: Implemented part 15 for Spanish floppy
Changed paths:
A engines/igor/parts/part_15_floppy.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_17.cpp
engines/igor/static_room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index c5315781339..785be674b10 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1010,6 +1010,18 @@ private:
void part15DrawTobiasTalking(int frame);
void part15DrawTobiasIdleFrame(int frame);
void part15();
+ void part15Floppy();
+ void part15FloppyExecuteAction(int action);
+ void part15FloppyLeaveToStreet();
+ void part15FloppyGoUpstairs();
+ void part15FloppyGiveProjectToTobias();
+ void part15FloppyGiveMoneyToTobias();
+ void part15FloppyHandOver();
+ void part15FloppyUpdateBackground();
+ void part15FloppyApplyObjectState(int num);
+ void part15FloppyEnterFromStreet();
+ void part15FloppyEnterFromStairs();
+ void part15FloppyDrawFigure(int figure, int frame);
// laboratory
void part16ExecuteAction(int action);
@@ -1809,6 +1821,7 @@ protected:
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_15_FLOPPY_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;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index da08514a1e5..a5e9d3da126 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -35,6 +35,7 @@ MODULE_OBJS = \
parts/part_13.o \
parts/part_14.o \
parts/part_15.o \
+ parts/part_15_floppy.o \
parts/part_16.o \
parts/part_17.o \
parts/part_18.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 943e64e034c..48287b6ec2f 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -542,7 +542,17 @@ void IgorEngine::partMain() {
part14();
break;
case 150:
- part15();
+ if (_game.version == kIdSpaFloppy) {
+ part15Floppy();
+ } else {
+ part15();
+ }
+ break;
+ case 151: // exists only in the Spanish floppy version
+ if (_game.version != kIdSpaFloppy) {
+ error("partMain() Unhandled part %d", _currentPart);
+ }
+ part15Floppy();
break;
case 160:
part16();
diff --git a/engines/igor/parts/part_15_floppy.cpp b/engines/igor/parts/part_15_floppy.cpp
new file mode 100644
index 00000000000..e059f391e1d
--- /dev/null
+++ b/engines/igor/parts/part_15_floppy.cpp
@@ -0,0 +1,298 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+// Part 15 (the porter Tobias Jennings) as in the Spanish floppy version.
+namespace {
+
+// Tobias' text position and color (palette entry 192 of the room palette)
+const int kTobiasTalkX = 50;
+const int kTobiasTalkY = 85;
+const int kTobiasTalkR = 53;
+const int kTobiasTalkG = 31;
+const int kTobiasTalkB = 23;
+
+// Area cell of the street door
+const int kStreetDoorCell = 97 * 320 + 309;
+
+// Where the hand-over frames are drawn
+const int kHandOverOffset = 29808;
+
+} // End of anonymous namespace
+
+void IgorEngine::part15FloppyExecuteAction(int action) {
+ switch (action) {
+ case 101: // talk to Tobias
+ igorSay(207, 1, 0);
+ break;
+ case 102: // look at Tobias
+ igorSay({ { 201, 1, 0 }, { 202, 2, 0 } });
+ break;
+ case 103: // look at the lodge door
+ igorSay(204, 2, 0);
+ break;
+ case 104: // look at the crest
+ igorSay(206, 1, 0);
+ break;
+ case 105:
+ part15FloppyLeaveToStreet();
+ break;
+ case 106: // look at the street door
+ igorSay(208, 1, 0);
+ break;
+ case 107:
+ part15FloppyGoUpstairs();
+ break;
+ case 108:
+ part15FloppyGiveProjectToTobias();
+ break;
+ case 109:
+ part15FloppyGiveMoneyToTobias();
+ break;
+ default:
+ error("part15FloppyExecuteAction unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::part15FloppyLeaveToStreet() {
+ --_walkDataLastIndex;
+ _roomObjectAreasTable[_screenLayer2[kStreetDoorCell]].area = 1;
+ buildWalkPathSimple(309, 105, 309, 97);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _walkDataCurrentIndex = 0;
+ _walkCurrentFrame = 1;
+ for (int i = 9; i >= 0; --i) {
+ if (i == 9) {
+ _walkCurrentFrame = 0;
+ }
+ _walkData[0].setPos(309, 97, 1, _walkCurrentFrame);
+ WalkData::setNextFrame(1, _walkCurrentFrame);
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 15;
+ _walkData[0].scaleWidth = i + 16;
+ _walkData[0].xPosChanged = 1;
+ _walkData[0].dxPos = 0;
+ _walkData[0].yPosChanged = 1;
+ _walkData[0].dyPos = 3;
+ _walkData[0].scaleHeight = 25;
+ moveIgor(_walkData[0].posNum, _walkData[0].frameNum);
+ waitForTimer(15);
+ }
+ _currentPart = (_objectsState[kExamCompletedStateIndex] == 0) ? 171 : 771;
+}
+
+void IgorEngine::part15FloppyGoUpstairs() {
+ _walkDataCurrentIndex = 0;
+ _walkCurrentFrame = 1;
+ for (int i = 9; i >= 0; --i) {
+ if (i == 9) {
+ _walkCurrentFrame = 0;
+ }
+ _walkData[0].setPos(230, 143, 3, _walkCurrentFrame);
+ WalkData::setNextFrame(3, _walkCurrentFrame);
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 15;
+ _walkData[0].scaleWidth = i * 2 + 7;
+ _walkData[0].xPosChanged = 1;
+ _walkData[0].dxPos = 0;
+ _walkData[0].yPosChanged = 1;
+ _walkData[0].dyPos = 3;
+ _walkData[0].scaleHeight = 25;
+ moveIgor(_walkData[0].posNum, _walkData[0].frameNum);
+ waitForTimer(15);
+ }
+ _currentPart = 302;
+}
+
+void IgorEngine::part15FloppyHandOver() {
+ for (int i = 1; i >= 0; --i) {
+ drawAnimRect(kHandOverOffset, i * 0x168, 15, 24);
+ waitForTimer(127);
+ }
+}
+
+void IgorEngine::part15FloppyGiveProjectToTobias() {
+ igorSayAndWait({ { 209, 1, 0 }, { 210, 1, 0 } });
+ cutsceneSay(kTobiasTalkX, kTobiasTalkY, kTobiasTalkR, kTobiasTalkG, kTobiasTalkB, 212, 1, 0);
+ igorSayAndWait(213, 1, 0);
+ if (_objectsState[kPersonalFileChangedStateIndex] == 0) {
+ cutsceneSay(kTobiasTalkX, kTobiasTalkY, kTobiasTalkR, kTobiasTalkG, kTobiasTalkB,
+ { { 214, 1, 0 }, { 215, 2, 0 }, { 217, 1, 0 } });
+ return;
+ }
+ cutsceneSay(kTobiasTalkX, kTobiasTalkY, kTobiasTalkR, kTobiasTalkG, kTobiasTalkB,
+ { { 214, 1, 0 }, { 218, 2, 0 }, { 220, 1, 0 } });
+ part15FloppyHandOver();
+ removeInventoryEntry(70);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
+ _objectsState[kProjectHandedToTobiasStateIndex] = 1;
+ if (_objectsState[kMoneyHandedToTobiasStateIndex] == 0) {
+ cutsceneSay(kTobiasTalkX, kTobiasTalkY, kTobiasTalkR, kTobiasTalkG, kTobiasTalkB, 221, 2, 0);
+ return;
+ }
+ cutsceneSay(kTobiasTalkX, kTobiasTalkY, kTobiasTalkR, kTobiasTalkG, kTobiasTalkB, 226, 2, 0);
+ igorSayAndWait(228, 1, 0);
+ cutsceneSay(kTobiasTalkX, kTobiasTalkY, kTobiasTalkR, kTobiasTalkG, kTobiasTalkB, 229, 1, 0);
+ igorSayAndWait(230, 1, 0);
+ _currentPart = 780;
+}
+
+void IgorEngine::part15FloppyGiveMoneyToTobias() {
+ igorSayAndWait({ { 209, 1, 0 }, { 211, 1, 0 } });
+ cutsceneSay(kTobiasTalkX, kTobiasTalkY, kTobiasTalkR, kTobiasTalkG, kTobiasTalkB, 212, 1, 0);
+ igorSayAndWait(213, 1, 0);
+ if (_objectsState[kPersonalFileChangedStateIndex] == 0) {
+ cutsceneSay(kTobiasTalkX, kTobiasTalkY, kTobiasTalkR, kTobiasTalkG, kTobiasTalkB,
+ { { 214, 1, 0 }, { 215, 2, 0 }, { 217, 1, 0 } });
+ return;
+ }
+ cutsceneSay(kTobiasTalkX, kTobiasTalkY, kTobiasTalkR, kTobiasTalkG, kTobiasTalkB,
+ { { 214, 1, 0 }, { 218, 2, 0 }, { 223, 1, 0 } });
+ part15FloppyHandOver();
+ removeInventoryEntry(60);
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
+ _objectsState[kMoneyHandedToTobiasStateIndex] = 1;
+ if (_objectsState[kProjectHandedToTobiasStateIndex] == 0) {
+ cutsceneSay(kTobiasTalkX, kTobiasTalkY, kTobiasTalkR, kTobiasTalkG, kTobiasTalkB, 224, 2, 0);
+ return;
+ }
+ cutsceneSay(kTobiasTalkX, kTobiasTalkY, kTobiasTalkR, kTobiasTalkG, kTobiasTalkB, 226, 2, 0);
+ igorSayAndWait(228, 1, 0);
+ cutsceneSay(kTobiasTalkX, kTobiasTalkY, kTobiasTalkR, kTobiasTalkG, kTobiasTalkB, 229, 1, 0);
+ igorSayAndWait(230, 1, 0);
+ _currentPart = 780;
+}
+
+void IgorEngine::part15FloppyDrawFigure(int figure, int frame) {
+ _roomCursorOn = false;
+ switch (figure) {
+ case 1:
+ drawAnimRect(24510, 0x2D0 + frame * 0x380, 32, 28, true, kBlendBehindIgorAndText);
+ break;
+ case 2:
+ drawAnimRect(23124, 0x10D0 + frame * 0x201, 19, 27, true, kBlendBehindIgorAndText);
+ break;
+ case 3:
+ drawAnimRect(23799, 0x18D4 + frame * 0x396, 34, 27, true, kBlendBehindIgorAndText);
+ break;
+ }
+ if (_dialogueCursorOn) {
+ _roomCursorOn = true;
+ }
+}
+
+void IgorEngine::part15FloppyUpdateBackground() {
+ if (compareGameTick(61) && _gameState.unk10 >= 1 && _gameState.unk10 <= 3) {
+ part15FloppyDrawFigure(_gameState.unk10, getRandomNumber(3));
+ }
+}
+
+void IgorEngine::part15FloppyApplyObjectState(int num) {
+}
+
+void IgorEngine::part15FloppyEnterFromStreet() {
+ playMusic(3, true);
+ _walkData[0].setPos(309, 97, 3, 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[kStreetDoorCell]].area = 1;
+ buildWalkPathSimple(309, 97, 309, 105);
+ _roomObjectAreasTable[_screenLayer2[kStreetDoorCell]].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part15FloppyEnterFromStairs() {
+ _walkDataCurrentIndex = 0;
+ _walkCurrentFrame = 1;
+ for (int i = 0; i <= 9; ++i) {
+ if (i == 9) {
+ _walkCurrentFrame = 0;
+ }
+ _walkData[0].setPos(230, 143, 1, _walkCurrentFrame);
+ WalkData::setNextFrame(1, _walkCurrentFrame);
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 15;
+ _walkData[0].scaleWidth = i * 2 + 7;
+ _walkData[0].xPosChanged = 1;
+ _walkData[0].dxPos = 0;
+ _walkData[0].yPosChanged = 1;
+ _walkData[0].dyPos = 3;
+ _walkData[0].scaleHeight = 25;
+ moveIgor(_walkData[0].posNum, _walkData[0].frameNum);
+ waitForTimer(15);
+ }
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+}
+
+void IgorEngine::part15Floppy() {
+ _gameState.enableLight = 1;
+ 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_FLOPPY_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143);
+ partMainSetExecuteAction(1, &IgorEngine::part15FloppyExecuteAction);
+ _updateRoomBackground = &IgorEngine::part15FloppyUpdateBackground;
+ part15FloppyApplyObjectState(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ // One of three figures in the hall, or none, drawn in its first frame
+ _gameState.unk10 = (getRandomNumber(9) + 2) / 3;
+ if (_gameState.unk10 != 0) {
+ part15FloppyDrawFigure(_gameState.unk10, 0);
+ }
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 150) {
+ part15FloppyEnterFromStreet();
+ } else {
+ part15FloppyEnterFromStairs();
+ }
+ }
+ enterPartLoop();
+ while ((_currentPart == 150 || _currentPart == 151) && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 64c4e5fd879..8cabe713022 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -67,7 +67,8 @@ void IgorEngine::part17WalkIn(bool lateGame) {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove(tick);
- _currentPart = 302;
+ // The Spanish floppy college entrance leads to the hall, not to the stairs
+ _currentPart = (_game.version == kIdSpaFloppy) ? 150 : 302;
}
void IgorEngine::part17TalkToPhilipAndJimmy() {
diff --git a/engines/igor/static_room.cpp b/engines/igor/static_room.cpp
index ae4adcae829..30e4f28ca1e 100644
--- a/engines/igor/static_room.cpp
+++ b/engines/igor/static_room.cpp
@@ -148,6 +148,14 @@ const RoomDataOffsets IgorEngine::PART_15_ROOM_DATA_OFFSETS = {
{ 45, 22, 3756, 66, 60, 180, 10588, 10632, 66 }
};
+// The Spanish floppy room has no dialogue data (Tobias isnt a character)
+const RoomDataOffsets IgorEngine::PART_15_FLOPPY_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 4, 15 },
+ { 19, 209, 3155, 103, 179, 82 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_16_ROOM_DATA_OFFSETS = {
{ 20, 2, 2, 1 },
{ 29, 34 },
Commit: 822a854ca7dfdf4ddadc71423edd6d6008e6d2e7
https://github.com/scummvm/scummvm/commit/822a854ca7dfdf4ddadc71423edd6d6008e6d2e7
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:11+01:00
Commit Message:
IGOR: Implement Spanish Floppy room 31
Changed paths:
A engines/igor/parts/part_31_floppy.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_15_floppy.cpp
engines/igor/resource_ids.h
engines/igor/static_room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 785be674b10..e7309d8785a 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1277,6 +1277,18 @@ private:
void part31EnterFromRight();
void part31DrawOpenDoor();
void part31();
+ void part31Floppy();
+ void part31FloppyExecuteAction(int action);
+ void part31FloppyEnterAstronomyLab();
+ void part31FloppyOpenDoor();
+ void part31FloppyGoDownstairs();
+ void part31FloppyUseKeysWithDoor();
+ void part31FloppyApplyObjectState(int num);
+ void part31FloppyEnterFromLeft();
+ void part31FloppyEnterFromAstronomyLab();
+ void part31FloppyEnterFromDownstairs();
+ void part31FloppyEnterFromRight();
+ void part31FloppyDrawDoorFrame(int frame);
// telescope room
void part32ExecuteAction(int action);
@@ -1838,6 +1850,7 @@ protected:
static const RoomDataOffsets PART_30_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_30_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_31_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_31_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_32_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_33_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_34_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index a5e9d3da126..c6fbcd8227d 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -52,6 +52,7 @@ MODULE_OBJS = \
parts/part_30.o \
parts/part_30_floppy.o \
parts/part_31.o \
+ parts/part_31_floppy.o \
parts/part_32.o \
parts/part_33.o \
parts/part_34.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 48287b6ec2f..c056b794ae9 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -623,7 +623,11 @@ void IgorEngine::partMain() {
case 311:
case 312:
case 313:
- part31();
+ if (_game.version == kIdSpaFloppy) {
+ part31Floppy();
+ } else {
+ part31();
+ }
break;
case 320:
part32(); // telescope room
diff --git a/engines/igor/parts/part_15_floppy.cpp b/engines/igor/parts/part_15_floppy.cpp
index e059f391e1d..7be30f593e1 100644
--- a/engines/igor/parts/part_15_floppy.cpp
+++ b/engines/igor/parts/part_15_floppy.cpp
@@ -24,23 +24,17 @@
namespace Igor {
// Part 15 (the porter Tobias Jennings) as in the Spanish floppy version.
-namespace {
-// Tobias' text position and color (palette entry 192 of the room palette)
const int kTobiasTalkX = 50;
const int kTobiasTalkY = 85;
const int kTobiasTalkR = 53;
const int kTobiasTalkG = 31;
const int kTobiasTalkB = 23;
-// Area cell of the street door
const int kStreetDoorCell = 97 * 320 + 309;
-// Where the hand-over frames are drawn
const int kHandOverOffset = 29808;
-} // End of anonymous namespace
-
void IgorEngine::part15FloppyExecuteAction(int action) {
switch (action) {
case 101: // talk to Tobias
diff --git a/engines/igor/parts/part_31_floppy.cpp b/engines/igor/parts/part_31_floppy.cpp
new file mode 100644
index 00000000000..f11abbbb2ab
--- /dev/null
+++ b/engines/igor/parts/part_31_floppy.cpp
@@ -0,0 +1,277 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+const int kDoorFramesBase = 0xFE5E;
+
+const int kDoorAnimOffset = 16754;
+const int kOpenDoorOffset = 16758;
+
+const uint8 kOpenDoorFrames[7] = { 2, 3, 2, 3, 2, 3, 1 };
+const uint8 kKeysDoorFrames[10] = { 2, 3, 2, 3, 2, 3, 2, 3, 4, 5 };
+
+const int kAstronomyLabCell = 75 * 320 + 135;
+const int kDownstairsCell = 107 * 320 + 190;
+
+void IgorEngine::part31FloppyExecuteAction(int action) {
+ switch (action) {
+ case 101:
+ _currentPart = 251;
+ break;
+ case 102:
+ part31FloppyEnterAstronomyLab();
+ break;
+ case 103:
+ part31FloppyOpenDoor();
+ break;
+ case 104: // close door
+ if (_objectsState[kAstronomyLabDoorStateIndex] == 0) {
+ partMainExecuteAction(14);
+ } else {
+ igorSay(205, 1, 0);
+ }
+ break;
+ case 105: // look at door
+ igorSay(201, 1, 0);
+ break;
+ case 106:
+ part31FloppyGoDownstairs();
+ break;
+ case 107: // look at downstairs
+ igorSay(203, 1, 0);
+ break;
+ case 108:
+ _currentPart = 200;
+ break;
+ case 109: // look at plaque
+ igorSay(204, 1, 0);
+ break;
+ case 110:
+ part31FloppyUseKeysWithDoor();
+ break;
+ default:
+ error("part31FloppyExecuteAction unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::part31FloppyEnterAstronomyLab() {
+ if (_objectsState[kAstronomyLabDoorStateIndex] == 0) {
+ return;
+ }
+ _roomObjectAreasTable[_screenLayer2[kAstronomyLabCell]].area = 2;
+ --_walkDataLastIndex;
+ buildWalkPath(127, 113, 135, 75);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _currentPart = 320;
+}
+
+void IgorEngine::part31FloppyDrawDoorFrame(int frame) {
+ drawAnimRect(kDoorAnimOffset, (frame * 0x7C0 + kDoorFramesBase) & 0xFFFF, 32, 62);
+}
+
+void IgorEngine::part31FloppyOpenDoor() {
+ if (_objectsState[kAstronomyLabDoorStateIndex] == 1) {
+ partMainExecuteAction(11);
+ return;
+ }
+ for (int i = 1; i <= 7; ++i) {
+ part31FloppyDrawDoorFrame(kOpenDoorFrames[i - 1]);
+ if (i < 7) {
+ waitForTimer(31);
+ }
+ }
+ igorSay(202, 1, 0);
+}
+
+void IgorEngine::part31FloppyGoDownstairs() {
+ --_walkDataLastIndex;
+ _roomObjectAreasTable[_screenLayer2[kDownstairsCell]].area = 2;
+ buildWalkPath(190, 113, 190, 107);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _walkDataCurrentIndex = 0;
+ _walkCurrentFrame = 1;
+ for (int i = 9; i >= 0; --i) {
+ if (i == 9) {
+ _walkCurrentFrame = 0;
+ }
+ WalkData *wd = &_walkData[0];
+ wd->setPos(190, 107, 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::part31FloppyUseKeysWithDoor() {
+ if (_objectsState[kAstronomyLabDoorStateIndex] == 1) {
+ partMainExecuteAction(11);
+ return;
+ }
+ for (int i = 1; i <= 10; ++i) {
+ part31FloppyDrawDoorFrame(kKeysDoorFrames[i - 1]);
+ if (i == 10) {
+ playSound(13, 1);
+ } else {
+ waitForTimer(31);
+ }
+ }
+ _objectsState[kAstronomyLabDoorStateIndex] = 1;
+ part31FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part31FloppyApplyObjectState(int num) {
+ if (num == 1 || num == 255) {
+ if (_objectsState[kAstronomyLabDoorStateIndex] == 0) {
+ _roomActionsTable[30] = 6;
+ } else {
+ copyArea(_screenLayer1, kOpenDoorOffset, 320, _animFramesBuffer, 27, 27, 58);
+ _roomActionsTable[30] = 7;
+ }
+ }
+}
+
+void IgorEngine::part31FloppyEnterFromLeft() {
+ _walkData[0].setPos(0, 134, 2, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 15;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPath(0, 134, 30, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part31FloppyEnterFromAstronomyLab() {
+ _walkData[0].setPos(135, 75, 3, 0);
+ _walkData[0].setDefaultScale();
+ _walkDataLastIndex = 0;
+ _roomObjectAreasTable[_screenLayer2[kAstronomyLabCell]].area = 2;
+ buildWalkPath(135, 75, 127, 118);
+ _roomObjectAreasTable[_screenLayer2[kAstronomyLabCell]].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part31FloppyEnterFromDownstairs() {
+ _walkDataCurrentIndex = 0;
+ _walkCurrentFrame = 1;
+ _walkCurrentPos = 3;
+ for (int i = 0; i <= 9; ++i) {
+ WalkData *wd = &_walkData[0];
+ if (i == 9) {
+ _walkCurrentFrame = 0;
+ }
+ wd->setPos(190, 107, 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[kDownstairsCell]].area = 2;
+ --_walkDataLastIndex;
+ buildWalkPath(190, 107, 190, 125);
+ _roomObjectAreasTable[_screenLayer2[kDownstairsCell]].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part31FloppyEnterFromRight() {
+ _walkData[0].setPos(319, 134, 4, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPath(319, 134, 289, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part31Floppy() {
+ // The room does not select any music, the current music keeps playing
+ _gameState.enableLight = 2;
+ loadRoomData(PAL_CollegeStairsSecondFloor, IMG_CollegeStairsSecondFloor, BOX_CollegeStairsSecondFloor, MSK_CollegeStairsSecondFloor, TXT_CollegeStairsSecondFloor);
+ // The room palette leaves Igor's colors empty: the room loader fills them from Igor's palette
+ memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
+ static const int anm[] = { FRM_CollegeStairsSecondFloorFloppy1, FRM_CollegeStairsSecondFloorFloppy2, 0 };
+ loadAnimData(anm);
+ loadActionData(DAT_CollegeStairsSecondFloor);
+ _roomDataOffsets = PART_31_FLOPPY_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 248, 143);
+ partMainSetExecuteAction(1, &IgorEngine::part31FloppyExecuteAction);
+ part31FloppyApplyObjectState(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ _gameState.unk10 = 1;
+ fadeIn(768);
+ if (_currentPart == 310) {
+ part31FloppyEnterFromLeft();
+ } else if (_currentPart == 311) {
+ part31FloppyEnterFromAstronomyLab();
+ } else if (_currentPart == 312) {
+ part31FloppyEnterFromDownstairs();
+ } else if (_currentPart == 313) {
+ part31FloppyEnterFromRight();
+ }
+ enterPartLoop();
+ }
+ while (_currentPart >= 310 && _currentPart <= 313 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 67d85cd0f92..4b9bc7b64ff 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -883,4 +883,7 @@
#define FRM_CollegeCorridorMargaretFloppy7 1265
#define FRM_CollegeCorridorMargaretFloppy8 1266
+#define FRM_CollegeStairsSecondFloorFloppy1 1273
+#define FRM_CollegeStairsSecondFloorFloppy2 1274
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_room.cpp b/engines/igor/static_room.cpp
index 30e4f28ca1e..2936c1599e0 100644
--- a/engines/igor/static_room.cpp
+++ b/engines/igor/static_room.cpp
@@ -288,6 +288,14 @@ const RoomDataOffsets IgorEngine::PART_31_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+// The Spanish floppy room has no dialogue data and uses the area routed walk builder.
+const RoomDataOffsets IgorEngine::PART_31_FLOPPY_ROOM_DATA_OFFSETS = {
+ { 20, 2, 2, 1 },
+ { 32, 43 },
+ { 47, 237, 3183, 131, 207, 82 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_32_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 },
{ 4, 15 },
Commit: b0296807dd1603d5f0fe9ae0722e0cc3f03fdfb5
https://github.com/scummvm/scummvm/commit/b0296807dd1603d5f0fe9ae0722e0cc3f03fdfb5
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:12+01:00
Commit Message:
IGOR: Implements part 20 in Spanish floppy
Changed paths:
A engines/igor/parts/part_20_floppy.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_31_floppy.cpp
engines/igor/resource_ids.h
engines/igor/static_room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index e7309d8785a..efca08c3f8a 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1278,6 +1278,10 @@ private:
void part31DrawOpenDoor();
void part31();
void part31Floppy();
+ void part20Floppy();
+ void part20FloppyExecuteAction(int action);
+ void part20FloppyEnterFromLeft();
+ void part20FloppyEnterFromRight();
void part31FloppyExecuteAction(int action);
void part31FloppyEnterAstronomyLab();
void part31FloppyOpenDoor();
@@ -1851,6 +1855,7 @@ protected:
static const RoomDataOffsets PART_30_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_31_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_31_FLOPPY_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_20_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_32_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_33_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_34_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index c6fbcd8227d..42b1c248ea0 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -40,6 +40,7 @@ MODULE_OBJS = \
parts/part_17.o \
parts/part_18.o \
parts/part_19.o \
+ parts/part_20_floppy.o \
parts/part_21.o \
parts/part_21_floppy.o \
parts/part_22.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index c056b794ae9..9a3390ee38f 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -569,6 +569,13 @@ void IgorEngine::partMain() {
case 191:
part19(); // women toilets
break;
+ case 200: // exist only in the Spanish floppy version
+ case 201:
+ if (_game.version != kIdSpaFloppy) {
+ error("partMain() Unhandled part %d", _currentPart);
+ }
+ part20Floppy();
+ break;
case 210:
case 211:
case 212:
diff --git a/engines/igor/parts/part_20_floppy.cpp b/engines/igor/parts/part_20_floppy.cpp
new file mode 100644
index 00000000000..123113592b3
--- /dev/null
+++ b/engines/igor/parts/part_20_floppy.cpp
@@ -0,0 +1,101 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+void IgorEngine::part20FloppyExecuteAction(int action) {
+ switch (action) {
+ case 101: // exit right
+ _currentPart = 313;
+ break;
+ case 102: // look at the corridor
+ case 103: // look at the door
+ igorSay(201, 1, 0);
+ break;
+ case 104: // look at the plaque
+ igorSay({ { 202, 1, 0 }, { 203, 1, 0 } });
+ break;
+ case 105: // look at the notice board
+ igorSay({ { 204, 1, 0 }, { 205, 2, 0 }, { 207, 2, 0 } });
+ break;
+ case 106: // exit left
+ _currentPart = 240;
+ break;
+ default:
+ error("part20FloppyExecuteAction unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::part20FloppyEnterFromLeft() {
+ _walkData[0].setPos(0, 134, 2, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 15;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPath(0, 134, 30, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part20FloppyEnterFromRight() {
+ _walkData[0].setPos(319, 134, 4, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPath(319, 134, 289, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part20Floppy() {
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_CollegeCorridorMathClass, IMG_CollegeCorridorMathClass, BOX_CollegeCorridorMathClass, MSK_CollegeCorridorMathClass, TXT_CollegeCorridorMathClass);
+ loadActionData(DAT_CollegeCorridorMathClass);
+ _roomDataOffsets = PART_20_FLOPPY_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143);
+ partMainSetExecuteAction(1, &IgorEngine::part20FloppyExecuteAction);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 200) {
+ part20FloppyEnterFromLeft();
+ } else {
+ part20FloppyEnterFromRight();
+ }
+ }
+ enterPartLoop();
+ while ((_currentPart == 200 || _currentPart == 201) && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_31_floppy.cpp b/engines/igor/parts/part_31_floppy.cpp
index f11abbbb2ab..5a9a9111b54 100644
--- a/engines/igor/parts/part_31_floppy.cpp
+++ b/engines/igor/parts/part_31_floppy.cpp
@@ -238,10 +238,8 @@ void IgorEngine::part31FloppyEnterFromRight() {
}
void IgorEngine::part31Floppy() {
- // The room does not select any music, the current music keeps playing
_gameState.enableLight = 2;
loadRoomData(PAL_CollegeStairsSecondFloor, IMG_CollegeStairsSecondFloor, BOX_CollegeStairsSecondFloor, MSK_CollegeStairsSecondFloor, TXT_CollegeStairsSecondFloor);
- // The room palette leaves Igor's colors empty: the room loader fills them from Igor's palette
memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
static const int anm[] = { FRM_CollegeStairsSecondFloorFloppy1, FRM_CollegeStairsSecondFloorFloppy2, 0 };
loadAnimData(anm);
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 4b9bc7b64ff..7c47bfdef62 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -886,4 +886,11 @@
#define FRM_CollegeStairsSecondFloorFloppy1 1273
#define FRM_CollegeStairsSecondFloorFloppy2 1274
+#define DAT_CollegeCorridorMathClass 1276
+#define TXT_CollegeCorridorMathClass 1277
+#define IMG_CollegeCorridorMathClass 1278
+#define PAL_CollegeCorridorMathClass 1279
+#define MSK_CollegeCorridorMathClass 1280
+#define BOX_CollegeCorridorMathClass 1281
+
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_room.cpp b/engines/igor/static_room.cpp
index 2936c1599e0..603e755207c 100644
--- a/engines/igor/static_room.cpp
+++ b/engines/igor/static_room.cpp
@@ -184,6 +184,14 @@ const RoomDataOffsets IgorEngine::PART_19_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+// This room doesnt exist in the English floppy onwards
+const RoomDataOffsets IgorEngine::PART_20_FLOPPY_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 4, 15 },
+ { 19, 209, 3155, 103, 179, 82 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_21_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 },
{ 5, 18 },
@@ -288,7 +296,6 @@ const RoomDataOffsets IgorEngine::PART_31_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
-// The Spanish floppy room has no dialogue data and uses the area routed walk builder.
const RoomDataOffsets IgorEngine::PART_31_FLOPPY_ROOM_DATA_OFFSETS = {
{ 20, 2, 2, 1 },
{ 32, 43 },
Commit: 25fd02a8467877c9fec14a0b49d49b3f3d9e8121
https://github.com/scummvm/scummvm/commit/25fd02a8467877c9fec14a0b49d49b3f3d9e8121
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:12+01:00
Commit Message:
IGOR: Color spanish floppy dialogue options
Changed paths:
engines/igor/igor.h
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index efca08c3f8a..f7d90668cdb 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1753,6 +1753,9 @@ private:
public:
Graphics::Screen *_screen = nullptr;
+ int dialogueChoiceOffset(int i) const;
+ Common::String dialogueChoiceText(int choice, const char *prefix) const;
+ void drawFloppyDialogueChoice(int choice, int color);
bool copyOptionsMenuThumbnail(Graphics::Surface &thumb) const {
if (!_optionsMenuThumbnail.getPixels())
return false;
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 51e5996bbde..fbf2d58774e 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -22,6 +22,22 @@
namespace Igor {
+// palette colors of a choice and of the one under the cursor, y of the
+// first line and distance between lines. The CD hover area starts one row above the first line.
+static const int kChoiceColor = 240;
+static const int kChoiceHoverColor = 241;
+static const int kChoiceFirstY = 135;
+static const int kChoiceLineSpacing = 11;
+static const int kChoiceHoverFirstY = 134;
+
+// Spanish floppy dialogue choices use the action sentence colors: the normal color, and the
+// one used for the choice under the cursor.
+static const int kFloppyChoiceColor = 248;
+static const int kFloppyChoiceHoverColor = 247;
+static const int kFloppyChoiceFirstY = 135;
+static const int kFloppyChoiceLineSpacing = 10;
+
+
/**
* appends one DialogueText{num, count, sound} record to the batch being built.
* Game accumulates texts in _dialogeTextsTable, then displays them during dialogues.
@@ -478,6 +494,24 @@ void IgorEngine::animateIgorTalking(int frame) {
}
}
+
+// Offset in the dialogue data of the entry of choice slot i (1..5) in the current menu.
+int IgorEngine::dialogueChoiceOffset(int i) const {
+ return (i - 1) * 6 + (_gameState.dialogueChoiceCount - 1) * 30 + (_gameState.dialogueChoiceStart - 1) * _roomDataOffsets.dlg.matSize;
+}
+
+// Text of a choice: both parts of the question, after an optional prefix.
+Common::String IgorEngine::dialogueChoiceText(int choice, const char *prefix) const {
+ const int offset = dialogueChoiceOffset(_dialogueInfo[choice]);
+ const int num = _gameState.dialogueData[offset + 3] - 1;
+ return Common::String::format("%s%s %s", prefix, _dialogueQuestions[num][0], _dialogueQuestions[num][1]);
+}
+
+void IgorEngine::drawFloppyDialogueChoice(int choice, int color) {
+ const Common::String text = dialogueChoiceText(choice, "");
+ _sentenceFont->drawString(_screenVGA, text.c_str(), 0, kFloppyChoiceFirstY + choice * kFloppyChoiceLineSpacing, color, -1, -1);
+}
+
/**
* Pos and color
*/
@@ -506,7 +540,7 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreU
}
dialogueAskQuestion();
dialogueReplyToQuestion(x, y, r, g, b);
- int offset = (_dialogueInfo[_dialogueChoiceSelected] - 1) * 6 + (_gameState.dialogueChoiceCount - 1) * 30 + (_gameState.dialogueChoiceStart - 1) * _roomDataOffsets.dlg.matSize;
+ int offset = dialogueChoiceOffset(_dialogueInfo[_dialogueChoiceSelected]);
int code = _gameState.dialogueData[offset + 5];
if (getPart() == 9) {
if (code == 4)
@@ -554,30 +588,38 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreU
_gameState.dialogueStarted = false;
}
+
void IgorEngine::drawDialogueChoices() {
if (_gameState.dialogueTextRunning) {
warning("drawDialogueChoices() entered while dialogue text is still active");
}
+ const bool floppy = (_game.version == kIdSpaFloppy);
memset(_screenVGA + 46080, 0, 56 * 320);
- setPaletteColor(240, 0, 0, 0);
+ setPaletteColor(floppy ? kFloppyChoiceColor : kChoiceColor, 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;
+ int offset = dialogueChoiceOffset(i);
if (_gameState.dialogueData[offset] == 1) {
++_dialogueInfo[0];
_dialogueInfo[_dialogueInfo[0]] = i;
- int num = _gameState.dialogueData[offset + 3] - 1;
- char questionText[128];
- snprintf(questionText, sizeof(questionText), "@%s %s", _dialogueQuestions[num][0], _dialogueQuestions[num][1]);
- _sentenceFont->drawString(_screenVGA, questionText, 0, _dialogueInfo[0] * 11 + 135, 240, 0, 0);
+ if (floppy) {
+ drawFloppyDialogueChoice(_dialogueInfo[0], kFloppyChoiceColor);
+ } else {
+ const Common::String questionText = dialogueChoiceText(_dialogueInfo[0], "@");
+ _dialogueFont->drawString(_screenVGA, questionText.c_str(), 0, _dialogueInfo[0] * kChoiceLineSpacing + kChoiceFirstY, kChoiceColor, 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]);
+ if (floppy) {
+ setPaletteColor(kFloppyChoiceColor, _paletteBuffer[3 * kFloppyChoiceColor], _paletteBuffer[3 * kFloppyChoiceColor + 1], _paletteBuffer[3 * kFloppyChoiceColor + 2]);
+ return;
+ }
+ setPaletteColor(kChoiceColor, _paletteBuffer[0x2F6 + 1], _paletteBuffer[0x2F6 + 2], _paletteBuffer[0x2F6 + 3]);
+ setPaletteColor(kChoiceHoverColor, _paletteBuffer[0x2F0 + 1], _paletteBuffer[0x2F0 + 2], _paletteBuffer[0x2F0 + 3]);
}
int IgorEngine::selectDialogue() {
@@ -596,9 +638,16 @@ int IgorEngine::selectDialogue() {
drawDialogueChoices();
hoveredChoice = 0;
}
- int currentChoice = (_inputVars[kInputCursorYPos] - 134) / 11;
- if (currentChoice < 0) {
- currentChoice = 0;
+ int currentChoice;
+ if (_game.version == kIdSpaFloppy) {
+ // only the rows of the choices react to the cursor
+ const int y = _inputVars[kInputCursorYPos];
+ currentChoice = (y >= 145 && y <= 194) ? (y - kFloppyChoiceFirstY) / kFloppyChoiceLineSpacing : 0;
+ } else {
+ currentChoice = (_inputVars[kInputCursorYPos] - kChoiceHoverFirstY) / kChoiceLineSpacing;
+ if (currentChoice < 0) {
+ currentChoice = 0;
+ }
}
if (currentChoice != hoveredChoice) {
@@ -629,7 +678,7 @@ int IgorEngine::selectDialogue() {
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 offset = dialogueChoiceOffset(_dialogueInfo[_dialogueChoiceSelected]);
int question = _gameState.dialogueData[offset + 3];
// For part 5 igor always chickens out from Phillip
if (getPart() == 17) {
@@ -651,15 +700,21 @@ void IgorEngine::dialogueAskQuestion() {
}
void IgorEngine::recolorDialogueChoice(int num, bool highlight) {
- uint8 *p = _screenVGA + 320 * (11 * num + 135);
- for (int i = 0; i < 320 * 11; ++i) {
+ if (_game.version == kIdSpaFloppy) {
+ if (num >= 1 && num <= _dialogueInfo[0]) {
+ drawFloppyDialogueChoice(num, highlight ? kFloppyChoiceHoverColor : kFloppyChoiceColor);
+ }
+ return;
+ }
+ uint8 *p = _screenVGA + 320 * (kChoiceLineSpacing * num + kChoiceFirstY);
+ for (int i = 0; i < 320 * kChoiceLineSpacing; ++i) {
if (highlight) {
- if (p[i] == 240) {
- p[i] = 241;
+ if (p[i] == kChoiceColor) {
+ p[i] = kChoiceHoverColor;
}
} else {
- if (p[i] == 241) {
- p[i] = 240;
+ if (p[i] == kChoiceHoverColor) {
+ p[i] = kChoiceColor;
}
}
}
@@ -667,7 +722,7 @@ void IgorEngine::recolorDialogueChoice(int num, bool highlight) {
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;
+ int offset = dialogueChoiceOffset(_dialogueInfo[_dialogueChoiceSelected]);
reply = _gameState.dialogueData[offset + 4];
debugC(9, kDebugEngine, "dialogueReplyToQuestion() dialogue choice %d reply %d", _dialogueChoiceSelected, reply);
if (reply == 0) {
Commit: 923207a7ced349bd698364d8e71c00963828d0a1
https://github.com/scummvm/scummvm/commit/923207a7ced349bd698364d8e71c00963828d0a1
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:12+01:00
Commit Message:
IGOR: Spanish floppy options menu
Changed paths:
engines/igor/igor.h
engines/igor/options.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index f7d90668cdb..a68f1bda065 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1658,6 +1658,16 @@ private:
void loadOptionsMenuTexts();
void drawOptionsMenuText(int text, int x, int y, int color);
void handleOptionsMenu();
+ void loadFloppyOptionsMenuTexts();
+ void floppyOptionsDrawText(int text, int x, int y, int color);
+ void floppyOptionsFillRow(const uint8 *button, int buttonRow, int y);
+ void floppyOptionsDrawMainPage(const uint8 *button);
+ void floppyOptionsClearCaptionBar(const uint8 *button);
+ void floppyOptionsPaintControl(const uint8 *button, int row);
+ void floppyOptionsPresent(int selectedButton);
+ void floppyOptionsQuitPage(const uint8 *button);
+ void floppyOptionsControlPage(const uint8 *button);
+ void handleFloppyOptionsMenu();
void scrollInventory();
void drawInventory(int start, int mode);
void pageFloppyInventory(bool forward);
@@ -1740,6 +1750,9 @@ private:
int x1MinY = -1, int x2MinY = -1);
void fixWalkPosition(int *x, int *y);
void recolorDialogueChoice(int num, bool highlight);
+ int dialogueChoiceOffset(int i) const;
+ Common::String dialogueChoiceText(int choice, const char *prefix) const;
+ void drawFloppyDialogueChoice(int choice, int color);
void handleDialogue(int x, int y, int r, int g, int b, bool restoreUI = true);
void drawDialogueChoices();
int selectDialogue();
@@ -1753,9 +1766,6 @@ private:
public:
Graphics::Screen *_screen = nullptr;
- int dialogueChoiceOffset(int i) const;
- Common::String dialogueChoiceText(int choice, const char *prefix) const;
- void drawFloppyDialogueChoice(int choice, int color);
bool copyOptionsMenuThumbnail(Graphics::Surface &thumb) const {
if (!_optionsMenuThumbnail.getPixels())
return false;
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 84b4c1d39eb..cd8969a4a36 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -27,6 +27,29 @@
namespace Igor {
+// The menu is drawn in a 234x115 panel whose top-left corner is at (43, 15) on the 320x200 screen.
+static const int kMenuX = 43;
+static const int kMenuY = 15;
+static const int kMenuWidth = 234;
+static const int kMenuHeight = 115;
+static const int kMenuSize = 320 * kMenuHeight;
+static const int kButtonSpacing = 46;
+static const int kButtonWidth = 44;
+static const int kCaptionY = 18 - kMenuY;
+static const int kPageCenterX = 159;
+static const int kPageRowHeight = 22;
+static const int kFadeSteps = 21;
+static const int kLastFadedColor = 245;
+
+enum {
+ kColorTitle = 0xF6,
+ kColorFrameLight = 0xF7,
+ kColorFill = 0xF8,
+ kColorFrameDark = 0xF9,
+ kColorPageCaption = 0xFB,
+ kColorText = 0xFF
+};
+
static const struct {
int y;
int h;
@@ -46,14 +69,14 @@ static const struct {
};
static void drawButtonsBar(uint8 *dst, const uint8 *src) {
- int y0 = 15;
+ int y0 = kMenuY;
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);
+ memcpy(dst + (y1 - kMenuY) * 320 + kMenuX, src + (buttonsBarCoords[i].y - 1) * kMenuWidth, kMenuWidth);
++y0;
}
}
@@ -63,8 +86,8 @@ static void drawButtonsBar(uint8 *dst, const uint8 *src) {
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) {
+ uint8 *p = dst + (y + 3) * 320 + button * kButtonSpacing + kMenuX + 3;
+ for (int x = 0; x < kButtonWidth; ++x) {
p[x] += colorDiff;
}
}
@@ -156,6 +179,10 @@ static const Page pages[] = {
void IgorEngine::loadOptionsMenuTexts() {
if (!_optionsMenuTexts.empty())
return;
+ if (_game.version == kIdSpaFloppy) {
+ loadFloppyOptionsMenuTexts();
+ return;
+ }
const bool demo = _game.flags & kFlagDemo;
const bool talkie = _game.flags & kFlagTalkie;
@@ -205,8 +232,8 @@ void IgorEngine::drawOptionsMenuText(int text, int x, int y, int color) {
}
void IgorEngine::handleOptionsMenu_paintQuit() {
- drawOptionsMenuText(kOptionsQuitQuestion, 159, 64 - 15, 0xF6);
- drawOptionsMenuText(kOptionsQuitKeys, 159, 76 - 15, 0xF6);
+ drawOptionsMenuText(kOptionsQuitQuestion, kPageCenterX, 64 - kMenuY, kColorTitle);
+ drawOptionsMenuText(kOptionsQuitKeys, kPageCenterX, 76 - kMenuY, kColorTitle);
}
bool IgorEngine::handleOptionsMenu_handleKeyDownQuit(int key) {
@@ -217,17 +244,17 @@ bool IgorEngine::handleOptionsMenu_handleKeyDownQuit(int key) {
}
static void redrawRect(uint8 *dst, int num, bool border) {
- const int x = 43 + 6;
- const int y = 22 * num;
+ const int x = kMenuX + 6;
+ const int y = kPageRowHeight * num;
for (int i = 0; i < 21; ++i) {
- memset(dst + (y + i) * 320 + x, 0xF8, 222);
+ memset(dst + (y + i) * 320 + x, kColorFill, 222);
}
if (border) {
- memset(dst + y * 320 + x, 0xF7, 222);
- memset(dst + (y + 20) * 320 + x, 0xF9, 222);
+ memset(dst + y * 320 + x, kColorFrameLight, 222);
+ memset(dst + (y + 20) * 320 + x, kColorFrameDark, 222);
for (int i = 1; i < 20; ++i) {
- dst[(y + i) * 320 + x ] = 0xF7;
- dst[(y + i) * 320 + x + 221] = 0xF9;
+ dst[(y + i) * 320 + x ] = kColorFrameLight;
+ dst[(y + i) * 320 + x + 221] = kColorFrameDark;
}
}
}
@@ -242,7 +269,7 @@ void IgorEngine::handleOptionsMenu_paintCtrl() {
};
for (int row = 1; row <= 4; ++row) {
redrawRect(_screenTextLayer, row, row == 4);
- drawOptionsMenuText(labels[row - 1], 159, 22 * row + 4, row == 4 ? 0xF6 : 0xF7);
+ drawOptionsMenuText(labels[row - 1], kPageCenterX, kPageRowHeight * row + 4, row == 4 ? kColorTitle : kColorFrameLight);
}
return;
}
@@ -257,8 +284,8 @@ void IgorEngine::handleOptionsMenu_paintCtrl() {
};
for (int row = 1; row <= 4; ++row) {
redrawRect(_screenTextLayer, row, row == _optionsControlRow);
- drawOptionsMenuText(labels[row - 1], 159, 22 * row + 4,
- row == _optionsControlRow ? 0xF6 : 0xFF);
+ drawOptionsMenuText(labels[row - 1], kPageCenterX, kPageRowHeight * row + 4,
+ row == _optionsControlRow ? kColorTitle : kColorText);
}
}
@@ -313,6 +340,331 @@ bool IgorEngine::handleOptionsMenu_handleKeyDownCtrl(int key) {
return false;
}
+static const int kFloppyMenuX = 53;
+static const int kFloppyMenuY = 19;
+static const int kFloppyMenuWidth = 214;
+static const int kFloppyMenuHeight = 106;
+static const int kFloppyMenuSize = 320 * kFloppyMenuHeight;
+static const int kFloppyButtonX = 55;
+static const int kFloppyButtonY = 21;
+static const int kFloppyButtonWidth = 42;
+static const int kFloppyButtonHeight = 13;
+static const int kFloppyControlPanelFirstRow = 36;
+static const int kFloppyControlPanelRows = 85;
+static const int kFloppyCaptionY = 22;
+static const int kFloppyCaptionLastRow = 34;
+static const int kFloppyLastFadedColor = 248;
+static const int kFloppyFadeSteps = 30;
+static const int kFloppyFadeCount = 3 * (kFloppyLastFadedColor + 1);
+
+enum {
+ kFloppyColorCaption = 0xF9,
+ kFloppyColorText = 0xFF,
+ kFloppyColorFrameLight = 0xFA,
+ kFloppyColorFrameDark = 0xFC,
+ kFloppyColorButtonLight = 0xFE,
+ kFloppyColorButtonDark = 0xFD
+};
+
+enum FloppyOptionsText {
+ kFloppySave = 0,
+ kFloppyLoad,
+ kFloppyQuit,
+ kFloppyCtrl,
+ kFloppyPlay,
+ kFloppySpeedTitle,
+ kFloppySpeedVerySlow,
+ kFloppySpeedSlow,
+ kFloppySpeedNormal,
+ kFloppySpeedFast,
+ kFloppySpeedVeryFast,
+ kFloppyMusicTitle,
+ kFloppyMusicOff,
+ kFloppyMusicOn,
+ kFloppyMusicUnavailable,
+ kFloppySoundTitle,
+ kFloppySoundOff,
+ kFloppySoundOn,
+ kFloppySoundUnavailable,
+ kFloppyCtrlTitle,
+ kFloppyQuitTitle,
+ kFloppyQuitQuestion,
+ kFloppyTextCount
+};
+
+static const int kFloppyCaptionX[5] = { 60, 102, 148, 185, 231 };
+static const int kFloppySpeedX[5] = { 137, 148, 145, 146, 135 };
+
+// Row of the button image (1-based) and the number of screen rows it is repeated for.
+static const struct {
+ int row;
+ int count;
+} kFloppyPanelRows[] = {
+ { 1, 1 }, { 2, 2 }, { 4, 1 }, { 5, 9 }, { 6, 1 }, { 2, 2 },
+ { 7, 1 }, { 8, 85 }, { 9, 1 }, { 2, 2 }, { 3, 1 }
+};
+
+void IgorEngine::loadFloppyOptionsMenuTexts() {
+ const struct {
+ int resource;
+ int count;
+ } groups[] = {
+ { TXT_OptionsButtons, 5 },
+ { TXT_OptionsSettings, 14 },
+ { TXT_OptionsTitle, 1 },
+ { TXT_OptionsQuit, 2 }
+ };
+ for (uint i = 0; i < ARRAYSIZE(groups); ++i) {
+ int size;
+ uint8 *data = loadData(groups[i].resource, 0, &size);
+ int offset = 0;
+ for (int j = 0; j < groups[i].count; ++j) {
+ if (offset >= size || data[offset] > size - offset - 1)
+ error("Invalid options menu text resource %d", groups[i].resource);
+ const int length = data[offset++];
+ _optionsMenuTexts.push_back(Common::String((const char *)data + offset, length));
+ offset += length;
+ }
+ if (offset != size)
+ error("Unexpected data in options menu text resource %d", groups[i].resource);
+ free(data);
+ }
+ assert(_optionsMenuTexts.size() == kFloppyTextCount);
+}
+
+// Texts are left aligned and drawn with the action sentence font into the menu panel.
+void IgorEngine::floppyOptionsDrawText(int text, int x, int y, int color) {
+ _sentenceFont->drawString(_screenTextLayer, _optionsMenuTexts[text].c_str(), x, y - kFloppyMenuY, color, -1, -1);
+}
+
+void IgorEngine::floppyOptionsFillRow(const uint8 *button, int buttonRow, int y) {
+ memcpy(_screenTextLayer + (y - kFloppyMenuY) * 320 + kFloppyMenuX,
+ button + (buttonRow - 1) * kFloppyMenuWidth, kFloppyMenuWidth);
+}
+
+void IgorEngine::floppyOptionsDrawMainPage(const uint8 *button) {
+ int y = 0;
+ for (uint i = 0; i < ARRAYSIZE(kFloppyPanelRows); ++i) {
+ for (int j = 0; j < kFloppyPanelRows[i].count; ++j) {
+ memcpy(_screenTextLayer + y * 320 + kFloppyMenuX, button + (kFloppyPanelRows[i].row - 1) * kFloppyMenuWidth, kFloppyMenuWidth);
+ ++y;
+ }
+ }
+ for (int i = 0; i < 5; ++i) {
+ floppyOptionsDrawText(kFloppySave + i, kFloppyCaptionX[i], kFloppyCaptionY, kFloppyColorCaption);
+ }
+}
+
+void IgorEngine::floppyOptionsClearCaptionBar(const uint8 *button) {
+ for (int y = kFloppyCaptionY; y <= kFloppyCaptionLastRow; ++y) {
+ floppyOptionsFillRow(button, 2, y);
+ }
+}
+
+// Sends the panel to the screen, with the frame of the selected button (0 for none) on top.
+void IgorEngine::floppyOptionsPresent(int selectedButton) {
+ uint8 panel[kFloppyMenuSize];
+ memcpy(panel, _screenTextLayer, kFloppyMenuSize);
+ if (selectedButton >= 1 && selectedButton <= 5) {
+ const int x = kFloppyButtonX + (selectedButton - 1) * kFloppyButtonWidth;
+ uint8 *top = panel + (kFloppyButtonY - kFloppyMenuY) * 320 + x;
+ memset(top, kFloppyColorButtonLight, kFloppyButtonWidth);
+ for (int i = 1; i < kFloppyButtonHeight - 1; ++i) {
+ top[i * 320] = kFloppyColorButtonLight;
+ top[i * 320 + kFloppyButtonWidth - 1] = kFloppyColorButtonDark;
+ }
+ memset(top + (kFloppyButtonHeight - 1) * 320, kFloppyColorButtonDark, kFloppyButtonWidth);
+ }
+ _system->copyRectToScreen(panel, 320, 0, kFloppyMenuY, 320, kFloppyMenuHeight);
+ _system->updateScreen();
+}
+
+void IgorEngine::floppyOptionsPaintControl(const uint8 *button, int row) {
+ for (int i = 0; i < kFloppyControlPanelRows; ++i) {
+ floppyOptionsFillRow(button, 8, kFloppyControlPanelFirstRow + i);
+ }
+ const int speed = CLIP<int>(_gameState.talkSpeed, 1, 5);
+ const bool musicOn = !(ConfMan.getBool("mute") || ConfMan.getBool("music_mute"));
+ const bool soundOn = !(ConfMan.getBool("mute") || ConfMan.getBool("sfx_mute"));
+ const int speedColor = (row == 1) ? kFloppyColorCaption : kFloppyColorText;
+ const int musicColor = (row == 2) ? kFloppyColorCaption : kFloppyColorText;
+ const int soundColor = (row == 3) ? kFloppyColorCaption : kFloppyColorText;
+ floppyOptionsDrawText(kFloppySpeedTitle, 120, 40, speedColor);
+ floppyOptionsDrawText(kFloppySpeedVerySlow + speed - 1, kFloppySpeedX[speed - 1], 51, speedColor);
+ floppyOptionsDrawText(kFloppyMusicTitle, 147, 68, musicColor);
+ if (musicOn)
+ floppyOptionsDrawText(kFloppyMusicOn, 141, 79, musicColor);
+ else
+ floppyOptionsDrawText(kFloppyMusicOff, 133, 79, musicColor);
+ floppyOptionsDrawText(kFloppySoundTitle, 122, 96, soundColor);
+ if (soundOn)
+ floppyOptionsDrawText(kFloppySoundOn, 138, 107, soundColor);
+ else
+ floppyOptionsDrawText(kFloppySoundOff, 131, 107, soundColor);
+
+ // Frame around the selected row: light top and left edges, dark bottom and right edges.
+ const int top = (28 * row + 10 - kFloppyMenuY) * 320 + 59;
+ memset(_screenTextLayer + top, kFloppyColorFrameLight, 202);
+ for (int i = 1; i <= 23; ++i) {
+ _screenTextLayer[top + i * 320] = kFloppyColorFrameLight;
+ _screenTextLayer[top + i * 320 + 201] = kFloppyColorFrameDark;
+ }
+ memset(_screenTextLayer + top + 24 * 320, kFloppyColorFrameDark, 202);
+}
+
+void IgorEngine::floppyOptionsControlPage(const uint8 *button) {
+ floppyOptionsClearCaptionBar(button);
+ floppyOptionsDrawText(kFloppyCtrlTitle, 121, kFloppyCaptionY, kFloppyColorCaption);
+ int row = 1;
+ bool leave = false;
+ floppyOptionsPaintControl(button, row);
+ while (!leave && !_eventQuitGame && _currentPart != kInvalidPart) {
+ Common::Event ev;
+ while (_eventMan->pollEvent(ev)) {
+ if (ev.type == Common::EVENT_QUIT) {
+ _currentPart = kInvalidPart;
+ _eventQuitGame = true;
+ } else if (ev.type == Common::EVENT_KEYDOWN) {
+ switch (ev.kbd.keycode) {
+ case Common::KEYCODE_ESCAPE:
+ leave = true;
+ break;
+ case Common::KEYCODE_UP:
+ row = MAX(1, row - 1);
+ break;
+ case Common::KEYCODE_DOWN:
+ row = MIN(3, row + 1);
+ break;
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ if (row == 1) {
+ _gameState.talkSpeed = _gameState.talkSpeed >= 5 ? 1 : _gameState.talkSpeed + 1;
+ } else if (row == 2) {
+ ConfMan.setBool("music_mute", !ConfMan.getBool("music_mute"));
+ } else {
+ ConfMan.setBool("sfx_mute", !ConfMan.getBool("sfx_mute"));
+ }
+ syncSoundSettings();
+ ConfMan.flushToDisk();
+ break;
+ default:
+ break;
+ }
+ floppyOptionsPaintControl(button, row);
+ }
+ }
+ floppyOptionsPresent(0);
+ _system->delayMillis(10);
+ }
+ floppyOptionsDrawMainPage(button);
+}
+
+void IgorEngine::floppyOptionsQuitPage(const uint8 *button) {
+ floppyOptionsClearCaptionBar(button);
+ floppyOptionsDrawText(kFloppyQuitTitle, 132, kFloppyCaptionY, kFloppyColorCaption);
+ floppyOptionsDrawText(kFloppyQuitQuestion, 90, 70, kFloppyColorCaption);
+ bool leave = false;
+ while (!leave && !_eventQuitGame && _currentPart != kInvalidPart) {
+ Common::Event ev;
+ while (_eventMan->pollEvent(ev)) {
+ if (ev.type == Common::EVENT_QUIT) {
+ _currentPart = kInvalidPart;
+ _eventQuitGame = true;
+ } else if (ev.type == Common::EVENT_KEYDOWN) {
+ if (ev.kbd.keycode == Common::KEYCODE_s) {
+ _currentPart = kInvalidPart;
+ leave = true;
+ } else if (ev.kbd.keycode == Common::KEYCODE_n || ev.kbd.keycode == Common::KEYCODE_ESCAPE) {
+ leave = true;
+ }
+ }
+ }
+ floppyOptionsPresent(0);
+ _system->delayMillis(10);
+ }
+ if (_currentPart != kInvalidPart)
+ floppyOptionsDrawMainPage(button);
+}
+
+void IgorEngine::handleFloppyOptionsMenu() {
+ // The menu starts from the full palette and dims colors 1..248 in steps of three levels.
+ memcpy(_currentPalette, _paletteBuffer, 768);
+ for (int m = 3; m <= kFloppyFadeSteps; m += 3) {
+ for (int i = 3; i < kFloppyFadeCount; ++i) {
+ if (_paletteBuffer[i] >= m) {
+ _currentPalette[i] = MAX<int>(_paletteBuffer[i] - m, _currentPalette[i] - 3);
+ }
+ }
+ setPaletteRange(1, kFloppyLastFadedColor);
+ _system->updateScreen();
+ _system->delayMillis(1000 / 60);
+ }
+ setPaletteColor(255, 35, 35, 23);
+
+ memcpy(_screenTextLayer, _screenVGA + kFloppyMenuY * 320, kFloppyMenuSize);
+ uint8 *button = loadData(IMG_OptionsButton);
+ floppyOptionsDrawMainPage(button);
+
+ int selected = 1;
+ bool menuLoop = true;
+ while (menuLoop && !_eventQuitGame && _currentPart != kInvalidPart) {
+ Common::Event ev;
+ while (_eventMan->pollEvent(ev)) {
+ if (ev.type == Common::EVENT_QUIT) {
+ _currentPart = kInvalidPart;
+ _eventQuitGame = true;
+ } else if (ev.type == Common::EVENT_KEYDOWN) {
+ switch (ev.kbd.keycode) {
+ case Common::KEYCODE_ESCAPE:
+ menuLoop = false;
+ break;
+ case Common::KEYCODE_LEFT:
+ selected = MAX(1, selected - 1);
+ break;
+ case Common::KEYCODE_RIGHT:
+ selected = MIN(5, selected + 1);
+ break;
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ if (selected == 1) {
+ saveGameDialog();
+ } else if (selected == 2) {
+ if (loadGameDialog()) {
+ free(button);
+ _optionsMenuThumbnail.free();
+ return;
+ }
+ } else if (selected == 3) {
+ floppyOptionsQuitPage(button);
+ } else if (selected == 4) {
+ floppyOptionsControlPage(button);
+ } else {
+ menuLoop = false;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ floppyOptionsPresent(selected);
+ _system->delayMillis(10);
+ }
+ free(button);
+
+ _optionsMenuThumbnail.free();
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputRightClick] = 0;
+ _inputVars[kInputSkipDialogue] = 0;
+ _inputVars[kInputOptions] = 0;
+ _inputVars[kInputPause] = 0;
+ setPaletteColor(255, 63, 63, 63);
+ if (_currentPart != kInvalidPart) {
+ fadeIn(kFloppyFadeCount);
+ }
+ showCursor();
+}
+
void IgorEngine::handleOptionsMenu() {
// get the gameplay screenshot before the menu draws or dims its palette.
_optionsMenuThumbnail.free();
@@ -336,6 +688,10 @@ void IgorEngine::handleOptionsMenu() {
_currentAction.object2Num = 0;
_currentAction.object2Type = 0;
}
+ if (_game.version == kIdSpaFloppy) {
+ handleFloppyOptionsMenu();
+ return;
+ }
// Keep the reserved UI colors: dialogue changes the displayed palette only.
memcpy(_paletteBuffer, _currentPalette, 208 * 3);
memcpy(_currentPalette + 208 * 3, _paletteBuffer + 208 * 3, 48 * 3);
@@ -343,22 +699,22 @@ void IgorEngine::handleOptionsMenu() {
if (!_gameState.dialogueStarted)
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) {
+ for (int m = 3; m <= kFadeSteps; m += 3) {
+ for (int i = 1 * 3; i <= kLastFadedColor * 3; ++i) {
if (_paletteBuffer[i] >= m) {
_currentPalette[i] = MAX<int>(_paletteBuffer[i] - m, _currentPalette[i] - 3);
}
}
- setPaletteRange(1, 245);
+ setPaletteRange(1, kLastFadedColor);
_system->updateScreen();
_system->delayMillis(1000 / 60);
}
setPaletteColor(255, 35, 35, 23);
- memcpy(_screenTextLayer, _screenVGA + 4800, 36800);
+ memcpy(_screenTextLayer, _screenVGA + kMenuY * 320, kMenuSize);
uint8 *optionsMenu = loadData(IMG_OptionsMenu);
- for (int i = 0; i < 36800; ++i) {
+ for (int i = 0; i < kMenuSize; ++i) {
if (optionsMenu[i]) {
_screenTextLayer[i] = optionsMenu[i];
}
@@ -368,9 +724,9 @@ void IgorEngine::handleOptionsMenu() {
drawButtonsBar(_screenTextLayer, optionsButton);
free(optionsButton);
- const int yPosCaption = 18 - 15;
+ const int yPosCaption = kCaptionY;
for (int i = 0; i < 5; ++i) {
- drawOptionsMenuText(pages[i].captions[0], pages[i].xPos[0], yPosCaption, 0xF6);
+ drawOptionsMenuText(pages[i].captions[0], pages[i].xPos[0], yPosCaption, kColorTitle);
}
redrawButton(_screenTextLayer, 0, true);
@@ -393,7 +749,7 @@ void IgorEngine::handleOptionsMenu() {
if (unavailable || (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);
+ memset(_screenTextLayer + y * 320 + kMenuX + 4, kColorFill, 226);
}
focusOnPage = false;
}
@@ -415,14 +771,14 @@ void IgorEngine::handleOptionsMenu() {
} else {
memcpy(buttonsBarBackup, _screenTextLayer + 3 * 320, 320 * 12);
for (int y = 0; y <= 11; ++y) {
- memset(_screenTextLayer + (y + 3) * 320 + 44, 0xF8, 232);
+ memset(_screenTextLayer + (y + 3) * 320 + kMenuX + 1, kColorFill, 232);
}
- drawOptionsMenuText(pages[currentPage].captions[1], pages[currentPage].xPos[1], yPosCaption, 0xFB);
+ drawOptionsMenuText(pages[currentPage].captions[1], pages[currentPage].xPos[1], yPosCaption, kColorPageCaption);
if (currentPage == kPageCtrl)
_optionsControlRow = (_game.flags & kFlagTalkie) ? 1 : 4;
if ((_game.flags & kFlagDemo) && (currentPage == kPageSave || currentPage == kPageLoad)) {
- drawOptionsMenuText(kOptionsUnavailable, 159, 70 - 16, 0xF6);
- _system->copyRectToScreen(_screenTextLayer, 320, 0, 15, 320, 115);
+ drawOptionsMenuText(kOptionsUnavailable, kPageCenterX, 70 - 16, kColorTitle);
+ _system->copyRectToScreen(_screenTextLayer, 320, 0, kMenuY, 320, kMenuHeight);
_system->updateScreen();
// The unavailable page requests a PCSpeaker beep before accepting another key.
if (speakerReady)
@@ -460,7 +816,7 @@ void IgorEngine::handleOptionsMenu() {
redrawButton(_screenTextLayer, currentPage, true);
}
_system->delayMillis(10);
- _system->copyRectToScreen(_screenTextLayer, 320, 0, 15, 320, 115);
+ _system->copyRectToScreen(_screenTextLayer, 320, 0, kMenuY, 320, kMenuHeight);
_system->updateScreen();
}
@@ -472,13 +828,13 @@ void IgorEngine::handleOptionsMenu() {
_inputVars[kInputPause] = 0;
_system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, 200);
setPaletteColor(255, 63, 63, 63);
- for (int m = 21; m >= 3; m -= 3) {
- for (int i = 1 * 3; i <= 245 * 3; ++i) {
+ for (int m = kFadeSteps; m >= 3; m -= 3) {
+ for (int i = 1 * 3; i <= kLastFadedColor * 3; ++i) {
if (_paletteBuffer[i] >= m) {
_currentPalette[i] = MIN<int>(_paletteBuffer[i], _currentPalette[i] + 3);
}
}
- setPaletteRange(1, 245);
+ setPaletteRange(1, kLastFadedColor);
_system->updateScreen();
_system->delayMillis(1000 / 60);
}
Commit: 4ca680a5e2a9aa70c6eaa8f144e9d2976e4f0e1a
https://github.com/scummvm/scummvm/commit/4ca680a5e2a9aa70c6eaa8f144e9d2976e4f0e1a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:13+01:00
Commit Message:
IGOR: Implements part 24 in the Spanish floppy version
Changed paths:
A engines/igor/parts/part_24_floppy.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index a68f1bda065..0ecb4a120f8 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1172,6 +1172,15 @@ private:
void part24EnterFromRight();
void part24EnterFromChemistryClass();
void part24();
+ void part24Floppy();
+ void part24FloppyExecuteAction(int action);
+ void part24FloppyEnterChemistryClass();
+ void part24FloppyOpenDoor();
+ void part24FloppyCloseDoor();
+ void part24FloppyApplyObjectState(int num);
+ void part24FloppyEnterFromLeft();
+ void part24FloppyEnterFromRight();
+ void part24FloppyEnterFromChemistryClass();
// college corridor announcement board
@@ -1869,6 +1878,7 @@ protected:
static const RoomDataOffsets PART_31_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_31_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_20_FLOPPY_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_24_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_32_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_33_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_34_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 42b1c248ea0..e981119dda6 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -46,6 +46,7 @@ MODULE_OBJS = \
parts/part_22.o \
parts/part_23.o \
parts/part_24.o \
+ parts/part_24_floppy.o \
parts/part_25.o \
parts/part_26.o \
parts/part_27.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 9a3390ee38f..cf62ff32124 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -597,7 +597,11 @@ void IgorEngine::partMain() {
case 240:
case 241:
case 242:
- part24();
+ if (_game.version == kIdSpaFloppy) {
+ part24Floppy();
+ } else {
+ part24();
+ }
break;
case 250:
case 251:
diff --git a/engines/igor/parts/part_24_floppy.cpp b/engines/igor/parts/part_24_floppy.cpp
new file mode 100644
index 00000000000..531db6128ad
--- /dev/null
+++ b/engines/igor/parts/part_24_floppy.cpp
@@ -0,0 +1,193 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+static const int kChemistryDoorCell = 114 * 320 + 181;
+static const int kChemistryDoorPictureOffset = 18729;
+static const int kChemistryDoorAnimOffset = 18727;
+static const int kChemistryDoorFramesBase = 0x5BD;
+static const int kChemistryDoorFrameSize = 0x7A1;
+static const int kChemistryDoorClosedPictureSize = 29 * 59;
+
+static const uint8 kCloseDoorFrames[3] = { 4, 2, 1 };
+
+void IgorEngine::part24FloppyExecuteAction(int action) {
+ switch (action) {
+ case 101: // exit left
+ _currentPart = 201;
+ break;
+ case 102:
+ part24FloppyEnterChemistryClass();
+ break;
+ case 103: // look at the chemistry door
+ igorSay(201, 1, 0);
+ break;
+ case 104:
+ part24FloppyOpenDoor();
+ break;
+ case 105:
+ part24FloppyCloseDoor();
+ break;
+ case 106: // look at the plaque
+ igorSay(202, 1, 0);
+ break;
+ case 107: // exit right
+ _currentPart = 330;
+ break;
+ default:
+ error("part24FloppyExecuteAction unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::part24FloppyEnterChemistryClass() {
+ if (_objectsState[kChemistryDoorStateIndex] == 0) {
+ return;
+ }
+ _roomObjectAreasTable[_screenLayer2[kChemistryDoorCell]].area = 2;
+ --_walkDataLastIndex;
+ buildWalkPathSimple(179, 120, 181, 114);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _currentPart = 360;
+}
+
+void IgorEngine::part24FloppyOpenDoor() {
+ if (_objectsState[kChemistryDoorStateIndex] == 1) {
+ partMainExecuteAction(11);
+ return;
+ }
+ for (int i = 1; i <= 3; ++i) {
+ drawAnimRect(kChemistryDoorAnimOffset, kChemistryDoorFramesBase + i * kChemistryDoorFrameSize, 31, 63);
+ if (i == 3) {
+ playSound(13, 1);
+ }
+ waitForTimer(127);
+ }
+ _objectsState[kChemistryDoorStateIndex] = 1;
+ part24FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part24FloppyCloseDoor() {
+ if (_objectsState[kChemistryDoorStateIndex] == 0) {
+ partMainExecuteAction(14);
+ return;
+ }
+ for (int i = 1; i <= 3; ++i) {
+ drawAnimRect(kChemistryDoorAnimOffset, kChemistryDoorFramesBase + kCloseDoorFrames[i - 1] * kChemistryDoorFrameSize, 31, 63);
+ if (i == 2) {
+ playSound(14, 1);
+ }
+ waitForTimer(127);
+ }
+ _objectsState[kChemistryDoorStateIndex] = 0;
+ part24FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part24FloppyApplyObjectState(int num) {
+ if (num == 1 || num == 255) {
+ if (_objectsState[kChemistryDoorStateIndex] == 0) {
+ copyArea(_screenLayer1, kChemistryDoorPictureOffset, 320, _animFramesBuffer, 29, 29, 59);
+ _roomActionsTable[30] = 6;
+ } else {
+ copyArea(_screenLayer1, kChemistryDoorPictureOffset, 320, _animFramesBuffer + kChemistryDoorClosedPictureSize, 29, 29, 59);
+ _roomActionsTable[30] = 7;
+ }
+ }
+}
+
+void IgorEngine::part24FloppyEnterFromLeft() {
+ _walkData[0].setPos(0, 134, 2, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 15;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPathSimple(0, 134, 30, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part24FloppyEnterFromRight() {
+ _walkData[0].setPos(319, 134, 4, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPathSimple(319, 134, 289, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part24FloppyEnterFromChemistryClass() {
+ _walkData[0].setPos(181, 114, 3, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 30;
+ _walkDataLastIndex = 0;
+ _roomObjectAreasTable[_screenLayer2[kChemistryDoorCell]].area = 2;
+ buildWalkPathSimple(181, 114, 181, 125);
+ _roomObjectAreasTable[_screenLayer2[kChemistryDoorCell]].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part24Floppy() {
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_CollegeCorridorChemistryClass, IMG_CollegeCorridorChemistryClass, BOX_CollegeCorridorChemistryClass, MSK_CollegeCorridorChemistryClass, TXT_CollegeCorridorChemistryClass);
+ static const int anm[] = { FRM_CollegeCorridorChemistryClassFloppy1, FRM_CollegeCorridorChemistryClassFloppy2, 0 };
+ loadAnimData(anm);
+ loadActionData(DAT_CollegeCorridorChemistryClass);
+ _roomDataOffsets = PART_24_FLOPPY_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143);
+ partMainSetExecuteAction(1, &IgorEngine::part24FloppyExecuteAction);
+ part24FloppyApplyObjectState(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 240) {
+ part24FloppyEnterFromLeft();
+ } else if (_currentPart == 241) {
+ part24FloppyEnterFromRight();
+ } else if (_currentPart == 242) {
+ part24FloppyEnterFromChemistryClass();
+ }
+ }
+ enterPartLoop();
+ while (_currentPart >= 240 && _currentPart <= 242 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 7c47bfdef62..5d80ee0c701 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -883,6 +883,9 @@
#define FRM_CollegeCorridorMargaretFloppy7 1265
#define FRM_CollegeCorridorMargaretFloppy8 1266
+#define FRM_CollegeCorridorChemistryClassFloppy1 1269
+#define FRM_CollegeCorridorChemistryClassFloppy2 1270
+
#define FRM_CollegeStairsSecondFloorFloppy1 1273
#define FRM_CollegeStairsSecondFloorFloppy2 1274
@@ -892,5 +895,11 @@
#define PAL_CollegeCorridorMathClass 1279
#define MSK_CollegeCorridorMathClass 1280
#define BOX_CollegeCorridorMathClass 1281
+#define DAT_CollegeCorridorChemistryClass 1282
+#define TXT_CollegeCorridorChemistryClass 1283
+#define IMG_CollegeCorridorChemistryClass 1284
+#define PAL_CollegeCorridorChemistryClass 1285
+#define MSK_CollegeCorridorChemistryClass 1286
+#define BOX_CollegeCorridorChemistryClass 1287
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_room.cpp b/engines/igor/static_room.cpp
index 603e755207c..921880fdb56 100644
--- a/engines/igor/static_room.cpp
+++ b/engines/igor/static_room.cpp
@@ -227,6 +227,13 @@ const RoomDataOffsets IgorEngine::PART_24_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_24_FLOPPY_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 31, 40 },
+ { 43, 215, 3091, 107, 183, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_25_ROOM_DATA_OFFSETS = {
{ 20, 2, 2, 1 },
{ 31, 40 },
Commit: 0f64925943df28ba1eed8a6aa87d36f1d85dbad6
https://github.com/scummvm/scummvm/commit/0f64925943df28ba1eed8a6aa87d36f1d85dbad6
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:13+01:00
Commit Message:
IGOR: Part 23 for the Spanish floppy
Changed paths:
A engines/igor/parts/part_23_floppy.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/parts/part_23.cpp
engines/igor/parts/part_24.cpp
engines/igor/resource_ids.h
engines/igor/static_room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 0ecb4a120f8..ed0d33e6149 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1155,6 +1155,15 @@ private:
void part23WalkFromRight();
void part23DrawLucasFrame(int frame);
void part23();
+ void part23Floppy();
+ void part23FloppyExecuteAction(int action);
+ void part23FloppyEnterLadiesRoom();
+ void part23FloppyOpenDoor();
+ void part23FloppyCloseDoor();
+ void part23FloppyApplyObjectState(int num);
+ void part23FloppyEnterFromLeft();
+ void part23FloppyEnterFromRight();
+ void part23FloppyEnterFromLadiesRoom();
// college corridor sharon michael
void part24ExecuteAction(int action);
@@ -1878,6 +1887,7 @@ protected:
static const RoomDataOffsets PART_31_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_31_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_20_FLOPPY_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_23_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_24_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_32_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_33_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index e981119dda6..bb86a38dd74 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -45,6 +45,7 @@ MODULE_OBJS = \
parts/part_21_floppy.o \
parts/part_22.o \
parts/part_23.o \
+ parts/part_23_floppy.o \
parts/part_24.o \
parts/part_24_floppy.o \
parts/part_25.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index cf62ff32124..6936096801d 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -592,7 +592,11 @@ void IgorEngine::partMain() {
case 230:
case 231:
case 232:
- part23(); // college corridor lucas
+ if (_game.version == kIdSpaFloppy) {
+ part23Floppy();
+ } else {
+ part23(); // college corridor lucas
+ }
break;
case 240:
case 241:
diff --git a/engines/igor/parts/part_23.cpp b/engines/igor/parts/part_23.cpp
index f78bad575f9..18afb99edcb 100644
--- a/engines/igor/parts/part_23.cpp
+++ b/engines/igor/parts/part_23.cpp
@@ -227,14 +227,14 @@ void IgorEngine::part23() {
if (isCDVersion())
playMusic(2);
_gameState.enableLight = 2;
- loadRoomData(PAL_CollegeCorridorLucas, IMG_CollegeCorridorLucas, BOX_CollegeCorridorLucas, MSK_CollegeCorridorLucas, TXT_CollegeCorridorLucas);
+ loadRoomData(PAL_CollegeCorridorLadiesRoom, IMG_CollegeCorridorLadiesRoom, BOX_CollegeCorridorLadiesRoom, MSK_CollegeCorridorLadiesRoom, TXT_CollegeCorridorLadiesRoom);
static const int anm[] = {
- FRM_CollegeCorridorLucas1, FRM_CollegeCorridorLucas2,
- FRM_CollegeCorridorLucas3, FRM_CollegeCorridorLucas4,
+ FRM_CollegeCorridorLadiesRoom1, FRM_CollegeCorridorLadiesRoom2,
+ FRM_CollegeCorridorLadiesRoom3, FRM_CollegeCorridorLadiesRoom4,
0
};
loadAnimData(anm);
- loadActionData(DAT_CollegeCorridorLucas);
+ loadActionData(DAT_CollegeCorridorLadiesRoom);
_roomDataOffsets = PART_23_ROOM_DATA_OFFSETS;
setRoomWalkBounds(15, 0, 319, 143);
diff --git a/engines/igor/parts/part_23_floppy.cpp b/engines/igor/parts/part_23_floppy.cpp
new file mode 100644
index 00000000000..adadaa88170
--- /dev/null
+++ b/engines/igor/parts/part_23_floppy.cpp
@@ -0,0 +1,205 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+static const int kLadiesRoomDoorCell = 114 * 320 + 181;
+static const int kLadiesRoomDoorPictureOffset = 18730;
+static const int kLadiesRoomDoorAnimOffset = 18727;
+static const int kLadiesRoomDoorFramesBase = 0x5B8;
+static const int kLadiesRoomDoorFrameSize = 0x7E0;
+static const int kLadiesRoomDoorClosedPictureSize = 29 * 60;
+
+void IgorEngine::part23FloppyExecuteAction(int action) {
+ switch (action) {
+ case 101: // exit left
+ _currentPart = 280;
+ break;
+ case 102: // look at the portrait
+ igorSay(201, 2, 0);
+ break;
+ case 103:
+ igorSay(203, 1, 0);
+ break;
+ case 104:
+ igorSay(204, 1, 0);
+ break;
+ case 105:
+ part23FloppyEnterLadiesRoom();
+ break;
+ case 106: // look at the door
+ igorSay(205, 1, 0);
+ break;
+ case 107:
+ part23FloppyOpenDoor();
+ break;
+ case 108:
+ part23FloppyCloseDoor();
+ break;
+ case 109: // exit right
+ _currentPart = 300;
+ break;
+ default:
+ error("part23FloppyExecuteAction unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::part23FloppyEnterLadiesRoom() {
+ if (_objectsState[kLadiesRoomDoorStateIndex] == 0) {
+ return;
+ }
+ _roomObjectAreasTable[_screenLayer2[kLadiesRoomDoorCell]].area = 2;
+ --_walkDataLastIndex;
+ buildWalkPathSimple(179, 120, 181, 114);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _currentPart = 190;
+}
+
+void IgorEngine::part23FloppyOpenDoor() {
+ if (_objectsState[kLadiesRoomDoorStateIndex] == 1) {
+ partMainExecuteAction(11);
+ return;
+ }
+ for (int i = 2; i <= 3; ++i) {
+ drawAnimRect(kLadiesRoomDoorAnimOffset, kLadiesRoomDoorFramesBase + i * kLadiesRoomDoorFrameSize, 32, 63);
+ if (i == 3) {
+ playSound(13, 1);
+ }
+ waitForTimer(127);
+ }
+ _objectsState[kLadiesRoomDoorStateIndex] = 1;
+ part23FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part23FloppyCloseDoor() {
+ if (_objectsState[kLadiesRoomDoorStateIndex] == 0) {
+ partMainExecuteAction(14);
+ return;
+ }
+ for (int i = 2; i >= 1; --i) {
+ drawAnimRect(kLadiesRoomDoorAnimOffset, kLadiesRoomDoorFramesBase + i * kLadiesRoomDoorFrameSize, 32, 63);
+ if (i == 2) {
+ playSound(14, 1);
+ }
+ waitForTimer(127);
+ }
+ _objectsState[kLadiesRoomDoorStateIndex] = 0;
+ part23FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part23FloppyApplyObjectState(int num) {
+ if (num == 1 || num == 255) {
+ if (_objectsState[kLadiesRoomDoorStateIndex] == 0) {
+ copyArea(_screenLayer1, kLadiesRoomDoorPictureOffset, 320, _animFramesBuffer, 29, 29, 60);
+ _roomActionsTable[31] = 6;
+ } else {
+ copyArea(_screenLayer1, kLadiesRoomDoorPictureOffset, 320, _animFramesBuffer + kLadiesRoomDoorClosedPictureSize, 29, 29, 60);
+ _roomActionsTable[31] = 7;
+ }
+ }
+}
+
+void IgorEngine::part23FloppyEnterFromLeft() {
+ _walkData[0].setPos(0, 134, 2, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 15;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPathSimple(0, 134, 30, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part23FloppyEnterFromRight() {
+ _walkData[0].setPos(319, 134, 4, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPathSimple(319, 134, 289, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part23FloppyEnterFromLadiesRoom() {
+ _walkData[0].setPos(181, 114, 3, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 30;
+ _walkDataLastIndex = 0;
+ _roomObjectAreasTable[_screenLayer2[kLadiesRoomDoorCell]].area = 2;
+ buildWalkPathSimple(181, 114, 181, 125);
+ _roomObjectAreasTable[_screenLayer2[kLadiesRoomDoorCell]].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ if (_objectsState[kToiletGirlsHaveLeftStateIndex] == 0) {
+ // The door is closed behind Igor while he is still in front of it
+ drawAnimRect(kLadiesRoomDoorPictureOffset, 0, 29, 60, false, kBlendBehindIgor);
+ playSound(14, 1);
+ _objectsState[kLadiesRoomDoorStateIndex] = 0;
+ part23FloppyApplyObjectState(1);
+ igorSay(206, 2, 0);
+ }
+}
+
+void IgorEngine::part23Floppy() {
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_CollegeCorridorLadiesRoom, IMG_CollegeCorridorLadiesRoom, BOX_CollegeCorridorLadiesRoom, MSK_CollegeCorridorLadiesRoom, TXT_CollegeCorridorLadiesRoom);
+ static const int anm[] = { FRM_CollegeCorridorLadiesRoomFloppy1, FRM_CollegeCorridorLadiesRoomFloppy2, 0 };
+ loadAnimData(anm);
+ loadActionData(DAT_CollegeCorridorLadiesRoom);
+ _roomDataOffsets = PART_23_FLOPPY_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143);
+ partMainSetExecuteAction(1, &IgorEngine::part23FloppyExecuteAction);
+ part23FloppyApplyObjectState(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 230) {
+ part23FloppyEnterFromLeft();
+ } else if (_currentPart == 231) {
+ part23FloppyEnterFromRight();
+ } else if (_currentPart == 232) {
+ part23FloppyEnterFromLadiesRoom();
+ }
+ }
+ enterPartLoop();
+ while (_currentPart >= 230 && _currentPart <= 232 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp
index 706377d0e3a..479a36a3250 100644
--- a/engines/igor/parts/part_24.cpp
+++ b/engines/igor/parts/part_24.cpp
@@ -265,10 +265,10 @@ void IgorEngine::part24() {
if (isCDVersion())
playMusic(2);
_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 };
+ loadRoomData(PAL_CollegeCorridorChemistryClass, IMG_CollegeCorridorChemistryClass, BOX_CollegeCorridorChemistryClass, MSK_CollegeCorridorChemistryClass, TXT_CollegeCorridorChemistryClass);
+ static const int anm[] = { FRM_CollegeCorridorChemistryClass1, FRM_CollegeCorridorChemistryClass2, FRM_CollegeCorridorChemistryClass3, FRM_CollegeCorridorChemistryClass4, 0 };
loadAnimData(anm);
- loadActionData(DAT_CollegeCorridorSharonMichael);
+ loadActionData(DAT_CollegeCorridorChemistryClass);
_roomDataOffsets = PART_24_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
partMainSetExecuteAction(1, &IgorEngine::part24ExecuteAction);
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 5d80ee0c701..175bbe2a1a9 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -80,16 +80,16 @@
#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_CollegeCorridorChemistryClass 59
+#define FRM_CollegeCorridorChemistryClass1 60
+#define FRM_CollegeCorridorChemistryClass2 61
+#define FRM_CollegeCorridorChemistryClass3 62
+#define FRM_CollegeCorridorChemistryClass4 63
+#define TXT_CollegeCorridorChemistryClass 64
+#define IMG_CollegeCorridorChemistryClass 65
+#define PAL_CollegeCorridorChemistryClass 66
+#define MSK_CollegeCorridorChemistryClass 67
+#define BOX_CollegeCorridorChemistryClass 68
#define DAT_CollegeCorridorCaroline 69
#define FRM_CollegeCorridorCaroline1 70
#define FRM_CollegeCorridorCaroline3 71
@@ -99,16 +99,16 @@
#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_CollegeCorridorLadiesRoom 78
+#define FRM_CollegeCorridorLadiesRoom1 79
+#define FRM_CollegeCorridorLadiesRoom2 80
+#define FRM_CollegeCorridorLadiesRoom3 81
+#define FRM_CollegeCorridorLadiesRoom4 82
+#define TXT_CollegeCorridorLadiesRoom 83
+#define IMG_CollegeCorridorLadiesRoom 84
+#define PAL_CollegeCorridorLadiesRoom 85
+#define MSK_CollegeCorridorLadiesRoom 86
+#define BOX_CollegeCorridorLadiesRoom 87
#define DAT_CollegeCorridorMargaret 88
#define DLG_CollegeCorridorMargaret 89
#define FRM_CollegeCorridorMargaret1 90
@@ -895,11 +895,7 @@
#define PAL_CollegeCorridorMathClass 1279
#define MSK_CollegeCorridorMathClass 1280
#define BOX_CollegeCorridorMathClass 1281
-#define DAT_CollegeCorridorChemistryClass 1282
-#define TXT_CollegeCorridorChemistryClass 1283
-#define IMG_CollegeCorridorChemistryClass 1284
-#define PAL_CollegeCorridorChemistryClass 1285
-#define MSK_CollegeCorridorChemistryClass 1286
-#define BOX_CollegeCorridorChemistryClass 1287
+#define FRM_CollegeCorridorLadiesRoomFloppy1 1257
+#define FRM_CollegeCorridorLadiesRoomFloppy2 1258
#endif // IGOR_RESOURCE_IDS
diff --git a/engines/igor/static_room.cpp b/engines/igor/static_room.cpp
index 921880fdb56..cf6914684cb 100644
--- a/engines/igor/static_room.cpp
+++ b/engines/igor/static_room.cpp
@@ -227,6 +227,13 @@ const RoomDataOffsets IgorEngine::PART_24_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_23_FLOPPY_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 31, 40 },
+ { 43, 215, 3091, 107, 183, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_24_FLOPPY_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 },
{ 31, 40 },
Commit: f41a0d51f2e02418b970872694a69cc77569ead3
https://github.com/scummvm/scummvm/commit/f41a0d51f2e02418b970872694a69cc77569ead3
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:13+01:00
Commit Message:
IGOR: Room 28 on the Spanish Floppy
Changed paths:
A engines/igor/parts/part_28_floppy.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index ed0d33e6149..1543cb95383 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1245,6 +1245,17 @@ private:
void part28EnterAndCheckGrades();
void part28DrawFolder(int frame);
void part28();
+ void part28Floppy();
+ void part28FloppyExecuteAction(int action);
+ void part28FloppyTalkToCaroline();
+ void part28FloppyTakeFolder();
+ void part28FloppyUpdateCarolineDialogue(int action);
+ void part28FloppyUpdateBackground();
+ void part28FloppyApplyObjectState(int num);
+ void part28FloppyDrawCaroline();
+ void part28FloppyDrawCarolineFrame(int frame);
+ void part28FloppyEnterFromRight();
+ void part28FloppyEnterAndCheckGrades();
// college corridor stairs first floor
void part30ExecuteAction(int action);
@@ -1888,6 +1899,7 @@ protected:
static const RoomDataOffsets PART_31_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_20_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_23_FLOPPY_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_28_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_24_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_32_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_33_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index bb86a38dd74..333a1bbbbc8 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -52,6 +52,7 @@ MODULE_OBJS = \
parts/part_26.o \
parts/part_27.o \
parts/part_28.o \
+ parts/part_28_floppy.o \
parts/part_30.o \
parts/part_30_floppy.o \
parts/part_31.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 6936096801d..ab8701f6b59 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -622,7 +622,11 @@ void IgorEngine::partMain() {
break;
case 280:
case 281:
- part28(); // college corridor caroline
+ if (_game.version == kIdSpaFloppy) {
+ part28Floppy();
+ } else {
+ part28(); // college corridor caroline
+ }
break;
case 300:
case 301:
diff --git a/engines/igor/parts/part_28_floppy.cpp b/engines/igor/parts/part_28_floppy.cpp
new file mode 100644
index 00000000000..45ba207ccbd
--- /dev/null
+++ b/engines/igor/parts/part_28_floppy.cpp
@@ -0,0 +1,299 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+static const int kCarolineDoorStateIndex = 86;
+
+static const int kCarolineTalkX = 259;
+static const int kCarolineTalkY = 76;
+static const int kCarolineTalkR = 55;
+static const int kCarolineTalkG = 39;
+static const int kCarolineTalkB = 51;
+
+static const int kCarolineOffset = 25211;
+static const int kCarolineFrameSize = 16 * 42;
+static const int kCarolineRestFrameOffset = 0xD20;
+
+static const int kDoorPictureOffset = 19030;
+static const int kClosedDoorPicture = 15587;
+static const int kOpenDoorPicture = kClosedDoorPicture + 28 * 58;
+static const int kFolderPictureOffset = 31260;
+static const int kFolderPicture = 15431;
+static const int kTakeFolderOffset = 24202;
+static const int kTakeFolderFrames = 0x1451;
+static const int kTakeFolderFrameSize = 0x5EF;
+
+void IgorEngine::part28FloppyExecuteAction(int action) {
+ switch (action) {
+ case 101: // read plaque
+ igorSay(201, 1, 0);
+ break;
+ case 102: // look at door
+ igorSay(202, 1, 0);
+ break;
+ case 103: // open door
+ if (_objectsState[kCarolineDoorStateIndex] == 1) {
+ partMainExecuteAction(11);
+ } else {
+ igorSay({ { 228, 1, 0 }, { 229, 1, 0 } });
+ }
+ break;
+ case 104: // close door
+ // The door never gets opened, so it is never open here
+ if (_objectsState[kCarolineDoorStateIndex] == 0) {
+ partMainExecuteAction(14);
+ }
+ break;
+ case 105:
+ part28FloppyTakeFolder();
+ break;
+ case 106: // look at the folder
+ igorSay(203, 1, 0);
+ break;
+ case 107:
+ part28FloppyTalkToCaroline();
+ break;
+ case 108: // look at Caroline
+ igorSay(204, 1, 0);
+ break;
+ case 109: // look at the message board
+ if (_objectsState[kExamCompletedStateIndex] == 0) {
+ igorSay({ { 205, 1, 0 }, { 206, 1, 0 } });
+ } else {
+ igorSay(234, 1, 0);
+ }
+ break;
+ case 110: // exit right
+ _currentPart = 230;
+ break;
+ case 111: // give the folder to Caroline
+ if (_objectsState[kFolderSwappedStateIndex] == 0) {
+ igorSay(226, 1, 0);
+ } else {
+ igorSay(227, 1, 0);
+ }
+ break;
+ default:
+ error("part28FloppyExecuteAction unhandled action %d", action);
+ break;
+ }
+}
+
+// Caroline's idle animation is only driven by the room loop and while Igor speaks;
+// her own talking loops never run it.
+void IgorEngine::part28FloppyTalkToCaroline() {
+ const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
+ if (_objectsState[kExamCompletedStateIndex] == 1) {
+ igorSayAndWait(218, 1, 0);
+ _updateRoomBackground = 0;
+ cutsceneSayWithCallback(kCarolineTalkX, kCarolineTalkY, kCarolineTalkR, kCarolineTalkG, kCarolineTalkB,
+ { { 211, 1, 0 }, { 212, 1, 0 }, { 213, 2, 0 }, { 215, 1, 0 }, { 216, 1, 0 } },
+ &IgorEngine::part28FloppyUpdateCarolineDialogue);
+ cutsceneSayWithCallback(kCarolineTalkX, kCarolineTalkY, kCarolineTalkR, kCarolineTalkG, kCarolineTalkB,
+ 217, 1, 0, &IgorEngine::part28FloppyUpdateCarolineDialogue);
+ _updateRoomBackground = updateRoomBackground;
+ --_walkDataLastIndex;
+ buildWalkPath(288, 122, 160, 140);
+ _walkDataCurrentIndex = 1;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkData[_walkDataLastIndex].posNum = 3;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ igorSay(222, 2, 0);
+ return;
+ }
+ if (_objectsState[kCarolineFolderStateIndex] < 2) {
+ igorSayAndWait(207, 1, 0);
+ } else {
+ igorSayAndWait(218, 1, 0);
+ }
+ _updateRoomBackground = 0;
+ if (_objectsState[kCarolineFolderStateIndex] < 2) {
+ cutsceneSayWithCallback(kCarolineTalkX, kCarolineTalkY, kCarolineTalkR, kCarolineTalkG, kCarolineTalkB,
+ 208, 1, 0, &IgorEngine::part28FloppyUpdateCarolineDialogue);
+ } else {
+ cutsceneSayWithCallback(kCarolineTalkX, kCarolineTalkY, kCarolineTalkR, kCarolineTalkG, kCarolineTalkB,
+ { { 219, 2, 0 }, { 221, 1, 0 } }, &IgorEngine::part28FloppyUpdateCarolineDialogue);
+ }
+ _updateRoomBackground = updateRoomBackground;
+}
+
+void IgorEngine::part28FloppyTakeFolder() {
+ igorSay(230, 1, 0);
+ for (int i = 1; i <= 2; ++i) {
+ drawAnimRect(kTakeFolderOffset, kTakeFolderFrames + i * kTakeFolderFrameSize, 31, 49);
+ if (i < 2) {
+ waitForTimer(91);
+ }
+ }
+
+ ++_inventoryInfo[kInventoryCount];
+ _inventoryInfo[_inventoryInfo[kInventoryCount] - 1] = kInventoryObjectFolder;
+ _inventoryInfo[57] = _inventoryInfo[kInventoryCount];
+ if (_inventoryInfo[kInventoryCount] > 8) {
+ _inventoryInfo[kInventoryFirstVisible] = _inventoryInfo[kInventoryCount] - 7;
+ }
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
+ _objectsState[kCarolineFolderStateIndex] = 1;
+ part28FloppyApplyObjectState(255);
+}
+
+void IgorEngine::part28FloppyUpdateCarolineDialogue(int action) {
+ switch (action) {
+ case kUpdateDialogueAnimEndOfSentence:
+ part28FloppyDrawCarolineFrame(6);
+ break;
+ case kUpdateDialogueAnimMiddleOfSentence:
+ part28FloppyDrawCarolineFrame(getRandomNumber(4) + 6);
+ break;
+ }
+}
+
+void IgorEngine::part28FloppyUpdateBackground() {
+ if (compareGameTick(61)) {
+ if (_gameState.unk10 > 3) {
+ part28FloppyDrawCarolineFrame(_gameState.unk10);
+ if (_gameState.unk10 == 4) {
+ ++_gameState.unk10;
+ } else {
+ _gameState.unk10 = 4;
+ }
+ if (getRandomNumber(7) == 0) {
+ _gameState.unk10 = 1;
+ }
+ } else {
+ part28FloppyDrawCarolineFrame(_gameState.unk10);
+ ++_gameState.unk10;
+ }
+ }
+}
+
+void IgorEngine::part28FloppyApplyObjectState(int num) {
+ if (num == 1 || num == 255) {
+ if (_objectsState[kCarolineDoorStateIndex] == 0) {
+ copyArea(_screenLayer1, kDoorPictureOffset, 320, _animFramesBuffer + kClosedDoorPicture, 28, 28, 58);
+ _roomActionsTable[30] = 6;
+ } else {
+ copyArea(_screenLayer1, kDoorPictureOffset, 320, _animFramesBuffer + kOpenDoorPicture, 28, 28, 58);
+ _roomActionsTable[30] = 7;
+ }
+ }
+ if (num == 2 || num == 255) {
+ if (_objectsState[kCarolineFolderStateIndex] == 0) {
+ copyArea(_screenLayer1, kFolderPictureOffset, 320, _animFramesBuffer + kFolderPicture, 13, 13, 12);
+ } else {
+ _roomObjectAreasTable[6].object = 0;
+ }
+ }
+}
+
+void IgorEngine::part28FloppyDrawCaroline() {
+ copyArea(_screenLayer1, kCarolineOffset, 320, _animFramesBuffer + kCarolineRestFrameOffset, 16, 16, 42);
+}
+
+void IgorEngine::part28FloppyDrawCarolineFrame(int frame) {
+ _roomCursorOn = false;
+ drawAnimRect(kCarolineOffset, (frame - 1) * kCarolineFrameSize, 16, 42, true, kBlendBehindIgorAndText);
+ if (_dialogueCursorOn) {
+ _roomCursorOn = true;
+ }
+}
+
+void IgorEngine::part28FloppyEnterFromRight() {
+ _walkData[0].setPos(319, 134, 4, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPath(319, 134, 289, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part28FloppyEnterAndCheckGrades() {
+ setupDefaultPalette();
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
+ drawVerbsPanel();
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
+ part28FloppyApplyObjectState(255);
+ fadeIn(768);
+ _walkData[0].setPos(319, 134, 4, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ _walkDataCurrentIndex = 1;
+ buildWalkPath(319, 134, 288, 122);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkData[_walkDataLastIndex].posNum = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ igorSayAndWait(209, 2, 0);
+ waitForTimer(255);
+ igorSayAndWait({ { 231, 1, 0 }, { 224, 2, 0 }, { 232, 2, 0 } });
+}
+
+void IgorEngine::part28Floppy() {
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_CollegeCorridorCaroline, IMG_CollegeCorridorCaroline, BOX_CollegeCorridorCaroline, MSK_CollegeCorridorCaroline, TXT_CollegeCorridorCaroline);
+ memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
+ static const int anm[] = {
+ FRM_CollegeCorridorCarolineFloppy1, FRM_CollegeCorridorCarolineFloppy2, FRM_CollegeCorridorCarolineFloppy3,
+ FRM_CollegeCorridorCarolineFloppy4, FRM_CollegeCorridorCarolineFloppy5, 0
+ };
+ loadAnimData(anm);
+ loadActionData(DAT_CollegeCorridorCaroline);
+ _roomDataOffsets = PART_28_FLOPPY_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(23, 0, 319, 143);
+ partMainSetExecuteAction(1, &IgorEngine::part28FloppyExecuteAction);
+ _updateRoomBackground = &IgorEngine::part28FloppyUpdateBackground;
+ part28FloppyDrawCaroline();
+ part28FloppyApplyObjectState(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ if (!restoreRoomAfterLoad()) {
+ _gameState.unk10 = 4;
+ _currentAction.verb = kVerbWalk;
+ if (_currentPart == 280) {
+ fadeIn(768);
+ part28FloppyEnterFromRight();
+ } else if (_currentPart == 281) {
+ part28FloppyEnterAndCheckGrades();
+ }
+ }
+ enterPartLoop();
+ while ((_currentPart == 280 || _currentPart == 281) && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ if (!_gameStateLoaded && _objectsState[kCarolineFolderStateIndex] == 1) {
+ _objectsState[kCarolineFolderStateIndex] = 2;
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 175bbe2a1a9..f4ae3f5d6dc 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -883,6 +883,12 @@
#define FRM_CollegeCorridorMargaretFloppy7 1265
#define FRM_CollegeCorridorMargaretFloppy8 1266
+#define FRM_CollegeCorridorCarolineFloppy1 1252
+#define FRM_CollegeCorridorCarolineFloppy2 1253
+#define FRM_CollegeCorridorCarolineFloppy3 1254
+#define FRM_CollegeCorridorCarolineFloppy4 1255
+#define FRM_CollegeCorridorCarolineFloppy5 1256
+
#define FRM_CollegeCorridorChemistryClassFloppy1 1269
#define FRM_CollegeCorridorChemistryClassFloppy2 1270
diff --git a/engines/igor/static_room.cpp b/engines/igor/static_room.cpp
index cf6914684cb..cdfb4c30f13 100644
--- a/engines/igor/static_room.cpp
+++ b/engines/igor/static_room.cpp
@@ -227,6 +227,13 @@ const RoomDataOffsets IgorEngine::PART_24_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_28_FLOPPY_ROOM_DATA_OFFSETS = {
+ { 20, 2, 2, 1 },
+ { 33, 46 },
+ { 51, 259, 3275, 155, 231, 84 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_23_FLOPPY_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 },
{ 31, 40 },
Commit: cb672b328f53722281d517e048470e0d03811440
https://github.com/scummvm/scummvm/commit/cb672b328f53722281d517e048470e0d03811440
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:14+01:00
Commit Message:
IGOR: Implement part 25
Changed paths:
A engines/igor/parts/part_25_floppy.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 1543cb95383..cb71c958301 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1204,6 +1204,15 @@ private:
void part25DrawClosedDoor();
void part25DrawOpenDoor();
void part25();
+ void part25Floppy();
+ void part25FloppyExecuteAction(int action);
+ void part25FloppyEnterMensToilet();
+ void part25FloppyOpenDoor();
+ void part25FloppyCloseDoor();
+ void part25FloppyApplyObjectState(int num);
+ void part25FloppyEnterFromLeft();
+ void part25FloppyEnterFromRight();
+ void part25FloppyEnterFromMensToilet();
// college corridor miss barrymore
void part26ExecuteAction(int action);
@@ -1890,6 +1899,7 @@ protected:
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_25_FLOPPY_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;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 333a1bbbbc8..0e152d78e05 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -49,6 +49,7 @@ MODULE_OBJS = \
parts/part_24.o \
parts/part_24_floppy.o \
parts/part_25.o \
+ parts/part_25_floppy.o \
parts/part_26.o \
parts/part_27.o \
parts/part_28.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index ab8701f6b59..886296ef808 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -610,7 +610,11 @@ void IgorEngine::partMain() {
case 250:
case 251:
case 252:
- part25();
+ if (_game.version == kIdSpaFloppy) {
+ part25Floppy();
+ } else {
+ part25();
+ }
break;
case 260:
case 261:
diff --git a/engines/igor/parts/part_25_floppy.cpp b/engines/igor/parts/part_25_floppy.cpp
new file mode 100644
index 00000000000..81861a1c17e
--- /dev/null
+++ b/engines/igor/parts/part_25_floppy.cpp
@@ -0,0 +1,198 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+static const int kMensDoorCell = 114 * 320 + 181;
+static const int kMensDoorPictureOffset = 18729;
+static const int kMensDoorAnimOffset = 18728;
+static const int kMensDoorFramesBase = 0x5FC;
+static const int kMensDoorFrameSize = 0x762;
+static const int kMensDoorClosedPictureSize = 29 * 59;
+
+void IgorEngine::part25FloppyExecuteAction(int action) {
+ switch (action) {
+ case 101: // exit left
+ _currentPart = 260;
+ break;
+ case 102: // look at lockers
+ igorSay(201, 2, 0);
+ break;
+ case 103: // open lockers
+ igorSay(203, 1, 0);
+ break;
+ case 104: // close lockers
+ igorSay(204, 1, 0);
+ break;
+ case 105:
+ part25FloppyEnterMensToilet();
+ break;
+ case 106: // look at door
+ igorSay(205, 1, 0);
+ break;
+ case 107:
+ part25FloppyOpenDoor();
+ break;
+ case 108:
+ part25FloppyCloseDoor();
+ break;
+ case 109: // exit right
+ _currentPart = 310;
+ break;
+ default:
+ error("part25FloppyExecuteAction unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::part25FloppyEnterMensToilet() {
+ if (_objectsState[kMensRoomDoorStateIndex] == 0) {
+ return;
+ }
+ _roomObjectAreasTable[_screenLayer2[kMensDoorCell]].area = 2;
+ --_walkDataLastIndex;
+ buildWalkPathSimple(180, 120, 181, 114);
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _currentPart = 180;
+}
+
+void IgorEngine::part25FloppyOpenDoor() {
+ if (_objectsState[kMensRoomDoorStateIndex] == 1) {
+ partMainExecuteAction(11);
+ return;
+ }
+ for (int i = 1; i <= 3; ++i) {
+ drawAnimRect(kMensDoorAnimOffset, kMensDoorFramesBase + i * kMensDoorFrameSize, 30, 63);
+ if (i == 3) {
+ playSound(13, 1);
+ }
+ waitForTimer(127);
+ }
+ _objectsState[kMensRoomDoorStateIndex] = 1;
+ part25FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part25FloppyCloseDoor() {
+ if (_objectsState[kMensRoomDoorStateIndex] == 0) {
+ partMainExecuteAction(14);
+ return;
+ }
+ static const uint8 kCloseDoorFrames[3] = { 4, 2, 1 };
+ for (int i = 1; i <= 3; ++i) {
+ drawAnimRect(kMensDoorAnimOffset, kMensDoorFramesBase + kCloseDoorFrames[i - 1] * kMensDoorFrameSize, 30, 63);
+ if (i == 2) {
+ playSound(14, 1);
+ }
+ waitForTimer(127);
+ }
+ _objectsState[kMensRoomDoorStateIndex] = 0;
+ part25FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part25FloppyApplyObjectState(int num) {
+ if (num == 1 || num == 255) {
+ if (_objectsState[kMensRoomDoorStateIndex] == 0) { // door state
+ copyArea(_screenLayer1, kMensDoorPictureOffset, 320, _animFramesBuffer, 29, 29, 59);
+ _roomActionsTable[31] = 6;
+ } else {
+ copyArea(_screenLayer1, kMensDoorPictureOffset, 320, _animFramesBuffer + kMensDoorClosedPictureSize, 29, 29, 59);
+ _roomActionsTable[31] = 7;
+ }
+ }
+}
+
+void IgorEngine::part25FloppyEnterFromLeft() {
+ _walkData[0].setPos(0, 134, 2, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 15;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPathSimple(0, 134, 30, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part25FloppyEnterFromRight() {
+ _walkData[0].setPos(319, 134, 4, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPathSimple(319, 134, 289, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part25FloppyEnterFromMensToilet() {
+ _walkData[0].setPos(181, 114, 3, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 30;
+ _walkDataLastIndex = 0;
+ _roomObjectAreasTable[_screenLayer2[kMensDoorCell]].area = 2;
+ buildWalkPathSimple(181, 114, 181, 125);
+ _roomObjectAreasTable[_screenLayer2[kMensDoorCell]].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part25Floppy() {
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_CollegeCorridorAnnouncementBoard, IMG_CollegeCorridorAnnouncementBoard, BOX_CollegeCorridorAnnouncementBoard, MSK_CollegeCorridorAnnouncementBoard, TXT_CollegeCorridorAnnouncementBoard);
+ static const int anm[] = { FRM_CollegeCorridorAnnouncementBoardFloppy1, FRM_CollegeCorridorAnnouncementBoardFloppy2, 0 };
+ loadAnimData(anm);
+ loadActionData(DAT_CollegeCorridorAnnouncementBoard);
+ _roomDataOffsets = PART_25_FLOPPY_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 319, 143);
+ partMainSetExecuteAction(1, &IgorEngine::part25FloppyExecuteAction);
+ part25FloppyApplyObjectState(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 250) {
+ part25FloppyEnterFromLeft();
+ } else if (_currentPart == 251) {
+ part25FloppyEnterFromRight();
+ } else if (_currentPart == 252) {
+ part25FloppyEnterFromMensToilet();
+ }
+ }
+ enterPartLoop();
+ while (_currentPart >= 250 && _currentPart <= 252 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index f4ae3f5d6dc..39037c58e4b 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -883,6 +883,9 @@
#define FRM_CollegeCorridorMargaretFloppy7 1265
#define FRM_CollegeCorridorMargaretFloppy8 1266
+#define FRM_CollegeCorridorAnnouncementBoardFloppy1 1250
+#define FRM_CollegeCorridorAnnouncementBoardFloppy2 1251
+
#define FRM_CollegeCorridorCarolineFloppy1 1252
#define FRM_CollegeCorridorCarolineFloppy2 1253
#define FRM_CollegeCorridorCarolineFloppy3 1254
diff --git a/engines/igor/static_room.cpp b/engines/igor/static_room.cpp
index cdfb4c30f13..633ecad5531 100644
--- a/engines/igor/static_room.cpp
+++ b/engines/igor/static_room.cpp
@@ -248,6 +248,13 @@ const RoomDataOffsets IgorEngine::PART_24_FLOPPY_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_25_FLOPPY_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 31, 40 },
+ { 43, 215, 3091, 107, 183, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_25_ROOM_DATA_OFFSETS = {
{ 20, 2, 2, 1 },
{ 31, 40 },
Commit: 5044fa8745cfed0b05f0f8ef76e068b5896be0b5
https://github.com/scummvm/scummvm/commit/5044fa8745cfed0b05f0f8ef76e068b5896be0b5
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:14+01:00
Commit Message:
IGOR: Implements part 26 in Spanish floppy
Changed paths:
A engines/igor/parts/part_26_floppy.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index cb71c958301..adee17fcec9 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1227,6 +1227,14 @@ private:
void part26EnterFromLaboratory();
void part26DrawMissSullivanFrame(int frame);
void part26();
+ void part26Floppy();
+ void part26FloppyExecuteAction(int action);
+ void part26FloppyOpenDoor();
+ void part26FloppyCloseDoor();
+ void part26FloppyEnterLab();
+ void part26FloppyApplyObjectState(int num);
+ void part26FloppyEnterFromRight();
+ void part26FloppyEnterFromLaboratory();
// college lockers
void part27ExecuteAction(int action);
@@ -1901,6 +1909,7 @@ protected:
static const RoomDataOffsets PART_25_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_25_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_26_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_26_FLOPPY_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;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 0e152d78e05..0b5d98297ec 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -51,6 +51,7 @@ MODULE_OBJS = \
parts/part_25.o \
parts/part_25_floppy.o \
parts/part_26.o \
+ parts/part_26_floppy.o \
parts/part_27.o \
parts/part_28.o \
parts/part_28_floppy.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 886296ef808..104f772b53c 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -618,7 +618,11 @@ void IgorEngine::partMain() {
break;
case 260:
case 261:
- part26();
+ if (_game.version == kIdSpaFloppy) {
+ part26Floppy();
+ } else {
+ part26();
+ }
break;
case 270:
case 271:
diff --git a/engines/igor/parts/part_26_floppy.cpp b/engines/igor/parts/part_26_floppy.cpp
new file mode 100644
index 00000000000..2cb691576e7
--- /dev/null
+++ b/engines/igor/parts/part_26_floppy.cpp
@@ -0,0 +1,195 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+static const int kLabDoorCell = 128 * 320;
+static const int kLabDoorPictureOffset = 21458;
+static const int kLabDoorAnimOffset = 21459;
+static const int kLabDoorPictureSize = 13 * 67;
+static const int kLabDoorFrameSize = 27 * 67;
+
+void IgorEngine::part26FloppyExecuteAction(int action) {
+ switch (action) {
+ case 101: // look at plaque
+ igorSay(202, 1, 0);
+ break;
+ case 102: // look at door
+ igorSay(203, 1, 0);
+ break;
+ case 103:
+ part26FloppyOpenDoor();
+ break;
+ case 104:
+ part26FloppyCloseDoor();
+ break;
+ case 105: // look at message board
+ switch (getRandomNumber(2) + 1) {
+ case 1:
+ igorSay({ { 204, 2, 0 }, { 206, 1, 0 } });
+ break;
+ case 2:
+ igorSay({ { 207, 1, 0 }, { 208, 1, 0 }, { 209, 1, 0 }, { 206, 1, 0 } });
+ break;
+ case 3:
+ igorSay({ { 210, 1, 0 }, { 211, 1, 0 }, { 206, 1, 0 } });
+ break;
+ }
+ break;
+ case 106: // exit right
+ _currentPart = 250;
+ break;
+ case 107:
+ part26FloppyEnterLab();
+ break;
+ default:
+ error("part26FloppyExecuteAction unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::part26FloppyOpenDoor() {
+ if (_objectsState[kLaboratoryDoorOpenStateIndex] == 1) {
+ partMainExecuteAction(11);
+ return;
+ }
+ for (int i = 2; i <= 3; ++i) {
+ drawAnimRect(kLabDoorAnimOffset, i * kLabDoorFrameSize - 67, 27, 67);
+ if (i == 3) {
+ playSound(13, 1);
+ }
+ waitForTimer(127);
+ }
+ _objectsState[kLaboratoryDoorOpenStateIndex] = 1;
+ part26FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part26FloppyCloseDoor() {
+ if (_objectsState[kLaboratoryDoorOpenStateIndex] == 0) {
+ partMainExecuteAction(14);
+ return;
+ }
+ for (int i = 2; i >= 1; --i) {
+ drawAnimRect(kLabDoorAnimOffset, i * kLabDoorFrameSize - 67, 27, 67);
+ if (i == 2) {
+ playSound(14, 1);
+ }
+ waitForTimer(127);
+ }
+ _objectsState[kLaboratoryDoorOpenStateIndex] = 0;
+ part26FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part26FloppyEnterLab() {
+ if (_objectsState[kLaboratoryDoorOpenStateIndex] == 0) {
+ return;
+ }
+ _roomObjectAreasTable[_screenLayer2[kLabDoorCell]].area = 1;
+ --_walkDataLastIndex;
+ buildWalkPathSimple(37, 131, 0, 128);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ _currentPart = 160;
+}
+
+void IgorEngine::part26FloppyApplyObjectState(int num) {
+ if (num == 1 || num == 255) {
+ if (_objectsState[kLaboratoryDoorOpenStateIndex] == 0) {
+ copyArea(_screenLayer1, kLabDoorPictureOffset, 320, _animFramesBuffer, 13, 13, 67);
+ _roomActionsTable[2] = 6;
+ } else {
+ copyArea(_screenLayer1, kLabDoorPictureOffset, 320, _animFramesBuffer + kLabDoorPictureSize, 13, 13, 67);
+ _roomActionsTable[2] = 7;
+ }
+ }
+}
+
+void IgorEngine::part26FloppyEnterFromRight() {
+ _walkData[0].setPos(319, 134, 4, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPathSimple(319, 134, 289, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part26FloppyEnterFromLaboratory() {
+ _walkData[0].setPos(0, 128, 3, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 30;
+ _walkDataLastIndex = 0;
+ _roomObjectAreasTable[_screenLayer2[kLabDoorCell]].area = 1;
+ buildWalkPathSimple(0, 128, 45, 132);
+ _roomObjectAreasTable[_screenLayer2[kLabDoorCell]].area = 0;
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+ if (_objectsState[kMargaretStateIndex] == kMargaretStatePhotoTaken) {
+ igorSay({ { 212, 1, 0 }, { 213, 2, 0 }, { 215, 1, 0 } });
+ _objectsState[kMargaretStateIndex] = kMargaretStatePhotoSequenceComplete;
+ drawVerbsPanel();
+ redrawVerb(kVerbWalk, true);
+ _currentAction.verb = kVerbWalk;
+ drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
+ part26FloppyApplyObjectState(255);
+ }
+}
+
+void IgorEngine::part26Floppy() {
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_CollegeCorridorMissBarrymore, IMG_CollegeCorridorMissBarrymore, BOX_CollegeCorridorMissBarrymore, MSK_CollegeCorridorMissBarrymore, TXT_CollegeCorridorMissBarrymore);
+ static const int anm[] = { FRM_CollegeCorridorMissBarrymoreFloppy1, FRM_CollegeCorridorMissBarrymoreFloppy2, 0 };
+ loadAnimData(anm);
+ loadActionData(DAT_CollegeCorridorMissBarrymore);
+ _roomDataOffsets = PART_26_FLOPPY_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(24, 0, 319, 143);
+ partMainSetExecuteAction(1, &IgorEngine::part26FloppyExecuteAction);
+ part26FloppyApplyObjectState(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ if (_currentPart == 260) {
+ part26FloppyEnterFromRight();
+ } else {
+ part26FloppyEnterFromLaboratory();
+ }
+ }
+ enterPartLoop();
+ while (_currentPart >= 260 && _currentPart <= 261 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 39037c58e4b..796777333d9 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -886,6 +886,9 @@
#define FRM_CollegeCorridorAnnouncementBoardFloppy1 1250
#define FRM_CollegeCorridorAnnouncementBoardFloppy2 1251
+#define FRM_CollegeCorridorMissBarrymoreFloppy1 1267
+#define FRM_CollegeCorridorMissBarrymoreFloppy2 1268
+
#define FRM_CollegeCorridorCarolineFloppy1 1252
#define FRM_CollegeCorridorCarolineFloppy2 1253
#define FRM_CollegeCorridorCarolineFloppy3 1254
diff --git a/engines/igor/static_room.cpp b/engines/igor/static_room.cpp
index 633ecad5531..b9a36e68a0f 100644
--- a/engines/igor/static_room.cpp
+++ b/engines/igor/static_room.cpp
@@ -262,6 +262,13 @@ const RoomDataOffsets IgorEngine::PART_25_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_26_FLOPPY_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 3, 12 },
+ { 15, 187, 3063, 79, 155, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_26_ROOM_DATA_OFFSETS = {
{ 20, 2, 2, 1 },
{ 32, 43 },
Commit: e15513059a51bfb9290eb017c0d1ecd7e3a8b05a
https://github.com/scummvm/scummvm/commit/e15513059a51bfb9290eb017c0d1ecd7e3a8b05a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:14+01:00
Commit Message:
IGOR: Spanish floppy part 27
Changed paths:
A engines/igor/parts/part_27_floppy.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/part_main.cpp
engines/igor/resource_ids.h
engines/igor/static_room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index adee17fcec9..da7509be65d 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1248,6 +1248,15 @@ private:
void part27DrawOpenLocker();
void part27EnterFromLibrary();
void part27();
+ void part27Floppy();
+ void part27FloppyExecuteAction(int action);
+ void part27FloppyDrawLockerFrame(int frame);
+ void part27FloppyOpenPhilipLocker();
+ void part27FloppyClosePhilipLocker();
+ void part27FloppyTakeBottle();
+ void part27FloppyUseFlaskOnLocker();
+ void part27FloppyApplyObjectState(int num);
+ void part27FloppyEnterFromLeft();
// college corridor caroline
void part28ExecuteAction(int action);
@@ -1911,6 +1920,7 @@ protected:
static const RoomDataOffsets PART_26_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_26_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_27_ROOM_DATA_OFFSETS;
+ static const RoomDataOffsets PART_27_FLOPPY_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_28_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_30_ROOM_DATA_OFFSETS;
static const RoomDataOffsets PART_30_FLOPPY_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 0b5d98297ec..99d22069e18 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -53,6 +53,7 @@ MODULE_OBJS = \
parts/part_26.o \
parts/part_26_floppy.o \
parts/part_27.o \
+ parts/part_27_floppy.o \
parts/part_28.o \
parts/part_28_floppy.o \
parts/part_30.o \
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 104f772b53c..b4bf4b47a91 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -626,7 +626,11 @@ void IgorEngine::partMain() {
break;
case 270:
case 271:
- part27();
+ if (_game.version == kIdSpaFloppy) {
+ part27Floppy();
+ } else {
+ part27();
+ }
break;
case 280:
case 281:
diff --git a/engines/igor/parts/part_27_floppy.cpp b/engines/igor/parts/part_27_floppy.cpp
new file mode 100644
index 00000000000..0e9a7848bf8
--- /dev/null
+++ b/engines/igor/parts/part_27_floppy.cpp
@@ -0,0 +1,210 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "igor/igor.h"
+
+namespace Igor {
+
+static const int kLockerAnimOffset = 19715;
+static const int kLockerFrameSize = 34 * 63;
+static const int kLockerPictureOffset = 19397;
+static const int kLockerClosedPictureOffset = 8568;
+static const int kLockerOpenPictureOffset = 8568 + 32 * 56;
+
+void IgorEngine::part27FloppyExecuteAction(int action) {
+ switch (action) {
+ case 101: // exit left
+ _currentPart = 211;
+ break;
+ case 102: // look at the lockers
+ if (_objectsState[kLockersExaminedStateIndex] == 0) {
+ igorSay(216, 2, 0);
+ _objectsState[kLockersExaminedStateIndex] = 1;
+ part27FloppyApplyObjectState(255);
+ } else {
+ igorSay(201, 1, 0);
+ }
+ break;
+ case 103: // open lockers
+ igorSay(203, 1, 0);
+ break;
+ case 104: // close lockers
+ igorSay(204, 1, 0);
+ break;
+ case 105: // look at Philip's locker
+ igorSay(205, 1, 0);
+ break;
+ case 106:
+ part27FloppyOpenPhilipLocker();
+ break;
+ case 107:
+ part27FloppyClosePhilipLocker();
+ break;
+ case 108:
+ part27FloppyTakeBottle();
+ break;
+ case 109: // look at the bottles
+ igorSay(215, 1, 0);
+ break;
+ case 110:
+ part27FloppyUseFlaskOnLocker();
+ break;
+ default:
+ error("part27FloppyExecuteAction unhandled action %d", action);
+ break;
+ }
+}
+
+void IgorEngine::part27FloppyDrawLockerFrame(int frame) {
+ drawAnimRect(kLockerAnimOffset, frame * kLockerFrameSize, 34, 63);
+}
+
+void IgorEngine::part27FloppyOpenPhilipLocker() {
+ if (_objectsState[kPhillipLockerStateIndex] == 1) {
+ partMainExecuteAction(11);
+ return;
+ }
+ if (_objectsState[kPhillipLockerCombinationLearnedStateIndex] == 0) {
+ igorSay(206, 1, 0);
+ return;
+ }
+ igorSayAndWait(209, 3, 0);
+ for (int i = 1; i <= 3; ++i) {
+ part27FloppyDrawLockerFrame(i - 1);
+ if (i == 3) {
+ playSound(13, 1);
+ }
+ if (i < 3) {
+ waitForTimer(91);
+ }
+ }
+ _objectsState[kPhillipLockerStateIndex] = 1;
+ part27FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part27FloppyClosePhilipLocker() {
+ if (_objectsState[kPhillipLockerStateIndex] == 0) {
+ partMainExecuteAction(14);
+ return;
+ }
+ for (int i = 3; i >= 1; --i) {
+ part27FloppyDrawLockerFrame(i - 1);
+ if (i == 3) {
+ playSound(14, 1);
+ }
+ if (i < 3) {
+ waitForTimer(91);
+ }
+ }
+ _objectsState[kPhillipLockerStateIndex] = 0;
+ part27FloppyApplyObjectState(1);
+}
+
+void IgorEngine::part27FloppyTakeBottle() {
+ if (_inventoryInfo[58] > 0 || _objectsState[kButterflyNetStateIndex] == 2) {
+ igorSay(208, 1, 0);
+ return;
+ }
+ igorSayAndWait(207, 1, 0);
+ for (int i = 4; i >= 1; --i) {
+ part27FloppyDrawLockerFrame(i - 1);
+ if (i > 3) {
+ waitForTimer(91);
+ }
+ }
+ addObjectToInventory(kInventoryObjectBottle, 58);
+ part27FloppyApplyObjectState(255);
+}
+
+void IgorEngine::part27FloppyUseFlaskOnLocker() {
+ igorSayAndWait({ { 212, 1, 0 }, { 213, 2, 0 } });
+ for (int i = 4; i >= 1; --i) {
+ part27FloppyDrawLockerFrame(i - 1);
+ if (i > 3) {
+ waitForTimer(91);
+ }
+ }
+ removeObjectFromInventory(55);
+ part27FloppyApplyObjectState(255);
+ _objectsState[kFlaskLeftInPhillipLockerStateIndex] = 1;
+}
+
+void IgorEngine::part27FloppyApplyObjectState(int num) {
+ if (num == 1 || num == 255) {
+ if (_objectsState[kPhillipLockerStateIndex] == 0) {
+ copyArea(_screenLayer1, kLockerPictureOffset, 320, _animFramesBuffer + kLockerClosedPictureOffset, 32, 32, 56);
+ _roomActionsTable[3] = 6;
+ _roomObjectAreasTable[4].object = 3;
+ } else {
+ copyArea(_screenLayer1, kLockerPictureOffset, 320, _animFramesBuffer + kLockerOpenPictureOffset, 32, 32, 56);
+ _roomActionsTable[3] = 7;
+ _roomObjectAreasTable[4].object = 4;
+ }
+ }
+ if (num == 2 || num == 255) {
+ if (_objectsState[kLockersExaminedStateIndex] == 0) {
+ _roomObjectAreasTable[3].object = 2;
+ _roomObjectAreasTable[4].object = 2;
+ } else {
+ _roomObjectAreasTable[3].object = 3;
+ }
+ }
+}
+
+void IgorEngine::part27FloppyEnterFromLeft() {
+ _walkData[0].setPos(0, 134, 2, 0);
+ _walkData[0].setDefaultScale();
+ _walkData[0].clipSkipX = 1;
+ _walkData[0].clipWidth = 15;
+ _walkDataLastIndex = 0;
+ buildWalkPathSimple(0, 134, 30, 134);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ waitForIgorMove();
+}
+
+void IgorEngine::part27Floppy() {
+ _gameState.enableLight = 1;
+ loadRoomData(PAL_CollegeLockers, IMG_CollegeLockers, BOX_CollegeLockers, MSK_CollegeLockers, TXT_CollegeLockers);
+ static const int anm[] = { FRM_CollegeLockersFloppy1, FRM_CollegeLockersFloppy2, 0 };
+ loadAnimData(anm);
+ loadActionData(DAT_CollegeLockers);
+ _roomDataOffsets = PART_27_FLOPPY_ROOM_DATA_OFFSETS;
+ setRoomWalkBounds(0, 0, 296, 143);
+ partMainSetExecuteAction(1, &IgorEngine::part27FloppyExecuteAction);
+ part27FloppyApplyObjectState(255);
+ memcpy(_screenVGA, _screenLayer1, 46080);
+ if (!restoreRoomAfterLoad()) {
+ _currentAction.verb = kVerbWalk;
+ fadeIn(768);
+ part27FloppyEnterFromLeft();
+ }
+ enterPartLoop();
+ while (_currentPart == 270 && !_gameStateLoaded) {
+ runPartLoop();
+ }
+ leavePartLoop();
+ if (!_gameStateLoaded)
+ fadeOut(624);
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 796777333d9..0e7321e1196 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -889,6 +889,9 @@
#define FRM_CollegeCorridorMissBarrymoreFloppy1 1267
#define FRM_CollegeCorridorMissBarrymoreFloppy2 1268
+#define FRM_CollegeLockersFloppy1 1271
+#define FRM_CollegeLockersFloppy2 1272
+
#define FRM_CollegeCorridorCarolineFloppy1 1252
#define FRM_CollegeCorridorCarolineFloppy2 1253
#define FRM_CollegeCorridorCarolineFloppy3 1254
diff --git a/engines/igor/static_room.cpp b/engines/igor/static_room.cpp
index b9a36e68a0f..ff16b5dc90c 100644
--- a/engines/igor/static_room.cpp
+++ b/engines/igor/static_room.cpp
@@ -276,6 +276,13 @@ const RoomDataOffsets IgorEngine::PART_26_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
+const RoomDataOffsets IgorEngine::PART_27_FLOPPY_ROOM_DATA_OFFSETS = {
+ { 0, 0, 0, 0 },
+ { 3, 12 },
+ { 15, 187, 3063, 79, 155, 80 },
+ { 0, 0, 0, 0, 0, 0, 0, 0, 0 }
+};
+
const RoomDataOffsets IgorEngine::PART_27_ROOM_DATA_OFFSETS = {
{ 0, 0, 0, 0 },
{ 6, 21 },
Commit: 0f59c74bbf0fc566c1cbaac2a9e543fe15027e3e
https://github.com/scummvm/scummvm/commit/0f59c74bbf0fc566c1cbaac2a9e543fe15027e3e
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:15+01:00
Commit Message:
IGOR: Do not trigger fist visit action on administration lobby on the floppy versions
Changed paths:
engines/igor/parts/part_7.cpp
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index 119e4195482..6590e07379f 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -99,7 +99,7 @@ void IgorEngine::part7EnterFromOutside() {
_walkDataLastIndex = 0;
// first time read notice board
- if (_game.version != kIdEngFloppy && !_part07FirstVisitDone) {
+ if (_game.version == kIdSpaCD && !_part07FirstVisitDone) {
buildWalkPath(109, 143, 180, 129);
_walkData[_walkDataLastIndex].frameNum = 0;
_walkData[_walkDataLastIndex].posNum = kFacingPositionRight;
Commit: 04795288a07437e0b6f97e8550fbca3bf4eb9885
https://github.com/scummvm/scummvm/commit/04795288a07437e0b6f97e8550fbca3bf4eb9885
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:15+01:00
Commit Message:
IGOR: Small fixes to adjust the Spanish floppy version
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_0.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_7.cpp
engines/igor/parts/part_78.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index da7509be65d..a43756b25a9 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1786,6 +1786,8 @@ private:
void debugApplyOverlay();
bool isCDVersion() const { return !(_game.flags & kFlagFloppy); }
+ // The two full floppy releases (the demos also carry the floppy flag)
+ bool isFullFloppyVersion() const { return _game.version == kIdEngFloppy || _game.version == kIdSpaFloppy; }
int getPart() const { return _currentPart / 10; }
bool compareGameTick(int add, int mod) const { return ((_gameTicks + (add & ~7)) % mod) == 0; }
bool compareGameTick(int eq) const { return _gameTicks == (eq & ~7); }
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 91ecf716528..7f3d8a53613 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -234,7 +234,8 @@ void IgorEngine::part0EnterFromBelow() {
int walkFrame = 1;
for (int i = 0; i <= 9; ++i) {
WalkData *entry = &_walkData[0];
- entry->setPos(145, 143, kFacingPositionBack, walkFrame);
+ // The Spanish floppy ends the entrance on the standing frame
+ entry->setPos(145, 143, kFacingPositionBack, (_game.version == kIdSpaFloppy && i == 9) ? 0 : walkFrame);
walkFrame = walkFrame == 6 ? 1 : walkFrame + 1;
entry->clipSkipX = 1;
entry->clipWidth = 30;
@@ -247,6 +248,12 @@ void IgorEngine::part0EnterFromBelow() {
moveIgor(entry->posNum, entry->frameNum);
waitForTimer(15);
}
+ if (_game.version == kIdSpaFloppy) {
+ // The Spanish floppy does not walk further inside after the entrance
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ return;
+ }
_walkDataLastIndex = 0;
buildWalkPath(145, 143, 125, 138);
_walkData[_walkDataLastIndex].frameNum = 0;
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index a8d948deacf..18c40c958df 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -157,7 +157,7 @@ void IgorEngine::part12TryEnterChurch() {
void IgorEngine::part12UseResinWithStone() {
if (_objectsState[kLizardTakenStateIndex] == 1) {
- if (_game.version == kIdEngFloppy)
+ if (isFullFloppyVersion())
ADD_DIALOGUE_TEXT(216, 2, kNoSpeechSound);
else
ADD_DIALOGUE_TEXT(219, 1, 801);
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 7d263686916..94c4d5dee03 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -101,7 +101,8 @@ void IgorEngine::part14LookAtPuzzle() {
waitForTimer(60);
}
stopSound();
- igorSay(227, 1, 1292);
+ if (!isFullFloppyVersion())
+ igorSay(227, 1, 1292);
_objectsState[kSecretPassageEntranceOpenStateIndex] = 1;
}
part14ApplyObjectState(255);
@@ -258,6 +259,12 @@ void IgorEngine::part14EnterFromChurch() {
moveIgor(wd->posNum, wd->frameNum);
waitForTimer(15);
}
+ if (_game.version == kIdSpaFloppy) {
+ // The Spanish floppy does not walk further inside after the entrance
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ return;
+ }
_walkDataLastIndex = 0;
_walkDataCurrentIndex = 1;
buildWalkPath(182, 143, 162, 138);
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index d6f4ac1643c..8c96c00c72a 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -194,7 +194,7 @@ void IgorEngine::part2ExecuteAction(int action) {
}
if (_inventoryInfo[44] == 0 && _inventoryInfo[45] == 0) {
if (_objectsState[kAtticNailExaminedStateIndex] == 0) {
- if (_game.version == kIdEngFloppy)
+ if (isFullFloppyVersion())
igorSay(202, 2);
else
igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
@@ -208,7 +208,7 @@ void IgorEngine::part2ExecuteAction(int action) {
}
if (_inventoryInfo[44] != 0 && _inventoryInfo[45] == 0) {
if (_objectsState[kAtticSmallCrackPresentStateIndex] == 0) {
- if (_game.version == kIdEngFloppy)
+ if (isFullFloppyVersion())
igorSay(202, 2);
else
igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
@@ -227,7 +227,7 @@ void IgorEngine::part2ExecuteAction(int action) {
igorSay(206, 1, 113);
addObjectToInventory(kInventoryObjectDynamite, 46);
} else if (_inventoryInfo[44] == 0 && _inventoryInfo[45] != 0 && _inventoryInfo[46] == 0 && _objectsState[kDynamitePlacedStateIndex] == 0) {
- if (_game.version == kIdEngFloppy)
+ if (isFullFloppyVersion())
igorSay(202, 2);
else
igorSay({ { 202, 1, 109 }, { 203, 1, 110 } });
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index adac5446012..e5117f4c49f 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -311,6 +311,10 @@ void IgorEngine::part33WalkIn() {
_walkCurrentPos = 1;
for (int i = 0; i <= 9; ++i) {
WalkData *wd = &_walkData[0];
+ if (_game.version == kIdSpaFloppy && i == 9) {
+ // The Spanish floppy ends the entrance on the standing frame
+ _walkCurrentFrame = 0;
+ }
wd->setPos(207, 143, 1, _walkCurrentFrame);
WalkData::setNextFrame(1, _walkCurrentFrame);
wd->clipSkipX = 1;
@@ -326,6 +330,10 @@ void IgorEngine::part33WalkIn() {
}
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
+ if (_game.version == kIdSpaFloppy) {
+ // The Spanish floppy does not walk further inside after the entrance
+ return;
+ }
--_walkDataLastIndex;
buildWalkPath(207, 143, 187, 138);
_walkData[_walkDataLastIndex].frameNum = 0;
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index 6590e07379f..0d84d75b169 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -92,11 +92,18 @@ void IgorEngine::part7EnterFromOutside() {
int frame = 1;
for (int step = 0; step <= 9; ++step) {
- part7DrawScaledIgor(step, kFacingPositionBack, frame, 0);
+ // The Spanish floppy ends the entrance on the standing frame
+ part7DrawScaledIgor(step, kFacingPositionBack, (_game.version == kIdSpaFloppy && step == 9) ? 0 : frame, 0);
frame = frame == 6 ? 1 : frame + 1;
waitForTimer(15);
}
+ if (_game.version == kIdSpaFloppy) {
+ // The Spanish floppy does not walk further inside after the entrance
+ _walkDataLastIndex = 1;
+ _walkDataCurrentIndex = 1;
+ return;
+ }
_walkDataLastIndex = 0;
// first time read notice board
if (_game.version == kIdSpaCD && !_part07FirstVisitDone) {
diff --git a/engines/igor/parts/part_78.cpp b/engines/igor/parts/part_78.cpp
index bd22187e651..e6d9a060c6e 100644
--- a/engines/igor/parts/part_78.cpp
+++ b/engines/igor/parts/part_78.cpp
@@ -272,7 +272,12 @@ void IgorEngine::part78() {
part78Say(kPart78IgorRight, { { 216, 1, 681 } });
part78Say(kPart78ProfessorLeft, { { 217, 1, 682 }, { 218, 1, 683 } });
part78Say(kPart78IgorRight, { { 219, 1, 684 } });
- part78Say(kPart78ProfessorLeft, { { 235, 1, 698 }, { 236, 2, 699 } });
+ if (_game.version == kIdSpaFloppy) {
+ // The Spanish floppy has this accusation in two lines (220-221); lines 235-237 do not exist there
+ part78Say(kPart78ProfessorLeft, { { 220, 1, kNoSpeechSound }, { 221, 1, kNoSpeechSound } });
+ } else {
+ part78Say(kPart78ProfessorLeft, { { 235, 1, 698 }, { 236, 2, 699 } });
+ }
part78Say(kPart78IgorRight, { { 222, 1, 685 }, { 223, 1, 686 } });
part78DrawIgorFrame(3);
part78Say(kPart78Philip, { { 224, 1, 687 }, { 225, 1, 688 }, { 226, 1, 689 } });
Commit: 15a8584f875b2009280a7f9c727f1979043b88e1
https://github.com/scummvm/scummvm/commit/15a8584f875b2009280a7f9c727f1979043b88e1
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:15+01:00
Commit Message:
IGOR: Fix select timing issues in the Spanish floppy
Changed paths:
engines/igor/parts/part_17.cpp
engines/igor/parts/part_18.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_80.cpp
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 8cabe713022..60ca007ea95 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -390,6 +390,33 @@ void IgorEngine::part17WalkFromCollege() {
if (!isCDVersion())
playMusic(2, true);
part17ApplyObjectState(255);
+ if (_game.version == kIdSpaFloppy) {
+ // The Spanish floppy college door leads to the hall: Igor appears at the foot of the steps and takes a single walk
+ WalkData &wd = _walkData[0];
+ wd.setPos(225, 100, 3, 1);
+ wd.clipSkipX = 1;
+ wd.clipWidth = 30;
+ wd.scaleWidth = 50;
+ wd.xPosChanged = 1;
+ wd.dxPos = 0;
+ wd.yPosChanged = 1;
+ wd.dyPos = 0;
+ wd.scaleHeight = 50;
+ _walkCurrentFrame = 1;
+ _walkDataCurrentIndex = 0;
+ _walkDataLastIndex = 0;
+ buildWalkPath(225, 100, 205, 124);
+ _walkData[_walkDataLastIndex].frameNum = 0;
+ _walkDataCurrentIndex = 1;
+ _gameState.igorMoving = true;
+ moveIgor(3, _walkData[1].frameNum);
+ ++_walkDataCurrentIndex;
+ fadeIn(768);
+ waitForIgorMove(&IgorEngine::part17UpdateBackground);
+ part17ChangePathZIndex(0);
+ part17ClearEntryAreas();
+ return;
+ }
fadeIn(768);
_walkData[0].setPos(274, 68, 4, 1);
_walkData[0].setDefaultScale();
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index 227d6fc06cc..62d253f07e0 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -108,7 +108,7 @@ void IgorEngine::part18UseBottleOnTap() {
drawAnimRect(offset, 0xF0A, 28, 29);
playSound(47, 1);
for (int i = 1; i <= 2; ++i) {
- waitForTimer(200);
+ waitForTimer(_game.version == kIdSpaFloppy ? 120 : 200);
}
drawAnimRect(offset, 0xBDE, 28, 29);
igorSay(213, 2, 907);
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 9567c8bdf9d..6ff7b7403b8 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -300,7 +300,7 @@ void IgorEngine::part68GiveRecordsToBoris() {
part68SayBoris({ { 215, 1, 1020 }, { 216, 1, 1021 }, { 217, 1, 1022 }, { 218, 1, 1023 } });
for (int frame = 1; frame <= 3; ++frame) {
drawAnimRect(kPart68GiveAnimOffset, kPart68GiveFramesOffset + frame * kPart68GiveFrameSize, kPart68GiveWidth, kPart68GiveHeight);
- waitForTimer(40);
+ waitForTimer(_game.version == kIdSpaFloppy ? 60 : 40);
}
part68SayBoris({ { 219, 1, 1024 }, { 220, 1, 1025 }, { 221, 1, 1026 }, { 222, 1, 1027 } });
part68DrawUndertaker(kPart68BorisFacing);
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index 29346cd842d..a9671574815 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -190,6 +190,16 @@ void IgorEngine::part8DeanDrinksBottle() {
part8DrawDean();
for (uint i = 0; i < ARRAYSIZE(frames); ++i) {
decodeAnimFrame(getAnimFrame(0x76DD, 0xD98, frames[i]), _screenVGA, true);
+ if (_game.version == kIdSpaFloppy) {
+ // The Spanish floppy shows the gulping while Dean drinks
+ if (i == 3)
+ cutsceneSayStart(78, 75, 26, 58, 0, 228, 1, 0);
+ if (i == 22) {
+ memcpy(_screenVGA + _dialogueDirtyRectY,
+ _screenTextLayer + 320 * 72, _dialogueDirtyRectSize);
+ _gameState.dialogueTextRunning = false;
+ }
+ }
waitForTimer(31);
}
}
@@ -317,16 +327,25 @@ void IgorEngine::part8ExecuteAction(int action) {
waitForIgorMove();
uint8 &pendingDeanDrink = _objectsState[kPendingDeanDrinkStateIndex];
if (pendingDeanDrink != kPart08PendingDeanDrinkNone) {
- waitForTimer(251);
+ if (_game.version != kIdSpaFloppy)
+ waitForTimer(251);
part8DeanDrinksBottle();
const bool bottleCaught = _objectsState[kButterflyNetStateIndex] == 1;
if (bottleCaught)
_objectsState[kButterflyNetStateIndex] = 2;
else
_objectsState[kGlassShardsPresentStateIndex] = 1;
- waitForTimer(101);
- if (!bottleCaught)
- playSound(16, 1);
+ if (_game.version == kIdSpaFloppy) {
+ // Only the shards fall with a pause and a sound
+ if (!bottleCaught) {
+ waitForTimer(100);
+ playSound(16, 1);
+ }
+ } else {
+ waitForTimer(101);
+ if (!bottleCaught)
+ playSound(16, 1);
+ }
if (pendingDeanDrink == kPart08PendingDeanDrinkWater) {
part8DeanPassesOut();
_objectsState[kDeanPassedOutStateIndex] = 1;
diff --git a/engines/igor/parts/part_80.cpp b/engines/igor/parts/part_80.cpp
index 1edea0d7c42..7a6ac51cbb5 100644
--- a/engines/igor/parts/part_80.cpp
+++ b/engines/igor/parts/part_80.cpp
@@ -107,17 +107,20 @@ void IgorEngine::part80() {
part80Say(1, { { 216, 1, 1143 }, { 217, 1, 1144 } });
part80Say(0, { { 218, 1, 1145 } });
part80Say(1, { { 219, 1, 1146 }, { 220, 1, 1147 }, { 221, 1, 1148 } });
- waitForTimer(255);
+ // The Spanish floppy has no animation of the friend falling and goes straight to the final holds
+ if (_game.version != kIdSpaFloppy) {
+ waitForTimer(255);
- // left-most friend falls on the floor
- for (int i = 1; i <= 4; ++i) {
- copyArea(_screenVGA, kPart80FallingGirlOffset, 320,
- _animFramesBuffer + kPart80FallingGirlFramesBase + i * kPart80FallingGirlFrameSize, kPart80FallingGirlWidth,
- kPart80FallingGirlWidth, kPart80FallingGirlHeight);
- if (i < 4) {
- waitForTimer(21);
- } else {
- playSound(15, 1);
+ // left-most friend falls on the floor
+ for (int i = 1; i <= 4; ++i) {
+ copyArea(_screenVGA, kPart80FallingGirlOffset, 320,
+ _animFramesBuffer + kPart80FallingGirlFramesBase + i * kPart80FallingGirlFrameSize, kPart80FallingGirlWidth,
+ kPart80FallingGirlWidth, kPart80FallingGirlHeight);
+ if (i < 4) {
+ waitForTimer(21);
+ } else {
+ playSound(15, 1);
+ }
}
}
for (int i = 1; i <= 3; ++i) {
Commit: 6af9bf4190eb2bafe6433920d8ec1792dbffdd47
https://github.com/scummvm/scummvm/commit/6af9bf4190eb2bafe6433920d8ec1792dbffdd47
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:16+01:00
Commit Message:
IGOR: Fix ending on Spanish floppy
Changed paths:
engines/igor/parts/part_79.cpp
diff --git a/engines/igor/parts/part_79.cpp b/engines/igor/parts/part_79.cpp
index a5be9727801..208949dcbd1 100644
--- a/engines/igor/parts/part_79.cpp
+++ b/engines/igor/parts/part_79.cpp
@@ -218,10 +218,21 @@ static const int kPart79Block3Frames = 0xC8B9;
static const int kPart79Block3FloppyOffset = 53 * 320 + 93;
static const int kPart79Block3FloppyWidth = 133;
static const int kPart79Block3FloppyFrames = 0xCE34;
+// The Spanish floppy title blocks are smaller, lower on the screen and in a different color
+static const int kPart79Block1SpaFloppyOffset = 89 * 320 + 121;
+static const int kPart79Block1SpaFloppyWidth = 79;
+static const int kPart79Block1SpaFloppyHeight = 22;
+static const int kPart79Block1SpaFloppyMark1 = 0x73C0;
+static const int kPart79Block1SpaFloppyMark2 = 0x74FF;
+static const int kPart79Block3SpaFloppyOffset = 89 * 320 + 141;
+static const int kPart79Block3SpaFloppyWidth = 38;
+static const int kPart79Block3SpaFloppyHeight = 22;
+static const int kPart79Block3SpaFloppyFrames = 0xC76D;
static const int kPart79FadeFirstColor = 0xF5;
static const int kPart79FadeLastColor = 0xFE;
static const uint8 kPart79FadeColors[6] = { 0x3F, 0x20, 0x00, 0x2C, 0x0C, 0x00 };
+static const uint8 kPart79SpaFloppyFadeColors[6] = { 0x00, 0x27, 0x19, 0x00, 0x12, 0x00 };
void IgorEngine::part79DrawGroupFrame(const uint8 *buffer, int table, int base, int frame) {
decodeAnimFrame(buffer + base + READ_LE_UINT16(buffer + table + frame * 2) - 1, _screenVGA, false);
@@ -356,7 +367,7 @@ void IgorEngine::part79FadeColors(int first, int last, bool fadeInColors) {
}
void IgorEngine::part79FadeInPair(int firstColor) {
- memcpy(_paletteBuffer + firstColor * 3, kPart79FadeColors, 6);
+ memcpy(_paletteBuffer + firstColor * 3, _game.version == kIdSpaFloppy ? kPart79SpaFloppyFadeColors : kPart79FadeColors, 6);
part79FadeColors(firstColor, firstColor + 1, true);
}
@@ -499,13 +510,21 @@ void IgorEngine::part79BeachScene() {
// the second animation resource replaces the first one
loadData(ANM_Part79bScenes, _animFramesBuffer);
const bool englishFloppy = _game.version == kIdEngFloppy;
+ const bool spanishFloppy = _game.version == kIdSpaFloppy;
const int titleOffset = englishFloppy ? kPart79Block1FloppyOffset : kPart79Block1Offset;
const int titleWidth = englishFloppy ? kPart79Block1FloppyWidth : kPart79Block1Width;
- copyArea(_screenVGA, titleOffset, 320, _animFramesBuffer + kPart79Block1Frames, titleWidth,
- titleWidth, kPart79Block1Height);
+ if (spanishFloppy) {
+ copyArea(_screenVGA, kPart79Block1SpaFloppyOffset, 320, _animFramesBuffer + kPart79Block1Frames, kPart79Block1SpaFloppyWidth,
+ kPart79Block1SpaFloppyWidth, kPart79Block1SpaFloppyHeight);
+ memset(_screenVGA + kPart79Block1SpaFloppyMark1, 0xFE, 2);
+ memset(_screenVGA + kPart79Block1SpaFloppyMark2, 0xFE, 2);
+ } else {
+ copyArea(_screenVGA, titleOffset, 320, _animFramesBuffer + kPart79Block1Frames, titleWidth,
+ titleWidth, kPart79Block1Height);
+ }
part79FadeInPair(0xF5);
- for (int i = 0; i < 5; ++i) {
+ for (int i = 0; i < (spanishFloppy ? 3 : 5); ++i) {
waitForTimer(255);
}
part79FadeInPair(0xF7);
@@ -557,10 +576,15 @@ void IgorEngine::part79BeachScene() {
const int finalTitleOffset = englishFloppy ? kPart79Block3FloppyOffset : kPart79Block3Offset;
const int finalTitleWidth = englishFloppy ? kPart79Block3FloppyWidth : kPart79Block3Width;
const int finalTitleFrames = englishFloppy ? kPart79Block3FloppyFrames : kPart79Block3Frames;
- copyArea(_screenVGA, finalTitleOffset, 320, _animFramesBuffer + finalTitleFrames, finalTitleWidth,
- finalTitleWidth, kPart79Block3Height);
+ if (spanishFloppy) {
+ copyArea(_screenVGA, kPart79Block3SpaFloppyOffset, 320, _animFramesBuffer + kPart79Block3SpaFloppyFrames, kPart79Block3SpaFloppyWidth,
+ kPart79Block3SpaFloppyWidth, kPart79Block3SpaFloppyHeight);
+ } else {
+ copyArea(_screenVGA, finalTitleOffset, 320, _animFramesBuffer + finalTitleFrames, finalTitleWidth,
+ finalTitleWidth, kPart79Block3Height);
+ }
part79FadeColors(kPart79FadeFirstColor, kPart79FadeLastColor, true);
- for (int i = 0; i < 8; ++i) {
+ for (int i = 0; i < (spanishFloppy ? 5 : 8); ++i) {
waitForTimer(255);
}
part79FadeColors(kPart79FadeFirstColor, kPart79FadeLastColor, false);
@@ -573,14 +597,16 @@ void IgorEngine::part79BeachScene() {
void IgorEngine::part79() {
const bool savingWasAllowed = _canSaveGame;
_canSaveGame = false;
- // the picture is shown below a black band
+ // the picture is shown below a black band (the Spanish floppy draws it at the top of the screen)
if (_currentPart == 790) {
memset(_screenVGA, 0, 64000);
}
- uint8 band[320 * kPart79BandRows];
- memset(band, 0, sizeof(band));
- _system->copyRectToScreen(band, 320, 0, 0, 320, kPart79BandRows);
- _screenVGAVOffset = kPart79BandRows;
+ if (_game.version != kIdSpaFloppy) {
+ uint8 band[320 * kPart79BandRows];
+ memset(band, 0, sizeof(band));
+ _system->copyRectToScreen(band, 320, 0, 0, 320, kPart79BandRows);
+ _screenVGAVOffset = kPart79BandRows;
+ }
if (_currentPart == 790) {
part79LauraInWater();
} else {
Commit: 2cdf080b7b95883fb46575ff60ba89fa6742047a
https://github.com/scummvm/scummvm/commit/2cdf080b7b95883fb46575ff60ba89fa6742047a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:16+01:00
Commit Message:
IGOR: Fix credits for Spanish floppy version
Changed paths:
engines/igor/part_main.cpp
engines/igor/parts/part_credits.cpp
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index b4bf4b47a91..fa62cba8c1a 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -774,14 +774,19 @@ void IgorEngine::partMain() {
// Clear the entire screen buffer before starting the intro cutscene
memset(_screenVGA, 0, 64000);
g_engine->_screen->updateScreen();
- _screenVGAVOffset = 24;
- // copy the initial portion of the screen to the display, with the vertical offset
- _system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, _screenVGAVOffset);
- g_engine->_screen->updateScreen();
+ // The Spanish floppy draws the intro at the top of the screen, without the black band
+ const bool band = _game.version != kIdSpaFloppy;
+ if (band) {
+ _screenVGAVOffset = 24;
+ // copy the initial portion of the screen to the display, with the vertical offset
+ _system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, _screenVGAVOffset);
+ g_engine->_screen->updateScreen();
+ }
part85();
// Clears the bottom portion of the screen
memset(_screenVGA + 46080, 0, 17920);
- partMainMoveScreenUp(_screenVGAVOffset);
+ if (band)
+ partMainMoveScreenUp(_screenVGAVOffset);
_screenVGAVOffset = 0;
_inputVars[kInputCursorXPos] = 160;
_inputVars[kInputCursorYPos] = 72;
diff --git a/engines/igor/parts/part_credits.cpp b/engines/igor/parts/part_credits.cpp
index 549396291c2..d6cb14427e9 100644
--- a/engines/igor/parts/part_credits.cpp
+++ b/engines/igor/parts/part_credits.cpp
@@ -89,29 +89,33 @@ void IgorEngine::partCredits() {
loadData(page.imgId, _screenVGA);
loadData(page.palId, _paletteBuffer);
SET_PAL_240_48_1();
- memset(_paletteBuffer + kCreditsNameColor * 3, 0x3F, 3);
-
- const bool englishFloppy = _game.version == kIdEngFloppy;
- const int pass = (_creditsPass == 0) ? 0 : 1;
- const CreditsLayout &layout = englishFloppy ? page.floppy : page.cd[pass];
- const int skip = !englishFloppy && pass == 1 ? page.cd[0].count : 0;
- int size;
- uint8 *texts = loadData(page.textId, nullptr, &size);
- int offset = 0;
- for (int i = 0; i < skip + layout.count; ++i) {
- assert(offset < size);
- const int length = texts[offset++];
- assert(offset + length <= size);
- if (i >= skip) {
- const int line = i - skip;
- const Common::String text(reinterpret_cast<const char *>(texts + offset), length);
- const int y = layout.y + (line == 0 ? 0 : 28 + (line - 1) * 15);
- const uint8 color = line == 0 ? 0xC2 : (englishFloppy ? 0xFF : kCreditsNameColor);
- partCreditsDrawText(layout.x, y, color, line == 0, text.c_str());
+ // The Spanish floppy pictures already contain the credits text
+ const bool bakedText = _game.version == kIdSpaFloppy;
+ if (!bakedText) {
+ memset(_paletteBuffer + kCreditsNameColor * 3, 0x3F, 3);
+
+ const bool englishFloppy = _game.version == kIdEngFloppy;
+ const int pass = (_creditsPass == 0) ? 0 : 1;
+ const CreditsLayout &layout = englishFloppy ? page.floppy : page.cd[pass];
+ const int skip = !englishFloppy && pass == 1 ? page.cd[0].count : 0;
+ int size;
+ uint8 *texts = loadData(page.textId, nullptr, &size);
+ int offset = 0;
+ for (int i = 0; i < skip + layout.count; ++i) {
+ assert(offset < size);
+ const int length = texts[offset++];
+ assert(offset + length <= size);
+ if (i >= skip) {
+ const int line = i - skip;
+ const Common::String text(reinterpret_cast<const char *>(texts + offset), length);
+ const int y = layout.y + (line == 0 ? 0 : 28 + (line - 1) * 15);
+ const uint8 color = line == 0 ? 0xC2 : (englishFloppy ? 0xFF : kCreditsNameColor);
+ partCreditsDrawText(layout.x, y, color, line == 0, text.c_str());
+ }
+ offset += length;
}
- offset += length;
+ free(texts);
}
- free(texts);
if (_gameStateLoaded) {
fadeIn(768);
@@ -120,7 +124,7 @@ void IgorEngine::partCredits() {
part79FadeColors(0, 255, true);
}
- const int pageTicks = _game.version == kIdEngFloppy ? 3928 : kCreditsPageTicks;
+ const int pageTicks = isFullFloppyVersion() ? 3928 : kCreditsPageTicks;
for (int ticks = 0; ticks < pageTicks; ticks += kTimerTicksCount) {
if (_inputVars[kInputOptions]) {
_inputVars[kInputOptions] = 0;
Commit: 5739884c8878651c57a4148b84956783bf7485ad
https://github.com/scummvm/scummvm/commit/5739884c8878651c57a4148b84956783bf7485ad
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:17+01:00
Commit Message:
IGOR: Fixes margaret scenes in Spanish floppy
Changed paths:
engines/igor/parts/part_margaret.cpp
diff --git a/engines/igor/parts/part_margaret.cpp b/engines/igor/parts/part_margaret.cpp
index 0d723d6b1ba..a31e79c7196 100644
--- a/engines/igor/parts/part_margaret.cpp
+++ b/engines/igor/parts/part_margaret.cpp
@@ -26,14 +26,27 @@ namespace Igor {
static int VAR_MARGARET_ROOM_ANIM_COUNTER;
+// The Spanish floppy has other animation blocks, so the tables are at other places
+static const int kMargaretBasePoseTable = 0x2A63;
+static const int kMargaretFramesBase = 0x2A75;
+static const int kMargaretFramesTable = 0xD887;
+static const int kMargaretFloppyBasePoseTable = 0x28A6;
+static const int kMargaretFloppyFramesBase = 0x28B8;
+static const int kMargaretFloppyFramesTable = 0xE338;
+
void IgorEngine::partMargaretDrawBasePose() {
- const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x2A63 + VAR_MARGARET_ROOM_ANIM_COUNTER * 2) - 1;
+ const bool floppy = _game.version == kIdSpaFloppy;
+ const int table = floppy ? kMargaretFloppyBasePoseTable : kMargaretBasePoseTable;
+ const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + table + VAR_MARGARET_ROOM_ANIM_COUNTER * 2) - 1;
decodeAnimFrame(src, _screenVGA);
}
void IgorEngine::partMargaretDrawFrame(int frame) {
+ const bool floppy = _game.version == kIdSpaFloppy;
const int offset = ((VAR_MARGARET_ROOM_ANIM_COUNTER - 1) * 5 + frame) * 2;
- const uint8 *src = _animFramesBuffer + 0x2A75 + READ_LE_UINT16(_animFramesBuffer + offset + 0xD887) - 1;
+ const int base = floppy ? kMargaretFloppyFramesBase : kMargaretFramesBase;
+ const int table = floppy ? kMargaretFloppyFramesTable : kMargaretFramesTable;
+ const uint8 *src = _animFramesBuffer + base + READ_LE_UINT16(_animFramesBuffer + offset + table) - 1;
decodeAnimFrame(src, _screenVGA);
}
@@ -54,6 +67,7 @@ void IgorEngine::partMargaret() {
if (isCDVersion())
playMusic(8);
_gameState.enableLight = 1;
+ const bool floppy = _game.version == kIdSpaFloppy;
VAR_MARGARET_ROOM_ANIM_COUNTER = _objectsState[kMargaretSceneStateIndex] + 1;
if (VAR_MARGARET_ROOM_ANIM_COUNTER == 9) {
VAR_MARGARET_ROOM_ANIM_COUNTER = 1;
@@ -110,14 +124,24 @@ void IgorEngine::partMargaret() {
break;
}
SET_DIALOGUE_TEXT(1, 3);
- startCutsceneDialogue(200, 73, 63, 32, 0);
- waitForEndOfCutsceneDialogue(200, 73, 63, 32, 0);
+ int textX = 200, textY = 73, textR = 63, textG = 32, textB = 0;
+ if (floppy) {
+ // The Spanish floppy shows the text elsewhere, in the color of palette entry 201
+ textX = 121;
+ textY = 62;
+ textR = _paletteBuffer[201 * 3];
+ textG = _paletteBuffer[201 * 3 + 1];
+ textB = _paletteBuffer[201 * 3 + 2];
+ }
+ startCutsceneDialogue(textX, textY, textR, textG, textB);
+ waitForEndOfCutsceneDialogue(textX, textY, textR, textG, textB);
waitForTimer(255);
_updateDialogue = 0;
++_objectsState[kMargaretSceneStateIndex];
- memcpy(_paletteBuffer, _currentPalette, 768);
+ memcpy(_paletteBuffer, _currentPalette, floppy ? 624 : 768);
fadeOut(768);
- memset(_screenVGA, 0, 46080);
+ if (!floppy)
+ memset(_screenVGA, 0, 46080);
if (_objectsState[kMargaretSceneStateIndex] < 9 && _currentPart != 331) {
setupDefaultPalette();
SET_PAL_240_48_1();
Commit: 74ac3adfbf357ed6c1e23d09c4ccc418236f81ea
https://github.com/scummvm/scummvm/commit/74ac3adfbf357ed6c1e23d09c4ccc418236f81ea
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:17+01:00
Commit Message:
IGOR: Remove wait for the lighthouse scene in the Spanish floppy
Changed paths:
engines/igor/parts/part_81.cpp
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index 7180655148c..f56b8814b32 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -256,7 +256,9 @@ void IgorEngine::part81DrawLighthouseFrame(int frame) {
void IgorEngine::part81LighthouseSendMessage() {
part81TransitionScrollUp();
- for (int i = 0; i < 3; ++i) {
+ // The Spanish floppy goes straight to the flashes, without the long pauses
+ const bool pauses = _game.version != kIdSpaFloppy;
+ for (int i = 0; pauses && i < 3; ++i) {
waitForTimer(251);
}
// lighthouse flashes message
@@ -264,7 +266,8 @@ void IgorEngine::part81LighthouseSendMessage() {
part81DrawLighthouseFrame(kPart81EndFrames[i]);
waitForTimer(kPart81EndHold[i]);
}
- waitForTimer(251);
+ if (pauses)
+ waitForTimer(251);
part74ShipCutscene();
// ship receives message
for (int i = 0; i < 10; ++i) {
Commit: c6333fc5ed2fcbffa02ea7f65f9bd4f965da6933
https://github.com/scummvm/scummvm/commit/c6333fc5ed2fcbffa02ea7f65f9bd4f965da6933
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:17+01:00
Commit Message:
IGOR: Music adjustments for Spanish floppy
Changed paths:
engines/igor/part_main.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_4.cpp
engines/igor/parts/part_77.cpp
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index fa62cba8c1a..f237f0c872c 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -844,17 +844,21 @@ void IgorEngine::partMain() {
if (_gameState.shouldShowCutsceneCounter != 5) {
++_gameState.shouldShowCutsceneCounter;
} else {
- if (!isCDVersion()) {
- if (_gameState.musicNum != 11) {
- _previousMusic = _gameState.musicNum;
- playMusic(11);
+ // The Spanish floppy leaves the music alone during the scene
+ const bool changeMusic = _game.version != kIdSpaFloppy;
+ if (changeMusic) {
+ if (!isCDVersion()) {
+ if (_gameState.musicNum != 11) {
+ _previousMusic = _gameState.musicNum;
+ playMusic(11);
+ }
+ } else {
+ playMusic(8);
}
- } else {
- playMusic(8);
}
partMainMeanwhile();
partMargaret();
- if (!isCDVersion() && _previousMusic != 11)
+ if (changeMusic && !isCDVersion() && _previousMusic != 11)
playMusic(_previousMusic, true);
_gameState.shouldShowCutsceneCounter = 0;
}
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index a2e508dccb3..7fc5a97327a 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -194,7 +194,7 @@ void IgorEngine::part16PhotoCutscene() {
_inventoryInfo[kInventoryFirstVisible] = _inventoryOffsetTable[(_inventoryInfo[kInventoryCount] - 1) / 7];
_objectsState[kPhotoCutsceneSeenStateIndex] = 1;
_objectsState[kMargaretStateIndex] = kMargaretStatePhotoTaken;
- if (!isCDVersion())
+ if (!isCDVersion() && _game.version != kIdSpaFloppy)
playMusic(3, true);
_currentPart = 261;
}
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index e5117f4c49f..9c23e368ee7 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -262,7 +262,7 @@ void IgorEngine::part33ApplyObjectState(int num) {
}
void IgorEngine::part33HarrisonWalksOut() {
- if (!isCDVersion())
+ if (!isCDVersion() && _game.version != kIdSpaFloppy)
playMusic(11, true);
memcpy(_screenLayer2, _screenVGA, 46080);
memcpy(_screenVGA, _screenLayer1, 46080);
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index aec7331a34c..ee2b21d45a3 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -69,7 +69,7 @@ void IgorEngine::part4() {
if (_objectsState[kStatuetteTaken2StateIndex] == 1) { // police custcene
_currentPart = 730;
- if (!isCDVersion())
+ if (!isCDVersion() && _game.version != kIdSpaFloppy)
playMusic(11, true);
return;
}
@@ -78,7 +78,7 @@ void IgorEngine::part4() {
if (_objectsState[kFlaskLeftInPhillipLockerStateIndex] == 1) {
_objectsState[kFlaskLeftInPhillipLockerStateIndex] = 0;
_currentPart = 750;
- if (!isCDVersion())
+ if (!isCDVersion() && _game.version != kIdSpaFloppy)
playMusic(11, true);
return;
}
diff --git a/engines/igor/parts/part_77.cpp b/engines/igor/parts/part_77.cpp
index aa5c8609ce7..ccd5a42995a 100644
--- a/engines/igor/parts/part_77.cpp
+++ b/engines/igor/parts/part_77.cpp
@@ -117,7 +117,7 @@ void IgorEngine::part77MonkeyCageCutscene() {
{ { 210, 2, 1126 }, { 212, 2, 1127 }, { 214, 1, 1128 }, { 215, 2, 1129 }, { 217, 2, 1130 } },
&IgorEngine::part77UpdateDialogue);
waitForTimer(255);
- if (!isCDVersion())
+ if (!isCDVersion() && _game.version != kIdSpaFloppy)
playMusic(0);
// the colors 240 to 255 are black on the screen
for (int i = 240; i <= 255; ++i) {
Commit: eff2463357ad9143ee58a65a02d871f3f4b017b3
https://github.com/scummvm/scummvm/commit/eff2463357ad9143ee58a65a02d871f3f4b017b3
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:18+01:00
Commit Message:
IGOR: Fix error in Dean Peeper's office
Changed paths:
engines/igor/parts/part_8.cpp
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index a9671574815..c57b6303f3e 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -311,10 +311,9 @@ void IgorEngine::part8GiveBottleToDean() {
void IgorEngine::part8ExecuteAction(int action) {
switch (action) {
case 101: // exit office
- if (_objectsState[kDeanDoorOpenStateIndex] == 0) {
- _currentPart = 71;
+ // With the door closed nothing happens: Igor has to open it first
+ if (_objectsState[kDeanDoorOpenStateIndex] == 0)
break;
- }
if (_objectsState[kDeanDoorOpenStateIndex] != 0) {
for (int area = 10; area <= 11; ++area)
_roomObjectAreasTable[area].area = 4;
Commit: e5ced6ecece4554bff6df1eb58367a6afe24cf03
https://github.com/scummvm/scummvm/commit/e5ced6ecece4554bff6df1eb58367a6afe24cf03
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:18+01:00
Commit Message:
IGOR: Hover default verb on hotspots for Spanish floppy
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 2212d952252..641ce2aac7c 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -148,6 +148,7 @@ void IgorEngine::restart() {
_actionCode = 0;
_actionWalkPoint = 0;
_rightButtonSelecting = false;
+ _hoverVerbState = kHoverVerbSelected;
_rightButtonSelectCursorX = _rightButtonSelectCursorY = 0;
memset(_inputVars, 0, sizeof(_inputVars));
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index a43756b25a9..216ca6e2ed0 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -83,6 +83,9 @@ enum {
kTalkModeTextOnly = 2
};
+// Value of _hoverVerbState when the verb panel shows the selected verb
+static const int kHoverVerbSelected = -1;
+
enum InputVar {
kInputSkipDialogue = 0,
kInputCursorXPos,
@@ -649,6 +652,8 @@ private:
int16 _inputVars[kInputVarCount];
bool _rightButtonSelecting;
+ // Verb highlighted while the cursor is over a hotspot (Spanish floppy): kHoverVerbSelected = the selected verb
+ int _hoverVerbState;
int _rightButtonSelectCursorX, _rightButtonSelectCursorY;
bool _scrollInventory;
@@ -1701,6 +1706,7 @@ private:
void drawVerbsPanel();
void redrawVerb(uint8 verb, bool highlight);
void beginRightButtonVerbPick();
+ void updateHoverVerbHighlight();
void updateRightButtonVerbPick();
void endRightButtonVerbPick();
void formatRightButtonSentence();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index cb7f2473fb4..366e191d2f1 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -289,6 +289,39 @@ void IgorEngine::formatRightButtonSentence() {
}
}
+/**
+ * The Spanish floppy highlights, while the cursor is over a hotspot, the default verb of that hotspot
+ * (Look for inventory objects) and shows the selected verb again when the cursor leaves.
+ */
+void IgorEngine::updateHoverVerbHighlight() {
+ int wanted = kHoverVerbSelected;
+ const bool idle = !_rightButtonSelecting && !_gameState.dialogueTextRunning && !_inputVars[kInputClick];
+ const int x = _inputVars[kInputCursorXPos];
+ const int y = _inputVars[kInputCursorYPos];
+ if (idle) {
+ if (y >= 0 && y < 144 && x >= 0 && x < 320) {
+ const int area = _screenLayer2[y * 320 + x];
+ const int object = _roomObjectAreasTable[area].object;
+ const int defaultVerbOffset = _roomDataOffsets.obj.walkPoints +
+ _roomDataOffsets.obj.walkFacingPosition - _roomDataOffsets.action.defaultVerb;
+ wanted = _roomActionsTable[defaultVerbOffset + object];
+ } else if (y >= 170 && y <= 197) {
+ wanted = kVerbLook;
+ }
+ }
+ if (wanted == _hoverVerbState)
+ return;
+ if (_hoverVerbState == kHoverVerbSelected)
+ redrawVerb(_currentAction.verb, false);
+ else
+ redrawVerb(_hoverVerbState, false);
+ if (wanted == kHoverVerbSelected)
+ redrawVerb(_currentAction.verb, true);
+ else
+ redrawVerb(wanted, true);
+ _hoverVerbState = wanted;
+}
+
void IgorEngine::handleRoomInput() {
// Escape is a transient abort input. Do not let an unused press from the
// room loop leak into a later blocking walk or dialogue sequence.
@@ -323,6 +356,9 @@ void IgorEngine::handleRoomInput() {
if (!_roomCursorOn || _gameState.dialogueTextRunning || _scrollInventory) {
return;
}
+ if (_game.version == kIdSpaFloppy) {
+ updateHoverVerbHighlight();
+ }
// Spanish floppy inventory paging works with left and right mouse buttons pressed on the 2 last rows of the screen
if (_game.version == kIdSpaFloppy && !_rightButtonSelecting && _inputVars[kInputCursorYPos] >= 198) {
if (_inputVars[kInputClick])
Commit: eb631b56609088b6edf9b26de8d04de9b77ad60b
https://github.com/scummvm/scummvm/commit/eb631b56609088b6edf9b26de8d04de9b77ad60b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:18+01:00
Commit Message:
IGOR: Right click directly selects default action in Spanish version
Changed paths:
engines/igor/igor.h
engines/igor/input.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 216ca6e2ed0..7a0c25bf2d0 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1706,6 +1706,7 @@ private:
void drawVerbsPanel();
void redrawVerb(uint8 verb, bool highlight);
void beginRightButtonVerbPick();
+ int getDefaultVerbAt(int x, int y) const;
void updateHoverVerbHighlight();
void updateRightButtonVerbPick();
void endRightButtonVerbPick();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 366e191d2f1..4c44807c30a 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -176,6 +176,15 @@ void IgorEngine::hideCursor() {
CursorMan.showMouse(_roomCursorOn);
}
+// Default verb of the room object under a scene position.
+int IgorEngine::getDefaultVerbAt(int x, int y) const {
+ const int area = _screenLayer2[y * 320 + x];
+ const int object = _roomObjectAreasTable[area].object;
+ const int defaultVerbOffset = _roomDataOffsets.obj.walkPoints +
+ _roomDataOffsets.obj.walkFacingPosition - _roomDataOffsets.action.defaultVerb;
+ return _roomActionsTable[defaultVerbOffset + object];
+}
+
/**
* Action to select a verb with moving the right mouse button clicked
*/
@@ -192,11 +201,7 @@ void IgorEngine::beginRightButtonVerbPick() {
int defaultVerb = 0;
// if in the scene, choose the hotspot's default verb as starting point
if (_rightButtonSelectCursorY < 144) {
- const int area = _screenLayer2[_rightButtonSelectCursorY * 320 + _rightButtonSelectCursorX];
- const int object = _roomObjectAreasTable[area].object;
- const int defaultVerbOffset = _roomDataOffsets.obj.walkPoints +
- _roomDataOffsets.obj.walkFacingPosition - _roomDataOffsets.action.defaultVerb;
- defaultVerb = _roomActionsTable[defaultVerbOffset + object];
+ defaultVerb = getDefaultVerbAt(_rightButtonSelectCursorX, _rightButtonSelectCursorY);
} else if (inventorySlot) { // for items, look is default
defaultVerb = kVerbLook;
}
@@ -300,11 +305,7 @@ void IgorEngine::updateHoverVerbHighlight() {
const int y = _inputVars[kInputCursorYPos];
if (idle) {
if (y >= 0 && y < 144 && x >= 0 && x < 320) {
- const int area = _screenLayer2[y * 320 + x];
- const int object = _roomObjectAreasTable[area].object;
- const int defaultVerbOffset = _roomDataOffsets.obj.walkPoints +
- _roomDataOffsets.obj.walkFacingPosition - _roomDataOffsets.action.defaultVerb;
- wanted = _roomActionsTable[defaultVerbOffset + object];
+ wanted = getDefaultVerbAt(x, y);
} else if (y >= 170 && y <= 197) {
wanted = kVerbLook;
}
@@ -370,7 +371,27 @@ void IgorEngine::handleRoomInput() {
_inputVars[kInputRightRelease] = 0;
return;
}
- if (_inputVars[kInputRightClick]) {
+ if (_game.version == kIdSpaFloppy && _inputVars[kInputRightClick]) {
+ // Right click runs the hovered object's default verb right away
+ // (Look for inventory items) instead of opening a verb pick.
+ _inputVars[kInputRightClick] = 0;
+ const int x = _inputVars[kInputCursorXPos];
+ const int y = _inputVars[kInputCursorYPos];
+ int verb = 0;
+ if (y < 144) {
+ verb = getDefaultVerbAt(x, y);
+ } else if (y >= 170 && y <= 197 && getObjectFromInventory(x) != 0) {
+ verb = kVerbLook;
+ }
+ if (verb >= kVerbWalk && verb <= kVerbGive) {
+ redrawVerb(_hoverVerbState == kHoverVerbSelected ? _currentAction.verb : _hoverVerbState, false);
+ memset(&_currentAction, 0, sizeof(_currentAction));
+ _currentAction.verb = verb;
+ _hoverVerbState = verb;
+ redrawVerb(verb, true);
+ _inputVars[kInputClick] = 1;
+ }
+ } else if (_inputVars[kInputRightClick]) {
_inputVars[kInputRightClick] = 0;
if (!_rightButtonSelecting) {
beginRightButtonVerbPick();
@@ -633,8 +654,13 @@ void IgorEngine::handleRoomInput() {
}
void IgorEngine::clearAction(bool redraw) {
- if (redraw)
+ if (redraw) {
+ if (_game.version == kIdSpaFloppy && _hoverVerbState != kHoverVerbSelected) {
+ redrawVerb(_hoverVerbState, false);
+ _hoverVerbState = kHoverVerbSelected;
+ }
redrawVerb(_currentAction.verb, false);
+ }
memset(&_currentAction, 0, sizeof(_currentAction));
_currentAction.verb = kVerbWalk;
_actionCode = 0;
Commit: 21abac5c4b6a10122734829db083cb439abc848a
https://github.com/scummvm/scummvm/commit/21abac5c4b6a10122734829db083cb439abc848a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:19+01:00
Commit Message:
IGOR: Correct sound indices in Spanish floppy version
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_0.cpp
engines/igor/parts/part_1.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_18.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_32.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_50.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_76.cpp
engines/igor/parts/part_79.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_85.cpp
engines/igor/parts/part_9.cpp
engines/igor/room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 7a0c25bf2d0..2e4478afb50 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -83,6 +83,35 @@ enum {
kTalkModeTextOnly = 2
};
+// Effects that the Spanish floppy plays with another number than the other versions (see playRoomSound)
+enum RoomSound {
+ kSoundPart0Nightstand = 6,
+ kSoundPart0ClosetClose = 4,
+ kSoundPart1Window = 12,
+ kSoundPart2Fuse = 11,
+ kSoundPart8Shards = 16,
+ kSoundPart18Tap = 47,
+ kSoundPart19Dryer = 45,
+ kSoundPart50Ambient = 44
+};
+
+// Numbers of the Spanish floppy sound table
+enum SpaFloppySound {
+ kSpaFloppySoundPart0Nightstand = 5,
+ kSpaFloppySoundPart0ClosetClose = 14,
+ kSpaFloppySoundPlaneEngine = 66,
+ kSpaFloppySoundPart50Door = 68,
+ kSpaFloppySoundPart68AmbientA = 69,
+ kSpaFloppySoundPart68AmbientB = 70,
+ kSpaFloppySoundPart18Tap = 71,
+ kSpaFloppySoundPart19Dryer = 72,
+ kSpaFloppySoundParkAmbient = 75,
+ kSpaFloppySoundPart6Ambient = 76,
+ kSpaFloppySoundPart8Shards = 77,
+ kSpaFloppySoundPart1Window = 79,
+ kSpaFloppySoundPart2Fuse = 80
+};
+
// Value of _hoverVerbState when the verb panel shows the selected verb
static const int kHoverVerbSelected = -1;
@@ -776,6 +805,7 @@ private:
void playMusic(int num, bool restart = false);
void updateMusic();
void playSound(int num, int type);
+ void playRoomSound(int sound, int spaFloppySound);
void stopSound();
int getTalkMode() const;
int prepareDialoguePlayback(const DialogueText &text);
@@ -1471,6 +1501,7 @@ private:
void part68DrawPose(int frame);
void part68UpdateOwlsEyes();
void part68UpdateBackground();
+ void part68PlayAmbientSound();
void part68UpdateBackgroundTalk();
void part68SayBorisReplies(int action);
void part68SayBoris(const Common::Array<DialogueText> &lines);
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 7f3d8a53613..90cb3209074 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -86,14 +86,14 @@ void IgorEngine::part0ExecuteAction(int action) {
break;
case 106: // open bedside table
if (_objectsState[kBedroomNightstandOpenStateIndex] == 0) {
- animateLitAnimFrames(0x3FC8, 0, 2, 0x436, 22, 49, 0x693C, 126, 2, 6);
+ animateLitAnimFrames(0x3FC8, 0, 2, 0x436, 22, 49, 0x693C, 126, 2, _game.version == kIdSpaFloppy ? kSpaFloppySoundPart0Nightstand : kSoundPart0Nightstand);
_objectsState[kBedroomNightstandOpenStateIndex] = 1;
part0ApplyObjectState(1);
}
break;
case 107: // close bedside table
if (_objectsState[kBedroomNightstandOpenStateIndex] != 0) {
- animateLitAnimFrames(0x3FC8, 2, 0, 0x436, 22, 49, 0x693C, 126, 1, 6);
+ animateLitAnimFrames(0x3FC8, 2, 0, 0x436, 22, 49, 0x693C, 126, 1, _game.version == kIdSpaFloppy ? kSpaFloppySoundPart0Nightstand : kSoundPart0Nightstand);
_objectsState[kBedroomNightstandOpenStateIndex] = 0;
part0ApplyObjectState(1);
}
@@ -125,7 +125,7 @@ void IgorEngine::part0ExecuteAction(int action) {
break;
case 111: // close closet
if (_objectsState[kBedroomClosetOpenStateIndex] != 0) {
- animateLitAnimFrames(0x1678, 2, 0, 0x940, 37, 64, 0x556C, 126, 1, 4);
+ animateLitAnimFrames(0x1678, 2, 0, 0x940, 37, 64, 0x556C, 126, 1, _game.version == kIdSpaFloppy ? kSpaFloppySoundPart0ClosetClose : kSoundPart0ClosetClose);
_objectsState[kBedroomClosetOpenStateIndex] = 0;
part0ApplyObjectState(3);
}
diff --git a/engines/igor/parts/part_1.cpp b/engines/igor/parts/part_1.cpp
index fb102e0a30a..80093eb9076 100644
--- a/engines/igor/parts/part_1.cpp
+++ b/engines/igor/parts/part_1.cpp
@@ -200,7 +200,7 @@ void IgorEngine::part1() {
else if (_currentPart == 12) {
memcpy(_currentPalette, _paletteBuffer, 768);
updatePalette(768);
- playSound(12, 1);
+ playRoomSound(kSoundPart1Window, kSpaFloppySoundPart1Window);
part1Explosion();
_currentPart = 23;
}
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 18c40c958df..59d6152aaea 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -110,7 +110,7 @@ void IgorEngine::part12TryEnterChurch() {
moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
waitForTimer(35);
// dor opening
- playSound(13, 1);
+ playRoomSound(13, 0);
_walkDataCurrentIndex = _walkDataLastIndex;
const uint8 *src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA444) - 1;
decodeAnimFrame(src, _screenVGA);
@@ -147,7 +147,7 @@ void IgorEngine::part12TryEnterChurch() {
if (i > 1) {
waitForTimer(35);
} else {
- playSound(14, 1);
+ playRoomSound(14, 0);
}
}
src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA440) - 1;
@@ -285,19 +285,33 @@ void IgorEngine::part12EnterChurch() {
void IgorEngine::part12UpdateBackground() {
if (compareGameTick(1) && getRandomNumber(14) == 0) {
- switch (getRandomNumber(3)) {
- case 0:
- playSound(21, 1);
- break;
- case 1:
- playSound(22, 1);
- break;
- case 2:
- playSound(23, 1);
- break;
- case 3:
- playSound(18, 1);
- break;
+ if (_game.version == kIdSpaFloppy) {
+ switch (getRandomNumber(2)) {
+ case 0:
+ playSound(21, 1);
+ break;
+ case 1:
+ playSound(kSpaFloppySoundParkAmbient, 1);
+ break;
+ case 2:
+ playSound(23, 1);
+ break;
+ }
+ } else {
+ switch (getRandomNumber(3)) {
+ case 0:
+ playSound(21, 1);
+ break;
+ case 1:
+ playSound(22, 1);
+ break;
+ case 2:
+ playSound(23, 1);
+ break;
+ case 3:
+ playSound(18, 1);
+ break;
+ }
}
}
}
@@ -376,7 +390,7 @@ void IgorEngine::part12ExorcismCutscene() {
SET_PAL_240_48_1();
SET_PAL_208_96_1();
fadeIn(768);
- playSound(13, 1);
+ playRoomSound(13, 0);
for (int i = 1; i <= 5; ++i) {
const uint8 *src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + i * 2) - 1;
decodeAnimFrame(src, _screenVGA, true);
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 94c4d5dee03..15b3aa25bb6 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -435,7 +435,7 @@ void IgorEngine::part14ShowPuzzle() {
if (area >= 1 && area <= 8) {
drawActionSentence(getString(STR_PushStone), 251);
hideCursor();
- playSound(34, 1);
+ playRoomSound(34, 0);
switch (area) {
case 1:
part14PushStone(33359, 28, 34, 0);
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index 62d253f07e0..bd67238c398 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -106,7 +106,7 @@ void IgorEngine::part18UseBottleOnTap() {
}
const int offset = 26798;
drawAnimRect(offset, 0xF0A, 28, 29);
- playSound(47, 1);
+ playRoomSound(kSoundPart18Tap, kSpaFloppySoundPart18Tap);
for (int i = 1; i <= 2; ++i) {
waitForTimer(_game.version == kIdSpaFloppy ? 120 : 200);
}
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index 835e2f78779..2de1050b6b6 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -88,7 +88,7 @@ void IgorEngine::part19UsePapyrusOnDryer() {
waitForTimer(45);
}
decodeAnimFrame(_animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + 0x35E) - 1, _screenVGA, true);
- playSound(45, 1);
+ playRoomSound(kSoundPart19Dryer, kSpaFloppySoundPart19Dryer);
partMainLookAtPapyrus(true);
part19ApplyObjectState(255);
stopSound();
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index 8c96c00c72a..ce948413c2b 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -315,20 +315,20 @@ void IgorEngine::part2ExecuteAction(int action) {
void IgorEngine::part2LightUpDynamite() {
memset(_screenVGA + 0xB400, 0, 0x4BFF);
- playSound(68, 1);
+ playRoomSound(68, 0);
animateLitAnimFrames(0x5CDC, 0, 2, 0x44C, 22, 50, 0x5989, 127, -1, 0);
waitForTimer(127);
igorSay(221, 1, 125);
if (_gameState.talkMode == kTalkModeTextOnly)
- playSound(11, 1);
+ playRoomSound(kSoundPart2Fuse, kSpaFloppySoundPart2Fuse);
_updateRoomBackground = &IgorEngine::part2UpdateFuse;
waitForEndOfIgorDialogue();
_updateRoomBackground = 0;
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer + 320 * 72, _dialogueDirtyRectSize);
if (_gameState.talkMode != kTalkModeTextOnly)
- playSound(11, 1);
+ playRoomSound(kSoundPart2Fuse, kSpaFloppySoundPart2Fuse);
part2WalkWhileFuseBurns(211, 120, 0, 143);
for (int elapsed = 0; elapsed < 255; elapsed += kTimerTicksCount) {
diff --git a/engines/igor/parts/part_32.cpp b/engines/igor/parts/part_32.cpp
index 54b21de6ec2..bba514ddcb4 100644
--- a/engines/igor/parts/part_32.cpp
+++ b/engines/igor/parts/part_32.cpp
@@ -230,7 +230,7 @@ void IgorEngine::part32ControlsIdle(int fieldColor) {
}
void IgorEngine::part32ExitControls() {
- playSound(getRandomNumber(1) + 0x42, 1);
+ playRoomSound(getRandomNumber(1) + 0x42, 0);
part32CopyControlColor(kPart32DeclinationColor, kPart32FieldColor);
part32CopyControlColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
@@ -239,7 +239,7 @@ void IgorEngine::part32ExitControls() {
void IgorEngine::part32SelectDeclination() {
- playSound(31, 1);
+ playRoomSound(31, 0);
part32CopyControlColor(kPart32DeclinationColor, kPart32FieldColor);
part32CopyControlColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32AscensionColor, kPart32AscensionColor);
@@ -249,7 +249,7 @@ void IgorEngine::part32SelectDeclination() {
_inputVars[kInputClick] = 0;
const int key = part32ControlKeyAtCursor();
if (key != kPart32KeyAscension) {
- playSound(getRandomNumber(1) + 0x42, 1);
+ playRoomSound(getRandomNumber(1) + 0x42, 0);
}
if (key >= 1 && key <= 10) {
// the declination does not go over 90
@@ -280,7 +280,7 @@ void IgorEngine::part32SelectDeclination() {
}
void IgorEngine::part32SelectAscension() {
- playSound(31, 1);
+ playRoomSound(31, 0);
part32CopyControlColor(kPart32DeclinationColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32DeclinationColor);
_part32Blink = 2;
@@ -289,7 +289,7 @@ void IgorEngine::part32SelectAscension() {
_inputVars[kInputClick] = 0;
const int key = part32ControlKeyAtCursor();
if (key != kPart32KeyDeclination) {
- playSound(getRandomNumber(1) + 0x42, 1);
+ playRoomSound(getRandomNumber(1) + 0x42, 0);
}
if (key >= 1 && key <= 10) {
// the ascension does not go over 360
@@ -326,7 +326,7 @@ void IgorEngine::part32SelectAscension() {
}
void IgorEngine::part32EnterCoordinates() {
- playSound(getRandomNumber(1) + 0x42, 1);
+ playRoomSound(getRandomNumber(1) + 0x42, 0);
part32CopyControlColor(kPart32DeclinationColor, kPart32FieldColor);
part32CopyControlColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
@@ -344,7 +344,7 @@ void IgorEngine::part32EnterCoordinates() {
}
int IgorEngine::part32AnimateDeclination() {
- playSound(30, 1);
+ playRoomSound(30, 0);
uint8 *digits = _part32DeclinationDigits;
if (digits[1] == 0xFF) {
digits[1] = digits[0];
@@ -369,7 +369,7 @@ int IgorEngine::part32AnimateDeclination() {
}
int IgorEngine::part32AnimateAscension() {
- playSound(30, 1);
+ playRoomSound(30, 0);
uint8 *digits = _part32AscensionDigits;
if (digits[2] == 0xFF) {
digits[2] = digits[1];
@@ -595,7 +595,7 @@ void IgorEngine::part32SceneGirl() {
decodeAnimFrame(_screenLayer2 + READ_LE_UINT16(_screenLayer2 + frame * 2 - 2) + 9, _screenVGA, false);
waitForTimer(50);
}
- playSound(32, 1);
+ playRoomSound(32, 0);
waitForTimer(255);
}
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index 7302d6c1e3b..9938564686e 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -86,19 +86,33 @@ void IgorEngine::part34And35PickUpAnimation(int screenOffset, int framesOffset)
*/
void IgorEngine::part34And35UpdateAmbientSound() {
if (compareGameTick(1) && getRandomNumber(14) == 0) {
- switch (getRandomNumber(3)) {
- case 0:
- playSound(21, 1);
- break;
- case 1:
- playSound(22, 1);
- break;
- case 2:
- playSound(23, 1);
- break;
- case 3:
- playSound(18, 1);
- break;
+ if (_game.version == kIdSpaFloppy) {
+ switch (getRandomNumber(2)) {
+ case 0:
+ playSound(21, 1);
+ break;
+ case 1:
+ playSound(kSpaFloppySoundParkAmbient, 1);
+ break;
+ case 2:
+ playSound(23, 1);
+ break;
+ }
+ } else {
+ switch (getRandomNumber(3)) {
+ case 0:
+ playSound(21, 1);
+ break;
+ case 1:
+ playSound(22, 1);
+ break;
+ case 2:
+ playSound(23, 1);
+ break;
+ case 3:
+ playSound(18, 1);
+ break;
+ }
}
}
}
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index 84bbae2e787..da4d1101042 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -268,21 +268,23 @@ void IgorEngine::part5UpdateBackground() {
scrollPalette(185, 191);
setPaletteRange(185, 191);
}
- if (compareGameTick(1)) {
- if (getRandomNumber(14) == 0) {
- switch (getRandomNumber(3)) {
- case 0:
- playSound(21, 1);
- break;
- case 1:
- playSound(22, 1);
- break;
- case 2:
- playSound(23, 1);
- break;
- case 3:
- playSound(18, 1);
- break;
+ if (_game.version != kIdSpaFloppy) {
+ if (compareGameTick(1)) {
+ if (getRandomNumber(14) == 0) {
+ switch (getRandomNumber(3)) {
+ case 0:
+ playSound(21, 1);
+ break;
+ case 1:
+ playSound(22, 1);
+ break;
+ case 2:
+ playSound(23, 1);
+ break;
+ case 3:
+ playSound(18, 1);
+ break;
+ }
}
}
}
diff --git a/engines/igor/parts/part_50.cpp b/engines/igor/parts/part_50.cpp
index a98c8a27a0a..124bf8f4ca3 100644
--- a/engines/igor/parts/part_50.cpp
+++ b/engines/igor/parts/part_50.cpp
@@ -76,6 +76,8 @@ void IgorEngine::part50EnterFromDoor() {
_walkDataCurrentIndex = 1;
_gameState.igorMoving = true;
waitForIgorMove();
+ if (_game.version == kIdSpaFloppy)
+ playSound(kSpaFloppySoundPart50Door, 1);
}
void IgorEngine::part50EnterFromHill() {
@@ -103,7 +105,7 @@ void IgorEngine::part50EnterFromHill() {
*/
void IgorEngine::part50UpdateBackground() {
if (compareGameTick(0x3D) && getRandomNumber(49) == 0) {
- playSound(44, 1);
+ playRoomSound(kSoundPart50Ambient, kSpaFloppySoundPart50Door);
}
}
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index da1a78e4a9c..aa15ba45833 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -40,7 +40,10 @@ void IgorEngine::part6UpdateBackground() {
setPaletteRange(185, 191);
}
if (compareGameTick(1)) {
- if (getRandomNumber(14) == 0) {
+ if (_game.version == kIdSpaFloppy) {
+ if (getRandomNumber(19) == 0)
+ playSound(kSpaFloppySoundPart6Ambient, 1);
+ } else if (getRandomNumber(14) == 0) {
switch (getRandomNumber(3)) {
case 0:
playSound(21, 1);
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 6ff7b7403b8..46ce8a39063 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -146,16 +146,23 @@ void IgorEngine::part68UpdateOwlsEyes() {
}
}
+void IgorEngine::part68PlayAmbientSound() {
+ if (_game.version == kIdSpaFloppy)
+ playSound(getRandomNumber(1) == 0 ? kSpaFloppySoundPart68AmbientA : kSpaFloppySoundPart68AmbientB, 1);
+ else
+ playSound(41, 1);
+}
+
void IgorEngine::part68UpdateBackgroundTalk() {
if (compareGameTick(1) && getRandomNumber(49) == 0) {
- playSound(41, 1);
+ part68PlayAmbientSound();
}
part68UpdateOwlsEyes();
}
void IgorEngine::part68UpdateBackground() {
if (compareGameTick(1) && getRandomNumber(49) == 0) {
- playSound(41, 1);
+ part68PlayAmbientSound();
}
if (compareGameTick(0x3D) && _part68NpcPresent) {
part68DrawUndertaker(getRandomNumber(2));
diff --git a/engines/igor/parts/part_76.cpp b/engines/igor/parts/part_76.cpp
index 281c09c8b7f..e673c3a3506 100644
--- a/engines/igor/parts/part_76.cpp
+++ b/engines/igor/parts/part_76.cpp
@@ -295,6 +295,8 @@ void IgorEngine::part76() {
setRoomClickFix(119, 153, 295, true, 119);
partMainSetExecuteAction(1, &IgorEngine::part76ExecuteAction);
part76ApplyObjectState();
+ if (_game.version == kIdSpaFloppy)
+ playSound(kSpaFloppySoundPlaneEngine, 1);
memcpy(_screenVGA, _screenLayer1, 46080);
if (!restoreRoomAfterLoad()) {
diff --git a/engines/igor/parts/part_79.cpp b/engines/igor/parts/part_79.cpp
index 208949dcbd1..e8d53e7fab6 100644
--- a/engines/igor/parts/part_79.cpp
+++ b/engines/igor/parts/part_79.cpp
@@ -457,7 +457,7 @@ void IgorEngine::part79BeachScene() {
waitForTimer(31);
}
if (frame == 0x59) {
- playSound(48, 1);
+ playRoomSound(48, 0);
}
}
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index c57b6303f3e..e8f122f84ce 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -338,12 +338,12 @@ void IgorEngine::part8ExecuteAction(int action) {
// Only the shards fall with a pause and a sound
if (!bottleCaught) {
waitForTimer(100);
- playSound(16, 1);
+ playRoomSound(kSoundPart8Shards, kSpaFloppySoundPart8Shards);
}
} else {
waitForTimer(101);
if (!bottleCaught)
- playSound(16, 1);
+ playRoomSound(kSoundPart8Shards, kSpaFloppySoundPart8Shards);
}
if (pendingDeanDrink == kPart08PendingDeanDrinkWater) {
part8DeanPassesOut();
diff --git a/engines/igor/parts/part_85.cpp b/engines/igor/parts/part_85.cpp
index 618096b33d0..d2cb9416fec 100644
--- a/engines/igor/parts/part_85.cpp
+++ b/engines/igor/parts/part_85.cpp
@@ -47,7 +47,7 @@ void IgorEngine::part85DisplayLogo() {
// The CD executable preserves the last intro frame while it displays a
// 320x122 title card, then restores that frame before entering part 61.
memcpy(_screenTextLayer, _screenVGA, 46080);
- playSound(65, 1);
+ playRoomSound(65, 0);
memcpy(_paletteBuffer, _currentPalette, 768);
loadData(PAL_IgorIntroLogo, _currentPalette);
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index 8fc63a93bda..af454a42147 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -292,7 +292,7 @@ void IgorEngine::part9() {
if (frame < 19)
waitForTimer(31);
else
- playSound(14, 1);
+ playRoomSound(14, 0);
}
waitForTimer(255);
fadeOut(624);
diff --git a/engines/igor/room.cpp b/engines/igor/room.cpp
index 8fc8b34c645..6966c04c6b4 100644
--- a/engines/igor/room.cpp
+++ b/engines/igor/room.cpp
@@ -24,6 +24,17 @@
namespace Igor {
+/**
+ * Plays an effect of a room. The Spanish floppy plays its own effect (or none, when spaFloppySound is 0)
+ * where the other versions play "sound".
+ */
+void IgorEngine::playRoomSound(int sound, int spaFloppySound) {
+ if (_game.version == kIdSpaFloppy)
+ sound = spaFloppySound;
+ if (sound > 0)
+ playSound(sound, 1);
+}
+
void IgorEngine::decodeRoomAreas(const uint8 *p, int count) {
for (int i = 0; i < count; ++i) {
RoomObjectArea *roa = &_roomObjectAreasTable[i];
Commit: 26ba9c36b1f2846e6d07c79d67d0b35de6a27a99
https://github.com/scummvm/scummvm/commit/26ba9c36b1f2846e6d07c79d67d0b35de6a27a99
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:19+01:00
Commit Message:
IGOR: Let player move cursor with keys in Spanish floppy version
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 641ce2aac7c..eed7beded1f 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -149,6 +149,7 @@ void IgorEngine::restart() {
_actionWalkPoint = 0;
_rightButtonSelecting = false;
_hoverVerbState = kHoverVerbSelected;
+ _keyboardCursorStep = 1;
_rightButtonSelectCursorX = _rightButtonSelectCursorY = 0;
memset(_inputVars, 0, sizeof(_inputVars));
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 2e4478afb50..1158c807744 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -26,6 +26,7 @@
#include "common/file.h"
#include "common/fs.h"
#include "common/hash-str.h"
+#include "common/keyboard.h"
#include "common/random.h"
#include "common/scummsys.h"
#include "common/serializer.h"
@@ -683,6 +684,7 @@ private:
bool _rightButtonSelecting;
// Verb highlighted while the cursor is over a hotspot (Spanish floppy): kHoverVerbSelected = the selected verb
int _hoverVerbState;
+ int _keyboardCursorStep;
int _rightButtonSelectCursorX, _rightButtonSelectCursorY;
bool _scrollInventory;
@@ -1739,6 +1741,8 @@ private:
void beginRightButtonVerbPick();
int getDefaultVerbAt(int x, int y) const;
void updateHoverVerbHighlight();
+ bool isCursorKey(Common::KeyCode key) const;
+ bool moveCursorWithKeyboard(Common::KeyCode key);
void updateRightButtonVerbPick();
void endRightButtonVerbPick();
void formatRightButtonSentence();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 4c44807c30a..63c6f377a96 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -56,8 +56,20 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
_fastMode, kTimerTicksCount * 1000 / kTickDelay / _fastMode);
} else if (ev.kbd.keycode == Common::KEYCODE_ESCAPE) {
_inputVars[kInputEscape] = 1;
+ } else if (_game.version == kIdSpaFloppy && moveCursorWithKeyboard(ev.kbd.keycode)) {
+ // the cursor was moved with the arrow/keypad keys
+ } else if (_game.version == kIdSpaFloppy && ev.kbd.keycode == Common::KEYCODE_INSERT) {
+ // Insert acts as the right button
+ if (!_gameState.dialogueTextRunning && !ev.kbdRepeat) {
+ _inputVars[kInputRightRelease] = 0;
+ _inputVars[kInputRightClick] = 1;
+ }
} else if (ev.kbd.keycode == Common::KEYCODE_RETURN || ev.kbd.keycode == Common::KEYCODE_KP_ENTER) {
_inputVars[kInputConfirm] = 1;
+ // Enter acts as the left button at the cursor position (first press only)
+ if (_game.version == kIdSpaFloppy && !_gameState.dialogueTextRunning && !ev.kbdRepeat) {
+ _inputVars[kInputClick] = 1;
+ }
} else if (ev.kbd.keycode == Common::KEYCODE_SPACE) {
_inputVars[kInputOptions] = 1;
} else if (ev.kbd.keycode == Common::KEYCODE_p) {
@@ -65,6 +77,9 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
}
break;
case Common::EVENT_KEYUP:
+ if (_game.version == kIdSpaFloppy && isCursorKey(ev.kbd.keycode)) {
+ _keyboardCursorStep = 1;
+ }
if (ev.kbd.keycode == Common::KEYCODE_RETURN || ev.kbd.keycode == Common::KEYCODE_KP_ENTER) {
_inputVars[kInputConfirm] = 0;
}
@@ -294,6 +309,47 @@ void IgorEngine::formatRightButtonSentence() {
}
}
+static const Common::KeyCode kCursorKeys[] = {
+ Common::KEYCODE_UP, Common::KEYCODE_DOWN, Common::KEYCODE_LEFT, Common::KEYCODE_RIGHT,
+ Common::KEYCODE_HOME, Common::KEYCODE_END, Common::KEYCODE_PAGEUP, Common::KEYCODE_PAGEDOWN,
+ Common::KEYCODE_KP8, Common::KEYCODE_KP2, Common::KEYCODE_KP4, Common::KEYCODE_KP6,
+ Common::KEYCODE_KP7, Common::KEYCODE_KP1, Common::KEYCODE_KP9, Common::KEYCODE_KP3
+};
+
+bool IgorEngine::isCursorKey(Common::KeyCode key) const {
+ for (uint i = 0; i < ARRAYSIZE(kCursorKeys); ++i) {
+ if (kCursorKeys[i] == key)
+ return true;
+ }
+ return false;
+}
+
+// Arrow and keypad keys move the cursor by a step that grows with every key
+// press (key repeat included) and returns to 1 when a key is released.
+bool IgorEngine::moveCursorWithKeyboard(Common::KeyCode key) {
+ if (!isCursorKey(key))
+ return false;
+ int dx = 0;
+ int dy = 0;
+ switch (key) {
+ case Common::KEYCODE_UP: case Common::KEYCODE_KP8: dy = -1; break;
+ case Common::KEYCODE_DOWN: case Common::KEYCODE_KP2: dy = 1; break;
+ case Common::KEYCODE_LEFT: case Common::KEYCODE_KP4: dx = -1; break;
+ case Common::KEYCODE_RIGHT: case Common::KEYCODE_KP6: dx = 1; break;
+ case Common::KEYCODE_HOME: case Common::KEYCODE_KP7: dx = -1; dy = -1; break;
+ case Common::KEYCODE_PAGEUP: case Common::KEYCODE_KP9: dx = 1; dy = -1; break;
+ case Common::KEYCODE_END: case Common::KEYCODE_KP1: dx = -1; dy = 1; break;
+ default: dx = 1; dy = 1; break;
+ }
+ const int step = _keyboardCursorStep++;
+ const int x = CLIP<int>(_inputVars[kInputCursorXPos] + dx * step, 0, 319);
+ const int y = CLIP<int>(_inputVars[kInputCursorYPos] + dy * step, 0, 199);
+ _inputVars[kInputCursorXPos] = x;
+ _inputVars[kInputCursorYPos] = y;
+ _system->warpMouse(x, y);
+ return true;
+}
+
/**
* The Spanish floppy highlights, while the cursor is over a hotspot, the default verb of that hotspot
* (Look for inventory objects) and shows the selected verb again when the cursor leaves.
Commit: 4b5bedd16b6398ab6726091b2fe3eb16993200ee
https://github.com/scummvm/scummvm/commit/4b5bedd16b6398ab6726091b2fe3eb16993200ee
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:19+01:00
Commit Message:
IGOR: Select look when no default action is present
Changed paths:
engines/igor/input.cpp
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 63c6f377a96..32cc71214db 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -628,7 +628,13 @@ void IgorEngine::handleRoomInput() {
debugC(9, kDebugEngine, "handleRoomInput() actionCode %d", _actionCode);
if (_actionCode == 0) {
debugC(9, kDebugEngine, "handleRoomInput() actionCode is 0, clearing action");
+ // The Spanish floppy selects Look when the last clicked object is an inventory item, otherwise Walk.
+ const int lastObjectType = _currentAction.verbType == 0 ? _currentAction.object1Type : _currentAction.object2Type;
clearAction();
+ if (_game.version == kIdSpaFloppy && lastObjectType == kObjectTypeInventory) {
+ _currentAction.verb = kVerbLook;
+ redrawVerb(kVerbLook, true);
+ }
return;
}
formatActionSentence(1);
Commit: 240f4ddb616726f27165fc9e7ebaa8e86e10a0a0
https://github.com/scummvm/scummvm/commit/240f4ddb616726f27165fc9e7ebaa8e86e10a0a0
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:20+01:00
Commit Message:
IGOR: Wait for click on photo & papyrus fullscreen views
Changed paths:
engines/igor/igor.h
engines/igor/part_main.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 1158c807744..b98a49c998b 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -856,6 +856,7 @@ private:
void partMainMoveScreenUp(int offset);
void partMainLookAtPapyrus(bool reveal);
void partMainExecuteAction(int action);
+ void partMainWaitForClick();
void partMainLookAtNewspaper();
void partMainLookAtPhoto();
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index f237f0c872c..30b9832f0de 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -298,6 +298,17 @@ void IgorEngine::partMainExecuteAction(int action) {
}
}
+// Waits until a click (left or right button, or the keys that stand for them).
+void IgorEngine::partMainWaitForClick() {
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputRightClick] = 0;
+ while (!_inputVars[kInputClick] && !_inputVars[kInputRightClick] && !_eventQuitGame) {
+ waitForTimer(1);
+ }
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputRightClick] = 0;
+}
+
void IgorEngine::partMainLookAtNewspaper() {
memcpy(_paletteBuffer, _currentPalette, 624);
fadeOut(624);
@@ -330,6 +341,9 @@ void IgorEngine::partMainLookAtNewspaper() {
SET_DIALOGUE_TEXT(1, 2);
startIgorDialogue();
waitForEndOfIgorDialogue(false, false);
+ // the Spanish floppy keeps the newspaper on screen until a click
+ if (_game.version == kIdSpaFloppy)
+ partMainWaitForClick();
wd->x = _walkDataCurrentPosX2;
wd->y = _walkDataCurrentPosY2;
wd->scaleWidth = _walkDataCurrentWScale;
@@ -340,7 +354,8 @@ void IgorEngine::partMainLookAtNewspaper() {
free(tmp);
}
fadeIn(624);
- if (_objectsState[kAstronomyBookStateIndex] == 0) {
+ // the Spanish floppy sets the state even when the astronomy book was already read
+ if (_game.version == kIdSpaFloppy || _objectsState[kAstronomyBookStateIndex] == 0) {
_objectsState[kAstronomyBookStateIndex] = 1;
}
}
@@ -365,6 +380,9 @@ void IgorEngine::partMainLookAtPhoto() {
wd->scaleWidth = 50;
igorSay(83, 2, 59);
waitForEndOfIgorDialogue(false, false);
+ // the Spanish floppy keeps the photo on screen until a click
+ if (_game.version == kIdSpaFloppy)
+ partMainWaitForClick();
_currentAction.object1Num = 0;
wd->x = _walkDataCurrentPosX2;
wd->y = _walkDataCurrentPosY2;
@@ -921,22 +939,19 @@ void IgorEngine::partMainLookAtPapyrus(bool reveal) {
wd->x = 160;
wd->y = 130;
wd->scaleWidth = 50;
- if (_objectsState[kPapyrusFiguresVisibleStateIndex] == 0) {
- ADD_DIALOGUE_TEXT(99, 1, 68);
- } else {
- ADD_DIALOGUE_TEXT(100, 2, 69);
+ // the Spanish floppy shows the paper without any comment
+ if (_game.version != kIdSpaFloppy) {
+ if (_objectsState[kPapyrusFiguresVisibleStateIndex] == 0) {
+ ADD_DIALOGUE_TEXT(99, 1, 68);
+ } else {
+ ADD_DIALOGUE_TEXT(100, 2, 69);
+ }
+ SET_DIALOGUE_TEXT(1, 1);
+ startIgorDialogue();
+ waitForEndOfIgorDialogue(false, false);
}
- SET_DIALOGUE_TEXT(1, 1);
- startIgorDialogue();
- waitForEndOfIgorDialogue(false, false);
// the paper stays on screen until another click (left or right)
- _inputVars[kInputClick] = 0;
- _inputVars[kInputRightClick] = 0;
- while (!_inputVars[kInputClick] && !_inputVars[kInputRightClick] && !_eventQuitGame) {
- waitForTimer(1);
- }
- _inputVars[kInputClick] = 0;
- _inputVars[kInputRightClick] = 0;
+ partMainWaitForClick();
wd->x = _walkDataCurrentPosX2;
wd->y = _walkDataCurrentPosY2;
wd->scaleWidth = _walkDataCurrentWScale;
Commit: b0bf952bdf1f383cdf226f89c603372561703d2b
https://github.com/scummvm/scummvm/commit/b0bf952bdf1f383cdf226f89c603372561703d2b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:20+01:00
Commit Message:
IGOR: Fix sentence text color in church puzzle for the Spanish floppy version
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_14.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index b98a49c998b..1c69005a2f6 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1025,6 +1025,7 @@ private:
void part14ShowPuzzle();
void part14LoadChurchMosaicData();
void part14PushStone(int screenOffset, int w, int h, int animOffset);
+ uint8 mosaicSentenceColor(int index) const;
void part14();
void part14LoadRoom();
void part14LoadAnimation();
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 15b3aa25bb6..4f506c02683 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -415,13 +415,13 @@ void IgorEngine::part14ShowPuzzle() {
if (VAR_NEW_CHURCH_MOSAIC_STONE != VAR_CURRENT_CHURCH_MOSAIC_STONE) {
switch (VAR_NEW_CHURCH_MOSAIC_STONE) {
case 1:
- drawActionSentence("", 253);
+ drawActionSentence("", mosaicSentenceColor(0));
break;
case 2:
- drawActionSentence(getString(STR_PushStone), 253);
+ drawActionSentence(getString(STR_PushStone), mosaicSentenceColor(0));
break;
case 3:
- drawActionSentence(getString(STR_Exit), 253);
+ drawActionSentence(getString(STR_Exit), mosaicSentenceColor(0));
break;
}
VAR_CURRENT_CHURCH_MOSAIC_STONE = VAR_NEW_CHURCH_MOSAIC_STONE;
@@ -433,7 +433,7 @@ void IgorEngine::part14ShowPuzzle() {
_currentPart = 146;
}
if (area >= 1 && area <= 8) {
- drawActionSentence(getString(STR_PushStone), 251);
+ drawActionSentence(getString(STR_PushStone), mosaicSentenceColor(1));
hideCursor();
playRoomSound(34, 0);
switch (area) {
@@ -463,7 +463,7 @@ void IgorEngine::part14ShowPuzzle() {
break;
}
stopSound();
- drawActionSentence(getString(STR_PushStone), 253);
+ drawActionSentence(getString(STR_PushStone), mosaicSentenceColor(0));
showCursor();
_dialogueEnded = false;
++_gameState.counter[4];
@@ -495,7 +495,7 @@ void IgorEngine::part14ShowPuzzle() {
// input is only gathered while waiting for the timer.
waitForTimer();
} while (!_eventQuitGame && !(_currentPart >= 145 && _currentPart <= 146 && _dialogueEnded));
- drawActionSentence("", 253);
+ drawActionSentence("", mosaicSentenceColor(0));
hideCursor();
if (_currentPart == 145) {
playSound(35, 1);
@@ -513,6 +513,10 @@ void IgorEngine::part14LoadChurchMosaicData() {
free(p);
}
+uint8 IgorEngine::mosaicSentenceColor(int index) const {
+ return (_game.version == kIdSpaFloppy) ? _actionSentenceColors[index] : _sentenceColorIndex[index];
+}
+
void IgorEngine::part14PushStone(int screenOffset, int w, int h, int animOffset) {
for (int i = 0; i <= h; ++i) {
memcpy(_screenTempLayer + i * 100, _screenVGA + i * 320 + screenOffset, w);
Commit: 4eba82202d6e6c7b4b6c32d58b419dca62fbb3cd
https://github.com/scummvm/scummvm/commit/4eba82202d6e6c7b4b6c32d58b419dca62fbb3cd
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:20+01:00
Commit Message:
IGOR: Fix missing sounds in room 32 for the Spanish floppy
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_14.cpp
engines/igor/parts/part_32.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 1c69005a2f6..22ea95a3d3f 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -110,7 +110,12 @@ enum SpaFloppySound {
kSpaFloppySoundPart6Ambient = 76,
kSpaFloppySoundPart8Shards = 77,
kSpaFloppySoundPart1Window = 79,
- kSpaFloppySoundPart2Fuse = 80
+ kSpaFloppySoundPart2Fuse = 80,
+ kSpaFloppySoundPart14StonePush = 34,
+ kSpaFloppySoundPart14Solved = 74,
+ kSpaFloppySoundPart32Key = 31,
+ kSpaFloppySoundPart32Animation = 73,
+ kSpaFloppySoundPart32Girl = 32
};
// Value of _hoverVerbState when the verb panel shows the selected verb
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 4f506c02683..94d190f6d15 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -435,7 +435,7 @@ void IgorEngine::part14ShowPuzzle() {
if (area >= 1 && area <= 8) {
drawActionSentence(getString(STR_PushStone), mosaicSentenceColor(1));
hideCursor();
- playRoomSound(34, 0);
+ playRoomSound(34, kSpaFloppySoundPart14StonePush);
switch (area) {
case 1:
part14PushStone(33359, 28, 34, 0);
@@ -476,7 +476,7 @@ void IgorEngine::part14ShowPuzzle() {
} else {
_currentPart = 145;
_gameState.counter[4] = 0;
- playSound(35, 1);
+ playRoomSound(35, kSpaFloppySoundPart14Solved);
waitForTimer(255);
stopSound();
// The mosaic screen has no Igor sprite, so his head is not animated.
@@ -498,7 +498,7 @@ void IgorEngine::part14ShowPuzzle() {
drawActionSentence("", mosaicSentenceColor(0));
hideCursor();
if (_currentPart == 145) {
- playSound(35, 1);
+ playRoomSound(35, kSpaFloppySoundPart14Solved);
}
fadeOut(768);
memcpy(_screenVGA, _screenLayer1, 46080);
diff --git a/engines/igor/parts/part_32.cpp b/engines/igor/parts/part_32.cpp
index bba514ddcb4..d521fbc22e2 100644
--- a/engines/igor/parts/part_32.cpp
+++ b/engines/igor/parts/part_32.cpp
@@ -230,7 +230,7 @@ void IgorEngine::part32ControlsIdle(int fieldColor) {
}
void IgorEngine::part32ExitControls() {
- playRoomSound(getRandomNumber(1) + 0x42, 0);
+ playRoomSound(getRandomNumber(1) + 0x42, kSpaFloppySoundPart32Key);
part32CopyControlColor(kPart32DeclinationColor, kPart32FieldColor);
part32CopyControlColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
@@ -249,7 +249,7 @@ void IgorEngine::part32SelectDeclination() {
_inputVars[kInputClick] = 0;
const int key = part32ControlKeyAtCursor();
if (key != kPart32KeyAscension) {
- playRoomSound(getRandomNumber(1) + 0x42, 0);
+ playRoomSound(getRandomNumber(1) + 0x42, kSpaFloppySoundPart32Key);
}
if (key >= 1 && key <= 10) {
// the declination does not go over 90
@@ -289,7 +289,7 @@ void IgorEngine::part32SelectAscension() {
_inputVars[kInputClick] = 0;
const int key = part32ControlKeyAtCursor();
if (key != kPart32KeyDeclination) {
- playRoomSound(getRandomNumber(1) + 0x42, 0);
+ playRoomSound(getRandomNumber(1) + 0x42, kSpaFloppySoundPart32Key);
}
if (key >= 1 && key <= 10) {
// the ascension does not go over 360
@@ -326,7 +326,7 @@ void IgorEngine::part32SelectAscension() {
}
void IgorEngine::part32EnterCoordinates() {
- playRoomSound(getRandomNumber(1) + 0x42, 0);
+ playRoomSound(getRandomNumber(1) + 0x42, kSpaFloppySoundPart32Key);
part32CopyControlColor(kPart32DeclinationColor, kPart32FieldColor);
part32CopyControlColor(kPart32AscensionColor, kPart32FieldColor);
setPaletteRange(kPart32DeclinationColor, kPart32AscensionColor);
@@ -344,7 +344,7 @@ void IgorEngine::part32EnterCoordinates() {
}
int IgorEngine::part32AnimateDeclination() {
- playRoomSound(30, 0);
+ playRoomSound(30, kSpaFloppySoundPart32Animation);
uint8 *digits = _part32DeclinationDigits;
if (digits[1] == 0xFF) {
digits[1] = digits[0];
@@ -369,7 +369,7 @@ int IgorEngine::part32AnimateDeclination() {
}
int IgorEngine::part32AnimateAscension() {
- playRoomSound(30, 0);
+ playRoomSound(30, kSpaFloppySoundPart32Animation);
uint8 *digits = _part32AscensionDigits;
if (digits[2] == 0xFF) {
digits[2] = digits[1];
@@ -595,7 +595,7 @@ void IgorEngine::part32SceneGirl() {
decodeAnimFrame(_screenLayer2 + READ_LE_UINT16(_screenLayer2 + frame * 2 - 2) + 9, _screenVGA, false);
waitForTimer(50);
}
- playRoomSound(32, 0);
+ playRoomSound(32, kSpaFloppySoundPart32Girl);
waitForTimer(255);
}
Commit: 9727162d0ad3aaaf1a45b197d45cbcd1e51cb11a
https://github.com/scummvm/scummvm/commit/9727162d0ad3aaaf1a45b197d45cbcd1e51cb11a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:21+01:00
Commit Message:
IGOR: Save issues when saving while Igor was walking
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index eed7beded1f..02558c974e2 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -115,6 +115,7 @@ Common::String IgorEngine::getGameId() const {
void IgorEngine::restart() {
_screenVGAVOffset = 0;
_gameStateLoaded = false;
+ _loadedIgorMoving = false;
_creditsPass = 0;
memset(&_gameState, 0, sizeof(_gameState));
@@ -265,7 +266,8 @@ void IgorEngine::enterPartLoop() {
if (!_gameState.dialogueTextRunning) {
showCursor();
}
- _gameState.igorMoving = false;
+ _gameState.igorMoving = _loadedIgorMoving;
+ _loadedIgorMoving = false;
if (_game.version == kIdEngDemo110 && _demoActionsCounter >= 10) {
ADD_DIALOGUE_TEXT(104, 2);
ADD_DIALOGUE_TEXT(106, 2);
@@ -275,9 +277,12 @@ void IgorEngine::enterPartLoop() {
}
bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
+ _loadedIgorMoving = false;
if (!_gameStateLoaded)
return false;
+ // A game saved while Igor was walking keeps walking once the room is entered.
+ _loadedIgorMoving = _gameState.igorMoving;
memcpy(_screenVGA, _screenLayer1, 46080);
if (drawIgor) { // position Igor in the room at the saved position
if (!_gameState.igorMoving)
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 22ea95a3d3f..305b6c49751 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -652,6 +652,7 @@ private:
bool _eventQuitGame;
bool _gameStateLoaded;
+ bool _loadedIgorMoving;
// pass of the end credits: 0 for the first one (set when the ending is over), the same "pages" are shown again after it
uint8 _creditsPass;
Commit: 8394cb363579f63dcccaf90b568df101305e292d
https://github.com/scummvm/scummvm/commit/8394cb363579f63dcccaf90b568df101305e292d
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:21+01:00
Commit Message:
IGOR: Fix verbs panel showing up during intercom cutscene
Changed paths:
engines/igor/parts/part_8.cpp
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index e8f122f84ce..4a669c919ac 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -176,6 +176,7 @@ void IgorEngine::part8DeanCallsSecretary() {
free(roomScreen);
SET_PAL_240_48_1();
SET_PAL_208_96_1();
+ drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
fadeIn(768);
_currentPart = currentPart;
@@ -245,7 +246,7 @@ void IgorEngine::part8HandleIntercomDialogue() {
_roomDataOffsets.dlg = { -174, 2, 257, 0, 30, 0, 459, 459, 0 };
loadDialogueData(DLG_Part8Intercom);
_updateDialogue = 0;
- handleDialogue(0, 0, 0, 0, 0);
+ handleDialogue(0, 0, 0, 0, 0, false);
_roomDataOffsets = savedOffsets;
}
Commit: 781597f1fdf724cd325ea4164f27d522e24249e4
https://github.com/scummvm/scummvm/commit/781597f1fdf724cd325ea4164f27d522e24249e4
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:21+01:00
Commit Message:
IGOR: Disallow saving when characters speak lines
Changed paths:
engines/igor/text.cpp
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index fbf2d58774e..ee34da69ffd 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -217,9 +217,12 @@ void IgorEngine::cutsceneSayWithCallback(int x, int y, int r, int g, int b, int
* Loop for character talking
*/
void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b) {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
do {
if (_eventQuitGame) {
cancelDialogue();
+ _canSaveGame = savingWasAllowed;
return;
}
// stop speech if skip dialogue hit
@@ -276,10 +279,12 @@ void IgorEngine::waitForEndOfCutsceneDialogue(int x, int y, int r, int g, int b)
}
// Escape only aborts dialogue during the intro cutscene.
if (_inputVars[kInputEscape] && _currentPart == 850) {
+ _canSaveGame = savingWasAllowed;
return;
}
waitForTimer();
} while (_gameState.dialogueTextRunning);
+ _canSaveGame = savingWasAllowed;
}
@@ -382,9 +387,12 @@ void IgorEngine::startIgorDialogue() {
}
void IgorEngine::waitForEndOfIgorDialogue(bool animateHead, bool updateRoomBackground) {
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
do {
if (_eventQuitGame) {
cancelDialogue();
+ _canSaveGame = savingWasAllowed;
return;
}
if (_gameState.dialogueTextRunning && _inputVars[kInputSkipDialogue]) {
@@ -436,10 +444,13 @@ void IgorEngine::waitForEndOfIgorDialogue(bool animateHead, bool updateRoomBackg
if (updateRoomBackground && _updateRoomBackground) {
(this->*_updateRoomBackground)();
}
- if (_inputVars[kInputEscape] && _currentPart == 850)
+ if (_inputVars[kInputEscape] && _currentPart == 850) {
+ _canSaveGame = savingWasAllowed;
return;
+ }
waitForTimer();
} while (_gameState.dialogueTextRunning);
+ _canSaveGame = savingWasAllowed;
}
void IgorEngine::animateIgorTalking(int frame) {
Commit: f07f631ef0728e8d83e6b400c50e1fd3a2773376
https://github.com/scummvm/scummvm/commit/f07f631ef0728e8d83e6b400c50e1fd3a2773376
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:22+01:00
Commit Message:
IGOR: Save during dialogue
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/parts/part_8.cpp
engines/igor/resource.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 02558c974e2..e1341b328ef 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -115,6 +115,8 @@ Common::String IgorEngine::getGameId() const {
void IgorEngine::restart() {
_screenVGAVOffset = 0;
_gameStateLoaded = false;
+ _resumeDialogueId = 0;
+ _dialogueResuming = false;
_loadedIgorMoving = false;
_creditsPass = 0;
@@ -302,12 +304,34 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
}
if (!_gameState.dialogueTextRunning)
showCursor();
+ _resumeDialogueId = _gameState.dialogueStarted;
_gameStateLoaded = false;
fadeIn(768);
return true;
}
+/**
+ * Called by a room after loading a savegame taken while one of its dialogue choice menus was open.
+ * Returns true if that menu is the dialogue with the given id and has to be run again
+ */
+bool IgorEngine::takeResumeDialogue(uint8 id) {
+ if (_resumeDialogueId == 0 || _resumeDialogueId != id)
+ return false;
+ _resumeDialogueId = 0;
+ _dialogueResuming = true;
+ return true;
+}
+
+// the cursor comes back and the action is cleared.
+void IgorEngine::finishResumedDialogue() {
+ if (!_gameState.dialogueTextRunning) {
+ showCursor();
+ }
+ clearAction(true);
+}
+
void IgorEngine::leavePartLoop() {
+ _resumeDialogueId = 0;
_roomWalkTargetRules.enabled = false;
_roomGiveObjectSize = 0;
hideCursor();
@@ -568,12 +592,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
}
s.syncAsByte(_gameState.unk10);
s.syncAsByte(_gameState.unk11);
- {
- byte v = _gameState.dialogueStarted ? 1 : 0;
- s.syncAsByte(v);
- if (s.isLoading())
- _gameState.dialogueStarted = v != 0;
- }
+ s.syncAsByte(_gameState.dialogueStarted);
s.skip(1);
for (int i = 0; i < 500; ++i) {
s.syncAsByte(_gameState.dialogueData[i]);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 305b6c49751..74d3d769c41 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -191,7 +191,7 @@ struct GameStateData {
bool unkF;
uint8 unk10;
uint8 unk11;
- bool dialogueStarted;
+ uint8 dialogueStarted; // 0 = no choice menu open, otherwise the id of the dialogue that is open
// byte[1]
uint8 dialogueData[583];
uint8 dialogueChoiceStart;
@@ -652,6 +652,8 @@ private:
bool _eventQuitGame;
bool _gameStateLoaded;
+ uint8 _resumeDialogueId; // id of the choice menu that was open in the loaded savegame, until a room resumes it
+ bool _dialogueResuming; // the choice menu being run continues a loaded savegame
bool _loadedIgorMoving;
// pass of the end credits: 0 for the first one (set when the ending is over), the same "pages" are shown again after it
@@ -1787,6 +1789,8 @@ private:
void leavePartLoop();
void runPartLoop();
bool restoreRoomAfterLoad(bool drawIgor = true);
+ bool takeResumeDialogue(uint8 id);
+ void finishResumedDialogue();
void handleRoomDialogue();
@@ -1860,7 +1864,7 @@ private:
int dialogueChoiceOffset(int i) const;
Common::String dialogueChoiceText(int choice, const char *prefix) const;
void drawFloppyDialogueChoice(int choice, int color);
- void handleDialogue(int x, int y, int r, int g, int b, bool restoreUI = true);
+ void handleDialogue(int x, int y, int r, int g, int b, bool restoreUI = true, uint8 id = 1);
void drawDialogueChoices();
int selectDialogue();
void dialogueAskQuestion();
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index 4a669c919ac..3f2a242d97f 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -246,7 +246,7 @@ void IgorEngine::part8HandleIntercomDialogue() {
_roomDataOffsets.dlg = { -174, 2, 257, 0, 30, 0, 459, 459, 0 };
loadDialogueData(DLG_Part8Intercom);
_updateDialogue = 0;
- handleDialogue(0, 0, 0, 0, 0, false);
+ handleDialogue(0, 0, 0, 0, 0, false, 2);
_roomDataOffsets = savedOffsets;
}
@@ -452,6 +452,11 @@ void IgorEngine::part8() {
}
enterPartLoop();
+ if (takeResumeDialogue(1)) { // loaded while talking to the dean
+ part8HandleDeanDialogue();
+ part8ApplyObjectState(255);
+ finishResumedDialogue();
+ }
while (_currentPart == 80 && !_gameStateLoaded)
runPartLoop();
leavePartLoop();
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index 53d263c0523..f99dbc99e50 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -172,7 +172,8 @@ void IgorEngine::loadDialogueData(int dlg) {
uint8 *p = loadData(dlg, 0, &dataSize);
int dialogueDataSize = _roomDataOffsets.dlg.questionsOffset + 164 + 41;
assert(dialogueDataSize <= (int)sizeof(_gameState.dialogueData));
- memcpy(_gameState.dialogueData, p, dialogueDataSize);
+ if (!_dialogueResuming) // a loaded savegame already holds the answered questions
+ memcpy(_gameState.dialogueData, p, dialogueDataSize);
assert(_roomDataOffsets.dlg.questionsSize <= MAX_DIALOGUE_QUESTIONS);
assert(_roomDataOffsets.dlg.repliesSize <= MAX_DIALOGUE_REPLIES);
memset(_dialogueQuestionSounds, 0, sizeof(_dialogueQuestionSounds));
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index ee34da69ffd..2a55239fd17 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -526,10 +526,14 @@ void IgorEngine::drawFloppyDialogueChoice(int choice, int color) {
/**
* Pos and color
*/
-void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreUI) {
- _gameState.dialogueStarted = true;
- _gameState.dialogueChoiceStart = 1;
- _gameState.dialogueChoiceCount = 1;
+void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreUI, uint8 id) {
+ const bool resuming = _dialogueResuming;
+ _dialogueResuming = false;
+ _gameState.dialogueStarted = id;
+ if (!resuming) { // a loaded savegame keeps the menu position it was saved at
+ _gameState.dialogueChoiceStart = 1;
+ _gameState.dialogueChoiceCount = 1;
+ }
_dialogueEnded = false;
if (getPart() == 12 && _objectsState[kLizardTakenStateIndex] == 0) {
_gameState.dialogueData[6] = 1;
@@ -596,7 +600,7 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreU
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
}
_currentAction.verb = kVerbWalk;
- _gameState.dialogueStarted = false;
+ _gameState.dialogueStarted = 0;
}
@@ -681,9 +685,11 @@ int IgorEngine::selectDialogue() {
}
waitForTimer();
- } while (!end && !_eventQuitGame);
+ } while (!end && !_eventQuitGame && !_gameStateLoaded);
hideCursor();
debugC(9, kDebugEngine, "selectDialogue() end hovered %d quit %d", hoveredChoice, _eventQuitGame);
+ if (_gameStateLoaded)
+ return -1;
return hoveredChoice;
}
Commit: f41c75f7d767d5a6213c0121a85f2ee87692df17
https://github.com/scummvm/scummvm/commit/f41c75f7d767d5a6213c0121a85f2ee87692df17
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:22+01:00
Commit Message:
IGOR: load from dialogue options in rooms 33, 81 and 9
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_33.cpp
engines/igor/parts/part_81.cpp
engines/igor/parts/part_9.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 74d3d769c41..19f0cb6f074 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -968,6 +968,7 @@ private:
void part9UpdateSecretaryDialogue(int action);
void part9DrawSecretaryTalkingFrame(int frame);
void part9SecretarySearchesFile();
+ void part9TalkToSecretary();
void part9UpdateBackground();
// Decanato right
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index 9c23e368ee7..78178d98293 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -371,6 +371,8 @@ void IgorEngine::part33() {
partMainSetExecuteAction(1, &IgorEngine::part33ExecuteAction);
_updateRoomBackground = &IgorEngine::part33UpdateBackground;
part33ApplyObjectState(255);
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
@@ -378,6 +380,11 @@ void IgorEngine::part33() {
part33WalkIn();
enterPartLoop();
}
+ if (takeResumeDialogue(1)) { // loaded while talking to harrison
+ part33HandleHarrisonDialogue();
+ part33ApplyObjectState(255);
+ finishResumedDialogue();
+ }
while (_currentPart == 330 && !_gameStateLoaded) {
runPartLoop();
}
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index f56b8814b32..2c007695a7a 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -383,9 +383,13 @@ void IgorEngine::part81HandleDialogue() {
_updateRoomBackground = 0;
_updateDialogue = &IgorEngine::part81UpdateLighthouseKeeperDialogue;
loadDialogueData(DLG_Part81);
- _gameState.dialogueStarted = true;
- _gameState.dialogueChoiceStart = 1;
- _gameState.dialogueChoiceCount = 1;
+ const bool resuming = _dialogueResuming;
+ _dialogueResuming = false;
+ _gameState.dialogueStarted = 1;
+ if (!resuming) { // a loaded savegame keeps the menu position it was saved at
+ _gameState.dialogueChoiceStart = 1;
+ _gameState.dialogueChoiceCount = 1;
+ }
bool done = false;
do {
@@ -432,7 +436,7 @@ void IgorEngine::part81HandleDialogue() {
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
- _gameState.dialogueStarted = false;
+ _gameState.dialogueStarted = 0;
_updateDialogue = 0;
_updateRoomBackground = previousBackground;
}
@@ -533,6 +537,11 @@ void IgorEngine::part81() {
part81WalkIn();
}
enterPartLoop();
+ if (takeResumeDialogue(1)) { // loaded while talking to the lighthouse keeper
+ part81HandleDialogue();
+ part81ApplyObjectState(255);
+ finishResumedDialogue();
+ }
while (_currentPart == 810 && !_gameStateLoaded) {
runPartLoop();
}
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index af454a42147..da240e3b213 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -186,6 +186,19 @@ void IgorEngine::part9UpdateBackground() {
part9DrawSecretaryFrame(getRandomNumber(2), false);
}
+void IgorEngine::part9TalkToSecretary() {
+ // the blocking dialogue loops never run the room's idle animation, which
+ // would otherwise fight the secretary's talking frames
+ const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
+ _updateRoomBackground = 0;
+ loadDialogueData(DLG_AdministrationSecretaryRoom);
+ _updateDialogue = &IgorEngine::part9UpdateSecretaryDialogue;
+ handleDialogue(63, 59, 0, 90, 65);
+ _updateDialogue = 0;
+ _updateRoomBackground = updateRoomBackground;
+ part9ApplyObjectState(255);
+}
+
void IgorEngine::part9ExecuteAction(int action) {
switch (action) {
case 101: // open file cabinet
@@ -195,18 +208,7 @@ void IgorEngine::part9ExecuteAction(int action) {
igorSayAndWait(201, 2, 234);
break;
case 103: // talk to secretary
- {
- // the blocking dialogue loops never run the room's idle animation, which
- // would otherwise fight the secretary's talking frames
- const UpdateRoomBackgroundProc updateRoomBackground = _updateRoomBackground;
- _updateRoomBackground = 0;
- loadDialogueData(DLG_AdministrationSecretaryRoom);
- _updateDialogue = &IgorEngine::part9UpdateSecretaryDialogue;
- handleDialogue(63, 59, 0, 90, 65);
- _updateDialogue = 0;
- _updateRoomBackground = updateRoomBackground;
- }
- part9ApplyObjectState(255);
+ part9TalkToSecretary();
break;
case 104: // look at secretary
igorSayAndWait(203, 2, 235);
@@ -328,6 +330,10 @@ void IgorEngine::part9() {
}
enterPartLoop();
+ if (takeResumeDialogue(1)) { // loaded while talking to the secretary
+ part9TalkToSecretary();
+ finishResumedDialogue();
+ }
while (_currentPart == 90 && !_gameStateLoaded)
runPartLoop();
leavePartLoop();
Commit: 133381f35c2c47478b38858c4c93d3fd8748d7a5
https://github.com/scummvm/scummvm/commit/133381f35c2c47478b38858c4c93d3fd8748d7a5
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:22+01:00
Commit Message:
IGOR: Allow saving during dialogue in parts 15 and 21
Changed paths:
engines/igor/parts/part_15.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_21_floppy.cpp
diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp
index 32e2fb15a40..35b802bf80c 100644
--- a/engines/igor/parts/part_15.cpp
+++ b/engines/igor/parts/part_15.cpp
@@ -371,6 +371,8 @@ void IgorEngine::part15() {
partMainSetExecuteAction(1, &IgorEngine::part15ExecuteAction);
_updateRoomBackground = &IgorEngine::part15UpdateBackground;
part15ApplyObjectState(255);
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
@@ -382,6 +384,11 @@ void IgorEngine::part15() {
part15WalkIn();
enterPartLoop();
}
+ if (takeResumeDialogue(1)) { // loaded while talking to tobias
+ part15HandleTobiasDialogue();
+ part15ApplyObjectState(255);
+ finishResumedDialogue();
+ }
while (_currentPart == 150 && !_gameStateLoaded) {
runPartLoop();
}
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index 4a0555f367e..a53b2ed9a11 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -414,6 +414,8 @@ void IgorEngine::part21() {
_updateRoomBackground = &IgorEngine::part21UpdateBackground;
part21ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
if (!restoreRoomAfterLoad()) {
_gameState.unk10 = 1;
_currentAction.verb = kVerbWalk;
@@ -427,6 +429,11 @@ void IgorEngine::part21() {
}
}
enterPartLoop();
+ if (takeResumeDialogue(1)) { // loaded while talking to margaret
+ part21HandleMargaretDialogue();
+ part21ApplyObjectState(255);
+ finishResumedDialogue();
+ }
while (_currentPart >= 210 && _currentPart <= 212 && !_gameStateLoaded) {
runPartLoop();
}
diff --git a/engines/igor/parts/part_21_floppy.cpp b/engines/igor/parts/part_21_floppy.cpp
index 408ee5ea541..d66d538b8d7 100644
--- a/engines/igor/parts/part_21_floppy.cpp
+++ b/engines/igor/parts/part_21_floppy.cpp
@@ -396,6 +396,8 @@ void IgorEngine::part21Floppy() {
_updateRoomBackground = &IgorEngine::part21FloppyUpdateBackground;
part21FloppyApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
if (!restoreRoomAfterLoad()) {
_gameState.unk10 = 1;
_currentAction.verb = kVerbWalk;
@@ -409,6 +411,11 @@ void IgorEngine::part21Floppy() {
}
}
enterPartLoop();
+ if (takeResumeDialogue(1)) { // loaded while talking to margaret
+ part21FloppyHandleMargaretDialogue();
+ part21FloppyApplyObjectState(255);
+ finishResumedDialogue();
+ }
while (_currentPart >= 210 && _currentPart <= 212 && !_gameStateLoaded) {
runPartLoop();
}
Commit: c19f596e51578a6a5f57f22b362d4fa0eac9484d
https://github.com/scummvm/scummvm/commit/c19f596e51578a6a5f57f22b362d4fa0eac9484d
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:23+01:00
Commit Message:
IGOR: Allow saving in dialogue in part 6
Changed paths:
engines/igor/igor.cpp
engines/igor/parts/part_6.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index e1341b328ef..5104a1fce35 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -301,6 +301,9 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
drawVerbsPanel();
redrawVerb(_currentAction.verb, true);
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
+ } else {
+ // the choice menu fills this area once the dialogue resumes; until then it must not show what was on screen before the load
+ memset(_screenVGA + 46080, 0, 17920);
}
if (!_gameState.dialogueTextRunning)
showCursor();
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index aa15ba45833..9871f340933 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -328,6 +328,11 @@ void IgorEngine::part6() {
_walkDataCurrentIndex = 1;
enterPartLoop();
}
+ if (takeResumeDialogue(1)) { // loaded while talking to the photographer
+ part6HandlePhotographerDialogue();
+ part6SetPhotographerState(255);
+ finishResumedDialogue();
+ }
while (_currentPart >= 60 && _currentPart <= 61 && !_gameStateLoaded) {
setRoomWalkBounds(0, 0, _objectsState[kPhotographerGoneStateIndex] == 0 ? 234 : 142, 143);
Commit: 323bf4678b0a65db822ab898b80a60efa5aea98e
https://github.com/scummvm/scummvm/commit/323bf4678b0a65db822ab898b80a60efa5aea98e
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:23+01:00
Commit Message:
IGOR: Have parts 12, 17 and 34 allow saving during dialogue
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_12.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_34.cpp
engines/igor/text.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 19f0cb6f074..40346c7e887 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1092,6 +1092,7 @@ private:
void part17LeaveThroughPath(bool lateGame = false);
void part17SwapFolders();
void part17HandlePhilipDialogue();
+ void part17PhilipDialogueAndTail();
void part17UpdateJimmyDialogue(int action);
void part17UpdatePhilipDialogue(int action);
void part17UpdateBackground();
@@ -1473,6 +1474,7 @@ private:
void part34OldLadyIdleAnimationFrame(int step);
void part34LauraConversation();
void part34OldLadyConversation();
+ void part34ReloadParkAfterLaura();
void part34UpdateBackground();
void part35();
void part35ExecuteAction(int action);
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 59d6152aaea..266eaba10dc 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -108,7 +108,8 @@ void IgorEngine::part12TryEnterChurch() {
_walkDataCurrentIndex = 1;
moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
- waitForTimer(35);
+ if (!_dialogueResuming)
+ waitForTimer(35);
// dor opening
playRoomSound(13, 0);
_walkDataCurrentIndex = _walkDataLastIndex;
@@ -116,7 +117,8 @@ void IgorEngine::part12TryEnterChurch() {
decodeAnimFrame(src, _screenVGA);
decodeAnimFrame(src, _screenLayer1);
moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
- waitForTimer(35);
+ if (!_dialogueResuming)
+ waitForTimer(35);
_walkDataCurrentIndex = _walkDataLastIndex - 1;
src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA446) - 1;
decodeAnimFrame(src, _screenVGA);
@@ -124,7 +126,8 @@ void IgorEngine::part12TryEnterChurch() {
_walkData[_walkDataCurrentIndex].xPosChanged = 1;
_walkData[_walkDataCurrentIndex].yPosChanged = 1;
moveIgor(_walkData[_walkDataCurrentIndex].posNum, _walkData[_walkDataCurrentIndex].frameNum);
- waitForTimer(35);
+ if (!_dialogueResuming)
+ waitForTimer(35);
_walkData[0].setPos(127, 108, 4, 0);
_walkData[0].clipSkipX = 1;
_walkData[0].clipWidth = 30;
@@ -141,6 +144,8 @@ void IgorEngine::part12TryEnterChurch() {
decodeAnimFrame(src, _screenLayer1);
moveIgor(4, 0);
part12HandlePriestDialogue();
+ if (_gameStateLoaded || _eventQuitGame)
+ return;
for (int i = 4; i >= 1; --i) {
src = _animFramesBuffer + 0x395B + READ_LE_UINT16(_animFramesBuffer + 0xA43E + i * 2) - 1;
decodeAnimFrame(src, _screenVGA);
@@ -538,6 +543,8 @@ void IgorEngine::part12() {
setRoomWalkBounds(89, 0, 275, 143);
partMainSetExecuteAction(1, &IgorEngine::part12ExecuteAction);
_updateRoomBackground = &IgorEngine::part12UpdateBackground;
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
part12ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (_objectsState[kLizardTakenStateIndex] == 0) {
@@ -574,6 +581,10 @@ void IgorEngine::part12() {
}
part12DisablePathBehindChurch();
enterPartLoop();
+ if (takeResumeDialogue(1)) { // loaded while talking to the priest
+ part12TryEnterChurch();
+ finishResumedDialogue();
+ }
while (_currentPart >= 120 && _currentPart <= 122 && !_gameStateLoaded) {
runPartLoop();
}
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 60ca007ea95..8659bd61a18 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -101,7 +101,13 @@ void IgorEngine::part17TalkToPhilipAndJimmy() {
VAR_CURRENT_TALKING_ACTOR = 1;
cutsceneSayWithCallback(135, 33, 63, 63, 0, 215 + randomDialogue, 1, 641 + randomDialogue, &IgorEngine::part17UpdatePhilipDialogue);
+ part17PhilipDialogueAndTail();
+}
+
+void IgorEngine::part17PhilipDialogueAndTail() {
part17HandlePhilipDialogue();
+ if (_gameStateLoaded || _eventQuitGame)
+ return;
part17ApplyObjectState(255);
part17PhilipToJimmyAnimFrame(0);
@@ -497,6 +503,8 @@ void IgorEngine::part17() {
partMainSetExecuteAction(1, &IgorEngine::part17ExecuteAction);
_updateRoomBackground = &IgorEngine::part17UpdateBackground;
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
part17ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
@@ -533,6 +541,13 @@ void IgorEngine::part17() {
}
}
enterPartLoop();
+ if (takeResumeDialogue(1)) { // loaded while talking to philip
+ // the lines before the menu are not played again, only philip's pose is drawn
+ VAR_CURRENT_TALKING_ACTOR = 1;
+ part17PhilipToIgor(0);
+ part17PhilipDialogueAndTail();
+ finishResumedDialogue();
+ }
while (_currentPart >= 170 && _currentPart <= 171 && !_gameStateLoaded) {
runPartLoop();
}
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index 9938564686e..e650940b375 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -27,6 +27,10 @@ namespace Igor {
static const DialogueDataOffsets kNoDialogueData = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
// Conversation with the old lady
+// ids of the dialogues of this room stored in a savegame while a choice menu is open
+static const uint8 kOldLadyDialogueId = 1;
+static const uint8 kLauraDialogueId = 2;
+
static const DialogueDataOffsets kOldLadyDialogueData = {
-162, 3, // questions
433, 10, // replies
@@ -236,6 +240,8 @@ void IgorEngine::part34TakeResin() {
void IgorEngine::part34TalkToOldLady() {
part34OldLadyConversation();
+ if (_gameStateLoaded || _eventQuitGame)
+ return;
part34ApplyObjectState(255);
_parkLadyIdleStep = 4;
part34OldLadyIdleAnimationFrame(4);
@@ -292,7 +298,12 @@ void IgorEngine::part34GiveLizardToOldLady() {
_objectsState[kLizardGivenStateIndex] = 1;
part34LauraConversation();
+ if (_gameStateLoaded || _eventQuitGame)
+ return;
+ part34ReloadParkAfterLaura();
+}
+void IgorEngine::part34ReloadParkAfterLaura() {
loadActionData(DAT_ParkLeft);
loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park);
SET_PAL_240_48_1();
@@ -304,24 +315,33 @@ void IgorEngine::part34GiveLizardToOldLady() {
void IgorEngine::part34OldLadyConversation() {
_roomDataOffsets.dlg = kOldLadyDialogueData;
loadDialogueData(DLG_ParkLady);
+ const bool resuming = _dialogueResuming;
if (_objectsState[kOldLadyConversationSeenStateIndex] == 0) {
memset(_screenVGA + 46080, 0, 17920);
}
int textIndex = 250;
- part34QueueReplyText(1, 1, 584, textIndex);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(160, 58, 63, 63, 63);
- part34WaitForIgorDialogue();
+ if (!resuming) {
+ part34QueueReplyText(1, 1, 584, textIndex);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(160, 58, 63, 63, 63);
+ part34WaitForIgorDialogue();
+ }
if (_objectsState[kOldLadyConversationSeenStateIndex] == 0) {
- textIndex = 250;
- part34QueueReplyText(2, 1, 585, textIndex);
- part34QueueReplyText(3, 1, 586, textIndex);
- SET_DIALOGUE_TEXT(1, 2);
- startCutsceneDialogue(121, 68, 63, 23, 0);
- part34WaitForLadyDialogue();
+ if (!resuming) {
+ textIndex = 250;
+ part34QueueReplyText(2, 1, 585, textIndex);
+ part34QueueReplyText(3, 1, 586, textIndex);
+ SET_DIALOGUE_TEXT(1, 2);
+ startCutsceneDialogue(121, 68, 63, 23, 0);
+ part34WaitForLadyDialogue();
+ }
_updateDialogue = &IgorEngine::part34UpdateLadyDialogue;
- handleDialogue(121, 68, 63, 23, 0, false);
+ handleDialogue(121, 68, 63, 23, 0, false, kOldLadyDialogueId);
_updateDialogue = 0;
+ if (_gameStateLoaded || _eventQuitGame) {
+ _roomDataOffsets.dlg = kNoDialogueData;
+ return;
+ }
}
textIndex = 250;
part34QueueReplyText(4, 2, 587, textIndex);
@@ -350,37 +370,47 @@ void IgorEngine::part34LauraConversation() {
_roomDataOffsets.dlg = kLauraDialogueData;
loadDialogueData(DLG_ParkLaura);
+ // a loaded savegame continues at the choice menu
+ const bool resuming = _dialogueResuming;
memset(_screenVGA + 46080, 0, 17920);
+ int textIndex = 250;
+ // the frames of Laura walking in are also drawn when resuming
for (int frame = 1; frame <= 19; ++frame) {
part34DrawLauraFrame(frame);
- waitForTimer(30);
+ if (!resuming)
+ waitForTimer(30);
}
- int textIndex = 250;
- part34QueueReplyText(1, 1, 600, textIndex);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(185, 69, 63, 0, 38);
- part34WaitForLauraDialogue();
- for (int frame = 26; frame <= 29; ++frame) {
- part34DrawLauraFrame(frame);
- waitForTimer(5);
+ if (!resuming) {
+ part34QueueReplyText(1, 1, 600, textIndex);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(185, 69, 63, 0, 38);
+ part34WaitForLauraDialogue();
+ for (int frame = 26; frame <= 29; ++frame) {
+ part34DrawLauraFrame(frame);
+ waitForTimer(5);
+ }
+ textIndex = 250;
+ part34QueueReplyText(2, 1, 601, textIndex);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(162, 64, 63, 63, 63);
+ WalkData *wd = &_walkData[_walkDataLastIndex - 1];
+ wd->x = 162;
+ wd->y = 117;
+ wd->posNum = kFacingPositionRight;
+ part34WaitForIgorDialogue();
+ textIndex = 250;
+ part34QueueReplyText(3, 1, 602, textIndex);
+ SET_DIALOGUE_TEXT(1, 1);
+ startCutsceneDialogue(185, 69, 63, 0, 38);
+ part34WaitForLauraDialogue();
}
- textIndex = 250;
- part34QueueReplyText(2, 1, 601, textIndex);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(162, 64, 63, 63, 63);
- WalkData *wd = &_walkData[_walkDataLastIndex - 1];
- wd->x = 162;
- wd->y = 117;
- wd->posNum = kFacingPositionRight;
- part34WaitForIgorDialogue();
- textIndex = 250;
- part34QueueReplyText(3, 1, 602, textIndex);
- SET_DIALOGUE_TEXT(1, 1);
- startCutsceneDialogue(185, 69, 63, 0, 38);
- part34WaitForLauraDialogue();
_updateDialogue = &IgorEngine::part34UpdateLauraDialogue;
- handleDialogue(185, 69, 63, 0, 38, false);
+ handleDialogue(185, 69, 63, 0, 38, false, kLauraDialogueId);
_updateDialogue = 0;
+ if (_gameStateLoaded || _eventQuitGame) {
+ _roomDataOffsets.dlg = kNoDialogueData;
+ return;
+ }
part34DrawLauraFrame(29);
textIndex = 250;
part34QueueReplyText(4, 1, 603, textIndex);
@@ -492,6 +522,17 @@ void IgorEngine::part34() {
_walkDataCurrentIndex = 1;
}
enterPartLoop();
+ if (takeResumeDialogue(kOldLadyDialogueId)) { // loaded while talking to the old lady
+ part34OldLadyConversation();
+ if (!_gameStateLoaded && !_eventQuitGame)
+ part34ApplyObjectState(255);
+ finishResumedDialogue();
+ } else if (takeResumeDialogue(kLauraDialogueId)) { // loaded while talking to laura
+ part34LauraConversation();
+ if (!_gameStateLoaded && !_eventQuitGame)
+ part34ReloadParkAfterLaura();
+ finishResumedDialogue();
+ }
while (_currentPart == 340 && !_gameStateLoaded) {
runPartLoop();
}
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 2a55239fd17..520cbad752a 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -535,7 +535,7 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreU
_gameState.dialogueChoiceCount = 1;
}
_dialogueEnded = false;
- if (getPart() == 12 && _objectsState[kLizardTakenStateIndex] == 0) {
+ if (getPart() == 12 && _objectsState[kLizardTakenStateIndex] == 0 && !resuming) {
_gameState.dialogueData[6] = 1;
dialogueReplyToQuestion(x, y, r, g, b, 40);
}
Commit: 310840c73fc6a6046a72cfd2435cb3bcea162a5b
https://github.com/scummvm/scummvm/commit/310840c73fc6a6046a72cfd2435cb3bcea162a5b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:23+01:00
Commit Message:
IGOR: Fix handling of empty dialogue lines
Changed paths:
engines/igor/text.cpp
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 520cbad752a..d8f025b7445 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -353,9 +353,16 @@ void IgorEngine::startIgorDialogue() {
_gameState.dialogueTextRunning = false;
return;
}
- fixIgorDialogueTextPosition(dt->num, dt->count, &talkX, &talkY);
+ DialogueText text = *dt;
+ // Empty lines reduce the displayed prefix without changing the queued record.
+ for (int i = dt->count - 1; i >= 0; --i) {
+ if (_globalDialogueTexts[dt->num + i][0] == '\0') {
+ --text.count;
+ }
+ }
+ fixIgorDialogueTextPosition(text.num, text.count, &talkX, &talkY);
_dialogueDirtyRectY = talkY * 320;
- _dialogueDirtyRectSize = dt->count * 11 * 320;
+ _dialogueDirtyRectSize = (text.count * 10 + 1) * 320;
assert(_dialogueDirtyRectSize < 320 * 72);
memcpy(_screenTextLayer, _screenVGA + _dialogueDirtyRectY, _dialogueDirtyRectSize);
@@ -370,8 +377,8 @@ void IgorEngine::startIgorDialogue() {
} else {
memcpy(_screenTextLayer + 320 * 72, _screenVGA + _dialogueDirtyRectY, _dialogueDirtyRectSize);
}
- for (int i = 0; i < dt->count; ++i) {
- const char *textLine = _globalDialogueTexts[dt->num + i];
+ for (int i = 0; i < text.count; ++i) {
+ const char *textLine = _globalDialogueTexts[text.num + i];
int textLineWidth = _dialogueFont->getStringWidth(textLine);
int textX = talkX - textLineWidth / 2;
int textY = i * 10;
@@ -379,7 +386,7 @@ void IgorEngine::startIgorDialogue() {
}
setPaletteColor(_talkColorIndex, _dialogueColor[0], _dialogueColor[1], _dialogueColor[2]);
setPaletteColor(_talkShadowIndex, 0, 0, 0);
- const int talkMode = prepareDialoguePlayback(*dt);
+ const int talkMode = prepareDialoguePlayback(text);
if (talkMode != kTalkModeSpeechOnly)
memcpy(_screenVGA + _dialogueDirtyRectY, _screenTextLayer, _dialogueDirtyRectSize);
_gameState.dialogueTextRunning = true;
Commit: a051e5e063c48035a09c6e6a5f1686fb75b98b5c
https://github.com/scummvm/scummvm/commit/a051e5e063c48035a09c6e6a5f1686fb75b98b5c
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:24+01:00
Commit Message:
IGOR: Correct glitches in room 30 and 34 after loading within a dialogue
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/options.cpp
engines/igor/parts/part_30.cpp
engines/igor/parts/part_30_floppy.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_8.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 5104a1fce35..fbf3751a0c5 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -278,7 +278,8 @@ void IgorEngine::enterPartLoop() {
}
}
-bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
+// With [fade] false the caller draws what the room shows when the game resumes and then fades in the screen itself.
+bool IgorEngine::restoreRoomAfterLoad(bool drawIgor, bool fade) {
_loadedIgorMoving = false;
if (!_gameStateLoaded)
return false;
@@ -309,7 +310,8 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor) {
showCursor();
_resumeDialogueId = _gameState.dialogueStarted;
_gameStateLoaded = false;
- fadeIn(768);
+ if (fade)
+ fadeIn(768);
return true;
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 40346c7e887..4c2bc8e8398 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1475,6 +1475,8 @@ private:
void part34LauraConversation();
void part34OldLadyConversation();
void part34ReloadParkAfterLaura();
+ void part34LoadLauraScene(bool showPalette);
+ void part34DrawLauraWalkingIn(bool wait);
void part34UpdateBackground();
void part35();
void part35ExecuteAction(int action);
@@ -1791,7 +1793,7 @@ private:
void enterPartLoop();
void leavePartLoop();
void runPartLoop();
- bool restoreRoomAfterLoad(bool drawIgor = true);
+ bool restoreRoomAfterLoad(bool drawIgor = true, bool fade = true);
bool takeResumeDialogue(uint8 id);
void finishResumedDialogue();
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index cd8969a4a36..5f3a991e8f9 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -627,7 +627,8 @@ void IgorEngine::handleFloppyOptionsMenu() {
case Common::KEYCODE_RETURN:
case Common::KEYCODE_KP_ENTER:
if (selected == 1) {
- saveGameDialog();
+ if (saveGameDialog())
+ menuLoop = false;
} else if (selected == 2) {
if (loadGameDialog()) {
free(button);
@@ -760,7 +761,8 @@ void IgorEngine::handleOptionsMenu() {
break;
case Common::KEYCODE_RETURN:
if (currentPage == kPageSave && !(_game.flags & kFlagDemo)) {
- saveGameDialog();
+ if (saveGameDialog())
+ menuLoop = false;
} else if (currentPage == kPageLoad && !(_game.flags & kFlagDemo)) {
if (loadGameDialog()) {
_optionsMenuThumbnail.free();
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index 5d1e965bba2..ed624966bd7 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -195,18 +195,25 @@ void IgorEngine::part30WalkInFromRight() {
void IgorEngine::part30LauraCutscene() {
if (!isCDVersion())
playMusic(3, true);
+
+ const bool resuming = _dialogueResuming;
memset(_screenVGA + 46080, 0, 17920);
- fadeIn(768);
- part30LauraAndIgorBumpIntoEachOther();
+ if (!resuming) {
+ fadeIn(768);
+ part30LauraAndIgorBumpIntoEachOther();
+ }
_walkData[0].setPos(172, 134, 2, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
_updateDialogue = &IgorEngine::part30UpdateLauraDialogue;
- igorSayAndWait({ { 203, 1, 452 }, { 204, 1, 453 }, { 205, 1, 454 } });
- cutsceneSay(201, 85, 63, 0, 38, 206, 1, 455);
+ if (!resuming) {
+ igorSayAndWait({ { 203, 1, 452 }, { 204, 1, 453 }, { 205, 1, 454 } });
+ cutsceneSay(201, 85, 63, 0, 38, 206, 1, 455);
+ }
// igor crosses arms
- part30IgorCrossesArms();
+ if (!resuming) // when resuming it was drawn before the screen faded in
+ part30IgorCrossesArms();
// real dialogue
part30HandleLauraDialogue();
@@ -283,7 +290,15 @@ void IgorEngine::part30() {
partMainSetExecuteAction(1, &IgorEngine::part30ExecuteAction);
part30ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- if (!restoreRoomAfterLoad()) {
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
+ const bool loaded = restoreRoomAfterLoad(true, false);
+ if (loaded) {
+ // a game saved at laura's dialogue shows the scene of the dialogue from the first frame
+ if (_resumeDialogueId == 1)
+ part30IgorCrossesArms();
+ fadeIn(768);
+ } else {
_currentAction.verb = kVerbWalk;
if (_objectsState[kLauraMetAtCollegeStateIndex] == 0) {
part30LauraCutscene();
@@ -306,6 +321,10 @@ void IgorEngine::part30() {
}
}
enterPartLoop();
+ if (takeResumeDialogue(1)) { // loaded while talking to laura
+ part30LauraCutscene();
+ finishResumedDialogue();
+ }
while (_currentPart >= 300 && _currentPart <= 303 && !_gameStateLoaded) {
runPartLoop();
}
diff --git a/engines/igor/parts/part_30_floppy.cpp b/engines/igor/parts/part_30_floppy.cpp
index 41d8892fbcb..07b7ab014a3 100644
--- a/engines/igor/parts/part_30_floppy.cpp
+++ b/engines/igor/parts/part_30_floppy.cpp
@@ -242,18 +242,24 @@ void IgorEngine::part30FloppyLauraLeaves() {
void IgorEngine::part30FloppyLauraCutscene() {
// The cutscene does not select any music, the current music keeps playing
+ const bool resuming = _dialogueResuming;
memset(_screenVGA + 46080, 0, 17920);
- fadeIn(768);
- part30FloppyLauraAndIgorBumpIntoEachOther();
+ if (!resuming) {
+ fadeIn(768);
+ part30FloppyLauraAndIgorBumpIntoEachOther();
+ }
_walkData[0].setPos(190, 119, 2, 0);
_walkData[0].setDefaultScale();
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
- igorSayAndWait({ { 203, 1, 0 }, { 204, 1, 0 }, { 205, 1, 0 } });
- _updateDialogue = &IgorEngine::part30FloppyUpdateLauraDialogue;
- cutsceneSay(kLauraTalkX, kLauraTalkY, kLauraTalkR, kLauraTalkG, kLauraTalkB, 206, 1, 0);
- _updateDialogue = 0;
- part30FloppyIgorCrossesArms();
+ if (!resuming) {
+ igorSayAndWait({ { 203, 1, 0 }, { 204, 1, 0 }, { 205, 1, 0 } });
+ _updateDialogue = &IgorEngine::part30FloppyUpdateLauraDialogue;
+ cutsceneSay(kLauraTalkX, kLauraTalkY, kLauraTalkR, kLauraTalkG, kLauraTalkB, 206, 1, 0);
+ _updateDialogue = 0;
+ }
+ if (!resuming) // when resuming igor has to be drawn before the screen fades in
+ part30FloppyIgorCrossesArms();
part30FloppyHandleLauraDialogue();
if (_gameStateLoaded || _eventQuitGame || _currentPart == kInvalidPart)
return;
@@ -285,7 +291,15 @@ void IgorEngine::part30Floppy() {
partMainSetExecuteAction(1, &IgorEngine::part30FloppyExecuteAction);
part30FloppyApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- if (!restoreRoomAfterLoad()) {
+ SET_PAL_240_48_1();
+ SET_PAL_208_96_1();
+ const bool loaded = restoreRoomAfterLoad(true, false);
+ if (loaded) {
+ // a game saved at laura's dialogue shows the scene of the dialogue from the first frame
+ if (_resumeDialogueId == 1)
+ part30FloppyIgorCrossesArms();
+ fadeIn(768);
+ } else {
_currentAction.verb = kVerbWalk;
if (_objectsState[kLauraMetAtCollegeStateIndex] == 0) {
part30FloppyLauraCutscene();
@@ -303,6 +317,10 @@ void IgorEngine::part30Floppy() {
}
}
enterPartLoop();
+ if (takeResumeDialogue(1)) { // loaded while talking to laura
+ part30FloppyLauraCutscene();
+ finishResumedDialogue();
+ }
while (_currentPart >= 300 && _currentPart <= 303 && !_gameStateLoaded) {
runPartLoop();
}
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index e650940b375..00d0ce6ee83 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -361,12 +361,29 @@ void IgorEngine::part34OldLadyConversation() {
/**
* Laura walks into the park, talks with Igor and leaves.
*/
-void IgorEngine::part34LauraConversation() {
+void IgorEngine::part34LoadLauraScene(bool showPalette) {
static const int frames[] = { FRM_ParkLaura1, FRM_ParkLaura2, FRM_ParkLaura3, 0 };
loadAnimData(frames, kParkLauraFrames);
memcpy(_paletteBuffer + 176 * 3, _animFramesBuffer + kParkLauraPalette, 48);
- memcpy(_currentPalette + 176 * 3, _animFramesBuffer + kParkLauraPalette, 48);
- setPaletteRange(176, 191);
+ if (showPalette) {
+ memcpy(_currentPalette + 176 * 3, _animFramesBuffer + kParkLauraPalette, 48);
+ setPaletteRange(176, 191);
+ }
+}
+
+// The frames of laura walking in are drawn again without waits when a savegame at her dialogue is loaded.
+void IgorEngine::part34DrawLauraWalkingIn(bool wait) {
+ for (int frame = 1; frame <= 19; ++frame) {
+ part34DrawLauraFrame(frame);
+ if (wait)
+ waitForTimer(30);
+ }
+}
+
+void IgorEngine::part34LauraConversation() {
+ // when resuming the scene was already loaded and drawn before the screen faded in
+ if (!_dialogueResuming)
+ part34LoadLauraScene(true);
_roomDataOffsets.dlg = kLauraDialogueData;
loadDialogueData(DLG_ParkLaura);
@@ -374,13 +391,8 @@ void IgorEngine::part34LauraConversation() {
const bool resuming = _dialogueResuming;
memset(_screenVGA + 46080, 0, 17920);
int textIndex = 250;
- // the frames of Laura walking in are also drawn when resuming
- for (int frame = 1; frame <= 19; ++frame) {
- part34DrawLauraFrame(frame);
- if (!resuming)
- waitForTimer(30);
- }
if (!resuming) {
+ part34DrawLauraWalkingIn(true);
part34QueueReplyText(1, 1, 600, textIndex);
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(185, 69, 63, 0, 38);
@@ -517,7 +529,14 @@ void IgorEngine::part34() {
setRoomWalkBounds(0, 0, 319, 143);
part34ApplyObjectState(255);
- if (!restoreRoomAfterLoad()) {
+ if (restoreRoomAfterLoad(true, false)) {
+ // a game saved at laura's menu shows her scene from the first frame
+ if (_resumeDialogueId == kLauraDialogueId) {
+ part34LoadLauraScene(false);
+ part34DrawLauraWalkingIn(false);
+ }
+ fadeIn(768);
+ } else {
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
}
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 46ce8a39063..93d9295688e 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -360,25 +360,29 @@ void IgorEngine::part68Conversation() {
_updateRoomBackground = &IgorEngine::part68UpdateBackgroundTalk;
_updateDialogue = &IgorEngine::part68SayBorisReplies;
loadDialogueData(DLG_Part68);
+ const bool resuming = _dialogueResuming;
+ _dialogueResuming = false;
_part68QuestionCounter = 1;
part68DrawUndertaker(kPart68BorisStanding);
memset(_screenVGA + 46080, 0, 17920);
- _gameState.dialogueStarted = true;
- _gameState.dialogueChoiceStart = 1;
- _gameState.dialogueChoiceCount = 1;
- // boris says different greeting depending if its the first time or not
- if (_objectsState[kBorisIntroducedStateIndex] == 0) {
- igorSayAndWait(225, 1, 1029);
- static const int replies[4] = { 1, 2, 3, 4 };
- static const int sounds[4] = { 1051, 1052, 1053, 1054 };
- part68SayBorisReplies(replies, sounds, 4);
- _objectsState[kBorisIntroducedStateIndex] = 1;
- } else {
- igorSayAndWait(226, 1, 1030);
- static const int replies[4] = { 5, 6, 7, 8 };
- static const int sounds[4] = { 1055, 1056, 1057, 1058 };
- part68SayBorisReplies(replies, sounds, 4);
+ _gameState.dialogueStarted = 1;
+ if (!resuming) {
+ _gameState.dialogueChoiceStart = 1;
+ _gameState.dialogueChoiceCount = 1;
+ // boris says different greeting depending if its the first time or not
+ if (_objectsState[kBorisIntroducedStateIndex] == 0) {
+ igorSayAndWait(225, 1, 1029);
+ static const int replies[4] = { 1, 2, 3, 4 };
+ static const int sounds[4] = { 1051, 1052, 1053, 1054 };
+ part68SayBorisReplies(replies, sounds, 4);
+ _objectsState[kBorisIntroducedStateIndex] = 1;
+ } else {
+ igorSayAndWait(226, 1, 1030);
+ static const int replies[4] = { 5, 6, 7, 8 };
+ static const int sounds[4] = { 1055, 1056, 1057, 1058 };
+ part68SayBorisReplies(replies, sounds, 4);
+ }
}
bool done = false;
@@ -433,13 +437,15 @@ void IgorEngine::part68Conversation() {
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
- _gameState.dialogueStarted = false;
+ _gameState.dialogueStarted = 0;
_updateDialogue = 0;
_updateRoomBackground = previousBackground;
}
void IgorEngine::part68TalkToBoris() {
part68Conversation();
+ if (_gameStateLoaded || _eventQuitGame)
+ return;
if (_objectsState[kUndertakerLeftStateIndex] == 2) {
_objectsState[kUndertakerLeftStateIndex] = 1;
part68ApplyObjectState(255);
@@ -501,6 +507,7 @@ void IgorEngine::part68() {
setRoomClickFix(143, -1, -1, false);
partMainSetExecuteAction(1, &IgorEngine::part68ExecuteAction);
_updateRoomBackground = &IgorEngine::part68UpdateBackground;
+ SET_PAL_208_96_1();
part68ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
@@ -521,6 +528,10 @@ void IgorEngine::part68() {
}
}
enterPartLoop();
+ if (takeResumeDialogue(1)) { // loaded while talking to boris
+ part68TalkToBoris();
+ finishResumedDialogue();
+ }
while ((_currentPart == 680 || _currentPart == 681) && !_gameStateLoaded) {
runPartLoop();
}
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index 3f2a242d97f..efce41d9d61 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -246,7 +246,11 @@ void IgorEngine::part8HandleIntercomDialogue() {
_roomDataOffsets.dlg = { -174, 2, 257, 0, 30, 0, 459, 459, 0 };
loadDialogueData(DLG_Part8Intercom);
_updateDialogue = 0;
+ // this menu is part of the scene that leads to the secretary: it cannot be saved
+ const bool savingWasAllowed = _canSaveGame;
+ _canSaveGame = false;
handleDialogue(0, 0, 0, 0, 0, false, 2);
+ _canSaveGame = savingWasAllowed;
_roomDataOffsets = savedOffsets;
}
Commit: f8a0a9fc3a54799fef465070f1e8a7c211b0607d
https://github.com/scummvm/scummvm/commit/f8a0a9fc3a54799fef465070f1e8a7c211b0607d
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:24+01:00
Commit Message:
IGOR: Implement copy protection UI in Spanish floppy
Changed paths:
A engines/igor/copy_protection.cpp
A engines/igor/floppy_menu.h
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/module.mk
engines/igor/options.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_90.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/copy_protection.cpp b/engines/igor/copy_protection.cpp
new file mode 100644
index 00000000000..b9a2dd3fcd3
--- /dev/null
+++ b/engines/igor/copy_protection.cpp
@@ -0,0 +1,246 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "common/events.h"
+#include "igor/igor.h"
+#include "igor/floppy_menu.h"
+
+namespace Igor {
+
+// Copy protection screen of the floppy version
+static const int kFloppyProtectionWordCount = 100;
+static const int kFloppyProtectionEntrySize = 14;
+static const int kFloppyProtectionInputX = 122;
+static const int kFloppyProtectionInputY = 75;
+static const int kFloppyProtectionInputFullX = 197;
+static const int kFloppyProtectionTitleX = 136;
+static const int kFloppyProtectionPromptX = 93;
+static const int kFloppyProtectionPromptY = 42;
+static const int kFloppyProtectionQuestionX = 81;
+static const int kFloppyProtectionQuestionY = 52;
+static const int kFloppyProtectionBlinkTick = 61;
+static const int kFloppyProtectionBlinkPeriod = 64;
+static const int kFloppyProtectionBoxX = 120;
+static const int kFloppyProtectionBoxY = 56;
+static const int kFloppyProtectionBoxWidth = 80;
+static const int kFloppyProtectionBoxHeight = 11;
+static const int kFloppyProtectionCaretRow = 8;
+static const int kFloppyProtectionCaretWidth = 7;
+static const int kFloppyProtectionGlyphRows = 9;
+static const int kFloppyProtectionMaxInput = 32;
+
+enum {
+ kFloppyColorInputFill = 0xFB
+};
+
+enum FloppyProtectionText {
+ kFloppyProtectionTitle = 0,
+ kFloppyProtectionPage,
+ kFloppyProtectionLine,
+ kFloppyProtectionWord,
+ kFloppyProtectionPrompt,
+ kFloppyProtectionTextCount
+};
+
+// Pascal strings stored one after the other in a resource.
+static void readProtectionStrings(Common::Array<Common::String> &texts, const uint8 *data, int size, int count) {
+ int offset = 0;
+ for (int i = 0; i < count; ++i) {
+ if (offset >= size || data[offset] > size - offset - 1)
+ error("Invalid copy protection text resource");
+ const int length = data[offset++];
+ texts.push_back(Common::String((const char *)data + offset, length));
+ offset += length;
+ }
+ if (offset != size)
+ error("Unexpected data in copy protection text resource");
+}
+
+static int protectionInputChar(const Common::KeyState &kbd) {
+ const uint32 chr = kbd.ascii;
+ if (chr >= 0x20 && chr < 0x7F)
+ return chr;
+ switch (chr) {
+ case 0xE9: return 0x82; // e acute
+ case 0xE1: return 0xA0; // a acute
+ case 0xED: return 0xA1; // i acute
+ case 0xF3: return 0xA2; // o acute
+ case 0xFA: return 0xA3; // u acute
+ case 0xF1: return 0xA4; // n tilde
+ case 0xD1: return 0xA5; // N tilde
+ case 0xBF: return 0xA8; // inverted question mark
+ case 0xA1: return 0xAD; // inverted exclamation mark
+ default: return 0;
+ }
+}
+// only ASCII + characters handled in protectionInputChar()
+static bool protectionCharAllowed(int chr) {
+ static const uint8 allowed[32] = {
+ 0, 0, 0, 0, 0x07, 0xF3, 0xFF, 0xDF, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07,
+ 0x04, 0, 0, 0, 0x3F, 0x21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ return (allowed[chr >> 3] & (1 << (chr & 7))) != 0;
+}
+
+void IgorEngine::floppyMenuFillRow(int x, int y, int count, int color) {
+ memset(_screenTextLayer + (y - kFloppyMenuY) * 320 + x, color, count);
+}
+
+bool IgorEngine::isGameEnding() const {
+ return _eventQuitGame || _currentPart == kInvalidPart;
+}
+
+// Returns false if the game has to end.
+bool IgorEngine::copyProtection() {
+ int size;
+ Common::Array<Common::String> texts;
+ uint8 *data = loadData(TXT_FloppyProtectionScreen, 0, &size);
+ readProtectionStrings(texts, data, size, 5);
+ free(data);
+ assert(texts.size() == kFloppyProtectionTextCount);
+ uint8 *words = loadData(DAT_FloppyProtectionWords, 0, &size);
+ assert(size == kFloppyProtectionWordCount * kFloppyProtectionEntrySize);
+ uint8 *button = loadData(IMG_OptionsButton);
+
+ PauseToken pauseToken = pauseEngine();
+ hideCursor();
+ floppyMenuFadeOut();
+ memcpy(_screenTextLayer, _screenVGA + kFloppyMenuY * 320, kFloppyMenuSize);
+
+ const uint32 startMillis = _system->getMillis();
+
+ const uint8 *entry = words + getRandomNumber(kFloppyProtectionWordCount - 1) * kFloppyProtectionEntrySize;
+ const int numbers[3] = { entry[11], entry[12], entry[13] };
+
+ floppyOptionsDrawPanel(button);
+ floppyOptionsClearCaptionBar(button);
+ _sentenceFont->drawString(_screenTextLayer, texts[kFloppyProtectionTitle].c_str(), kFloppyProtectionTitleX, kFloppyCaptionY - kFloppyMenuY, kFloppyColorCaption, -1, -1);
+ //format the requested protection question
+ Common::String question = texts[kFloppyProtectionPage] + Common::String::format("%d", numbers[0]) +
+ texts[kFloppyProtectionLine] + Common::String::format("%d", numbers[1]) +
+ texts[kFloppyProtectionWord] + Common::String::format("%d", numbers[2]);
+ int questionX = kFloppyProtectionQuestionX;
+ for (int i = 0; i < 3; ++i) {
+ if (numbers[i] > 9)
+ questionX -= 2;
+ }
+ _sentenceFont->drawString(_screenTextLayer, texts[kFloppyProtectionPrompt].c_str(), kFloppyProtectionPromptX, kFloppyProtectionPromptY - kFloppyMenuY, kFloppyColorCaption, -1, -1);
+ _sentenceFont->drawString(_screenTextLayer, question.c_str(), questionX, kFloppyProtectionQuestionY - kFloppyMenuY, kFloppyColorCaption, -1, -1);
+
+
+ const int boxY = kFloppyMenuY + kFloppyProtectionBoxY;
+ floppyMenuFillRow(kFloppyProtectionBoxX, boxY, kFloppyProtectionBoxWidth, kFloppyColorFrameLight);
+ for (int i = 1; i < kFloppyProtectionBoxHeight - 1; ++i) {
+ _screenTextLayer[(kFloppyProtectionBoxY + i) * 320 + kFloppyProtectionBoxX] = kFloppyColorFrameLight;
+ _screenTextLayer[(kFloppyProtectionBoxY + i) * 320 + kFloppyProtectionBoxX + kFloppyProtectionBoxWidth - 1] = kFloppyColorFrameDark;
+ }
+ floppyMenuFillRow(kFloppyProtectionBoxX, boxY + kFloppyProtectionBoxHeight - 1, kFloppyProtectionBoxWidth, kFloppyColorFrameDark);
+ floppyOptionsPresent(0);
+
+ uint8 typed[kFloppyProtectionMaxInput + 1];
+ memset(typed, ' ', sizeof(typed));
+ int position = 1;
+ int x = kFloppyProtectionInputX;
+ bool full = false;
+ bool done = false;
+ int caretColor = kFloppyColorCaption;
+ int blinkCounter = 0;
+ uint32 lastTick = ticksSince(startMillis);
+ while (!done && !isGameEnding()) {
+ Common::Event ev;
+ bool changed = false;
+ while (!done && _eventMan->pollEvent(ev)) {
+ if (ev.type == Common::EVENT_QUIT) {
+ _currentPart = kInvalidPart;
+ _eventQuitGame = true;
+ break;
+ }
+ if (ev.type != Common::EVENT_KEYDOWN)
+ continue;
+ const int chr = protectionInputChar(ev.kbd);
+ if (chr && protectionCharAllowed(chr)) {
+ if (!full && position <= kFloppyProtectionMaxInput) {
+ typed[position++] = chr;
+ floppyMenuFillRow(x, kFloppyProtectionInputY + kFloppyProtectionCaretRow, kFloppyProtectionCaretWidth, kFloppyColorInputFill);
+ const char str[2] = { (char)chr, 0 };
+ _sentenceFont->drawString(_screenTextLayer, str, x, kFloppyProtectionInputY - kFloppyMenuY, kFloppyColorCaption, -1, -1);
+ x += _sentenceFont->getCharWidth(chr);
+ full = (x + 6 > kFloppyProtectionInputFullX);
+ changed = true;
+ }
+ } else if (ev.kbd.keycode == Common::KEYCODE_BACKSPACE) {
+ if (position > 1) {
+ --position;
+ if (!full)
+ floppyMenuFillRow(x, kFloppyProtectionInputY + kFloppyProtectionCaretRow, kFloppyProtectionCaretWidth, kFloppyColorInputFill);
+ x -= _sentenceFont->getCharWidth(typed[position]);
+ full = (x + 6 > kFloppyProtectionInputFullX);
+ typed[position] = ' ';
+ for (int row = 1; row <= kFloppyProtectionGlyphRows; ++row)
+ floppyMenuFillRow(x, kFloppyProtectionInputY + row, kFloppyProtectionCaretWidth, kFloppyColorInputFill);
+ changed = true;
+ }
+ } else if (ev.kbd.keycode == Common::KEYCODE_RETURN || ev.kbd.keycode == Common::KEYCODE_KP_ENTER) {
+ if (!full)
+ floppyMenuFillRow(x, kFloppyProtectionInputY + kFloppyProtectionCaretRow, kFloppyProtectionCaretWidth, kFloppyColorInputFill);
+ done = true;
+ changed = true;
+ }
+ }
+ if (blinkCounter == kFloppyProtectionBlinkTick && !full && !done) {
+ floppyMenuFillRow(x, kFloppyProtectionInputY + kFloppyProtectionCaretRow, kFloppyProtectionCaretWidth, caretColor);
+ caretColor = (caretColor == kFloppyColorCaption) ? kFloppyColorInputFill : kFloppyColorCaption;
+ changed = true;
+ }
+ if (changed)
+ floppyOptionsPresent(0);
+
+ while (!done && !_eventQuitGame && ticksSince(startMillis) == lastTick)
+ _system->delayMillis(1);
+ lastTick = ticksSince(startMillis);
+ blinkCounter = (blinkCounter == kFloppyProtectionBlinkPeriod - 1) ? 0 : blinkCounter + 1;
+ }
+
+ free(button);
+ free(words);
+ _inputVars[kInputClick] = 0;
+ _inputVars[kInputRightClick] = 0;
+ _inputVars[kInputSkipDialogue] = 0;
+ _inputVars[kInputOptions] = 0;
+ _inputVars[kInputPause] = 0;
+ showCursor();
+ if (isGameEnding())
+ return false;
+ setPaletteColor(255, 63, 63, 63);
+ fadeIn(kFloppyFadeCount);
+ return true;
+}
+
+bool IgorEngine::checkCopyProtection() {
+ if (_game.version != kIdSpaFloppy || _floppyProtectionPassed)
+ return true;
+ if (!copyProtection())
+ return false;
+ _floppyProtectionPassed = true;
+ return true;
+}
+
+} // End of namespace Igor
diff --git a/engines/igor/floppy_menu.h b/engines/igor/floppy_menu.h
new file mode 100644
index 00000000000..f8da70cc04a
--- /dev/null
+++ b/engines/igor/floppy_menu.h
@@ -0,0 +1,56 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_FLOPPY_MENU_H
+#define IGOR_FLOPPY_MENU_H
+
+namespace Igor {
+
+// Geometry and colors of the panel shared by the floppy options menu and the copy protection.
+static const int kFloppyMenuX = 53;
+static const int kFloppyMenuY = 19;
+static const int kFloppyMenuWidth = 214;
+static const int kFloppyMenuHeight = 106;
+static const int kFloppyMenuSize = 320 * kFloppyMenuHeight;
+static const int kFloppyButtonX = 55;
+static const int kFloppyButtonY = 21;
+static const int kFloppyButtonWidth = 42;
+static const int kFloppyButtonHeight = 13;
+static const int kFloppyControlPanelFirstRow = 36;
+static const int kFloppyControlPanelRows = 85;
+static const int kFloppyCaptionY = 22;
+static const int kFloppyCaptionLastRow = 34;
+static const int kFloppyLastFadedColor = 248;
+static const int kFloppyFadeSteps = 30;
+static const int kFloppyFadeCount = 3 * (kFloppyLastFadedColor + 1);
+
+enum {
+ kFloppyColorCaption = 0xF9,
+ kFloppyColorText = 0xFF,
+ kFloppyColorFrameLight = 0xFA,
+ kFloppyColorFrameDark = 0xFC,
+ kFloppyColorButtonLight = 0xFE,
+ kFloppyColorButtonDark = 0xFD
+};
+
+} // End of namespace Igor
+
+#endif
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index fbf3751a0c5..fc0aa3232b2 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -57,6 +57,7 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
_verbsPanelBuffer = (uint8 *)malloc(3840);
_verbsPanelSize = 0; // set when the panel is loaded
+ _floppyProtectionPassed = false;
_game.ovlFileName = gameDesc->ovlFileName;
_game.sfxFileName = gameDesc->sfxFileName;
_game.version = gameDesc->gameVersion;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 4c2bc8e8398..9d74cafbb7b 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -635,6 +635,7 @@ private:
Audio::SoundHandle _sfxHandle;
Audio::SoundHandle _speechHandle;
int _optionsControlRow;
+ bool _floppyProtectionPassed;
uint8 *_screenVGA;
uint8 *_facingIgorFrames[4];
@@ -1773,13 +1774,19 @@ private:
void loadFloppyOptionsMenuTexts();
void floppyOptionsDrawText(int text, int x, int y, int color);
void floppyOptionsFillRow(const uint8 *button, int buttonRow, int y);
+ void floppyOptionsDrawPanel(const uint8 *button);
void floppyOptionsDrawMainPage(const uint8 *button);
void floppyOptionsClearCaptionBar(const uint8 *button);
void floppyOptionsPaintControl(const uint8 *button, int row);
void floppyOptionsPresent(int selectedButton);
void floppyOptionsQuitPage(const uint8 *button);
void floppyOptionsControlPage(const uint8 *button);
+ void floppyMenuFadeOut();
void handleFloppyOptionsMenu();
+ void floppyMenuFillRow(int x, int y, int count, int color);
+ bool isGameEnding() const;
+ bool copyProtection();
+ bool checkCopyProtection();
void scrollInventory();
void drawInventory(int start, int mode);
void pageFloppyInventory(bool forward);
@@ -1852,6 +1859,7 @@ private:
bool compareGameTick(int eq) const { return _gameTicks == (eq & ~7); }
void waitForTimer(int ticks = -1, bool presentScreen = true, uint32 deadline = 0);
+ uint32 ticksSince(uint32 startMillis) const;
ResourceEntry *findData(int num);
void unpackExecutable();
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 32cc71214db..ac1cdddd330 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -27,6 +27,11 @@
namespace Igor {
+// Timer ticks elapsed since [startMillis], at the rate of the original timer (scaled by fast mode).
+uint32 IgorEngine::ticksSince(uint32 startMillis) const {
+ return (uint32)((uint64)(_system->getMillis() - startMillis) * kTickDelay * _fastMode / 1000);
+}
+
void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
if (presentScreen && !_eventQuitGame) {
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 99d22069e18..9b9e36da624 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -20,6 +20,7 @@ MODULE_OBJS = \
static_palette.o \
static_text.o \
options.o \
+ copy_protection.o \
parts/part_0.o \
parts/part_1.o \
parts/part_2.o \
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 5f3a991e8f9..f4aa9d5eecb 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -24,6 +24,7 @@
#include "graphics/scaler.h"
#include "igor/igor.h"
+#include "igor/floppy_menu.h"
namespace Igor {
@@ -340,32 +341,6 @@ bool IgorEngine::handleOptionsMenu_handleKeyDownCtrl(int key) {
return false;
}
-static const int kFloppyMenuX = 53;
-static const int kFloppyMenuY = 19;
-static const int kFloppyMenuWidth = 214;
-static const int kFloppyMenuHeight = 106;
-static const int kFloppyMenuSize = 320 * kFloppyMenuHeight;
-static const int kFloppyButtonX = 55;
-static const int kFloppyButtonY = 21;
-static const int kFloppyButtonWidth = 42;
-static const int kFloppyButtonHeight = 13;
-static const int kFloppyControlPanelFirstRow = 36;
-static const int kFloppyControlPanelRows = 85;
-static const int kFloppyCaptionY = 22;
-static const int kFloppyCaptionLastRow = 34;
-static const int kFloppyLastFadedColor = 248;
-static const int kFloppyFadeSteps = 30;
-static const int kFloppyFadeCount = 3 * (kFloppyLastFadedColor + 1);
-
-enum {
- kFloppyColorCaption = 0xF9,
- kFloppyColorText = 0xFF,
- kFloppyColorFrameLight = 0xFA,
- kFloppyColorFrameDark = 0xFC,
- kFloppyColorButtonLight = 0xFE,
- kFloppyColorButtonDark = 0xFD
-};
-
enum FloppyOptionsText {
kFloppySave = 0,
kFloppyLoad,
@@ -442,7 +417,7 @@ void IgorEngine::floppyOptionsFillRow(const uint8 *button, int buttonRow, int y)
button + (buttonRow - 1) * kFloppyMenuWidth, kFloppyMenuWidth);
}
-void IgorEngine::floppyOptionsDrawMainPage(const uint8 *button) {
+void IgorEngine::floppyOptionsDrawPanel(const uint8 *button) {
int y = 0;
for (uint i = 0; i < ARRAYSIZE(kFloppyPanelRows); ++i) {
for (int j = 0; j < kFloppyPanelRows[i].count; ++j) {
@@ -450,6 +425,10 @@ void IgorEngine::floppyOptionsDrawMainPage(const uint8 *button) {
++y;
}
}
+}
+
+void IgorEngine::floppyOptionsDrawMainPage(const uint8 *button) {
+ floppyOptionsDrawPanel(button);
for (int i = 0; i < 5; ++i) {
floppyOptionsDrawText(kFloppySave + i, kFloppyCaptionX[i], kFloppyCaptionY, kFloppyColorCaption);
}
@@ -586,8 +565,8 @@ void IgorEngine::floppyOptionsQuitPage(const uint8 *button) {
floppyOptionsDrawMainPage(button);
}
-void IgorEngine::handleFloppyOptionsMenu() {
- // The menu starts from the full palette and dims colors 1..248 in steps of three levels.
+// The menus start from the full palette and dim colors 1..248 in steps of three levels.
+void IgorEngine::floppyMenuFadeOut() {
memcpy(_currentPalette, _paletteBuffer, 768);
for (int m = 3; m <= kFloppyFadeSteps; m += 3) {
for (int i = 3; i < kFloppyFadeCount; ++i) {
@@ -600,6 +579,10 @@ void IgorEngine::handleFloppyOptionsMenu() {
_system->delayMillis(1000 / 60);
}
setPaletteColor(255, 35, 35, 23);
+}
+
+void IgorEngine::handleFloppyOptionsMenu() {
+ floppyMenuFadeOut();
memcpy(_screenTextLayer, _screenVGA + kFloppyMenuY * 320, kFloppyMenuSize);
uint8 *button = loadData(IMG_OptionsButton);
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index 9871f340933..faa504ef062 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -319,6 +319,8 @@ void IgorEngine::part6() {
memcpy(_paletteBuffer, _currentPalette, 624);
// Part 61 is arriving from intro so it doesnt need to copy the screen buffer
fadeIn(768);
+ if (!checkCopyProtection())
+ return;
}
loadActionData(DAT_SpringBridge);
_roomDataOffsets = PART_06_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp
index 601e18e84cf..9ba795a87ac 100644
--- a/engines/igor/parts/part_90.cpp
+++ b/engines/igor/parts/part_90.cpp
@@ -83,15 +83,17 @@ bool IgorEngine::part90Hold(uint16 duration, int skipMode, bool optionsMenu) {
uint8 observedTimer = 0;
for (uint16 elapsed = 0; elapsed < duration; ++elapsed) {
if (optionsMenu && _inputVars[kInputOptions]) {
+ // The title screen asks for the protection before opening the menu for the first time.
+ if (_currentPart == 900 && !checkCopyProtection())
+ break;
handleOptionsMenu();
_inputVars[kInputOptions] = 0;
waitForTimer(0);
}
while (!_gameStateLoaded && !_eventQuitGame && _currentPart != kInvalidPart && !skipRequested()) {
waitForTimer(0, false);
- const uint32 timerMillis = _system->getMillis() - timerStart;
const uint64 timerRate = (uint64)kTickDelay * _fastMode;
- const uint64 timerTicks = (uint64)timerMillis * timerRate / 1000;
+ const uint64 timerTicks = ticksSince(timerStart);
const uint8 timerByte = (uint8)timerTicks;
if (timerByte != observedTimer) {
observedTimer = timerByte;
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index 0e7321e1196..bc3c226a196 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -910,6 +910,8 @@
#define PAL_CollegeCorridorMathClass 1279
#define MSK_CollegeCorridorMathClass 1280
#define BOX_CollegeCorridorMathClass 1281
+#define DAT_FloppyProtectionWords 1282
+#define TXT_FloppyProtectionScreen 1283
#define FRM_CollegeCorridorLadiesRoomFloppy1 1257
#define FRM_CollegeCorridorLadiesRoomFloppy2 1258
Commit: a0045bd1303f42c0991b17a304005b1ec27fea72
https://github.com/scummvm/scummvm/commit/a0045bd1303f42c0991b17a304005b1ec27fea72
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:25+01:00
Commit Message:
IGOR: Implements copy protection logic, gates behind config
Changed paths:
engines/igor/copy_protection.cpp
engines/igor/detection.h
engines/igor/detection_tables.h
engines/igor/igor.h
engines/igor/metaengine.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/copy_protection.cpp b/engines/igor/copy_protection.cpp
index b9a2dd3fcd3..7873e03ba25 100644
--- a/engines/igor/copy_protection.cpp
+++ b/engines/igor/copy_protection.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "common/config-manager.h"
#include "common/events.h"
#include "igor/igor.h"
#include "igor/floppy_menu.h"
@@ -26,8 +27,11 @@
namespace Igor {
// Copy protection screen of the floppy version
+static const int kFloppyProtectionTries = 3;
static const int kFloppyProtectionWordCount = 100;
static const int kFloppyProtectionEntrySize = 14;
+static const int kFloppyProtectionWordLength = 10;
+static const int kFloppyProtectionCodeOffset = 0x45;
static const int kFloppyProtectionInputX = 122;
static const int kFloppyProtectionInputY = 75;
static const int kFloppyProtectionInputFullX = 197;
@@ -36,6 +40,9 @@ static const int kFloppyProtectionPromptX = 93;
static const int kFloppyProtectionPromptY = 42;
static const int kFloppyProtectionQuestionX = 81;
static const int kFloppyProtectionQuestionY = 52;
+static const int kFloppyProtectionReplyX = 100;
+static const int kFloppyProtectionReplyY = 86;
+static const int kFloppyProtectionReplyTicks = 2 * 200;
static const int kFloppyProtectionBlinkTick = 61;
static const int kFloppyProtectionBlinkPeriod = 64;
static const int kFloppyProtectionBoxX = 120;
@@ -57,6 +64,8 @@ enum FloppyProtectionText {
kFloppyProtectionLine,
kFloppyProtectionWord,
kFloppyProtectionPrompt,
+ kFloppyProtectionMaster,
+ kFloppyProtectionWrong,
kFloppyProtectionTextCount
};
@@ -108,32 +117,13 @@ bool IgorEngine::isGameEnding() const {
return _eventQuitGame || _currentPart == kInvalidPart;
}
-// Returns false if the game has to end.
-bool IgorEngine::copyProtection() {
- int size;
- Common::Array<Common::String> texts;
- uint8 *data = loadData(TXT_FloppyProtectionScreen, 0, &size);
- readProtectionStrings(texts, data, size, 5);
- free(data);
- assert(texts.size() == kFloppyProtectionTextCount);
- uint8 *words = loadData(DAT_FloppyProtectionWords, 0, &size);
- assert(size == kFloppyProtectionWordCount * kFloppyProtectionEntrySize);
- uint8 *button = loadData(IMG_OptionsButton);
- PauseToken pauseToken = pauseEngine();
- hideCursor();
- floppyMenuFadeOut();
- memcpy(_screenTextLayer, _screenVGA + kFloppyMenuY * 320, kFloppyMenuSize);
-
- const uint32 startMillis = _system->getMillis();
-
- const uint8 *entry = words + getRandomNumber(kFloppyProtectionWordCount - 1) * kFloppyProtectionEntrySize;
+// Draws the panel with the question for [entry] and the empty input box.
+void IgorEngine::drawProtectionScreen(const Common::Array<Common::String> &texts, const uint8 *button, const uint8 *entry) {
const int numbers[3] = { entry[11], entry[12], entry[13] };
-
floppyOptionsDrawPanel(button);
floppyOptionsClearCaptionBar(button);
_sentenceFont->drawString(_screenTextLayer, texts[kFloppyProtectionTitle].c_str(), kFloppyProtectionTitleX, kFloppyCaptionY - kFloppyMenuY, kFloppyColorCaption, -1, -1);
- //format the requested protection question
Common::String question = texts[kFloppyProtectionPage] + Common::String::format("%d", numbers[0]) +
texts[kFloppyProtectionLine] + Common::String::format("%d", numbers[1]) +
texts[kFloppyProtectionWord] + Common::String::format("%d", numbers[2]);
@@ -145,7 +135,7 @@ bool IgorEngine::copyProtection() {
_sentenceFont->drawString(_screenTextLayer, texts[kFloppyProtectionPrompt].c_str(), kFloppyProtectionPromptX, kFloppyProtectionPromptY - kFloppyMenuY, kFloppyColorCaption, -1, -1);
_sentenceFont->drawString(_screenTextLayer, question.c_str(), questionX, kFloppyProtectionQuestionY - kFloppyMenuY, kFloppyColorCaption, -1, -1);
-
+ // Frame of the input box: light top and left edges, dark bottom and right edges.
const int boxY = kFloppyMenuY + kFloppyProtectionBoxY;
floppyMenuFillRow(kFloppyProtectionBoxX, boxY, kFloppyProtectionBoxWidth, kFloppyColorFrameLight);
for (int i = 1; i < kFloppyProtectionBoxHeight - 1; ++i) {
@@ -154,16 +144,18 @@ bool IgorEngine::copyProtection() {
}
floppyMenuFillRow(kFloppyProtectionBoxX, boxY + kFloppyProtectionBoxHeight - 1, kFloppyProtectionBoxWidth, kFloppyColorFrameDark);
floppyOptionsPresent(0);
+}
- uint8 typed[kFloppyProtectionMaxInput + 1];
- memset(typed, ' ', sizeof(typed));
+bool IgorEngine::readProtectionWord(uint8 *typed) {
+ memset(typed, ' ', kFloppyProtectionMaxInput + 1);
int position = 1;
int x = kFloppyProtectionInputX;
bool full = false;
bool done = false;
int caretColor = kFloppyColorCaption;
int blinkCounter = 0;
- uint32 lastTick = ticksSince(startMillis);
+ const uint32 startMillis = _system->getMillis();
+ uint32 lastTick = 0;
while (!done && !isGameEnding()) {
Common::Event ev;
bool changed = false;
@@ -218,6 +210,54 @@ bool IgorEngine::copyProtection() {
lastTick = ticksSince(startMillis);
blinkCounter = (blinkCounter == kFloppyProtectionBlinkPeriod - 1) ? 0 : blinkCounter + 1;
}
+ return !isGameEnding();
+}
+
+// Returns false if the test failed
+bool IgorEngine::copyProtection() {
+ int size;
+ Common::Array<Common::String> texts;
+ uint8 *data = loadData(TXT_FloppyProtectionScreen, 0, &size);
+ readProtectionStrings(texts, data, size, 5);
+ free(data);
+ data = loadData(TXT_FloppyProtectionReply, 0, &size);
+ readProtectionStrings(texts, data, size, 2);
+ free(data);
+ assert(texts.size() == kFloppyProtectionTextCount);
+ uint8 *words = loadData(DAT_FloppyProtectionWords, 0, &size);
+ assert(size == kFloppyProtectionWordCount * kFloppyProtectionEntrySize);
+ uint8 *button = loadData(IMG_OptionsButton);
+
+ PauseToken pauseToken = pauseEngine();
+ hideCursor();
+ floppyMenuFadeOut();
+ memcpy(_screenTextLayer, _screenVGA + kFloppyMenuY * 320, kFloppyMenuSize);
+
+ bool passed = false;
+ for (int attempt = 1; attempt <= kFloppyProtectionTries && !passed && !isGameEnding(); ++attempt) {
+ const uint8 *entry = words + getRandomNumber(kFloppyProtectionWordCount - 1) * kFloppyProtectionEntrySize;
+ drawProtectionScreen(texts, button, entry);
+ uint8 typed[kFloppyProtectionMaxInput + 1];
+ if (!readProtectionWord(typed))
+ break;
+
+ // Compare the typed word, in the stored form, with the expected word and the master code.
+ uint8 encoded[kFloppyProtectionWordLength + 1];
+ encoded[0] = kFloppyProtectionWordLength;
+ for (int i = 1; i <= kFloppyProtectionWordLength; ++i) {
+ const uint8 chr = (typed[i] >= 'a' && typed[i] <= 'z') ? typed[i] - 0x20 : typed[i];
+ encoded[i] = (uint8)(chr + kFloppyProtectionCodeOffset);
+ }
+ const Common::String &master = texts[kFloppyProtectionMaster];
+ passed = !memcmp(encoded, entry, kFloppyProtectionWordLength + 1) ||
+ (master.size() == kFloppyProtectionWordLength && !memcmp(encoded + 1, master.c_str(), kFloppyProtectionWordLength));
+ if (!passed && attempt < kFloppyProtectionTries) {
+ // TODO: the original also beeps here; the tone and length of that beep are not established.
+ _sentenceFont->drawString(_screenTextLayer, texts[kFloppyProtectionWrong].c_str(), kFloppyProtectionReplyX, kFloppyProtectionReplyY - kFloppyMenuY, kFloppyColorCaption, -1, -1);
+ floppyOptionsPresent(0);
+ waitForTimer(kFloppyProtectionReplyTicks, false);
+ }
+ }
free(button);
free(words);
@@ -226,16 +266,21 @@ bool IgorEngine::copyProtection() {
_inputVars[kInputSkipDialogue] = 0;
_inputVars[kInputOptions] = 0;
_inputVars[kInputPause] = 0;
+ _inputVars[kInputEscape] = 0;
+ _inputVars[kInputConfirm] = 0;
showCursor();
- if (isGameEnding())
+ if (!passed) {
+ // Three wrong words end the game.
+ _currentPart = kInvalidPart;
return false;
+ }
setPaletteColor(255, 63, 63, 63);
fadeIn(kFloppyFadeCount);
return true;
}
bool IgorEngine::checkCopyProtection() {
- if (_game.version != kIdSpaFloppy || _floppyProtectionPassed)
+ if (_game.version != kIdSpaFloppy || _floppyProtectionPassed || (ConfMan.hasKey("skip_copy_protection") && ConfMan.getBool("skip_copy_protection")))
return true;
if (!copyProtection())
return false;
diff --git a/engines/igor/detection.h b/engines/igor/detection.h
index 4a6597fa758..c0ce2492914 100644
--- a/engines/igor/detection.h
+++ b/engines/igor/detection.h
@@ -79,6 +79,7 @@ extern const PlainGameDescriptor igorGames[];
extern const IgorGameDescription gameDescriptions[];
#define GAMEOPTION_ORIGINAL_SAVELOAD GUIO_GAMEOPTIONS1
+#define GAMEOPTION_SKIP_COPY_PROTECTION GUIO_GAMEOPTIONS2
} // End of namespace Igor
diff --git a/engines/igor/detection_tables.h b/engines/igor/detection_tables.h
index b2458bf9f88..5c55b34d863 100644
--- a/engines/igor/detection_tables.h
+++ b/engines/igor/detection_tables.h
@@ -92,7 +92,7 @@ const IgorGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformDOS,
ADGF_UNSTABLE,
- GUIO1(GUIO_NOSPEECH)
+ GUIO2(GUIO_NOSPEECH, GAMEOPTION_SKIP_COPY_PROTECTION)
},
kIdSpaFloppy,
kFlagFloppy,
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 9d74cafbb7b..359aa9b8660 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -23,6 +23,7 @@
#define IGOR_H
#include "common/error.h"
+#include "common/events.h"
#include "common/file.h"
#include "common/fs.h"
#include "common/hash-str.h"
@@ -1785,6 +1786,8 @@ private:
void handleFloppyOptionsMenu();
void floppyMenuFillRow(int x, int y, int count, int color);
bool isGameEnding() const;
+ void drawProtectionScreen(const Common::Array<Common::String> &texts, const uint8 *button, const uint8 *entry);
+ bool readProtectionWord(uint8 *typed);
bool copyProtection();
bool checkCopyProtection();
void scrollInventory();
diff --git a/engines/igor/metaengine.cpp b/engines/igor/metaengine.cpp
index 8bc42520a86..b6a90d1fa76 100644
--- a/engines/igor/metaengine.cpp
+++ b/engines/igor/metaengine.cpp
@@ -39,6 +39,17 @@ static const ADExtraGuiOptionsMap optionsList[] = {
0
}
},
+ {
+ GAMEOPTION_SKIP_COPY_PROTECTION,
+ {
+ _s("Skip copy protection"),
+ _s("Skips original copy protection screen"),
+ "skip_copy_protection",
+ false,
+ 0,
+ 0
+ }
+ },
AD_EXTRA_GUI_OPTIONS_TERMINATOR
};
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index bc3c226a196..ace84588091 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -912,6 +912,7 @@
#define BOX_CollegeCorridorMathClass 1281
#define DAT_FloppyProtectionWords 1282
#define TXT_FloppyProtectionScreen 1283
+#define TXT_FloppyProtectionReply 1284
#define FRM_CollegeCorridorLadiesRoomFloppy1 1257
#define FRM_CollegeCorridorLadiesRoomFloppy2 1258
Commit: 37a093709cff939b73acde22b39bf875d43ce383
https://github.com/scummvm/scummvm/commit/37a093709cff939b73acde22b39bf875d43ce383
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:25+01:00
Commit Message:
IGOR: scope part 2 case 23 to fix windows compilation
Changed paths:
engines/igor/parts/part_2.cpp
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index ce948413c2b..1cd47e2185a 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -408,7 +408,7 @@ void IgorEngine::part2() {
updatePalette(768);
_walkData[0].setPos(49, 118, kFacingPositionBack, 0);
break;
- case 23: // back after outdoor explosion scene
+ case 23: { // back after outdoor explosion scene
memset(_screenVGA + 0xB400, 0, 0x4600);
memcpy(_currentPalette, _paletteBuffer, 768);
drawAnimRect(0x6C3B, 0x820B + 0 * 0xA19, 47, 55, false, kBlendLitSprite);
@@ -436,6 +436,7 @@ void IgorEngine::part2() {
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_walkData[0].setPos(215, 134, kFacingPositionRight, 0);
break;
+ }
case 24: // From igor's room
_walkData[0].setPos(211, 120, kFacingPositionFront, 0);
fadeIn(768);
Commit: d85c18f02c32970cc2f096c5a0edd881f8483ab2
https://github.com/scummvm/scummvm/commit/d85c18f02c32970cc2f096c5a0edd881f8483ab2
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:25+01:00
Commit Message:
IGOR: Fix compilation warnings
Changed paths:
engines/igor/copy_protection.cpp
engines/igor/input.cpp
engines/igor/parts/part_0.cpp
diff --git a/engines/igor/copy_protection.cpp b/engines/igor/copy_protection.cpp
index 7873e03ba25..261a3bd73d7 100644
--- a/engines/igor/copy_protection.cpp
+++ b/engines/igor/copy_protection.cpp
@@ -199,7 +199,7 @@ bool IgorEngine::readProtectionWord(uint8 *typed) {
}
if (blinkCounter == kFloppyProtectionBlinkTick && !full && !done) {
floppyMenuFillRow(x, kFloppyProtectionInputY + kFloppyProtectionCaretRow, kFloppyProtectionCaretWidth, caretColor);
- caretColor = (caretColor == kFloppyColorCaption) ? kFloppyColorInputFill : kFloppyColorCaption;
+ caretColor = (caretColor == kFloppyColorCaption) ? (int)kFloppyColorInputFill : (int)kFloppyColorCaption;
changed = true;
}
if (changed)
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index ac1cdddd330..41328a22974 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -230,7 +230,7 @@ void IgorEngine::beginRightButtonVerbPick() {
}
// if in inventory area but no item is below the mouse, choose use
if (inventorySlot && getObjectFromInventory(_rightButtonSelectCursorX) == 0 && defaultVerb == kVerbLook) {
- defaultVerb = (_currentAction.verb == kVerbWalk) ? kVerbUse : _currentAction.verb;
+ defaultVerb = (_currentAction.verb == kVerbWalk) ? (int)kVerbUse : (int)_currentAction.verb;
}
const int previousVerb = _currentAction.verb;
if (defaultVerb > 0) {
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 90cb3209074..7eaf322b0d1 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -86,14 +86,14 @@ void IgorEngine::part0ExecuteAction(int action) {
break;
case 106: // open bedside table
if (_objectsState[kBedroomNightstandOpenStateIndex] == 0) {
- animateLitAnimFrames(0x3FC8, 0, 2, 0x436, 22, 49, 0x693C, 126, 2, _game.version == kIdSpaFloppy ? kSpaFloppySoundPart0Nightstand : kSoundPart0Nightstand);
+ animateLitAnimFrames(0x3FC8, 0, 2, 0x436, 22, 49, 0x693C, 126, 2, _game.version == kIdSpaFloppy ? (int)kSpaFloppySoundPart0Nightstand : (int)kSoundPart0Nightstand);
_objectsState[kBedroomNightstandOpenStateIndex] = 1;
part0ApplyObjectState(1);
}
break;
case 107: // close bedside table
if (_objectsState[kBedroomNightstandOpenStateIndex] != 0) {
- animateLitAnimFrames(0x3FC8, 2, 0, 0x436, 22, 49, 0x693C, 126, 1, _game.version == kIdSpaFloppy ? kSpaFloppySoundPart0Nightstand : kSoundPart0Nightstand);
+ animateLitAnimFrames(0x3FC8, 2, 0, 0x436, 22, 49, 0x693C, 126, 1, _game.version == kIdSpaFloppy ? (int)kSpaFloppySoundPart0Nightstand : (int)kSoundPart0Nightstand);
_objectsState[kBedroomNightstandOpenStateIndex] = 0;
part0ApplyObjectState(1);
}
@@ -125,7 +125,7 @@ void IgorEngine::part0ExecuteAction(int action) {
break;
case 111: // close closet
if (_objectsState[kBedroomClosetOpenStateIndex] != 0) {
- animateLitAnimFrames(0x1678, 2, 0, 0x940, 37, 64, 0x556C, 126, 1, _game.version == kIdSpaFloppy ? kSpaFloppySoundPart0ClosetClose : kSoundPart0ClosetClose);
+ animateLitAnimFrames(0x1678, 2, 0, 0x940, 37, 64, 0x556C, 126, 1, _game.version == kIdSpaFloppy ? (int)kSpaFloppySoundPart0ClosetClose : (int)kSoundPart0ClosetClose);
_objectsState[kBedroomClosetOpenStateIndex] = 0;
part0ApplyObjectState(3);
}
Commit: 0e2cf56adb8b3a2faef2cf92b6b339c6a1dfeb3a
https://github.com/scummvm/scummvm/commit/0e2cf56adb8b3a2faef2cf92b6b339c6a1dfeb3a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:26+01:00
Commit Message:
IGOR: Implement original save/load menu
Changed paths:
engines/igor/detection_tables.h
engines/igor/igor.h
engines/igor/metaengine.cpp
engines/igor/options.cpp
engines/igor/resource_ids.h
diff --git a/engines/igor/detection_tables.h b/engines/igor/detection_tables.h
index 5c55b34d863..9bfa1f24d12 100644
--- a/engines/igor/detection_tables.h
+++ b/engines/igor/detection_tables.h
@@ -74,7 +74,7 @@ const IgorGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformDOS,
ADGF_UNSTABLE | ADGF_CD,
- GUIO1(GUIO_NONE)
+ GUIO1(GAMEOPTION_ORIGINAL_SAVELOAD)
},
kIdSpaCD,
kFlagTalkie,
@@ -92,7 +92,7 @@ const IgorGameDescription gameDescriptions[] = {
Common::ES_ESP,
Common::kPlatformDOS,
ADGF_UNSTABLE,
- GUIO2(GUIO_NOSPEECH, GAMEOPTION_SKIP_COPY_PROTECTION)
+ GUIO3(GUIO_NOSPEECH, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_SKIP_COPY_PROTECTION)
},
kIdSpaFloppy,
kFlagFloppy,
@@ -111,7 +111,7 @@ const IgorGameDescription gameDescriptions[] = {
Common::EN_ANY,
Common::kPlatformDOS,
ADGF_UNSTABLE,
- GUIO1(GUIO_NOSPEECH)
+ GUIO2(GUIO_NOSPEECH, GAMEOPTION_ORIGINAL_SAVELOAD)
},
kIdEngFloppy,
kFlagFloppy,
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 359aa9b8660..def60a74e9c 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -607,6 +607,29 @@ enum AnimBlend {
class MidiPlayer;
+// We create a struct to share the same implementation for
+// both Spanish floppy and english & CD versions of the game
+// logic is the same, statics differ
+struct SaveLoadLayout {
+ const IgorFont *font;
+ int shadowColor;
+ int menuY, menuHeight;
+ int menuX, menuWidth; // position and width of the panel imagery
+ int captionTextY, captionFirstY, captionLastY;
+ int bodyFirstY, bodyRows;
+ int listTextX, listFirstY, rowHeight;
+ int frameX, frameWidth;
+ int colorSelected, colorNormal, colorFrameLight, colorFrameDark, colorEraser;
+ int colorTitle, colorNoGames;
+ int nameLimitX, nameMargin;
+ int cursorRows, cursorY, cursorX, cursorWidth;
+ int eraseLastRow, eraseX;
+ bool apostropheGlyph;
+ int centerX; // titles are centered on this x, or start at titleX when negative
+ // x position of the titles when they are not centered
+ int saveTitleX, describeTitleX, loadTitleX, noSavedGamesX;
+};
+
class IgorEngine : public Engine {
public:
typedef void (IgorEngine::*ExecuteActionProc)(int action); // pointer to room action function
@@ -1781,6 +1804,14 @@ private:
void floppyOptionsPaintControl(const uint8 *button, int row);
void floppyOptionsPresent(int selectedButton);
void floppyOptionsQuitPage(const uint8 *button);
+ void saveLoadDrawTitle(const SaveLoadLayout &layout, int text, int x, int y, int color);
+ void saveLoadFillRows(const SaveLoadLayout &layout, const uint8 *button, int artRow, int firstY, int lastY);
+ void saveLoadFillCursor(const SaveLoadLayout &layout, int x, int y, int firstColor, int secondColor);
+ void saveLoadPresent(const SaveLoadLayout &layout);
+ void saveLoadDrawList(const SaveLoadLayout &layout, const uint8 *button, const Common::Array<Common::String> &names, int top, int row);
+ bool saveLoadChoose(const SaveLoadLayout &layout, const uint8 *button, const Common::Array<Common::String> &names, int &top, int &row);
+ bool saveLoadEditName(const SaveLoadLayout &layout, const uint8 *button, Common::String &name, int row);
+ bool originalSaveLoadPage(bool save);
void floppyOptionsControlPage(const uint8 *button);
void floppyMenuFadeOut();
void handleFloppyOptionsMenu();
diff --git a/engines/igor/metaengine.cpp b/engines/igor/metaengine.cpp
index b6a90d1fa76..ed492cb650b 100644
--- a/engines/igor/metaengine.cpp
+++ b/engines/igor/metaengine.cpp
@@ -43,7 +43,7 @@ static const ADExtraGuiOptionsMap optionsList[] = {
GAMEOPTION_SKIP_COPY_PROTECTION,
{
_s("Skip copy protection"),
- _s("Skips original copy protection screen"),
+ _s("Skips original copy protection screen."),
"skip_copy_protection",
false,
0,
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index f4aa9d5eecb..2382818a02c 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -133,6 +133,7 @@ enum OptionsMenuText {
kOptionsNoSavedGames,
kOptionsLoadTitle,
kOptionsUnavailable,
+ kOptionsDescribe,
kOptionsTextCount
};
@@ -199,6 +200,8 @@ void IgorEngine::loadOptionsMenuTexts() {
{ TXT_OptionsQuit, 3, kOptionsQuitTitle },
{ TXT_OptionsSaveTitle, 1, kOptionsSaveTitle },
{ TXT_OptionsLoadTitle, talkie ? 2 : 1, talkie ? kOptionsNoSavedGames : kOptionsLoadTitle },
+ { TXT_OptionsNoSavedGames, (!talkie && !demo) ? 1 : 0, kOptionsNoSavedGames },
+ { TXT_OptionsDescribeSave, demo ? 0 : 1, kOptionsDescribe },
{ TXT_OptionsUnavailable, demo ? 1 : 0, kOptionsUnavailable }
};
for (uint i = 0; i < ARRAYSIZE(groups); ++i) {
@@ -380,14 +383,22 @@ static const struct {
};
void IgorEngine::loadFloppyOptionsMenuTexts() {
+ // The floppy texts use their own indices; the save/load texts share the indices of the other versions.
+ static_assert((int)kFloppyTextCount <= (int)kOptionsSaveTitle, "floppy texts overlap the shared save/load texts");
+ _optionsMenuTexts.resize(kOptionsTextCount);
const struct {
int resource;
int count;
+ int firstText;
} groups[] = {
- { TXT_OptionsButtons, 5 },
- { TXT_OptionsSettings, 14 },
- { TXT_OptionsTitle, 1 },
- { TXT_OptionsQuit, 2 }
+ { TXT_OptionsButtons, 5, kFloppySave },
+ { TXT_OptionsSettings, 14, kFloppySpeedTitle },
+ { TXT_OptionsTitle, 1, kFloppyCtrlTitle },
+ { TXT_OptionsQuit, 2, kFloppyQuitTitle },
+ { TXT_OptionsSaveTitle, 1, kOptionsSaveTitle },
+ { TXT_OptionsLoadTitle, 1, kOptionsLoadTitle },
+ { TXT_OptionsDescribeSave, 1, kOptionsDescribe },
+ { TXT_OptionsNoSavedGames, 1, kOptionsNoSavedGames }
};
for (uint i = 0; i < ARRAYSIZE(groups); ++i) {
int size;
@@ -397,14 +408,13 @@ void IgorEngine::loadFloppyOptionsMenuTexts() {
if (offset >= size || data[offset] > size - offset - 1)
error("Invalid options menu text resource %d", groups[i].resource);
const int length = data[offset++];
- _optionsMenuTexts.push_back(Common::String((const char *)data + offset, length));
+ _optionsMenuTexts[groups[i].firstText + j] = Common::String((const char *)data + offset, length);
offset += length;
}
if (offset != size)
error("Unexpected data in options menu text resource %d", groups[i].resource);
free(data);
}
- assert(_optionsMenuTexts.size() == kFloppyTextCount);
}
// Texts are left aligned and drawn with the action sentence font into the menu panel.
@@ -565,6 +575,399 @@ void IgorEngine::floppyOptionsQuitPage(const uint8 *button) {
floppyOptionsDrawMainPage(button);
}
+// Original save/load screens. Every version runs the same code, only the offset/colors/font differ.
+static const int kSaveLoadVisibleRows = 8;
+static const int kSaveLoadNameLength = 100;
+static const int kSaveLoadNoSavedGamesY = 70;
+static const int kSaveLoadCaptionArtRow = 1;
+static const int kSaveLoadBodyArtRow = 7;
+static const int kSaveLoadBlinkPeriod = 64;
+static const int kSaveLoadBlinkToggleAt = 0x3d;
+static const int kSaveLoadNameCharsSize = 32;
+
+static SaveLoadLayout makeSaveLoadLayout(const IgorFont *sentenceFont, const IgorFont *dialogueFont, bool spanish, bool floppy) {
+ SaveLoadLayout l;
+ if (floppy) {
+ l.font = sentenceFont;
+ l.shadowColor = -1;
+ l.menuY = kFloppyMenuY;
+ l.menuHeight = kFloppyMenuHeight;
+ l.menuX = kFloppyMenuX;
+ l.menuWidth = kFloppyMenuWidth;
+ l.captionTextY = kFloppyCaptionY;
+ l.captionFirstY = kFloppyCaptionY;
+ l.captionLastY = kFloppyCaptionLastRow;
+ l.bodyFirstY = kFloppyControlPanelFirstRow;
+ l.bodyRows = kFloppyControlPanelRows;
+ l.listTextX = 62;
+ l.listFirstY = 38;
+ l.rowHeight = 10;
+ l.frameX = 59;
+ l.frameWidth = 202;
+ l.colorSelected = kFloppyColorCaption;
+ l.colorNormal = kFloppyColorText;
+ l.colorFrameLight = kFloppyColorFrameLight;
+ l.colorFrameDark = kFloppyColorFrameDark;
+ l.colorEraser = 0xFB;
+ l.colorTitle = kFloppyColorCaption;
+ l.colorNoGames = kFloppyColorCaption;
+ l.nameLimitX = 0x101;
+ l.nameMargin = 6;
+ l.cursorRows = 1;
+ l.cursorY = 8;
+ l.cursorX = 0;
+ l.cursorWidth = 7;
+ l.eraseLastRow = 9;
+ l.eraseX = 0;
+ l.apostropheGlyph = false;
+ l.centerX = -1;
+ l.saveTitleX = 108;
+ l.describeTitleX = 101;
+ l.loadTitleX = 108;
+ l.noSavedGamesX = 103;
+ } else {
+ l.font = dialogueFont;
+ l.shadowColor = 0;
+ l.menuY = kMenuY;
+ l.menuHeight = kMenuHeight;
+ l.menuX = kMenuX;
+ l.menuWidth = kMenuWidth;
+ l.captionTextY = kCaptionY + kMenuY;
+ l.captionFirstY = 18;
+ l.captionLastY = 29;
+ l.bodyFirstY = 35;
+ l.bodyRows = 89;
+ l.listTextX = 51;
+ l.listFirstY = 35;
+ l.rowHeight = 11;
+ l.frameX = 49;
+ l.frameWidth = 222;
+ l.colorSelected = kColorTitle;
+ l.colorNormal = kColorText;
+ l.colorFrameLight = kColorFrameLight;
+ l.colorFrameDark = kColorFrameDark;
+ l.colorEraser = kColorFill;
+ l.colorTitle = kColorPageCaption;
+ l.colorNoGames = kColorTitle;
+ l.nameLimitX = 0x10b;
+ l.nameMargin = 7;
+ l.cursorRows = 2;
+ l.cursorY = 9;
+ l.cursorX = 1;
+ l.cursorWidth = 8;
+ l.eraseLastRow = 10;
+ l.eraseX = 1;
+ l.apostropheGlyph = true;
+ // the Spanish texts are centered, the English ones start at a fixed position
+ l.centerX = spanish ? kPageCenterX : -1;
+ l.saveTitleX = 75;
+ l.describeTitleX = 103;
+ l.loadTitleX = 93;
+ l.noSavedGamesX = 87;
+ }
+ return l;
+}
+
+void IgorEngine::saveLoadDrawTitle(const SaveLoadLayout &l, int text, int x, int y, int color) {
+ const char *str = _optionsMenuTexts[text].c_str();
+ if (l.centerX >= 0) {
+ x = l.centerX - l.font->getStringWidth(str) / 2;
+ }
+ l.font->drawString(_screenTextLayer, str, x, y - l.menuY, color, -1, l.shadowColor);
+}
+
+void IgorEngine::saveLoadFillRows(const SaveLoadLayout &l, const uint8 *button, int artRow, int firstY, int lastY) {
+ for (int y = firstY; y <= lastY; ++y) {
+ memcpy(_screenTextLayer + (y - l.menuY) * 320 + l.menuX, button + artRow * l.menuWidth, l.menuWidth);
+ }
+}
+
+void IgorEngine::saveLoadPresent(const SaveLoadLayout &l) {
+ _system->copyRectToScreen(_screenTextLayer, 320, 0, l.menuY, 320, l.menuHeight);
+ _system->updateScreen();
+}
+
+// Long names, which can come from ScummVMâs own save dialog, are cut at the editing limit so they donât exceed the available space.
+static Common::String saveLoadFitName(const SaveLoadLayout &l, const Common::String &name) {
+ Common::String fitted;
+ int x = l.listTextX;
+ for (uint i = 0; i < name.size(); ++i) {
+ x += l.font->getCharWidth((uint8)name[i]);
+ if (x + l.nameMargin > l.nameLimitX)
+ break;
+ fitted += name[i];
+ }
+ return fitted;
+}
+
+void IgorEngine::saveLoadDrawList(const SaveLoadLayout &l, const uint8 *button, const Common::Array<Common::String> &names, int top, int row) {
+ saveLoadFillRows(l, button, kSaveLoadBodyArtRow, l.bodyFirstY, l.bodyFirstY + l.bodyRows - 1);
+ const int last = MIN<int>(top + kSaveLoadVisibleRows - 1, names.size());
+ int y = l.listFirstY;
+ for (int i = top; i <= last; ++i) {
+ const int color = (i - top + 1 == row) ? l.colorSelected : l.colorNormal;
+ l.font->drawString(_screenTextLayer, saveLoadFitName(l, names[i - 1]).c_str(), l.listTextX, y - l.menuY, color, -1, l.shadowColor);
+ y += l.rowHeight;
+ }
+ uint8 *frame = _screenTextLayer + (9 + l.rowHeight * row) * 320 + l.frameX;
+ memset(frame, l.colorFrameLight, l.frameWidth);
+ for (int i = 1; i < l.rowHeight; ++i) {
+ frame[i * 320] = l.colorFrameLight;
+ frame[i * 320 + l.frameWidth - 1] = l.colorFrameDark;
+ }
+ memset(frame + l.rowHeight * 320, l.colorFrameDark, l.frameWidth);
+}
+
+// Selects an entry with the keyboard; the selected position is row (1..8) of the window starting at top.
+bool IgorEngine::saveLoadChoose(const SaveLoadLayout &l, const uint8 *button, const Common::Array<Common::String> &names, int &top, int &row) {
+ row = 1;
+ const int count = names.size();
+ bool redraw = true;
+ bool done = false;
+ bool accepted = false;
+ while (!done && !_eventQuitGame && _currentPart != kInvalidPart) {
+ if (redraw) {
+ saveLoadDrawList(l, button, names, top, row);
+ redraw = false;
+ }
+ Common::Event ev;
+ while (_eventMan->pollEvent(ev)) {
+ if (ev.type == Common::EVENT_QUIT) {
+ _currentPart = kInvalidPart;
+ _eventQuitGame = true;
+ } else if (ev.type == Common::EVENT_KEYDOWN) {
+ switch (ev.kbd.keycode) {
+ case Common::KEYCODE_UP:
+ if (row > 1) {
+ --row;
+ } else if (top > 1) {
+ --top;
+ }
+ redraw = true;
+ break;
+ case Common::KEYCODE_DOWN:
+ if (row < kSaveLoadVisibleRows) {
+ if (row < count)
+ ++row;
+ } else if (count > kSaveLoadVisibleRows && top + kSaveLoadVisibleRows - 1 < count) {
+ ++top;
+ }
+ redraw = true;
+ break;
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ accepted = true;
+ done = true;
+ break;
+ case Common::KEYCODE_ESCAPE:
+ done = true;
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ saveLoadPresent(l);
+ _system->delayMillis(10);
+ }
+ return accepted;
+}
+
+static int saveLoadKeyToCode(const Common::KeyState &key) {
+ switch (key.keycode) {
+ case Common::KEYCODE_BACKSPACE:
+ return 8;
+ case Common::KEYCODE_RETURN:
+ case Common::KEYCODE_KP_ENTER:
+ return 13;
+ case Common::KEYCODE_ESCAPE:
+ return 27;
+ default:
+ break;
+ }
+ if (key.ascii >= 0x20 && key.ascii < 0x7f)
+ return key.ascii;
+ switch (key.ascii) {
+ case 0xe9: return 130;
+ case 0xe1: return 160;
+ case 0xed: return 161;
+ case 0xf3: return 162;
+ case 0xfa: return 163;
+ case 0xf1: return 164;
+ case 0xd1: return 165;
+ case 0xbf: return 168;
+ case 0xa1: return 173;
+ default: return 0;
+ }
+}
+
+// Fills the blinking cursor below the line being edited; the second row is its shadow.
+void IgorEngine::saveLoadFillCursor(const SaveLoadLayout &l, int x, int y, int firstColor, int secondColor) {
+ memset(_screenTextLayer + (y + l.cursorY - l.menuY) * 320 + x + l.cursorX, firstColor, l.cursorWidth);
+ if (l.cursorRows > 1)
+ memset(_screenTextLayer + (y + l.cursorY + 1 - l.menuY) * 320 + x + l.cursorX + 1, secondColor, l.cursorWidth);
+}
+
+bool IgorEngine::saveLoadEditName(const SaveLoadLayout &l, const uint8 *button, Common::String &name, int row) {
+ uint8 *allowed = loadData(DAT_OptionsNameChars);
+ saveLoadFillRows(l, button, kSaveLoadCaptionArtRow, l.captionFirstY, l.captionLastY);
+ saveLoadDrawTitle(l, kOptionsDescribe, l.describeTitleX, l.captionTextY, l.colorTitle);
+
+ char text[kSaveLoadNameLength + 2];
+ memset(text, ' ', sizeof(text));
+ for (int i = 0; i < kSaveLoadNameLength && i < (int)name.size(); ++i) {
+ text[i + 1] = name[i];
+ }
+ int index = kSaveLoadNameLength;
+ while (text[index] == ' ' && index != 1) {
+ --index;
+ }
+ int x = l.listTextX;
+ if (index > 1) {
+ for (int i = 1; i <= index; ++i) {
+ x += l.font->getCharWidth((uint8)text[i]);
+ }
+ ++index;
+ }
+ bool full = (x + l.nameMargin > l.nameLimitX);
+ const int y = row * l.rowHeight + l.listFirstY - l.rowHeight;
+ int blinkColor = l.colorSelected;
+ int blinkCounter = 0;
+ uint32 lastUnit = _system->getMillis() * kTickDelay / 1000;
+ bool done = false;
+ bool accepted = false;
+
+ while (!done && !_eventQuitGame && _currentPart != kInvalidPart) {
+ Common::Event ev;
+ while (_eventMan->pollEvent(ev)) {
+ if (ev.type == Common::EVENT_QUIT) {
+ _currentPart = kInvalidPart;
+ _eventQuitGame = true;
+ } else if (ev.type == Common::EVENT_KEYDOWN) {
+ int key = saveLoadKeyToCode(ev.kbd);
+ if (key >= 0 && key < kSaveLoadNameCharsSize * 8 && (allowed[key >> 3] & (1 << (key & 7))) && !full && index <= kSaveLoadNameLength) {
+ if (key == 0x27 && l.apostropheGlyph) {
+ key = 0x25;
+ }
+ text[index] = key;
+ saveLoadFillCursor(l, x, y, l.colorEraser, l.colorEraser);
+ const char str[2] = { (char)key, 0 };
+ l.font->drawString(_screenTextLayer, str, x, y - l.menuY, l.colorSelected, -1, l.shadowColor);
+ ++index;
+ x += l.font->getCharWidth((uint8)key);
+ full = (x + l.nameMargin > l.nameLimitX);
+ }
+ if (key == 8 && index > 1) {
+ --index;
+ if (!full) {
+ saveLoadFillCursor(l, x, y, l.colorEraser, l.colorEraser);
+ }
+ x -= l.font->getCharWidth((uint8)text[index]);
+ full = (x + l.nameMargin > l.nameLimitX);
+ text[index] = ' ';
+ for (int i = y + 1; i <= y + l.eraseLastRow; ++i) {
+ memset(_screenTextLayer + (i - l.menuY) * 320 + x + l.eraseX, l.colorEraser, l.cursorWidth);
+ }
+ }
+ if (key == 13) {
+ accepted = true;
+ done = true;
+ }
+ if (key == 27) {
+ done = true;
+ }
+ }
+ }
+ const uint32 unit = _system->getMillis() * kTickDelay / 1000;
+ for (; lastUnit != unit; ++lastUnit) {
+ if (blinkCounter == kSaveLoadBlinkToggleAt && !full) {
+ if (blinkColor == l.colorSelected) {
+ saveLoadFillCursor(l, x, y, l.colorSelected, 0);
+ blinkColor = l.colorEraser;
+ } else {
+ saveLoadFillCursor(l, x, y, blinkColor, blinkColor);
+ blinkColor = l.colorSelected;
+ }
+ }
+ blinkCounter = (blinkCounter == kSaveLoadBlinkPeriod - 1) ? 0 : blinkCounter + 1;
+ }
+ saveLoadPresent(l);
+ _system->delayMillis(10);
+ }
+ free(allowed);
+ if (accepted) {
+ name = Common::String(text + 1, kSaveLoadNameLength);
+ }
+ return accepted;
+}
+
+// Returns true when a game was saved or loaded.
+bool IgorEngine::originalSaveLoadPage(bool save) {
+ const SaveLoadLayout l = makeSaveLoadLayout(_sentenceFont, _dialogueFont, _game.language == Common::ES_ESP, _game.version == kIdSpaFloppy);
+ Common::Array<int> slots;
+ Common::Array<Common::String> names;
+ const int autosaveSlot = getAutosaveSlot();
+ // ScummVM's slot limit replaces the original's fixed number of savegame files (40)
+ const uint maxEntries = getMetaEngine()->getMaximumSaveSlot() + 1;
+ const SaveStateList saves = getMetaEngine()->listSaves(_targetName.c_str());
+ for (uint i = 0; i < saves.size() && slots.size() < maxEntries; ++i) {
+ if (saves[i].getSaveSlot() == autosaveSlot)
+ continue;
+ slots.push_back(saves[i].getSaveSlot());
+ names.push_back(saves[i].getDescription().substr(0, kSaveLoadNameLength));
+ }
+ if (save && slots.size() < maxEntries) {
+ // the new savegame uses the first free slot
+ int freeSlot = 0;
+ for (;;) {
+ bool used = (freeSlot == autosaveSlot);
+ for (uint i = 0; i < slots.size() && !used; ++i) {
+ used = (slots[i] == freeSlot);
+ }
+ if (!used)
+ break;
+ ++freeSlot;
+ }
+ slots.push_back(freeSlot);
+ names.push_back(Common::String(kSaveLoadNameLength, ' '));
+ }
+ if (slots.empty()) {
+ saveLoadDrawTitle(l, kOptionsNoSavedGames, l.noSavedGamesX, kSaveLoadNoSavedGamesY, l.colorNoGames);
+ saveLoadPresent(l);
+ return false;
+ }
+
+ Common::Array<uint8> backup(_screenTextLayer, 320 * l.menuHeight);
+ uint8 *button = loadData(IMG_OptionsButton);
+ bool done = false;
+ int top = 1;
+ while (!done && !_eventQuitGame && _currentPart != kInvalidPart) {
+ saveLoadFillRows(l, button, kSaveLoadCaptionArtRow, l.captionFirstY, l.captionLastY);
+ saveLoadDrawTitle(l, save ? kOptionsSaveTitle : kOptionsLoadTitle, save ? l.saveTitleX : l.loadTitleX, l.captionTextY, l.colorTitle);
+ int row;
+ if (!saveLoadChoose(l, button, names, top, row)) {
+ break;
+ }
+ const int entry = row + top - 1;
+ if (!save) {
+ done = (loadGameState(slots[entry - 1]).getCode() == Common::kNoError);
+ break;
+ }
+ Common::String name = names[entry - 1];
+ if (saveLoadEditName(l, button, name, row)) {
+ while (name.size() > 0 && name.lastChar() == ' ') {
+ name.deleteLastChar();
+ }
+ done = (saveGameState(slots[entry - 1], name).getCode() == Common::kNoError);
+ break;
+ }
+ }
+ free(button);
+ if (!done)
+ memcpy(_screenTextLayer, backup.data(), backup.size());
+ return done;
+}
+
// The menus start from the full palette and dim colors 1..248 in steps of three levels.
void IgorEngine::floppyMenuFadeOut() {
memcpy(_currentPalette, _paletteBuffer, 768);
@@ -610,10 +1013,10 @@ void IgorEngine::handleFloppyOptionsMenu() {
case Common::KEYCODE_RETURN:
case Common::KEYCODE_KP_ENTER:
if (selected == 1) {
- if (saveGameDialog())
+ if (ConfMan.getBool("original_menus") ? originalSaveLoadPage(true) : saveGameDialog())
menuLoop = false;
} else if (selected == 2) {
- if (loadGameDialog()) {
+ if (ConfMan.getBool("original_menus") ? originalSaveLoadPage(false) : loadGameDialog()) {
free(button);
_optionsMenuThumbnail.free();
return;
@@ -744,10 +1147,10 @@ void IgorEngine::handleOptionsMenu() {
break;
case Common::KEYCODE_RETURN:
if (currentPage == kPageSave && !(_game.flags & kFlagDemo)) {
- if (saveGameDialog())
+ if (ConfMan.getBool("original_menus") ? originalSaveLoadPage(true) : saveGameDialog())
menuLoop = false;
} else if (currentPage == kPageLoad && !(_game.flags & kFlagDemo)) {
- if (loadGameDialog()) {
+ if (ConfMan.getBool("original_menus") ? originalSaveLoadPage(false) : loadGameDialog()) {
_optionsMenuThumbnail.free();
return;
}
diff --git a/engines/igor/resource_ids.h b/engines/igor/resource_ids.h
index ace84588091..7c9f41ff39a 100644
--- a/engines/igor/resource_ids.h
+++ b/engines/igor/resource_ids.h
@@ -913,6 +913,9 @@
#define DAT_FloppyProtectionWords 1282
#define TXT_FloppyProtectionScreen 1283
#define TXT_FloppyProtectionReply 1284
+#define TXT_OptionsDescribeSave 1285
+#define DAT_OptionsNameChars 1286
+#define TXT_OptionsNoSavedGames 1287
#define FRM_CollegeCorridorLadiesRoomFloppy1 1257
#define FRM_CollegeCorridorLadiesRoomFloppy2 1258
Commit: 13ba30a7d156c90127bbe78b4d7c17a2346307a9
https://github.com/scummvm/scummvm/commit/13ba30a7d156c90127bbe78b4d7c17a2346307a9
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:26+01:00
Commit Message:
IGOR: Embed Floppy binary data in TBL file
Changed paths:
R engines/igor/unpack.cpp
R engines/igor/unpack.h
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/module.mk
engines/igor/resource.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index fc0aa3232b2..eca283d6b47 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -236,10 +236,6 @@ Common::Error IgorEngine::run() {
error("Unable to open '%s'", _game.sfxFileName);
}
- if (_game.version == kIdSpaFloppy) {
- unpackExecutable();
- }
-
readTableFile();
if (_game.flags & kFlagFloppy)
_midiPlayer = new MidiPlayer(_mixer);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index def60a74e9c..7e05f4c8fdf 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -155,8 +155,8 @@ struct DetectedGameVersion {
};
enum ResourceSource {
- kResourceSourceContainer, // the game's resource container (IGOR.DAT, IGOR.EXE)
- kResourceSourceExecutable // the unpacked executable image of the Spanish floppy version
+ kResourceSourceContainer, // the game's resource container (IGOR.DAT)
+ kResourceSourceTable = 2 // data embedded in IGOR.TBL, offset is absolute in that file
};
struct ResourceEntry {
@@ -654,7 +654,6 @@ private:
Common::File _ovlFile;
Common::File _sndFile;
- Common::Array<byte> _unpackedExe;
Audio::SoundHandle _sfxHandle;
Audio::SoundHandle _speechHandle;
@@ -1896,7 +1895,6 @@ private:
uint32 ticksSince(uint32 startMillis) const;
ResourceEntry *findData(int num);
- void unpackExecutable();
uint8 *loadData(int num, uint8 *dst = 0, int *size = 0);
void loadAnimData(const int *anm, int loadOffset = 0);
void loadActionData(int act);
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index 9b9e36da624..b40eeca0af1 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -8,7 +8,6 @@ MODULE_OBJS = \
palette.o \
font.o \
floppy_font.o \
- unpack.o \
room.o \
graphics.o \
resource.o \
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index f99dbc99e50..baec9f5cbb2 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -21,28 +21,9 @@
#include "igor/igor.h"
#include "common/debug-channels.h"
-#include "igor/unpack.h"
namespace Igor {
-// The Spanish floppy version keeps part of its resources inside its packed
-// executable. They are read from the memory image of IGOR.EXE, restored at startup.
-void IgorEngine::unpackExecutable() {
- Common::File exeFile;
- if (!exeFile.open("IGOR.EXE")) {
- error("Unable to open 'IGOR.EXE'");
- }
- Common::Array<byte> packed;
- packed.resize(exeFile.size());
- if (exeFile.read(packed.data(), packed.size()) != packed.size()) {
- error("Unable to read 'IGOR.EXE'");
- }
- Common::String unpackError;
- if (!unpackSpanishFloppyExe(packed.data(), packed.size(), _unpackedExe, unpackError)) {
- error("Unable to unpack 'IGOR.EXE': %s", unpackError.c_str());
- }
-}
-
void IgorEngine::readTableFile() {
Common::File tblFile;
uint32 stringsEntriesOffset = 0, resourcesEntriesOffset = 0, soundEntriesOffset = 0;
@@ -50,8 +31,8 @@ void IgorEngine::readTableFile() {
if (tblFile.open("IGOR.TBL") && tblFile.readUint32BE() == 'ITBL') {
tableVersion = tblFile.readUint32BE();
}
- // version 5 adds the source of the data of each resource
- if (tableVersion == 4 || tableVersion == 5) {
+ // version 5 adds the source of the data of each resource, version 6 data embedded in the table
+ if (tableVersion >= 4 && tableVersion <= 6) {
stringsEntriesOffset = tblFile.readUint32BE();
uint32 borlandOverlaySize = _ovlFile.size();
int gameVersionsCount = tblFile.readByte();
@@ -76,7 +57,7 @@ void IgorEngine::readTableFile() {
_resourceEntries[i].source = kResourceSourceContainer;
if (tableVersion >= 5) {
const int source = tblFile.readByte();
- if (source != kResourceSourceContainer && source != kResourceSourceExecutable) {
+ if (source != kResourceSourceContainer && !(tableVersion >= 6 && source == kResourceSourceTable)) {
error("Invalid resource source in 'IGOR.TBL'");
}
_resourceEntries[i].source = (ResourceSource)source;
@@ -109,13 +90,13 @@ void IgorEngine::readTableFile() {
error("Unable to read 'IGOR.TBL'");
}
-// The unpacked executable of the Spanish floppy version stores each text as a
+// The Spanish floppy text table stores each text as a
// plain Pascal string (length byte, then the characters) in a slot with room for
// both languages.
static void decodeFloppyMainString(const uint8 *src, char *dst, uint slotSize) {
const uint length = *src;
if (length >= slotSize) {
- error("Invalid text length in the unpacked executable");
+ error("Invalid text length in the floppy text table");
}
memcpy(dst, src + 1, length);
dst[length] = '\0';
@@ -368,12 +349,11 @@ uint8 *IgorEngine::loadData(int id, uint8 *dst, int *size) {
error("Unable to allocate %d bytes", re->size);
}
}
- // copy directly from the in-memory unpacked executable if the resource is stored there
- if (re->source == kResourceSourceExecutable) {
- if (re->offs > _unpackedExe.size() || re->size > _unpackedExe.size() - re->offs) {
- error("Resource %d lies outside the unpacked executable", id);
+ if (re->source == kResourceSourceTable) {
+ Common::File tblFile;
+ if (!tblFile.open("IGOR.TBL") || !tblFile.seek(re->offs) || tblFile.read(dst, re->size) != re->size) {
+ error("Unable to read resource %d from 'IGOR.TBL'", id);
}
- memcpy(dst, _unpackedExe.data() + re->offs, re->size);
} else {
_ovlFile.seek(re->offs);
_ovlFile.read(dst, re->size);
diff --git a/engines/igor/unpack.cpp b/engines/igor/unpack.cpp
deleted file mode 100644
index 29007695df6..00000000000
--- a/engines/igor/unpack.cpp
+++ /dev/null
@@ -1,250 +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 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "igor/unpack.h"
-
-#include "common/crc.h"
-#include "common/endian.h"
-
-namespace Igor {
-namespace {
-
-const uint32 kSupportedFileSize = 39537;
-const uint32 kSupportedCRC32 = 0x8edcfa28;
-const uint32 kImageSize = kSpanishFloppyExeImageSize;
-const uint32 kEncodedWordBytes = 38972;
-const uint32 kCompressedDataOffset = 656;
-const uint32 kLengthTable = 586;
-const uint32 kExtendedLengthTable = 597;
-const uint32 kLongLengthTable = 608;
-const uint32 kDistanceTable = 624;
-
-class UnpackReader {
-public:
- UnpackReader(const Common::Array<byte> &bytes)
- : _bytes(bytes), _position(kCompressedDataOffset), _control(0),
- _remaining(0), _error(nullptr) {
- refill();
- }
-
- byte readByte() {
- if (_position >= _bytes.size()) {
- fail("Truncated compressed stream");
- return 0;
- }
- return _bytes[_position++];
- }
-
- uint16 readWord() {
- const uint16 low = readByte();
- return low | (uint16(readByte()) << 8);
- }
-
- uint bit() {
- const uint value = _control & 1;
- _control >>= 1;
- // Refill before reading a following literal or match distance.
- if (--_remaining == 0)
- refill();
- return value;
- }
-
- uint bits(uint count) {
- uint value = 0;
- while (count--)
- value = (value << 1) | bit();
- return value;
- }
-
- uint appendBit(uint value) { return (value << 1) | bit(); }
-
- uint table(uint32 base, uint index) {
- if (index >= 32 || base + index >= _bytes.size()) {
- fail("Invalid decompression table index");
- return 0;
- }
- return _bytes[base + index];
- }
-
- void fail(const char *message) {
- if (!_error)
- _error = message;
- }
-
- const char *getError() const { return _error; }
-
-private:
- void refill() {
- _control = readWord();
- _remaining = 16;
- }
-
- const Common::Array<byte> &_bytes;
- uint32 _position;
- uint16 _control;
- uint _remaining;
- const char *_error;
-};
-
-uint matchLength(UnpackReader &reader) {
- uint code = reader.bits(2);
- if (code >= 2)
- return code;
-
- code = reader.appendBit(code);
- if (code != 0) {
- code = reader.appendBit(code);
- if (code >= 5)
- code = reader.appendBit(code);
- }
- if (code <= 12)
- return reader.table(kLengthTable, code);
-
- code = reader.appendBit(code & 3);
- if (code >= 5)
- code = reader.appendBit(code);
- if (code <= 12)
- return reader.table(kExtendedLengthTable, code);
-
- code = reader.appendBit(code & 3);
- if (code >= 5)
- code = reader.appendBit(code);
- return reader.table(kLongLengthTable, code);
-}
-
-uint matchDistance(UnpackReader &reader, uint length) {
- uint high = 0;
- if (length != 2 && reader.bit() == 0) {
- uint code = reader.bits(3);
- if (code >= 2) {
- code = reader.appendBit(code);
- if (code >= 8) {
- code = reader.appendBit(code);
- if (code >= 23) {
- code = reader.appendBit(code);
- high = code & 0xdf;
- } else {
- high = reader.table(kDistanceTable, code);
- }
- } else {
- high = reader.table(kDistanceTable, code);
- }
- } else {
- high = reader.table(kDistanceTable, code);
- }
- }
- return (high << 8) | reader.readByte();
-}
-
-void checkRelocations(UnpackReader &reader, uint32 imageSize) {
- // Resources use the unrelocated image; validate the relocation metadata
- // without changing pointers to depend on a DOS load address.
- while (!reader.getError()) {
- const uint count = reader.readByte();
- if (count == 0)
- return;
- const uint32 segment = reader.readWord();
- for (uint i = 0; i < count && !reader.getError(); ++i) {
- const uint32 offset = reader.readWord();
- const uint32 location = segment * 16 + offset;
- if (location >= imageSize || imageSize - location < 2)
- reader.fail("Relocation outside resident image");
- }
- }
-}
-
-} // End of anonymous namespace
-
-bool unpackSpanishFloppyExe(const byte *input, uint32 size,
- Common::Array<byte> &image, Common::String &error) {
- image.clear();
- error.clear();
- if (!input || size != kSupportedFileSize || Common::CRC32().crcFast(input, size) != kSupportedCRC32) {
- error = "Unsupported packed Spanish floppy executable";
- return false;
- }
-
- Common::Array<byte> decoded;
- decoded.resize(size);
- memcpy(decoded.data(), input, size);
- // Restore the encoded prefix used by the native word transform.
- decoded[0] = 0xcc;
- decoded[1] = 0x2f;
- decoded[2] = 0x3f;
- uint16 key = 0x3ad8;
- for (uint32 i = 0; i < kEncodedWordBytes; i += 2) {
- const uint16 difference = uint16(READ_LE_UINT16(decoded.data() + i) - key);
- key = difference;
- WRITE_LE_UINT16(decoded.data() + i, uint16((difference << 1) | (difference >> 15)));
- }
-
- UnpackReader reader(decoded);
- Common::Array<byte> result;
- result.reserve(kImageSize);
- bool ended = false;
- for (uint32 token = 0; token < size * 2 && !reader.getError(); ++token) {
- if (reader.bit() == 0) {
- if (result.size() == kImageSize) {
- reader.fail("Resident image exceeds supported size");
- break;
- }
- result.push_back(reader.readByte());
- continue;
- }
-
- uint length = matchLength(reader);
- if (length == 25) {
- const uint extension = reader.readByte();
- if (extension >= 254) {
- if (extension == 255) {
- ended = true;
- break;
- }
- // Segment refresh changes address representation only.
- continue;
- }
- length += extension;
- }
- if (length < 2 || length > kImageSize - result.size()) {
- reader.fail("Invalid match length");
- break;
- }
- const uint distance = matchDistance(reader, length);
- if (distance == 0 || distance > result.size()) {
- reader.fail("Invalid match distance");
- break;
- }
- for (uint i = 0; i < length; ++i)
- result.push_back(result[result.size() - distance]);
- }
- if (!ended || result.size() != kImageSize)
- reader.fail("Incomplete resident image");
- if (!reader.getError())
- checkRelocations(reader, result.size());
- if (reader.getError()) {
- error = reader.getError();
- return false;
- }
- image.swap(result);
- return true;
-}
-
-} // End of namespace Igor
diff --git a/engines/igor/unpack.h b/engines/igor/unpack.h
deleted file mode 100644
index da3608bf3e5..00000000000
--- a/engines/igor/unpack.h
+++ /dev/null
@@ -1,41 +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 3 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, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifndef IGOR_UNPACK_H
-#define IGOR_UNPACK_H
-
-#include "common/array.h"
-#include "common/str.h"
-
-namespace Igor {
-
-enum {
- kSpanishFloppyExeImageSize = 120864
-};
-
-// Reconstructs the resident image without applying load-address relocations.
-// Resource offsets are relative to this image. No game code is executed.
-bool unpackSpanishFloppyExe(const byte *input, uint32 size,
- Common::Array<byte> &image, Common::String &error);
-
-} // End of namespace Igor
-
-#endif
Commit: eb25b0fc262aca0757fe6d1d0a2ff585301a88f9
https://github.com/scummvm/scummvm/commit/eb25b0fc262aca0757fe6d1d0a2ff585301a88f9
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:26+01:00
Commit Message:
IGOR: Fix credits
Changed paths:
engines/igor/credits.pl
diff --git a/engines/igor/credits.pl b/engines/igor/credits.pl
index 2f061d84faa..076ba8c413e 100644
--- a/engines/igor/credits.pl
+++ b/engines/igor/credits.pl
@@ -1,3 +1,4 @@
begin_section("Igor");
- add_person("Name 1", "Handle 1", "");
+ add_person("Gabriel SanmartÃn", "kelmer", "engine implementation");
+ add_person("Gregory Montoir", "cyx", "original engine foundation & demo support");
end_section();
Commit: 89505984e4ee37409d1ac7247e4688a651e48c5e
https://github.com/scummvm/scummvm/commit/89505984e4ee37409d1ac7247e4688a651e48c5e
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:27+01:00
Commit Message:
IGOR: Sort header declarations
Changed paths:
engines/igor/copy_protection.cpp
engines/igor/detection.cpp
engines/igor/floppy_font.cpp
engines/igor/font.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/metaengine.cpp
engines/igor/midi.cpp
engines/igor/midi.h
engines/igor/options.cpp
engines/igor/palette.cpp
engines/igor/part_main.cpp
engines/igor/parts/part_0.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_18.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_22.cpp
engines/igor/parts/part_23.cpp
engines/igor/parts/part_24.cpp
engines/igor/parts/part_25.cpp
engines/igor/parts/part_26.cpp
engines/igor/parts/part_27.cpp
engines/igor/parts/part_28.cpp
engines/igor/parts/part_32.cpp
engines/igor/parts/part_4.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_69.cpp
engines/igor/parts/part_70.cpp
engines/igor/parts/part_71.cpp
engines/igor/parts/part_72.cpp
engines/igor/parts/part_73.cpp
engines/igor/parts/part_74.cpp
engines/igor/parts/part_76.cpp
engines/igor/parts/part_77.cpp
engines/igor/parts/part_78.cpp
engines/igor/parts/part_79.cpp
engines/igor/parts/part_80.cpp
engines/igor/parts/part_81.cpp
engines/igor/parts/part_85.cpp
engines/igor/parts/part_90.cpp
engines/igor/parts/part_95.cpp
engines/igor/parts/part_credits.cpp
engines/igor/resource.cpp
engines/igor/room.cpp
engines/igor/sound.cpp
engines/igor/text.cpp
diff --git a/engines/igor/copy_protection.cpp b/engines/igor/copy_protection.cpp
index 261a3bd73d7..2fded56195c 100644
--- a/engines/igor/copy_protection.cpp
+++ b/engines/igor/copy_protection.cpp
@@ -21,8 +21,9 @@
#include "common/config-manager.h"
#include "common/events.h"
-#include "igor/igor.h"
+
#include "igor/floppy_menu.h"
+#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/detection.cpp b/engines/igor/detection.cpp
index 089c39d9b39..e67e582f6cd 100644
--- a/engines/igor/detection.cpp
+++ b/engines/igor/detection.cpp
@@ -26,6 +26,7 @@
#include "common/str-array.h"
#include "common/translation.h"
#include "common/util.h"
+
#include "igor/detection.h"
#include "igor/detection_tables.h"
diff --git a/engines/igor/floppy_font.cpp b/engines/igor/floppy_font.cpp
index 39278ab0d18..98a81c24502 100644
--- a/engines/igor/floppy_font.cpp
+++ b/engines/igor/floppy_font.cpp
@@ -19,9 +19,10 @@
*
*/
-#include "igor/floppy_font.h"
#include "graphics/surface.h"
+#include "igor/floppy_font.h"
+
namespace Igor {
// Static font data
diff --git a/engines/igor/font.cpp b/engines/igor/font.cpp
index fb1a2f68180..72324eaa970 100644
--- a/engines/igor/font.cpp
+++ b/engines/igor/font.cpp
@@ -19,9 +19,10 @@
*
*/
-#include "igor/font.h"
#include "graphics/surface.h"
+#include "igor/font.h"
+
namespace Igor {
// Static font data
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index eca283d6b47..480e5c9a2ef 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -26,9 +26,9 @@
#include "common/system.h"
#include "engines/util.h"
-#include "igor/igor.h"
#include "igor/console.h"
#include "igor/detection.h"
+#include "igor/igor.h"
#include "igor/midi.h"
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 7e05f4c8fdf..36fc30ed5a6 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -22,6 +22,9 @@
#ifndef IGOR_H
#define IGOR_H
+#include "audio/mididrv_ms.h"
+#include "audio/midiparser.h"
+#include "audio/mixer.h"
#include "common/error.h"
#include "common/events.h"
#include "common/file.h"
@@ -37,13 +40,9 @@
#include "engines/savestate.h"
#include "graphics/screen.h"
-#include "audio/mididrv_ms.h"
-#include "audio/midiparser.h"
-#include "audio/mixer.h"
-
#include "igor/detection.h"
-#include "igor/font.h"
#include "igor/floppy_font.h"
+#include "igor/font.h"
#include "igor/resource_ids.h"
namespace Igor {
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 41328a22974..ac5d08cb3d2 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -23,6 +23,7 @@
#include "common/events.h"
#include "common/system.h"
#include "graphics/cursorman.h"
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/metaengine.cpp b/engines/igor/metaengine.cpp
index ed492cb650b..bd7eada421c 100644
--- a/engines/igor/metaengine.cpp
+++ b/engines/igor/metaengine.cpp
@@ -21,9 +21,9 @@
#include "common/translation.h"
-#include "igor/metaengine.h"
#include "igor/detection.h"
#include "igor/igor.h"
+#include "igor/metaengine.h"
namespace Igor {
diff --git a/engines/igor/midi.cpp b/engines/igor/midi.cpp
index 0bc956d63e5..c1847afb03d 100644
--- a/engines/igor/midi.cpp
+++ b/engines/igor/midi.cpp
@@ -18,8 +18,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "common/endian.h"
#include "common/textconsole.h"
+
#include "igor/midi.h"
#ifndef DISABLE_NUKED_OPL
diff --git a/engines/igor/midi.h b/engines/igor/midi.h
index bdf7ea61701..8bcc0368494 100644
--- a/engines/igor/midi.h
+++ b/engines/igor/midi.h
@@ -21,13 +21,12 @@
#ifndef IGOR_MIDI_H
#define IGOR_MIDI_H
-#include "common/util.h"
-#include "common/mutex.h"
-
#include "audio/fmopl.h"
-#include "audio/softsynth/emumidi.h"
#include "audio/mididrv.h"
#include "audio/midiparser.h"
+#include "audio/softsynth/emumidi.h"
+#include "common/mutex.h"
+#include "common/util.h"
namespace Igor {
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 2382818a02c..76715bfd958 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -18,13 +18,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "audio/softsynth/pcspk.h"
#include "common/config-manager.h"
#include "common/events.h"
#include "graphics/scaler.h"
-#include "igor/igor.h"
#include "igor/floppy_menu.h"
+#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index bbc38bc97e4..296caae0f3d 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -19,11 +19,12 @@
*
*/
-#include "igor/igor.h"
#include "common/debug-channels.h"
#include "common/system.h"
#include "graphics/paletteman.h"
+#include "igor/igor.h"
+
namespace Igor {
void IgorEngine::setupDefaultPalette() {
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 30b9832f0de..eb4800e7cbf 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index 7eaf322b0d1..bde425e5ffc 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 266eaba10dc..e74be01b4ec 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 8659bd61a18..e8ab12f50ac 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index bd67238c398..1ed6df69074 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index 2de1050b6b6..01353be805e 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index a53b2ed9a11..07b4ee82719 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp
index 98dda32e896..ddeb8137ace 100644
--- a/engines/igor/parts/part_22.cpp
+++ b/engines/igor/parts/part_22.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_23.cpp b/engines/igor/parts/part_23.cpp
index 18afb99edcb..f0668de6481 100644
--- a/engines/igor/parts/part_23.cpp
+++ b/engines/igor/parts/part_23.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp
index 479a36a3250..d5b48206099 100644
--- a/engines/igor/parts/part_24.cpp
+++ b/engines/igor/parts/part_24.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index 6d451bf6536..0473040cfa7 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index e27f8574e9a..8206a5eb235 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index cc315bc86e7..f334c946b24 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index cff8660bbab..f5ec2e32f1f 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
diff --git a/engines/igor/parts/part_32.cpp b/engines/igor/parts/part_32.cpp
index d521fbc22e2..7ed35faaaaa 100644
--- a/engines/igor/parts/part_32.cpp
+++ b/engines/igor/parts/part_32.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index ee2b21d45a3..a9a4cd9e80e 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index da4d1101042..50237c28e07 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index faa504ef062..1a7d5e12685 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 93d9295688e..c4f5f04640d 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_69.cpp b/engines/igor/parts/part_69.cpp
index eaa814f9b17..d9a71bb2cc4 100644
--- a/engines/igor/parts/part_69.cpp
+++ b/engines/igor/parts/part_69.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_70.cpp b/engines/igor/parts/part_70.cpp
index 2b095f07aff..b057f49afeb 100644
--- a/engines/igor/parts/part_70.cpp
+++ b/engines/igor/parts/part_70.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_71.cpp b/engines/igor/parts/part_71.cpp
index 58d526d802f..d34b266abf3 100644
--- a/engines/igor/parts/part_71.cpp
+++ b/engines/igor/parts/part_71.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
index 8a302dfe437..dc93df7e680 100644
--- a/engines/igor/parts/part_72.cpp
+++ b/engines/igor/parts/part_72.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_73.cpp b/engines/igor/parts/part_73.cpp
index cf8163899c8..9b1b059c281 100644
--- a/engines/igor/parts/part_73.cpp
+++ b/engines/igor/parts/part_73.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_74.cpp b/engines/igor/parts/part_74.cpp
index aeac0c92e61..2f0b73d9c2d 100644
--- a/engines/igor/parts/part_74.cpp
+++ b/engines/igor/parts/part_74.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_76.cpp b/engines/igor/parts/part_76.cpp
index e673c3a3506..2fa21571742 100644
--- a/engines/igor/parts/part_76.cpp
+++ b/engines/igor/parts/part_76.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_77.cpp b/engines/igor/parts/part_77.cpp
index ccd5a42995a..53a8fb0f0e3 100644
--- a/engines/igor/parts/part_77.cpp
+++ b/engines/igor/parts/part_77.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_78.cpp b/engines/igor/parts/part_78.cpp
index e6d9a060c6e..5316de948d3 100644
--- a/engines/igor/parts/part_78.cpp
+++ b/engines/igor/parts/part_78.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_79.cpp b/engines/igor/parts/part_79.cpp
index e8d53e7fab6..8756c60264e 100644
--- a/engines/igor/parts/part_79.cpp
+++ b/engines/igor/parts/part_79.cpp
@@ -18,7 +18,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "common/system.h"
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_80.cpp b/engines/igor/parts/part_80.cpp
index 7a6ac51cbb5..4a8a083ec20 100644
--- a/engines/igor/parts/part_80.cpp
+++ b/engines/igor/parts/part_80.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index 2c007695a7a..a7521492d91 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_85.cpp b/engines/igor/parts/part_85.cpp
index d2cb9416fec..6b720e479b1 100644
--- a/engines/igor/parts/part_85.cpp
+++ b/engines/igor/parts/part_85.cpp
@@ -18,9 +18,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-#include "igor/igor.h"
+
#include "common/system.h"
+#include "igor/igor.h"
+
namespace Igor {
static int VAR_CURRENT_TALKING_ACTOR;
diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp
index 9ba795a87ac..64b6c0aaee3 100644
--- a/engines/igor/parts/part_90.cpp
+++ b/engines/igor/parts/part_90.cpp
@@ -18,7 +18,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "common/system.h"
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/parts/part_95.cpp b/engines/igor/parts/part_95.cpp
index 2f3e44debd2..175cd0bf2a5 100644
--- a/engines/igor/parts/part_95.cpp
+++ b/engines/igor/parts/part_95.cpp
@@ -18,9 +18,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
-#include "igor/igor.h"
+
#include "common/system.h"
+#include "igor/igor.h"
+
namespace Igor {
struct SharewareScreenString {
diff --git a/engines/igor/parts/part_credits.cpp b/engines/igor/parts/part_credits.cpp
index d6cb14427e9..341b0c73ff2 100644
--- a/engines/igor/parts/part_credits.cpp
+++ b/engines/igor/parts/part_credits.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index baec9f5cbb2..a5cce149bf1 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -19,9 +19,10 @@
*
*/
-#include "igor/igor.h"
#include "common/debug-channels.h"
+#include "igor/igor.h"
+
namespace Igor {
void IgorEngine::readTableFile() {
diff --git a/engines/igor/room.cpp b/engines/igor/room.cpp
index 6966c04c6b4..0aed936ae89 100644
--- a/engines/igor/room.cpp
+++ b/engines/igor/room.cpp
@@ -19,9 +19,10 @@
*
*/
-#include "igor/igor.h"
#include "common/debug-channels.h"
+#include "igor/igor.h"
+
namespace Igor {
/**
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index 9d897082da8..ea9b6f5ceb7 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "audio/decoders/raw.h"
#include "audio/decoders/voc.h"
#include "backends/audiocd/audiocd.h"
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index d8f025b7445..84ffbea678a 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
+
#include "igor/igor.h"
namespace Igor {
Commit: a4778fbf8a53e1540ae40ab5aaa095f87088ff77
https://github.com/scummvm/scummvm/commit/a4778fbf8a53e1540ae40ab5aaa095f87088ff77
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:27+01:00
Commit Message:
IGOR: Disallow loading when saving is not allowed (except splash screen and credits)
Changed paths:
engines/igor/igor.h
engines/igor/parts/part_90.cpp
engines/igor/parts/part_credits.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 36fc30ed5a6..33686c0911d 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -730,6 +730,8 @@ private:
int16 _currentPart;
bool _canSaveGame = true;
+ // Sequences that block saving but still open the options menu (title, credits)
+ bool _optionsMenuReachable = false;
Graphics::Surface _optionsMenuThumbnail;
int _talkDelay;
int _talkSpeechCounter;
@@ -1958,7 +1960,8 @@ public:
};
bool canLoadGameStateCurrently(Common::U32String *msg = nullptr) override {
- return true;
+ // Loading is only possible where the original lets the player open the options menu
+ return _canSaveGame || _optionsMenuReachable;
}
bool canSaveGameStateCurrently(Common::U32String *msg = nullptr) override {
return _canSaveGame;
diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp
index 64b6c0aaee3..58eb311b0d0 100644
--- a/engines/igor/parts/part_90.cpp
+++ b/engines/igor/parts/part_90.cpp
@@ -60,6 +60,8 @@ enum {
* Returns false if the game was loaded or quit meanwhile.
*/
bool IgorEngine::part90Hold(uint16 duration, int skipMode, bool optionsMenu) {
+ const bool menuWasReachable = _optionsMenuReachable;
+ _optionsMenuReachable = optionsMenu;
_inputVars[kInputSkipDialogue] = 0;
_inputVars[kInputEscape] = 0;
_inputVars[kInputOptions] = 0;
@@ -118,6 +120,7 @@ bool IgorEngine::part90Hold(uint16 duration, int skipMode, bool optionsMenu) {
_inputVars[kInputRightClick] = 0;
_inputVars[kInputOptions] = 0;
}
+ _optionsMenuReachable = menuWasReachable;
return !_gameStateLoaded && !_eventQuitGame && _currentPart != kInvalidPart;
}
diff --git a/engines/igor/parts/part_credits.cpp b/engines/igor/parts/part_credits.cpp
index 341b0c73ff2..6d4468ebb7b 100644
--- a/engines/igor/parts/part_credits.cpp
+++ b/engines/igor/parts/part_credits.cpp
@@ -76,6 +76,7 @@ void IgorEngine::partCreditsDrawText(int x, int y, uint8 color, bool underline,
void IgorEngine::partCredits() {
const bool savingWasAllowed = _canSaveGame;
_canSaveGame = false;
+ _optionsMenuReachable = true;
const CreditsPage &page = kCreditsPages[(_currentPart - 910) / 10];
if (isCDVersion())
@@ -146,6 +147,7 @@ void IgorEngine::partCredits() {
fadeOut(768);
SET_PAL_208_96_1();
_canSaveGame = savingWasAllowed;
+ _optionsMenuReachable = false;
return;
}
@@ -157,6 +159,7 @@ void IgorEngine::partCredits() {
_currentPart += 10;
}
_canSaveGame = savingWasAllowed;
+ _optionsMenuReachable = false;
}
} // End of namespace Igor
Commit: 2d1487c6533d19448ec00943b0f7c53fb9b79a87
https://github.com/scummvm/scummvm/commit/2d1487c6533d19448ec00943b0f7c53fb9b79a87
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:27+01:00
Commit Message:
IGOR: Add devtool to generate IGOR.TBL
Changed paths:
A devtools/create_igor/create_igortbl.cpp
A devtools/create_igor/exe_blobs.h
A devtools/create_igor/fsd_en_demo.h
A devtools/create_igor/fsd_en_floppy.h
A devtools/create_igor/fsd_sp_cdrom.h
A devtools/create_igor/fsd_sp_floppy.h
A devtools/create_igor/module.mk
A devtools/create_igor/resource_en_demo100.h
A devtools/create_igor/resource_en_demo110.h
A devtools/create_igor/resource_en_floppy.h
A devtools/create_igor/resource_ids.h
A devtools/create_igor/resource_sp_cdrom.h
A devtools/create_igor/resource_sp_floppy.h
A devtools/create_igor/strings.h
.gitignore
devtools/create_project/create_project.cpp
diff --git a/.gitignore b/.gitignore
index 4471e936a79..28752e7173d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -157,6 +157,7 @@ project.xcworkspace
/devtools/create_drascula/create_drascula
/devtools/create_glk/create_glk
/devtools/create_hugo/create_hugo
+/devtools/create_igor/create_igortbl
/devtools/create_kyradat/create_kyradat
/devtools/create_lure/create_lure
/devtools/create_mm/create_xeen/create_mm
diff --git a/devtools/create_igor/create_igortbl.cpp b/devtools/create_igor/create_igortbl.cpp
new file mode 100644
index 00000000000..f0a634d1e38
--- /dev/null
+++ b/devtools/create_igor/create_igortbl.cpp
@@ -0,0 +1,369 @@
+/* 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 "resource_ids.h"
+
+/*
+ uint32 : 'ITBL'
+ uint32 : version/tag (6; the engine also reads versions 4 and 5)
+ 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
+ }
+ embedded data blobs (version 6), referenced by resource entries with source 2
+ repeat (number of resources tables) {
+ uint16 : number of entries
+ repeat (number of entries) {
+ uint16 : id
+ uint32 : offset (source 2: absolute offset inside this file)
+ uint32 : length
+ uint8 : source (0: resource container, 2: embedded in this file)
+ }
+ }
+ 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 16
+#define TABLE_SIZE(x) (sizeof(x)/sizeof(x[0]))
+
+typedef unsigned char uint8;
+typedef unsigned short uint16;
+typedef unsigned int uint32;
+
+// Where the data of a resource is read from. Catalog rows leave it out for the
+// resource container (the version's overlay file).
+enum {
+ SOURCE_CONTAINER = 0,
+ SOURCE_TBL = 2 // data embedded in IGOR.TBL (see _embeddedBlobs)
+};
+
+struct ResourceEntry {
+ int id;
+ uint32 offs;
+ uint32 size;
+ uint8 source;
+};
+
+static struct ResourceEntry _resourceEntriesEngDemo100[] = {
+#include "resource_en_demo100.h"
+};
+
+static struct ResourceEntry _resourceEntriesEngDemo110[] = {
+#include "resource_en_demo110.h"
+};
+
+static struct ResourceEntry _resourceEntriesEngFloppy[] = {
+#include "resource_en_floppy.h"
+};
+
+static struct ResourceEntry _resourceEntriesSpaCd[] = {
+#include "resource_sp_cdrom.h"
+};
+
+static struct ResourceEntry _resourceEntriesSpaFloppy[] = {
+#include "resource_sp_floppy.h"
+};
+
+static struct {
+ struct ResourceEntry *p;
+ int count;
+} _resourceEntriesList[] = {
+ { _resourceEntriesEngDemo100, TABLE_SIZE(_resourceEntriesEngDemo100) },
+ { _resourceEntriesEngDemo110, TABLE_SIZE(_resourceEntriesEngDemo110) },
+ { _resourceEntriesEngFloppy, TABLE_SIZE(_resourceEntriesEngFloppy) },
+ { _resourceEntriesSpaCd, TABLE_SIZE(_resourceEntriesSpaCd) },
+ { _resourceEntriesSpaFloppy, TABLE_SIZE(_resourceEntriesSpaFloppy) },
+ { 0, 0 }
+};
+
+static const uint32 _soundEntriesEngDemo[] = {
+#include "fsd_en_demo.h"
+};
+
+static const uint32 _soundEntriesEngFloppy[] = {
+#include "fsd_en_floppy.h"
+};
+
+static const uint32 _soundEntriesSpaCd[] = {
+#include "fsd_sp_cdrom.h"
+};
+
+static const uint32 _soundEntriesSpaFloppy[] = {
+#include "fsd_sp_floppy.h"
+};
+
+static struct {
+ const uint32 *p;
+ int count;
+} _soundEntriesList[] = {
+ { _soundEntriesEngDemo, TABLE_SIZE(_soundEntriesEngDemo) },
+ { _soundEntriesEngFloppy, TABLE_SIZE(_soundEntriesEngFloppy) },
+ { _soundEntriesSpaCd, TABLE_SIZE(_soundEntriesSpaCd) },
+ { _soundEntriesSpaFloppy, TABLE_SIZE(_soundEntriesSpaFloppy) },
+ { 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 },
+ { 11199335, _resourceEntriesSpaFloppy, _soundEntriesSpaFloppy },
+ { 8819339, _resourceEntriesEngFloppy, _soundEntriesEngFloppy }
+};
+
+static const uint32 ITBL_TAG = 0x4954424C;
+static const uint32 CURRENT_VERSION = 6;
+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;
+}
+
+// Data that the game keeps outside its resource container (text tables of the
+// Spanish floppy executable). It is stored in the file right after the header and
+// referenced by the resource rows marked SOURCE_TBL.
+#include "exe_blobs.h"
+
+struct EmbeddedBlob {
+ int id;
+ const unsigned char *data;
+ uint32 size;
+ uint32 offset;
+};
+
+static struct EmbeddedBlob _embeddedBlobs[] = {
+ { TXT_MainTable, TXT_MainTable_data, sizeof(TXT_MainTable_data), 0 },
+ { TXT_MainVerbs, TXT_MainVerbs_data, sizeof(TXT_MainVerbs_data), 0 },
+ { DAT_FloppySentenceColors, DAT_FloppySentenceColors_data, sizeof(DAT_FloppySentenceColors_data), 0 }
+};
+
+static void writeEmbeddedBlobs(FILE *fp) {
+ unsigned i;
+ for (i = 0; i < TABLE_SIZE(_embeddedBlobs); ++i) {
+ _embeddedBlobs[i].offset = ftell(fp);
+ fwrite(_embeddedBlobs[i].data, 1, _embeddedBlobs[i].size, fp);
+ }
+}
+
+static const struct EmbeddedBlob *findEmbeddedBlob(int id) {
+ unsigned i;
+ for (i = 0; i < TABLE_SIZE(_embeddedBlobs); ++i) {
+ if (_embeddedBlobs[i].id == id) {
+ return &_embeddedBlobs[i];
+ }
+ }
+ assert(0);
+ return 0;
+}
+
+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) {
+ uint32 offs = re->offs, size = re->size;
+ if (re->source == SOURCE_TBL) {
+ const struct EmbeddedBlob *blob = findEmbeddedBlob(re->id);
+ assert(blob->size == size);
+ offs = blob->offset;
+ }
+ writeUint16BE(fp, re->id);
+ writeUint32BE(fp, offs);
+ writeUint32BE(fp, size);
+ writeByte(fp, re->source);
+ }
+}
+
+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 */
+ }
+
+ /* embedded data */
+ writeEmbeddedBlobs(fp);
+
+ /* 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; i < (int)TABLE_SIZE(_soundEntriesList); ++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/devtools/create_igor/exe_blobs.h b/devtools/create_igor/exe_blobs.h
new file mode 100644
index 00000000000..a1df7426112
--- /dev/null
+++ b/devtools/create_igor/exe_blobs.h
@@ -0,0 +1,1669 @@
+// Data taken from the Spanish floppy executable that the game keeps outside its
+// resource container. Embedded here so the tool needs no external input files.
+
+static const unsigned char TXT_MainTable_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x05, 0x20, 0x63, 0x6f, 0x6e, 0x20, 0x00, 0x06, 0x20, 0x77,
+ 0x69, 0x74, 0x68, 0x20, 0x03, 0x20, 0x61, 0x20, 0x00, 0x00, 0x00, 0x04,
+ 0x20, 0x74, 0x6f, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x62, 0x6f, 0x6f,
+ 0x6d, 0x65, 0x72, 0x61, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x06, 0x61, 0x6d, 0x75, 0x6c, 0x65, 0x74, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x63,
+ 0x61, 0x72, 0x74, 0x65, 0x72, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0a, 0x70, 0x61, 0x72, 0x61, 0x63, 0x61, 0x69, 0x64, 0x61, 0x73, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x69, 0x64, 0x20, 0x63,
+ 0x61, 0x72, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x08, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x64, 0x61, 0x73, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x74, 0x69,
+ 0x63, 0x6b, 0x65, 0x74, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74,
+ 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
+ 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x20, 0x64, 0x69, 0x73, 0x63,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x64, 0x65, 0x73, 0x70, 0x65,
+ 0x72, 0x74, 0x61, 0x64, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x0b, 0x61, 0x6c, 0x61, 0x72, 0x6d, 0x20, 0x63, 0x6c, 0x6f, 0x63,
+ 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x63, 0x61, 0x7a,
+ 0x61, 0x6d, 0x61, 0x72, 0x69, 0x70, 0x6f, 0x73, 0x61, 0x73, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x0e, 0x62, 0x75, 0x74, 0x74, 0x65, 0x72, 0x66, 0x6c,
+ 0x79, 0x20, 0x74, 0x72, 0x61, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x63,
+ 0x61, 0x6a, 0x61, 0x20, 0x64, 0x65, 0x20, 0x63, 0x65, 0x72, 0x69, 0x6c,
+ 0x6c, 0x61, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x20,
+ 0x62, 0x6f, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x6d, 0x61, 0x72, 0x74, 0x69, 0x6c, 0x6c, 0x6f, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x68, 0x61, 0x6d, 0x6d,
+ 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x70, 0x69, 0x63, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x70, 0x69,
+ 0x63, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x07, 0x62, 0x61, 0x72, 0x72, 0x65, 0x6e, 0x6f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x64, 0x79, 0x6e, 0x61, 0x6d, 0x69, 0x74, 0x65, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x68, 0x6f, 0x72, 0x71, 0x75,
+ 0x69, 0x6c, 0x6c, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x68, 0x61, 0x69, 0x72, 0x70, 0x69, 0x6e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6c, 0x69, 0x62,
+ 0x72, 0x6f, 0x20, 0x64, 0x65, 0x6c, 0x20, 0x64, 0x65, 0x63, 0x61, 0x6e,
+ 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x04, 0x62, 0x6f, 0x6f, 0x6b, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x64,
+ 0x69, 0x73, 0x66, 0x72, 0x61, 0x7a, 0x20, 0x64, 0x65, 0x20, 0x6d, 0x6f,
+ 0x6e, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x6d, 0x6f, 0x6e, 0x6b, 0x65, 0x79,
+ 0x20, 0x58, 0x58, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x09, 0x70, 0x65, 0x72, 0x69, 0xa2, 0x64, 0x69, 0x63, 0x6f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x6e, 0x65, 0x77, 0x73,
+ 0x70, 0x61, 0x70, 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x07, 0x6c, 0x6c, 0x61, 0x76, 0x65, 0x72, 0x6f, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x58, 0x58,
+ 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x0b, 0x68, 0x61, 0x6d, 0x62, 0x75, 0x72, 0x67,
+ 0x75, 0x65, 0x73, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a,
+ 0x68, 0x61, 0x6d, 0x62, 0x75, 0x72, 0x67, 0x75, 0x65, 0x72, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x62, 0x61, 0x62, 0x6f, 0x73,
+ 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x04, 0x73, 0x6c, 0x75, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x66, 0x6f, 0x74,
+ 0x6f, 0x67, 0x72, 0x61, 0x66, 0xa1, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x70,
+ 0x72, 0x6f, 0x62, 0x65, 0x74, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x58, 0x58, 0x58, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0e, 0x6e, 0x6f, 0x74, 0x61, 0x20, 0x64, 0x65, 0x20, 0x50, 0x68, 0x69,
+ 0x6c, 0x69, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x58, 0x58, 0x58, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x13, 0x63, 0x61, 0x72, 0x70, 0x65, 0x74, 0x61, 0x20, 0x64,
+ 0x65, 0x20, 0x43, 0x61, 0x72, 0x6f, 0x6c, 0x69, 0x6e, 0x65, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x58, 0x58,
+ 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x11, 0x62, 0x6f, 0x74, 0x65, 0x6c, 0x6c, 0x61,
+ 0x20, 0x64, 0x65, 0x20, 0x77, 0x68, 0x69, 0x73, 0x6b, 0x79, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d,
+ 0x77, 0x68, 0x69, 0x73, 0x6b, 0x79, 0x20, 0x62, 0x6f, 0x74, 0x74, 0x6c,
+ 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x6c, 0x61, 0x67, 0x61, 0x72,
+ 0x74, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x03, 0x58, 0x58, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x74, 0x65, 0x73,
+ 0x6f, 0x72, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x03, 0x58, 0x58, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x63,
+ 0x6f, 0x68, 0x65, 0x74, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x58, 0x58, 0x58, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x72, 0x65, 0x73, 0x69, 0x6e, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x58, 0x58, 0x58, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x09, 0x70, 0x65, 0x72, 0x67, 0x61, 0x6d, 0x69, 0x6e, 0x6f,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x58, 0x58,
+ 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x14, 0x6e, 0x6f, 0x74, 0x61, 0x20, 0x64, 0x65,
+ 0x6c, 0x20, 0x22, 0x43, 0x6f, 0x6d, 0x61, 0x64, 0x72, 0x65, 0x6a, 0x61,
+ 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+ 0x58, 0x58, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x62, 0x6f, 0x6c, 0xa1, 0x67,
+ 0x72, 0x61, 0x66, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x03, 0x58, 0x58, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x6c, 0x69, 0x62,
+ 0x72, 0x6f, 0x20, 0x64, 0x65, 0x20, 0x61, 0x73, 0x74, 0x72, 0x6f, 0x6e,
+ 0x6f, 0x6d, 0xa1, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x03, 0x58, 0x58, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x6e,
+ 0x6f, 0x74, 0x61, 0x20, 0x64, 0x65, 0x20, 0x6c, 0x61, 0x20, 0x70, 0x61,
+ 0x70, 0x65, 0x6c, 0x65, 0x72, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x58, 0x58, 0x58, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x66, 0x6c, 0x6f, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x58, 0x58, 0x58, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x06, 0x6a, 0x61, 0x72, 0x72, 0xa2, 0x6e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x58, 0x58,
+ 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x13, 0x74, 0x72, 0x61, 0x62, 0x61, 0x6a, 0x6f,
+ 0x20, 0x64, 0x65, 0x20, 0x62, 0x69, 0x6f, 0x6c, 0x6f, 0x67, 0xa1, 0x61,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
+ 0x58, 0x58, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x63, 0xa0, 0x6d, 0x61, 0x72,
+ 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x06, 0x63, 0x61, 0x6d, 0x65, 0x72, 0x61, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xad, 0x48, 0x6f,
+ 0x6c, 0x61, 0x21, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04,
+ 0x48, 0x69, 0x21, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x4e, 0x6f, 0x20, 0x63, 0x72, 0x65, 0x6f, 0x20, 0x71,
+ 0x75, 0x65, 0x20, 0x6d, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x73,
+ 0x74, 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x49, 0x20, 0x77, 0x6f, 0x6e, 0x25,
+ 0x74, 0x20, 0x67, 0x65, 0x74, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x61, 0x6e,
+ 0x73, 0x77, 0x65, 0x72, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0xa8, 0x43, 0xa2,
+ 0x6d, 0x6f, 0x20, 0x76, 0x61, 0x20, 0x65, 0x73, 0x6f, 0x3f, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c,
+ 0x48, 0x6f, 0x77, 0x20, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x3f, 0x2e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0e, 0x4e, 0x6f, 0x20, 0x6c, 0x65, 0x20, 0x63, 0x6f, 0x6e,
+ 0x6f, 0x7a, 0x63, 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x49, 0x20, 0x64, 0x6f, 0x6e, 0x25,
+ 0x74, 0x20, 0x6b, 0x6e, 0x6f, 0x77, 0x20, 0x68, 0x69, 0x6d, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x4e, 0x6f, 0x20,
+ 0x6c, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x6f, 0x7a, 0x63, 0x6f, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11,
+ 0x49, 0x20, 0x64, 0x6f, 0x6e, 0x25, 0x74, 0x20, 0x6b, 0x6e, 0x6f, 0x77,
+ 0x20, 0x68, 0x65, 0x72, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x12, 0x4e, 0x6f, 0x20, 0x73, 0x65, 0x20, 0x70, 0x75, 0x65,
+ 0x64, 0x65, 0x20, 0x63, 0x6f, 0x67, 0x65, 0x72, 0x2e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x49, 0x20, 0x63, 0x61, 0x6e, 0x25,
+ 0x74, 0x20, 0x67, 0x65, 0x74, 0x20, 0x69, 0x74, 0x2e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x59, 0x61, 0x20,
+ 0x6c, 0x6f, 0x20, 0x74, 0x65, 0x6e, 0x67, 0x6f, 0x2e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+ 0x49, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x68, 0x61,
+ 0x76, 0x65, 0x20, 0x69, 0x74, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0a, 0x49, 0x6d, 0x70, 0x6f, 0x73, 0x69, 0x62, 0x6c, 0x65,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x49, 0x6d, 0x70, 0x6f, 0x73, 0x73,
+ 0x69, 0x62, 0x6c, 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x50, 0x65, 0x73,
+ 0x61, 0x20, 0x64, 0x65, 0x6d, 0x61, 0x73, 0x69, 0x61, 0x64, 0x6f, 0x2e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f,
+ 0x49, 0x74, 0x25, 0x73, 0x20, 0x74, 0x6f, 0x6f, 0x20, 0x68, 0x65, 0x61,
+ 0x76, 0x79, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x14, 0x45, 0x73, 0x20, 0x64, 0x65, 0x6d, 0x61, 0x73, 0x69,
+ 0x61, 0x64, 0x6f, 0x20, 0x67, 0x72, 0x61, 0x6e, 0x64, 0x65, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x74, 0x25, 0x73, 0x20, 0x74,
+ 0x6f, 0x6f, 0x20, 0x62, 0x69, 0x67, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x4e, 0x6f, 0x20,
+ 0x66, 0x75, 0x6e, 0x63, 0x69, 0x6f, 0x6e, 0x61, 0x2e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
+ 0x49, 0x74, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x25, 0x74, 0x20, 0x77,
+ 0x6f, 0x72, 0x6b, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x12, 0x4e, 0x6f, 0x20, 0x76, 0x61, 0x20, 0x61, 0x20, 0x66,
+ 0x75, 0x6e, 0x63, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x2e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x49, 0x74, 0x20, 0x64, 0x6f, 0x65,
+ 0x73, 0x6e, 0x25, 0x74, 0x20, 0x73, 0x65, 0x65, 0x6d, 0x20, 0x74, 0x6f,
+ 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x4e, 0x6f, 0x20,
+ 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x67, 0x75, 0x69, 0x72, 0x82, 0x20, 0x6e,
+ 0x61, 0x64, 0x61, 0x20, 0x63, 0x6f, 0x6e, 0x20, 0x65, 0x73, 0x6f, 0x2e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17,
+ 0x49, 0x74, 0x25, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x67, 0x6f, 0x69,
+ 0x6e, 0x67, 0x20, 0x74, 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x05, 0x50, 0x61, 0x73, 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x4e, 0x6f, 0x2c, 0x20, 0x49, 0x25,
+ 0x64, 0x20, 0x62, 0x65, 0x74, 0x74, 0x65, 0x72, 0x20, 0x6e, 0x6f, 0x74,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x45, 0x73, 0x6f,
+ 0x20, 0x6e, 0x6f, 0x20, 0x74, 0x69, 0x65, 0x6e, 0x65, 0x20, 0x73, 0x65,
+ 0x6e, 0x74, 0x69, 0x64, 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
+ 0x4e, 0x6f, 0x6e, 0x73, 0x65, 0x6e, 0x73, 0x65, 0x2e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0b, 0x4e, 0x6f, 0x20, 0x73, 0x65, 0x20, 0x61, 0x62, 0x72,
+ 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x49, 0x74, 0x20, 0x64, 0x6f, 0x65,
+ 0x73, 0x6e, 0x25, 0x74, 0x20, 0x73, 0x65, 0x65, 0x6d, 0x20, 0x74, 0x6f,
+ 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x4e, 0x6f, 0x20,
+ 0x70, 0x75, 0x65, 0x64, 0x65, 0x20, 0x61, 0x62, 0x72, 0x69, 0x72, 0x73,
+ 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13,
+ 0x49, 0x74, 0x20, 0x63, 0x61, 0x6e, 0x25, 0x74, 0x20, 0x62, 0x65, 0x20,
+ 0x6f, 0x70, 0x65, 0x6e, 0x65, 0x64, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x59, 0x61, 0x20, 0x65, 0x73, 0x74, 0xa0, 0x20, 0x61,
+ 0x62, 0x69, 0x65, 0x72, 0x74, 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x49, 0x74, 0x25, 0x73, 0x20, 0x61,
+ 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x65,
+ 0x64, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x59, 0x61, 0x20,
+ 0x65, 0x73, 0x74, 0xa0, 0x20, 0x61, 0x62, 0x69, 0x65, 0x72, 0x74, 0x61,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14,
+ 0x49, 0x74, 0x25, 0x73, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79,
+ 0x20, 0x6f, 0x70, 0x65, 0x6e, 0x65, 0x64, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0d, 0x4e, 0x6f, 0x20, 0x73, 0x65, 0x20, 0x63, 0x69, 0x65,
+ 0x72, 0x72, 0x61, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x49, 0x74, 0x20, 0x64, 0x6f, 0x65,
+ 0x73, 0x6e, 0x25, 0x74, 0x20, 0x73, 0x65, 0x65, 0x6d, 0x20, 0x74, 0x6f,
+ 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x4e, 0x6f, 0x20,
+ 0x70, 0x75, 0x65, 0x64, 0x65, 0x20, 0x63, 0x65, 0x72, 0x72, 0x61, 0x72,
+ 0x73, 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13,
+ 0x49, 0x74, 0x20, 0x63, 0x61, 0x6e, 0x25, 0x74, 0x20, 0x62, 0x65, 0x20,
+ 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x59, 0x61, 0x20, 0x65, 0x73, 0x74, 0xa0, 0x20, 0x63,
+ 0x65, 0x72, 0x72, 0x61, 0x64, 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x49, 0x74, 0x25, 0x73, 0x20, 0x61,
+ 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79, 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65,
+ 0x64, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x59, 0x61, 0x20,
+ 0x65, 0x73, 0x74, 0xa0, 0x20, 0x63, 0x65, 0x72, 0x72, 0x61, 0x64, 0x61,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14,
+ 0x49, 0x74, 0x25, 0x73, 0x20, 0x61, 0x6c, 0x72, 0x65, 0x61, 0x64, 0x79,
+ 0x20, 0x63, 0x6c, 0x6f, 0x73, 0x65, 0x64, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1d, 0x4e, 0x6f, 0x20, 0x63, 0x72, 0x65, 0x6f, 0x20, 0x71,
+ 0x75, 0x65, 0x20, 0x65, 0x73, 0x74, 0x6f, 0x20, 0x6c, 0x65, 0x20, 0x69,
+ 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x48, 0x65, 0x20, 0x64, 0x6f, 0x65,
+ 0x73, 0x6e, 0x25, 0x74, 0x20, 0x77, 0x61, 0x6e, 0x74, 0x20, 0x69, 0x74,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x4e, 0x6f, 0x20,
+ 0x63, 0x72, 0x65, 0x6f, 0x20, 0x71, 0x75, 0x65, 0x20, 0x65, 0x73, 0x74,
+ 0x6f, 0x20, 0x6c, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73,
+ 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14,
+ 0x53, 0x68, 0x65, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x25, 0x74, 0x20,
+ 0x77, 0x61, 0x6e, 0x74, 0x20, 0x69, 0x74, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0a, 0x4e, 0x6f, 0x20, 0x71, 0x75, 0x69, 0x65, 0x72, 0x6f,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x4e, 0x6f, 0x2c, 0x20, 0x69, 0x74,
+ 0x25, 0x73, 0x20, 0x6d, 0x69, 0x6e, 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x4e, 0x69, 0x20,
+ 0x68, 0x61, 0x62, 0x6c, 0x61, 0x72, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
+ 0x4e, 0x6f, 0x20, 0x77, 0x61, 0x79, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0c, 0x4e, 0x6f, 0x20, 0x73, 0x65, 0x20, 0x6d, 0x75, 0x65,
+ 0x76, 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x49, 0x74, 0x20, 0x64, 0x6f, 0x65,
+ 0x73, 0x6e, 0x25, 0x74, 0x20, 0x6d, 0x6f, 0x76, 0x65, 0x2e, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x4e, 0x6f, 0x20,
+ 0x6d, 0x65, 0x20, 0x70, 0x61, 0x72, 0x65, 0x63, 0x65, 0x20, 0x75, 0x6e,
+ 0x61, 0x20, 0x62, 0x75, 0x65, 0x6e, 0x61, 0x20, 0x69, 0x64, 0x65, 0x61,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f,
+ 0x49, 0x20, 0x64, 0x6f, 0x6e, 0x25, 0x74, 0x20, 0x74, 0x68, 0x69, 0x6e,
+ 0x6b, 0x20, 0x69, 0x74, 0x25, 0x73, 0x20, 0x61, 0x20, 0x67, 0x6f, 0x6f,
+ 0x64, 0x20, 0x69, 0x64, 0x65, 0x61, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x4e, 0x61, 0x64, 0x61, 0x20, 0x64, 0x65, 0x20, 0x69,
+ 0x6e, 0x74, 0x65, 0x72, 0x82, 0x73, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x4e, 0x6f, 0x74, 0x68, 0x69, 0x6e,
+ 0x67, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x74, 0x69, 0x6e,
+ 0x67, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x54, 0x6f, 0x64,
+ 0x61, 0x76, 0xa1, 0x61, 0x20, 0x6e, 0x6f, 0x20, 0x6c, 0x6f, 0x20, 0x74,
+ 0x65, 0x6e, 0x67, 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11,
+ 0x49, 0x20, 0x68, 0x61, 0x76, 0x65, 0x6e, 0x25, 0x74, 0x20, 0x69, 0x74,
+ 0x20, 0x79, 0x65, 0x74, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x4d, 0x65, 0x20,
+ 0x6c, 0x6f, 0x20, 0x72, 0x65, 0x67, 0x61, 0x6c, 0x61, 0x72, 0x6f, 0x6e,
+ 0x20, 0x65, 0x6e, 0x20, 0x75, 0x6e, 0x20, 0x76, 0x69, 0x61, 0x6a, 0x65,
+ 0x20, 0x70, 0x6f, 0x72, 0x20, 0x41, 0x75, 0x73, 0x74, 0x72, 0x61, 0x6c,
+ 0x69, 0x61, 0x2e, 0x2e, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17,
+ 0x49, 0x74, 0x25, 0x73, 0x20, 0x6d, 0x79, 0x20, 0x6c, 0x75, 0x63, 0x6b,
+ 0x79, 0x20, 0x74, 0x61, 0x6c, 0x69, 0x73, 0x6d, 0x61, 0x6e, 0x2c, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1f, 0x2e, 0x2e, 0x2e, 0x6c, 0x6c, 0x65, 0x76, 0x61, 0x6d,
+ 0x6f, 0x73, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x6f, 0x73, 0x20, 0x61, 0xa4,
+ 0x6f, 0x73, 0x20, 0x6a, 0x75, 0x6e, 0x74, 0x6f, 0x73, 0x2e, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x77, 0x65, 0x25, 0x76, 0x65, 0x20,
+ 0x62, 0x65, 0x65, 0x6e, 0x20, 0x74, 0x6f, 0x67, 0x65, 0x74, 0x68, 0x65,
+ 0x72, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x79, 0x65, 0x61, 0x72, 0x73, 0x2e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x27, 0x54, 0x65, 0x6e,
+ 0x67, 0x6f, 0x20, 0x64, 0x65, 0x20, 0x74, 0x6f, 0x64, 0x6f, 0x20, 0x61,
+ 0x68, 0xa1, 0x20, 0x64, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x2c, 0x20, 0x6d,
+ 0x65, 0x6e, 0x6f, 0x73, 0x20, 0x64, 0x69, 0x6e, 0x65, 0x72, 0x6f, 0x2e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f,
+ 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x73, 0x20,
+ 0x74, 0x68, 0x65, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x20, 0x67, 0x6f,
+ 0x20, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x23, 0x4e, 0x6f, 0x20, 0x70, 0x61, 0x72, 0x65, 0x63, 0x65,
+ 0x20, 0x65, 0x73, 0x74, 0x61, 0x72, 0x20, 0x65, 0x6e, 0x20, 0x6d, 0x75,
+ 0x79, 0x20, 0x62, 0x75, 0x65, 0x6e, 0x20, 0x65, 0x73, 0x74, 0x61, 0x64,
+ 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x45, 0x73, 0x74,
+ 0x75, 0x76, 0x65, 0x20, 0x73, 0x65, 0x69, 0x73, 0x20, 0x68, 0x6f, 0x72,
+ 0x61, 0x73, 0x20, 0x65, 0x6e, 0x20, 0x6c, 0x61, 0x20, 0x63, 0x6f, 0x6c,
+ 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23,
+ 0x49, 0x20, 0x73, 0x74, 0x61, 0x79, 0x65, 0x64, 0x20, 0x69, 0x6e, 0x20,
+ 0x74, 0x68, 0x65, 0x20, 0x71, 0x75, 0x65, 0x75, 0x65, 0x20, 0x66, 0x6f,
+ 0x72, 0x20, 0x73, 0x69, 0x78, 0x20, 0x68, 0x6f, 0x75, 0x72, 0x73, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x21, 0x70, 0x61, 0x72, 0x61, 0x20, 0x63, 0x6f, 0x6e, 0x73,
+ 0x65, 0x67, 0x75, 0x69, 0x72, 0x20, 0x65, 0x73, 0x74, 0x61, 0x73, 0x20,
+ 0x64, 0x6f, 0x73, 0x20, 0x65, 0x6e, 0x74, 0x72, 0x61, 0x64, 0x61, 0x73,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x74, 0x6f, 0x20, 0x67, 0x65, 0x74,
+ 0x20, 0x74, 0x68, 0x65, 0x73, 0x65, 0x20, 0x74, 0x77, 0x6f, 0x20, 0x74,
+ 0x69, 0x63, 0x6b, 0x65, 0x74, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x64, 0x65, 0x6c,
+ 0x20, 0x63, 0x6f, 0x6e, 0x63, 0x69, 0x65, 0x72, 0x74, 0x6f, 0x20, 0x64,
+ 0x65, 0x20, 0x54, 0x2e, 0x50, 0x2e, 0x4c, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17,
+ 0x66, 0x6f, 0x72, 0x20, 0x74, 0x68, 0x65, 0x20, 0x54, 0x2e, 0x50, 0x2e,
+ 0x4c, 0x2e, 0x20, 0x63, 0x6f, 0x6e, 0x63, 0x65, 0x72, 0x74, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x16, 0x45, 0x73, 0x20, 0x6c, 0x6f, 0x20, 0xa3, 0x6c, 0x74,
+ 0x69, 0x6d, 0x6f, 0x20, 0x64, 0x65, 0x20, 0x54, 0x2e, 0x50, 0x2e, 0x4c,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x49, 0x74, 0x25, 0x73, 0x20, 0x74,
+ 0x68, 0x65, 0x20, 0x6e, 0x65, 0x77, 0x20, 0x54, 0x2e, 0x50, 0x2e, 0x4c,
+ 0x2e, 0x20, 0x61, 0x6c, 0x62, 0x75, 0x6d, 0x2e, 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, 0x4c, 0x65, 0x20,
+ 0x6f, 0x64, 0x69, 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a,
+ 0x49, 0x20, 0x68, 0x61, 0x74, 0x65, 0x20, 0x69, 0x74, 0x2e, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1f, 0x4d, 0x65, 0x20, 0x64, 0x65, 0x73, 0x70, 0x69, 0x65,
+ 0x72, 0x74, 0x61, 0x20, 0x74, 0x6f, 0x64, 0x61, 0x73, 0x20, 0x6c, 0x61,
+ 0x73, 0x20, 0x6d, 0x61, 0xa4, 0x61, 0x6e, 0x61, 0x73, 0x2e, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x49, 0x74, 0x20, 0x77, 0x61, 0x6b,
+ 0x65, 0x73, 0x20, 0x6d, 0x65, 0x20, 0x75, 0x70, 0x20, 0x65, 0x76, 0x65,
+ 0x72, 0x79, 0x20, 0x6d, 0x6f, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0x4d, 0x65, 0x20,
+ 0x70, 0x72, 0x65, 0x67, 0x75, 0x6e, 0x74, 0x6f, 0x20, 0x71, 0x75, 0x82,
+ 0x20, 0x70, 0x6f, 0x64, 0x72, 0x82, 0x20, 0x63, 0x61, 0x7a, 0x61, 0x72,
+ 0x20, 0x63, 0x6f, 0x6e, 0x20, 0x65, 0x73, 0x74, 0x6f, 0x2e, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23,
+ 0x49, 0x20, 0x77, 0x6f, 0x6e, 0x64, 0x65, 0x72, 0x20, 0x77, 0x68, 0x61,
+ 0x74, 0x20, 0x63, 0x61, 0x6e, 0x20, 0x49, 0x20, 0x74, 0x72, 0x61, 0x70,
+ 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x74, 0x68, 0x69, 0x73, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x28, 0x53, 0x65, 0x67, 0x75, 0x72, 0x6f, 0x20, 0x71, 0x75,
+ 0x65, 0x20, 0x6c, 0x65, 0x20, 0x65, 0x6e, 0x63, 0x75, 0x65, 0x6e, 0x74,
+ 0x72, 0x6f, 0x20, 0x61, 0x6c, 0x67, 0x75, 0x6e, 0x61, 0x20, 0x75, 0x74,
+ 0x69, 0x6c, 0x69, 0x64, 0x61, 0x64, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x49, 0x25, 0x6d, 0x20, 0x73, 0x75,
+ 0x72, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x77, 0x69, 0x6c, 0x6c,
+ 0x20, 0x62, 0x65, 0x20, 0x75, 0x73, 0x65, 0x66, 0x75, 0x6c, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x56, 0x61, 0x79,
+ 0x61, 0x20, 0x63, 0x68, 0x69, 0x73, 0x6d, 0x65, 0x2c, 0x20, 0x63, 0xa2,
+ 0x6d, 0x6f, 0x20, 0x70, 0x65, 0x73, 0x61, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20,
+ 0x57, 0x68, 0x61, 0x74, 0x20, 0x61, 0x20, 0x67, 0x61, 0x64, 0x67, 0x65,
+ 0x74, 0x2c, 0x20, 0x69, 0x74, 0x20, 0x77, 0x65, 0x69, 0x67, 0x68, 0x74,
+ 0x73, 0x20, 0x61, 0x20, 0x6c, 0x6f, 0x74, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x19, 0x45, 0x73, 0x20, 0x75, 0x6e, 0x20, 0x6d, 0x61, 0x72,
+ 0x74, 0x69, 0x6c, 0x6c, 0x6f, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x69, 0x65,
+ 0x6e, 0x74, 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x49, 0x74, 0x25, 0x73, 0x20, 0x6a,
+ 0x75, 0x73, 0x74, 0x20, 0x61, 0x20, 0x68, 0x61, 0x6d, 0x6d, 0x65, 0x72,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x50, 0x75, 0x72,
+ 0x69, 0x74, 0x61, 0x20, 0x64, 0x69, 0x6e, 0x61, 0x6d, 0x69, 0x74, 0x61,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b,
+ 0x4e, 0x65, 0x61, 0x74, 0x20, 0x73, 0x74, 0x75, 0x66, 0x66, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x22, 0x41, 0x6c, 0x67, 0x75, 0x6e, 0x61, 0x20, 0x63, 0x68,
+ 0x69, 0x63, 0x61, 0x20, 0x6c, 0x61, 0x20, 0x6f, 0x6c, 0x76, 0x69, 0x64,
+ 0xa2, 0x20, 0x65, 0x6e, 0x20, 0x65, 0x6c, 0x20, 0x62, 0x61, 0xa4, 0x6f,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x49, 0x74, 0x20, 0x62, 0x65, 0x6c,
+ 0x6f, 0x6e, 0x67, 0x73, 0x20, 0x74, 0x6f, 0x20, 0x67, 0x75, 0x61, 0x72,
+ 0x72, 0x61, 0x73, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x22, 0x45, 0x6c,
+ 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x69, 0x6f, 0x72, 0x20, 0x64, 0x65,
+ 0x20, 0x75, 0x6e, 0x6f, 0x20, 0x6d, 0x69, 0x73, 0x6d, 0x6f, 0x22, 0x2e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+ 0x22, 0x49, 0x6e, 0x73, 0x69, 0x64, 0x65, 0x20, 0x79, 0x6f, 0x75, 0x72,
+ 0x73, 0x65, 0x6c, 0x66, 0x22, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x14, 0x45, 0x6e, 0x72, 0x69, 0x71, 0x75, 0x65, 0x20, 0x52,
+ 0x2e, 0x20, 0x41, 0x74, 0x69, 0x65, 0x6e, 0x7a, 0x61, 0x72, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x45, 0x6e, 0x72, 0x69, 0x71, 0x75,
+ 0x65, 0x20, 0x52, 0x2e, 0x20, 0x41, 0x74, 0x69, 0x65, 0x6e, 0x7a, 0x61,
+ 0x72, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x50, 0x6f, 0x64,
+ 0x72, 0xa1, 0x61, 0x20, 0x73, 0x65, 0x72, 0x20, 0x64, 0x65, 0x20, 0x6d,
+ 0x69, 0x20, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12,
+ 0x49, 0x74, 0x20, 0x6d, 0x61, 0x79, 0x20, 0x62, 0x65, 0x20, 0x6d, 0x79,
+ 0x20, 0x73, 0x69, 0x7a, 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1c, 0x22, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74,
+ 0x6f, 0x72, 0x69, 0x6f, 0x20, 0x28, 0x20, 0x36, 0x30, 0x20, 0x2d, 0x20,
+ 0x30, 0x39, 0x30, 0x20, 0x29, 0x22, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x53, 0x6f, 0x6e,
+ 0x20, 0x73, 0xa2, 0x6c, 0x6f, 0x20, 0x75, 0x6e, 0x6f, 0x73, 0x20, 0x72,
+ 0x65, 0x73, 0x74, 0x6f, 0x73, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10,
+ 0x49, 0x74, 0x25, 0x73, 0x20, 0x68, 0x61, 0x6c, 0x66, 0x20, 0x65, 0x61,
+ 0x74, 0x65, 0x6e, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x19, 0x45, 0x73, 0x20, 0x6d, 0x75, 0x79, 0x20, 0x70, 0x6f,
+ 0x63, 0x6f, 0x20, 0x63, 0x6f, 0x6d, 0x75, 0x6e, 0x69, 0x63, 0x61, 0x74,
+ 0x69, 0x76, 0x61, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x49, 0x74, 0x25, 0x73, 0x20, 0x6e,
+ 0x6f, 0x74, 0x20, 0x76, 0x65, 0x72, 0x79, 0x20, 0x63, 0x68, 0x61, 0x72,
+ 0x6d, 0x69, 0x6e, 0x67, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0xad, 0x51, 0x75,
+ 0x82, 0x20, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x69, 0x74, 0x6f, 0x20,
+ 0x74, 0x61, 0x6e, 0x20, 0x64, 0x75, 0x6c, 0x63, 0x65, 0x21, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b,
+ 0x49, 0x74, 0x25, 0x73, 0x20, 0x73, 0x75, 0x63, 0x68, 0x20, 0x61, 0x20,
+ 0x73, 0x77, 0x65, 0x65, 0x74, 0x20, 0x63, 0x72, 0x65, 0x61, 0x74, 0x75,
+ 0x72, 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x16, 0xad, 0x52, 0x61, 0x79, 0x6f, 0x73, 0x21, 0x2c, 0x20,
+ 0x65, 0x73, 0x74, 0xa0, 0x20, 0x68, 0x75, 0x65, 0x63, 0x6f, 0x2e, 0x2e,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x2e, 0x2e, 0x2e,
+ 0x79, 0x20, 0x68, 0x61, 0x79, 0x20, 0x75, 0x6e, 0x20, 0x6c, 0x6c, 0x61,
+ 0x76, 0x65, 0x72, 0x6f, 0x20, 0x64, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x2e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0b, 0x45, 0x73, 0x74, 0xa0, 0x20, 0x76, 0x61, 0x63, 0x69,
+ 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x49, 0x74, 0x25, 0x73, 0x20, 0x65,
+ 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x45, 0x73, 0x63,
+ 0x6f, 0x63, 0x82, 0x73, 0x20, 0x64, 0x65, 0x20, 0x31, 0x32, 0x20, 0x61,
+ 0xa4, 0x6f, 0x73, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b,
+ 0x4f, 0x6c, 0x64, 0x20, 0x73, 0x63, 0x6f, 0x74, 0x63, 0x68, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0b, 0x45, 0x73, 0x74, 0xa0, 0x20, 0x76, 0x61, 0x63, 0xa1,
+ 0x61, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x45, 0x73, 0x74,
+ 0xa0, 0x20, 0x6c, 0x6c, 0x65, 0x6e, 0x61, 0x20, 0x64, 0x65, 0x20, 0x61,
+ 0x67, 0x75, 0x61, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x15, 0x53, 0x65, 0x20, 0x63, 0x72, 0x65, 0xa1, 0x61, 0x20,
+ 0x6d, 0x75, 0x79, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x6f, 0x2e, 0x2e, 0x2e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x2e, 0x2e, 0x2e,
+ 0x70, 0x65, 0x72, 0x6f, 0x20, 0x61, 0x20, 0x6d, 0xa1, 0x20, 0x6e, 0x6f,
+ 0x20, 0x6d, 0x65, 0x20, 0x74, 0x69, 0x6d, 0x61, 0x20, 0x75, 0x6e, 0x20,
+ 0x6c, 0x61, 0x67, 0x61, 0x72, 0x74, 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x25, 0xad, 0x4c, 0x6f, 0x20, 0x71, 0x75, 0x65, 0x20, 0x68,
+ 0x61, 0x63, 0x65, 0x20, 0x75, 0x6e, 0x61, 0x20, 0x62, 0x75, 0x65, 0x6e,
+ 0x61, 0x20, 0x61, 0x6c, 0x69, 0x6d, 0x65, 0x6e, 0x74, 0x61, 0x63, 0x69,
+ 0xa2, 0x6e, 0x21, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x53, 0x82, 0x20,
+ 0x64, 0x65, 0x20, 0x63, 0x69, 0x65, 0x72, 0x74, 0x61, 0x20, 0x70, 0x65,
+ 0x72, 0x73, 0x6f, 0x6e, 0x61, 0x20, 0x61, 0x20, 0x6c, 0x61, 0x20, 0x71,
+ 0x75, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x14, 0x6e, 0x6f, 0x20, 0x6c, 0x65, 0x20, 0x67, 0x75, 0x73,
+ 0x74, 0x61, 0x72, 0xa0, 0x20, 0x6d, 0x75, 0x63, 0x68, 0x6f, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x45, 0x73, 0x74,
+ 0xa0, 0x20, 0x6c, 0x6c, 0x65, 0x6e, 0x61, 0x20, 0x64, 0x65, 0x20, 0x61,
+ 0x70, 0x75, 0x6e, 0x74, 0x65, 0x73, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x29, 0x38, 0x35, 0x33, 0x35, 0x32, 0x2e, 0x20, 0x41, 0x70,
+ 0x75, 0x65, 0x73, 0x74, 0x6f, 0x20, 0x71, 0x75, 0x65, 0x20, 0x65, 0x73,
+ 0x74, 0x61, 0x20, 0x65, 0x73, 0x20, 0x6c, 0x61, 0x20, 0x63, 0x6f, 0x6d,
+ 0x62, 0x69, 0x6e, 0x61, 0x63, 0x69, 0xa2, 0x6e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x64, 0x65, 0x20,
+ 0x6c, 0x61, 0x20, 0x74, 0x61, 0x71, 0x75, 0x69, 0x6c, 0x6c, 0x61, 0x20,
+ 0x64, 0x65, 0x20, 0x47, 0x6f, 0x6f, 0x6c, 0x61, 0x73, 0x68, 0x2e, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0c, 0x45, 0x73, 0x20, 0x70, 0x65, 0x67, 0x61, 0x6a, 0x6f,
+ 0x73, 0x61, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x50, 0x61, 0x72,
+ 0x65, 0x63, 0x65, 0x20, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x74, 0x65, 0x2c,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x21, 0x73, 0x65, 0x67, 0x75, 0x72, 0x6f, 0x20, 0x71, 0x75,
+ 0x65, 0x20, 0x6c, 0x6c, 0x65, 0x67, 0x61, 0x20, 0x62, 0x61, 0x73, 0x74,
+ 0x61, 0x6e, 0x74, 0x65, 0x20, 0x61, 0x72, 0x72, 0x69, 0x62, 0x61, 0x2e,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0xad, 0x51, 0x75,
+ 0x82, 0x20, 0x65, 0x78, 0x74, 0x72, 0x61, 0xa4, 0x6f, 0x21, 0x2e, 0x20,
+ 0x45, 0x73, 0x74, 0xa0, 0x20, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x6d, 0x65,
+ 0x6e, 0x74, 0x65, 0x20, 0x65, 0x6e, 0x20, 0x62, 0x6c, 0x61, 0x6e, 0x63,
+ 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x05, 0x44, 0x69, 0x63, 0x65, 0x3a, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x4c, 0x61, 0x75,
+ 0x72, 0x61, 0x2c, 0x20, 0x74, 0x65, 0x20, 0x65, 0x73, 0x70, 0x65, 0x72,
+ 0x6f, 0x20, 0x65, 0x6e, 0x20, 0x65, 0x6c, 0x20, 0x6c, 0x61, 0x62, 0x6f,
+ 0x72, 0x61, 0x74, 0x6f, 0x72, 0x69, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0e, 0x61, 0x20, 0xa3, 0x6c, 0x74, 0x69, 0x6d, 0x61, 0x20,
+ 0x68, 0x6f, 0x72, 0x61, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x50, 0x68, 0x69,
+ 0x6c, 0x69, 0x70, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x2b, 0x45, 0x73, 0x20, 0x65, 0x6c, 0x20, 0xa3, 0x6c, 0x74,
+ 0x69, 0x6d, 0x6f, 0x20, 0x67, 0x72, 0x69, 0x74, 0x6f, 0x20, 0x65, 0x6e,
+ 0x20, 0x63, 0xa0, 0x6d, 0x61, 0x72, 0x61, 0x73, 0x20, 0x69, 0x6e, 0x73,
+ 0x74, 0x61, 0x6e, 0x74, 0xa0, 0x6e, 0x65, 0x61, 0x73, 0x2e, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29, 0x54, 0x65, 0x20,
+ 0x65, 0x73, 0x70, 0x65, 0x72, 0x6f, 0x20, 0x65, 0x6e, 0x20, 0x65, 0x6c,
+ 0x20, 0x6c, 0x61, 0x62, 0x6f, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x69, 0x6f,
+ 0x20, 0x61, 0x20, 0xa3, 0x6c, 0x74, 0x69, 0x6d, 0x61, 0x20, 0x68, 0x6f,
+ 0x72, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x23, 0x70, 0x61, 0x72, 0x61, 0x20, 0x63, 0x6f, 0x6e, 0x74,
+ 0x69, 0x6e, 0x75, 0x61, 0x72, 0x20, 0x6e, 0x75, 0x65, 0x73, 0x74, 0x72,
+ 0x6f, 0x20, 0x65, 0x78, 0x70, 0x65, 0x72, 0x69, 0x6d, 0x65, 0x6e, 0x74,
+ 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x18, 0x45, 0x73, 0x74, 0x6f, 0x20, 0x70, 0x61, 0x72, 0x65,
+ 0x63, 0x65, 0x20, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x65, 0x73, 0x61, 0x6e,
+ 0x74, 0x65, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x4c, 0x61, 0x73,
+ 0x20, 0x63, 0x6f, 0x6f, 0x72, 0x64, 0x65, 0x6e, 0x61, 0x64, 0x61, 0x73,
+ 0x20, 0x64, 0x65, 0x20, 0x6c, 0x61, 0x20, 0x67, 0x61, 0x6c, 0x61, 0x78,
+ 0x69, 0x61, 0x20, 0x4d, 0x4a, 0x2d, 0x37, 0x38, 0x20, 0x73, 0x6f, 0x6e,
+ 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x11, 0x44, 0x65, 0x63, 0x6c, 0x69, 0x6e, 0x61, 0x63, 0x69,
+ 0xa2, 0x6e, 0x20, 0x3d, 0x20, 0x37, 0x34, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x41, 0x73, 0x63,
+ 0x65, 0x6e, 0x73, 0x69, 0xa2, 0x6e, 0x20, 0x72, 0x65, 0x63, 0x74, 0x61,
+ 0x20, 0x3d, 0x20, 0x32, 0x30, 0x37, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1e, 0x22, 0x45, 0x4c, 0x20, 0x43, 0x4f, 0x4d, 0x41, 0x44,
+ 0x52, 0x45, 0x4a, 0x41, 0x20, 0x41, 0x54, 0x41, 0x43, 0x41, 0x20, 0x44,
+ 0x45, 0x20, 0x4e, 0x55, 0x45, 0x56, 0x4f, 0x22, 0x2e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x22, 0x45, 0x6c,
+ 0x20, 0x47, 0x72, 0x61, 0x6e, 0x20, 0x44, 0x6f, 0x73, 0x69, 0x63, 0x75,
+ 0x61, 0x22, 0x2c, 0x20, 0x6c, 0x61, 0x20, 0x65, 0x73, 0x74, 0x61, 0x74,
+ 0x75, 0x69, 0x6c, 0x6c, 0x61, 0x20, 0x6d, 0xa0, 0x73, 0x20, 0x66, 0x61,
+ 0x6d, 0x6f, 0x73, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x17, 0x64, 0x65, 0x6c, 0x20, 0x6d, 0x75, 0x73, 0x65, 0x6f,
+ 0x20, 0x46, 0x72, 0x61, 0x6e, 0x6b, 0x65, 0x6e, 0x68, 0x65, 0x6c, 0x6c,
+ 0x65, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x66, 0x75, 0x65,
+ 0x20, 0x73, 0x75, 0x73, 0x74, 0x72, 0x61, 0xa1, 0x64, 0x61, 0x20, 0x64,
+ 0x75, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x20, 0x6c, 0x61, 0x20, 0x70, 0x61,
+ 0x73, 0x61, 0x64, 0x61, 0x20, 0x6e, 0x6f, 0x63, 0x68, 0x65, 0x2e, 0x2e,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x28, 0x2e, 0x2e, 0x2e, 0x44, 0x65, 0x20, 0x6e, 0x75, 0x65,
+ 0x76, 0x6f, 0x2c, 0x20, 0x6c, 0x61, 0x20, 0x70, 0x69, 0x6e, 0x74, 0x61,
+ 0x64, 0x61, 0x20, 0x64, 0x65, 0x20, 0x75, 0x6e, 0x61, 0x20, 0x63, 0x6f,
+ 0x6d, 0x61, 0x64, 0x72, 0x65, 0x6a, 0x61, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x64, 0x65, 0x6c,
+ 0x61, 0x74, 0x61, 0x2c, 0x20, 0x73, 0x69, 0x6e, 0x20, 0x64, 0x75, 0x64,
+ 0x61, 0x20, 0x61, 0x6c, 0x67, 0x75, 0x6e, 0x61, 0x2c, 0x20, 0x61, 0x6c,
+ 0x20, 0x61, 0x75, 0x74, 0x6f, 0x72, 0x20, 0x64, 0x65, 0x20, 0x6c, 0x6f,
+ 0x73, 0x20, 0x68, 0x65, 0x63, 0x68, 0x6f, 0x73, 0x2e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x20, 0x53, 0x65, 0x20, 0x6f, 0x66, 0x72, 0x65, 0x63, 0x65,
+ 0x20, 0x73, 0x75, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x69, 0x6f, 0x73, 0x61,
+ 0x20, 0x72, 0x65, 0x63, 0x6f, 0x6d, 0x70, 0x65, 0x6e, 0x73, 0x61, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x70, 0x6f, 0x72,
+ 0x20, 0x6c, 0x61, 0x20, 0x72, 0x65, 0x63, 0x75, 0x70, 0x65, 0x72, 0x61,
+ 0x63, 0x69, 0xa2, 0x6e, 0x20, 0x64, 0x65, 0x20, 0x65, 0x73, 0x74, 0x61,
+ 0x20, 0x66, 0x61, 0x6d, 0x6f, 0x73, 0x61, 0x20, 0x6f, 0x62, 0x72, 0x61,
+ 0x20, 0x64, 0x65, 0x20, 0x61, 0x72, 0x74, 0x65, 0x2e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x28, 0x22, 0x41, 0x50, 0x41, 0x52, 0x45, 0x43, 0x45, 0x20,
+ 0x53, 0x55, 0x50, 0x45, 0x52, 0x4e, 0x4f, 0x56, 0x41, 0x20, 0x45, 0x4e,
+ 0x20, 0x4c, 0x41, 0x20, 0x47, 0x41, 0x4c, 0x41, 0x58, 0x49, 0x41, 0x20,
+ 0x4d, 0x4a, 0x2d, 0x37, 0x38, 0x22, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x45, 0x73, 0x74,
+ 0x65, 0x20, 0x64, 0x65, 0x73, 0x63, 0x75, 0x62, 0x72, 0x69, 0x6d, 0x69,
+ 0x65, 0x6e, 0x74, 0x6f, 0x20, 0x73, 0x75, 0x70, 0x6f, 0x6e, 0x65, 0x20,
+ 0x70, 0x61, 0x72, 0x61, 0x20, 0x6c, 0x6f, 0x73, 0x20, 0x63, 0x69, 0x65,
+ 0x6e, 0x74, 0xa1, 0x66, 0x69, 0x63, 0x6f, 0x73, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x28, 0x75, 0x6e, 0x61, 0x20, 0x69, 0x6d, 0x70, 0x6f, 0x72,
+ 0x74, 0x61, 0x6e, 0x74, 0xa1, 0x73, 0x69, 0x6d, 0x61, 0x20, 0x66, 0x75,
+ 0x65, 0x6e, 0x74, 0x65, 0x20, 0x64, 0x65, 0x20, 0x69, 0x6e, 0x66, 0x6f,
+ 0x72, 0x6d, 0x61, 0x63, 0x69, 0xa2, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x73, 0x6f, 0x62,
+ 0x72, 0x65, 0x20, 0x65, 0x73, 0x74, 0x65, 0x20, 0x66, 0x65, 0x6e, 0xa2,
+ 0x6d, 0x65, 0x6e, 0x6f, 0x20, 0x65, 0x73, 0x74, 0x65, 0x6c, 0x61, 0x72,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x30, 0x50, 0x61, 0x72, 0x65, 0x63, 0x65, 0x20, 0x66, 0x75,
+ 0x65, 0x72, 0x74, 0x65, 0x2c, 0x20, 0x82, 0x73, 0x74, 0x6f, 0x20, 0x70,
+ 0x6f, 0x6e, 0x65, 0x20, 0x65, 0x6e, 0x20, 0x74, 0x72, 0x61, 0x6e, 0x63,
+ 0x65, 0x20, 0x61, 0x20, 0x63, 0x75, 0x61, 0x6c, 0x71, 0x75, 0x69, 0x65,
+ 0x72, 0x61, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x45, 0x73, 0x20,
+ 0x72, 0x61, 0x72, 0xa1, 0x73, 0x69, 0x6d, 0x61, 0x2c, 0x20, 0x70, 0x65,
+ 0x72, 0x6f, 0x20, 0x73, 0x75, 0x20, 0x76, 0x61, 0x6c, 0x6f, 0x72, 0x20,
+ 0x64, 0x65, 0x62, 0x65, 0x20, 0x73, 0x65, 0x72, 0x20, 0x69, 0x6e, 0x63,
+ 0x61, 0x6c, 0x63, 0x75, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x2e, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x25, 0x45, 0x73, 0x74, 0x61, 0x20, 0x72, 0x65, 0x63, 0x6f,
+ 0x6d, 0x70, 0x65, 0x6e, 0x73, 0x61, 0x20, 0x70, 0x75, 0x65, 0x64, 0x65,
+ 0x20, 0x73, 0x65, 0x72, 0x6d, 0x65, 0x20, 0x6d, 0x75, 0x79, 0x20, 0xa3,
+ 0x74, 0x69, 0x6c, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x48, 0x69,
+ 0x6a, 0x6f, 0x2c, 0x20, 0x6e, 0x6f, 0x20, 0x74, 0x61, 0x72, 0x64, 0x65,
+ 0x73, 0x2c, 0x20, 0x6d, 0x61, 0x6d, 0xa0, 0x20, 0x74, 0x65, 0x20, 0x65,
+ 0x73, 0x70, 0x65, 0x72, 0x61, 0x22, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x23, 0x45, 0x73, 0x20, 0x75, 0x6e, 0x20, 0x62, 0x6f, 0x6c,
+ 0xa1, 0x67, 0x72, 0x61, 0x66, 0x6f, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61,
+ 0x6c, 0x20, 0x79, 0x20, 0x63, 0x6f, 0x72, 0x72, 0x69, 0x65, 0x6e, 0x74,
+ 0x65, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1d, 0x45, 0x73, 0x70,
+ 0x65, 0x72, 0x61, 0x72, 0x82, 0x20, 0x61, 0x6c, 0x20, 0x6d, 0x6f, 0x6d,
+ 0x65, 0x6e, 0x74, 0x6f, 0x20, 0x61, 0x64, 0x65, 0x63, 0x75, 0x61, 0x64,
+ 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0b, 0x45, 0x73, 0x74, 0xa0, 0x20, 0x76, 0x61, 0x63, 0xa1,
+ 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x54, 0x69, 0x65,
+ 0x6e, 0x65, 0x20, 0x75, 0x6e, 0x61, 0x20, 0x66, 0x6c, 0x6f, 0x72, 0x20,
+ 0x64, 0x65, 0x6e, 0x74, 0x72, 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1a, 0x45, 0x73, 0x74, 0xa0, 0x20, 0x6c, 0x6c, 0x65, 0x6e,
+ 0x6f, 0x20, 0x64, 0x65, 0x20, 0x6c, 0x75, 0x63, 0x69, 0x82, 0x72, 0x6e,
+ 0x61, 0x67, 0x61, 0x73, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x50, 0x61, 0x72,
+ 0x65, 0x63, 0x65, 0x20, 0x75, 0x6e, 0x61, 0x20, 0x66, 0x6c, 0x6f, 0x72,
+ 0x20, 0x65, 0x78, 0xa2, 0x74, 0x69, 0x63, 0x61, 0x2e, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x22, 0x45, 0x73, 0x74, 0x65, 0x20, 0x48, 0x61, 0x72, 0x72,
+ 0x69, 0x73, 0x6f, 0x6e, 0x20, 0x76, 0x61, 0x6c, 0x65, 0x20, 0x73, 0x75,
+ 0x20, 0x70, 0x65, 0x73, 0x6f, 0x20, 0x65, 0x6e, 0x20, 0x6f, 0x72, 0x6f,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x4e, 0x6f, 0x20,
+ 0x64, 0x65, 0x62, 0x6f, 0x20, 0x68, 0x61, 0x63, 0x65, 0x72, 0x20, 0x65,
+ 0x73, 0x6f, 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x1d, 0x4e, 0x6f, 0x20, 0x71, 0x75, 0x69, 0x65, 0x72, 0x6f,
+ 0x20, 0x65, 0x73, 0x63, 0x72, 0x69, 0x62, 0x69, 0x72, 0x20, 0x6e, 0x61,
+ 0x64, 0x61, 0x20, 0x61, 0x71, 0x75, 0xa1, 0x2e, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0x50, 0x61, 0x72,
+ 0x65, 0x63, 0x65, 0x20, 0x71, 0x75, 0x65, 0x20, 0x6c, 0x65, 0x20, 0x68,
+ 0x61, 0x20, 0x73, 0x65, 0x6e, 0x74, 0x61, 0x64, 0x6f, 0x20, 0x64, 0x65,
+ 0x20, 0x6d, 0x61, 0x72, 0x61, 0x76, 0x69, 0x6c, 0x6c, 0x61, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x16, 0x4c, 0x61, 0x20, 0x70, 0x6f, 0x6e, 0x64, 0x72, 0x82,
+ 0x20, 0x61, 0x71, 0x75, 0xa1, 0x20, 0x64, 0x65, 0x6e, 0x74, 0x72, 0x6f,
+ 0x2e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static const unsigned char TXT_MainVerbs_data[] = {
+ 0x05, 0x49, 0x72, 0x20, 0x61, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x57, 0x61, 0x6c, 0x6b, 0x20, 0x74, 0x6f, 0x20, 0x00, 0x00, 0x00,
+ 0x0b, 0x48, 0x61, 0x62, 0x6c, 0x61, 0x72, 0x20, 0x63, 0x6f, 0x6e, 0x20,
+ 0x0a, 0x54, 0x61, 0x6c, 0x6b, 0x20, 0x77, 0x69, 0x74, 0x68, 0x20, 0x00,
+ 0x06, 0x43, 0x6f, 0x67, 0x65, 0x72, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x54, 0x61, 0x6b, 0x65, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x4d, 0x69, 0x72, 0x61, 0x72, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x4c, 0x6f, 0x6f, 0x6b, 0x20, 0x61, 0x74, 0x20, 0x00, 0x00, 0x00,
+ 0x05, 0x55, 0x73, 0x61, 0x72, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x55, 0x73, 0x65, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x41, 0x62, 0x72, 0x69, 0x72, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x4f, 0x70, 0x65, 0x6e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x07, 0x43, 0x65, 0x72, 0x72, 0x61, 0x72, 0x20, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x44, 0x61, 0x72, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x05, 0x47, 0x69, 0x76, 0x65, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
+
+static const unsigned char DAT_FloppySentenceColors_data[] = {
+ 0xf8, 0xf7, 0xf1
+};
+
diff --git a/devtools/create_igor/fsd_en_demo.h b/devtools/create_igor/fsd_en_demo.h
new file mode 100644
index 00000000000..5f054954463
--- /dev/null
+++ b/devtools/create_igor/fsd_en_demo.h
@@ -0,0 +1,8 @@
+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/devtools/create_igor/fsd_en_floppy.h b/devtools/create_igor/fsd_en_floppy.h
new file mode 100644
index 00000000000..f274e63596e
--- /dev/null
+++ b/devtools/create_igor/fsd_en_floppy.h
@@ -0,0 +1,9 @@
+// English floppy sound offsets.
+0x000000, 0x0023A2, 0x0049C4, 0x0062A6, 0x007CC3, 0x0095A5, 0x00B807, 0x010829,
+0x0139C4, 0x0145A5, 0x015197, 0x0160C3, 0x01BE68, 0x01CA4A, 0x01E467, 0x01F649,
+0x020C8E, 0x0307B0, 0x03179C, 0x03707B, 0x03DFE1, 0x03F103, 0x04008E, 0x0405C1,
+0x0477E2, 0x04E603, 0x053B65, 0x055806, 0x0567F0, 0x05C3EC, 0x05D318, 0x05D51D,
+0x060333, 0x066204, 0x067521, 0x068515, 0x06A588, 0x06C5C3, 0x06DD4C, 0x06ECFE,
+0x06F220, 0x070C41, 0x07C912, 0x08325A, 0x08C37C, 0x0A5558, 0x0A73E9, 0x0AA0FD,
+0x0AE45E, 0x0B1BEE, 0x0BE986, 0x0BEBB8, 0x0C4349, 0x0D10E1, 0x0DAFF1, 0x0E25A2,
+0x0F51C3, 0x102365, 0x11A786, 0x1244DB, 0x12A7FD, 0x13487F, 0x143500,
diff --git a/devtools/create_igor/fsd_sp_cdrom.h b/devtools/create_igor/fsd_sp_cdrom.h
new file mode 100644
index 00000000000..ab4cec62b88
--- /dev/null
+++ b/devtools/create_igor/fsd_sp_cdrom.h
@@ -0,0 +1,175 @@
+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/devtools/create_igor/fsd_sp_floppy.h b/devtools/create_igor/fsd_sp_floppy.h
new file mode 100644
index 00000000000..f63b3822284
--- /dev/null
+++ b/devtools/create_igor/fsd_sp_floppy.h
@@ -0,0 +1,13 @@
+// Spanish floppy sound effects: offsets in IGOR.DAT, indexed by sound number - 1.
+// Numbers 1-63 are the numbers used by the other versions (an entry is 0 when this
+// version has no identical effect). Numbers 64 and up exist only in this version.
+0x009920B1, 0x00938C7F, 0x008FB108, 0x00000000, 0x0098B26E, 0x0098CB50, 0x0095CA31, 0x00961A53,
+0x00964BEE, 0x009657CF, 0x00000000, 0x00000000, 0x0098EDB2, 0x00990694, 0x008FE407, 0x00000000,
+0x009D2C57, 0x00000000, 0x00888807, 0x00000000, 0x008363BB, 0x00000000, 0x008386D0, 0x0070C63B,
+0x0072CD69, 0x00733B8A, 0x0072B0C8, 0x00001D3F, 0x00002D29, 0x00000000, 0x007AF5CE, 0x007AF7D3,
+0x007FB035, 0x007F9D18, 0x00000000, 0x002207F8, 0x0022286B, 0x002248A6, 0x00208B21, 0x0020BA1E,
+0x00000000, 0x00287172, 0x00000000, 0x00000000, 0x00000000, 0x006F4ADE, 0x00000000, 0x00000000,
+0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x000E7395,
+0x0014481C, 0x0018E080, 0x00209AD3, 0x00246F76, 0x00264020, 0x00265A41, 0x006ED250, 0x006F2D72,
+0x007AC3A2, 0x007F4B6C, 0x008374DD, 0x0088E0E6, 0x008F9CA1, 0x008FC9EA, 0x0093517C, 0x009663C1,
diff --git a/devtools/create_igor/module.mk b/devtools/create_igor/module.mk
new file mode 100644
index 00000000000..6e60512c49f
--- /dev/null
+++ b/devtools/create_igor/module.mk
@@ -0,0 +1,11 @@
+
+MODULE := devtools/create_igor
+
+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/devtools/create_igor/resource_en_demo100.h b/devtools/create_igor/resource_en_demo100.h
new file mode 100644
index 00000000000..c79e7f53cac
--- /dev/null
+++ b/devtools/create_igor/resource_en_demo100.h
@@ -0,0 +1,340 @@
+{ 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_CollegeCorridorChemistryClass, 0xa3544, 5993 },
+{ FRM_CollegeCorridorChemistryClass1, 0xa4f4d, 3630 },
+{ FRM_CollegeCorridorChemistryClass2, 0xa5d7b, 7752 },
+{ FRM_CollegeCorridorChemistryClass3, 0xa7bc3, 5676 },
+{ FRM_CollegeCorridorChemistryClass4, 0xa91ef, 6762 },
+{ TXT_CollegeCorridorChemistryClass, 0xab344, 1387 },
+{ IMG_CollegeCorridorChemistryClass, 0xab8af, 46080 },
+{ PAL_CollegeCorridorChemistryClass, 0xb6caf, 624 },
+{ MSK_CollegeCorridorChemistryClass, 0xb6f1f, 3144 },
+{ BOX_CollegeCorridorChemistryClass, 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_CollegeCorridorLadiesRoom, 0xd6381, 6109 },
+{ FRM_CollegeCorridorLadiesRoom1, 0xd7df4, 2592 },
+{ FRM_CollegeCorridorLadiesRoom2, 0xd8814, 1225 },
+{ FRM_CollegeCorridorLadiesRoom3, 0xd8cdd, 6480 },
+{ FRM_CollegeCorridorLadiesRoom4, 0xda62d, 1140 },
+{ TXT_CollegeCorridorLadiesRoom, 0xdb18c, 1387 },
+{ IMG_CollegeCorridorLadiesRoom, 0xdb6f7, 46080 },
+{ PAL_CollegeCorridorLadiesRoom, 0xe6af7, 624 },
+{ MSK_CollegeCorridorLadiesRoom, 0xe6d67, 3297 },
+{ BOX_CollegeCorridorLadiesRoom, 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 },
+{ TXT_OptionsButtons, 0x36842b, 25 },
+{ TXT_OptionsSettings, 0x368790, 210 },
+{ TXT_OptionsTitle, 0x368e9a, 14 },
+{ TXT_OptionsQuit, 0x369164, 25 },
+{ TXT_OptionsSaveTitle, 0x369dbf, 29 },
+{ TXT_OptionsLoadTitle, 0x36a0e9, 22 },
+{ TXT_OptionsUnavailable, 0x369d9c, 35 },
diff --git a/devtools/create_igor/resource_en_demo110.h b/devtools/create_igor/resource_en_demo110.h
new file mode 100644
index 00000000000..8e6a3af4b8d
--- /dev/null
+++ b/devtools/create_igor/resource_en_demo110.h
@@ -0,0 +1,340 @@
+{ 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_CollegeCorridorChemistryClass, 0xa360e, 5993 },
+{ FRM_CollegeCorridorChemistryClass1, 0xa501b, 3630 },
+{ FRM_CollegeCorridorChemistryClass2, 0xa5e49, 7752 },
+{ FRM_CollegeCorridorChemistryClass3, 0xa7c91, 5676 },
+{ FRM_CollegeCorridorChemistryClass4, 0xa92bd, 6762 },
+{ TXT_CollegeCorridorChemistryClass, 0xab412, 1387 },
+{ IMG_CollegeCorridorChemistryClass, 0xab97d, 46080 },
+{ PAL_CollegeCorridorChemistryClass, 0xb6d7d, 624 },
+{ MSK_CollegeCorridorChemistryClass, 0xb6fed, 3144 },
+{ BOX_CollegeCorridorChemistryClass, 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_CollegeCorridorLadiesRoom, 0xd6468, 6109 },
+{ FRM_CollegeCorridorLadiesRoom1, 0xd7edf, 2592 },
+{ FRM_CollegeCorridorLadiesRoom2, 0xd88ff, 1225 },
+{ FRM_CollegeCorridorLadiesRoom3, 0xd8dc8, 6480 },
+{ FRM_CollegeCorridorLadiesRoom4, 0xda718, 1140 },
+{ TXT_CollegeCorridorLadiesRoom, 0xdb277, 1387 },
+{ IMG_CollegeCorridorLadiesRoom, 0xdb7e2, 46080 },
+{ PAL_CollegeCorridorLadiesRoom, 0xe6be2, 624 },
+{ MSK_CollegeCorridorLadiesRoom, 0xe6e52, 3297 },
+{ BOX_CollegeCorridorLadiesRoom, 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 },
+{ TXT_OptionsButtons, 0x36a0bc, 25 },
+{ TXT_OptionsSettings, 0x36a421, 210 },
+{ TXT_OptionsTitle, 0x36ab2b, 14 },
+{ TXT_OptionsQuit, 0x36adf5, 25 },
+{ TXT_OptionsSaveTitle, 0x36ba50, 29 },
+{ TXT_OptionsLoadTitle, 0x36bd7a, 22 },
+{ TXT_OptionsUnavailable, 0x36ba2d, 35 },
diff --git a/devtools/create_igor/resource_en_floppy.h b/devtools/create_igor/resource_en_floppy.h
new file mode 100644
index 00000000000..0d3635e62b4
--- /dev/null
+++ b/devtools/create_igor/resource_en_floppy.h
@@ -0,0 +1,724 @@
+// English floppy resource catalog.
+// Unresolved resources are intentionally omitted.
+
+{ ANM_PhilipVodka, 0x16dea0, 24175 },
+{ AOF_PhilipVodka, 0x173d0f, 80 },
+{ TXT_PhilipRoom, 0x174413, 1164 },
+{ IMG_PhilipRoom, 0x17489f, 46080 },
+{ PAL_PhilipRoom, 0x17fc9f, 768 },
+{ MSK_PhilipRoom, 0x17ff9f, 3 },
+{ BOX_PhilipRoom, 0x17ffa2, 1280 },
+{ DAT_PhysicsClassroom, 0x358da6, 6017 },
+{ FRM_PhysicsClassroom1, 0x35a76f, 3100 },
+{ TXT_PhysicsClassroom, 0x35ba6a, 1145 },
+{ IMG_PhysicsClassroom, 0x35bee3, 46080 },
+{ PAL_PhysicsClassroom, 0x3672e3, 624 },
+{ MSK_PhysicsClassroom, 0x367553, 1557 },
+{ BOX_PhysicsClassroom, 0x367b68, 1280 },
+{ DAT_ChemistryClassroom, 0x36b9ea, 6345 },
+{ FRM_ChemistryClassroom1, 0x36d543, 14 },
+{ FRM_ChemistryClassroom2, 0x36d551, 3332 },
+{ TXT_ChemistryClassroom, 0x36e938, 1226 },
+{ IMG_ChemistryClassroom, 0x36ee02, 46080 },
+{ PAL_ChemistryClassroom, 0x37a202, 624 },
+{ MSK_ChemistryClassroom, 0x37a472, 1980 },
+{ BOX_ChemistryClassroom, 0x37ac2e, 1280 },
+{ DAT_CollegeStairsSecondFloor, 0x3bb731, 6393 },
+{ FRM_CollegeStairsSecondFloor1, 0x3bd32a, 2756 },
+{ FRM_CollegeStairsSecondFloor2, 0x3bddee, 11136 },
+{ FRM_CollegeStairsSecondFloor3, 0x3c096e, 6665 },
+{ TXT_CollegeStairsSecondFloor, 0x3c2a71, 1559 },
+{ IMG_CollegeStairsSecondFloor, 0x3c3088, 46080 },
+{ PAL_CollegeStairsSecondFloor, 0x3ce488, 624 },
+{ MSK_CollegeStairsSecondFloor, 0x3ce6f8, 4128 },
+{ BOX_CollegeStairsSecondFloor, 0x3cf718, 1280 },
+{ DAT_CollegeStairsFirstFloor, 0x3d3c17, 6017 },
+{ DLG_CollegeStairsFirstFloor, 0x3d665a, 2713 },
+{ FRM_CollegeStairsFirstFloor1, 0x3d7207, 48790 },
+{ FRM_CollegeStairsFirstFloor2, 0x3e309d, 140 },
+{ TXT_CollegeStairsFirstFloor, 0x3e381f, 1228 },
+{ IMG_CollegeStairsFirstFloor, 0x3e3ceb, 46080 },
+{ PAL_CollegeStairsFirstFloor, 0x3ef0eb, 624 },
+{ MSK_CollegeStairsFirstFloor, 0x3ef35b, 2934 },
+{ BOX_CollegeStairsFirstFloor, 0x3efed1, 1280 },
+{ DAT_CollegeCorridorMissBarrymore, 0x3f4215, 6137 },
+{ FRM_CollegeCorridorMissBarrymore1, 0x3f5cfa, 3250 },
+{ FRM_CollegeCorridorMissBarrymore2, 0x3f69ac, 5280 },
+{ FRM_CollegeCorridorMissBarrymore3, 0x3f7e4c, 10824 },
+{ TXT_CollegeCorridorMissBarrymore, 0x3faf7b, 1412 },
+{ IMG_CollegeCorridorMissBarrymore, 0x3fb4ff, 46080 },
+{ PAL_CollegeCorridorMissBarrymore, 0x4068ff, 624 },
+{ MSK_CollegeCorridorMissBarrymore, 0x406b6f, 2484 },
+{ BOX_CollegeCorridorMissBarrymore, 0x407523, 1280 },
+{ DAT_CollegeCorridorAnnouncementBoard, 0x40b5c1, 5973 },
+{ FRM_CollegeCorridorAnnouncementBoard1, 0x40cfb6, 2392 },
+{ FRM_CollegeCorridorAnnouncementBoard2, 0x40d90e, 6944 },
+{ TXT_CollegeCorridorAnnouncementBoard, 0x40fb11, 1238 },
+{ IMG_CollegeCorridorAnnouncementBoard, 0x40ffe7, 46080 },
+{ PAL_CollegeCorridorAnnouncementBoard, 0x41b3e7, 624 },
+{ MSK_CollegeCorridorAnnouncementBoard, 0x41b657, 3117 },
+{ BOX_CollegeCorridorAnnouncementBoard, 0x41c284, 1280 },
+{ DAT_CollegeCorridorChemistryClass, 0x41f7b6, 5993 },
+{ FRM_CollegeCorridorChemistryClass1, 0x4211bf, 3630 },
+{ FRM_CollegeCorridorChemistryClass2, 0x421fed, 7752 },
+{ FRM_CollegeCorridorChemistryClass3, 0x423e35, 5676 },
+{ FRM_CollegeCorridorChemistryClass4, 0x425461, 6762 },
+{ TXT_CollegeCorridorChemistryClass, 0x4275b6, 1387 },
+{ IMG_CollegeCorridorChemistryClass, 0x427b21, 46080 },
+{ PAL_CollegeCorridorChemistryClass, 0x432f21, 624 },
+{ MSK_CollegeCorridorChemistryClass, 0x433191, 3144 },
+{ BOX_CollegeCorridorChemistryClass, 0x433dd9, 1280 },
+{ DAT_CollegeCorridorCaroline, 0x43870c, 6509 },
+{ FRM_CollegeCorridorCaroline1, 0x43a3ab, 25080 },
+{ FRM_CollegeCorridorCaroline3, 0x4405a3, 7595 },
+{ FRM_CollegeCorridorCaroline2, 0x44234e, 270 },
+{ TXT_CollegeCorridorCaroline, 0x442b56, 2037 },
+{ IMG_CollegeCorridorCaroline, 0x44334b, 46080 },
+{ PAL_CollegeCorridorCaroline, 0x44e74b, 624 },
+{ MSK_CollegeCorridorCaroline, 0x44e9bb, 2151 },
+{ BOX_CollegeCorridorCaroline, 0x44f222, 1280 },
+{ DAT_CollegeCorridorLadiesRoom, 0x4525f3, 6109 },
+{ FRM_CollegeCorridorLadiesRoom1, 0x454066, 2592 },
+{ FRM_CollegeCorridorLadiesRoom2, 0x454a86, 1225 },
+{ FRM_CollegeCorridorLadiesRoom3, 0x454f4f, 6480 },
+{ FRM_CollegeCorridorLadiesRoom4, 0x45689f, 1140 },
+{ TXT_CollegeCorridorLadiesRoom, 0x4573fe, 1387 },
+{ IMG_CollegeCorridorLadiesRoom, 0x457969, 46080 },
+{ PAL_CollegeCorridorLadiesRoom, 0x462d69, 624 },
+{ MSK_CollegeCorridorLadiesRoom, 0x462fd9, 3297 },
+{ BOX_CollegeCorridorLadiesRoom, 0x463cba, 1280 },
+{ DAT_CollegeCorridorMargaret, 0x4679c1, 6273 },
+{ DLG_CollegeCorridorMargaret, 0x46a597, 6860 },
+{ FRM_CollegeCorridorMargaret1, 0x46c1eb, 5346 },
+{ FRM_CollegeCorridorMargaret2, 0x46d6cd, 44247 },
+{ FRM_CollegeCorridorMargaret3, 0x4783a4, 7800 },
+{ FRM_CollegeCorridorMargaret4, 0x47a21c, 3564 },
+{ TXT_CollegeCorridorMargaret, 0x47b706, 1651 },
+{ IMG_CollegeCorridorMargaret, 0x47bd79, 46080 },
+{ PAL_CollegeCorridorMargaret, 0x487179, 624 },
+{ MSK_CollegeCorridorMargaret, 0x4873e9, 3690 },
+{ BOX_CollegeCorridorMargaret, 0x488253, 1280 },
+{ DAT_CollegeLockers, 0x48b47b, 6437 },
+{ FRM_CollegeLockers1, 0x48d016, 2496 },
+{ FRM_CollegeLockers2, 0x48d9d6, 4704 },
+{ FRM_CollegeLockers3, 0x48ec36, 1260 },
+{ TXT_CollegeLockers, 0x48f809, 1589 },
+{ IMG_CollegeLockers, 0x48fe3e, 46080 },
+{ PAL_CollegeLockers, 0x49b23e, 624 },
+{ MSK_CollegeLockers, 0x49b4ae, 2235 },
+{ BOX_CollegeLockers, 0x49bd69, 1280 },
+{ DAT_MenToilets, 0x49fe43, 6465 },
+{ DAT_WomenToilets, 0x4a5e3d, 6385 },
+{ FRM_WomenToilets1, 0x4a7ad6, 854 },
+{ FRM_WomenToilets2, 0x4a7e2c, 12 },
+{ FRM_WomenToilets3, 0x4a7e38, 2744 },
+{ FRM_WomenToilets4, 0x4a88f0, 12855 },
+{ FRM_WomenToilets5, 0x4abb27, 102 },
+{ TXT_WomenToilets, 0x4ac27c, 1637 },
+{ IMG_WomenToilets, 0x4ac8e1, 46080 },
+{ PAL_WomenToilets, 0x4b7ce1, 624 },
+{ MSK_WomenToilets, 0x4b7f51, 2022 },
+{ BOX_WomenToilets, 0x4b8737, 1280 },
+{ FRM_MenToilets1, 0x4b8ce5, 3038 },
+{ FRM_MenToilets2, 0x4b98c3, 1624 },
+{ TXT_MenToilets, 0x4ba5fe, 1322 },
+{ IMG_MenToilets, 0x4bab28, 46080 },
+{ PAL_MenToilets, 0x4c5f28, 624 },
+{ MSK_MenToilets, 0x4c6198, 1980 },
+{ BOX_MenToilets, 0x4c6954, 1280 },
+{ DAT_OutsideCollege, 0x4cbf74, 6777 },
+{ DLG_OutsideCollege, 0x4ce7e3, 953 },
+{ FRM_OutsideCollege1, 0x4ced24, 2156 },
+{ FRM_OutsideCollege2, 0x4cf590, 4347 },
+{ FRM_OutsideCollege3, 0x4d068b, 693 },
+{ FRM_OutsideCollege4, 0x4d0940, 594 },
+{ FRM_OutsideCollege5, 0x4d0b92, 10080 },
+{ TXT_OutsideCollege, 0x4d39e1, 1741 },
+{ IMG_OutsideCollege, 0x4d40ae, 46080 },
+{ PAL_OutsideCollege, 0x4df4ae, 624 },
+{ MSK_OutsideCollege, 0x4df71e, 4974 },
+{ BOX_OutsideCollege, 0x4e0a8c, 1280 },
+{ DAT_Laboratory, 0x4e4ef9, 5645 },
+{ FRM_Laboratory1, 0x4e680e, 2254 },
+{ FRM_Laboratory2, 0x4e70dc, 26218 },
+{ FRM_Laboratory3, 0x4ed746, 128 },
+{ TXT_Laboratory, 0x4edead, 1527 },
+{ IMG_Laboratory, 0x4ee4a4, 46080 },
+{ PAL_Laboratory, 0x4f98a4, 624 },
+{ MSK_Laboratory, 0x4f9b14, 2130 },
+{ BOX_Laboratory, 0x4fa366, 1280 },
+{ FRM_MargaretRoom1, 0x4fd9d0, 10853 },
+{ FRM_MargaretRoom2, 0x500435, 16 },
+{ FRM_MargaretRoom3, 0x500445, 44564 },
+{ FRM_MargaretRoom4, 0x50b259, 80 },
+{ TXT_MargaretRoom, 0x50b965, 1707 },
+{ IMG_MargaretRoom, 0x50c010, 46080 },
+{ PAL_MargaretRoom, 0x517410, 768 },
+{ MSK_MargaretRoom, 0x517710, 3 },
+{ BOX_MargaretRoom, 0x517713, 1280 },
+{ DAT_Map, 0x51a1c0, 6273 },
+{ TXT_Map, 0x51c286, 1023 },
+{ IMG_Map, 0x51c685, 46080 },
+{ PAL_Map, 0x527a85, 624 },
+{ MSK_Map, 0x527cf5, 1809 },
+{ BOX_Map, 0x528406, 1280 },
+{ DAT_TobiasOffice, 0x52c174, 5945 },
+{ DLG_TobiasOffice, 0x52ebb3, 10590 },
+{ ANM_TobiasOffice1, 0x531697, 2392 },
+{ AOF_TobiasOffice1, 0x531fef, 910 },
+{ ANM_TobiasOffice2, 0x53237d, 16992 },
+{ AOF_TobiasOffice2, 0x5365dd, 6678 },
+{ TXT_TobiasOffice, 0x5386de, 2086 },
+{ IMG_TobiasOffice, 0x538f04, 46080 },
+{ PAL_TobiasOffice, 0x544304, 624 },
+{ MSK_TobiasOffice, 0x544574, 1455 },
+{ BOX_TobiasOffice, 0x544b23, 1280 },
+{ DAT_BellChurch, 0x54785f, 5617 },
+{ FRM_BellChurch1, 0x549042, 40960 },
+{ FRM_BellChurch2, 0x553042, 2100 },
+{ TXT_BellChurch, 0x553f59, 1158 },
+{ IMG_BellChurch, 0x5543df, 46080 },
+{ PAL_BellChurch, 0x55f7df, 624 },
+{ MSK_BellChurch, 0x55fa4f, 861 },
+{ BOX_BellChurch, 0x55fdac, 1280 },
+{ DAT_ChurchPuzzle, 0x598706, 6137 },
+{ IMG_ChurchMosaic, 0x59af62, 46080 },
+{ PAL_ChurchMosaic, 0x5a6362, 720 },
+{ MSK_ChurchMosaic, 0x5a6632, 2445 },
+{ FRM_ChurchPuzzle1, 0x5a72b1, 980 },
+{ FRM_ChurchPuzzle2, 0x5a7685, 945 },
+{ FRM_ChurchPuzzle3, 0x5a7a36, 1794 },
+{ FRM_ChurchPuzzle13, 0x5a8138, 2240 },
+{ FRM_ChurchPuzzle4, 0x5a89f8, 2106 },
+{ FRM_ChurchPuzzle5, 0x5a9232, 1260 },
+{ FRM_ChurchPuzzle6, 0x5a971e, 1036 },
+{ FRM_ChurchPuzzle7, 0x5a9b2a, 1053 },
+{ FRM_ChurchPuzzle8, 0x5a9f47, 6 },
+{ FRM_ChurchPuzzle9, 0x5a9f4d, 26980 },
+{ FRM_ChurchPuzzle10, 0x5b08b1, 120 },
+{ FRM_ChurchPuzzle11, 0x5b0929, 11607 },
+{ FRM_ChurchPuzzle12, 0x5b3680, 20 },
+{ FRM_ChurchPuzzle14, 0x5b3694, 2904 },
+{ TXT_ChurchPuzzle, 0x5b48ff, 1587 },
+{ IMG_ChurchPuzzle, 0x5b4f32, 46080 },
+{ PAL_ChurchPuzzle, 0x5c0332, 624 },
+{ MSK_ChurchPuzzle, 0x5c05a2, 1992 },
+{ BOX_ChurchPuzzle, 0x5c0d6a, 1280 },
+{ DAT_InsideChurch, 0x5c4c4c, 5973 },
+{ TXT_InsideChurch, 0x5c6c80, 1070 },
+{ IMG_InsideChurch, 0x5c70ae, 46080 },
+{ PAL_InsideChurch, 0x5d24ae, 624 },
+{ MSK_InsideChurch, 0x5d271e, 2352 },
+{ BOX_InsideChurch, 0x5d304e, 1280 },
+{ DAT_OutsideChurch, 0x5d85a5, 6017 },
+{ DLG_OutsideChurch, 0x5db1b7, 5130 },
+{ FRM_OutsideChurch8, 0x5dc901, 27365 },
+{ FRM_OutsideChurch9, 0x5e33e6, 58 },
+{ FRM_OutsideChurch1, 0x5e3420, 1869 },
+{ FRM_OutsideChurch2, 0x5e3b6d, 20 },
+{ FRM_OutsideChurch3, 0x5e3b81, 2472 },
+{ FRM_OutsideChurch4, 0x5e4529, 16 },
+{ FRM_OutsideChurch5, 0x5e4539, 5147 },
+{ FRM_OutsideChurch6, 0x5e5954, 14 },
+{ FRM_OutsideChurch7, 0x5e5962, 5145 },
+{ FRM_OutsideChurch10, 0x5e6d7b, 6805 },
+{ FRM_OutsideChurch11, 0x5e8810, 14 },
+{ FRM_OutsideChurch12, 0x5e881e, 5145 },
+{ TXT_OutsideChurch, 0x5ea30b, 1427 },
+{ IMG_OutsideChurch, 0x5ea89e, 46080 },
+{ PAL_OutsideChurch, 0x5f5c9e, 624 },
+{ MSK_OutsideChurch, 0x5f5f0e, 3264 },
+{ BOX_OutsideChurch, 0x5f6bce, 1280 },
+{ DAT_SpringBridge, 0x625302, 6017 },
+{ WLK_Bridge1, 0x626a83, 134 },
+{ WLK_Bridge2, 0x626b09, 2546 },
+{ DLG_SpringPhotographer, 0x628de2, 15460 },
+{ DAT_SpringRock, 0x630ae2, 6195 },
+{ WLK_Bridge3, 0x632315, 134 },
+{ WLK_Bridge4, 0x63239b, 2546 },
+{ FRM_SpringRock1, 0x63310d, 84 },
+{ FRM_SpringRock2, 0x633161, 759 },
+{ FRM_SpringRock3, 0x633458, 5145 },
+{ FRM_SpringRock4, 0x634871, 4508 },
+{ FRM_SpringRock5, 0x635a0d, 13364 },
+{ FRM_SpringRock6, 0x638e41, 54 },
+{ FRM_SpringBridge1, 0x638f05, 24 },
+{ FRM_SpringBridge2, 0x638f1d, 4410 },
+{ TXT_SpringBridge, 0x63a73a, 1071 },
+{ IMG_SpringBridge, 0x63ab69, 46080 },
+{ PAL_SpringBridge, 0x645f69, 720 },
+{ MSK_SpringBridge, 0x646239, 3936 },
+{ BOX_SpringBridge, 0x647199, 1280 },
+{ DAT_Library, 0x64bfcb, 7325 },
+{ DLG_Library, 0x64f1a1, 3573 },
+{ FRM_Library1, 0x650154, 2254 },
+{ FRM_Library2, 0x650a22, 18823 },
+{ FRM_Library3, 0x6553a9, 50 },
+{ FRM_Library4, 0x6553db, 1440 },
+{ FRM_Library5, 0x65597b, 14616 },
+{ TXT_Library2, 0x6594f9, 237 },
+{ TXT_Library, 0x659ce0, 2033 },
+{ IMG_Library, 0x65a4d1, 46080 },
+{ PAL_Library, 0x6658d1, 624 },
+{ MSK_Library, 0x665b41, 2217 },
+{ BOX_Library, 0x6663ea, 1280 },
+{ ANM_PhilipLauraIntro, 0x728451, 29824 },
+{ AOF_PhilipLauraIntro, 0x72f8d1, 74 },
+{ ANM_LauraIntro, 0x72f91b, 12793 },
+{ AOF_LauraIntro, 0x732b14, 48 },
+{ TXT_SpringBridgeIntro, 0x7330ee, 1846 },
+{ IMG_SpringBridgeIntro, 0x733824, 46080 },
+{ PAL_SpringBridgeIntro, 0x73ec24, 720 },
+{ TXT_SpringRock, 0x73f5fb, 1374 },
+{ IMG_SpringRock, 0x73fb59, 46080 },
+{ PAL_SpringRock, 0x74af59, 720 },
+{ MSK_SpringRock, 0x74b229, 3117 },
+{ BOX_SpringRock, 0x74be56, 1280 },
+{ PAL_TitleScreen, 0x74c6ec, 768 },
+{ IMG_TitleScreen, 0x74c9ec, 64000 },
+{ PAL_PenduloStudios, 0x75c464, 768 },
+{ IMG_PenduloStudios, 0x75c764, 64000 },
+{ PAL_GraphicAdventure, 0x76c1dc, 768 },
+{ IMG_GraphicAdventure, 0x76c4dc, 64000 },
+{ PAL_Presents, 0x77bf54, 768 },
+{ IMG_Presents, 0x77c254, 64000 },
+{ PAL_OptikSoftware, 0x78bccc, 768 },
+{ IMG_OptikSoftware, 0x78bfcc, 64000 },
+{ IMG_Meanwhile, 0x7c8e01, 46080 },
+{ IMG_OptionsButton, 0x7e1bd0, 2106 },
+{ IMG_OptionsMenu, 0x7e240a, 36800 },
+{ CMF_8, 0x7eb7a7, 4926 },
+{ CMF_9, 0x7ecae5, 6249 },
+{ CMF_10, 0x7ee34e, 5982 },
+{ CMF_11, 0x7efaac, 12793 },
+{ CMF_12, 0x7f2ca5, 22275 },
+{ CMF_2_1, 0x7f8622, 4111 },
+{ CMF_2_2, 0x7f9631, 4303 },
+{ CMF_2_3, 0x7fa700, 4343 },
+{ CMF_2_4, 0x7fb7f7, 5943 },
+{ CMF_3, 0x7fcf2e, 5898 },
+{ CMF_4, 0x7fe638, 3133 },
+{ CMF_7_1, 0x7ff275, 4671 },
+{ CMF_7_2, 0x8004b4, 646 },
+{ CMF_7_3, 0x80073a, 2014 },
+{ CMF_7_4, 0x800f18, 1369 },
+{ FRM_IgorDirBack, 0x80e23d, 10500 },
+{ FRM_IgorDirRight, 0x810b41, 13500 },
+{ FRM_IgorDirFront, 0x813ffd, 10500 },
+{ FRM_IgorDirLeft, 0x816901, 13500 },
+{ FRM_IgorHead, 0x819dbd, 3696 },
+{ IMG_VerbsPanel, 0x8233d5, 3840 },
+{ TXT_MainTable, 0x8242d5, 28028 },
+{ IMG_RomanNumbersPaper, 0x82b499, 46080 },
+{ PAL_RomanNumbersPaper, 0x836899, 624 },
+{ FRM_NumbersPaper1, 0x836d33, 51163 },
+{ FRM_NumbersPaper2, 0x84350e, 40 },
+{ IMG_NewsPaper, 0x843804, 46080 },
+{ PAL_NewsPaper, 0x84ec04, 624 },
+{ IMG_PhotoHarrisonMargaret, 0x84f37e, 46080 },
+{ PAL_PhotoHarrisonMargaret, 0x85a77e, 624 },
+{ IMG_InventoryPanel, 0x85b0fb, 9600 },
+{ IMG_Objects, 0x85d67b, 48000 },
+{ DAT_Physicsclassroom, 0x358da6, 6017 },
+{ DAT_ParkRight, 0x37dbdf, 6133 },
+{ DAT_ParkLeft, 0x382a08, 5969 },
+{ FRM_Park1, 0x3a0550, 30376 },
+{ FRM_Park2, 0x3a7bf8, 62 },
+{ FRM_Park3, 0x3a7c36, 3969 },
+{ FRM_Park4, 0x3a8bb7, 3150 },
+{ TXT_Park, 0x3a9ef0, 1638 },
+{ IMG_Park, 0x3aa556, 46080 },
+{ PAL_Park, 0x3b5956, 624 },
+{ MSK_Park, 0x3b5bc6, 4728 },
+{ BOX_Park, 0x3b6e3e, 1280 },
+{ DAT_Decanato, 0x5faf7d, 6345 },
+{ FRM_Decanato1, 0x603929, 2058 },
+{ FRM_Decanato2, 0x604133, 2520 },
+{ FRM_Decanato3, 0x604b0b, 420 },
+{ FRM_Decanato4, 0x604caf, 296 },
+{ FRM_Decanato5, 0x604dd7, 2520 },
+{ DAT_DeanPepperOffice, 0x66b623, 6417 },
+{ DAT_AdministrationSecretaryRoom, 0x6719a1, 6417 },
+{ TXT_AdministrationSecretaryRoom, 0x68577c, 1595 },
+{ IMG_AdministrationSecretaryRoom, 0x685db7, 46080 },
+{ PAL_AdministrationSecretaryRoom, 0x6911b7, 624 },
+{ MSK_AdministrationSecretaryRoom, 0x691427, 2400 },
+{ BOX_AdministrationSecretaryRoom, 0x691d87, 1280 },
+{ FRM_DeanPepperOffice1, 0x698392, 2448 },
+{ FRM_DeanPepperOffice2, 0x698d22, 2254 },
+{ FRM_DeanPepperOffice3, 0x6995f0, 2744 },
+{ FRM_DeanPepperOffice4, 0x69a0a8, 2652 },
+{ FRM_DeanPepperOffice5, 0x69ab04, 2842 },
+{ FRM_DeanPepperOffice6, 0x69b61e, 2842 },
+{ FRM_DeanPepperOffice7, 0x69c138, 4293 },
+{ FRM_DeanPepperOffice8, 0x69d1fd, 3850 },
+{ FRM_DeanPepperOffice9, 0x69e107, 4704 },
+{ FRM_DeanPepperOffice10, 0x69f367, 1800 },
+{ FRM_DeanPepperOffice11, 0x69fa6f, 3480 },
+{ FRM_DeanPepperOffice12, 0x6a0807, 20 },
+{ FRM_DeanPepperOffice13, 0x6a081b, 5075 },
+{ FRM_DeanPepperOffice14, 0x6a1bee, 620 },
+{ FRM_DeanPepperOffice15, 0x6a1e5a, 18298 },
+{ FRM_DeanPepperOffice16, 0x6a65d4, 38 },
+{ TXT_DeanPepperOffice, 0x6a6d15, 1763 },
+{ IMG_DeanPepperOffice, 0x6a73f8, 46080 },
+{ PAL_DeanPepperOffice, 0x6b27f8, 624 },
+{ MSK_DeanPepperOffice, 0x6b2a68, 2745 },
+{ BOX_DeanPepperOffice, 0x6b3521, 1280 },
+{ DAT_StudentDormitoryRoom, 0x70e410, 6673 },
+{ TXT_StudentDormitoryRoom, 0x719624, 1517 },
+{ IMG_StudentDormitoryRoom, 0x719c11, 46080 },
+{ PAL_StudentDormitoryRoom, 0x725011, 624 },
+{ MSK_StudentDormitoryRoom, 0x725311, 6699 },
+{ BOX_StudentDormitoryRoom, 0x726d3c, 1280 },
+{ FRM_IgorDirBack2, 0x801663, 10500 },
+{ FRM_IgorDirRight2, 0x803f67, 13500 },
+{ FRM_IgorDirFront2, 0x807423, 10500 },
+{ FRM_IgorDirLeft2, 0x809d27, 13500 },
+{ FRM_IgorHead2, 0x80d1e3, 3696 },
+{ PAL_DecanatoLeft, 0x61edd5, 624 },
+{ IMG_DecanatoLeft, 0x6139d5, 46080 },
+{ MSK_DecanatoLeft, 0x61f045, 5766 },
+{ BOX_DecanatoLeft, 0x6206cb, 1280 },
+{ PAL_DecanatoRight, 0x611741, 624 },
+{ IMG_DecanatoRight, 0x606341, 46080 },
+{ MSK_DecanatoRight, 0x6119b1, 3858 },
+{ BOX_DecanatoRight, 0x6128c3, 1280 },
+{ TXT_DecanatoLeft, 0x6134da, 1275 },
+{ TXT_DecanatoRight, 0x605e9e, 1187 },
+{ WLK_DecanatoLeft, 0x5fc846, 120 },
+{ WLK_DecanatoRight, 0x60355d, 120 },
+{ DAT_DecanatoPart11, 0x601d1c, 6209 },
+{ DAT_AdministrationCorridor, 0x6b7a39, 6745 },
+{ ANM_AdministrationCorridor, 0x6b97c2, 11085 },
+{ TXT_AdministrationCorridor, 0x6bc9fa, 1488 },
+{ IMG_AdministrationCorridor, 0x6bcfca, 46080 },
+{ PAL_AdministrationCorridor, 0x6c83ca, 624 },
+{ MSK_AdministrationCorridor, 0x6c863a, 2388 },
+{ BOX_AdministrationCorridor, 0x6c8f8e, 1280 },
+{ ANM_AdministrationSecretaryRoom1, 0x6772cd, 3384 },
+{ ANM_AdministrationSecretaryRoom2, 0x678005, 507 },
+{ ANM_AdministrationSecretaryRoom3, 0x678200, 19928 },
+{ ANM_AdministrationSecretaryRoom4, 0x67cfd8, 2352 },
+{ ANM_AdministrationSecretaryRoom5, 0x67d908, 2000 },
+{ ANM_AdministrationSecretaryRoom6, 0x67e0d8, 6372 },
+{ ANM_AdministrationSecretaryRoom7, 0x67f9bc, 5300 },
+{ ANM_AdministrationSecretaryRoom8, 0x680e70, 2160 },
+{ ANM_AdministrationSecretaryRoom9, 0x6816e0, 14749 },
+{ ANM_DecanatoHamburger, 0x5fcb3a, 4998 },
+{ TXT_ParkRight, 0x3934b6, 1164 },
+{ IMG_ParkRight, 0x393942, 46080 },
+{ PAL_ParkRight, 0x39ed42, 624 },
+{ MSK_ParkRight, 0x39efb2, 3972 },
+{ BOX_ParkRight, 0x39ff36, 1280 },
+{ DLG_DeanPepperOffice, 0x694318, 15490 },
+{ ANM_StudentDormitoryRoom1, 0x710303, 4608 },
+{ ANM_StudentDormitoryRoom2, 0x711503, 1144 },
+{ ANM_StudentDormitoryRoom3, 0x71197b, 7104 },
+{ ANM_StudentDormitoryRoom4, 0x71353b, 3472 },
+{ ANM_StudentDormitoryRoom5, 0x7142cb, 3234 },
+{ ANM_StudentDormitoryRoom6, 0x714f6d, 288 },
+{ ANM_StudentDormitoryRoom7, 0x71508d, 3000 },
+{ ANM_StudentDormitoryRoom8, 0x715c45, 3300 },
+{ ANM_StudentDormitoryRoom9, 0x716929, 5600 },
+{ ANM_StudentDormitoryRoom10, 0x717f09, 2058 },
+{ ANM_StudentDormitoryRoom11, 0x718713, 2058 },
+{ DAT_OutsideStudentDormitory, 0x6cc257, 6109 },
+{ TXT_OutsideStudentDormitory, 0x6daea5, 1361 },
+{ IMG_OutsideStudentDormitory, 0x6db3f6, 46080 },
+{ PAL_OutsideStudentDormitory, 0x6e67f6, 624 },
+{ MSK_OutsideStudentDormitory, 0x6e6a66, 1524 },
+{ BOX_OutsideStudentDormitory, 0x6e705a, 1280 },
+{ ANM_OutsideStudentDormitory1, 0x6cdd96, 216 },
+{ ANM_OutsideStudentDormitory2, 0x6cde6e, 3612 },
+{ ANM_OutsideStudentDormitory3, 0x6cec8a, 1968 },
+{ ANM_OutsideStudentDormitory4, 0x6cf43a, 437 },
+{ ANM_OutsideStudentDormitory5, 0x6cf5ef, 208 },
+{ ANM_OutsideStudentDormitory6, 0x6cf6bf, 36480 },
+{ ANM_OutsideStudentDormitory7, 0x6d853f, 80 },
+{ ANM_OutsideStudentDormitory8, 0x6d858f, 8720 },
+{ DAT_StudentDormitoryAttic, 0x6ed382, 7843 },
+{ TXT_StudentDormitoryAttic, 0x6fbd20, 1893 },
+{ IMG_StudentDormitoryAttic, 0x6fc485, 46080 },
+{ PAL_StudentDormitoryAttic, 0x707885, 624 },
+{ MSK_StudentDormitoryAttic, 0x707af5, 4545 },
+{ BOX_StudentDormitoryAttic, 0x708cb6, 1280 },
+{ ANM_StudentDormitoryAttic1, 0x6ef825, 700 },
+{ ANM_StudentDormitoryAttic2, 0x6efae1, 220 },
+{ ANM_StudentDormitoryAttic3, 0x6efbbd, 40 },
+{ ANM_StudentDormitoryAttic4, 0x6efbe5, 5439 },
+{ ANM_StudentDormitoryAttic5, 0x6f1124, 5439 },
+{ ANM_StudentDormitoryAttic6, 0x6f2663, 1404 },
+{ ANM_StudentDormitoryAttic7, 0x6f2bdf, 3600 },
+{ ANM_StudentDormitoryAttic8, 0x6f39ef, 4872 },
+{ ANM_StudentDormitoryAttic9, 0x6f4cf7, 2058 },
+{ ANM_StudentDormitoryAttic10, 0x6f5501, 3300 },
+{ ANM_StudentDormitoryAttic11, 0x6f61e5, 5643 },
+{ ANM_StudentDormitoryAttic12, 0x6f77f0, 576 },
+{ ANM_StudentDormitoryAttic13, 0x6f7a30, 12925 },
+{ ANM_StudentDormitoryAttic14, 0x6facad, 2400 },
+{ DLG_AdministrationSecretaryRoom, 0x674902, 10031 },
+{ DLG_ParkLady, 0x38772d, 1555 },
+{ DLG_ParkLaura, 0x3858fa, 2854 },
+{ FRM_ParkLaura1, 0x387eb8, 40622 },
+{ FRM_ParkLaura2, 0x391d66, 114 },
+{ FRM_ParkLaura3, 0x391dd8, 48 },
+{ FRM_ParkRight1, 0x391e56, 3969 },
+{ DAT_MazeEntrance, 0x23e7c5, 5617 },
+{ FRM_MazeEntrance1, 0x3473ce, 6061 },
+{ TXT_MazeEntrance, 0x303ee5, 1313 },
+{ IMG_MazeEntrance, 0x304406, 46080 },
+{ PAL_MazeEntrance, 0x30f806, 624 },
+{ MSK_MazeEntrance, 0x30fa76, 1884 },
+{ BOX_MazeEntrance, 0x3101d2, 1280 },
+{ DAT_Maze51, 0x345d9d, 5173 },
+{ TXT_Maze51, 0x349271, 1313 },
+{ IMG_Maze51, 0x349792, 46080 },
+{ PAL_Maze51, 0x354b92, 624 },
+{ MSK_Maze51, 0x354e02, 873 },
+{ BOX_Maze51, 0x35516b, 1280 },
+{ DAT_Maze52, 0x334efc, 5173 },
+{ TXT_Maze52, 0x336ba9, 1313 },
+{ IMG_Maze52, 0x3370ca, 46080 },
+{ PAL_Maze52, 0x3424ca, 624 },
+{ MSK_Maze52, 0x34273a, 1128 },
+{ BOX_Maze52, 0x342ba2, 1280 },
+{ DAT_Maze53, 0x3243b1, 5173 },
+{ TXT_Maze53, 0x326062, 1313 },
+{ IMG_Maze53, 0x326583, 46080 },
+{ PAL_Maze53, 0x331983, 624 },
+{ MSK_Maze53, 0x331bf3, 267 },
+{ BOX_Maze53, 0x331cfe, 1280 },
+{ DAT_Maze54, 0x31336b, 5173 },
+{ TXT_Maze54, 0x315014, 1313 },
+{ IMG_Maze54, 0x315535, 46080 },
+{ PAL_Maze54, 0x320935, 624 },
+{ MSK_Maze54, 0x320ba5, 1278 },
+{ BOX_Maze54, 0x3210a3, 1280 },
+{ DAT_Maze55, 0x30221e, 5197 },
+{ DAT_Maze56, 0x2f12cc, 5197 },
+{ TXT_Maze56, 0x2f2fa7, 1313 },
+{ IMG_Maze56, 0x2f34c8, 46080 },
+{ PAL_Maze56, 0x2fe8c8, 624 },
+{ MSK_Maze56, 0x2feb38, 1017 },
+{ BOX_Maze56, 0x2fef31, 1280 },
+{ DAT_Maze57, 0x2dfb7b, 5197 },
+{ TXT_Maze57, 0x2e1846, 1313 },
+{ IMG_Maze57, 0x2e1d67, 46080 },
+{ PAL_Maze57, 0x2ed167, 624 },
+{ MSK_Maze57, 0x2ed3d7, 2058 },
+{ BOX_Maze57, 0x2edbe1, 1280 },
+{ DAT_Maze58, 0x2ceaa9, 5197 },
+{ TXT_Maze58, 0x2d0784, 1313 },
+{ IMG_Maze58, 0x2d0ca5, 46080 },
+{ PAL_Maze58, 0x2dc0a5, 624 },
+{ MSK_Maze58, 0x2dc315, 1254 },
+{ BOX_Maze58, 0x2dc7fb, 1280 },
+{ DAT_Maze59, 0x2bd0f4, 5897 },
+{ TXT_Maze59, 0x2bf077, 1313 },
+{ IMG_Maze59, 0x2bf598, 46080 },
+{ PAL_Maze59, 0x2ca998, 624 },
+{ MSK_Maze59, 0x2cac08, 1992 },
+{ BOX_Maze59, 0x2cb3d0, 1280 },
+{ DAT_Maze60, 0x2abfe4, 5197 },
+{ TXT_Maze60, 0x2adcbf, 1313 },
+{ IMG_Maze60, 0x2ae1e0, 46080 },
+{ PAL_Maze60, 0x2b95e0, 624 },
+{ MSK_Maze60, 0x2b9850, 1404 },
+{ BOX_Maze60, 0x2b9dcc, 1280 },
+{ DAT_Maze61, 0x29a7bf, 5221 },
+{ TXT_Maze61, 0x29c4b8, 1313 },
+{ IMG_Maze61, 0x29c9d9, 46080 },
+{ PAL_Maze61, 0x2a7dd9, 624 },
+{ MSK_Maze61, 0x2a8049, 2256 },
+{ BOX_Maze61, 0x2a8919, 1280 },
+{ DAT_Maze62, 0x288e80, 5221 },
+{ TXT_Maze62, 0x28ab81, 1313 },
+{ IMG_Maze62, 0x28b0a2, 46080 },
+{ PAL_Maze62, 0x2964a2, 624 },
+{ MSK_Maze62, 0x296712, 2139 },
+{ BOX_Maze62, 0x296f6d, 1280 },
+{ DAT_Maze63, 0x27750f, 5221 },
+{ TXT_Maze63, 0x279208, 1313 },
+{ IMG_Maze63, 0x279729, 46080 },
+{ PAL_Maze63, 0x284b29, 624 },
+{ MSK_Maze63, 0x284d99, 2034 },
+{ BOX_Maze63, 0x28558b, 1280 },
+{ DAT_Maze64, 0x265778, 5221 },
+{ TXT_Maze64, 0x267451, 1313 },
+{ IMG_Maze64, 0x267972, 46080 },
+{ PAL_Maze64, 0x272d72, 624 },
+{ MSK_Maze64, 0x272fe2, 3273 },
+{ BOX_Maze64, 0x273cab, 1280 },
+{ DAT_Maze65, 0x254299, 5245 },
+{ TXT_Maze65, 0x255f94, 1313 },
+{ IMG_Maze65, 0x2564b5, 46080 },
+{ PAL_Maze65, 0x2618b5, 624 },
+{ MSK_Maze65, 0x261b25, 3366 },
+{ BOX_Maze65, 0x26284b, 1280 },
+{ DAT_Maze66, 0x242da9, 5781 },
+{ TXT_Maze66, 0x244ccc, 1313 },
+{ IMG_Maze66, 0x2451ed, 46080 },
+{ PAL_Maze66, 0x2505ed, 624 },
+{ MSK_Maze66, 0x25085d, 2364 },
+{ BOX_Maze66, 0x251199, 1280 },
+{ DAT_OutsideMaze, 0x1f9faf, 6205 },
+{ TXT_OutsideMaze, 0x1fc0d2, 1016 },
+{ IMG_OutsideMaze, 0x1fc4ca, 46080 },
+{ PAL_OutsideMaze, 0x2078ca, 576 },
+{ MSK_OutsideMaze, 0x207b3a, 2511 },
+{ BOX_OutsideMaze, 0x208509, 1280 },
+{ DAT_Part70, 0x1b13ab, 5945 },
+{ ANM_Part70, 0x1b2c86, 4290 },
+{ TXT_Part70, 0x1b4427, 997 },
+{ IMG_Part70, 0x1b480c, 46080 },
+{ PAL_Part70, 0x1bfc0c, 624 },
+{ MSK_Part70, 0x1bfe7c, 1212 },
+{ BOX_Part70, 0x1c0338, 1280 },
+{ DAT_Part72, 0x1c44ff, 6181 },
+{ ANM_Part72, 0x1c5fb6, 5235 },
+{ TXT_Part72, 0x1c7b1f, 1111 },
+{ IMG_Part72, 0x1c7f76, 46080 },
+{ PAL_Part72, 0x1d3376, 624 },
+{ MSK_Part72, 0x1d35e6, 5325 },
+{ BOX_Part72, 0x1d4ab3, 1280 },
+{ DAT_Part68, 0x20d24c, 6113 },
+{ DLG_Part68, 0x2105b8, 13774 },
+{ ANM_Part68, 0x213dfa, 28857 },
+{ TXT_Part68, 0x21b5aa, 1595 },
+{ IMG_Part68, 0x21bbe5, 46080 },
+{ PAL_Part68, 0x226fe5, 624 },
+{ MSK_Part68, 0x227255, 5499 },
+{ BOX_Part68, 0x2287d0, 1280 },
+{ DAT_Part81, 0xd6861, 6137 },
+{ DLG_Part81, 0xd9545, 6820 },
+{ ANM_Part81, 0xec5dd, 53065 },
+{ TXT_Part81, 0xf9c28, 2115 },
+{ IMG_Part81, 0xfa46b, 46080 },
+{ PAL_Part81, 0x10586b, 624 },
+{ MSK_Part81, 0x105adb, 2718 },
+{ BOX_Part81, 0x106579, 1280 },
+{ ANM_Part81Cutscene, 0xe01ab, 49944 },
+{ IMG_Part81Strip, 0xdb0d9, 20520 },
+{ PAL_Part74, 0x18e46f, 624 },
+{ IMG_Part74, 0x18306f, 46080 },
+{ TXT_Part74, 0x182b54, 1307 },
+{ ANM_Part74, 0x18107c, 5598 },
+{ DAT_Part71, 0x22b962, 6273 },
+{ ANM_Part71, 0x22d3fd, 5160 },
+{ TXT_Part71, 0x22ef1b, 1389 },
+{ IMG_Part71, 0x22f488, 46080 },
+{ PAL_Part71, 0x23a888, 624 },
+{ MSK_Part71, 0x23aaf8, 2586 },
+{ BOX_Part71, 0x23b512, 1280 },
+{ DAT_Part69, 0x1d900f, 6041 },
+{ ANM_Part69, 0x1dabc4, 58485 },
+{ TXT_Part69, 0x1e974b, 1400 },
+{ IMG_Part69, 0x1e9cc3, 46080 },
+{ PAL_Part69, 0x1f50c3, 624 },
+{ MSK_Part69, 0x1f5333, 3546 },
+{ BOX_Part69, 0x1f610d, 1280 },
+{ DAT_Part32, 0x562a5c, 6109 },
+{ TXT_Part32, 0x586eec, 1272 },
+{ IMG_Part32, 0x5873e4, 46080 },
+{ PAL_Part32, 0x5927e4, 624 },
+{ MSK_Part32, 0x592a54, 3237 },
+{ BOX_Part32, 0x5936f9, 1280 },
+{ IMG_Part32Lock, 0x57ac4f, 46080 },
+{ PAL_Part32Lock, 0x58604f, 624 },
+{ MSK_Part32Lock, 0x5862bf, 1401 },
+{ ANM_Part32Digits, 0x57a8fb, 420 },
+{ ANM_Part32Tower, 0x5717cf, 34105 },
+{ TXT_Part32Tower, 0x571442, 909 },
+{ PAL_Part32Tower, 0x579d08, 624 },
+{ IMG_Part32Girl, 0x564eee, 46080 },
+{ PAL_Part32Girl, 0x5702ee, 768 },
+{ ANM_Part32Girl, 0x5705ee, 2907 },
+{ DAT_Part77, 0x139d04, 6777 },
+{ ANM_Part77, 0x13ba45, 26666 },
+{ TXT_Part77, 0x142952, 1433 },
+{ IMG_Part77, 0x142eeb, 46080 },
+{ PAL_Part77, 0x14e2eb, 624 },
+{ MSK_Part77, 0x14e55b, 4974 },
+{ BOX_Part77, 0x14f8c9, 1280 },
+{ ANM_Part78, 0x119105, 64402 },
+{ TXT_Part78, 0x129357, 1828 },
+{ IMG_Part78, 0x129a7b, 46080 },
+{ PAL_Part78, 0x134e7b, 768 },
+{ BOX_Part78, 0x13517e, 1280 },
+{ IMG_Part78Layer2, 0x10dea7, 45388 },
+{ ANM_Part78Frames, 0x107ff7, 14756 },
+{ IMG_Part78MinutesLater, 0x79ba9d, 46080 },
+{ IMG_Part78NextDay, 0x7bd928, 46080 },
+{ ANM_Part73, 0x1a0a0f, 6890 },
+{ TXT_Part73, 0x1a2bbc, 1274 },
+{ IMG_Part73, 0x1a30b6, 46080 },
+{ PAL_Part73, 0x1ae4b6, 624 },
+{ MSK_Part73, 0x1ae726, 636 },
+{ BOX_Part73, 0x1ae9a2, 1280 },
+{ IMG_Part73Card, 0x7b244f, 46080 },
+{ ANM_Part80, 0x18f5ce, 19328 },
+{ TXT_Part80, 0x194802, 1428 },
+{ IMG_Part80, 0x194d96, 46080 },
+{ PAL_Part80, 0x1a0196, 768 },
+{ MSK_Part80, 0x1a0496, 3 },
+{ BOX_Part80, 0x1a0499, 1280 },
+{ DAT_Part76, 0x154250, 6137 },
+{ ANM_Part76, 0x155e87, 31576 },
+{ TXT_Part76, 0x15e0da, 1867 },
+{ IMG_Part76, 0x15e825, 46080 },
+{ PAL_Part76, 0x169c25, 624 },
+{ MSK_Part76, 0x169e95, 2760 },
+{ BOX_Part76, 0x16a95d, 1280 },
+{ IMG_Part76Card, 0x7a6f76, 46080 },
+{ PAL_Part79, 0xd161c, 768 },
+{ IMG_Part79, 0xc621c, 46080 },
+{ TXT_Part79, 0xc6066, 438 },
+{ IMG_Part79Layer2, 0xba9b1, 46080 },
+{ ANM_Part79, 0xaad62, 64517 },
+{ ANM_Part79Frames, 0xa3eba, 28086 },
+{ IMG_Part79b, 0x98277, 46080 },
+{ TXT_Part79b, 0x97e9f, 984 },
+{ ANM_Part79bFrames, 0x8810a, 63364 },
+{ ANM_Part79bLayer2, 0x80074, 32788 },
+{ ANM_Part79bScenes, 0x7254b, 55847 },
+{ TXT_Part79bMain, 0x97ae8, 297 },
+{ IMG_Credits1, 0x60457, 64000 },
+{ PAL_Credits1, 0x6fe57, 768 },
+{ IMG_Credits2, 0x50373, 64000 },
+{ PAL_Credits2, 0x5fd73, 768 },
+{ IMG_Credits3, 0x40329, 64000 },
+{ PAL_Credits3, 0x4fd29, 768 },
+{ IMG_Credits4, 0x30352, 64000 },
+{ PAL_Credits4, 0x3fd52, 768 },
+{ IMG_Credits5, 0x20375, 64000 },
+{ PAL_Credits5, 0x2fd75, 768 },
+{ IMG_Credits6, 0x1038a, 64000 },
+{ PAL_Credits6, 0x1fd8a, 768 },
+{ IMG_Credits7, 0x3b3, 64000 },
+{ PAL_Credits7, 0xfdb3, 768 },
+{ DLG_Part8Intercom, 0x692f9a, 461 },
+{ TXT_OptionsButtons, 0x7defb3, 25 },
+{ TXT_OptionsSettings, 0x7df318, 210 },
+{ TXT_OptionsTitle, 0x7dfa22, 14 },
+{ TXT_OptionsQuit, 0x7dfcec, 25 },
+{ DAT_FloppyProtectionWords, 0x7de6ab, 1400 },
+{ TXT_FloppyProtectionScreen, 0x7d4213, 80 },
+{ TXT_FloppyProtectionReply, 0x7d4b7e, 46 },
+{ TXT_OptionsSaveTitle, 0x7e0929, 29 },
+{ TXT_OptionsLoadTitle, 0x7e0bec, 22 },
+{ TXT_OptionsNoSavedGames, 0x7e0bd3, 25 },
+{ TXT_OptionsDescribeSave, 0x7e03d3, 20 },
+{ DAT_OptionsNameChars, 0x7e03e7, 32 },
+{ TXT_Part81ObjectNames, 0xd2f90, 11 },
+{ TXT_Credits1, 0x6007d, 82 },
+{ TXT_Credits2, 0x50033, 61 },
+{ TXT_Credits3, 0x4005c, 26 },
+{ TXT_Credits4, 0x3007f, 32 },
+{ TXT_Credits5, 0x20094, 46 },
+{ TXT_Credits6, 0x100bd, 26 },
+{ TXT_Credits7, 0x8, 82 },
+
+// TODO: Verify the English floppy counterpart for FRM_IgorIntroLogo.
+// TODO: Verify the English floppy counterpart for IMG_IgorIntroLogo.
+// TODO: Verify the English floppy counterpart for PAL_IgorIntroLogo.
diff --git a/devtools/create_igor/resource_ids.h b/devtools/create_igor/resource_ids.h
new file mode 100644
index 00000000000..7c9f41ff39a
--- /dev/null
+++ b/devtools/create_igor/resource_ids.h
@@ -0,0 +1,922 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#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_CollegeCorridorChemistryClass 59
+#define FRM_CollegeCorridorChemistryClass1 60
+#define FRM_CollegeCorridorChemistryClass2 61
+#define FRM_CollegeCorridorChemistryClass3 62
+#define FRM_CollegeCorridorChemistryClass4 63
+#define TXT_CollegeCorridorChemistryClass 64
+#define IMG_CollegeCorridorChemistryClass 65
+#define PAL_CollegeCorridorChemistryClass 66
+#define MSK_CollegeCorridorChemistryClass 67
+#define BOX_CollegeCorridorChemistryClass 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_CollegeCorridorLadiesRoom 78
+#define FRM_CollegeCorridorLadiesRoom1 79
+#define FRM_CollegeCorridorLadiesRoom2 80
+#define FRM_CollegeCorridorLadiesRoom3 81
+#define FRM_CollegeCorridorLadiesRoom4 82
+#define TXT_CollegeCorridorLadiesRoom 83
+#define IMG_CollegeCorridorLadiesRoom 84
+#define PAL_CollegeCorridorLadiesRoom 85
+#define MSK_CollegeCorridorLadiesRoom 86
+#define BOX_CollegeCorridorLadiesRoom 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 CMF_1 1275
+#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_Decanato 346
+#define FRM_Decanato1 347
+#define FRM_Decanato2 348
+#define FRM_Decanato3 349
+#define FRM_Decanato4 350
+#define FRM_Decanato5 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
+#define STR_ShinyThing 449
+
+
+// Decanato panels
+#define PAL_DecanatoLeft 900
+#define IMG_DecanatoLeft 901
+#define MSK_DecanatoLeft 902
+#define BOX_DecanatoLeft 903
+#define TXT_DecanatoLeft 908
+#define PAL_DecanatoRight 904
+#define IMG_DecanatoRight 905
+#define MSK_DecanatoRight 906
+#define BOX_DecanatoRight 907
+#define TXT_DecanatoRight 909
+// Walk line used for scroll
+#define WLK_DecanatoLeft 910
+#define WLK_DecanatoRight 911
+#define DAT_DecanatoPart11 912
+
+// CD-only intro card shown by state 850. All three resources are contiguous in
+// NE segment 209 immediately after the intro code.
+#define FRM_IgorIntroLogo 913
+#define IMG_IgorIntroLogo 914
+#define PAL_IgorIntroLogo 915
+
+#define DAT_AdministrationCorridor 916
+#define ANM_AdministrationCorridor 917
+#define TXT_AdministrationCorridor 918
+#define IMG_AdministrationCorridor 919
+#define PAL_AdministrationCorridor 920
+#define MSK_AdministrationCorridor 921
+#define BOX_AdministrationCorridor 922
+
+#define ANM_DecanatoHamburger 932
+
+#define TXT_ParkRight 933
+#define IMG_ParkRight 934
+#define PAL_ParkRight 935
+#define MSK_ParkRight 936
+#define BOX_ParkRight 937
+
+#define DLG_DeanPepperOffice 938
+
+#define ANM_StudentDormitoryRoom1 939
+#define ANM_StudentDormitoryRoom2 940
+#define ANM_StudentDormitoryRoom3 941
+#define ANM_StudentDormitoryRoom4 942
+#define ANM_StudentDormitoryRoom5 943
+#define ANM_StudentDormitoryRoom6 944
+#define ANM_StudentDormitoryRoom7 945
+#define ANM_StudentDormitoryRoom8 946
+#define ANM_StudentDormitoryRoom9 947
+#define ANM_StudentDormitoryRoom10 948
+#define ANM_StudentDormitoryRoom11 949
+
+
+#define DAT_OutsideStudentDormitory 950
+#define TXT_OutsideStudentDormitory 951
+#define IMG_OutsideStudentDormitory 952
+#define PAL_OutsideStudentDormitory 953
+#define MSK_OutsideStudentDormitory 954
+#define BOX_OutsideStudentDormitory 955
+#define ANM_OutsideStudentDormitory1 956
+#define ANM_OutsideStudentDormitory2 957
+#define ANM_OutsideStudentDormitory3 958
+#define ANM_OutsideStudentDormitory4 959
+#define ANM_OutsideStudentDormitory5 960
+#define ANM_OutsideStudentDormitory6 961
+#define ANM_OutsideStudentDormitory7 962
+#define ANM_OutsideStudentDormitory8 963
+
+#define DAT_StudentDormitoryAttic 964
+#define TXT_StudentDormitoryAttic 965
+#define IMG_StudentDormitoryAttic 966
+#define PAL_StudentDormitoryAttic 967
+#define MSK_StudentDormitoryAttic 968
+#define BOX_StudentDormitoryAttic 969
+#define ANM_StudentDormitoryAttic1 970
+#define ANM_StudentDormitoryAttic2 971
+#define ANM_StudentDormitoryAttic3 972
+#define ANM_StudentDormitoryAttic4 973
+#define ANM_StudentDormitoryAttic5 974
+#define ANM_StudentDormitoryAttic6 975
+#define ANM_StudentDormitoryAttic7 976
+#define ANM_StudentDormitoryAttic8 977
+#define ANM_StudentDormitoryAttic9 978
+#define ANM_StudentDormitoryAttic10 979
+#define ANM_StudentDormitoryAttic11 980
+#define ANM_StudentDormitoryAttic12 981
+#define ANM_StudentDormitoryAttic13 982
+#define ANM_StudentDormitoryAttic14 983
+
+#define ANM_AdministrationSecretaryRoom1 923
+#define ANM_AdministrationSecretaryRoom2 924
+#define ANM_AdministrationSecretaryRoom3 925
+#define ANM_AdministrationSecretaryRoom4 926
+#define ANM_AdministrationSecretaryRoom5 927
+#define ANM_AdministrationSecretaryRoom6 928
+#define ANM_AdministrationSecretaryRoom7 929
+#define ANM_AdministrationSecretaryRoom8 930
+#define ANM_AdministrationSecretaryRoom9 931
+
+#define DLG_AdministrationSecretaryRoom 984
+
+#define DLG_ParkLady 985
+#define DLG_ParkLaura 986
+#define FRM_ParkLaura1 987
+#define FRM_ParkLaura2 988
+#define FRM_ParkLaura3 989
+#define FRM_ParkRight1 990
+#define DAT_MazeEntrance 991
+#define FRM_MazeEntrance1 992
+#define TXT_MazeEntrance 993
+#define IMG_MazeEntrance 994
+#define PAL_MazeEntrance 995
+#define MSK_MazeEntrance 996
+#define BOX_MazeEntrance 997
+
+// MAZE ROOMS BEGIN
+#define DAT_Maze51 998
+#define TXT_Maze51 999
+#define IMG_Maze51 1000
+#define PAL_Maze51 1001
+#define MSK_Maze51 1002
+#define BOX_Maze51 1003
+#define DAT_Maze52 1004
+#define TXT_Maze52 1005
+#define IMG_Maze52 1006
+#define PAL_Maze52 1007
+#define MSK_Maze52 1008
+#define BOX_Maze52 1009
+#define DAT_Maze53 1010
+#define TXT_Maze53 1011
+#define IMG_Maze53 1012
+#define PAL_Maze53 1013
+#define MSK_Maze53 1014
+#define BOX_Maze53 1015
+#define DAT_Maze54 1016
+#define TXT_Maze54 1017
+#define IMG_Maze54 1018
+#define PAL_Maze54 1019
+#define MSK_Maze54 1020
+#define BOX_Maze54 1021
+#define DAT_Maze55 1022
+#define DAT_Maze56 1023
+#define TXT_Maze56 1024
+#define IMG_Maze56 1025
+#define PAL_Maze56 1026
+#define MSK_Maze56 1027
+#define BOX_Maze56 1028
+#define DAT_Maze57 1029
+#define TXT_Maze57 1030
+#define IMG_Maze57 1031
+#define PAL_Maze57 1032
+#define MSK_Maze57 1033
+#define BOX_Maze57 1034
+#define DAT_Maze58 1035
+#define TXT_Maze58 1036
+#define IMG_Maze58 1037
+#define PAL_Maze58 1038
+#define MSK_Maze58 1039
+#define BOX_Maze58 1040
+#define DAT_Maze59 1041
+#define TXT_Maze59 1042
+#define IMG_Maze59 1043
+#define PAL_Maze59 1044
+#define MSK_Maze59 1045
+#define BOX_Maze59 1046
+#define DAT_Maze60 1047
+#define TXT_Maze60 1048
+#define IMG_Maze60 1049
+#define PAL_Maze60 1050
+#define MSK_Maze60 1051
+#define BOX_Maze60 1052
+#define DAT_Maze61 1053
+#define TXT_Maze61 1054
+#define IMG_Maze61 1055
+#define PAL_Maze61 1056
+#define MSK_Maze61 1057
+#define BOX_Maze61 1058
+#define DAT_Maze62 1059
+#define TXT_Maze62 1060
+#define IMG_Maze62 1061
+#define PAL_Maze62 1062
+#define MSK_Maze62 1063
+#define BOX_Maze62 1064
+#define DAT_Maze63 1065
+#define TXT_Maze63 1066
+#define IMG_Maze63 1067
+#define PAL_Maze63 1068
+#define MSK_Maze63 1069
+#define BOX_Maze63 1070
+#define DAT_Maze64 1071
+#define TXT_Maze64 1072
+#define IMG_Maze64 1073
+#define PAL_Maze64 1074
+#define MSK_Maze64 1075
+#define BOX_Maze64 1076
+#define DAT_Maze65 1077
+#define TXT_Maze65 1078
+#define IMG_Maze65 1079
+#define PAL_Maze65 1080
+#define MSK_Maze65 1081
+#define BOX_Maze65 1082
+#define DAT_Maze66 1083
+#define TXT_Maze66 1084
+#define IMG_Maze66 1085
+#define PAL_Maze66 1086
+#define MSK_Maze66 1087
+#define BOX_Maze66 1088
+#define DAT_OutsideMaze 1089
+#define TXT_OutsideMaze 1090
+#define IMG_OutsideMaze 1091
+#define PAL_OutsideMaze 1092
+#define MSK_OutsideMaze 1093
+#define BOX_OutsideMaze 1094
+// MAZE ROOMS END
+
+// State 700 (PART_70)
+#define DAT_Part70 1095
+#define ANM_Part70 1096
+#define TXT_Part70 1097
+#define IMG_Part70 1098
+#define PAL_Part70 1099
+#define MSK_Part70 1100
+#define BOX_Part70 1101
+
+// State 720 (PART_72)
+#define DAT_Part72 1102
+#define ANM_Part72 1103
+#define TXT_Part72 1104
+#define IMG_Part72 1105
+#define PAL_Part72 1106
+#define MSK_Part72 1107
+#define BOX_Part72 1108
+
+// States 680 / 681 (PART_68)
+#define DAT_Part68 1109
+#define DLG_Part68 1110
+#define ANM_Part68 1111
+#define TXT_Part68 1112
+#define IMG_Part68 1113
+#define PAL_Part68 1114
+#define MSK_Part68 1115
+#define BOX_Part68 1116
+
+// States 810 (PART_81) and the cutscene of state 740 (PART_74)
+#define DAT_Part81 1117
+#define DLG_Part81 1118
+#define ANM_Part81 1119
+#define TXT_Part81 1120
+#define IMG_Part81 1121
+#define PAL_Part81 1122
+#define MSK_Part81 1123
+#define BOX_Part81 1124
+#define ANM_Part81Cutscene 1125
+#define IMG_Part81Strip 1126
+#define PAL_Part74 1127
+#define IMG_Part74 1128
+#define TXT_Part74 1129
+#define ANM_Part74 1130
+#define TXT_Part81ObjectNames 1231
+
+// State 710 (PART_71)
+#define DAT_Part71 1131
+#define ANM_Part71 1132
+#define TXT_Part71 1133
+#define IMG_Part71 1134
+#define PAL_Part71 1135
+#define MSK_Part71 1136
+#define BOX_Part71 1137
+
+// State 690 (PART_69)
+#define DAT_Part69 1138
+#define ANM_Part69 1139
+#define TXT_Part69 1140
+#define IMG_Part69 1141
+#define PAL_Part69 1142
+#define MSK_Part69 1143
+#define BOX_Part69 1144
+
+// State 320 (PART_32)
+#define DAT_Part32 1145
+#define TXT_Part32 1146
+#define IMG_Part32 1147
+#define PAL_Part32 1148
+#define MSK_Part32 1149
+#define BOX_Part32 1150
+#define IMG_Part32Lock 1151
+#define PAL_Part32Lock 1152
+#define MSK_Part32Lock 1153
+#define ANM_Part32Digits 1154
+#define ANM_Part32Tower 1155
+#define TXT_Part32Tower 1156
+#define PAL_Part32Tower 1157
+#define IMG_Part32Girl 1158
+#define PAL_Part32Girl 1159
+#define ANM_Part32Girl 1160
+
+// State 770 (PART_77)
+#define DAT_Part77 1161
+#define ANM_Part77 1162
+#define TXT_Part77 1163
+#define IMG_Part77 1164
+#define PAL_Part77 1165
+#define MSK_Part77 1166
+#define BOX_Part77 1167
+
+// State 780 (PART_78)
+#define ANM_Part78 1168
+#define TXT_Part78 1169
+#define IMG_Part78 1170
+#define PAL_Part78 1171
+#define BOX_Part78 1172
+#define IMG_Part78Layer2 1173
+#define ANM_Part78Frames 1174
+#define IMG_Part78MinutesLater 1175
+#define IMG_Part78NextDay 1176
+
+// State 730 (PART_73)
+#define ANM_Part73 1177
+#define TXT_Part73 1178
+#define IMG_Part73 1179
+#define PAL_Part73 1180
+#define MSK_Part73 1181
+#define BOX_Part73 1182
+#define IMG_Part73Card 1183
+
+// State 800 (PART_80), played inside state 730
+#define ANM_Part80 1184
+#define TXT_Part80 1185
+#define IMG_Part80 1186
+#define PAL_Part80 1187
+#define MSK_Part80 1188
+#define BOX_Part80 1189
+
+// State 760 (PART_76)
+#define DAT_Part76 1190
+#define ANM_Part76 1191
+#define TXT_Part76 1192
+#define IMG_Part76 1193
+#define PAL_Part76 1194
+#define MSK_Part76 1195
+#define BOX_Part76 1196
+#define IMG_Part76Card 1197
+
+// States 790 / 791 (PART_79)
+#define PAL_Part79 1198
+#define IMG_Part79 1199
+#define TXT_Part79 1200
+#define IMG_Part79Layer2 1201
+#define ANM_Part79 1202
+#define ANM_Part79Frames 1203
+#define IMG_Part79b 1204
+#define TXT_Part79b 1205
+#define ANM_Part79bFrames 1206
+#define ANM_Part79bLayer2 1207
+#define ANM_Part79bScenes 1208
+#define TXT_Part79bMain 1209
+
+// States 910 .. 970 (credits, PART_CREDITS): picture and palette of every page
+#define IMG_Credits1 1210
+#define PAL_Credits1 1211
+#define IMG_Credits2 1212
+#define PAL_Credits2 1213
+#define IMG_Credits3 1214
+#define PAL_Credits3 1215
+#define IMG_Credits4 1216
+#define PAL_Credits4 1217
+#define IMG_Credits5 1218
+#define PAL_Credits5 1219
+#define IMG_Credits6 1220
+#define PAL_Credits6 1221
+#define IMG_Credits7 1222
+#define PAL_Credits7 1223
+
+
+#define DLG_Part8Intercom 1224
+
+#define TXT_OptionsButtons 1225
+#define TXT_OptionsSettings 1226
+#define TXT_OptionsTitle 1227
+#define TXT_OptionsQuit 1228
+#define TXT_OptionsSaveTitle 1229
+#define TXT_OptionsLoadTitle 1230
+#define TXT_OptionsUnavailable 1232
+
+#define TXT_Credits1 1233
+#define TXT_Credits2 1234
+#define TXT_Credits3 1235
+#define TXT_Credits4 1236
+#define TXT_Credits5 1237
+#define TXT_Credits6 1238
+#define TXT_Credits7 1239
+
+#define TXT_MainVerbs 1240
+#define PAL_VerbsPanel 1241
+#define PAL_InventoryPanel 1242
+#define DAT_FloppySentenceColors 1246
+#define IMG_FloppyTitleBackdrop 1249
+
+// Margaret's frames are more in the Spanish Floppy version so we
+// need new ids
+#define FRM_CollegeCorridorMargaretFloppy1 1259
+#define FRM_CollegeCorridorMargaretFloppy2 1260
+#define FRM_CollegeCorridorMargaretFloppy3 1261
+#define FRM_CollegeCorridorMargaretFloppy4 1262
+#define FRM_CollegeCorridorMargaretFloppy5 1263
+#define FRM_CollegeCorridorMargaretFloppy6 1264
+#define FRM_CollegeCorridorMargaretFloppy7 1265
+#define FRM_CollegeCorridorMargaretFloppy8 1266
+
+#define FRM_CollegeCorridorAnnouncementBoardFloppy1 1250
+#define FRM_CollegeCorridorAnnouncementBoardFloppy2 1251
+
+#define FRM_CollegeCorridorMissBarrymoreFloppy1 1267
+#define FRM_CollegeCorridorMissBarrymoreFloppy2 1268
+
+#define FRM_CollegeLockersFloppy1 1271
+#define FRM_CollegeLockersFloppy2 1272
+
+#define FRM_CollegeCorridorCarolineFloppy1 1252
+#define FRM_CollegeCorridorCarolineFloppy2 1253
+#define FRM_CollegeCorridorCarolineFloppy3 1254
+#define FRM_CollegeCorridorCarolineFloppy4 1255
+#define FRM_CollegeCorridorCarolineFloppy5 1256
+
+#define FRM_CollegeCorridorChemistryClassFloppy1 1269
+#define FRM_CollegeCorridorChemistryClassFloppy2 1270
+
+#define FRM_CollegeStairsSecondFloorFloppy1 1273
+#define FRM_CollegeStairsSecondFloorFloppy2 1274
+
+#define DAT_CollegeCorridorMathClass 1276
+#define TXT_CollegeCorridorMathClass 1277
+#define IMG_CollegeCorridorMathClass 1278
+#define PAL_CollegeCorridorMathClass 1279
+#define MSK_CollegeCorridorMathClass 1280
+#define BOX_CollegeCorridorMathClass 1281
+#define DAT_FloppyProtectionWords 1282
+#define TXT_FloppyProtectionScreen 1283
+#define TXT_FloppyProtectionReply 1284
+#define TXT_OptionsDescribeSave 1285
+#define DAT_OptionsNameChars 1286
+#define TXT_OptionsNoSavedGames 1287
+#define FRM_CollegeCorridorLadiesRoomFloppy1 1257
+#define FRM_CollegeCorridorLadiesRoomFloppy2 1258
+
+#endif // IGOR_RESOURCE_IDS
diff --git a/devtools/create_igor/resource_sp_cdrom.h b/devtools/create_igor/resource_sp_cdrom.h
new file mode 100644
index 00000000000..14fb25463cd
--- /dev/null
+++ b/devtools/create_igor/resource_sp_cdrom.h
@@ -0,0 +1,703 @@
+{ 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_ParkRight, 0x3dffa2, 1160 }, // cseg104:01AB-0244; seg104:06A2..0B29
+{ IMG_ParkRight, 0x3e042a, 46080 }, // cseg104:006B-0095; seg104:0B2A..BF29
+{ PAL_ParkRight, 0x3eb82a, 624 }, // cseg104:0010-0039; seg104:BF2A..C199
+{ MSK_ParkRight, 0x3eba9a, 3972 }, // cseg104:00D7-01A8; seg104:C19A..D11D
+{ BOX_ParkRight, 0x3eca1e, 1280 }, // cseg104:009A-00C3; seg104:D11E..D61D
+{ 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 }, // cseg110:28F7-291A copies 0x1781 bytes from seg110:36B4
+{ DLG_CollegeStairsFirstFloor, 0x425fcd, 2753 }, // seg111:ECD..198E; byte-identical post-load image at src+2753 = seg111:198E
+{ DLG_OutsideCollege, 0x4283b5, 965 }, // cseg111:2CE8-2D08 loads resource 111; seg111:32B5..367A
+{ 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_CollegeCorridorChemistryClass, 0x4752aa, 5993 },
+{ FRM_CollegeCorridorChemistryClass1, 0x4789d6, 3630 },
+{ FRM_CollegeCorridorChemistryClass2, 0x479804, 7752 },
+{ FRM_CollegeCorridorChemistryClass3, 0x47b64c, 5676 },
+{ FRM_CollegeCorridorChemistryClass4, 0x47cc78, 6762 },
+{ TXT_CollegeCorridorChemistryClass, 0x47eea2, 1331 },
+{ IMG_CollegeCorridorChemistryClass, 0x47f3d5, 46080 },
+{ PAL_CollegeCorridorChemistryClass, 0x48a7d5, 624 },
+{ MSK_CollegeCorridorChemistryClass, 0x48aa45, 3144 },
+{ BOX_CollegeCorridorChemistryClass, 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 },
+{ BOX_CollegeCorridorCaroline, 0x4a8374, 1280 }, // seg125 stub at seg125:2, block 5: src 0xcd74 len 0x500; follows MSK contiguously
+{ DAT_CollegeCorridorLadiesRoom, 0x4ab255, 6109 },
+{ FRM_CollegeCorridorLadiesRoom1, 0x4ae9d6, 2592 }, // seg127 stub at seg127:2, block 0: src 0xd6 len 0xa20
+{ FRM_CollegeCorridorLadiesRoom2, 0x4af3f6, 1225 }, // block 1: src 0xaf6 len 0x4c9, dest +0xa20
+{ FRM_CollegeCorridorLadiesRoom3, 0x4af8bf, 6480 }, // block 2: src 0xfbf len 0x1950, dest +0xee9
+{ FRM_CollegeCorridorLadiesRoom4, 0x4b120f, 1140 }, // block 3: src 0x290f len 0x474, dest +0x2839
+{ FRM_SpringBridge1, 0x4b16f4, 24 },
+{ FRM_SpringBridge2, 0x4b170c, 4410 },
+{ TXT_CollegeCorridorLadiesRoom, 0x4b2fa2, 1333 },
+{ IMG_CollegeCorridorLadiesRoom, 0x4b34d7, 46080 },
+{ PAL_CollegeCorridorLadiesRoom, 0x4be8d7, 624 },
+{ MSK_CollegeCorridorLadiesRoom, 0x4beb47, 3297 },
+{ BOX_CollegeCorridorLadiesRoom, 0x4bf828, 1280 },
+{ DAT_CollegeCorridorMargaret, 0x4c2ff1, 6273 },
+{ DLG_CollegeCorridorMargaret, 0x4c7973, 6980 }, // cseg130+0x0F73 (offset literal repeated 30x in cseg130's dialogue loader, same role as 0x0ECD x29 in cseg111 for part 30). Size 6980: replySoundsOffset(6878) + (50 + 1) * 2 == 6980 exactly, with questionSoundsOffset = 6980 - (10 + 50 + 1) * 2 = 6858 giving questions 1199..1207,0 and replies 1208..1216 at 6878. NOTE: an earlier note here claimed 6982 -- that came from resource.cpp's off-by-one-word derived formula (now fixed); 6980 is correct. The 64-byte duplicate head at src+6980 confirms the end only coincidentally (trailing slots are zero)
+{ 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_Decanato, 0x67949c, 6345 },
+{ FRM_Decanato1, 0x683f0d, 2058 },
+{ FRM_Decanato2, 0x684717, 2520 },
+{ FRM_Decanato3, 0x6850ef, 420 },
+{ FRM_Decanato4, 0x685293, 296 },
+{ FRM_Decanato5, 0x6853bb, 2520 },
+{ ANM_DecanatoHamburger, 0x4efcee, 0x1386 }, /* cseg134:21AF-21ED */
+{ WLK_DecanatoLeft, 0x67c62e, 120 }, /* cseg175:03E7-0409; segment 175:672E */
+{ WLK_DecanatoRight, 0x68351d, 120 }, /* cseg176:0584-05A6; segment 176:661D */
+{ DAT_DecanatoPart11, 0x68049b, 6209 }, /* PART_11 state 110; cseg176:286F-2882 */
+{ DAT_SpringBridge, 0x6a54a6, 6017 },
+{ WLK_Bridge1, 0x6a83a8, 134 },
+{ WLK_Bridge2, 0x6a842e, 2546 },
+{ DLG_SpringPhotographer, 0x6ae94e, 0x3ce6 }, /* cseg181:11AB-11CE; segment 181:514E */
+{ 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 },
+{ DLG_DeanPepperOffice, 0x7256fe, 0x3d86 },
+{ DLG_AdministrationSecretaryRoom, 0x702a78, 0x27c5 },
+{ DLG_ParkLady, 0x390a6a, 1581 }, // cseg094:2498 loads resource 94; cseg094:24DE-24F1 copies seg94:2E6A (0x62D bytes) to seg94:283D
+{ DLG_ParkLaura, 0x3d3597, 2900 }, // cseg102:0D22 loads resource 102; cseg102:0D64-0D7B copies seg102:1E97 (0xB54 bytes) to seg102:1343
+{ FRM_ParkLaura1, 0x3d58a5, 40622 }, // cseg103:000C-003A copies seg103:00A5..9F52 to ANM+0x5A00
+{ FRM_ParkLaura2, 0x3df753, 114 }, // cseg103:003F-006C copies seg103:9F53..9FC4 to ANM+0xF8AE
+{ FRM_ParkLaura3, 0x3df7c5, 48 }, // cseg103:0071-009E copies seg103:9FC5..9FF4 to ANM+0xF920
+{ FRM_ParkRight1, 0x2053b6, 3969 }, // cseg049:2981-29AF copies seg49:29B6..3936 to ANM+0x5A00; byte-identical to FRM_Park3
+{ DAT_MazeEntrance, 0x28509b, 5617 }, // cseg062:16ED loads resource 62; the DAT is the segment tail seg62:279B..3D8B, used in place
+{ FRM_MazeEntrance1, 0x38dc70, 6061 }, // cseg094:000C-0069 copies seg94:0070 (0x227 bytes) and seg94:0297 (0x1586 bytes) to ANM+0
+{ TXT_MazeEntrance, 0x34a8b3, 1279 }, // cseg086:01BC; seg86:06B3, ends where the picture starts
+{ IMG_MazeEntrance, 0x34adb2, 46080 }, // cseg086:0079-00A6 copies seg86:0BB2 (0xB400 bytes) to layer 1
+{ PAL_MazeEntrance, 0x3561b2, 576 }, // cseg086:0010-0039 copies seg86:BFB2 (0x240 bytes); colors 192..207 come from the Igor palette
+{ MSK_MazeEntrance, 0x356422, 1884 }, // cseg086:00E8 decodes seg86:C222; ends where the area table starts
+{ BOX_MazeEntrance, 0x356b7e, 1280 }, // cseg086:00AB-00D4 copies seg86:C97E (0x500 bytes)
+// MAZE ROOMS BEGIN
+{ DAT_Maze51, 0x38c1c5, 5173 },
+{ TXT_Maze51, 0x3925b3, 1279 },
+{ IMG_Maze51, 0x392ab2, 46080 },
+{ PAL_Maze51, 0x39deb2, 576 },
+{ MSK_Maze51, 0x39e122, 873 },
+{ BOX_Maze51, 0x39e48b, 1280 },
+{ DAT_Maze52, 0x37b3c9, 5173 },
+{ TXT_Maze52, 0x37d4b3, 1279 },
+{ IMG_Maze52, 0x37d9b2, 46080 },
+{ PAL_Maze52, 0x388db2, 576 },
+{ MSK_Maze52, 0x389022, 1128 },
+{ BOX_Maze52, 0x38948a, 1280 },
+{ DAT_Maze53, 0x36a8ef, 5173 },
+{ TXT_Maze53, 0x36c9b3, 1279 },
+{ IMG_Maze53, 0x36ceb2, 46080 },
+{ PAL_Maze53, 0x3782b2, 576 },
+{ MSK_Maze53, 0x378522, 267 },
+{ BOX_Maze53, 0x37862d, 1280 },
+{ DAT_Maze54, 0x35986d, 5173 },
+{ TXT_Maze54, 0x35b9b3, 1279 },
+{ IMG_Maze54, 0x35beb2, 46080 },
+{ PAL_Maze54, 0x3672b2, 576 },
+{ MSK_Maze54, 0x367522, 1278 },
+{ BOX_Maze54, 0x367a20, 1280 },
+{ DAT_Maze55, 0x3487c7, 5197 },
+{ DAT_Maze56, 0x3378a6, 5197 },
+{ TXT_Maze56, 0x3399b3, 1279 },
+{ IMG_Maze56, 0x339eb2, 46080 },
+{ PAL_Maze56, 0x3452b2, 576 },
+{ MSK_Maze56, 0x345522, 1017 },
+{ BOX_Maze56, 0x34591b, 1280 },
+{ DAT_Maze57, 0x326139, 5197 },
+{ TXT_Maze57, 0x3282b3, 1279 },
+{ IMG_Maze57, 0x3287b2, 46080 },
+{ PAL_Maze57, 0x333bb2, 576 },
+{ MSK_Maze57, 0x333e22, 2058 },
+{ BOX_Maze57, 0x33462c, 1280 },
+{ DAT_Maze58, 0x315098, 5197 },
+{ TXT_Maze58, 0x3171b3, 1279 },
+{ IMG_Maze58, 0x3176b2, 46080 },
+{ PAL_Maze58, 0x322ab2, 576 },
+{ MSK_Maze58, 0x322d22, 1254 },
+{ BOX_Maze58, 0x323208, 1280 },
+{ DAT_Maze59, 0x3037ec, 5897 },
+{ TXT_Maze59, 0x305bb3, 1279 },
+{ IMG_Maze59, 0x3060b2, 46080 },
+{ PAL_Maze59, 0x3114b2, 576 },
+{ MSK_Maze59, 0x311722, 1992 },
+{ BOX_Maze59, 0x311eea, 1280 },
+{ DAT_Maze60, 0x2f2787, 5197 },
+{ TXT_Maze60, 0x2f48b3, 1279 },
+{ IMG_Maze60, 0x2f4db2, 46080 },
+{ PAL_Maze60, 0x3001b2, 576 },
+{ MSK_Maze60, 0x300422, 1404 },
+{ BOX_Maze60, 0x30099e, 1280 },
+{ DAT_Maze61, 0x2e1005, 5221 },
+{ TXT_Maze61, 0x2e31b3, 1279 },
+{ IMG_Maze61, 0x2e36b2, 46080 },
+{ PAL_Maze61, 0x2eeab2, 576 },
+{ MSK_Maze61, 0x2eed22, 2256 },
+{ BOX_Maze61, 0x2ef5f2, 1280 },
+{ DAT_Maze62, 0x2cf68c, 5221 },
+{ TXT_Maze62, 0x2d18b3, 1279 },
+{ IMG_Maze62, 0x2d1db2, 46080 },
+{ PAL_Maze62, 0x2dd1b2, 576 },
+{ MSK_Maze62, 0x2dd422, 2139 },
+{ BOX_Maze62, 0x2ddc7d, 1280 },
+{ DAT_Maze63, 0x2bdd17, 5221 },
+{ TXT_Maze63, 0x2bfeb3, 1279 },
+{ IMG_Maze63, 0x2c03b2, 46080 },
+{ PAL_Maze63, 0x2cb7b2, 576 },
+{ MSK_Maze63, 0x2cba22, 2034 },
+{ BOX_Maze63, 0x2cc214, 1280 },
+{ DAT_Maze64, 0x2ac028, 5221 },
+{ TXT_Maze64, 0x2ae1b3, 1279 },
+{ IMG_Maze64, 0x2ae6b2, 46080 },
+{ PAL_Maze64, 0x2b9ab2, 576 },
+{ MSK_Maze64, 0x2b9d22, 3273 },
+{ BOX_Maze64, 0x2ba9eb, 1280 },
+{ DAT_Maze65, 0x29aaf2, 5245 },
+{ TXT_Maze65, 0x29ccb3, 1279 },
+{ IMG_Maze65, 0x29d1b2, 46080 },
+{ PAL_Maze65, 0x2a85b2, 576 },
+{ MSK_Maze65, 0x2a8822, 3366 },
+{ BOX_Maze65, 0x2a9548, 1280 },
+{ DAT_Maze66, 0x289560, 5781 },
+{ TXT_Maze66, 0x28b9b3, 1279 },
+{ IMG_Maze66, 0x28beb2, 46080 },
+{ PAL_Maze66, 0x2972b2, 576 },
+{ MSK_Maze66, 0x297522, 2364 },
+{ BOX_Maze66, 0x297e5e, 1280 },
+{ DAT_OutsideMaze, 0x23b5f1, 6205 },
+{ TXT_OutsideMaze, 0x23dbb3, 1001 },
+{ IMG_OutsideMaze, 0x23df9c, 46080 },
+{ PAL_OutsideMaze, 0x24939c, 576 },
+{ MSK_OutsideMaze, 0x24960c, 2511 },
+{ BOX_OutsideMaze, 0x249fdb, 1280 },
+// MAZE ROOMS END
+{ 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 },
+{ ANM_AdministrationSecretaryRoom1, 0x7057d5, 0x0d38 }, /* cseg192:000C-0036 */
+{ ANM_AdministrationSecretaryRoom2, 0x70650d, 0x01fb }, /* cseg192:003B-0069 */
+{ ANM_AdministrationSecretaryRoom3, 0x706708, 0x4dd8 }, /* cseg192:006E-009C */
+{ ANM_AdministrationSecretaryRoom4, 0x70b4e0, 0x0930 }, /* cseg192:00A1-00CF */
+{ ANM_AdministrationSecretaryRoom5, 0x70be10, 0x07d0 }, /* cseg192:00D4-0102 */
+{ ANM_AdministrationSecretaryRoom6, 0x70c5e0, 0x18e4 }, /* cseg192:0107-0135 */
+{ ANM_AdministrationSecretaryRoom7, 0x70dec4, 0x14b4 }, /* cseg192:013A-0168 */
+{ ANM_AdministrationSecretaryRoom8, 0x70f378, 0x0870 }, /* cseg192:016D-019B */
+{ ANM_AdministrationSecretaryRoom9, 0x70fbe8, 0x399d }, /* cseg192:01A0-01CE */
+{ 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_StudentDormitoryRoom1, 0x7a843b, 0x1200 }, // cseg207:000C-003B
+{ ANM_StudentDormitoryRoom2, 0x7a963b, 0x0478 }, // cseg207:003B-006E
+{ ANM_StudentDormitoryRoom3, 0x7a9ab3, 0x1bc0 }, // cseg207:006E-00A1
+{ ANM_StudentDormitoryRoom4, 0x7ab673, 0x0d90 }, // cseg207:00A1-00D4
+{ ANM_StudentDormitoryRoom5, 0x7ac403, 0x0ca2 }, // cseg207:00D4-0107
+{ ANM_StudentDormitoryRoom6, 0x7ad0a5, 0x0120 }, // cseg207:0107-013A
+{ ANM_StudentDormitoryRoom7, 0x7ad1c5, 0x0bb8 }, // cseg207:013A-016D
+{ ANM_StudentDormitoryRoom8, 0x7add7d, 0x0ce4 }, // cseg207:016D-01A0
+{ ANM_StudentDormitoryRoom9, 0x7aea61, 0x15e0 }, // cseg207:01A0-01D3
+{ ANM_StudentDormitoryRoom10, 0x7b0041, 0x080a }, // cseg207:01D3-0206
+{ ANM_StudentDormitoryRoom11, 0x7b084b, 0x080a }, // cseg207:0206-0239
+{ DAT_OutsideStudentDormitory, 0x75ef8f, 0x17dd }, // cseg200:1853-186A; source cseg200:278F
+{ TXT_OutsideStudentDormitory, 0x76f9ad, 0x0549 }, // cseg202:0002; cseg202:06AD-0BF5
+{ IMG_OutsideStudentDormitory, 0x76fef6, 0xb400 }, // cseg202:0002; cseg202:0BF6-BFF5
+{ PAL_OutsideStudentDormitory, 0x77b2f6, 0x0270 }, // cseg202:0002; cseg202:BFF6-C265
+{ MSK_OutsideStudentDormitory, 0x77b566, 0x05f4 }, // cseg202:0002; cseg202:C266-C859
+{ BOX_OutsideStudentDormitory, 0x77bb5a, 0x0500 }, // cseg202:0002; cseg202:C85A-CD59
+{ ANM_OutsideStudentDormitory1, 0x7627a1, 0x00d8 }, // cseg201:000C-0039
+{ ANM_OutsideStudentDormitory2, 0x762879, 0x0e1c }, // cseg201:003E-006B
+{ ANM_OutsideStudentDormitory3, 0x763695, 0x07b0 }, // cseg201:0070-009D
+{ ANM_OutsideStudentDormitory4, 0x763e45, 0x01b5 }, // cseg201:00A2-00CF
+{ ANM_OutsideStudentDormitory5, 0x763ffa, 0x00d0 }, // cseg201:00D4-0101
+{ ANM_OutsideStudentDormitory6, 0x7640ca, 0x8e80 }, // cseg201:0106-0133
+{ ANM_OutsideStudentDormitory7, 0x76cf4a, 0x0050 }, // cseg201:0138-0165
+{ ANM_OutsideStudentDormitory8, 0x76cf9a, 0x2210 }, // cseg201:016A-0197
+{ DAT_StudentDormitoryAttic, 0x7814d7, 0x1ea3 }, // cseg203:41ED-4204; source cseg203:52D7
+{ TXT_StudentDormitoryAttic, 0x7926a2, 0x0744 }, // cseg205:0002; cseg205:06A2-0DE5
+{ IMG_StudentDormitoryAttic, 0x792de6, 0xb400 }, // cseg205:0002; cseg205:0DE6-C1E5
+{ PAL_StudentDormitoryAttic, 0x79e1e6, 0x0270 }, // cseg205:0002; cseg205:C1E6-C455
+{ MSK_StudentDormitoryAttic, 0x79e456, 0x11c1 }, // cseg205:0002; cseg205:C456-D616
+{ BOX_StudentDormitoryAttic, 0x79f617, 0x0500 }, // cseg205:0002; cseg205:D617-DB16
+{ ANM_StudentDormitoryAttic1, 0x7860d3, 0x02bc }, // cseg204:000C-0039
+{ ANM_StudentDormitoryAttic2, 0x78638f, 0x00dc }, // cseg204:003E-006B
+{ ANM_StudentDormitoryAttic3, 0x78646b, 0x0028 }, // cseg204:0070-009D
+{ ANM_StudentDormitoryAttic4, 0x786493, 0x153f }, // cseg204:00A2-00CF
+{ ANM_StudentDormitoryAttic5, 0x7879d2, 0x153f }, // cseg204:00D4-0101
+{ ANM_StudentDormitoryAttic6, 0x788f11, 0x057c }, // cseg204:0106-0133
+{ ANM_StudentDormitoryAttic7, 0x78948d, 0x0e10 }, // cseg204:0138-0165
+{ ANM_StudentDormitoryAttic8, 0x78a29d, 0x1308 }, // cseg204:016A-0197
+{ ANM_StudentDormitoryAttic9, 0x78b5a5, 0x080a }, // cseg204:019C-01C9
+{ ANM_StudentDormitoryAttic10, 0x78bdaf, 0x0ce4 }, // cseg204:01CE-01FB
+{ ANM_StudentDormitoryAttic11, 0x78ca93, 0x160b }, // cseg204:0200-022D
+{ ANM_StudentDormitoryAttic12, 0x78e09e, 0x0240 }, // cseg204:0232-025F
+{ ANM_StudentDormitoryAttic13, 0x78e2de, 0x327d }, // cseg204:0264-0291
+{ ANM_StudentDormitoryAttic14, 0x79155b, 0x0960 }, // cseg204:0296-02C3
+{ 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 },
+{ PAL_DecanatoLeft, 0x69f4b3, 624 },
+{ IMG_DecanatoLeft, 0x6940b3, 46080 },
+{ MSK_DecanatoLeft, 0x69f723, 5766 },
+{ BOX_DecanatoLeft, 0x6a0da9, 1280 },
+{ PAL_DecanatoRight, 0x691d2f, 624 },
+{ IMG_DecanatoRight, 0x68692f, 46080 },
+{ MSK_DecanatoRight, 0x691f9f, 3858 },
+{ BOX_DecanatoRight, 0x692eb1, 1280 },
+{ TXT_DecanatoLeft, 0x693ba2, 1297 }, // cseg179:0002, seg179:06A2..0BB2
+{ TXT_DecanatoRight, 0x6864a2, 1165 }, // cseg178:0002, seg178:06A2..0B2E
+{ FRM_IgorIntroLogo, 0x7c09be, 2678 }, // cseg209:13BE; 206x13 logo subtitle mask
+{ IMG_IgorIntroLogo, 0x7c1434, 39040 }, // cseg209:1E34; 320x122 indexed image
+{ PAL_IgorIntroLogo, 0x7cacb4, 768 }, // cseg209:B6B4; 256-color VGA palette
+{ DAT_AdministrationCorridor, 0x748b32, 6745 }, // cseg197:3732-518A; copied at cseg197:2920-2943
+{ ANM_AdministrationCorridor, 0x74c8d6, 11085 }, // cseg198:00D6-2C22; loaded at cseg198:0002-00D5
+{ TXT_AdministrationCorridor, 0x74fba2, 1518 }, // cseg199:06A2-0C8F
+{ IMG_AdministrationCorridor, 0x750190, 46080 }, // cseg199:0C90-C08F
+{ PAL_AdministrationCorridor, 0x75b590, 624 }, // cseg199:C090-C2FF
+{ MSK_AdministrationCorridor, 0x75b800, 2388 }, // cseg199:C300-CC53
+{ BOX_AdministrationCorridor, 0x75c154, 1280 }, // cseg199:CC54-D153
+{ DAT_OutsideChurch, 0x653b61, 6017 }, // cseg171:35F2-3615; seg171:4461..5BE1
+{ DLG_OutsideChurch, 0x6599e6, 5314 }, // cseg172:0D31-0D54; seg172:24E6..39A7
+{ FRM_OutsideChurch8, 0x65b469, 27365 }, // cseg173:016A-0198; seg173:0269..6D4D
+{ FRM_OutsideChurch9, 0x661f4e, 58 }, // cseg173:019D-01CA; seg173:6D4E..6D87
+{ FRM_OutsideChurch1, 0x661f88, 1869 }, // cseg173:000C-0036; seg173:6D88..74D4
+{ FRM_OutsideChurch2, 0x6626d5, 20 }, // cseg173:003B-0068; seg173:74D5..74E8
+{ FRM_OutsideChurch3, 0x6626e9, 2472 }, // cseg173:006D-009B; seg173:74E9..7E90
+{ FRM_OutsideChurch4, 0x663091, 16 }, // cseg173:00A0-00CD; seg173:7E91..7EA0
+{ FRM_OutsideChurch5, 0x6630a1, 5147 }, // cseg173:00D2-0100; seg173:7EA1..92BB
+{ FRM_OutsideChurch6, 0x6644bc, 14 }, // cseg173:0105-0132; seg173:92BC..92C9
+{ FRM_OutsideChurch7, 0x6644ca, 5145 }, // cseg173:0137-0165; seg173:92CA..A6E2
+{ FRM_OutsideChurch10, 0x6658e3, 6805 }, // cseg173:01CF-01FD; seg173:A6E3..C177
+{ FRM_OutsideChurch11, 0x667378, 14 }, // cseg173:0202-022F; seg173:C178..C185
+{ FRM_OutsideChurch12, 0x667386, 5145 }, // cseg173:0234-0262; seg173:C186..D59E
+{ TXT_OutsideChurch, 0x668f73, 1442 }, // cseg174:01AB-0672; seg174:0673..0C14
+{ IMG_OutsideChurch, 0x669515, 46080 }, // cseg174:006B-0095; seg174:0C15..C014
+{ PAL_OutsideChurch, 0x674915, 624 }, // cseg174:0010-0039; seg174:C015..C284
+{ MSK_OutsideChurch, 0x674b85, 3264 }, // cseg174:00D7-01A8; seg174:C285..CF44
+{ BOX_OutsideChurch, 0x675845, 1280 }, // cseg174:009A-00C3; seg174:CF45..D444
+{ DAT_PhysicsClassroom, 0x3a1960, 6017 },
+{ DAT_ChurchPuzzle, 0x611d87, 6137 },
+{ IMG_ChurchMosaic, 0x615952, 46080 },
+{ PAL_ChurchMosaic, 0x620d52, 720 },
+{ MSK_ChurchMosaic, 0x621022, 2445 },
+{ FRM_ChurchPuzzle1, 0x621cd1, 980 },
+{ FRM_ChurchPuzzle2, 0x6220a5, 945 },
+{ FRM_ChurchPuzzle3, 0x622456, 1794 },
+{ FRM_ChurchPuzzle13, 0x622b58, 2240 },
+{ FRM_ChurchPuzzle4, 0x623418, 2106 },
+{ FRM_ChurchPuzzle5, 0x623c52, 1260 },
+{ FRM_ChurchPuzzle6, 0x62413e, 1036 },
+{ FRM_ChurchPuzzle7, 0x62454a, 1053 },
+{ FRM_ChurchPuzzle8, 0x624967, 6 },
+{ FRM_ChurchPuzzle9, 0x62496d, 26980 },
+{ FRM_ChurchPuzzle10, 0x62b2d1, 120 },
+{ FRM_ChurchPuzzle11, 0x62b349, 11607 },
+{ FRM_ChurchPuzzle12, 0x62e0a0, 20 },
+{ FRM_ChurchPuzzle14, 0x62e0b4, 2904 },
+{ TXT_ChurchPuzzle, 0x62f3a2, 1647 },
+{ IMG_ChurchPuzzle, 0x62fa11, 46080 },
+{ PAL_ChurchPuzzle, 0x63ae11, 624 },
+{ MSK_ChurchPuzzle, 0x63b081, 1992 },
+{ BOX_ChurchPuzzle, 0x63b849, 1280 },
+{ DAT_InsideChurch, 0x63f00c, 5973 },
+{ TXT_InsideChurch, 0x642ca2, 1057 },
+{ IMG_InsideChurch, 0x6430c3, 46080 },
+{ PAL_InsideChurch, 0x64e4c3, 624 },
+{ MSK_InsideChurch, 0x64e733, 2352 },
+{ BOX_InsideChurch, 0x64f063, 1280 },
+{ DLG_TobiasOffice, 0x5a6d2e, 10766 },
+{ DAT_Library, 0x6d1b63, 7325 },
+{ DLG_Library, 0x6d7eb9, 3629 },
+{ FRM_Library1, 0x6d9108, 2254 },
+{ FRM_Library2, 0x6d99d6, 18823 },
+{ FRM_Library3, 0x6de35d, 50 },
+{ FRM_Library4, 0x6de38f, 1440 },
+{ FRM_Library5, 0x6de92f, 14616 },
+{ TXT_Library, 0x6e29b3, 2062 },
+{ IMG_Library, 0x6e31c1, 46080 },
+{ PAL_Library, 0x6ee5c1, 624 },
+{ MSK_Library, 0x6ee831, 2217 },
+{ BOX_Library, 0x6ef0da, 1280 },
+{ TXT_Library2, 0x5348, 234 },
+{ IMG_PhotoHarrisonMargaret, 0x88ac06, 46080 },
+{ PAL_PhotoHarrisonMargaret, 0x896006, 624 },
+{ IMG_RomanNumbersPaper, 0x866eea, 46080 },
+{ PAL_RomanNumbersPaper, 0x8722ea, 624 },
+{ FRM_NumbersPaper1, 0x8728d1, 51163 },
+{ FRM_NumbersPaper2, 0x87f0ac, 40 },
+{ IMG_NewsPaper, 0x87f2f8, 46080 },
+{ PAL_NewsPaper, 0x88a6f8, 624 },
+{ IMG_OptionsButton, 0x85302e, 2106 },
+{ IMG_OptionsMenu, 0x853868, 36800 },
+{ DAT_Part70, 0x1ebe72, 5945 },
+{ ANM_Part70, 0x1d0062, 4290 },
+{ TXT_Part70, 0x1ef8a2, 986 },
+{ IMG_Part70, 0x1efc7c, 46080 },
+{ PAL_Part70, 0x1fb07c, 624 },
+{ MSK_Part70, 0x1fb2ec, 1212 },
+{ BOX_Part70, 0x1fb7a8, 1280 },
+{ DAT_Part72, 0x1ff1c9, 6181 },
+{ ANM_Part72, 0x202a6f, 5235 },
+{ TXT_Part72, 0x206ab3, 1102 },
+{ IMG_Part72, 0x206f01, 46080 },
+{ PAL_Part72, 0x212301, 624 },
+{ MSK_Part72, 0x212571, 5325 },
+{ BOX_Part72, 0x213a3e, 1280 },
+{ DAT_Part68, 0x24e42a, 6113 },
+{ DLG_Part68, 0x256ab7, 14016 },
+{ ANM_Part68, 0x25a76e, 28857 },
+{ TXT_Part68, 0x261fa2, 1598 },
+{ IMG_Part68, 0x2625e0, 46080 },
+{ PAL_Part68, 0x26d9e0, 624 },
+{ MSK_Part68, 0x26dc50, 5499 },
+{ BOX_Part68, 0x26f1cb, 1280 },
+{ DAT_Part81, 0xdcd6b, 6137 },
+{ DLG_Part81, 0xe335c, 6940 },
+{ ANM_Part81, 0xf6809, 53065 },
+{ TXT_Part81, 0x103eb3, 2100 },
+{ TXT_Part81ObjectNames, 0xd9e1b, 16 },
+{ IMG_Part81, 0x1046e7, 46080 },
+{ PAL_Part81, 0x10fae7, 624 },
+{ MSK_Part81, 0x10fd57, 2718 },
+{ BOX_Part81, 0x1107f5, 1280 },
+{ ANM_Part81Cutscene, 0xea3a2, 49944 },
+{ IMG_Part81Strip, 0xe523d, 20520 },
+{ PAL_Part74, 0x1bca8a, 624 },
+{ IMG_Part74, 0x1b168a, 46080 },
+{ TXT_Part74, 0x1b11be, 1228 },
+{ ANM_Part74, 0x776ce, 5598 },
+{ DAT_Part71, 0x271e5c, 6273 },
+{ ANM_Part71, 0x203f4f, 5160 },
+{ TXT_Part71, 0x275cb3, 1411 },
+{ IMG_Part71, 0x276236, 46080 },
+{ PAL_Part71, 0x281636, 624 },
+{ MSK_Part71, 0x2818a6, 2586 },
+{ BOX_Part71, 0x2822c0, 1280 },
+{ DAT_Part69, 0x217833, 6041 },
+{ ANM_Part69, 0x21b0d3, 58485 },
+{ TXT_Part69, 0x229cb3, 1413 },
+{ IMG_Part69, 0x22a238, 46080 },
+{ PAL_Part69, 0x235638, 624 },
+{ MSK_Part69, 0x2358a8, 3546 },
+{ BOX_Part69, 0x236682, 1280 },
+{ DAT_Part32, 0x5dc008, 6109 },
+{ TXT_Part32, 0x600d73, 1310 },
+{ IMG_Part32, 0x601291, 46080 },
+{ PAL_Part32, 0x60c691, 624 },
+{ MSK_Part32, 0x60c901, 3237 },
+{ BOX_Part32, 0x60d5a6, 1280 },
+{ IMG_Part32Lock, 0x5f4a52, 46080 },
+{ PAL_Part32Lock, 0x5ffe52, 624 },
+{ MSK_Part32Lock, 0x6000c2, 1401 },
+{ ANM_Part32Digits, 0x464347, 420 },
+{ ANM_Part32Tower, 0x5ec04e, 34105 },
+{ TXT_Part32Tower, 0x5ebcc9, 901 },
+{ PAL_Part32Tower, 0x5f4587, 624 },
+{ IMG_Part32Girl, 0x5df6d0, 46080 },
+{ PAL_Part32Girl, 0x5eaad0, 768 },
+{ ANM_Part32Girl, 0x5eadd0, 2907 },
+{ DAT_Part77, 0x15a5c2, 6777 },
+{ ANM_Part77, 0x15e36f, 26666 },
+{ TXT_Part77, 0x1652a2, 1445 },
+{ IMG_Part77, 0x165847, 46080 },
+{ PAL_Part77, 0x170c47, 624 },
+{ MSK_Part77, 0x170eb7, 4974 },
+{ BOX_Part77, 0x172225, 1280 },
+{ ANM_Part78, 0x123807, 64402 },
+{ TXT_Part78, 0x133a75, 1792 },
+{ IMG_Part78, 0x134175, 46080 },
+{ PAL_Part78, 0x13f575, 768 },
+{ BOX_Part78, 0x13f878, 1280 },
+{ IMG_Part78Layer2, 0x118541, 45388 },
+{ ANM_Part78Frames, 0x112204, 14756 },
+{ IMG_Part78MinutesLater, 0x13ffb7, 46080 },
+{ IMG_Part78NextDay, 0x14b4b7, 46080 },
+{ ANM_Part73, 0x1ce53d, 6890 },
+{ TXT_Part73, 0x1d2586, 1305 },
+{ IMG_Part73, 0x1d2a9f, 46080 },
+{ PAL_Part73, 0x1dde9f, 624 },
+{ MSK_Part73, 0x1de10f, 636 },
+{ BOX_Part73, 0x1de38b, 1280 },
+{ IMG_Part73Card, 0x1deab7, 46080 },
+{ ANM_Part80, 0x1bce70, 19328 },
+{ TXT_Part80, 0x1c2175, 1443 },
+{ IMG_Part80, 0x1c2718, 46080 },
+{ PAL_Part80, 0x1cdb18, 768 },
+{ MSK_Part80, 0x1cde18, 3 },
+{ BOX_Part80, 0x1cde1b, 1280 },
+{ DAT_Part76, 0x176346, 6137 },
+{ ANM_Part76, 0x18539f, 31576 },
+{ TXT_Part76, 0x18d6a2, 1864 },
+{ IMG_Part76, 0x18ddea, 46080 },
+{ PAL_Part76, 0x1991ea, 624 },
+{ MSK_Part76, 0x19945a, 2760 },
+{ BOX_Part76, 0x199f22, 1280 },
+{ IMG_Part76Card, 0x179db7, 46080 },
+{ PAL_Part79, 0xd857e, 768 },
+{ IMG_Part79, 0xcd17e, 46080 },
+{ TXT_Part79, 0xccf93, 491 },
+{ IMG_Part79Layer2, 0xc183d, 46080 },
+{ ANM_Part79, 0xb1ba3, 64517 },
+{ ANM_Part79Frames, 0xaabbd, 28086 },
+{ IMG_Part79b, 0x9ef44, 46080 },
+{ TXT_Part79b, 0x9eb65, 991 },
+{ ANM_Part79bFrames, 0x8f070, 63364 },
+{ ANM_Part79bLayer2, 0x86ed4, 32788 },
+{ ANM_Part79bScenes, 0x7a004, 52397 },
+{ TXT_Part79bMain, 0x4014, 296 },
+{ IMG_Credits1, 0x6596e, 64000 },
+{ PAL_Credits1, 0x7536e, 768 },
+{ IMG_Credits2, 0x55b6e, 64000 },
+{ PAL_Credits2, 0x6556e, 768 },
+{ IMG_Credits3, 0x45d6e, 64000 },
+{ PAL_Credits3, 0x5576e, 768 },
+{ IMG_Credits4, 0x35f6e, 64000 },
+{ PAL_Credits4, 0x4596e, 768 },
+{ IMG_Credits5, 0x2616e, 64000 },
+{ PAL_Credits5, 0x35b6e, 768 },
+{ IMG_Credits6, 0x1636e, 64000 },
+{ PAL_Credits6, 0x25d6e, 768 },
+{ IMG_Credits7, 0x656e, 64000 },
+{ PAL_Credits7, 0x15f6e, 768 },
+{ DLG_Part8Intercom, 0x550339, 467 },
+
+{ TXT_OptionsButtons, 0x850a93, 34 },
+{ TXT_OptionsSettings, 0x850ce5, 351 },
+{ TXT_OptionsTitle, 0x851279, 9 },
+{ TXT_OptionsQuit, 0x8515e5, 27 },
+{ TXT_OptionsSaveTitle, 0x85202a, 32 },
+{ TXT_OptionsLoadTitle, 0x85220e, 61 },
+{ TXT_OptionsDescribeSave, 0x851b52, 26 },
+{ DAT_OptionsNameChars, 0x851b6c, 32 },
+
+{ TXT_Credits1, 0x3aab, 124 },
+{ TXT_Credits2, 0x36cf, 173 },
+{ TXT_Credits3, 0x3347, 137 },
+{ TXT_Credits4, 0x3099, 64 },
+{ TXT_Credits5, 0x2dde, 77 },
+{ TXT_Credits6, 0x2a89, 134 },
+{ TXT_Credits7, 0x27c2, 69 },
diff --git a/devtools/create_igor/resource_sp_floppy.h b/devtools/create_igor/resource_sp_floppy.h
new file mode 100644
index 00000000000..8634329ff96
--- /dev/null
+++ b/devtools/create_igor/resource_sp_floppy.h
@@ -0,0 +1,762 @@
+// Spanish floppy resource catalog.
+// Offsets refer to the original overlay data file (IGOR.DAT), or to the
+// data embedded in IGOR.TBL for the rows marked SOURCE_TBL (offset is filled in by the tool).
+// This catalog is incomplete; unresolved resources remain disabled.
+// Changed resource layouts require corresponding engine support.
+
+{ FRM_PhysicsClassroom1, 0x59b16f, 3100 },
+{ ANM_PhilipVodka, 0x1b32e8, 24175 },
+{ AOF_PhilipVodka, 0x1b9157, 80 },
+{ TXT_PhilipRoom, 0x1b985b, 1208 },
+{ IMG_PhilipRoom, 0x1b9d13, 46080 },
+{ PAL_PhilipRoom, 0x1c5113, 768 },
+{ MSK_PhilipRoom, 0x1c5413, 3 },
+{ BOX_PhilipRoom, 0x1c5416, 1280 },
+{ FRM_ChemistryClassroom1, 0x5add4a, 14 },
+{ FRM_ChemistryClassroom2, 0x5add58, 3332 },
+{ DAT_Physicsclassroom, 0x5997be, 6017 },
+{ TXT_PhysicsClassroom, 0x59c43b, 1149 },
+{ IMG_PhysicsClassroom, 0x59c8b8, 46080 },
+{ PAL_PhysicsClassroom, 0x5a7cb8, 624 },
+{ MSK_PhysicsClassroom, 0x5a7f28, 1557 },
+{ BOX_PhysicsClassroom, 0x5a853d, 1280 },
+{ DAT_ChemistryClassroom, 0x5ac209, 6345 },
+{ TXT_ChemistryClassroom, 0x5af110, 1221 },
+{ IMG_ChemistryClassroom, 0x5af5d5, 46080 },
+{ PAL_ChemistryClassroom, 0x5ba9d5, 624 },
+{ MSK_ChemistryClassroom, 0x5bac45, 1980 },
+{ BOX_ChemistryClassroom, 0x5bb401, 1280 },
+{ DAT_ParkRight, 0x5be1f6, 6133 },
+{ DAT_ParkLeft, 0x5c2cbe, 5969 },
+{ FRM_MenToilets1, 0x6f69ed, 3038 },
+{ FRM_MenToilets2, 0x6f75cb, 1624 },
+{ FRM_Park1, 0x5e028e, 30376 },
+{ FRM_Park2, 0x5e7936, 62 },
+{ FRM_Park3, 0x5e7974, 3969 },
+{ FRM_Park4, 0x5e88f5, 3150 },
+{ TXT_ParkRight, 0x5d320b, 1145 },
+{ IMG_ParkRight, 0x5d3684, 46080 },
+{ PAL_ParkRight, 0x5dea84, 624 },
+{ MSK_ParkRight, 0x5decf4, 3972 },
+{ BOX_ParkRight, 0x5dfc78, 1280 },
+{ TXT_Park, 0x5e9bff, 1729 },
+{ IMG_Park, 0x5ea2c0, 46080 },
+{ PAL_Park, 0x5f56c0, 624 },
+{ MSK_Park, 0x5f5930, 4728 },
+{ BOX_Park, 0x5f6ba8, 1280 },
+{ DAT_CollegeStairsSecondFloor, 0x5fab8a, 6137 },
+// TODO: Identify the floppy counterpart for FRM_CollegeStairsSecondFloor1.
+// TODO: Identify the floppy counterpart for FRM_CollegeStairsSecondFloor2.
+// TODO: Identify the floppy counterpart for FRM_CollegeStairsSecondFloor3.
+{ TXT_CollegeStairsSecondFloor, 0x5ff9b8, 1122 },
+{ IMG_CollegeStairsSecondFloor, 0x5ffe1a, 46080 },
+{ PAL_CollegeStairsSecondFloor, 0x60b21a, 624 },
+{ MSK_CollegeStairsSecondFloor, 0x60b48a, 2469 },
+{ BOX_CollegeStairsSecondFloor, 0x60be2f, 1280 },
+{ DAT_CollegeStairsFirstFloor, 0x60f09d, 5945 },
+{ DLG_CollegeStairsFirstFloor, 0x61185e, 2713 },
+{ DLG_OutsideCollege, 0x70c1d0, 953 },
+{ FRM_CollegeStairsFirstFloor1, 0x6123f3, 40882 },
+{ FRM_CollegeStairsFirstFloor2, 0x61c3a5, 104 },
+{ TXT_CollegeStairsFirstFloor, 0x61cad4, 1225 },
+{ IMG_CollegeStairsFirstFloor, 0x61cf9d, 46080 },
+{ PAL_CollegeStairsFirstFloor, 0x62839d, 624 },
+{ MSK_CollegeStairsFirstFloor, 0x62860d, 2532 },
+{ BOX_CollegeStairsFirstFloor, 0x628ff1, 1280 },
+{ DAT_CollegeCorridorMissBarrymore, 0x62bd61, 5945 },
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorMissBarrymore1.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorMissBarrymore2.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorMissBarrymore3.
+{ TXT_CollegeCorridorMissBarrymore, 0x62f94d, 1351 },
+{ IMG_CollegeCorridorMissBarrymore, 0x62fe94, 46080 },
+{ PAL_CollegeCorridorMissBarrymore, 0x63b294, 624 },
+{ MSK_CollegeCorridorMissBarrymore, 0x63b504, 1737 },
+{ BOX_CollegeCorridorMissBarrymore, 0x63bbcd, 1280 },
+{ DAT_CollegeCorridorAnnouncementBoard, 0x63e935, 5973 },
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorAnnouncementBoard1.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorAnnouncementBoard2.
+{ TXT_CollegeCorridorAnnouncementBoard, 0x643422, 1094 },
+{ IMG_CollegeCorridorAnnouncementBoard, 0x643868, 46080 },
+{ PAL_CollegeCorridorAnnouncementBoard, 0x64ec68, 624 },
+{ MSK_CollegeCorridorAnnouncementBoard, 0x64eed8, 2028 },
+{ BOX_CollegeCorridorAnnouncementBoard, 0x64f6c4, 1280 },
+{ DAT_CollegeCorridorChemistryClass, 0x662f9c, 5973 },
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorChemistryClass1.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorChemistryClass2.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorChemistryClass3.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorChemistryClass4.
+{ TXT_CollegeCorridorChemistryClass, 0x667b79, 1025 },
+{ IMG_CollegeCorridorChemistryClass, 0x667f7a, 46080 },
+{ PAL_CollegeCorridorChemistryClass, 0x67337a, 624 },
+{ MSK_CollegeCorridorChemistryClass, 0x6735ea, 1725 },
+{ BOX_CollegeCorridorChemistryClass, 0x673ca7, 1280 },
+{ DAT_CollegeCorridorCaroline, 0x6781ff, 6301 },
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorCaroline1.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorCaroline3.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorCaroline2.
+{ TXT_CollegeCorridorCaroline, 0x67ee78, 2050 },
+{ IMG_CollegeCorridorCaroline, 0x67f67a, 46080 },
+{ PAL_CollegeCorridorCaroline, 0x68aa7a, 624 },
+{ MSK_CollegeCorridorCaroline, 0x68acea, 1878 },
+{ BOX_CollegeCorridorCaroline, 0x68b440, 1280 },
+{ DAT_CollegeCorridorLadiesRoom, 0x68e2ba, 5973 },
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorLadiesRoom1.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorLadiesRoom2.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorLadiesRoom3.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorLadiesRoom4.
+{ TXT_CollegeCorridorLadiesRoom, 0x6927ff, 1167 },
+{ IMG_CollegeCorridorLadiesRoom, 0x692c8e, 46080 },
+{ PAL_CollegeCorridorLadiesRoom, 0x69e08e, 624 },
+{ MSK_CollegeCorridorLadiesRoom, 0x69e2fe, 2028 },
+{ BOX_CollegeCorridorLadiesRoom, 0x69eaea, 1280 },
+{ FRM_SpringBridge1, 0x89b948, 24 },
+{ FRM_SpringBridge2, 0x89b960, 4410 },
+{ DAT_CollegeCorridorMargaret, 0x6a34c6, 6301 },
+{ DLG_CollegeCorridorMargaret, 0x6a6057, 6860 },
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorMargaret1.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorMargaret2.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorMargaret3.
+// TODO: Identify the floppy counterpart for FRM_CollegeCorridorMargaret4.
+{ TXT_CollegeCorridorMargaret, 0x6b066a, 1611 },
+{ IMG_CollegeCorridorMargaret, 0x6b0cb5, 46080 },
+{ PAL_CollegeCorridorMargaret, 0x6bc0b5, 624 },
+{ MSK_CollegeCorridorMargaret, 0x6bc325, 1962 },
+{ BOX_CollegeCorridorMargaret, 0x6bcacf, 1280 },
+{ DAT_CollegeLockers, 0x6bf951, 5945 },
+// TODO: Identify the floppy counterpart for FRM_CollegeLockers1.
+// TODO: Identify the floppy counterpart for FRM_CollegeLockers2.
+// TODO: Identify the floppy counterpart for FRM_CollegeLockers3.
+{ TXT_CollegeLockers, 0x6c48cc, 1445 },
+{ IMG_CollegeLockers, 0x6c4e71, 46080 },
+{ PAL_CollegeLockers, 0x6d0271, 624 },
+{ MSK_CollegeLockers, 0x6d04e1, 1602 },
+{ BOX_CollegeLockers, 0x6d0b23, 1280 },
+{ DAT_MenToilets, 0x6d48f8, 6465 },
+{ DAT_WomenToilets, 0x6da3cc, 6385 },
+{ FRM_WomenToilets1, 0x6dc035, 854 },
+{ FRM_WomenToilets2, 0x6dc38b, 12 },
+{ FRM_WomenToilets3, 0x6dc397, 2744 },
+{ FRM_WomenToilets4, 0x6dce4f, 12855 },
+{ FRM_WomenToilets5, 0x6e0086, 102 },
+{ TXT_WomenToilets, 0x6e07ac, 1648 },
+{ IMG_WomenToilets, 0x6e0e1c, 46080 },
+{ PAL_WomenToilets, 0x6ec21c, 624 },
+{ MSK_WomenToilets, 0x6ec48c, 2022 },
+{ BOX_WomenToilets, 0x6ecc72, 1280 },
+{ TXT_MenToilets, 0x6f82d7, 1392 },
+{ IMG_MenToilets, 0x6f8847, 46080 },
+{ PAL_MenToilets, 0x703c47, 624 },
+{ MSK_MenToilets, 0x703eb7, 1980 },
+{ BOX_MenToilets, 0x704673, 1280 },
+{ DAT_OutsideCollege, 0x709952, 6777 },
+{ FRM_OutsideCollege1, 0x71396e, 2156 },
+{ FRM_OutsideCollege2, 0x7141da, 4347 },
+{ FRM_OutsideCollege3, 0x7152d5, 693 },
+{ FRM_OutsideCollege4, 0x71558a, 594 },
+{ FRM_OutsideCollege5, 0x7157dc, 10080 },
+{ TXT_OutsideCollege, 0x7185fc, 1818 },
+{ IMG_OutsideCollege, 0x718d16, 46080 },
+{ PAL_OutsideCollege, 0x724116, 624 },
+{ MSK_OutsideCollege, 0x724386, 4974 },
+{ BOX_OutsideCollege, 0x7256f4, 1280 },
+{ DAT_Laboratory, 0x7297d7, 5645 },
+{ FRM_MargaretRoom1, 0x74d6b9, 10408 },
+{ FRM_MargaretRoom2, 0x74ff61, 16 },
+{ FRM_MargaretRoom3, 0x74ff71, 47746 },
+{ FRM_MargaretRoom4, 0x75b9f3, 80 },
+{ TXT_MargaretRoom, 0x75c0ff, 1771 },
+{ IMG_MargaretRoom, 0x75c7ea, 46080 },
+{ PAL_MargaretRoom, 0x767bea, 768 },
+{ MSK_MargaretRoom, 0x767eea, 3 },
+{ BOX_MargaretRoom, 0x767eed, 1280 },
+{ IMG_Meanwhile, 0xa0fd58, 46080 },
+{ FRM_Laboratory1, 0x73919e, 2254 },
+{ FRM_Laboratory2, 0x739a6c, 26218 },
+{ FRM_Laboratory3, 0x7400d6, 128 },
+{ TXT_Laboratory, 0x74080e, 1504 },
+{ IMG_Laboratory, 0x740dee, 46080 },
+{ PAL_Laboratory, 0x74c1ee, 624 },
+{ MSK_Laboratory, 0x74c45e, 2130 },
+{ BOX_Laboratory, 0x74ccb0, 1280 },
+{ DAT_Map, 0x76a800, 6273 },
+{ TXT_Map, 0x76c87b, 1017 },
+{ IMG_Map, 0x76cc74, 46080 },
+{ PAL_Map, 0x778074, 624 },
+{ MSK_Map, 0x7782e4, 1809 },
+{ BOX_Map, 0x7789f5, 1280 },
+{ DAT_TobiasOffice, 0x77c39e, 6109 },
+{ ANM_TobiasOffice1, 0x77de41, 720 },
+{ AOF_TobiasOffice1, 0x77e111, 3584 },
+{ ANM_TobiasOffice2, 0x77ef11, 2052 },
+{ AOF_TobiasOffice2, 0x77f715, 3672 },
+{ TXT_TobiasOffice, 0x780c29, 1887 },
+{ IMG_TobiasOffice, 0x781388, 46080 },
+{ PAL_TobiasOffice, 0x78c788, 624 },
+{ MSK_TobiasOffice, 0x78c9f8, 1002 },
+{ BOX_TobiasOffice, 0x78cde2, 1280 },
+{ DAT_BellChurch, 0x78f990, 5617 },
+{ FRM_BellChurch1, 0x79115b, 40960 },
+{ FRM_BellChurch2, 0x79b15b, 2100 },
+{ TXT_BellChurch, 0x79c043, 1154 },
+{ IMG_BellChurch, 0x79c4c5, 46080 },
+{ PAL_BellChurch, 0x7a78c5, 624 },
+{ MSK_BellChurch, 0x7a7b35, 861 },
+{ BOX_BellChurch, 0x7a7e92, 1280 },
+{ DAT_Decanato, 0x857350, 6345 },
+{ FRM_Decanato1, 0x85fa8e, 2058 },
+{ FRM_Decanato2, 0x860298, 2520 },
+{ FRM_Decanato3, 0x860c70, 420 },
+{ FRM_Decanato4, 0x860e14, 296 },
+{ FRM_Decanato5, 0x860f3c, 2520 },
+{ ANM_DecanatoHamburger, 0x858efd, 4998 },
+{ WLK_DecanatoLeft, 0x858c19, 120 },
+{ WLK_DecanatoRight, 0x85f6dc, 120 },
+{ DAT_DecanatoPart11, 0x85de9b, 6209 },
+{ DAT_SpringBridge, 0x8811f0, 6017 },
+{ WLK_Bridge1, 0x882971, 134 },
+{ WLK_Bridge2, 0x8829f7, 2546 },
+{ DLG_SpringPhotographer, 0x884a81, 15460 },
+{ DAT_SpringRock, 0x893541, 6195 },
+{ WLK_Bridge3, 0x894d74, 134 },
+{ WLK_Bridge4, 0x894dfa, 2546 },
+{ FRM_SpringRock1, 0x895b50, 84 },
+{ FRM_SpringRock2, 0x895ba4, 759 },
+{ FRM_SpringRock3, 0x895e9b, 5145 },
+{ FRM_SpringRock4, 0x8972b4, 4508 },
+{ FRM_SpringRock5, 0x898450, 13364 },
+{ FRM_SpringRock6, 0x89b884, 54 },
+{ TXT_SpringBridge, 0x89d14e, 1082 },
+{ IMG_SpringBridge, 0x89d588, 46080 },
+{ PAL_SpringBridge, 0x8a8988, 720 },
+{ MSK_SpringBridge, 0x8a8c58, 3936 },
+{ BOX_SpringBridge, 0x8a9bb8, 1280 },
+{ DAT_DeanPepperOffice, 0x8cd69e, 6417 },
+{ DLG_DeanPepperOffice, 0x8f5ea7, 15490 },
+{ DLG_AdministrationSecretaryRoom, 0x8d65f0, 10031 },
+{ DLG_ParkLady, 0x5c74d7, 1555 },
+{ DLG_ParkLaura, 0x5c5920, 2854 },
+{ FRM_ParkLaura1, 0x5c7c3c, 40622 },
+{ FRM_ParkLaura2, 0x5d1aea, 114 },
+{ FRM_ParkLaura3, 0x5d1b5c, 48 },
+{ FRM_ParkRight1, 0x5d1bda, 3969 },
+{ DAT_MazeEntrance, 0x2a4125, 5617 },
+{ FRM_MazeEntrance1, 0x3ab369, 6061 },
+{ TXT_MazeEntrance, 0x3684b5, 1315 },
+{ IMG_MazeEntrance, 0x3689d8, 46080 },
+{ PAL_MazeEntrance, 0x373dd8, 624 },
+{ MSK_MazeEntrance, 0x374048, 1884 },
+{ BOX_MazeEntrance, 0x3747a4, 1280 },
+{ DAT_Maze51, 0x3a9d54, 5173 },
+{ TXT_Maze51, 0x3ad1dd, 1315 },
+{ IMG_Maze51, 0x3ad700, 46080 },
+{ PAL_Maze51, 0x3b8b00, 624 },
+{ MSK_Maze51, 0x3b8d70, 873 },
+{ BOX_Maze51, 0x3b90d9, 1280 },
+{ DAT_Maze52, 0x39904c, 5173 },
+{ TXT_Maze52, 0x39acae, 1315 },
+{ IMG_Maze52, 0x39b1d1, 46080 },
+{ PAL_Maze52, 0x3a65d1, 624 },
+{ MSK_Maze52, 0x3a6841, 1128 },
+{ BOX_Maze52, 0x3a6ca9, 1280 },
+{ DAT_Maze53, 0x38869a, 5173 },
+{ TXT_Maze53, 0x38a300, 1315 },
+{ IMG_Maze53, 0x38a823, 46080 },
+{ PAL_Maze53, 0x395c23, 624 },
+{ MSK_Maze53, 0x395e93, 267 },
+{ BOX_Maze53, 0x395f9e, 1280 },
+{ DAT_Maze54, 0x3777ed, 5173 },
+{ TXT_Maze54, 0x37944b, 1315 },
+{ IMG_Maze54, 0x37996e, 46080 },
+{ PAL_Maze54, 0x384d6e, 624 },
+{ MSK_Maze54, 0x384fde, 1278 },
+{ BOX_Maze54, 0x3854dc, 1280 },
+{ DAT_Maze55, 0x366839, 5197 },
+{ DAT_Maze56, 0x355a80, 5197 },
+{ TXT_Maze56, 0x357710, 1315 },
+{ IMG_Maze56, 0x357c33, 46080 },
+{ PAL_Maze56, 0x363033, 624 },
+{ MSK_Maze56, 0x3632a3, 1017 },
+{ BOX_Maze56, 0x36369c, 1280 },
+{ DAT_Maze57, 0x3444c8, 5197 },
+{ TXT_Maze57, 0x346148, 1315 },
+{ IMG_Maze57, 0x34666b, 46080 },
+{ PAL_Maze57, 0x351a6b, 624 },
+{ MSK_Maze57, 0x351cdb, 2058 },
+{ BOX_Maze57, 0x3524e5, 1280 },
+{ DAT_Maze58, 0x33358f, 5197 },
+{ TXT_Maze58, 0x33521f, 1315 },
+{ IMG_Maze58, 0x335742, 46080 },
+{ PAL_Maze58, 0x340b42, 624 },
+{ MSK_Maze58, 0x340db2, 1254 },
+{ BOX_Maze58, 0x341298, 1280 },
+{ DAT_Maze59, 0x321d73, 5897 },
+{ TXT_Maze59, 0x323cab, 1315 },
+{ IMG_Maze59, 0x3241ce, 46080 },
+{ PAL_Maze59, 0x32f5ce, 624 },
+{ MSK_Maze59, 0x32f83e, 1992 },
+{ BOX_Maze59, 0x330006, 1280 },
+{ DAT_Maze60, 0x310dfc, 5197 },
+{ TXT_Maze60, 0x312a8c, 1315 },
+{ IMG_Maze60, 0x312faf, 46080 },
+{ PAL_Maze60, 0x31e3af, 624 },
+{ MSK_Maze60, 0x31e61f, 1404 },
+{ BOX_Maze60, 0x31eb9b, 1280 },
+{ DAT_Maze61, 0x2ff770, 5221 },
+{ TXT_Maze61, 0x30141e, 1315 },
+{ IMG_Maze61, 0x301941, 46080 },
+{ PAL_Maze61, 0x30cd41, 624 },
+{ MSK_Maze61, 0x30cfb1, 2256 },
+{ BOX_Maze61, 0x30d881, 1280 },
+{ DAT_Maze62, 0x2edfca, 5221 },
+{ TXT_Maze62, 0x2efc80, 1315 },
+{ IMG_Maze62, 0x2f01a3, 46080 },
+{ PAL_Maze62, 0x2fb5a3, 624 },
+{ MSK_Maze62, 0x2fb813, 2139 },
+{ BOX_Maze62, 0x2fc06e, 1280 },
+{ DAT_Maze63, 0x2dc7f2, 5221 },
+{ TXT_Maze63, 0x2de4a0, 1315 },
+{ IMG_Maze63, 0x2de9c3, 46080 },
+{ PAL_Maze63, 0x2e9dc3, 624 },
+{ MSK_Maze63, 0x2ea033, 2034 },
+{ BOX_Maze63, 0x2ea825, 1280 },
+{ DAT_Maze64, 0x2cabf4, 5221 },
+{ TXT_Maze64, 0x2cc882, 1315 },
+{ IMG_Maze64, 0x2ccda5, 46080 },
+{ PAL_Maze64, 0x2d81a5, 624 },
+{ MSK_Maze64, 0x2d8415, 3273 },
+{ BOX_Maze64, 0x2d90de, 1280 },
+{ DAT_Maze65, 0x2b98ae, 5245 },
+{ TXT_Maze65, 0x2bb55e, 1315 },
+{ IMG_Maze65, 0x2bba81, 46080 },
+{ PAL_Maze65, 0x2c6e81, 624 },
+{ MSK_Maze65, 0x2c70f1, 3366 },
+{ BOX_Maze65, 0x2c7e17, 1280 },
+{ DAT_Maze66, 0x2a8557, 5781 },
+{ TXT_Maze66, 0x2aa42f, 1315 },
+{ IMG_Maze66, 0x2aa952, 46080 },
+{ PAL_Maze66, 0x2b5d52, 624 },
+{ MSK_Maze66, 0x2b5fc2, 2364 },
+{ BOX_Maze66, 0x2b68fe, 1280 },
+{ DAT_OutsideMaze, 0x24550f, 6205 },
+{ TXT_OutsideMaze, 0x2517ca, 1016 },
+{ IMG_OutsideMaze, 0x251bc2, 46080 },
+{ PAL_OutsideMaze, 0x25cfc2, 576 },
+{ MSK_OutsideMaze, 0x25d232, 2511 },
+{ BOX_OutsideMaze, 0x25dc01, 1280 },
+{ DAT_AdministrationSecretaryRoom, 0x8d3772, 6417 },
+{ TXT_AdministrationSecretaryRoom, 0x8e742b, 1934 },
+{ IMG_AdministrationSecretaryRoom, 0x8e7bb9, 46080 },
+{ PAL_AdministrationSecretaryRoom, 0x8f2fb9, 624 },
+{ MSK_AdministrationSecretaryRoom, 0x8f3229, 2400 },
+{ BOX_AdministrationSecretaryRoom, 0x8f3b89, 1280 },
+{ FRM_DeanPepperOffice1, 0x8ff943, 2448 },
+{ FRM_DeanPepperOffice2, 0x9002d3, 2254 },
+{ FRM_DeanPepperOffice3, 0x900ba1, 2744 },
+{ FRM_DeanPepperOffice4, 0x901659, 2652 },
+{ FRM_DeanPepperOffice5, 0x9020b5, 2842 },
+{ FRM_DeanPepperOffice6, 0x902bcf, 2842 },
+{ FRM_DeanPepperOffice7, 0x9036e9, 4293 },
+{ FRM_DeanPepperOffice8, 0x9047ae, 3850 },
+{ FRM_DeanPepperOffice9, 0x9056b8, 4704 },
+{ FRM_DeanPepperOffice10, 0x906918, 1800 },
+{ FRM_DeanPepperOffice11, 0x907020, 3480 },
+{ FRM_DeanPepperOffice12, 0x907db8, 20 },
+{ FRM_DeanPepperOffice13, 0x907dcc, 5075 },
+{ FRM_DeanPepperOffice14, 0x90919f, 620 },
+{ FRM_DeanPepperOffice15, 0x90940b, 18298 },
+{ FRM_DeanPepperOffice16, 0x90db85, 38 },
+{ TXT_DeanPepperOffice, 0x90e297, 2217 },
+{ IMG_DeanPepperOffice, 0x90eb40, 46080 },
+{ PAL_DeanPepperOffice, 0x919f40, 624 },
+{ MSK_DeanPepperOffice, 0x91a1b0, 2745 },
+{ BOX_DeanPepperOffice, 0x91ac69, 1280 },
+{ ANM_AdministrationSecretaryRoom1, 0x8d8fab, 3384 },
+{ ANM_AdministrationSecretaryRoom2, 0x8d9ce3, 507 },
+{ ANM_AdministrationSecretaryRoom3, 0x8d9ede, 19928 },
+{ ANM_AdministrationSecretaryRoom4, 0x8decb6, 2352 },
+{ ANM_AdministrationSecretaryRoom5, 0x8df5e6, 2000 },
+{ ANM_AdministrationSecretaryRoom6, 0x8dfdb6, 6372 },
+{ ANM_AdministrationSecretaryRoom7, 0x8e169a, 5300 },
+{ ANM_AdministrationSecretaryRoom8, 0x8e2b4e, 2160 },
+{ ANM_AdministrationSecretaryRoom9, 0x8e33be, 14749 },
+{ DAT_StudentDormitoryRoom, 0x989493, 6673 },
+{ TXT_StudentDormitoryRoom, 0x99ffc5, 1997 },
+{ IMG_StudentDormitoryRoom, 0x9a0792, 46080 },
+{ PAL_StudentDormitoryRoom, 0x9abb92, 624 },
+{ MSK_StudentDormitoryRoom, 0x9abe92, 6699 },
+{ BOX_StudentDormitoryRoom, 0x9ad8bd, 1280 },
+{ ANM_StudentDormitoryRoom1, 0x996cd3, 4608 },
+{ ANM_StudentDormitoryRoom2, 0x997ed3, 1144 },
+{ ANM_StudentDormitoryRoom3, 0x99834b, 7104 },
+{ ANM_StudentDormitoryRoom4, 0x999f0b, 3472 },
+{ ANM_StudentDormitoryRoom5, 0x99ac9b, 3234 },
+{ ANM_StudentDormitoryRoom6, 0x99b93d, 288 },
+{ ANM_StudentDormitoryRoom7, 0x99ba5d, 3000 },
+{ ANM_StudentDormitoryRoom8, 0x99c615, 3300 },
+{ ANM_StudentDormitoryRoom9, 0x99d2f9, 5600 },
+{ ANM_StudentDormitoryRoom10, 0x99e8d9, 2058 },
+{ ANM_StudentDormitoryRoom11, 0x99f0e3, 2058 },
+{ DAT_OutsideStudentDormitory, 0x93378b, 6109 },
+{ TXT_OutsideStudentDormitory, 0x948528, 1700 },
+{ IMG_OutsideStudentDormitory, 0x948bcc, 46080 },
+{ PAL_OutsideStudentDormitory, 0x953fcc, 624 },
+{ MSK_OutsideStudentDormitory, 0x95423c, 1524 },
+{ BOX_OutsideStudentDormitory, 0x954830, 1280 },
+{ ANM_OutsideStudentDormitory1, 0x93b453, 216 },
+{ ANM_OutsideStudentDormitory2, 0x93b52b, 3612 },
+{ ANM_OutsideStudentDormitory3, 0x93c347, 1968 },
+{ ANM_OutsideStudentDormitory4, 0x93caf7, 437 },
+{ ANM_OutsideStudentDormitory5, 0x93ccac, 208 },
+{ ANM_OutsideStudentDormitory6, 0x93cd7c, 36480 },
+{ ANM_OutsideStudentDormitory7, 0x945bfc, 80 },
+{ ANM_OutsideStudentDormitory8, 0x945c4c, 8720 },
+{ DAT_StudentDormitoryAttic, 0x95a798, 7843 },
+{ TXT_StudentDormitoryAttic, 0x976c3f, 2752 },
+{ IMG_StudentDormitoryAttic, 0x9776ff, 46080 },
+{ PAL_StudentDormitoryAttic, 0x982aff, 624 },
+{ MSK_StudentDormitoryAttic, 0x982d6f, 4545 },
+{ BOX_StudentDormitoryAttic, 0x983f30, 1280 },
+{ ANM_StudentDormitoryAttic1, 0x96a773, 700 },
+{ ANM_StudentDormitoryAttic2, 0x96aa2f, 220 },
+{ ANM_StudentDormitoryAttic3, 0x96ab0b, 40 },
+{ ANM_StudentDormitoryAttic4, 0x96ab33, 5439 },
+{ ANM_StudentDormitoryAttic5, 0x96c072, 5439 },
+{ ANM_StudentDormitoryAttic6, 0x96d5b1, 1404 },
+{ ANM_StudentDormitoryAttic7, 0x96db2d, 3600 },
+{ ANM_StudentDormitoryAttic8, 0x96e93d, 4872 },
+{ ANM_StudentDormitoryAttic9, 0x96fc45, 2058 },
+{ ANM_StudentDormitoryAttic10, 0x97044f, 3300 },
+{ ANM_StudentDormitoryAttic11, 0x971133, 5643 },
+{ ANM_StudentDormitoryAttic12, 0x97273e, 576 },
+{ ANM_StudentDormitoryAttic13, 0x97297e, 12925 },
+{ ANM_StudentDormitoryAttic14, 0x975bfb, 2400 },
+{ ANM_PhilipLauraIntro, 0x9aed55, 29824 },
+{ AOF_PhilipLauraIntro, 0x9b61d5, 74 },
+{ ANM_LauraIntro, 0x9b621f, 12793 },
+{ AOF_LauraIntro, 0x9b9418, 48 },
+{ TXT_SpringBridgeIntro, 0x9b99f2, 1784 },
+{ IMG_SpringBridgeIntro, 0x9ba0ea, 46080 },
+{ PAL_SpringBridgeIntro, 0x9c54ea, 720 },
+{ TXT_SpringRock, 0x9c5e92, 1362 },
+{ IMG_SpringRock, 0x9c63e4, 46080 },
+{ PAL_SpringRock, 0x9d17e4, 720 },
+{ MSK_SpringRock, 0x9d1ab4, 3117 },
+{ BOX_SpringRock, 0x9d26e1, 1280 },
+{ PAL_PenduloStudios, 0xe6d19, 768 },
+{ IMG_PenduloStudios, 0xd7319, 64000 },
+// No Spanish floppy counterpart for PAL_GraphicAdventure: its startup shows only the Pendulo logo and the title screen.
+// No Spanish floppy counterpart for IMG_GraphicAdventure: its startup shows only the Pendulo logo and the title screen.
+// No Spanish floppy counterpart for PAL_Presents: its startup shows only the Pendulo logo and the title screen.
+// No Spanish floppy counterpart for IMG_Presents: its startup shows only the Pendulo logo and the title screen.
+// No Spanish floppy counterpart for PAL_OptikSoftware: its startup shows only the Pendulo logo and the title screen.
+// No Spanish floppy counterpart for IMG_OptikSoftware: its startup shows only the Pendulo logo and the title screen.
+{ FRM_IgorDirBack2, 0xa552ac, 10500 },
+{ FRM_IgorDirRight2, 0xa57bb0, 13500 },
+{ FRM_IgorDirFront2, 0xa5b06c, 10500 },
+{ FRM_IgorDirLeft2, 0xa5d970, 13500 },
+{ FRM_IgorHead2, 0xa60e2c, 3696 },
+{ FRM_IgorDirBack, 0xa61e86, 10500 },
+{ FRM_IgorDirRight, 0xa6478a, 13500 },
+{ FRM_IgorDirFront, 0xa67c46, 10500 },
+{ FRM_IgorDirLeft, 0xa6a54a, 13500 },
+{ FRM_IgorHead, 0xa6da06, 3696 },
+{ IMG_VerbsPanel, 0xa27d1c, 3520 },
+{ TXT_MainTable, 0, 19676, SOURCE_TBL },
+{ IMG_InventoryPanel, 0xaa01ef, 9600 },
+{ IMG_Objects, 0xaa276f, 48000 },
+{ PAL_DecanatoLeft, 0x87b049, 624 },
+{ IMG_DecanatoLeft, 0x86fc49, 46080 },
+{ MSK_DecanatoLeft, 0x87b2b9, 5766 },
+{ BOX_DecanatoLeft, 0x87c93f, 1280 },
+{ PAL_DecanatoRight, 0x86d935, 624 },
+{ IMG_DecanatoRight, 0x862535, 46080 },
+{ MSK_DecanatoRight, 0x86dba5, 3858 },
+{ BOX_DecanatoRight, 0x86eab7, 1280 },
+{ TXT_DecanatoLeft, 0x86f69b, 1454 },
+{ TXT_DecanatoRight, 0x861fd4, 1377 },
+// TODO: Identify the floppy counterpart for FRM_IgorIntroLogo.
+// TODO: Identify the floppy counterpart for IMG_IgorIntroLogo.
+// TODO: Identify the floppy counterpart for PAL_IgorIntroLogo.
+{ DAT_AdministrationCorridor, 0x91efad, 6745 },
+{ ANM_AdministrationCorridor, 0x920d26, 11085 },
+{ TXT_AdministrationCorridor, 0x923f2f, 2001 },
+{ IMG_AdministrationCorridor, 0x924700, 46080 },
+{ PAL_AdministrationCorridor, 0x92fb00, 624 },
+{ MSK_AdministrationCorridor, 0x92fd70, 2388 },
+{ BOX_AdministrationCorridor, 0x9306c4, 1280 },
+{ DAT_OutsideChurch, 0x8322e6, 6017 },
+{ DLG_OutsideChurch, 0x834e4f, 5130 },
+{ FRM_OutsideChurch8, 0x838e89, 27365 },
+{ FRM_OutsideChurch9, 0x83f96e, 58 },
+{ FRM_OutsideChurch1, 0x83f9a8, 1869 },
+{ FRM_OutsideChurch2, 0x8400f5, 20 },
+{ FRM_OutsideChurch3, 0x840109, 2472 },
+{ FRM_OutsideChurch4, 0x840ab1, 16 },
+{ FRM_OutsideChurch5, 0x840ac1, 5147 },
+{ FRM_OutsideChurch6, 0x841edc, 14 },
+{ FRM_OutsideChurch7, 0x841eea, 5145 },
+{ FRM_OutsideChurch10, 0x843303, 6805 },
+{ FRM_OutsideChurch11, 0x844d98, 14 },
+{ FRM_OutsideChurch12, 0x844da6, 5145 },
+{ TXT_OutsideChurch, 0x84682c, 1424 },
+{ IMG_OutsideChurch, 0x846dbc, 46080 },
+{ PAL_OutsideChurch, 0x8521bc, 624 },
+{ MSK_OutsideChurch, 0x85242c, 3264 },
+{ BOX_OutsideChurch, 0x8530ec, 1280 },
+{ DAT_PhysicsClassroom, 0x5997be, 6017 },
+{ DAT_ChurchPuzzle, 0x7e62c5, 6137 },
+{ IMG_ChurchMosaic, 0x7e8a59, 46080 },
+{ PAL_ChurchMosaic, 0x7f3e59, 720 },
+{ MSK_ChurchMosaic, 0x7f4129, 2445 },
+{ FRM_ChurchPuzzle1, 0x8011f4, 980 },
+{ FRM_ChurchPuzzle2, 0x8015c8, 945 },
+{ FRM_ChurchPuzzle3, 0x801979, 1794 },
+{ FRM_ChurchPuzzle13, 0x80207b, 2240 },
+{ FRM_ChurchPuzzle4, 0x80293b, 2106 },
+{ FRM_ChurchPuzzle5, 0x803175, 1260 },
+{ FRM_ChurchPuzzle6, 0x803661, 1036 },
+{ FRM_ChurchPuzzle7, 0x803a6d, 1053 },
+{ FRM_ChurchPuzzle8, 0x803e8a, 6 },
+{ FRM_ChurchPuzzle9, 0x803e90, 26980 },
+{ FRM_ChurchPuzzle10, 0x80a7f4, 120 },
+{ FRM_ChurchPuzzle11, 0x80a86c, 11607 },
+{ FRM_ChurchPuzzle12, 0x80d5c3, 20 },
+{ FRM_ChurchPuzzle14, 0x80d5d7, 2904 },
+{ TXT_ChurchPuzzle, 0x80e813, 1669 },
+{ IMG_ChurchPuzzle, 0x80ee98, 46080 },
+{ PAL_ChurchPuzzle, 0x81a298, 624 },
+{ MSK_ChurchPuzzle, 0x81a508, 1992 },
+{ BOX_ChurchPuzzle, 0x81acd0, 1280 },
+{ DAT_InsideChurch, 0x81eb7e, 5973 },
+{ TXT_InsideChurch, 0x820b7b, 1108 },
+{ IMG_InsideChurch, 0x820fcf, 46080 },
+{ PAL_InsideChurch, 0x82c3cf, 624 },
+{ MSK_InsideChurch, 0x82c63f, 2352 },
+{ BOX_InsideChurch, 0x82cf6f, 1280 },
+// TODO: Identify the floppy counterpart for DLG_TobiasOffice. The Tobias office room code references no dialogue data.
+{ DAT_Library, 0x8ae4d2, 7325 },
+{ DLG_Library, 0x8b15ab, 3573 },
+{ FRM_Library1, 0x8b254e, 2254 },
+{ FRM_Library2, 0x8b2e1c, 18823 },
+{ FRM_Library3, 0x8b77a3, 50 },
+{ FRM_Library4, 0x8b77d5, 1440 },
+{ FRM_Library5, 0x8b7d75, 14616 },
+{ TXT_Library, 0x8bc0ad, 2031 },
+{ IMG_Library, 0x8bc89c, 46080 },
+{ PAL_Library, 0x8c7c9c, 624 },
+{ MSK_Library, 0x8c7f0c, 2217 },
+{ BOX_Library, 0x8c87b5, 1280 },
+{ TXT_Library2, 0x8bb8f3, 239 },
+{ IMG_PhotoHarrisonMargaret, 0xa948d8, 46080 },
+{ PAL_PhotoHarrisonMargaret, 0xa9fcd8, 624 },
+{ IMG_RomanNumbersPaper, 0xa70a39, 46080 },
+{ PAL_RomanNumbersPaper, 0xa7be39, 624 },
+{ FRM_NumbersPaper1, 0xa7c2b5, 51163 },
+{ FRM_NumbersPaper2, 0xa88a90, 40 },
+{ IMG_NewsPaper, 0xa88d73, 46080 },
+{ PAL_NewsPaper, 0xa94173, 624 },
+{ IMG_OptionsButton, 0xa1be08, 2568 },
+{ IMG_OptionsMenu, 0xa1c810, 33920 },
+{ DAT_Part70, 0x1f40e4, 5945 },
+{ ANM_Part70, 0x1f59a1, 4290 },
+{ TXT_Part70, 0x1f7113, 982 },
+{ IMG_Part70, 0x1f74e9, 46080 },
+{ PAL_Part70, 0x2028e9, 624 },
+{ MSK_Part70, 0x202b59, 1212 },
+{ BOX_Part70, 0x203015, 1280 },
+{ DAT_Part72, 0x20704c, 6181 },
+{ ANM_Part72, 0x20bfbe, 5235 },
+{ TXT_Part72, 0x20daf8, 1103 },
+{ IMG_Part72, 0x20df47, 46080 },
+{ PAL_Part72, 0x219347, 624 },
+{ MSK_Part72, 0x2195b7, 5325 },
+{ BOX_Part72, 0x21aa84, 1280 },
+{ DAT_Part68, 0x262551, 6113 },
+{ DLG_Part68, 0x26a5ca, 13774 },
+{ ANM_Part68, 0x26de04, 28857 },
+{ TXT_Part68, 0x275585, 1604 },
+{ IMG_Part68, 0x275bc9, 46080 },
+{ PAL_Part68, 0x280fc9, 624 },
+{ MSK_Part68, 0x281239, 5499 },
+{ BOX_Part68, 0x2827b4, 1280 },
+{ DAT_Part81, 0x11018c, 6137 },
+{ DLG_Part81, 0x112d8e, 6820 },
+{ ANM_Part81, 0x125e16, 53065 },
+{ TXT_Part81, 0x133432, 2114 },
+{ TXT_Part81ObjectNames, 0x10ca90, 14 },
+{ IMG_Part81, 0x133c74, 46080 },
+{ PAL_Part81, 0x13f074, 624 },
+{ MSK_Part81, 0x13f2e4, 2718 },
+{ BOX_Part81, 0x13fd82, 1280 },
+{ ANM_Part81Cutscene, 0x1199e4, 49944 },
+{ IMG_Part81Strip, 0x114912, 20520 },
+{ PAL_Part74, 0x1d35be, 624 },
+{ IMG_Part74, 0x1c81be, 46080 },
+{ TXT_Part74, 0x1c7ce0, 1246 },
+{ ANM_Part74, 0x1c6208, 5598 },
+{ DAT_Part71, 0x285721, 6273 },
+{ ANM_Part71, 0x292eb9, 5160 },
+{ TXT_Part71, 0x2949a8, 1442 },
+{ IMG_Part71, 0x294f4a, 46080 },
+{ PAL_Part71, 0x2a034a, 624 },
+{ MSK_Part71, 0x2a05ba, 2586 },
+{ BOX_Part71, 0x2a0fd4, 1280 },
+{ DAT_Part69, 0x21ed97, 6041 },
+{ ANM_Part69, 0x226219, 58485 },
+{ TXT_Part69, 0x234d71, 1412 },
+{ IMG_Part69, 0x2352f5, 46080 },
+{ PAL_Part69, 0x2406f5, 624 },
+{ MSK_Part69, 0x240965, 3546 },
+{ BOX_Part69, 0x24173f, 1280 },
+{ DAT_Part32, 0x7aa9a1, 6109 },
+{ TXT_Part32, 0x7d4dfb, 1315 },
+{ IMG_Part32, 0x7d531e, 46080 },
+{ PAL_Part32, 0x7e071e, 624 },
+{ MSK_Part32, 0x7e098e, 3237 },
+{ BOX_Part32, 0x7e1633, 1280 },
+{ IMG_Part32Lock, 0x7c8bc5, 46080 },
+{ PAL_Part32Lock, 0x7d3fc5, 624 },
+{ MSK_Part32Lock, 0x7d4235, 1401 },
+{ ANM_Part32Digits, 0x7c8871, 420 },
+{ ANM_Part32Tower, 0x7bf751, 34105 },
+{ TXT_Part32Tower, 0x7bf3b7, 922 },
+{ PAL_Part32Tower, 0x7c7c8a, 624 },
+{ IMG_Part32Girl, 0x7b2e9b, 46080 },
+{ PAL_Part32Girl, 0x7be29b, 768 },
+{ ANM_Part32Girl, 0x7be59b, 2907 },
+{ DAT_Part77, 0x172734, 6777 },
+{ ANM_Part77, 0x174459, 26666 },
+{ TXT_Part77, 0x17b337, 1463 },
+{ IMG_Part77, 0x17b8ee, 46080 },
+{ PAL_Part77, 0x186cee, 624 },
+{ MSK_Part77, 0x186f5e, 4974 },
+{ BOX_Part77, 0x1882cc, 1280 },
+{ ANM_Part78, 0x151d6c, 64402 },
+{ TXT_Part78, 0x161fbe, 1839 },
+{ IMG_Part78, 0x1626ed, 46080 },
+{ PAL_Part78, 0x16daed, 768 },
+{ BOX_Part78, 0x16ddf0, 1280 },
+{ IMG_Part78Layer2, 0x146b0e, 45388 },
+{ ANM_Part78Frames, 0x140db8, 14756 },
+{ IMG_Part78MinutesLater, 0x9e28a4, 46080 },
+{ IMG_Part78NextDay, 0xa0482b, 46080 },
+{ ANM_Part73, 0x1e3916, 6890 },
+{ TXT_Part73, 0x1e5ac3, 1319 },
+{ IMG_Part73, 0x1e5fea, 46080 },
+{ PAL_Part73, 0x1f13ea, 624 },
+{ MSK_Part73, 0x1f165a, 636 },
+{ BOX_Part73, 0x1f18d6, 1280 },
+{ IMG_Part73Card, 0x9f92fe, 46080 },
+{ ANM_Part80, 0x1d42d8, 11600 },
+{ TXT_Part80, 0x1d76d8, 1477 },
+{ IMG_Part80, 0x1d7c9d, 46080 },
+{ PAL_Part80, 0x1e309d, 768 },
+{ MSK_Part80, 0x1e339d, 3 },
+{ BOX_Part80, 0x1e33a0, 1280 },
+{ DAT_Part76, 0x18c5f9, 6137 },
+{ ANM_Part76, 0x19de5a, 31576 },
+{ TXT_Part76, 0x1a607e, 1912 },
+{ IMG_Part76, 0x1a67f6, 46080 },
+{ PAL_Part76, 0x1b1bf6, 624 },
+{ MSK_Part76, 0x1b1e66, 2760 },
+{ BOX_Part76, 0x1b292e, 1280 },
+{ IMG_Part76Card, 0x9eddd1, 46080 },
+{ PAL_Part79, 0x66c9f, 768 },
+{ IMG_Part79, 0x5b89f, 46080 },
+{ TXT_Part79, 0x5b6a2, 509 },
+{ IMG_Part79Layer2, 0x4ffed, 46080 },
+{ ANM_Part79, 0x4039e, 64517 },
+{ ANM_Part79Frames, 0x394f4, 28086 },
+{ IMG_Part79b, 0x2d982, 46080 },
+{ TXT_Part79b, 0x2d53d, 1093 },
+{ ANM_Part79bFrames, 0x1d788, 63364 },
+{ ANM_Part79bLayer2, 0x156f2, 32788 },
+{ ANM_Part79bScenes, 0x8b3f, 51889 },
+{ TXT_Part79bMain, 0x2d165, 330 },
+{ IMG_Credits1, 0xc710d, 64000 },
+{ PAL_Credits1, 0xd6b0d, 768 },
+{ IMG_Credits2, 0xb714e, 64000 },
+{ PAL_Credits2, 0xc6b4e, 768 },
+{ IMG_Credits3, 0xa718f, 64000 },
+{ PAL_Credits3, 0xb6b8f, 768 },
+{ IMG_Credits4, 0x971d0, 64000 },
+{ PAL_Credits4, 0xa6bd0, 768 },
+{ IMG_Credits5, 0x87211, 64000 },
+{ PAL_Credits5, 0x96c11, 768 },
+{ IMG_Credits6, 0x77252, 64000 },
+{ PAL_Credits6, 0x86c52, 768 },
+{ IMG_Credits7, 0x6728f, 64000 },
+{ PAL_Credits7, 0x76c8f, 768 },
+{ DLG_Part8Intercom, 0x8f4c16, 461 },
+{ TXT_OptionsButtons, 0xa254cd, 34 },
+{ TXT_OptionsSettings, 0xa2576b, 159 },
+{ TXT_OptionsTitle, 0xa25df8, 17 },
+{ TXT_OptionsQuit, 0xa26084, 46 },
+{ DAT_FloppyProtectionWords, 0xa24c90, 1400 },
+{ TXT_FloppyProtectionScreen, 0xa1b16a, 80 },
+{ TXT_FloppyProtectionReply, 0xa1bad5, 46 },
+{ TXT_OptionsSaveTitle, 0xa26bc5, 24 },
+{ TXT_OptionsLoadTitle, 0xa26e7e, 24 },
+{ TXT_OptionsDescribeSave, 0xa2673b, 27 },
+{ TXT_OptionsNoSavedGames, 0xa26e63, 27 },
+{ DAT_OptionsNameChars, 0xa26756, 32 },
+// TODO: Identify the floppy counterpart for TXT_Credits1.
+// TODO: Identify the floppy counterpart for TXT_Credits2.
+// TODO: Identify the floppy counterpart for TXT_Credits3.
+// TODO: Identify the floppy counterpart for TXT_Credits4.
+// TODO: Identify the floppy counterpart for TXT_Credits5.
+// TODO: Identify the floppy counterpart for TXT_Credits6.
+// TODO: Identify the floppy counterpart for TXT_Credits7.
+{ CMF_1, 0xa48344, 306 },
+{ CMF_10, 0xa41122, 5982 },
+{ CMF_11, 0xa44da9, 12793 },
+{ CMF_12, 0xa35d11, 22275 },
+{ CMF_2_1, 0xa49013, 4111 },
+{ CMF_2_2, 0xa4ac4f, 4303 },
+{ CMF_2_3, 0xa4c969, 4343 },
+{ CMF_3, 0xa4eb37, 5898 },
+{ CMF_4, 0xa50a7b, 3133 },
+{ CMF_7_1, 0xa523f3, 4671 },
+{ CMF_7_2, 0xa537d3, 646 },
+{ CMF_7_3, 0xa53fd2, 2014 },
+{ CMF_7_4, 0xa54b61, 1369 },
+{ CMF_8, 0xa3c31f, 4926 },
+{ CMF_9, 0xa3e7e8, 6249 },
+{ FRM_CollegeCorridorAnnouncementBoardFloppy1, 0x640288, 3422 },
+{ FRM_CollegeCorridorAnnouncementBoardFloppy2, 0x640fe6, 7560 },
+{ FRM_CollegeCorridorCarolineFloppy1, 0x679e12, 6720 },
+{ FRM_CollegeCorridorCarolineFloppy2, 0x67b852, 3038 },
+{ FRM_CollegeCorridorCarolineFloppy3, 0x67c430, 5673 },
+{ FRM_CollegeCorridorCarolineFloppy4, 0x67da59, 156 },
+{ FRM_CollegeCorridorCarolineFloppy5, 0x67daf5, 3248 },
+{ FRM_CollegeCorridorLadiesRoomFloppy1, 0x68fc13, 3480 },
+{ FRM_CollegeCorridorLadiesRoomFloppy2, 0x6909ab, 6048 },
+{ FRM_CollegeCorridorMargaretFloppy1, 0x6a7d6b, 3480 },
+{ FRM_CollegeCorridorMargaretFloppy2, 0x6a8b03, 6138 },
+{ FRM_CollegeCorridorMargaretFloppy3, 0x6aa2fd, 6235 },
+{ FRM_CollegeCorridorMargaretFloppy4, 0x6abb58, 4320 },
+{ FRM_CollegeCorridorMargaretFloppy5, 0x6acc38, 1920 },
+{ FRM_CollegeCorridorMargaretFloppy6, 0x6ad3b8, 7128 },
+{ FRM_CollegeCorridorMargaretFloppy7, 0x6aef90, 3200 },
+{ FRM_CollegeCorridorMargaretFloppy8, 0x6afc10, 910 },
+{ FRM_CollegeCorridorMissBarrymoreFloppy1, 0x62d698, 1742 },
+{ FRM_CollegeCorridorMissBarrymoreFloppy2, 0x62dd66, 5427 },
+{ FRM_CollegeCorridorChemistryClassFloppy1, 0x6648e3, 3422 },
+{ FRM_CollegeCorridorChemistryClassFloppy2, 0x665641, 7812 },
+{ FRM_CollegeLockersFloppy1, 0x6c12a0, 8568 },
+{ FRM_CollegeLockersFloppy2, 0x6c3418, 3584 },
+{ FRM_CollegeStairsSecondFloorFloppy1, 0x5fc613, 1566 },
+{ FRM_CollegeStairsSecondFloorFloppy2, 0x5fcc31, 9920 },
+{ DAT_CollegeCorridorMathClass, 0x652043, 6109 },
+{ TXT_CollegeCorridorMathClass, 0x65402e, 1218 },
+{ IMG_CollegeCorridorMathClass, 0x6544f0, 46080 },
+{ PAL_CollegeCorridorMathClass, 0x65f8f0, 624 },
+{ MSK_CollegeCorridorMathClass, 0x65fb60, 1890 },
+{ BOX_CollegeCorridorMathClass, 0x6602c2, 1280 },
+{ IMG_FloppyTitleBackdrop, 0xfba2c, 64000 },
+{ IMG_TitleScreen, 0xebfb8, 64000 },
+{ PAL_InventoryPanel, 0xaae2ef, 96 },
+{ PAL_TitleScreen, 0x10b42c, 768 },
+{ PAL_VerbsPanel, 0xa27cec, 48 },
+{ DAT_FloppySentenceColors, 0, 3, SOURCE_TBL },
+{ TXT_MainVerbs, 0, 192, SOURCE_TBL },
diff --git a/devtools/create_igor/strings.h b/devtools/create_igor/strings.h
new file mode 100644
index 00000000000..db60d00330f
--- /dev/null
+++ b/devtools/create_igor/strings.h
@@ -0,0 +1,82 @@
+{ 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_ShinyThing, STR_LANG_SPA, " cosa reluciente" },
+
+{ 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_SPA, "Empujar piedra" },
+{ STR_Exit, STR_LANG_SPA, "Salir" },
+
+{ 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" },
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index f2c09800889..39ff03c8d0d 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -1246,6 +1246,7 @@ const Tool s_tools[] = {
{ "create_cryo", true},
{ "create_drascula", true},
{ "create_hugo", true},
+ { "create_igor", true},
{ "create_kyradat", true},
{ "create_lure", true},
{ "create_neverhood", true},
Commit: 235c0e960d5787886fc91e80d24fe7fab43444fc
https://github.com/scummvm/scummvm/commit/235c0e960d5787886fc91e80d24fe7fab43444fc
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:28+01:00
Commit Message:
IGOR: Rename verb and inventory palette functions
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/palette.cpp
engines/igor/part_main.cpp
engines/igor/parts/part_10.cpp
engines/igor/parts/part_11.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_15.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_21_floppy.cpp
engines/igor/parts/part_22.cpp
engines/igor/parts/part_28.cpp
engines/igor/parts/part_28_floppy.cpp
engines/igor/parts/part_30.cpp
engines/igor/parts/part_30_floppy.cpp
engines/igor/parts/part_32.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
engines/igor/parts/part_4.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_50.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_69.cpp
engines/igor/parts/part_7.cpp
engines/igor/parts/part_70.cpp
engines/igor/parts/part_71.cpp
engines/igor/parts/part_72.cpp
engines/igor/parts/part_73.cpp
engines/igor/parts/part_76.cpp
engines/igor/parts/part_77.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_81.cpp
engines/igor/parts/part_9.cpp
engines/igor/parts/part_90.cpp
engines/igor/parts/part_credits.cpp
engines/igor/parts/part_margaret.cpp
engines/igor/parts/part_maze.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 480e5c9a2ef..422f35affb5 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -294,8 +294,8 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor, bool fade) {
}
if (!_gameState.dialogueStarted) { // if loading we need to redraw the room background and UI
memset(_screenVGA + 46080, 0, 17920);
- SET_PAL_208_96_1();
- SET_PAL_240_48_1();
+ setInventoryPanelColors();
+ setVerbPanelColors();
drawVerbsPanel();
redrawVerb(_currentAction.verb, true);
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 33686c0911d..ce7fbe98cc8 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1872,8 +1872,8 @@ private:
void setPaletteRange(int startColor, int endColor);
void darkenPalette(uint8 *palette, int firstColor, int lastColor, int amount);
void updatePalette(int count);
- void SET_PAL_208_96_1();
- void SET_PAL_240_48_1();
+ void setInventoryPanelColors();
+ void setVerbPanelColors();
void fadeIn(int count);
void fadeOut(int count);
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index 296caae0f3d..ac54f2a3beb 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -79,7 +79,7 @@ void IgorEngine::updatePalette(int count) {
// The inventory panel colors (208-239). The Spanish floppy version has its own.
-void IgorEngine::SET_PAL_208_96_1() {
+void IgorEngine::setInventoryPanelColors() {
if (_game.version == kIdSpaFloppy) {
loadData(PAL_InventoryPanel, _paletteBuffer + 208 * 3);
} else {
@@ -88,7 +88,7 @@ void IgorEngine::SET_PAL_208_96_1() {
}
// The verbs panel colors (240-255). The Spanish floppy version has its own.
-void IgorEngine::SET_PAL_240_48_1() {
+void IgorEngine::setVerbPanelColors() {
if (_game.version == kIdSpaFloppy) {
loadData(PAL_VerbsPanel, _paletteBuffer + 240 * 3);
} else {
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index eb4800e7cbf..78e84029017 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -486,8 +486,8 @@ void IgorEngine::partMain() {
}
partMainUpdateObjectState(255);
if (_currentPart != kStartupPart) { // boot param
- SET_PAL_208_96_1();
- SET_PAL_240_48_1();
+ setInventoryPanelColors();
+ setVerbPanelColors();
drawVerbsPanel();
drawInventory(1, 0);
}
diff --git a/engines/igor/parts/part_10.cpp b/engines/igor/parts/part_10.cpp
index 21edaa1d244..1fdf31022e6 100644
--- a/engines/igor/parts/part_10.cpp
+++ b/engines/igor/parts/part_10.cpp
@@ -173,8 +173,8 @@ void IgorEngine::part10() {
static const int hamburgerAnimation[] = { ANM_DecanatoHamburger, 0 };
loadAnimData(hamburgerAnimation, kPart10_11_Frm1);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
partMainSetExecuteAction(1, &IgorEngine::part10ExecuteAction);
_roomDataOffsets = PART_10_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index 822bff85a68..0533c76882c 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -204,8 +204,8 @@ void IgorEngine::part11() {
_roomDataOffsets = PART_11_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
part11ApplyObjectState(255);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
if (!restoreRoomAfterLoad()) {
_walkDataLastIndex = 1;
_walkDataCurrentIndex = 1;
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index e74be01b4ec..7c416530ef2 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -393,8 +393,8 @@ void IgorEngine::part12PaintOverLizard() {
}
void IgorEngine::part12ExorcismCutscene() {
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
fadeIn(768);
playRoomSound(13, 0);
for (int i = 1; i <= 5; ++i) {
@@ -544,8 +544,8 @@ void IgorEngine::part12() {
setRoomWalkBounds(89, 0, 275, 143);
partMainSetExecuteAction(1, &IgorEngine::part12ExecuteAction);
_updateRoomBackground = &IgorEngine::part12UpdateBackground;
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
part12ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
if (_objectsState[kLizardTakenStateIndex] == 0) {
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 94d190f6d15..5ccfc22cf20 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -502,7 +502,7 @@ void IgorEngine::part14ShowPuzzle() {
}
fadeOut(768);
memcpy(_screenVGA, _screenLayer1, 46080);
- SET_PAL_208_96_1();
+ setInventoryPanelColors();
}
void IgorEngine::part14LoadChurchMosaicData() {
diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp
index 35b802bf80c..5964a0a3f56 100644
--- a/engines/igor/parts/part_15.cpp
+++ b/engines/igor/parts/part_15.cpp
@@ -371,8 +371,8 @@ void IgorEngine::part15() {
partMainSetExecuteAction(1, &IgorEngine::part15ExecuteAction);
_updateRoomBackground = &IgorEngine::part15UpdateBackground;
part15ApplyObjectState(255);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index 7fc5a97327a..87e2d669f70 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -144,8 +144,8 @@ void IgorEngine::part16PhotoCutscene() {
partMargaret();
} while (_objectsState[kMargaretSceneStateIndex] != 9);
setupDefaultPalette();
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
part16LoadRoom();
part16LoadAnimation();
memcpy(_screenVGA, _screenLayer1, 46080);
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index e8ab12f50ac..aa1c0cda904 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -504,8 +504,8 @@ void IgorEngine::part17() {
partMainSetExecuteAction(1, &IgorEngine::part17ExecuteAction);
_updateRoomBackground = &IgorEngine::part17UpdateBackground;
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
part17ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index 07b4ee82719..df25904ac72 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -415,8 +415,8 @@ void IgorEngine::part21() {
_updateRoomBackground = &IgorEngine::part21UpdateBackground;
part21ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
if (!restoreRoomAfterLoad()) {
_gameState.unk10 = 1;
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_21_floppy.cpp b/engines/igor/parts/part_21_floppy.cpp
index d66d538b8d7..c76c63860dd 100644
--- a/engines/igor/parts/part_21_floppy.cpp
+++ b/engines/igor/parts/part_21_floppy.cpp
@@ -396,8 +396,8 @@ void IgorEngine::part21Floppy() {
_updateRoomBackground = &IgorEngine::part21FloppyUpdateBackground;
part21FloppyApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
if (!restoreRoomAfterLoad()) {
_gameState.unk10 = 1;
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp
index ddeb8137ace..a11b0b9df71 100644
--- a/engines/igor/parts/part_22.cpp
+++ b/engines/igor/parts/part_22.cpp
@@ -162,7 +162,7 @@ void IgorEngine::part22() {
playMusic(3);
_gameState.enableLight = 1;
loadRoomData(PAL_BellChurch, IMG_BellChurch, BOX_BellChurch, MSK_BellChurch, TXT_BellChurch);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
static const int anm[] = { FRM_BellChurch1, FRM_BellChurch2, 0 };
loadAnimData(anm);
loadActionData(DAT_BellChurch);
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index f5ec2e32f1f..e965e7baf5d 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -214,8 +214,8 @@ void IgorEngine::part28DrawCarolineTalkingFrame(int frame) {
void IgorEngine::part28EnterAndCheckGrades() {
setupDefaultPalette();
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
part28ApplyObjectState(255);
diff --git a/engines/igor/parts/part_28_floppy.cpp b/engines/igor/parts/part_28_floppy.cpp
index 45ba207ccbd..f9d5192610b 100644
--- a/engines/igor/parts/part_28_floppy.cpp
+++ b/engines/igor/parts/part_28_floppy.cpp
@@ -235,8 +235,8 @@ void IgorEngine::part28FloppyEnterFromRight() {
void IgorEngine::part28FloppyEnterAndCheckGrades() {
setupDefaultPalette();
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
part28FloppyApplyObjectState(255);
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index ed624966bd7..54281e5502f 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -290,8 +290,8 @@ void IgorEngine::part30() {
partMainSetExecuteAction(1, &IgorEngine::part30ExecuteAction);
part30ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
const bool loaded = restoreRoomAfterLoad(true, false);
if (loaded) {
// a game saved at laura's dialogue shows the scene of the dialogue from the first frame
diff --git a/engines/igor/parts/part_30_floppy.cpp b/engines/igor/parts/part_30_floppy.cpp
index 07b7ab014a3..a72f8cb3090 100644
--- a/engines/igor/parts/part_30_floppy.cpp
+++ b/engines/igor/parts/part_30_floppy.cpp
@@ -291,8 +291,8 @@ void IgorEngine::part30Floppy() {
partMainSetExecuteAction(1, &IgorEngine::part30FloppyExecuteAction);
part30FloppyApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
const bool loaded = restoreRoomAfterLoad(true, false);
if (loaded) {
// a game saved at laura's dialogue shows the scene of the dialogue from the first frame
diff --git a/engines/igor/parts/part_32.cpp b/engines/igor/parts/part_32.cpp
index 7ed35faaaaa..dac6fccf3ff 100644
--- a/engines/igor/parts/part_32.cpp
+++ b/engines/igor/parts/part_32.cpp
@@ -606,7 +606,7 @@ void IgorEngine::part32() {
_gameState.enableLight = 1;
loadActionData(DAT_Part32);
loadRoomData(PAL_Part32, IMG_Part32, BOX_Part32, MSK_Part32, TXT_Part32);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
_roomDataOffsets = PART_32_ROOM_DATA_OFFSETS;
setRoomClickFix(143, 10, 120, true);
partMainSetExecuteAction(1, &IgorEngine::part32ExecuteAction);
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index 78178d98293..f7a0d4c1f37 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -371,8 +371,8 @@ void IgorEngine::part33() {
partMainSetExecuteAction(1, &IgorEngine::part33ExecuteAction);
_updateRoomBackground = &IgorEngine::part33UpdateBackground;
part33ApplyObjectState(255);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
if (!restoreRoomAfterLoad()) {
memcpy(_screenVGA, _screenLayer1, 46080);
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index 00d0ce6ee83..798aa1fa613 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -306,7 +306,7 @@ void IgorEngine::part34GiveLizardToOldLady() {
void IgorEngine::part34ReloadParkAfterLaura() {
loadActionData(DAT_ParkLeft);
loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
loadAnimData(frames, kParkFrames);
part34ApplyObjectState(255);
@@ -520,8 +520,8 @@ void IgorEngine::part34() {
loadRoomData(PAL_Park, IMG_Park, BOX_Park, MSK_Park, TXT_Park); // active left panel;
static const int frames[] = { FRM_Park1, FRM_Park2, FRM_Park3, FRM_Park4, 0 };
loadAnimData(frames, kParkFrames);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
partMainSetExecuteAction(1, &IgorEngine::part34ExecuteAction);
_updateRoomBackground = &IgorEngine::part34UpdateBackground;
_parkLadyIdleStep = 1;
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index 6dd17616686..aacac4e6511 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -137,8 +137,8 @@ void IgorEngine::part35() {
// The pick up frames replace the start of FRM_Park1, whose frames are not drawn on this panel
static const int pickUpFrames[] = { FRM_ParkRight1, 0 };
loadAnimData(pickUpFrames, kParkFrames);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
partMainSetExecuteAction(1, &IgorEngine::part35ExecuteAction);
_updateRoomBackground = &IgorEngine::part34And35UpdateAmbientSound;
_roomDataOffsets = PART_35_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index a9a4cd9e80e..d7f901fa250 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -86,8 +86,8 @@ void IgorEngine::part4() {
_gameState.enableLight = 1;
loadRoomData(PAL_Map, IMG_Map, BOX_Map, MSK_Map, TXT_Map);
if (!isCDVersion()) {
- SET_PAL_208_96_1();
- SET_PAL_240_48_1();
+ setInventoryPanelColors();
+ setVerbPanelColors();
}
loadActionData(DAT_Map);
_roomDataOffsets = PART_04_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index 50237c28e07..ca4d189f9ef 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -113,9 +113,9 @@ void IgorEngine::part5() {
playMusic(10);
_gameState.enableLight = 1;
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
// the room palette resource is longer than the palette the room really uses, restore the inventory colors
- SET_PAL_208_96_1();
+ setInventoryPanelColors();
static const int anm2[] = {FRM_SpringRock1, FRM_SpringRock2, 0};
loadAnimData(anm2, 0x7E00);
static const int anm3[] = {FRM_SpringRock3, FRM_SpringRock4, 0};
diff --git a/engines/igor/parts/part_50.cpp b/engines/igor/parts/part_50.cpp
index 124bf8f4ca3..74c30a0a97a 100644
--- a/engines/igor/parts/part_50.cpp
+++ b/engines/igor/parts/part_50.cpp
@@ -115,7 +115,7 @@ void IgorEngine::part50() {
_gameState.enableLight = 2;
loadRoomData(PAL_OutsideMaze, IMG_OutsideMaze, BOX_OutsideMaze, MSK_OutsideMaze, TXT_OutsideMaze);
memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
loadActionData(DAT_OutsideMaze);
_roomDataOffsets = PART_50_ROOM_DATA_OFFSETS;
setRoomWalkBounds(49, 22, 224, 119);
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index 1a7d5e12685..1b86d7c6c8b 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -293,8 +293,8 @@ void IgorEngine::part6() {
copyArea(_animFramesBuffer, 0, 224, _screenLayer1, 320, 224, 144);
loadRoomData(PAL_SpringRock, IMG_SpringRock, BOX_SpringRock, MSK_SpringRock, TXT_SpringRock);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
static const int anm2[] = {FRM_SpringRock1, FRM_SpringRock2, 0};
loadAnimData(anm2, 0x7E00);
@@ -313,7 +313,7 @@ void IgorEngine::part6() {
}
if (_currentPart == 61 && !_gameStateLoaded) {
- SET_PAL_208_96_1();
+ setInventoryPanelColors();
drawVerbsPanel();
drawInventory(1, 0);
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index c4f5f04640d..03391ee9201 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -71,7 +71,7 @@ static const int kPart68TalkCodeEnd = 100;
void IgorEngine::part68LoadRoom() {
loadRoomData(PAL_Part68, IMG_Part68, BOX_Part68, MSK_Part68, TXT_Part68);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
}
void IgorEngine::part68DrawUndertaker(int frame) {
@@ -508,7 +508,7 @@ void IgorEngine::part68() {
setRoomClickFix(143, -1, -1, false);
partMainSetExecuteAction(1, &IgorEngine::part68ExecuteAction);
_updateRoomBackground = &IgorEngine::part68UpdateBackground;
- SET_PAL_208_96_1();
+ setInventoryPanelColors();
part68ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
diff --git a/engines/igor/parts/part_69.cpp b/engines/igor/parts/part_69.cpp
index d9a71bb2cc4..3bbd72e9c6c 100644
--- a/engines/igor/parts/part_69.cpp
+++ b/engines/igor/parts/part_69.cpp
@@ -291,7 +291,7 @@ void IgorEngine::part69() {
loadRoomData(PAL_Part69, IMG_Part69, BOX_Part69, MSK_Part69, TXT_Part69);
// the colors of Igor
memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
static const int anim[] = { ANM_Part69, 0 };
loadAnimData(anim);
_roomDataOffsets = PART_69_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index 0d84d75b169..48467e2e6a0 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -225,8 +225,8 @@ void IgorEngine::part7() {
setRoomWalkBounds(0, 0, 319, 143);
part7DrawDoorState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
for (int area = 11; area <= 13; ++area) {
_roomObjectAreasTable[area].area = 0;
}
diff --git a/engines/igor/parts/part_70.cpp b/engines/igor/parts/part_70.cpp
index b057f49afeb..1f12eef0017 100644
--- a/engines/igor/parts/part_70.cpp
+++ b/engines/igor/parts/part_70.cpp
@@ -70,7 +70,7 @@ void IgorEngine::part70() {
_gameState.enableLight = 2;
loadActionData(DAT_Part70);
loadRoomData(PAL_Part70, IMG_Part70, BOX_Part70, MSK_Part70, TXT_Part70);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
static const int anim[] = { ANM_Part70, 0 };
loadAnimData(anim);
_roomDataOffsets = PART_70_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/parts/part_71.cpp b/engines/igor/parts/part_71.cpp
index d34b266abf3..b459ef94c7a 100644
--- a/engines/igor/parts/part_71.cpp
+++ b/engines/igor/parts/part_71.cpp
@@ -195,7 +195,7 @@ void IgorEngine::part71() {
loadRoomData(PAL_Part71, IMG_Part71, BOX_Part71, MSK_Part71, TXT_Part71);
// the colors of Igor
memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
static const int anim[] = { ANM_Part71, 0 };
loadAnimData(anim);
_roomDataOffsets = PART_71_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
index dc93df7e680..be50d9e1dfe 100644
--- a/engines/igor/parts/part_72.cpp
+++ b/engines/igor/parts/part_72.cpp
@@ -184,7 +184,7 @@ void IgorEngine::part72() {
loadRoomData(PAL_Part72, IMG_Part72, BOX_Part72, MSK_Part72, TXT_Part72);
// the colors of Igor
memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
static const int anim[] = { ANM_Part72, 0 };
loadAnimData(anim);
_roomDataOffsets = PART_72_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/parts/part_73.cpp b/engines/igor/parts/part_73.cpp
index 9b1b059c281..672a59a4369 100644
--- a/engines/igor/parts/part_73.cpp
+++ b/engines/igor/parts/part_73.cpp
@@ -104,8 +104,8 @@ void IgorEngine::part73Cutscene() {
part80();
setupDefaultPalette();
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_76.cpp b/engines/igor/parts/part_76.cpp
index 2fa21571742..ffd704d2f64 100644
--- a/engines/igor/parts/part_76.cpp
+++ b/engines/igor/parts/part_76.cpp
@@ -286,10 +286,10 @@ void IgorEngine::part76() {
loadIgorBeachFrames();
loadActionData(DAT_Part76);
loadRoomData(PAL_Part76, IMG_Part76, BOX_Part76, MSK_Part76, TXT_Part76);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
static const int anim[] = { ANM_Part76, 0 };
loadAnimData(anim);
- SET_PAL_208_96_1();
+ setInventoryPanelColors();
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_roomDataOffsets = PART_76_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/parts/part_77.cpp b/engines/igor/parts/part_77.cpp
index 53a8fb0f0e3..57d48722ea6 100644
--- a/engines/igor/parts/part_77.cpp
+++ b/engines/igor/parts/part_77.cpp
@@ -162,7 +162,7 @@ void IgorEngine::part77() {
_gameState.enableLight = 1;
loadActionData(DAT_Part77);
loadRoomData(PAL_Part77, IMG_Part77, BOX_Part77, MSK_Part77, TXT_Part77);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
static const int anim[] = { ANM_Part77, 0 };
loadAnimData(anim);
_roomDataOffsets = PART_77_ROOM_DATA_OFFSETS;
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index efce41d9d61..d2160a9038e 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -174,8 +174,8 @@ void IgorEngine::part8DeanCallsSecretary() {
part8ApplyObjectState(255);
memcpy(_screenVGA, roomScreen, 46080);
free(roomScreen);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
fadeIn(768);
@@ -442,8 +442,8 @@ void IgorEngine::part8() {
part8ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
_walkData[0].setPos(241, 121, kFacingPositionLeft, 0);
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index a7521492d91..088089c4edf 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -72,7 +72,7 @@ void IgorEngine::part81LoadRoom() {
loadRoomData(PAL_Part81, IMG_Part81, BOX_Part81, MSK_Part81, TXT_Part81);
// the colors of Igor
memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
}
void IgorEngine::part81LoadAnimation() {
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index da240e3b213..8aaae95b0c1 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -315,8 +315,8 @@ void IgorEngine::part9() {
setRoomWalkBounds(0, 0, 319, 143);
part9ApplyObjectState(255);
memcpy(_screenVGA, _screenLayer1, 46080);
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
_updateRoomBackground = &IgorEngine::part9UpdateBackground;
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_90.cpp b/engines/igor/parts/part_90.cpp
index 58eb311b0d0..c75f87ac4ac 100644
--- a/engines/igor/parts/part_90.cpp
+++ b/engines/igor/parts/part_90.cpp
@@ -250,8 +250,8 @@ void IgorEngine::part90() {
if (spanishFloppy) {
part90SetUserInterfacePalettes();
} else {
- SET_PAL_208_96_1();
- SET_PAL_240_48_1();
+ setInventoryPanelColors();
+ setVerbPanelColors();
}
_canSaveGame = savingWasAllowed;
return;
diff --git a/engines/igor/parts/part_credits.cpp b/engines/igor/parts/part_credits.cpp
index 6d4468ebb7b..b6ee8bbff6e 100644
--- a/engines/igor/parts/part_credits.cpp
+++ b/engines/igor/parts/part_credits.cpp
@@ -90,7 +90,7 @@ void IgorEngine::partCredits() {
loadData(page.imgId, _screenVGA);
loadData(page.palId, _paletteBuffer);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
// The Spanish floppy pictures already contain the credits text
const bool bakedText = _game.version == kIdSpaFloppy;
if (!bakedText) {
@@ -145,7 +145,7 @@ void IgorEngine::partCredits() {
if (_gameStateLoaded || _currentPart == kInvalidPart) {
// a game was loaded or the game is quit: the state is not changed
fadeOut(768);
- SET_PAL_208_96_1();
+ setInventoryPanelColors();
_canSaveGame = savingWasAllowed;
_optionsMenuReachable = false;
return;
diff --git a/engines/igor/parts/part_margaret.cpp b/engines/igor/parts/part_margaret.cpp
index a31e79c7196..0ae247c1402 100644
--- a/engines/igor/parts/part_margaret.cpp
+++ b/engines/igor/parts/part_margaret.cpp
@@ -144,8 +144,8 @@ void IgorEngine::partMargaret() {
memset(_screenVGA, 0, 46080);
if (_objectsState[kMargaretSceneStateIndex] < 9 && _currentPart != 331) {
setupDefaultPalette();
- SET_PAL_240_48_1();
- SET_PAL_208_96_1();
+ setVerbPanelColors();
+ setInventoryPanelColors();
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
}
diff --git a/engines/igor/parts/part_maze.cpp b/engines/igor/parts/part_maze.cpp
index e033bc5457c..9dd2b484114 100644
--- a/engines/igor/parts/part_maze.cpp
+++ b/engines/igor/parts/part_maze.cpp
@@ -314,7 +314,7 @@ void IgorEngine::partMaze() {
}
loadRoomData(room->pal, room->img, room->box, room->msk, room->txt);
memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
- SET_PAL_240_48_1();
+ setVerbPanelColors();
static const int anm[] = { FRM_MazeEntrance1, 0 };
loadAnimData(anm);
loadActionData(room->dat);
Commit: 43d90e796f7296035ee811038b95f694de7e677b
https://github.com/scummvm/scummvm/commit/43d90e796f7296035ee811038b95f694de7e677b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:28+01:00
Commit Message:
IGOR: Consolidate decodeRoomString into one definition
Changed paths:
engines/igor/igor.h
engines/igor/resource.cpp
engines/igor/room.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index ce7fbe98cc8..ea61167f4ac 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1878,6 +1878,8 @@ private:
void fadeIn(int count);
void fadeOut(int count);
+ // Decodes sz bytes of an encoded room/dialogue string (no terminator is written)
+ static void decodeRoomString(const uint8 *src, char *dst, int sz);
void decodeRoomStrings(const uint8 *p, bool skipObjectNames = false);
void decodeRoomText(const uint8 *p);
void decodeRoomAreas(const uint8 *p, int count);
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index a5cce149bf1..ccc81f20f84 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -115,7 +115,7 @@ static void decodeMainString(const uint8 *src, char *dst) {
dst[sz] = '\0';
}
-static void decodeRoomString(const uint8 *src, char *dst, int sz) {
+void IgorEngine::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)) {
diff --git a/engines/igor/room.cpp b/engines/igor/room.cpp
index 0aed936ae89..b24568a511a 100644
--- a/engines/igor/room.cpp
+++ b/engines/igor/room.cpp
@@ -64,40 +64,6 @@ void IgorEngine::decodeRoomMask(const uint8 *p) {
}
}
-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::handleRoomDialogue() {
if (_gameState.dialogueTextRunning) {
// Speech completion ends the sentence
Commit: 0f65c76e53ae39e6d1666b94fb268a2ea4e4fef5
https://github.com/scummvm/scummvm/commit/0f65c76e53ae39e6d1666b94fb268a2ea4e4fef5
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:28+01:00
Commit Message:
IGOR: Remove unused symbols
Changed paths:
engines/igor/igor.h
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index ea61167f4ac..7be2c00ff53 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -57,7 +57,6 @@ enum {
kTimerTicksCount = 8,
kFastModeFactor = 4,
kFastModeMaxFactor = 16,
- kMaxSaveStates = 10,
kNoSpeechSound = 0
};
@@ -819,7 +818,6 @@ private:
ResourceEntry *_resourceEntries;
Common::Array<StringEntry> _stringEntries;
Common::Array<Common::String> _optionsMenuTexts;
- char _saveStateDescriptions[kMaxSaveStates][100];
void restart();
@@ -2067,7 +2065,6 @@ protected:
};
extern IgorEngine *g_engine;
-#define SHOULD_QUIT ::Igor::g_engine->shouldQuit()
} // End of namespace Igor
Commit: a07b284c5fe63b62bc594300a5ab3dfdc79883e3
https://github.com/scummvm/scummvm/commit/a07b284c5fe63b62bc594300a5ab3dfdc79883e3
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:29+01:00
Commit Message:
IGOR: Split igor.h declarations into per-context files
Changed paths:
A engines/igor/maze.h
A engines/igor/objects.h
A engines/igor/resource_types.h
A engines/igor/room_types.h
engines/igor/igor.h
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 7be2c00ff53..bd620ea49c4 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -43,7 +43,11 @@
#include "igor/detection.h"
#include "igor/floppy_font.h"
#include "igor/font.h"
+#include "igor/maze.h"
+#include "igor/objects.h"
#include "igor/resource_ids.h"
+#include "igor/resource_types.h"
+#include "igor/room_types.h"
namespace Igor {
@@ -70,13 +74,6 @@ enum {
MAX_DIALOGUE_REPLIES = 100
};
-enum FacingPosition {
- kFacingPositionBack = 1,
- kFacingPositionRight = 2,
- kFacingPositionFront = 3,
- kFacingPositionLeft = 4
-};
-
enum {
kTalkModeSpeechOnly = 0,
kTalkModeSpeechAndText = 1,
@@ -136,50 +133,6 @@ enum InputVar {
kInputVarCount
};
-struct RoomWalkBounds {
- int x1, y1;
- int x2, y2;
- // Minimum y after clamping a click past the corresponding horizontal edge.
- // e.g. clamped to x1? then x1MinY is used to determine the minimum y.
- int x1MinY, x2MinY;
-};
-
-struct DetectedGameVersion {
- int version;
- int flags;
- Common::Language language;
- const char *ovlFileName;
- const char *sfxFileName;
-};
-
-enum ResourceSource {
- kResourceSourceContainer, // the game's resource container (IGOR.DAT)
- kResourceSourceTable = 2 // data embedded in IGOR.TBL, offset is absolute in that file
-};
-
-struct ResourceEntry {
- int id;
- uint32 offs;
- uint32 size;
- ResourceSource source;
-};
-
-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 GameStateData {
uint8 enableLight;
int8 colorLum;
@@ -206,395 +159,12 @@ struct GameStateData {
uint8 musicSequenceIndex;
};
-struct Action {
- uint8 verb;
- uint8 object1Num;
- uint8 object1Type;
- uint8 verbType; // 1:use,2:give
- uint8 object2Num;
- uint8 object2Type;
-};
-
-struct DialogueDataOffsets {
- int questionsOffset; // Base offset used to locate question text
- int questionsSize;
- int repliesOffset; // Base offset used to locate reply text
- int repliesSize;
- int matSize; // Stride used to index the conversation choices matrix
- int replyDataOffset;
- int questionSoundsOffset;
- int replySoundsOffset;
- int replySoundsSize;
-};
-
-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;
- DialogueDataOffsets dlg;
-};
-
-// The click fix of a room that clamps the clicked position: y is limited, x is limited to [xMin, xMax]
-// (-1: no limit), then the first walkable row below is looked for (and above if scanUp).
-struct RoomWalkTargetRules {
- int yMax;
- int xMin;
- int xMax;
- bool scanUp;
- bool enabled;
-};
-
-struct MazeNode {
- uint8 neighbors[4];
- uint8 shape;
-};
-
-enum MazeDirection {
- kMazeNorth,
- kMazeEast,
- kMazeSouth,
- kMazeWest
-};
-
-enum MazeEntryKind {
- kMazeEntryWalk, // Igor appears at (x, y) and walks to (destX, destY)
- kMazeEntryStairs // Igor walks into the picture at x, scaling down
-};
-
-struct MazeEntry {
- uint16 state;
- uint8 kind;
- int16 x, y;
- uint8 facing;
- int16 destX, destY;
-};
-
-enum MazeActionKind {
- kMazeActionExit, // walk (x1, y1) -> (x2, y2), then to the neighbour location
- kMazeActionStairsExit, // walk out of the picture at x, scaling up, then to the neighbour location
- kMazeActionExitFixed, // walk, then to a fixed location and state
- kMazeActionDialogue
-};
-
-struct MazeDialogueLine {
- uint16 text;
- uint8 count;
- uint16 sound;
-};
-
-struct MazeAction {
- uint8 code;
- uint8 kind;
- int16 x1, y1, x2, y2;
- uint8 dir;
- int16 stairsX;
- int16 location; // -1: unchanged
- int16 state;
- int8 objectState; // -1: none
- int8 objectStateValue;
- const MazeDialogueLine *lines;
- uint8 numLines;
- uint8 dialogueStart;
- uint8 dialogueCount;
-};
-
-enum MazeFlameMode {
- kMazeFlameNone,
- kMazeFlameFixed, // one flame at a fixed position, color 1 shows the first frame
- kMazeFlameFirstFrame, // color 1 shows the first frame
- kMazeFlameLayer1 // color 1 shows the next pixel of the room
-};
-
-struct MazeFlame {
- int16 x, y;
-};
-
-struct MazeRoom {
- uint8 part;
- int dat, txt, img, pal, msk, box;
- int8 music;
- uint8 darkness;
- uint8 flameMode;
- uint8 numFlames;
- MazeFlame flames[2];
- uint8 flameFrames[2];
- uint8 secondFlameFrame;
- bool saveLocation; // the room ends when the location changes
- const RoomDataOffsets *offsets;
- int giveObjectSize;
- RoomWalkTargetRules clickFix;
- const MazeEntry *entries;
- uint8 numEntries;
- const MazeAction *actions;
- uint8 numActions;
- const char *objectName3;
-};
-
enum {
kUpdateDialogueAnimEndOfSentence = 1,
kUpdateDialogueAnimMiddleOfSentence,
kUpdateDialogueAnimStanding
};
-enum ObjectType {
- kObjectTypeInventory = 1,
- kObjectTypeRoom = 2
-};
-
-// One-based inventory object numbers, separate from object state and inventory lookup indices.
-enum InventoryObjectNumber {
- kInventoryObjectBoomerang = 1,
- kInventoryObjectWallet = 2,
- kInventoryObjectParachute = 3,
- kInventoryObjectTplTickets = 4,
- kInventoryObjectRecords = 5,
- kInventoryObjectAlarmClock = 6,
- kInventoryObjectButterflyNet = 7,
- kInventoryObjectMatches = 8,
- kInventoryObjectHammer = 9,
- kInventoryObjectPickaxe = 10,
- kInventoryObjectDynamite = 11,
- kInventoryObjectHairpin = 12,
- kInventoryObjectDeansBook = 13,
- kInventoryObjectMonkeySuit = 14,
- kInventoryObjectNewspaper = 15,
- kInventoryObjectLabKeys = 16,
- kInventoryObjectBurger = 17,
- kInventoryObjectSlug = 18,
- kInventoryObjectPhoto = 19,
- kInventoryObjectFlask = 20,
- kInventoryObjectLoveNote = 21,
- kInventoryObjectFolder = 22,
- kInventoryObjectBottle = 23,
- kInventoryObjectMoney = 24,
- kInventoryObjectLizard = 25,
- kInventoryObjectRocket = 26,
- kInventoryObjectResin = 27,
- kInventoryObjectPapyrus = 28,
- kInventoryObjectPassword = 29,
- kInventoryObjectPen = 30,
- kInventoryObjectAstronomyBook = 31,
- kInventoryObjectLabNote = 32,
- kInventoryObjectFlower = 33,
- kInventoryObjectVase = 34,
- kInventoryObjectBiologyProject = 35,
- kInventoryObjectCamera = 36
-};
-
-/**
- * Indices for global game objects state, for better readability
- */
-enum ObjectStateIndex {
- kBottleStateIndex = 0,
- kLizardFedStateIndex = 1,
- kPapyrusFiguresVisibleStateIndex = 2,
- kFolderSwappedStateIndex = 3,
- kAstronomyBookStateIndex = 4,
- kPhillipLockerCombinationLearnedStateIndex = 5,
- kVaseStateIndex = 6,
- kStatueDeliveredStateIndex = 7,
- kBedroomNightstandOpenStateIndex = 8,
- kAlarmClockTakenStateIndex = 9,
- kBedroomClosetOpenStateIndex = 10,
- kBedroomHoleOpenStateIndex = 11,
- kRecordTakenStateIndex = 12,
- kBedroomWindowStateIndex = 13,
- kRatSkinHatSeenStateIndex = 14,
- kBedroomWindowExitUsedStateIndex = 15,
- kAtticTrunkOpenStateIndex = 16,
- kButterflyNetTakenStateIndex = 17,
- kAtticWallHolePresentStateIndex = 18,
- kAtticLargeCrackPresentStateIndex = 19,
- kAtticSmallCrackPresentStateIndex = 20,
- kAtticNailHotspotActiveStateIndex = 21,
- kAtticNailExaminedStateIndex = 22,
- kDynamitePlacedStateIndex = 23,
- kAtticWindowExitTriedStateIndex = 24,
- kMatchesTakenStateIndex = 25,
- kDeanDoorOpenStateIndex = 26,
- kSecretaryDoorOpenStateIndex = 27,
- kDeanBookTakenStateIndex = 28,
- kDeanPassedOutStateIndex = 29,
- kPendingDeanDrinkStateIndex = 30,
- kNewspaperTakenStateIndex = 31,
- kIntercomUsedStateIndex = 32,
- kSecretaryClosetOpenStateIndex = 34,
- kSecretaryDismissedStateIndex = 35,
- kSecretaryClosetStateIndex = 36,
- kPersonalFileChangedStateIndex = 37,
- kHamburgerTakenStateIndex = 38,
- kSlugTakenStateIndex = 40,
- kGlassShardsPresentStateIndex = 41,
- kButterflyNetStateIndex = 42,
- kLizardTakenStateIndex = 44,
- kChurchDoorOpenStateIndex = 45,
- kProjectHandedToTobiasStateIndex = 46,
- kMoneyHandedToTobiasStateIndex = 47,
- kCuckooClockTriggeredStateIndex = 48,
- kCuckooAnimationControlStateIndex = 49,
- kSecretPassageEntranceOpenStateIndex = 50,
- kFlaskTakenStateIndex = 52,
- kPhotoCutsceneSeenStateIndex = 53,
- kPhillipAndJimmyPresentStateIndex = 54,
- kCollegeEntranceFoldersSwappedStateIndex = 55,
- kPhillipAndJimmyHaveLeftStateIndex = 56,
- kHairpinTakenStateIndex = 58,
- kToiletGirlsHaveLeftStateIndex = 59,
- kSpringBridgePaperStateIndex = 60,
- kPhotographerGoneStateIndex = 61,
- kTripodStateIndex = 62,
- kCameraStateIndex = 63,
- kPhysicsClassDoorStateIndex = 64,
- kMargaretStateIndex = 65,
- kLadiesRoomDoorStateIndex = 66,
- kChemistryDoorStateIndex = 67,
- kMensRoomDoorStateIndex = 68,
- kLaboratoryDoorOpenStateIndex = 69,
- kMazeBeatenStateIndex = 70,
- kMazeEntryDirectionStateIndex = 71,
- kAstronomyLabDoorStateIndex = 72,
- kLauraMetAtCollegeStateIndex = 73,
- kAstronomyBookTakenStateIndex = 74,
- kHarrisonPhotoStateIndex = 75,
- kHarrisonNoteShownStateIndex = 76,
- kBellTowerConversationSeenStateIndex = 78,
- kSeenChickThroughTelescopeStateIndex = 79,
- kLizardGivenStateIndex = 80,
- kOldLadyConversationSeenStateIndex = 81,
- kTreeResinDiscoveredStateIndex = 82,
- kPhillipLockerStateIndex = 84,
- kLockersExaminedStateIndex = 85,
- kCarolineFolderStateIndex = 87,
- kPenTakenStateIndex = 88,
- kPhysicsClassPaperTakenStateIndex = 89,
- kCemeteryEntrySideStateIndex = 90,
- kVaseTakenStateIndex = 91,
- kUndertakerLeftStateIndex = 92,
- kRecordGivenToUndertakerStateIndex = 93,
- kBorisIntroducedStateIndex = 94,
- kPart69FireflyCapturedStateIndex = 96,
- kPart69LeaderFireflyIdentifiedStateIndex = 97,
- kPart69SwarmAnimationPhaseStateIndex = 98,
- kPart69LeaderFireflyPathStateIndex = 99,
- kStatuetteTakenStateIndex = 100,
- kStatuetteExaminedStateIndex = 101,
- kFlowerTakenStateIndex = 102,
- kLighthouseMessageSentStateIndex = 104,
- kChurchBellMessageSeenStateIndex = 105,
- kStatuetteTaken2StateIndex = 106,
- kFlaskLeftInPhillipLockerStateIndex = 107,
- kPlaneDoorOpenStateIndex = 108,
- kParachuteTakenStateIndex = 109,
- kMargaretSceneStateIndex = 110,
- kExamCompletedStateIndex = 111
-};
-
-enum MargaretState {
- kMargaretStateInitial = 0,
- kMargaretStateNoteAltered,
- kMargaretStateReadNote,
- kMargaretStatePhotoTaken,
- kMargaretStatePhotoSequenceComplete
-};
-
-// Special Entries of _inventoryInfo after the objects: the number of the first
-// visible object of the inventory and the number of objects held.
-enum {
- kInventoryFirstVisible = 72,
- kInventoryCount = 73,
- kInventoryInfoSize = 74
-};
-
-enum Verb {
- kVerbWalk = 1,
- kVerbTalk,
- kVerbTake,
- kVerbLook,
- kVerbUse,
- kVerbOpen,
- kVerbClose,
- kVerbGive
-};
-
-struct DialogueText {
- int num;
- int count;
- int sound;
-};
-
-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;
- }
- }
-};
-
enum AnimBlend {
kBlendCopy, // blit the entire rectangle
kBlendLitSprite, // Igor colors follow the roomâs masking and shading rules.
diff --git a/engines/igor/maze.h b/engines/igor/maze.h
new file mode 100644
index 00000000000..696c32b6dc0
--- /dev/null
+++ b/engines/igor/maze.h
@@ -0,0 +1,118 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_MAZE_H
+#define IGOR_MAZE_H
+
+#include "common/scummsys.h"
+#include "igor/room_types.h"
+
+namespace Igor {
+
+struct MazeNode {
+ uint8 neighbors[4];
+ uint8 shape;
+};
+
+enum MazeDirection {
+ kMazeNorth,
+ kMazeEast,
+ kMazeSouth,
+ kMazeWest
+};
+
+enum MazeEntryKind {
+ kMazeEntryWalk, // Igor appears at (x, y) and walks to (destX, destY)
+ kMazeEntryStairs // Igor walks into the picture at x, scaling down
+};
+
+struct MazeEntry {
+ uint16 state;
+ uint8 kind;
+ int16 x, y;
+ uint8 facing;
+ int16 destX, destY;
+};
+
+enum MazeActionKind {
+ kMazeActionExit, // walk (x1, y1) -> (x2, y2), then to the neighbour location
+ kMazeActionStairsExit, // walk out of the picture at x, scaling up, then to the neighbour location
+ kMazeActionExitFixed, // walk, then to a fixed location and state
+ kMazeActionDialogue
+};
+
+struct MazeDialogueLine {
+ uint16 text;
+ uint8 count;
+ uint16 sound;
+};
+
+struct MazeAction {
+ uint8 code;
+ uint8 kind;
+ int16 x1, y1, x2, y2;
+ uint8 dir;
+ int16 stairsX;
+ int16 location; // -1: unchanged
+ int16 state;
+ int8 objectState; // -1: none
+ int8 objectStateValue;
+ const MazeDialogueLine *lines;
+ uint8 numLines;
+ uint8 dialogueStart;
+ uint8 dialogueCount;
+};
+
+enum MazeFlameMode {
+ kMazeFlameNone,
+ kMazeFlameFixed, // one flame at a fixed position, color 1 shows the first frame
+ kMazeFlameFirstFrame, // color 1 shows the first frame
+ kMazeFlameLayer1 // color 1 shows the next pixel of the room
+};
+
+struct MazeFlame {
+ int16 x, y;
+};
+
+struct MazeRoom {
+ uint8 part;
+ int dat, txt, img, pal, msk, box;
+ int8 music;
+ uint8 darkness;
+ uint8 flameMode;
+ uint8 numFlames;
+ MazeFlame flames[2];
+ uint8 flameFrames[2];
+ uint8 secondFlameFrame;
+ bool saveLocation; // the room ends when the location changes
+ const RoomDataOffsets *offsets;
+ int giveObjectSize;
+ RoomWalkTargetRules clickFix;
+ const MazeEntry *entries;
+ uint8 numEntries;
+ const MazeAction *actions;
+ uint8 numActions;
+ const char *objectName3;
+};
+
+} // End of namespace Igor
+
+#endif // IGOR_MAZE_H
diff --git a/engines/igor/objects.h b/engines/igor/objects.h
new file mode 100644
index 00000000000..37edb84ec56
--- /dev/null
+++ b/engines/igor/objects.h
@@ -0,0 +1,209 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_OBJECTS_H
+#define IGOR_OBJECTS_H
+
+namespace Igor {
+
+enum ObjectType {
+ kObjectTypeInventory = 1,
+ kObjectTypeRoom = 2
+};
+
+// One-based inventory object numbers, separate from object state and inventory lookup indices.
+enum InventoryObjectNumber {
+ kInventoryObjectBoomerang = 1,
+ kInventoryObjectWallet = 2,
+ kInventoryObjectParachute = 3,
+ kInventoryObjectTplTickets = 4,
+ kInventoryObjectRecords = 5,
+ kInventoryObjectAlarmClock = 6,
+ kInventoryObjectButterflyNet = 7,
+ kInventoryObjectMatches = 8,
+ kInventoryObjectHammer = 9,
+ kInventoryObjectPickaxe = 10,
+ kInventoryObjectDynamite = 11,
+ kInventoryObjectHairpin = 12,
+ kInventoryObjectDeansBook = 13,
+ kInventoryObjectMonkeySuit = 14,
+ kInventoryObjectNewspaper = 15,
+ kInventoryObjectLabKeys = 16,
+ kInventoryObjectBurger = 17,
+ kInventoryObjectSlug = 18,
+ kInventoryObjectPhoto = 19,
+ kInventoryObjectFlask = 20,
+ kInventoryObjectLoveNote = 21,
+ kInventoryObjectFolder = 22,
+ kInventoryObjectBottle = 23,
+ kInventoryObjectMoney = 24,
+ kInventoryObjectLizard = 25,
+ kInventoryObjectRocket = 26,
+ kInventoryObjectResin = 27,
+ kInventoryObjectPapyrus = 28,
+ kInventoryObjectPassword = 29,
+ kInventoryObjectPen = 30,
+ kInventoryObjectAstronomyBook = 31,
+ kInventoryObjectLabNote = 32,
+ kInventoryObjectFlower = 33,
+ kInventoryObjectVase = 34,
+ kInventoryObjectBiologyProject = 35,
+ kInventoryObjectCamera = 36
+};
+
+/**
+ * Indices for global game objects state, for better readability
+ */
+enum ObjectStateIndex {
+ kBottleStateIndex = 0,
+ kLizardFedStateIndex = 1,
+ kPapyrusFiguresVisibleStateIndex = 2,
+ kFolderSwappedStateIndex = 3,
+ kAstronomyBookStateIndex = 4,
+ kPhillipLockerCombinationLearnedStateIndex = 5,
+ kVaseStateIndex = 6,
+ kStatueDeliveredStateIndex = 7,
+ kBedroomNightstandOpenStateIndex = 8,
+ kAlarmClockTakenStateIndex = 9,
+ kBedroomClosetOpenStateIndex = 10,
+ kBedroomHoleOpenStateIndex = 11,
+ kRecordTakenStateIndex = 12,
+ kBedroomWindowStateIndex = 13,
+ kRatSkinHatSeenStateIndex = 14,
+ kBedroomWindowExitUsedStateIndex = 15,
+ kAtticTrunkOpenStateIndex = 16,
+ kButterflyNetTakenStateIndex = 17,
+ kAtticWallHolePresentStateIndex = 18,
+ kAtticLargeCrackPresentStateIndex = 19,
+ kAtticSmallCrackPresentStateIndex = 20,
+ kAtticNailHotspotActiveStateIndex = 21,
+ kAtticNailExaminedStateIndex = 22,
+ kDynamitePlacedStateIndex = 23,
+ kAtticWindowExitTriedStateIndex = 24,
+ kMatchesTakenStateIndex = 25,
+ kDeanDoorOpenStateIndex = 26,
+ kSecretaryDoorOpenStateIndex = 27,
+ kDeanBookTakenStateIndex = 28,
+ kDeanPassedOutStateIndex = 29,
+ kPendingDeanDrinkStateIndex = 30,
+ kNewspaperTakenStateIndex = 31,
+ kIntercomUsedStateIndex = 32,
+ kSecretaryClosetOpenStateIndex = 34,
+ kSecretaryDismissedStateIndex = 35,
+ kSecretaryClosetStateIndex = 36,
+ kPersonalFileChangedStateIndex = 37,
+ kHamburgerTakenStateIndex = 38,
+ kSlugTakenStateIndex = 40,
+ kGlassShardsPresentStateIndex = 41,
+ kButterflyNetStateIndex = 42,
+ kLizardTakenStateIndex = 44,
+ kChurchDoorOpenStateIndex = 45,
+ kProjectHandedToTobiasStateIndex = 46,
+ kMoneyHandedToTobiasStateIndex = 47,
+ kCuckooClockTriggeredStateIndex = 48,
+ kCuckooAnimationControlStateIndex = 49,
+ kSecretPassageEntranceOpenStateIndex = 50,
+ kFlaskTakenStateIndex = 52,
+ kPhotoCutsceneSeenStateIndex = 53,
+ kPhillipAndJimmyPresentStateIndex = 54,
+ kCollegeEntranceFoldersSwappedStateIndex = 55,
+ kPhillipAndJimmyHaveLeftStateIndex = 56,
+ kHairpinTakenStateIndex = 58,
+ kToiletGirlsHaveLeftStateIndex = 59,
+ kSpringBridgePaperStateIndex = 60,
+ kPhotographerGoneStateIndex = 61,
+ kTripodStateIndex = 62,
+ kCameraStateIndex = 63,
+ kPhysicsClassDoorStateIndex = 64,
+ kMargaretStateIndex = 65,
+ kLadiesRoomDoorStateIndex = 66,
+ kChemistryDoorStateIndex = 67,
+ kMensRoomDoorStateIndex = 68,
+ kLaboratoryDoorOpenStateIndex = 69,
+ kMazeBeatenStateIndex = 70,
+ kMazeEntryDirectionStateIndex = 71,
+ kAstronomyLabDoorStateIndex = 72,
+ kLauraMetAtCollegeStateIndex = 73,
+ kAstronomyBookTakenStateIndex = 74,
+ kHarrisonPhotoStateIndex = 75,
+ kHarrisonNoteShownStateIndex = 76,
+ kBellTowerConversationSeenStateIndex = 78,
+ kSeenChickThroughTelescopeStateIndex = 79,
+ kLizardGivenStateIndex = 80,
+ kOldLadyConversationSeenStateIndex = 81,
+ kTreeResinDiscoveredStateIndex = 82,
+ kPhillipLockerStateIndex = 84,
+ kLockersExaminedStateIndex = 85,
+ kCarolineFolderStateIndex = 87,
+ kPenTakenStateIndex = 88,
+ kPhysicsClassPaperTakenStateIndex = 89,
+ kCemeteryEntrySideStateIndex = 90,
+ kVaseTakenStateIndex = 91,
+ kUndertakerLeftStateIndex = 92,
+ kRecordGivenToUndertakerStateIndex = 93,
+ kBorisIntroducedStateIndex = 94,
+ kPart69FireflyCapturedStateIndex = 96,
+ kPart69LeaderFireflyIdentifiedStateIndex = 97,
+ kPart69SwarmAnimationPhaseStateIndex = 98,
+ kPart69LeaderFireflyPathStateIndex = 99,
+ kStatuetteTakenStateIndex = 100,
+ kStatuetteExaminedStateIndex = 101,
+ kFlowerTakenStateIndex = 102,
+ kLighthouseMessageSentStateIndex = 104,
+ kChurchBellMessageSeenStateIndex = 105,
+ kStatuetteTaken2StateIndex = 106,
+ kFlaskLeftInPhillipLockerStateIndex = 107,
+ kPlaneDoorOpenStateIndex = 108,
+ kParachuteTakenStateIndex = 109,
+ kMargaretSceneStateIndex = 110,
+ kExamCompletedStateIndex = 111
+};
+
+enum MargaretState {
+ kMargaretStateInitial = 0,
+ kMargaretStateNoteAltered,
+ kMargaretStateReadNote,
+ kMargaretStatePhotoTaken,
+ kMargaretStatePhotoSequenceComplete
+};
+
+// Special Entries of _inventoryInfo after the objects: the number of the first
+// visible object of the inventory and the number of objects held.
+enum {
+ kInventoryFirstVisible = 72,
+ kInventoryCount = 73,
+ kInventoryInfoSize = 74
+};
+
+enum Verb {
+ kVerbWalk = 1,
+ kVerbTalk,
+ kVerbTake,
+ kVerbLook,
+ kVerbUse,
+ kVerbOpen,
+ kVerbClose,
+ kVerbGive
+};
+
+} // End of namespace Igor
+
+#endif // IGOR_OBJECTS_H
diff --git a/engines/igor/resource_types.h b/engines/igor/resource_types.h
new file mode 100644
index 00000000000..f03a4aa4fb1
--- /dev/null
+++ b/engines/igor/resource_types.h
@@ -0,0 +1,61 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_RESOURCE_TYPES_H
+#define IGOR_RESOURCE_TYPES_H
+
+#include "common/language.h"
+#include "common/scummsys.h"
+#include "common/str.h"
+
+namespace Igor {
+
+struct DetectedGameVersion {
+ int version;
+ int flags;
+ Common::Language language;
+ const char *ovlFileName;
+ const char *sfxFileName;
+};
+
+enum ResourceSource {
+ kResourceSourceContainer, // the game's resource container (IGOR.DAT)
+ kResourceSourceTable = 2 // data embedded in IGOR.TBL, offset is absolute in that file
+};
+
+struct ResourceEntry {
+ int id;
+ uint32 offs;
+ uint32 size;
+ ResourceSource source;
+};
+
+struct StringEntry {
+ int id;
+ Common::String str;
+
+ StringEntry() : id(0) {}
+ StringEntry(int i, const char *s) : id(i), str(s) {}
+};
+
+} // End of namespace Igor
+
+#endif // IGOR_RESOURCE_TYPES_H
diff --git a/engines/igor/room_types.h b/engines/igor/room_types.h
new file mode 100644
index 00000000000..e39a7b55561
--- /dev/null
+++ b/engines/igor/room_types.h
@@ -0,0 +1,171 @@
+/* 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 3 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, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef IGOR_ROOM_TYPES_H
+#define IGOR_ROOM_TYPES_H
+
+#include "common/scummsys.h"
+
+namespace Igor {
+
+enum FacingPosition {
+ kFacingPositionBack = 1,
+ kFacingPositionRight = 2,
+ kFacingPositionFront = 3,
+ kFacingPositionLeft = 4
+};
+
+struct RoomWalkBounds {
+ int x1, y1;
+ int x2, y2;
+ // Minimum y after clamping a click past the corresponding horizontal edge.
+ // e.g. clamped to x1? then x1MinY is used to determine the minimum y.
+ int x1MinY, x2MinY;
+};
+
+struct RoomObjectArea {
+ uint8 area;
+ uint8 object;
+ uint8 y1Lum;
+ uint8 y2Lum;
+ uint8 deltaLum;
+};
+
+struct Action {
+ uint8 verb;
+ uint8 object1Num;
+ uint8 object1Type;
+ uint8 verbType; // 1:use,2:give
+ uint8 object2Num;
+ uint8 object2Type;
+};
+
+struct DialogueDataOffsets {
+ int questionsOffset; // Base offset used to locate question text
+ int questionsSize;
+ int repliesOffset; // Base offset used to locate reply text
+ int repliesSize;
+ int matSize; // Stride used to index the conversation choices matrix
+ int replyDataOffset;
+ int questionSoundsOffset;
+ int replySoundsOffset;
+ int replySoundsSize;
+};
+
+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;
+ DialogueDataOffsets dlg;
+};
+
+// The click fix of a room that clamps the clicked position: y is limited, x is limited to [xMin, xMax]
+// (-1: no limit), then the first walkable row below is looked for (and above if scanUp).
+struct RoomWalkTargetRules {
+ int yMax;
+ int xMin;
+ int xMax;
+ bool scanUp;
+ bool enabled;
+};
+
+struct DialogueText {
+ int num;
+ int count;
+ int sound;
+};
+
+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;
+ }
+ }
+};
+
+} // End of namespace Igor
+
+#endif // IGOR_ROOM_TYPES_H
Commit: 34ad0c993e35b812651b50c10d516cf4bd6aa041
https://github.com/scummvm/scummvm/commit/34ad0c993e35b812651b50c10d516cf4bd6aa041
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:29+01:00
Commit Message:
IGOR: Support return to Launcher
Changed paths:
engines/igor/copy_protection.cpp
engines/igor/input.cpp
engines/igor/options.cpp
diff --git a/engines/igor/copy_protection.cpp b/engines/igor/copy_protection.cpp
index 2fded56195c..202220223f2 100644
--- a/engines/igor/copy_protection.cpp
+++ b/engines/igor/copy_protection.cpp
@@ -161,7 +161,7 @@ bool IgorEngine::readProtectionWord(uint8 *typed) {
Common::Event ev;
bool changed = false;
while (!done && _eventMan->pollEvent(ev)) {
- if (ev.type == Common::EVENT_QUIT) {
+ if (ev.type == Common::EVENT_QUIT || ev.type == Common::EVENT_RETURN_TO_LAUNCHER) {
_currentPart = kInvalidPart;
_eventQuitGame = true;
break;
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index ac5d08cb3d2..059c83c52a3 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -49,6 +49,7 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
Common::Event ev;
while (!_eventQuitGame && _eventMan->pollEvent(ev)) {
switch (ev.type) {
+ case Common::EVENT_RETURN_TO_LAUNCHER:
case Common::EVENT_QUIT:
_inputVars[kInputEscape] = 1;
_currentPart = kInvalidPart;
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 76715bfd958..755508172af 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -511,7 +511,7 @@ void IgorEngine::floppyOptionsControlPage(const uint8 *button) {
while (!leave && !_eventQuitGame && _currentPart != kInvalidPart) {
Common::Event ev;
while (_eventMan->pollEvent(ev)) {
- if (ev.type == Common::EVENT_QUIT) {
+ if (ev.type == Common::EVENT_QUIT || ev.type == Common::EVENT_RETURN_TO_LAUNCHER) {
_currentPart = kInvalidPart;
_eventQuitGame = true;
} else if (ev.type == Common::EVENT_KEYDOWN) {
@@ -557,7 +557,7 @@ void IgorEngine::floppyOptionsQuitPage(const uint8 *button) {
while (!leave && !_eventQuitGame && _currentPart != kInvalidPart) {
Common::Event ev;
while (_eventMan->pollEvent(ev)) {
- if (ev.type == Common::EVENT_QUIT) {
+ if (ev.type == Common::EVENT_QUIT || ev.type == Common::EVENT_RETURN_TO_LAUNCHER) {
_currentPart = kInvalidPart;
_eventQuitGame = true;
} else if (ev.type == Common::EVENT_KEYDOWN) {
@@ -733,7 +733,7 @@ bool IgorEngine::saveLoadChoose(const SaveLoadLayout &l, const uint8 *button, co
}
Common::Event ev;
while (_eventMan->pollEvent(ev)) {
- if (ev.type == Common::EVENT_QUIT) {
+ if (ev.type == Common::EVENT_QUIT || ev.type == Common::EVENT_RETURN_TO_LAUNCHER) {
_currentPart = kInvalidPart;
_eventQuitGame = true;
} else if (ev.type == Common::EVENT_KEYDOWN) {
@@ -841,7 +841,7 @@ bool IgorEngine::saveLoadEditName(const SaveLoadLayout &l, const uint8 *button,
while (!done && !_eventQuitGame && _currentPart != kInvalidPart) {
Common::Event ev;
while (_eventMan->pollEvent(ev)) {
- if (ev.type == Common::EVENT_QUIT) {
+ if (ev.type == Common::EVENT_QUIT || ev.type == Common::EVENT_RETURN_TO_LAUNCHER) {
_currentPart = kInvalidPart;
_eventQuitGame = true;
} else if (ev.type == Common::EVENT_KEYDOWN) {
@@ -997,7 +997,7 @@ void IgorEngine::handleFloppyOptionsMenu() {
while (menuLoop && !_eventQuitGame && _currentPart != kInvalidPart) {
Common::Event ev;
while (_eventMan->pollEvent(ev)) {
- if (ev.type == Common::EVENT_QUIT) {
+ if (ev.type == Common::EVENT_QUIT || ev.type == Common::EVENT_RETURN_TO_LAUNCHER) {
_currentPart = kInvalidPart;
_eventQuitGame = true;
} else if (ev.type == Common::EVENT_KEYDOWN) {
@@ -1127,6 +1127,7 @@ void IgorEngine::handleOptionsMenu() {
Common::Event ev;
while (_eventMan->pollEvent(ev)) {
switch (ev.type) {
+ case Common::EVENT_RETURN_TO_LAUNCHER:
case Common::EVENT_QUIT:
_currentPart = kInvalidPart;
_eventQuitGame = true;
Commit: c7fc4ad0d9bb84520f711be8cac6617971a93bac
https://github.com/scummvm/scummvm/commit/c7fc4ad0d9bb84520f711be8cac6617971a93bac
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:29+01:00
Commit Message:
IGOR: Remove unused midi controller
Changed paths:
engines/igor/midi.cpp
diff --git a/engines/igor/midi.cpp b/engines/igor/midi.cpp
index c1847afb03d..1da37315eda 100644
--- a/engines/igor/midi.cpp
+++ b/engines/igor/midi.cpp
@@ -313,9 +313,6 @@ void AdlibMidiDriver::adlibControlChange(int channel, int control, int param) {
adlibWrite(0xBD, _adlibData[0xBD] & ~0x20);
}
break;
- case 0x7B:
- adlibTurnNoteOff(channel, -1);
- break;
default:
warning("Unhandled adlibControlChange 0x%X %d", control, param);
break;
Commit: 09582b2f0befc460dc145797b204d8a9e50a102a
https://github.com/scummvm/scummvm/commit/09582b2f0befc460dc145797b204d8a9e50a102a
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:30+01:00
Commit Message:
IGOR: Adds keymapper support
Changed paths:
engines/igor/copy_protection.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/metaengine.cpp
engines/igor/metaengine.h
engines/igor/options.cpp
diff --git a/engines/igor/copy_protection.cpp b/engines/igor/copy_protection.cpp
index 202220223f2..660062ae6d3 100644
--- a/engines/igor/copy_protection.cpp
+++ b/engines/igor/copy_protection.cpp
@@ -148,6 +148,7 @@ void IgorEngine::drawProtectionScreen(const Common::Array<Common::String> &texts
}
bool IgorEngine::readProtectionWord(uint8 *typed) {
+ setKeymapperEnabled(false);
memset(typed, ' ', kFloppyProtectionMaxInput + 1);
int position = 1;
int x = kFloppyProtectionInputX;
@@ -211,6 +212,7 @@ bool IgorEngine::readProtectionWord(uint8 *typed) {
lastTick = ticksSince(startMillis);
blinkCounter = (blinkCounter == kFloppyProtectionBlinkPeriod - 1) ? 0 : blinkCounter + 1;
}
+ setKeymapperEnabled(true);
return !isGameEnding();
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index bd620ea49c4..001e91e6c52 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -117,6 +117,27 @@ enum SpaFloppySound {
// Value of _hoverVerbState when the verb panel shows the selected verb
static const int kHoverVerbSelected = -1;
+// Custom engine actions generated by the keymapper.
+enum IgorAction {
+ kActionNone = 0,
+ kActionEscape,
+ kActionConfirm,
+ kActionOptions,
+ kActionPause,
+ kActionFastMode,
+ kActionKeyRightClick,
+ kActionUp,
+ kActionDown,
+ kActionLeft,
+ kActionRight,
+ kActionUpLeft,
+ kActionUpRight,
+ kActionDownLeft,
+ kActionDownRight,
+ kActionYes,
+ kActionNo
+};
+
enum InputVar {
kInputSkipDialogue = 0,
kInputCursorXPos,
@@ -1349,8 +1370,9 @@ private:
void beginRightButtonVerbPick();
int getDefaultVerbAt(int x, int y) const;
void updateHoverVerbHighlight();
- bool isCursorKey(Common::KeyCode key) const;
- bool moveCursorWithKeyboard(Common::KeyCode key);
+ bool isCursorKey(int action) const;
+ bool moveCursorWithKeyboard(int action);
+ void setKeymapperEnabled(bool enabled);
void updateRightButtonVerbPick();
void endRightButtonVerbPick();
void formatRightButtonSentence();
@@ -1501,9 +1523,9 @@ public:
}
void handleOptionsMenu_paintQuit();
- bool handleOptionsMenu_handleKeyDownQuit(int key);
+ bool handleOptionsMenu_handleActionQuit(int action);
void handleOptionsMenu_paintCtrl();
- bool handleOptionsMenu_handleKeyDownCtrl(int key);
+ bool handleOptionsMenu_handleActionCtrl(int action);
public:
IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 059c83c52a3..06f0dbfb719 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -24,6 +24,8 @@
#include "common/system.h"
#include "graphics/cursorman.h"
+#include "backends/keymapper/keymapper.h"
+
#include "igor/igor.h"
namespace Igor {
@@ -56,38 +58,38 @@ void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
_eventQuitGame = true;
cancelDialogue();
break;
- case Common::EVENT_KEYDOWN:
- if (ev.kbd.keycode == Common::KEYCODE_f && (ev.kbd.flags & Common::KBD_CTRL)) {
+ case Common::EVENT_CUSTOM_ENGINE_ACTION_START:
+ if (ev.customType == kActionFastMode) {
_fastMode = (_fastMode == 1) ? kFastModeFactor : 1;
- debugC(1, kDebugEngine, "Ctrl+F: fast mode %d (%d ms per tick)",
+ debugC(1, kDebugEngine, "fast mode %d (%d ms per tick)",
_fastMode, kTimerTicksCount * 1000 / kTickDelay / _fastMode);
- } else if (ev.kbd.keycode == Common::KEYCODE_ESCAPE) {
+ } else if (ev.customType == kActionEscape) {
_inputVars[kInputEscape] = 1;
- } else if (_game.version == kIdSpaFloppy && moveCursorWithKeyboard(ev.kbd.keycode)) {
+ } else if (_game.version == kIdSpaFloppy && moveCursorWithKeyboard(ev.customType)) {
// the cursor was moved with the arrow/keypad keys
- } else if (_game.version == kIdSpaFloppy && ev.kbd.keycode == Common::KEYCODE_INSERT) {
+ } else if (_game.version == kIdSpaFloppy && ev.customType == kActionKeyRightClick) {
// Insert acts as the right button
if (!_gameState.dialogueTextRunning && !ev.kbdRepeat) {
_inputVars[kInputRightRelease] = 0;
_inputVars[kInputRightClick] = 1;
}
- } else if (ev.kbd.keycode == Common::KEYCODE_RETURN || ev.kbd.keycode == Common::KEYCODE_KP_ENTER) {
+ } else if (ev.customType == kActionConfirm) {
_inputVars[kInputConfirm] = 1;
// Enter acts as the left button at the cursor position (first press only)
if (_game.version == kIdSpaFloppy && !_gameState.dialogueTextRunning && !ev.kbdRepeat) {
_inputVars[kInputClick] = 1;
}
- } else if (ev.kbd.keycode == Common::KEYCODE_SPACE) {
+ } else if (ev.customType == kActionOptions) {
_inputVars[kInputOptions] = 1;
- } else if (ev.kbd.keycode == Common::KEYCODE_p) {
+ } else if (ev.customType == kActionPause) {
_inputVars[kInputPause] = 1;
}
break;
- case Common::EVENT_KEYUP:
- if (_game.version == kIdSpaFloppy && isCursorKey(ev.kbd.keycode)) {
+ case Common::EVENT_CUSTOM_ENGINE_ACTION_END:
+ if (_game.version == kIdSpaFloppy && isCursorKey(ev.customType)) {
_keyboardCursorStep = 1;
}
- if (ev.kbd.keycode == Common::KEYCODE_RETURN || ev.kbd.keycode == Common::KEYCODE_KP_ENTER) {
+ if (ev.customType == kActionConfirm) {
_inputVars[kInputConfirm] = 0;
}
break;
@@ -316,36 +318,33 @@ void IgorEngine::formatRightButtonSentence() {
}
}
-static const Common::KeyCode kCursorKeys[] = {
- Common::KEYCODE_UP, Common::KEYCODE_DOWN, Common::KEYCODE_LEFT, Common::KEYCODE_RIGHT,
- Common::KEYCODE_HOME, Common::KEYCODE_END, Common::KEYCODE_PAGEUP, Common::KEYCODE_PAGEDOWN,
- Common::KEYCODE_KP8, Common::KEYCODE_KP2, Common::KEYCODE_KP4, Common::KEYCODE_KP6,
- Common::KEYCODE_KP7, Common::KEYCODE_KP1, Common::KEYCODE_KP9, Common::KEYCODE_KP3
-};
+bool IgorEngine::isCursorKey(int action) const {
+ return action >= kActionUp && action <= kActionDownRight;
+}
-bool IgorEngine::isCursorKey(Common::KeyCode key) const {
- for (uint i = 0; i < ARRAYSIZE(kCursorKeys); ++i) {
- if (kCursorKeys[i] == key)
- return true;
+void IgorEngine::setKeymapperEnabled(bool enabled) {
+ _eventMan->getKeymapper()->setEnabled(enabled);
+ if (enabled) {
+ // the release of a key pressed before the suspension was not seen as an action end
+ _inputVars[kInputConfirm] = 0;
}
- return false;
}
// Arrow and keypad keys move the cursor by a step that grows with every key
// press (key repeat included) and returns to 1 when a key is released.
-bool IgorEngine::moveCursorWithKeyboard(Common::KeyCode key) {
- if (!isCursorKey(key))
+bool IgorEngine::moveCursorWithKeyboard(int action) {
+ if (!isCursorKey(action))
return false;
int dx = 0;
int dy = 0;
- switch (key) {
- case Common::KEYCODE_UP: case Common::KEYCODE_KP8: dy = -1; break;
- case Common::KEYCODE_DOWN: case Common::KEYCODE_KP2: dy = 1; break;
- case Common::KEYCODE_LEFT: case Common::KEYCODE_KP4: dx = -1; break;
- case Common::KEYCODE_RIGHT: case Common::KEYCODE_KP6: dx = 1; break;
- case Common::KEYCODE_HOME: case Common::KEYCODE_KP7: dx = -1; dy = -1; break;
- case Common::KEYCODE_PAGEUP: case Common::KEYCODE_KP9: dx = 1; dy = -1; break;
- case Common::KEYCODE_END: case Common::KEYCODE_KP1: dx = -1; dy = 1; break;
+ switch (action) {
+ case kActionUp: dy = -1; break;
+ case kActionDown: dy = 1; break;
+ case kActionLeft: dx = -1; break;
+ case kActionRight: dx = 1; break;
+ case kActionUpLeft: dx = -1; dy = -1; break;
+ case kActionUpRight: dx = 1; dy = -1; break;
+ case kActionDownLeft: dx = -1; dy = 1; break;
default: dx = 1; dy = 1; break;
}
const int step = _keyboardCursorStep++;
diff --git a/engines/igor/metaengine.cpp b/engines/igor/metaengine.cpp
index bd7eada421c..ca2bb879862 100644
--- a/engines/igor/metaengine.cpp
+++ b/engines/igor/metaengine.cpp
@@ -19,8 +19,13 @@
*
*/
+#include "common/config-manager.h"
#include "common/translation.h"
+#include "backends/keymapper/action.h"
+#include "backends/keymapper/keymap.h"
+#include "backends/keymapper/standard-actions.h"
+
#include "igor/detection.h"
#include "igor/igor.h"
#include "igor/metaengine.h"
@@ -69,6 +74,78 @@ const ADExtraGuiOptionsMap *IgorMetaEngine::getAdvancedExtraGuiOptions() const {
return Igor::optionsList;
}
+Common::KeymapArray IgorMetaEngine::initKeymaps(const char *target) const {
+ using namespace Common;
+
+ Keymap *mouseKeymap = new Keymap(Keymap::kKeymapTypeGame, "igor-default", _("Default keymappings"));
+ // The keyboard actions live in their own keymap: it is suspended while the player types text.
+ Keymap *keyKeymap = new Keymap(Keymap::kKeymapTypeGame, "igor-keys", _("Keyboard keymappings"));
+
+ Common::Action *act;
+
+ act = new Common::Action(kStandardActionLeftClick, _("Left click"));
+ act->setLeftClickEvent();
+ act->addDefaultInputMapping("MOUSE_LEFT");
+ act->addDefaultInputMapping("JOY_A");
+ mouseKeymap->addAction(act);
+
+ act = new Common::Action(kStandardActionRightClick, _("Right click"));
+ act->setRightClickEvent();
+ act->addDefaultInputMapping("MOUSE_RIGHT");
+ act->addDefaultInputMapping("JOY_B");
+ mouseKeymap->addAction(act);
+
+ act = new Common::Action(kStandardActionOpenMainMenu, _("Game menu"));
+ act->setKeyEvent(KeyState(KEYCODE_F5, ASCII_F5));
+ act->addDefaultInputMapping("F5");
+ act->addDefaultInputMapping("JOY_LEFT_SHOULDER");
+ act->allowKbdRepeats();
+ mouseKeymap->addAction(act);
+
+ struct KeyAction {
+ const char *id;
+ const char *desc;
+ int action;
+ const char *keys[3];
+ bool repeat;
+ };
+ // The quit confirmation answers with the initial of "yes" in the game's language.
+ const char *yesKey = (ConfMan.hasKey("language", target) && parseLanguage(ConfMan.get("language", target)) == ES_ESP) ? "s" : "y";
+ // I18N: Escape is a key
+ const KeyAction keyActions[] = {
+ { "ESCAPE", _s("Escape"), Igor::kActionEscape, { "ESCAPE", "JOY_X", nullptr }, true },
+ { "CONFIRM", _s("Confirm"), Igor::kActionConfirm, { "RETURN", "KP_ENTER", nullptr }, true },
+ { "OPTIONS", _s("Options menu"), Igor::kActionOptions, { "SPACE", "JOY_Y", nullptr }, true },
+ { "PAUSE", _s("Pause"), Igor::kActionPause, { "p", nullptr, nullptr }, true },
+ { "FASTMODE", _s("Toggle fast mode"), Igor::kActionFastMode, { "C+f", nullptr, nullptr }, false },
+ { "KEYRIGHTCLICK", _s("Right click with the keyboard"), Igor::kActionKeyRightClick, { "INSERT", nullptr, nullptr }, true },
+ { "UP", _s("Up"), Igor::kActionUp, { "UP", "KP8", "JOY_UP" }, true },
+ { "DOWN", _s("Down"), Igor::kActionDown, { "DOWN", "KP2", "JOY_DOWN" }, true },
+ { "LEFT", _s("Left"), Igor::kActionLeft, { "LEFT", "KP4", "JOY_LEFT" }, true },
+ { "RIGHT", _s("Right"), Igor::kActionRight, { "RIGHT", "KP6", "JOY_RIGHT" }, true },
+ { "UPLEFT", _s("Up and left"), Igor::kActionUpLeft, { "HOME", "KP7", nullptr }, true },
+ { "UPRIGHT", _s("Up and right"), Igor::kActionUpRight, { "PAGEUP", "KP9", nullptr }, true },
+ { "DOWNLEFT", _s("Down and left"), Igor::kActionDownLeft, { "END", "KP1", nullptr }, true },
+ { "DOWNRIGHT", _s("Down and right"), Igor::kActionDownRight, { "PAGEDOWN", "KP3", nullptr }, true },
+ { "YES", _s("Confirm quit"), Igor::kActionYes, { yesKey, nullptr, nullptr }, true },
+ { "NO", _s("Cancel quit"), Igor::kActionNo, { "n", nullptr, nullptr }, true }
+ };
+ for (uint i = 0; i < ARRAYSIZE(keyActions); ++i) {
+ act = new Common::Action(keyActions[i].id, _(keyActions[i].desc));
+ act->setCustomEngineActionEvent(keyActions[i].action);
+ for (uint j = 0; j < ARRAYSIZE(keyActions[i].keys) && keyActions[i].keys[j]; ++j)
+ act->addDefaultInputMapping(keyActions[i].keys[j]);
+ if (keyActions[i].repeat)
+ act->allowKbdRepeats();
+ keyKeymap->addAction(act);
+ }
+
+ KeymapArray keymaps(2);
+ keymaps[0] = mouseKeymap;
+ keymaps[1] = keyKeymap;
+ return keymaps;
+}
+
Common::Error IgorMetaEngine::createInstance(OSystem *syst, Engine **engine, const Igor::IgorGameDescription *desc) const {
*engine = new Igor::IgorEngine(syst, desc);
return Common::kNoError;
diff --git a/engines/igor/metaengine.h b/engines/igor/metaengine.h
index d065e579317..bc6c297066a 100644
--- a/engines/igor/metaengine.h
+++ b/engines/igor/metaengine.h
@@ -39,6 +39,7 @@ public:
void getSavegameThumbnail(Graphics::Surface &thumb) override;
const ADExtraGuiOptionsMap *getAdvancedExtraGuiOptions() const override;
+ Common::KeymapArray initKeymaps(const char *target) const override;
};
#endif // IGOR_METAENGINE_H
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 755508172af..d9259e4214b 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -142,7 +142,7 @@ struct Page {
int captions[2];
int xPos[2];
void (IgorEngine::*paintProc)();
- bool (IgorEngine::*handleKeyDownProc)(int key);
+ bool (IgorEngine::*handleActionProc)(int action);
};
static const Page pages[] = {
@@ -162,13 +162,13 @@ static const Page pages[] = {
{ kOptionsQuit, kOptionsQuitTitle },
{ 159, 159 },
&IgorEngine::handleOptionsMenu_paintQuit,
- &IgorEngine::handleOptionsMenu_handleKeyDownQuit
+ &IgorEngine::handleOptionsMenu_handleActionQuit
},
{
{ kOptionsCtrl, kOptionsCtrlTitle },
{ 205, 159 },
&IgorEngine::handleOptionsMenu_paintCtrl,
- &IgorEngine::handleOptionsMenu_handleKeyDownCtrl
+ &IgorEngine::handleOptionsMenu_handleActionCtrl
},
{
{ kOptionsPlay, -1 },
@@ -241,11 +241,10 @@ void IgorEngine::handleOptionsMenu_paintQuit() {
drawOptionsMenuText(kOptionsQuitKeys, kPageCenterX, 76 - kMenuY, kColorTitle);
}
-bool IgorEngine::handleOptionsMenu_handleKeyDownQuit(int key) {
- const int yesKey = (_game.language == Common::ES_ESP) ? Common::KEYCODE_s : Common::KEYCODE_y;
- if (key == yesKey)
+bool IgorEngine::handleOptionsMenu_handleActionQuit(int action) {
+ if (action == kActionYes)
_currentPart = kInvalidPart;
- return key == yesKey || key == Common::KEYCODE_n || key == Common::KEYCODE_ESCAPE;
+ return action == kActionYes || action == kActionNo || action == kActionEscape;
}
static void redrawRect(uint8 *dst, int num, bool border) {
@@ -294,11 +293,11 @@ void IgorEngine::handleOptionsMenu_paintCtrl() {
}
}
-bool IgorEngine::handleOptionsMenu_handleKeyDownCtrl(int key) {
+bool IgorEngine::handleOptionsMenu_handleActionCtrl(int action) {
if (_game.flags & kFlagDemo) {
- if (key == Common::KEYCODE_ESCAPE)
+ if (action == kActionEscape)
return true;
- if (key == Common::KEYCODE_RETURN) {
+ if (action == kActionConfirm) {
_gameState.talkSpeed = _gameState.talkSpeed == 5 ? 1 : _gameState.talkSpeed + 1;
handleOptionsMenu_paintCtrl();
}
@@ -306,16 +305,16 @@ bool IgorEngine::handleOptionsMenu_handleKeyDownCtrl(int key) {
}
const int firstRow = (_game.flags & kFlagTalkie) ? 1 : 4;
const int lastRow = getTalkMode() == kTalkModeTextOnly ? 4 : 3;
- switch (key) {
- case Common::KEYCODE_ESCAPE:
+ switch (action) {
+ case kActionEscape:
return true;
- case Common::KEYCODE_UP:
+ case kActionUp:
_optionsControlRow = MAX(firstRow, _optionsControlRow - 1);
break;
- case Common::KEYCODE_DOWN:
+ case kActionDown:
_optionsControlRow = MIN(lastRow, _optionsControlRow + 1);
break;
- case Common::KEYCODE_RETURN:
+ case kActionConfirm:
switch (_optionsControlRow) {
case 1:
ConfMan.setBool("sfx_mute", !ConfMan.getBool("sfx_mute"));
@@ -514,19 +513,18 @@ void IgorEngine::floppyOptionsControlPage(const uint8 *button) {
if (ev.type == Common::EVENT_QUIT || ev.type == Common::EVENT_RETURN_TO_LAUNCHER) {
_currentPart = kInvalidPart;
_eventQuitGame = true;
- } else if (ev.type == Common::EVENT_KEYDOWN) {
- switch (ev.kbd.keycode) {
- case Common::KEYCODE_ESCAPE:
+ } else if (ev.type == Common::EVENT_CUSTOM_ENGINE_ACTION_START) {
+ switch (ev.customType) {
+ case kActionEscape:
leave = true;
break;
- case Common::KEYCODE_UP:
+ case kActionUp:
row = MAX(1, row - 1);
break;
- case Common::KEYCODE_DOWN:
+ case kActionDown:
row = MIN(3, row + 1);
break;
- case Common::KEYCODE_RETURN:
- case Common::KEYCODE_KP_ENTER:
+ case kActionConfirm:
if (row == 1) {
_gameState.talkSpeed = _gameState.talkSpeed >= 5 ? 1 : _gameState.talkSpeed + 1;
} else if (row == 2) {
@@ -560,11 +558,11 @@ void IgorEngine::floppyOptionsQuitPage(const uint8 *button) {
if (ev.type == Common::EVENT_QUIT || ev.type == Common::EVENT_RETURN_TO_LAUNCHER) {
_currentPart = kInvalidPart;
_eventQuitGame = true;
- } else if (ev.type == Common::EVENT_KEYDOWN) {
- if (ev.kbd.keycode == Common::KEYCODE_s) {
+ } else if (ev.type == Common::EVENT_CUSTOM_ENGINE_ACTION_START) {
+ if (ev.customType == kActionYes) {
_currentPart = kInvalidPart;
leave = true;
- } else if (ev.kbd.keycode == Common::KEYCODE_n || ev.kbd.keycode == Common::KEYCODE_ESCAPE) {
+ } else if (ev.customType == kActionNo || ev.customType == kActionEscape) {
leave = true;
}
}
@@ -736,9 +734,9 @@ bool IgorEngine::saveLoadChoose(const SaveLoadLayout &l, const uint8 *button, co
if (ev.type == Common::EVENT_QUIT || ev.type == Common::EVENT_RETURN_TO_LAUNCHER) {
_currentPart = kInvalidPart;
_eventQuitGame = true;
- } else if (ev.type == Common::EVENT_KEYDOWN) {
- switch (ev.kbd.keycode) {
- case Common::KEYCODE_UP:
+ } else if (ev.type == Common::EVENT_CUSTOM_ENGINE_ACTION_START) {
+ switch (ev.customType) {
+ case kActionUp:
if (row > 1) {
--row;
} else if (top > 1) {
@@ -746,7 +744,7 @@ bool IgorEngine::saveLoadChoose(const SaveLoadLayout &l, const uint8 *button, co
}
redraw = true;
break;
- case Common::KEYCODE_DOWN:
+ case kActionDown:
if (row < kSaveLoadVisibleRows) {
if (row < count)
++row;
@@ -755,12 +753,11 @@ bool IgorEngine::saveLoadChoose(const SaveLoadLayout &l, const uint8 *button, co
}
redraw = true;
break;
- case Common::KEYCODE_RETURN:
- case Common::KEYCODE_KP_ENTER:
+ case kActionConfirm:
accepted = true;
done = true;
break;
- case Common::KEYCODE_ESCAPE:
+ case kActionEscape:
done = true;
break;
default:
@@ -810,6 +807,8 @@ void IgorEngine::saveLoadFillCursor(const SaveLoadLayout &l, int x, int y, int f
}
bool IgorEngine::saveLoadEditName(const SaveLoadLayout &l, const uint8 *button, Common::String &name, int row) {
+ // raw key presses are needed to type, whatever keys the player bound
+ setKeymapperEnabled(false);
uint8 *allowed = loadData(DAT_OptionsNameChars);
saveLoadFillRows(l, button, kSaveLoadCaptionArtRow, l.captionFirstY, l.captionLastY);
saveLoadDrawTitle(l, kOptionsDescribe, l.describeTitleX, l.captionTextY, l.colorTitle);
@@ -899,6 +898,7 @@ bool IgorEngine::saveLoadEditName(const SaveLoadLayout &l, const uint8 *button,
if (accepted) {
name = Common::String(text + 1, kSaveLoadNameLength);
}
+ setKeymapperEnabled(true);
return accepted;
}
@@ -1000,19 +1000,18 @@ void IgorEngine::handleFloppyOptionsMenu() {
if (ev.type == Common::EVENT_QUIT || ev.type == Common::EVENT_RETURN_TO_LAUNCHER) {
_currentPart = kInvalidPart;
_eventQuitGame = true;
- } else if (ev.type == Common::EVENT_KEYDOWN) {
- switch (ev.kbd.keycode) {
- case Common::KEYCODE_ESCAPE:
+ } else if (ev.type == Common::EVENT_CUSTOM_ENGINE_ACTION_START) {
+ switch (ev.customType) {
+ case kActionEscape:
menuLoop = false;
break;
- case Common::KEYCODE_LEFT:
+ case kActionLeft:
selected = MAX(1, selected - 1);
break;
- case Common::KEYCODE_RIGHT:
+ case kActionRight:
selected = MIN(5, selected + 1);
break;
- case Common::KEYCODE_RETURN:
- case Common::KEYCODE_KP_ENTER:
+ case kActionConfirm:
if (selected == 1) {
if (ConfMan.getBool("original_menus") ? originalSaveLoadPage(true) : saveGameDialog())
menuLoop = false;
@@ -1132,10 +1131,10 @@ void IgorEngine::handleOptionsMenu() {
_currentPart = kInvalidPart;
_eventQuitGame = true;
break;
- case Common::EVENT_KEYDOWN:
+ case Common::EVENT_CUSTOM_ENGINE_ACTION_START:
if (focusOnPage) {
const bool unavailable = (_game.flags & kFlagDemo) && (currentPage == kPageSave || currentPage == kPageLoad);
- if (unavailable || (this->*pages[currentPage].handleKeyDownProc)(ev.kbd.keycode)) {
+ if (unavailable || (this->*pages[currentPage].handleActionProc)(ev.customType)) {
memcpy(_screenTextLayer + 3 * 320, buttonsBarBackup, 320 * 12);
for (int y = 22; y <= 110; ++y) {
memset(_screenTextLayer + y * 320 + kMenuX + 4, kColorFill, 226);
@@ -1143,11 +1142,11 @@ void IgorEngine::handleOptionsMenu() {
focusOnPage = false;
}
} else {
- switch (ev.kbd.keycode) {
- case Common::KEYCODE_ESCAPE:
+ switch (ev.customType) {
+ case kActionEscape:
menuLoop = false;
break;
- case Common::KEYCODE_RETURN:
+ case kActionConfirm:
if (currentPage == kPageSave && !(_game.flags & kFlagDemo)) {
if (ConfMan.getBool("original_menus") ? originalSaveLoadPage(true) : saveGameDialog())
menuLoop = false;
@@ -1180,13 +1179,13 @@ void IgorEngine::handleOptionsMenu() {
focusOnPage = true;
}
break;
- case Common::KEYCODE_LEFT:
+ case kActionLeft:
--currentPage;
if (currentPage < 0) {
currentPage = 0;
}
break;
- case Common::KEYCODE_RIGHT:
+ case kActionRight:
++currentPage;
if (currentPage > 4) {
currentPage = 4;
Commit: 98904570267331bd83afff20a1577fb4626fa3ff
https://github.com/scummvm/scummvm/commit/98904570267331bd83afff20a1577fb4626fa3ff
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:30+01:00
Commit Message:
IGOR: Use ManagedSurfaces instead of pixel buffers where it makes sense
Changed paths:
engines/igor/graphics.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/input.cpp
engines/igor/options.cpp
engines/igor/palette.cpp
engines/igor/part_main.cpp
engines/igor/parts/part_0.cpp
engines/igor/parts/part_1.cpp
engines/igor/parts/part_10.cpp
engines/igor/parts/part_11.cpp
engines/igor/parts/part_12.cpp
engines/igor/parts/part_13.cpp
engines/igor/parts/part_14.cpp
engines/igor/parts/part_15.cpp
engines/igor/parts/part_15_floppy.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_18.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_2.cpp
engines/igor/parts/part_20_floppy.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_21_floppy.cpp
engines/igor/parts/part_22.cpp
engines/igor/parts/part_23.cpp
engines/igor/parts/part_23_floppy.cpp
engines/igor/parts/part_24.cpp
engines/igor/parts/part_24_floppy.cpp
engines/igor/parts/part_25.cpp
engines/igor/parts/part_25_floppy.cpp
engines/igor/parts/part_26.cpp
engines/igor/parts/part_26_floppy.cpp
engines/igor/parts/part_27.cpp
engines/igor/parts/part_27_floppy.cpp
engines/igor/parts/part_28.cpp
engines/igor/parts/part_28_floppy.cpp
engines/igor/parts/part_30.cpp
engines/igor/parts/part_30_floppy.cpp
engines/igor/parts/part_31.cpp
engines/igor/parts/part_31_floppy.cpp
engines/igor/parts/part_32.cpp
engines/igor/parts/part_33.cpp
engines/igor/parts/part_34.cpp
engines/igor/parts/part_35.cpp
engines/igor/parts/part_36.cpp
engines/igor/parts/part_37.cpp
engines/igor/parts/part_4.cpp
engines/igor/parts/part_5.cpp
engines/igor/parts/part_50.cpp
engines/igor/parts/part_6.cpp
engines/igor/parts/part_68.cpp
engines/igor/parts/part_69.cpp
engines/igor/parts/part_7.cpp
engines/igor/parts/part_70.cpp
engines/igor/parts/part_71.cpp
engines/igor/parts/part_72.cpp
engines/igor/parts/part_73.cpp
engines/igor/parts/part_75.cpp
engines/igor/parts/part_76.cpp
engines/igor/parts/part_77.cpp
engines/igor/parts/part_78.cpp
engines/igor/parts/part_79.cpp
engines/igor/parts/part_8.cpp
engines/igor/parts/part_80.cpp
engines/igor/parts/part_81.cpp
engines/igor/parts/part_85.cpp
engines/igor/parts/part_9.cpp
engines/igor/parts/part_95.cpp
engines/igor/parts/part_credits.cpp
engines/igor/parts/part_margaret.cpp
engines/igor/parts/part_maze.cpp
engines/igor/text.cpp
diff --git a/engines/igor/graphics.cpp b/engines/igor/graphics.cpp
index 7273e101a93..f4156485301 100644
--- a/engines/igor/graphics.cpp
+++ b/engines/igor/graphics.cpp
@@ -23,6 +23,20 @@
namespace Igor {
+void IgorEngine::flushScreenToBackend() {
+ _system->copyRectToScreen(_screenVGASurface.getPixels(), _screenVGASurface.pitch, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
+}
+
+// Copies a 320x144 room layer (background, mask or text layer) over the room area of the screen surface
+void IgorEngine::copyLayerToScreen(const Graphics::ManagedSurface &layer) {
+ _screenVGASurface.copyRectToSurface(layer, 0, 0, Common::Rect(320, 144));
+}
+
+// Fills whole rows of the screen surface with one color
+void IgorEngine::fillScreenRows(int firstRow, int numRows, uint8 color) {
+ _screenVGASurface.fillRect(Common::Rect(0, firstRow, 320, firstRow + numRows), color);
+}
+
/**
* Copies a w x h block between two pixel buffers (each with its own pitch).
* Transparent copies skip source pixels equal to 0.
@@ -161,7 +175,7 @@ void IgorEngine::decodeAnimFrame(const uint8 *src, uint8 *dst, bool preserveText
}
void IgorEngine::drawVerbsPanel() {
- memcpy(_screenVGA + 320 * 156, _verbsPanelBuffer, _verbsPanelSize);
+ _screenVGASurface.copyRectToSurface(_verbsPanelSurface, 0, 156, Common::Rect(320, _verbsPanelSize / 320));
}
void IgorEngine::redrawVerb(uint8 verb, bool highlight) {
@@ -169,12 +183,10 @@ void IgorEngine::redrawVerb(uint8 verb, bool highlight) {
if (verb < kVerbWalk || verb > kVerbGive)
return;
const int x = (verb - 1) * 40;
- memset(_screenVGA + 155 * 320 + x, highlight ? 254 : 0, 40);
- for (int y = 156; y <= 166; ++y) {
- _screenVGA[y * 320 + x] = highlight ? 254 : 0;
- _screenVGA[y * 320 + x + 39] = highlight ? 253 : 0;
- }
- memset(_screenVGA + 167 * 320 + x, highlight ? 253 : 0, 40);
+ _screenVGASurface.hLine(x, 155, x + 39, highlight ? 254 : 0);
+ _screenVGASurface.vLine(x, 156, 166, highlight ? 254 : 0);
+ _screenVGASurface.vLine(x + 39, 156, 166, highlight ? 253 : 0);
+ _screenVGASurface.hLine(x, 167, x + 39, highlight ? 253 : 0);
return;
}
uint8 verbBitmap[44 * 12];
@@ -196,14 +208,10 @@ void IgorEngine::redrawVerb(uint8 verb, bool highlight) {
void IgorEngine::scrollInventory() {
if (_scrollInventoryStartY == _scrollInventoryEndY) {
- memcpy(_screenVGA + 54400, _inventoryPanelBuffer + (_scrollInventoryStartY - 1) * 320, 9600);
+ _screenVGASurface.copyRectToSurface(_inventoryPanelBuffer + (_scrollInventoryStartY - 1) * 320, 320, 0, 170, 320, 30);
_scrollInventory = false;
} else {
- int offset = 54420;
- for (int y = _scrollInventoryStartY; y < _scrollInventoryStartY + 29; ++y) {
- memcpy(_screenVGA + offset, _inventoryPanelBuffer + 320 * y - 300, 280);
- offset += 320;
- }
+ _screenVGASurface.copyRectToSurface(_inventoryPanelBuffer + 320 * _scrollInventoryStartY - 300, 320, 20, 170, 280, 29);
_scrollInventoryStartY += _scrollInventoryDy;
}
}
@@ -223,7 +231,7 @@ void IgorEngine::drawInventory(int start, int mode) {
}
}
}
- memcpy(_screenVGA + 170 * 320, _inventoryPanelBuffer, 9600);
+ _screenVGASurface.copyRectToSurface(_inventoryPanelSurface, 0, 170, Common::Rect(320, 30));
_scrollInventory = false;
return;
}
@@ -274,7 +282,7 @@ void IgorEngine::drawInventory(int start, int mode) {
}
switch (mode) {
case 0: // normal inventory rendering
- memcpy(_screenVGA + 54400, _inventoryPanelBuffer, 9600);
+ _screenVGASurface.copyRectToSurface(_inventoryPanelSurface, 0, 170, Common::Rect(320, 30));
_scrollInventory = false;
break;
case 1: // animation scrolling up
@@ -289,7 +297,7 @@ void IgorEngine::drawInventory(int start, int mode) {
}
}
memmove(_inventoryPanelBuffer + 9600, _inventoryPanelBuffer, 9600);
- memcpy(_inventoryPanelBuffer, _screenVGA + 54400, 9600);
+ _inventoryPanelSurface.copyRectToSurface(_screenVGASurface, 0, 0, Common::Rect(0, 170, 320, 200));
_scrollInventoryStartY = 7;
_scrollInventoryEndY = 31;
_scrollInventoryDy = 6;
@@ -307,7 +315,7 @@ void IgorEngine::drawInventory(int start, int mode) {
}
}
memmove(_inventoryPanelBuffer + 9600, _inventoryPanelBuffer, 9600);
- memcpy(_inventoryPanelBuffer + 9600, _screenVGA + 54400, 9600);
+ _inventoryPanelSurface.copyRectToSurface(_screenVGASurface, 0, 30, Common::Rect(0, 170, 320, 200));
_scrollInventoryStartY = 25;
_scrollInventoryEndY = 1;
_scrollInventoryDy = -6;
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 422f35affb5..0f359d65b82 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -41,20 +41,29 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
g_engine = this;
// Some parts draw outside the visible 320x200 area, but still within 64kb segment
- // hence allocate full 64-KiB VGA segment for the screen buffer
- _screenVGA = (uint8 *)malloc(65536);
+ // hence the screen surface covers the full 64-KiB VGA segment
+ const Graphics::PixelFormat clut8 = Graphics::PixelFormat::createFormatCLUT8();
+ _screenVGASurface.create(320, 205, clut8);
+ _screenLayer1Surface.create(320, 144, clut8);
+ _screenLayer2Surface.create(320, 144, clut8);
+ _screenTextLayerSurface.create(320, 144, clut8);
+ _screenTempLayerSurface.create(100, 100, clut8);
+ _inventoryPanelSurface.create(320, 60, clut8);
+ _inventoryImagesSurface.create(320, 150, clut8);
+ _verbsPanelSurface.create(320, 12, clut8);
+ _screenVGA = (uint8 *)_screenVGASurface.getPixels();
+ _screenLayer1 = (uint8 *)_screenLayer1Surface.getPixels();
+ _screenLayer2 = (uint8 *)_screenLayer2Surface.getPixels();
+ _screenTextLayer = (uint8 *)_screenTextLayerSurface.getPixels();
+ _screenTempLayer = (uint8 *)_screenTempLayerSurface.getPixels();
+ _inventoryPanelBuffer = (uint8 *)_inventoryPanelSurface.getPixels();
+ _inventoryImagesBuffer = (uint8 *)_inventoryImagesSurface.getPixels();
+ _verbsPanelBuffer = (uint8 *)_verbsPanelSurface.getPixels();
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);
_verbsPanelSize = 0; // set when the panel is loaded
_floppyProtectionPassed = false;
@@ -88,19 +97,11 @@ IgorEngine::~IgorEngine() {
free(_musicData);
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);
delete _screen;
}
@@ -283,7 +284,7 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor, bool fade) {
// A game saved while Igor was walking keeps walking once the room is entered.
_loadedIgorMoving = _gameState.igorMoving;
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (drawIgor) { // position Igor in the room at the saved position
if (!_gameState.igorMoving)
_walkDataCurrentIndex = _walkDataLastIndex - 1;
@@ -293,7 +294,7 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor, bool fade) {
_walkDataCurrentIndex = _walkDataLastIndex;
}
if (!_gameState.dialogueStarted) { // if loading we need to redraw the room background and UI
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
setInventoryPanelColors();
setVerbPanelColors();
drawVerbsPanel();
@@ -301,7 +302,7 @@ bool IgorEngine::restoreRoomAfterLoad(bool drawIgor, bool fade) {
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
} else {
// the choice menu fills this area once the dialogue resumes; until then it must not show what was on screen before the load
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
}
if (!_gameState.dialogueTextRunning)
showCursor();
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 001e91e6c52..71e7df58c01 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -38,6 +38,7 @@
#include "common/util.h"
#include "engines/engine.h"
#include "engines/savestate.h"
+#include "graphics/managed_surface.h"
#include "graphics/screen.h"
#include "igor/detection.h"
@@ -249,6 +250,17 @@ private:
int _optionsControlRow;
bool _floppyProtectionPassed;
+ // Screen layers and UI buffers: the surfaces own the pixels (8bpp, pitch == width), the raw pointers below
+ // are views of their pixel memory, set once in the constructor, for the offset-based drawing code
+ Graphics::ManagedSurface _screenVGASurface; // 320x205: some parts draw below the visible area
+ Graphics::ManagedSurface _screenLayer1Surface; // room background
+ Graphics::ManagedSurface _screenLayer2Surface; // room hotspot/lighting mask
+ Graphics::ManagedSurface _screenTextLayerSurface;
+ Graphics::ManagedSurface _screenTempLayerSurface; // 100x100 scratch block
+ Graphics::ManagedSurface _inventoryPanelSurface; // two panels (320x30 each)
+ Graphics::ManagedSurface _inventoryImagesSurface;
+ Graphics::ManagedSurface _verbsPanelSurface;
+
uint8 *_screenVGA;
uint8 *_facingIgorFrames[4];
uint8 *_screenLayer1;
@@ -416,6 +428,9 @@ private:
void readTableFile();
+ void flushScreenToBackend();
+ void copyLayerToScreen(const Graphics::ManagedSurface &layer);
+ void fillScreenRows(int firstRow, int numRows, uint8 color);
void copyArea(uint8 *dst, int dstOffset, int dstPitch, const uint8 *src, int srcPitch, int w, int h, bool transparent = false);
void drawAnimRect(int dstOffset, int animOffset, int w, int h, bool alsoBackground = false, AnimBlend blend = kBlendCopy);
void animateLitAnimFrames(int srcOffset, int firstFrame, int lastFrame, int frameSize, int width, int height, int dstOffset, int delay, int soundFrame, int sound);
diff --git a/engines/igor/input.cpp b/engines/igor/input.cpp
index 06f0dbfb719..dce2fe77fc3 100644
--- a/engines/igor/input.cpp
+++ b/engines/igor/input.cpp
@@ -38,7 +38,7 @@ uint32 IgorEngine::ticksSince(uint32 startMillis) const {
void IgorEngine::waitForTimer(int ticks, bool presentScreen, uint32 deadline) {
if (presentScreen && !_eventQuitGame) {
- _system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
+ flushScreenToBackend();
_system->updateScreen();
}
@@ -764,7 +764,7 @@ void IgorEngine::formatActionSentence(uint8 color) {
}
void IgorEngine::drawActionSentence(const char *sentence, uint8 color) {
- memset(_screenVGA + 144 * 320, 0, 11 * 320);
+ fillScreenRows(144, 11, 0);
int w = _sentenceFont->getStringWidth(sentence);
int x = (320 - w) / 2;
// A sentence wider than the screen would start at a negative offset and
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index d9259e4214b..02fc1647462 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -1084,7 +1084,7 @@ void IgorEngine::handleOptionsMenu() {
memcpy(_currentPalette + 208 * 3, _paletteBuffer + 208 * 3, 48 * 3);
setPaletteRange(208, 255);
if (!_gameState.dialogueStarted)
- memset(_screenVGA + 144 * 320, 0, 11 * 320);
+ fillScreenRows(144, 11, 0);
_system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, 200);
for (int m = 3; m <= kFadeSteps; m += 3) {
for (int i = 1 * 3; i <= kLastFadedColor * 3; ++i) {
diff --git a/engines/igor/palette.cpp b/engines/igor/palette.cpp
index ac54f2a3beb..a25bdede8e3 100644
--- a/engines/igor/palette.cpp
+++ b/engines/igor/palette.cpp
@@ -98,7 +98,7 @@ void IgorEngine::setVerbPanelColors() {
void IgorEngine::fadeIn(int count) {
debugC(9, kDebugScreen, "fadeIn(%d)", count);
- _system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
+ flushScreenToBackend();
int m = 66;
do {
m -= 3;
@@ -119,7 +119,7 @@ void IgorEngine::fadeIn(int count) {
void IgorEngine::fadeOut(int count) {
debugC(9, kDebugScreen, "fadeOut(%d)", count);
- _system->copyRectToScreen(_screenVGA, 320, 0, _screenVGAVOffset, 320, 200 - _screenVGAVOffset);
+ flushScreenToBackend();
// only the faded range is saved; the rest of the buffer is left untouched
memcpy(_paletteBuffer, _currentPalette, count);
int m = 0;
diff --git a/engines/igor/part_main.cpp b/engines/igor/part_main.cpp
index 78e84029017..219799282fd 100644
--- a/engines/igor/part_main.cpp
+++ b/engines/igor/part_main.cpp
@@ -791,7 +791,7 @@ void IgorEngine::partMain() {
const bool savingWasAllowed = _canSaveGame;
_canSaveGame = false;
// Clear the entire screen buffer before starting the intro cutscene
- memset(_screenVGA, 0, 64000);
+ fillScreenRows(0, 200, 0);
g_engine->_screen->updateScreen();
// The Spanish floppy draws the intro at the top of the screen, without the black band
const bool band = _game.version != kIdSpaFloppy;
@@ -803,7 +803,7 @@ void IgorEngine::partMain() {
}
part85();
// Clears the bottom portion of the screen
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
if (band)
partMainMoveScreenUp(_screenVGAVOffset);
_screenVGAVOffset = 0;
@@ -988,7 +988,7 @@ void IgorEngine::partMainMeanwhile(int img) {
memset(_currentPalette, 0, 768);
setPaletteRange(208, 255);
// clears the verbs and inventory panels area
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
loadData(img, _screenVGA);
_paletteBuffer[3] = 63;
_paletteBuffer[4] = 32;
diff --git a/engines/igor/parts/part_0.cpp b/engines/igor/parts/part_0.cpp
index bde425e5ffc..ac7a13f8b3c 100644
--- a/engines/igor/parts/part_0.cpp
+++ b/engines/igor/parts/part_0.cpp
@@ -286,7 +286,7 @@ void IgorEngine::part0() {
partMainSetExecuteAction(1, &IgorEngine::part0ExecuteAction);
part0ApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
diff --git a/engines/igor/parts/part_1.cpp b/engines/igor/parts/part_1.cpp
index 80093eb9076..53a05101f64 100644
--- a/engines/igor/parts/part_1.cpp
+++ b/engines/igor/parts/part_1.cpp
@@ -174,7 +174,7 @@ void IgorEngine::part1() {
// the room mask
setRoomWalkBounds(60, 0, 276, 143);
partMainSetExecuteAction(1, &IgorEngine::part1ExecuteAction);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_10.cpp b/engines/igor/parts/part_10.cpp
index 1fdf31022e6..4d98fc1a5ec 100644
--- a/engines/igor/parts/part_10.cpp
+++ b/engines/igor/parts/part_10.cpp
@@ -134,7 +134,7 @@ void IgorEngine::part10ScrollLeft() {
_screenLayer2[dstOffset + col] = color;
}
}
- memcpy(_screenVGA, _screenLayer2, 46080);
+ copyLayerToScreen(_screenLayer2Surface);
++i;
}
waitForTimer();
@@ -181,7 +181,7 @@ void IgorEngine::part10() {
setRoomWalkBounds(0, 0, 319, 143);
if (_currentPart != 102 && !_gameStateLoaded) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
}
diff --git a/engines/igor/parts/part_11.cpp b/engines/igor/parts/part_11.cpp
index 0533c76882c..999bc972e4b 100644
--- a/engines/igor/parts/part_11.cpp
+++ b/engines/igor/parts/part_11.cpp
@@ -104,7 +104,7 @@ void IgorEngine::part11ScrollRight() {
_screenLayer2[dstOffset + col] = color;
}
}
- memcpy(_screenVGA, _screenLayer2, 46080);
+ copyLayerToScreen(_screenLayer2Surface);
++i;
}
waitForTimer();
diff --git a/engines/igor/parts/part_12.cpp b/engines/igor/parts/part_12.cpp
index 7c416530ef2..a9c9bf4eb47 100644
--- a/engines/igor/parts/part_12.cpp
+++ b/engines/igor/parts/part_12.cpp
@@ -171,7 +171,7 @@ void IgorEngine::part12UseResinWithStone() {
startIgorDialogue();
return;
}
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
removeInventoryEntry(62);
const int animOffset = (_objectsState[kChurchDoorOpenStateIndex] == 0) ? 0x2543 : 0xBF1E;
for (int i = 1; i <= 9; ++i) {
@@ -547,7 +547,7 @@ void IgorEngine::part12() {
setVerbPanelColors();
setInventoryPanelColors();
part12ApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (_objectsState[kLizardTakenStateIndex] == 0) {
part12PaintOverLizard();
}
diff --git a/engines/igor/parts/part_13.cpp b/engines/igor/parts/part_13.cpp
index ef1fc4c04ef..e6d97f39e22 100644
--- a/engines/igor/parts/part_13.cpp
+++ b/engines/igor/parts/part_13.cpp
@@ -210,7 +210,7 @@ void IgorEngine::part13() {
partMainSetExecuteAction(1, &IgorEngine::part13ExecuteAction);
part13ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 130) {
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 5ccfc22cf20..660107dddbe 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -90,7 +90,7 @@ void IgorEngine::part14LookAtPuzzle() {
fadeOut(768);
part14ShowPuzzle();
part14LoadRoom();
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
fadeIn(768);
@@ -391,9 +391,9 @@ void IgorEngine::part14BrotherReveal(int start, int end) {
void IgorEngine::part14ShowPuzzle() {
part14LoadChurchMosaicData();
memcpy(_screenTextLayer, _screenVGA, 46080);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
memcpy(_screenLayer1, _screenTextLayer, 46080);
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
fadeIn(768);
_inputVars[kInputCursorXPos] = 160;
_inputVars[kInputCursorYPos] = 72;
@@ -501,7 +501,7 @@ void IgorEngine::part14ShowPuzzle() {
playRoomSound(35, kSpaFloppySoundPart14Solved);
}
fadeOut(768);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
setInventoryPanelColors();
}
@@ -540,7 +540,7 @@ void IgorEngine::part14() {
partMainSetExecuteAction(1, &IgorEngine::part14ExecuteAction);
part14ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 140) {
diff --git a/engines/igor/parts/part_15.cpp b/engines/igor/parts/part_15.cpp
index 5964a0a3f56..8c21979b73d 100644
--- a/engines/igor/parts/part_15.cpp
+++ b/engines/igor/parts/part_15.cpp
@@ -374,7 +374,7 @@ void IgorEngine::part15() {
setVerbPanelColors();
setInventoryPanelColors();
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
_gameState.unk10 = 1;
diff --git a/engines/igor/parts/part_15_floppy.cpp b/engines/igor/parts/part_15_floppy.cpp
index 7be30f593e1..ed7138f4010 100644
--- a/engines/igor/parts/part_15_floppy.cpp
+++ b/engines/igor/parts/part_15_floppy.cpp
@@ -265,7 +265,7 @@ void IgorEngine::part15Floppy() {
partMainSetExecuteAction(1, &IgorEngine::part15FloppyExecuteAction);
_updateRoomBackground = &IgorEngine::part15FloppyUpdateBackground;
part15FloppyApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
// One of three figures in the hall, or none, drawn in its first frame
_gameState.unk10 = (getRandomNumber(9) + 2) / 3;
if (_gameState.unk10 != 0) {
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index 87e2d669f70..4268a2d4ff1 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -108,7 +108,7 @@ void IgorEngine::part16EnterScene() {
}
void IgorEngine::part16PhotoCutscene() {
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
igorSayAndWait({ { 210, 1, 731 }, { 211, 1, 732 }, { 212, 1, 733 }, { 213, 2, 734 } });
--_walkDataLastIndex;
buildWalkPath(90, 135, 200, 143);
@@ -148,7 +148,7 @@ void IgorEngine::part16PhotoCutscene() {
setInventoryPanelColors();
part16LoadRoom();
part16LoadAnimation();
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
part16ApplyObjectState(255);
fadeIn(768);
waitForTimer(255);
@@ -232,7 +232,7 @@ void IgorEngine::part16() {
partMainSetExecuteAction(1, &IgorEngine::part16ExecuteAction);
part16ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
part16EnterScene();
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index aa1c0cda904..5b2509e1df5 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -508,7 +508,7 @@ void IgorEngine::part17() {
setInventoryPanelColors();
part17ApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (_objectsState[kPhillipAndJimmyHaveLeftStateIndex] == 1) {
diff --git a/engines/igor/parts/part_18.cpp b/engines/igor/parts/part_18.cpp
index 1ed6df69074..1df22883cce 100644
--- a/engines/igor/parts/part_18.cpp
+++ b/engines/igor/parts/part_18.cpp
@@ -77,7 +77,7 @@ void IgorEngine::part18UseSlugOnGrating() {
// loads part 19
part19();
- memcpy(_screenVGA, _screenLayer2, 46080);
+ copyLayerToScreen(_screenLayer2Surface);
part18LoadRoom();
part18LoadAnimation();
@@ -87,7 +87,7 @@ void IgorEngine::part18UseSlugOnGrating() {
partMainSetExecuteAction(1, &IgorEngine::part18ExecuteAction);
part18ApplyObjectState(255);
// paints bottom of screen black
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
drawVerbsPanel();
drawInventory(1, 0);
removeObjectFromInventory(53);
@@ -150,7 +150,7 @@ void IgorEngine::part18() {
partMainSetExecuteAction(1, &IgorEngine::part18ExecuteAction);
part18ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
part18WalkIn();
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index 01353be805e..acfb326c9ba 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -128,7 +128,7 @@ void IgorEngine::part19SlugCutscene() { // sub_137_07AD
int talkSpeed = _gameState.talkSpeed;
_gameState.talkSpeed = 5;
memcpy(_screenLayer2, _screenVGA, 46080);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
const uint8 *src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x4051) - 1;
decodeAnimFrame(src, _screenVGA, true);
memcpy(_screenLayer1, _screenVGA, 46080);
@@ -229,7 +229,7 @@ void IgorEngine::part19() {
partMainSetExecuteAction(1, &IgorEngine::part19ExecuteAction);
part19ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
part19WalkIn();
diff --git a/engines/igor/parts/part_2.cpp b/engines/igor/parts/part_2.cpp
index 1cd47e2185a..81e65aa13a2 100644
--- a/engines/igor/parts/part_2.cpp
+++ b/engines/igor/parts/part_2.cpp
@@ -388,7 +388,7 @@ void IgorEngine::part2() {
setRoomWalkBounds(41, 0, 253, 143, 141, 138);
partMainSetExecuteAction(1, &IgorEngine::part2ExecuteAction);
part2ApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_20_floppy.cpp b/engines/igor/parts/part_20_floppy.cpp
index 123113592b3..80613f5837d 100644
--- a/engines/igor/parts/part_20_floppy.cpp
+++ b/engines/igor/parts/part_20_floppy.cpp
@@ -79,7 +79,7 @@ void IgorEngine::part20Floppy() {
_roomDataOffsets = PART_20_FLOPPY_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
partMainSetExecuteAction(1, &IgorEngine::part20FloppyExecuteAction);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index df25904ac72..806a1cbeda6 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -338,7 +338,7 @@ void IgorEngine::part21DrawMargaret() {
void IgorEngine::part21MargaretTakesNote() {
part21DrawMargaretFrameComposited(1);
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
waitForTimer(120);
for (int i = 1; i <= 6; ++i) {
part21DrawMargaretFrameComposited(PART_21_ANIM_DATA_1[i]);
@@ -414,7 +414,7 @@ void IgorEngine::part21() {
partMainSetExecuteAction(1, &IgorEngine::part21ExecuteAction);
_updateRoomBackground = &IgorEngine::part21UpdateBackground;
part21ApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
setVerbPanelColors();
setInventoryPanelColors();
if (!restoreRoomAfterLoad()) {
diff --git a/engines/igor/parts/part_21_floppy.cpp b/engines/igor/parts/part_21_floppy.cpp
index c76c63860dd..e059452c790 100644
--- a/engines/igor/parts/part_21_floppy.cpp
+++ b/engines/igor/parts/part_21_floppy.cpp
@@ -320,7 +320,7 @@ void IgorEngine::part21FloppyDrawMargaretNoteHead(int frame) {
void IgorEngine::part21FloppyMargaretTakesNote() {
part21FloppyDrawMargaretFrameComposited(1);
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
drawAnimRect(kMargaretBodyOffset, kMargaretBodyFrame, 48, 40);
waitForTimer(121);
for (int i = 1; i <= 6; ++i) {
@@ -395,7 +395,7 @@ void IgorEngine::part21Floppy() {
partMainSetExecuteAction(1, &IgorEngine::part21FloppyExecuteAction);
_updateRoomBackground = &IgorEngine::part21FloppyUpdateBackground;
part21FloppyApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
setVerbPanelColors();
setInventoryPanelColors();
if (!restoreRoomAfterLoad()) {
diff --git a/engines/igor/parts/part_22.cpp b/engines/igor/parts/part_22.cpp
index a11b0b9df71..2fb6a8f97b7 100644
--- a/engines/igor/parts/part_22.cpp
+++ b/engines/igor/parts/part_22.cpp
@@ -120,7 +120,7 @@ void IgorEngine::part22ScrollStep(int step) {
const int pictureRows = kPart22PictureRows - step * 8;
memcpy(_screenTextLayer, _screenLayer1 + pictureRows * 320, roomRows * 320);
memcpy(_screenTextLayer + roomRows * 320, _animFramesBuffer, pictureRows * 320);
- memcpy(_screenVGA, _screenTextLayer, 46080);
+ copyLayerToScreen(_screenTextLayerSurface);
}
/**
diff --git a/engines/igor/parts/part_23.cpp b/engines/igor/parts/part_23.cpp
index f0668de6481..befac3fab2c 100644
--- a/engines/igor/parts/part_23.cpp
+++ b/engines/igor/parts/part_23.cpp
@@ -242,7 +242,7 @@ void IgorEngine::part23() {
partMainSetExecuteAction(1, &IgorEngine::part23ExecuteAction);
_updateRoomBackground = &IgorEngine::part23UpdateBackground;
part23ApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
diff --git a/engines/igor/parts/part_23_floppy.cpp b/engines/igor/parts/part_23_floppy.cpp
index adadaa88170..36fdcbd99a1 100644
--- a/engines/igor/parts/part_23_floppy.cpp
+++ b/engines/igor/parts/part_23_floppy.cpp
@@ -181,7 +181,7 @@ void IgorEngine::part23Floppy() {
setRoomWalkBounds(0, 0, 319, 143);
partMainSetExecuteAction(1, &IgorEngine::part23FloppyExecuteAction);
part23FloppyApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
diff --git a/engines/igor/parts/part_24.cpp b/engines/igor/parts/part_24.cpp
index d5b48206099..c97b5424471 100644
--- a/engines/igor/parts/part_24.cpp
+++ b/engines/igor/parts/part_24.cpp
@@ -276,7 +276,7 @@ void IgorEngine::part24() {
_updateRoomBackground = &IgorEngine::part24UpdateBackground;
part24ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 240) {
diff --git a/engines/igor/parts/part_24_floppy.cpp b/engines/igor/parts/part_24_floppy.cpp
index 531db6128ad..e6581b622b9 100644
--- a/engines/igor/parts/part_24_floppy.cpp
+++ b/engines/igor/parts/part_24_floppy.cpp
@@ -169,7 +169,7 @@ void IgorEngine::part24Floppy() {
setRoomWalkBounds(0, 0, 319, 143);
partMainSetExecuteAction(1, &IgorEngine::part24FloppyExecuteAction);
part24FloppyApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
diff --git a/engines/igor/parts/part_25.cpp b/engines/igor/parts/part_25.cpp
index 0473040cfa7..21a757640da 100644
--- a/engines/igor/parts/part_25.cpp
+++ b/engines/igor/parts/part_25.cpp
@@ -191,7 +191,7 @@ void IgorEngine::part25() {
partMainSetExecuteAction(1, &IgorEngine::part25ExecuteAction);
part25ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 250) {
diff --git a/engines/igor/parts/part_25_floppy.cpp b/engines/igor/parts/part_25_floppy.cpp
index 81861a1c17e..9638e87e61a 100644
--- a/engines/igor/parts/part_25_floppy.cpp
+++ b/engines/igor/parts/part_25_floppy.cpp
@@ -174,7 +174,7 @@ void IgorEngine::part25Floppy() {
setRoomWalkBounds(0, 0, 319, 143);
partMainSetExecuteAction(1, &IgorEngine::part25FloppyExecuteAction);
part25FloppyApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
diff --git a/engines/igor/parts/part_26.cpp b/engines/igor/parts/part_26.cpp
index 8206a5eb235..98a58d74d70 100644
--- a/engines/igor/parts/part_26.cpp
+++ b/engines/igor/parts/part_26.cpp
@@ -233,7 +233,7 @@ void IgorEngine::part26() {
_updateRoomBackground = &IgorEngine::part26UpdateBackground;
part26ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
_gameState.unk10 = true;
fadeIn(768);
diff --git a/engines/igor/parts/part_26_floppy.cpp b/engines/igor/parts/part_26_floppy.cpp
index 2cb691576e7..8e6284635d7 100644
--- a/engines/igor/parts/part_26_floppy.cpp
+++ b/engines/igor/parts/part_26_floppy.cpp
@@ -173,7 +173,7 @@ void IgorEngine::part26Floppy() {
setRoomWalkBounds(24, 0, 319, 143);
partMainSetExecuteAction(1, &IgorEngine::part26FloppyExecuteAction);
part26FloppyApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
diff --git a/engines/igor/parts/part_27.cpp b/engines/igor/parts/part_27.cpp
index f334c946b24..014c710b8b5 100644
--- a/engines/igor/parts/part_27.cpp
+++ b/engines/igor/parts/part_27.cpp
@@ -226,7 +226,7 @@ void IgorEngine::part27() {
partMainSetExecuteAction(1, &IgorEngine::part27ExecuteAction);
part27ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
if (_currentPart == 270) {
diff --git a/engines/igor/parts/part_27_floppy.cpp b/engines/igor/parts/part_27_floppy.cpp
index 0e9a7848bf8..c72398f23dc 100644
--- a/engines/igor/parts/part_27_floppy.cpp
+++ b/engines/igor/parts/part_27_floppy.cpp
@@ -192,7 +192,7 @@ void IgorEngine::part27Floppy() {
setRoomWalkBounds(0, 0, 296, 143);
partMainSetExecuteAction(1, &IgorEngine::part27FloppyExecuteAction);
part27FloppyApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
fadeIn(768);
diff --git a/engines/igor/parts/part_28.cpp b/engines/igor/parts/part_28.cpp
index e965e7baf5d..e4f8a87fb3a 100644
--- a/engines/igor/parts/part_28.cpp
+++ b/engines/igor/parts/part_28.cpp
@@ -262,7 +262,7 @@ void IgorEngine::part28() {
_updateRoomBackground = &IgorEngine::part28UpdateBackground;
part28DrawCaroline();
part28ApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_gameState.unk10 = 1;
diff --git a/engines/igor/parts/part_28_floppy.cpp b/engines/igor/parts/part_28_floppy.cpp
index f9d5192610b..caf4a017ec9 100644
--- a/engines/igor/parts/part_28_floppy.cpp
+++ b/engines/igor/parts/part_28_floppy.cpp
@@ -273,7 +273,7 @@ void IgorEngine::part28Floppy() {
_updateRoomBackground = &IgorEngine::part28FloppyUpdateBackground;
part28FloppyDrawCaroline();
part28FloppyApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_gameState.unk10 = 4;
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_30.cpp b/engines/igor/parts/part_30.cpp
index 54281e5502f..34e5e78e094 100644
--- a/engines/igor/parts/part_30.cpp
+++ b/engines/igor/parts/part_30.cpp
@@ -197,7 +197,7 @@ void IgorEngine::part30LauraCutscene() {
playMusic(3, true);
const bool resuming = _dialogueResuming;
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
if (!resuming) {
fadeIn(768);
part30LauraAndIgorBumpIntoEachOther();
@@ -233,7 +233,7 @@ void IgorEngine::part30LauraCutscene() {
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
// Que caracter
igorSay(210, 1, 459);
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
@@ -289,7 +289,7 @@ void IgorEngine::part30() {
setRoomWalkBounds(0, 0, 319, 143);
partMainSetExecuteAction(1, &IgorEngine::part30ExecuteAction);
part30ApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
setVerbPanelColors();
setInventoryPanelColors();
const bool loaded = restoreRoomAfterLoad(true, false);
diff --git a/engines/igor/parts/part_30_floppy.cpp b/engines/igor/parts/part_30_floppy.cpp
index a72f8cb3090..d775284d627 100644
--- a/engines/igor/parts/part_30_floppy.cpp
+++ b/engines/igor/parts/part_30_floppy.cpp
@@ -243,7 +243,7 @@ void IgorEngine::part30FloppyLauraLeaves() {
void IgorEngine::part30FloppyLauraCutscene() {
// The cutscene does not select any music, the current music keeps playing
const bool resuming = _dialogueResuming;
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
if (!resuming) {
fadeIn(768);
part30FloppyLauraAndIgorBumpIntoEachOther();
@@ -272,7 +272,7 @@ void IgorEngine::part30FloppyLauraCutscene() {
_walkData[0].setDefaultScale();
_walkDataLastIndex = 1;
igorSay(210, 1, 0);
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
@@ -290,7 +290,7 @@ void IgorEngine::part30Floppy() {
setRoomWalkBounds(0, 0, 319, 143);
partMainSetExecuteAction(1, &IgorEngine::part30FloppyExecuteAction);
part30FloppyApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
setVerbPanelColors();
setInventoryPanelColors();
const bool loaded = restoreRoomAfterLoad(true, false);
diff --git a/engines/igor/parts/part_31.cpp b/engines/igor/parts/part_31.cpp
index d1eab76311a..c26e56716ab 100644
--- a/engines/igor/parts/part_31.cpp
+++ b/engines/igor/parts/part_31.cpp
@@ -380,7 +380,7 @@ void IgorEngine::part31() {
_updateRoomBackground = &IgorEngine::part31UpdateBackground;
part31ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
_gameState.unk10 = 4;
part31DrawJohnnyFrame(_gameState.unk10);
diff --git a/engines/igor/parts/part_31_floppy.cpp b/engines/igor/parts/part_31_floppy.cpp
index 5a9a9111b54..70f10d1e37b 100644
--- a/engines/igor/parts/part_31_floppy.cpp
+++ b/engines/igor/parts/part_31_floppy.cpp
@@ -248,7 +248,7 @@ void IgorEngine::part31Floppy() {
setRoomWalkBounds(0, 0, 248, 143);
partMainSetExecuteAction(1, &IgorEngine::part31FloppyExecuteAction);
part31FloppyApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
_gameState.unk10 = 1;
diff --git a/engines/igor/parts/part_32.cpp b/engines/igor/parts/part_32.cpp
index dac6fccf3ff..4e98785cf45 100644
--- a/engines/igor/parts/part_32.cpp
+++ b/engines/igor/parts/part_32.cpp
@@ -417,8 +417,8 @@ void IgorEngine::part32Controls() {
decodeRoomMask(mask);
free(mask);
loadData(ANM_Part32Digits, _part32Glyphs);
- memcpy(_screenVGA, _screenLayer1, 46080);
- memset(_screenVGA + 46080, 0, 17920);
+ copyLayerToScreen(_screenLayer1Surface);
+ fillScreenRows(144, 56, 0);
fadeIn(624);
showCursor();
@@ -589,7 +589,7 @@ void IgorEngine::part32SceneNothing() {
void IgorEngine::part32SceneGirl() {
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
fadeIn(768);
for (int i = 0; i < ARRAYSIZE(kPart32GirlFrames); ++i) {
const int frame = kPart32GirlFrames[i];
@@ -610,7 +610,7 @@ void IgorEngine::part32() {
_roomDataOffsets = PART_32_ROOM_DATA_OFFSETS;
setRoomClickFix(143, 10, 120, true);
partMainSetExecuteAction(1, &IgorEngine::part32ExecuteAction);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_33.cpp b/engines/igor/parts/part_33.cpp
index f7a0d4c1f37..96db14ef0e5 100644
--- a/engines/igor/parts/part_33.cpp
+++ b/engines/igor/parts/part_33.cpp
@@ -265,7 +265,7 @@ void IgorEngine::part33HarrisonWalksOut() {
if (!isCDVersion() && _game.version != kIdSpaFloppy)
playMusic(11, true);
memcpy(_screenLayer2, _screenVGA, 46080);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x5255) - 1, _screenVGA, true);
memcpy(_screenLayer1, _screenVGA, 46080);
fadeIn(624);
@@ -374,7 +374,7 @@ void IgorEngine::part33() {
setVerbPanelColors();
setInventoryPanelColors();
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
part33WalkIn();
diff --git a/engines/igor/parts/part_34.cpp b/engines/igor/parts/part_34.cpp
index 798aa1fa613..23dfa9aee6c 100644
--- a/engines/igor/parts/part_34.cpp
+++ b/engines/igor/parts/part_34.cpp
@@ -317,7 +317,7 @@ void IgorEngine::part34OldLadyConversation() {
loadDialogueData(DLG_ParkLady);
const bool resuming = _dialogueResuming;
if (_objectsState[kOldLadyConversationSeenStateIndex] == 0) {
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
}
int textIndex = 250;
if (!resuming) {
@@ -349,7 +349,7 @@ void IgorEngine::part34OldLadyConversation() {
startCutsceneDialogue(121, 68, 63, 23, 0);
part34WaitForLadyDialogue();
if (_objectsState[kOldLadyConversationSeenStateIndex] == 0) {
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
@@ -389,7 +389,7 @@ void IgorEngine::part34LauraConversation() {
loadDialogueData(DLG_ParkLaura);
// a loaded savegame continues at the choice menu
const bool resuming = _dialogueResuming;
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
int textIndex = 250;
if (!resuming) {
part34DrawLauraWalkingIn(true);
@@ -438,7 +438,7 @@ void IgorEngine::part34LauraConversation() {
SET_DIALOGUE_TEXT(1, 1);
startCutsceneDialogue(162, 64, 63, 63, 63);
part34WaitForIgorDialogue();
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
@@ -471,7 +471,7 @@ void IgorEngine::part34ScrollRight() {
}
}
}
- memcpy(_screenVGA, _screenLayer2, 46080);
+ copyLayerToScreen(_screenLayer2Surface);
++step;
}
waitForTimer();
diff --git a/engines/igor/parts/part_35.cpp b/engines/igor/parts/part_35.cpp
index aacac4e6511..70fe1cb0e53 100644
--- a/engines/igor/parts/part_35.cpp
+++ b/engines/igor/parts/part_35.cpp
@@ -92,7 +92,7 @@ void IgorEngine::part35ScrollLeft() {
}
}
}
- memcpy(_screenVGA, _screenLayer2, 46080);
+ copyLayerToScreen(_screenLayer2Surface);
++step;
}
waitForTimer();
@@ -146,7 +146,7 @@ void IgorEngine::part35() {
part35ApplyObjectState(255);
if (_currentPart != 351 && !_gameStateLoaded) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
}
diff --git a/engines/igor/parts/part_36.cpp b/engines/igor/parts/part_36.cpp
index 06c126829e0..0311ae9f2ec 100644
--- a/engines/igor/parts/part_36.cpp
+++ b/engines/igor/parts/part_36.cpp
@@ -118,7 +118,7 @@ void IgorEngine::part36() {
partMainSetExecuteAction(1, &IgorEngine::part36ExecuteAction);
part36ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
part36WalkIn();
diff --git a/engines/igor/parts/part_37.cpp b/engines/igor/parts/part_37.cpp
index 2e0ba7563f8..219be53042d 100644
--- a/engines/igor/parts/part_37.cpp
+++ b/engines/igor/parts/part_37.cpp
@@ -99,7 +99,7 @@ void IgorEngine::part37() {
partMainSetExecuteAction(1, &IgorEngine::part37ExecuteAction);
part37ApplyObjectState(255);
if (!restoreRoomAfterLoad()) {
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(768);
part37WalkIn();
diff --git a/engines/igor/parts/part_4.cpp b/engines/igor/parts/part_4.cpp
index d7f901fa250..e2cfb88d802 100644
--- a/engines/igor/parts/part_4.cpp
+++ b/engines/igor/parts/part_4.cpp
@@ -95,7 +95,7 @@ void IgorEngine::part4() {
// closes Philips locker
_objectsState[kPhillipLockerStateIndex] = 0;
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (isCDVersion())
diff --git a/engines/igor/parts/part_5.cpp b/engines/igor/parts/part_5.cpp
index ca4d189f9ef..540f047562c 100644
--- a/engines/igor/parts/part_5.cpp
+++ b/engines/igor/parts/part_5.cpp
@@ -157,7 +157,7 @@ void IgorEngine::part5() {
_walkDataCurrentIndex = 1;
if (_currentPart == 50) {
debug("Entering PART_05_HELPER_6");
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_currentAction.verb = kVerbWalk;
fadeIn(624);
part5WalkIgorToScene();
@@ -238,7 +238,7 @@ void IgorEngine::part5ScrollRight() {
}
}
}
- memcpy(_screenVGA, _screenLayer2, 46080);
+ copyLayerToScreen(_screenLayer2Surface);
++i;
}
part5UpdateBackground();
diff --git a/engines/igor/parts/part_50.cpp b/engines/igor/parts/part_50.cpp
index 74c30a0a97a..34fd623e3ff 100644
--- a/engines/igor/parts/part_50.cpp
+++ b/engines/igor/parts/part_50.cpp
@@ -121,7 +121,7 @@ void IgorEngine::part50() {
setRoomWalkBounds(49, 22, 224, 119);
partMainSetExecuteAction(1, &IgorEngine::part50ExecuteAction);
_updateRoomBackground = &IgorEngine::part50UpdateBackground;
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
// the whole room is darker than its palette
darkenPalette(_paletteBuffer, 1, 207, kPart50PaletteDarkness);
diff --git a/engines/igor/parts/part_6.cpp b/engines/igor/parts/part_6.cpp
index 1b86d7c6c8b..2fb827682e2 100644
--- a/engines/igor/parts/part_6.cpp
+++ b/engines/igor/parts/part_6.cpp
@@ -255,7 +255,7 @@ void IgorEngine::part6ScrollLeft() {
}
}
}
- memcpy(_screenVGA, _screenLayer2, 46080);
+ copyLayerToScreen(_screenLayer2Surface);
++i;
}
part6UpdateBackground();
diff --git a/engines/igor/parts/part_68.cpp b/engines/igor/parts/part_68.cpp
index 03391ee9201..0002c05fc16 100644
--- a/engines/igor/parts/part_68.cpp
+++ b/engines/igor/parts/part_68.cpp
@@ -366,7 +366,7 @@ void IgorEngine::part68Conversation() {
_part68QuestionCounter = 1;
part68DrawUndertaker(kPart68BorisStanding);
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
_gameState.dialogueStarted = 1;
if (!resuming) {
_gameState.dialogueChoiceStart = 1;
@@ -434,7 +434,7 @@ void IgorEngine::part68Conversation() {
part68BorisLeaves();
_objectsState[kUndertakerLeftStateIndex] = 2;
}
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
@@ -510,7 +510,7 @@ void IgorEngine::part68() {
_updateRoomBackground = &IgorEngine::part68UpdateBackground;
setInventoryPanelColors();
part68ApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
// the colors that change are darker than their palette
darkenPalette(_paletteBuffer, 192, 207, 10);
diff --git a/engines/igor/parts/part_69.cpp b/engines/igor/parts/part_69.cpp
index 3bbd72e9c6c..f81124327d9 100644
--- a/engines/igor/parts/part_69.cpp
+++ b/engines/igor/parts/part_69.cpp
@@ -299,7 +299,7 @@ void IgorEngine::part69() {
partMainSetExecuteAction(1, &IgorEngine::part69ExecuteAction);
_updateRoomBackground = &IgorEngine::part69UpdateBackground;
part69ApplyObjectState();
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (_objectsState[kPart69FireflyCapturedStateIndex] == 0) {
part69DrawSwarm(kPart69SwarmInitialFrame);
part69DrawMainFirefly(kPart69MainFireflyInitialFrame);
diff --git a/engines/igor/parts/part_7.cpp b/engines/igor/parts/part_7.cpp
index 48467e2e6a0..7025d3450e2 100644
--- a/engines/igor/parts/part_7.cpp
+++ b/engines/igor/parts/part_7.cpp
@@ -224,7 +224,7 @@ void IgorEngine::part7() {
_roomDataOffsets = PART_07_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
part7DrawDoorState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
setVerbPanelColors();
setInventoryPanelColors();
for (int area = 11; area <= 13; ++area) {
diff --git a/engines/igor/parts/part_70.cpp b/engines/igor/parts/part_70.cpp
index 1f12eef0017..6d1282d2bd5 100644
--- a/engines/igor/parts/part_70.cpp
+++ b/engines/igor/parts/part_70.cpp
@@ -78,7 +78,7 @@ void IgorEngine::part70() {
partMainSetExecuteAction(1, &IgorEngine::part70ExecuteAction);
_updateRoomBackground = &IgorEngine::part70UpdateBackground;
part70DrawObjectState();
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
// Igor is not shown in the map
if (!restoreRoomAfterLoad(false)) {
diff --git a/engines/igor/parts/part_71.cpp b/engines/igor/parts/part_71.cpp
index b459ef94c7a..b2efcdd9d91 100644
--- a/engines/igor/parts/part_71.cpp
+++ b/engines/igor/parts/part_71.cpp
@@ -203,7 +203,7 @@ void IgorEngine::part71() {
partMainSetExecuteAction(1, &IgorEngine::part71ExecuteAction);
_updateRoomBackground = &IgorEngine::part71UpdateBackground;
part71ApplyObjectState(kPart71ApplyAll);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_roomAmbientIndex = 0;
// the colors of Igor are darker than their palette
diff --git a/engines/igor/parts/part_72.cpp b/engines/igor/parts/part_72.cpp
index be50d9e1dfe..afb4cce40ee 100644
--- a/engines/igor/parts/part_72.cpp
+++ b/engines/igor/parts/part_72.cpp
@@ -192,7 +192,7 @@ void IgorEngine::part72() {
partMainSetExecuteAction(1, &IgorEngine::part72ExecuteAction);
_updateRoomBackground = &IgorEngine::part72UpdateBackground;
part72ApplyObjectState();
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
// Darken the room colors by 10 and Igor's colors by 15.
darkenPalette(_paletteBuffer, 1, 175, 10);
diff --git a/engines/igor/parts/part_73.cpp b/engines/igor/parts/part_73.cpp
index 672a59a4369..5a9df86c679 100644
--- a/engines/igor/parts/part_73.cpp
+++ b/engines/igor/parts/part_73.cpp
@@ -58,8 +58,8 @@ void IgorEngine::part73Cutscene() {
memcpy(_paletteBuffer + 192 * 3, _igorPalette, 48);
static const int anim[] = { ANM_Part73, 0 };
loadAnimData(anim);
- memcpy(_screenVGA, _screenLayer1, 46080);
- memset(_screenVGA + 46080, 0, 17920);
+ copyLayerToScreen(_screenLayer1Surface);
+ fillScreenRows(144, 56, 0);
part73DrawPoliceman(1);
WalkData *wd = &_walkData[0];
wd->setPos(195, 107, 4, 0);
diff --git a/engines/igor/parts/part_75.cpp b/engines/igor/parts/part_75.cpp
index 271dfa09fa4..f13c3c75140 100644
--- a/engines/igor/parts/part_75.cpp
+++ b/engines/igor/parts/part_75.cpp
@@ -60,7 +60,7 @@ void IgorEngine::part75() {
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);
+ copyLayerToScreen(_screenLayer1Surface);
_updateDialogue = &IgorEngine::part75UpdatePhilipDialogue;
part75DrawPhilipFrame(1);
part75DrawPhilipFrame(7);
diff --git a/engines/igor/parts/part_76.cpp b/engines/igor/parts/part_76.cpp
index ffd704d2f64..1fee5602eb2 100644
--- a/engines/igor/parts/part_76.cpp
+++ b/engines/igor/parts/part_76.cpp
@@ -177,7 +177,7 @@ void IgorEngine::part76UseParachute() {
return;
}
// the panel and the colors 240 to 255 are cleared
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
memset(_paletteBuffer + 240 * 3, 0, 48);
memset(_currentPalette + 240 * 3, 0, 48);
if (_gameState.igorMoving) {
@@ -298,7 +298,7 @@ void IgorEngine::part76() {
part76ApplyObjectState();
if (_game.version == kIdSpaFloppy)
playSound(kSpaFloppySoundPlaneEngine, 1);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
@@ -312,7 +312,7 @@ void IgorEngine::part76() {
stopDialogueSpeech();
if (!_gameStateLoaded) {
// the panel is cleared and the colors 208 to 254 go black in both palettes
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
memset(_paletteBuffer + 208 * 3, 0, 141);
memset(_currentPalette + 208 * 3, 0, 141);
} else {
diff --git a/engines/igor/parts/part_77.cpp b/engines/igor/parts/part_77.cpp
index 57d48722ea6..701e6a3e0bd 100644
--- a/engines/igor/parts/part_77.cpp
+++ b/engines/igor/parts/part_77.cpp
@@ -78,7 +78,7 @@ void IgorEngine::part77UpdateDialogue(int action) {
}
void IgorEngine::part77MonkeyCageCutscene() {
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
--_walkDataLastIndex;
_roomObjectAreasTable[_screenLayer2[88 * 320 + 124]].area = 5;
buildWalkPath(_walkData[_walkDataLastIndex].x, _walkData[_walkDataLastIndex].y, 124, 88);
@@ -169,7 +169,7 @@ void IgorEngine::part77() {
setRoomClickFix(143, -1, 286, true);
partMainSetExecuteAction(1, &IgorEngine::part77ExecuteAction);
part77ApplyObjectState();
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
part17DisableArea(0);
if (_gameStateLoaded) {
diff --git a/engines/igor/parts/part_78.cpp b/engines/igor/parts/part_78.cpp
index 5316de948d3..a4c7e53a76b 100644
--- a/engines/igor/parts/part_78.cpp
+++ b/engines/igor/parts/part_78.cpp
@@ -207,7 +207,7 @@ void IgorEngine::part78() {
partMainMeanwhile(IMG_Part78MinutesLater);
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
_gameState.enableLight = 1;
loadRoomData(PAL_Part78, IMG_Part78, BOX_Part78, 0, TXT_Part78);
static const int anim[] = { ANM_Part78, 0 };
@@ -215,7 +215,7 @@ void IgorEngine::part78() {
loadData(IMG_Part78Layer2, _screenLayer2 + 1);
_part78BandFrames = loadData(ANM_Part78Frames);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
part78DrawProfessorFrame(kPart78FirstFigure);
part78DrawIgorFrame(1);
memset(_currentPalette, 0, 768);
diff --git a/engines/igor/parts/part_79.cpp b/engines/igor/parts/part_79.cpp
index 8756c60264e..f71f31b4b07 100644
--- a/engines/igor/parts/part_79.cpp
+++ b/engines/igor/parts/part_79.cpp
@@ -144,8 +144,8 @@ void IgorEngine::part79LauraInWater() {
loadData(IMG_Part79Layer2, _screenLayer2);
loadData(ANM_Part79, _animFramesBuffer);
if (!isCDVersion())
- memset(_screenVGA, 0, 64000);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ fillScreenRows(0, 200, 0);
+ copyLayerToScreen(_screenLayer1Surface);
part79DrawLauraInWater(1);
fadeIn(768);
_roomAmbientIndex = 0;
@@ -601,7 +601,7 @@ void IgorEngine::part79() {
_canSaveGame = false;
// the picture is shown below a black band (the Spanish floppy draws it at the top of the screen)
if (_currentPart == 790) {
- memset(_screenVGA, 0, 64000);
+ fillScreenRows(0, 200, 0);
}
if (_game.version != kIdSpaFloppy) {
uint8 band[320 * kPart79BandRows];
diff --git a/engines/igor/parts/part_8.cpp b/engines/igor/parts/part_8.cpp
index d2160a9038e..88f6cc6b81e 100644
--- a/engines/igor/parts/part_8.cpp
+++ b/engines/igor/parts/part_8.cpp
@@ -441,7 +441,7 @@ void IgorEngine::part8() {
setRoomClickFix(143, -1, 281, false);
part8ApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
setVerbPanelColors();
setInventoryPanelColors();
if (!restoreRoomAfterLoad()) {
diff --git a/engines/igor/parts/part_80.cpp b/engines/igor/parts/part_80.cpp
index 4a8a083ec20..9fe4260a7c5 100644
--- a/engines/igor/parts/part_80.cpp
+++ b/engines/igor/parts/part_80.cpp
@@ -89,8 +89,8 @@ void IgorEngine::part80() {
loadRoomData(PAL_Part80, IMG_Part80, BOX_Part80, MSK_Part80, TXT_Part80);
static const int anim[] = { ANM_Part80, 0 };
loadAnimData(anim);
- memcpy(_screenVGA, _screenLayer1, 46080);
- memset(_screenVGA + 46080, 0, 17920);
+ copyLayerToScreen(_screenLayer1Surface);
+ fillScreenRows(144, 56, 0);
fadeIn(768);
_gameState.igorMoving = false;
diff --git a/engines/igor/parts/part_81.cpp b/engines/igor/parts/part_81.cpp
index 088089c4edf..bde7634502e 100644
--- a/engines/igor/parts/part_81.cpp
+++ b/engines/igor/parts/part_81.cpp
@@ -307,7 +307,7 @@ void IgorEngine::part81GiveLampToLighthouseKeeper() {
part81RejectItem();
return;
}
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
for (int frame = 3; frame <= 4; ++frame) {
part81DrawLighthouseKeeperHead(frame);
waitForTimer(31);
@@ -433,7 +433,7 @@ void IgorEngine::part81HandleDialogue() {
}
} while (!done);
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
_currentAction.verb = kVerbWalk;
@@ -530,7 +530,7 @@ void IgorEngine::part81() {
// the colors that change are darker than their palette
darkenPalette(_paletteBuffer, 192, 207, 20);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
if (!restoreRoomAfterLoad()) {
_currentAction.verb = kVerbWalk;
diff --git a/engines/igor/parts/part_85.cpp b/engines/igor/parts/part_85.cpp
index 6b720e479b1..8600f7123ee 100644
--- a/engines/igor/parts/part_85.cpp
+++ b/engines/igor/parts/part_85.cpp
@@ -136,7 +136,7 @@ void IgorEngine::part85DisplayLogo() {
waitForTimer(0);
}
- memcpy(_screenVGA, _screenTextLayer, 46080);
+ copyLayerToScreen(_screenTextLayerSurface);
_currentPalette[765] = 63;
_currentPalette[766] = 63;
_currentPalette[767] = 63;
@@ -162,7 +162,7 @@ void IgorEngine::part85ScrollRight() {
if (compareGameTick(0, 16)) {
copyArea(_screenTextLayer, 0, 320, _screenLayer1 + x * 8, 320, 320 - x * 8, 144);
copyArea(_screenTextLayer, 320 - x * 8, 320, _screenLayer2 + 96, 320, x * 8, 144);
- memcpy(_screenVGA, _screenTextLayer, 46080);
+ copyLayerToScreen(_screenTextLayerSurface);
++x;
}
part85UpdateBackground();
@@ -219,7 +219,7 @@ void IgorEngine::part85() {
static const int anm[] = { ANM_PhilipLauraIntro, AOF_PhilipLauraIntro, ANM_LauraIntro, AOF_LauraIntro, 0 };
loadAnimData(anm);
// copies part6 into screen buffer
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
_updateDialogue = &IgorEngine::part85UpdatePhilipLauraDialogue;
_updateRoomBackground = &IgorEngine::part85UpdateBackground;
@@ -312,7 +312,7 @@ PART_85_EXIT:
_walkData[0].setPos(155, 121, 4, 0);
_walkData[0].setDefaultScale();
copyArea(_screenLayer2, 23180, 320, _facingIgorFrames[3], 30, 30, 50, true);
- memcpy(_screenVGA, _screenLayer2, 46080);
+ copyLayerToScreen(_screenLayer2Surface);
// sets all colors after 624 as black
memset(_currentPalette + 0x270, 0, 0x8D);
setPaletteRange(208, 254);
diff --git a/engines/igor/parts/part_9.cpp b/engines/igor/parts/part_9.cpp
index 8aaae95b0c1..674540addf4 100644
--- a/engines/igor/parts/part_9.cpp
+++ b/engines/igor/parts/part_9.cpp
@@ -282,7 +282,7 @@ void IgorEngine::part9() {
TXT_AdministrationSecretaryRoom);
if (_currentPart == 91) {
// This sequence uses the animation frames retained from the dean's room.
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
part8DrawSecretaryTalkingFrame(1);
memcpy(_screenLayer1, _screenVGA, 46080);
fadeIn(624);
@@ -314,7 +314,7 @@ void IgorEngine::part9() {
_roomDataOffsets = PART_09_ROOM_DATA_OFFSETS;
setRoomWalkBounds(0, 0, 319, 143);
part9ApplyObjectState(255);
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
setVerbPanelColors();
setInventoryPanelColors();
_updateRoomBackground = &IgorEngine::part9UpdateBackground;
diff --git a/engines/igor/parts/part_95.cpp b/engines/igor/parts/part_95.cpp
index 175cd0bf2a5..47684a5e29d 100644
--- a/engines/igor/parts/part_95.cpp
+++ b/engines/igor/parts/part_95.cpp
@@ -115,7 +115,7 @@ void IgorEngine::part95() {
hideCursor();
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
- memset(_screenVGA, 0, 64000);
+ fillScreenRows(0, 200, 0);
int startStr = -1, endStr = -1;
switch (_currentPart) {
case 950:
diff --git a/engines/igor/parts/part_credits.cpp b/engines/igor/parts/part_credits.cpp
index b6ee8bbff6e..6980a7d49b9 100644
--- a/engines/igor/parts/part_credits.cpp
+++ b/engines/igor/parts/part_credits.cpp
@@ -84,7 +84,7 @@ void IgorEngine::partCredits() {
else
playMusic(12);
- memset(_screenVGA, 0, 64000);
+ fillScreenRows(0, 200, 0);
memset(_currentPalette, 0, 768);
setPaletteRange(0, 255);
diff --git a/engines/igor/parts/part_margaret.cpp b/engines/igor/parts/part_margaret.cpp
index 0ae247c1402..afd85e4a79e 100644
--- a/engines/igor/parts/part_margaret.cpp
+++ b/engines/igor/parts/part_margaret.cpp
@@ -75,7 +75,7 @@ void IgorEngine::partMargaret() {
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);
+ copyLayerToScreen(_screenLayer1Surface);
_updateDialogue = &IgorEngine::partMargaretUpdateDialogue;
partMargaretDrawBasePose();
memset(_currentPalette, 0, 768);
diff --git a/engines/igor/parts/part_maze.cpp b/engines/igor/parts/part_maze.cpp
index 9dd2b484114..892fcb15c6b 100644
--- a/engines/igor/parts/part_maze.cpp
+++ b/engines/igor/parts/part_maze.cpp
@@ -326,7 +326,7 @@ void IgorEngine::partMaze() {
if (room->objectName3) {
Common::strlcpy(_roomObjectNames[3], room->objectName3, sizeof(_roomObjectNames[3]));
}
- memcpy(_screenVGA, _screenLayer1, 46080);
+ copyLayerToScreen(_screenLayer1Surface);
// the whole room is darker than its palette
darkenPalette(_paletteBuffer, 1, 183, room->darkness);
diff --git a/engines/igor/text.cpp b/engines/igor/text.cpp
index 84ffbea678a..f231f9ea641 100644
--- a/engines/igor/text.cpp
+++ b/engines/igor/text.cpp
@@ -602,7 +602,7 @@ void IgorEngine::handleDialogue(int x, int y, int r, int g, int b, bool restoreU
}
debugC(9, kDebugEngine, "handleDialogue() end %d start %d count %d", _dialogueEnded, _gameState.dialogueChoiceStart, _gameState.dialogueChoiceCount);
} while (!_dialogueEnded);
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
if(restoreUI) {
drawVerbsPanel();
drawInventory(_inventoryInfo[kInventoryFirstVisible], 0);
@@ -617,7 +617,7 @@ void IgorEngine::drawDialogueChoices() {
warning("drawDialogueChoices() entered while dialogue text is still active");
}
const bool floppy = (_game.version == kIdSpaFloppy);
- memset(_screenVGA + 46080, 0, 56 * 320);
+ fillScreenRows(144, 56, 0);
setPaletteColor(floppy ? kFloppyChoiceColor : kChoiceColor, 0, 0, 0);
_dialogueInfo[0] = 0;
for (int i = 1; i <= 5; ++i) {
@@ -702,7 +702,7 @@ int IgorEngine::selectDialogue() {
}
void IgorEngine::dialogueAskQuestion() {
- memset(_screenVGA + 46080, 0, 17920);
+ fillScreenRows(144, 56, 0);
int offset = dialogueChoiceOffset(_dialogueInfo[_dialogueChoiceSelected]);
int question = _gameState.dialogueData[offset + 3];
// For part 5 igor always chickens out from Phillip
Commit: 9fabb6d736222d721fdd067056d087d6d4232e8e
https://github.com/scummvm/scummvm/commit/9fabb6d736222d721fdd067056d087d6d4232e8e
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:30+01:00
Commit Message:
IGOR: Remove unnecessary static from copy protection
Changed paths:
engines/igor/copy_protection.cpp
diff --git a/engines/igor/copy_protection.cpp b/engines/igor/copy_protection.cpp
index 660062ae6d3..cb8e6425e31 100644
--- a/engines/igor/copy_protection.cpp
+++ b/engines/igor/copy_protection.cpp
@@ -71,7 +71,7 @@ enum FloppyProtectionText {
};
// Pascal strings stored one after the other in a resource.
-static void readProtectionStrings(Common::Array<Common::String> &texts, const uint8 *data, int size, int count) {
+void readProtectionStrings(Common::Array<Common::String> &texts, const uint8 *data, int size, int count) {
int offset = 0;
for (int i = 0; i < count; ++i) {
if (offset >= size || data[offset] > size - offset - 1)
@@ -84,7 +84,7 @@ static void readProtectionStrings(Common::Array<Common::String> &texts, const ui
error("Unexpected data in copy protection text resource");
}
-static int protectionInputChar(const Common::KeyState &kbd) {
+int protectionInputChar(const Common::KeyState &kbd) {
const uint32 chr = kbd.ascii;
if (chr >= 0x20 && chr < 0x7F)
return chr;
@@ -102,8 +102,8 @@ static int protectionInputChar(const Common::KeyState &kbd) {
}
}
// only ASCII + characters handled in protectionInputChar()
-static bool protectionCharAllowed(int chr) {
- static const uint8 allowed[32] = {
+bool protectionCharAllowed(int chr) {
+ const uint8 allowed[32] = {
0, 0, 0, 0, 0x07, 0xF3, 0xFF, 0xDF, 0xFE, 0xFF, 0xFF, 0x07, 0xFE, 0xFF, 0xFF, 0x07,
0x04, 0, 0, 0, 0x3F, 0x21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
Commit: 7cfadf6d4d2eaf2aca6d9a2dcb5cd909d0f9ca38
https://github.com/scummvm/scummvm/commit/7cfadf6d4d2eaf2aca6d9a2dcb5cd909d0f9ca38
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:31+01:00
Commit Message:
IGOR: Remove statics from floppy menu
Changed paths:
engines/igor/copy_protection.cpp
engines/igor/floppy_menu.h
diff --git a/engines/igor/copy_protection.cpp b/engines/igor/copy_protection.cpp
index cb8e6425e31..5ade87c5a65 100644
--- a/engines/igor/copy_protection.cpp
+++ b/engines/igor/copy_protection.cpp
@@ -28,32 +28,32 @@
namespace Igor {
// Copy protection screen of the floppy version
-static const int kFloppyProtectionTries = 3;
-static const int kFloppyProtectionWordCount = 100;
-static const int kFloppyProtectionEntrySize = 14;
-static const int kFloppyProtectionWordLength = 10;
-static const int kFloppyProtectionCodeOffset = 0x45;
-static const int kFloppyProtectionInputX = 122;
-static const int kFloppyProtectionInputY = 75;
-static const int kFloppyProtectionInputFullX = 197;
-static const int kFloppyProtectionTitleX = 136;
-static const int kFloppyProtectionPromptX = 93;
-static const int kFloppyProtectionPromptY = 42;
-static const int kFloppyProtectionQuestionX = 81;
-static const int kFloppyProtectionQuestionY = 52;
-static const int kFloppyProtectionReplyX = 100;
-static const int kFloppyProtectionReplyY = 86;
-static const int kFloppyProtectionReplyTicks = 2 * 200;
-static const int kFloppyProtectionBlinkTick = 61;
-static const int kFloppyProtectionBlinkPeriod = 64;
-static const int kFloppyProtectionBoxX = 120;
-static const int kFloppyProtectionBoxY = 56;
-static const int kFloppyProtectionBoxWidth = 80;
-static const int kFloppyProtectionBoxHeight = 11;
-static const int kFloppyProtectionCaretRow = 8;
-static const int kFloppyProtectionCaretWidth = 7;
-static const int kFloppyProtectionGlyphRows = 9;
-static const int kFloppyProtectionMaxInput = 32;
+const int kFloppyProtectionTries = 3;
+const int kFloppyProtectionWordCount = 100;
+const int kFloppyProtectionEntrySize = 14;
+const int kFloppyProtectionWordLength = 10;
+const int kFloppyProtectionCodeOffset = 0x45;
+const int kFloppyProtectionInputX = 122;
+const int kFloppyProtectionInputY = 75;
+const int kFloppyProtectionInputFullX = 197;
+const int kFloppyProtectionTitleX = 136;
+const int kFloppyProtectionPromptX = 93;
+const int kFloppyProtectionPromptY = 42;
+const int kFloppyProtectionQuestionX = 81;
+const int kFloppyProtectionQuestionY = 52;
+const int kFloppyProtectionReplyX = 100;
+const int kFloppyProtectionReplyY = 86;
+const int kFloppyProtectionReplyTicks = 2 * 200;
+const int kFloppyProtectionBlinkTick = 61;
+const int kFloppyProtectionBlinkPeriod = 64;
+const int kFloppyProtectionBoxX = 120;
+const int kFloppyProtectionBoxY = 56;
+const int kFloppyProtectionBoxWidth = 80;
+const int kFloppyProtectionBoxHeight = 11;
+const int kFloppyProtectionCaretRow = 8;
+const int kFloppyProtectionCaretWidth = 7;
+const int kFloppyProtectionGlyphRows = 9;
+const int kFloppyProtectionMaxInput = 32;
enum {
kFloppyColorInputFill = 0xFB
diff --git a/engines/igor/floppy_menu.h b/engines/igor/floppy_menu.h
index f8da70cc04a..2ffeb34eb2c 100644
--- a/engines/igor/floppy_menu.h
+++ b/engines/igor/floppy_menu.h
@@ -25,22 +25,22 @@
namespace Igor {
// Geometry and colors of the panel shared by the floppy options menu and the copy protection.
-static const int kFloppyMenuX = 53;
-static const int kFloppyMenuY = 19;
-static const int kFloppyMenuWidth = 214;
-static const int kFloppyMenuHeight = 106;
-static const int kFloppyMenuSize = 320 * kFloppyMenuHeight;
-static const int kFloppyButtonX = 55;
-static const int kFloppyButtonY = 21;
-static const int kFloppyButtonWidth = 42;
-static const int kFloppyButtonHeight = 13;
-static const int kFloppyControlPanelFirstRow = 36;
-static const int kFloppyControlPanelRows = 85;
-static const int kFloppyCaptionY = 22;
-static const int kFloppyCaptionLastRow = 34;
-static const int kFloppyLastFadedColor = 248;
-static const int kFloppyFadeSteps = 30;
-static const int kFloppyFadeCount = 3 * (kFloppyLastFadedColor + 1);
+const int kFloppyMenuX = 53;
+const int kFloppyMenuY = 19;
+const int kFloppyMenuWidth = 214;
+const int kFloppyMenuHeight = 106;
+const int kFloppyMenuSize = 320 * kFloppyMenuHeight;
+const int kFloppyButtonX = 55;
+const int kFloppyButtonY = 21;
+const int kFloppyButtonWidth = 42;
+const int kFloppyButtonHeight = 13;
+const int kFloppyControlPanelFirstRow = 36;
+const int kFloppyControlPanelRows = 85;
+const int kFloppyCaptionY = 22;
+const int kFloppyCaptionLastRow = 34;
+const int kFloppyLastFadedColor = 248;
+const int kFloppyFadeSteps = 30;
+const int kFloppyFadeCount = 3 * (kFloppyLastFadedColor + 1);
enum {
kFloppyColorCaption = 0xF9,
Commit: 7affd33497ccbfac14c3729992a9c93b081acb40
https://github.com/scummvm/scummvm/commit/7affd33497ccbfac14c3729992a9c93b081acb40
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:31+01:00
Commit Message:
IGOR: Turn igor's frames into ManagedSurfaces
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 0f359d65b82..acda7c5e581 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -60,10 +60,14 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
_inventoryImagesBuffer = (uint8 *)_inventoryImagesSurface.getPixels();
_verbsPanelBuffer = (uint8 *)_verbsPanelSurface.getPixels();
for (int i = 0; i < 4; i++) {
- _facingIgorFrames[i] = (uint8 *)malloc(13500);
- }
- _igorHeadFrames = (uint8 *)malloc(3696);
- _animFramesBuffer = (uint8 *)malloc(65535);
+ _facingIgorFramesSurface[i].create(13500, 1, clut8);
+ _facingIgorFrames[i] = (uint8 *)_facingIgorFramesSurface[i].getPixels();
+ }
+ _igorHeadFramesSurface.create(3696, 1, clut8);
+ _igorHeadFrames = (uint8 *)_igorHeadFramesSurface.getPixels();
+ // 65535 isn't representable as a single ManagedSurface dimension (int16), so split it into two factors
+ _animFramesBufferSurface.create(255, 257, clut8);
+ _animFramesBuffer = (uint8 *)_animFramesBufferSurface.getPixels();
_verbsPanelSize = 0; // set when the panel is loaded
_floppyProtectionPassed = false;
@@ -97,11 +101,6 @@ IgorEngine::~IgorEngine() {
free(_musicData);
free(_resourceEntries);
free(_soundOffsets);
- for (int i = 0; i < 4; ++i) {
- free(_facingIgorFrames[i]);
- }
- free(_igorHeadFrames);
- free(_animFramesBuffer);
delete _screen;
}
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 71e7df58c01..d7ba2d458a0 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -260,6 +260,9 @@ private:
Graphics::ManagedSurface _inventoryPanelSurface; // two panels (320x30 each)
Graphics::ManagedSurface _inventoryImagesSurface;
Graphics::ManagedSurface _verbsPanelSurface;
+ Graphics::ManagedSurface _facingIgorFramesSurface[4]; // 13500 bytes each: Igor sprite frames, one per facing direction
+ Graphics::ManagedSurface _igorHeadFramesSurface; // 3696 bytes: Igor head close-up frames
+ Graphics::ManagedSurface _animFramesBufferSurface; // 65535 bytes: scratch buffer for screen and animation data
uint8 *_screenVGA;
uint8 *_facingIgorFrames[4];
Commit: 0b8b60b040e11d528d9bdfee3526b55f8db141dc
https://github.com/scummvm/scummvm/commit/0b8b60b040e11d528d9bdfee3526b55f8db141dc
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:31+01:00
Commit Message:
IGOR: Remove static modifier to variables that dont really need it
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/parts/part_14.cpp
engines/igor/parts/part_16.cpp
engines/igor/parts/part_17.cpp
engines/igor/parts/part_19.cpp
engines/igor/parts/part_21.cpp
engines/igor/parts/part_21_floppy.cpp
engines/igor/parts/part_85.cpp
engines/igor/parts/part_margaret.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index acda7c5e581..987fc92baa1 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -93,6 +93,17 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
_musicData = nullptr;
_fastMode = 1;
+
+ _part14NewChurchMosaicStone = 0;
+ _part14CurrentChurchMosaicStone = 0;
+ _part16CurrentTalkingActor = 0;
+ _part17CurrentTalkingActor = 0;
+ _part19CurrentTalkingActor = 0;
+ _part21InAction111 = false;
+ _part21FloppyInAction111 = false;
+ _part85CurrentTalkingActor = 0;
+ _part85WaterSoundPlaying = false;
+ _partMargaretRoomAnimCounter = 0;
}
IgorEngine::~IgorEngine() {
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index d7ba2d458a0..da68f7e6a93 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -388,6 +388,17 @@ private:
bool _part68NpcPresent;
uint8 _parkLadyIdleStep;
+ int _part14NewChurchMosaicStone;
+ int _part14CurrentChurchMosaicStone;
+ int _part16CurrentTalkingActor;
+ int _part17CurrentTalkingActor;
+ int _part19CurrentTalkingActor;
+ bool _part21InAction111;
+ bool _part21FloppyInAction111; // same as _part21InAction111, but for the Spanish floppy variant of part 21
+ int _part85CurrentTalkingActor;
+ bool _part85WaterSoundPlaying;
+ int _partMargaretRoomAnimCounter;
+
uint8 _currentPalette[768];
uint8 _paletteBuffer[768];
uint8 _igorPalette[48];
diff --git a/engines/igor/parts/part_14.cpp b/engines/igor/parts/part_14.cpp
index 660107dddbe..7a0345a5109 100644
--- a/engines/igor/parts/part_14.cpp
+++ b/engines/igor/parts/part_14.cpp
@@ -26,9 +26,6 @@ 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::part14ExecuteAction(int action) {
debugC(9, kDebugGame, "part14ExecuteAction %d", action);
switch (action) {
@@ -401,19 +398,19 @@ void IgorEngine::part14ShowPuzzle() {
_gameState.counter[4] = 0;
_currentPart = 145;
_dialogueEnded = false;
- VAR_CURRENT_CHURCH_MOSAIC_STONE = 255;
+ _part14CurrentChurchMosaicStone = 255;
do {
// the region mask only covers the room area; below it (verbs panel) there is no region
int area = _inputVars[kInputCursorYPos] < 144 ? _screenLayer2[_inputVars[kInputCursorYPos] * 320 + _inputVars[kInputCursorXPos]] : 0;
if (area == 0) {
- VAR_NEW_CHURCH_MOSAIC_STONE = 1;
+ _part14NewChurchMosaicStone = 1;
} else if (area >= 1 && area <= 8) {
- VAR_NEW_CHURCH_MOSAIC_STONE = 2;
+ _part14NewChurchMosaicStone = 2;
} else if (area == 9) {
- VAR_NEW_CHURCH_MOSAIC_STONE = 3;
+ _part14NewChurchMosaicStone = 3;
}
- if (VAR_NEW_CHURCH_MOSAIC_STONE != VAR_CURRENT_CHURCH_MOSAIC_STONE) {
- switch (VAR_NEW_CHURCH_MOSAIC_STONE) {
+ if (_part14NewChurchMosaicStone != _part14CurrentChurchMosaicStone) {
+ switch (_part14NewChurchMosaicStone) {
case 1:
drawActionSentence("", mosaicSentenceColor(0));
break;
@@ -424,7 +421,7 @@ void IgorEngine::part14ShowPuzzle() {
drawActionSentence(getString(STR_Exit), mosaicSentenceColor(0));
break;
}
- VAR_CURRENT_CHURCH_MOSAIC_STONE = VAR_NEW_CHURCH_MOSAIC_STONE;
+ _part14CurrentChurchMosaicStone = _part14NewChurchMosaicStone;
}
if (_inputVars[kInputClick]) {
_inputVars[kInputClick] = 0;
diff --git a/engines/igor/parts/part_16.cpp b/engines/igor/parts/part_16.cpp
index 4268a2d4ff1..0cf37ce77c0 100644
--- a/engines/igor/parts/part_16.cpp
+++ b/engines/igor/parts/part_16.cpp
@@ -23,9 +23,6 @@
namespace Igor {
-
-static int VAR_CURRENT_TALKING_ACTOR;
-
void IgorEngine::part16ExecuteAction(int action) {
debugC(9, kDebugGame, "part16ExecuteAction %d", action);
switch (action) {
@@ -66,10 +63,10 @@ void IgorEngine::part16TakeFlask() {
void IgorEngine::part16UpdateMargaretHarrisonDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- part16DrawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? 34 : 48);
+ part16DrawTalkingFrame((_part16CurrentTalkingActor == 0) ? 34 : 48);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- part16DrawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? getRandomNumber(4) + 30 : getRandomNumber(4) + 44);
+ part16DrawTalkingFrame((_part16CurrentTalkingActor == 0) ? getRandomNumber(4) + 30 : getRandomNumber(4) + 44);
break;
}
}
@@ -156,7 +153,7 @@ void IgorEngine::part16PhotoCutscene() {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true);
waitForTimer(25);
}
- VAR_CURRENT_TALKING_ACTOR = 0;
+ _part16CurrentTalkingActor = 0;
cutsceneSayWithCallback(175, 78, 0, 58, 40, { { 215, 1, 735 }, { 216, 1, 736 }, { 217, 1, 737 } }, &IgorEngine::part16UpdateMargaretHarrisonDialogue);
for (int i = 35; i <= 41; ++i) {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true);
@@ -167,7 +164,7 @@ void IgorEngine::part16PhotoCutscene() {
decodeAnimFrame(_animFramesBuffer + 0x8CE + READ_LE_UINT16(_animFramesBuffer + 0x6F36 + i * 2) - 1, _screenVGA, true);
waitForTimer(35);
}
- VAR_CURRENT_TALKING_ACTOR = 1;
+ _part16CurrentTalkingActor = 1;
cutsceneSayWithCallback(175, 78, 0, 58, 40, { { 220, 1, 739 }, { 221, 1, 740 } }, &IgorEngine::part16UpdateMargaretHarrisonDialogue);
cutsceneSayWithCallback(88, 69, 63, 32, 0, 222, 2, 741, &IgorEngine::part16UpdateMargaretDialogue);
playSound(26, 1);
diff --git a/engines/igor/parts/part_17.cpp b/engines/igor/parts/part_17.cpp
index 5b2509e1df5..b24990aa732 100644
--- a/engines/igor/parts/part_17.cpp
+++ b/engines/igor/parts/part_17.cpp
@@ -23,8 +23,6 @@
namespace Igor {
-static int VAR_CURRENT_TALKING_ACTOR;
-
void IgorEngine::part17ExecuteAction(int action) {
debugC(9, kDebugGame, "part17ExecuteAction %d", action);
switch (action) {
@@ -83,7 +81,7 @@ void IgorEngine::part17TalkToPhilipAndJimmy() {
cutsceneSayWithCallback(156, 32, 35, 38, 47, 210, 2, 638, &IgorEngine::part17UpdateJimmyDialogue);
}
- VAR_CURRENT_TALKING_ACTOR = 0;
+ _part17CurrentTalkingActor = 0;
if (_gameState.counter[4] == 1) {
debug("part17TalkToPhilipAndJimmy: counter[4] == 1");
cutsceneSayWithCallback(135, 33, 63, 63, 0, { { 203, 1, 634 }, { 204, 2, 635 } }, &IgorEngine::part17UpdatePhilipDialogue);
@@ -99,7 +97,7 @@ void IgorEngine::part17TalkToPhilipAndJimmy() {
waitForTimer(255);
const int randomDialogue = getRandomNumber(3);
- VAR_CURRENT_TALKING_ACTOR = 1;
+ _part17CurrentTalkingActor = 1;
cutsceneSayWithCallback(135, 33, 63, 63, 0, 215 + randomDialogue, 1, 641 + randomDialogue, &IgorEngine::part17UpdatePhilipDialogue);
part17PhilipDialogueAndTail();
@@ -237,14 +235,14 @@ void IgorEngine::part17UpdateJimmyDialogue(int action) {
void IgorEngine::part17UpdatePhilipDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- if (VAR_CURRENT_TALKING_ACTOR == 0) {
+ if (_part17CurrentTalkingActor == 0) {
part17PhilipToJimmyAnimFrame(0);
} else {
part17PhilipToIgor(0);
}
break;
case kUpdateDialogueAnimMiddleOfSentence:
- if (VAR_CURRENT_TALKING_ACTOR == 0) {
+ if (_part17CurrentTalkingActor == 0) {
debug("part17PhilipToJimmyAnimFrame");
part17PhilipToJimmyAnimFrame(getRandomNumber(6));
} else {
@@ -544,7 +542,7 @@ void IgorEngine::part17() {
enterPartLoop();
if (takeResumeDialogue(1)) { // loaded while talking to philip
// the lines before the menu are not played again, only philip's pose is drawn
- VAR_CURRENT_TALKING_ACTOR = 1;
+ _part17CurrentTalkingActor = 1;
part17PhilipToIgor(0);
part17PhilipDialogueAndTail();
finishResumedDialogue();
diff --git a/engines/igor/parts/part_19.cpp b/engines/igor/parts/part_19.cpp
index acfb326c9ba..10e3a341552 100644
--- a/engines/igor/parts/part_19.cpp
+++ b/engines/igor/parts/part_19.cpp
@@ -23,8 +23,6 @@
namespace Igor {
-static int VAR_CURRENT_TALKING_ACTOR;
-
void IgorEngine::part19ExecuteAction(int action) {
switch (action) {
case 101:
@@ -100,10 +98,10 @@ void IgorEngine::part19UsePapyrusOnDryer() {
void IgorEngine::part19UpdateWomenDialogue(int action) {
switch (action) {
case kUpdateDialogueAnimEndOfSentence:
- part19DrawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? 35 : 40);
+ part19DrawTalkingFrame((_part19CurrentTalkingActor == 0) ? 35 : 40);
break;
case kUpdateDialogueAnimMiddleOfSentence:
- part19DrawTalkingFrame((VAR_CURRENT_TALKING_ACTOR == 0) ? 35 + getRandomNumber(4) : 40 + getRandomNumber(4));
+ part19DrawTalkingFrame((_part19CurrentTalkingActor == 0) ? 35 + getRandomNumber(4) : 40 + getRandomNumber(4));
break;
}
}
@@ -133,7 +131,7 @@ void IgorEngine::part19SlugCutscene() { // sub_137_07AD
decodeAnimFrame(src, _screenVGA, true);
memcpy(_screenLayer1, _screenVGA, 46080);
fadeIn(624);
- VAR_CURRENT_TALKING_ACTOR = 0;
+ _part19CurrentTalkingActor = 0;
cutsceneSayWithCallback(243, 92, 63, 23, 33, 212, 3, 920, &IgorEngine::part19UpdateWomenDialogue);
for (int i = 2; i <= 9; ++i) {
src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x404F + i * 2) - 1;
@@ -142,7 +140,7 @@ void IgorEngine::part19SlugCutscene() { // sub_137_07AD
}
cutsceneSayStart(227, 91, 0, 63, 63, { { 215, 1, 921 }, { 216, 2, 922 } });
_gameState.counter[1] = 10;
- VAR_CURRENT_TALKING_ACTOR = 1;
+ _part19CurrentTalkingActor = 1;
_updateRoomBackground = &IgorEngine::part19UpdateBackground;
waitForEndOfCutsceneDialogue(227, 91, 0, 63, 63);
_updateRoomBackground = 0;
@@ -168,13 +166,13 @@ void IgorEngine::part19SlugCutscene() { // sub_137_07AD
src = _animFramesBuffer + 0xE1A + READ_LE_UINT16(_animFramesBuffer + 0x40B5) - 1;
decodeAnimFrame(src, _screenVGA, true);
waitForTimer(30);
- VAR_CURRENT_TALKING_ACTOR = 0;
+ _part19CurrentTalkingActor = 0;
cutsceneSayWithCallback(243, 92, 63, 23, 33, 218, 1, 923, &IgorEngine::part19UpdateWomenDialogue);
- VAR_CURRENT_TALKING_ACTOR = 1;
+ _part19CurrentTalkingActor = 1;
cutsceneSayWithCallback(227, 91, 0, 63, 63, 219, 2, 924, &IgorEngine::part19UpdateWomenDialogue);
- VAR_CURRENT_TALKING_ACTOR = 0;
+ _part19CurrentTalkingActor = 0;
cutsceneSayWithCallback(243, 92, 63, 23, 33, 221, 2, 925, &IgorEngine::part19UpdateWomenDialogue);
- VAR_CURRENT_TALKING_ACTOR = 1;
+ _part19CurrentTalkingActor = 1;
cutsceneSayWithCallback(227, 91, 0, 63, 63, 223, 2, 926, &IgorEngine::part19UpdateWomenDialogue);
_objectsState[kToiletGirlsHaveLeftStateIndex] = 1;
fadeOut(624);
diff --git a/engines/igor/parts/part_21.cpp b/engines/igor/parts/part_21.cpp
index 806a1cbeda6..7864ddfa814 100644
--- a/engines/igor/parts/part_21.cpp
+++ b/engines/igor/parts/part_21.cpp
@@ -27,8 +27,6 @@ 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::part21ExecuteAction(int action) {
switch (action) {
case 101:
@@ -148,11 +146,11 @@ void IgorEngine::part21UseNoteWithSandwiches() {
igorSay(223, 2, 1196);
return;
}
- IN_ACTION_111 = true;
+ _part21InAction111 = true;
igorSay({ { 208, 1, 1184 }, { 209, 1, 1185 } });
// Igor's talking head is not animated here; the writing frames take its place
waitForEndOfIgorDialogue(false);
- IN_ACTION_111 = false;
+ _part21InAction111 = false;
const int offset = 28183;
drawAnimRect(offset, 0xCBE1, 26, 50);
waitForTimer(100);
@@ -372,7 +370,7 @@ void IgorEngine::part21SetMargaretBackgroundFrame(int frame) {
}
void IgorEngine::part21UpdateBackground() {
- if (IN_ACTION_111 && compareGameTick(3, 24)) {
+ if (_part21InAction111 && compareGameTick(3, 24)) {
const int offset = 28183;
int i = getRandomNumber(1) + 1;
drawAnimRect(offset, 0xBCA5 + i * 1300, 26, 50);
diff --git a/engines/igor/parts/part_21_floppy.cpp b/engines/igor/parts/part_21_floppy.cpp
index e059452c790..d2140ae5441 100644
--- a/engines/igor/parts/part_21_floppy.cpp
+++ b/engines/igor/parts/part_21_floppy.cpp
@@ -52,8 +52,6 @@ const int kWritingFrames = 0x3B1D;
const uint8 kWritingEndFrames[5] = { 0, 1, 2, 6, 1 };
const int kPhysicsDoorCell = 114 * 320 + 181;
-bool IN_ACTION_111;
-
void IgorEngine::part21FloppyExecuteAction(int action) {
switch (action) {
case 101:
@@ -171,11 +169,11 @@ void IgorEngine::part21FloppyUseNoteWithSandwiches() {
igorSay({ { 223, 2, 0 }, { 225, 1, 0 } });
return;
}
- IN_ACTION_111 = true;
+ _part21FloppyInAction111 = true;
igorSay({ { 208, 1, 0 }, { 209, 1, 0 } });
// Igor's talking head is not animated here
waitForEndOfIgorDialogue(false);
- IN_ACTION_111 = false;
+ _part21FloppyInAction111 = false;
int k = 1;
do {
if (compareGameTick(61) && k <= 4) {
@@ -352,7 +350,7 @@ void IgorEngine::part21FloppyMargaretTakesNote() {
}
void IgorEngine::part21FloppyUpdateBackground() {
- if (IN_ACTION_111 && compareGameTick(61)) {
+ if (_part21FloppyInAction111 && compareGameTick(61)) {
const int i = getRandomNumber(2) + 3;
drawAnimRect(kWritingOffset, kWritingFrames + i * 720, 24, 30);
}
diff --git a/engines/igor/parts/part_85.cpp b/engines/igor/parts/part_85.cpp
index 8600f7123ee..91fe97f5b5e 100644
--- a/engines/igor/parts/part_85.cpp
+++ b/engines/igor/parts/part_85.cpp
@@ -25,17 +25,13 @@
namespace Igor {
-static int VAR_CURRENT_TALKING_ACTOR;
-static bool VAR_WATER_SOUND_PLAYING;
-
-
void IgorEngine::part85UpdatePhilipLauraDialogue(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) {
+ if (_part85CurrentTalkingActor != 0) {
_gameState.counter[0] = getRandomNumber(4) + 8;
} else {
_gameState.counter[0] = getRandomNumber(4) + 13;
@@ -187,7 +183,7 @@ void IgorEngine::part85UpdateBackground() {
scrollPalette(185, 191);
setPaletteRange(185, 191);
}
- if (!VAR_WATER_SOUND_PLAYING) {
+ if (!_part85WaterSoundPlaying) {
return;
}
if (_game.flags & kFlagFloppy /*|| !_gameState.dialogueTextRunning*/) {
@@ -226,7 +222,7 @@ void IgorEngine::part85() {
// In the CD version the water sound is embedded in the CD track
if(_game.flags & kFlagFloppy) {
- VAR_WATER_SOUND_PLAYING = true;
+ _part85WaterSoundPlaying = true;
playSound(17, 1);
}
@@ -249,25 +245,25 @@ void IgorEngine::part85() {
waitForEndOfCutsceneDialogue(89, 56, 63, 63, 0);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
cutsceneSayStart(113, 59, 63, 0, 38, 205, 3, 547);
- VAR_CURRENT_TALKING_ACTOR = 1;
+ _part85CurrentTalkingActor = 1;
waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
cutsceneSayStart(89, 56, 63, 63, 0, 208, 1, 548);
- VAR_CURRENT_TALKING_ACTOR = 0;
+ _part85CurrentTalkingActor = 0;
waitForEndOfCutsceneDialogue(89, 56, 63, 63, 0);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
cutsceneSayStart(113, 59, 63, 0, 38, { { 209, 2, 549 }, { 211, 1, 550 }, { 212, 1, 551 }, { 213, 1, 552 }, { 214, 1, 553 } });
- VAR_CURRENT_TALKING_ACTOR = 1;
+ _part85CurrentTalkingActor = 1;
waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
part85PlayAnimationFrame(0, 0x7481, 2, 7, 32);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
cutsceneSayStart(89, 56, 63, 63, 0, { { 215, 1, 554 }, { 216, 2, 555 }, { 218, 1, 556 } });
- VAR_CURRENT_TALKING_ACTOR = 0;
+ _part85CurrentTalkingActor = 0;
waitForEndOfCutsceneDialogue(89, 56, 63, 63, 0);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
cutsceneSayStart(113, 59, 63, 0, 38, { { 219, 2, 557 }, { 221, 2, 558 } });
- VAR_CURRENT_TALKING_ACTOR = 1;
+ _part85CurrentTalkingActor = 1;
waitForEndOfCutsceneDialogue(113, 59, 63, 0, 38);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
decodeAnimFrame(getAnimFrame(0, 0x7480, 1), _screenVGA, true);
@@ -276,7 +272,7 @@ void IgorEngine::part85() {
part85PlayAnimationFrame(0, 0x7481, 18, 37, 20);
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
part85ScrollRight();
- VAR_WATER_SOUND_PLAYING = false;
+ _part85WaterSoundPlaying = false;
stopSound();
if (_inputVars[kInputEscape]) goto PART_85_EXIT;
part85PlayAnimationFrame(0x74CA, 0xA6C4, 1, 6, 32);
diff --git a/engines/igor/parts/part_margaret.cpp b/engines/igor/parts/part_margaret.cpp
index afd85e4a79e..e6c4e36f638 100644
--- a/engines/igor/parts/part_margaret.cpp
+++ b/engines/igor/parts/part_margaret.cpp
@@ -23,9 +23,6 @@
namespace Igor {
-
-static int VAR_MARGARET_ROOM_ANIM_COUNTER;
-
// The Spanish floppy has other animation blocks, so the tables are at other places
static const int kMargaretBasePoseTable = 0x2A63;
static const int kMargaretFramesBase = 0x2A75;
@@ -37,13 +34,13 @@ static const int kMargaretFloppyFramesTable = 0xE338;
void IgorEngine::partMargaretDrawBasePose() {
const bool floppy = _game.version == kIdSpaFloppy;
const int table = floppy ? kMargaretFloppyBasePoseTable : kMargaretBasePoseTable;
- const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + table + VAR_MARGARET_ROOM_ANIM_COUNTER * 2) - 1;
+ const uint8 *src = _animFramesBuffer + READ_LE_UINT16(_animFramesBuffer + table + _partMargaretRoomAnimCounter * 2) - 1;
decodeAnimFrame(src, _screenVGA);
}
void IgorEngine::partMargaretDrawFrame(int frame) {
const bool floppy = _game.version == kIdSpaFloppy;
- const int offset = ((VAR_MARGARET_ROOM_ANIM_COUNTER - 1) * 5 + frame) * 2;
+ const int offset = ((_partMargaretRoomAnimCounter - 1) * 5 + frame) * 2;
const int base = floppy ? kMargaretFloppyFramesBase : kMargaretFramesBase;
const int table = floppy ? kMargaretFloppyFramesTable : kMargaretFramesTable;
const uint8 *src = _animFramesBuffer + base + READ_LE_UINT16(_animFramesBuffer + offset + table) - 1;
@@ -68,9 +65,9 @@ void IgorEngine::partMargaret() {
playMusic(8);
_gameState.enableLight = 1;
const bool floppy = _game.version == kIdSpaFloppy;
- VAR_MARGARET_ROOM_ANIM_COUNTER = _objectsState[kMargaretSceneStateIndex] + 1;
- if (VAR_MARGARET_ROOM_ANIM_COUNTER == 9) {
- VAR_MARGARET_ROOM_ANIM_COUNTER = 1;
+ _partMargaretRoomAnimCounter = _objectsState[kMargaretSceneStateIndex] + 1;
+ if (_partMargaretRoomAnimCounter == 9) {
+ _partMargaretRoomAnimCounter = 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 };
@@ -81,7 +78,7 @@ void IgorEngine::partMargaret() {
memset(_currentPalette, 0, 768);
fadeIn(768);
_gameState.igorMoving = false;
- switch (VAR_MARGARET_ROOM_ANIM_COUNTER) {
+ switch (_partMargaretRoomAnimCounter) {
case 1:
ADD_DIALOGUE_TEXT(223, 1, 1118);
ADD_DIALOGUE_TEXT(224, 1, 1119);
Commit: 6a86fe60f3f31fc92d948165ce6c2a4fd9e54542
https://github.com/scummvm/scummvm/commit/6a86fe60f3f31fc92d948165ce6c2a4fd9e54542
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:32+01:00
Commit Message:
IGOR: Sort MODULE_OBJS list alphabetically
Changed paths:
engines/igor/module.mk
diff --git a/engines/igor/module.mk b/engines/igor/module.mk
index b40eeca0af1..f941a7dc3a9 100644
--- a/engines/igor/module.mk
+++ b/engines/igor/module.mk
@@ -1,25 +1,18 @@
MODULE := engines/igor
MODULE_OBJS = \
- igor.o \
console.o \
- metaengine.o \
- walk.o \
- palette.o \
- font.o \
+ copy_protection.o \
floppy_font.o \
- room.o \
+ font.o \
graphics.o \
- resource.o \
+ igor.o \
input.o \
- static_walk.o \
- static_cursor.o \
- static_room.o \
- static_inventory.o \
- static_palette.o \
- static_text.o \
+ metaengine.o \
+ midi.o \
options.o \
- copy_protection.o \
+ palette.o \
+ part_main.o \
parts/part_0.o \
parts/part_1.o \
parts/part_2.o \
@@ -85,13 +78,20 @@ MODULE_OBJS = \
parts/part_90.o \
parts/part_95.o \
parts/part_credits.o \
+ parts/part_margaret.o \
parts/part_maze.o \
parts/part_maze_data.o \
- parts/part_margaret.o \
+ resource.o \
+ room.o \
+ sound.o \
+ static_cursor.o \
+ static_inventory.o \
+ static_palette.o \
+ static_room.o \
+ static_text.o \
+ static_walk.o \
text.o \
- part_main.o \
- midi.o \
- sound.o
+ walk.o
# This module can be built as a plugin
ifeq ($(ENABLE_IGOR), DYNAMIC_PLUGIN)
Commit: af6ff7e6cda1a648c887a4c06435dd352a74e985
https://github.com/scummvm/scummvm/commit/af6ff7e6cda1a648c887a4c06435dd352a74e985
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:32+01:00
Commit Message:
IGOR: Fix unfreed resources
Changed paths:
engines/igor/igor.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 987fc92baa1..a80656342cf 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -91,6 +91,10 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
// _currentPart = 850;
_midiPlayer = nullptr;
_musicData = nullptr;
+ _resourceEntriesCount = 0;
+ _resourceEntries = nullptr;
+ _soundOffsetsCount = 0;
+ _soundOffsets = nullptr;
_fastMode = 1;
@@ -206,6 +210,7 @@ void IgorEngine::restart() {
_executeMainAction = 0;
_executeRoomAction = 0;
_previousMusic = 0;
+ free(_musicData);
_musicData = 0;
_scrollInventory = false;
_roomCursorOn = true;
@@ -217,8 +222,10 @@ void IgorEngine::restart() {
_updateRoomBackground = 0;
_resourceEntriesCount = 0;
+ free(_resourceEntries);
_resourceEntries = 0;
_soundOffsetsCount = 0;
+ free(_soundOffsets);
_soundOffsets = 0;
_demoActionsCounter = 0;
Commit: adc80868b8e98a36227778b5965015374b74ea24
https://github.com/scummvm/scummvm/commit/adc80868b8e98a36227778b5965015374b74ea24
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:33+01:00
Commit Message:
IGOR: Prevent out-of-bounds save slot in the original save/load page
Changed paths:
engines/igor/options.cpp
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index 02fc1647462..ec6388f817a 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -919,18 +919,21 @@ bool IgorEngine::originalSaveLoadPage(bool save) {
}
if (save && slots.size() < maxEntries) {
// the new savegame uses the first free slot
+ const int maxSlot = (int)maxEntries - 1;
int freeSlot = 0;
- for (;;) {
+ for (; freeSlot <= maxSlot; ++freeSlot) {
bool used = (freeSlot == autosaveSlot);
for (uint i = 0; i < slots.size() && !used; ++i) {
used = (slots[i] == freeSlot);
}
if (!used)
break;
- ++freeSlot;
}
- slots.push_back(freeSlot);
- names.push_back(Common::String(kSaveLoadNameLength, ' '));
+ // every valid slot may already be taken (e.g. by the autosave)
+ if (freeSlot <= maxSlot) {
+ slots.push_back(freeSlot);
+ names.push_back(Common::String(kSaveLoadNameLength, ' '));
+ }
}
if (slots.empty()) {
saveLoadDrawTitle(l, kOptionsNoSavedGames, l.noSavedGamesX, kSaveLoadNoSavedGamesY, l.colorNoGames);
Commit: 45a541fa6dd423d07d35aa464d8cf1f1a913faa4
https://github.com/scummvm/scummvm/commit/45a541fa6dd423d07d35aa464d8cf1f1a913faa4
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:33+01:00
Commit Message:
IGOR: Skip sentinel sound entry in create_tbl
Changed paths:
devtools/create_igor/create_igortbl.cpp
diff --git a/devtools/create_igor/create_igortbl.cpp b/devtools/create_igor/create_igortbl.cpp
index f0a634d1e38..4cdb552fa22 100644
--- a/devtools/create_igor/create_igortbl.cpp
+++ b/devtools/create_igor/create_igortbl.cpp
@@ -340,7 +340,7 @@ static void createTableFile(FILE *fp) {
}
/* sounds tables */
- for (i = 0; i < (int)TABLE_SIZE(_soundEntriesList); ++i) {
+ for (i = 0; _soundEntriesList[i].p; ++i) {
addPtrOffset(fp, _soundEntriesList[i].p);
writeSoundEntriesTable(fp, _soundEntriesList[i].p, _soundEntriesList[i].count);
}
Commit: 81dcffd50ae45b1f5054ceb0f97bbfba6a2fd922
https://github.com/scummvm/scummvm/commit/81dcffd50ae45b1f5054ceb0f97bbfba6a2fd922
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:33+01:00
Commit Message:
IGOR: Add exit condition on pause loop
Changed paths:
engines/igor/igor.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index a80656342cf..d4a90be8293 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -523,7 +523,9 @@ void IgorEngine::handlePause() {
drawActionSentence(getString(STR_GamePaused), 0xFB);
do {
waitForTimer();
- } while (!_inputVars[kInputPause]);
+ } while (!_inputVars[kInputPause] && !_eventQuitGame);
+ if (_eventQuitGame)
+ return; // keep the escape flag set by the quit event
memset(_inputVars, 0, sizeof(_inputVars));
}
Commit: f81d54b002653759ae624a0311e59fc72906dce5
https://github.com/scummvm/scummvm/commit/f81d54b002653759ae624a0311e59fc72906dce5
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:34+01:00
Commit Message:
IGOR: Fix incorrect syncing of walkData and dialogueData
Changed paths:
engines/igor/igor.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index d4a90be8293..9d74554f322 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -531,8 +531,8 @@ void IgorEngine::handlePause() {
Common::Error IgorEngine::syncGame(Common::Serializer &s) {
- // Walk data (100 entries)
- for (int i = 0; i < 100; ++i) {
+ // Walk data
+ for (int i = 0; i < ARRAYSIZE(_walkData); ++i) {
s.skip(2);
s.syncAsSint16LE(_walkData[i].x);
s.syncAsSint16LE(_walkData[i].y);
@@ -616,7 +616,7 @@ Common::Error IgorEngine::syncGame(Common::Serializer &s) {
s.syncAsByte(_gameState.unk11);
s.syncAsByte(_gameState.dialogueStarted);
s.skip(1);
- for (int i = 0; i < 500; ++i) {
+ for (int i = 0; i < ARRAYSIZE(_gameState.dialogueData); ++i) {
s.syncAsByte(_gameState.dialogueData[i]);
}
s.syncAsByte(_gameState.dialogueChoiceStart);
Commit: 4e2eba2af1b75d46139b743290281a09dacd5a56
https://github.com/scummvm/scummvm/commit/4e2eba2af1b75d46139b743290281a09dacd5a56
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:34+01:00
Commit Message:
IGOR: Preload inventory icons and panel
Changed paths:
engines/igor/graphics.cpp
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/resource.cpp
diff --git a/engines/igor/graphics.cpp b/engines/igor/graphics.cpp
index f4156485301..f37bb9964ee 100644
--- a/engines/igor/graphics.cpp
+++ b/engines/igor/graphics.cpp
@@ -217,8 +217,7 @@ void IgorEngine::scrollInventory() {
}
void IgorEngine::drawInventory(int start, int mode) {
- loadData(IMG_InventoryPanel, _inventoryPanelBuffer);
- loadData(IMG_Objects, _inventoryImagesBuffer);
+ memcpy(_inventoryPanelBuffer, _inventoryPanelOriginal, _inventoryPanelSize);
if (_game.version == kIdSpaFloppy) {
for (int slot = 0; slot < 8; ++slot) {
const int object = _inventoryInfo[start + slot - 1];
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 9d74554f322..1691536787d 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -50,6 +50,7 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
_screenTempLayerSurface.create(100, 100, clut8);
_inventoryPanelSurface.create(320, 60, clut8);
_inventoryImagesSurface.create(320, 150, clut8);
+ _inventoryPanelOriginalSurface.create(320, 60, clut8);
_verbsPanelSurface.create(320, 12, clut8);
_screenVGA = (uint8 *)_screenVGASurface.getPixels();
_screenLayer1 = (uint8 *)_screenLayer1Surface.getPixels();
@@ -58,6 +59,8 @@ IgorEngine::IgorEngine(OSystem *syst, const IgorGameDescription *gameDesc) : Eng
_screenTempLayer = (uint8 *)_screenTempLayerSurface.getPixels();
_inventoryPanelBuffer = (uint8 *)_inventoryPanelSurface.getPixels();
_inventoryImagesBuffer = (uint8 *)_inventoryImagesSurface.getPixels();
+ _inventoryPanelOriginal = (uint8 *)_inventoryPanelOriginalSurface.getPixels();
+ _inventoryPanelSize = 0;
_verbsPanelBuffer = (uint8 *)_verbsPanelSurface.getPixels();
for (int i = 0; i < 4; i++) {
_facingIgorFramesSurface[i].create(13500, 1, clut8);
@@ -259,6 +262,7 @@ Common::Error IgorEngine::run() {
_midiPlayer = new MidiPlayer(_mixer);
loadMainTexts();
loadIgorFrames();
+ loadInventoryResources();
_gameState.talkMode = kTalkModeSpeechAndText;
_gameState.talkSpeed = 3;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index da68f7e6a93..ff3a0163afc 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -259,6 +259,7 @@ private:
Graphics::ManagedSurface _screenTempLayerSurface; // 100x100 scratch block
Graphics::ManagedSurface _inventoryPanelSurface; // two panels (320x30 each)
Graphics::ManagedSurface _inventoryImagesSurface;
+ Graphics::ManagedSurface _inventoryPanelOriginalSurface;
Graphics::ManagedSurface _verbsPanelSurface;
Graphics::ManagedSurface _facingIgorFramesSurface[4]; // 13500 bytes each: Igor sprite frames, one per facing direction
Graphics::ManagedSurface _igorHeadFramesSurface; // 3696 bytes: Igor head close-up frames
@@ -274,6 +275,8 @@ private:
uint8 *_animFramesBuffer;
uint8 *_inventoryPanelBuffer;
uint8 *_inventoryImagesBuffer;
+ uint8 *_inventoryPanelOriginal; // untouched panel, drawInventory() works on a copy
+ int _inventoryPanelSize;
uint8 *_verbsPanelBuffer;
int _verbsPanelSize;
int _screenVGAVOffset;
@@ -463,6 +466,7 @@ private:
int getTalkMode() const;
int prepareDialoguePlayback(const DialogueText &text);
void loadIgorFrames();
+ void loadInventoryResources();
void loadIgorBeachFrames();
void ADD_DIALOGUE_TEXT(int num, int count, int sound = kNoSpeechSound);
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index ccc81f20f84..cffa11777df 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -304,6 +304,11 @@ const char *IgorEngine::getString(int id) const {
return str;
}
+void IgorEngine::loadInventoryResources() {
+ loadData(IMG_InventoryPanel, _inventoryPanelOriginal, &_inventoryPanelSize);
+ loadData(IMG_Objects, _inventoryImagesBuffer);
+}
+
void IgorEngine::loadIgorFrames() {
loadData(FRM_IgorDirBack, _facingIgorFrames[0]);
loadData(FRM_IgorDirRight, _facingIgorFrames[1]);
Commit: e74477e3caf816133f16f62f6ec00b871db2d1f9
https://github.com/scummvm/scummvm/commit/e74477e3caf816133f16f62f6ec00b871db2d1f9
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:34+01:00
Commit Message:
IGOR: Fix black bar when opening options menu during splash screen
Changed paths:
engines/igor/options.cpp
diff --git a/engines/igor/options.cpp b/engines/igor/options.cpp
index ec6388f817a..e9e1448f56d 100644
--- a/engines/igor/options.cpp
+++ b/engines/igor/options.cpp
@@ -1086,7 +1086,9 @@ void IgorEngine::handleOptionsMenu() {
memcpy(_paletteBuffer, _currentPalette, 208 * 3);
memcpy(_currentPalette + 208 * 3, _paletteBuffer + 208 * 3, 48 * 3);
setPaletteRange(208, 255);
- if (!_gameState.dialogueStarted)
+ // The logo slideshow uses the whole screen, so the dialogue text strip must stay.
+ const bool splashScreen = _currentPart >= 900 && _currentPart <= 904;
+ if (!_gameState.dialogueStarted && !splashScreen)
fillScreenRows(144, 11, 0);
_system->copyRectToScreen(_screenVGA, 320, 0, 0, 320, 200);
for (int m = 3; m <= kFadeSteps; m += 3) {
Commit: d6a7291cfad2b4be8ff40e1a66e65983dd5a728b
https://github.com/scummvm/scummvm/commit/d6a7291cfad2b4be8ff40e1a66e65983dd5a728b
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:35+01:00
Commit Message:
IGOR: Avoid walk table overrun and playSound asserts
Changed paths:
engines/igor/igor.h
engines/igor/sound.cpp
engines/igor/walk.cpp
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index ff3a0163afc..5afbd6344ed 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -1471,6 +1471,7 @@ private:
int lookupScale(int xOffset, int yOffset, int h) const;
void lookupScale(int curX, int curY, uint8 &scale, uint8 &xScale, uint8 &yScale) const;
+ void advanceWalkDataLastIndex();
void buildWalkPathSimple(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);
diff --git a/engines/igor/sound.cpp b/engines/igor/sound.cpp
index ea9b6f5ceb7..957dbebb3e1 100644
--- a/engines/igor/sound.cpp
+++ b/engines/igor/sound.cpp
@@ -247,7 +247,10 @@ void IgorEngine::playSound(int num, int type) {
if (_mixer->isSoundHandleActive(_sfxHandle)) {
return;
}
- assert(num >= 0 && num < _soundOffsetsCount);
+ if (num < 0 || num >= _soundOffsetsCount) {
+ warning("playSound: invalid sound id %d", num + 1);
+ return;
+ }
soundOffset = _soundOffsets[num];
soundType = Audio::Mixer::kSFXSoundType;
soundHandle = &_sfxHandle;
@@ -260,7 +263,10 @@ void IgorEngine::playSound(int num, int type) {
return;
}
num += 101;
- assert(num >= 0 && num < _soundOffsetsCount);
+ if (num < 0 || num >= _soundOffsetsCount) {
+ warning("playSound: invalid speech id %d", num - 101);
+ return;
+ }
soundOffset = _soundOffsets[num];
soundType = Audio::Mixer::kSpeechSoundType;
soundHandle = &_speechHandle;
diff --git a/engines/igor/walk.cpp b/engines/igor/walk.cpp
index 6c7da93050d..c6596c6f068 100644
--- a/engines/igor/walk.cpp
+++ b/engines/igor/walk.cpp
@@ -197,6 +197,15 @@ void IgorEngine::moveIgor(int pos, int frame) {
screenIgorDrawOffset += 320;
}
}
+void IgorEngine::advanceWalkDataLastIndex() {
+ // the path must never grow past the walk table: keep overwriting the final entry instead
+ if (_walkDataLastIndex + 1 >= ARRAYSIZE(_walkData)) {
+ warning("Walk path too long, truncating");
+ return;
+ }
+ ++_walkDataLastIndex;
+}
+
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) {
@@ -372,7 +381,7 @@ void IgorEngine::buildWalkPathAreaUpDirection(int srcX, int srcY, int dstX, int
_walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1];
_walkData[_walkDataLastIndex].posNum = (dstX > srcX) ? kFacingPositionRight : kFacingPositionLeft;
_walkData[_walkDataLastIndex].frameNum = 5;
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
} else {
_walkCurrentPos = 1;
}
@@ -419,7 +428,7 @@ void IgorEngine::buildWalkPathAreaUpDirection(int srcX, int srcY, int dstX, int
wd->dxPos = _walkData[_walkDataLastIndex - 1].x - wd->x;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
vStepCur += vStepDist;
}
} else {
@@ -427,7 +436,7 @@ void IgorEngine::buildWalkPathAreaUpDirection(int srcX, int srcY, int dstX, int
_walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1];
_walkData[_walkDataLastIndex].posNum = 1;
_walkData[_walkDataLastIndex].frameNum = 1;
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
}
}
lookupScale(dstX, dstY, scale, xScale, yScale);
@@ -457,7 +466,7 @@ void IgorEngine::buildWalkPathAreaUpDirection(int srcX, int srcY, int dstX, int
wd->dxPos = curX - dstX;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
} else {
int vStepsCount = getVerticalStepsCount(dstX, dstY, srcX, srcY);
if (vStepsCount > 0) {
@@ -494,7 +503,7 @@ void IgorEngine::buildWalkPathAreaUpDirection(int srcX, int srcY, int dstX, int
wd->dxPos = wd->x - _walkData[_walkDataLastIndex - 1].x;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
vStepCur += vStepDist;
}
} else {
@@ -502,7 +511,7 @@ void IgorEngine::buildWalkPathAreaUpDirection(int srcX, int srcY, int dstX, int
_walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1];
_walkData[_walkDataLastIndex].posNum = 1;
_walkData[_walkDataLastIndex].frameNum = 1;
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
}
}
lookupScale(dstX, dstY, scale, xScale, yScale);
@@ -534,7 +543,7 @@ void IgorEngine::buildWalkPathAreaUpDirection(int srcX, int srcY, int dstX, int
wd->dxPos = dstX - curX;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
}
}
@@ -545,7 +554,7 @@ void IgorEngine::buildWalkPathAreaDownDirection(int srcX, int srcY, int dstX, in
_walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1];
_walkData[_walkDataLastIndex].posNum = (srcX > dstX) ? kFacingPositionLeft : kFacingPositionRight;
_walkData[_walkDataLastIndex].frameNum = 1;
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
} else {
_walkCurrentPos = 3;
}
@@ -592,7 +601,7 @@ void IgorEngine::buildWalkPathAreaDownDirection(int srcX, int srcY, int dstX, in
wd->dxPos = _walkData[_walkDataLastIndex - 1].x - wd->x;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
vStepCur += vStepDist;
}
} else {
@@ -600,7 +609,7 @@ void IgorEngine::buildWalkPathAreaDownDirection(int srcX, int srcY, int dstX, in
_walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1];
_walkData[_walkDataLastIndex].posNum = 3;
_walkData[_walkDataLastIndex].frameNum = 1;
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
}
}
lookupScale(dstX, dstY, scale, xScale, yScale);
@@ -630,7 +639,7 @@ void IgorEngine::buildWalkPathAreaDownDirection(int srcX, int srcY, int dstX, in
wd->dxPos = curX - dstX;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
} else {
int vStepsCount = getVerticalStepsCount(srcX, srcY, dstX, dstY);
if (vStepsCount > 0) {
@@ -666,7 +675,7 @@ void IgorEngine::buildWalkPathAreaDownDirection(int srcX, int srcY, int dstX, in
wd->dxPos = wd->x - _walkData[_walkDataLastIndex - 1].x;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
vStepCur += vStepDist;
}
} else {
@@ -674,7 +683,7 @@ void IgorEngine::buildWalkPathAreaDownDirection(int srcX, int srcY, int dstX, in
_walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1];
_walkData[_walkDataLastIndex].posNum = 3;
_walkData[_walkDataLastIndex].frameNum = 1;
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
}
}
lookupScale(dstX, dstY, scale, xScale, yScale);
@@ -704,7 +713,7 @@ void IgorEngine::buildWalkPathAreaDownDirection(int srcX, int srcY, int dstX, in
wd->dxPos = dstX - curX;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
}
}
@@ -715,7 +724,7 @@ void IgorEngine::buildWalkPathAreaRightDirection(int srcX, int srcY, int dstX, i
_walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1];
_walkData[_walkDataLastIndex].posNum = (srcY > dstY) ? kFacingPositionBack : kFacingPositionFront;
_walkData[_walkDataLastIndex].frameNum = 5;
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
} else {
_walkCurrentPos = kFacingPositionRight;
}
@@ -763,7 +772,7 @@ void IgorEngine::buildWalkPathAreaRightDirection(int srcX, int srcY, int dstX, i
wd->dxPos = xSkip;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
hStepCur += hStepDist;
WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame);
}
@@ -772,7 +781,7 @@ void IgorEngine::buildWalkPathAreaRightDirection(int srcX, int srcY, int dstX, i
_walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1];
_walkData[_walkDataLastIndex].posNum = 2;
_walkData[_walkDataLastIndex].frameNum = 1;
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
}
}
wd = &_walkData[_walkDataLastIndex];
@@ -802,7 +811,7 @@ void IgorEngine::buildWalkPathAreaRightDirection(int srcX, int srcY, int dstX, i
wd->dxPos = dstX - curX;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame);
} else {
int hStepsCount = getHorizontalStepsCount(srcX, srcY, dstX, dstY);
@@ -843,7 +852,7 @@ void IgorEngine::buildWalkPathAreaRightDirection(int srcX, int srcY, int dstX, i
wd->dxPos = xSkip;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
hStepCur += hStepDist;
WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame);
}
@@ -852,7 +861,7 @@ void IgorEngine::buildWalkPathAreaRightDirection(int srcX, int srcY, int dstX, i
_walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1];
_walkData[_walkDataLastIndex].posNum = 2;
_walkData[_walkDataLastIndex].frameNum = 1;
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
}
}
wd = &_walkData[_walkDataLastIndex];
@@ -882,7 +891,7 @@ void IgorEngine::buildWalkPathAreaRightDirection(int srcX, int srcY, int dstX, i
wd->dxPos = dstX - curX;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
WalkData::setNextFrame(kFacingPositionRight, _walkCurrentFrame);
}
}
@@ -894,7 +903,7 @@ void IgorEngine::buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, in
_walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1];
_walkData[_walkDataLastIndex].posNum = (srcY > dstY) ? kFacingPositionBack : kFacingPositionFront;
_walkData[_walkDataLastIndex].frameNum = 5;
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
} else {
_walkCurrentPos = kFacingPositionLeft;
}
@@ -942,7 +951,7 @@ void IgorEngine::buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, in
wd->dxPos = xSkip;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
hStepCur += hStepDist;
WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame);
}
@@ -951,7 +960,7 @@ void IgorEngine::buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, in
_walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1];
_walkData[_walkDataLastIndex].posNum = 4;
_walkData[_walkDataLastIndex].frameNum = 1;
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
}
}
wd = &_walkData[_walkDataLastIndex];
@@ -981,7 +990,7 @@ void IgorEngine::buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, in
wd->dxPos = curX - dstX;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame);
} else {
int hStepsCount = getHorizontalStepsCount(dstX, srcY, srcX, dstY);
@@ -1022,7 +1031,7 @@ void IgorEngine::buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, in
wd->dxPos = xSkip;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
hStepCur += hStepDist;
WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame);
}
@@ -1031,7 +1040,7 @@ void IgorEngine::buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, in
_walkData[_walkDataLastIndex] = _walkData[_walkDataLastIndex - 1];
_walkData[_walkDataLastIndex].posNum = 4;
_walkData[_walkDataLastIndex].frameNum = 1;
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
}
}
wd = &_walkData[_walkDataLastIndex];
@@ -1061,7 +1070,7 @@ void IgorEngine::buildWalkPathAreaLeftDirection(int srcX, int srcY, int dstX, in
wd->dxPos = curX - dstX;
}
}
- ++_walkDataLastIndex;
+ advanceWalkDataLastIndex();
WalkData::setNextFrame(kFacingPositionLeft, _walkCurrentFrame);
}
}
Commit: 828d4565a41d8d01340d287363a0fa63c963bd71
https://github.com/scummvm/scummvm/commit/828d4565a41d8d01340d287363a0fa63c963bd71
Author: kelmer (kelmer at gmail.com)
Date: 2026-11-15T15:07:35+01:00
Commit Message:
IGOR: Optimize by having IGOR.TBL always open
Changed paths:
engines/igor/igor.cpp
engines/igor/igor.h
engines/igor/resource.cpp
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 1691536787d..16d35f2e094 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -277,6 +277,7 @@ Common::Error IgorEngine::run() {
partMain();
_ovlFile.close();
+ _tblFile.close();
_sndFile.close();
return Common::kNoError;
diff --git a/engines/igor/igor.h b/engines/igor/igor.h
index 5afbd6344ed..51ba6402fba 100644
--- a/engines/igor/igor.h
+++ b/engines/igor/igor.h
@@ -243,6 +243,7 @@ private:
int _previousMusic;
Common::File _ovlFile;
+ Common::File _tblFile;
Common::File _sndFile;
Audio::SoundHandle _sfxHandle;
diff --git a/engines/igor/resource.cpp b/engines/igor/resource.cpp
index cffa11777df..e1f91e9eccf 100644
--- a/engines/igor/resource.cpp
+++ b/engines/igor/resource.cpp
@@ -26,66 +26,66 @@
namespace Igor {
void IgorEngine::readTableFile() {
- Common::File tblFile;
uint32 stringsEntriesOffset = 0, resourcesEntriesOffset = 0, soundEntriesOffset = 0;
uint32 tableVersion = 0;
- if (tblFile.open("IGOR.TBL") && tblFile.readUint32BE() == 'ITBL') {
- tableVersion = tblFile.readUint32BE();
+ if (_tblFile.open("IGOR.TBL") && _tblFile.readUint32BE() == 'ITBL') {
+ tableVersion = _tblFile.readUint32BE();
}
// version 5 adds the source of the data of each resource, version 6 data embedded in the table
if (tableVersion >= 4 && tableVersion <= 6) {
- stringsEntriesOffset = tblFile.readUint32BE();
+ stringsEntriesOffset = _tblFile.readUint32BE();
uint32 borlandOverlaySize = _ovlFile.size();
- int gameVersionsCount = tblFile.readByte();
+ int gameVersionsCount = _tblFile.readByte();
for (int i = 0; i < gameVersionsCount; ++i) {
- uint32 size = tblFile.readUint32BE();
+ uint32 size = _tblFile.readUint32BE();
if (size == borlandOverlaySize) {
- resourcesEntriesOffset = tblFile.readUint32BE();
- soundEntriesOffset = tblFile.readUint32BE();
+ resourcesEntriesOffset = _tblFile.readUint32BE();
+ soundEntriesOffset = _tblFile.readUint32BE();
break;
}
- tblFile.skip(8);
+ _tblFile.skip(8);
}
}
if (resourcesEntriesOffset != 0 && soundEntriesOffset != 0) {
- tblFile.seek(resourcesEntriesOffset);
- _resourceEntriesCount = tblFile.readUint16BE();
+ _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();
+ _resourceEntries[i].id = _tblFile.readUint16BE();
+ _resourceEntries[i].offs = _tblFile.readUint32BE();
+ _resourceEntries[i].size = _tblFile.readUint32BE();
_resourceEntries[i].source = kResourceSourceContainer;
if (tableVersion >= 5) {
- const int source = tblFile.readByte();
+ const int source = _tblFile.readByte();
if (source != kResourceSourceContainer && !(tableVersion >= 6 && source == kResourceSourceTable)) {
error("Invalid resource source in 'IGOR.TBL'");
}
_resourceEntries[i].source = (ResourceSource)source;
}
}
- tblFile.seek(soundEntriesOffset);
- _soundOffsetsCount = tblFile.readUint16BE();
+ _tblFile.seek(soundEntriesOffset);
+ _soundOffsetsCount = _tblFile.readUint16BE();
_soundOffsets = (uint32 *)malloc(sizeof(uint32) * _soundOffsetsCount);
for (int i = 0; i < _soundOffsetsCount; ++i) {
- _soundOffsets[i] = tblFile.readUint32BE();
+ _soundOffsets[i] = _tblFile.readUint32BE();
}
- tblFile.seek(stringsEntriesOffset);
- int stringsCount = tblFile.readUint16BE();
+ _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();
+ 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);
+ _tblFile.skip(len);
} else {
char buf[256];
- tblFile.read(buf, len);
+ _tblFile.read(buf, len);
buf[len] = 0;
_stringEntries.push_back(StringEntry(id, buf));
}
}
+ // the file stays open: resources are read from it on demand
return;
}
error("Unable to read 'IGOR.TBL'");
@@ -356,8 +356,7 @@ uint8 *IgorEngine::loadData(int id, uint8 *dst, int *size) {
}
}
if (re->source == kResourceSourceTable) {
- Common::File tblFile;
- if (!tblFile.open("IGOR.TBL") || !tblFile.seek(re->offs) || tblFile.read(dst, re->size) != re->size) {
+ if (!_tblFile.seek(re->offs) || _tblFile.read(dst, re->size) != re->size) {
error("Unable to read resource %d from 'IGOR.TBL'", id);
}
} else {
More information about the Scummvm-git-logs
mailing list