aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS22
-rw-r--r--Makefile.common3
-rw-r--r--NEWS6
-rw-r--r--README4
-rw-r--r--audio/rate.cpp32
-rw-r--r--audio/rate_arm.cpp21
-rw-r--r--audio/rate_arm_asm.s34
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_audio.cpp29
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_euphony.cpp1192
-rw-r--r--audio/softsynth/fmtowns_pc98/towns_euphony.h239
-rw-r--r--backends/audiocd/sdl/sdl-audiocd.cpp4
-rw-r--r--backends/audiocd/sdl/sdl-audiocd.h4
-rw-r--r--backends/events/ps3sdl/ps3sdl-events.cpp8
-rw-r--r--backends/events/sdl/sdl-events.cpp9
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp147
-rw-r--r--backends/graphics/opengl/opengl-graphics.h18
-rw-r--r--backends/graphics/opengl/opengl-sys.h4
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp27
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.h2
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp95
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.h15
-rw-r--r--backends/midi/timidity.cpp1
-rw-r--r--backends/mixer/sdl/sdl-mixer.cpp59
-rw-r--r--backends/mixer/sdl13/sdl13-mixer.cpp108
-rw-r--r--backends/module.mk7
-rw-r--r--backends/platform/sdl/macosx/appmenu_osx.mm25
-rw-r--r--backends/platform/sdl/ps3/ps3.cpp9
-rw-r--r--backends/platform/sdl/raspberrypi/README.RASPBERRYPI77
-rw-r--r--backends/platform/sdl/sdl.cpp8
-rw-r--r--backends/platform/symbian/AdaptAllMMPs.pl2
-rw-r--r--backends/platform/symbian/BuildPackageUpload_LocalSettings.pl42
-rw-r--r--backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in3
-rw-r--r--backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in3
-rw-r--r--backends/platform/symbian/help/ScummVM.rtf104
-rw-r--r--backends/platform/symbian/help/build_help.mk5
-rw-r--r--backends/platform/symbian/mmp/scummvm_base.mmp.in2
-rw-r--r--backends/platform/symbian/mmp/scummvm_sherlock.mmp.in53
-rw-r--r--backends/platform/tizen/graphics.cpp5
-rw-r--r--backends/platform/tizen/graphics.h2
-rw-r--r--backends/taskbar/win32/win32-taskbar.cpp20
-rw-r--r--common/algorithm.h6
-rw-r--r--common/dcl.cpp2
-rw-r--r--common/dcl.h1
-rw-r--r--common/scummsys.h14
-rw-r--r--common/xmlparser.cpp48
-rwxr-xr-xconfigure91
-rw-r--r--devtools/convbdf.cpp4
-rw-r--r--devtools/create_access/amazon_resources.cpp757
-rw-r--r--devtools/create_access/amazon_resources.h62
-rw-r--r--devtools/create_access/create_access_dat.cpp430
-rw-r--r--devtools/create_access/create_access_dat.h184
-rw-r--r--devtools/create_access/martian_resources.cpp182
-rw-r--r--devtools/create_access/martian_resources.h52
-rw-r--r--devtools/create_access/module.mk13
-rw-r--r--devtools/create_kyradat/create_kyradat.cpp2
-rw-r--r--devtools/create_kyradat/resources/lok_pc98_japanese.h5
-rw-r--r--devtools/create_project/create_project.h4
-rw-r--r--devtools/create_project/xcode.cpp389
-rw-r--r--devtools/create_project/xcode.h162
-rw-r--r--devtools/create_translations/create_translations.h6
-rwxr-xr-xdevtools/credits.pl29
-rwxr-xr-xdevtools/dist-scummvm.sh70
-rw-r--r--devtools/scumm-md5.txt56
-rw-r--r--dists/engine-data/README3
-rw-r--r--dists/engine-data/access.datbin0 -> 322768 bytes
-rw-r--r--dists/engine-data/kyra.datbin496648 -> 496676 bytes
-rw-r--r--dists/macosx/Info.plist5
-rw-r--r--dists/macosx/Info.plist.in5
-rw-r--r--dists/ps3/readme-ps3.md4
-rw-r--r--dists/scummvm.rc3
-rw-r--r--dists/scummvm.rc.in3
-rw-r--r--dists/win32/ScummVM.iss2
-rw-r--r--doc/de/Neues7
-rw-r--r--engines/access/access.cpp13
-rw-r--r--engines/access/access.h4
-rw-r--r--engines/access/amazon/amazon_game.cpp70
-rw-r--r--engines/access/amazon/amazon_logic.cpp2
-rw-r--r--engines/access/amazon/amazon_resources.cpp2022
-rw-r--r--engines/access/amazon/amazon_resources.h63
-rw-r--r--engines/access/amazon/amazon_room.cpp5
-rw-r--r--engines/access/amazon/amazon_scripts.cpp21
-rw-r--r--engines/access/animation.cpp7
-rw-r--r--engines/access/asurface.cpp15
-rw-r--r--engines/access/asurface.h6
-rw-r--r--engines/access/bubble_box.cpp18
-rw-r--r--engines/access/char.cpp31
-rw-r--r--engines/access/configure.engine2
-rw-r--r--engines/access/debugger.cpp54
-rw-r--r--engines/access/debugger.h5
-rw-r--r--engines/access/detection_tables.h16
-rw-r--r--engines/access/events.cpp2
-rw-r--r--engines/access/files.cpp18
-rw-r--r--engines/access/files.h1
-rw-r--r--engines/access/inventory.cpp35
-rw-r--r--engines/access/martian/martian_game.cpp22
-rw-r--r--engines/access/martian/martian_resources.cpp714
-rw-r--r--engines/access/martian/martian_resources.h30
-rw-r--r--engines/access/martian/martian_room.cpp2
-rw-r--r--engines/access/module.mk1
-rw-r--r--engines/access/resources.cpp135
-rw-r--r--engines/access/resources.h65
-rw-r--r--engines/access/room.cpp29
-rw-r--r--engines/access/screen.cpp9
-rw-r--r--engines/access/screen.h2
-rw-r--r--engines/access/scripts.cpp14
-rw-r--r--engines/access/scripts.h2
-rw-r--r--engines/access/sound.cpp35
-rw-r--r--engines/access/sound.h13
-rw-r--r--engines/access/video/movie_decoder.cpp741
-rw-r--r--engines/access/video/movie_decoder.h157
-rw-r--r--engines/agi/console.cpp144
-rw-r--r--engines/agi/console.h1
-rw-r--r--engines/agi/cycle.cpp20
-rw-r--r--engines/agi/op_cmd.cpp16
-rw-r--r--engines/agi/opcodes.cpp4
-rw-r--r--engines/agi/opcodes.h2
-rw-r--r--engines/agi/sound_2gs.cpp2
-rw-r--r--engines/agi/wagparser.cpp2
-rw-r--r--engines/agi/words.cpp6
-rw-r--r--engines/bbvs/bbvs.cpp14
-rw-r--r--engines/bbvs/bbvs.h12
-rw-r--r--engines/bbvs/configure.engine2
-rw-r--r--engines/bbvs/detection.cpp17
-rw-r--r--engines/bbvs/dialogs.cpp30
-rw-r--r--engines/bbvs/minigames/bbtennis.cpp2
-rw-r--r--engines/bbvs/videoplayer.cpp11
-rw-r--r--engines/bbvs/walk.cpp4
-rw-r--r--engines/cge2/sound.h4
-rw-r--r--engines/cge2/vga13h.cpp4
-rw-r--r--engines/fullpipe/scenes/scene04.cpp2
-rw-r--r--engines/fullpipe/statics.cpp7
-rw-r--r--engines/kyra/sound_intern.h2
-rw-r--r--engines/kyra/sound_towns.cpp100
-rw-r--r--engines/kyra/staticres.cpp2
-rw-r--r--engines/lab/anim.cpp349
-rw-r--r--engines/lab/anim.h101
-rw-r--r--engines/lab/configure.engine3
-rw-r--r--engines/lab/console.cpp128
-rw-r--r--engines/lab/console.h46
-rw-r--r--engines/lab/detection.cpp248
-rw-r--r--engines/lab/dispman.cpp971
-rw-r--r--engines/lab/dispman.h278
-rw-r--r--engines/lab/engine.cpp1123
-rw-r--r--engines/lab/eventman.cpp227
-rw-r--r--engines/lab/eventman.h138
-rw-r--r--engines/lab/image.cpp133
-rw-r--r--engines/lab/image.h78
-rw-r--r--engines/lab/interface.cpp159
-rw-r--r--engines/lab/intro.cpp438
-rw-r--r--engines/lab/intro.h71
-rw-r--r--engines/lab/lab.cpp247
-rw-r--r--engines/lab/lab.h501
-rw-r--r--engines/lab/labsets.cpp77
-rw-r--r--engines/lab/labsets.h61
-rw-r--r--engines/lab/map.cpp564
-rw-r--r--engines/lab/module.mk30
-rw-r--r--engines/lab/music.cpp336
-rw-r--r--engines/lab/music.h143
-rw-r--r--engines/lab/processroom.cpp640
-rw-r--r--engines/lab/processroom.h196
-rw-r--r--engines/lab/resource.cpp308
-rw-r--r--engines/lab/resource.h124
-rw-r--r--engines/lab/savegame.cpp249
-rw-r--r--engines/lab/special.cpp467
-rw-r--r--engines/lab/tilepuzzle.cpp399
-rw-r--r--engines/lab/tilepuzzle.h104
-rw-r--r--engines/lab/utils.cpp272
-rw-r--r--engines/lab/utils.h105
-rw-r--r--engines/lastexpress/game/savegame.cpp3
-rw-r--r--engines/lure/res.cpp4
-rw-r--r--engines/lure/res_struct.cpp21
-rw-r--r--engines/lure/res_struct.h14
-rw-r--r--engines/mads/animation.cpp44
-rw-r--r--engines/mads/animation.h17
-rw-r--r--engines/mads/assets.h5
-rw-r--r--engines/mads/camera.cpp192
-rw-r--r--engines/mads/camera.h63
-rw-r--r--engines/mads/configure.engine2
-rw-r--r--engines/mads/conversations.cpp362
-rw-r--r--engines/mads/conversations.h (renamed from backends/mixer/sdl13/sdl13-mixer.h)61
-rw-r--r--engines/mads/debugger.cpp14
-rw-r--r--engines/mads/debugger.h1
-rw-r--r--engines/mads/detection_tables.h4
-rw-r--r--engines/mads/dialogs.h5
-rw-r--r--engines/mads/dragonsphere/dragonsphere_scenes.cpp19
-rw-r--r--engines/mads/dragonsphere/dragonsphere_scenes.h85
-rw-r--r--engines/mads/dragonsphere/dragonsphere_scenes1.cpp3694
-rw-r--r--engines/mads/dragonsphere/dragonsphere_scenes1.h188
-rw-r--r--engines/mads/dragonsphere/game_dragonsphere.cpp2
-rw-r--r--engines/mads/dragonsphere/game_dragonsphere.h13
-rw-r--r--engines/mads/dragonsphere/globals_dragonsphere.cpp51
-rw-r--r--engines/mads/dragonsphere/globals_dragonsphere.h184
-rw-r--r--engines/mads/game.cpp88
-rw-r--r--engines/mads/game.h14
-rw-r--r--engines/mads/hotspots.cpp21
-rw-r--r--engines/mads/hotspots.h20
-rw-r--r--engines/mads/mads.cpp11
-rw-r--r--engines/mads/mads.h3
-rw-r--r--engines/mads/menu_views.cpp77
-rw-r--r--engines/mads/menu_views.h17
-rw-r--r--engines/mads/messages.cpp14
-rw-r--r--engines/mads/messages.h5
-rw-r--r--engines/mads/module.mk8
-rw-r--r--engines/mads/nebular/dialogs_nebular.cpp18
-rw-r--r--engines/mads/nebular/game_nebular.cpp22
-rw-r--r--engines/mads/nebular/menu_nebular.cpp26
-rw-r--r--engines/mads/nebular/menu_nebular.h15
-rw-r--r--engines/mads/nebular/nebular_scenes.cpp8
-rw-r--r--engines/mads/nebular/nebular_scenes1.cpp30
-rw-r--r--engines/mads/nebular/nebular_scenes2.cpp92
-rw-r--r--engines/mads/nebular/nebular_scenes3.cpp148
-rw-r--r--engines/mads/nebular/nebular_scenes3.h2
-rw-r--r--engines/mads/nebular/nebular_scenes4.cpp124
-rw-r--r--engines/mads/nebular/nebular_scenes5.cpp52
-rw-r--r--engines/mads/nebular/nebular_scenes6.cpp254
-rw-r--r--engines/mads/nebular/nebular_scenes7.cpp94
-rw-r--r--engines/mads/nebular/nebular_scenes8.cpp36
-rw-r--r--engines/mads/nebular/sound_nebular.cpp4
-rw-r--r--engines/mads/palette.h2
-rw-r--r--engines/mads/phantom/game_phantom.cpp779
-rw-r--r--engines/mads/phantom/game_phantom.h51
-rw-r--r--engines/mads/phantom/globals_phantom.cpp5
-rw-r--r--engines/mads/phantom/globals_phantom.h16
-rw-r--r--engines/mads/phantom/phantom_scenes.cpp111
-rw-r--r--engines/mads/phantom/phantom_scenes.h45
-rw-r--r--engines/mads/phantom/phantom_scenes1.cpp9423
-rw-r--r--engines/mads/phantom/phantom_scenes1.h338
-rw-r--r--engines/mads/phantom/phantom_scenes2.cpp7001
-rw-r--r--engines/mads/phantom/phantom_scenes2.h307
-rw-r--r--engines/mads/phantom/phantom_scenes3.cpp2767
-rw-r--r--engines/mads/phantom/phantom_scenes3.h248
-rw-r--r--engines/mads/phantom/phantom_scenes4.cpp4975
-rw-r--r--engines/mads/phantom/phantom_scenes4.h265
-rw-r--r--engines/mads/phantom/phantom_scenes5.cpp4308
-rw-r--r--engines/mads/phantom/phantom_scenes5.h219
-rw-r--r--engines/mads/player.cpp53
-rw-r--r--engines/mads/player.h13
-rw-r--r--engines/mads/rails.cpp14
-rw-r--r--engines/mads/rails.h4
-rw-r--r--engines/mads/resources.cpp6
-rw-r--r--engines/mads/scene.cpp190
-rw-r--r--engines/mads/scene.h24
-rw-r--r--engines/mads/scene_data.cpp89
-rw-r--r--engines/mads/screen.cpp15
-rw-r--r--engines/mads/sequence.cpp24
-rw-r--r--engines/mads/sequence.h5
-rw-r--r--engines/mads/sound.cpp2
-rw-r--r--engines/mads/sound.h2
-rw-r--r--engines/mads/user_interface.cpp2
-rw-r--r--engines/mads/user_interface.h4
-rw-r--r--engines/mohawk/myst_stacks/myst.cpp8
-rw-r--r--engines/mortevielle/utils.cpp4
-rw-r--r--engines/neverhood/resourceman.cpp22
-rw-r--r--engines/prince/graphics.cpp18
-rw-r--r--engines/sci/detection_tables.h49
-rw-r--r--engines/sci/graphics/text16.cpp56
-rw-r--r--engines/sci/sci.cpp84
-rw-r--r--engines/scumm/dialogs.cpp2
-rw-r--r--engines/scumm/he/logic/puttrace.cpp2
-rw-r--r--engines/scumm/players/player_towns.cpp69
-rw-r--r--engines/scumm/players/player_towns.h4
-rw-r--r--engines/scumm/players/player_v2.cpp2
-rw-r--r--engines/sherlock/configure.engine2
-rw-r--r--engines/sherlock/decompress.cpp128
-rw-r--r--engines/sherlock/detection_tables.h22
-rw-r--r--engines/sherlock/journal.cpp11
-rw-r--r--engines/sherlock/music.cpp1
-rw-r--r--engines/sherlock/objects.cpp2
-rw-r--r--engines/sherlock/scalpel/scalpel_debugger.cpp2
-rw-r--r--engines/sherlock/scalpel/scalpel_saveload.cpp3
-rw-r--r--engines/sherlock/scalpel/tsage/logo.cpp1
-rw-r--r--engines/sherlock/talk.cpp4
-rw-r--r--engines/sherlock/tattoo/tattoo_darts.cpp1
-rw-r--r--engines/sherlock/tattoo/tattoo_fixed_text.cpp4
-rw-r--r--engines/sherlock/tattoo/widget_base.cpp1
-rw-r--r--engines/sherlock/tattoo/widget_files.cpp20
-rw-r--r--engines/sword25/configure.engine2
-rw-r--r--engines/sword25/detection_tables.h35
-rw-r--r--engines/sword25/gfx/animation.cpp4
-rw-r--r--engines/sword25/gfx/graphicengine.cpp36
-rw-r--r--engines/sword25/gfx/graphicengine.h2
-rw-r--r--engines/sword25/gfx/image/imgloader.cpp29
-rw-r--r--engines/sword25/gfx/image/imgloader.h19
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp16
-rw-r--r--engines/sword25/gfx/image/renderedimage.h3
-rw-r--r--engines/sword25/gfx/image/swimage.cpp19
-rw-r--r--engines/sword25/gfx/image/swimage.h9
-rw-r--r--engines/sword25/gfx/image/vectorimage.cpp14
-rw-r--r--engines/sword25/gfx/image/vectorimage.h1
-rw-r--r--engines/sword25/gfx/image/vectorimagerenderer.cpp3
-rw-r--r--engines/sword25/gfx/panel.cpp2
-rw-r--r--engines/sword25/gfx/screenshot.cpp34
-rw-r--r--engines/sword25/gfx/staticbitmap.cpp4
-rw-r--r--engines/sword25/gfx/text.cpp36
-rw-r--r--engines/sword25/math/polygon.cpp2
-rw-r--r--engines/sword25/sword25.cpp2
-rw-r--r--engines/sword25/util/lua/scummvm_file.cpp4
-rw-r--r--engines/testbed/testbed.cpp3
-rw-r--r--engines/testbed/testsuite.cpp3
-rw-r--r--engines/tinsel/tinsel.cpp2
-rw-r--r--engines/tony/detection_tables.h22
-rw-r--r--engines/voyeur/voyeur.cpp2
-rw-r--r--engines/wintermute/ad/ad_game.cpp2
-rw-r--r--engines/wintermute/base/base_keyboard_state.cpp46
-rw-r--r--engines/wintermute/base/file/base_save_thumb_file.cpp3
-rw-r--r--engines/wintermute/base/font/base_font_truetype.cpp4
-rw-r--r--engines/wintermute/detection_tables.h29
-rw-r--r--engines/wintermute/utils/convert_utf.cpp6
-rw-r--r--engines/wintermute/utils/convert_utf.h3
-rw-r--r--engines/zvision/text/truetype_font.cpp2
-rw-r--r--graphics/fonts/ttf.cpp144
-rw-r--r--graphics/fonts/ttf.h24
-rw-r--r--graphics/module.mk1
-rw-r--r--graphics/pixelformat.cpp64
-rw-r--r--graphics/pixelformat.h3
-rw-r--r--graphics/transparent_surface.cpp6
-rw-r--r--graphics/transparent_surface.h38
-rw-r--r--gui/ThemeEngine.cpp7
-rw-r--r--gui/credits.h19
-rw-r--r--gui/themes/translations.datbin471949 -> 477983 bytes
-rw-r--r--image/codecs/msvideo1.cpp100
-rw-r--r--image/codecs/msvideo1.h4
-rw-r--r--po/be_BY.po129
-rw-r--r--po/ca_ES.po129
-rw-r--r--po/cs_CZ.po129
-rw-r--r--po/da_DA.po129
-rw-r--r--po/de_DE.po134
-rw-r--r--po/es_ES.po129
-rw-r--r--po/eu.po129
-rw-r--r--po/fi_FI.po129
-rw-r--r--po/fr_FR.po129
-rw-r--r--po/gl_ES.po129
-rw-r--r--po/hu_HU.po307
-rw-r--r--po/it_IT.po129
-rw-r--r--po/nb_NO.po129
-rw-r--r--po/nl_NL.po129
-rw-r--r--po/nn_NO.po129
-rw-r--r--po/pl_PL.po129
-rw-r--r--po/pt_BR.po129
-rw-r--r--po/ru_RU.po148
-rw-r--r--po/scummvm.pot128
-rw-r--r--po/se_SE.po129
-rw-r--r--po/uk_UA.po144
-rw-r--r--ports.mk16
-rw-r--r--test/common/algorithm.h18
345 files changed, 53874 insertions, 7134 deletions
diff --git a/AUTHORS b/AUTHORS
index e2cad187fe..f5d62c2e14 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -62,10 +62,17 @@ ScummVM Team
Oliver Kiehl - (retired)
Ludvig Strigeus - (retired)
+ Access:
+ Arnaud Boutonne
+ Paul Gilbert
+
Avalanche:
Peter Bozso
Arnaud Boutonne
+ BBVS:
+ Benjamin Haisch
+
CGE:
Arnaud Boutonne
Paul Gilbert
@@ -194,6 +201,10 @@ ScummVM Team
Jordi Vilalta Prat
Lars Skovlund
+ Sherlock:
+ Paul Gilbert
+ Martin Kiewitz
+
Sky:
Robert Goeffringmann - (retired)
Oliver Kiehl - (retired)
@@ -327,6 +338,9 @@ ScummVM Team
Wii:
Andre Heider
+ Raspberry Pi:
+ Manuel Alfayate
+
Other subsystems
----------------
Infrastructure:
@@ -719,3 +733,11 @@ Special thanks to
Bob Bell, Michel Kripalani, Tommy Yune, from Presto Studios for providing
the source code of The Journeyman Project: Pegasus Prime.
+ Electronic Arts IP Preservation Team, particularly Stefan Serbicki, and
+ Vasyl Tsvirkunov of Electronic Arts for providing the source code of the
+ two Lost Files of Sherlock Holmes games. James M. Ferguson and Barry
+ Duncan for their tenacious efforts to recover the sources.
+
+ The mindFactory team for writing Broken Sword 2.5, a splendid fan-made
+ sequel, and for sharing the source code with us.
+
diff --git a/Makefile.common b/Makefile.common
index 993b833f4e..df24d397de 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -246,6 +246,9 @@ DIST_FILES_THEMES:=$(addprefix $(srcdir)/gui/themes/,$(DIST_FILES_THEMES))
# Engine data files
DIST_FILES_ENGINEDATA=
+ifdef ENABLE_ACCESS
+DIST_FILES_ENGINEDATA+=access.dat
+endif
ifdef ENABLE_DRASCULA
DIST_FILES_ENGINEDATA+=drascula.dat
endif
diff --git a/NEWS b/NEWS
index 765329a1f5..47a72daf21 100644
--- a/NEWS
+++ b/NEWS
@@ -7,7 +7,13 @@ For a more comprehensive changelog of the latest experimental code, see:
- Added support for Sfinx.
- Added support for Zork Nemesis: The Forbidden Lands.
- Added support for Zork: Grand Inquisitor.
+ - Added support for The Lost Files of Sherlock Holmes: The Case of the Serrated Scalpel.
+ - Added support for The Lost Files of Sherlock Holmes: The Case of the Rose Tattoo.
- Added support for Beavis and Butthead in Virtual Stupidity.
+ - Added support for Amazon: Guardians of Eden.
+
+ New Ports:
+ - Added Raspberry Pi port.
General:
- Updated Munt MT-32 emulation code to version 1.5.0.
diff --git a/README b/README
index 2a1d7c390e..a34856c81e 100644
--- a/README
+++ b/README
@@ -160,7 +160,7 @@ reproducible, and still occurs in the latest git/Daily build version.
Also check the known problems list (below) and the compatibility list
on our website for that game, to ensure the issue is not already known:
- http://www.scummvm.org/compatibility_stable.php
+ http://scummvm.org/compatibility/
Please do not report bugs on games that are not listed as being
completeable in the 'Supported Games' section, or compatibility list. We
@@ -2434,7 +2434,7 @@ currently we have only x86 MMX optimized versions, and they will not
compile on other processors.
On Win9x/NT/XP, you can define USE_WINDBG and attach WinDbg to browse
-debug messages (see http://www.sysinternals.com/ntw2k/freeware/debugview.shtml).
+debug messages (see https://technet.microsoft.com/en-us/sysinternals/debugview.aspx).
GCC and MinGW32:
diff --git a/audio/rate.cpp b/audio/rate.cpp
index 19d9c8c61e..6264465e19 100644
--- a/audio/rate.cpp
+++ b/audio/rate.cpp
@@ -46,6 +46,16 @@ namespace Audio {
*/
#define INTERMEDIATE_BUFFER_SIZE 512
+/**
+ * The default fractional type in frac.h (with 16 fractional bits) limits
+ * the rate conversion code to 65536Hz audio: we need to able to handle
+ * 96kHz audio, so we use fewer fractional bits in this code.
+ */
+enum {
+ FRAC_BITS_LOW = 15,
+ FRAC_ONE_LOW = (1L << FRAC_BITS_LOW),
+ FRAC_HALF_LOW = (1L << (FRAC_BITS_LOW-1))
+};
/**
* Audio rate converter based on simple resampling. Used when no
@@ -187,18 +197,18 @@ public:
*/
template<bool stereo, bool reverseStereo>
LinearRateConverter<stereo, reverseStereo>::LinearRateConverter(st_rate_t inrate, st_rate_t outrate) {
- if (inrate >= 65536 || outrate >= 65536) {
- error("rate effect can only handle rates < 65536");
+ if (inrate >= 131072 || outrate >= 131072) {
+ error("rate effect can only handle rates < 131072");
}
- opos = FRAC_ONE;
+ opos = FRAC_ONE_LOW;
// Compute the linear interpolation increment.
- // This will overflow if inrate >= 2^16, and underflow if outrate >= 2^16.
+ // This will overflow if inrate >= 2^17, and underflow if outrate >= 2^17.
// Also, if the quotient of the two rate becomes too small / too big, that
// would cause problems, but since we rarely scale from 1 to 65536 Hz or vice
// versa, I think we can live with that limitation ;-).
- opos_inc = (inrate << FRAC_BITS) / outrate;
+ opos_inc = (inrate << FRAC_BITS_LOW) / outrate;
ilast0 = ilast1 = 0;
icur0 = icur1 = 0;
@@ -220,7 +230,7 @@ int LinearRateConverter<stereo, reverseStereo>::flow(AudioStream &input, st_samp
while (obuf < oend) {
// read enough input samples so that opos < 0
- while ((frac_t)FRAC_ONE <= opos) {
+ while ((frac_t)FRAC_ONE_LOW <= opos) {
// Check if we have to refill the buffer
if (inLen == 0) {
inPtr = inBuf;
@@ -235,17 +245,17 @@ int LinearRateConverter<stereo, reverseStereo>::flow(AudioStream &input, st_samp
ilast1 = icur1;
icur1 = *inPtr++;
}
- opos -= FRAC_ONE;
+ opos -= FRAC_ONE_LOW;
}
// Loop as long as the outpos trails behind, and as long as there is
// still space in the output buffer.
- while (opos < (frac_t)FRAC_ONE && obuf < oend) {
+ while (opos < (frac_t)FRAC_ONE_LOW && obuf < oend) {
// interpolate
st_sample_t out0, out1;
- out0 = (st_sample_t)(ilast0 + (((icur0 - ilast0) * opos + FRAC_HALF) >> FRAC_BITS));
+ out0 = (st_sample_t)(ilast0 + (((icur0 - ilast0) * opos + FRAC_HALF_LOW) >> FRAC_BITS_LOW));
out1 = (stereo ?
- (st_sample_t)(ilast1 + (((icur1 - ilast1) * opos + FRAC_HALF) >> FRAC_BITS)) :
+ (st_sample_t)(ilast1 + (((icur1 - ilast1) * opos + FRAC_HALF_LOW) >> FRAC_BITS_LOW)) :
out0);
// output left channel
@@ -333,7 +343,7 @@ public:
template<bool stereo, bool reverseStereo>
RateConverter *makeRateConverter(st_rate_t inrate, st_rate_t outrate) {
if (inrate != outrate) {
- if ((inrate % outrate) == 0) {
+ if ((inrate % outrate) == 0 && (inrate < 65536)) {
return new SimpleRateConverter<stereo, reverseStereo>(inrate, outrate);
} else {
return new LinearRateConverter<stereo, reverseStereo>(inrate, outrate);
diff --git a/audio/rate_arm.cpp b/audio/rate_arm.cpp
index 4ad8d71a34..7765266673 100644
--- a/audio/rate_arm.cpp
+++ b/audio/rate_arm.cpp
@@ -68,6 +68,16 @@ namespace Audio {
*/
#define INTERMEDIATE_BUFFER_SIZE 512
+/**
+ * The default fractional type in frac.h (with 16 fractional bits) limits
+ * the rate conversion code to 65536Hz audio: we need to able to handle
+ * 96kHz audio, so we use fewer fractional bits in this code.
+ */
+enum {
+ FRAC_BITS_LOW = 15,
+ FRAC_ONE_LOW = (1L << FRAC_BITS_LOW),
+ FRAC_HALF_LOW = (1L << (FRAC_BITS_LOW-1))
+};
/**
* Audio rate converter based on simple resampling. Used when no
@@ -287,17 +297,18 @@ LinearRateConverter<stereo, reverseStereo>::LinearRateConverter(st_rate_t inrate
error("Input and Output rates must be different to use rate effect");
}
- if (inrate >= 65536 || outrate >= 65536) {
- error("rate effect can only handle rates < 65536");
+ if (inrate >= 131072 || outrate >= 131072) {
+ error("rate effect can only handle rates < 131072");
}
- lr.opos = FRAC_ONE;
+ lr.opos = FRAC_ONE_LOW;
/* increment */
- incr = (inrate << FRAC_BITS) / outrate;
+ incr = (inrate << FRAC_BITS_LOW) / outrate;
lr.opos_inc = incr;
+ // FIXME: Does 32768 here need changing to 65536 or 0? Compare to rate.cpp code...
lr.ilast[0] = lr.ilast[1] = 32768;
lr.icur[0] = lr.icur[1] = 0;
@@ -438,7 +449,7 @@ public:
*/
RateConverter *makeRateConverter(st_rate_t inrate, st_rate_t outrate, bool stereo, bool reverseStereo) {
if (inrate != outrate) {
- if ((inrate % outrate) == 0) {
+ if ((inrate % outrate) == 0 && (inrate < 65536)) {
if (stereo) {
if (reverseStereo)
return new SimpleRateConverter<true, true>(inrate, outrate);
diff --git a/audio/rate_arm_asm.s b/audio/rate_arm_asm.s
index a727209d39..bb01c614c2 100644
--- a/audio/rate_arm_asm.s
+++ b/audio/rate_arm_asm.s
@@ -441,17 +441,17 @@ LinearRate_M_part2:
LDRSH r4, [r3] @ r4 = obuf[0]
LDRSH r5, [r3,#2] @ r5 = obuf[1]
- MOV r6, r6, ASR #16 @ r6 = tmp0 = tmp1 >>= 16
+ MOV r6, r6, ASR #15 @ r6 = tmp0 = tmp1 >>= 15
MUL r7, r12,r6 @ r7 = tmp0*vol_l
MUL r6, r14,r6 @ r6 = tmp1*vol_r
- ADDS r7, r7, r4, LSL #16 @ r7 = obuf[0]<<16 + tmp0*vol_l
+ ADDS r7, r7, r4, LSL #15 @ r7 = obuf[0]<<15 + tmp0*vol_l
RSCVS r7, r10, #0x80000000 @ Clamp r7
- ADDS r6, r6, r5, LSL #16 @ r6 = obuf[1]<<16 + tmp1*vol_r
+ ADDS r6, r6, r5, LSL #15 @ r6 = obuf[1]<<15 + tmp1*vol_r
RSCVS r6, r10, #0x80000000 @ Clamp r6
- MOV r7, r7, LSR #16 @ Shift back to halfword
- MOV r6, r6, LSR #16 @ Shift back to halfword
+ MOV r7, r7, LSR #15 @ Shift back to halfword
+ MOV r6, r6, LSR #15 @ Shift back to halfword
LDR r5, [r2,#12] @ r5 = opos_inc
STRH r7, [r3],#2 @ Store output value
@@ -538,23 +538,23 @@ LinearRate_S_part2:
LDR r7, [r2,#24] @ r7 = ilast[1]<<16 + 32768
LDRSH r5, [r2,#18] @ r5 = icur[1]
LDRSH r10,[r3] @ r10= obuf[0]
- MOV r6, r6, ASR #16 @ r6 = tmp1 >>= 16
+ MOV r6, r6, ASR #15 @ r6 = tmp1 >>= 15
SUB r5, r5, r7, ASR #16 @ r5 = icur[1] - ilast[1]
MLA r7, r4, r5, r7 @ r7 = (icur[1]-ilast[1])*opos_frac+ilast[1]
LDRSH r5, [r3,#2] @ r5 = obuf[1]
- MOV r7, r7, ASR #16 @ r7 = tmp0 >>= 16
+ MOV r7, r7, ASR #15 @ r7 = tmp0 >>= 15
MUL r7, r12,r7 @ r7 = tmp0*vol_l
MUL r6, r14,r6 @ r6 = tmp1*vol_r
- ADDS r7, r7, r10, LSL #16 @ r7 = obuf[0]<<16 + tmp0*vol_l
+ ADDS r7, r7, r10, LSL #15 @ r7 = obuf[0]<<15 + tmp0*vol_l
MOV r4, #0
RSCVS r7, r4, #0x80000000 @ Clamp r7
- ADDS r6, r6, r5, LSL #16 @ r6 = obuf[1]<<16 + tmp1*vol_r
+ ADDS r6, r6, r5, LSL #15 @ r6 = obuf[1]<<15 + tmp1*vol_r
RSCVS r6, r4, #0x80000000 @ Clamp r6
- MOV r7, r7, LSR #16 @ Shift back to halfword
- MOV r6, r6, LSR #16 @ Shift back to halfword
+ MOV r7, r7, LSR #15 @ Shift back to halfword
+ MOV r6, r6, LSR #15 @ Shift back to halfword
LDR r5, [r2,#12] @ r5 = opos_inc
STRH r7, [r3],#2 @ Store output value
@@ -641,23 +641,23 @@ LinearRate_R_part2:
LDR r7, [r2,#24] @ r7 = ilast[1]<<16 + 32768
LDRSH r5, [r2,#18] @ r5 = icur[1]
LDRSH r10,[r3,#2] @ r10= obuf[1]
- MOV r6, r6, ASR #16 @ r6 = tmp1 >>= 16
+ MOV r6, r6, ASR #15 @ r6 = tmp1 >>= 15
SUB r5, r5, r7, ASR #16 @ r5 = icur[1] - ilast[1]
MLA r7, r4, r5, r7 @ r7 = (icur[1]-ilast[1])*opos_frac+ilast[1]
LDRSH r5, [r3] @ r5 = obuf[0]
- MOV r7, r7, ASR #16 @ r7 = tmp0 >>= 16
+ MOV r7, r7, ASR #15 @ r7 = tmp0 >>= 15
MUL r7, r12,r7 @ r7 = tmp0*vol_l
MUL r6, r14,r6 @ r6 = tmp1*vol_r
- ADDS r7, r7, r10, LSL #16 @ r7 = obuf[1]<<16 + tmp0*vol_l
+ ADDS r7, r7, r10, LSL #15 @ r7 = obuf[1]<<15 + tmp0*vol_l
MOV r4, #0
RSCVS r7, r4, #0x80000000 @ Clamp r7
- ADDS r6, r6, r5, LSL #16 @ r6 = obuf[0]<<16 + tmp1*vol_r
+ ADDS r6, r6, r5, LSL #15 @ r6 = obuf[0]<<15 + tmp1*vol_r
RSCVS r6, r4, #0x80000000 @ Clamp r6
- MOV r7, r7, LSR #16 @ Shift back to halfword
- MOV r6, r6, LSR #16 @ Shift back to halfword
+ MOV r7, r7, LSR #15 @ Shift back to halfword
+ MOV r6, r6, LSR #15 @ Shift back to halfword
LDR r5, [r2,#12] @ r5 = opos_inc
STRH r6, [r3],#2 @ Store output value
diff --git a/audio/softsynth/fmtowns_pc98/towns_audio.cpp b/audio/softsynth/fmtowns_pc98/towns_audio.cpp
index 7fa55ef6c1..9db45bd8aa 100644
--- a/audio/softsynth/fmtowns_pc98/towns_audio.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_audio.cpp
@@ -83,7 +83,7 @@ public:
bool _activeOutput;
private:
- void setupLoop(uint32 loopStart, uint32 len);
+ void setupLoop(uint32 loopStart, uint32 loopLen);
void setNote(uint8 note, TownsAudio_WaveTable *w, bool stepLimit = false);
void setVelo(uint8 velo);
@@ -104,10 +104,10 @@ private:
uint8 _panRight;
int8 *_data;
- int8 *_dataEnd;
- int8 *_loopEnd;
+ uint32 _loopStart;
uint32 _loopLen;
+ uint32 _dataEnd;
uint16 _stepNote;
uint16 _stepPitch;
@@ -1571,7 +1571,7 @@ void TownsAudio_PcmChannel::clear() {
_loopLen = 0;
_pos = 0;
- _loopEnd = 0;
+ _loopStart = 0;
_step = 0;
_stepNote = 0x4000;
@@ -1592,7 +1592,8 @@ void TownsAudio_PcmChannel::clear() {
void TownsAudio_PcmChannel::loadData(TownsAudio_WaveTable *w) {
_data = w->data;
- _dataEnd = w->data + w->size;
+ _dataEnd = w->size << 11;
+ _pos = 0;
}
void TownsAudio_PcmChannel::loadData(uint8 *buffer, uint32 size) {
@@ -1604,7 +1605,7 @@ void TownsAudio_PcmChannel::loadData(uint8 *buffer, uint32 size) {
*dst++ = *src & 0x80 ? (*src++ & 0x7f) : -*src++;
_data = _extData;
- _dataEnd = _extData + size;
+ _dataEnd = size << 11;
_pos = 0;
}
@@ -1643,7 +1644,7 @@ int TownsAudio_PcmChannel::initInstrument(uint8 &note, TownsAudio_WaveTable *&ta
}
void TownsAudio_PcmChannel::keyOn(uint8 note, uint8 velo, TownsAudio_WaveTable *w) {
- setupLoop(w->loopStart, w->loopLen);
+ setupLoop(w->loopLen ? w->loopStart : w->size, w->loopLen);
setNote(note, w, _reserved);
setVelo(velo);
@@ -1744,9 +1745,10 @@ void TownsAudio_PcmChannel::updateOutput() {
if (_activeKey || _activeEffect) {
_pos += _step;
- if (&_data[_pos >> 11] >= _loopEnd) {
- if (_loopLen) {
- _pos -= _loopLen;
+ if (_pos >= _dataEnd) {
+ if (_loopStart != _dataEnd) {
+ _pos = _loopStart;
+ _dataEnd = _loopLen;
} else {
_pos = 0;
_activeKey = _activeEffect = false;
@@ -1763,10 +1765,9 @@ int32 TownsAudio_PcmChannel::currentSampleRight() {
return (_activeOutput && _panRight) ? (((_data[_pos >> 11] * _tl) * _panRight) >> 3) : 0;
}
-void TownsAudio_PcmChannel::setupLoop(uint32 loopStart, uint32 len) {
- _loopLen = len << 11;
- _loopEnd = _loopLen ? &_data[(loopStart + _loopLen) >> 11] : _dataEnd;
- _pos = loopStart;
+void TownsAudio_PcmChannel::setupLoop(uint32 loopStart, uint32 loopLen) {
+ _loopStart = loopStart << 11;
+ _loopLen = loopLen << 11;
}
void TownsAudio_PcmChannel::setNote(uint8 note, TownsAudio_WaveTable *w, bool stepLimit) {
diff --git a/audio/softsynth/fmtowns_pc98/towns_euphony.cpp b/audio/softsynth/fmtowns_pc98/towns_euphony.cpp
index fca3d19912..aea714f68f 100644
--- a/audio/softsynth/fmtowns_pc98/towns_euphony.cpp
+++ b/audio/softsynth/fmtowns_pc98/towns_euphony.cpp
@@ -25,283 +25,167 @@
#include "common/util.h"
#include "common/textconsole.h"
-TownsEuphonyDriver::TownsEuphonyDriver(Audio::Mixer *mixer) : _activeChannels(0), _sustainChannels(0),
- _assignedChannels(0), _paraCount(0), _command(0), _tEnable(0), _tMode(0), _tOrdr(0), _tLevel(0),
- _tTranspose(0), _musicPos(0), _musicStart(0), _playing(false), _eventBuffer(0), _bufferedEventsCount(0),
- _tempoControlMode(0), _timerSetting(0), _tempoDiff(0), _timeStampBase(0), _elapsedEvents(0), _loop(false),
- _endOfTrack(false), _suspendParsing(false), _musicTrackSize(0) {
- _para[0] = _para[1] = 0;
- _intf = new TownsAudioInterface(mixer, this);
+EuphonyPlayer::EuphonyPlayer(Audio::Mixer *mixer) : _partConfig_enable(0), _partConfig_type(0), _partConfig_ordr(0), _partConfig_volume(0),
+ _partConfig_transpose(0), _musicPos(0), _musicStart(0), _playing(false), _savedEventsChain(0),
+ _tempoControlMode(0), _timerSetting(0), _tempoMode1PulseCounter(0), _parseToBar(0), _tempoMode1UpdateF8(0), _loop(false),
+ _endOfTrack(false), _paused(false), _musicTrackSize(0) {
+ _drivers[0] = _eupDriver = new EuphonyDriver(mixer, this);
+ _drivers[1] = new Type0Driver(this);
+ _drivers[2] = 0;
resetTempo();
}
-TownsEuphonyDriver::~TownsEuphonyDriver() {
- delete _intf;
- delete[] _activeChannels;
- delete[] _sustainChannels;
- delete[] _assignedChannels;
- delete[] _eventBuffer;
- delete[] _tEnable;
- delete[] _tMode;
- delete[] _tOrdr;
- delete[] _tLevel;
- delete[] _tTranspose;
-}
-
-bool TownsEuphonyDriver::init() {
- if (!_intf->init())
- return false;
+EuphonyPlayer::~EuphonyPlayer() {
+ for (int i = 0; i < 3; i++)
+ delete _drivers[i];
- delete[] _activeChannels;
- delete[] _sustainChannels;
- delete[] _assignedChannels;
- delete[] _eventBuffer;
- delete[] _tEnable;
- delete[] _tMode;
- delete[] _tOrdr;
- delete[] _tLevel;
- delete[] _tTranspose;
-
- _activeChannels = new int8[16];
- _sustainChannels = new int8[16];
- _assignedChannels = new ActiveChannel[128];
- _eventBuffer = new DlEvent[64];
-
- _tEnable = new uint8[32];
- _tMode = new uint8[32];
- _tOrdr = new uint8[32];
- _tLevel = new int8[32];
- _tTranspose = new int8[32];
-
- reset();
+ while (_savedEventsChain) {
+ SavedEvent *evt = _savedEventsChain;
+ _savedEventsChain = _savedEventsChain->next;
+ delete evt;
+ }
- return true;
+ delete[] _partConfig_enable;
+ delete[] _partConfig_type;
+ delete[] _partConfig_ordr;
+ delete[] _partConfig_volume;
+ delete[] _partConfig_transpose;
}
-void TownsEuphonyDriver::reset() {
- _intf->callback(0);
-
- _intf->callback(74);
- _intf->callback(70, 0);
- _intf->callback(75, 3);
-
- setTimerA(true, 1);
- setTimerA(false, 1);
- setTimerB(true, 221);
-
- _paraCount = _command = _para[0] = _para[1] = 0;
- memset(_sustainChannels, 0, 16);
- memset(_activeChannels, -1, 16);
- for (int i = 0; i < 128; i++) {
- _assignedChannels[i].chan = _assignedChannels[i].next = -1;
- _assignedChannels[i].note = _assignedChannels[i].sub = 0;
+bool EuphonyPlayer::init() {
+ for (int i = 0; i < 3; i++) {
+ if (_drivers[i]) {
+ if (!_drivers[i]->init()) {
+ warning("EuphonyPlayer:: Driver initialization failed: %d", i);
+ delete _drivers[i];
+ _drivers[i] = 0;
+ }
+ }
}
+
+ if (!_drivers[0] || !_drivers[1])
+ return false;
- int e = 0;
- for (int i = 0; i < 6; i++)
- assignChannel(i, e++);
- for (int i = 0x40; i < 0x48; i++)
- assignChannel(i, e++);
-
- resetTables();
-
- memset(_eventBuffer, 0, 64 * sizeof(DlEvent));
- _bufferedEventsCount = 0;
-
- _playing = _endOfTrack = _suspendParsing = _loop = false;
- _elapsedEvents = 0;
- _tempoDiff = 0;
-
- resetTempo();
-
- if (_tempoControlMode == 1) {
- //if (///)
- // return;
- setTempoIntern(_defaultTempo);
- } else {
- setTempoIntern(_defaultTempo);
+ while (_savedEventsChain) {
+ SavedEvent *evt = _savedEventsChain;
+ _savedEventsChain = _savedEventsChain->next;
+ delete evt;
}
- resetControl();
-}
+ delete[] _partConfig_enable;
+ delete[] _partConfig_type;
+ delete[] _partConfig_ordr;
+ delete[] _partConfig_volume;
+ delete[] _partConfig_transpose;
-void TownsEuphonyDriver::loadInstrument(int chanType, int id, const uint8 *data) {
- _intf->callback(5, chanType, id, data);
-}
+ _partConfig_enable = new uint8[32];
+ _partConfig_type = new uint8[32];
+ _partConfig_ordr = new uint8[32];
+ _partConfig_volume = new int8[32];
+ _partConfig_transpose = new int8[32];
-void TownsEuphonyDriver::loadWaveTable(const uint8 *data) {
- _intf->callback(34, data);
-}
-
-void TownsEuphonyDriver::unloadWaveTable(int id) {
- _intf->callback(35, id);
-}
-
-void TownsEuphonyDriver::reserveSoundEffectChannels(int num) {
- _intf->callback(33, num);
- uint32 volMask = 0;
-
- if (num > 8)
- return;
-
- for (uint32 v = 1 << 13; num; num--) {
- volMask |= v;
- v >>= 1;
- }
-
- _intf->setSoundEffectChanMask(volMask);
-}
+ reset();
-int TownsEuphonyDriver::setMusicTempo(int tempo) {
- if (tempo > 250)
- return 3;
- _defaultTempo = tempo;
- _trackTempo = tempo;
- setTempoIntern(tempo);
- return 0;
+ return true;
}
-int TownsEuphonyDriver::startMusicTrack(const uint8 *data, int trackSize, int startTick) {
+int EuphonyPlayer::startTrack(const uint8 *data, int trackSize, int barLen) {
if (_playing)
return 2;
_musicPos = _musicStart = data;
- _defaultBaseTickLen = _baseTickLen = startTick;
+ _defaultBarLength = _barLength = barLen;
_musicTrackSize = trackSize;
- _timeStampBase = _timeStampDest = 0;
- _tickCounter = 0;
+ _parseToBar = _bar = 0;
+ _beat = 0;
_playing = true;
return 0;
}
-void TownsEuphonyDriver::setMusicLoop(bool loop) {
- _loop = loop;
-}
-
-void TownsEuphonyDriver::stopParser() {
+void EuphonyPlayer::stop() {
if (_playing) {
_playing = false;
- _pulseCount = 0;
+ _playerUpdatesLeft = 0;
_endOfTrack = false;
- flushEventBuffer();
- resetControl();
+ clearHangingNotes();
+ resetAllControls();
}
}
-void TownsEuphonyDriver::continueParsing() {
- _suspendParsing = false;
-}
-
-void TownsEuphonyDriver::playSoundEffect(int chan, int note, int velo, const uint8 *data) {
- _intf->callback(37, chan, note, velo, data);
-}
-
-void TownsEuphonyDriver::stopSoundEffect(int chan) {
- _intf->callback(39, chan);
-}
-
-bool TownsEuphonyDriver::soundEffectIsPlaying(int chan) {
- return _intf->callback(40, chan) ? true : false;
-}
-
-void TownsEuphonyDriver::chanPanPos(int chan, int mode) {
- _intf->callback(3, chan, mode);
-}
-
-void TownsEuphonyDriver::chanPitch(int chan, int pitch) {
- _intf->callback(7, chan, pitch);
+void EuphonyPlayer::pause() {
+ _paused = true;
+ clearHangingNotes();
+ allPartsOff();
}
-void TownsEuphonyDriver::chanVolume(int chan, int vol) {
- _intf->callback(8, chan, vol);
+void EuphonyPlayer::resume() {
+ _paused = false;
}
-void TownsEuphonyDriver::setOutputVolume(int mode, int volLeft, int volRight) {
- _intf->callback(67, mode, volLeft, volRight);
-}
-
-int TownsEuphonyDriver::configChan_enable(int tableEntry, int val) {
- if (tableEntry > 31)
+int EuphonyPlayer::setTempo(int tempo) {
+ if (tempo > 250)
return 3;
- _tEnable[tableEntry] = val;
+ _defaultTempo = tempo;
+ _trackTempo = tempo;
+ sendTempo(tempo);
return 0;
}
-int TownsEuphonyDriver::configChan_setMode(int tableEntry, int val) {
- if (tableEntry > 31)
+void EuphonyPlayer::setLoopStatus(bool loop) {
+ _loop = loop;
+}
+
+int EuphonyPlayer::configPart_enable(int part, int val) {
+ uint8 enable = val & 0xff;
+ if (part > 31 || ((enable + 1) & 0xff) > 1)
return 3;
- _tMode[tableEntry] = val;
+ _partConfig_enable[part] = enable;
return 0;
}
-int TownsEuphonyDriver::configChan_remap(int tableEntry, int val) {
- if (tableEntry > 31)
+int EuphonyPlayer::configPart_setType(int part, int val) {
+ uint8 type = val & 0xff;
+ if (part > 31 || ((type + 1) & 0xff) > 8)
return 3;
- if (val < 16)
- _tOrdr[tableEntry] = val;
+ _partConfig_type[part] = type;
return 0;
}
-int TownsEuphonyDriver::configChan_adjustVolume(int tableEntry, int val) {
- if (tableEntry > 31)
+int EuphonyPlayer::configPart_remap(int part, int val) {
+ uint8 remap = val & 0xff;
+ if (part > 31 || ((remap + 1) & 0xff) > 16)
return 3;
- if (val <= 40)
- _tLevel[tableEntry] = (int8)(val & 0xff);
+ _partConfig_ordr[part] = remap;
return 0;
}
-int TownsEuphonyDriver::configChan_setTranspose(int tableEntry, int val) {
- if (tableEntry > 31)
+int EuphonyPlayer::configPart_adjustVolume(int part, int val) {
+ int8 adjvol = val & 0xff;
+ if (part > 31 || adjvol < -40 || adjvol > 40)
return 3;
- if (val <= 40)
- _tTranspose[tableEntry] = (int8)(val & 0xff);
+ _partConfig_volume[part] = adjvol;
return 0;
}
-int TownsEuphonyDriver::assignChannel(int chan, int tableEntry) {
- if (tableEntry > 15 || chan > 127 || chan < 0)
+int EuphonyPlayer::configPart_setTranspose(int part, int val) {
+ int8 trans = val & 0xff;
+ if (part > 31 || trans < -40 || trans > 40)
return 3;
-
- ActiveChannel *a = &_assignedChannels[chan];
- if (a->chan == tableEntry)
- return 0;
-
- if (a->chan != -1) {
- int8 *b = &_activeChannels[a->chan];
- while (*b != chan) {
- b = &_assignedChannels[*b].next;
- if (*b == -1 && *b != chan)
- return 3;
- }
-
- *b = a->next;
-
- if (a->note)
- _intf->callback(2, chan);
-
- a->chan = a->next = -1;
- a->note = 0;
- }
-
- a->next = _activeChannels[tableEntry];
- _activeChannels[tableEntry] = chan;
- a->chan = tableEntry;
- a->note = a->sub = 0;
-
+ _partConfig_transpose[part] = trans;
return 0;
}
-void TownsEuphonyDriver::timerCallback(int timerId) {
+void EuphonyPlayer::timerCallback(int timerId) {
switch (timerId) {
case 0:
- updatePulseCount();
- while (_pulseCount > 0) {
- --_pulseCount;
- updateTimeStampBase();
+ updatePulseCounters();
+ while (_playerUpdatesLeft) {
+ --_playerUpdatesLeft;
+ updateBeat();
if (!_playing)
continue;
- updateEventBuffer();
+ updateHangingNotes();
updateParser();
updateCheckEot();
}
@@ -311,175 +195,156 @@ void TownsEuphonyDriver::timerCallback(int timerId) {
}
}
-void TownsEuphonyDriver::setMusicVolume(int volume) {
- _intf->setMusicVolume(volume);
-}
+void EuphonyPlayer::reset() {
+ _eupDriver->reset();
+ _eupDriver->setTimerA(true, 1);
+ _eupDriver->setTimerA(false, 1);
+ _eupDriver->setTimerB(true, 221);
-void TownsEuphonyDriver::setSoundEffectVolume(int volume) {
- _intf->setSoundEffectVolume(volume);
-}
-
-void TownsEuphonyDriver::resetTables() {
- memset(_tEnable, 0xff, 32);
- memset(_tMode, 0xff, 16);
- memset(_tMode + 16, 0, 16);
- for (int i = 0; i < 32; i++)
- _tOrdr[i] = i & 0x0f;
- memset(_tLevel, 0, 32);
- memset(_tTranspose, 0, 32);
-}
-
-void TownsEuphonyDriver::resetTempo() {
- _defaultBaseTickLen = _baseTickLen = 0x33;
- _pulseCount = 0;
- _extraTimingControlRemainder = 0;
- _extraTimingControl = 16;
- _tempoModifier = 0;
- _timeStampDest = 0;
- _deltaTicks = 0;
- _tickCounter = 0;
- _defaultTempo = 90;
- _trackTempo = 90;
-}
+ resetPartConfig();
-void TownsEuphonyDriver::setTempoIntern(int tempo) {
- tempo = CLIP(tempo + _tempoModifier, 0, 500);
- if (_tempoControlMode == 0) {
- _timerSetting = 34750 / (tempo + 30);
- _extraTimingControl = 16;
-
- while (_timerSetting < 126) {
- _timerSetting <<= 1;
- _extraTimingControl <<= 1;
- }
-
- while (_timerSetting > 383) {
- _timerSetting >>= 1;
- _extraTimingControl >>= 1;
- }
+ while (_savedEventsChain) {
+ SavedEvent *evt = _savedEventsChain;
+ _savedEventsChain = _savedEventsChain->next;
+ delete evt;
+ }
- setTimerA(true, -(_timerSetting - 2));
+ _playing = _endOfTrack = _paused = _loop = false;
+ _tempoMode1UpdateF8 = 0;
+ _tempoMode1PulseCounter = 0;
- } else if (_tempoControlMode == 1) {
- _timerSetting = 312500 / (tempo + 30);
- _extraTimingControl = 16;
- while (_timerSetting < 1105) {
- _timerSetting <<= 1;
- _extraTimingControl <<= 1;
- }
+ resetTempo();
- } else if (_tempoControlMode == 2) {
- _timerSetting = 625000 / (tempo + 30);
- _extraTimingControlRemainder = 0;
+ if (_tempoControlMode == 1) {
+ //if (///)
+ // return;
+ sendTempo(_defaultTempo);
+ } else {
+ sendTempo(_defaultTempo);
}
+
+ resetAllControls();
}
-void TownsEuphonyDriver::setTimerA(bool enable, int tempo) {
- _intf->callback(21, enable ? 255 : 0, tempo);
+void EuphonyPlayer::resetPartConfig() {
+ memset(_partConfig_enable, 0xff, 32);
+ memset(_partConfig_type, 0xff, 16);
+ memset(_partConfig_type + 16, 0, 16);
+ for (int i = 0; i < 32; i++)
+ _partConfig_ordr[i] = i & 0x0f;
+ memset(_partConfig_volume, 0, 32);
+ memset(_partConfig_transpose, 0, 32);
}
-void TownsEuphonyDriver::setTimerB(bool enable, int tempo) {
- _intf->callback(22, enable ? 255 : 0, tempo);
+void EuphonyPlayer::resetTempo() {
+ _defaultBarLength = _barLength = 0x33;
+ _playerUpdatesLeft = 0;
+ _updatesPerPulseRemainder = 0;
+ _updatesPerPulse = 0x10;
+ _tempoModifier = 0;
+ _bar = 0;
+ _deltaTicks = 0;
+ _beat = 0;
+ _defaultTempo = 90;
+ _trackTempo = 90;
}
-void TownsEuphonyDriver::updatePulseCount() {
- int tc = _extraTimingControl + _extraTimingControlRemainder;
- _extraTimingControlRemainder = tc & 0x0f;
+void EuphonyPlayer::updatePulseCounters() {
+ int tc = _updatesPerPulse + _updatesPerPulseRemainder;
+ _updatesPerPulseRemainder = tc & 0x0f;
tc >>= 4;
- _tempoDiff -= tc;
+ _tempoMode1PulseCounter -= tc;
- while (_tempoDiff < 0) {
- _elapsedEvents++;
- _tempoDiff += 4;
+ while (_tempoMode1PulseCounter < 0) {
+ _tempoMode1UpdateF8++;
+ _tempoMode1PulseCounter += 4;
}
- if (_playing && !_suspendParsing)
- _pulseCount += tc;
+ if (_playing && !_paused)
+ _playerUpdatesLeft += tc;
}
-void TownsEuphonyDriver::updateTimeStampBase() {
- static const uint16 table[] = { 0x180, 0xC0, 0x80, 0x60, 0x40, 0x30, 0x20, 0x18 };
- if ((uint32)(table[_baseTickLen >> 4] * ((_baseTickLen & 0x0f) + 1)) > ++_tickCounter)
+void EuphonyPlayer::updateBeat() {
+ static const uint16 beatLengthTable[] = { 0x180, 0xC0, 0x80, 0x60, 0x40, 0x30, 0x20, 0x18 };
+ uint8 beatsPersBar = (_barLength & 0x0f) + 1;
+ uint8 beatNoteValue = _barLength >> 4;
+
+ if ((uint32)(beatLengthTable[beatNoteValue] * beatsPersBar) > ++_beat)
return;
- ++_timeStampDest;
- _tickCounter = 0;
+
+ ++_bar;
+ _beat = 0;
_deltaTicks = 0;
}
-void TownsEuphonyDriver::updateParser() {
+void EuphonyPlayer::updateParser() {
for (bool loop = true; loop;) {
uint8 cmd = _musicPos[0];
if (cmd == 0xff || cmd == 0xf7) {
- jumpNextLoop();
+ proceedToNextEvent();
} else if (cmd < 0x90) {
_endOfTrack = true;
- flushEventBuffer();
+ clearHangingNotes();
loop = false;
- } else if (_timeStampBase > _timeStampDest) {
+ } else if (_parseToBar > _bar) {
loop = false;
} else {
- if (_timeStampBase == _timeStampDest) {
- uint16 timeStamp = READ_LE_UINT16(&_musicPos[2]);
- uint8 l = (timeStamp & 0xff) + (timeStamp & 0xff);
- timeStamp = ((timeStamp & 0xff00) | l) >> 1;
- if (timeStamp > _tickCounter)
+ if (_parseToBar == _bar) {
+ uint16 parseToBeat = ((_musicPos[3] << 8) | ((_musicPos[2] << 1) & 0xff)) >> 1;
+ if (parseToBeat > _beat)
loop = false;
}
if (loop) {
- if (parseNext())
+ if (parseEvent())
loop = false;
}
}
}
}
-void TownsEuphonyDriver::updateCheckEot() {
- if (!_endOfTrack || _bufferedEventsCount)
+void EuphonyPlayer::updateCheckEot() {
+ if (!_endOfTrack || _savedEventsChain)
return;
- stopParser();
-}
-
-bool TownsEuphonyDriver::parseNext() {
-#define OPC(x) &TownsEuphonyDriver::evt##x
- static const EuphonyOpcode opcodes[] = {
- OPC(NotImpl),
- OPC(SetupNote),
- OPC(PolyphonicAftertouch),
- OPC(ControlPitch),
- OPC(InstrumentChanAftertouch),
- OPC(InstrumentChanAftertouch),
- OPC(ControlPitch)
+ stop();
+}
+
+bool EuphonyPlayer::parseEvent() {
+#define EVENT(x) &EuphonyPlayer::event_##x
+ static const EuphonyEvent events[] = {
+ EVENT(notImpl),
+ EVENT(noteOn),
+ EVENT(polyphonicAftertouch),
+ EVENT(controlChange_pitchWheel),
+ EVENT(programChange_channelAftertouch),
+ EVENT(programChange_channelAftertouch),
+ EVENT(controlChange_pitchWheel),
+
+ EVENT(sysex),
+ EVENT(advanceBar),
+ EVENT(notImpl),
+ EVENT(notImpl),
+ EVENT(setTempo),
+ EVENT(notImpl),
+ EVENT(typeOrdrChange)
};
-#undef OPC
+#undef EVENT
uint cmd = _musicPos[0];
if (cmd != 0xfe && cmd != 0xfd) {
- if (cmd >= 0xf0) {
- cmd &= 0x0f;
- if (cmd == 0)
- evtLoadInstrument();
- else if (cmd == 2)
- evtAdvanceTimestampOffset();
- else if (cmd == 8)
- evtTempo();
- else if (cmd == 12)
- evtModeOrdrChange();
- jumpNextLoop();
- return false;
-
- } else if (!(this->*opcodes[(cmd - 0x80) >> 4])()) {
- jumpNextLoop();
+ bool result = (cmd >= 0xf0) ? (this->*events[((cmd - 0xf0) >> 1) + 7])() : (this->*events[(cmd - 0x80) >> 4])();
+ if (!result) {
+ proceedToNextEvent();
return false;
}
}
if (cmd == 0xfd) {
- _suspendParsing = true;
+ _paused = true;
return true;
}
@@ -490,299 +355,208 @@ bool TownsEuphonyDriver::parseNext() {
_endOfTrack = false;
_musicPos = _musicStart;
- _timeStampBase = _timeStampDest = _tickCounter = 0;
- _baseTickLen = _defaultBaseTickLen;
+ _parseToBar = _bar = _beat = 0;
+ _barLength = _defaultBarLength;
return false;
}
-void TownsEuphonyDriver::jumpNextLoop() {
+void EuphonyPlayer::proceedToNextEvent() {
_musicPos += 6;
if (_musicPos >= _musicStart + _musicTrackSize)
_musicPos = _musicStart;
}
-void TownsEuphonyDriver::updateEventBuffer() {
- DlEvent *e = _eventBuffer;
- for (int i = _bufferedEventsCount; i; e++) {
- if (e->evt == 0)
- continue;
+void EuphonyPlayer::updateHangingNotes() {
+ SavedEvent *l = 0;
+ SavedEvent *e = _savedEventsChain;
+
+ while (e) {
if (--e->len) {
- --i;
+ l = e;
+ e = e->next;
continue;
}
- processBufferNote(e->mode, e->evt, e->note, e->velo);
- e->evt = 0;
- --i;
- --_bufferedEventsCount;
- }
-}
-void TownsEuphonyDriver::flushEventBuffer() {
- DlEvent *e = _eventBuffer;
- for (int i = _bufferedEventsCount; i; e++) {
- if (e->evt == 0)
- continue;
- processBufferNote(e->mode, e->evt, e->note, e->velo);
- e->evt = 0;
- --i;
- --_bufferedEventsCount;
+ SavedEvent *n = e->next;
+ if (l)
+ l->next = n;
+ if (_savedEventsChain == e)
+ _savedEventsChain = n;
+
+ sendNoteEvent(e->type, e->evt, e->note, e->velo);
+ delete e;
+
+ e = n;
}
}
-void TownsEuphonyDriver::processBufferNote(int mode, int evt, int note, int velo) {
- if (!velo)
- evt &= 0x8f;
- sendEvent(mode, evt);
- sendEvent(mode, note);
- sendEvent(mode, velo);
+void EuphonyPlayer::clearHangingNotes() {
+ while (_savedEventsChain) {
+ SavedEvent *e = _savedEventsChain;
+ _savedEventsChain = _savedEventsChain->next;
+ sendNoteEvent(e->type, e->evt, e->note, e->velo);
+ delete e;
+ }
}
-void TownsEuphonyDriver::resetControl() {
+void EuphonyPlayer::resetAllControls() {
for (int i = 0; i < 32; i++) {
- if (_tOrdr[i] > 15) {
+ if (_partConfig_ordr[i] > 15) {
for (int ii = 0; ii < 16; ii++)
- resetControlIntern(_tMode[i], ii);
+ sendControllerReset(_partConfig_type[i], ii);
} else {
- resetControlIntern(_tMode[i], _tOrdr[i]);
+ sendControllerReset(_partConfig_type[i], _partConfig_ordr[i]);
}
}
}
-void TownsEuphonyDriver::resetControlIntern(int mode, int chan) {
- sendEvent(mode, 0xb0 | chan);
- sendEvent(mode, 0x40);
- sendEvent(mode, 0);
- sendEvent(mode, 0xb0 | chan);
- sendEvent(mode, 0x7b);
- sendEvent(mode, 0);
- sendEvent(mode, 0xb0 | chan);
- sendEvent(mode, 0x79);
- sendEvent(mode, 0x40);
+void EuphonyPlayer::allPartsOff() {
+ for (int i = 0; i < 32; i++) {
+ if (_partConfig_ordr[i] > 15) {
+ for (int ii = 0; ii < 16; ii++)
+ sendAllNotesOff(_partConfig_type[i], ii);
+ } else {
+ sendAllNotesOff(_partConfig_type[i], _partConfig_ordr[i]);
+ }
+ }
}
-uint8 TownsEuphonyDriver::appendEvent(uint8 evt, uint8 chan) {
- if (evt >= 0x80 && evt < 0xf0 && _tOrdr[chan] < 16)
- return (evt & 0xf0) | _tOrdr[chan];
+uint8 EuphonyPlayer::appendEvent(uint8 evt, uint8 chan) {
+ if (evt >= 0x80 && evt < 0xf0 && _partConfig_ordr[chan] < 16)
+ return (evt & 0xf0) | _partConfig_ordr[chan];
return evt;
}
-void TownsEuphonyDriver::sendEvent(uint8 mode, uint8 command) {
- if (mode == 0) {
- // warning("TownsEuphonyDriver: Mode 0 not implemented");
-
- } else if (mode == 0x10) {
- warning("TownsEuphonyDriver: Mode 0x10 not implemented");
-
- } else if (mode == 0xff) {
- if (command >= 0xf0) {
- _paraCount = 1;
- _command = 0;
- } else if (command >= 0x80) {
- _paraCount = 1;
- _command = command;
- } else if (_command >= 0x80) {
- switch ((_command - 0x80) >> 4) {
- case 0:
- if (_paraCount < 2) {
- _paraCount++;
- _para[0] = command;
- } else {
- _paraCount = 1;
- _para[1] = command;
- sendNoteOff();
- }
- break;
-
- case 1:
- if (_paraCount < 2) {
- _paraCount++;
- _para[0] = command;
- } else {
- _paraCount = 1;
- _para[1] = command;
- if (command)
- sendNoteOn();
- else
- sendNoteOff();
- }
- break;
-
- case 2:
- if (_paraCount < 2) {
- _paraCount++;
- _para[0] = command;
- } else {
- _paraCount = 1;
- }
- break;
-
- case 3:
- if (_paraCount < 2) {
- _paraCount++;
- _para[0] = command;
- } else {
- _paraCount = 1;
- _para[1] = command;
-
- if (_para[0] == 7)
- sendChanVolume();
- else if (_para[0] == 10)
- sendPanPosition();
- else if (_para[0] == 64)
- sendAllNotesOff();
- }
- break;
-
- case 4:
- _paraCount = 1;
- _para[0] = command;
- sendSetInstrument();
- break;
-
- case 5:
- _paraCount = 1;
- _para[0] = command;
- break;
-
- case 6:
- if (_paraCount < 2) {
- _paraCount++;
- _para[0] = command;
- } else {
- _paraCount = 1;
- _para[1] = command;
- sendPitch();
- }
- break;
- }
- }
- }
+bool EuphonyPlayer::event_notImpl() {
+ return false;
}
-bool TownsEuphonyDriver::evtSetupNote() {
+bool EuphonyPlayer::event_noteOn() {
if (_musicPos[1] > 31)
return false;
- if (!_tEnable[_musicPos[1]]) {
- jumpNextLoop();
+ if (!_partConfig_enable[_musicPos[1]]) {
+ proceedToNextEvent();
return (_musicPos[0] == 0xfe || _musicPos[0] == 0xfd) ? true : false;
}
uint8 evt = appendEvent(_musicPos[0], _musicPos[1]);
- uint8 mode = _tMode[_musicPos[1]];
+ uint8 type = _partConfig_type[_musicPos[1]];
uint8 note = _musicPos[4];
uint8 velo = _musicPos[5];
- sendEvent(mode, evt);
- sendEvent(mode, applyTranspose(note));
- sendEvent(mode, applyVolumeAdjust(velo));
+ sendEvent(type, evt);
+ sendEvent(type, applyTranspose(note));
+ sendEvent(type, applyVolumeAdjust(velo));
- jumpNextLoop();
+ proceedToNextEvent();
if (_musicPos[0] == 0xfe || _musicPos[0] == 0xfd)
return true;
velo = _musicPos[5];
- uint16 len = ((((_musicPos[1] << 4) | (_musicPos[2] << 8)) >> 4) & 0xff) | ((((_musicPos[3] << 4) | (_musicPos[4] << 8)) >> 4) << 8);
-
- int i = 0;
- for (; i < 64; i++) {
- if (_eventBuffer[i].evt == 0)
- break;
- }
+ uint16 len = (_musicPos[1] & 0x0f) | ((_musicPos[2] & 0x0f) << 4) | ((_musicPos[3] & 0x0f) << 8) | ((_musicPos[4] & 0x0f) << 12);
- if (i == 64) {
- processBufferNote(mode, evt, note, velo);
- } else {
- _eventBuffer[i].evt = evt;
- _eventBuffer[i].mode = mode;
- _eventBuffer[i].note = note;
- _eventBuffer[i].velo = velo;
- _eventBuffer[i].len = len ? len : 1;
- _bufferedEventsCount++;
- }
+ _savedEventsChain = new SavedEvent(evt, type, note, velo, len ? len : 1, _savedEventsChain);
return false;
}
-bool TownsEuphonyDriver::evtPolyphonicAftertouch() {
+bool EuphonyPlayer::event_polyphonicAftertouch() {
if (_musicPos[1] > 31)
return false;
- if (!_tEnable[_musicPos[1]])
+ if (!_partConfig_enable[_musicPos[1]])
return false;
uint8 evt = appendEvent(_musicPos[0], _musicPos[1]);
- uint8 mode = _tMode[_musicPos[1]];
+ uint8 type = _partConfig_type[_musicPos[1]];
- sendEvent(mode, evt);
- sendEvent(mode, applyTranspose(_musicPos[4]));
- sendEvent(mode, _musicPos[5]);
+ sendEvent(type, evt);
+ sendEvent(type, applyTranspose(_musicPos[4]));
+ sendEvent(type, _musicPos[5]);
return false;
}
-bool TownsEuphonyDriver::evtControlPitch() {
+bool EuphonyPlayer::event_controlChange_pitchWheel() {
if (_musicPos[1] > 31)
return false;
- if (!_tEnable[_musicPos[1]])
+ if (!_partConfig_enable[_musicPos[1]])
return false;
uint8 evt = appendEvent(_musicPos[0], _musicPos[1]);
- uint8 mode = _tMode[_musicPos[1]];
+ uint8 type = _partConfig_type[_musicPos[1]];
- sendEvent(mode, evt);
- sendEvent(mode, _musicPos[4]);
- sendEvent(mode, _musicPos[5]);
+ sendEvent(type, evt);
+ sendEvent(type, _musicPos[4]);
+ sendEvent(type, _musicPos[5]);
return false;
}
-bool TownsEuphonyDriver::evtInstrumentChanAftertouch() {
+bool EuphonyPlayer::event_programChange_channelAftertouch() {
if (_musicPos[1] > 31)
return false;
- if (!_tEnable[_musicPos[1]])
+ if (!_partConfig_enable[_musicPos[1]])
return false;
uint8 evt = appendEvent(_musicPos[0], _musicPos[1]);
- uint8 mode = _tMode[_musicPos[1]];
+ uint8 type = _partConfig_type[_musicPos[1]];
- sendEvent(mode, evt);
- sendEvent(mode, _musicPos[4]);
+ sendEvent(type, evt);
+ sendEvent(type, _musicPos[4]);
return false;
}
-bool TownsEuphonyDriver::evtLoadInstrument() {
+bool EuphonyPlayer::event_sysex() {
+ uint8 type = _partConfig_type[_musicPos[1]];
+ sendEvent(type, 0xF0);
+ proceedToNextEvent();
+
+ for (bool loop = true; loop; ) {
+ for (int i = 0; i < 6; i++) {
+ if (_musicPos[i] != 0xFF) {
+ sendEvent(type, _musicPos[i]);
+ if (_musicPos[i] >= 0x80) {
+ loop = false;
+ break;
+ }
+ }
+ }
+ if (loop)
+ proceedToNextEvent();
+ }
+
return false;
}
-bool TownsEuphonyDriver::evtAdvanceTimestampOffset() {
- ++_timeStampBase;
- _baseTickLen = _musicPos[1];
+bool EuphonyPlayer::event_advanceBar() {
+ ++_parseToBar;
+ _barLength = _musicPos[1];
return false;
}
-bool TownsEuphonyDriver::evtTempo() {
- uint8 l = _musicPos[4] << 1;
- _trackTempo = (l | (_musicPos[5] << 8)) >> 1;
- setTempoIntern(_trackTempo);
+bool EuphonyPlayer::event_setTempo() {
+ _trackTempo = ((_musicPos[5] << 8) | ((_musicPos[4] << 1) & 0xff)) >> 1;
+ sendTempo(_trackTempo);
return false;
}
-bool TownsEuphonyDriver::evtModeOrdrChange() {
+bool EuphonyPlayer::event_typeOrdrChange() {
if (_musicPos[1] > 31)
return false;
- if (!_tEnable[_musicPos[1]])
+ if (!_partConfig_enable[_musicPos[1]])
return false;
if (_musicPos[4] == 1)
- _tMode[_musicPos[1]] = _musicPos[5];
+ _partConfig_type[_musicPos[1]] = _musicPos[5];
else if (_musicPos[4] == 2)
- _tOrdr[_musicPos[1]] = _musicPos[5];
+ _partConfig_ordr[_musicPos[1]] = _musicPos[5];
return false;
}
-uint8 TownsEuphonyDriver::applyTranspose(uint8 in) {
- int out = _tTranspose[_musicPos[1]];
+uint8 EuphonyPlayer::applyTranspose(uint8 in) {
+ int out = _partConfig_transpose[_musicPos[1]];
if (!out)
return in;
out += (in & 0x7f);
@@ -796,61 +570,328 @@ uint8 TownsEuphonyDriver::applyTranspose(uint8 in) {
return out & 0xff;
}
-uint8 TownsEuphonyDriver::applyVolumeAdjust(uint8 in) {
- int out = _tLevel[_musicPos[1]];
+uint8 EuphonyPlayer::applyVolumeAdjust(uint8 in) {
+ int out = _partConfig_volume[_musicPos[1]];
out += (in & 0x7f);
out = CLIP(out, 1, 127);
return out & 0xff;
}
-void TownsEuphonyDriver::sendNoteOff() {
- int8 *chan = &_activeChannels[_command & 0x0f];
+void EuphonyPlayer::sendEvent(uint8 type, uint8 command) {
+ int drv = ((type >> 4) + 1) & 3;
+ if (_drivers[drv])
+ _drivers[drv]->send(command);
+}
+
+void EuphonyPlayer::sendNoteEvent(int type, int evt, int note, int velo) {
+ if (velo)
+ evt &= 0x8f;
+ sendEvent(type, evt);
+ sendEvent(type, note);
+ sendEvent(type, velo);
+}
+
+void EuphonyPlayer::sendControllerReset(int type, int part) {
+ sendEvent(type, 0xb0 | part);
+ sendEvent(type, 0x40);
+ sendEvent(type, 0);
+ sendEvent(type, 0xb0 | part);
+ sendEvent(type, 0x7b);
+ sendEvent(type, 0);
+ sendEvent(type, 0xb0 | part);
+ sendEvent(type, 0x79);
+ sendEvent(type, 0x40);
+}
+
+void EuphonyPlayer::sendAllNotesOff(int type, int part) {
+ sendEvent(type, 0xb0 | part);
+ sendEvent(type, 0x40);
+ sendEvent(type, 0);
+}
+
+void EuphonyPlayer::sendTempo(int tempo) {
+ tempo = CLIP(tempo + _tempoModifier, 0, 500);
+ if (_tempoControlMode == 0) {
+ _timerSetting = 34750 / (tempo + 30);
+ _updatesPerPulse = 0x10;
+
+ while (_timerSetting < 126) {
+ _timerSetting <<= 1;
+ _updatesPerPulse <<= 1;
+ }
+
+ while (_timerSetting > 383) {
+ _timerSetting >>= 1;
+ _updatesPerPulse >>= 1;
+ }
+
+ _eupDriver->setTimerA(true, -(_timerSetting - 2));
+
+ } else if (_tempoControlMode == 1) {
+ _timerSetting = 312500 / (tempo + 30);
+ _updatesPerPulse = 0x10;
+ while (_timerSetting < 1105) {
+ _timerSetting <<= 1;
+ _updatesPerPulse <<= 1;
+ }
+
+ } else if (_tempoControlMode == 2) {
+ _timerSetting = 625000 / (tempo + 30);
+ _updatesPerPulseRemainder = 0;
+ }
+}
+
+EuphonyDriver::EuphonyDriver(Audio::Mixer *mixer, EuphonyPlayer *pl) : EuphonyBaseDriver(), _channels(0), _partToChanMapping(0), _sustainChannels(0) {
+ _intf = new TownsAudioInterface(mixer, pl);
+}
+
+EuphonyDriver::~EuphonyDriver() {
+ delete _intf;
+ delete[] _partToChanMapping;
+ delete[] _sustainChannels;
+ delete[] _channels;
+}
+
+
+bool EuphonyDriver::init() {
+ if (!_intf->init())
+ return false;
+
+ delete[] _channels;
+ delete[] _partToChanMapping;
+ delete[] _sustainChannels;
+
+ _channels = new Channel[128];
+ _partToChanMapping = new int8[16];
+ _sustainChannels = new int8[16];
+
+ return true;
+}
+
+void EuphonyDriver::reset() {
+ _intf->callback(0);
+ _intf->callback(74);
+ _intf->callback(70, 0);
+ _intf->callback(75, 3);
+
+ _currentEvent.clear();
+ memset(_sustainChannels, 0, 16);
+ memset(_partToChanMapping, -1, 16);
+
+ for (int i = 0; i < 128; i++) {
+ _channels[i].part = _channels[i].next = -1;
+ _channels[i].note = _channels[i].pri = 0;
+ }
+
+ int e = 0;
+ for (int i = 0; i < 6; i++)
+ assignPartToChannel(i, e++);
+ for (int i = 0x40; i < 0x48; i++)
+ assignPartToChannel(i, e++);
+}
+
+int EuphonyDriver::assignPartToChannel(int chan, int part) {
+ if (part > 15 || chan > 127 || chan < 0)
+ return 3;
+
+ Channel *a = &_channels[chan];
+ if (a->part == part)
+ return 0;
+
+ if (a->part != -1) {
+ int8 *b = &_partToChanMapping[a->part];
+ while (*b != chan) {
+ b = &_channels[*b].next;
+ if (*b == -1 && *b != chan)
+ return 3;
+ }
+
+ *b = a->next;
+
+ if (a->note)
+ _intf->callback(2, chan);
+
+ a->part = a->next = -1;
+ a->note = 0;
+ }
+
+ a->next = _partToChanMapping[part];
+ _partToChanMapping[part] = chan;
+ a->part = part;
+ a->note = a->pri = 0;
+
+ return 0;
+}
+
+void EuphonyDriver::send(uint8 command) {
+ if (command >= 0x80) {
+ _currentEvent.clear();
+ _currentEvent.push_back(command >= 0xf0 ? 0 : command);
+ } else if (_currentEvent[0] >= 0x80) {
+ uint8 cmd = (_currentEvent[0] - 0x80) >> 4;
+ _currentEvent.push_back(command);
+
+ static const uint8 eventSize[] = { 3, 3, 3, 3, 2, 2, 3 };
+ if (_currentEvent.size() != eventSize[cmd])
+ return;
+
+ switch (cmd) {
+ case 0:
+ noteOff();
+ break;
+ case 1:
+ if (_currentEvent[2])
+ noteOn();
+ else
+ noteOff();
+ break;
+ case 3:
+ if (_currentEvent[1] == 7)
+ controlChange_volume();
+ else if (_currentEvent[1] == 10)
+ controlChange_panPos();
+ else if (_currentEvent[1] == 64)
+ controlChange_allNotesOff();
+ break;
+ case 4:
+ programChange();
+ break;
+ case 6:
+ pitchWheel();
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+void EuphonyDriver::setTimerA(bool enable, int tempo) {
+ _intf->callback(21, enable ? 255 : 0, tempo);
+}
+
+void EuphonyDriver::setTimerB(bool enable, int tempo) {
+ _intf->callback(22, enable ? 255 : 0, tempo);
+}
+
+void EuphonyDriver::loadInstrument(int chanType, int id, const uint8 *data) {
+ _intf->callback(5, chanType, id, data);
+}
+
+void EuphonyDriver::setInstrument(int chan, int instrID) {
+ _intf->callback(4, chan, instrID);
+}
+
+void EuphonyDriver::loadWaveTable(const uint8 *data) {
+ _intf->callback(34, data);
+}
+
+void EuphonyDriver::unloadWaveTable(int id) {
+ _intf->callback(35, id);
+}
+
+void EuphonyDriver::reserveSoundEffectChannels(int num) {
+ _intf->callback(33, num);
+ uint32 volMask = 0;
+
+ if (num > 8)
+ return;
+
+ for (uint32 v = 1 << 13; num; num--) {
+ volMask |= v;
+ v >>= 1;
+ }
+
+ _intf->setSoundEffectChanMask(volMask);
+}
+
+void EuphonyDriver::playSoundEffect(int chan, int note, int velo, const uint8 *data) {
+ _intf->callback(37, chan, note, velo, data);
+}
+
+void EuphonyDriver::stopSoundEffect(int chan) {
+ _intf->callback(39, chan);
+}
+
+bool EuphonyDriver::soundEffectIsPlaying(int chan) {
+ return _intf->callback(40, chan) ? true : false;
+}
+
+void EuphonyDriver::channelPan(int chan, int mode) {
+ _intf->callback(3, chan, mode);
+}
+
+void EuphonyDriver::channelPitch(int chan, int pitch) {
+ _intf->callback(7, chan, pitch);
+}
+
+void EuphonyDriver::channelVolume(int chan, int vol) {
+ _intf->callback(8, chan, vol);
+}
+
+void EuphonyDriver::setOutputVolume(int mode, int volLeft, int volRight) {
+ _intf->callback(67, mode, volLeft, volRight);
+}
+
+void EuphonyDriver::cdaToggle(int a) {
+ _intf->callback(73, a);
+}
+
+void EuphonyDriver::setMusicVolume(int volume) {
+ _intf->setMusicVolume(volume);
+}
+
+void EuphonyDriver::setSoundEffectVolume(int volume) {
+ _intf->setSoundEffectVolume(volume);
+}
+
+void EuphonyDriver::noteOff() {
+ int8 *chan = &_partToChanMapping[_currentEvent[0] & 0x0f];
if (*chan == -1)
return;
- while (_assignedChannels[*chan].note != _para[0]) {
- chan = &_assignedChannels[*chan].next;
+ while (_channels[*chan].note != _currentEvent[1]) {
+ chan = &_channels[*chan].next;
if (*chan == -1)
return;
}
- if (_sustainChannels[_command & 0x0f]) {
- _assignedChannels[*chan].note |= 0x80;
+ if (_sustainChannels[_currentEvent[0] & 0x0f]) {
+ _channels[*chan].note |= 0x80;
} else {
- _assignedChannels[*chan].note = 0;
+ _channels[*chan].note = 0;
_intf->callback(2, *chan);
}
}
-void TownsEuphonyDriver::sendNoteOn() {
- if (!_para[0])
+void EuphonyDriver::noteOn() {
+ if (!_currentEvent[1])
return;
- int8 *chan = &_activeChannels[_command & 0x0f];
+ int8 *chan = &_partToChanMapping[_currentEvent[0] & 0x0f];
if (*chan == -1)
return;
do {
- _assignedChannels[*chan].sub++;
- chan = &_assignedChannels[*chan].next;
+ _channels[*chan].pri++;
+ chan = &_channels[*chan].next;
} while (*chan != -1);
- chan = &_activeChannels[_command & 0x0f];
+ chan = &_partToChanMapping[_currentEvent[0] & 0x0f];
int d = 0;
int c = 0;
bool found = false;
do {
- if (!_assignedChannels[*chan].note) {
+ if (!_channels[*chan].note) {
found = true;
break;
}
- if (d <= _assignedChannels[*chan].sub) {
+ if (d <= _channels[*chan].pri) {
c = *chan;
- d = _assignedChannels[*chan].sub;
+ d = _channels[*chan].pri;
}
- chan = &_assignedChannels[*chan].next;
+ chan = &_channels[*chan].next;
} while (*chan != -1);
if (found)
@@ -858,59 +899,72 @@ void TownsEuphonyDriver::sendNoteOn() {
else
_intf->callback(2, c);
- _assignedChannels[c].note = _para[0];
- _assignedChannels[c].sub = 0;
- _intf->callback(1, c, _para[0], _para[1]);
+ _channels[c].note = _currentEvent[1];
+ _channels[c].pri = 0;
+ _intf->callback(1, c, _currentEvent[1], _currentEvent[2]);
}
-void TownsEuphonyDriver::sendChanVolume() {
- int8 *chan = &_activeChannels[_command & 0x0f];
+void EuphonyDriver::controlChange_volume() {
+ int8 *chan = &_partToChanMapping[_currentEvent[0] & 0x0f];
while (*chan != -1) {
- _intf->callback(8, *chan, _para[1] & 0x7f);
- chan = &_assignedChannels[*chan].next;
+ _intf->callback(8, *chan, _currentEvent[2] & 0x7f);
+ chan = &_channels[*chan].next;
}
}
-void TownsEuphonyDriver::sendPanPosition() {
- int8 *chan = &_activeChannels[_command & 0x0f];
+void EuphonyDriver::controlChange_panPos() {
+ int8 *chan = &_partToChanMapping[_currentEvent[0] & 0x0f];
while (*chan != -1) {
- _intf->callback(3, *chan, _para[1] & 0x7f);
- chan = &_assignedChannels[*chan].next;
+ _intf->callback(3, *chan, _currentEvent[2] & 0x7f);
+ chan = &_channels[*chan].next;
}
}
-void TownsEuphonyDriver::sendAllNotesOff() {
- if (_para[1] > 63) {
- _sustainChannels[_command & 0x0f] = -1;
+void EuphonyDriver::controlChange_allNotesOff() {
+ if (_currentEvent[2] > 63) {
+ _sustainChannels[_currentEvent[0] & 0x0f] = -1;
return;
}
- _sustainChannels[_command & 0x0f] = 0;
- int8 *chan = &_activeChannels[_command & 0x0f];
+ _sustainChannels[_currentEvent[0] & 0x0f] = 0;
+ int8 *chan = &_partToChanMapping[_currentEvent[0] & 0x0f];
while (*chan != -1) {
- if (_assignedChannels[*chan].note & 0x80) {
- _assignedChannels[*chan].note = 0;
+ if (_channels[*chan].note & 0x80) {
+ _channels[*chan].note = 0;
_intf->callback(2, *chan);
}
- chan = &_assignedChannels[*chan].next;
+ chan = &_channels[*chan].next;
}
}
-void TownsEuphonyDriver::sendSetInstrument() {
- int8 *chan = &_activeChannels[_command & 0x0f];
+void EuphonyDriver::programChange() {
+ int8 *chan = &_partToChanMapping[_currentEvent[0] & 0x0f];
while (*chan != -1) {
- _intf->callback(4, *chan, _para[0]);
+ _intf->callback(4, *chan, _currentEvent[1]);
_intf->callback(7, *chan, 0);
- chan = &_assignedChannels[*chan].next;
+ chan = &_channels[*chan].next;
}
}
-void TownsEuphonyDriver::sendPitch() {
- int8 *chan = &_activeChannels[_command & 0x0f];
+void EuphonyDriver::pitchWheel() {
+ int8 *chan = &_partToChanMapping[_currentEvent[0] & 0x0f];
while (*chan != -1) {
- _para[0] += _para[0];
- int16 pitch = (((READ_LE_UINT16(_para)) >> 1) & 0x3fff) - 0x2000;
+ _currentEvent[1] += _currentEvent[1];
+ int16 pitch = ((((_currentEvent[2] << 8) | _currentEvent[1]) >> 1) & 0x3fff) - 0x2000;
_intf->callback(7, *chan, pitch);
- chan = &_assignedChannels[*chan].next;
+ chan = &_channels[*chan].next;
}
}
+
+Type0Driver::Type0Driver(EuphonyPlayer *pl) : EuphonyBaseDriver() {
+}
+
+Type0Driver::~Type0Driver() {
+}
+
+bool Type0Driver::init() {
+ return true;
+}
+
+void Type0Driver::send(uint8 command) {
+}
diff --git a/audio/softsynth/fmtowns_pc98/towns_euphony.h b/audio/softsynth/fmtowns_pc98/towns_euphony.h
index d77217884d..76aa153a37 100644
--- a/audio/softsynth/fmtowns_pc98/towns_euphony.h
+++ b/audio/softsynth/fmtowns_pc98/towns_euphony.h
@@ -24,160 +24,203 @@
#define TOWNS_EUP_H
#include "audio/softsynth/fmtowns_pc98/towns_audio.h"
+#include "common/array.h"
-class TownsEuphonyDriver : public TownsAudioInterfacePluginDriver {
+class EuphonyBaseDriver {
public:
- TownsEuphonyDriver(Audio::Mixer *mixer);
- virtual ~TownsEuphonyDriver();
+ EuphonyBaseDriver() {}
+ virtual ~EuphonyBaseDriver() {}
+
+ virtual bool init() { return true; }
+
+ virtual void send(uint8 command) = 0;
+};
+
+class EuphonyPlayer;
+
+class EuphonyDriver : public EuphonyBaseDriver {
+public:
+ EuphonyDriver(Audio::Mixer *mixer, EuphonyPlayer *pl);
+ ~EuphonyDriver();
bool init();
void reset();
+ int assignPartToChannel(int chan, int part);
+
+ void send(uint8 command);
+
+ void setTimerA(bool enable, int tempo);
+ void setTimerB(bool enable, int tempo);
+
void loadInstrument(int chanType, int id, const uint8 *data);
+ void setInstrument(int chan, int instrID);
void loadWaveTable(const uint8 *data);
void unloadWaveTable(int id);
- void reserveSoundEffectChannels(int num);
-
- int setMusicTempo(int tempo);
- int startMusicTrack(const uint8 *data, int trackSize, int startTick);
- void setMusicLoop(bool loop);
- void stopParser();
- bool parserIsPlaying() {return _playing; }
- void continueParsing();
+ void reserveSoundEffectChannels(int num);
void playSoundEffect(int chan, int note, int velo, const uint8 *data);
void stopSoundEffect(int chan);
bool soundEffectIsPlaying(int chan);
- void chanPanPos(int chan, int mode);
- void chanPitch(int chan, int pitch);
- void chanVolume(int chan, int vol);
+ void channelPan(int chan, int mode);
+ void channelPitch(int chan, int pitch);
+ void channelVolume(int chan, int vol);
void setOutputVolume(int chanType, int volLeft, int volRight);
+ void cdaToggle(int a);
- int configChan_enable(int tableEntry, int val);
- int configChan_setMode(int tableEntry, int val);
- int configChan_remap(int tableEntry, int val);
- int configChan_adjustVolume(int tableEntry, int val);
- int configChan_setTranspose(int tableEntry, int val);
+ void setMusicVolume(int volume);
+ void setSoundEffectVolume(int volume);
- int assignChannel(int chan, int tableEntry);
+private:
+ void noteOff();
+ void noteOn();
+ void controlChange_volume();
+ void controlChange_panPos();
+ void controlChange_allNotesOff();
+ void programChange();
+ void pitchWheel();
+
+ Common::Array<uint8> _currentEvent;
+ int8 *_partToChanMapping;
+ int8 *_sustainChannels;
- void timerCallback(int timerId);
+ struct Channel {
+ int8 part;
+ int8 next;
+ uint8 note;
+ uint8 pri;
+ } *_channels;
- void setMusicVolume(int volume);
- void setSoundEffectVolume(int volume);
+ TownsAudioInterface *_intf;
+};
- TownsAudioInterface *intf() {
- return _intf;
- }
+class Type0Driver : public EuphonyBaseDriver {
+public:
+ Type0Driver(EuphonyPlayer *pl);
+ ~Type0Driver();
-private:
- void resetTables();
+ bool init();
+
+ void send(uint8 command);
+};
+
+class EuphonyPlayer : public TownsAudioInterfacePluginDriver {
+public:
+ EuphonyPlayer(Audio::Mixer *mixer);
+ virtual ~EuphonyPlayer();
+
+ bool init();
+ int startTrack(const uint8 *data, int trackSize, int barLen);
+ void stop();
+ void pause();
+ void resume();
+
+ int setTempo(int tempo);
+ void setLoopStatus(bool loop);
+
+ bool isPlaying() {return _playing; }
+
+ int configPart_enable(int part, int val);
+ int configPart_setType(int part, int val);
+ int configPart_remap(int part, int val);
+ int configPart_adjustVolume(int part, int val);
+ int configPart_setTranspose(int part, int val);
+
+ void timerCallback(int timerId);
+
+ EuphonyDriver *driver() { return _eupDriver; }
+
+private:
+ void reset();
+ void resetPartConfig();
void resetTempo();
- void setTempoIntern(int tempo);
- void setTimerA(bool enable, int tempo);
- void setTimerB(bool enable, int tempo);
- void updatePulseCount();
- void updateTimeStampBase();
+ void updatePulseCounters();
+ void updateBeat();
void updateParser();
void updateCheckEot();
- bool parseNext();
- void jumpNextLoop();
-
- void updateEventBuffer();
- void flushEventBuffer();
- void processBufferNote(int mode, int evt, int note, int velo);
+ bool parseEvent();
+ void proceedToNextEvent();
- void resetControl();
- void resetControlIntern(int mode, int chan);
+ void updateHangingNotes();
+ void clearHangingNotes();
+
+ void resetAllControls();
+ void allPartsOff();
+
uint8 appendEvent(uint8 evt, uint8 chan);
- void sendEvent(uint8 mode, uint8 command);
-
- typedef bool(TownsEuphonyDriver::*EuphonyOpcode)();
- bool evtSetupNote();
- bool evtPolyphonicAftertouch();
- bool evtControlPitch();
- bool evtInstrumentChanAftertouch();
- bool evtLoadInstrument();
- bool evtAdvanceTimestampOffset();
- bool evtTempo();
- bool evtModeOrdrChange();
- bool evtNotImpl() {
- return false;
- }
+ typedef bool(EuphonyPlayer::*EuphonyEvent)();
+ bool event_notImpl();
+ bool event_noteOn();
+ bool event_polyphonicAftertouch();
+ bool event_controlChange_pitchWheel();
+ bool event_programChange_channelAftertouch();
+
+ bool event_sysex();
+ bool event_advanceBar();
+ bool event_setTempo();
+ bool event_typeOrdrChange();
uint8 applyTranspose(uint8 in);
uint8 applyVolumeAdjust(uint8 in);
- void sendNoteOff();
- void sendNoteOn();
- void sendChanVolume();
- void sendPanPosition();
- void sendAllNotesOff();
- void sendSetInstrument();
- void sendPitch();
+ void sendEvent(uint8 type, uint8 command);
+ void sendNoteEvent(int type, int evt, int note, int velo);
+ void sendControllerReset(int type, int part);
+ void sendAllNotesOff(int type, int part);
+ void sendTempo(int tempo);
- int8 *_activeChannels;
- int8 *_sustainChannels;
+ uint8 *_partConfig_enable;
+ uint8 *_partConfig_type;
+ uint8 *_partConfig_ordr;
+ int8 *_partConfig_volume;
+ int8 *_partConfig_transpose;
- struct ActiveChannel {
- int8 chan;
- int8 next;
- uint8 note;
- uint8 sub;
- } *_assignedChannels;
-
- uint8 *_tEnable;
- uint8 *_tMode;
- uint8 *_tOrdr;
- int8 *_tLevel;
- int8 *_tTranspose;
-
- struct DlEvent {
+ struct SavedEvent {
+ SavedEvent(int ev, int tp, int nt, int vl, int ln, SavedEvent *chain) : evt(ev), type(tp), note(nt), velo(vl), len(ln), next(chain) {}
uint8 evt;
- uint8 mode;
+ uint8 type;
uint8 note;
uint8 velo;
uint16 len;
- } *_eventBuffer;
- int _bufferedEventsCount;
-
- uint8 _para[2];
- uint8 _paraCount;
- uint8 _command;
-
- uint8 _defaultBaseTickLen;
- uint8 _baseTickLen;
- uint32 _pulseCount;
+ SavedEvent *next;
+ };
+
+ SavedEvent *_savedEventsChain;
+
+ uint8 _defaultBarLength;
+ uint8 _barLength;
+ int _playerUpdatesLeft;
int _tempoControlMode;
- int _extraTimingControlRemainder;
- int _extraTimingControl;
+ int _updatesPerPulseRemainder;
+ int _updatesPerPulse;
int _timerSetting;
- int8 _tempoDiff;
+ int8 _tempoMode1PulseCounter;
int _tempoModifier;
- uint32 _timeStampDest;
- uint32 _timeStampBase;
- int8 _elapsedEvents;
+ uint32 _bar;
+ uint32 _parseToBar;
+ int8 _tempoMode1UpdateF8;
uint8 _deltaTicks;
- uint32 _tickCounter;
+ uint32 _beat;
uint8 _defaultTempo;
int _trackTempo;
bool _loop;
bool _playing;
bool _endOfTrack;
- bool _suspendParsing;
+ bool _paused;
const uint8 *_musicStart;
const uint8 *_musicPos;
uint32 _musicTrackSize;
- TownsAudioInterface *_intf;
+ EuphonyDriver *_eupDriver;
+ EuphonyBaseDriver *_drivers[3];
};
#endif
diff --git a/backends/audiocd/sdl/sdl-audiocd.cpp b/backends/audiocd/sdl/sdl-audiocd.cpp
index c7b089af09..ff50c56af3 100644
--- a/backends/audiocd/sdl/sdl-audiocd.cpp
+++ b/backends/audiocd/sdl/sdl-audiocd.cpp
@@ -26,7 +26,7 @@
#include "backends/audiocd/sdl/sdl-audiocd.h"
-#if !SDL_VERSION_ATLEAST(1, 3, 0)
+#if !SDL_VERSION_ATLEAST(2, 0, 0)
#include "common/textconsole.h"
@@ -136,6 +136,6 @@ void SdlAudioCDManager::updateCD() {
}
}
-#endif // !SDL_VERSION_ATLEAST(1, 3, 0)
+#endif // !SDL_VERSION_ATLEAST(2, 0, 0)
#endif
diff --git a/backends/audiocd/sdl/sdl-audiocd.h b/backends/audiocd/sdl/sdl-audiocd.h
index 783d4fe0f0..bfad7b6805 100644
--- a/backends/audiocd/sdl/sdl-audiocd.h
+++ b/backends/audiocd/sdl/sdl-audiocd.h
@@ -27,7 +27,7 @@
#include "backends/platform/sdl/sdl-sys.h"
-#if !SDL_VERSION_ATLEAST(1, 3, 0)
+#if !SDL_VERSION_ATLEAST(2, 0, 0)
/**
* The SDL audio cd manager. Implements real audio cd playback.
@@ -49,6 +49,6 @@ protected:
uint32 _cdEndTime, _cdStopTime;
};
-#endif // !SDL_VERSION_ATLEAST(1, 3, 0)
+#endif // !SDL_VERSION_ATLEAST(2, 0, 0)
#endif
diff --git a/backends/events/ps3sdl/ps3sdl-events.cpp b/backends/events/ps3sdl/ps3sdl-events.cpp
index 0f6e01857b..1fc10559c2 100644
--- a/backends/events/ps3sdl/ps3sdl-events.cpp
+++ b/backends/events/ps3sdl/ps3sdl-events.cpp
@@ -126,8 +126,8 @@ bool PS3SdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
* This pauses execution and keeps redrawing the screen until the XMB is closed.
*/
void PS3SdlEventSource::preprocessEvents(SDL_Event *event) {
- if (event->type == SDL_ACTIVEEVENT) {
- if (event->active.state == SDL_APPMOUSEFOCUS && !event->active.gain) {
+ if (event->type == SDL_WINDOWEVENT) {
+ if (event->window.event == SDL_WINDOWEVENT_LEAVE) {
// XMB opened
if (g_engine)
g_engine->pauseEngine(true);
@@ -145,9 +145,9 @@ void PS3SdlEventSource::preprocessEvents(SDL_Event *event) {
}
if (event->type == SDL_QUIT)
return;
- if (event->type != SDL_ACTIVEEVENT)
+ if (event->type != SDL_WINDOWEVENT)
continue;
- if (event->active.state == SDL_APPMOUSEFOCUS && event->active.gain) {
+ if (event->window.event == SDL_WINDOWEVENT_ENTER) {
// XMB closed
if (g_engine)
g_engine->pauseEngine(false);
diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index 1e5119dbec..745f398be6 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -314,7 +314,7 @@ Common::KeyCode SdlEventSource::SDLToOSystemKeycode(const SDLKey key) {
case SDLK_y: return Common::KEYCODE_y;
case SDLK_z: return Common::KEYCODE_z;
case SDLK_DELETE: return Common::KEYCODE_DELETE;
-#if SDL_VERSION_ATLEAST(1, 3, 0)
+#if SDL_VERSION_ATLEAST(2, 0, 0)
case SDL_SCANCODE_TO_KEYCODE(SDL_SCANCODE_GRAVE): return Common::KEYCODE_TILDE;
#else
case SDLK_WORLD_16: return Common::KEYCODE_TILDE;
@@ -737,16 +737,16 @@ bool SdlEventSource::handleJoyButtonUp(SDL_Event &ev, Common::Event &event) {
bool SdlEventSource::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) {
int axis = ev.jaxis.value;
- if ( axis > JOY_DEADZONE) {
+ if (axis > JOY_DEADZONE) {
axis -= JOY_DEADZONE;
event.type = Common::EVENT_MOUSEMOVE;
- } else if ( axis < -JOY_DEADZONE ) {
+ } else if (axis < -JOY_DEADZONE) {
axis += JOY_DEADZONE;
event.type = Common::EVENT_MOUSEMOVE;
} else
axis = 0;
- if ( ev.jaxis.axis == JOY_XAXIS) {
+ if (ev.jaxis.axis == JOY_XAXIS) {
#ifdef JOY_ANALOG
_km.x_vel = axis / 2000;
_km.x_down_count = 0;
@@ -759,7 +759,6 @@ bool SdlEventSource::handleJoyAxisMotion(SDL_Event &ev, Common::Event &event) {
_km.x_down_count = 0;
}
#endif
-
} else if (ev.jaxis.axis == JOY_YAXIS) {
#ifndef JOY_INVERT_Y
axis = -axis;
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index 5821856c30..ac6d41d47d 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -51,7 +51,8 @@ OpenGLGraphicsManager::OpenGLGraphicsManager()
_overlayVisible(false), _cursor(nullptr),
_cursorX(0), _cursorY(0), _cursorDisplayX(0),_cursorDisplayY(0), _cursorHotspotX(0), _cursorHotspotY(0),
_cursorHotspotXScaled(0), _cursorHotspotYScaled(0), _cursorWidthScaled(0), _cursorHeightScaled(0),
- _cursorKeyColor(0), _cursorVisible(false), _cursorDontScale(false), _cursorPaletteEnabled(false)
+ _cursorKeyColor(0), _cursorVisible(false), _cursorDontScale(false), _cursorPaletteEnabled(false),
+ _forceRedraw(false), _scissorOverride(3)
#ifdef USE_OSD
, _osdAlpha(0), _osdFadeStartTime(0), _osd(nullptr)
#endif
@@ -343,7 +344,10 @@ void OpenGLGraphicsManager::fillScreen(uint32 col) {
}
void OpenGLGraphicsManager::setShakePos(int shakeOffset) {
- _gameScreenShakeOffset = shakeOffset;
+ if (_gameScreenShakeOffset != shakeOffset) {
+ _gameScreenShakeOffset = shakeOffset;
+ _forceRedraw = true;
+ }
}
void OpenGLGraphicsManager::updateScreen() {
@@ -351,8 +355,30 @@ void OpenGLGraphicsManager::updateScreen() {
return;
}
+ // We only update the screen when there actually have been any changes.
+ if ( !_forceRedraw
+ && !_gameScreen->isDirty()
+ && !(_overlayVisible && _overlay->isDirty())
+ && !(_cursorVisible && _cursor && _cursor->isDirty())
+ && _osdAlpha == 0) {
+ return;
+ }
+ _forceRedraw = false;
+
// Clear the screen buffer.
- GLCALL(glClear(GL_COLOR_BUFFER_BIT));
+ if (_scissorOverride && !_overlayVisible) {
+ // In certain cases we need to assure that the whole screen area is
+ // cleared. For example, when switching from overlay visible to
+ // invisible, we need to assure that all contents are cleared to
+ // properly remove all overlay contents.
+ GLCALL(glDisable(GL_SCISSOR_TEST));
+ GLCALL(glClear(GL_COLOR_BUFFER_BIT));
+ GLCALL(glEnable(GL_SCISSOR_TEST));
+
+ --_scissorOverride;
+ } else {
+ GLCALL(glClear(GL_COLOR_BUFFER_BIT));
+ }
const GLfloat shakeOffset = _gameScreenShakeOffset * (GLfloat)_displayHeight / _gameScreen->getHeight();
@@ -375,37 +401,8 @@ void OpenGLGraphicsManager::updateScreen() {
_cursorWidthScaled, _cursorHeightScaled);
}
- // Fourth step: Draw black borders around the game screen when no overlay
- // is visible. This makes sure that the mouse cursor etc. is only drawn
- // in the actual game screen area in this case.
- if (!_overlayVisible) {
- GLCALL(glColor4f(0.0f, 0.0f, 0.0f, 1.0f));
-
- GLCALL(glDisable(GL_TEXTURE_2D));
- GLCALL(glDisableClientState(GL_TEXTURE_COORD_ARRAY));
-
- // Top border.
- drawRect(0, 0, _outputScreenWidth, _displayY);
-
- // Left border.
- drawRect(0, 0, _displayX, _outputScreenHeight);
-
- // Bottom border.
- const int y = _displayY + _displayHeight;
- drawRect(0, y, _outputScreenWidth, _outputScreenHeight - y);
-
- // Right border.
- const int x = _displayX + _displayWidth;
- drawRect(x, 0, _outputScreenWidth - x, _outputScreenHeight);
-
- GLCALL(glEnableClientState(GL_TEXTURE_COORD_ARRAY));
- GLCALL(glEnable(GL_TEXTURE_2D));
-
- GLCALL(glColor4f(1.0f, 1.0f, 1.0f, 1.0f));
- }
-
#ifdef USE_OSD
- // Fifth step: Draw the OSD.
+ // Fourth step: Draw the OSD.
if (_osdAlpha > 0) {
Common::StackLock lock(_osdMutex);
@@ -431,6 +428,8 @@ void OpenGLGraphicsManager::updateScreen() {
GLCALL(glColor4f(1.0f, 1.0f, 1.0f, 1.0f));
}
#endif
+
+ refreshScreen();
}
Graphics::Surface *OpenGLGraphicsManager::lockScreen() {
@@ -465,6 +464,10 @@ int16 OpenGLGraphicsManager::getOverlayHeight() {
void OpenGLGraphicsManager::showOverlay() {
_overlayVisible = true;
+ _forceRedraw = true;
+
+ // Allow drawing inside full screen area.
+ GLCALL(glDisable(GL_SCISSOR_TEST));
// Update cursor position.
setMousePosition(_cursorX, _cursorY);
@@ -472,6 +475,11 @@ void OpenGLGraphicsManager::showOverlay() {
void OpenGLGraphicsManager::hideOverlay() {
_overlayVisible = false;
+ _forceRedraw = true;
+
+ // Limit drawing to screen area.
+ GLCALL(glEnable(GL_SCISSOR_TEST));
+ _scissorOverride = 3;
// Update cursor position.
setMousePosition(_cursorX, _cursorY);
@@ -503,6 +511,12 @@ void OpenGLGraphicsManager::grabOverlay(void *buf, int pitch) {
}
bool OpenGLGraphicsManager::showMouse(bool visible) {
+ // In case the mouse cursor visibility changed we need to redraw the whole
+ // screen even when nothing else changed.
+ if (_cursorVisible != visible) {
+ _forceRedraw = true;
+ }
+
bool last = _cursorVisible;
_cursorVisible = visible;
return last;
@@ -537,11 +551,8 @@ void OpenGLGraphicsManager::warpMouse(int x, int y) {
return;
}
- x = (x * _displayWidth) / _gameScreen->getWidth();
- y = (y * _displayHeight) / _gameScreen->getHeight();
-
- x += _displayX;
- y += _displayY;
+ x = (x * _outputScreenWidth) / _gameScreen->getWidth();
+ y = (y * _outputScreenHeight) / _gameScreen->getHeight();
}
setMousePosition(x, y);
@@ -851,6 +862,16 @@ void OpenGLGraphicsManager::notifyContextCreate(const Graphics::PixelFormat &def
GLCALL(glEnable(GL_TEXTURE_2D));
+ // Setup scissor state accordingly.
+ if (_overlayVisible) {
+ GLCALL(glDisable(GL_SCISSOR_TEST));
+ } else {
+ GLCALL(glEnable(GL_SCISSOR_TEST));
+ }
+ // Clear the whole screen for the first three frames to assure any
+ // leftovers are cleared.
+ _scissorOverride = 3;
+
// We use a "pack" alignment (when reading from textures) to 4 here,
// since the only place where we really use it is the BMP screenshot
// code and that requires the same alignment too.
@@ -922,22 +943,21 @@ void OpenGLGraphicsManager::adjustMousePosition(int16 &x, int16 &y) {
y = (y * _overlay->getHeight()) / _outputScreenHeight;
}
} else if (_gameScreen) {
- x -= _displayX;
- y -= _displayY;
-
const int16 width = _gameScreen->getWidth();
const int16 height = _gameScreen->getHeight();
- x = (x * width) / (int)_displayWidth;
- y = (y * height) / (int)_displayHeight;
-
- // Make sure we only supply valid coordinates.
- x = CLIP<int16>(x, 0, width - 1);
- y = CLIP<int16>(y, 0, height - 1);
+ x = (x * width) / (int)_outputScreenWidth;
+ y = (y * height) / (int)_outputScreenHeight;
}
}
void OpenGLGraphicsManager::setMousePosition(int x, int y) {
+ // Whenever the mouse position changed we force a screen redraw to reflect
+ // changes properly.
+ if (_cursorX != x || _cursorY != y) {
+ _forceRedraw = true;
+ }
+
_cursorX = x;
_cursorY = y;
@@ -945,8 +965,8 @@ void OpenGLGraphicsManager::setMousePosition(int x, int y) {
_cursorDisplayX = x;
_cursorDisplayY = y;
} else {
- _cursorDisplayX = CLIP<int>(x, _displayX, _displayX + _displayWidth - 1);
- _cursorDisplayY = CLIP<int>(y, _displayY, _displayY + _displayHeight - 1);
+ _cursorDisplayX = _displayX + (x * _displayWidth) / _outputScreenWidth;
+ _cursorDisplayY = _displayY + (y * _displayHeight) / _outputScreenHeight;
}
}
@@ -1096,8 +1116,21 @@ void OpenGLGraphicsManager::recalculateDisplayArea() {
_displayX = (_outputScreenWidth - _displayWidth ) / 2;
_displayY = (_outputScreenHeight - _displayHeight) / 2;
+ // Setup drawing limitation for game graphics.
+ // This invovles some trickery because OpenGL's viewport coordinate system
+ // is upside down compared to ours.
+ GLCALL(glScissor(_displayX,
+ _outputScreenHeight - _displayHeight - _displayY,
+ _displayWidth,
+ _displayHeight));
+ // Clear the whole screen for the first three frames to remove leftovers.
+ _scissorOverride = 3;
+
// Update the cursor position to adjust for new display area.
setMousePosition(_cursorX, _cursorY);
+
+ // Force a redraw to assure screen is properly redrawn.
+ _forceRedraw = true;
}
void OpenGLGraphicsManager::updateCursorPalette() {
@@ -1215,20 +1248,4 @@ void OpenGLGraphicsManager::saveScreenshot(const Common::String &filename) const
delete[] pixels;
}
-void OpenGLGraphicsManager::drawRect(GLfloat x, GLfloat y, GLfloat w, GLfloat h) {
- if (w < 0 || h < 0) {
- return;
- }
-
- const GLfloat vertices[4*2] = {
- x, y,
- x + w, y,
- x, y + h,
- x + w, y + h
- };
- GLCALL(glVertexPointer(2, GL_FLOAT, 0, vertices));
-
- GLCALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4));
-}
-
} // End of namespace OpenGL
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index cec970e0cc..9578839383 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -263,6 +263,11 @@ protected:
virtual bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format) = 0;
/**
+ * Refresh the screen contents.
+ */
+ virtual void refreshScreen() = 0;
+
+ /**
* Save a screenshot of the full display as BMP to the given file. This
* uses Common::DumpFile for writing the screenshot.
*
@@ -464,10 +469,19 @@ private:
*/
byte _cursorPalette[3 * 256];
+ //
+ // Misc
+ //
+
+ /**
+ * Whether the screen contents shall be forced to redrawn.
+ */
+ bool _forceRedraw;
+
/**
- * Draws a rectangle
+ * Number of frames glClear shall ignore scissor testing.
*/
- void drawRect(GLfloat x, GLfloat y, GLfloat w, GLfloat h);
+ uint _scissorOverride;
#ifdef USE_OSD
//
diff --git a/backends/graphics/opengl/opengl-sys.h b/backends/graphics/opengl/opengl-sys.h
index a3524b28d2..4e21894380 100644
--- a/backends/graphics/opengl/opengl-sys.h
+++ b/backends/graphics/opengl/opengl-sys.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef BACKENDS_GRAPHICS_OPENGL_OPENGL_H
-#define BACKENDS_GRAPHICS_OPENGL_OPENGL_H
+#ifndef BACKENDS_GRAPHICS_OPENGL_OPENGL_SYS_H
+#define BACKENDS_GRAPHICS_OPENGL_OPENGL_SYS_H
// The purpose of this header is to include the OpenGL headers in an uniform
// fashion. A notable example for a non standard port is the Tizen port.
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index a2b172f14a..0d140ee4d7 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -21,6 +21,7 @@
*/
#include "backends/graphics/openglsdl/openglsdl-graphics.h"
+#include "backends/events/sdl/sdl-events.h"
#include "common/textconsole.h"
#include "common/config-manager.h"
@@ -236,13 +237,6 @@ void OpenGLSdlGraphicsManager::updateScreen() {
}
OpenGLGraphicsManager::updateScreen();
-
- // Swap OpenGL buffers
-#if SDL_VERSION_ATLEAST(2, 0, 0)
- SDL_GL_SwapWindow(_window->getSDLWindow());
-#else
- SDL_GL_SwapBuffers();
-#endif
}
void OpenGLSdlGraphicsManager::notifyVideoExpose() {
@@ -251,6 +245,7 @@ void OpenGLSdlGraphicsManager::notifyVideoExpose() {
void OpenGLSdlGraphicsManager::notifyResize(const uint width, const uint height) {
#if SDL_VERSION_ATLEAST(2, 0, 0)
setActualScreenSize(width, height);
+ _eventSource->resetKeyboadEmulation(width - 1, height - 1);
#else
if (!_ignoreResizeEvents && _hwScreen && !(_hwScreen->flags & SDL_FULLSCREEN)) {
// We save that we handled a resize event here. We need to know this
@@ -301,6 +296,15 @@ bool OpenGLSdlGraphicsManager::loadVideoMode(uint requestedWidth, uint requested
return setupMode(requestedWidth, requestedHeight);
}
+void OpenGLSdlGraphicsManager::refreshScreen() {
+ // Swap OpenGL buffers
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ SDL_GL_SwapWindow(_window->getSDLWindow());
+#else
+ SDL_GL_SwapBuffers();
+#endif
+}
+
bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
// In case we request a fullscreen mode we will use the mode the user
// has chosen last time or the biggest mode available.
@@ -386,6 +390,13 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
}
}
+#ifdef USE_GLES
+ // SDL2 will create a GLES2 context by default, so this is needed for GLES1-profile
+ // functions to work.
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 1);
+ SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
+#endif
_glContext = SDL_GL_CreateContext(_window->getSDLWindow());
if (!_glContext) {
return false;
@@ -395,6 +406,7 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
int actualWidth, actualHeight;
getWindowDimensions(&actualWidth, &actualHeight);
setActualScreenSize(actualWidth, actualHeight);
+ _eventSource->resetKeyboadEmulation(actualWidth - 1, actualHeight - 1);
return true;
#else
// WORKAROUND: Working around infamous SDL bugs when switching
@@ -440,6 +452,7 @@ bool OpenGLSdlGraphicsManager::setupMode(uint width, uint height) {
if (_hwScreen) {
notifyContextCreate(rgba8888, rgba8888);
setActualScreenSize(_hwScreen->w, _hwScreen->h);
+ _eventSource->resetKeyboadEmulation(_hwScreen->w - 1, _hwScreen->h - 1);
}
// Ignore resize events (from SDL) for a few frames, if this isn't
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.h b/backends/graphics/openglsdl/openglsdl-graphics.h
index 845880eb14..1552593575 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.h
+++ b/backends/graphics/openglsdl/openglsdl-graphics.h
@@ -65,6 +65,8 @@ protected:
virtual void setInternalMousePosition(int x, int y);
virtual bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format);
+
+ virtual void refreshScreen();
private:
bool setupMode(uint width, uint height);
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 9cb14525ee..2b9d3aa100 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -32,6 +32,7 @@
#include "common/textconsole.h"
#include "common/translation.h"
#include "common/util.h"
+#include "common/frac.h"
#ifdef USE_RGB_COLOR
#include "common/list.h"
#endif
@@ -125,6 +126,7 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
_hwscreen(0),
#if SDL_VERSION_ATLEAST(2, 0, 0)
_renderer(nullptr), _screenTexture(nullptr),
+ _viewport(), _windowWidth(1), _windowHeight(1),
#else
_originalBitsPerPixel(0),
#endif
@@ -889,9 +891,14 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
SDL_SetColorKey(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, kOSDColorKey);
#endif
+#if !SDL_VERSION_ATLEAST(2, 0, 0)
+ // For SDL2 the output resolution might differ from the requested
+ // resolution. We handle resetting the keyboard emulation properly inside
+ // our SDL_SetVideoMode wrapper for SDL2.
_eventSource->resetKeyboadEmulation(
_videoMode.screenWidth * _videoMode.scaleFactor - 1,
effectiveScreenHeight() - 1);
+#endif
// Distinguish 555 and 565 mode
if (_hwscreen->format->Rmask == 0x7C00)
@@ -1756,22 +1763,30 @@ void SurfaceSdlGraphicsManager::setMousePos(int x, int y) {
}
void SurfaceSdlGraphicsManager::warpMouse(int x, int y) {
- int y1 = y;
-
// Don't change actual mouse position, when mouse is outside of our window (in case of windowed mode)
if (!_window->hasMouseFocus()) {
setMousePos(x, y); // but change game cursor position
return;
}
+ int x1 = x, y1 = y;
if (_videoMode.aspectRatioCorrection && !_overlayVisible)
- y1 = real2Aspect(y);
+ y1 = real2Aspect(y1);
if (_mouseCurState.x != x || _mouseCurState.y != y) {
- if (!_overlayVisible)
- _window->warpMouseInWindow(x * _videoMode.scaleFactor, y1 * _videoMode.scaleFactor);
- else
- _window->warpMouseInWindow(x, y1);
+ if (!_overlayVisible) {
+ x1 *= _videoMode.scaleFactor;
+ y1 *= _videoMode.scaleFactor;
+ }
+
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ // Transform our coordinates in "virtual" output coordinate space into
+ // actual output coordinate space.
+ x1 = x1 * _windowWidth / _videoMode.hardwareWidth;
+ y1 = y1 * _windowHeight / _videoMode.hardwareHeight;
+#endif
+
+ _window->warpMouseInWindow(x1, y1);
// SDL_WarpMouse() generates a mouse movement event, so
// setMousePos() would be called eventually. However, the
@@ -2352,7 +2367,25 @@ void SurfaceSdlGraphicsManager::notifyVideoExpose() {
_forceFull = true;
}
+#ifdef USE_SDL_RESIZABLE_WINDOW
+void SurfaceSdlGraphicsManager::notifyResize(const uint width, const uint height) {
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ setWindowResolution(width, height);
+#endif
+}
+#endif
+
void SurfaceSdlGraphicsManager::transformMouseCoordinates(Common::Point &point) {
+#if SDL_VERSION_ATLEAST(2, 0, 0)
+ // In SDL2 the actual output resolution might be different from what we
+ // requested. Thus, we transform the coordinates from actual output
+ // coordinate space into the "virtual" output coordinate space.
+ // Please note that we ignore the possible existence of black bars here,
+ // this avoids the feeling of stickyness to black bars.
+ point.x = point.x * _videoMode.hardwareWidth / _windowWidth;
+ point.y = point.y * _videoMode.hardwareHeight / _windowHeight;
+#endif
+
if (!_overlayVisible) {
point.x /= _videoMode.scaleFactor;
point.y /= _videoMode.scaleFactor;
@@ -2377,10 +2410,51 @@ void SurfaceSdlGraphicsManager::deinitializeRenderer() {
_window->destroyWindow();
}
+void SurfaceSdlGraphicsManager::setWindowResolution(int width, int height) {
+ _windowWidth = width;
+ _windowHeight = height;
+
+ // We expect full screen resolution as inputs coming from the event system.
+ _eventSource->resetKeyboadEmulation(_windowWidth - 1, _windowHeight - 1);
+
+ // Calculate the "viewport" for the actual area we draw in. In fullscreen
+ // we can easily get a different resolution than what we requested. In
+ // this case, we add black bars if necessary to assure the aspect ratio
+ // is preserved.
+ const frac_t outputAspect = intToFrac(_windowWidth) / _windowHeight;
+ const frac_t desiredAspect = intToFrac(_videoMode.hardwareWidth) / _videoMode.hardwareHeight;
+
+ _viewport.w = _windowWidth;
+ _viewport.h = _windowHeight;
+
+ // Adjust one dimension for mantaining the aspect ratio.
+ if (abs(outputAspect - desiredAspect) >= (int)(FRAC_ONE / 1000)) {
+ if (outputAspect < desiredAspect) {
+ _viewport.h = _videoMode.hardwareHeight * _windowWidth / _videoMode.hardwareWidth;
+ } else if (outputAspect > desiredAspect) {
+ _viewport.w = _videoMode.hardwareWidth * _windowHeight / _videoMode.hardwareHeight;
+ }
+ }
+
+ _viewport.x = (_windowWidth - _viewport.w) / 2;
+ _viewport.y = (_windowHeight - _viewport.h) / 2;
+
+ // Force a full redraw because we changed the viewport.
+ _forceFull = true;
+}
+
SDL_Surface *SurfaceSdlGraphicsManager::SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags) {
deinitializeRenderer();
- if (!_window->createWindow(width, height, (flags & SDL_FULLSCREEN) ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0)) {
+ uint32 createWindowFlags = 0;
+#ifdef USE_SDL_RESIZABLE_WINDOW
+ createWindowFlags |= SDL_WINDOW_RESIZABLE;
+#endif
+ if ((flags & SDL_FULLSCREEN) != 0) {
+ createWindowFlags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
+ }
+
+ if (!_window->createWindow(width, height, createWindowFlags)) {
return nullptr;
}
@@ -2390,6 +2464,9 @@ SDL_Surface *SurfaceSdlGraphicsManager::SDL_SetVideoMode(int width, int height,
return nullptr;
}
+ SDL_GetWindowSize(_window->getSDLWindow(), &_windowWidth, &_windowHeight);
+ setWindowResolution(_windowWidth, _windowHeight);
+
_screenTexture = SDL_CreateTexture(_renderer, SDL_PIXELFORMAT_RGB565, SDL_TEXTUREACCESS_STREAMING, width, height);
if (!_screenTexture) {
deinitializeRenderer();
@@ -2409,7 +2486,7 @@ void SurfaceSdlGraphicsManager::SDL_UpdateRects(SDL_Surface *screen, int numrect
SDL_UpdateTexture(_screenTexture, nullptr, screen->pixels, screen->pitch);
SDL_RenderClear(_renderer);
- SDL_RenderCopy(_renderer, _screenTexture, NULL, NULL);
+ SDL_RenderCopy(_renderer, _screenTexture, NULL, &_viewport);
SDL_RenderPresent(_renderer);
}
#endif // SDL_VERSION_ATLEAST(2, 0, 0)
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index 2431ce8664..c4f7346525 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -39,6 +39,15 @@
#define USE_SDL_DEBUG_FOCUSRECT
#endif
+// We have (some) support for resizable windows when SDL2 is used. However
+// the overlay still uses the resolution setup with SDL_SetVideoMode. This
+// makes the GUI look subpar when the user resizes the window. In addition
+// we do not adapt the scale factor right now. Thus, we disable this code
+// path for now.
+#if SDL_VERSION_ATLEAST(2, 0, 0) && 0
+#define USE_SDL_RESIZABLE_WINDOW
+#endif
+
#if !defined(_WIN32_WCE) && !defined(__SYMBIAN32__)
// Uncomment this to enable the 'on screen display' code.
#define USE_OSD 1
@@ -143,6 +152,9 @@ public:
// SdlGraphicsManager interface
virtual void notifyVideoExpose();
+#ifdef USE_SDL_RESIZABLE_WINDOW
+ virtual void notifyResize(const uint width, const uint height);
+#endif
virtual void transformMouseCoordinates(Common::Point &point);
virtual void notifyMousePos(Common::Point mouse);
@@ -171,7 +183,10 @@ protected:
* around this API to keep the code paths as close as possible. */
SDL_Renderer *_renderer;
SDL_Texture *_screenTexture;
+ SDL_Rect _viewport;
+ int _windowWidth, _windowHeight;
void deinitializeRenderer();
+ void setWindowResolution(int width, int height);
SDL_Surface *SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags);
void SDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects);
diff --git a/backends/midi/timidity.cpp b/backends/midi/timidity.cpp
index d10b808bdb..497138850a 100644
--- a/backends/midi/timidity.cpp
+++ b/backends/midi/timidity.cpp
@@ -316,6 +316,7 @@ int MidiDriver_TIMIDITY::connect_to_server(const char* hostname, unsigned short
if (connect(fd, (struct sockaddr *)&in, sizeof(in)) < 0) {
warning("TiMidity: connect(): %s", strerror(errno));
+ ::close(fd);
return -1;
}
diff --git a/backends/mixer/sdl/sdl-mixer.cpp b/backends/mixer/sdl/sdl-mixer.cpp
index dc0c853808..0ca3231892 100644
--- a/backends/mixer/sdl/sdl-mixer.cpp
+++ b/backends/mixer/sdl/sdl-mixer.cpp
@@ -30,8 +30,10 @@
#include "common/config-manager.h"
#include "common/textconsole.h"
-#ifdef GP2X
+#if defined(GP2X)
#define SAMPLES_PER_SEC 11025
+#elif defined(PLAYSTATION3)
+#define SAMPLES_PER_SEC 48000
#else
#define SAMPLES_PER_SEC 44100
#endif
@@ -78,34 +80,49 @@ void SdlMixerManager::init() {
if (SDL_OpenAudio(&fmt, &_obtained) != 0) {
warning("Could not open audio device: %s", SDL_GetError());
+ // The mixer is not marked as ready
_mixer = new Audio::MixerImpl(g_system, desired.freq);
- assert(_mixer);
- _mixer->setReady(false);
- } else {
- debug(1, "Output sample rate: %d Hz", _obtained.freq);
- if (_obtained.freq != desired.freq)
- warning("SDL mixer output sample rate: %d differs from desired: %d", _obtained.freq, desired.freq);
+ return;
+ }
+
+ // The obtained sample format is not supported by the mixer, call
+ // SDL_OpenAudio again with NULL as the second argument to force
+ // SDL to do resampling to the desired audio spec.
+ if (_obtained.format != desired.format) {
+ debug(1, "SDL mixer sound format: %d differs from desired: %d", _obtained.format, desired.format);
+ SDL_CloseAudio();
+
+ if (SDL_OpenAudio(&fmt, NULL) != 0) {
+ warning("Could not open audio device: %s", SDL_GetError());
+
+ // The mixer is not marked as ready
+ _mixer = new Audio::MixerImpl(g_system, desired.freq);
+ return;
+ }
- debug(1, "Output buffer size: %d samples", _obtained.samples);
- if (_obtained.samples != desired.samples)
- warning("SDL mixer output buffer size: %d differs from desired: %d", _obtained.samples, desired.samples);
+ _obtained = desired;
+ }
+
+ debug(1, "Output sample rate: %d Hz", _obtained.freq);
+ if (_obtained.freq != desired.freq)
+ warning("SDL mixer output sample rate: %d differs from desired: %d", _obtained.freq, desired.freq);
- if (_obtained.format != desired.format)
- warning("SDL mixer sound format: %d differs from desired: %d", _obtained.format, desired.format);
+ debug(1, "Output buffer size: %d samples", _obtained.samples);
+ if (_obtained.samples != desired.samples)
+ warning("SDL mixer output buffer size: %d differs from desired: %d", _obtained.samples, desired.samples);
#ifndef __SYMBIAN32__
- // The SymbianSdlMixerManager does stereo->mono downmixing,
- // but otherwise we require stereo output.
- if (_obtained.channels != 2)
- error("SDL mixer output requires stereo output device");
+ // The SymbianSdlMixerManager does stereo->mono downmixing,
+ // but otherwise we require stereo output.
+ if (_obtained.channels != 2)
+ error("SDL mixer output requires stereo output device");
#endif
- _mixer = new Audio::MixerImpl(g_system, _obtained.freq);
- assert(_mixer);
- _mixer->setReady(true);
+ _mixer = new Audio::MixerImpl(g_system, _obtained.freq);
+ assert(_mixer);
+ _mixer->setReady(true);
- startAudio();
- }
+ startAudio();
}
SDL_AudioSpec SdlMixerManager::getAudioSpec(uint32 outputRate) {
diff --git a/backends/mixer/sdl13/sdl13-mixer.cpp b/backends/mixer/sdl13/sdl13-mixer.cpp
deleted file mode 100644
index dc38242bde..0000000000
--- a/backends/mixer/sdl13/sdl13-mixer.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/scummsys.h"
-
-#if defined(SDL_BACKEND)
-
-#include "backends/mixer/sdl13/sdl13-mixer.h"
-#include "common/debug.h"
-#include "common/system.h"
-#include "common/config-manager.h"
-#include "common/textconsole.h"
-
-#ifdef GP2X
-#define SAMPLES_PER_SEC 11025
-#else
-#define SAMPLES_PER_SEC 44100
-#endif
-
-Sdl13MixerManager::Sdl13MixerManager()
- :
- SdlMixerManager(),
- _device(0) {
-
-}
-
-Sdl13MixerManager::~Sdl13MixerManager() {
- _mixer->setReady(false);
-
- SDL_CloseAudioDevice(_device);
-
- delete _mixer;
-}
-
-void Sdl13MixerManager::init() {
- // Start SDL Audio subsystem
- if (SDL_InitSubSystem(SDL_INIT_AUDIO) == -1) {
- error("Could not initialize SDL: %s", SDL_GetError());
- }
-
- // Get the desired audio specs
- SDL_AudioSpec desired = getAudioSpec(SAMPLES_PER_SEC);
-
- // Start SDL audio with the desired specs
- _device = SDL_OpenAudioDevice(NULL, 0, &desired, &_obtained,
- SDL_AUDIO_ALLOW_FREQUENCY_CHANGE);
-
- if (_device <= 0) {
- warning("Could not open audio device: %s", SDL_GetError());
-
- _mixer = new Audio::MixerImpl(g_system, desired.freq);
- assert(_mixer);
- _mixer->setReady(false);
- } else {
- debug(1, "Output sample rate: %d Hz", _obtained.freq);
-
- _mixer = new Audio::MixerImpl(g_system, _obtained.freq);
- assert(_mixer);
- _mixer->setReady(true);
-
- startAudio();
- }
-}
-
-void Sdl13MixerManager::startAudio() {
- // Start the sound system
- SDL_PauseAudioDevice(_device, 0);
-}
-
-void Sdl13MixerManager::suspendAudio() {
- SDL_CloseAudioDevice(_device);
- _audioSuspended = true;
-}
-
-int Sdl13MixerManager::resumeAudio() {
- if (!_audioSuspended)
- return -2;
-
- _device = SDL_OpenAudioDevice(NULL, 0, &_obtained, NULL, 0);
- if (_device <= 0) {
- return -1;
- }
-
- SDL_PauseAudioDevice(_device, 0);
- _audioSuspended = false;
- return 0;
-}
-
-#endif
diff --git a/backends/module.mk b/backends/module.mk
index e5e2905781..3d7dea1f26 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -72,13 +72,11 @@ MODULE_OBJS += \
plugins/sdl/sdl-provider.o \
timer/sdl/sdl-timer.o
-# SDL 1.3 removed audio CD support
-ifndef USE_SDL13
+# SDL 2 removed audio CD support
ifndef USE_SDL2
MODULE_OBJS += \
audiocd/sdl/sdl-audiocd.o
endif
-endif
ifdef USE_OPENGL
MODULE_OBJS += \
@@ -125,8 +123,7 @@ MODULE_OBJS += \
fs/posix/posix-fs.o \
fs/posix/posix-fs-factory.o \
fs/ps3/ps3-fs-factory.o \
- events/ps3sdl/ps3sdl-events.o \
- mixer/sdl13/sdl13-mixer.o
+ events/ps3sdl/ps3sdl-events.o
endif
ifeq ($(BACKEND),tizen)
diff --git a/backends/platform/sdl/macosx/appmenu_osx.mm b/backends/platform/sdl/macosx/appmenu_osx.mm
index d083fb8483..feea40bc06 100644
--- a/backends/platform/sdl/macosx/appmenu_osx.mm
+++ b/backends/platform/sdl/macosx/appmenu_osx.mm
@@ -28,12 +28,22 @@
#include <Cocoa/Cocoa.h>
-// Apple removed setAppleMenu from the header files in 10.4,
-// but as the method still exists we declare it ourselves here.
+// Apple added setAppleMenu in 10.5 and removed it in 10.6.
+// But as the method still exists we declare it ourselves here.
// Yes, this works :)
@interface NSApplication(MissingFunction)
- (void)setAppleMenu:(NSMenu *)menu;
@end
+// However maybe we should conditionally use it depending on the system on which we run ScummVM (and not
+// the one on which we compile) to only do it on OS X 10.5.
+// Here is the relevant bit from the release notes for 10.6:
+// In Leopard and earlier, apps that tried to construct a menu bar without a nib would get an undesirable
+// stubby application menu that could not be removed. To work around this problem on Leopard, you can call
+// the undocumented setAppleMenu: method and pass it the application menu, like so:
+// [NSApp setAppleMenu:[[[NSApp mainMenu] itemAtIndex:0] submenu]];
+// In SnowLeopard, this workaround is unnecessary and should not be used. Under SnowLeopard, the first menu
+// is always identified as the application menu.
+
NSString *constructNSStringFromCString(const char *rawCString, CFStringEncoding stringEncoding) {
return (NSString *)CFStringCreateWithCString(NULL, rawCString, stringEncoding);
@@ -46,13 +56,14 @@ void replaceApplicationMenuItems() {
NSMenu *windowMenu;
NSMenuItem *menuItem;
- // For some reason [[NSApp mainMenu] removeAllItems] doesn't work and crashes, so we need
- // to remove the SDL generated menus one by one
- [[NSApp mainMenu] removeItemAtIndex:0]; // Remove application menu
- [[NSApp mainMenu] removeItemAtIndex:0]; // Remove "Windows" menu
+ // We cannot use [[NSApp mainMenu] removeAllItems] as removeAllItems was added in OS X 10.6
+ // So remove the SDL generated menus one by one instead.
+ while ([[NSApp mainMenu] numberOfItems] > 0) {
+ [[NSApp mainMenu] removeItemAtIndex:0];
+ }
// Create new application menu
- appleMenu = [[NSMenu alloc] initWithTitle:@""];
+ appleMenu = [[NSMenu alloc] initWithTitle:@"ScummVM"];
NSString *nsString = NULL;
diff --git a/backends/platform/sdl/ps3/ps3.cpp b/backends/platform/sdl/ps3/ps3.cpp
index f111379794..0bb8300014 100644
--- a/backends/platform/sdl/ps3/ps3.cpp
+++ b/backends/platform/sdl/ps3/ps3.cpp
@@ -31,7 +31,6 @@
#include "backends/saves/default/default-saves.h"
#include "backends/fs/ps3/ps3-fs-factory.h"
#include "backends/events/ps3sdl/ps3sdl-events.h"
-#include "backends/mixer/sdl13/sdl13-mixer.h"
#include <dirent.h>
#include <sys/stat.h>
@@ -68,14 +67,6 @@ void OSystem_PS3::initBackend() {
if (_savefileManager == 0)
_savefileManager = new DefaultSaveFileManager(PREFIX "/saves");
- // Create the mixer manager
- if (_mixer == 0) {
- _mixerManager = new Sdl13MixerManager();
-
- // Setup and start mixer
- _mixerManager->init();
- }
-
// Event source
if (_eventSource == 0)
_eventSource = new PS3SdlEventSource();
diff --git a/backends/platform/sdl/raspberrypi/README.RASPBERRYPI b/backends/platform/sdl/raspberrypi/README.RASPBERRYPI
new file mode 100644
index 0000000000..ab0e674c31
--- /dev/null
+++ b/backends/platform/sdl/raspberrypi/README.RASPBERRYPI
@@ -0,0 +1,77 @@
+ScummVM-RASPBERRYPI README
+==============================================================================
+
+Notes
+============
+
+This version of ScummVM uses SDL2 hardware accelerated graphics, be it
+plain SDL2 which in turn uses dispmanx/gles2 or by using gles1 via an
+SDL2-configured GLES1 context.
+
+Requirements
+============
+- Raspberry Pi 1 or 2 microcomputer.
+- Raspbian (Debian) installed on SD card. Other distros may be supported if
+ they include the VideoCore runtime libraries that Raspbian includes.
+-An attached keyboard and mouse, or alternatively joystick.
+
+Controls
+============
+
+The standard ScummVM keyboard and mouse controls are used as in any other
+GNU/Linux based system.
+Use the --joystick parameter if you want to use a joystick instead of the
+intended mouse for playing the games (not recommended).
+
+Installation from binaries
+==============================
+
+We have at least three methods to get the binaries into the Raspbian SD:
+
+1) Since Debian (Raspbian) includes an ssh service by default, I recommend
+keeping the SD card on the Raspberry Pi, and using scp to copy the package over
+to your home directory in the Debian filesystem.
+
+scp scummvm-rpi_<version>.zip pi@<raspberrypi_ip>:/home/pi
+
+2) If your RaspberryPi has internet access, you can simply use wget to
+download the package to your home folder:
+
+cd ~/
+wget <package_link>
+
+3) You could also connect the Raspbian SD card to your main PC and, after
+mounting it (or being automounted as it would be in most desktop GNU/Linux
+systems), copy the package file manually to your home directory.
+How to mount an SD and copy files to it is beyond the scope of this README.
+
+Once we have the package file in our home directory using one of the three
+aforementioned methods, we would need to uncompress it:
+
+unzip scummvm-rpi_<version>.zip
+
+As a result, a directory containing the scummvm along with this README will be
+created.
+We can run it by simply changing to our scummvm directory and executing the
+scummvm file.
+
+cd scummvm-rpi
+./scummvm
+
+I recommend copying the games to /home/pi/scummvm-rpi. Adding the games via the menu
+works as in any other system ScummVM runs on.
+
+Building from sources
+==============================
+
+Recommended method is building by cross-compiling on a GNU/Linux X86-based computer.
+You can find concise instructions for this on the ScummVM wiki:
+
+http://wiki.scummvm.org/index.php/Compiling_ScummVM/RPI
+
+The configure script is disabling scalers because we prefer dispmanx for that, which
+makes scalers unnecessary on a CPU limited platform like this, timestamps because most people
+doesn't have an RTC on the Raspberry Pi, and event recorder to save SD card write cycles.
+All these are automatically disabled when we crosscompile by passing "--host=raspberrypi".
+
+Enjoy!
diff --git a/backends/platform/sdl/sdl.cpp b/backends/platform/sdl/sdl.cpp
index 6d4dede212..fffb9d56d9 100644
--- a/backends/platform/sdl/sdl.cpp
+++ b/backends/platform/sdl/sdl.cpp
@@ -36,8 +36,8 @@
#include "backends/saves/default/default-saves.h"
-// Audio CD support was removed with SDL 1.3
-#if SDL_VERSION_ATLEAST(1, 3, 0)
+// Audio CD support was removed with SDL 2.0
+#if SDL_VERSION_ATLEAST(2, 0, 0)
#include "backends/audiocd/default/default-audiocd.h"
#else
#include "backends/audiocd/sdl/sdl-audiocd.h"
@@ -246,8 +246,8 @@ void OSystem_SDL::initBackend() {
#endif
if (_audiocdManager == 0) {
- // Audio CD support was removed with SDL 1.3
-#if SDL_VERSION_ATLEAST(1, 3, 0)
+ // Audio CD support was removed with SDL 2.0
+#if SDL_VERSION_ATLEAST(2, 0, 0)
_audiocdManager = new DefaultAudioCDManager();
#else
_audiocdManager = new SdlAudioCDManager();
diff --git a/backends/platform/symbian/AdaptAllMMPs.pl b/backends/platform/symbian/AdaptAllMMPs.pl
index 6b9f918a51..a836b764d2 100644
--- a/backends/platform/symbian/AdaptAllMMPs.pl
+++ b/backends/platform/symbian/AdaptAllMMPs.pl
@@ -56,6 +56,7 @@ chdir("../../../");
"mmp/scummvm_lastexpress.mmp",
"mmp/scummvm_mads.mmp",
"mmp/scummvm_prince.mmp",
+ "mmp/scummvm_sherlock.mmp",
"mmp/scummvm_sword25.mmp",
"mmp/scummvm_testbed.mmp",
"mmp/scummvm_zvision.mmp",
@@ -203,6 +204,7 @@ ParseModule("_lastexpress","lastexpress", \@section_empty);
ParseModule("_m4", "m4", \@section_empty);
ParseModule("_mads" ,"mads", \@section_empty);
ParseModule("_prince" ,"prince", \@section_empty);
+ParseModule("_sherlock" ,"sherlock", \@section_empty);
ParseModule("_sword25" ,"sword25", \@section_empty);
ParseModule("_testbed" ,"testbed", \@section_empty);
ParseModule("_zvision" ,"zvision", \@section_empty);
diff --git a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl
index 8c19631524..10bcf0340a 100644
--- a/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl
+++ b/backends/platform/symbian/BuildPackageUpload_LocalSettings.pl
@@ -1,36 +1,32 @@
##################################################################################################################
+#### sword25 ignored because of incompatible resolution 800*600
@WorkingEngines = qw(
- agos agi cine cge composer cruise draci dreamweb
- drascula hugo gob groovie hopkins kyra lastexpress
- lure made mohawk mortevielle neverhood parallaction
- pegasus queen saga sci scumm sky sword1 sword2
- teenagent tinsel toltecs tony toon touche tsage
- tucker voyeur wintermute
- access avalanche bbvs cge2 fullpipe mads prince
- testbed zvision
+ access agi agos avalanche bbvs cge cge2
+ cine composer cruise draci drascula
+ dreamweb fullpipe gob groovie hopkins
+ hugo kyra lastexpress lure made mads
+ mohawk mortevielle neverhood parallaction
+ pegasus prince queen saga sci scumm
+ sherlock sky sword1 sword2 teenagent
+ testbed tinsel toltecs tony toon touche
+ tsage tucker voyeur wintermute zvision
);
-
-#### sword25 yet not added
-
-#### In progress engines are :
-#### access avalanche bbvs cge2 fullpipe mads prince
-#### testbed zvision
@WorkingEngines_1st = qw(
- cine composer cruise drascula groovie
- lastexpress made parallaction queen saga
- scumm touche tucker wintermute voyeur
- access avalanche cge2 zvision
+ access agi agos cge2 cine composer cruise
+ drascula gob groovie kyra lastexpress made
+ neverhood parallaction queen saga scumm
+ touche tucker voyeur wintermute
);
@WorkingEngines_2nd = qw(
- agi agos cge draci dreamweb gob hopkins
- hugo kyra lure mohawk mortevielle neverhood
- pegasus sci sky sword1 sword2 teenagent
- tinsel tsage toltecs tony toon
- bbvs fullpipe mads prince testbed
+ avalanche bbvs cge draci dreamweb fullpipe
+ hopkins hugo lure mads mohawk mortevielle
+ pegasus prince sci sherlock sky sword1 sword2
+ teenagent testbed tinsel toltecs tony toon
+ tsage zvision
);
#### sword25 yet not added
diff --git a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in
index c9e4769484..308b9ee2af 100644
--- a/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in
+++ b/backends/platform/symbian/S60v3/ScummVM_A0000658_S60v3.mmp.in
@@ -36,7 +36,7 @@ TARGETPATH sys\bin
TARGETTYPE exe
OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
// fixes error "section .data loaded at [...] overlaps section .text loaded at [...]"
-LINKEROPTION GCCE -Tdata 0xAA00000
+LINKEROPTION GCCE -Tdata 0xAA00000 --gc-sections --strip-all
UID 0x100039ce 0xA0000658
@@ -122,6 +122,7 @@ SOURCEPATH ..\..\..\..
// backend EPOC/SDL/ESDL specific includes
SOURCE backends\platform\sdl\sdl.cpp
+SOURCE backends\platform\sdl\sdl-window.cpp
SOURCE backends\audiocd\sdl\sdl-audiocd.cpp
SOURCE backends\audiocd\default\default-audiocd.cpp
SOURCE backends\fs\symbian\symbian-fs.cpp
diff --git a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
index f2d7b51a7a..4e6e62362c 100644
--- a/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
+++ b/backends/platform/symbian/S60v3/ScummVM_S60v3.mmp.in
@@ -37,7 +37,7 @@ TARGETTYPE exe
OPTION GCCE -Wno-multichar -Wno-reorder -Wno-unused -Wno-format -fsigned-char
// fixes error "section .data loaded at [...] overlaps section .text loaded at [...]"
-LINKEROPTION GCCE -Tdata 0xAA00000
+LINKEROPTION GCCE -Tdata 0xAA00000 --gc-sections --strip-all
UID 0x100039ce 0xA0000657
@@ -123,6 +123,7 @@ SOURCEPATH ..\..\..\..
// backend EPOC/SDL/ESDL specific includes
SOURCE backends\platform\sdl\sdl.cpp
+SOURCE backends\platform\sdl\sdl-window.cpp
SOURCE backends\audiocd\sdl\sdl-audiocd.cpp
SOURCE backends\audiocd\default\default-audiocd.cpp
SOURCE backends\fs\symbian\symbian-fs.cpp
diff --git a/backends/platform/symbian/help/ScummVM.rtf b/backends/platform/symbian/help/ScummVM.rtf
index 15b2105ecd..220eb76ecd 100644
--- a/backends/platform/symbian/help/ScummVM.rtf
+++ b/backends/platform/symbian/help/ScummVM.rtf
@@ -39,26 +39,28 @@ Synonyms;}{\*\cs33 \additive \super \sbasedon10 endnote reference;}{\s34\ql \fi-
\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext34 \sautoupd List Bullet;}{\s35\ql \fi-284\li568\ri0\sa120\widctlpar{\*\pn \pnlvlblt\ilvl10\ls2047\pnrnot0\pnf3\pnstart1\pnindent283\pnhang{\pntxtb \'b7}}
\nooverflow\faroman\ls2047\ilvl10\rin0\lin568\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext35 \sautoupd List Bullet 2;}{\s36\ql \li0\ri0\sa120\widctlpar\tqc\tx4153\tqr\tx8306\nooverflow\faroman\rin0\lin0\itap0
\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext36 footer;}{\s37\ql \li284\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin284\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext37 List Continue;}{
-\s38\ql \li566\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin566\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext38 List Continue 2;}}{\*\listtable{\list\listtemplateid-737142542\listsimple{\listlevel\levelnfc0
-\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li643\jclisttab\tx643 }{\listname ;}\listid-129}
-{\list\listtemplateid1907811784\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0
-\fi-360\li643\jclisttab\tx643 }{\listname ;}\listid-125}{\list\listtemplateid1912741052\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\chbrdr
-\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid-120}{\list\listtemplateid-51363132\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
-{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid-119}{\list\listtemplateid947971744\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0
-\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\'01*;}{\levelnumbers;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 }{\listname ;}\listid-2}}{\*\listoverridetable{\listoverride\listid-120\listoverridecount0\ls1}
-{\listoverride\listid-129\listoverridecount0\ls2}{\listoverride\listid-119\listoverridecount0\ls3}{\listoverride\listid-125\listoverridecount0\ls4}{\listoverride\listid-120\listoverridecount0\ls5}{\listoverride\listid-129\listoverridecount0\ls6}
-{\listoverride\listid-119\listoverridecount0\ls7}{\listoverride\listid-125\listoverridecount0\ls8}{\listoverride\listid-120\listoverridecount0\ls9}{\listoverride\listid-129\listoverridecount0\ls10}{\listoverride\listid-119\listoverridecount0\ls11}
-{\listoverride\listid-125\listoverridecount0\ls12}{\listoverride\listid-120\listoverridecount0\ls13}{\listoverride\listid-129\listoverridecount0\ls14}{\listoverride\listid-119\listoverridecount0\ls15}{\listoverride\listid-125\listoverridecount0\ls16}
-{\listoverride\listid-120\listoverridecount0\ls17}{\listoverride\listid-129\listoverridecount0\ls18}{\listoverride\listid-119\listoverridecount0\ls19}{\listoverride\listid-125\listoverridecount0\ls20}{\listoverride\listid-120\listoverridecount0\ls21}
-{\listoverride\listid-129\listoverridecount0\ls22}{\listoverride\listid-119\listoverridecount0\ls23}{\listoverride\listid-125\listoverridecount0\ls24}{\listoverride\listid-120\listoverridecount0\ls25}{\listoverride\listid-129\listoverridecount0\ls26}
-{\listoverride\listid-119\listoverridecount0\ls27}{\listoverride\listid-125\listoverridecount0\ls28}{\listoverride\listid-120\listoverridecount0\ls29}{\listoverride\listid-129\listoverridecount0\ls30}{\listoverride\listid-119\listoverridecount0\ls31}
-{\listoverride\listid-125\listoverridecount0\ls32}{\listoverride\listid-120\listoverridecount0\ls33}{\listoverride\listid-129\listoverridecount0\ls34}{\listoverride\listid-119\listoverridecount0\ls35}{\listoverride\listid-125\listoverridecount0\ls36}
-{\listoverride\listid-120\listoverridecount0\ls37}{\listoverride\listid-129\listoverridecount0\ls38}{\listoverride\listid-119\listoverridecount0\ls39}{\listoverride\listid-125\listoverridecount0\ls40}{\listoverride\listid-2\listoverridecount1{\lfolevel
-\listoverrideformat{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelold\levelspace0\levelindent283{\leveltext\'01\u-3991 ?;}{\levelnumbers;}\f30\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-283\li283
-}}\ls41}{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelold\levelspace0\levelindent283{\leveltext\'01\u-3991 ?;}{\levelnumbers;}\f30\chbrdr
-\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-283\li283 }}\ls42}}{\info{\author Fedor}{\operator Fedor}{\creatim\yr2013\mo11\dy30\hr23\min4}{\revtim\yr2014\mo12\dy29\hr22\min52}{\version102}{\edmins95}{\nofpages8}{\nofwords1514}{\nofchars8634}
-{\*\company DEV}{\nofcharsws0}{\vern8249}}\margl1701\margr850\margt1134\margb1134 \deftab708\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0
-\dgvshow3\jcompress\viewkind4\viewscale100\nolnhtadjtbl \fet0{\*\template E:\\Documents and Settings\\Administrator\\Application Data\\Microsoft\\\'d8\'e0\'e1\'eb\'ee\'ed\'fb\\cshelp2000.dot}\sectd \linex0\sectdefaultcl {\*\pnseclvl1
+\s38\ql \li566\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin566\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 \sbasedon0 \snext38 List Continue 2;}{\*\cs39 \additive \sbasedon10 x x-first x-last;}}{\*\listtable
+{\list\listtemplateid-737142542\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'02\'00.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li643
+\jclisttab\tx643 }{\listname ;}\listid-129}{\list\listtemplateid1907811784\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr
+\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li643\jclisttab\tx643 }{\listname ;}\listid-125}{\list\listtemplateid1912741052\listsimple{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace0\levelindent0
+{\leveltext\'02\'00.;}{\levelnumbers\'01;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid-120}{\list\listtemplateid-51363132\listsimple{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0
+\levelfollow0\levelstartat1\levelspace0\levelindent0{\leveltext\'01\u-3913 ?;}{\levelnumbers;}\f3\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-360\li360\jclisttab\tx360 }{\listname ;}\listid-119}{\list\listtemplateid947971744\listsimple
+{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat0\levelspace0\levelindent0{\leveltext\'01*;}{\levelnumbers;}\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1 }{\listname ;}\listid-2}}{\*\listoverridetable
+{\listoverride\listid-120\listoverridecount0\ls1}{\listoverride\listid-129\listoverridecount0\ls2}{\listoverride\listid-119\listoverridecount0\ls3}{\listoverride\listid-125\listoverridecount0\ls4}{\listoverride\listid-120\listoverridecount0\ls5}
+{\listoverride\listid-129\listoverridecount0\ls6}{\listoverride\listid-119\listoverridecount0\ls7}{\listoverride\listid-125\listoverridecount0\ls8}{\listoverride\listid-120\listoverridecount0\ls9}{\listoverride\listid-129\listoverridecount0\ls10}
+{\listoverride\listid-119\listoverridecount0\ls11}{\listoverride\listid-125\listoverridecount0\ls12}{\listoverride\listid-120\listoverridecount0\ls13}{\listoverride\listid-129\listoverridecount0\ls14}{\listoverride\listid-119\listoverridecount0\ls15}
+{\listoverride\listid-125\listoverridecount0\ls16}{\listoverride\listid-120\listoverridecount0\ls17}{\listoverride\listid-129\listoverridecount0\ls18}{\listoverride\listid-119\listoverridecount0\ls19}{\listoverride\listid-125\listoverridecount0\ls20}
+{\listoverride\listid-120\listoverridecount0\ls21}{\listoverride\listid-129\listoverridecount0\ls22}{\listoverride\listid-119\listoverridecount0\ls23}{\listoverride\listid-125\listoverridecount0\ls24}{\listoverride\listid-120\listoverridecount0\ls25}
+{\listoverride\listid-129\listoverridecount0\ls26}{\listoverride\listid-119\listoverridecount0\ls27}{\listoverride\listid-125\listoverridecount0\ls28}{\listoverride\listid-120\listoverridecount0\ls29}{\listoverride\listid-129\listoverridecount0\ls30}
+{\listoverride\listid-119\listoverridecount0\ls31}{\listoverride\listid-125\listoverridecount0\ls32}{\listoverride\listid-120\listoverridecount0\ls33}{\listoverride\listid-129\listoverridecount0\ls34}{\listoverride\listid-119\listoverridecount0\ls35}
+{\listoverride\listid-125\listoverridecount0\ls36}{\listoverride\listid-120\listoverridecount0\ls37}{\listoverride\listid-129\listoverridecount0\ls38}{\listoverride\listid-119\listoverridecount0\ls39}{\listoverride\listid-125\listoverridecount0\ls40}
+{\listoverride\listid-120\listoverridecount0\ls41}{\listoverride\listid-129\listoverridecount0\ls42}{\listoverride\listid-119\listoverridecount0\ls43}{\listoverride\listid-125\listoverridecount0\ls44}{\listoverride\listid-120\listoverridecount0\ls45}
+{\listoverride\listid-129\listoverridecount0\ls46}{\listoverride\listid-119\listoverridecount0\ls47}{\listoverride\listid-125\listoverridecount0\ls48}{\listoverride\listid-2\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\levelnfcn23
+\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelold\levelspace0\levelindent283{\leveltext\'01\u-3991 ?;}{\levelnumbers;}\f30\chbrdr\brdrnone\brdrcf1 \chshdng0\chcfpat1\chcbpat1\fbias0 \fi-283\li283 }}\ls49}{\listoverride\listid-2
+\listoverridecount1{\lfolevel\listoverrideformat{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelold\levelspace0\levelindent283{\leveltext\'01\u-3991 ?;}{\levelnumbers;}\f30\chbrdr\brdrnone\brdrcf1
+\chshdng0\chcfpat1\chcbpat1\fbias0 \fi-283\li283 }}\ls50}}{\info{\author Fedor}{\operator Fedor}{\creatim\yr2013\mo11\dy30\hr23\min4}{\revtim\yr2015\mo11\dy22\hr17\min27}{\version105}{\edmins185}{\nofpages8}{\nofwords1514}{\nofchars8634}{\*\company DEV}
+{\nofcharsws0}{\vern8249}}\margl1701\margr850\margt1134\margb1134 \deftab708\widowctrl\ftnbj\aenddoc\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\horzdoc\dghspace120\dgvspace120\dghorigin1701\dgvorigin1984\dghshow0\dgvshow3
+\jcompress\viewkind4\viewscale100\nolnhtadjtbl \fet0{\*\template E:\\Documents and Settings\\Administrator\\Application Data\\Microsoft\\\'d8\'e0\'e1\'eb\'ee\'ed\'fb\\cshelp2000.dot}\sectd \linex0\sectdefaultcl {\*\pnseclvl1
\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5
\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang
{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \s17\ql \li0\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \i\f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {
@@ -70,20 +72,19 @@ Synonyms;}{\*\cs33 \additive \super \sbasedon10 endnote reference;}{\s34\ql \fi-
\par }\pard\plain \ql \li0\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f28
\par }\pard\plain \s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072\nooverflow\faroman\outlinelevel1\rin0\lin0\itap0 \b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\b0\f28
About ScummVM Help
-\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls41\pnrnot0
-\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls41\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {About ScummVM Help
+\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls49\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls49\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {About ScummVM Help
\par }\pard\plain \ql \li0\ri0\sa120\widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f28
-\par }{
-This help file based on ScummVM forum thread with some elaborations(in Anotherguest section) and text correction. If you wish add some text or translate you may download and modify source document from https://sourceforge.net/projects/scummvms60git/ and t
-hen send me to fedor_qd@mail.ru
+\par }{This help file based on ScummVM forum thread with some elaborations(in Anotherguest section) and text correction. If you wish add some text or translate you may download and modify source document from https://sourceforge.net/projects/scummvms60git/ a
+nd then send me to fedor_qd@mail.ru
\par Feel free to replace, merge or write you own instead 1st, 2nd and 3rd guides. Other sections require strict translations. And don\rquote t forget add your name :-)
\par First guide contain help by Anotherguest, second - VincentJ, third - murgo. This doc created by Fedor Strizhniou.
\par Enjoys, cheers! Always yours =)}{\lang1059\langfe1033\langnp1059
\par }{\f29
\par }\pard\plain \s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\outlinelevel1\rin0\lin0\itap0
\b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\b0\f28 1st guide
-\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls41\pnrnot0
-\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls41\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Controls, Virtual keyboard, Shortcuts, ScummVM, Tips, S60, UIQ, UIQ3, S80, s80, S90, s90
+\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls49\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls49\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Controls, Virtual keyboard, Shortcuts, ScummVM, Tips, S60, UIQ, UIQ3, S80, s80, S90, s90
\par }\pard\plain \ql \li0\ri0\sa120\widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f28
\par }{UIQ3 devices: To the top right (holding the phone portrait) you four icons, from the top they are
\par
@@ -124,22 +125,22 @@ hen send me to fedor_qd@mail.ru
\par
\par What are these Joystick, Keyboard and Cursor modes anyway?
\par }{\f28
-\par }{Joystick mode sends SDL joystick events to ScummVM which acts as a mouse control in ScummVM. Cursor mode sends keyboard arrows instead, so for example it can be used to navigate
-through directorylist (one hand use perhaps!?) or save games etc. Keyboard mode is only available for S60 and enables multi-tap to enter text characters in save dialogs. These modes are implemented at the underlying SDL level, so this determines the types
- of events that ScummVM receives from SDL.
+\par }{Joystick mode sends SDL joystick events to ScummVM which acts as a mouse control in ScummVM. Cursor mode sends keyboard arrows instead, so for exampl
+e it can be used to navigate through directorylist (one hand use perhaps!?) or save games etc. Keyboard mode is only available for S60 and enables multi-tap to enter text characters in save dialogs. These modes are implemented at the underlying SDL level,
+ so this determines the types of events that ScummVM receives from SDL.
\par What are these Shrinked, Zoomed and Upscaled modes anyway?
\par
-\par Shrink displays the game on your screen but in a shrinked way, either in Port
-rait or Landscape mode, so not all the pixels can be seen. Zoom mode uses the maximum resolution of your phone displaying a smaller part of the game zoomed at 1:1 pixels. For scrolling in S60 Zoom mode: 0+Cursor keys to scroll around, 0+Ok button to cente
-r view. Upscale tries to fill the larger screens on S80/S90 devices in a better way for low resolution games. Currently it uses a pixel interpolation upscaling routine.
+\par Shrink displays the game on your screen but in a shrinked way, either in Portrait or Landscape mode, so not all the pixels ca
+n be seen. Zoom mode uses the maximum resolution of your phone displaying a smaller part of the game zoomed at 1:1 pixels. For scrolling in S60 Zoom mode: 0+Cursor keys to scroll around, 0+Ok button to center view. Upscale tries to fill the larger screens
+ on S80/S90 devices in a better way for low resolution games. Currently it uses a pixel interpolation upscaling routine.
\par
\par You can also use a bluetooth mouse with S60v3 devices to control your game. You need the bluetooth hid library from Hinkka http://koti.mbnet.fi/hinkka/Download.html to get it to work properly.
\par }{\f29
\par
\par }\pard\plain \s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\outlinelevel1\rin0\lin0\itap0
\b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\b0\f28 2nd guide
-\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls41\pnrnot0
-\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls41\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Controls, Virtual keyboard, Shortcuts, ScummVM, Tips, S60, s60
+\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls49\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls49\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Controls, Virtual keyboard, Shortcuts, ScummVM, Tips, S60, s60
\par }\pard\plain \ql \li0\ri0\sa120\widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f28
\par
\par }{More user-friendly guide for Nokia phones (based on N96 but should apply to most phones)
@@ -164,8 +165,8 @@ r view. Upscale tries to fill the larger screens on S80/S90 devices in a better
\par }{1 - Change Input.
\par This is the option you'll probably use the most. There are three settings; A,C and J.
\par
-\par A - This is the "Text Input" mode. It allows you to type directly into ScummVM as if you were using a keyboard. Type the same way you would when sending a text message o
-ff of your phone. Please note that the pointer is disabled when in this mode. Don't forget to exit Configuration Mode before typing!
+\par A - This is the "Text Input" mode. It allows you to type directly into ScummVM as if you were using a keyboard. Type the same way you would wh
+en sending a text message off of your phone. Please note that the pointer is disabled when in this mode. Don't forget to exit Configuration Mode before typing!
\par
\par C - This is the "Cursor" mode. This emulates the arrow keys of the keyboard. Some games require using this instead of the mouse (e.g. the destruction derby section towards the end of Full Throttle).
\par
@@ -180,9 +181,9 @@ ff of your phone. Please note that the pointer is disabled when in this mode. Do
\par Only applies to Landscape mode, simply swaps the screen output between having the phone tilted on its left side or on its right side.
\par
\par 4 - Toggle Zoom On and Off
-\par Zooms in on a portion of the screen. Handy for when you are looking through a screen fo
-r items or having trouble reading subtitles. Use the navigation buttons for panning around the play area. Don't forget you'll have to exit out of Configuration Mode before you can move the pointer again. Exiting Configuration Mode does not reset the zoom
-level.
+\par Zooms in on a portion of the screen. Handy for when you are
+looking through a screen for items or having trouble reading subtitles. Use the navigation buttons for panning around the play area. Don't forget you'll have to exit out of Configuration Mode before you can move the pointer again. Exiting Configuration Mo
+de does not reset the zoom level.
\par }{\f29
\par }{5 & 6 - Unused
\par
@@ -203,12 +204,13 @@ level.
\par
\par }\pard\plain \s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\outlinelevel1\rin0\lin0\itap0
\b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\b0\f28 3rd guide
-\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls41\pnrnot0
-\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls41\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Controls, Virtual keyboard, Shortcuts, ScummVM, Tips, S60, s60
+\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls49\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls49\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Controls, Virtual keyboard, Shortcuts, ScummVM, Tips, S60, s60
\par }\pard\plain \ql \li0\ri0\sa120\widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {\f28
\par
-\par }{ScummVM keys on Nokia e71 (most likely on any other qwerty-device, too), tested on version 0.14.0svn (Feb. 18 20
-09 05:56:07). Number keys are inserted by first pressing fn-key (leftmost key at bottom row on E71) and then pressing correct key (e.g. 5 is fn+g). You don't have to press both keys simultaneously.
+\par }{ScummVM keys on Nokia
+ e71 (most likely on any other qwerty-device, too), tested on version 0.14.0svn (Feb. 18 2009 05:56:07). Number keys are inserted by first pressing fn-key (leftmost key at bottom row on E71) and then pressing correct key (e.g. 5 is fn+g). You don't have t
+o press both keys simultaneously.
\par
\par Basic keys:
\par
@@ -258,8 +260,8 @@ level.
\par p -- punch (hand)
\par
\par AGI games (King's Quest, Police Quest etc.):
-\par The games work beautifully on the E71, but there's some stupid bugs (in input). I recall finding some debug keys and "last sentence" / "inventory" -keys in earlier version, but I can't find them any more. Also you can't turn on sirens in Police Quest, whi
-ch kinda makes it unplayable.
+\par The games work beautifully on the E71, but there's some stupid bugs (in input). I recall finding some debug keys and "last sentence" / "inventory" -keys in earlier version, bu
+t I can't find them any more. Also you can't turn on sirens in Police Quest, which kinda makes it unplayable.
\par
\par There's good side and bad side to each input mode:
\par Keyboard (I use this primarily)
@@ -280,8 +282,8 @@ ch kinda makes it unplayable.
\par }{\f28
\par }\pard\plain \s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\outlinelevel1\rin0\lin0\itap0
\b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {ScummVM1 engines list
-\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls42\pnrnot0
-\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls42\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Supported engines
+\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls50\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls50\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Supported engines
\par }\pard\plain \ql \li0\ri0\sa120\widctlpar{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {access
\par agi
\par agos
@@ -315,9 +317,10 @@ ch kinda makes it unplayable.
\par
\par }\pard\plain \s2\ql \li0\ri0\sb120\sa120\keepn\widctlpar\brdrt\brdrs\brdrw30\brsp20 \brdrb\brdrs\brdrw30\brsp20 \tqr\tx9072{\*\pn \pnlvlcont\ilvl0\ls0\pnrnot0\pndec }\nooverflow\faroman\outlinelevel1\rin0\lin0\itap0
\b\f1\fs24\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {ScummVM2 engines list
-\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls42\pnrnot0
-\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls42\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Supported engines
+\par {\pntext\pard\plain\s26 \f30\fs20\lang2057\langfe1033\langnp2057\langfenp1033 \loch\af30\dbch\af0\hich\f30 \'69\tab}}\pard\plain \s26\ql \fi-283\li283\ri0\sa120\widctlpar\brdrb\brdrs\brdrw15\brsp20 {\*\pn \pnlvlblt\ilvl0\ls50\pnrnot0
+\pnf30\pnstart1\pnindent283\pnhang{\pntxtb i}}\nooverflow\faroman\ls50\rin0\lin283\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {Supported engines
\par }\pard\plain \ql \li0\ri0\sa120\widctlpar\nooverflow\faroman\rin0\lin0\itap0 \f1\fs20\lang2057\langfe1033\cgrid\langnp2057\langfenp1033 {avalanche
+\par }{\cs39 bbvs}{
\par cge
\par composer
\par draci
@@ -336,6 +339,7 @@ ch kinda makes it unplayable.
\par prince
\par sci
\par \tab SCI32
+\par sherlock
\par sky
\par sword1
\par sword2
diff --git a/backends/platform/symbian/help/build_help.mk b/backends/platform/symbian/help/build_help.mk
index 7a18ad8252..b2910f9c11 100644
--- a/backends/platform/symbian/help/build_help.mk
+++ b/backends/platform/symbian/help/build_help.mk
@@ -18,12 +18,9 @@ clean :
del ScummVM.hlp
del ScummVM.hlp.hrh
-bld :
- cshlpcmp ScummVM.xml
-
ifeq (WINS,$(findstring WINS, $(PLATFORM)))
copy ScummVM.hlp $(EPOCROOT)epoc32\$(PLATFORM)\c\resource\help
endif
-freeze lib cleanlib final resource savespace releasables :
+bld freeze lib cleanlib final resource savespace releasables :
diff --git a/backends/platform/symbian/mmp/scummvm_base.mmp.in b/backends/platform/symbian/mmp/scummvm_base.mmp.in
index 559d070452..d547070578 100644
--- a/backends/platform/symbian/mmp/scummvm_base.mmp.in
+++ b/backends/platform/symbian/mmp/scummvm_base.mmp.in
@@ -38,6 +38,7 @@ TARGETTYPE lib
OPTION GCCE -I'/Symbian/S60_5th_Edition_SDK_v1.0/epoc32/include/png'
// Note: the LIB:*.lib statements are used by AdaptAllMMPs.pl, so don't remove them!
+MACRO USE_SYSTEM_REMOVE
//START_AUTO_MACROS_MASTER//
// empty base file, will be updated by Perl build scripts
@@ -99,6 +100,7 @@ SOURCEPATH ..\..\..\..\audio
//STOP_AUTO_OBJECTS_AUDIO_//
SOURCE softsynth\fmtowns_pc98\towns_pc98_fmsynth.cpp // Included since its excluded by filter
+SOURCE miles_mt32.cpp
#if defined (WINS)
SOURCE rate.cpp // WINS emulator version: add regular .cpp
diff --git a/backends/platform/symbian/mmp/scummvm_sherlock.mmp.in b/backends/platform/symbian/mmp/scummvm_sherlock.mmp.in
new file mode 100644
index 0000000000..1edd781100
--- /dev/null
+++ b/backends/platform/symbian/mmp/scummvm_sherlock.mmp.in
@@ -0,0 +1,53 @@
+/* ScummVM - Graphic Adventure Engine
+ * Copyright (C) 2003-2005 Andreas 'Sprawl' Karlsson - Original EPOC port, ESDL
+ * Copyright (C) 2003-2005 Lars 'AnotherGuest' Persson - Original EPOC port, Audio System
+ * Copyright (C) 2005 Jurgen 'SumthinWicked' Braam - EPOC/CVS maintainer
+ * Copyright (C) 2005-2015 The ScummVM Team
+ * Copyright (C) 2015 Strizniou Fedor
+ *
+ * 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.
+ *
+ */
+
+//
+// EPOC MMP makefile project for ScummVM
+//
+
+// *** Definitions
+
+TARGET scummvm_sherlock.lib
+TARGETTYPE lib
+#include "config.mmh"
+
+//START_AUTO_MACROS_SLAVE//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_MACROS_SLAVE//
+
+// *** SOURCE files
+
+SOURCEPATH ..\..\..\..\engines\sherlock
+
+//START_AUTO_OBJECTS_SHERLOCK_//
+
+ // empty base file, will be updated by Perl build scripts
+
+//STOP_AUTO_OBJECTS_SHERLOCK_//
+
diff --git a/backends/platform/tizen/graphics.cpp b/backends/platform/tizen/graphics.cpp
index 9b23e3fe78..759c4e519d 100644
--- a/backends/platform/tizen/graphics.cpp
+++ b/backends/platform/tizen/graphics.cpp
@@ -127,7 +127,6 @@ void TizenGraphicsManager::setReady() {
void TizenGraphicsManager::updateScreen() {
if (!_initState) {
OpenGLGraphicsManager::updateScreen();
- eglSwapBuffers(_eglDisplay, _eglSurface);
}
}
@@ -203,3 +202,7 @@ bool TizenGraphicsManager::loadVideoMode(uint requestedWidth, uint requestedHeig
// using a fixed output size we do nothing like that here.
return true;
}
+
+void TizenGraphicsManager::refreshScreen() {
+ eglSwapBuffers(_eglDisplay, _eglSurface);
+}
diff --git a/backends/platform/tizen/graphics.h b/backends/platform/tizen/graphics.h
index f1d4498650..1522d66bbe 100644
--- a/backends/platform/tizen/graphics.h
+++ b/backends/platform/tizen/graphics.h
@@ -61,6 +61,8 @@ protected:
bool loadVideoMode(uint requestedWidth, uint requestedHeight, const Graphics::PixelFormat &format);
+ void refreshScreen();
+
const Graphics::Font *getFontOSD();
private:
diff --git a/backends/taskbar/win32/win32-taskbar.cpp b/backends/taskbar/win32/win32-taskbar.cpp
index d45253c676..0192b1dc03 100644
--- a/backends/taskbar/win32/win32-taskbar.cpp
+++ b/backends/taskbar/win32/win32-taskbar.cpp
@@ -32,6 +32,21 @@
#if defined(__GNUC__) && defined(__MINGW32__) && !defined(__MINGW64__)
#include "backends/taskbar/win32/mingw-compat.h"
#else
+ // We use functionality introduced with Win7 in this file.
+ // To assure that including the respective system headers gives us all
+ // required definitions we set Win7 as minimum version we target.
+ // See: https://msdn.microsoft.com/en-us/library/windows/desktop/aa383745%28v=vs.85%29.aspx#macros_for_conditional_declarations
+ #undef _WIN32_WINNT
+ #define _WIN32_WINNT _WIN32_WINNT_WIN7
+
+ // TODO: We might not need to include this file, the MSDN docs are
+ // not really helpful to decide whether we require it or not.
+ //
+ // Casing of the name is a bit of a mess. MinGW64 seems to use all
+ // lowercase, while MSDN docs suggest "SdkDdkVer.h". We are stuck with
+ // what MinGW64 uses...
+ #include <sdkddkver.h>
+
// We need certain functions that are excluded by default
#undef NONLS
#undef NOICONS
@@ -39,11 +54,6 @@
#if defined(ARRAYSIZE)
#undef ARRAYSIZE
#endif
-
- #if defined(_MSC_VER)
- // Default MSVC headers for ITaskbarList3 and IShellLink
- #include <SDKDDKVer.h>
- #endif
#endif
#include <shlobj.h>
diff --git a/common/algorithm.h b/common/algorithm.h
index 6453073ae5..cbd6eae708 100644
--- a/common/algorithm.h
+++ b/common/algorithm.h
@@ -177,7 +177,8 @@ T sortChoosePivot(T first, T last) {
template<typename T, class StrictWeakOrdering>
T sortPartition(T first, T last, T pivot, StrictWeakOrdering &comp) {
--last;
- SWAP(*pivot, *last);
+ if (pivot != last)
+ SWAP(*pivot, *last);
T sorted;
for (sorted = first; first != last; ++first) {
@@ -188,7 +189,8 @@ T sortPartition(T first, T last, T pivot, StrictWeakOrdering &comp) {
}
}
- SWAP(*last, *sorted);
+ if (last != sorted)
+ SWAP(*last, *sorted);
return sorted;
}
diff --git a/common/dcl.cpp b/common/dcl.cpp
index 5993c218cb..66dfb76b2a 100644
--- a/common/dcl.cpp
+++ b/common/dcl.cpp
@@ -449,6 +449,8 @@ bool DecompressorDCL::unpack(SeekableReadStream *sourceStream, WriteStream *targ
}
if (_targetFixedSize) {
+ if (_bytesWritten != _targetSize)
+ warning("DCL-INFLATE Error: Inconsistent bytes written (%d) and target buffer size (%d)", _bytesWritten, _targetSize);
return _bytesWritten == _targetSize;
}
return true; // For targets featuring dynamic size we always succeed
diff --git a/common/dcl.h b/common/dcl.h
index f90bc23c8d..ade7ebd985 100644
--- a/common/dcl.h
+++ b/common/dcl.h
@@ -25,6 +25,7 @@
* PKWARE DCL ("explode") ("PKWARE data compression library") decompressor used in engines:
* - agos (exclusively for Simon 2 setup.shr file)
* - mohawk
+ * - neverhood
* - sci
*/
diff --git a/common/scummsys.h b/common/scummsys.h
index b8cf7678a4..7c2978f173 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -23,8 +23,8 @@
#ifndef COMMON_SCUMMSYS_H
#define COMMON_SCUMMSYS_H
-#ifndef __has_feature // Optional of course.
- #define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#ifndef __has_feature // Optional of course.
+ #define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
// This is a convenience macro to test whether the compiler used is a GCC
@@ -367,11 +367,11 @@
#endif
#ifndef STRINGBUFLEN
- #if defined(__N64__) || defined(__DS__)
- #define STRINGBUFLEN 256
- #else
- #define STRINGBUFLEN 1024
- #endif
+ #if defined(__N64__) || defined(__DS__)
+ #define STRINGBUFLEN 256
+ #else
+ #define STRINGBUFLEN 1024
+ #endif
#endif
#ifndef MAXPATHLEN
diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp
index 67a3d36cec..da4f577e3c 100644
--- a/common/xmlparser.cpp
+++ b/common/xmlparser.cpp
@@ -97,36 +97,38 @@ bool XMLParser::parserError(const String &errStr) {
assert(_stream->pos() == startPosition);
currentPosition = startPosition;
- int keyOpening = 0;
- int keyClosing = 0;
-
- while (currentPosition-- && keyOpening == 0) {
- _stream->seek(-2, SEEK_CUR);
- c = _stream->readByte();
+ Common::String errorMessage = Common::String::format("\n File <%s>, line %d:\n", _fileName.c_str(), lineCount);
- if (c == '<')
- keyOpening = currentPosition - 1;
- else if (c == '>')
- keyClosing = currentPosition;
- }
+ if (startPosition > 1) {
+ int keyOpening = 0;
+ int keyClosing = 0;
- _stream->seek(startPosition, SEEK_SET);
- currentPosition = startPosition;
- while (keyClosing == 0 && c && currentPosition++) {
- c = _stream->readByte();
+ while (currentPosition-- && keyOpening == 0) {
+ _stream->seek(-2, SEEK_CUR);
+ c = _stream->readByte();
- if (c == '>')
- keyClosing = currentPosition;
- }
+ if (c == '<')
+ keyOpening = currentPosition - 1;
+ else if (c == '>')
+ keyClosing = currentPosition;
+ }
- Common::String errorMessage = Common::String::format("\n File <%s>, line %d:\n", _fileName.c_str(), lineCount);
+ _stream->seek(startPosition, SEEK_SET);
+ currentPosition = startPosition;
+ while (keyClosing == 0 && c && currentPosition++) {
+ c = _stream->readByte();
- currentPosition = (keyClosing - keyOpening);
- _stream->seek(keyOpening, SEEK_SET);
+ if (c == '>')
+ keyClosing = currentPosition;
+ }
- while (currentPosition--)
- errorMessage += (char)_stream->readByte();
+ currentPosition = (keyClosing - keyOpening);
+ _stream->seek(keyOpening, SEEK_SET);
+ while (currentPosition--)
+ errorMessage += (char)_stream->readByte();
+ }
+
errorMessage += "\n\nParser error: ";
errorMessage += errStr;
errorMessage += "\n\n";
diff --git a/configure b/configure
index a2f73644cf..34ffa2fb6a 100755
--- a/configure
+++ b/configure
@@ -867,6 +867,7 @@ Special configuration feature:
tizen for Samsung Tizen
caanoo for Caanoo
dingux for Dingux
+ raspberrypi for Raspberry Pi
dreamcast for Sega Dreamcast
ds for Nintendo DS
gamecube for Nintendo GameCube
@@ -1305,6 +1306,13 @@ arm-riscos)
_host_os=riscos
_host_cpu=arm
;;
+raspberrypi)
+ _host_os=linux
+ _host_cpu=arm
+ # This tuple is the one used by the official Rpi toolchain.
+ # It may change in the future.
+ _host_alias=bcm2708hardfp
+ ;;
caanoo)
_host_os=gph-linux
_host_cpu=arm
@@ -1678,23 +1686,33 @@ LD=$CXX
#
echocheck "compiler version"
-# We first check whether we have an Intel compiler here, since the Intel compiler
-# can also fake itself as an gcc (to ease compatibility with common Linux etc.
-# programs).
+# Some compilers pretend to be gcc to ease compatibility with
+# common Linux etc. programs. We first check for some of these here.
+have_gcc=no
+cc_check_define __GNUC__ && have_gcc=yes
have_icc=no
cc_check_define __INTEL_COMPILER && have_icc=yes
+have_clang=no
+cc_check_define __clang__ && have_clang=yes
if test "$have_icc" = yes; then
add_line_to_config_mk 'HAVE_ICC = 1'
- # Make ICC error our on unknown command line options instead of printing
+ # Make ICC error out on unknown command line options instead of printing
# a warning. This is for example required to make the -Wglobal-destructors
# detection work correctly.
append_var CXXFLAGS "-diag-error 10006,10148"
+
+ # ICC doesn't accept all gcc options, so we disable have_gcc, even if
+ # ICC does have the gcc-compatibility defines.
+ have_gcc=no
fi
-have_gcc=no
-cc_check_define __GNUC__ && have_gcc=yes
+if test "$have_clang" = yes; then
+ add_line_to_config_mk 'HAVE_CLANG = 1'
+
+ # clang does accept all gcc options we use, so we keep have_gcc
+fi
if test "$have_gcc" = yes; then
add_line_to_config_mk 'HAVE_GCC = 1'
@@ -1702,11 +1720,17 @@ if test "$have_gcc" = yes; then
_cxx_minor=`gcc_get_define __GNUC_MINOR__`
cxx_version="`( $CXX -dumpversion ) 2>&1`"
- if test -n "`gcc_get_define __clang__`"; then
- add_line_to_config_mk 'HAVE_CLANG = 1'
- fi
-
- if test "$_cxx_major" -eq 2 && test "$_cxx_minor" -ge 95 || \
+ if test "$have_clang" = yes; then
+ # Clang sets a gcc version number for compatibility.
+ # We keep that as _cxx_minor/_cxx_major for later
+ # compiler version checks.
+
+ # For the version reported in the configure log (cxx_version),
+ # we get the actual clang version.
+ cxx_version=`gcc_get_define __clang_version__`
+ cxx_version="`echo "${cxx_version}" | sed -e 's/"\([^ ]*\) .*/\1/'`"
+ cxx_version="clang $cxx_version, ok"
+ elif test "$_cxx_major" -eq 2 && test "$_cxx_minor" -ge 95 || \
test "$_cxx_major" -gt 2 ; then
cxx_version="$cxx_version, ok"
cxx_verc_fail=no
@@ -2040,7 +2064,12 @@ case $_host_cpu in
arm*)
echo "ARM"
define_in_config_if_yes yes 'USE_ARM_SCALER_ASM'
- define_in_config_if_yes yes 'USE_ARM_SOUND_ASM'
+ # FIXME: The following feature exhibits a bug. It produces distorted
+ # sound since 9003ce517ff9906b0288f9f7c02197fd091d4554. The ARM
+ # assembly will need to be properly adapted to the changes to the C
+ # code in 8f5a7cde2f99de9fef849b0ff688906f05f4643e.
+ # See bug #6957: "AUDIO: ARM ASM sound code causes distorted audio on 32 bit armv6"
+ #define_in_config_if_yes yes 'USE_ARM_SOUND_ASM'
define_in_config_if_yes yes 'USE_ARM_SMUSH_ASM'
define_in_config_if_yes yes 'USE_ARM_GFX_ASM'
# FIXME: The following feature exhibits a bug during the intro scene of Indy 4
@@ -2406,6 +2435,7 @@ case $_host_os in
;;
ps3)
# Force use of SDL and freetype from the ps3 toolchain
+ _sdlconfig=sdl2-config
_sdlpath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin"
_freetypepath="$PS3DEV/portlibs/ppu:$PS3DEV/portlibs/ppu/bin"
@@ -2559,6 +2589,30 @@ if test -n "$_host"; then
_seq_midi=no
_port_mk="backends/platform/dingux/dingux.mk"
;;
+ raspberrypi)
+ # This is needed because the official cross compiler doesn't have multiarch enabled
+ # but Raspbian does.
+ # Be careful as it's the linker (LDFLAGS) which must know about sysroot.
+ # These are needed to build against Raspbian's libSDL.
+ append_var LDFLAGS "--sysroot=$RPI_ROOT"
+ append_var LDFLAGS "-B$RPI_ROOT/usr/lib/arm-linux-gnueabihf"
+ append_var LDFLAGS "-Xlinker --rpath-link=$RPI_ROOT/usr/lib/arm-linux-gnueabihf"
+ append_var LDFLAGS "-Xlinker --rpath-link=$RPI_ROOT/lib/arm-linux-gnueabihf"
+ append_var LDFLAGS "-Xlinker --rpath-link=$RPI_ROOT/opt/vc/lib"
+ append_var LDFLAGS "-L$RPI_ROOT/opt/vc/lib"
+ # This is so optional OpenGL ES includes are found.
+ append_var CXXFLAGS "-I$RPI_ROOT/opt/vc/include"
+ _savegame_timestamp=no
+ _eventrec=no
+ _build_scalers=no
+ _build_hq_scalers=no
+ # We prefer SDL2 on the Raspberry Pi: acceleration now depends on it
+ # since SDL2 manages dispmanx/GLES2 very well internally.
+ # SDL1 is bit-rotten on this platform.
+ _sdlconfig=sdl2-config
+ # We should add _opengles=yes later here if we wanted the GLES renderer.
+ # For now, we use plain SDL2 only, which in turn uses GLES2 by default.
+ ;;
dreamcast)
append_var DEFINES "-DDISABLE_DEFAULT_SAVEFILEMANAGER"
append_var DEFINES "-DDISABLE_TEXT_CONSOLE"
@@ -3076,9 +3130,6 @@ case $_backend in
_sdlversion=`$_sdlconfig --version`
case $_sdlversion in
- 1.3.*)
- add_line_to_config_mk "USE_SDL13 = 1"
- ;;
2.0.*)
add_line_to_config_mk "USE_SDL2 = 1"
;;
@@ -3139,7 +3190,6 @@ case $_backend in
;;
esac
-
#
# Determine whether host is POSIX compliant, or at least POSIX
# compatible enough to support our POSIX code (including dlsym(),
@@ -4006,6 +4056,13 @@ EOF
int main(void) { return GL_OES_VERSION_1_1; }
EOF
cc_check $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS && _opengl=yes && _opengles=yes && break
+
+ # Test the current header for OpenGL ES on SBCs (Raspberry Pi, Cubieboard, etc)
+ cat > $TMPC << EOF
+#include <$i>
+int main(void) { return GL_VERSION_ES_CM_1_1; }
+EOF
+ cc_check $DEFINES $OPENGL_CFLAGS $OPENGL_LIBS && _opengl=yes && _opengles=yes && break
done
fi
fi
@@ -4073,7 +4130,6 @@ fi
define_in_config_if_yes "$_opengl" "USE_OPENGL"
define_in_config_if_yes "$_opengles" "USE_GLES"
-
#
# Check for nasm
#
@@ -4556,6 +4612,7 @@ STAGINGPATH=$_stagingpath
WIN32PATH=$_win32path
AMIGAOSPATH=$_amigaospath
STATICLIBPATH=$_staticlibpath
+SDLCONFIG=$_sdlconfig
ABI := $ABI
diff --git a/devtools/convbdf.cpp b/devtools/convbdf.cpp
index 21c8af8234..59ea5cc4e5 100644
--- a/devtools/convbdf.cpp
+++ b/devtools/convbdf.cpp
@@ -21,7 +21,7 @@
*/
#ifndef __has_feature // Optional of course.
- #define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
#include <fstream>
@@ -392,7 +392,7 @@ int main(int argc, char *argv[]) {
for (int y = 0; y < box.height; ++y) {
printf("// |");
- unsigned char data;
+ unsigned char data = 0;
for (int x = 0; x < box.width; ++x) {
if (!(x % 8))
data = *bitmap++;
diff --git a/devtools/create_access/amazon_resources.cpp b/devtools/create_access/amazon_resources.cpp
new file mode 100644
index 0000000000..f4b642ffbc
--- /dev/null
+++ b/devtools/create_access/amazon_resources.cpp
@@ -0,0 +1,757 @@
+/* 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.
+ *
+ */
+
+#include "amazon_resources.h"
+
+namespace Amazon {
+
+const byte MOUSE0[] = {
+ // hotspot x and y, uint16 LE
+ 0, 0, 0, 0,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0, 2, 6, 1,
+ 0, 3, 6, 6, 1,
+ 0, 3, 6, 6, 1,
+ 0, 4, 6, 6, 6, 1,
+ 0, 4, 6, 6, 6, 1,
+ 0, 5, 6, 6, 6, 6, 1,
+ 0, 5, 6, 6, 6, 6, 1,
+ 0, 6, 6, 6, 6, 6, 6, 1,
+ 0, 6, 6, 6, 6, 6, 6, 1,
+ 0, 7, 6, 6, 6, 6, 6, 6, 1,
+ 0, 6, 6, 6, 6, 6, 6, 1,
+ 0, 5, 6, 6, 6, 6, 1,
+ 2, 3, 6, 6, 1,
+ 3, 3, 6, 6, 1,
+ 3, 3, 6, 6, 1,
+ 4, 2, 6, 1
+};
+
+const byte MOUSE1[] = {
+ // hotspot x and y, uint16 LE
+ 0x07, 0x00, 0x07, 0x00,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0x06, 0x01, 0x05,
+ 0x04, 0x05, 0xFF, 0xFF, 0x00, 0xFF, 0xFF,
+ 0x03, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0x02, 0x09, 0xFF, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xFF,
+ 0x01, 0x0B, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0x01, 0x0B, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0x00, 0x0D, 0x05, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00, 0x00, 0x05,
+ 0x01, 0x0B, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0x01, 0x0B, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0x02, 0x09, 0xFF, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xFF,
+ 0x03, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0x04, 0x05, 0xFF, 0xFF, 0x00, 0xFF, 0xFF,
+ 0x06, 0x01, 0x05,
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00
+};
+
+const byte MOUSE2[] = {
+ // hotspot x and y, uint16 LE
+ 0x08, 0x00, 0x08, 0x00,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 0x07, 0x02, 0x04, 0x05,
+ 0x07, 0x02, 0x04, 0x05,
+ 0x07, 0x02, 0x04, 0x05,
+ 0x07, 0x02, 0x04, 0x05,
+ 0x07, 0x02, 0x04, 0x05,
+ 0x02, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05,
+ 0x07, 0x02, 0x04, 0x05,
+ 0x07, 0x02, 0x04, 0x05,
+ 0x07, 0x02, 0x04, 0x05,
+ 0x07, 0x02, 0x04, 0x05,
+ 0x07, 0x02, 0x04, 0x05,
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00
+};
+
+const byte MOUSE3[] = {
+ // hotspot x and y, uint16 LE
+ 0x00, 0x00, 0x00, 0x00,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0x00, 0x0B, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x00, 0x0C, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06, 0x05,
+ 0x00, 0x0C, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x05, 0x05,
+ 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
+ 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
+ 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x05, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x05,
+ 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
+ 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
+ 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
+ 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
+ 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
+ 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
+ 0x01, 0x0B, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00
+};
+const byte CURSEYE[] = {
+ // hotspot x and y, uint16 LE
+ 0x01, 0x00, 0x08, 0x00,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0x04, 0x06, 0x0E, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D,
+ 0x03, 0x09, 0x0E, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0D, 0x0D,
+ 0x02, 0x0B, 0x0E, 0x01, 0x33, 0x33, 0x01, 0x01, 0x33, 0x34, 0x01, 0x01, 0x0D,
+ 0x01, 0x0D, 0x0E, 0x01, 0x04, 0x34, 0x01, 0x01, 0x01, 0x07, 0x33, 0x04, 0x04, 0x01, 0x0D,
+ 0x00, 0x0F, 0x0E, 0x0E, 0x01, 0x07, 0x33, 0x33, 0x01, 0x01, 0x33, 0x34, 0x07, 0x07, 0x06, 0x01, 0x0E,
+ 0x01, 0x0D, 0x0F, 0x0F, 0x06, 0x07, 0x34, 0x33, 0x33, 0x34, 0x07, 0x07, 0x06, 0x0F, 0x0E,
+ 0x03, 0x09, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0E,
+ 0x01, 0x01, 0x07,
+ 0x00, 0x03, 0x07, 0x01, 0x07,
+ 0x01, 0x01, 0x07,
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00
+};
+
+const byte CURSHAND[] = {
+ // hotspot x and y, uint16 LE
+ 0x02, 0x00, 0x03, 0x00,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0x07, 0x02, 0x17, 0x0E,
+ 0x05, 0x07, 0x0E, 0x12, 0x17, 0x0E, 0x13, 0x17, 0x0E,
+ 0x02, 0x0C, 0x07, 0x00, 0x17, 0x0E, 0x11, 0x0F, 0x0E, 0x11, 0x17, 0x0E, 0x00, 0x17,
+ 0x01, 0x0E, 0x07, 0x01, 0x07, 0x0F, 0x0E, 0x11, 0x17, 0x0E, 0x11, 0x0F, 0x0E, 0x12, 0x17, 0x0E,
+ 0x02, 0x0D, 0x07, 0x00, 0x17, 0x0F, 0x12, 0x0F, 0x0F, 0x11, 0x17, 0x0E, 0x12, 0x0F, 0x0E,
+ 0x04, 0x0B, 0x0F, 0x0E, 0x11, 0x17, 0x0E, 0x12, 0x0F, 0x0F, 0x11, 0x17, 0x0E,
+ 0x04, 0x0B, 0x17, 0x0E, 0x12, 0x17, 0x0E, 0x12, 0x17, 0x0E, 0x11, 0x0F, 0x0E,
+ 0x00, 0x0F, 0x0E, 0x0D, 0x12, 0x00, 0x17, 0x0F, 0x0F, 0x0F, 0x0F, 0x12, 0x0F, 0x0E, 0x12, 0x17, 0x0F,
+ 0x00, 0x0F, 0x0F, 0x17, 0x0D, 0x11, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0D,
+ 0x01, 0x0E, 0x0F, 0x17, 0x0F, 0x0E, 0x0F, 0x0D, 0x0D, 0x0D, 0x0D, 0x0E, 0x0F, 0x0F, 0x0E, 0x0D,
+ 0x02, 0x0D, 0x0F, 0x17, 0x0F, 0x0E, 0x0D, 0x0D, 0x0F, 0x0F, 0x0E, 0x0F, 0x0E, 0x0E, 0x12,
+ 0x03, 0x0C, 0x0F, 0x17, 0x0F, 0x0F, 0x0F, 0x0E, 0x0F, 0x0F, 0x0F, 0x0E, 0x0D, 0x12,
+ 0x04, 0x0A, 0x0F, 0x17, 0x0F, 0x0F, 0x0F, 0x0E, 0x0F, 0x0F, 0x0E, 0x0D,
+ 0x05, 0x09, 0x0F, 0x17, 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0D, 0x12,
+ 0x06, 0x08, 0x17, 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0D, 0x12,
+ 0x06, 0x07, 0x17, 0x0F, 0x0F, 0x0F, 0x3D, 0x0E, 0x0D
+};
+
+const byte CURSGET[] = {
+ // hotspot x and y, uint16 LE
+ 0x07, 0x00, 0x0E, 0x00,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0x0A, 0x05, 0x1C, 0x07, 0x0F, 0x0F, 0x0F,
+ 0x08, 0x08, 0x1C, 0x07, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
+ 0x06, 0x0A, 0x1C, 0x07, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
+ 0x05, 0x0A, 0x07, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
+ 0x03, 0x0C, 0x07, 0x1C, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
+ 0x02, 0x0D, 0x1C, 0x0F, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
+ 0x01, 0x0E, 0x07, 0x0F, 0x0E, 0x0D, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
+ 0x00, 0x0F, 0x1C, 0x0F, 0x0E, 0x0D, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
+ 0x00, 0x0F, 0x1C, 0x0E, 0x0D, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0C, 0x0C, 0x0E, 0x0F, 0x0F, 0x0F, 0x0C,
+ 0x00, 0x0E, 0x1C, 0x0D, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0C, 0x00, 0x00, 0x0E, 0x0F, 0x0F, 0x0C,
+ 0x00, 0x0E, 0x1C, 0x0E, 0x0F, 0x0D, 0x0F, 0x0F, 0x0C, 0x00, 0x00, 0x0E, 0x1C, 0x0F, 0x0F, 0x0C,
+ 0x00, 0x0D, 0x1C, 0x0D, 0x0F, 0x0D, 0x0F, 0x0C, 0x00, 0x00, 0x00, 0x0E, 0x1C, 0x0F, 0x0C,
+ 0x01, 0x0B, 0x0E, 0x0F, 0x0E, 0x0F, 0x0C, 0x00, 0x00, 0x0E, 0x07, 0x0F, 0x0C,
+ 0x02, 0x09, 0x0E, 0x0D, 0x0F, 0x0C, 0x00, 0x07, 0x0E, 0x0F, 0x0C,
+ 0x03, 0x06, 0x0E, 0x0F, 0x0E, 0x07, 0x01, 0x07,
+ 0x07, 0x01, 0x07
+};
+
+const byte CURSCLIMB[] = {
+ // hotspot x and y, uint16 LE
+ 0x03, 0x00, 0x0E, 0x00,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0x06, 0x04, 0x01, 0x01, 0x01, 0x01,
+ 0x06, 0x04, 0x0F, 0x0E, 0x01, 0x01,
+ 0x06, 0x04, 0x0F, 0x0E, 0x0D, 0x01,
+ 0x07, 0x02, 0x0F, 0x0D,
+ 0x00, 0x0C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x13, 0x12, 0x12, 0x12, 0x12, 0x11, 0x11,
+ 0x00, 0x0D, 0x0D, 0x0E, 0x00, 0x00, 0x13, 0x14, 0x13, 0x12, 0x12, 0x12, 0x11, 0x11, 0x0E,
+ 0x01, 0x0C, 0x0D, 0x0D, 0x0D, 0x0E, 0x11, 0x13, 0x13, 0x12, 0x11, 0x11, 0x0E, 0x0D,
+ 0x02, 0x0C, 0x0E, 0x0E, 0x00, 0x00, 0x00, 0x13, 0x12, 0x11, 0x00, 0x00, 0x0E, 0x0D,
+ 0x03, 0x0B, 0x04, 0x04, 0x04, 0x22, 0x21, 0x21, 0x20, 0x00, 0x00, 0x00, 0x0D,
+ 0x02, 0x0D, 0x22, 0x04, 0x20, 0x22, 0x04, 0x21, 0x04, 0x20, 0x00, 0x00, 0x00, 0x0E, 0x0E,
+ 0x03, 0x07, 0x22, 0x21, 0x20, 0x20, 0x22, 0x04, 0x20,
+ 0x04, 0x06, 0x01, 0x01, 0x00, 0x04, 0x22, 0x20,
+ 0x02, 0x09, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x04, 0x20,
+ 0x03, 0x09, 0x07, 0x01, 0x01, 0x00, 0x00, 0x00, 0x22, 0x04, 0x20,
+ 0x02, 0x0B, 0x07, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x20,
+ 0x03, 0x0A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01
+};
+
+const byte CURSTALK[] = {
+ // hotspot x and y, uint16 LE
+ 0x02, 0x00, 0x0B, 0x00,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0x03, 0x08, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x01, 0x0C, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06,
+ 0x00, 0x0E, 0x06, 0x06, 0x06, 0x06, 0x07, 0x06, 0x07, 0x07, 0x06, 0x07, 0x07, 0x06, 0x07, 0x06,
+ 0x00, 0x0F, 0x06, 0x08, 0x08, 0x08, 0x06, 0x08, 0x06, 0x06, 0x08, 0x06, 0x06, 0x08, 0x06, 0x08, 0x06,
+ 0x00, 0x0F, 0x06, 0x06, 0x08, 0x06, 0x08, 0x06, 0x08, 0x06, 0x08, 0x06, 0x06, 0x08, 0x08, 0x06, 0x06,
+ 0x00, 0x0F, 0x06, 0x06, 0x08, 0x06, 0x08, 0x08, 0x08, 0x06, 0x08, 0x06, 0x06, 0x08, 0x06, 0x08, 0x06,
+ 0x01, 0x0E, 0x06, 0x08, 0x06, 0x08, 0x06, 0x08, 0x06, 0x08, 0x08, 0x06, 0x08, 0x06, 0x08, 0x06,
+ 0x02, 0x0C, 0x06, 0x06, 0x06, 0x07, 0x06, 0x07, 0x06, 0x06, 0x07, 0x06, 0x07, 0x06,
+ 0x04, 0x09, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06,
+ 0x07, 0x04, 0x06, 0x07, 0x07, 0x06,
+ 0x02, 0x08, 0x07, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06,
+ 0x01, 0x06, 0x07, 0x01, 0x07, 0x06, 0x06, 0x06,
+ 0x02, 0x01, 0x07,
+ 0x00, 0x00,
+ 0x00, 0x00,
+ 0x00, 0x00
+};
+const byte CURSHELP[] = {
+ // hotspot x and y, uint16 LE
+ 0x02, 0x00, 0x0B, 0x00,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0x04, 0x06, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24,
+ 0x02, 0x0A, 0x24, 0x24, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x20, 0x20,
+ 0x01, 0x0C, 0x24, 0x22, 0x22, 0x22, 0x20, 0x20, 0x20, 0x22, 0x22, 0x22, 0x22, 0x20,
+ 0x00, 0x0E, 0x24, 0x22, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20,
+ 0x00, 0x0E, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x24, 0x22, 0x22, 0x22, 0x20,
+ 0x00, 0x0E, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x24, 0x22, 0x22, 0x22, 0x20,
+ 0x01, 0x0D, 0x24, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20,
+ 0x07, 0x06, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20,
+ 0x05, 0x07, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, 0x20,
+ 0x04, 0x05, 0x24, 0x22, 0x22, 0x22, 0x20,
+ 0x02, 0x07, 0x07, 0x00, 0x24, 0x20, 0x20, 0x20, 0x20,
+ 0x01, 0x03, 0x07, 0x01, 0x07,
+ 0x02, 0x07, 0x07, 0x00, 0x00, 0x24, 0x24, 0x24, 0x24,
+ 0x04, 0x06, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20,
+ 0x04, 0x06, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20,
+ 0x05, 0x04, 0x20, 0x20, 0x20, 0x20
+};
+
+const byte *const CURSORS[AMAZON_NUM_CURSORS] = {
+ MOUSE0, MOUSE1, MOUSE2, MOUSE3, CURSEYE, CURSHAND, CURSGET, CURSCLIMB, CURSTALK, CURSHELP
+};
+const uint CURSOR_SIZES[AMAZON_NUM_CURSORS] = {
+ sizeof(MOUSE0), sizeof(MOUSE1), sizeof(MOUSE2), sizeof(MOUSE3), sizeof(CURSEYE),
+ sizeof(CURSHAND), sizeof(CURSGET), sizeof(CURSCLIMB), sizeof(CURSTALK), sizeof(CURSHELP)
+};
+
+
+const int FONT2_INDEX[] = {
+ 62, 2, 6,
+ 0x0000, 0x0019, 0x0021, 0x002e, 0x0041, 0x005a, 0x0073, 0x008c, 0x0093, 0x009b,
+ 0x00a3, 0x00bc, 0x00d5, 0x00dd, 0x00ea, 0x00f1, 0x00fe, 0x010b, 0x0118, 0x0125,
+ 0x0132, 0x013f, 0x014c, 0x0159, 0x0166, 0x0173, 0x0180, 0x0187, 0x018e, 0x01a7,
+ 0x01b4, 0x01cd, 0x01dc, 0x01f5, 0x0208, 0x0215, 0x0222, 0x022f, 0x023c, 0x0249,
+ 0x025c, 0x0269, 0x0276, 0x0285, 0x0292, 0x029f, 0x02b2, 0x02c5, 0x02d2, 0x02df,
+ 0x02ee, 0x02fb, 0x0308, 0x0315, 0x0322, 0x032f, 0x0342, 0x034f, 0x0362, 0x036f,
+ 0x0388, 0x03a1,
+};
+
+const byte FONT2_DATA[] = {
+ 0x06, 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, 0xf0, 0xf0, 0xf0, 0xf0,
+ 0x00, 0xf0, 0x00, 0x06, 0xf3, 0xc0, 0xc3, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x07, 0x1c, 0x00,
+ 0x67, 0x9e, 0xc0, 0x07, 0x1c, 0x00, 0x67, 0x9e, 0xc0, 0x07,
+ 0x1c, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02, 0xc0, 0x00, 0x3f,
+ 0xfc, 0x00, 0xb2, 0xc0, 0x00, 0x3f, 0xfc, 0x00, 0x02, 0xcb,
+ 0x00, 0x3f, 0xfc, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00,
+ 0x09, 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, 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, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x18, 0x60,
+ 0x70, 0x70, 0x60, 0x1c, 0x00, 0x04, 0x60, 0x18, 0x1c, 0x1c,
+ 0x1c, 0x70, 0x00, 0x09, 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, 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, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x30,
+ 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc0,
+ 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf0, 0xf0,
+ 0x00, 0x07, 0x00, 0xf0, 0x03, 0xc0, 0x0f, 0x00, 0x3c, 0x00,
+ 0xf0, 0x00, 0x00, 0x00, 0x07, 0x3f, 0xc0, 0x70, 0x70, 0x70,
+ 0x70, 0x70, 0x70, 0x3f, 0xc0, 0x00, 0x00, 0x07, 0x1f, 0x00,
+ 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0xff, 0xf0, 0x00, 0x00,
+ 0x08, 0x2b, 0xf0, 0xb0, 0x2c, 0x00, 0xa0, 0x0a, 0x00, 0xff,
+ 0xfc, 0x00, 0x00, 0x07, 0xff, 0xc0, 0x00, 0x70, 0x03, 0xc0,
+ 0x00, 0x70, 0xff, 0xc0, 0x00, 0x00, 0x07, 0x0b, 0xc0, 0x2d,
+ 0xc0, 0xb1, 0xc0, 0xaa, 0xa0, 0x01, 0xc0, 0x00, 0x00, 0x07,
+ 0xff, 0xf0, 0x70, 0x00, 0x7f, 0xc0, 0x00, 0xb0, 0xbf, 0xc0,
+ 0x00, 0x00, 0x07, 0x2f, 0xc0, 0x70, 0x00, 0x7f, 0xc0, 0x70,
+ 0x70, 0x3f, 0xc0, 0x00, 0x00, 0x08, 0xff, 0xfc, 0x00, 0xb0,
+ 0x02, 0xc0, 0x02, 0xc0, 0x0b, 0x00, 0x00, 0x00, 0x08, 0x2f,
+ 0xf0, 0xb0, 0x1c, 0x2f, 0xf0, 0xb0, 0x1c, 0x2f, 0xf0, 0x00,
+ 0x00, 0x07, 0x3f, 0xc0, 0x70, 0x70, 0x3f, 0xf0, 0x00, 0x70,
+ 0x3f, 0xc0, 0x00, 0x00, 0x03, 0xf0, 0xf0, 0x00, 0xf0, 0xf0,
+ 0x00, 0x03, 0xf0, 0xf0, 0x00, 0xf0, 0x30, 0x00, 0x09, 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, 0x00, 0x00, 0xff, 0xc0, 0x00, 0x00,
+ 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x09, 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, 0xff, 0x00, 0x03, 0xc0, 0x0f, 0x00, 0x3c, 0x00,
+ 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x09, 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, 0x00, 0x40, 0x00, 0x01, 0xf0, 0x00, 0x07, 0x1c,
+ 0x00, 0x1f, 0xff, 0x00, 0x70, 0x01, 0xc0, 0x00, 0x00, 0x00,
+ 0x08, 0x7f, 0xf0, 0x70, 0x1c, 0x7f, 0xf0, 0x70, 0x1c, 0x6a,
+ 0xb0, 0x00, 0x00, 0x08, 0x2f, 0xfc, 0x70, 0x00, 0x70, 0x00,
+ 0x70, 0x00, 0x2a, 0xa8, 0x00, 0x00, 0x08, 0x7f, 0xf0, 0x70,
+ 0x1c, 0x70, 0x1c, 0x70, 0x1c, 0x6a, 0xb0, 0x00, 0x00, 0x07,
+ 0x7f, 0xf0, 0x70, 0x00, 0x7f, 0xc0, 0x70, 0x00, 0x6a, 0xa0,
+ 0x00, 0x00, 0x07, 0x7f, 0xf0, 0x70, 0x00, 0x7f, 0xc0, 0x70,
+ 0x00, 0x60, 0x00, 0x00, 0x00, 0x09, 0x3f, 0xfc, 0x00, 0x70,
+ 0x00, 0x00, 0x70, 0xff, 0x00, 0x70, 0x1c, 0x00, 0x2a, 0xbc,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x70, 0x1c, 0x70, 0x1c, 0x7f,
+ 0xfc, 0x70, 0x1c, 0x70, 0x1c, 0x00, 0x00, 0x07, 0xff, 0xf0,
+ 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0xaa, 0xa0, 0x00, 0x00,
+ 0x08, 0x0f, 0xfc, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x70,
+ 0x70, 0x2a, 0x40, 0x00, 0x00, 0x08, 0x70, 0x2c, 0x72, 0xc0,
+ 0x7f, 0x00, 0x72, 0xc0, 0x70, 0x28, 0x00, 0x00, 0x07, 0x70,
+ 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x6a, 0xa0, 0x00,
+ 0x00, 0x0a, 0x70, 0x02, 0xc0, 0x7c, 0x09, 0xc0, 0x77, 0x2d,
+ 0xc0, 0x71, 0xb1, 0xc0, 0x60, 0xc1, 0x80, 0x00, 0x00, 0x00,
+ 0x09, 0x70, 0x07, 0x00, 0x77, 0x07, 0x00, 0x71, 0xc7, 0x00,
+ 0x70, 0x77, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x2f, 0xf0, 0x70, 0x1c, 0x70, 0x1c, 0x70, 0x1c, 0x2a, 0xa0,
+ 0x00, 0x00, 0x08, 0x7f, 0xf0, 0x70, 0x1c, 0x7f, 0xf0, 0x70,
+ 0x00, 0x60, 0x00, 0x00, 0x00, 0x08, 0x2f, 0xf0, 0x70, 0x1c,
+ 0x70, 0x1c, 0x71, 0xdc, 0x2a, 0xa0, 0x00, 0x1c, 0x00, 0x00,
+ 0x08, 0x7f, 0xf0, 0x70, 0x1c, 0x7f, 0xc0, 0x70, 0x70, 0x60,
+ 0x18, 0x00, 0x00, 0x07, 0x2f, 0xf0, 0x70, 0x00, 0x2f, 0xc0,
+ 0x00, 0xb0, 0xbf, 0xc0, 0x00, 0x00, 0x07, 0xff, 0xf0, 0x0b,
+ 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08,
+ 0x70, 0x1c, 0x70, 0x1c, 0x70, 0x1c, 0x70, 0xdc, 0x1f, 0x1c,
+ 0x00, 0x00, 0x08, 0xf0, 0x1c, 0xb0, 0x1c, 0x70, 0xb0, 0x72,
+ 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x0b, 0xf0, 0x00, 0xb0, 0xb0,
+ 0x00, 0x70, 0x70, 0xc0, 0x70, 0x72, 0x72, 0xc0, 0x7c, 0x1f,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0xf0, 0x3c, 0x1c, 0xe0, 0x07,
+ 0xc0, 0x1c, 0x70, 0x70, 0x1c, 0x00, 0x00, 0x09, 0x70, 0x07,
+ 0x00, 0x1c, 0x1c, 0x00, 0x07, 0xf0, 0x00, 0x01, 0xc0, 0x00,
+ 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x08, 0xff, 0xfc, 0x00,
+ 0x70, 0x07, 0x00, 0x1c, 0x00, 0xaa, 0xac, 0x00, 0x00, 0x09,
+ 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, 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,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00,
+};
+
+const int FONT6x6_INDEX[] = {
+ 62, 1, 6,
+ 0x0000, 0x0007, 0x000e, 0x0015, 0x001c, 0x0023, 0x002a, 0x0031, 0x0038, 0x003f,
+ 0x0046, 0x004d, 0x0054, 0x005b, 0x0062, 0x0069, 0x0070, 0x0077, 0x007e, 0x0085,
+ 0x008c, 0x0093, 0x009a, 0x00a1, 0x00a8, 0x00af, 0x00b6, 0x00bd, 0x00c4, 0x00cb,
+ 0x00d2, 0x00d9, 0x00e0, 0x00e7, 0x00ee, 0x00f5, 0x00fc, 0x0103, 0x010a, 0x0111,
+ 0x0118, 0x011f, 0x0126, 0x012d, 0x0134, 0x013b, 0x0142, 0x0149, 0x0150, 0x0157,
+ 0x015e, 0x0165, 0x016c, 0x0173, 0x017a, 0x0181, 0x0188, 0x018f, 0x0196, 0x019d,
+ 0x01a4, 0x01ab,
+};
+
+const byte FONT6x6_DATA[] = {
+ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x30, 0x30,
+ 0x30, 0x30, 0x00, 0x30, 0x06, 0xd8, 0xd8, 0x90, 0x00, 0x00,
+ 0x00, 0x06, 0x50, 0xf8, 0x50, 0xf8, 0x50, 0x00, 0x06, 0x78,
+ 0xa0, 0x70, 0x28, 0xf0, 0x20, 0x06, 0xc8, 0xd0, 0x20, 0x58,
+ 0x98, 0x00, 0x06, 0x60, 0xd0, 0x60, 0xe8, 0xd0, 0x68, 0x06,
+ 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x06, 0x30, 0x60, 0x60,
+ 0x60, 0x30, 0x00, 0x07, 0x30, 0x18, 0x18, 0x18, 0x30, 0x00,
+ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x20, 0x20,
+ 0xf8, 0x20, 0x20, 0x00, 0x06, 0x00, 0x00, 0x00, 0x30, 0x30,
+ 0x60, 0x06, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x00, 0x00, 0x60, 0x60, 0x00, 0x06, 0x18, 0x30, 0x60, 0xc0,
+ 0x80, 0x00, 0x06, 0x70, 0x98, 0xa8, 0xc8, 0x70, 0x00, 0x06,
+ 0x10, 0x30, 0x10, 0x10, 0x10, 0x00, 0x06, 0xf0, 0x08, 0x70,
+ 0x80, 0xf8, 0x00, 0x06, 0xf0, 0x08, 0x70, 0x08, 0xf0, 0x00,
+ 0x06, 0x30, 0x50, 0x90, 0xf8, 0x10, 0x00, 0x06, 0xf0, 0x80,
+ 0xf0, 0x08, 0xf0, 0x00, 0x06, 0x70, 0x80, 0xf0, 0x88, 0x70,
+ 0x00, 0x06, 0xf8, 0x08, 0x10, 0x20, 0x20, 0x00, 0x06, 0x70,
+ 0x88, 0x70, 0x88, 0x70, 0x00, 0x06, 0x70, 0x88, 0x78, 0x08,
+ 0x70, 0x00, 0x06, 0x60, 0x60, 0x00, 0x60, 0x60, 0x00, 0x06,
+ 0x60, 0x60, 0x00, 0x60, 0x20, 0x40, 0x06, 0x18, 0x30, 0x60,
+ 0x30, 0x18, 0x00, 0x06, 0x00, 0x78, 0x00, 0x78, 0x00, 0x00,
+ 0x06, 0x60, 0x30, 0x18, 0x30, 0x60, 0x00, 0x06, 0x70, 0x98,
+ 0x30, 0x30, 0x00, 0x30, 0x06, 0x70, 0x88, 0xb8, 0xb0, 0x80,
+ 0x78, 0x06, 0x70, 0x88, 0xf8, 0x88, 0x88, 0x00, 0x06, 0xf0,
+ 0x88, 0xf0, 0x88, 0xf0, 0x00, 0x06, 0x78, 0x80, 0x80, 0x80,
+ 0x78, 0x00, 0x06, 0xf0, 0x88, 0x88, 0x88, 0xf0, 0x00, 0x06,
+ 0xf8, 0x80, 0xf0, 0x80, 0xf8, 0x00, 0x06, 0xf8, 0x80, 0xf0,
+ 0x80, 0x80, 0x00, 0x06, 0x78, 0x80, 0x98, 0x88, 0x78, 0x00,
+ 0x06, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x00, 0x06, 0x70, 0x20,
+ 0x20, 0x20, 0x70, 0x00, 0x06, 0x08, 0x08, 0x08, 0x88, 0x70,
+ 0x00, 0x06, 0x90, 0xa0, 0xc0, 0xa0, 0x90, 0x00, 0x06, 0x80,
+ 0x80, 0x80, 0x80, 0xf0, 0x00, 0x06, 0x88, 0xd8, 0xa8, 0x88,
+ 0x88, 0x00, 0x06, 0x88, 0xc8, 0xa8, 0x98, 0x88, 0x00, 0x06,
+ 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, 0x06, 0xf0, 0x88, 0xf0,
+ 0x80, 0x80, 0x00, 0x06, 0x70, 0x88, 0x88, 0x88, 0x70, 0x18,
+ 0x06, 0xf0, 0x88, 0xf0, 0xa0, 0x98, 0x00, 0x06, 0x78, 0x80,
+ 0x70, 0x08, 0xf0, 0x00, 0x06, 0xf8, 0x20, 0x20, 0x20, 0x20,
+ 0x00, 0x06, 0x88, 0x88, 0x88, 0x88, 0x78, 0x00, 0x06, 0x88,
+ 0x88, 0x88, 0x50, 0x20, 0x00, 0x06, 0x88, 0x88, 0xa8, 0xd8,
+ 0x88, 0x00, 0x06, 0x88, 0x50, 0x20, 0x50, 0x88, 0x00, 0x06,
+ 0x88, 0x88, 0x50, 0x20, 0x20, 0x00, 0x06, 0xf8, 0x10, 0x20,
+ 0x40, 0xf8, 0x00, 0x06, 0x78, 0x60, 0x60, 0x60, 0x78, 0x00,
+ 0x06, 0xc0, 0x60, 0x30, 0x18, 0x08, 0x00, 0x06, 0x78, 0x18,
+ 0x18, 0x18, 0x78, 0x00, 0x00, 0x52, 0x41, 0x54, 0x00, 0x41,
+ 0x4c, 0x43, 0x4f, 0x48, 0x4f, 0x4c, 0x00, 0x53, 0x41, 0x46,
+ 0x45, 0x20, 0x43, 0x4f, 0x4d, 0x42, 0x49, 0x4e, 0x41, 0x54,
+ 0x49, 0x4f, 0x4e, 0x00, 0x42, 0x45, 0x41, 0x4b, 0x45, 0x52,
+ 0x00, 0x4d, 0x49, 0x43, 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x4d,
+ 0x00, 0x56, 0x41, 0x55, 0x4c, 0x54, 0x20, 0x4b, 0x45, 0x59,
+ 0x00, 0x42, 0x4f, 0x4c, 0x54, 0x20, 0x43, 0x55, 0x54, 0x54,
+ 0x45, 0x52, 0x53, 0x00, 0x42, 0x4c, 0x4f, 0x57, 0x47, 0x55,
+ 0x4e, 0x00, 0x4c, 0x4f, 0x56, 0x45, 0x20, 0x50, 0x4f, 0x54,
+ 0x49, 0x4f, 0x4e, 0x00, 0x4d, 0x4f, 0x4e, 0x45, 0x59, 0x00,
+ 0x44, 0x41, 0x52, 0x54, 0x53, 0x00, 0x54, 0x41, 0x50, 0x45,
+ 0x00, 0x4a, 0x55, 0x4e, 0x47, 0x4c, 0x45, 0x20, 0x50, 0x4f,
+ 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x4d, 0x4f, 0x56, 0x49,
+};
+
+const uint FONT2_INDEX_SIZE = sizeof(FONT2_INDEX) / 2;
+const uint FONT2_DATA_SIZE = sizeof(FONT2_DATA);
+const uint FONT6x6_INDEX_SIZE = sizeof(FONT6x6_INDEX) / 2;
+const uint FONT6x6_DATA_SIZE = sizeof(FONT6x6_DATA);
+
+const char *const ROOM_DESCR[64] = {
+ "Credits", nullptr, nullptr, nullptr, "Outside of Allister Center",
+ "Hall", "Jason's Lab", nullptr, "Allen's Lab", "Outside of the Vault",
+ "Inside the Vault", "Reader", "Jason's Apartment", "Jason's ransacked apartment", "Cutscene 1",
+ "TBD FLYSOUTH", "Cuzco Airport", "TBD INAIR", "Green Monkey Club", "In Plane",
+ "TBD PILFALL", "TBD COCKPIT", "TBD CRASH", "TBD SINKING", "Cutscene Jungle Walk",
+ "TBD TOWN", "TBD HOTEL", "TBD CANTINA", nullptr, "TBD MASSACRE",
+ "TBD TRADE", "TBD BRIDGE", "TBD DOCK", "TBD DRIVER", nullptr,
+ nullptr, "TBD SHORE", "TBD BOAT", "TBD CABIN", "TBD CAPTIVE",
+ nullptr, nullptr, "TBD VILLAGE", nullptr, "TBD TREE",
+ "TBD CANOE", "TBD INTREE", "TBD FALLS", nullptr, nullptr,
+ nullptr, nullptr, nullptr, nullptr, "TBD WATERFALL",
+ "TBD INWATER", nullptr, "Cave Bridge", nullptr, nullptr,
+ nullptr, "Pit with Ants", nullptr, nullptr
+};
+
+
+const byte DEATH_SCREENS_ENG[58] = {
+ 0, 1, 0, 0, 0, 0, 0, 0, 2, 0,
+ 0, 2, 4, 2, 1, 0, 0, 0, 0, 0,
+ 0, 2, 7, 7, 4, 6, 7, 10, 4, 2,
+ 0, 0, 0, 0, 5, 5, 3, 3, 3, 5,
+ 8, 8, 11, 9, 8, 12, 0, 1, 9, 8,
+ 8, 0, 5, 8, 0, 12, 12, 11
+};
+
+const byte DEATH_SCREENS_ENG_DEMO[34] = {
+ 1, 2, 1, 1, 1, 1, 1, 1, 4, 1,
+ 3, 4, 2, 4, 2, 1, 1, 1, 1, 1,
+ 1, 4, 2, 4, 2, 4, 2, 4, 4, 4,
+ 1, 1, 1, 1
+};
+
+const char *const DEATH_TEXT_ENG[58] = {
+ "SAM SALVADOR SPOTS YOU AND LETS YOU HAVE IT.",
+ "WHILE TAKING A MOONLIGHT SWIM YOU DISCOVER THAT PIRANHA REALLY CAN STRIP FLESH TO THE BONE.",
+ "THE GUARD FILLS YOU FULL OF HOLES BEFORE TOSSING YOU TO THE PIRANHA.",
+ "YOU'RE ONLY ABLE TO SWIM HALFWAY ACROSS THE RIVER BEFORE RUNNING OUT OF AIR. "
+ "YOU MAKE SO MUCH NOISE GASPING FOR BREATH THAT SAM EASILY FINDS YOU AND LEAVES "
+ "YOU IN THE RIVER PERMANENTLY.",
+ "SAM SALVADOR NOTICES SOMEONE HAS BEEN PLAYING WITH THE CARGO. "
+ "HE TRACKS YOU DOWN AND LETS YOU HAVE IT.",
+ "THE GUARD COMES AROUND THE CORNER. HE DECIDES THAT THREE LEAD SLUGS WILL "
+ "TEACH YOU TO BE MORE POLITE.",
+ "THE CAPTAIN IS WAITING OUTSIDE THE DOOR.",
+ "THE CAPTAIN'S RANDOM SHOOTING FINALLY FINDS ITS TARGET.",
+ "THE CRATE OUTSIDE THE WINDOW EXPLODES, DESTROYING THE SHIP. "
+ "UNFORTUNATELY, YOU'RE STILL ABOARD.",
+ "THE DOOR WAS NOT BARRED AND THE CAPTAIN WALKS RIGHT IN AND PARTS YOUR HAIR.",
+
+ "",
+ "YOU RUN OUT ON DECK, THEN REALIZE THAT MAYA IS STILL TIED UP. "
+ "AS YOU TURN TO GO BACK THE BOAT BLOWS UP.",
+ "AFTER YOU FAIL TO PROVE YOUR DIVINITY THE NATIVES EAT YOU FOR LUNCH.",
+ "THIS IS THE GENERIC DEATH SCENE",
+ "YOU ONLY MAKE IT HALFWAY ACROSS THE RIVER BEFORE THE PIRANHA STRIKE.",
+ "WITH NOTHING TO PROTECT HIM FROM THE HAIL OF BULLETS ALLEN IS QUICKLY GUNNED DOWN. "
+ "JASON AND MAYA SOON FOLLOW...",
+ "THE COMBINATION OF THE WIND AND GUNFIRE KNOCK THE CORRUGATED IRON OVER, "
+ "LEAVING YOU WITHOUT PROTECTION.",
+ "WITHOUT SUFFICIENT AMMUNITION, ALLEN IS UNABLE TO HOLD OFF THE ATTACKERS FOR LONG. "
+ "THIS RESULTS IN A SERIOUS CASE OF LEAD POISONING. ADDITIONAL AMMUNITION SHOULD "
+ "HAVE BEEN PURCHASED AT THE RIO BLANCO TRADING POST (CHAPTER 6).",
+ "ALLEN IS A MARVELOUS SHOT, BUT HIS AMMUNITION IS NOT UNLIMITED. "
+ "SOON IT IS ALL OVER.",
+ "THE PILOT FEELS YOU ARE TOO CLOSE AND PULLS THE TRIGGER.",
+
+ "THE PILOT SHOOTS YOU IN THE HEART, THEN TOSSES YOUR LIFELESS BODY OUT THE DOOR.",
+ "THE PLANE CRASHES INTO THE JUNGLE CANOPY AT 200 MPH.",
+ "THE CANOE HITS THE ROCKS AND CAPSIZES, AND THE PIRANHA MAKE YOU THEIR LUNCH GUESTS.",
+ "YOU TAKE THE WRONG BRANCH AND ACCIDENTALLY DISCOVER THE FOURTH TALLEST WATERFALL "
+ "IN SOUTH AMERICA.",
+ "YOU TAKE THE WRONG BRANCH AND DISCOVER A VERY HUNGRY TRIBE OF CANNIBALS.",
+ "YOU TAKE THE WRONG BRANCH AND BECOME LOST IN THE WINDING WATERWAYS. "
+ "YOU WANDER UNTIL YOU STARVE TO DEATH.",
+ "YOU TAKE THE WRONG BRANCH AND BECOME TRAPPED IN THE RAPIDS. "
+ "EVENTUALLY YOU AND MAYA ARE CRUSHED BETWEEN THE ROCKS.",
+ "YOU WAIT AROUND FOR SOME TIME, BUT HANS STROHEIM NEVER SPEAKS TO YOU AGAIN. "
+ "FINALLY YOU RETURN HOME KNOWING YOU HAVE FAILED.",
+ "DECIDING THAT YOU THREATEN HIM AND HIS WORK, HANS STROHEIM HAS THE NATIVES "
+ "IN THE VILLAGE KILL YOU.",
+ "YOU DO NOT GET FAR ENOUGH AWAY BEFORE THE DYNAMITE EXPLODES AND YOU ARE BLOWN "
+ "INTO A THOUSAND PIECES.",
+
+ "YOU ARE STANDING SO CLOSE TO THE ENTRANCE WHEN SANCEZ AND HIS MEN BREAK THROUGH "
+ "THE WALL THAT YOU ARE QUICKLY SPOTTED AND SHOT",
+ "THE AMAZON SENTINELS SPOT YOU AND FILL YOU FULL OF ARROWS.",
+ "SAM MAY BE UGLY, BUT HE'S NOT DEAF. HE HEARS ALL THE NOISE YOU ARE MAKING AND "
+ "CANCELS YOUR BOARDING PASS.",
+ "WITH THE BAR OFF THE DOOR THE CAPTAIN WALTZES IN AND BLOWS YOU AWAY",
+ "THE BEAR WANDERS OFF INTO THE WOODS AND DISTURBS THE TWO LOVEBIRDS. "
+ "WHEN THEY COME OUT THEY FIND YOU AND PUT YOU IN THE BIG HOUSE FOR TWENTY YEARS.",
+ "WHEN YOU DO NOT LEAVE THE SECURITY AREA QUICKLY ENOUGH YOU ARE ARRESTED AND CONVICTED "
+ "AS A COMMIE SPY. YOU EMBARK ON A NEW CAREER STAMPING OUT LICENSE PLATES.",
+ "THE HUNGRY BEAR SPOTS YOU AND DECIDES YOU WILL MAKE A NICE APPETIZER.",
+ "YOU DISTURB THE BEAR'S LUNCH AND HE EATS YOU FOR DESSERT.",
+ "AFTER FAILING TO FIND ANY LUNCH AT THE GARBAGE CAN THE BEAR EATS YOU INSTEAD.",
+ "THE SUSPICIOUS LIBRARIAN CALLS SECURITY AND YOU ARE SENT TO JAIL.",
+
+ "YOU PLUMMET 10,000 FEET TO YOUR DEATH.",
+ "EL LOCO FLIES INTO AN INSANE RAGE AND BEATS YOU TO A BLOODY PULP.",
+ "THE WOMAN WALKS OUT THE DOOR AND NEVER RETURNS. YOU SPEND THE REST OF YOUR LIFE "
+ "IN A FUTILE ATTEMPT TO LOCATE ALLEN.",
+ "YOU SLIP OFF THE PLATFORM AND FALL TO YOUR DEATH.",
+ "YOU SLIP OFF THE PLATFORM AND FALL TO YOUR DEATH.",
+ "YOU COME TOO CLOSE TO THE POWERFUL JAWS OF THE ANT AND HE SNIPS YOU IN TWO BEFORE "
+ "DEVOURING YOU.",
+ "B.O.B. HAS A FLAW IN HIS PROGRAMMING THAT DIRECTS HIM TO SHOOT FIRST AND ASK QUESTIONS LATER.",
+ "THE PLANE SINKS AND THE PIRHANA ATTACK BEFORE YOU EVEN GET OUT THE DOOR.",
+ "MAYA FALLS OFF THE END OF THE BROKEN BRIDGE.",
+ "YOUR WEIGHT IS JUST ENOUGH TO CAUSE THE REMAINING SUPPORT CABLE TO SNAP AND YOU "
+ "FALL TO THE BOTTOM OF THE GORGE.",
+
+ "EVEN WITH REPAIRS THE BRIDGE IS NOT STRONG ENOUGH TO HOLD TWO PEOPLE.",
+ "SANCHEZ AND HIS MEN FIND YOU AND HOLD FIRING SQUAD PRACTICE.",
+ "THE TWO GUARDS ARE DISTURBED IN THEIR LOVE NEST AND COME LOOKING FOR ANYONE ACTING SUSPICIOUS. "
+ "THEY FIND YOU AND SEND YOU UP THE RIVER.",
+ "THE PARACHUTE IS NOT LARGE ENOUGH TO SUPPORT YOU, AND YOU HIT THE TREES AT 140 M.P.H.",
+ "SANCHEZ AND HIS MEN FOLLOW YOU ACROSS THE BRIDGE AND CUT YOU DOWN IN A HAIL OF GUNFIRE",
+ "YOU TRIED TO STAB THE ANT BUT HIS SHELL IS TOO DIFFICULT TO PENETRATE. "
+ "YOU NOTICE A SLIGHT CUT IN THE SHELL UNDERNEATH BUT YOU CAN'T GET TO IT "
+ "AND HE SNIPS YOU INTO DELICIOUS MEATY CHUNKS.",
+ "AFTER THE ANT FINISHES SUCKING ALL OF THE SAP OUT OF THE VINE HE TURNS HIS ATTENTION BACK TO YOU "
+ "AND BITES YOUR HEAD OFF.",
+ "THE CANTINA OWNER NOTICES YOU ARE TRYING TO STEAL OBJECTS FROM THE TABLES. "
+ "TWENTY YEARS LATER YOU ARE RELEASED FROM A SOUTH AMERICAN PRISON."
+};
+
+const char *const DEATH_TEXT_ENG_DEMO[34] = {
+ "SAM SALVADOR SPOTS YOU AND LETS YOU HAVE IT.",
+ "WHILE TAKING A MOONLIGHT SWIM YOU DISCOVER THAT PIRANHA REALLY CAN STRIP FLESH TO THE BONE.",
+ "THE GUARD FILLS YOU FULL OF HOLES BEFORE TOSSING YOU TO THE PIRANHA.",
+ "YOU'RE ONLY ABLE TO SWIM HALFWAY ACROSS THE RIVER BEFORE RUNNING OUT OF AIR. YOU MAKE SO MUCH NOISE GASPING FOR BREATH THAT SAM EASILY FINDS YOU AND LEAVES YOU IN THE RIVER PERMANENTLY.",
+ "SAM SALVADOR NOTICES SOMEONE HAS BEEN PLAYING WITH THE CARGO. HE TRACKS YOU DOWN AND LETS YOU HAVE IT.",
+ "THE GUARD COMES AROUND THE CORNER. HE DECIDES THAT THREE LEAD SLUGS WILL TEACH YOU TO BE MORE POLITE.",
+ "THE CAPTAIN IS WAITING OUTSIDE THE DOOR.",
+ "THE CAPTAIN'S RANDOM SHOOTING FINALLY FINDS ITS TARGET.",
+ "THE CRATE OUTSIDE THE WINDOW EXPLODES, DESTROYING THE SHIP. UNFORTUNATELY, YOU'RE STILL ABOARD.",
+ "THE DOOR WAS NOT BARRED AND THE CAPTAIN WALKS RIGHT IN AND PARTS YOUR HAIR.",
+ "",
+ "YOU RUN OUT ON DECK, THEN REALIZE THAT MAYA IS STILL TIED UP. AS YOU TURN TO GO BACK THE BOAT BLOWS UP.",
+ "AFTER YOU FAIL TO PROVE YOUR DIVINITY THE NATIVES EAT YOU FOR LUNCH.",
+ "THIS IS THE GENERIC DEATH SCENE",
+ "YOU ONLY MAKE IT HALFWAY ACROSS THE RIVER BEFORE THE PIRANHA STRIKE.",
+ "WITH NOTHING TO PROTECT HIM FROM THE HAIL OF BULLETS ALLEN IS QUICKLY GUNNED DOWN. JASON AND MAYA SOON FOLLOW...",
+ "THE COMBINATION OF THE WIND AND GUNFIRE KNOCK THE CORRUGATED IRON OVER, LEAVING YOU WITHOUT PROTECTION.",
+ "WITHOUT SUFFICIENT AMMUNITION, ALLEN IS UNABLE TO HOLD OFF THE ATTACKERS FOR LONG. THIS RESULTS IN A SERIOUS CASE OF LEAD POISONING.",
+ "ALLEN IS A MARVELOUS SHOT, BUT HIS AMMUNITION IS NOT UNLIMITED. SOON IT IS ALL OVER.",
+ "THE PILOT FEELS YOU ARE TOO CLOSE AND PULLS THE TRIGGER.",
+ "THE PILOT SHOOTS YOU IN THE HEAD, THEN TOSSES YOUR LIFELESS",
+ "THE PLANE CRASHES INTO THE JUNGLE CANOPY AT 200 MPH.",
+ "THE CANOE HITS THE ROCKS AND CAPSIZES, AND THE PIRANHA MAKE YOU THEIR LUNCH GUESTS.",
+ "YOU ACCIDENTALLY DISCOVER THE FOURTH TALLEST WATERFALL IN SOUTH AMERICA.",
+ "YOU DISCOVER A VERY HUNGRY TRIBE OF CANNIBALS.",
+ "YOU BECOME LOST IN THE WINDING WATERWAYS AND WANDER UNTIL YOU STARVE TO DEATH.",
+ "YOU BECOME TRAPPED IN THE RAPIDS AND ARE CRUSHED BETWEEN THE ROCKS.",
+ "YOU WAIT AROUND FOR SOME TIME, BUT HANS STROHEIM NEVER SPEAKS TO YOU AGAIN. FINALLY YOU RETURN HOME KNOWING YOU HAVE FAILED.",
+ "DECIDING THAT YOU THREATEN HIM AND HIS WORK, HANS STROHEIM HAS THE NATIVES IN THE VILLAGE KILL YOU.",
+ "YOU DO NOT GET FAR ENOUGH AWAY BEFORE THE DYNAMITE EXPLODES AND YOU ARE BLOWN INTO A THOUSAND PIECES.",
+ "STANDING OUT IN THE OPEN YOU ARE EXPOSED TO THE HAIL OF BULLETS FROM SANCHEZ' MEN.",
+ "THE AMAZON SENTINELS SPOT YOU AND FILL YOU FULL OF ARROWS.",
+ "SAM MAY BE UGLY, BUT HE'S NOT DEAF. HE HEARS ALL THE NOISE YOU ARE MAKING AND CANCELS YOUR BOARDING PASS.",
+ "WITH THE BAR OFF THE DOOR THE CAPTAIN WALTZES IN AND BLOWS YOU AWAY"
+};
+
+const char *const INVENTORY_NAMES_ENG[85] = {
+ "RAT", "ALCOHOL", "SAFE COMBINATION", "BEAKER", "MICROFILM",
+ "VAULT KEY", "BOLT CUTTERS", "BLOWGUN", "LOVE POTION", "MONEY",
+ "DARTS", "TAPE", "JUNGLE POTION", "MOVIE", "CABINET KEY",
+ "DISPLAY CASE KEY", "FLITCH'S CAR KEYS", "COAT HANGER",
+ "CROWBAR", "COMPASS", "MAP", "LETTER OPENER", "LETTER",
+ "DECODER", "DIPPED DART", "LOADED BLOWGUN", "CARD", "JERRYCAN",
+ "CIGARETTES", "BIKE PUMP", "PARACHUTE", "PESO", "PEPPERS",
+ "MACHETE", "POISON ROOT", "AMMUNITION", "PADDLE", "FISHING NET",
+ "RAT TRAP", "CHEESE", "LOADED TRAP", "KNIFE", "CHOPPED PEPPERS",
+ "LIGHTER", "LADDER", "SMALL POLE", "JEEP KEY", "CHAIN", "ARROW",
+ "FILLED JERRY CAN", "EXPLOSIVES", "GEIGER COUNTER", "VINE",
+ "GOLD NUGGET", "HOLLOW REED", "AMAZON QUEEN KEYS", "FISHING POLE",
+ "HARPOON", "RAG", "BOTTLE OF RUM", "RAG IN BOTTLE", "MOLOTOV COCKTAIL",
+ "JUNGLE PLANT", "LADLE", "WORM", "FISH", "FIREWORKS", "BAITED POLE",
+ "FILLED LADLE", "EMERALD", "SMALL KEY", "SCROLL", "LIT EXPLOSIVES",
+ "LIGHTER", "BROKEN SPEAR", "SHOE LACES", "TORCH", "LACES AND SPEAR",
+ "KNIFE SPEAR", "GARBAGE CAN", "RAFT", "INFLATED RAFT",
+ "JASON'S CAR KEYS", "PESO BILLS", "PLANK"
+};
+
+const int COMBO_TABLE[85][4] = {
+ { -1, -1, -1, -1 },
+ { 12, 3, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 24, 25, -1, -1 },
+ { 10, 24, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 8, 24, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 1, 3, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 7, 25, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 80, 81, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 41, 42, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 39, 40, -1, -1 },
+ { 38, 40, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 32, 42, 77, 78 },
+ { -1, -1, -1, -1 },
+ { 60, 61, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 73, 72, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 64, 67, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 59, 60, -1, -1 },
+ { 58, 60, -1, -1 },
+ { 43, 61, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 56, 67, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 50, 72, -1, -1 },
+ { 75, 77, -1, -1 },
+ { 74, 77, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 41, 78, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { 29, 81, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 },
+ { -1, -1, -1, -1 }
+};
+
+const char *const NO_HELP_MESSAGE_ENG =
+ "WE ARE UNABLE TO PROVIDE YOU WITH ANY MORE HINTS. YOUR IQ \
+HAS DECREASED SO FAR THAT WE CAN NO LONGER PUT THE HINTS IN TERMS \
+YOU CAN UNDERSTAND.";
+const char *const NO_HINTS_MESSAGE_ENG = "THE HELP SYSTEM HAS BEEN TURNED OFF FOR THIS GAME.";
+const char *const RIVER_HIT1_ENG = "YOU HIT THE ROCKS AND THE CANOE BEGINS TO LEAK.";
+const char *const RIVER_HIT2_ENG = "YOU HIT THE ROCKS AND THE CANOE DEVELOPS SERIOUS LEAKS.";
+const char *const BAR_MESSAGE_ENG = "YOU ARE TOO BUSY TRYING TO KEEP FROM SINKING TO DO THAT";
+const char *const HELPLVLTXT_ENG[3] = { " LEVEL 1 ", " LEVEL 2 ", " LEVEL 3 " };
+
+const char *const IQLABELS_ENG[9] = {
+ "VEGETABLE",
+ "NEANDERTHAL",
+ "LOBOTOMIZED",
+ "DENSE",
+ "AVERAGE",
+ "INTELLIGENT",
+ "MURPHYITE",
+ "BRILLIANT",
+ "GENIUS"
+};
+
+const char *const CANT_GET_THERE_ENG = "YOU CAN'T GET THERE FROM HERE.";
+
+} // End of namespace Amazon
diff --git a/devtools/create_access/amazon_resources.h b/devtools/create_access/amazon_resources.h
new file mode 100644
index 0000000000..aae27ce3ba
--- /dev/null
+++ b/devtools/create_access/amazon_resources.h
@@ -0,0 +1,62 @@
+/* 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.
+ *
+ */
+
+#ifndef __AMAZON_RESOURCES_H__
+#define __AMAZON_RESOURCES_H__
+
+#include "common/scummsys.h"
+
+namespace Amazon {
+
+#define AMAZON_NUM_CURSORS 10
+extern const byte *const CURSORS[AMAZON_NUM_CURSORS];
+extern const uint CURSOR_SIZES[AMAZON_NUM_CURSORS];
+
+extern const int FONT2_INDEX[];
+extern const byte FONT2_DATA[];
+extern const int FONT6x6_INDEX[];
+extern const byte FONT6x6_DATA[];
+extern const uint FONT2_INDEX_SIZE;
+extern const uint FONT2_DATA_SIZE;
+extern const uint FONT6x6_INDEX_SIZE;
+extern const uint FONT6x6_DATA_SIZE;
+
+extern const char *const ROOM_DESCR[64];
+extern const char *const DEATH_TEXT_ENG[58];
+extern const char *const DEATH_TEXT_ENG_DEMO[34];
+extern const byte DEATH_SCREENS_ENG[58];
+extern const byte DEATH_SCREENS_ENG_DEMO[34];
+extern const char *const INVENTORY_NAMES_ENG[85];
+extern const int COMBO_TABLE[85][4];
+
+extern const char *const NO_HELP_MESSAGE_ENG;
+extern const char *const NO_HINTS_MESSAGE_ENG;
+extern const char *const RIVER_HIT1_ENG;
+extern const char *const RIVER_HIT2_ENG;
+extern const char *const BAR_MESSAGE_ENG;
+extern const char *const HELPLVLTXT_ENG[3];
+extern const char *const IQLABELS_ENG[9];
+extern const char *const CANT_GET_THERE_ENG;
+
+} // End of namespace Amazon
+
+#endif
diff --git a/devtools/create_access/create_access_dat.cpp b/devtools/create_access/create_access_dat.cpp
new file mode 100644
index 0000000000..a1591ef6e5
--- /dev/null
+++ b/devtools/create_access/create_access_dat.cpp
@@ -0,0 +1,430 @@
+/* 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.
+ *
+ */
+
+// Disable symbol overrides so that we can use system headers.
+#define FORBIDDEN_SYMBOL_ALLOW_ALL
+
+// 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 "common/language.h"
+#include "common/rect.h"
+#include "create_access_dat.h"
+#include "amazon_resources.h"
+#include "martian_resources.h"
+
+/**
+ * Format of the access.dat file that will be created:
+ * 4 Bytes - Magic string 'SVMA' to identify valid data file
+ * 2 bytes - Version number
+ * 2 Bytes - Number of different games data in the data file
+ * Series of index entries identifying each game:
+ * 1 byte - Game type: 1 = Amazon, 2 = Martian Memorandum, 3 = Noctropolis
+ * 1 byte - disc type: 0 = Floppy, 1 = CD, 2 = Common data shared across
+ * all variations of the given game
+ * 1 byte - Is Demo: 0 = Full game, 1 = Demo
+ * 1 byte - Language (Common::Language)
+ * 4 bytes - File offset for the data for the game
+ */
+
+File outputFile;
+
+void writeHeader(int numExecutables);
+void writeAmazonCommonData();
+void writeMartianCommonData();
+bool processExecutable(int idx, const char *name);
+
+void NORETURN_PRE error(const char *s, ...) {
+ printf("%s\n", s);
+ exit(1);
+}
+
+int main(int argc, char *argv[]) {
+ const uint NUM_COMMON_ENTRIES = 2;
+
+ if (argc < 3) {
+ printf("Format: %s output_filename executable1 [executable2 ..]\n", argv[0]);
+ exit(0);
+ }
+
+ // Create the new data file for output
+ outputFile.open(argv[1], kFileWriteMode);
+ writeHeader(argc - 2 + NUM_COMMON_ENTRIES);
+
+ // Write out entries containing common data for the games
+ writeAmazonCommonData();
+ writeMartianCommonData();
+
+ // Iterate through processing each specified executable
+ outputFile.seek(0, SEEK_END);
+ for (int idx = 2; idx < argc; ++idx) {
+ if (!processExecutable(idx - 2 + NUM_COMMON_ENTRIES, argv[idx]))
+ break;
+ }
+
+ // Close the output file
+ outputFile.close();
+}
+
+void writeHeader(int numExecutables) {
+ // Write out magic string
+ const char *MAGIC_STR = "SVMA";
+ outputFile.write(MAGIC_STR, 4);
+
+ // Write out version number
+ outputFile.writeWord(VERSION_NUMBER);
+
+ // Write out the number of entries the data file will contain
+ outputFile.writeWord(numExecutables);
+
+ // Write out padding for index entries that will be written
+ outputFile.writeByte(0, 8 * numExecutables);
+}
+
+void writeAmazonCommonData() {
+ // Write out the header entry
+ outputFile.seek(8);
+ outputFile.writeByte(1); // Amazon
+ outputFile.writeByte(2); // Common data
+ outputFile.writeByte(0);
+ outputFile.writeByte(0);
+ outputFile.writeLong(outputFile.size());
+
+ // Write out cursor list
+ outputFile.seek(0, SEEK_END);
+ outputFile.writeWord(AMAZON_NUM_CURSORS);
+
+ for (uint idx = 0; idx < AMAZON_NUM_CURSORS; ++idx) {
+ outputFile.writeWord(Amazon::CURSOR_SIZES[idx]);
+ outputFile.write(Amazon::CURSORS[idx], Amazon::CURSOR_SIZES[idx]);
+ }
+
+ // Write out font data
+ outputFile.writeWord(Amazon::FONT2_INDEX_SIZE);
+ for (uint idx = 0; idx < Amazon::FONT2_INDEX_SIZE; ++idx)
+ outputFile.writeWord(Amazon::FONT2_INDEX[idx]);
+
+ outputFile.writeWord(Amazon::FONT2_DATA_SIZE);
+ outputFile.write(Amazon::FONT2_DATA, Amazon::FONT2_DATA_SIZE);
+
+ outputFile.writeWord(Amazon::FONT6x6_INDEX_SIZE);
+ for (uint idx = 0; idx < Amazon::FONT6x6_INDEX_SIZE; ++idx)
+ outputFile.writeWord(Amazon::FONT6x6_INDEX[idx]);
+
+ outputFile.writeWord(Amazon::FONT6x6_DATA_SIZE);
+ outputFile.write(Amazon::FONT2_DATA, Amazon::FONT6x6_DATA_SIZE);
+}
+
+
+void writeMartianCommonData() {
+ // Write out the header entry
+ outputFile.seek(16);
+ outputFile.writeByte(2); // Martian
+ outputFile.writeByte(2); // Common data
+ outputFile.writeByte(0);
+ outputFile.writeByte(0);
+ outputFile.writeLong(outputFile.size());
+
+ // Write out cursor list
+ outputFile.seek(0, SEEK_END);
+ outputFile.writeByte(MARTIAN_NUM_CURSORS);
+
+ for (uint idx = 0; idx < MARTIAN_NUM_CURSORS; ++idx) {
+ outputFile.writeWord(Martian::CURSOR_SIZES[idx]);
+ outputFile.write(Martian::CURSORS[idx], Martian::CURSOR_SIZES[idx]);
+ }
+}
+
+bool processExecutable(int exeIdx, const char *name) {
+ uint dataSegmentOffset;
+ uint filenamesOffset, numFilenames;
+ uint charsStart, charsEnd;
+ uint roomsStart, roomsEnd, numRooms;
+ uint travelPosOffset;
+ const char *const *roomDescs;
+ const byte *deathScreens;
+ const char *const *deathText;
+ uint numDeaths;
+ uint numItems;
+ const char *const *itemNames;
+ const int *comboTable;
+ byte gameId = 0, discType = 0, demoType = 0;
+ byte language = Common::EN_ANY;
+
+ // Open up the file for access
+ File exeFile;
+ if (!exeFile.open(name)) {
+ printf("Could not open file - %s\n", name);
+ return false;
+ }
+
+ // Total up the first 256 bytes of the executable as a simplified
+ // means of identifying the different executables we support
+ uint fileChecksum = 0;
+ for (int idx = 0; idx < 256; ++idx)
+ fileChecksum += exeFile.readByte();
+
+ switch (fileChecksum) {
+ case 11899:
+ // Amazon English floppy
+ gameId = 1;
+ dataSegmentOffset = 0xC8C0;
+ filenamesOffset = dataSegmentOffset + 0x3628;
+ numFilenames = 100;
+ charsStart = dataSegmentOffset + 0x4234;
+ charsEnd = dataSegmentOffset + 0x49c6;
+ roomsStart = dataSegmentOffset + 0x35a8;
+ roomsEnd = dataSegmentOffset + 0x4234;
+ travelPosOffset = dataSegmentOffset + 0x5ff7;
+ numRooms = 64;
+ roomDescs = &Amazon::ROOM_DESCR[0];
+ deathScreens = Amazon::DEATH_SCREENS_ENG;
+ deathText = &Amazon::DEATH_TEXT_ENG[0];
+ numDeaths = sizeof(Amazon::DEATH_SCREENS_ENG);
+ numItems = 85;
+ itemNames = &Amazon::INVENTORY_NAMES_ENG[0];
+ comboTable = &Amazon::COMBO_TABLE[0][0];
+ break;
+
+ case 12360:
+ // Amazon CD English
+ gameId = 1;
+ discType = 1;
+ dataSegmentOffset = 0xd370;
+ filenamesOffset = dataSegmentOffset + 0x3EA0;
+ numFilenames = 116;
+ charsStart = dataSegmentOffset + 0x4BDC;
+ charsEnd = dataSegmentOffset + 0x5AF4;
+ roomsStart = dataSegmentOffset + 0x3E20;
+ roomsEnd = dataSegmentOffset + 0x4BDC;
+ travelPosOffset = dataSegmentOffset + 0x7125;
+ numRooms = 64;
+ roomDescs = &Amazon::ROOM_DESCR[0];
+ deathScreens = Amazon::DEATH_SCREENS_ENG;
+ deathText = &Amazon::DEATH_TEXT_ENG[0];
+ numDeaths = sizeof(Amazon::DEATH_SCREENS_ENG);
+ numItems = 85;
+ itemNames = &Amazon::INVENTORY_NAMES_ENG[0];
+ comboTable = &Amazon::COMBO_TABLE[0][0];
+ break;
+
+ case 11748:
+ // Amazon English Demo
+ gameId = 1;
+ discType = 0;
+ demoType = 1;
+ dataSegmentOffset = 0xa2a0;
+ filenamesOffset = dataSegmentOffset + 0x242C;
+ numFilenames = 100;
+ charsStart = dataSegmentOffset + 0x2F1A;
+ charsEnd = dataSegmentOffset + 0x34FB;
+ roomsStart = dataSegmentOffset + 0x23AC;
+ roomsEnd = dataSegmentOffset + 0x2F1A;
+ travelPosOffset = dataSegmentOffset + 0x494E;
+ numRooms = 64;
+ roomDescs = &Amazon::ROOM_DESCR[0];
+ deathScreens = Amazon::DEATH_SCREENS_ENG;
+ deathText = &Amazon::DEATH_TEXT_ENG[0];
+ numDeaths = sizeof(Amazon::DEATH_SCREENS_ENG);
+ numItems = 85;
+ itemNames = &Amazon::INVENTORY_NAMES_ENG[0];
+ comboTable = &Amazon::COMBO_TABLE[0][0];
+ break;
+
+ case 1224:
+ // Martian Memorandum English packed
+ printf("Martian Memorandum provided that's packed with EXEPACK.\n");
+ printf("It needs to be first unpacked before it can be used with this tool.\n");
+ return false;
+
+ case 0:
+ // Martian Memorandum English
+ gameId = 2;
+ dataSegmentOffset = 0x8d78;
+ filenamesOffset = dataSegmentOffset + 0x373A;
+ numFilenames = 80;
+ charsStart = dataSegmentOffset + 0x40F2;
+ charsEnd = dataSegmentOffset + 0x46F8;
+ roomsStart = dataSegmentOffset + 0x36DA;
+ roomsEnd = dataSegmentOffset + 0x40F2;
+ travelPosOffset = dataSegmentOffset + 0x58E9;
+ numRooms = 48;
+ roomDescs = &Martian::ROOM_DESCR[0];
+ deathScreens = Martian::DEATH_SCREENS_ENG;
+ deathText = &Martian::DEATH_TEXT_ENG[0];
+ numDeaths = sizeof(Martian::DEATH_SCREENS_ENG);
+ numItems = 85;
+ itemNames = &Martian::INVENTORY_NAMES_ENG[0];
+ comboTable = nullptr;
+ break;
+
+ default:
+ printf("Unknown game executable specified - %s\n", name);
+ exeFile.close();
+ return false;
+ }
+
+ // Write out header entry
+ uint outputOffset = outputFile.size();
+ outputFile.seek(8 + exeIdx * 8);
+ outputFile.writeByte(gameId);
+ outputFile.writeByte(discType);
+ outputFile.writeByte(demoType);
+ outputFile.writeByte(language);
+ outputFile.writeLong(outputOffset);
+ outputFile.seek(0, SEEK_END);
+
+ // Write out list of AP filenames
+ outputFile.writeWord(numFilenames);
+ for (uint idx = 0; idx < numFilenames; ++idx) {
+ exeFile.seek(filenamesOffset + idx * 2);
+ uint nameOffset = exeFile.readWord();
+
+ exeFile.seek(dataSegmentOffset + nameOffset);
+ outputFile.writeString(exeFile);
+ }
+
+ // Write out the character list
+ exeFile.seek(charsStart);
+ Common::Array<uint> charOffsets;
+ charOffsets.push_back(exeFile.readWord());
+ assert((dataSegmentOffset + charOffsets[0] - exeFile.pos()) < 512);
+
+ while (exeFile.pos() < (dataSegmentOffset + charOffsets[0]))
+ charOffsets.push_back(exeFile.readWord());
+
+ outputFile.writeWord(charOffsets.size());
+ charOffsets.push_back(charsEnd);
+ for (uint idx = 0; idx < charOffsets.size() - 1; ++idx) {
+ if (charOffsets[idx] == 0) {
+ outputFile.writeWord(0);
+ } else {
+ uint nextOffset = 0xffff;
+ for (uint idx2 = 0; idx2 < charOffsets.size(); ++idx2) {
+ if (charOffsets[idx2] && charOffsets[idx2] > charOffsets[idx] && charOffsets[idx2] < nextOffset)
+ nextOffset = charOffsets[idx2];
+ }
+ uint size = nextOffset - charOffsets[idx];
+
+ exeFile.seek(dataSegmentOffset + charOffsets[idx]);
+ outputFile.writeWord(size);
+ outputFile.write(exeFile, size);
+ }
+ }
+
+ // Write out the room data
+ Common::Array<uint> roomOffsets;
+ Common::Array<Common::Point> travelPos;
+
+ exeFile.seek(roomsStart);
+ for (uint idx = 0; idx < numRooms; ++idx)
+ roomOffsets.push_back(exeFile.readWord());
+ roomOffsets.push_back(roomsEnd);
+
+ exeFile.seek(travelPosOffset);
+ for (uint idx = 0; idx < numRooms; ++idx) {
+ int16 xp = (int16)exeFile.readWord();
+ int16 yp = (int16)exeFile.readWord();
+ travelPos.push_back(Common::Point(xp, yp));
+ }
+
+ outputFile.writeWord(numRooms);
+ for (uint idx = 0; idx < numRooms; ++idx) {
+ uint dataSize = 0;
+
+ if (roomOffsets[idx] == 0) {
+ dataSize = 0;
+ } else {
+ // Find the offset of the next higher entry that's non-zero
+ uint offset = 0;
+ for (uint idx2 = idx + 1; !offset; ++idx2)
+ offset = roomOffsets[idx2];
+ dataSize = offset - roomOffsets[idx];
+ exeFile.seek(dataSegmentOffset + roomOffsets[idx]);
+ }
+
+ // Write out the room description (used only by the debugger)
+ outputFile.writeString(roomDescs[idx]);
+
+ // Write out travel position
+ outputFile.writeWord((uint16)travelPos[idx].x);
+ outputFile.writeWord((uint16)travelPos[idx].y);
+
+ // Write out the data for the room
+ outputFile.writeWord(dataSize);
+ if (dataSize > 0)
+ outputFile.write(exeFile, dataSize);
+ }
+
+ // Write out the deaths list
+ outputFile.writeWord(numDeaths);
+ for (uint idx = 0; idx < numDeaths; ++idx) {
+ // Write out the screen number and text
+ outputFile.writeByte(deathScreens[idx]);
+ outputFile.writeString(deathText[idx]);
+ }
+
+ // Write out inventory data
+ outputFile.writeWord(numItems);
+ for (uint idx = 0; idx < numItems; ++idx) {
+ outputFile.writeString(itemNames[idx]);
+
+ if (comboTable == nullptr) {
+ for (uint cIdx = 0; cIdx < 4; ++cIdx)
+ outputFile.writeWord(0);
+ } else {
+ for (uint cIdx = 0; cIdx < 4; ++cIdx, ++comboTable)
+ outputFile.writeWord((uint16)*comboTable);
+ }
+ }
+
+ // Write out game specific strings and other data
+ if (gameId == 1) {
+ // Write out miscellaneous strings
+ outputFile.writeString(Amazon::NO_HELP_MESSAGE_ENG);
+ outputFile.writeString(Amazon::NO_HINTS_MESSAGE_ENG);
+ outputFile.writeString(Amazon::RIVER_HIT1_ENG);
+ outputFile.writeString(Amazon::RIVER_HIT2_ENG);
+ outputFile.writeString(Amazon::BAR_MESSAGE_ENG);
+
+ for (int idx = 0; idx < 3; ++idx)
+ outputFile.writeString(Amazon::HELPLVLTXT_ENG[idx]);
+ for (int idx = 0; idx < 9; ++idx)
+ outputFile.writeString(Amazon::IQLABELS_ENG[idx]);
+
+ outputFile.writeString(Amazon::CANT_GET_THERE_ENG);
+ }
+
+ // Do final padding to the next paragraph boundary
+ if ((outputFile.size() % 16) != 0)
+ outputFile.writeByte(0, 16 - (outputFile.size() % 16));
+
+ // Close the executable and signal that it was processed successfully
+ exeFile.close();
+ return true;
+}
diff --git a/devtools/create_access/create_access_dat.h b/devtools/create_access/create_access_dat.h
new file mode 100644
index 0000000000..4976edec46
--- /dev/null
+++ b/devtools/create_access/create_access_dat.h
@@ -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 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.
+ *
+ */
+
+#ifndef __CREATE_ACCESS_DAT_H__
+#define __CREATE_ACCESS_DAT_H__
+
+#include <stdio.h>
+#include <stdlib.h>
+#include "common/scummsys.h"
+#include "common/endian.h"
+#include "common/array.h"
+
+#define VERSION_NUMBER 1
+
+enum AccessMode {
+ kFileReadMode = 1,
+ kFileWriteMode = 2
+};
+
+class File {
+private:
+ FILE *_f;
+ const byte *_memPtr;
+ size_t _offset, _size;
+public:
+ File() : _f(nullptr), _memPtr(nullptr), _offset(0), _size(0) {}
+
+ bool open(const char *filename, AccessMode mode = kFileReadMode) {
+ _memPtr = nullptr;
+ _f = fopen(filename, (mode == kFileReadMode) ? "rb" : "wb+");
+ return (_f != NULL);
+ }
+ bool open(const byte *data, uint size) {
+ close();
+ _memPtr = data;
+ _size = size;
+ return true;
+ }
+
+ void close() {
+ if (_f)
+ fclose(_f);
+ _f = nullptr;
+ _memPtr = nullptr;
+ }
+ int seek(int32 offset, int whence = SEEK_SET) {
+ if (_f)
+ return fseek(_f, offset, whence);
+
+ switch (whence) {
+ case SEEK_SET:
+ _offset = offset;
+ break;
+ case SEEK_CUR:
+ _offset += offset;
+ break;
+ case SEEK_END:
+ _offset = _size + offset;
+ break;
+ default:
+ break;
+ }
+
+ return _offset;
+ }
+ void skip(int32 offset) {
+ if (_f)
+ fseek(_f, offset, SEEK_CUR);
+ else
+ _offset += offset;
+ }
+ long read(void *buffer, size_t len) {
+ if (_f)
+ return fread(buffer, 1, len, _f);
+
+ uint bytesToRead = CLIP(len, (size_t)0, _size - _offset);
+ memcpy(buffer, &_memPtr[_offset], bytesToRead);
+ _offset += bytesToRead;
+ return bytesToRead;
+ }
+ void write(const void *buffer, size_t len) {
+ assert(_f);
+ fwrite(buffer, 1, len, _f);
+ }
+ void write(File &src, size_t len) {
+ for (size_t idx = 0; idx < len; ++idx)
+ writeByte(src.readByte());
+ }
+ byte readByte() {
+ byte v;
+ read(&v, sizeof(byte));
+ return v;
+ }
+ uint16 readWord() {
+ uint16 v;
+ read(&v, sizeof(uint16));
+ return FROM_LE_16(v);
+ }
+ uint32 readLong() {
+ uint32 v;
+ read(&v, sizeof(uint32));
+ return FROM_LE_32(v);
+ }
+ void writeByte(byte v) {
+ write(&v, sizeof(byte));
+ }
+ void writeByte(byte v, int len) {
+ byte *b = new byte[len];
+ memset(b, v, len);
+ write(b, len);
+ delete[] b;
+ }
+ void writeWord(uint16 v) {
+ uint16 vTemp = TO_LE_16(v);
+ write(&vTemp, sizeof(uint16));
+ }
+ void writeLong(uint32 v) {
+ uint32 vTemp = TO_LE_32(v);
+ write(&vTemp, sizeof(uint32));
+ }
+ void writeString(const char *msg) {
+ if (!msg) {
+ writeByte(0);
+ } else {
+ do {
+ writeByte(*msg);
+ } while (*msg++);
+ }
+ }
+ void writeString(File &src) {
+ char c;
+ do {
+ c = src.readByte();
+ writeByte(c);
+ } while (c);
+ }
+ uint32 pos() const {
+ if (_f)
+ return ftell(_f);
+ else
+ return _offset;
+ }
+ uint32 size() const {
+ if (_f) {
+ uint32 currentPos = pos();
+ fseek(_f, 0, SEEK_END);
+ uint32 result = pos();
+ fseek(_f, currentPos, SEEK_SET);
+ return result;
+ } else if (_memPtr) {
+ return _size;
+ } else {
+ return 0;
+ }
+ }
+ bool eof() const {
+ if (_f)
+ return feof(_f) != 0;
+ else if (_memPtr)
+ return _offset >= _size;
+ return false;
+ }
+};
+
+#endif
diff --git a/devtools/create_access/martian_resources.cpp b/devtools/create_access/martian_resources.cpp
new file mode 100644
index 0000000000..381b79a073
--- /dev/null
+++ b/devtools/create_access/martian_resources.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 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.
+ *
+ */
+
+#include "martian_resources.h"
+
+namespace Martian {
+
+
+const byte MOUSE0[] = {
+ // hotspot x and y, uint16 LE
+ 0, 0, 0, 0,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0, 2, 0xF7, 5,
+ 0, 3, 0xF7, 0xF7, 5,
+ 0, 3, 0xF7, 0xF7, 5,
+ 0, 4, 0xF7, 0xF7, 0xF7, 5,
+ 0, 4, 0xF7, 0xF7, 0xF7, 5,
+ 0, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5,
+ 0, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5,
+ 0, 6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5,
+ 0, 6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5,
+ 0, 7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5,
+ 0, 6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5,
+ 0, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5,
+ 2, 3, 0xF7, 0xF7, 5,
+ 3, 3, 0xF7, 0xF7, 5,
+ 3, 3, 0xF7, 0xF7, 5,
+ 4, 2, 0xF7, 5
+};
+const byte MOUSE1[] = {
+ // hotspot x and y, uint16 LE
+ 7, 0, 7, 0,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 6, 1, 0xF7,
+ 4, 5, 0xFF, 0xFF, 0, 0xFF, 0xFF,
+ 3, 7, 0xFF, 0, 0, 0, 0, 0, 0xFF,
+ 2, 9, 0xFF, 0, 0, 0, 0xF7, 0, 0, 0, 0xFF,
+ 1, 11, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF,
+ 1, 11, 0xFF, 0, 0, 0, 0, 0xF7, 0, 0, 0, 0, 0xFF,
+ 0, 13, 0xF7, 0, 0, 0xF7, 0, 0xF7, 0, 0xF7, 0, 0xF7, 0, 0, 0xF7,
+ 1, 11, 0xFF, 0, 0, 0, 0, 0xF7, 0, 0, 0, 0, 0xFF,
+ 1, 11, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF,
+ 2, 9, 0xFF, 0, 0, 0, 0xF7, 0, 0, 0, 0xFF,
+ 3, 7, 0xFF, 0, 0, 0, 0, 0, 0xFF,
+ 4, 5, 0xFF, 0xFF, 0, 0xFF, 0xFF,
+ 6, 1, 0xF7,
+ 0, 0,
+ 0, 0,
+ 0, 0
+};
+const byte MOUSE2[] = {
+ // hotspot x and y, uint16 LE
+ 8, 0, 8, 0,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0, 0,
+ 0, 0,
+ 7, 2, 4, 5,
+ 7, 2, 4, 5,
+ 7, 2, 4, 5,
+ 7, 2, 4, 5,
+ 7, 2, 4, 5,
+ 2, 12, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 5,
+ 7, 2, 4, 5,
+ 7, 2, 4, 5,
+ 7, 2, 4, 5,
+ 7, 2, 4, 5,
+ 7, 2, 4, 5,
+ 0, 0,
+ 0, 0,
+ 0, 0
+};
+const byte MOUSE3[] = {
+ // hotspot x and y, uint16 LE
+ 0, 0, 0, 0,
+ // byte 1: number of skipped pixels
+ // byte 2: number of plotted pixels
+ // then, pixels
+ 0, 11, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 0, 12, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 5,
+ 0, 12, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 5, 5,
+ 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5,
+ 0, 12, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 5,
+ 0, 12, 6, 6, 6, 6, 5, 0, 0, 6, 6, 6, 6, 5,
+ 0, 12, 6, 6, 6, 6, 6, 0, 6, 6, 6, 6, 6, 5,
+ 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5,
+ 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5,
+ 0, 12, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 5,
+ 0, 12, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 5,
+ 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5,
+ 1, 11, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 0, 0,
+ 0, 0,
+ 0, 0
+};
+
+const byte *const CURSORS[MARTIAN_NUM_CURSORS] = {
+ MOUSE0, MOUSE1, MOUSE2, MOUSE3
+};
+const uint CURSOR_SIZES[MARTIAN_NUM_CURSORS] = {
+ sizeof(MOUSE0), sizeof(MOUSE1), sizeof(MOUSE2), sizeof(MOUSE3)
+};
+
+const char *const ROOM_DESCR[48] = {
+ nullptr, "TBD ROOM_TABLE1", "TBD ROOM_TABLE2", "TBD ROOM_TABLE3", "TBD ROOM_TABLE4",
+ "TBD ROOM_TABLE5", "TBD ROOM_TABLE6", "TBD ROOM_TABLE7", "TBD ROOM_TABLE8", "TBD ROOM_TABLE9",
+ nullptr, "TBD ROOM_TABLE11", nullptr, "TBD ROOM_TABLE13", "TBD ROOM_TABLE14",
+ "TBD ROOM_TABLE15", "TBD ROOM_TABLE16", "TBD ROOM_TABLE17", "TBD ROOM_TABLE18", nullptr,
+ nullptr, "TBD ROOM_TABLE21", "TBD ROOM_TABLE22", "TBD ROOM_TABLE23", "TBD ROOM_TABLE24",
+ "TBD ROOM_TABLE25", "TBD ROOM_TABLE26", "TBD ROOM_TABLE27", "TBD ROOM_TABLE28", "TBD ROOM_TABLE29",
+ "TBD ROOM_TABLE30", "TBD ROOM_TABLE31", "TBD ROOM_TABLE32", "TBD ROOM_TABLE33", nullptr,
+ "TBD ROOM_TABLE35", nullptr, "TBD ROOM_TABLE37", "TBD ROOM_TABLE38", "TBD ROOM_TABLE39",
+ nullptr, nullptr, nullptr, nullptr, nullptr,
+ nullptr, nullptr, "TBD ROOM_TABLE47"
+};
+
+const byte DEATH_SCREENS_ENG[20] = {
+ 5, 5, 3, 3, 7, 4, 6, 2, 2, 2, 1, 5, 3, 5, 2, 8, 5, 3, 8, 5
+};
+
+const char *const DEATH_TEXT_ENG[20] = {
+ "A VICIOUS THUG PULLS OUT HIS GUN AND AIR CONDITIONS YOUR BRAIN.",
+ "BIG DICK COMES BACK AND ANNOUNCES YOUR TIME IS UP. ONE OF HIS BOYS PROCEEDS TO PART YOUR EYEBROWS.",
+ "ALTHOUGH HIS FIRST SHOT MISSED, THE PUNK FINDS YOU AND TURNS YOU INTO A DOUGHNUT.",
+ "THE CREEP SPOTS YOU. HE TURNS AND FIRES HIS WEAPON. IT BURNS A HOLE A BUZZARD CAN FLY THROUGH.",
+ "OBVIOUSLY RICK LOGAN HAS A FEW TRICK UP HIS SLEEVE. A TREMENDOUS WEIGHT HITS YOUR HEAD. YOU MUMBLE; WATCH OUT FOR THAT TREE...",
+ "SLOWLY SINKING IN THE SLIMY OOZE, YOU THINK OF SEVERAL JELLO WRESTLING MATCHES YOU'VE ATTENDED. BUT NO MORE...",
+ "THE PATH SUDDENLY GIVES WAY AND YOU FEEL MANY STAKES TEAR THROUGH YOUR FLESH. HOW DO YOU LIKE YOUR STAKE",
+ "THE SNAKE SINKS ITS FANGS INTO YOU LEG. THE POISON WORKS QUICKLY. THE SNAKE THEN SWALLOWS YOU WHOLE.",
+ "YOU FADE AWAY, GLOWING LIKE A LIGHTBULB.",
+ "YOU TOUCH THE BUBBLING RADIOACTIVE SELTZER. IT IMMEDIATELY CAUSES VITAL ORGANS TO ELONGATE AND EXPLODE. YOU DIE WITH AN ABSURD AND FOOLISH LOOK ON YOUR FACE.",
+ "THE DOGS PRETTY HUNGRY. IT WON'T TAKE HIM LONG TO FINISH SO SIT BACK AND ENJOY IT.",
+ "ROCKY DOESN'T LIKE BEING FOLLOWED. HE DECIDES TO BEAT YOU. WITHIN AND INCH OF YOUR LIFE. UNFORTUNATELY, HE MISJUDGED THE DISTANCE",
+ "YOU STUMBLE INTO DEADLY LASER FIRE.",
+ "THE OUTPOST AND YOUR BODY PARTS ARE BLOWN TO KINGDOM COME.",
+ "YOU REACH THE TOP, BUT YOUR AIR SOON RUNS OUT LEAVING YOU BREATHLESS.",
+ "YOU DIE IN THE FIERY EXPLOSION.",
+ "YOU FALL HUNDREDS OF FEET TO YOUR DEATH.",
+ "YOU WALK ONTO A PRESSURE SENSITIVE SECURITY PAD. A LASER ZEROS IN AND BLOWS A HOLE THE SIZE OF A SUBARU TIRE THROUGH YOU.",
+ "DANGERFIELD'S EXPERIMENT BACKFIRES. IT RELEASES A DEMON FROM HIS SUBCONSCIOUS WHICH DESTROYS THE ENTIRE PLANET.",
+ "ONCE DANGERFIELD GETS OUT OF HIS CHAMBER, HE PULLS OUT A WEAPON AND LETS YOU HAVE IT."
+};
+
+const char *const INVENTORY_NAMES_ENG[55] = {
+ "CAMERA", "LENS", "PHOTOS", "MAIL", "GUN",
+ "CASH", "COMLINK", "AMMO", "LOCKPICK KIT", "EARRING",
+ "RECIEPTS", "PAPER", "LADDER", "BOOTS", "DOCUMENTS",
+ "KNIFE", "DAGGER", "KEYS", "ROCK", "LOG",
+ "SHOVEL", "STONE", "REMOTE CONTROL", "FOOD AND WATER", "DOOR CARD KEY",
+ "FLASHLIGHT", "INTERLOCK KEY", "TOOLS", "REBREATHER", "JET PACK",
+ "ROD", "HCL2", "SAFE CARD KEY", "TUNING FORK", "STONE",
+ "ROSE", "KEY", "NOTE", "ALLEN WRENCH", "HOVER BOARD",
+ "BLUE PRINTS", "LETTER", "MEMORANDUM", "MARKERS", "FILM",
+ "ANDRETTI FILM", "GLASSES", "AMULET", "FACIAL KIT", "CAT FOOD",
+ "MONKEY WRENCH", "BIG DICK CARD", "BRA", "BOLT", nullptr
+};
+
+} // End of namespace Amazon
diff --git a/devtools/create_access/martian_resources.h b/devtools/create_access/martian_resources.h
new file mode 100644
index 0000000000..f80f4c1cf4
--- /dev/null
+++ b/devtools/create_access/martian_resources.h
@@ -0,0 +1,52 @@
+/* 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.
+ *
+ */
+
+#ifndef __MARTIAN_RESOURCES_H__
+#define __MARTIAN_RESOURCES_H__
+
+#include "common/scummsys.h"
+
+namespace Martian {
+
+#define MARTIAN_NUM_CURSORS 4
+extern const byte *const CURSORS[MARTIAN_NUM_CURSORS];
+extern const uint CURSOR_SIZES[MARTIAN_NUM_CURSORS];
+
+extern const char *const ROOM_DESCR[48];
+
+extern const char *const DEATH_TEXT_ENG[20];
+extern const byte DEATH_SCREENS_ENG[20];
+extern const char *const INVENTORY_NAMES_ENG[55];
+extern const int COMBO_TABLE[85][4];
+
+extern const char *const NO_HELP_MESSAGE_ENG;
+extern const char *const NO_HINTS_MESSAGE_ENG;
+extern const char *const RIVER_HIT1_ENG;
+extern const char *const RIVER_HIT2_ENG;
+extern const char *const BAR_MESSAGE_ENG;
+extern const char *const HELPLVLTXT_ENG[3];
+extern const char *const IQLABELS_ENG[9];
+extern const char *const CANT_GET_THERE_ENG;
+
+} // End of namespace Amazon
+
+#endif
diff --git a/devtools/create_access/module.mk b/devtools/create_access/module.mk
new file mode 100644
index 0000000000..4694ccc7ef
--- /dev/null
+++ b/devtools/create_access/module.mk
@@ -0,0 +1,13 @@
+
+MODULE := devtools/create_access
+
+MODULE_OBJS := \
+ create_access_dat.o \
+ amazon_resources.o \
+ martian_resources.o
+
+# Set the name of the executable
+TOOL_EXECUTABLE := create_access
+
+# Include common rules
+include $(srcdir)/rules.mk
diff --git a/devtools/create_kyradat/create_kyradat.cpp b/devtools/create_kyradat/create_kyradat.cpp
index 441f315c8d..e064e899de 100644
--- a/devtools/create_kyradat/create_kyradat.cpp
+++ b/devtools/create_kyradat/create_kyradat.cpp
@@ -45,7 +45,7 @@
enum {
- kKyraDatVersion = 86
+ kKyraDatVersion = 87
};
const ExtractFilename extractFilenames[] = {
diff --git a/devtools/create_kyradat/resources/lok_pc98_japanese.h b/devtools/create_kyradat/resources/lok_pc98_japanese.h
index 0cbc96aeb9..0a70ab945e 100644
--- a/devtools/create_kyradat/resources/lok_pc98_japanese.h
+++ b/devtools/create_kyradat/resources/lok_pc98_japanese.h
@@ -222,10 +222,11 @@ static const char *const k1PoisonGoneStringPC98Japanese[2] = {
static const StringListProvider k1PoisonGoneStringPC98JapaneseProvider = { ARRAYSIZE(k1PoisonGoneStringPC98Japanese), k1PoisonGoneStringPC98Japanese };
-static const char *const k1ThePoisonStringsPC98Japanese[3] = {
+static const char *const k1ThePoisonStringsPC98Japanese[4] = {
"\x93\xC5\x82\xBE\x81""E""\x81""E""\x81""E",
"\x8C\xC4\x8B""z""\x82\xAA\x8F""o""\x97\x88\x82\xC8\x82\xA2\x81""E""\x81""E""\x81""E",
- "\x8B""C""\x95\xAA\x82\xAA\x88\xAB\x82\xA2\x81""E""\x81""E""\x81""E"
+ "\x8B""C""\x95\xAA\x82\xAA\x88\xAB\x82\xA2\x81""E""\x81""E""\x81""E",
+ "\x82\xA0\x82\xCC\x8E\xD6\x82\xCD""\r""\x93\xC5\x8E\xD6\x82\xC9\x82\xBF\x82\xAA\x82\xA2\x82\xC8\x82\xA2\x81""I"
};
static const StringListProvider k1ThePoisonStringsPC98JapaneseProvider = { ARRAYSIZE(k1ThePoisonStringsPC98Japanese), k1ThePoisonStringsPC98Japanese };
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index 459342a67d..1a28946315 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -23,8 +23,8 @@
#ifndef TOOLS_CREATE_PROJECT_H
#define TOOLS_CREATE_PROJECT_H
-#ifndef __has_feature // Optional of course.
- #define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#ifndef __has_feature // Optional of course.
+#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
#include <map>
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index babd530ad7..c5c433c82e 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -42,42 +42,31 @@ namespace CreateProjectTool {
defines.push_back(name);
#define ADD_SETTING(config, key, value) \
- config.settings[key] = Setting(value, "", SettingsNoQuote);
+ config._settings[key] = Setting(value, "", kSettingsNoQuote);
#define ADD_SETTING_ORDER(config, key, value, order) \
- config.settings[key] = Setting(value, "", SettingsNoQuote, 0, order);
+ config._settings[key] = Setting(value, "", kSettingsNoQuote, 0, order);
#define ADD_SETTING_ORDER_NOVALUE(config, key, comment, order) \
- config.settings[key] = Setting("", comment, SettingsNoValue, 0, order);
+ config._settings[key] = Setting("", comment, kSettingsNoValue, 0, order);
#define ADD_SETTING_QUOTE(config, key, value) \
- config.settings[key] = Setting(value);
+ config._settings[key] = Setting(value);
#define ADD_SETTING_QUOTE_VAR(config, key, value) \
- config.settings[key] = Setting(value, "", SettingsQuoteVariable);
+ config._settings[key] = Setting(value, "", kSettingsQuoteVariable);
#define ADD_SETTING_LIST(config, key, values, flags, indent) \
- config.settings[key] = Setting(values, flags, indent);
+ config._settings[key] = Setting(values, flags, indent);
#define REMOVE_SETTING(config, key) \
- config.settings.erase(key);
+ config._settings.erase(key);
#define ADD_BUILD_FILE(id, name, fileRefId, comment) { \
Object *buildFile = new Object(this, id, name, "PBXBuildFile", "PBXBuildFile", comment); \
- buildFile->addProperty("fileRef", fileRefId, name, SettingsNoValue); \
+ buildFile->addProperty("fileRef", fileRefId, name, kSettingsNoValue); \
_buildFile.add(buildFile); \
- _buildFile.flags = SettingsSingleItem; \
-}
-
-#define ADD_FILE_REFERENCE(id, name, properties) { \
- Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name); \
- if (!properties.fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties.fileEncoding, "", SettingsNoValue); \
- if (!properties.lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties.lastKnownFileType, "", SettingsNoValue|SettingsQuoteVariable); \
- if (!properties.fileName.empty()) fileRef->addProperty("name", properties.fileName, "", SettingsNoValue|SettingsQuoteVariable); \
- if (!properties.filePath.empty()) fileRef->addProperty("path", properties.filePath, "", SettingsNoValue|SettingsQuoteVariable); \
- if (!properties.sourceTree.empty()) fileRef->addProperty("sourceTree", properties.sourceTree, "", SettingsNoValue); \
- _fileReference.add(fileRef); \
- _fileReference.flags = SettingsSingleItem; \
+ _buildFile._flags = kSettingsSingleItem; \
}
bool producesObjectFileOnOSX(const std::string &fileName) {
@@ -93,56 +82,56 @@ bool producesObjectFileOnOSX(const std::string &fileName) {
}
XcodeProvider::Group::Group(XcodeProvider *objectParent, const std::string &groupName, const std::string &uniqueName, const std::string &path) : Object(objectParent, uniqueName, groupName, "PBXGroup", "", groupName) {
- addProperty("name", name, "", SettingsNoValue|SettingsQuoteVariable);
- addProperty("sourceTree", "<group>", "", SettingsNoValue|SettingsQuoteVariable);
-
+ addProperty("name", _name, "", kSettingsNoValue | kSettingsQuoteVariable);
+ addProperty("sourceTree", "<group>", "", kSettingsNoValue | kSettingsQuoteVariable);
+
if (path != "") {
- addProperty("path", path, "", SettingsNoValue|SettingsQuoteVariable);
+ addProperty("path", path, "", kSettingsNoValue | kSettingsQuoteVariable);
}
_childOrder = 0;
_treeName = uniqueName;
}
void XcodeProvider::Group::ensureChildExists(const std::string &name) {
- std::map<std::string, Group*>::iterator it = _childGroups.find(name);
+ std::map<std::string, Group *>::iterator it = _childGroups.find(name);
if (it == _childGroups.end()) {
- Group *child = new Group(parent, name, this->_treeName + '/' + name, name);
+ Group *child = new Group(_parent, name, this->_treeName + '/' + name, name);
_childGroups[name] = child;
addChildGroup(child);
- parent->_groups.add(child);
+ _parent->_groups.add(child);
}
}
void XcodeProvider::Group::addChildInternal(const std::string &id, const std::string &comment) {
- if (properties.find("children") == properties.end()) {
+ if (_properties.find("children") == _properties.end()) {
Property children;
- children.hasOrder = true;
- children.flags = SettingsAsList;
- properties["children"] = children;
+ children._hasOrder = true;
+ children._flags = kSettingsAsList;
+ _properties["children"] = children;
}
- properties["children"].settings[id] = Setting("", comment + " in Sources", SettingsNoValue, 0, _childOrder++);
+ _properties["children"]._settings[id] = Setting("", comment + " in Sources", kSettingsNoValue, 0, _childOrder++);
if (_childOrder == 1) {
// Force children to use () even when there is only 1 child.
// Also this enforces the use of "," after the single item, instead of ; (see writeProperty)
- properties["children"].flags |= SettingsSingleItem;
+ _properties["children"]._flags |= kSettingsSingleItem;
} else {
- properties["children"].flags ^= SettingsSingleItem;
+ _properties["children"]._flags ^= kSettingsSingleItem;
}
}
-void XcodeProvider::Group::addChildGroup(const Group* group) {
- addChildInternal(parent->getHash(group->_treeName), group->_treeName);
+void XcodeProvider::Group::addChildGroup(const Group *group) {
+ addChildInternal(_parent->getHash(group->_treeName), group->_treeName);
}
void XcodeProvider::Group::addChildFile(const std::string &name) {
std::string id = "FileReference_" + _treeName + "/" + name;
- addChildInternal(parent->getHash(id), name);
+ addChildInternal(_parent->getHash(id), name);
FileProperty property = FileProperty(name, name, name, "\"<group>\"");
- parent->addFileReference(id, name, property);
+ _parent->addFileReference(id, name, property);
if (producesObjectFileOnOSX(name)) {
- parent->addBuildFile(_treeName + "/" + name, name, parent->getHash(id), name + " in Sources");
+ _parent->addBuildFile(_treeName + "/" + name, name, _parent->getHash(id), name + " in Sources");
}
}
@@ -151,14 +140,14 @@ void XcodeProvider::Group::addChildByHash(const std::string &hash, const std::st
}
XcodeProvider::Group *XcodeProvider::Group::getChildGroup(const std::string &name) {
- std::map<std::string, Group*>::iterator it = _childGroups.find(name);
+ std::map<std::string, Group *>::iterator it = _childGroups.find(name);
assert(it != _childGroups.end());
return it->second;
}
XcodeProvider::Group *XcodeProvider::touchGroupsForPath(const std::string &path) {
if (_rootSourceGroup == NULL) {
- assert (path == _projectRoot);
+ assert(path == _projectRoot);
_rootSourceGroup = new Group(this, "Sources", path, path);
_groups.add(_rootSourceGroup);
return _rootSourceGroup;
@@ -180,31 +169,31 @@ XcodeProvider::Group *XcodeProvider::touchGroupsForPath(const std::string &path)
void XcodeProvider::addFileReference(const std::string &id, const std::string &name, FileProperty properties) {
Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name);
- if (!properties.fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties.fileEncoding, "", SettingsNoValue);
- if (!properties.lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties.lastKnownFileType, "", SettingsNoValue|SettingsQuoteVariable);
- if (!properties.fileName.empty()) fileRef->addProperty("name", properties.fileName, "", SettingsNoValue|SettingsQuoteVariable);
- if (!properties.filePath.empty()) fileRef->addProperty("path", properties.filePath, "", SettingsNoValue|SettingsQuoteVariable);
- if (!properties.sourceTree.empty()) fileRef->addProperty("sourceTree", properties.sourceTree, "", SettingsNoValue);
+ if (!properties._fileEncoding.empty()) fileRef->addProperty("fileEncoding", properties._fileEncoding, "", kSettingsNoValue);
+ if (!properties._lastKnownFileType.empty()) fileRef->addProperty("lastKnownFileType", properties._lastKnownFileType, "", kSettingsNoValue | kSettingsQuoteVariable);
+ if (!properties._fileName.empty()) fileRef->addProperty("name", properties._fileName, "", kSettingsNoValue | kSettingsQuoteVariable);
+ if (!properties._filePath.empty()) fileRef->addProperty("path", properties._filePath, "", kSettingsNoValue | kSettingsQuoteVariable);
+ if (!properties._sourceTree.empty()) fileRef->addProperty("sourceTree", properties._sourceTree, "", kSettingsNoValue);
_fileReference.add(fileRef);
- _fileReference.flags = SettingsSingleItem;
+ _fileReference._flags = kSettingsSingleItem;
}
void XcodeProvider::addProductFileReference(const std::string &id, const std::string &name) {
Object *fileRef = new Object(this, id, name, "PBXFileReference", "PBXFileReference", name);
- fileRef->addProperty("explicitFileType", "compiled.mach-o.executable", "", SettingsNoValue|SettingsQuoteVariable);
- fileRef->addProperty("includeInIndex", "0", "", SettingsNoValue);
- fileRef->addProperty("path", name, "", SettingsNoValue|SettingsQuoteVariable);
- fileRef->addProperty("sourceTree", "BUILT_PRODUCTS_DIR", "", SettingsNoValue);
+ fileRef->addProperty("explicitFileType", "compiled.mach-o.executable", "", kSettingsNoValue | kSettingsQuoteVariable);
+ fileRef->addProperty("includeInIndex", "0", "", kSettingsNoValue);
+ fileRef->addProperty("path", name, "", kSettingsNoValue | kSettingsQuoteVariable);
+ fileRef->addProperty("sourceTree", "BUILT_PRODUCTS_DIR", "", kSettingsNoValue);
_fileReference.add(fileRef);
- _fileReference.flags = SettingsSingleItem;
+ _fileReference._flags = kSettingsSingleItem;
}
void XcodeProvider::addBuildFile(const std::string &id, const std::string &name, const std::string &fileRefId, const std::string &comment) {
Object *buildFile = new Object(this, id, name, "PBXBuildFile", "PBXBuildFile", comment);
- buildFile->addProperty("fileRef", fileRefId, name, SettingsNoValue);
+ buildFile->addProperty("fileRef", fileRefId, name, kSettingsNoValue);
_buildFile.add(buildFile);
- _buildFile.flags = SettingsSingleItem;
+ _buildFile._flags = kSettingsSingleItem;
}
XcodeProvider::XcodeProvider(StringList &global_warnings, std::map<std::string, StringList> &project_warnings, const int version)
@@ -218,7 +207,7 @@ void XcodeProvider::createWorkspace(const BuildSetup &setup) {
createDirectory(workspace);
_projectRoot = setup.srcDir;
touchGroupsForPath(_projectRoot);
-
+
// Setup global objects
setupDefines(setup);
#ifdef ENABLE_IOS
@@ -274,10 +263,10 @@ void XcodeProvider::ouputMainProjectFile(const BuildSetup &setup) {
// Header
project << "// !$*UTF8*$!\n"
"{\n"
- "\t" << writeSetting("archiveVersion", "1", "", SettingsNoQuote) << ";\n"
+ "\t" << writeSetting("archiveVersion", "1", "", kSettingsNoQuote) << ";\n"
"\tclasses = {\n"
"\t};\n"
- "\t" << writeSetting("objectVersion", "46", "", SettingsNoQuote) << ";\n"
+ "\t" << writeSetting("objectVersion", "46", "", kSettingsNoQuote) << ";\n"
"\tobjects = {\n";
//////////////////////////////////////////////////////////////////////////
@@ -297,7 +286,7 @@ void XcodeProvider::ouputMainProjectFile(const BuildSetup &setup) {
//////////////////////////////////////////////////////////////////////////
// Footer
project << "\t};\n"
- "\t" << writeSetting("rootObject", getHash("PBXProject"), "Project object", SettingsNoQuote) << ";\n"
+ "\t" << writeSetting("rootObject", getHash("PBXProject"), "Project object", kSettingsNoQuote) << ";\n"
"}\n";
}
@@ -333,7 +322,7 @@ void XcodeProvider::setupCopyFilesBuildPhase() {
#define DEF_SYSFRAMEWORK(framework) properties[framework".framework"] = FileProperty("wrapper.framework", framework".framework", "System/Library/Frameworks/" framework ".framework", "SDKROOT"); \
ADD_SETTING_ORDER_NOVALUE(children, getHash(framework".framework"), framework".framework", fwOrder++);
-
+
#define DEF_LOCALLIB_STATIC(lib) properties[lib".a"] = FileProperty("archive.ar", lib".a", "/opt/local/lib/" lib ".a", "\"<group>\""); \
ADD_SETTING_ORDER_NOVALUE(children, getHash(lib".a"), lib".a", fwOrder++);
@@ -343,14 +332,14 @@ void XcodeProvider::setupCopyFilesBuildPhase() {
* (each native target has different build rules)
*/
void XcodeProvider::setupFrameworksBuildPhase() {
- _frameworksBuildPhase.comment = "PBXFrameworksBuildPhase";
+ _frameworksBuildPhase._comment = "PBXFrameworksBuildPhase";
// Just use a hardcoded id for the Frameworks-group
Group *frameworksGroup = new Group(this, "Frameworks", "PBXGroup_CustomTemplate_Frameworks_", "");
Property children;
- children.hasOrder = true;
- children.flags = SettingsAsList;
+ children._hasOrder = true;
+ children._flags = kSettingsAsList;
// Setup framework file properties
std::map<std::string, FileProperty> properties;
@@ -380,7 +369,7 @@ void XcodeProvider::setupFrameworksBuildPhase() {
DEF_LOCALLIB_STATIC("libfreetype");
// DEF_LOCALLIB_STATIC("libmpeg2");
- frameworksGroup->properties["children"] = children;
+ frameworksGroup->_properties["children"] = children;
_groups.add(frameworksGroup);
// Force this to be added as a sub-group in the root.
_rootSourceGroup->addChildGroup(frameworksGroup);
@@ -393,13 +382,13 @@ void XcodeProvider::setupFrameworksBuildPhase() {
// iPhone
Object *framework_iPhone = new Object(this, "PBXFrameworksBuildPhase_" + _targets[IOS_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks");
- framework_iPhone->addProperty("buildActionMask", "2147483647", "", SettingsNoValue);
- framework_iPhone->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue);
+ framework_iPhone->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
+ framework_iPhone->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
// List of frameworks
Property iPhone_files;
- iPhone_files.hasOrder = true;
- iPhone_files.flags = SettingsAsList;
+ iPhone_files._hasOrder = true;
+ iPhone_files._flags = kSettingsAsList;
ValueList frameworks_iPhone;
frameworks_iPhone.push_back("CoreAudio.framework");
@@ -420,10 +409,10 @@ void XcodeProvider::setupFrameworksBuildPhase() {
ADD_SETTING_ORDER_NOVALUE(iPhone_files, getHash(id), comment, order++);
ADD_BUILD_FILE(id, *framework, getHash(*framework), comment);
- ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]);
+ addFileReference(*framework, *framework, properties[*framework]);
}
- framework_iPhone->properties["files"] = iPhone_files;
+ framework_iPhone->_properties["files"] = iPhone_files;
_frameworksBuildPhase.add(framework_iPhone);
#endif
@@ -431,13 +420,13 @@ void XcodeProvider::setupFrameworksBuildPhase() {
// ScummVM-OS X
Object *framework_OSX = new Object(this, "PBXFrameworksBuildPhase_" + _targets[OSX_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks");
- framework_OSX->addProperty("buildActionMask", "2147483647", "", SettingsNoValue);
- framework_OSX->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue);
+ framework_OSX->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
+ framework_OSX->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
// List of frameworks
Property osx_files;
- osx_files.hasOrder = true;
- osx_files.flags = SettingsAsList;
+ osx_files._hasOrder = true;
+ osx_files._flags = kSettingsAsList;
ValueList frameworks_osx;
frameworks_osx.push_back("CoreFoundation.framework");
@@ -462,10 +451,10 @@ void XcodeProvider::setupFrameworksBuildPhase() {
ADD_SETTING_ORDER_NOVALUE(osx_files, getHash(id), comment, order++);
ADD_BUILD_FILE(id, *framework, getHash(*framework), comment);
- ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]);
+ addFileReference(*framework, *framework, properties[*framework]);
}
- framework_OSX->properties["files"] = osx_files;
+ framework_OSX->_properties["files"] = osx_files;
_frameworksBuildPhase.add(framework_OSX);
#ifdef ENABLE_IOS
@@ -473,13 +462,13 @@ void XcodeProvider::setupFrameworksBuildPhase() {
// Simulator
Object *framework_simulator = new Object(this, "PBXFrameworksBuildPhase_" + _targets[SIM_TARGET], "PBXFrameworksBuildPhase", "PBXFrameworksBuildPhase", "", "Frameworks");
- framework_simulator->addProperty("buildActionMask", "2147483647", "", SettingsNoValue);
- framework_simulator->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue);
+ framework_simulator->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
+ framework_simulator->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
// List of frameworks
Property simulator_files;
- simulator_files.hasOrder = true;
- simulator_files.flags = SettingsAsList;
+ simulator_files._hasOrder = true;
+ simulator_files._flags = kSettingsAsList;
ValueList frameworks_simulator;
frameworks_simulator.push_back("CoreAudio.framework");
@@ -497,17 +486,17 @@ void XcodeProvider::setupFrameworksBuildPhase() {
ADD_SETTING_ORDER_NOVALUE(simulator_files, getHash(id), comment, order++);
ADD_BUILD_FILE(id, *framework, getHash(*framework), comment);
- ADD_FILE_REFERENCE(*framework, *framework, properties[*framework]);
+ addFileReference(*framework, *framework, properties[*framework]);
}
- framework_simulator->properties["files"] = simulator_files;
+ framework_simulator->_properties["files"] = simulator_files;
_frameworksBuildPhase.add(framework_simulator);
#endif
}
void XcodeProvider::setupNativeTarget() {
- _nativeTarget.comment = "PBXNativeTarget";
+ _nativeTarget._comment = "PBXNativeTarget";
// Just use a hardcoded id for the Products-group
Group *productsGroup = new Group(this, "Products", "PBXGroup_CustomTemplate_Products_" , "");
@@ -520,26 +509,26 @@ void XcodeProvider::setupNativeTarget() {
#endif
Object *target = new Object(this, "PBXNativeTarget_" + _targets[i], "PBXNativeTarget", "PBXNativeTarget", "", _targets[i]);
- target->addProperty("buildConfigurationList", getHash("XCConfigurationList_" + _targets[i]), "Build configuration list for PBXNativeTarget \"" + _targets[i] + "\"", SettingsNoValue);
+ target->addProperty("buildConfigurationList", getHash("XCConfigurationList_" + _targets[i]), "Build configuration list for PBXNativeTarget \"" + _targets[i] + "\"", kSettingsNoValue);
Property buildPhases;
- buildPhases.hasOrder = true;
- buildPhases.flags = SettingsAsList;
- buildPhases.settings[getHash("PBXResourcesBuildPhase_" + _targets[i])] = Setting("", "Resources", SettingsNoValue, 0, 0);
- buildPhases.settings[getHash("PBXSourcesBuildPhase_" + _targets[i])] = Setting("", "Sources", SettingsNoValue, 0, 1);
- buildPhases.settings[getHash("PBXFrameworksBuildPhase_" + _targets[i])] = Setting("", "Frameworks", SettingsNoValue, 0, 2);
- target->properties["buildPhases"] = buildPhases;
+ buildPhases._hasOrder = true;
+ buildPhases._flags = kSettingsAsList;
+ buildPhases._settings[getHash("PBXResourcesBuildPhase_" + _targets[i])] = Setting("", "Resources", kSettingsNoValue, 0, 0);
+ buildPhases._settings[getHash("PBXSourcesBuildPhase_" + _targets[i])] = Setting("", "Sources", kSettingsNoValue, 0, 1);
+ buildPhases._settings[getHash("PBXFrameworksBuildPhase_" + _targets[i])] = Setting("", "Frameworks", kSettingsNoValue, 0, 2);
+ target->_properties["buildPhases"] = buildPhases;
- target->addProperty("buildRules", "", "", SettingsNoValue|SettingsAsList);
+ target->addProperty("buildRules", "", "", kSettingsNoValue | kSettingsAsList);
- target->addProperty("dependencies", "", "", SettingsNoValue|SettingsAsList);
+ target->addProperty("dependencies", "", "", kSettingsNoValue | kSettingsAsList);
- target->addProperty("name", _targets[i], "", SettingsNoValue|SettingsQuoteVariable);
- target->addProperty("productName", PROJECT_NAME, "", SettingsNoValue);
+ target->addProperty("name", _targets[i], "", kSettingsNoValue | kSettingsQuoteVariable);
+ target->addProperty("productName", PROJECT_NAME, "", kSettingsNoValue);
addProductFileReference("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i], PROJECT_DESCRIPTION ".app");
productsGroup->addChildByHash(getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app");
- target->addProperty("productReference", getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app", SettingsNoValue);
- target->addProperty("productType", "com.apple.product-type.application", "", SettingsNoValue|SettingsQuoteVariable);
+ target->addProperty("productReference", getHash("PBXFileReference_" PROJECT_DESCRIPTION ".app_" + _targets[i]), PROJECT_DESCRIPTION ".app", kSettingsNoValue);
+ target->addProperty("productType", "com.apple.product-type.application", "", kSettingsNoValue | kSettingsQuoteVariable);
_nativeTarget.add(target);
}
@@ -548,49 +537,49 @@ void XcodeProvider::setupNativeTarget() {
}
void XcodeProvider::setupProject() {
- _project.comment = "PBXProject";
+ _project._comment = "PBXProject";
Object *project = new Object(this, "PBXProject", "PBXProject", "PBXProject", "", "Project object");
- project->addProperty("buildConfigurationList", getHash("XCConfigurationList_scummvm"), "Build configuration list for PBXProject \"" PROJECT_NAME "\"", SettingsNoValue);
- project->addProperty("compatibilityVersion", "Xcode 3.2", "", SettingsNoValue|SettingsQuoteVariable);
- project->addProperty("developmentRegion", "English", "", SettingsNoValue);
- project->addProperty("hasScannedForEncodings", "1", "", SettingsNoValue);
+ project->addProperty("buildConfigurationList", getHash("XCConfigurationList_scummvm"), "Build configuration list for PBXProject \"" PROJECT_NAME "\"", kSettingsNoValue);
+ project->addProperty("compatibilityVersion", "Xcode 3.2", "", kSettingsNoValue | kSettingsQuoteVariable);
+ project->addProperty("developmentRegion", "English", "", kSettingsNoValue);
+ project->addProperty("hasScannedForEncodings", "1", "", kSettingsNoValue);
// List of known regions
Property regions;
- regions.flags = SettingsAsList;
+ regions._flags = kSettingsAsList;
ADD_SETTING_ORDER_NOVALUE(regions, "English", "", 0);
ADD_SETTING_ORDER_NOVALUE(regions, "Japanese", "", 1);
ADD_SETTING_ORDER_NOVALUE(regions, "French", "", 2);
ADD_SETTING_ORDER_NOVALUE(regions, "German", "", 3);
- project->properties["knownRegions"] = regions;
+ project->_properties["knownRegions"] = regions;
- project->addProperty("mainGroup", _rootSourceGroup->getHashRef(), "CustomTemplate", SettingsNoValue);
- project->addProperty("projectDirPath", _projectRoot, "", SettingsNoValue|SettingsQuoteVariable);
- project->addProperty("projectRoot", "", "", SettingsNoValue|SettingsQuoteVariable);
+ project->addProperty("mainGroup", _rootSourceGroup->getHashRef(), "CustomTemplate", kSettingsNoValue);
+ project->addProperty("projectDirPath", _projectRoot, "", kSettingsNoValue | kSettingsQuoteVariable);
+ project->addProperty("projectRoot", "", "", kSettingsNoValue | kSettingsQuoteVariable);
// List of targets
Property targets;
- targets.flags = SettingsAsList;
+ targets._flags = kSettingsAsList;
#ifdef ENABLE_IOS
- targets.settings[getHash("PBXNativeTarget_" + _targets[IOS_TARGET])] = Setting("", _targets[IOS_TARGET], SettingsNoValue, 0, 0);
+ targets._settings[getHash("PBXNativeTarget_" + _targets[IOS_TARGET])] = Setting("", _targets[IOS_TARGET], kSettingsNoValue, 0, 0);
#endif
- targets.settings[getHash("PBXNativeTarget_" + _targets[OSX_TARGET])] = Setting("", _targets[OSX_TARGET], SettingsNoValue, 0, 1);
+ targets._settings[getHash("PBXNativeTarget_" + _targets[OSX_TARGET])] = Setting("", _targets[OSX_TARGET], kSettingsNoValue, 0, 1);
#ifdef ENABLE_IOS
- targets.settings[getHash("PBXNativeTarget_" + _targets[SIM_TARGET])] = Setting("", _targets[SIM_TARGET], SettingsNoValue, 0, 2);
+ targets._settings[getHash("PBXNativeTarget_" + _targets[SIM_TARGET])] = Setting("", _targets[SIM_TARGET], kSettingsNoValue, 0, 2);
#endif
- project->properties["targets"] = targets;
+ project->_properties["targets"] = targets;
#ifndef ENABLE_IOS
// Force list even when there is only a single target
- project->properties["targets"].flags |= SettingsSingleItem;
+ project->_properties["targets"]._flags |= kSettingsSingleItem;
#endif
_project.add(project);
}
void XcodeProvider::setupResourcesBuildPhase() {
- _resourcesBuildPhase.comment = "PBXResourcesBuildPhase";
+ _resourcesBuildPhase._comment = "PBXResourcesBuildPhase";
// Setup resource file properties
std::map<std::string, FileProperty> properties;
@@ -615,12 +604,12 @@ void XcodeProvider::setupResourcesBuildPhase() {
for (unsigned int i = 0; i < _targets.size(); i++) {
Object *resource = new Object(this, "PBXResourcesBuildPhase_" + _targets[i], "PBXResourcesBuildPhase", "PBXResourcesBuildPhase", "", "Resources");
- resource->addProperty("buildActionMask", "2147483647", "", SettingsNoValue);
+ resource->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
// Add default files
Property files;
- files.hasOrder = true;
- files.flags = SettingsAsList;
+ files._hasOrder = true;
+ files._flags = kSettingsAsList;
ValueList files_list;
files_list.push_back("scummclassic.zip");
@@ -646,28 +635,28 @@ void XcodeProvider::setupResourcesBuildPhase() {
ADD_SETTING_ORDER_NOVALUE(files, getHash(id), comment, order++);
// TODO Fix crash when adding build file for data
//ADD_BUILD_FILE(id, *file, comment);
- ADD_FILE_REFERENCE(*file, *file, properties[*file]);
+ addFileReference(*file, *file, properties[*file]);
}
// Add custom files depending on the target
if (_targets[i] == PROJECT_DESCRIPTION "-OS X") {
- files.settings[getHash("PBXResources_" PROJECT_NAME ".icns")] = Setting("", PROJECT_NAME ".icns in Resources", SettingsNoValue, 0, 6);
+ files._settings[getHash("PBXResources_" PROJECT_NAME ".icns")] = Setting("", PROJECT_NAME ".icns in Resources", kSettingsNoValue, 0, 6);
// Remove 2 iphone icon files
- files.settings.erase(getHash("PBXResources_Default.png"));
- files.settings.erase(getHash("PBXResources_icon.png"));
+ files._settings.erase(getHash("PBXResources_Default.png"));
+ files._settings.erase(getHash("PBXResources_icon.png"));
}
- resource->properties["files"] = files;
+ resource->_properties["files"] = files;
- resource->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue);
+ resource->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
_resourcesBuildPhase.add(resource);
}
}
void XcodeProvider::setupSourcesBuildPhase() {
- _sourcesBuildPhase.comment = "PBXSourcesBuildPhase";
+ _sourcesBuildPhase._comment = "PBXSourcesBuildPhase";
// Setup source file properties
std::map<std::string, FileProperty> properties;
@@ -676,24 +665,24 @@ void XcodeProvider::setupSourcesBuildPhase() {
for (unsigned int i = 0; i < _targets.size(); i++) {
Object *source = new Object(this, "PBXSourcesBuildPhase_" + _targets[i], "PBXSourcesBuildPhase", "PBXSourcesBuildPhase", "", "Sources");
- source->addProperty("buildActionMask", "2147483647", "", SettingsNoValue);
+ source->addProperty("buildActionMask", "2147483647", "", kSettingsNoValue);
Property files;
- files.hasOrder = true;
- files.flags = SettingsAsList;
+ files._hasOrder = true;
+ files._flags = kSettingsAsList;
int order = 0;
- for (std::vector<Object*>::iterator file = _buildFile.objects.begin(); file !=_buildFile.objects.end(); ++file) {
- if (!producesObjectFileOnOSX((*file)->name)) {
+ for (std::vector<Object *>::iterator file = _buildFile._objects.begin(); file != _buildFile._objects.end(); ++file) {
+ if (!producesObjectFileOnOSX((*file)->_name)) {
continue;
}
- std::string comment = (*file)->name + " in Sources";
- ADD_SETTING_ORDER_NOVALUE(files, getHash((*file)->id), comment, order++);
+ std::string comment = (*file)->_name + " in Sources";
+ ADD_SETTING_ORDER_NOVALUE(files, getHash((*file)->_id), comment, order++);
}
- source->properties["files"] = files;
+ source->_properties["files"] = files;
- source->addProperty("runOnlyForDeploymentPostprocessing", "0", "", SettingsNoValue);
+ source->addProperty("runOnlyForDeploymentPostprocessing", "0", "", kSettingsNoValue);
_sourcesBuildPhase.add(source);
}
@@ -702,8 +691,8 @@ void XcodeProvider::setupSourcesBuildPhase() {
// Setup all build configurations
void XcodeProvider::setupBuildConfiguration() {
- _buildConfiguration.comment = "XCBuildConfiguration";
- _buildConfiguration.flags = SettingsAsList;
+ _buildConfiguration._comment = "XCBuildConfiguration";
+ _buildConfiguration._flags = kSettingsAsList;
///****************************************
// * iPhone
@@ -721,7 +710,7 @@ void XcodeProvider::setupBuildConfiguration() {
ValueList iPhone_FrameworkSearchPaths;
iPhone_FrameworkSearchPaths.push_back("$(inherited)");
iPhone_FrameworkSearchPaths.push_back("\"$(SDKROOT)$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"");
- ADD_SETTING_LIST(iPhone_Debug, "FRAMEWORK_SEARCH_PATHS", iPhone_FrameworkSearchPaths, SettingsAsList, 5);
+ ADD_SETTING_LIST(iPhone_Debug, "FRAMEWORK_SEARCH_PATHS", iPhone_FrameworkSearchPaths, kSettingsAsList, 5);
ADD_SETTING(iPhone_Debug, "GCC_DYNAMIC_NO_PIC", "NO");
ADD_SETTING(iPhone_Debug, "GCC_ENABLE_CPP_EXCEPTIONS", "NO");
ADD_SETTING(iPhone_Debug, "GCC_ENABLE_FIX_AND_CONTINUE", "NO");
@@ -734,12 +723,12 @@ void XcodeProvider::setupBuildConfiguration() {
iPhone_HeaderSearchPaths.push_back("$(SRCROOT)/engines/");
iPhone_HeaderSearchPaths.push_back("$(SRCROOT)");
iPhone_HeaderSearchPaths.push_back("include/");
- ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, SettingsAsList|SettingsQuoteVariable, 5);
+ ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, kSettingsAsList | kSettingsQuoteVariable, 5);
ADD_SETTING(iPhone_Debug, "INFOPLIST_FILE", "Info.plist");
ValueList iPhone_LibPaths;
iPhone_LibPaths.push_back("$(inherited)");
iPhone_LibPaths.push_back("\"$(SRCROOT)/lib\"");
- ADD_SETTING_LIST(iPhone_Debug, "LIBRARY_SEARCH_PATHS", iPhone_LibPaths, SettingsAsList, 5);
+ ADD_SETTING_LIST(iPhone_Debug, "LIBRARY_SEARCH_PATHS", iPhone_LibPaths, kSettingsAsList, 5);
ADD_SETTING(iPhone_Debug, "ONLY_ACTIVE_ARCH", "YES");
ADD_SETTING(iPhone_Debug, "PREBINDING", "NO");
ADD_SETTING(iPhone_Debug, "PRODUCT_NAME", PROJECT_DESCRIPTION);
@@ -748,8 +737,8 @@ void XcodeProvider::setupBuildConfiguration() {
ADD_SETTING(iPhone_Debug, "SDKROOT", "iphoneos4.0");
ADD_SETTING_QUOTE(iPhone_Debug, "TARGETED_DEVICE_FAMILY", "1,2");
- iPhone_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue);
- iPhone_Debug_Object->properties["buildSettings"] = iPhone_Debug;
+ iPhone_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
+ iPhone_Debug_Object->_properties["buildSettings"] = iPhone_Debug;
// Release
Object *iPhone_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-iPhone_Release", _targets[IOS_TARGET] /* ScummVM-iPhone */, "XCBuildConfiguration", "PBXNativeTarget", "Release");
@@ -759,8 +748,8 @@ void XcodeProvider::setupBuildConfiguration() {
REMOVE_SETTING(iPhone_Release, "GCC_DYNAMIC_NO_PIC");
ADD_SETTING(iPhone_Release, "WRAPPER_EXTENSION", "app");
- iPhone_Release_Object->addProperty("name", "Release", "", SettingsNoValue);
- iPhone_Release_Object->properties["buildSettings"] = iPhone_Release;
+ iPhone_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
+ iPhone_Release_Object->_properties["buildSettings"] = iPhone_Release;
_buildConfiguration.add(iPhone_Debug_Object);
_buildConfiguration.add(iPhone_Release_Object);
@@ -787,7 +776,7 @@ void XcodeProvider::setupBuildConfiguration() {
ADD_DEFINE(scummvm_defines, "IPHONE");
ADD_DEFINE(scummvm_defines, "XCODE");
ADD_DEFINE(scummvm_defines, "IPHONE_OFFICIAL");
- ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote|SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvm_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, kSettingsNoQuote | kSettingsAsList, 5);
ADD_SETTING(scummvm_Debug, "GCC_THUMB_SUPPORT", "NO");
ADD_SETTING(scummvm_Debug, "GCC_USE_GCC3_PFE_SUPPORT", "NO");
ADD_SETTING(scummvm_Debug, "GCC_WARN_ABOUT_RETURN_TYPE", "YES");
@@ -796,7 +785,7 @@ void XcodeProvider::setupBuildConfiguration() {
scummvm_HeaderPaths.push_back("include/");
scummvm_HeaderPaths.push_back("$(SRCROOT)/engines/");
scummvm_HeaderPaths.push_back("$(SRCROOT)");
- ADD_SETTING_LIST(scummvm_Debug, "HEADER_SEARCH_PATHS", scummvm_HeaderPaths, SettingsQuoteVariable|SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvm_Debug, "HEADER_SEARCH_PATHS", scummvm_HeaderPaths, kSettingsQuoteVariable | kSettingsAsList, 5);
ADD_SETTING_QUOTE(scummvm_Debug, "LIBRARY_SEARCH_PATHS", "");
ADD_SETTING(scummvm_Debug, "ONLY_ACTIVE_ARCH", "YES");
ADD_SETTING_QUOTE(scummvm_Debug, "OTHER_CFLAGS", "");
@@ -804,8 +793,8 @@ void XcodeProvider::setupBuildConfiguration() {
ADD_SETTING(scummvm_Debug, "PREBINDING", "NO");
ADD_SETTING(scummvm_Debug, "SDKROOT", "macosx");
- scummvm_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue);
- scummvm_Debug_Object->properties["buildSettings"] = scummvm_Debug;
+ scummvm_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
+ scummvm_Debug_Object->_properties["buildSettings"] = scummvm_Debug;
// Release
Object *scummvm_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_NAME "_Release", PROJECT_NAME, "XCBuildConfiguration", "PBXProject", "Release");
@@ -815,8 +804,8 @@ void XcodeProvider::setupBuildConfiguration() {
REMOVE_SETTING(scummvm_Release, "GCC_WARN_UNUSED_VARIABLE");
REMOVE_SETTING(scummvm_Release, "ONLY_ACTIVE_ARCH");
- scummvm_Release_Object->addProperty("name", "Release", "", SettingsNoValue);
- scummvm_Release_Object->properties["buildSettings"] = scummvm_Release;
+ scummvm_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
+ scummvm_Release_Object->_properties["buildSettings"] = scummvm_Release;
_buildConfiguration.add(scummvm_Debug_Object);
_buildConfiguration.add(scummvm_Release_Object);
@@ -844,7 +833,7 @@ void XcodeProvider::setupBuildConfiguration() {
ValueList scummvmOSX_defines(_defines);
ADD_DEFINE(scummvmOSX_defines, "SDL_BACKEND");
ADD_DEFINE(scummvmOSX_defines, "MACOSX");
- ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, SettingsNoQuote|SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvmOSX_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvmOSX_defines, kSettingsNoQuote | kSettingsAsList, 5);
ADD_SETTING_QUOTE(scummvmOSX_Debug, "GCC_VERSION", "");
ValueList scummvmOSX_HeaderPaths;
scummvmOSX_HeaderPaths.push_back("/opt/local/include/SDL");
@@ -853,14 +842,14 @@ void XcodeProvider::setupBuildConfiguration() {
scummvmOSX_HeaderPaths.push_back("include/");
scummvmOSX_HeaderPaths.push_back("$(SRCROOT)/engines/");
scummvmOSX_HeaderPaths.push_back("$(SRCROOT)");
- ADD_SETTING_LIST(scummvmOSX_Debug, "HEADER_SEARCH_PATHS", scummvmOSX_HeaderPaths, SettingsQuoteVariable|SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvmOSX_Debug, "HEADER_SEARCH_PATHS", scummvmOSX_HeaderPaths, kSettingsQuoteVariable | kSettingsAsList, 5);
ADD_SETTING_QUOTE(scummvmOSX_Debug, "INFOPLIST_FILE", "$(SRCROOT)/dists/macosx/Info.plist");
ValueList scummvmOSX_LibPaths;
scummvmOSX_LibPaths.push_back("/sw/lib");
scummvmOSX_LibPaths.push_back("/opt/local/lib");
scummvmOSX_LibPaths.push_back("\"$(inherited)\"");
scummvmOSX_LibPaths.push_back("\"\\\\\\\"$(SRCROOT)/lib\\\\\\\"\""); // mmmh, all those slashes, it's almost Christmas \o/
- ADD_SETTING_LIST(scummvmOSX_Debug, "LIBRARY_SEARCH_PATHS", scummvmOSX_LibPaths, SettingsNoQuote|SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvmOSX_Debug, "LIBRARY_SEARCH_PATHS", scummvmOSX_LibPaths, kSettingsNoQuote | kSettingsAsList, 5);
ADD_SETTING_QUOTE(scummvmOSX_Debug, "OTHER_CFLAGS", "");
ValueList scummvmOSX_LdFlags;
scummvmOSX_LdFlags.push_back("-lSDLmain");
@@ -875,12 +864,12 @@ void XcodeProvider::setupBuildConfiguration() {
scummvmOSX_LdFlags.push_back("-lFLAC");
scummvmOSX_LdFlags.push_back("-lSDL");
scummvmOSX_LdFlags.push_back("-lz");
- ADD_SETTING_LIST(scummvmOSX_Debug, "OTHER_LDFLAGS", scummvmOSX_LdFlags, SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvmOSX_Debug, "OTHER_LDFLAGS", scummvmOSX_LdFlags, kSettingsAsList, 5);
ADD_SETTING(scummvmOSX_Debug, "PREBINDING", "NO");
ADD_SETTING(scummvmOSX_Debug, "PRODUCT_NAME", PROJECT_DESCRIPTION);
- scummvmOSX_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue);
- scummvmOSX_Debug_Object->properties["buildSettings"] = scummvmOSX_Debug;
+ scummvmOSX_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
+ scummvmOSX_Debug_Object->_properties["buildSettings"] = scummvmOSX_Debug;
// Release
Object *scummvmOSX_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-OSX_Release", _targets[OSX_TARGET] /* ScummVM-OS X */, "XCBuildConfiguration", "PBXNativeTarget", "Release");
@@ -890,8 +879,8 @@ void XcodeProvider::setupBuildConfiguration() {
REMOVE_SETTING(scummvmOSX_Release, "GCC_OPTIMIZATION_LEVEL");
ADD_SETTING(scummvmOSX_Release, "WRAPPER_EXTENSION", "app");
- scummvmOSX_Release_Object->addProperty("name", "Release", "", SettingsNoValue);
- scummvmOSX_Release_Object->properties["buildSettings"] = scummvmOSX_Release;
+ scummvmOSX_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
+ scummvmOSX_Release_Object->_properties["buildSettings"] = scummvmOSX_Release;
_buildConfiguration.add(scummvmOSX_Debug_Object);
_buildConfiguration.add(scummvmOSX_Release_Object);
@@ -904,13 +893,13 @@ void XcodeProvider::setupBuildConfiguration() {
Object *scummvmSimulator_Debug_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-Simulator_Debug", _targets[SIM_TARGET] /* ScummVM-Simulator */, "XCBuildConfiguration", "PBXNativeTarget", "Debug");
Property scummvmSimulator_Debug(iPhone_Debug);
ADD_SETTING_QUOTE(scummvmSimulator_Debug, "FRAMEWORK_SEARCH_PATHS", "$(inherited)");
- ADD_SETTING_LIST(scummvmSimulator_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, SettingsNoQuote|SettingsAsList, 5);
+ ADD_SETTING_LIST(scummvmSimulator_Debug, "GCC_PREPROCESSOR_DEFINITIONS", scummvm_defines, kSettingsNoQuote | kSettingsAsList, 5);
ADD_SETTING(scummvmSimulator_Debug, "SDKROOT", "iphonesimulator3.2");
ADD_SETTING_QUOTE(scummvmSimulator_Debug, "VALID_ARCHS", "i386 x86_64");
REMOVE_SETTING(scummvmSimulator_Debug, "TARGETED_DEVICE_FAMILY");
- scummvmSimulator_Debug_Object->addProperty("name", "Debug", "", SettingsNoValue);
- scummvmSimulator_Debug_Object->properties["buildSettings"] = scummvmSimulator_Debug;
+ scummvmSimulator_Debug_Object->addProperty("name", "Debug", "", kSettingsNoValue);
+ scummvmSimulator_Debug_Object->_properties["buildSettings"] = scummvmSimulator_Debug;
// Release
Object *scummvmSimulator_Release_Object = new Object(this, "XCBuildConfiguration_" PROJECT_DESCRIPTION "-Simulator_Release", _targets[SIM_TARGET] /* ScummVM-Simulator */, "XCBuildConfiguration", "PBXNativeTarget", "Release");
@@ -920,32 +909,32 @@ void XcodeProvider::setupBuildConfiguration() {
REMOVE_SETTING(scummvmSimulator_Release, "GCC_DYNAMIC_NO_PIC");
ADD_SETTING(scummvmSimulator_Release, "WRAPPER_EXTENSION", "app");
- scummvmSimulator_Release_Object->addProperty("name", "Release", "", SettingsNoValue);
- scummvmSimulator_Release_Object->properties["buildSettings"] = scummvmSimulator_Release;
+ scummvmSimulator_Release_Object->addProperty("name", "Release", "", kSettingsNoValue);
+ scummvmSimulator_Release_Object->_properties["buildSettings"] = scummvmSimulator_Release;
_buildConfiguration.add(scummvmSimulator_Debug_Object);
_buildConfiguration.add(scummvmSimulator_Release_Object);
//////////////////////////////////////////////////////////////////////////
// Configuration List
- _configurationList.comment = "XCConfigurationList";
- _configurationList.flags = SettingsAsList;
+ _configurationList._comment = "XCConfigurationList";
+ _configurationList._flags = kSettingsAsList;
#endif
// Warning: This assumes we have all configurations with a Debug & Release pair
- for (std::vector<Object *>::iterator config = _buildConfiguration.objects.begin(); config != _buildConfiguration.objects.end(); config++) {
+ for (std::vector<Object *>::iterator config = _buildConfiguration._objects.begin(); config != _buildConfiguration._objects.end(); config++) {
- Object *configList = new Object(this, "XCConfigurationList_" + (*config)->name, (*config)->name, "XCConfigurationList", "", "Build configuration list for " + (*config)->refType + " \"" + (*config)->name + "\"");
+ Object *configList = new Object(this, "XCConfigurationList_" + (*config)->_name, (*config)->_name, "XCConfigurationList", "", "Build configuration list for " + (*config)->_refType + " \"" + (*config)->_name + "\"");
Property buildConfigs;
- buildConfigs.flags = SettingsAsList;
+ buildConfigs._flags = kSettingsAsList;
- buildConfigs.settings[getHash((*config)->id)] = Setting("", "Debug", SettingsNoValue, 0, 0);
- buildConfigs.settings[getHash((*(++config))->id)] = Setting("", "Release", SettingsNoValue, 0, 1);
+ buildConfigs._settings[getHash((*config)->_id)] = Setting("", "Debug", kSettingsNoValue, 0, 0);
+ buildConfigs._settings[getHash((*(++config))->_id)] = Setting("", "Release", kSettingsNoValue, 0, 1);
- configList->properties["buildConfigurations"] = buildConfigs;
+ configList->_properties["buildConfigurations"] = buildConfigs;
- configList->addProperty("defaultConfigurationIsVisible", "0", "", SettingsNoValue);
- configList->addProperty("defaultConfigurationName", "Release", "", SettingsNoValue);
+ configList->addProperty("defaultConfigurationIsVisible", "0", "", kSettingsNoValue);
+ configList->addProperty("defaultConfigurationName", "Release", "", kSettingsNoValue);
_configurationList.add(configList);
}
@@ -959,7 +948,7 @@ void XcodeProvider::setupBuildConfiguration() {
void XcodeProvider::setupDefines(const BuildSetup &setup) {
for (StringList::const_iterator i = setup.defines.begin(); i != setup.defines.end(); ++i) {
- if (*i == "HAVE_NASM") // Not supported on Mac (TODO: change how it's handled in main class or add it only in MSVC/CodeBlocks providers?)
+ if (*i == "HAVE_NASM") // Not supported on Mac (TODO: change how it's handled in main class or add it only in MSVC/CodeBlocks providers?)
continue;
ADD_DEFINE(_defines, *i);
@@ -995,7 +984,7 @@ std::string XcodeProvider::getHash(std::string key) {
#endif
}
-bool isSeparator (char s) { return (s == '-'); }
+bool isSeparator(char s) { return (s == '-'); }
std::string XcodeProvider::newHash() const {
std::string hash = createUUID();
@@ -1018,10 +1007,10 @@ std::string replace(std::string input, const std::string find, std::string repla
std::string::size_type findLen = find.length();
std::string::size_type replaceLen = replaceStr.length();
- if (findLen == 0 )
+ if (findLen == 0)
return input;
- for (;(pos = input.find(find, pos)) != std::string::npos;) {
+ for (; (pos = input.find(find, pos)) != std::string::npos;) {
input.replace(pos, findLen, replaceStr);
pos += replaceLen;
}
@@ -1032,30 +1021,30 @@ std::string replace(std::string input, const std::string find, std::string repla
std::string XcodeProvider::writeProperty(const std::string &variable, Property &prop, int flags) const {
std::string output;
- output += (flags & SettingsSingleItem ? "" : "\t\t\t") + variable + " = ";
+ output += (flags & kSettingsSingleItem ? "" : "\t\t\t") + variable + " = ";
- if (prop.settings.size() > 1 || (prop.flags & SettingsSingleItem))
- output += (prop.flags & SettingsAsList) ? "(\n" : "{\n";
+ if (prop._settings.size() > 1 || (prop._flags & kSettingsSingleItem))
+ output += (prop._flags & kSettingsAsList) ? "(\n" : "{\n";
OrderedSettingList settings = prop.getOrderedSettingList();
for (OrderedSettingList::const_iterator setting = settings.begin(); setting != settings.end(); ++setting) {
- if (settings.size() > 1 || (prop.flags & SettingsSingleItem))
- output += (flags & SettingsSingleItem ? " " : "\t\t\t\t");
+ if (settings.size() > 1 || (prop._flags & kSettingsSingleItem))
+ output += (flags & kSettingsSingleItem ? " " : "\t\t\t\t");
- output += writeSetting((*setting).first, (*setting).second);
+ output += writeSetting(setting->first, setting->second);
- // The combination of SettingsAsList, and SettingsSingleItem should use "," and not ";" (i.e children
+ // The combination of kSettingsAsList, and kSettingsSingleItem should use "," and not ";" (i.e children
// in PBXGroup, so we special case that case here.
- if ((prop.flags & SettingsAsList) && (prop.settings.size() > 1 || (prop.flags & SettingsSingleItem))) {
- output += (prop.settings.size() > 0) ? ",\n" : "\n";
+ if ((prop._flags & kSettingsAsList) && (prop._settings.size() > 1 || (prop._flags & kSettingsSingleItem))) {
+ output += (prop._settings.size() > 0) ? ",\n" : "\n";
} else {
output += ";";
- output += (flags & SettingsSingleItem ? " " : "\n");
+ output += (flags & kSettingsSingleItem ? " " : "\n");
}
}
- if (prop.settings.size() > 1 || (prop.flags & SettingsSingleItem))
- output += (prop.flags & SettingsAsList) ? "\t\t\t);\n" : "\t\t\t};\n";
+ if (prop._settings.size() > 1 || (prop._flags & kSettingsSingleItem))
+ output += (prop._flags & kSettingsAsList) ? "\t\t\t);\n" : "\t\t\t};\n";
return output;
}
@@ -1068,32 +1057,32 @@ std::string XcodeProvider::writeSetting(const std::string &variable, std::string
// XCode project generator pbuilder_pbx.cpp, writeSettings() (under LGPL 2.1)
std::string XcodeProvider::writeSetting(const std::string &variable, const Setting &setting) const {
std::string output;
- const std::string quote = (setting.flags & SettingsNoQuote) ? "" : "\"";
+ const std::string quote = (setting._flags & kSettingsNoQuote) ? "" : "\"";
const std::string escape_quote = quote.empty() ? "" : "\\" + quote;
std::string newline = "\n";
// Get indent level
- for (int i = 0; i < setting.indent; ++i)
+ for (int i = 0; i < setting._indent; ++i)
newline += "\t";
// Setup variable
- std::string var = (setting.flags & SettingsQuoteVariable) ? "\"" + variable + "\"" : variable;
+ std::string var = (setting._flags & kSettingsQuoteVariable) ? "\"" + variable + "\"" : variable;
// Output a list
- if (setting.flags & SettingsAsList) {
+ if (setting._flags & kSettingsAsList) {
- output += var + ((setting.flags & SettingsNoValue) ? "(" : " = (") + newline;
+ output += var + ((setting._flags & kSettingsNoValue) ? "(" : " = (") + newline;
- for (unsigned int i = 0, count = 0; i < setting.entries.size(); ++i) {
+ for (unsigned int i = 0, count = 0; i < setting._entries.size(); ++i) {
- std::string value = setting.entries.at(i).value;
+ std::string value = setting._entries.at(i)._value;
if (!value.empty()) {
if (count++ > 0)
output += "," + newline;
output += quote + replace(value, quote, escape_quote) + quote;
- std::string comment = setting.entries.at(i).comment;
+ std::string comment = setting._entries.at(i)._comment;
if (!comment.empty())
output += " /* " + comment + " */";
}
@@ -1101,24 +1090,24 @@ std::string XcodeProvider::writeSetting(const std::string &variable, const Setti
}
// Add closing ")" on new line
newline.resize(newline.size() - 1);
- output += (setting.flags & SettingsNoValue) ? "\t\t\t)" : "," + newline + ")";
+ output += (setting._flags & kSettingsNoValue) ? "\t\t\t)" : "," + newline + ")";
} else {
output += var;
- output += (setting.flags & SettingsNoValue) ? "" : " = " + quote;
+ output += (setting._flags & kSettingsNoValue) ? "" : " = " + quote;
- for(unsigned int i = 0; i < setting.entries.size(); ++i) {
- std::string value = setting.entries.at(i).value;
- if(i)
+ for (unsigned int i = 0; i < setting._entries.size(); ++i) {
+ std::string value = setting._entries.at(i)._value;
+ if (i)
output += " ";
output += value;
- std::string comment = setting.entries.at(i).comment;
+ std::string comment = setting._entries.at(i)._comment;
if (!comment.empty())
output += " /* " + comment + " */";
}
- output += (setting.flags & SettingsNoValue) ? "" : quote;
+ output += (setting._flags & kSettingsNoValue) ? "" : quote;
}
return output;
}
diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h
index 2686d14986..d48f11cb19 100644
--- a/devtools/create_project/xcode.h
+++ b/devtools/create_project/xcode.h
@@ -47,24 +47,23 @@ protected:
const StringList &duplicate, const std::string &objPrefix, const std::string &filePrefix);
private:
enum {
- SettingsAsList = 0x01,
- SettingsSingleItem = 0x02,
- SettingsNoQuote = 0x04,
- SettingsQuoteVariable = 0x08,
- SettingsNoValue = 0x10
+ kSettingsAsList = 0x01,
+ kSettingsSingleItem = 0x02,
+ kSettingsNoQuote = 0x04,
+ kSettingsQuoteVariable = 0x08,
+ kSettingsNoValue = 0x10
};
// File properties
struct FileProperty {
- std::string fileEncoding;
- std::string lastKnownFileType;
- std::string fileName;
- std::string filePath;
- std::string sourceTree;
-
- FileProperty(std::string fileType = "", std::string name = "", std::string path = "", std::string source = "") :
- fileEncoding(""), lastKnownFileType(fileType), fileName(name), filePath(path), sourceTree(source)
- {
+ std::string _fileEncoding;
+ std::string _lastKnownFileType;
+ std::string _fileName;
+ std::string _filePath;
+ std::string _sourceTree;
+
+ FileProperty(std::string fileType = "", std::string name = "", std::string path = "", std::string source = "")
+ : _fileEncoding(""), _lastKnownFileType(fileType), _fileName(name), _filePath(path), _sourceTree(source) {
}
};
@@ -73,33 +72,33 @@ private:
typedef std::vector<std::string> ValueList;
struct Entry {
- std::string value;
- std::string comment;
+ std::string _value;
+ std::string _comment;
- Entry(std::string val, std::string cmt) : value(val), comment(cmt) {}
+ Entry(std::string val, std::string cmt) : _value(val), _comment(cmt) {}
};
typedef std::vector<Entry> EntryList;
struct Setting {
- EntryList entries;
- int flags;
- int indent;
- int order;
+ EntryList _entries;
+ int _flags;
+ int _indent;
+ int _order;
- explicit Setting(std::string value = "", std::string comment = "", int flgs = 0, int idt = 0, int ord = -1) : flags(flgs), indent(idt), order(ord) {
- entries.push_back(Entry(value, comment));
+ Setting(std::string value = "", std::string comment = "", int flgs = 0, int idt = 0, int ord = -1) : _flags(flgs), _indent(idt), _order(ord) {
+ _entries.push_back(Entry(value, comment));
}
- explicit Setting(ValueList values, int flgs = 0, int idt = 0, int ord = -1) : flags(flgs), indent(idt), order(ord) {
+ Setting(ValueList values, int flgs = 0, int idt = 0, int ord = -1) : _flags(flgs), _indent(idt), _order(ord) {
for (unsigned int i = 0; i < values.size(); i++)
- entries.push_back(Entry(values[i], ""));
+ _entries.push_back(Entry(values[i], ""));
}
- explicit Setting(EntryList ents, int flgs = 0, int idt = 0, int ord = -1) : entries(ents), flags(flgs), indent(idt), order(ord) {}
+ Setting(EntryList ents, int flgs = 0, int idt = 0, int ord = -1) : _entries(ents), _flags(flgs), _indent(idt), _order(ord) {}
void addEntry(std::string value, std::string comment = "") {
- entries.push_back(Entry(value, comment));
+ _entries.push_back(Entry(value, comment));
}
};
@@ -107,46 +106,36 @@ private:
typedef std::pair<std::string, Setting> SettingPair;
typedef std::vector<SettingPair> OrderedSettingList;
- static bool OrderSortPredicate(const SettingPair& s1, const SettingPair& s2) {
- return s1.second.order < s2.second.order;
+ static bool OrderSortPredicate(const SettingPair &s1, const SettingPair &s2) {
+ return s1.second._order < s2.second._order;
}
struct Property {
public:
- SettingList settings;
- int flags;
- bool hasOrder;
+ SettingList _settings;
+ int _flags;
+ bool _hasOrder;
- Property() : flags(0), hasOrder(false) {}
+ Property() : _flags(0), _hasOrder(false) {}
// Constructs a simple Property
- explicit Property(std::string name, std::string value = "", std::string comment = "", int flgs = 0, int indent = 0, bool order = false) : flags(flgs), hasOrder(order) {
- Setting setting(value, comment, flags, indent);
-
- settings[name] = setting;
+ Property(std::string name, std::string value = "", std::string comment = "", int flgs = 0, int indent = 0, bool order = false) : _flags(flgs), _hasOrder(order) {
+ _settings[name] = Setting(value, comment, _flags, indent);
}
- Property(std::string name, ValueList values, int flgs = 0, int indent = 0, bool order = false) : flags(flgs), hasOrder(order) {
- Setting setting(values, flags, indent);
-
- settings[name] = setting;
- }
-
- // Copy constructor
- Property(const Property &rhs) {
- settings = rhs.settings;
- flags = rhs.flags;
+ Property(std::string name, ValueList values, int flgs = 0, int indent = 0, bool order = false) : _flags(flgs), _hasOrder(order) {
+ _settings[name] = Setting(values, _flags, indent);
}
OrderedSettingList getOrderedSettingList() {
OrderedSettingList list;
// Prepare vector to sort
- for (SettingList::const_iterator setting = settings.begin(); setting != settings.end(); ++setting)
+ for (SettingList::const_iterator setting = _settings.begin(); setting != _settings.end(); ++setting)
list.push_back(SettingPair(setting->first, setting->second));
// Sort vector using setting order
- if (hasOrder)
+ if (_hasOrder)
std::sort(list.begin(), list.end(), OrderSortPredicate);
return list;
@@ -160,48 +149,48 @@ private:
// be overkill since we only have to generate a single project
struct Object {
public:
- std::string id; // Unique identifier for this object
- std::string name; // Name (may not be unique - for ex. configuration entries)
- std::string refType; // Type of object this references (if any)
- std::string comment; // Main comment (empty for no comment)
+ std::string _id; // Unique identifier for this object
+ std::string _name; // Name (may not be unique - for ex. configuration entries)
+ std::string _refType; // Type of object this references (if any)
+ std::string _comment; // Main comment (empty for no comment)
- PropertyList properties; // List of object properties, including output configuration
+ PropertyList _properties; // List of object properties, including output configuration
// Constructs an object and add a default type property
Object(XcodeProvider *objectParent, std::string objectId, std::string objectName, std::string objectType, std::string objectRefType = "", std::string objectComment = "")
- : id(objectId), name(objectName), refType(objectRefType), comment(objectComment), parent(objectParent) {
+ : _id(objectId), _name(objectName), _refType(objectRefType), _comment(objectComment), _parent(objectParent) {
assert(objectParent);
assert(!objectId.empty());
assert(!objectName.empty());
assert(!objectType.empty());
- addProperty("isa", objectType, "", SettingsNoQuote|SettingsNoValue);
+ addProperty("isa", objectType, "", kSettingsNoQuote | kSettingsNoValue);
}
// Add a simple Property with just a name and a value
void addProperty(std::string propName, std::string propValue, std::string propComment = "", int propFlags = 0, int propIndent = 0) {
- properties[propName] = Property(propValue, "", propComment, propFlags, propIndent);
+ _properties[propName] = Property(propValue, "", propComment, propFlags, propIndent);
}
std::string toString(int flags = 0) {
std::string output;
- output = "\t\t" + parent->getHash(id) + (comment.empty() ? "" : " /* " + comment + " */") + " = {";
+ output = "\t\t" + _parent->getHash(_id) + (_comment.empty() ? "" : " /* " + _comment + " */") + " = {";
- if (flags & SettingsAsList)
+ if (flags & kSettingsAsList)
output += "\n";
// Special case: always output the isa property first
- output += parent->writeProperty("isa", properties["isa"], flags);
+ output += _parent->writeProperty("isa", _properties["isa"], flags);
// Write each property
- for (PropertyList::iterator property = properties.begin(); property != properties.end(); ++property) {
- if ((*property).first == "isa")
+ for (PropertyList::iterator property = _properties.begin(); property != _properties.end(); ++property) {
+ if (property->first == "isa")
continue;
- output += parent->writeProperty((*property).first, (*property).second, flags);
+ output += _parent->writeProperty(property->first, property->second, flags);
}
- if (flags & SettingsAsList)
+ if (flags & kSettingsAsList)
output += "\t\t";
output += "};\n";
@@ -209,50 +198,49 @@ private:
return output;
}
- // Slight hack, to allow Group access to parent.
+ // Slight hack, to allow Group access to parent.
protected:
- XcodeProvider *parent;
+ XcodeProvider *_parent;
private:
// Returns the type property (should always be the first in the properties map)
std::string getType() {
- assert(!properties.empty());
- assert(!properties["isa"].settings.empty());
-
- SettingList::iterator it = properties["isa"].settings.begin();
+ assert(!_properties.empty());
+ assert(!_properties["isa"]._settings.empty());
- return (*it).first;
+ SettingList::iterator it = _properties["isa"]._settings.begin();
+ return it->first;
}
};
struct ObjectList {
private:
- std::map<std::string, bool> objectMap;
+ std::map<std::string, bool> _objectMap;
public:
- std::vector<Object *> objects;
- std::string comment;
- int flags;
+ std::vector<Object *> _objects;
+ std::string _comment;
+ int _flags;
void add(Object *obj) {
- std::map<std::string, bool>::iterator it = objectMap.find(obj->id);
- if (it != objectMap.end() && it->second == true)
+ std::map<std::string, bool>::iterator it = _objectMap.find(obj->_id);
+ if (it != _objectMap.end() && it->second == true)
return;
- objects.push_back(obj);
- objectMap[obj->id] = true;
+ _objects.push_back(obj);
+ _objectMap[obj->_id] = true;
}
std::string toString() {
std::string output;
- if (!comment.empty())
- output = "\n/* Begin " + comment + " section */\n";
+ if (!_comment.empty())
+ output = "\n/* Begin " + _comment + " section */\n";
- for (std::vector<Object *>::iterator object = objects.begin(); object != objects.end(); ++object)
- output += (*object)->toString(flags);
+ for (std::vector<Object *>::iterator object = _objects.begin(); object != _objects.end(); ++object)
+ output += (*object)->toString(_flags);
- if (!comment.empty())
- output += "/* End " + comment + " section */\n";
+ if (!_comment.empty())
+ output += "/* End " + _comment + " section */\n";
return output;
}
@@ -271,10 +259,10 @@ private:
void addChildFile(const std::string &name);
void addChildByHash(const std::string &hash, const std::string &name);
// Should be passed the hash for the entry
- void addChildGroup(const Group* group);
+ void addChildGroup(const Group *group);
void ensureChildExists(const std::string &name);
Group *getChildGroup(const std::string &name);
- std::string getHashRef() const { return parent->getHash(id); }
+ std::string getHashRef() const { return _parent->getHash(_id); }
};
// The path used by the root-source group
diff --git a/devtools/create_translations/create_translations.h b/devtools/create_translations/create_translations.h
index 34a79913ac..e87e3923c3 100644
--- a/devtools/create_translations/create_translations.h
+++ b/devtools/create_translations/create_translations.h
@@ -26,10 +26,10 @@
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
-typedef signed short int16;
+typedef signed short int16;
-#ifndef __has_feature // Optional of course.
- #define __has_feature(x) 0 // Compatibility with non-clang compilers.
+#ifndef __has_feature // Optional of course.
+#define __has_feature(x) 0 // Compatibility with non-clang compilers.
#endif
#endif /* CREATE_TRANSLATIONS_H */
diff --git a/devtools/credits.pl b/devtools/credits.pl
index 41c2d4f162..1a038c7dee 100755
--- a/devtools/credits.pl
+++ b/devtools/credits.pl
@@ -552,12 +552,21 @@ begin_credits("Credits");
add_person("Oliver Kiehl", "olki", "(retired)");
add_person("Ludvig Strigeus", "ludde", "(retired)");
end_section();
-
+
+ begin_section("Access");
+ add_person("Arnaud Boutonn&eacute;", "Strangerke", "");
+ add_person("Paul Gilbert", "dreammaster", "");
+ end_section();
+
begin_section("Avalanche");
add_person("Peter Bozs&oacute;", "uruk", "");
add_person("Arnaud Boutonn&eacute;", "Strangerke", "");
end_section();
+ begin_section("BBVS");
+ add_person("Benjamin Haisch", "john_doe", "");
+ end_section();
+
begin_section("CGE");
add_person("Arnaud Boutonn&eacute;", "Strangerke", "");
add_person("Paul Gilbert", "dreammaster", "");
@@ -710,6 +719,11 @@ begin_credits("Credits");
add_person("Lars Skovlund", "lskovlun", "");
end_section();
+ begin_section("Sherlock");
+ add_person("Paul Gilbert", "dreammaster", "");
+ add_person("Martin Kiewitz", "m_kiewitz", "");
+ end_section();
+
begin_section("Sky");
add_person("Robert G&ouml;ffringmann", "lavosspawn", "(retired)");
add_person("Oliver Kiehl", "olki", "(retired)");
@@ -877,6 +891,10 @@ begin_credits("Credits");
add_person("Andre Heider", "dhewg", "");
end_section();
+ begin_section("Raspberry Pi");
+ add_person("Manuel Alfayate", "vanfanel", "");
+ end_section();
+
end_section();
begin_section("Other subsystems");
@@ -1286,6 +1304,15 @@ begin_credits("Credits");
"Bob Bell, Michel Kripalani, Tommy Yune, from Presto Studios for ".
"providing the source code of The Journeyman Project: Pegasus Prime.");
+ add_paragraph(
+ "Electronic Arts IP Preservation Team, particularly Stefan Serbicki, and Vasyl Tsvirkunov of ".
+ "Electronic Arts for providing the source code of the two Lost Files of Sherlock Holmes games. ".
+ "James M. Ferguson and Barry Duncan for their tenacious efforts to recover the sources.");
+
+ add_paragraph(
+ "The mindFactory team for writing Broken Sword 2.5, a splendid fan-made sequel, and for sharing ".
+ "the source code with us.");
+
end_section();
end_credits();
diff --git a/devtools/dist-scummvm.sh b/devtools/dist-scummvm.sh
index ac411c55a3..56e6b4e05e 100755
--- a/devtools/dist-scummvm.sh
+++ b/devtools/dist-scummvm.sh
@@ -4,6 +4,7 @@
#
# Largely based on dist-fink.sh, Copyright (c) 2001 Christoph Pfisterer.
# Modified to use Subversion instead of CVS by Max Horn in 2007.
+# Modified to use git by Eugene Sandulenko in 2015.
#
# ScummVM is the legal property of its developers, whose names
# are too numerous to list here. Please refer to the COPYRIGHT
@@ -26,25 +27,44 @@
### configuration
-svnroot='https://scummvm.svn.sourceforge.net/svnroot/scummvm'
+scummvmrepo='https://github.com/scummvm/scummvm.git'
+toolsrepo='https://github.com/scummvm/scummvm-tools.git'
### init
if [ $# -lt 2 ]; then
- echo "Usage: $0 <module> <version-number> [<temporary-directory> [<tag>]]"
+ echo "Usage: $0 <scummvm | scummvm-tools> <version-number> [<temporary-directory> [<tag>]]"
exit 1
fi
+echo_n() {
+ printf "$@"
+}
+
module=$1
version=$2
tmpdir=${3:-/tmp}
tag=$4
if [ -z "$tag" ]; then
- tag=release-`echo $version | sed 's/\./-/g'`
+ tag="v$version"
fi
fullname="$module-$version"
-echo "packaging $module release $version, SVN tag $tag"
+# Check modules
+case $module in
+scummvm)
+ gitrepo=$scummvmrepo
+;;
+scummvm-tools)
+ gitrepo=$toolsrepo
+;;
+*)
+ echo "Unknown module $module. Only scummvm or scummvm-tools are supported"
+ exit 1
+esac
+
+
+echo "packaging $module release $version, GIT tag $tag"
### setup temp directory
@@ -54,25 +74,39 @@ umask 022
if [ -d $fullname ]; then
echo "There is a left-over directory in $tmpdir."
- echo "Remove $fullname, then try again."
+ echo "Remove $tmpdir/$fullname, then try again."
exit 1
fi
-### check code out from SVN
-# TODO: Add support for making tarballs from trunk / branches?
+### check code out from GIT
-echo "Exporting module $module, tag $tag from SVN:"
-svn export "$svnroot/$module/tags/$tag" $fullname
+echo "Cloning module $module from GIT:"
+git clone $gitrepo $fullname
if [ ! -d $fullname ]; then
- echo "SVN export failed, directory $fullname doesn't exist!"
+ echo "GIT clone failed, directory $fullname doesn't exist!"
exit 1
fi
+cd $tmpdir/$fullname
+
+echo_n "Checking out tag $tag..."
+if git checkout $tag --quiet 2>/dev/null; then
+ echo done
+else
+ echo "checking out tag $tag failed."
+ exit 1
+fi
+
+cd $tmpdir
+
+echo "Cleaning up .git directory"
+rm -rf $fullname/.git
+
### roll the tarball
-echo "Creating tarball $fullname.tar:"
+echo "Creating tarball $fullname.tar..."
rm -f $fullname.tar $fullname.tar.gz
-tar -cvf $fullname.tar $fullname
+tar -cf $fullname.tar $fullname
echo "Compressing (using gzip) tarball $fullname.tar.gz..."
gzip -c9 $fullname.tar > $fullname.tar.gz
@@ -88,8 +122,15 @@ if [ ! -f $fullname.tar.bz2 ]; then
exit 1
fi
+echo "Compressing (using xz) tarball $fullname.tar.xz..."
+xz -c9 $fullname.tar > $fullname.tar.xz
+if [ ! -f $fullname.tar.xz ]; then
+ echo "Packaging to xz failed, $fullname.tar.xz doesn't exist!"
+ # But do not exit
+fi
+
echo "Zipping $fullname.zip..."
-zip -r9 $fullname.zip $fullname
+zip -r9 $fullname.zip $fullname >/dev/null
if [ ! -f $fullname.zip ]; then
echo "Packaging failed, $fullname.zip doesn't exist!"
exit 1
@@ -99,6 +140,7 @@ fi
### finish up
echo "Done:"
-ls -l $fullname.tar.gz $fullname.tar.bz2 $fullname.zip
+ls -l $fullname.tar.gz $fullname.tar.bz2 $fullname.tar.xz $fullname.zip
+md5sum $fullname.tar.gz $fullname.tar.bz2 $fullname.tar.xz $fullname.zip
exit 0
diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index d758111ff1..f4301ad0a3 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -494,7 +494,7 @@ freddi Freddi Fish 1: The Case of the Missing Kelp Seeds
1f2e62b5a9c50589fc342285a6bb3a27 -1 he Windows HE 73 - - e_orz
64a22be96d679018696e5c8d3ca8b71d 26375 jp Windows HE 73 - - sev
507bb360688dc4180fdf0d7597352a69 26402 se Windows HE 73 - - Sven Arvidsson
- df047cc4792150f601290357566d36a6 -1 us All HE 90 Updated - khalek
+ df047cc4792150f601290357566d36a6 -1 en All HE 90 Updated - khalek
e44ea295a3f8fe4f41983080dab1e9ce -1 fr Mac HE 90 Updated - ThierryFR
746e88c172a5b7a1ae89ac0ee3ee681a -1 ru Windows HE 90 Updated - sev
a197a87ae77f3b3333f09a7a2c448fe2 -1 en Windows HE 99 Updated - Jonathan
@@ -523,9 +523,9 @@ freddi2 Freddi Fish 2: The Case of the Haunted Schoolhouse
5057fb0e99e5aa29df1836329232f101 -1 All Windows HE 80 - - sev
ac62d50e39492ee3738b4e83a5ac780f -1 nl Windows HE 80 - - joostp
151071053a1d0021198216713939521d -1 en Windows HE 80 - - vampir_raziel
- 51305e929e330e24a75a0351c8f9975e -1 us All HE 99 Updated - Kirben
+ 51305e929e330e24a75a0351c8f9975e -1 en All HE 99 Updated - Kirben
9c0ee9c252785e9fca0143e42ac4b256 -1 de Windows HE 99 Updated - George Kormendi
- 8ee63cafb1fe9d62aa0d5a23117e70e7 -1 us All HE 100 Updated - Kirben
+ 8ee63cafb1fe9d62aa0d5a23117e70e7 -1 en All HE 100 Updated - Kirben
e41de1c2a15abbcdbf9977e2d7e8a340 -1 ru Windows HE 100 Updated - sev
c20848f53c2d48bfacdc840993843765 -1 nl All HE 80 Demo - DarthBo
@@ -533,7 +533,7 @@ freddi2 Freddi Fish 2: The Case of the Haunted Schoolhouse
d37c55388294b66e53e7ced3af88fa68 -1 en All HE 100 Updated Demo - khalek
freddi3 Freddi Fish 3: The Case of the Stolen Conch Shell
- 8368f552b1e3eba559f8d559bcc4cadb -1 All All - - - Kirben, sev
+ 8368f552b1e3eba559f8d559bcc4cadb 55959 All All - - - Kirben, sev (US and ???)
0cccfa5223099a60e76cfcca57a1a141 -1 nl All - - - adutchguy, daniel9
008e76ec3ae58d0add637ea7aa299a2c -1 fr Mac - - - ThierryFR
898ce8eb1234a955ef75e87141902bb3 -1 ru Windows - - - sev
@@ -551,7 +551,7 @@ freddi3 Freddi Fish 3: The Case of the Stolen Conch Shell
d73c851b942af44deb9b6d5f416a0972 -1 he Windows HE 99 Demo - Ori Avtalion
freddi4 Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch
- 4f580a021eee026f3b4589e17d130d78 -1 All All - - - Kirben, sev
+ 4f580a021eee026f3b4589e17d130d78 44190 All All - - - Kirben, sev (US and ???)
14d48c95b43ddeb983254cf6c43851f1 -1 nl All - - - adutchguy, daniel9
3b832f4a90740bf22e9b8ed42ca0128c -1 gb All HE 99 - - Reckless
d74122362a77ec24525fdd50297dfd82 -1 fr Mac - - - ThierryFR
@@ -581,7 +581,7 @@ freddi4 Freddi Fish 4: The Case of the Hogfish Rustlers of Briny Gulch
47e041521d35c7a801bb1c010d84da9d -1 it Windows HE 99 Demo - Kirben
freddicove Freddi Fish 5: The Case of the Creature of Coral Cove
- 590e6546aacd0d374b7f3a4f53013ab1 -1 All All - - - cyx
+ 590e6546aacd0d374b7f3a4f53013ab1 41165 All All - - - cyx (US and ???)
21abe302e1b1e2b66d6f5c12e241ebfd -1 ru Windows unenc Unencrypted - sev
b8955d7d23b4972229060d1592489fef -1 nl All HE 100 - - adutchguy, daniel9
8f345db2f3f5a25ed6305001957e6f72 41182 nl All HE 100 - - Ben Castricum
@@ -651,12 +651,12 @@ moonbase Moonbase Commander
ef71a322b6530ac45b1a070f7c0795f7 -1 en Windows Demo Demo - Kirben
pajama Pajama Sam 1: No Need to Hide When It's Dark Outside
- 672dec94b82f7f0877ebb5b5cf7f4bc1 -1 us All - - - khalek
+ 672dec94b82f7f0877ebb5b5cf7f4bc1 -1 en All - - - khalek
1d7a2e1ddcade791e2de0cfceac86725 -1 fr All - - - gist974, ThierryFR
4fa6870d9bc8c313b65d54b1da5a1891 -1 nl All - - - joostp
a095e33061606d231ff37dca4c64c8ac -1 de All HE 99 - - Joachim Eberhard
898eaa21f79cf8d4f08db856244689ff 66505 en Windows HE 99 Updated - Joachim Eberhard
- 37aed3f91c1ef959e0bd265f9b13781f -1 us All HE 100 Updated - Kirben
+ 37aed3f91c1ef959e0bd265f9b13781f 66599 en All HE 100 Updated - Kirben
4aa93cb30e485b728504ba3a693f12bf -1 ru Windows HE 100 - - sev
782393c5934ecd0b536eaf5fd541bd26 -1 en Windows HE 101 Updated - Jonathan
c225bec1b6c0798a2b8c89ac226dc793 -1 en Wii HE 101 - - sanguinehearts
@@ -766,14 +766,14 @@ puttmoon Putt-Putt Goes to the Moon
puttcircus Putt-Putt Joins the Circus
ecc4340c2b801f5af8da4e00c0e432d9 -1 nl All - - - daniel9
- ab0693e9324cfcf498fdcbb12acf8bb4 -1 en All - - - sev
+ ab0693e9324cfcf498fdcbb12acf8bb4 36655 us All - - - sev
7bad72e332a59f9fcc1d437f4edad32a -1 ru All - - - sev
db74136c20557eca6ed3411bff39f7a1 -1 gb Windows - - - Reckless
d0ad929def3e9cfe39dea55bd12098d4 -1 fr Windows - - - gist974
febf4a983ea5faea1c9dd6c710ebb09c -1 de Windows - - - andy482
c8253da0f4626d2236b5291b99e33408 -1 he Windows HE 99 - - Matan Bareket
- a7cacad9c40c4dc9e1812abf6c8af9d5 -1 en All - Demo - Kirben, sev
+ a7cacad9c40c4dc9e1812abf6c8af9d5 -1 us All - Demo - Kirben, sev
1387d16aa620dc1c2d1fd87f8a9e7a09 -1 fr Windows - Demo - Mevi
3af61c5edf8e15b43dbafd285b2e9777 -1 he Windows - Demo - Ori Avtalion
@@ -800,7 +800,7 @@ puttzoo Putt-Putt Saves the Zoo
9781422e4288dbc090720e4563168ba7 -1 fr Windows - - - gist974
0f9d3317910ac7a9f449243118884ada 42070 de Windows - - - George Kormendi
92e7727e67f5cd979d8a1070e4eb8cb3 -1 en All HE 98.5 Updated - cyx
- 3a3e592b074f595489f7f11e150c398d -1 us Windows HE 99 Updated - Adrian
+ 3a3e592b074f595489f7f11e150c398d -1 en Windows HE 99 Updated - Adrian
c5cc7cba02a2fbd539c4439e775b0536 43470 de Windows HE 99 Updated - Lightkey
5c9cecbd2952ccec14c9ecebf5822a34 -1 en iOS HE 100 - - clone2727
7b4ee071eecadc2d8cd0c3509110825c -1 en Windows HE 100 Remastered - Kirben
@@ -816,7 +816,7 @@ puttzoo Putt-Putt Saves the Zoo
PuttTime Putt-Putt Travels Through Time
fcb78ebecab2757264c590890c319cc5 -1 nl All HE 85 - - adutchguy, daniel9
- 63fdcdc95cdeea00060883aed38e5504 -1 en All HE 85 - - iziku
+ 63fdcdc95cdeea00060883aed38e5504 62582 us All HE 85 - - iziku
db21a6e338fe3b70c2723b6530865bf2 -1 fr All HE 85 - - gist974, ThierryFR
84e3c23a49ded8a6f9197735c8eb3de7 -1 de Windows HE 85 - - oncer
2108d83dcf09f8adb4bc524669c8cf51 -1 us All HE 99 Updated - Kirben
@@ -841,9 +841,9 @@ balloon Putt-Putt and Pep's Balloon-O-Rama
bab0fb81dcb12b8930c5d850b8f2a7de 12800 de Windows HE 80 - - George Kormendi
145bd3373574feb668cc2eea2ec6cf86 -1 ru Windows HE 80 - - sev
27b2ef1653089fe5b897d9cc89ce784f -1 ru Windows HE 80 - - George Kormendi
- 2232b0b9411575b1f9961713ebc9de61 -1 nl Windows HE 80 - - Ben Castricum
- a22af0ad0e3126d19d22707b0267a37d -1 nl Windows HE 80 - - Ben Castricum
- a56a05c6b865b9956639f8c51269e5ab -1 nl Mac HE 80 - - Ben Castricum
+ 2232b0b9411575b1f9961713ebc9de61 12800 nl Windows HE 80 - - Ben Castricum
+ a22af0ad0e3126d19d22707b0267a37d 12800 nl Windows HE 80 - - Ben Castricum
+ a56a05c6b865b9956639f8c51269e5ab 12800 nl Mac HE 80 - - Ben Castricum
d7b247c26bf1f01f8f7daf142be84de3 -1 en Windows HE 99 Updated - iziku
8e3241ddd6c8dadf64305e8740d45e13 -1 en All HE 100 Updated - Kirben
@@ -870,40 +870,40 @@ PuttsFunShop Putt-Putt's One-Stop Fun Shop
5262a27afcaee04e5c4900220bd463e7 -1 us All - - - Kirben
spyfox SPY Fox 1: Dry Cereal
- 6bf70eee5de3d24d2403e0dd3d267e8a 49221 All Windows - - - khalek
+ 6bf70eee5de3d24d2403e0dd3d267e8a 49221 All Windows - - - khalek (US and ???)
100b4c8403ad6a83d4bf7dbf83e44dc4 -1 fr Windows - - - gist974
9bda5fee51d2fda5253d02c642016bf4 -1 nl All HE 98.5 - - daniel9, joostp
- 58436e634f4fae1d9973591c2ffa1fcb -1 en All HE 99 Updated - Joachim Eberhard
+ 58436e634f4fae1d9973591c2ffa1fcb -1 en All HE 99 Updated - Joachim Eberhard (GB or US?)
a28135a7ade38cc0208b04507c46efd1 -1 de All HE 99 - - nachbarnebenan
ee785fe2569bc9965526e774f7ab86f1 -1 fr Mac HE 99 - - ThierryFR
76b66b43e593ad4d2f1dfb5cc8f19700 -1 nl Windows HE 99 - - sugarcube
72ac6bc980d5101c2142189d746bd62f -1 ru Windows HE 99 - - sev
3de99ef0523f8ca7958faa3afccd035a -1 us All HE 100 Updated - Kirben
- 23394c8d29cc63c61313959431a12476 -1 en Windows HE 100 Updated - Jonathan
- 50b831f11b8c4b83784cf81f4dcc69ea -1 en Wii HE 101 - - sanguinehearts
- 15878e3bee2e1e759184abee98589eaa -1 en iOS HE 100 - - clone2727
+ 23394c8d29cc63c61313959431a12476 -1 en Windows HE 100 Updated - Jonathan (GB or US?)
+ 50b831f11b8c4b83784cf81f4dcc69ea -1 en Wii HE 101 - - sanguinehearts (GB or US?)
+ 15878e3bee2e1e759184abee98589eaa -1 en iOS HE 100 - - clone2727 (GB or US?)
- 53e94115b55dd51d4b8ff0871aa1df1e 20103 en All - Demo - khalek, sev
- fbdd947d21e8f5bac6d6f7a316af1c5a 15693 en All - Demo - sev
+ 53e94115b55dd51d4b8ff0871aa1df1e 20103 us All - Demo - khalek, sev
+ fbdd947d21e8f5bac6d6f7a316af1c5a 15693 us All - Demo - sev
ba888e6831517597859e91aa173f945c -1 fr All - Demo - Kirben
73b8197e236da4bf49adc99fe8f5fa1b -1 de All - Demo - Joachim Eberhard
4edbf9d03550f7ba01e7f34d69b678dd -1 nl All HE 98.5 Demo - Kirben
- f2ec78e50bdc63b70044e9758be10914 -1 nl Mac HE 98.5 Demo - Ben Castricum
- 9d4ab3e0e1d1ebc6ba8a6a4c470ed184 -1 en All HE 100 Demo - khalek
+ f2ec78e50bdc63b70044e9758be10914 20141 nl Mac HE 98.5 Demo - Ben Castricum
+ 9d4ab3e0e1d1ebc6ba8a6a4c470ed184 15943 us All HE 100 Demo - khalek
spyfox2 SPY Fox 2: Some Assembly Required
- f79e60c17cca601e411f1f75e8ee9b5a 51286 All All - - - Kirben
+ f79e60c17cca601e411f1f75e8ee9b5a 51286 All All - - - Kirben (US and ???)
90e2f0af4f779629695c6394a65bb702 -1 fr All - - - gist974, ThierryFR
bc4700bc0e12879f6d25d14d6be6cfdd -1 de All - - - Joachim Eberhard
3785fd25f7e02b5782bfc5072d8f77c8 -1 it All - - - Saleck
cea91e3dd47f2518ea418e41611aa77f -1 ru All - - - sev
- 9fd66fb3b04703bd50da4356e4202558 51295 en Mac - - - pix_climber
+ 9fd66fb3b04703bd50da4356e4202558 51295 en Mac - - - pix_climber (GB or US?)
71fe97c3108678cf604f14abe342341b 51286 nl All - - - adutchguy
1c792d28376d45e145cb916bca0400a2 -1 nl All - Demo - joostp
7222f260253f325c21fcfa68b5bfab67 -1 us All - Demo - Kirben
732845548b1d6c2da572cb6a1bf81b07 -1 de All - Demo - Joachim Eberhard
- e62056ba675ad65d8854ab3c5ad4b3c0 14689 en Windows - Mini Game - Trekky
+ e62056ba675ad65d8854ab3c5ad4b3c0 14689 gb Windows - Mini Game - Trekky
22c7432dc97a821fcfccd480e93e3911 14689 nl Windows - Mini Game - Ben Castricum
6b10c9977cad9de503642059359792b1 14689 fr Windows - Mini Game - Ben Castricum
9684c161258d68e0d464d6cab7024b9c 14689 it Windows - Mini Game - Ben Castricum
@@ -920,7 +920,7 @@ spyozon SPY Fox 3: Operation Ozone
7015b059ab72cff3a0ef9fb4d5e9889d -1 de Windows - - - andy482
be39a5d4db60e8aa736b9086778cb45c -1 gb Windows - - -
- ebd0b2c8a387f18887282afe6cad894a 15317 en All - Demo - Kirben
+ ebd0b2c8a387f18887282afe6cad894a 15317 us All - Demo - Kirben
a99c39ba65b6086be28aef576da69595 -1 fr Windows - Demo - Mevi
65563295c3a06493351870f20a1630cf 5235008 All All HE CUP Preview - sev
diff --git a/dists/engine-data/README b/dists/engine-data/README
index e87f04c65b..06939dba42 100644
--- a/dists/engine-data/README
+++ b/dists/engine-data/README
@@ -1,6 +1,9 @@
engine-data README
-------------------------------------------------------------------------------
+access.dat
+TODO
+
drascula.dat
TODO
diff --git a/dists/engine-data/access.dat b/dists/engine-data/access.dat
new file mode 100644
index 0000000000..e90903816f
--- /dev/null
+++ b/dists/engine-data/access.dat
Binary files differ
diff --git a/dists/engine-data/kyra.dat b/dists/engine-data/kyra.dat
index 3ad01b868f..1b42cfbadc 100644
--- a/dists/engine-data/kyra.dat
+++ b/dists/engine-data/kyra.dat
Binary files differ
diff --git a/dists/macosx/Info.plist b/dists/macosx/Info.plist
index fffb18056e..b619fa6843 100644
--- a/dists/macosx/Info.plist
+++ b/dists/macosx/Info.plist
@@ -7,15 +7,20 @@
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
+ <string>be</string>
<string>ca</string>
<string>cs</string>
<string>da</string>
<string>de</string>
<string>es</string>
+ <string>eu</string>
+ <string>fi</string>
<string>fr</string>
+ <string>gl</string>
<string>hu</string>
<string>it</string>
<string>nb</string>
+ <string>nl</string>
<string>nn</string>
<string>pl</string>
<string>pt</string>
diff --git a/dists/macosx/Info.plist.in b/dists/macosx/Info.plist.in
index 7e91984f39..39bb82ca69 100644
--- a/dists/macosx/Info.plist.in
+++ b/dists/macosx/Info.plist.in
@@ -7,15 +7,20 @@
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
+ <string>be</string>
<string>ca</string>
<string>cs</string>
<string>da</string>
<string>de</string>
<string>es</string>
+ <string>eu</string>
+ <string>fi</string>
<string>fr</string>
+ <string>gl</string>
<string>hu</string>
<string>it</string>
<string>nb</string>
+ <string>nl</string>
<string>nn</string>
<string>pl</string>
<string>pt</string>
diff --git a/dists/ps3/readme-ps3.md b/dists/ps3/readme-ps3.md
index 2fb393b4fb..8290f87066 100644
--- a/dists/ps3/readme-ps3.md
+++ b/dists/ps3/readme-ps3.md
@@ -36,12 +36,12 @@ Unauthorized distribution of an installable package with non freeware games incl
Building from source
====================
-This port of ScummVM to the PS3 is based on SDL. It uses the open source SDK PSL1GHT.
+This port of ScummVM to the PS3 is based on SDL2. It uses the open source SDK PSL1GHT.
The dependencies needed to build it are :
- The toolchain from https://github.com/ps3dev/ps3toolchain
-- SDL from https://github.com/zeldin/SDL_PSL1GHT
+- SDL from https://bitbucket.org/bgK/sdl_psl1ght
- ScummVM from https://github.com/scummvm/scummvm
Once all the dependencies are correctly setup, an installable package can be obtained from source by issuing the following command :
diff --git a/dists/scummvm.rc b/dists/scummvm.rc
index 2028a5bfd3..fbf2f44434 100644
--- a/dists/scummvm.rc
+++ b/dists/scummvm.rc
@@ -20,6 +20,9 @@ scummmodern.zip FILE "gui/themes/scummmodern.zip"
translations.dat FILE "gui/themes/translations.dat"
#endif
+#if ENABLE_ACCESS == STATIC_PLUGIN
+access.dat FILE "dists/engine-data/access.dat"
+#endif
#if ENABLE_DRASCULA == STATIC_PLUGIN
drascula.dat FILE "dists/engine-data/drascula.dat"
#endif
diff --git a/dists/scummvm.rc.in b/dists/scummvm.rc.in
index 3a619334d5..fc68f95a95 100644
--- a/dists/scummvm.rc.in
+++ b/dists/scummvm.rc.in
@@ -20,6 +20,9 @@ scummmodern.zip FILE "gui/themes/scummmodern.zip"
translations.dat FILE "gui/themes/translations.dat"
#endif
+#if ENABLE_ACCESS == STATIC_PLUGIN
+access.dat FILE "dists/engine-data/access.dat"
+#endif
#if ENABLE_DRASCULA == STATIC_PLUGIN
drascula.dat FILE "dists/engine-data/drascula.dat"
#endif
diff --git a/dists/win32/ScummVM.iss b/dists/win32/ScummVM.iss
index 5afb407177..c156ab6ca1 100644
--- a/dists/win32/ScummVM.iss
+++ b/dists/win32/ScummVM.iss
@@ -53,7 +53,6 @@ Name: {group}\Copyright; Filename: {app}\COPYRIGHT.txt; WorkingDir: {app}; Comme
Name: {group}\News; Filename: {app}\NEWS.txt; WorkingDir: {app}; Comment: NEWS; Flags: createonlyiffileexists; Languages: not de
Name: {group}\Neues; Filename: {app}\Neues.txt; WorkingDir: {app}; Comment: Neues; Flags: createonlyiffileexists; Languages: de
;QUICKSTART
-Name: {group}\QuickStart; Filename: {app}\QUICKSTART.txt; WorkingDir: {app}; Comment: QUICKSTART; Flags: createonlyiffileexists; Languages: not (de or es or fr or it or nb or se)
Name: {group}\Schnellstart; Filename: {app}\Schnellstart.txt; WorkingDir: {app}; Comment: Schnellstart; Flags: createonlyiffileexists; Languages: de
Name: {group}\InicioRapido; Filename: {app}\InicioRapido.txt; WorkingDir: {app}; Comment: InicioRapido; Flags: createonlyiffileexists; Languages: es
Name: {group}\DemarrageRapide; Filename: {app}\DemarrageRapide.txt; WorkingDir: {app}; Comment: DemarrageRapide; Flags: createonlyiffileexists; Languages: fr
@@ -93,7 +92,6 @@ Source: COPYRIGHT.txt; DestDir: {app}; Flags: ignoreversion
Source: NEWS.txt; DestDir: {app}; Flags: ignoreversion; Languages: not de
Source: doc/de/Neues.txt; DestDir: {app}; Flags: ignoreversion; Languages: de
;QUICKSTART
-Source: doc/QUICKSTART.txt; DestDir: {app}; Flags: ignoreversion isreadme; Languages: not (de or es or fr or it or nb or se)
Source: doc/de/Schnellstart.txt; DestDir: {app}; Flags: ignoreversion isreadme; Languages: de
Source: doc/es/InicioRapido.txt; DestDir: {app}; Flags: ignoreversion isreadme; Languages: es
Source: doc/fr/DemarrageRapide.txt; DestDir: {app}; Flags: ignoreversion isreadme; Languages: fr
diff --git a/doc/de/Neues b/doc/de/Neues
index 3d155be825..0c681bf1c9 100644
--- a/doc/de/Neues
+++ b/doc/de/Neues
@@ -8,6 +8,13 @@ Sie auf Englisch unter:
- UnterstУМtzung fУМr Sfinx hinzugefУМgt.
- UnterstУМtzung fУМr Zork Nemesis: The Forbidden Lands hinzugefУМgt.
- UnterstУМtzung fУМr Zork: Grand Inquisitor hinzugefУМgt.
+ - UnterstУМtzung fУМr The Lost Files of Sherlock Holmes: The Case of the Serrated Scalpel hinzugefУМgt.
+ - UnterstУМtzung fУМr The Lost Files of Sherlock Holmes: The Case of the Rose Tattoo hinzugefУМgt.
+ - UnterstУМtzung fУМr Beavis and Butthead in Virtual Stupidity hinzugefУМgt.
+ - UnterstУМtzung fУМr Amazon: Guardians of Eden hinzugefУМgt.
+
+ Neue Portierungen:
+ - Portierung auf den Raspberry Pi erfolgt.
Allgemein:
- Code fУМr Munt-MT-32-Emulation auf Version 1.5.0 aktualisiert.
diff --git a/engines/access/access.cpp b/engines/access/access.cpp
index 56fa6c7533..bc9bcb4b08 100644
--- a/engines/access/access.cpp
+++ b/engines/access/access.cpp
@@ -34,19 +34,24 @@ namespace Access {
AccessEngine::AccessEngine(OSystem *syst, const AccessGameDescription *gameDesc)
: _gameDescription(gameDesc), Engine(syst), _randomSource("Access"),
_useItem(_flags[99]), _startup(_flags[170]), _manScaleOff(_flags[172]) {
+ _aboutBox = nullptr;
_animation = nullptr;
_bubbleBox = nullptr;
_char = nullptr;
_debugger = nullptr;
_events = nullptr;
_files = nullptr;
+ _invBox = nullptr;
_inventory = nullptr;
+ _helpBox = nullptr;
_midi = nullptr;
_player = nullptr;
+ _res = nullptr;
_room = nullptr;
_screen = nullptr;
_scripts = nullptr;
_sound = nullptr;
+ _travelBox = nullptr;
_video = nullptr;
_destIn = nullptr;
@@ -130,6 +135,7 @@ AccessEngine::~AccessEngine() {
delete _inventory;
delete _midi;
delete _player;
+ delete _res;
delete _room;
delete _screen;
delete _scripts;
@@ -204,6 +210,13 @@ void AccessEngine::initialize() {
}
Common::Error AccessEngine::run() {
+ _res = Resources::init(this);
+ Common::String errorMessage;
+ if (!_res->load(errorMessage)) {
+ GUIErrorMessage(errorMessage);
+ return Common::kNoError;
+ }
+
setVGA();
initialize();
diff --git a/engines/access/access.h b/engines/access/access.h
index 37b9fec5a5..2ca4a3468e 100644
--- a/engines/access/access.h
+++ b/engines/access/access.h
@@ -42,6 +42,7 @@
#include "access/font.h"
#include "access/inventory.h"
#include "access/player.h"
+#include "access/resources.h"
#include "access/room.h"
#include "access/screen.h"
#include "access/scripts.h"
@@ -147,6 +148,7 @@ public:
FileManager *_files;
InventoryManager *_inventory;
Player *_player;
+ Resources *_res;
Room *_room;
Screen *_screen;
Scripts *_scripts;
@@ -313,6 +315,8 @@ public:
void SPRINTCHR(char c, int fontNum);
void PRINTCHR(Common::String msg, int fontNum);
+
+ bool playMovie(const Common::String &filename, const Common::Point &pos);
};
} // End of namespace Access
diff --git a/engines/access/amazon/amazon_game.cpp b/engines/access/amazon/amazon_game.cpp
index 7a55873d97..3bb19676e8 100644
--- a/engines/access/amazon/amazon_game.cpp
+++ b/engines/access/amazon/amazon_game.cpp
@@ -146,27 +146,24 @@ void AmazonEngine::playGame() {
}
void AmazonEngine::setupGame() {
+ Amazon::AmazonResources &res = *((Amazon::AmazonResources *)_res);
+
// Load death list
- if (isDemo()) {
- _deaths.resize(34);
- for (int i = 0; i < 34; ++i) {
- _deaths[i]._screenId = DEATH_SCREENS_DEMO[i];
- _deaths[i]._msg = DEATH_TEXT_DEMO[i];
- }
- } else {
- _deaths.resize(58);
- for (int i = 0; i < 58; ++i) {
- _deaths[i]._screenId = DEATH_SCREENS[i];
- _deaths[i]._msg = DEATH_TEXT[i];
- }
+ _deaths.resize(_res->DEATHS.size());
+
+ for (uint idx = 0; idx < _deaths.size(); ++idx) {
+ _deaths[idx]._screenId = res.DEATHS[idx]._screenId;
+ _deaths[idx]._msg = res.DEATHS[idx]._msg;
}
+
+ // Load the deaths cells
_deaths._cells.resize(13);
for (int i = 0; i < 13; ++i)
_deaths._cells[i] = CellIdent(DEATH_CELLS[i][0], DEATH_CELLS[i][1], DEATH_CELLS[i][2]);
// Miscellaneous
- _fonts._font1.load(FONT6x6_INDEX, FONT6x6_DATA);
- _fonts._font2.load(FONT2_INDEX, FONT2_DATA);
+ _fonts._font1.load(&res.FONT6x6_INDEX[0], &res.FONT6x6_DATA[0]);
+ _fonts._font2.load(&res.FONT2_INDEX[0], &res.FONT2_DATA[0]);
initVariables();
}
@@ -195,8 +192,8 @@ void AmazonEngine::initVariables() {
_timers.push_back(te);
}
- _player->_playerX = _player->_rawPlayer.x = _travelPos[_player->_roomNumber][0];
- _player->_playerY = _player->_rawPlayer.y = _travelPos[_player->_roomNumber][1];
+ _player->_playerX = _player->_rawPlayer.x = _res->ROOMTBL[_player->_roomNumber]._travelPos.x;
+ _player->_playerY = _player->_rawPlayer.y = _res->ROOMTBL[_player->_roomNumber]._travelPos.y;
_room->_selectCommand = -1;
_events->setNormalCursor(CURSOR_CROSSHAIRS);
_mouseMode = 0;
@@ -411,6 +408,7 @@ void AmazonEngine::calcIQ() {
}
void AmazonEngine::helpTitle() {
+ AmazonResources &res = *(AmazonResources *)_res;
int width = _fonts._font2.stringWidth(_bubbleBox->_bubbleTitle);
int posX = 160 - (width / 2);
_fonts._font2._fontColors[0] = 0;
@@ -419,13 +417,13 @@ void AmazonEngine::helpTitle() {
_fonts._font2._fontColors[3] = 35;
_fonts._font2.drawString(_screen, _bubbleBox->_bubbleTitle, Common::Point(posX, 24));
- width = _fonts._font2.stringWidth(HELPLVLTXT[_helpLevel]);
+ width = _fonts._font2.stringWidth(res.HELPLVLTXT[_helpLevel]);
posX = 160 - (width / 2);
_fonts._font2._fontColors[0] = 0;
_fonts._font2._fontColors[1] = 10;
_fonts._font2._fontColors[2] = 11;
_fonts._font2._fontColors[3] = 12;
- _fonts._font2.drawString(_screen, HELPLVLTXT[_helpLevel], Common::Point(posX, 36));
+ _fonts._font2.drawString(_screen, res.HELPLVLTXT[_helpLevel], Common::Point(posX, 36));
Common::String iqText = "IQ: ";
calcIQ();
@@ -441,7 +439,7 @@ void AmazonEngine::helpTitle() {
index /= 20;
iqText += " ";
- iqText += IQLABELS[index];
+ iqText += res.IQLABELS[index];
width = _fonts._font2.stringWidth(iqText);
posX = 160 - (width / 2);
@@ -642,25 +640,27 @@ void AmazonEngine::startChapter(int chapter) {
_room->init4Quads();
}
- if (chapter == 14) {
- _conversation = 31;
- _char->loadChar(_conversation);
- _events->setCursor(CURSOR_ARROW);
+ if (isCD()) {
+ if (chapter == 14) {
+ _conversation = 31;
+ _char->loadChar(_conversation);
+ _events->setCursor(CURSOR_ARROW);
- _images.clear();
- _oldRects.clear();
- _scripts->_sequence = 0;
- _scripts->searchForSequence();
+ _images.clear();
+ _oldRects.clear();
+ _scripts->_sequence = 0;
+ _scripts->searchForSequence();
- if (_screen->_vesaMode) {
- _converseMode = 1;
- }
- } else if (chapter != 1) {
- _player->_roomNumber = CHAPTER_JUMP[_chapter - 1];
- _room->_function = FN_CLEAR1;
- _converseMode = 0;
+ if (_screen->_vesaMode) {
+ _converseMode = 1;
+ }
+ } else if (chapter != 1) {
+ _player->_roomNumber = CHAPTER_JUMP[_chapter - 1];
+ _room->_function = FN_CLEAR1;
+ _converseMode = 0;
- _scripts->cmdRetPos();
+ _scripts->cmdRetPos();
+ }
}
}
diff --git a/engines/access/amazon/amazon_logic.cpp b/engines/access/amazon/amazon_logic.cpp
index de53da51cd..f927525ad1 100644
--- a/engines/access/amazon/amazon_logic.cpp
+++ b/engines/access/amazon/amazon_logic.cpp
@@ -1598,7 +1598,7 @@ void River::moveCanoe() {
if (events._leftButton && pt.y >= 140) {
if (pt.x < _vm->_room->_rMouse[8][0]) {
// Disk icon wasn't clicked
- _vm->_scripts->printString(BAR_MESSAGE);
+ _vm->_scripts->printString(AMRES.BAR_MESSAGE);
} else {
// Clicked on the Disc icon. Show the ScummVM menu
_vm->_room->handleCommand(9);
diff --git a/engines/access/amazon/amazon_resources.cpp b/engines/access/amazon/amazon_resources.cpp
index 430aa64f30..7dbe1c9f90 100644
--- a/engines/access/amazon/amazon_resources.cpp
+++ b/engines/access/amazon/amazon_resources.cpp
@@ -27,50 +27,60 @@ namespace Access {
namespace Amazon {
-const char *const FILENAMES[] = {
- "S00.AP", "S01.AP", "S02.AP", "R03.AP", "S04.AP", "S05.AP",
- "S06.AP", "S07.AP", "S08.AP", "S09.AP", "S10.AP", "S11.AP",
- "S12.AP", "S13.AP", "S14.AP", "S15.AP", "S16.AP", "S17.AP",
- "S18.AP", "S19.AP", "S20.AP", "S21.AP", "S22.AP", "S23.AP",
- "S24.AP", "S25.AP", "S26.AP", "S27.AP", "S28.AP", "S29.AP",
- "S30.AP", "S31.AP", "S32.AP", "S33.AP", "S34.AP", "R35.AP",
- "S36.AP", "S37.AP", "S38.AP", "S39.AP", "S40.AP", "C26.AP",
- "S42.AP", "S01.AP", "S44.AP", "S45.AP", "S46.AP", "S47.AP",
- "C36.AP", nullptr, "S50.AP", nullptr, nullptr, "S53.AP",
- "S54.AP", "S55.AP", "C35.AP", "S57.AP", "S58.AP", nullptr,
- nullptr, "S61.AP", nullptr, nullptr, "S64.AP", "C00.AP",
- "C01.AP", "C06.AP", "C07.AP", "C08.AP", "C05.AP", "C09.AP",
- "C12.AP", "C03.AP", "C13.AP", "C15.AP", "C14.AP", "C16.AP",
- "C17.AP", "C19.AP", "C20.AP", "C21.AP", "C22.AP", "C23.AP",
- "C24.AP", "C25.AP", "C29.AP", "C30.AP", "C32.AP", "C33.AP",
- "C34.AP", "CREDITS.AP", "MIDIDRV.AP", "SUMMARY.AP", "DEAD.AP",
- "EST.AP", "CHAPTER.AP", "MIDI.AP", "SOUND.AP", "INV.AP",
- // The following files are only present in the CD version
- "NARATE01.AP", "NARATE02.AP", "NARATE03.AP", "NARATE04.AP",
- "NARATE05.AP", "NARATE06.AP", "NARATE07.AP", "NARATE08.AP",
- "NARATE09.AP", "NARATE10.AP", "NARATE11.AP", "NARATE12.AP",
- "NARATE13.AP", "NARATE14.AP", "S00.AP", "TAG.AP"
-};
-
-const char *const FILENAMES_DEMO[] = {
- "S00.AP", "S01.AP", "S02.AP", "R03.AP", "S04.AP", "S05.AP",
- "S06.AP", "S07.AP", "S08.AP", "S09.AP", "S10.AP", "S11.AP",
- "S12.AP", "S13.AP", "S14.AP", "S15.AP", "S16.AP", "S17.AP",
- "S18.AP", "S19.AP", "S20.AP", "S21.AP", "S22.AP", "S23.AP",
- "S24.AP", "S25.AP", "S26.AP", "S27.AP", "S28.AP", "S29.AP",
- "S30.AP", "S31.AP", "S32.AP", "S33.AP", "S34.AP", "R35.AP",
- "S36.AP", "S37.AP", "S38.AP", "S39.AP", "S40.AP", "TITLE.AP",
- "S42.AP", "S01.AP", "S44.AP", "S45.AP", "S46.AP", "S47.AP",
- nullptr, nullptr, "S50.AP", nullptr, nullptr, "S53.AP",
- "S54.AP", nullptr, nullptr, "S57.AP", nullptr, nullptr,
- nullptr, "S61.AP", nullptr, "C23.AP", "C12.AP", "C00.AP",
- "C01.AP", "C06.AP", "C07.AP", "C08.AP", "C05.AP", "C09.AP",
- "C12.AP", "C03.AP", "C13.AP", "C15.AP", "C14.AP", "C16.AP",
- "C17.AP", "C19.AP", "C20.AP", "C21.AP", "C22.AP", "C23.AP",
- "C24.AP", "C25.AP", "R49.AP", "R49.AP", "R49.AP", "R49.AP",
- "R49.AP", "R49.AP", "R49.AP", "R49.AP", "DEAD.AP", "EST.AP",
- "CHAPTER.AP", "MUSIC.AP", "SOUND.AP", "INV.AP"
-};
+void AmazonResources::load(Common::SeekableReadStream &s) {
+ Resources::load(s);
+ uint count;
+
+ // Load the version specific data
+ NO_HELP_MESSAGE = readString(s);
+ NO_HINTS_MESSAGE = readString(s);
+ RIVER_HIT1 = readString(s);
+ RIVER_HIT2 = readString(s);
+ BAR_MESSAGE = readString(s);
+
+ for (int idx = 0; idx < 3; ++idx)
+ HELPLVLTXT[idx] = readString(s);
+ for (int idx = 0; idx < 9; ++idx)
+ IQLABELS[idx] = readString(s);
+
+ CANT_GET_THERE = readString(s);
+
+ // Get the offset of the general shared data for the game
+ uint entryOffset = findEntry(_vm->getGameID(), 2, 0, (Common::Language)0);
+ s.seek(entryOffset);
+
+ // Read in the cursor list
+ count = s.readUint16LE();
+ CURSORS.resize(count);
+ for (uint idx = 0; idx < count; ++idx) {
+ uint count2 = s.readUint16LE();
+ CURSORS[idx].resize(count2);
+ s.read(&CURSORS[idx][0], count2);
+ }
+
+ // Load font data
+ count = s.readUint16LE();
+ FONT2_INDEX.resize(count);
+ for (uint idx = 0; idx < count; ++idx)
+ FONT2_INDEX[idx] = s.readSint16LE();
+
+ count = s.readUint16LE();
+ FONT2_DATA.resize(count);
+ for (uint idx = 0; idx < count; ++idx)
+ FONT2_DATA[idx] = s.readByte();
+
+ count = s.readUint16LE();
+ FONT6x6_INDEX.resize(count);
+ for (uint idx = 0; idx < count; ++idx)
+ FONT6x6_INDEX[idx] = s.readSint16LE();
+
+ count = s.readUint16LE();
+ FONT6x6_DATA.resize(count);
+ for (uint idx = 0; idx < count; ++idx)
+ FONT6x6_DATA[idx] = s.readByte();
+}
+
+/*------------------------------------------------------------------------*/
const int SIDEOFFR[] = { 5, 5, 5, 5, 5, 5, 5, 5, 0 };
const int SIDEOFFL[] = { 5, 5, 5, 5, 5, 5, 5, 5, 0 };
@@ -85,316 +95,6 @@ const int DIAGOFFULY[] = { 3, 3, 1, 2, 2, 1, 1, 1, 0 };
const int DIAGOFFDLX[] = { 4, 5, 3, 3, 5, 4, 6, 1, 0 };
const int DIAGOFFDLY[] = { 2, 2, 1, 2, 3, 1, 2, 1, 0 };
-const byte MOUSE0[] = {
- // hotspot x and y, uint16 LE
- 0, 0, 0, 0,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0, 2, 6, 1,
- 0, 3, 6, 6, 1,
- 0, 3, 6, 6, 1,
- 0, 4, 6, 6, 6, 1,
- 0, 4, 6, 6, 6, 1,
- 0, 5, 6, 6, 6, 6, 1,
- 0, 5, 6, 6, 6, 6, 1,
- 0, 6, 6, 6, 6, 6, 6, 1,
- 0, 6, 6, 6, 6, 6, 6, 1,
- 0, 7, 6, 6, 6, 6, 6, 6, 1,
- 0, 6, 6, 6, 6, 6, 6, 1,
- 0, 5, 6, 6, 6, 6, 1,
- 2, 3, 6, 6, 1,
- 3, 3, 6, 6, 1,
- 3, 3, 6, 6, 1,
- 4, 2, 6, 1
-};
-
-const byte MOUSE1[] = {
- // hotspot x and y, uint16 LE
- 0x07, 0x00, 0x07, 0x00,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0x06, 0x01, 0x05,
- 0x04, 0x05, 0xFF, 0xFF, 0x00, 0xFF, 0xFF,
- 0x03, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
- 0x02, 0x09, 0xFF, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xFF,
- 0x01, 0x0B, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
- 0x01, 0x0B, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0xFF,
- 0x00, 0x0D, 0x05, 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00, 0x05, 0x00, 0x00, 0x05,
- 0x01, 0x0B, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0xFF,
- 0x01, 0x0B, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
- 0x02, 0x09, 0xFF, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0xFF,
- 0x03, 0x07, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
- 0x04, 0x05, 0xFF, 0xFF, 0x00, 0xFF, 0xFF,
- 0x06, 0x01, 0x05,
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x00
-};
-
-const byte MOUSE2[] = {
- // hotspot x and y, uint16 LE
- 0x08, 0x00, 0x08, 0x00,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0x00, 0x00,
- 0x00, 0x00,
- 0x07, 0x02, 0x04, 0x05,
- 0x07, 0x02, 0x04, 0x05,
- 0x07, 0x02, 0x04, 0x05,
- 0x07, 0x02, 0x04, 0x05,
- 0x07, 0x02, 0x04, 0x05,
- 0x02, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x04, 0x00, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05,
- 0x07, 0x02, 0x04, 0x05,
- 0x07, 0x02, 0x04, 0x05,
- 0x07, 0x02, 0x04, 0x05,
- 0x07, 0x02, 0x04, 0x05,
- 0x07, 0x02, 0x04, 0x05,
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x00
-};
-
-const byte MOUSE3[] = {
- // hotspot x and y, uint16 LE
- 0x00, 0x00, 0x00, 0x00,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0x00, 0x0B, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x00, 0x0C, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06, 0x05,
- 0x00, 0x0C, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x05, 0x05,
- 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
- 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
- 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x05, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x05,
- 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
- 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
- 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
- 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
- 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
- 0x00, 0x0C, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x05,
- 0x01, 0x0B, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05,
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x00
-};
-const byte CURSEYE[] = {
- // hotspot x and y, uint16 LE
- 0x01, 0x00, 0x08, 0x00,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0x04, 0x06, 0x0E, 0x0D, 0x0D, 0x0D, 0x0D, 0x0D,
- 0x03, 0x09, 0x0E, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x0D, 0x0D,
- 0x02, 0x0B, 0x0E, 0x01, 0x33, 0x33, 0x01, 0x01, 0x33, 0x34, 0x01, 0x01, 0x0D,
- 0x01, 0x0D, 0x0E, 0x01, 0x04, 0x34, 0x01, 0x01, 0x01, 0x07, 0x33, 0x04, 0x04, 0x01, 0x0D,
- 0x00, 0x0F, 0x0E, 0x0E, 0x01, 0x07, 0x33, 0x33, 0x01, 0x01, 0x33, 0x34, 0x07, 0x07, 0x06, 0x01, 0x0E,
- 0x01, 0x0D, 0x0F, 0x0F, 0x06, 0x07, 0x34, 0x33, 0x33, 0x34, 0x07, 0x07, 0x06, 0x0F, 0x0E,
- 0x03, 0x09, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0E,
- 0x01, 0x01, 0x07,
- 0x00, 0x03, 0x07, 0x01, 0x07,
- 0x01, 0x01, 0x07,
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x00
-};
-
-const byte CURSHAND[] = {
- // hotspot x and y, uint16 LE
- 0x02, 0x00, 0x03, 0x00,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0x07, 0x02, 0x17, 0x0E,
- 0x05, 0x07, 0x0E, 0x12, 0x17, 0x0E, 0x13, 0x17, 0x0E,
- 0x02, 0x0C, 0x07, 0x00, 0x17, 0x0E, 0x11, 0x0F, 0x0E, 0x11, 0x17, 0x0E, 0x00, 0x17,
- 0x01, 0x0E, 0x07, 0x01, 0x07, 0x0F, 0x0E, 0x11, 0x17, 0x0E, 0x11, 0x0F, 0x0E, 0x12, 0x17, 0x0E,
- 0x02, 0x0D, 0x07, 0x00, 0x17, 0x0F, 0x12, 0x0F, 0x0F, 0x11, 0x17, 0x0E, 0x12, 0x0F, 0x0E,
- 0x04, 0x0B, 0x0F, 0x0E, 0x11, 0x17, 0x0E, 0x12, 0x0F, 0x0F, 0x11, 0x17, 0x0E,
- 0x04, 0x0B, 0x17, 0x0E, 0x12, 0x17, 0x0E, 0x12, 0x17, 0x0E, 0x11, 0x0F, 0x0E,
- 0x00, 0x0F, 0x0E, 0x0D, 0x12, 0x00, 0x17, 0x0F, 0x0F, 0x0F, 0x0F, 0x12, 0x0F, 0x0E, 0x12, 0x17, 0x0F,
- 0x00, 0x0F, 0x0F, 0x17, 0x0D, 0x11, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0D,
- 0x01, 0x0E, 0x0F, 0x17, 0x0F, 0x0E, 0x0F, 0x0D, 0x0D, 0x0D, 0x0D, 0x0E, 0x0F, 0x0F, 0x0E, 0x0D,
- 0x02, 0x0D, 0x0F, 0x17, 0x0F, 0x0E, 0x0D, 0x0D, 0x0F, 0x0F, 0x0E, 0x0F, 0x0E, 0x0E, 0x12,
- 0x03, 0x0C, 0x0F, 0x17, 0x0F, 0x0F, 0x0F, 0x0E, 0x0F, 0x0F, 0x0F, 0x0E, 0x0D, 0x12,
- 0x04, 0x0A, 0x0F, 0x17, 0x0F, 0x0F, 0x0F, 0x0E, 0x0F, 0x0F, 0x0E, 0x0D,
- 0x05, 0x09, 0x0F, 0x17, 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0D, 0x12,
- 0x06, 0x08, 0x17, 0x0F, 0x0F, 0x0F, 0x0F, 0x0E, 0x0D, 0x12,
- 0x06, 0x07, 0x17, 0x0F, 0x0F, 0x0F, 0x3D, 0x0E, 0x0D
-};
-
-const byte CURSGET[] = {
- // hotspot x and y, uint16 LE
- 0x07, 0x00, 0x0E, 0x00,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0x0A, 0x05, 0x1C, 0x07, 0x0F, 0x0F, 0x0F,
- 0x08, 0x08, 0x1C, 0x07, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
- 0x06, 0x0A, 0x1C, 0x07, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
- 0x05, 0x0A, 0x07, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
- 0x03, 0x0C, 0x07, 0x1C, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
- 0x02, 0x0D, 0x1C, 0x0F, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
- 0x01, 0x0E, 0x07, 0x0F, 0x0E, 0x0D, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
- 0x00, 0x0F, 0x1C, 0x0F, 0x0E, 0x0D, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x0C,
- 0x00, 0x0F, 0x1C, 0x0E, 0x0D, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0C, 0x0C, 0x0E, 0x0F, 0x0F, 0x0F, 0x0C,
- 0x00, 0x0E, 0x1C, 0x0D, 0x0F, 0x0E, 0x0D, 0x0F, 0x0F, 0x0C, 0x00, 0x00, 0x0E, 0x0F, 0x0F, 0x0C,
- 0x00, 0x0E, 0x1C, 0x0E, 0x0F, 0x0D, 0x0F, 0x0F, 0x0C, 0x00, 0x00, 0x0E, 0x1C, 0x0F, 0x0F, 0x0C,
- 0x00, 0x0D, 0x1C, 0x0D, 0x0F, 0x0D, 0x0F, 0x0C, 0x00, 0x00, 0x00, 0x0E, 0x1C, 0x0F, 0x0C,
- 0x01, 0x0B, 0x0E, 0x0F, 0x0E, 0x0F, 0x0C, 0x00, 0x00, 0x0E, 0x07, 0x0F, 0x0C,
- 0x02, 0x09, 0x0E, 0x0D, 0x0F, 0x0C, 0x00, 0x07, 0x0E, 0x0F, 0x0C,
- 0x03, 0x06, 0x0E, 0x0F, 0x0E, 0x07, 0x01, 0x07,
- 0x07, 0x01, 0x07
-};
-
-const byte CURSCLIMB[] = {
- // hotspot x and y, uint16 LE
- 0x03, 0x00, 0x0E, 0x00,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0x06, 0x04, 0x01, 0x01, 0x01, 0x01,
- 0x06, 0x04, 0x0F, 0x0E, 0x01, 0x01,
- 0x06, 0x04, 0x0F, 0x0E, 0x0D, 0x01,
- 0x07, 0x02, 0x0F, 0x0D,
- 0x00, 0x0C, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x13, 0x12, 0x12, 0x12, 0x12, 0x11, 0x11,
- 0x00, 0x0D, 0x0D, 0x0E, 0x00, 0x00, 0x13, 0x14, 0x13, 0x12, 0x12, 0x12, 0x11, 0x11, 0x0E,
- 0x01, 0x0C, 0x0D, 0x0D, 0x0D, 0x0E, 0x11, 0x13, 0x13, 0x12, 0x11, 0x11, 0x0E, 0x0D,
- 0x02, 0x0C, 0x0E, 0x0E, 0x00, 0x00, 0x00, 0x13, 0x12, 0x11, 0x00, 0x00, 0x0E, 0x0D,
- 0x03, 0x0B, 0x04, 0x04, 0x04, 0x22, 0x21, 0x21, 0x20, 0x00, 0x00, 0x00, 0x0D,
- 0x02, 0x0D, 0x22, 0x04, 0x20, 0x22, 0x04, 0x21, 0x04, 0x20, 0x00, 0x00, 0x00, 0x0E, 0x0E,
- 0x03, 0x07, 0x22, 0x21, 0x20, 0x20, 0x22, 0x04, 0x20,
- 0x04, 0x06, 0x01, 0x01, 0x00, 0x04, 0x22, 0x20,
- 0x02, 0x09, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x04, 0x20,
- 0x03, 0x09, 0x07, 0x01, 0x01, 0x00, 0x00, 0x00, 0x22, 0x04, 0x20,
- 0x02, 0x0B, 0x07, 0x01, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x20,
- 0x03, 0x0A, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01
-};
-
-const byte CURSTALK[] = {
- // hotspot x and y, uint16 LE
- 0x02, 0x00, 0x0B, 0x00,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0x03, 0x08, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x01, 0x0C, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06,
- 0x00, 0x0E, 0x06, 0x06, 0x06, 0x06, 0x07, 0x06, 0x07, 0x07, 0x06, 0x07, 0x07, 0x06, 0x07, 0x06,
- 0x00, 0x0F, 0x06, 0x08, 0x08, 0x08, 0x06, 0x08, 0x06, 0x06, 0x08, 0x06, 0x06, 0x08, 0x06, 0x08, 0x06,
- 0x00, 0x0F, 0x06, 0x06, 0x08, 0x06, 0x08, 0x06, 0x08, 0x06, 0x08, 0x06, 0x06, 0x08, 0x08, 0x06, 0x06,
- 0x00, 0x0F, 0x06, 0x06, 0x08, 0x06, 0x08, 0x08, 0x08, 0x06, 0x08, 0x06, 0x06, 0x08, 0x06, 0x08, 0x06,
- 0x01, 0x0E, 0x06, 0x08, 0x06, 0x08, 0x06, 0x08, 0x06, 0x08, 0x08, 0x06, 0x08, 0x06, 0x08, 0x06,
- 0x02, 0x0C, 0x06, 0x06, 0x06, 0x07, 0x06, 0x07, 0x06, 0x06, 0x07, 0x06, 0x07, 0x06,
- 0x04, 0x09, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x06, 0x06,
- 0x07, 0x04, 0x06, 0x07, 0x07, 0x06,
- 0x02, 0x08, 0x07, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x06,
- 0x01, 0x06, 0x07, 0x01, 0x07, 0x06, 0x06, 0x06,
- 0x02, 0x01, 0x07,
- 0x00, 0x00,
- 0x00, 0x00,
- 0x00, 0x00
-};
-const byte CURSHELP[] = {
- // hotspot x and y, uint16 LE
- 0x02, 0x00, 0x0B, 0x00,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0x04, 0x06, 0x24, 0x24, 0x24, 0x24, 0x24, 0x24,
- 0x02, 0x0A, 0x24, 0x24, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x20, 0x20,
- 0x01, 0x0C, 0x24, 0x22, 0x22, 0x22, 0x20, 0x20, 0x20, 0x22, 0x22, 0x22, 0x22, 0x20,
- 0x00, 0x0E, 0x24, 0x22, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20,
- 0x00, 0x0E, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x24, 0x22, 0x22, 0x22, 0x20,
- 0x00, 0x0E, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, 0x00, 0x00, 0x00, 0x24, 0x22, 0x22, 0x22, 0x20,
- 0x01, 0x0D, 0x24, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20,
- 0x07, 0x06, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20,
- 0x05, 0x07, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20, 0x20,
- 0x04, 0x05, 0x24, 0x22, 0x22, 0x22, 0x20,
- 0x02, 0x07, 0x07, 0x00, 0x24, 0x20, 0x20, 0x20, 0x20,
- 0x01, 0x03, 0x07, 0x01, 0x07,
- 0x02, 0x07, 0x07, 0x00, 0x00, 0x24, 0x24, 0x24, 0x24,
- 0x04, 0x06, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20,
- 0x04, 0x06, 0x24, 0x22, 0x22, 0x22, 0x22, 0x20,
- 0x05, 0x04, 0x20, 0x20, 0x20, 0x20
-};
-const byte *const CURSORS[10] = {
- MOUSE0, MOUSE1, MOUSE2, MOUSE3, CURSEYE, CURSHAND, CURSGET, CURSCLIMB, CURSTALK, CURSHELP
-};
-
-const int _travelPos[][2] = {
- { -1, 0 },
- { 228, 117 },
- { 28, 98 },
- { 161, 140 },
- { 130, 139 },
- { 884, 95 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 41, 185 },
- { 60, 138 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 170, 155 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 108, 95 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 100, 115 },
- { 480, 90 },
- { 154, 63 },
- { 0, 0 },
- { 145, 85 },
- { 0, 0 },
- { 110, 107 },
- { 0, 0 },
- { 105, 154 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 20, 160 },
- { 130, 314 },
- { 0, 0 },
- { 50, 125 },
- { 0, 0 },
- { 0, 0 },
- { 123, 123 },
- { -1, 7 },
- { 266, 168 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { -1, 18 },
- { -1, 19 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 203, 160 },
- { 0, 0 },
- { 283, 163 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 },
- { 180, 165 },
- { 0, 0 },
- { 0, 0 },
- { 0, 0 }
-};
-
const int OVEROFFR[] = { 2, 2, 1, 2, 2, 1, 0, 0, 0 };
const int OVEROFFL[] = { 2, 2, 1, 2, 2, 1, 0, 0, 0 };
const int OVEROFFU[] = { 1, 1, 1, 1, 1, 1, 0, 0, 0 };
@@ -408,1528 +108,6 @@ const int OVEROFFULY[] = { 1, 0, 0, 2, 1, 0, 0, 0, 0 };
const int OVEROFFDLX[] = { 1, 2, 1, 1, 2, 1, 0, 0, 0 };
const int OVEROFFDLY[] = { 0, 1, 0, 0, 1, 1, 0, 0, 0 };
-const byte CREDITS[] = {
- 0x2, 0xFF, 0xFF, 0x61, 0x0, 0x3, 0x0, 0x30, 0x22, 0x30, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0x0, 0x0, 0xFF, 0xFF,
- 0x0, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ALLISTER[] = {
- 0x0, 0xFF, 0xFF, 0x61, 0x0, 0x0, 0x0, 0x36, 0x0F, 0x5E, 0x4, 0x0, 0x0,
- 0x0, 0x4, 0x4, 0x0, 0x3, 0x0, 0xFF, 0x4, 0x0, 0x2, 0x0, 0x4, 0x0, 0x1, 0x0, 0x8C,
- 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x0, 0x0, 0x0,
- 0x1, 0x0, 0x62, 0x0, 0x0B, 0x0, 0x1, 0x0, 0x62, 0x0, 0x0C, 0x0, 0x1, 0x0, 0x62,
- 0x0, 0x0D, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte HALL[] = {
- 0x0, 0xFF, 0xFF, 0x61, 0x0, 0x0, 0x0, 0x40, 0x3E, 0x1A, 0x5, 0x0, 0x0,
- 0x0, 0x5, 0x5, 0x0, 0x3, 0x0, 0xFF, 0x5, 0x0, 0x2, 0x0, 0x5, 0x0, 0x1, 0x0, 0xFF,
- 0x30, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x0, 0x0,
- 0x0, 0x2, 0x0, 0x62, 0x0, 0x0D, 0x0, 0x1, 0x0, 0x62, 0x0, 0x13, 0x0, 0x1, 0x0,
- 0x62, 0x0, 0x14, 0x0, 0x2, 0x0, 0x62, 0x0, 0x4, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte JASONLAB[] = {
- 0x1, 0x6, 0x0, 0x61, 0x0, 0x0D, 0x0, 0x40, 0x20, 0x0C4, 0x6, 0x0, 0x0, 0x0,
- 0x6, 0x6, 0x0, 0x3, 0x0, 0xFF, 0x6, 0x0, 0x2, 0x0, 0x6, 0x0, 0x1, 0x0, 0xFF, 0x0,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x0, 0x0, 0x0, 0x1,
- 0x0, 0x62, 0x0, 0x1, 0x0, 0x1, 0x0, 0x62, 0x0, 0x2, 0x0, 0x1, 0x0, 0x62, 0x0, 0x3,
- 0x0, 0x2, 0x0, 0x62, 0x0, 0x26, 0x0, 0x1, 0x0, 0x62, 0x0, 0x0D, 0x0, 0x1, 0x0,
- 0x62, 0x0, 0x35, 0x0, 0x2, 0x0, 0xFF, 0xFF
-};
-
-const byte ALLENLAB[] = {
- 0x1, 0x8, 0x0, 0x61, 0x0, 0x0D, 0x0, 0x40, 0x20, 0x0C4, 0x8, 0x0, 0x0, 0x0,
- 0x8, 0x8, 0x0, 0x3, 0x0, 0xFF, 0x8, 0x0, 0x2, 0x0, 0x8, 0x0, 0x1, 0x0, 0xFF, 0x0,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x0, 0x0, 0x0, 0x1,
- 0x0, 0x62, 0x0, 0x7, 0x0, 0x1, 0x0, 0x62, 0x0, 0x8, 0x0, 0x2, 0x0, 0x62, 0x0, 0x9,
- 0x0, 0x1, 0x0, 0x62, 0x0, 0x0A, 0x0, 0x1, 0x0, 0x62, 0x0, 0x0D, 0x0, 0x1, 0x0,
- 0xFF, 0xFF
-};
-
-const byte OUTVAULT[] = {
- 0x0, 0x9, 0x0, 0x61, 0x0, 0x2B, 0x0, 0x30, 0x18, 0x9B, 0x9, 0x0, 0x0, 0x0,
- 0x9, 0x9, 0x0, 0x3, 0x0, 0xFF, 0x9, 0x0, 0x2, 0x0, 0x9, 0x0, 0x1, 0x0, 0x0B4, 0x10,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x0, 0x0, 0x0, 0x3,
- 0x0, 0x62, 0x0, 0x4, 0x0, 0x1, 0x0, 0x62, 0x0, 0x5, 0x0, 0x2, 0x0, 0x62, 0x0, 0x6,
- 0x0, 0x2, 0x0, 0x62, 0x0, 0x36, 0x0, 0x1, 0x0, 0x62, 0x0, 0x47, 0x0, 0x1, 0x0,
- 0xFF, 0xFF
-};
-
-const byte VAULT[] = {
- 0x0, 0xFF, 0xFF, 0x61, 0x0, 0x29, 0x0, 0x40, 0x3A, 0x37, 0x0A, 0x0,
- 0x0, 0x0, 0x0A, 0x0A, 0x0, 0x3, 0x0, 0xFF, 0x0A, 0x0, 0x2, 0x0, 0x0A, 0x0,
- 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x0, 0x0, 0x1, 0x0, 0x62, 0x0, 0x37, 0x0, 0x2, 0x0, 0x62, 0x0, 0x39, 0x0,
- 0x1, 0x0, 0x62, 0x0, 0x38, 0x0, 0x2, 0x0, 0x62, 0x0, 0x15, 0x0, 0x2, 0x0, 0xFF,
- 0xFF
-};
-
-const byte LIBRARY[] = {
- 0x1, 0xFF, 0xFF, 0x61, 0x0, 0x0C, 0x0, 0x40, 0x3A, 0x22, 0x0B, 0x0,
- 0x0, 0x0, 0x0B, 0x0B, 0x0, 0x3, 0x0, 0xFF, 0x0B, 0x0, 0x2, 0x0, 0x0B, 0x0,
- 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x0, 0x0, 0x1, 0x0, 0x62, 0x0, 0x1, 0x0, 0x1, 0x0, 0xFF, 0xFF,
-};
-
-const byte JASAPT[] = {
- 0x1, 0x0C, 0x0, 0x61, 0x0, 0x19, 0x0, 0x40, 0x30, 0x14, 0x0C, 0x0, 0x0,
- 0x0, 0x0C, 0x0C, 0x0, 0x3, 0x0, 0xFF, 0x0C, 0x0, 0x2, 0x0, 0x0C, 0x0, 0x1,
- 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x18, 0x0, 0x2, 0x0, 0x62, 0x0, 0x17, 0x0, 0x1, 0x0, 0x62, 0x0, 0x11,
- 0x0, 0x1, 0x0, 0x62, 0x0, 0x0D, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte RANSACKED[] = {
- 0x1, 0x0D, 0x0, 0x61, 0x0, 0x2D, 0x0, 0x40, 0x36, 0x2C, 0x0D, 0x0, 0x0,
- 0x0, 0x0D, 0x0D, 0x0, 0x3, 0x0, 0xFF, 0x0D, 0x0, 0x2, 0x0, 0x0D, 0x0, 0x1,
- 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x17, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte MEAN1[] = {
- 0x1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x3E, 0x33,
- 0xFF, 0xFF, 0x0, 0x0, 0xFF, 0x0E, 0x0, 0x5, 0x0, 0x0E, 0x0, 0x4, 0x0,
- 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte FLYSOUTH[] = {
- 0x1, 0xFF, 0xFF, 0x61, 0x0, 0x10, 0x0, 0x28, 0x0C, 0x5E, 0x0F, 0x0,
- 0x0, 0x0, 0x0F, 0x0F, 0x0, 0x2, 0x0, 0xFF, 0x0F, 0x0, 0x1, 0x0, 0xFF, 0xFF,
- 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x44, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte CUZCO[] = {
- 0x2, 0x10, 0x0, 0x61, 0x0, 0x10, 0x0, 0x40, 0x20, 0x30, 0x10, 0x0, 0x0,
- 0x0, 0x10, 0x10, 0x0, 0x3, 0x0, 0xFF, 0x10, 0x0, 0x2, 0x0, 0x10, 0x0, 0x1,
- 0x0, 0x6E, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x0, 0x0, 0x2, 0x0, 0x62, 0x0, 0x44, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte INAIR[] = {
- 0x1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x28, 0x19, 0x2B,
- 0x11, 0x0, 0x0, 0x0, 0x11, 0x11, 0x0, 0x3, 0x0, 0xFF, 0x11, 0x0, 0x2, 0x0,
- 0x11, 0x0, 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF
-};
-
-const byte GREENMONKEY[] = {
- 0x1, 0xFF, 0xFF, 0x61, 0x0, 0x11, 0x0, 0x2D, 0x14, 0x3C, 0x12, 0x0,
- 0x0, 0x0, 0x12, 0x12, 0x0, 0x3, 0x0, 0xFF, 0x12, 0x0, 0x2, 0x0, 0x12, 0x0,
- 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte INPLANE[] = {
- 0x2, 0x13, 0x0, 0x61, 0x0, 0x26, 0x0, 0x2D, 0x28, 0x28, 0x13, 0x0, 0x0,
- 0x0, 0x13, 0x13, 0x0, 0x3, 0x0, 0xFF, 0x13, 0x0, 0x2, 0x0, 0x13, 0x0, 0x1,
- 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x0, 0x0, 0x0,
- 0x2, 0x0, 0x62, 0x0, 0x29, 0x0, 0x2, 0x0, 0x62, 0x0, 0x1F, 0x0, 0x1, 0x0,
- 0x62, 0x0, 0x38, 0x0, 0x2, 0x0, 0x62, 0x0, 0x33, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte PILFALL[] = {
- 0x1, 0xFF, 0xFF, 0x61, 0x0, 0x16, 0x0, 0x28, 0x0C, 0x5E, 0x14, 0x0,
- 0x0, 0x0, 0x14, 0x14, 0x0, 0x2, 0x0, 0xFF, 0x14, 0x0, 0x1, 0x0, 0xFF, 0xFF,
- 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x3A, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte COCKPIT[] = {
- 0x1, 0xFF, 0xFF, 0x61, 0x0, 0x12, 0x0, 0x3C, 0x2A, 0x29, 0x15, 0x0,
- 0x0, 0x0, 0x15, 0x15, 0x0, 0x3, 0x0, 0xFF, 0x15, 0x0, 0x2, 0x0, 0x15, 0x0,
- 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x23, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte CRASH[] = {
- 0x1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x2D, 0x64,
- 0x16, 0x0, 0x0, 0x0, 0xFF, 0x16, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0x0, 0x0,
- 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x16, 0x0, 0x2, 0x0, 0xFF,
- 0xFF, 0x62, 0x0, 0x2A, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte SINKING[] = {
- 0x2, 0xFF, 0xFF, 0x61, 0x0, 0x14, 0x0, 0x40, 0x3C, 0x19, 0x17, 0x0,
- 0x0, 0x0, 0x17, 0x17, 0x0, 0x3, 0x0, 0xFF, 0x17, 0x0, 0x2, 0x0, 0x17, 0x0,
- 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x0, 0x0, 0x1, 0x0, 0x62, 0x0, 0x48, 0x0, 0x1, 0x0, 0x62, 0x0, 0x17, 0x0,
- 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte JNGLWLK[] = {
- 0x2, 0xFF, 0xFF, 0x61, 0x0, 0x17, 0x0, 0x40, 0x3F, 0x5A, 0x18, 0x0,
- 0x0, 0x0, 0x18, 0x18, 0x0, 0x2, 0x0, 0xFF, 0x18, 0x0, 0x1, 0x0, 0xFF, 0xFF,
- 0x0, 0x0, 0x0DC, 0x0A0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x62, 0x0, 0x0, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte TOWN[] = {
- 0x2, 0x19, 0x0, 0x61, 0x0, 0x18, 0x0, 0x3E, 0x32, 0x80, 0x19, 0x0, 0x0,
- 0x0, 0x19, 0x19, 0x0, 0x3, 0x0, 0xFF, 0x19, 0x0, 0x2, 0x0, 0x19, 0x0, 0x1,
- 0x0, 0x64, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x0, 0x0, 0x1, 0x0, 0x62, 0x0, 0x3D, 0x0, 0x1, 0x0, 0x62, 0x0, 0x3B, 0x0,
- 0x2, 0x0, 0xFF, 0xFF
-};
-
-const byte HOTEL[] = {
- 0x1, 0xFF, 0xFF, 0x61, 0x0, 0x19, 0x0, 0x34, 0x28, 0x28, 0x1A, 0x0,
- 0x0, 0x0, 0x1A, 0x1A, 0x0, 0x3, 0x0, 0xFF, 0x1A, 0x0, 0x2, 0x0, 0x1A, 0x0,
- 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x28, 0x0, 0x1, 0x0, 0x62, 0x0, 0x2B, 0x0, 0x1, 0x0, 0x62, 0x0, 0x46,
- 0x0, 0x2, 0x0, 0x62, 0x0, 0x45, 0x0, 0x1, 0x0, 0x62, 0x0, 0x0E, 0x0, 0x1, 0x0,
- 0xFF, 0xFF
-};
-
-const byte CANTINA[] = {
- 0x2, 0xFF, 0xFF, 0x61, 0x0, 0x27, 0x0, 0x40, 0x3A, 0x6C, 0x1B, 0x0,
- 0x0, 0x0, 0x1B, 0x1B, 0x0, 0x3, 0x0, 0xFF, 0x1B, 0x0, 0x2, 0x0, 0x1B, 0x0,
- 0x1, 0x0, 0x0C8, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x0, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte MASSACRE[] = {
- 0x2, 0x1D, 0x0, 0x61, 0x0, 0x32, 0x0, 0x20, 0x18, 0x73, 0x1D, 0x0, 0x0,
- 0x0, 0x1D, 0x1D, 0x0, 0x3, 0x0, 0xFF, 0x1D, 0x0, 0x2, 0x0, 0x1D, 0x0, 0x1,
- 0x0, 0x96, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x0, 0x0, 0x1, 0x0, 0x62, 0x0, 0x0C, 0x0, 0x1, 0x0, 0x62, 0x0, 0x3, 0x0, 0x2,
- 0x0, 0x62, 0x0, 0x49, 0x0, 0x2, 0x0, 0x62, 0x0, 0x4A, 0x0, 0x2, 0x0, 0xFF, 0xFF
-};
-
-const byte TRADE[] = {
- 0x1, 0xFF, 0xFF, 0x61, 0x0, 0x18, 0x0, 0x3F, 0x1C, 0x27, 0x1E, 0x0,
- 0x0, 0x0, 0x1E, 0x1E, 0x0, 0x3, 0x0, 0xFF, 0x1E, 0x0, 0x2, 0x0, 0x1E, 0x0,
- 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte BRIDGE[] = {
- 0x2, 0x1F, 0x0, 0x61, 0x0, 0x1B, 0x0, 0x40, 0x3F, 0x78, 0x1F, 0x0, 0x0,
- 0x0, 0x1F, 0x1F, 0x0, 0x3, 0x0, 0xFF, 0x1F, 0x0, 0x2, 0x0, 0x1F, 0x0, 0x1,
- 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x0, 0x0, 0x2, 0x0, 0x62, 0x0, 0x1F, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte DOCK[] = {
- 0x1, 0xFF, 0xFF, 0x61, 0x0, 0x1E, 0x0, 0x40, 0x3B, 0x4B, 0x20, 0x0,
- 0x0, 0x0, 0xFF, 0x20, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0x1, 0x0, 0xFF, 0x0,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte DRIVER[] = {
- 0x1, 0x21, 0x0, 0x61, 0x0, 0x28, 0x0, 0x30, 0x10, 0x51, 0x21, 0x0, 0x0,
- 0x0, 0x21, 0x21, 0x0, 0x2, 0x0, 0xFF, 0x21, 0x0, 0x1, 0x0, 0xFF, 0xFF,
- 0x0, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x2E, 0x0, 0x1, 0x0, 0x62, 0x0, 0x2F, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte SHORE[] = {
- 0x2, 0x24, 0x0, 0x61, 0x0, 0x4, 0x0, 0x3E, 0x3A, 0x32, 0x24, 0x0, 0x0, 0x0,
- 0x24, 0x24, 0x0, 0x3, 0x0, 0xFF, 0x24, 0x0, 0x2, 0x0, 0x24, 0x0, 0x1, 0x0,
- 0x0B4, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x0,
- 0x2D, 0x0, 0x2, 0x0, 0x62, 0x0, 0x1F, 0x0, 0x1, 0x0, 0x62, 0x0, 0x2E, 0x0,
- 0x1, 0x0, 0x62, 0x0, 0x2F, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte BOAT[] = {
- 0x3, 0xFF, 0xFF, 0x61, 0x0, 0x8, 0x0, 0x3F, 0x3F, 0xFF, 0x25, 0x0,
- 0x0, 0x0, 0x25, 0x25, 0x0, 0x3, 0x0, 0xFF, 0x25, 0x0, 0x2, 0x0, 0x25, 0x0,
- 0x1, 0x0, 0xFF, 0x40, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x62, 0x0, 0x0, 0x0, 0x2, 0x0, 0x62, 0x0, 0x21, 0x0, 0x1, 0x0, 0x62, 0x0, 0x25,
- 0x0, 0x1, 0x0, 0x62, 0x0, 0x1F, 0x0, 0x1, 0x0, 0x62, 0x0, 0x30, 0x0, 0x1, 0x0,
- 0x62, 0x0, 0x32, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte CABIN[] = {
- 0x1, 0xFF, 0xFF, 0x61, 0x0, 0x8, 0x0, 0x40, 0x32, 0x50, 0x26, 0x0,
- 0x0, 0x0, 0x26, 0x26, 0x0, 0x3, 0x0, 0xFF, 0x26, 0x0, 0x2, 0x0, 0x26, 0x0,
- 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x0, 0x0, 0x1, 0x0, 0x62, 0x0, 0x22, 0x0, 0x2, 0x0, 0x62, 0x0, 0x31, 0x0,
- 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte CAPTIVE[] = {
- 0x2, 0x27, 0x0, 0x61, 0x0, 0x9, 0x0, 0x40, 0x3F, 0x37, 0x27, 0x0, 0x0, 0x0,
- 0x27, 0x27, 0x0, 0x3, 0x0, 0xFF, 0x27, 0x0, 0x2, 0x0, 0x27, 0x0, 0x1, 0x0,
- 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x0,
- 0x0, 0x0, 0x4, 0x0, 0x62, 0x0, 0x1B, 0x0, 0x3, 0x0, 0x62, 0x0, 0x1C, 0x0, 0x1,
- 0x0, 0x62, 0x0, 0x1F, 0x0, 0x2, 0x0, 0x62, 0x0, 0x23, 0x0, 0x1, 0x0, 0x62,
- 0x0, 0x32, 0x0, 0x1, 0x0, 0x62, 0x0, 0x33, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte VILLAGE[] = {
- 0x2, 0x2A, 0x0, 0x61, 0x0, 0x2E, 0x0, 0x1E, 0x1B, 0x6E, 0x2A, 0x0, 0x0,
- 0x0, 0x2A, 0x2A, 0x0, 0x3, 0x0, 0xFF, 0x2A, 0x0, 0x2, 0x0, 0x2A, 0x0, 0x1,
- 0x0, 0x0A5, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x2D, 0x0, 0x3, 0x0, 0x62, 0x0, 0x3F, 0x0, 0x1, 0x0, 0x62, 0x0, 0x40,
- 0x0, 0x2, 0x0, 0xFF, 0xFF
-};
-
-const byte TREE[] = {
- 0x2, 0x2C, 0x0, 0x61, 0x0, 0x31, 0x0, 0x1E, 0x1D, 0x0BE, 0x2C, 0x0, 0x0,
- 0x0, 0x2C, 0x2C, 0x0, 0x3, 0x0, 0xFF, 0x2C, 0x0, 0x2, 0x0, 0x2C, 0x0, 0x1,
- 0x0, 0x50, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x0, 0x0, 0x2, 0x0, 0x62, 0x0, 0x2E, 0x0, 0x1, 0x0, 0x62, 0x0, 0x2F, 0x0,
- 0x1, 0x0, 0x62, 0x0, 0x4, 0x0, 0x1, 0x0, 0x62, 0x0, 0x42, 0x0, 0x1, 0x0, 0xFF,
- 0xFF
-};
-
-const byte CANOE[] = {
- 0x1, 0x2D, 0x0, 0x61, 0x0, 0x2F, 0x0, 0x1E, 0x1D, 0x78, 0x2D, 0x0, 0x0,
- 0x0, 0x2D, 0x2D, 0x0, 0x3, 0x0, 0xFF, 0x2D, 0x0, 0x2, 0x0, 0x2D, 0x0, 0x1,
- 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x40, 0x0, 0x3, 0x0, 0x62, 0x0, 0x41, 0x0, 0x2, 0x0, 0x62, 0x0, 0x2E,
- 0x0, 0x2, 0x0, 0x62, 0x0, 0x2F, 0x0, 0x2, 0x0, 0x62, 0x0, 0x16, 0x0, 0x1, 0x0,
- 0xFF, 0xFF
-};
-
-const byte INTREE[] = {
- 0x1, 0xFF, 0xFF, 0x61, 0x0, 0x33, 0x0, 0x28, 0x1E, 0x32, 0x2E, 0x0,
- 0x0, 0x0, 0x2E, 0x2E, 0x0, 0x3, 0x0, 0xFF, 0x2E, 0x0, 0x2, 0x0, 0x2E, 0x0,
- 0x1, 0x0, 0x0F0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte FALLS[] = {
- 0x1, 0xFF, 0xFF, 0x61, 0x0, 0x3B, 0x0, 0x28, 0x1E, 0x32, 0x2F, 0x0,
- 0x0, 0x0, 0x2F, 0x2F, 0x0, 0x3, 0x0, 0xFF, 0x2F, 0x0, 0x2, 0x0, 0x2F, 0x0,
- 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x4, 0x0, 0x1, 0x0, 0x62, 0x0, 0x2A, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte WATERFALL[] = {
- 0x1, 0x36, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x28, 0x1E, 0x6E, 0x36,
- 0x0, 0x0, 0x0, 0x36, 0x36, 0x0, 0x3, 0x0, 0xFF, 0x36, 0x0, 0x2, 0x0, 0x36,
- 0x0, 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x36, 0x0, 0x4,
- 0x0, 0xFF, 0xFF, 0x62, 0x0, 0x1F, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte INWATER[] = {
- 0x2, 0xFF, 0xFF, 0x61, 0x0, 0x36, 0x0, 0x40, 0x3F, 0x2A, 0x37, 0x0,
- 0x0, 0x0, 0x37, 0x37, 0x0, 0x3, 0x0, 0xFF, 0x37, 0x0, 0x2, 0x0, 0x37, 0x0,
- 0x1, 0x0, 0xFF, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x0, 0x0, 0x1, 0x0, 0x62, 0x0, 0x38, 0x0, 0x1, 0x0, 0xFF, 0xFF
-};
-
-const byte CAVE[] = {
- 0x2, 0x39, 0x0, 0x61, 0x0, 0x37, 0x0, 0x32, 0x14, 0x73, 0x39, 0x0, 0x0,
- 0x0, 0x39, 0x39, 0x0, 0x3, 0x0, 0xFF, 0x39, 0x0, 0x2, 0x0, 0x39, 0x0, 0x1,
- 0x0, 0x0B4, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x0, 0x0, 0x0, 0x1, 0x0, 0x62, 0x0, 0x1F, 0x0, 0x1, 0x0, 0x62, 0x0, 0x4B, 0x0,
- 0x2, 0x0, 0x62, 0x0, 0x4C, 0x0, 0x2, 0x0, 0xFF, 0xFF
-};
-
-const byte PIT[] = {
- 0x2, 0xFF, 0xFF, 0x61, 0x0, 0x38, 0x0, 0x41, 0x3F, 0x19, 0x3D, 0x0,
- 0x0, 0x0, 0x3D, 0x3D, 0x0, 0x3, 0x0, 0x3E, 0x3D, 0x0, 0x4, 0x0, 0xFF, 0x3D,
- 0x0, 0x2, 0x0, 0x3D, 0x0, 0x1, 0x0, 0x0BE, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0x62, 0x0, 0x0, 0x0, 0x2, 0x0, 0x62, 0x0, 0x27, 0x0, 0x1, 0x0,
- 0x62, 0x0, 0x4D, 0x0, 0x2, 0x0, 0xFF, 0xFF, 0x0
-};
-
-const byte *const ROOM_TABLE[] = {
- CREDITS, nullptr, nullptr, nullptr, ALLISTER, HALL, JASONLAB, nullptr,
- ALLENLAB, OUTVAULT, VAULT, LIBRARY, JASAPT, RANSACKED, MEAN1, FLYSOUTH,
- CUZCO, INAIR, GREENMONKEY, INPLANE, PILFALL, COCKPIT, CRASH, SINKING,
- JNGLWLK, TOWN, HOTEL, CANTINA, nullptr, MASSACRE, TRADE, BRIDGE, DOCK,
- DRIVER, nullptr, nullptr, SHORE, BOAT, CABIN, CAPTIVE, nullptr,
- nullptr, VILLAGE, nullptr, TREE, CANOE, INTREE, FALLS, nullptr,
- nullptr, nullptr, nullptr, nullptr, nullptr, WATERFALL, INWATER, nullptr,
- CAVE, nullptr, nullptr, nullptr, PIT, nullptr, nullptr
-};
-
-const char *const ROOM_DESCR[] = {
- "Credits", nullptr, nullptr, nullptr, "Outside of Allister Center",
- "Hall", "Jason's Lab", nullptr, "Allen's Lab", "Outside of the Vault",
- "Inside the Vault", "Reader", "Jason's Apartment", "Jason's ransacked apartment", "Cutscene 1",
- "TBD FLYSOUTH", "Cuzco Airport", "TBD INAIR", "Green Monkey Club", "In Plane",
- "TBD PILFALL", "TBD COCKPIT", "TBD CRASH", "TBD SINKING", "Cutscene Jungle Walk",
- "TBD TOWN", "TBD HOTEL", "TBD CANTINA", nullptr, "TBD MASSACRE",
- "TBD TRADE", "TBD BRIDGE", "TBD DOCK", "TBD DRIVER", nullptr,
- nullptr, "TBD SHORE", "TBD BOAT", "TBD CABIN", "TBD CAPTIVE",
- nullptr, nullptr, "TBD VILLAGE", nullptr, "TBD TREE",
- "TBD CANOE", "TBD INTREE", "TBD FALLS", nullptr, nullptr,
- nullptr, nullptr, nullptr, nullptr, "TBD WATERFALL",
- "TBD INWATER", nullptr, "Cave Bridge", nullptr, nullptr,
- nullptr, "Pit with Ants", nullptr, nullptr
-};
-
-const byte ROOM_TABLE1_DEMO[] = {
- 0x02, 0x61, 0x00, 0x03, 0x00, 0x30, 0x22, 0x30, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xFF, 0xFF, 0xFF,
- 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE5_DEMO[] = {
- 0x00, 0x61, 0x00, 0x0E, 0x00, 0x36, 0x0F, 0x5E, 0x04, 0x00,
- 0x00, 0x00, 0x04, 0x04, 0x00, 0x03, 0x00, 0xFF, 0x04, 0x00,
- 0x02, 0x00, 0x04, 0x00, 0x01, 0x00, 0x8C, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x62, 0x00, 0x0B, 0x00, 0x01, 0x00, 0x62, 0x00, 0x0C, 0x00,
- 0x01, 0x00, 0x62, 0x00, 0x0D, 0x00, 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE6_DEMO[] = {
- 0x00, 0x61, 0x00, 0x0E, 0x00, 0x40, 0x3E, 0x1A, 0x05, 0x00,
- 0x00, 0x00, 0x05, 0x05, 0x00, 0x03, 0x00, 0xFF, 0x05, 0x00,
- 0x02, 0x00, 0x05, 0x00, 0x01, 0x00, 0xFF, 0x30, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x62, 0x00, 0x12, 0x00, 0x03, 0x00, 0x62, 0x00, 0x13, 0x00,
- 0x01, 0x00, 0x62, 0x00, 0x14, 0x00, 0x02, 0x00, 0x62, 0x00,
- 0x04, 0x00, 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE7_DEMO[] = {
- 0x01, 0x61, 0x00, 0x0D, 0x00, 0x40, 0x20, 0xC4, 0x06, 0x00,
- 0x00, 0x00, 0x06, 0x06, 0x00, 0x03, 0x00, 0xFF, 0x06, 0x00,
- 0x02, 0x00, 0x06, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x62, 0x00, 0x01, 0x00, 0x01, 0x00, 0x62, 0x00, 0x02, 0x00,
- 0x01, 0x00, 0x62, 0x00, 0x03, 0x00, 0x02, 0x00, 0x62, 0x00,
- 0x26, 0x00, 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE9_DEMO[] = {
- 0x01, 0x61, 0x00, 0x0D, 0x00, 0x40, 0x20, 0xC4, 0x08, 0x00,
- 0x00, 0x00, 0x08, 0x08, 0x00, 0x03, 0x00, 0xFF, 0x08, 0x00,
- 0x02, 0x00, 0x08, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x62, 0x00, 0x07, 0x00, 0x01, 0x00, 0x62, 0x00, 0x08, 0x00,
- 0x02, 0x00, 0x62, 0x00, 0x09, 0x00, 0x01, 0x00, 0x62, 0x00,
- 0x0A, 0x00, 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE10_DEMO[] = {
- 0x00, 0x61, 0x00, 0x0E, 0x00, 0x30, 0x18, 0x9B, 0x09, 0x00,
- 0x00, 0x00, 0x09, 0x09, 0x00, 0x03, 0x00, 0xFF, 0x09, 0x00,
- 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0xB4, 0x10, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x03, 0x00,
- 0x62, 0x00, 0x04, 0x00, 0x01, 0x00, 0x62, 0x00, 0x05, 0x00,
- 0x02, 0x00, 0x62, 0x00, 0x06, 0x00, 0x02, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE11_DEMO[] = {
- 0x01, 0x61, 0x00, 0x0E, 0x00, 0x40, 0x30, 0x14, 0x0A, 0x00,
- 0x00, 0x00, 0x0A, 0x0A, 0x00, 0x03, 0x00, 0xFF, 0x0A, 0x00,
- 0x02, 0x00, 0x0A, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x62, 0x00, 0x15, 0x00, 0x01, 0x00, 0x62, 0x00, 0x16, 0x00,
- 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE12_DEMO[] = {
- 0x01, 0x61, 0x00, 0x0E, 0x00, 0x40, 0x3A, 0x22, 0x0B, 0x00,
- 0x00, 0x00, 0x0B, 0x0B, 0x00, 0x03, 0x00, 0xFF, 0x0B, 0x00,
- 0x02, 0x00, 0x0B, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x62, 0x00, 0x01, 0x00, 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE13_DEMO[] = {
- 0x01, 0x61, 0x00, 0x08, 0x00, 0x40, 0x30, 0x14, 0x0C, 0x00,
- 0x00, 0x00, 0x0C, 0x0C, 0x00, 0x03, 0x00, 0xFF, 0x0C, 0x00,
- 0x02, 0x00, 0x0C, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x18, 0x00, 0x02, 0x00,
- 0x62, 0x00, 0x17, 0x00, 0x01, 0x00, 0x62, 0x00, 0x11, 0x00,
- 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE14_DEMO[] = {
- 0x01, 0x61, 0x00, 0x0D, 0x00, 0x40, 0x36, 0x2C, 0x0D, 0x00,
- 0x00, 0x00, 0x0D, 0x0D, 0x00, 0x03, 0x00, 0xFF, 0x0D, 0x00,
- 0x02, 0x00, 0x0D, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE15_DEMO[] = {
- 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x3E, 0x33, 0xFF, 0xFF,
- 0x00, 0x00, 0xFF, 0x0E, 0x00, 0x05, 0x00, 0x0E, 0x00, 0x04,
- 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF
-};
-
-const byte ROOM_TABLE16_DEMO[] = {
- 0x01, 0x61, 0x00, 0x10, 0x00, 0x28, 0x0C, 0x5E, 0x0F, 0x00,
- 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x02, 0x00, 0xFF, 0x0F, 0x00,
- 0x01, 0x00, 0xFF, 0xFF, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE17_DEMO[] = {
- 0x02, 0x61, 0x00, 0x10, 0x00, 0x40, 0x20, 0x30, 0x10, 0x00,
- 0x00, 0x00, 0x10, 0x10, 0x00, 0x03, 0x00, 0xFF, 0x10, 0x00,
- 0x02, 0x00, 0x10, 0x00, 0x01, 0x00, 0x6E, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE18_DEMO[] = {
- 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x28, 0x19, 0x2B, 0x11, 0x00,
- 0x00, 0x00, 0x11, 0x11, 0x00, 0x03, 0x00, 0xFF, 0x11, 0x00,
- 0x02, 0x00, 0x11, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE19_DEMO[] = {
- 0x01, 0x61, 0x00, 0x11, 0x00, 0x2D, 0x14, 0x3C, 0x12, 0x00,
- 0x00, 0x00, 0x12, 0x12, 0x00, 0x03, 0x00, 0xFF, 0x12, 0x00,
- 0x02, 0x00, 0x12, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE20_DEMO[] = {
- 0x02, 0x61, 0x00, 0x12, 0x00, 0x2D, 0x28, 0x28, 0x13, 0x00,
- 0x00, 0x00, 0x13, 0x13, 0x00, 0x03, 0x00, 0xFF, 0x13, 0x00,
- 0x02, 0x00, 0x13, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x62, 0x00, 0x29, 0x00, 0x01, 0x00, 0x62, 0x00, 0x24, 0x00,
- 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE21_DEMO[] = {
- 0x01, 0x61, 0x00, 0x16, 0x00, 0x28, 0x0C, 0x5E, 0x14, 0x00,
- 0x00, 0x00, 0x14, 0x14, 0x00, 0x02, 0x00, 0xFF, 0x14, 0x00,
- 0x01, 0x00, 0xFF, 0xFF, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE22_DEMO[] = {
- 0x01, 0x61, 0x00, 0x12, 0x00, 0x3C, 0x2A, 0x29, 0x15, 0x00,
- 0x00, 0x00, 0x15, 0x15, 0x00, 0x03, 0x00, 0xFF, 0x15, 0x00,
- 0x02, 0x00, 0x15, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x23, 0x00, 0x01, 0x00,
- 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE23_DEMO[] = {
- 0x01, 0x61, 0x00, 0x13, 0x00, 0x40, 0x2D, 0x64, 0x16, 0x00,
- 0x00, 0x00, 0xFF, 0x16, 0x00, 0x01, 0x00, 0xFF, 0xFF, 0x00,
- 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x16, 0x00, 0x02,
- 0x00, 0xFF, 0xFF, 0x62, 0x00, 0x2A, 0x00, 0x01, 0x00, 0xFF,
- 0xFF
-};
-
-const byte ROOM_TABLE24_DEMO[] = {
- 0x02, 0x61, 0x00, 0x14, 0x00, 0x40, 0x3C, 0x19, 0x17, 0x00,
- 0x00, 0x00, 0x17, 0x17, 0x00, 0x03, 0x00, 0xFF, 0x17, 0x00,
- 0x02, 0x00, 0x17, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE25_DEMO[] = {
- 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0x40, 0x3F, 0x5A, 0x18, 0x00,
- 0x00, 0x00, 0x18, 0x18, 0x00, 0x02, 0x00, 0xFF, 0x18, 0x00,
- 0x01, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xDC, 0xA0, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE26_DEMO[] = {
- 0x02, 0x61, 0x00, 0x17, 0x00, 0x3E, 0x32, 0x80, 0x19, 0x00,
- 0x00, 0x00, 0x19, 0x19, 0x00, 0x03, 0x00, 0xFF, 0x19, 0x00,
- 0x02, 0x00, 0x19, 0x00, 0x01, 0x00, 0x64, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE27_DEMO[] = {
- 0x01, 0x61, 0x00, 0x19, 0x00, 0x34, 0x28, 0x28, 0x1A, 0x00,
- 0x00, 0x00, 0x1A, 0x1A, 0x00, 0x03, 0x00, 0xFF, 0x1A, 0x00,
- 0x02, 0x00, 0x1A, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x28, 0x00, 0x01, 0x00,
- 0x62, 0x00, 0x2B, 0x00, 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE28_DEMO[] = {
- 0x02, 0x61, 0x00, 0x18, 0x00, 0x40, 0x3A, 0x6C, 0x1B, 0x00,
- 0x00, 0x00, 0x1B, 0x1B, 0x00, 0x03, 0x00, 0xFF, 0x1B, 0x00,
- 0x02, 0x00, 0x1B, 0x00, 0x01, 0x00, 0xC8, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE30_DEMO[] = {
- 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0x20, 0x18, 0x73, 0x1D, 0x00,
- 0x00, 0x00, 0x1D, 0x1D, 0x00, 0x03, 0x00, 0xFF, 0x1D, 0x00,
- 0x02, 0x00, 0x1D, 0x00, 0x01, 0x00, 0x80, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE31_DEMO[] = {
- 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x1C, 0x27, 0x1E, 0x00,
- 0x00, 0x00, 0x1E, 0x1E, 0x00, 0x03, 0x00, 0xFF, 0x1E, 0x00,
- 0x02, 0x00, 0x1E, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE32_DEMO[] = {
- 0x02, 0x61, 0x00, 0x1B, 0x00, 0x40, 0x10, 0x78, 0x1F, 0x00,
- 0x00, 0x00, 0x1F, 0x1F, 0x00, 0x03, 0x00, 0xFF, 0x1F, 0x00,
- 0x02, 0x00, 0x1F, 0x00, 0x01, 0x00, 0xFE, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x62, 0x00, 0x1F, 0x00, 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE33_DEMO[] = {
- 0x01, 0x61, 0x00, 0x1E, 0x00, 0x40, 0x3B, 0x4B, 0x20, 0x00,
- 0x00, 0x00, 0x20, 0x20, 0x00, 0x03, 0x00, 0xFF, 0x20, 0x00,
- 0x02, 0x00, 0x20, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE34_DEMO[] = {
- 0x01, 0x61, 0x00, 0x04, 0x00, 0x30, 0x10, 0x51, 0x21, 0x00,
- 0x00, 0x00, 0x21, 0x21, 0x00, 0x02, 0x00, 0xFF, 0x21, 0x00,
- 0x01, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x2E, 0x00, 0x01, 0x00,
- 0x62, 0x00, 0x2F, 0x00, 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE37_DEMO[] = {
- 0x02, 0x61, 0x00, 0x04, 0x00, 0x3E, 0x3A, 0x32, 0x24, 0x00,
- 0x00, 0x00, 0x24, 0x24, 0x00, 0x03, 0x00, 0xFF, 0x24, 0x00,
- 0x02, 0x00, 0x24, 0x00, 0x01, 0x00, 0xB4, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x2D, 0x00, 0x02, 0x00,
- 0x62, 0x00, 0x1F, 0x00, 0x01, 0x00, 0x62, 0x00, 0x2E, 0x00,
- 0x01, 0x00, 0x62, 0x00, 0x2F, 0x00, 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE38_DEMO[] = {
- 0x03, 0x61, 0x00, 0x08, 0x00, 0x3F, 0x3F, 0xFF, 0x25, 0x00,
- 0x00, 0x00, 0x25, 0x25, 0x00, 0x03, 0x00, 0xFF, 0x25, 0x00,
- 0x02, 0x00, 0x25, 0x00, 0x01, 0x00, 0xFF, 0x40, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x62, 0x00, 0x21, 0x00, 0x01, 0x00, 0x62, 0x00, 0x25, 0x00,
- 0x01, 0x00, 0x62, 0x00, 0x1F, 0x00, 0x01, 0x00, 0x62, 0x00,
- 0x30, 0x00, 0x01, 0x00, 0x62, 0x00, 0x32, 0x00, 0x01, 0x00,
- 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE39_DEMO[] = {
- 0x01, 0x61, 0x00, 0x08, 0x00, 0x40, 0x32, 0x50, 0x26, 0x00,
- 0x00, 0x00, 0x26, 0x26, 0x00, 0x03, 0x00, 0xFF, 0x26, 0x00,
- 0x02, 0x00, 0x26, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x62, 0x00, 0x22, 0x00, 0x02, 0x00, 0x62, 0x00, 0x31, 0x00,
- 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE40_DEMO[] = {
- 0x02, 0x61, 0x00, 0x09, 0x00, 0x40, 0x3F, 0x37, 0x27, 0x00,
- 0x00, 0x00, 0x27, 0x27, 0x00, 0x03, 0x00, 0xFF, 0x27, 0x00,
- 0x02, 0x00, 0x27, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x04, 0x00,
- 0x62, 0x00, 0x1B, 0x00, 0x03, 0x00, 0x62, 0x00, 0x1C, 0x00,
- 0x01, 0x00, 0x62, 0x00, 0x1F, 0x00, 0x02, 0x00, 0x62, 0x00,
- 0x23, 0x00, 0x01, 0x00, 0x62, 0x00, 0x32, 0x00, 0x01, 0x00,
- 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE43_DEMO[] = {
- 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x1B, 0x6E, 0x2A, 0x00,
- 0x00, 0x00, 0x2A, 0x2A, 0x00, 0x03, 0x00, 0xFF, 0x2A, 0x00,
- 0x02, 0x00, 0x2A, 0x00, 0x01, 0x00, 0xA5, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE45_DEMO[] = {
- 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x1D, 0xBE, 0x2C, 0x00,
- 0x00, 0x00, 0x2C, 0x2C, 0x00, 0x03, 0x00, 0xFF, 0x2C, 0x00,
- 0x02, 0x00, 0x2C, 0x00, 0x01, 0x00, 0x50, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE46_DEMO[] = {
- 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x1E, 0x1D, 0x78, 0x2D, 0x00,
- 0x00, 0x00, 0x2D, 0x2D, 0x00, 0x03, 0x00, 0xFF, 0x2D, 0x00,
- 0x02, 0x00, 0x2D, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE47_DEMO[] = {
- 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x28, 0x1E, 0x32, 0x2E, 0x00,
- 0x00, 0x00, 0x2E, 0x2E, 0x00, 0x03, 0x00, 0xFF, 0x2E, 0x00,
- 0x02, 0x00, 0x2E, 0x00, 0x01, 0x00, 0xF0, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE48_DEMO[] = {
- 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x28, 0x1E, 0x32, 0x2F, 0x00,
- 0x00, 0x00, 0x2F, 0x2F, 0x00, 0x03, 0x00, 0xFF, 0x2F, 0x00,
- 0x02, 0x00, 0x2F, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE51_DEMO[] = {
- 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x28, 0x1E, 0x32, 0xFF, 0xFF,
- 0x00, 0x00, 0xFF, 0x32, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x04,
- 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x32,
- 0x00, 0x01, 0x00, 0x01, 0x00, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE55_DEMO[] = {
- 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x28, 0x1E, 0x6E, 0x36, 0x00,
- 0x00, 0x00, 0x36, 0x36, 0x00, 0x03, 0x00, 0xFF, 0x36, 0x00,
- 0x02, 0x00, 0x36, 0x00, 0x01, 0x00, 0xFF, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0x36, 0x00, 0x04, 0x00, 0xFF, 0xFF, 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE58_DEMO[] = {
- 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0x32, 0x14, 0x73, 0x39, 0x00,
- 0x00, 0x00, 0x39, 0x39, 0x00, 0x03, 0x00, 0xFF, 0x39, 0x00,
- 0x02, 0x00, 0x39, 0x00, 0x01, 0x00, 0xB4, 0x00, 0xFF, 0xFF,
- 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xFF, 0xFF
-};
-
-const byte ROOM_TABLE62_DEMO[] = {
- 0x02, 0xFF, 0xFF, 0xFF, 0xFF, 0x41, 0x3F, 0x19, 0x3D, 0x00,
- 0x00, 0x00, 0x3D, 0x3D, 0x00, 0x03, 0x00, 0x3E, 0x3D, 0x00,
- 0x04, 0x00, 0xFF, 0x3D, 0x00, 0x02, 0x00, 0x3D, 0x00, 0x01,
- 0x00, 0xBE, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62,
- 0x00, 0x00, 0x00, 0x01, 0x00, 0xFF, 0xFF, 0x00
-};
-
-const byte *const ROOM_TABLE_DEMO[] = {
- ROOM_TABLE1_DEMO, nullptr, nullptr, nullptr, ROOM_TABLE5_DEMO,
- ROOM_TABLE6_DEMO, ROOM_TABLE7_DEMO, nullptr, ROOM_TABLE9_DEMO, ROOM_TABLE10_DEMO,
- ROOM_TABLE11_DEMO, ROOM_TABLE12_DEMO, ROOM_TABLE13_DEMO, ROOM_TABLE14_DEMO, ROOM_TABLE15_DEMO,
- ROOM_TABLE16_DEMO, ROOM_TABLE17_DEMO, ROOM_TABLE18_DEMO, ROOM_TABLE19_DEMO, ROOM_TABLE20_DEMO,
- ROOM_TABLE21_DEMO, ROOM_TABLE22_DEMO, ROOM_TABLE23_DEMO, ROOM_TABLE24_DEMO, ROOM_TABLE25_DEMO,
- ROOM_TABLE26_DEMO, ROOM_TABLE27_DEMO, ROOM_TABLE28_DEMO, nullptr, ROOM_TABLE30_DEMO,
- ROOM_TABLE31_DEMO, ROOM_TABLE32_DEMO, ROOM_TABLE33_DEMO, ROOM_TABLE34_DEMO, nullptr,
- nullptr, ROOM_TABLE37_DEMO, ROOM_TABLE38_DEMO, ROOM_TABLE39_DEMO, ROOM_TABLE40_DEMO,
- nullptr, nullptr, ROOM_TABLE43_DEMO, nullptr, ROOM_TABLE45_DEMO,
- ROOM_TABLE46_DEMO, ROOM_TABLE47_DEMO, ROOM_TABLE48_DEMO, nullptr, nullptr,
- ROOM_TABLE51_DEMO, nullptr, nullptr, nullptr, ROOM_TABLE55_DEMO,
- nullptr, nullptr, ROOM_TABLE58_DEMO, nullptr, nullptr,
- nullptr, ROOM_TABLE62_DEMO, nullptr, nullptr
-};
-
-const int ROOM_NUMB = 63;
-
-const byte ELAINE[] = {
- 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x0, 0x0, 0x0, 0x0, 0x41, 0x41, 0x0, 0x1, 0x0, 0xFF, 0x41, 0x0, 0x2,
- 0x0, 0x41, 0x0, 0x0, 0x0, 0x41, 0x0, 0x3, 0x0, 0x41, 0x0, 0x25, 0x0, 0x41,
- 0x0, 0x4, 0x0, 0x41, 0x0, 0x26, 0x0, 0x41, 0x0, 0x5, 0x0, 0x41, 0x0, 0x27,
- 0x0, 0x41, 0x0, 0x6, 0x0, 0x41, 0x0, 0x28, 0x0, 0x41, 0x0, 0x7, 0x0, 0x41,
- 0x0, 0x29, 0x0, 0x41, 0x0, 0x8, 0x0, 0x41, 0x0, 0x2A, 0x0, 0x41, 0x0, 0x9,
- 0x0, 0x41, 0x0, 0x2B, 0x0, 0x41, 0x0, 0x0A, 0x0, 0x41, 0x0, 0x2C, 0x0, 0x41,
- 0x0, 0x0B, 0x0, 0x41, 0x0, 0x2D, 0x0, 0x41, 0x0, 0x0C, 0x0, 0x41, 0x0, 0x2E,
- 0x0, 0x41, 0x0, 0x0D, 0x0, 0x41, 0x0, 0x2F, 0x0, 0x41, 0x0, 0x0E, 0x0, 0x41,
- 0x0, 0x30, 0x0, 0x41, 0x0, 0x0F, 0x0, 0x41, 0x0, 0x31, 0x0, 0x41, 0x0, 0x10,
- 0x0, 0x41, 0x0, 0x32, 0x0, 0x41, 0x0, 0x11, 0x0, 0x41, 0x0, 0x33, 0x0, 0x41,
- 0x0, 0x12, 0x0, 0x41, 0x0, 0x34, 0x0, 0x41, 0x0, 0x13, 0x0, 0x41, 0x0, 0x35,
- 0x0, 0x41, 0x0, 0x14, 0x0, 0x41, 0x0, 0x36, 0x0, 0x41, 0x0, 0x15, 0x0, 0x41,
- 0x0, 0x37, 0x0, 0x41, 0x0, 0x16, 0x0, 0x41, 0x0, 0x38, 0x0, 0x41, 0x0, 0x17,
- 0x0, 0x41, 0x0, 0x39, 0x0, 0x41, 0x0, 0x18, 0x0, 0x41, 0x0, 0x3A, 0x0, 0x41,
- 0x0, 0x19, 0x0, 0x41, 0x0, 0x3B, 0x0, 0x41, 0x0, 0x1A, 0x0, 0x41, 0x0, 0x3C,
- 0x0, 0x41, 0x0, 0x1B, 0x0, 0x41, 0x0, 0x3D, 0x0, 0x41, 0x0, 0x1C, 0x0, 0x41,
- 0x0, 0x3E, 0x0, 0x41, 0x0, 0x1D, 0x0, 0x41, 0x0, 0x3F, 0x0, 0x41, 0x0, 0x1E,
- 0x0, 0x41, 0x0, 0x40, 0x0, 0x41, 0x0, 0x1F, 0x0, 0x41, 0x0, 0x41, 0x0, 0x41,
- 0x0, 0x20, 0x0, 0x41, 0x0, 0x42, 0x0, 0x41, 0x0, 0x21, 0x0, 0x41, 0x0, 0x43,
- 0x0, 0x41, 0x0, 0x22, 0x0, 0x41, 0x0, 0x44, 0x0, 0x41, 0x0, 0x23, 0x0, 0x41,
- 0x0, 0x45, 0x0, 0x41, 0x0, 0x24, 0x0, 0x41, 0x0, 0x46, 0x0, 0xFF, 0xFF
-};
-
-const byte LIB[] = {
- 0x1, 0xFF, 0xFF, 0x42, 0x0, 0x2, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x42, 0x42, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0x2,
- 0x0, 0x42, 0x0, 0x0, 0x0, 0x42, 0x0, 0x3, 0x0, 0x42, 0x0, 0x18, 0x0, 0x42,
- 0x0, 0x4, 0x0, 0x42, 0x0, 0x19, 0x0, 0x42, 0x0, 0x5, 0x0, 0x42, 0x0, 0x1A,
- 0x0, 0x42, 0x0, 0x6, 0x0, 0x42, 0x0, 0x1B, 0x0, 0x42, 0x0, 0x7, 0x0, 0x42,
- 0x0, 0x1C, 0x0, 0x42, 0x0, 0x8, 0x0, 0x42, 0x0, 0x1D, 0x0, 0x42, 0x0, 0x9,
- 0x0, 0x42, 0x0, 0x1E, 0x0, 0x42, 0x0, 0x0A, 0x0, 0x42, 0x0, 0x1F, 0x0, 0x42,
- 0x0, 0x0B, 0x0, 0x42, 0x0, 0x20, 0x0, 0x42, 0x0, 0x0C, 0x0, 0x42, 0x0, 0x21,
- 0x0, 0x42, 0x0, 0x0D, 0x0, 0x42, 0x0, 0x22, 0x0, 0x42, 0x0, 0x0E, 0x0, 0x42,
- 0x0, 0x23, 0x0, 0x42, 0x0, 0x0F, 0x0, 0x42, 0x0, 0x24, 0x0, 0x42, 0x0, 0x10,
- 0x0, 0x42, 0x0, 0x25, 0x0, 0x42, 0x0, 0x11, 0x0, 0x42, 0x0, 0x26, 0x0, 0x42,
- 0x0, 0x12, 0x0, 0x42, 0x0, 0x27, 0x0, 0x42, 0x0, 0x13, 0x0, 0x42, 0x0, 0x28,
- 0x0, 0x42, 0x0, 0x14, 0x0, 0x42, 0x0, 0x29, 0x0, 0x42, 0x0, 0x15, 0x0, 0x42,
- 0x0, 0x2A, 0x0, 0x42, 0x0, 0x16, 0x0, 0x42, 0x0, 0x2B, 0x0, 0x42, 0x0, 0x17,
- 0x0, 0x42, 0x0, 0x2C, 0x0, 0xFF, 0xFF
-};
-
-const byte FLASHBACK[] = {
- 0x2, 0x1B, 0x0, 0x1C, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0x26, 0x0, 0x1C, 0x0, 0x0, 0x0, 0x1C,
- 0x0, 0x5, 0x0, 0x1C, 0x0, 0x0E, 0x0, 0x1C, 0x0, 0x6, 0x0, 0x1C, 0x0, 0x0F,
- 0x0, 0x1C, 0x0, 0x7, 0x0, 0x1C, 0x0, 0x0C, 0x0, 0x1C, 0x0, 0x8, 0x0, 0x1C,
- 0x0, 0x0D, 0x0, 0x2, 0x0, 0x1, 0x0, 0x1C, 0x0, 0x10, 0x0, 0x2, 0x0, 0x2, 0x0, 0x1C,
- 0x0, 0x11, 0x0, 0x1C, 0x0, 0x9, 0x0, 0x1C, 0x0, 0x12, 0x0, 0x1C, 0x0, 0x0A,
- 0x0, 0x1C, 0x0, 0x13, 0x0, 0x1C, 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x14, 0x0, 0x1C,
- 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x15, 0x0, 0x1C, 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x16,
- 0x0, 0x1C, 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x17, 0x0, 0x1C, 0x0, 0x0B, 0x0, 0x1C,
- 0x0, 0x18, 0x0, 0x1C, 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x19, 0x0, 0x1C, 0x0, 0x0B,
- 0x0, 0x1C, 0x0, 0x1A, 0x0, 0x1C, 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x1B, 0x0, 0x1C,
- 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x1C, 0x0, 0x1C, 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x1D,
- 0x0, 0x1C, 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x1E, 0x0, 0x1C, 0x0, 0x0B, 0x0, 0x1C,
- 0x0, 0x1F, 0x0, 0x1C, 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x20, 0x0, 0x1C, 0x0, 0x0B,
- 0x0, 0x1C, 0x0, 0x21, 0x0, 0x1C, 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x22, 0x0, 0x1C,
- 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x23, 0x0, 0x1C, 0x0, 0x0B, 0x0, 0x1C, 0x0, 0x24,
- 0x0, 0xFF, 0xFF
-};
-
-const byte ALLENDIE[] = {
- 0x2, 0xFF, 0xFF, 0x49, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0x0, 0x0, 0x49, 0x0, 0x0, 0x0, 0x49,
- 0x0, 0x4, 0x0, 0x62, 0x0, 0x1F, 0x0, 0x49, 0x0, 0x5, 0x0, 0x62, 0x0, 0x3A,
- 0x0, 0x49, 0x0, 0x6, 0x0, 0x49, 0x0, 0x7, 0x0, 0xFF, 0xFF
-};
-
-const byte OVERBOARD[] = {
- 0x2, 0xFF, 0xFF, 0x22, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x22, 0x22, 0x0, 0x2, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x22, 0x0, 0x0, 0x0, 0x22, 0x0, 0x3, 0x0, 0x22, 0x0, 0x6, 0x0, 0x22,
- 0x0, 0x4, 0x0, 0x22, 0x0, 0x7, 0x0, 0x22, 0x0, 0x5, 0x0, 0x62, 0x0, 0x1D, 0x0,
- 0x22, 0x0, 0x5, 0x0, 0x62, 0x0, 0x24, 0x0, 0xFF, 0xFF
-};
-
-const byte PILOT2[] = {
- 0x0, 0x12, 0x0, 0xFF, 0xFF, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x46, 0x46, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x46, 0x0, 0x0, 0x0, 0x46, 0x0, 0x2, 0x0, 0x46, 0x0, 0x0A, 0x0, 0x46,
- 0x0, 0x3, 0x0, 0x46, 0x0, 0x0B, 0x0, 0x46, 0x0, 0x4, 0x0, 0x46, 0x0, 0x0C,
- 0x0, 0x46, 0x0, 0x5, 0x0, 0x46, 0x0, 0x0D, 0x0, 0x46, 0x0, 0x6, 0x0, 0x46,
- 0x0, 0x0E, 0x0, 0x46, 0x0, 0x7, 0x0, 0x46, 0x0, 0x0F, 0x0, 0x46, 0x0, 0x8,
- 0x0, 0x46, 0x0, 0x10, 0x0, 0x46, 0x0, 0x9, 0x0, 0x46, 0x0, 0x11, 0x0, 0x46,
- 0x0, 0x9, 0x0, 0x62, 0x0, 0x1F, 0x0, 0xFF, 0xFF
-};
-
-const byte TIKAGENT[] = {
- 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x43, 0x43, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0x2,
- 0x0, 0x43, 0x0, 0x0, 0x0, 0x43, 0x0, 0x2, 0x0, 0x43, 0x0, 0x12, 0x0, 0x43,
- 0x0, 0x3, 0x0, 0x43, 0x0, 0x13, 0x0, 0x43, 0x0, 0x4, 0x0, 0x43, 0x0, 0x14,
- 0x0, 0x43, 0x0, 0x5, 0x0, 0x43, 0x0, 0x15, 0x0, 0x43, 0x0, 0x6, 0x0, 0x43,
- 0x0, 0x16, 0x0, 0x43, 0x0, 0x7, 0x0, 0x43, 0x0, 0x17, 0x0, 0x43, 0x0, 0x8,
- 0x0, 0x43, 0x0, 0x18, 0x0, 0x43, 0x0, 0x9, 0x0, 0x43, 0x0, 0x19, 0x0, 0x43,
- 0x0, 0x0A, 0x0, 0x43, 0x0, 0x1A, 0x0, 0x43, 0x0, 0x0B, 0x0, 0x43, 0x0, 0x1B,
- 0x0, 0x43, 0x0, 0x0C, 0x0, 0x43, 0x0, 0x1C, 0x0, 0x43, 0x0, 0x0D, 0x0, 0x43,
- 0x0, 0x1D, 0x0, 0x43, 0x0, 0x0E, 0x0, 0x43, 0x0, 0x1E, 0x0, 0x43, 0x0, 0x0F,
- 0x0, 0x43, 0x0, 0x1F, 0x0, 0x43, 0x0, 0x10, 0x0, 0x43, 0x0, 0x20, 0x0, 0x43,
- 0x0, 0x11, 0x0, 0x43, 0x0, 0x21, 0x0, 0xFF, 0xFF
-};
-
-const byte BARTENDER[] = {
- 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x44, 0x44, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x44, 0x0, 0x0, 0x0, 0x44, 0x0, 0x2, 0x0, 0x44, 0x0, 0x8, 0x0, 0x44, 0x0,
- 0x3, 0x0, 0x44, 0x0, 0x9, 0x0, 0x44, 0x0, 0x4, 0x0, 0x44, 0x0, 0x0A, 0x0, 0x44,
- 0x0, 0x5, 0x0, 0x44, 0x0, 0x0B, 0x0, 0x44, 0x0, 0x6, 0x0, 0x44, 0x0, 0x0C,
- 0x0, 0x44, 0x0, 0x7, 0x0, 0x44, 0x0, 0x0D, 0x0, 0xFF, 0xFF
-};
-
-const byte PILOT1[] = {
- 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x0, 0x0, 0x0, 0x0, 0x45, 0x45, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x45, 0x0, 0x0, 0x0, 0x45, 0x0, 0x2, 0x0, 0x45, 0x0, 0x3, 0x0, 0xFF, 0xFF
-};
-
-const byte COOK[] = {
- 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x0, 0x0, 0x0, 0x0, 0x47, 0x47, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF,
- 0x2, 0x0, 0x47, 0x0, 0x0, 0x0, 0x47, 0x0, 0x2, 0x0, 0x47, 0x0, 0x10, 0x0, 0x47,
- 0x0, 0x3, 0x0, 0x47, 0x0, 0x11, 0x0, 0x47, 0x0, 0x4, 0x0, 0x47, 0x0, 0x12,
- 0x0, 0x47, 0x0, 0x5, 0x0, 0x47, 0x0, 0x13, 0x0, 0x47, 0x0, 0x6, 0x0, 0x47,
- 0x0, 0x14, 0x0, 0x47, 0x0, 0x7, 0x0, 0x47, 0x0, 0x15, 0x0, 0x47, 0x0, 0x8,
- 0x0, 0x47, 0x0, 0x16, 0x0, 0x47, 0x0, 0x9, 0x0, 0x47, 0x0, 0x17, 0x0, 0x47,
- 0x0, 0x0A, 0x0, 0x47, 0x0, 0x18, 0x0, 0x47, 0x0, 0x0B, 0x0, 0x47, 0x0, 0x19,
- 0x0, 0x47, 0x0, 0x0C, 0x0, 0x47, 0x0, 0x1A, 0x0, 0x47, 0x0, 0x0D, 0x0, 0x47,
- 0x0, 0x1B, 0x0, 0x47, 0x0, 0x0E, 0x0, 0x47, 0x0, 0x1C, 0x0, 0x47, 0x0, 0x0F,
- 0x0, 0x47, 0x0, 0x1D, 0x0, 0xFF, 0xFF
-};
-
-const byte BEXPLODE[] = {
- 0x2, 0xFF, 0xFF, 0x28, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x28, 0x28, 0x0, 0x2, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x28, 0x0, 0x0, 0x0, 0x28, 0x0, 0x3, 0x0, 0x28, 0x0, 0x9, 0x0, 0x28,
- 0x0, 0x4, 0x0, 0x28, 0x0, 0x0A, 0x0, 0x28, 0x0, 0x5, 0x0, 0x28, 0x0, 0x0B,
- 0x0, 0x28, 0x0, 0x6, 0x0, 0x62, 0x0, 0x23, 0x0, 0x28, 0x0, 0x7, 0x0, 0x62,
- 0x0, 0x23, 0x0, 0x28, 0x0, 0x8, 0x0, 0x62, 0x0, 0x23, 0x0, 0xFF, 0xFF
-};
-
-const byte THORNICK[] = {
- 0x2, 0x7, 0x0, 0x7, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x0, 0x0,
- 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7, 0x0, 0x0, 0x0, 0x7, 0x0, 0x2, 0x0,
- 0x7, 0x0, 0x5, 0x0, 0x7, 0x0, 0x3, 0x0, 0x7, 0x0, 0x6, 0x0, 0x7, 0x0, 0x3,
- 0x0, 0x7, 0x0, 0x7, 0x0, 0x7, 0x0, 0x4, 0x0, 0x7, 0x0, 0x8, 0x0, 0xFF, 0xFF
-};
-
-const byte MAYA[] = {
- 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x0, 0x0, 0x48, 0x48, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0x2, 0x0,
- 0x48, 0x0, 0x0, 0x0, 0x48, 0x0, 0x2, 0x0, 0x48, 0x0, 0x13, 0x0, 0x48,
- 0x0, 0x3, 0x0, 0x48, 0x0, 0x14, 0x0, 0x48, 0x0, 0x4, 0x0, 0x48, 0x0, 0x15,
- 0x0, 0x48, 0x0, 0x5, 0x0, 0x48, 0x0, 0x16, 0x0, 0x48, 0x0, 0x6, 0x0, 0x48,
- 0x0, 0x17, 0x0, 0x48, 0x0, 0x7, 0x0, 0x48, 0x0, 0x18, 0x0, 0x48, 0x0, 0x8,
- 0x0, 0x48, 0x0, 0x19, 0x0, 0x48, 0x0, 0x9, 0x0, 0x48, 0x0, 0x1A, 0x0, 0x48,
- 0x0, 0x0A, 0x0, 0x48, 0x0, 0x1B, 0x0, 0x48, 0x0, 0x0B, 0x0, 0x48, 0x0, 0x1C,
- 0x0, 0x48, 0x0, 0x0C, 0x0, 0x48, 0x0, 0x1D, 0x0, 0x48, 0x0, 0x0D, 0x0, 0x48,
- 0x0, 0x1E, 0x0, 0x48, 0x0, 0x0E, 0x0, 0x48, 0x0, 0x1F, 0x0, 0x48, 0x0, 0x0F,
- 0x0, 0x48, 0x0, 0x20, 0x0, 0x48, 0x0, 0x10, 0x0, 0x48, 0x0, 0x21, 0x0, 0x48,
- 0x0, 0x11, 0x0, 0x48, 0x0, 0x22, 0x0, 0x48, 0x0, 0x12, 0x0, 0x48, 0x0, 0x23,
- 0x0, 0xFF, 0xFF
-};
-
-const byte CAPTAIN[] = {
- 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x0, 0x0, 0x0, 0x0, 0x4A, 0x4A, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF,
- 0x2, 0x0, 0x4A, 0x0, 0x0, 0x0, 0x4A, 0x0, 0x2, 0x0, 0x4A, 0x0, 0x0E, 0x0, 0x4A,
- 0x0, 0x3, 0x0, 0x4A, 0x0, 0x0F, 0x0, 0x4A, 0x0, 0x4, 0x0, 0x4A, 0x0, 0x10,
- 0x0, 0x4A, 0x0, 0x5, 0x0, 0x4A, 0x0, 0x11, 0x0, 0x4A, 0x0, 0x6, 0x0, 0x4A,
- 0x0, 0x12, 0x0, 0x4A, 0x0, 0x7, 0x0, 0x4A, 0x0, 0x13, 0x0, 0x4A, 0x0, 0x8,
- 0x0, 0x4A, 0x0, 0x14, 0x0, 0x4A, 0x0, 0x9, 0x0, 0x4A, 0x0, 0x15, 0x0, 0x4A,
- 0x0, 0x0A, 0x0, 0x4A, 0x0, 0x16, 0x0, 0x4A, 0x0, 0x0B, 0x0, 0x4A, 0x0, 0x17,
- 0x0, 0x4A, 0x0, 0x0C, 0x0, 0x4A, 0x0, 0x18, 0x0, 0x4A, 0x0, 0x0D, 0x0, 0x4A,
- 0x0, 0x19, 0x0, 0xFF, 0xFF
-};
-
-const byte ALLEN[] = {
- 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x0, 0x0, 0x0, 0x0, 0x1E, 0x4C, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0x4C, 0x0, 0x0, 0x0, 0x4C, 0x0, 0x2, 0x0, 0x4C, 0x0, 0x3, 0x0,
- 0xFF, 0xFF
-};
-
-const byte ARCH[] = {
- 0x1, 0x2B, 0x0, 0x4B, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x0, 0x0, 0x2B, 0x4B, 0x0, 0x40, 0x0, 0xFF, 0x4B, 0x0, 0x41, 0x0,
- 0x4B, 0x0, 0x0, 0x0, 0x4B, 0x0, 0x2, 0x0, 0x4B, 0x0, 0x4, 0x0, 0x4B, 0x0, 0x3,
- 0x0, 0x4B, 0x0, 0x5, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x6, 0x0, 0x4B, 0x0,
- 0x3, 0x0, 0x4B, 0x0, 0x7, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x8, 0x0, 0x4B,
- 0x0, 0x3, 0x0, 0x4B, 0x0, 0x9, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x0A, 0x0,
- 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x0B, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0,
- 0x0C, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x0D, 0x0, 0x4B, 0x0, 0x3, 0x0,
- 0x4B, 0x0, 0x0E, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x0F, 0x0, 0x4B, 0x0,
- 0x3, 0x0, 0x4B, 0x0, 0x10, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x11, 0x0,
- 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x12, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0,
- 0x13, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x14, 0x0, 0x4B, 0x0, 0x3, 0x0,
- 0x4B, 0x0, 0x15, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x16, 0x0, 0x4B, 0x0,
- 0x3, 0x0, 0x4B, 0x0, 0x17, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x18, 0x0,
- 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x19, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0,
- 0x1A, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x1B, 0x0, 0x4B, 0x0, 0x3, 0x0,
- 0x4B, 0x0, 0x1C, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x1D, 0x0, 0x4B, 0x0,
- 0x3, 0x0, 0x4B, 0x0, 0x1E, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x1F, 0x0,
- 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x20, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0,
- 0x21, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x22, 0x0, 0x4B, 0x0, 0x3, 0x0,
- 0x4B, 0x0, 0x23, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x24, 0x0, 0x4B, 0x0,
- 0x3, 0x0, 0x4B, 0x0, 0x25, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x26, 0x0,
- 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x27, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0,
- 0x28, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x29, 0x0, 0x4B, 0x0, 0x3, 0x0,
- 0x4B, 0x0, 0x2A, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x2B, 0x0, 0x4B, 0x0,
- 0x3, 0x0, 0x4B, 0x0, 0x2C, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x2D, 0x0,
- 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x2E, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0,
- 0x2F, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x30, 0x0, 0x4B, 0x0, 0x3, 0x0,
- 0x4B, 0x0, 0x31, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x32, 0x0, 0x4B, 0x0,
- 0x3, 0x0, 0x4B, 0x0, 0x33, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x34, 0x0,
- 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x35, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0,
- 0x36, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x37, 0x0, 0x4B, 0x0, 0x3, 0x0,
- 0x4B, 0x0, 0x38, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x39, 0x0, 0x4B, 0x0,
- 0x3, 0x0, 0x4B, 0x0, 0x3A, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x3B, 0x0,
- 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x3C, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0,
- 0x3D, 0x0, 0x4B, 0x0, 0x3, 0x0, 0x4B, 0x0, 0x3E, 0x0, 0x4B, 0x0, 0x3, 0x0,
- 0x4B, 0x0, 0x3F, 0x0, 0xFF, 0xFF
-};
-
-const byte GUARD1[] = {
- 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x0, 0x0, 0x0, 0x0, 0x4D, 0x4D, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0x4D, 0x0, 0x0, 0x0, 0x4D, 0x0, 0x2, 0x0, 0x4D, 0x0, 0x3, 0x0,
- 0xFF, 0xFF
-};
-
-const byte MCANOE[] = {
- 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x0, 0x0, 0x0, 0x0, 0x4E, 0x4E, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF,
- 0xFF, 0xFF, 0x4E, 0x0, 0x0, 0x0, 0x4E, 0x0, 0x2, 0x0, 0x4E, 0x0, 0x3, 0x0,
- 0xFF, 0xFF
-};
-
-const byte CAMPFIRE[] = {
- 0x2, 0x35, 0x0, 0x35, 0x0, 0x3, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x0, 0x0, 0x35, 0x35, 0x0, 0x1, 0x0, 0xFF, 0x35, 0x0, 0x2, 0x0, 0x35,
- 0x0, 0x0, 0x0, 0x35, 0x0, 0x4, 0x0, 0x35, 0x0, 0x18, 0x0, 0x35, 0x0, 0x5, 0x0,
- 0x35, 0x0, 0x19, 0x0, 0x35, 0x0, 0x6, 0x0, 0x35, 0x0, 0x1A, 0x0, 0x35, 0x0,
- 0x7, 0x0, 0x35, 0x0, 0x1B, 0x0, 0x35, 0x0, 0x8, 0x0, 0x35, 0x0, 0x1C, 0x0,
- 0x35, 0x0, 0x9, 0x0, 0x35, 0x0, 0x1D, 0x0, 0x35, 0x0, 0x0A, 0x0, 0x35, 0x0,
- 0x1E, 0x0, 0x35, 0x0, 0x0B, 0x0, 0x35, 0x0, 0x1F, 0x0, 0x35, 0x0, 0x0C,
- 0x0, 0x35, 0x0, 0x20, 0x0, 0x35, 0x0, 0x0D, 0x0, 0x35, 0x0, 0x21, 0x0, 0x35,
- 0x0, 0x0E, 0x0, 0x35, 0x0, 0x22, 0x0, 0x35, 0x0, 0x0F, 0x0, 0x35, 0x0, 0x23,
- 0x0, 0x35, 0x0, 0x10, 0x0, 0x35, 0x0, 0x24, 0x0, 0x35, 0x0, 0x11, 0x0, 0x35,
- 0x0, 0x25, 0x0, 0x35, 0x0, 0x12, 0x0, 0x35, 0x0, 0x26, 0x0, 0x35, 0x0, 0x13,
- 0x0, 0x35, 0x0, 0x27, 0x0, 0x35, 0x0, 0x14, 0x0, 0x35, 0x0, 0x28, 0x0, 0x35,
- 0x0, 0x15, 0x0, 0x35, 0x0, 0x29, 0x0, 0x35, 0x0, 0x16, 0x0, 0x35, 0x0, 0x2A,
- 0x0, 0x35, 0x0, 0x17, 0x0, 0x35, 0x0, 0x2B, 0x0, 0xFF, 0xFF
-};
-
-const byte COLONEL[] = {
- 0x2, 0xFF, 0xFF, 0x0E, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x0E, 0x0E, 0x0, 0x5, 0x0, 0xFF, 0xFF, 0xFF, 0x2,
- 0x0, 0x4F, 0x0, 0x0, 0x0, 0x4F, 0x0, 0x1, 0x0, 0x4F, 0x0, 0x2, 0x0, 0x0E, 0x0,
- 0x8, 0x0, 0x4F, 0x0, 0x3, 0x0, 0xFF, 0xFF
-};
-
-const byte SOLDIERS[] = {
- 0x2, 0xFF, 0xFF, 0x50, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0x0, 0x0, 0x50, 0x0, 0x0, 0x0, 0x50,
- 0x0, 0x2, 0x0, 0x50, 0x0, 0x0, 0x0, 0xFF, 0xFF
-};
-
-const byte JWATER[] = {
- 0x2, 0xFF, 0xFF, 0x51, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0x0, 0x0, 0x51, 0x0, 0x0, 0x0, 0x51,
- 0x0, 0x2, 0x0, 0x51, 0x0, 0x3, 0x0, 0xFF, 0xFF
-};
-
-const byte SHOOT[] = {
- 0x2, 0xFF, 0xFF, 0x52, 0x0, 0x2, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x38, 0x52, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x52, 0x0, 0x0, 0x0, 0x52, 0x0, 0x3, 0x0, 0x52, 0x0, 0x5, 0x0, 0x52,
- 0x0, 0x4, 0x0, 0x62, 0x0, 0x1F, 0x0, 0xFF, 0xFF
-};
-
-const byte ADIE[] = {
- 0x2, 0xFF, 0xFF, 0x53, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0x2, 0x0, 0x53, 0x0, 0x0, 0x0, 0x53,
- 0x0, 0x2, 0x0, 0x62, 0x0, 0x4, 0x0, 0x53, 0x0, 0x3, 0x0, 0x62, 0x0, 0x4,
- 0x0, 0x53, 0x0, 0x4, 0x0, 0x62, 0x0, 0x4, 0x0, 0xFF, 0xFF
-};
-
-const byte DYNAMITE[] = {
- 0x2, 0xFF, 0xFF, 0x54, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0x2, 0x0, 0x54, 0x0, 0x0, 0x0, 0x54,
- 0x0, 0x2, 0x0, 0x62, 0x0, 0x23, 0x0, 0xFF, 0xFF
-};
-
-const byte MAYASHOT[] = {
- 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x0, 0x0, 0x0, 0x0, 0x36, 0x55, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF,
- 0x3, 0x0, 0x55, 0x0, 0x0, 0x0, 0x55, 0x0, 0x2, 0x0, 0x62, 0x0, 0x1F,
- 0x0, 0xFF, 0xFF
-};
-
-const byte OFFKEV[] = {
- 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x0, 0x0, 0x4D, 0x29, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x29, 0x0, 0x0, 0x0, 0x29, 0x0, 0x2, 0x0, 0x29, 0x0, 0x3, 0x0, 0xFF, 0xFF
-};
-
-const byte VALLEY[] = {
- 0x2, 0x3A, 0x0, 0x3A, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x0, 0x0, 0x3A, 0x3A, 0x0, 0x2, 0x0, 0xFF, 0xFF, 0xFF, 0x3, 0x0,
- 0x3A, 0x0, 0x0, 0x0, 0x3A, 0x0, 0x3, 0x0, 0x3A, 0x0, 0x5, 0x0, 0x3A, 0x0,
- 0x4, 0x0, 0x62, 0x0, 0x27, 0x0, 0xFF, 0xFF
-};
-
-const byte MEANWHILE1[] = {
- 0x2, 0xFF, 0xFF, 0x0E, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x0E, 0x0E, 0x0, 0x5, 0x0, 0xFF, 0xFF, 0xFF, 0x3,
- 0x0, 0x0E, 0x0, 0x0, 0x0, 0x0E, 0x0, 0x6, 0x0, 0x0E, 0x0, 0x0A, 0x0, 0x0E,
- 0x0, 0x7, 0x0, 0x0E, 0x0, 0x0B, 0x0, 0x0E, 0x0, 0x8, 0x0, 0x0E, 0x0, 0x0C,
- 0x0, 0x0E, 0x0, 0x8, 0x0, 0x0E, 0x0, 0x0D, 0x0, 0x0E, 0x0, 0x8, 0x0, 0x0E,
- 0x0, 0x0E, 0x0, 0x0E, 0x0, 0x9, 0x0, 0x0E, 0x0, 0x0F, 0x0, 0x0E, 0x0, 0x9,
- 0x0, 0x0E, 0x0, 0x10, 0x0, 0x0E, 0x0, 0x9, 0x0, 0x0E, 0x0, 0x11, 0x0, 0x0E,
- 0x0, 0x9, 0x0, 0x0E, 0x0, 0x12, 0x0, 0x0E, 0x0, 0x9, 0x0, 0x62, 0x0, 0x1A,
- 0x0, 0xFF, 0xFF
-};
-
-const byte MAYATREE[] = {
- 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x30, 0x56, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x56, 0x0, 0x0, 0x0, 0x56, 0x0, 0x2, 0x0, 0x56, 0x0, 0x3, 0x0, 0xFF, 0xFF
-};
-
-const byte LOCO[] = {
- 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x31, 0x57, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x57, 0x0, 0x0, 0x0, 0x57, 0x0, 0x2, 0x0, 0x57, 0x0, 0x3, 0x0, 0xFF, 0xFF
-};
-
-const byte KISS[] = {
- 0x2, 0xFF, 0xFF, 0x3A, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x40, 0x40, 0x0, 0x5, 0x0, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x40, 0x0, 0x0, 0x0, 0x40, 0x0, 0x6, 0x0, 0x40, 0x0, 0x26, 0x0, 0x40,
- 0x0, 0x7, 0x0, 0x40, 0x0, 0x27, 0x0, 0x40, 0x0, 0x8, 0x0, 0x40, 0x0, 0x28,
- 0x0, 0x40, 0x0, 0x9, 0x0, 0x62, 0x0, 0x4E, 0x0, 0x40, 0x0, 0x0A, 0x0, 0x40,
- 0x0, 0x29, 0x0, 0x40, 0x0, 0x0B, 0x0, 0x40, 0x0, 0x2A, 0x0, 0x40, 0x0, 0x0C,
- 0x0, 0x40, 0x0, 0x2B, 0x0, 0x40, 0x0, 0x0D, 0x0, 0x40, 0x0, 0x2C, 0x0, 0x40,
- 0x0, 0x0E, 0x0, 0x40, 0x0, 0x2D, 0x0, 0x40, 0x0, 0x0F, 0x0, 0x40, 0x0, 0x2E,
- 0x0, 0x40, 0x0, 0x10, 0x0, 0x40, 0x0, 0x2F, 0x0, 0x40, 0x0, 0x11, 0x0, 0x40,
- 0x0, 0x30, 0x0, 0x40, 0x0, 0x12, 0x0, 0x40, 0x0, 0x31, 0x0, 0x40, 0x0, 0x13,
- 0x0, 0x40, 0x0, 0x32, 0x0, 0x40, 0x0, 0x14, 0x0, 0x40, 0x0, 0x33, 0x0, 0x40,
- 0x0, 0x15, 0x0, 0x40, 0x0, 0x34, 0x0, 0x40, 0x0, 0x16, 0x0, 0x40, 0x0, 0x35,
- 0x0, 0x40, 0x0, 0x17, 0x0, 0x40, 0x0, 0x36, 0x0, 0x40, 0x0, 0x18, 0x0, 0x40,
- 0x0, 0x37, 0x0, 0x40, 0x0, 0x19, 0x0, 0x40, 0x0, 0x38, 0x0, 0x40, 0x0, 0x1A,
- 0x0, 0x40, 0x0, 0x39, 0x0, 0x40, 0x0, 0x1B, 0x0, 0x40, 0x0, 0x3A, 0x0, 0x40,
- 0x0, 0x1C, 0x0, 0x40, 0x0, 0x3B, 0x0, 0x40, 0x0, 0x1D, 0x0, 0x40, 0x0, 0x3C,
- 0x0, 0x40, 0x0, 0x1E, 0x0, 0x40, 0x0, 0x3D, 0x0, 0x40, 0x0, 0x1F, 0x0, 0x40,
- 0x0, 0x3E, 0x0, 0x40, 0x0, 0x20, 0x0, 0x40, 0x0, 0x3F, 0x0, 0x40, 0x0, 0x21,
- 0x0, 0x40, 0x0, 0x40, 0x0, 0x40, 0x0, 0x22, 0x0, 0x40, 0x0, 0x41, 0x0, 0x40,
- 0x0, 0x23, 0x0, 0x40, 0x0, 0x42, 0x0, 0x40, 0x0, 0x24, 0x0, 0x40, 0x0, 0x43,
- 0x0, 0x40, 0x0, 0x25, 0x0, 0x40, 0x0, 0x44, 0x0, 0x40, 0x0, 0x25, 0x0, 0x40,
- 0x0, 0x45, 0x0, 0x40, 0x0, 0x25, 0x0, 0x40, 0x0, 0x46, 0x0, 0x40, 0x0, 0x25,
- 0x0, 0x40, 0x0, 0x47, 0x0, 0xFF, 0xFF
-};
-
-const byte ROBOT[] = {
- 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0x9, 0x58, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0x0, 0x0,
- 0x58, 0x0, 0x0, 0x0, 0x58, 0x0, 0x0, 0x0, 0x58, 0x0, 0x2, 0x0, 0xFF, 0xFF
-};
-
-const byte ANTKILL[] = {
- 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x0,
- 0x0, 0x0, 0x3C, 0x59, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0x0, 0x0, 0x59,
- 0x0, 0x0, 0x0, 0x59, 0x0, 0x2, 0x0, 0x62, 0x0, 0x0E, 0x0, 0xFF, 0xFF
-};
-
-const byte LOCOHOT[] = {
- 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0, 0x0,
- 0x0, 0x0, 0x19, 0x5A, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0x0, 0x0, 0x5A,
- 0x0, 0x0, 0x0, 0x5A, 0x0, 0x2, 0x0, 0x62, 0x0, 0x3C, 0x0, 0xFF, 0xFF
-};
-
-const byte CRACK[] = {
- 0x2, 0x38, 0x0, 0x38, 0x0, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF, 0x0,
- 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0x0, 0x0, 0x38, 0x0, 0x0, 0x0, 0x38,
- 0x0, 0x0, 0x0, 0x38, 0x0, 0x2, 0x0, 0xFF, 0xFF
-};
-
-const byte LETTER[] = {
- 0x3, 0xFF, 0xFF, 0xFF, 0xFF, 0x1, 0x0, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x0, 0x0, 0x0, 0x0, 0xFF, 0xFF, 0xFF, 0x0, 0x0, 0x30, 0x0, 0x0, 0x0, 0x30,
- 0x0, 0x0, 0x0, 0x30, 0x0, 0x1, 0x0, 0x30, 0x0, 0x0, 0x0, 0x30, 0x0, 0x6, 0x0, 0x30,
- 0x0, 0x0, 0x0, 0x30, 0x0, 0x7, 0x0, 0x30, 0x0, 0x0, 0x0, 0x30, 0x0, 0x8, 0x0, 0x30,
- 0x0, 0x0, 0x0, 0x30, 0x0, 0x9, 0x0, 0x30, 0x0, 0x0, 0x0, 0x30, 0x0, 0x0A, 0x0,
- 0x30, 0x0, 0x0, 0x0, 0x30, 0x0, 0x0B, 0x0, 0x30, 0x0, 0x0, 0x0, 0x30, 0x0,
- 0x0C, 0x0, 0x30, 0x0, 0x0, 0x0, 0x30, 0x0, 0x0D, 0x0, 0x30, 0x0, 0x0, 0x0,
- 0x30, 0x0, 0x0E, 0x0, 0x30, 0x0, 0x0, 0x0, 0x30, 0x0, 0x0F, 0x0, 0x30, 0x0,
- 0x0, 0x0, 0x30, 0x0, 0x10, 0x0, 0x30, 0x0, 0x0, 0x0, 0x30, 0x0, 0x2, 0x0, 0x30,
- 0x0, 0x0, 0x0, 0x30, 0x0, 0x3, 0x0, 0x30, 0x0, 0x0, 0x0, 0x30, 0x0, 0x4, 0x0, 0x30,
- 0x0, 0x0, 0x0, 0x30, 0x0, 0x5, 0x0, 0xFF, 0xFF
-};
-
-const byte OVERBOARD_DEMO[] = {
- 0x02, 0xFF, 0xFF, 0x22, 0x00, 0x01, 0x00, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x00, 0x00, 0x00, 0x00, 0x22, 0x22, 0x00, 0x02, 0x00,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x22, 0x00, 0x00, 0x00, 0x22,
- 0x00, 0x03, 0x00, 0x22, 0x00, 0x06, 0x00, 0x22, 0x00, 0x04,
- 0x00, 0x22, 0x00, 0x07, 0x00, 0x22, 0x00, 0x05, 0x00, 0x62,
- 0x00, 0x1D, 0x00, 0x60, 0x00, 0x00, 0x00, 0x22, 0x00, 0x06,
- 0x00, 0x60, 0x00, 0x01, 0x00, 0x22, 0x00, 0x07, 0x00, 0xFF,
- 0xFF
-};
-
-const byte SHORE1[] = {
- 0x02, 0xFF, 0xFF, 0x55, 0x00, 0x01, 0x00, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x03, 0x00,
- 0x55, 0x00, 0x00, 0x00, 0x55, 0x00, 0x02, 0x00, 0x62, 0x00,
- 0x2E, 0x00, 0x55, 0x00, 0x02, 0x00, 0x62, 0x00, 0x2F, 0x00,
- 0xFF, 0xFF
-};
-
-const byte CHAP8[] = {
- 0x02, 0xFF, 0xFF, 0x60, 0x00, 0x03, 0x00, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x60, 0x00, 0x02, 0x00, 0xFF, 0xFF
-};
-
-const byte *const CHARTBL[] = {
- ELAINE, LIB, FLASHBACK, ALLENDIE, OVERBOARD, PILOT2, TIKAGENT,
- BARTENDER, PILOT1, COOK, BEXPLODE, THORNICK, MAYA, CAPTAIN,
- ALLEN, ARCH, GUARD1, MCANOE, CAMPFIRE, COLONEL, SOLDIERS,
- JWATER, SHOOT, ADIE, DYNAMITE, MAYASHOT, OFFKEV, VALLEY,
- MEANWHILE1, MAYATREE, LOCO, KISS, ROBOT, ANTKILL, LOCOHOT,
- CRACK, LETTER
-};
-
-const byte *const CHARTBL_DEMO[] = {
- ELAINE, LIB, FLASHBACK, ALLENDIE, OVERBOARD_DEMO, PILOT2, TIKAGENT,
- BARTENDER, PILOT1, COOK, BEXPLODE, THORNICK, MAYA, CAPTAIN,
- ALLEN, ARCH, GUARD1, MCANOE, CAMPFIRE, COLONEL, SOLDIERS,
- JWATER, SHOOT, ADIE, DYNAMITE, SHORE1, CHAP8
-};
-
-const char *const INVENTORY_NAMES[] = {
- "RAT", "ALCOHOL", "SAFE COMBINATION", "BEAKER", "MICROFILM",
- "VAULT KEY", "BOLT CUTTERS", "BLOWGUN", "LOVE POTION", "MONEY",
- "DARTS", "TAPE", "JUNGLE POTION", "MOVIE", "CABINET KEY",
- "DISPLAY CASE KEY", "FLITCH'S CAR KEYS", "COAT HANGER",
- "CROWBAR", "COMPASS", "MAP", "LETTER OPENER", "LETTER",
- "DECODER", "DIPPED DART", "LOADED BLOWGUN", "CARD", "JERRYCAN",
- "CIGARETTES", "BIKE PUMP", "PARACHUTE", "PESO", "PEPPERS",
- "MACHETE", "POISON ROOT", "AMMUNITION", "PADDLE", "FISHING NET",
- "RAT TRAP", "CHEESE", "LOADED TRAP", "KNIFE", "CHOPPED PEPPERS",
- "LIGHTER", "LADDER", "SMALL POLE", "JEEP KEY", "CHAIN", "ARROW",
- "FILLED JERRY CAN", "EXPLOSIVES", "GEIGER COUNTER", "VINE",
- "GOLD NUGGET", "HOLLOW REED", "AMAZON QUEEN KEYS", "FISHING POLE",
- "HARPOON", "RAG", "BOTTLE OF RUM", "RAG IN BOTTLE", "MOLOTOV COCKTAIL",
- "JUNGLE PLANT", "LADLE", "WORM", "FISH", "FIREWORKS", "BAITED POLE",
- "FILLED LADLE", "EMERALD", "SMALL KEY", "SCROLL", "LIT EXPLOSIVES",
- "LIGHTER", "BROKEN SPEAR", "SHOE LACES", "TORCH", "LACES AND SPEAR",
- "KNIFE SPEAR", "GARBAGE CAN", "RAFT", "INFLATED RAFT",
- "JASON'S CAR KEYS", "PESO BILLS", "PLANK"
-};
-
-const int FONT2_INDEX[] = {
- 62, 2, 6,
- 0x0000, 0x0019, 0x0021, 0x002e, 0x0041, 0x005a, 0x0073, 0x008c, 0x0093, 0x009b,
- 0x00a3, 0x00bc, 0x00d5, 0x00dd, 0x00ea, 0x00f1, 0x00fe, 0x010b, 0x0118, 0x0125,
- 0x0132, 0x013f, 0x014c, 0x0159, 0x0166, 0x0173, 0x0180, 0x0187, 0x018e, 0x01a7,
- 0x01b4, 0x01cd, 0x01dc, 0x01f5, 0x0208, 0x0215, 0x0222, 0x022f, 0x023c, 0x0249,
- 0x025c, 0x0269, 0x0276, 0x0285, 0x0292, 0x029f, 0x02b2, 0x02c5, 0x02d2, 0x02df,
- 0x02ee, 0x02fb, 0x0308, 0x0315, 0x0322, 0x032f, 0x0342, 0x034f, 0x0362, 0x036f,
- 0x0388, 0x03a1,
-};
-
-const byte FONT2_DATA[] = {
- 0x06, 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, 0xf0, 0xf0, 0xf0, 0xf0,
- 0x00, 0xf0, 0x00, 0x06, 0xf3, 0xc0, 0xc3, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x07, 0x1c, 0x00,
- 0x67, 0x9e, 0xc0, 0x07, 0x1c, 0x00, 0x67, 0x9e, 0xc0, 0x07,
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x09, 0x02, 0xc0, 0x00, 0x3f,
- 0xfc, 0x00, 0xb2, 0xc0, 0x00, 0x3f, 0xfc, 0x00, 0x02, 0xcb,
- 0x00, 0x3f, 0xfc, 0x00, 0x03, 0xc0, 0x00, 0x00, 0x00, 0x00,
- 0x09, 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, 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, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x18, 0x60,
- 0x70, 0x70, 0x60, 0x1c, 0x00, 0x04, 0x60, 0x18, 0x1c, 0x1c,
- 0x1c, 0x70, 0x00, 0x09, 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, 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, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x30,
- 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc0,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf0, 0xf0,
- 0x00, 0x07, 0x00, 0xf0, 0x03, 0xc0, 0x0f, 0x00, 0x3c, 0x00,
- 0xf0, 0x00, 0x00, 0x00, 0x07, 0x3f, 0xc0, 0x70, 0x70, 0x70,
- 0x70, 0x70, 0x70, 0x3f, 0xc0, 0x00, 0x00, 0x07, 0x1f, 0x00,
- 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0xff, 0xf0, 0x00, 0x00,
- 0x08, 0x2b, 0xf0, 0xb0, 0x2c, 0x00, 0xa0, 0x0a, 0x00, 0xff,
- 0xfc, 0x00, 0x00, 0x07, 0xff, 0xc0, 0x00, 0x70, 0x03, 0xc0,
- 0x00, 0x70, 0xff, 0xc0, 0x00, 0x00, 0x07, 0x0b, 0xc0, 0x2d,
- 0xc0, 0xb1, 0xc0, 0xaa, 0xa0, 0x01, 0xc0, 0x00, 0x00, 0x07,
- 0xff, 0xf0, 0x70, 0x00, 0x7f, 0xc0, 0x00, 0xb0, 0xbf, 0xc0,
- 0x00, 0x00, 0x07, 0x2f, 0xc0, 0x70, 0x00, 0x7f, 0xc0, 0x70,
- 0x70, 0x3f, 0xc0, 0x00, 0x00, 0x08, 0xff, 0xfc, 0x00, 0xb0,
- 0x02, 0xc0, 0x02, 0xc0, 0x0b, 0x00, 0x00, 0x00, 0x08, 0x2f,
- 0xf0, 0xb0, 0x1c, 0x2f, 0xf0, 0xb0, 0x1c, 0x2f, 0xf0, 0x00,
- 0x00, 0x07, 0x3f, 0xc0, 0x70, 0x70, 0x3f, 0xf0, 0x00, 0x70,
- 0x3f, 0xc0, 0x00, 0x00, 0x03, 0xf0, 0xf0, 0x00, 0xf0, 0xf0,
- 0x00, 0x03, 0xf0, 0xf0, 0x00, 0xf0, 0x30, 0x00, 0x09, 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, 0x00, 0x00, 0xff, 0xc0, 0x00, 0x00,
- 0xff, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x09, 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, 0xff, 0x00, 0x03, 0xc0, 0x0f, 0x00, 0x3c, 0x00,
- 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x09, 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, 0x00, 0x40, 0x00, 0x01, 0xf0, 0x00, 0x07, 0x1c,
- 0x00, 0x1f, 0xff, 0x00, 0x70, 0x01, 0xc0, 0x00, 0x00, 0x00,
- 0x08, 0x7f, 0xf0, 0x70, 0x1c, 0x7f, 0xf0, 0x70, 0x1c, 0x6a,
- 0xb0, 0x00, 0x00, 0x08, 0x2f, 0xfc, 0x70, 0x00, 0x70, 0x00,
- 0x70, 0x00, 0x2a, 0xa8, 0x00, 0x00, 0x08, 0x7f, 0xf0, 0x70,
- 0x1c, 0x70, 0x1c, 0x70, 0x1c, 0x6a, 0xb0, 0x00, 0x00, 0x07,
- 0x7f, 0xf0, 0x70, 0x00, 0x7f, 0xc0, 0x70, 0x00, 0x6a, 0xa0,
- 0x00, 0x00, 0x07, 0x7f, 0xf0, 0x70, 0x00, 0x7f, 0xc0, 0x70,
- 0x00, 0x60, 0x00, 0x00, 0x00, 0x09, 0x3f, 0xfc, 0x00, 0x70,
- 0x00, 0x00, 0x70, 0xff, 0x00, 0x70, 0x1c, 0x00, 0x2a, 0xbc,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x70, 0x1c, 0x70, 0x1c, 0x7f,
- 0xfc, 0x70, 0x1c, 0x70, 0x1c, 0x00, 0x00, 0x07, 0xff, 0xf0,
- 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0xaa, 0xa0, 0x00, 0x00,
- 0x08, 0x0f, 0xfc, 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x70,
- 0x70, 0x2a, 0x40, 0x00, 0x00, 0x08, 0x70, 0x2c, 0x72, 0xc0,
- 0x7f, 0x00, 0x72, 0xc0, 0x70, 0x28, 0x00, 0x00, 0x07, 0x70,
- 0x00, 0x70, 0x00, 0x70, 0x00, 0x70, 0x00, 0x6a, 0xa0, 0x00,
- 0x00, 0x0a, 0x70, 0x02, 0xc0, 0x7c, 0x09, 0xc0, 0x77, 0x2d,
- 0xc0, 0x71, 0xb1, 0xc0, 0x60, 0xc1, 0x80, 0x00, 0x00, 0x00,
- 0x09, 0x70, 0x07, 0x00, 0x77, 0x07, 0x00, 0x71, 0xc7, 0x00,
- 0x70, 0x77, 0x00, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x2f, 0xf0, 0x70, 0x1c, 0x70, 0x1c, 0x70, 0x1c, 0x2a, 0xa0,
- 0x00, 0x00, 0x08, 0x7f, 0xf0, 0x70, 0x1c, 0x7f, 0xf0, 0x70,
- 0x00, 0x60, 0x00, 0x00, 0x00, 0x08, 0x2f, 0xf0, 0x70, 0x1c,
- 0x70, 0x1c, 0x71, 0xdc, 0x2a, 0xa0, 0x00, 0x1c, 0x00, 0x00,
- 0x08, 0x7f, 0xf0, 0x70, 0x1c, 0x7f, 0xc0, 0x70, 0x70, 0x60,
- 0x18, 0x00, 0x00, 0x07, 0x2f, 0xf0, 0x70, 0x00, 0x2f, 0xc0,
- 0x00, 0xb0, 0xbf, 0xc0, 0x00, 0x00, 0x07, 0xff, 0xf0, 0x0b,
- 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08,
- 0x70, 0x1c, 0x70, 0x1c, 0x70, 0x1c, 0x70, 0xdc, 0x1f, 0x1c,
- 0x00, 0x00, 0x08, 0xf0, 0x1c, 0xb0, 0x1c, 0x70, 0xb0, 0x72,
- 0xc0, 0x7f, 0x00, 0x00, 0x00, 0x0b, 0xf0, 0x00, 0xb0, 0xb0,
- 0x00, 0x70, 0x70, 0xc0, 0x70, 0x72, 0x72, 0xc0, 0x7c, 0x1f,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0xf0, 0x3c, 0x1c, 0xe0, 0x07,
- 0xc0, 0x1c, 0x70, 0x70, 0x1c, 0x00, 0x00, 0x09, 0x70, 0x07,
- 0x00, 0x1c, 0x1c, 0x00, 0x07, 0xf0, 0x00, 0x01, 0xc0, 0x00,
- 0x01, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x08, 0xff, 0xfc, 0x00,
- 0x70, 0x07, 0x00, 0x1c, 0x00, 0xaa, 0xac, 0x00, 0x00, 0x09,
- 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, 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,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00,
-};
-
-const int FONT6x6_INDEX[] = {
- 62, 1, 6,
- 0x0000, 0x0007, 0x000e, 0x0015, 0x001c, 0x0023, 0x002a, 0x0031, 0x0038, 0x003f,
- 0x0046, 0x004d, 0x0054, 0x005b, 0x0062, 0x0069, 0x0070, 0x0077, 0x007e, 0x0085,
- 0x008c, 0x0093, 0x009a, 0x00a1, 0x00a8, 0x00af, 0x00b6, 0x00bd, 0x00c4, 0x00cb,
- 0x00d2, 0x00d9, 0x00e0, 0x00e7, 0x00ee, 0x00f5, 0x00fc, 0x0103, 0x010a, 0x0111,
- 0x0118, 0x011f, 0x0126, 0x012d, 0x0134, 0x013b, 0x0142, 0x0149, 0x0150, 0x0157,
- 0x015e, 0x0165, 0x016c, 0x0173, 0x017a, 0x0181, 0x0188, 0x018f, 0x0196, 0x019d,
- 0x01a4, 0x01ab,
-};
-
-const byte FONT6x6_DATA[] = {
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x30, 0x30,
- 0x30, 0x30, 0x00, 0x30, 0x06, 0xd8, 0xd8, 0x90, 0x00, 0x00,
- 0x00, 0x06, 0x50, 0xf8, 0x50, 0xf8, 0x50, 0x00, 0x06, 0x78,
- 0xa0, 0x70, 0x28, 0xf0, 0x20, 0x06, 0xc8, 0xd0, 0x20, 0x58,
- 0x98, 0x00, 0x06, 0x60, 0xd0, 0x60, 0xe8, 0xd0, 0x68, 0x06,
- 0x30, 0x30, 0x60, 0x00, 0x00, 0x00, 0x06, 0x30, 0x60, 0x60,
- 0x60, 0x30, 0x00, 0x07, 0x30, 0x18, 0x18, 0x18, 0x30, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x20, 0x20,
- 0xf8, 0x20, 0x20, 0x00, 0x06, 0x00, 0x00, 0x00, 0x30, 0x30,
- 0x60, 0x06, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x06, 0x00,
- 0x00, 0x00, 0x60, 0x60, 0x00, 0x06, 0x18, 0x30, 0x60, 0xc0,
- 0x80, 0x00, 0x06, 0x70, 0x98, 0xa8, 0xc8, 0x70, 0x00, 0x06,
- 0x10, 0x30, 0x10, 0x10, 0x10, 0x00, 0x06, 0xf0, 0x08, 0x70,
- 0x80, 0xf8, 0x00, 0x06, 0xf0, 0x08, 0x70, 0x08, 0xf0, 0x00,
- 0x06, 0x30, 0x50, 0x90, 0xf8, 0x10, 0x00, 0x06, 0xf0, 0x80,
- 0xf0, 0x08, 0xf0, 0x00, 0x06, 0x70, 0x80, 0xf0, 0x88, 0x70,
- 0x00, 0x06, 0xf8, 0x08, 0x10, 0x20, 0x20, 0x00, 0x06, 0x70,
- 0x88, 0x70, 0x88, 0x70, 0x00, 0x06, 0x70, 0x88, 0x78, 0x08,
- 0x70, 0x00, 0x06, 0x60, 0x60, 0x00, 0x60, 0x60, 0x00, 0x06,
- 0x60, 0x60, 0x00, 0x60, 0x20, 0x40, 0x06, 0x18, 0x30, 0x60,
- 0x30, 0x18, 0x00, 0x06, 0x00, 0x78, 0x00, 0x78, 0x00, 0x00,
- 0x06, 0x60, 0x30, 0x18, 0x30, 0x60, 0x00, 0x06, 0x70, 0x98,
- 0x30, 0x30, 0x00, 0x30, 0x06, 0x70, 0x88, 0xb8, 0xb0, 0x80,
- 0x78, 0x06, 0x70, 0x88, 0xf8, 0x88, 0x88, 0x00, 0x06, 0xf0,
- 0x88, 0xf0, 0x88, 0xf0, 0x00, 0x06, 0x78, 0x80, 0x80, 0x80,
- 0x78, 0x00, 0x06, 0xf0, 0x88, 0x88, 0x88, 0xf0, 0x00, 0x06,
- 0xf8, 0x80, 0xf0, 0x80, 0xf8, 0x00, 0x06, 0xf8, 0x80, 0xf0,
- 0x80, 0x80, 0x00, 0x06, 0x78, 0x80, 0x98, 0x88, 0x78, 0x00,
- 0x06, 0x88, 0x88, 0xf8, 0x88, 0x88, 0x00, 0x06, 0x70, 0x20,
- 0x20, 0x20, 0x70, 0x00, 0x06, 0x08, 0x08, 0x08, 0x88, 0x70,
- 0x00, 0x06, 0x90, 0xa0, 0xc0, 0xa0, 0x90, 0x00, 0x06, 0x80,
- 0x80, 0x80, 0x80, 0xf0, 0x00, 0x06, 0x88, 0xd8, 0xa8, 0x88,
- 0x88, 0x00, 0x06, 0x88, 0xc8, 0xa8, 0x98, 0x88, 0x00, 0x06,
- 0x70, 0x88, 0x88, 0x88, 0x70, 0x00, 0x06, 0xf0, 0x88, 0xf0,
- 0x80, 0x80, 0x00, 0x06, 0x70, 0x88, 0x88, 0x88, 0x70, 0x18,
- 0x06, 0xf0, 0x88, 0xf0, 0xa0, 0x98, 0x00, 0x06, 0x78, 0x80,
- 0x70, 0x08, 0xf0, 0x00, 0x06, 0xf8, 0x20, 0x20, 0x20, 0x20,
- 0x00, 0x06, 0x88, 0x88, 0x88, 0x88, 0x78, 0x00, 0x06, 0x88,
- 0x88, 0x88, 0x50, 0x20, 0x00, 0x06, 0x88, 0x88, 0xa8, 0xd8,
- 0x88, 0x00, 0x06, 0x88, 0x50, 0x20, 0x50, 0x88, 0x00, 0x06,
- 0x88, 0x88, 0x50, 0x20, 0x20, 0x00, 0x06, 0xf8, 0x10, 0x20,
- 0x40, 0xf8, 0x00, 0x06, 0x78, 0x60, 0x60, 0x60, 0x78, 0x00,
- 0x06, 0xc0, 0x60, 0x30, 0x18, 0x08, 0x00, 0x06, 0x78, 0x18,
- 0x18, 0x18, 0x78, 0x00, 0x00, 0x52, 0x41, 0x54, 0x00, 0x41,
- 0x4c, 0x43, 0x4f, 0x48, 0x4f, 0x4c, 0x00, 0x53, 0x41, 0x46,
- 0x45, 0x20, 0x43, 0x4f, 0x4d, 0x42, 0x49, 0x4e, 0x41, 0x54,
- 0x49, 0x4f, 0x4e, 0x00, 0x42, 0x45, 0x41, 0x4b, 0x45, 0x52,
- 0x00, 0x4d, 0x49, 0x43, 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x4d,
- 0x00, 0x56, 0x41, 0x55, 0x4c, 0x54, 0x20, 0x4b, 0x45, 0x59,
- 0x00, 0x42, 0x4f, 0x4c, 0x54, 0x20, 0x43, 0x55, 0x54, 0x54,
- 0x45, 0x52, 0x53, 0x00, 0x42, 0x4c, 0x4f, 0x57, 0x47, 0x55,
- 0x4e, 0x00, 0x4c, 0x4f, 0x56, 0x45, 0x20, 0x50, 0x4f, 0x54,
- 0x49, 0x4f, 0x4e, 0x00, 0x4d, 0x4f, 0x4e, 0x45, 0x59, 0x00,
- 0x44, 0x41, 0x52, 0x54, 0x53, 0x00, 0x54, 0x41, 0x50, 0x45,
- 0x00, 0x4a, 0x55, 0x4e, 0x47, 0x4c, 0x45, 0x20, 0x50, 0x4f,
- 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x4d, 0x4f, 0x56, 0x49,
-};
-
-const char *const NO_HELP_MESSAGE =
- "WE ARE UNABLE TO PROVIDE YOU WITH ANY MORE HINTS. YOUR IQ \
-HAS DECREASED SO FAR THAT WE CAN NO LONGER PUT THE HINTS IN TERMS \
-YOU CAN UNDERSTAND.";
-const char *const NO_HINTS_MESSAGE = "THE HELP SYSTEM HAS BEEN TURNED OFF FOR THIS GAME.";
-const char *const RIVER_HIT1 = "YOU HIT THE ROCKS AND THE CANOE BEGINS TO LEAK.";
-const char *const RIVER_HIT2 = "YOU HIT THE ROCKS AND THE CANOE DEVELOPS SERIOUS LEAKS.";
-const char *const BAR_MESSAGE = "YOU ARE TOO BUSY TRYING TO KEEP FROM SINKING TO DO THAT";
-const char *const HELPLVLTXT[3] = {
- " LEVEL 1 ",
- " LEVEL 2 ",
- " LEVEL 3 "
-};
-
-const char *const IQLABELS[9] = {
- "VEGETABLE",
- "NEANDERTHAL",
- "LOBOTOMIZED",
- "DENSE",
- "AVERAGE",
- "INTELLIGENT",
- "MURPHYITE",
- "BRILLIANT",
- "GENIUS"
-};
-
-const byte DEATH_SCREENS[58] = {
- 0, 1, 0, 0, 0, 0, 0, 0, 2, 0,
- 0, 2, 4, 2, 1, 0, 0, 0, 0, 0,
- 0, 2, 7, 7, 4, 6, 7, 10, 4, 2,
- 0, 0, 0, 0, 5, 5, 3, 3, 3, 5,
- 8, 8, 11, 9, 8, 12, 0, 1, 9, 8,
- 8, 0, 5, 8, 0, 12, 12, 11
-};
-
-const byte DEATH_SCREENS_DEMO[34] = {
- 1, 2, 1, 1, 1, 1, 1, 1, 4, 1,
- 3, 4, 2, 4, 2, 1, 1, 1, 1, 1,
- 1, 4, 2, 4, 2, 4, 2, 4, 4, 4,
- 1, 1, 1, 1
-};
-
-const char *const DEATH_TEXT[58] = {
- "SAM SALVADOR SPOTS YOU AND LETS YOU HAVE IT.",
- "WHILE TAKING A MOONLIGHT SWIM YOU DISCOVER THAT PIRANHA REALLY CAN STRIP FLESH TO THE BONE.",
- "THE GUARD FILLS YOU FULL OF HOLES BEFORE TOSSING YOU TO THE PIRANHA.",
- "YOU'RE ONLY ABLE TO SWIM HALFWAY ACROSS THE RIVER BEFORE RUNNING OUT OF AIR. "
- "YOU MAKE SO MUCH NOISE GASPING FOR BREATH THAT SAM EASILY FINDS YOU AND LEAVES "
- "YOU IN THE RIVER PERMANENTLY.",
- "SAM SALVADOR NOTICES SOMEONE HAS BEEN PLAYING WITH THE CARGO. "
- "HE TRACKS YOU DOWN AND LETS YOU HAVE IT.",
- "THE GUARD COMES AROUND THE CORNER. HE DECIDES THAT THREE LEAD SLUGS WILL "
- "TEACH YOU TO BE MORE POLITE.",
- "THE CAPTAIN IS WAITING OUTSIDE THE DOOR.",
- "THE CAPTAIN'S RANDOM SHOOTING FINALLY FINDS ITS TARGET.",
- "THE CRATE OUTSIDE THE WINDOW EXPLODES, DESTROYING THE SHIP. "
- "UNFORTUNATELY, YOU'RE STILL ABOARD.",
- "THE DOOR WAS NOT BARRED AND THE CAPTAIN WALKS RIGHT IN AND PARTS YOUR HAIR.",
-
- "",
- "YOU RUN OUT ON DECK, THEN REALIZE THAT MAYA IS STILL TIED UP. "
- "AS YOU TURN TO GO BACK THE BOAT BLOWS UP.",
- "AFTER YOU FAIL TO PROVE YOUR DIVINITY THE NATIVES EAT YOU FOR LUNCH.",
- "THIS IS THE GENERIC DEATH SCENE",
- "YOU ONLY MAKE IT HALFWAY ACROSS THE RIVER BEFORE THE PIRANHA STRIKE.",
- "WITH NOTHING TO PROTECT HIM FROM THE HAIL OF BULLETS ALLEN IS QUICKLY GUNNED DOWN. "
- "JASON AND MAYA SOON FOLLOW...",
- "THE COMBINATION OF THE WIND AND GUNFIRE KNOCK THE CORRUGATED IRON OVER, "
- "LEAVING YOU WITHOUT PROTECTION.",
- "WITHOUT SUFFICIENT AMMUNITION, ALLEN IS UNABLE TO HOLD OFF THE ATTACKERS FOR LONG. "
- "THIS RESULTS IN A SERIOUS CASE OF LEAD POISONING. ADDITIONAL AMMUNITION SHOULD "
- "HAVE BEEN PURCHASED AT THE RIO BLANCO TRADING POST (CHAPTER 6).",
- "ALLEN IS A MARVELOUS SHOT, BUT HIS AMMUNITION IS NOT UNLIMITED. "
- "SOON IT IS ALL OVER.",
- "THE PILOT FEELS YOU ARE TOO CLOSE AND PULLS THE TRIGGER.",
-
- "THE PILOT SHOOTS YOU IN THE HEART, THEN TOSSES YOUR LIFELESS BODY OUT THE DOOR.",
- "THE PLANE CRASHES INTO THE JUNGLE CANOPY AT 200 MPH.",
- "THE CANOE HITS THE ROCKS AND CAPSIZES, AND THE PIRANHA MAKE YOU THEIR LUNCH GUESTS.",
- "YOU TAKE THE WRONG BRANCH AND ACCIDENTALLY DISCOVER THE FOURTH TALLEST WATERFALL "
- "IN SOUTH AMERICA.",
- "YOU TAKE THE WRONG BRANCH AND DISCOVER A VERY HUNGRY TRIBE OF CANNIBALS.",
- "YOU TAKE THE WRONG BRANCH AND BECOME LOST IN THE WINDING WATERWAYS. "
- "YOU WANDER UNTIL YOU STARVE TO DEATH.",
- "YOU TAKE THE WRONG BRANCH AND BECOME TRAPPED IN THE RAPIDS. "
- "EVENTUALLY YOU AND MAYA ARE CRUSHED BETWEEN THE ROCKS.",
- "YOU WAIT AROUND FOR SOME TIME, BUT HANS STROHEIM NEVER SPEAKS TO YOU AGAIN. "
- "FINALLY YOU RETURN HOME KNOWING YOU HAVE FAILED.",
- "DECIDING THAT YOU THREATEN HIM AND HIS WORK, HANS STROHEIM HAS THE NATIVES "
- "IN THE VILLAGE KILL YOU.",
- "YOU DO NOT GET FAR ENOUGH AWAY BEFORE THE DYNAMITE EXPLODES AND YOU ARE BLOWN "
- "INTO A THOUSAND PIECES.",
-
- "YOU ARE STANDING SO CLOSE TO THE ENTRANCE WHEN SANCEZ AND HIS MEN BREAK THROUGH "
- "THE WALL THAT YOU ARE QUICKLY SPOTTED AND SHOT",
- "THE AMAZON SENTINELS SPOT YOU AND FILL YOU FULL OF ARROWS.",
- "SAM MAY BE UGLY, BUT HE'S NOT DEAF. HE HEARS ALL THE NOISE YOU ARE MAKING AND "
- "CANCELS YOUR BOARDING PASS.",
- "WITH THE BAR OFF THE DOOR THE CAPTAIN WALTZES IN AND BLOWS YOU AWAY",
- "THE BEAR WANDERS OFF INTO THE WOODS AND DISTURBS THE TWO LOVEBIRDS. "
- "WHEN THEY COME OUT THEY FIND YOU AND PUT YOU IN THE BIG HOUSE FOR TWENTY YEARS.",
- "WHEN YOU DO NOT LEAVE THE SECURITY AREA QUICKLY ENOUGH YOU ARE ARRESTED AND CONVICTED "
- "AS A COMMIE SPY. YOU EMBARK ON A NEW CAREER STAMPING OUT LICENSE PLATES.",
- "THE HUNGRY BEAR SPOTS YOU AND DECIDES YOU WILL MAKE A NICE APPETIZER.",
- "YOU DISTURB THE BEAR'S LUNCH AND HE EATS YOU FOR DESSERT.",
- "AFTER FAILING TO FIND ANY LUNCH AT THE GARBAGE CAN THE BEAR EATS YOU INSTEAD.",
- "THE SUSPICIOUS LIBRARIAN CALLS SECURITY AND YOU ARE SENT TO JAIL.",
-
- "YOU PLUMMET 10,000 FEET TO YOUR DEATH.",
- "EL LOCO FLIES INTO AN INSANE RAGE AND BEATS YOU TO A BLOODY PULP.",
- "THE WOMAN WALKS OUT THE DOOR AND NEVER RETURNS. YOU SPEND THE REST OF YOUR LIFE "
- "IN A FUTILE ATTEMPT TO LOCATE ALLEN.",
- "YOU SLIP OFF THE PLATFORM AND FALL TO YOUR DEATH.",
- "YOU SLIP OFF THE PLATFORM AND FALL TO YOUR DEATH.",
- "YOU COME TOO CLOSE TO THE POWERFUL JAWS OF THE ANT AND HE SNIPS YOU IN TWO BEFORE "
- "DEVOURING YOU.",
- "B.O.B. HAS A FLAW IN HIS PROGRAMMING THAT DIRECTS HIM TO SHOOT FIRST AND ASK QUESTIONS LATER.",
- "THE PLANE SINKS AND THE PIRHANA ATTACK BEFORE YOU EVEN GET OUT THE DOOR.",
- "MAYA FALLS OFF THE END OF THE BROKEN BRIDGE.",
- "YOUR WEIGHT IS JUST ENOUGH TO CAUSE THE REMAINING SUPPORT CABLE TO SNAP AND YOU "
- "FALL TO THE BOTTOM OF THE GORGE.",
-
- "EVEN WITH REPAIRS THE BRIDGE IS NOT STRONG ENOUGH TO HOLD TWO PEOPLE.",
- "SANCHEZ AND HIS MEN FIND YOU AND HOLD FIRING SQUAD PRACTICE.",
- "THE TWO GUARDS ARE DISTURBED IN THEIR LOVE NEST AND COME LOOKING FOR ANYONE ACTING SUSPICIOUS. "
- "THEY FIND YOU AND SEND YOU UP THE RIVER.",
- "THE PARACHUTE IS NOT LARGE ENOUGH TO SUPPORT YOU, AND YOU HIT THE TREES AT 140 M.P.H.",
- "SANCHEZ AND HIS MEN FOLLOW YOU ACROSS THE BRIDGE AND CUT YOU DOWN IN A HAIL OF GUNFIRE",
- "YOU TRIED TO STAB THE ANT BUT HIS SHELL IS TOO DIFFICULT TO PENETRATE. "
- "YOU NOTICE A SLIGHT CUT IN THE SHELL UNDERNEATH BUT YOU CAN'T GET TO IT "
- "AND HE SNIPS YOU INTO DELICIOUS MEATY CHUNKS.",
- "AFTER THE ANT FINISHES SUCKING ALL OF THE SAP OUT OF THE VINE HE TURNS HIS ATTENTION BACK TO YOU "
- "AND BITES YOUR HEAD OFF.",
- "THE CANTINA OWNER NOTICES YOU ARE TRYING TO STEAL OBJECTS FROM THE TABLES. "
- "TWENTY YEARS LATER YOU ARE RELEASED FROM A SOUTH AMERICAN PRISON."
-};
-
-const char *const DEATH_TEXT_DEMO[34] = {
- "SAM SALVADOR SPOTS YOU AND LETS YOU HAVE IT.",
- "WHILE TAKING A MOONLIGHT SWIM YOU DISCOVER THAT PIRANHA REALLY CAN STRIP FLESH TO THE BONE.",
- "THE GUARD FILLS YOU FULL OF HOLES BEFORE TOSSING YOU TO THE PIRANHA.",
- "YOU'RE ONLY ABLE TO SWIM HALFWAY ACROSS THE RIVER BEFORE RUNNING OUT OF AIR. YOU MAKE SO MUCH NOISE GASPING FOR BREATH THAT SAM EASILY FINDS YOU AND LEAVES YOU IN THE RIVER PERMANENTLY.",
- "SAM SALVADOR NOTICES SOMEONE HAS BEEN PLAYING WITH THE CARGO. HE TRACKS YOU DOWN AND LETS YOU HAVE IT.",
- "THE GUARD COMES AROUND THE CORNER. HE DECIDES THAT THREE LEAD SLUGS WILL TEACH YOU TO BE MORE POLITE.",
- "THE CAPTAIN IS WAITING OUTSIDE THE DOOR.",
- "THE CAPTAIN'S RANDOM SHOOTING FINALLY FINDS ITS TARGET.",
- "THE CRATE OUTSIDE THE WINDOW EXPLODES, DESTROYING THE SHIP. UNFORTUNATELY, YOU'RE STILL ABOARD.",
- "THE DOOR WAS NOT BARRED AND THE CAPTAIN WALKS RIGHT IN AND PARTS YOUR HAIR.",
- "",
- "YOU RUN OUT ON DECK, THEN REALIZE THAT MAYA IS STILL TIED UP. AS YOU TURN TO GO BACK THE BOAT BLOWS UP.",
- "AFTER YOU FAIL TO PROVE YOUR DIVINITY THE NATIVES EAT YOU FOR LUNCH.",
- "THIS IS THE GENERIC DEATH SCENE",
- "YOU ONLY MAKE IT HALFWAY ACROSS THE RIVER BEFORE THE PIRANHA STRIKE.",
- "WITH NOTHING TO PROTECT HIM FROM THE HAIL OF BULLETS ALLEN IS QUICKLY GUNNED DOWN. JASON AND MAYA SOON FOLLOW...",
- "THE COMBINATION OF THE WIND AND GUNFIRE KNOCK THE CORRUGATED IRON OVER, LEAVING YOU WITHOUT PROTECTION.",
- "WITHOUT SUFFICIENT AMMUNITION, ALLEN IS UNABLE TO HOLD OFF THE ATTACKERS FOR LONG. THIS RESULTS IN A SERIOUS CASE OF LEAD POISONING.",
- "ALLEN IS A MARVELOUS SHOT, BUT HIS AMMUNITION IS NOT UNLIMITED. SOON IT IS ALL OVER.",
- "THE PILOT FEELS YOU ARE TOO CLOSE AND PULLS THE TRIGGER.",
- "THE PILOT SHOOTS YOU IN THE HEAD, THEN TOSSES YOUR LIFELESS",
- "THE PLANE CRASHES INTO THE JUNGLE CANOPY AT 200 MPH.",
- "THE CANOE HITS THE ROCKS AND CAPSIZES, AND THE PIRANHA MAKE YOU THEIR LUNCH GUESTS.",
- "YOU ACCIDENTALLY DISCOVER THE FOURTH TALLEST WATERFALL IN SOUTH AMERICA.",
- "YOU DISCOVER A VERY HUNGRY TRIBE OF CANNIBALS.",
- "YOU BECOME LOST IN THE WINDING WATERWAYS AND WANDER UNTIL YOU STARVE TO DEATH.",
- "YOU BECOME TRAPPED IN THE RAPIDS AND ARE CRUSHED BETWEEN THE ROCKS.",
- "YOU WAIT AROUND FOR SOME TIME, BUT HANS STROHEIM NEVER SPEAKS TO YOU AGAIN. FINALLY YOU RETURN HOME KNOWING YOU HAVE FAILED.",
- "DECIDING THAT YOU THREATEN HIM AND HIS WORK, HANS STROHEIM HAS THE NATIVES IN THE VILLAGE KILL YOU.",
- "YOU DO NOT GET FAR ENOUGH AWAY BEFORE THE DYNAMITE EXPLODES AND YOU ARE BLOWN INTO A THOUSAND PIECES.",
- "STANDING OUT IN THE OPEN YOU ARE EXPOSED TO THE HAIL OF BULLETS FROM SANCHEZ' MEN.",
- "THE AMAZON SENTINELS SPOT YOU AND FILL YOU FULL OF ARROWS.",
- "SAM MAY BE UGLY, BUT HE'S NOT DEAF. HE HEARS ALL THE NOISE YOU ARE MAKING AND CANCELS YOUR BOARDING PASS.",
- "WITH THE BAR OFF THE DOOR THE CAPTAIN WALTZES IN AND BLOWS YOU AWAY"
-};
-
const int DEATH_CELLS[13][3] = {
{ 0, 94, 2 },
{ 0, 94, 3 },
@@ -1984,94 +162,6 @@ const int CHAPTER_JUMP[14] = {
0, 12, 10, 15, 19, 25, 31, 36, 45, 46, 29, 55, 61, 0
};
-const int COMBO_TABLE[85][4] = {
- { -1, -1, -1, -1 },
- { 12, 3, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { 24, 25, -1, -1 },
- { 10, 24, -1, -1 },
- { -1, -1, -1, -1 },
- { 8, 24, -1, -1 },
- { -1, -1, -1, -1 },
- { 1, 3, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { 7, 25, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { 80, 81, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { 41, 42, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { 39, 40, -1, -1 },
- { 38, 40, -1, -1 },
- { -1, -1, -1, -1 },
- { 32, 42, 77, 78 },
- { -1, -1, -1, -1 },
- { 60, 61, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { 73, 72, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { 64, 67, -1, -1 },
- { -1, -1, -1, -1 },
- { 59, 60, -1, -1 },
- { 58, 60, -1, -1 },
- { 43, 61, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { 56, 67, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { 50, 72, -1, -1 },
- { 75, 77, -1, -1 },
- { 74, 77, -1, -1 },
- { -1, -1, -1, -1 },
- { 41, 78, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { 29, 81, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 },
- { -1, -1, -1, -1 }
-};
-
const int ANTWALK[24] = {
0, 3, 0,
1, 5, 0,
@@ -2349,8 +439,8 @@ RiverStruct RIVER2OBJECTS[54] = {
RiverStruct *RIVER_OBJECTS[3][2] = {
{ RIVER0OBJECTS, RIVER0OBJECTS + 46 - 1},
- { RIVER1OBJECTS, RIVER0OBJECTS + 50 - 1 },
- { RIVER2OBJECTS, RIVER0OBJECTS + 54 - 1 }
+ { RIVER1OBJECTS, RIVER1OBJECTS + 50 - 1 },
+ { RIVER2OBJECTS, RIVER2OBJECTS + 54 - 1 }
};
const int HELP1COORDS[2][4] = {
diff --git a/engines/access/amazon/amazon_resources.h b/engines/access/amazon/amazon_resources.h
index 10dea02abc..20d90cc5b6 100644
--- a/engines/access/amazon/amazon_resources.h
+++ b/engines/access/amazon/amazon_resources.h
@@ -24,6 +24,8 @@
#define ACCESS_AMAZON_RESOURCES_H
#include "common/scummsys.h"
+#include "common/array.h"
+#include "access/resources.h"
namespace Access {
@@ -42,9 +44,6 @@ struct RiverStruct {
int _offsetY;
};
-extern const char *const FILENAMES[];
-extern const char *const FILENAMES_DEMO[];
-
extern const int SIDEOFFR[];
extern const int SIDEOFFL[];
extern const int SIDEOFFU[];
@@ -58,8 +57,6 @@ extern const int DIAGOFFULY[];
extern const int DIAGOFFDLX[];
extern const int DIAGOFFDLY[];
-extern const byte *const CURSORS[10];
-
extern const int _travelPos[][2];
extern const int OVEROFFR[];
@@ -75,37 +72,6 @@ extern const int OVEROFFULY[];
extern const int OVEROFFDLX[];
extern const int OVEROFFDLY[];
-extern const byte *const ROOM_TABLE[];
-extern const char *const ROOM_DESCR[];
-extern const byte *const ROOM_TABLE_DEMO[];
-extern const int ROOM_NUMB;
-
-extern const byte *const CHARTBL[];
-extern const byte *const CHARTBL_DEMO[];
-
-extern const char *const INVENTORY_NAMES[];
-
-extern const int FONT2_INDEX[];
-
-extern const byte FONT2_DATA[];
-
-extern const int FONT6x6_INDEX[];
-
-extern const byte FONT6x6_DATA[];
-
-extern const char *const NO_HELP_MESSAGE;
-extern const char *const NO_HINTS_MESSAGE;
-extern const char *const RIVER_HIT1;
-extern const char *const RIVER_HIT2;
-extern const char *const BAR_MESSAGE;
-extern const char *const HELPLVLTXT[3];
-extern const char *const IQLABELS[9];
-extern const byte DEATH_SCREENS[58];
-extern const byte DEATH_SCREENS_DEMO[34];
-
-extern const char *const DEATH_TEXT[58];
-extern const char *const DEATH_TEXT_DEMO[34];
-
extern const int DEATH_CELLS[13][3];
extern const int CHAPTER_CELLS[17][3];
@@ -155,6 +121,31 @@ extern const int CAST_END_OBJ1[4][4];
extern const int RMOUSE[10][2];
+class AmazonResources: public Resources {
+protected:
+ /**
+ * Load data from the access.dat file
+ */
+ virtual void load(Common::SeekableReadStream &s);
+public:
+ Common::Array<int> FONT2_INDEX;
+ Common::Array<byte> FONT2_DATA;
+ Common::Array<int> FONT6x6_INDEX;
+ Common::Array<byte> FONT6x6_DATA;
+ Common::String NO_HELP_MESSAGE;
+ Common::String NO_HINTS_MESSAGE;
+ Common::String RIVER_HIT1;
+ Common::String RIVER_HIT2;
+ Common::String BAR_MESSAGE;
+ Common::String HELPLVLTXT[3];
+ Common::String IQLABELS[9];
+public:
+ AmazonResources(AccessEngine *vm) : Resources(vm) {}
+ virtual ~AmazonResources() {}
+};
+
+#define AMRES (*((Amazon::AmazonResources *)_vm->_res))
+
} // End of namespace Amazon
} // End of namespace Access
diff --git a/engines/access/amazon/amazon_room.cpp b/engines/access/amazon/amazon_room.cpp
index 29742f66bd..c027f4e7c6 100644
--- a/engines/access/amazon/amazon_room.cpp
+++ b/engines/access/amazon/amazon_room.cpp
@@ -41,10 +41,7 @@ AmazonRoom::~AmazonRoom() {
}
void AmazonRoom::loadRoom(int roomNumber) {
- if (_vm->isDemo())
- loadRoomData(ROOM_TABLE_DEMO[roomNumber]);
- else
- loadRoomData(ROOM_TABLE[roomNumber]);
+ loadRoomData(&AMRES.ROOMTBL[roomNumber]._data[0]);
}
void AmazonRoom::reloadRoom() {
diff --git a/engines/access/amazon/amazon_scripts.cpp b/engines/access/amazon/amazon_scripts.cpp
index d8f4663401..48438e9c95 100644
--- a/engines/access/amazon/amazon_scripts.cpp
+++ b/engines/access/amazon/amazon_scripts.cpp
@@ -401,10 +401,10 @@ void AmazonScripts::cmdHelp_v2() {
_game->_useItem = 0;
if (_game->_noHints) {
- printString(NO_HELP_MESSAGE);
+ printString(AMRES.NO_HELP_MESSAGE);
return;
} else if (_game->_hintLevel == 0) {
- printString(NO_HINTS_MESSAGE);
+ printString(AMRES.NO_HINTS_MESSAGE);
return;
}
}
@@ -473,12 +473,29 @@ void AmazonScripts::cmdCycleBack() {
if (_vm->_startup == -1)
_vm->_screen->cyclePaletteBackwards();
}
+
void AmazonScripts::cmdChapter() {
+ Resource *activeScript = nullptr;
+
if (_vm->isDemo()) {
cmdSetHelp();
} else {
int chapter = _data->readByte();
+
+ if (!_vm->isCD()) {
+ // For floppy version, the current script remains active even
+ // after the end of the chapter start, so we need to save it
+ activeScript = _resource;
+ _resource = nullptr;
+ _data = nullptr;
+ }
+
_game->startChapter(chapter);
+
+ if (!_vm->isCD()) {
+ assert(!_resource);
+ setScript(activeScript, false);
+ }
}
}
diff --git a/engines/access/animation.cpp b/engines/access/animation.cpp
index 14d7c0d4cc..259396f37e 100644
--- a/engines/access/animation.cpp
+++ b/engines/access/animation.cpp
@@ -53,6 +53,13 @@ Animation::Animation(AccessEngine *vm, Common::SeekableReadStream *stream) : Man
uint32 startOfs = stream->pos();
_type = stream->readByte();
+
+ // WORKAROUND: In Amazon floppy English, there's an animation associated with
+ // the librarian that isn't used, and has junk data. Luckily, it's animation
+ // type is also invalid, so if the _type isn't in range, exit immediately
+ if (_type < 0 || _type > 7)
+ return;
+
_scaling = stream->readSByte();
stream->readByte(); // unk
_frameNumber = stream->readByte();
diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp
index 526690807a..f693e6a3a0 100644
--- a/engines/access/asurface.cpp
+++ b/engines/access/asurface.cpp
@@ -28,6 +28,8 @@
namespace Access {
+const int TRANSPARENCY = 0;
+
SpriteResource::SpriteResource(AccessEngine *vm, Resource *res) {
Common::Array<uint32> offsets;
int count = res->_stream->readUint16LE();
@@ -64,7 +66,7 @@ SpriteFrame::SpriteFrame(AccessEngine *vm, Common::SeekableReadStream *stream, i
// Empty surface
byte *data = (byte *)getPixels();
- Common::fill(data, data + w * h, 0);
+ Common::fill(data, data + w * h, TRANSPARENCY);
// Decode the data
for (int y = 0; y < h; ++y) {
@@ -202,7 +204,7 @@ void ASurface::transBlitFrom(ASurface *src, const Common::Point &destPos) {
byte *destP = (byte *)getBasePtr(destPos.x, destPos.y + yp);
for (int xp = 0; xp < this->w; ++xp, ++srcP, ++destP) {
- if (*srcP != 0)
+ if (*srcP != TRANSPARENCY)
*destP = *srcP;
}
}
@@ -258,7 +260,7 @@ void ASurface::transBlitFrom(ASurface &src) {
blitFrom(src);
}
-void ASurface::blitFrom(Graphics::Surface &src) {
+void ASurface::blitFrom(const Graphics::Surface &src) {
assert(w >= src.w && h >= src.h);
for (int y = 0; y < src.h; ++y) {
const byte *srcP = (const byte *)src.getBasePtr(0, y);
@@ -294,6 +296,13 @@ void ASurface::copyBlock(ASurface *src, const Common::Rect &bounds) {
copyRectToSurface(*src, bounds.left, bounds.top, bounds);
}
+void ASurface::copyTo(ASurface *dest) {
+ if (dest->empty())
+ dest->create(this->w, this->h);
+
+ dest->blitFrom(*this);
+}
+
void ASurface::saveBlock(const Common::Rect &bounds) {
_savedBounds = bounds;
_savedBounds.clip(Common::Rect(0, 0, this->w, this->h));
diff --git a/engines/access/asurface.h b/engines/access/asurface.h
index 022e2534c1..dd05c8067b 100644
--- a/engines/access/asurface.h
+++ b/engines/access/asurface.h
@@ -63,6 +63,8 @@ public:
void create(uint16 width, uint16 height);
+ bool empty() const { return w == 0 || h == 0 || pixels == nullptr; }
+
void clearBuffer();
bool clip(Common::Rect &r);
@@ -107,13 +109,13 @@ public:
virtual void transBlitFrom(ASurface &src);
- virtual void blitFrom(Graphics::Surface &src);
+ virtual void blitFrom(const Graphics::Surface &src);
virtual void copyBuffer(Graphics::Surface *src);
virtual void addDirtyRect(const Common::Rect &r) {}
- void copyTo(ASurface *dest) { dest->blitFrom(*this); }
+ void copyTo(ASurface *dest);
void saveBlock(const Common::Rect &bounds);
diff --git a/engines/access/bubble_box.cpp b/engines/access/bubble_box.cpp
index df8adc1bc6..831ba507a1 100644
--- a/engines/access/bubble_box.cpp
+++ b/engines/access/bubble_box.cpp
@@ -95,8 +95,9 @@ void BubbleBox::placeBubble1(const Common::String &msg) {
void BubbleBox::calcBubble(const Common::String &msg) {
// Save points
- Common::Point printOrg = _vm->_screen->_printOrg;
- Common::Point printStart = _vm->_screen->_printStart;
+ Screen &screen = *_vm->_screen;
+ Common::Point printOrg = screen._printOrg;
+ Common::Point printStart = screen._printStart;
// Figure out maximum width allowed
if (_type == kBoxTypeFileDialog) {
@@ -114,15 +115,15 @@ void BubbleBox::calcBubble(const Common::String &msg) {
int width = 0;
bool lastLine;
do {
- lastLine = _vm->_fonts._font2.getLine(s, _vm->_screen->_maxChars * 6, line, width);
+ lastLine = _vm->_fonts._font2.getLine(s, screen._maxChars * 6, line, width);
_vm->_fonts._printMaxX = MAX(width, _vm->_fonts._printMaxX);
- _vm->_screen->_printOrg.y += 6;
- _vm->_screen->_printOrg.x = _vm->_screen->_printStart.x;
+ screen._printOrg.y += 6;
+ screen._printOrg.x = screen._printStart.x;
} while (!lastLine);
if (_type == kBoxTypeFileDialog)
- ++_vm->_screen->_printOrg.y += 6;
+ ++screen._printOrg.y += 6;
// Determine the width for the area
width = (((_vm->_fonts._printMaxX >> 4) + 1) << 4) + 5;
@@ -131,7 +132,7 @@ void BubbleBox::calcBubble(const Common::String &msg) {
bounds.setWidth(width);
// Determine the height for area
- int y = _vm->_screen->_printOrg.y + 6;
+ int y = screen._printOrg.y + 6;
if (_type == kBoxTypeFileDialog)
y += 6;
int height = y - bounds.top;
@@ -141,6 +142,9 @@ void BubbleBox::calcBubble(const Common::String &msg) {
if (height >= 0)
bounds.setHeight(bounds.height() + 13 - (height % 13));
+ if (bounds.bottom > screen.h)
+ bounds.translate(0, screen.h - bounds.bottom);
+
// Add the new bounds to the bubbles list
_bubbles.push_back(bounds);
diff --git a/engines/access/char.cpp b/engines/access/char.cpp
index aca7262952..cbe1d5d3d9 100644
--- a/engines/access/char.cpp
+++ b/engines/access/char.cpp
@@ -31,7 +31,7 @@ CharEntry::CharEntry(const byte *data, AccessEngine *vm) {
Common::MemoryReadStream s(data, 999);
_charFlag = s.readByte();
- if (vm->getGameID() == GType_MartianMemorandum) {
+ if (vm->getGameID() != GType_Amazon || !vm->isCD()) {
_screenFile.load(s);
_estabIndex = s.readSint16LE();
} else {
@@ -78,25 +78,12 @@ CharEntry::CharEntry() {
/*------------------------------------------------------------------------*/
CharManager::CharManager(AccessEngine *vm) : Manager(vm) {
- switch (vm->getGameID()) {
- case GType_Amazon:
- // Setup character list
- if (_vm->isDemo()) {
- for (int i = 0; i < 27; ++i)
- _charTable.push_back(CharEntry(Amazon::CHARTBL_DEMO[i], vm));
- } else {
- for (int i = 0; i < 37; ++i)
- _charTable.push_back(CharEntry(Amazon::CHARTBL[i], vm));
- }
- break;
-
- case GType_MartianMemorandum:
- for (int i = 0; i < 27; ++i)
- _charTable.push_back(CharEntry(Martian::CHARTBL_MM[i], vm));
- break;
-
- default:
- error("Unknown game");
+ // Setup character list
+ for (uint idx = 0; idx < _vm->_res->CHARTBL.size(); ++idx) {
+ if (_vm->_res->CHARTBL[idx].size() == 0)
+ _charTable.push_back(CharEntry());
+ else
+ _charTable.push_back(CharEntry(&_vm->_res->CHARTBL[idx][0], _vm));
}
_charFlag = 0;
@@ -177,6 +164,10 @@ void CharManager::charMenu() {
} else
error("Game not supported");
+ // Make a backup copy of the screen including the character buttons,
+ // for restoring when erasing conversation boxes
+ screen.copyTo(&_vm->_buffer1);
+
screen.restoreScreen();
delete spr;
}
diff --git a/engines/access/configure.engine b/engines/access/configure.engine
index b1defce946..0082430062 100644
--- a/engines/access/configure.engine
+++ b/engines/access/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine access "Access" no
+add_engine access "Access" yes
diff --git a/engines/access/debugger.cpp b/engines/access/debugger.cpp
index 6cb2bb606c..48c7290249 100644
--- a/engines/access/debugger.cpp
+++ b/engines/access/debugger.cpp
@@ -52,35 +52,26 @@ Debugger *Debugger::init(AccessEngine *vm) {
}
}
+void Debugger::postEnter() {
+ if (!_playMovieFile.empty()) {
+ _vm->playMovie(_playMovieFile, Common::Point(0, 0));
+
+ _playMovieFile.clear();
+ }
+
+ _vm->pauseEngine(false);
+}
+
/*------------------------------------------------------------------------*/
Debugger::Debugger(AccessEngine *vm) : GUI::Debugger(), _vm(vm) {
registerCmd("continue", WRAP_METHOD(Debugger, cmdExit));
registerCmd("scene", WRAP_METHOD(Debugger, Cmd_LoadScene));
registerCmd("cheat", WRAP_METHOD(Debugger, Cmd_Cheat));
-
- switch (vm->getGameID()) {
- case GType_Amazon:
- _sceneNumb = Amazon::ROOM_NUMB;
- _sceneDescr = new Common::String[_sceneNumb];
- for (int i = 0; i < _sceneNumb; i++)
- _sceneDescr[i] = Common::String(Amazon::ROOM_DESCR[i]);
- break;
- case GType_MartianMemorandum:
- _sceneNumb = Martian::ROOM_NUMB;
- _sceneDescr = new Common::String[_sceneNumb];
- for (int i = 0; i < _sceneNumb; i++)
- _sceneDescr[i] = Common::String(Martian::ROOM_DESCR[i]);
- break;
- default:
- _sceneDescr = nullptr;
- _sceneNumb = 0;
- break;
- }
+ registerCmd("playmovie", WRAP_METHOD(Debugger, Cmd_PlayMovie));
}
Debugger::~Debugger() {
- delete[] _sceneDescr;
}
bool Debugger::Cmd_LoadScene(int argc, const char **argv) {
@@ -88,18 +79,18 @@ bool Debugger::Cmd_LoadScene(int argc, const char **argv) {
case 1:
debugPrintf("Current scene is: %d\n\n", _vm->_player->_roomNumber);
- for (int i = 0; i < _sceneNumb; i++)
- if (_sceneDescr[i].size())
- debugPrintf("%d - %s\n", i, _sceneDescr[i].c_str());
+ for (uint i = 0; i < _vm->_res->ROOMTBL.size(); i++)
+ if (!_vm->_res->ROOMTBL[i]._desc.empty())
+ debugPrintf("%d - %s\n", i, _vm->_res->ROOMTBL[i]._desc.c_str());
return true;
case 2: {
int newRoom = strToInt(argv[1]);
- if (newRoom < 0 || newRoom >= _sceneNumb) {
+ if (newRoom < 0 || newRoom >= (int)_vm->_res->ROOMTBL.size()) {
debugPrintf("Invalid Room Number\n");
return true;
}
- if (!_sceneDescr[newRoom].size()) {
+ if (_vm->_res->ROOMTBL[newRoom]._desc.empty()) {
debugPrintf("Unused Room Number\n");
return true;
}
@@ -133,6 +124,19 @@ bool Debugger::Cmd_Cheat(int argc, const char **argv) {
return true;
}
+bool Debugger::Cmd_PlayMovie(int argc, const char **argv) {
+ if (argc != 2) {
+ debugPrintf("Format: playmovie <movie-file>\n");
+ return true;
+ }
+
+ // play gets postponed until debugger is closed
+ Common::String filename = argv[1];
+ _playMovieFile = filename;
+
+ return cmdExit(0, 0);
+}
+
/*------------------------------------------------------------------------*/
namespace Amazon {
diff --git a/engines/access/debugger.h b/engines/access/debugger.h
index f4d8df7634..641b85c19b 100644
--- a/engines/access/debugger.h
+++ b/engines/access/debugger.h
@@ -35,13 +35,14 @@ class AccessEngine;
class Debugger : public GUI::Debugger {
protected:
AccessEngine *_vm;
+ Common::String _playMovieFile;
bool Cmd_LoadScene(int argc, const char **argv);
bool Cmd_Cheat(int argc, const char **argv);
- Common::String *_sceneDescr;
- int _sceneNumb;
+ bool Cmd_PlayMovie(int argc, const char **argv);
public:
static Debugger *init(AccessEngine *vm);
+ void postEnter();
public:
Debugger(AccessEngine *vm);
virtual ~Debugger();
diff --git a/engines/access/detection_tables.h b/engines/access/detection_tables.h
index 124f5fcf0d..9556cd9f67 100644
--- a/engines/access/detection_tables.h
+++ b/engines/access/detection_tables.h
@@ -40,6 +40,22 @@ static const AccessGameDescription gameDescriptions[] = {
0
},
+ {
+ // Amazon Guardians of Eden - Spanish
+ // Provided by dianiu in bug report #6958
+ {
+ "amazon",
+ 0,
+ AD_ENTRY1s("c00.ap", "aeb429ff015596144c0df06886c84825", 303753),
+ Common::ES_ESP,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO1(GUIO_NONE)
+ },
+ GType_Amazon,
+ 0
+ },
+
// Amazon Guardians of Eden - Demo English
{
{
diff --git a/engines/access/events.cpp b/engines/access/events.cpp
index 6ffe67acfb..d62b05c33f 100644
--- a/engines/access/events.cpp
+++ b/engines/access/events.cpp
@@ -74,7 +74,7 @@ void EventsManager::setCursor(CursorType cursorId) {
_invCursor.w / 2, _invCursor.h / 2, 0);
} else {
// Get a pointer to the mouse data to use, and get the cursor hotspot
- const byte *srcP = Amazon::CURSORS[cursorId];
+ const byte *srcP = &_vm->_res->CURSORS[cursorId][0];
int hotspotX = (int16)READ_LE_UINT16(srcP);
int hotspotY = (int16)READ_LE_UINT16(srcP + 2);
srcP += 4;
diff --git a/engines/access/files.cpp b/engines/access/files.cpp
index 4d734a67a9..b9c0f7080d 100644
--- a/engines/access/files.cpp
+++ b/engines/access/files.cpp
@@ -84,20 +84,6 @@ byte *Resource::data() {
/*------------------------------------------------------------------------*/
FileManager::FileManager(AccessEngine *vm) : _vm(vm) {
- switch (vm->getGameID()) {
- case GType_Amazon:
- if (_vm->isDemo())
- _filenames = &Amazon::FILENAMES_DEMO[0];
- else
- _filenames = &Amazon::FILENAMES[0];
- break;
- case GType_MartianMemorandum:
- _filenames = &Martian::FILENAMES[0];
- break;
- default:
- error("Unknown game");
- }
-
_fileNumber = -1;
_setPaletteFlag = true;
}
@@ -215,8 +201,8 @@ void FileManager::handleFile(Resource *res) {
void FileManager::setAppended(Resource *res, int fileNum) {
// Open the file for access
- if (!res->_file.open(_filenames[fileNum]))
- error("Could not open file %s", _filenames[fileNum]);
+ if (!res->_file.open(_vm->_res->FILENAMES[fileNum]))
+ error("Could not open file %s", _vm->_res->FILENAMES[fileNum].c_str());
// If a different file has been opened then previously, load its index
if (_fileNumber != fileNum) {
diff --git a/engines/access/files.h b/engines/access/files.h
index 714ea44c75..d081934e91 100644
--- a/engines/access/files.h
+++ b/engines/access/files.h
@@ -70,7 +70,6 @@ public:
class FileManager {
private:
AccessEngine *_vm;
- const char * const *_filenames;
void openFile(Resource *res, const Common::String &filename);
diff --git a/engines/access/inventory.cpp b/engines/access/inventory.cpp
index 3823b17283..6d1b6d8d0f 100644
--- a/engines/access/inventory.cpp
+++ b/engines/access/inventory.cpp
@@ -66,27 +66,9 @@ InventoryManager::InventoryManager(AccessEngine *vm) : Manager(vm) {
_iconDisplayFlag = true;
_boxNum = 0;
- const char *const *names;
- const int *combineP;
-
- switch (vm->getGameID()) {
- case GType_Amazon:
- names = Amazon::INVENTORY_NAMES;
- combineP = &Amazon::COMBO_TABLE[0][0];
- _inv.resize(85);
- for (uint i = 0; i < _inv.size(); ++i, combineP += 4)
- _inv[i].load(names[i], combineP);
- break;
- case GType_MartianMemorandum:
- names = Martian::INVENTORY_NAMES;
- combineP = nullptr;
- _inv.resize(55);
- for (uint i = 0; i < _inv.size(); ++i)
- _inv[i].load(names[i], nullptr);
- break;
- default:
- error("Unknown game");
- }
+ _inv.resize(_vm->_res->INVENTORY.size());
+ for (uint idx = 0; idx < _inv.size(); ++idx)
+ _inv[idx].load(_vm->_res->INVENTORY[idx]._desc, _vm->_res->INVENTORY[idx]._combo);
for (uint i = 0; i < 26; ++i) {
const int *r = INVCOORDS[i];
@@ -138,6 +120,7 @@ int InventoryManager::newDisplayInv() {
getList();
initFields();
+ files._setPaletteFlag = false;
files.loadScreen(&_vm->_buffer1, 99, 0);
_vm->_buffer1.copyTo(&_vm->_buffer2);
_vm->copyBF2Vid();
@@ -200,7 +183,6 @@ int InventoryManager::newDisplayInv() {
_invModeFlag = false;
events.debounceLeft();
_vm->_timers.restoreTimers();
- _vm->_startup = 1;
int result = 0;
if (!_invRefreshFlag) {
@@ -217,12 +199,15 @@ int InventoryManager::newDisplayInv() {
}
int InventoryManager::displayInv() {
- int *inv = (int *) malloc (Martian::INVENTORY_SIZE * sizeof(int));
+ int *inv = (int *) malloc(_vm->_res->INVENTORY.size() * sizeof(int));
+ const char **names = (const char **)malloc(_vm->_res->INVENTORY.size() * sizeof(const char *));
- for (int i = 0; i < Martian::INVENTORY_SIZE; i++)
+ for (uint i = 0; i < _vm->_res->INVENTORY.size(); i++) {
inv[i] = _inv[i]._value;
+ names[i] = _inv[i]._name.c_str();
+ }
_vm->_events->forceSetCursor(CURSOR_CROSSHAIRS);
- _vm->_invBox->getList(Martian::INVENTORY_NAMES, inv);
+ _vm->_invBox->getList(names, inv);
int btnSelected = 0;
int boxX = _vm->_invBox->doBox_v1(_startInvItem, _startInvBox, btnSelected);
diff --git a/engines/access/martian/martian_game.cpp b/engines/access/martian/martian_game.cpp
index 3fdba8d260..4e858568fe 100644
--- a/engines/access/martian/martian_game.cpp
+++ b/engines/access/martian/martian_game.cpp
@@ -68,8 +68,8 @@ void MartianEngine::initVariables() {
_timers.push_back(te);
}
- _player->_playerX = _player->_rawPlayer.x = _travelPos[_player->_roomNumber][0];
- _player->_playerY = _player->_rawPlayer.y = _travelPos[_player->_roomNumber][1];
+ _player->_playerX = _player->_rawPlayer.x = _res->ROOMTBL[_player->_roomNumber]._travelPos.x;
+ _player->_playerY = _player->_rawPlayer.y = _res->ROOMTBL[_player->_roomNumber]._travelPos.y;
_room->_selectCommand = -1;
_events->setNormalCursor(CURSOR_CROSSHAIRS);
_mouseMode = 0;
@@ -280,10 +280,10 @@ void MartianEngine::doCredits() {
void MartianEngine::setupGame() {
// Load death list
- _deaths.resize(20);
- for (int i = 0; i < 20; ++i) {
- _deaths[i]._screenId = Martian::DEATH_SCREENS[i];
- _deaths[i]._msg = Martian::DEATHMESSAGE[i];
+ _deaths.resize(_res->DEATHS.size());
+ for (uint idx = 0; idx < _deaths.size(); ++idx) {
+ _deaths[idx]._screenId = _res->DEATHS[idx]._screenId;
+ _deaths[idx]._msg = _res->DEATHS[idx]._msg;
}
// Setup timers
@@ -297,14 +297,14 @@ void MartianEngine::setupGame() {
}
// Miscellaneous
- // TODO: Replace with Martian fonts when located
- _fonts._font1.load(Amazon::FONT6x6_INDEX, Amazon::FONT6x6_DATA);
- _fonts._font2.load(Amazon::FONT2_INDEX, Amazon::FONT2_DATA);
+ Amazon::AmazonResources &res = *((Amazon::AmazonResources *)_res);
+ _fonts._font1.load(&res.FONT6x6_INDEX[0], &res.FONT6x6_DATA[0]);
+ _fonts._font2.load(&res.FONT2_INDEX[0], &res.FONT2_DATA[0]);
// Set player room and position
_player->_roomNumber = 7;
- _player->_playerX = _player->_rawPlayer.x = _travelPos[_player->_roomNumber][0];
- _player->_playerY = _player->_rawPlayer.y = _travelPos[_player->_roomNumber][1];
+ _player->_playerX = _player->_rawPlayer.x = _res->ROOMTBL[_player->_roomNumber]._travelPos.x;
+ _player->_playerY = _player->_rawPlayer.y = _res->ROOMTBL[_player->_roomNumber]._travelPos.y;
}
void MartianEngine::showDeathText(Common::String msg) {
diff --git a/engines/access/martian/martian_resources.cpp b/engines/access/martian/martian_resources.cpp
index 474ec2f71c..070fa0f7e3 100644
--- a/engines/access/martian/martian_resources.cpp
+++ b/engines/access/martian/martian_resources.cpp
@@ -27,691 +27,6 @@ namespace Access {
namespace Martian {
-const char *const FILENAMES[] = {
- "R00.AP", "R01.AP", "R02.AP", "R03.AP", "R04.AP", "R05.AP", "R06.AP", "R07.AP",
- "R08.AP", "R09.AP", "R10.AP", "R11.AP", "R12.AP", "R13.AP", "R14.AP", "R15.AP",
- "R16.AP", "R17.AP", "R18.AP", "R19.AP", "R20.AP", "R21.AP", "R22.AP", "R23.AP",
- "R24.AP", "R25.AP", "R26.AP", "R27.AP", "R28.AP", "R29.AP", "R30.AP", "R31.AP",
- "R32.AP", "R33.AP", "R34.AP", "R35.AP", "R36.AP", "R37.AP", "R38.AP", "R39.AP",
- "R40.AP","TITLE.AP","R42.AP","S01.AP", "R44.AP", "R45.AP","SOUND.AP","MUSIC.AP",
- "DEAD.AP","EST.AP", "W02.AP", "C02.AP", "C05.AP", "C04.AP", "C10.AP", "C03.AP",
- "C07.AP", "LOVE.AP","CAFE.AP","C08.AP", "C18.AP", "C19.AP", "C21.AP", "C23.AP",
- "C12.AP", "C16.AP","CAFE1.AP","C05A.AP","C06.AP","C11.AP", "C13.AP", "C20.AP",
- "C16A.AP","C09.AP", "R45.AP", "R46.AP", "R47.AP", "R48.AP", "R49.AP"
-};
-
-const byte MOUSE0[] = {
- // hotspot x and y, uint16 LE
- 0, 0, 0, 0,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0, 2, 0xF7, 5,
- 0, 3, 0xF7, 0xF7, 5,
- 0, 3, 0xF7, 0xF7, 5,
- 0, 4, 0xF7, 0xF7, 0xF7, 5,
- 0, 4, 0xF7, 0xF7, 0xF7, 5,
- 0, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5,
- 0, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5,
- 0, 6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5,
- 0, 6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5,
- 0, 7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5,
- 0, 6, 0xF7, 0xF7, 0xF7, 0xF7, 0xF7, 5,
- 0, 5, 0xF7, 0xF7, 0xF7, 0xF7, 5,
- 2, 3, 0xF7, 0xF7, 5,
- 3, 3, 0xF7, 0xF7, 5,
- 3, 3, 0xF7, 0xF7, 5,
- 4, 2, 0xF7, 5
-};
-const byte MOUSE1[] = {
- // hotspot x and y, uint16 LE
- 7, 0, 7, 0,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 6, 1, 0xF7,
- 4, 5, 0xFF, 0xFF, 0, 0xFF, 0xFF,
- 3, 7, 0xFF, 0, 0, 0, 0, 0, 0xFF,
- 2, 9, 0xFF, 0, 0, 0, 0xF7, 0, 0, 0, 0xFF,
- 1, 11, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF,
- 1, 11, 0xFF, 0, 0, 0, 0, 0xF7, 0, 0, 0, 0, 0xFF,
- 0, 13, 0xF7, 0, 0, 0xF7, 0, 0xF7, 0, 0xF7, 0, 0xF7, 0, 0, 0xF7,
- 1, 11, 0xFF, 0, 0, 0, 0, 0xF7, 0, 0, 0, 0, 0xFF,
- 1, 11, 0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF,
- 2, 9, 0xFF, 0, 0, 0, 0xF7, 0, 0, 0, 0xFF,
- 3, 7, 0xFF, 0, 0, 0, 0, 0, 0xFF,
- 4, 5, 0xFF, 0xFF, 0, 0xFF, 0xFF,
- 6, 1, 0xF7,
- 0, 0,
- 0, 0,
- 0, 0
-};
-const byte MOUSE2[] = {
- // hotspot x and y, uint16 LE
- 8, 0, 8, 0,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0, 0,
- 0, 0,
- 7, 2, 4, 5,
- 7, 2, 4, 5,
- 7, 2, 4, 5,
- 7, 2, 4, 5,
- 7, 2, 4, 5,
- 2, 12, 4, 4, 4, 4, 4, 0, 4, 4, 4, 4, 4, 5,
- 7, 2, 4, 5,
- 7, 2, 4, 5,
- 7, 2, 4, 5,
- 7, 2, 4, 5,
- 7, 2, 4, 5,
- 0, 0,
- 0, 0,
- 0, 0
-};
-const byte MOUSE3[] = {
- // hotspot x and y, uint16 LE
- 0, 0, 0, 0,
- // byte 1: number of skipped pixels
- // byte 2: number of plotted pixels
- // then, pixels
- 0, 11, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 0, 12, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 5,
- 0, 12, 6, 7, 7, 7, 7, 7, 7, 7, 7, 6, 5, 5,
- 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5,
- 0, 12, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 5,
- 0, 12, 6, 6, 6, 6, 5, 0, 0, 6, 6, 6, 6, 5,
- 0, 12, 6, 6, 6, 6, 6, 0, 6, 6, 6, 6, 6, 5,
- 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5,
- 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5,
- 0, 12, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 5,
- 0, 12, 6, 6, 6, 6, 6, 5, 6, 6, 6, 6, 6, 5,
- 0, 12, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5,
- 1, 11, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 0, 0,
- 0, 0,
- 0, 0
-};
-const byte *const CURSORS[4] = { MOUSE0, MOUSE1, MOUSE2, MOUSE3 };
-
-const int _travelPos[][2] = {
- { -1, 0 },
- { 228, 117 },
- { 28, 98 },
- { 161, 140 },
- { 160, 116 },
- { 34, 119 },
- { 166, 105 },
- { 260, 126 },
- { 37, 107 },
- { 78, 139 },
- { 0, 0 },
- { 13, 112 },
- { 0, 0 },
- { 16, 122 },
- { 33, 126 },
- { 10, 160 },
- { 150, 102 },
- { 134, 160 },
- { 160, 76 },
- { 0, 0 },
- { 0, 0 },
- { 36, 116 },
- { 214, 113 },
- { 30, 127 },
- { 143, 131 },
- { 163, 103 },
- { 254, 106 },
- { 28, 161 },
- { 11, 164 },
- { 276, 134 },
- { 93, 118 },
- { 22, 150 },
- { 282, 156 },
- { 149, 92 },
- { 0, 0 },
- { 43, 410 },
- { 0, 0 },
- { 10, 136 },
- { 41, 100 },
- { 157, 97 },
- { -1, 5 },
- { -1, 4 },
- { -1, 10 },
- { -1, 7 },
- { -1, 3 },
- { -1, 8 },
- { -1, 6 },
- { -1, 20 },
- { -1, 18 },
- { -1, 19 },
- { -1, 21 }
-};
-
-const int INVENTORY_SIZE = 55;
-const char *const INVENTORY_NAMES[] = {
- "CAMERA", "LENS", "PHOTOS", "MAIL", "GUN",
- "CASH", "COMLINK", "AMMO", "LOCKPICK KIT", "EARRING",
- "RECIEPTS", "PAPER", "LADDER", "BOOTS", "DOCUMENTS",
- "KNIFE", "DAGGER", "KEYS", "ROCK", "LOG",
- "SHOVEL", "STONE", "REMOTE CONTROL", "FOOD AND WATER", "DOOR CARD KEY",
- "FLASHLIGHT", "INTERLOCK KEY", "TOOLS", "REBREATHER", "JET PACK",
- "ROD", "HCL2", "SAFE CARD KEY", "TUNING FORK", "STONE",
- "ROSE", "KEY", "NOTE", "ALLEN WRENCH", "HOVER BOARD",
- "BLUE PRINTS", "LETTER", "MEMORANDUM", "MARKERS", "FILM",
- "ANDRETTI FILM", "GLASSES", "AMULET", "FACIAL KIT", "CAT FOOD",
- "MONKEY WRENCH", "BIG DICK CARD", "BRA", "BOLT", nullptr
-};
-
-const byte ROOM_TABLE1[] = {
- 0x00, 0x2f, 0x00, 0x0d, 0x00, 0x30, 0x22, 0x30, 0x01, 0x00,
- 0x00, 0x00, 0x01, 0x01, 0x00, 0x03, 0x00, 0xff, 0x01, 0x00,
- 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0xc0, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x05, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE2[] = {
- 0x00, 0x2f, 0x00, 0x0d, 0x00, 0x32, 0x28, 0x25, 0x02, 0x00,
- 0x00, 0x00, 0x02, 0x02, 0x00, 0x03, 0x00, 0xff, 0x02, 0x00,
- 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0xc8, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x06, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE3[] = {
- 0x00, 0x2f, 0x00, 0x0f, 0x00, 0x1e, 0x19, 0x24, 0x03, 0x00,
- 0x00, 0x00, 0x03, 0x03, 0x00, 0x03, 0x00, 0xff, 0x03, 0x00,
- 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x78, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x02, 0x00,
- 0x03, 0x00, 0x04, 0x00, 0x01, 0x00, 0x03, 0x00, 0x05, 0x00,
- 0x01, 0x00, 0x03, 0x00, 0x06, 0x00, 0x01, 0x00, 0x2e, 0x00,
- 0x01, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE4[] = {
- 0x00, 0x2f, 0x00, 0x06, 0x00, 0x36, 0x27, 0x32, 0x04, 0x00,
- 0x00, 0x00, 0x04, 0x04, 0x00, 0x03, 0x00, 0xff, 0x04, 0x00,
- 0x02, 0x00, 0x04, 0x00, 0x01, 0x00, 0xc8, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x07, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x05, 0x00,
- 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE5[] = {
- 0x00, 0x2f, 0x00, 0x00, 0x00, 0x28, 0x19, 0x36, 0x05, 0x00,
- 0x00, 0x00, 0x05, 0x05, 0x00, 0x03, 0x00, 0xff, 0x05, 0x00,
- 0x02, 0x00, 0x05, 0x00, 0x01, 0x00, 0xa0, 0x20, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x02, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x03, 0x00,
- 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE6[] = {
- 0x00, 0x2f, 0x00, 0x07, 0x00, 0x40, 0x36, 0x36, 0x06, 0x00,
- 0x00, 0x00, 0x06, 0x06, 0x00, 0x03, 0x00, 0xff, 0x06, 0x00,
- 0x02, 0x00, 0x06, 0x00, 0x01, 0x00, 0xfe, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x13, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x08, 0x00,
- 0x01, 0x00, 0x2e, 0x00, 0x14, 0x00, 0x01, 0x00, 0x2e, 0x00,
- 0x07, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE7[] = {
- 0x00, 0x2f, 0x00, 0x0e, 0x00, 0x40, 0x32, 0x3b, 0x07, 0x00,
- 0x00, 0x00, 0x07, 0x07, 0x00, 0x03, 0x00, 0xff, 0x07, 0x00,
- 0x02, 0x00, 0x07, 0x00, 0x01, 0x00, 0xfe, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x14, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x07, 0x00,
- 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE8[] = {
- 0x00, 0x2f, 0x00, 0x0a, 0x00, 0x30, 0x22, 0x46, 0x08, 0x00,
- 0x00, 0x00, 0x08, 0x08, 0x00, 0x03, 0x00, 0xff, 0x08, 0x00,
- 0x02, 0x00, 0x08, 0x00, 0x01, 0x00, 0xc0, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xff, 0xff,
-};
-const byte ROOM_TABLE9[] = {
- 0x00, 0x2f, 0x00, 0x07, 0x00, 0x32, 0x0c, 0x29, 0x09, 0x00,
- 0x00, 0x00, 0x09, 0x09, 0x00, 0x03, 0x00, 0xff, 0x09, 0x00,
- 0x02, 0x00, 0x09, 0x00, 0x01, 0x00, 0xc8, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xff, 0xff,
-};
-const byte ROOM_TABLE11[] = {
- 0x00, 0x2f, 0x00, 0x00, 0x00, 0x40, 0x3a, 0x22, 0x0b, 0x00,
- 0x00, 0x00, 0x0b, 0x0b, 0x00, 0x03, 0x00, 0xff, 0x0b, 0x00,
- 0x02, 0x00, 0x0b, 0x00, 0x01, 0x00, 0xfe, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xff, 0xff,
-};
-const byte ROOM_TABLE13[] = {
- 0x00, 0x2f, 0x00, 0x0c, 0x00, 0x40, 0x36, 0x2c, 0x0d, 0x00,
- 0x00, 0x00, 0x0d, 0x0d, 0x00, 0x03, 0x00, 0xff, 0x0d, 0x00,
- 0x02, 0x00, 0x0d, 0x00, 0x01, 0x00, 0xe6, 0x40, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x07, 0x00,
- 0x01, 0x00, 0x2e, 0x00, 0x0b, 0x00, 0x01, 0x00, 0x2e, 0x00,
- 0x15, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE14[] = {
- 0x00, 0x2f, 0x00, 0x05, 0x00, 0x40, 0x3e, 0x33, 0x0e, 0x00,
- 0x00, 0x00, 0x0e, 0x0e, 0x00, 0x03, 0x00, 0xff, 0x0e, 0x00,
- 0x02, 0x00, 0x0e, 0x00, 0x01, 0x00, 0xfe, 0x40, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x09, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x07, 0x00,
- 0x01, 0x00, 0x2e, 0x00, 0x13, 0x00, 0x01, 0x00, 0x2e, 0x00,
- 0x0a, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE15[] = {
- 0x00, 0x2f, 0x00, 0x0c, 0x00, 0x28, 0x0c, 0x5e, 0x0f, 0x00,
- 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x03, 0x00, 0xff, 0x0f, 0x00,
- 0x02, 0x00, 0x0f, 0x00, 0x01, 0x00, 0xb4, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x11, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE16[] = {
- 0x00, 0x2f, 0x00, 0x05, 0x00, 0x28, 0x1e, 0x24, 0x10, 0x00,
- 0x00, 0x00, 0x10, 0x10, 0x00, 0x03, 0x00, 0xff, 0x10, 0x00,
- 0x02, 0x00, 0x10, 0x00, 0x01, 0x00, 0xa0, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x07, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE17[] = {
- 0x00, 0x2f, 0x00, 0x06, 0x00, 0x28, 0x19, 0x2b, 0x11, 0x00,
- 0x00, 0x00, 0x11, 0x11, 0x00, 0x03, 0x00, 0xff, 0x11, 0x00,
- 0x02, 0x00, 0x11, 0x00, 0x01, 0x00, 0xa0, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x05, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE18[] = {
- 0x00, 0x2f, 0x00, 0x00, 0x00, 0x2d, 0x14, 0x3c, 0x12, 0x00,
- 0x00, 0x00, 0x12, 0x12, 0x00, 0x03, 0x00, 0xff, 0x12, 0x00,
- 0x02, 0x00, 0x12, 0x00, 0x01, 0x00, 0xb1, 0x40, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x05, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE21[] = {
- 0x00, 0x2f, 0x00, 0x07, 0x00, 0x3c, 0x2a, 0x29, 0x15, 0x00,
- 0x00, 0x00, 0x15, 0x15, 0x00, 0x03, 0x00, 0xff, 0x15, 0x00,
- 0x02, 0x00, 0x15, 0x00, 0x01, 0x00, 0xf0, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x12, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x07, 0x00,
- 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE22[] = {
- 0x00, 0x2f, 0x00, 0x0a, 0x00, 0x40, 0x2d, 0x27, 0x16, 0x00,
- 0x00, 0x00, 0x16, 0x16, 0x00, 0x03, 0x00, 0xff, 0x16, 0x00,
- 0x02, 0x00, 0x16, 0x00, 0x01, 0x00, 0xfe, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x16, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x07, 0x00,
- 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE23[] = {
- 0x00, 0x2f, 0x00, 0x0a, 0x00, 0x40, 0x38, 0x24, 0x17, 0x00,
- 0x00, 0x00, 0x17, 0x17, 0x00, 0x03, 0x00, 0xff, 0x17, 0x00,
- 0x02, 0x00, 0x17, 0x00, 0x01, 0x00, 0xfe, 0x40, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x0f, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x17, 0x00,
- 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE24[] = {
- 0x00, 0x2f, 0x00, 0x06, 0x00, 0x3e, 0x10, 0x62, 0x18, 0x00,
- 0x00, 0x00, 0x18, 0x18, 0x00, 0x03, 0x00, 0xff, 0x18, 0x00,
- 0x02, 0x00, 0x18, 0x00, 0x01, 0x00, 0xf8, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x16, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE25[] = {
- 0x00, 0x2f, 0x00, 0x0e, 0x00, 0x3e, 0x37, 0x19, 0x19, 0x00,
- 0x00, 0x00, 0x19, 0x19, 0x00, 0x03, 0x00, 0xff, 0x19, 0x00,
- 0x02, 0x00, 0x19, 0x00, 0x01, 0x00, 0xf8, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x10, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x07, 0x00,
- 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE26[] = {
- 0x00, 0x2f, 0x00, 0x06, 0x00, 0x34, 0x28, 0x28, 0x1a, 0x00,
- 0x00, 0x00, 0x1a, 0x1a, 0x00, 0x03, 0x00, 0xff, 0x1a, 0x00,
- 0x02, 0x00, 0x1a, 0x00, 0x01, 0x00, 0xd0, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x07, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE27[] = {
- 0x00, 0x2f, 0x00, 0x0f, 0x00, 0x1b, 0x16, 0x18, 0x1b, 0x00,
- 0x00, 0x00, 0x1b, 0x1b, 0x00, 0x03, 0x00, 0xff, 0x1b, 0x00,
- 0x02, 0x00, 0x1b, 0x00, 0x01, 0x00, 0x70, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x0d, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x07, 0x00,
- 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE28[] = {
- 0x00, 0x2f, 0x00, 0x09, 0x00, 0x25, 0x10, 0x43, 0x1c, 0x00,
- 0x00, 0x00, 0x1c, 0x1c, 0x00, 0x03, 0x00, 0xff, 0x1c, 0x00,
- 0x02, 0x00, 0x1c, 0x00, 0x01, 0x00, 0x94, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xff, 0xff,
-};
-const byte ROOM_TABLE29[] = {
- 0x00, 0x2f, 0x00, 0x0a, 0x00, 0x20, 0x18, 0x56, 0x1d, 0x00,
- 0x00, 0x00, 0x1d, 0x1d, 0x00, 0x03, 0x00, 0xff, 0x1d, 0x00,
- 0x02, 0x00, 0x1d, 0x00, 0x01, 0x00, 0x80, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x17, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE30[] = {
- 0x00, 0x2f, 0x00, 0x07, 0x00, 0x3f, 0x1c, 0x27, 0x1e, 0x00,
- 0x00, 0x00, 0x1e, 0x1e, 0x00, 0x03, 0x00, 0xff, 0x1e, 0x00,
- 0x02, 0x00, 0x1e, 0x00, 0x01, 0x00, 0xfe, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0x1e, 0x00, 0x04, 0x00, 0xff, 0xff, 0x2e, 0x00,
- 0x00, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x07, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x15, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE31[] = {
- 0x00, 0x2f, 0x00, 0x0d, 0x00, 0x32, 0x2e, 0x69, 0x1f, 0x00,
- 0x00, 0x00, 0x1f, 0x1f, 0x00, 0x03, 0x00, 0xff, 0x1f, 0x00,
- 0x02, 0x00, 0x1f, 0x00, 0x01, 0x00, 0xc8, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xff, 0xff,
-};
-const byte ROOM_TABLE32[] = {
- 0x00, 0x2f, 0x00, 0x07, 0x00, 0x40, 0x3b, 0x4b, 0x20, 0x00,
- 0x00, 0x00, 0x20, 0x20, 0x00, 0x03, 0x00, 0xff, 0x20, 0x00,
- 0x02, 0x00, 0x20, 0x00, 0x01, 0x00, 0xfe, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x05, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE33[] = {
- 0x00, 0x2f, 0x00, 0x0b, 0x00, 0x30, 0x10, 0x51, 0x21, 0x00,
- 0x00, 0x00, 0x21, 0x21, 0x00, 0x03, 0x00, 0xff, 0x21, 0x00,
- 0x02, 0x00, 0x21, 0x00, 0x01, 0x00, 0xc0, 0x40, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0xff, 0xff,
-};
-const byte ROOM_TABLE35[] = {
- 0x00, 0x2f, 0x00, 0x0f, 0x00, 0x1e, 0x18, 0x25, 0x23, 0x00,
- 0x00, 0x00, 0x23, 0x23, 0x00, 0x03, 0x00, 0xff, 0x23, 0x00,
- 0x02, 0x00, 0x23, 0x00, 0x01, 0x00, 0x78, 0x18, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x07, 0x00,
- 0x01, 0x00, 0x2e, 0x00, 0x16, 0x00, 0x01, 0x00, 0x2e, 0x00,
- 0x0c, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE37[] = {
- 0x00, 0x2f, 0x00, 0x0f, 0x00, 0x3f, 0x3a, 0x1a, 0x25, 0x00,
- 0x00, 0x00, 0x25, 0x25, 0x00, 0x03, 0x00, 0xff, 0x25, 0x00,
- 0x02, 0x00, 0x25, 0x00, 0x01, 0x00, 0xfe, 0x40, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x0d, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE38[] = {
- 0x00, 0x2f, 0x00, 0x0d, 0x00, 0x40, 0x32, 0x32, 0x26, 0x00,
- 0x00, 0x00, 0x26, 0x26, 0x00, 0x03, 0x00, 0xff, 0x26, 0x00,
- 0x02, 0x00, 0x26, 0x00, 0x01, 0x00, 0xf0, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x0b, 0x00, 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE39[] = {
- 0x00, 0x2f, 0x00, 0x0a, 0x00, 0x3c, 0x10, 0x4c, 0x27, 0x00,
- 0x00, 0x00, 0x27, 0x27, 0x00, 0x03, 0x00, 0xff, 0x27, 0x00,
- 0x02, 0x00, 0x27, 0x00, 0x01, 0x00, 0xf0, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0xff, 0xff, 0x2e, 0x00, 0x00, 0x00, 0x01, 0x00,
- 0x2e, 0x00, 0x11, 0x00, 0x01, 0x00, 0x2e, 0x00, 0x0f, 0x00,
- 0x01, 0x00, 0xff, 0xff,
-};
-const byte ROOM_TABLE47[] = {
- 0x00, 0x2f, 0x00, 0x06, 0x00, 0x28, 0x1e, 0x32, 0x2b, 0x00,
- 0x00, 0x00, 0x46, 0x2b, 0x00, 0x03, 0x00, 0xff, 0x2b, 0x00,
- 0x02, 0x00, 0x2b, 0x00, 0x01, 0x00, 0xf0, 0x00, 0xff, 0xff,
- 0xff, 0xff, 0x2b, 0x00, 0x04, 0x00, 0xff, 0xff, 0x2e, 0x00,
- 0x04, 0x00, 0x01, 0x00, 0xff, 0xff, 0x00,
-};
-const byte *const ROOM_TABLE[] = {
- nullptr, ROOM_TABLE1, ROOM_TABLE2, ROOM_TABLE3, ROOM_TABLE4, ROOM_TABLE5, ROOM_TABLE6,
- ROOM_TABLE7, ROOM_TABLE8, ROOM_TABLE9, nullptr, ROOM_TABLE11, nullptr, ROOM_TABLE13,
- ROOM_TABLE14, ROOM_TABLE15, ROOM_TABLE16, ROOM_TABLE17, ROOM_TABLE18, nullptr, nullptr,
- ROOM_TABLE21, ROOM_TABLE22, ROOM_TABLE23, ROOM_TABLE24, ROOM_TABLE25, ROOM_TABLE26, ROOM_TABLE27,
- ROOM_TABLE28, ROOM_TABLE29, ROOM_TABLE30, ROOM_TABLE31, ROOM_TABLE32, ROOM_TABLE33, nullptr,
- ROOM_TABLE35, nullptr, ROOM_TABLE37, ROOM_TABLE38, ROOM_TABLE39, nullptr, nullptr,
- nullptr, nullptr, nullptr, nullptr, nullptr, ROOM_TABLE47
-};
-
-const char *const ROOM_DESCR[] = {
- nullptr, "TBD ROOM_TABLE1", "TBD ROOM_TABLE2", "TBD ROOM_TABLE3", "TBD ROOM_TABLE4",
- "TBD ROOM_TABLE5", "TBD ROOM_TABLE6", "TBD ROOM_TABLE7", "TBD ROOM_TABLE8", "TBD ROOM_TABLE9",
- nullptr, "TBD ROOM_TABLE11", nullptr, "TBD ROOM_TABLE13", "TBD ROOM_TABLE14",
- "TBD ROOM_TABLE15", "TBD ROOM_TABLE16", "TBD ROOM_TABLE17", "TBD ROOM_TABLE18", nullptr,
- nullptr, "TBD ROOM_TABLE21", "TBD ROOM_TABLE22", "TBD ROOM_TABLE23", "TBD ROOM_TABLE24",
- "TBD ROOM_TABLE25", "TBD ROOM_TABLE26", "TBD ROOM_TABLE27", "TBD ROOM_TABLE28", "TBD ROOM_TABLE29",
- "TBD ROOM_TABLE30", "TBD ROOM_TABLE31", "TBD ROOM_TABLE32", "TBD ROOM_TABLE33", nullptr,
- "TBD ROOM_TABLE35", nullptr, "TBD ROOM_TABLE37", "TBD ROOM_TABLE38", "TBD ROOM_TABLE39",
- nullptr, nullptr, nullptr, nullptr, nullptr,
- nullptr, nullptr, "TBD ROOM_TABLE47"
-};
-
-const int ROOM_NUMB = 48;
-
-const byte MMCHAR_0[] = {
- 0x02, 0x31, 0x00, 0x08, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff,
-};
-const byte MMCHAR_2[] = {
- 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x32, 0x33, 0x00, 0x01, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0x33, 0x00, 0x00, 0x00, 0x33,
- 0x00, 0x02, 0x00, 0x33, 0x00, 0x0b, 0x00, 0x33, 0x00, 0x03,
- 0x00, 0x33, 0x00, 0x0c, 0x00, 0x33, 0x00, 0x04, 0x00, 0x33,
- 0x00, 0x0d, 0x00, 0x33, 0x00, 0x05, 0x00, 0x33, 0x00, 0x0e,
- 0x00, 0x33, 0x00, 0x06, 0x00, 0x33, 0x00, 0x0f, 0x00, 0x33,
- 0x00, 0x07, 0x00, 0x33, 0x00, 0x10, 0x00, 0x33, 0x00, 0x08,
- 0x00, 0x33, 0x00, 0x11, 0x00, 0x33, 0x00, 0x09, 0x00, 0x33,
- 0x00, 0x12, 0x00, 0x33, 0x00, 0x0a, 0x00, 0x33, 0x00, 0x13,
- 0x00, 0xff, 0xff,
-};
-const byte MMCHAR_3[] = {
- 0x02, 0x31, 0x00, 0x03, 0x00, 0x35, 0x00, 0x37, 0x00, 0x02,
- 0x00, 0x80, 0x00, 0xf7, 0x00, 0x4b, 0x37, 0x00, 0x01, 0x00,
- 0xff, 0x37, 0x00, 0x03, 0x00, 0x37, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_4[] = {
- 0x01, 0x31, 0x00, 0x0a, 0x00, 0x36, 0x00, 0x35, 0x00, 0x02,
- 0x00, 0x80, 0x00, 0xf7, 0x00, 0x49, 0x35, 0x00, 0x01, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0x35, 0x00, 0x00, 0x00, 0x35,
- 0x00, 0x03, 0x00, 0x35, 0x00, 0x0c, 0x00, 0x35, 0x00, 0x04,
- 0x00, 0x35, 0x00, 0x0d, 0x00, 0x35, 0x00, 0x05, 0x00, 0x35,
- 0x00, 0x0e, 0x00, 0x35, 0x00, 0x06, 0x00, 0x35, 0x00, 0x0f,
- 0x00, 0x35, 0x00, 0x07, 0x00, 0x35, 0x00, 0x10, 0x00, 0x35,
- 0x00, 0x08, 0x00, 0x35, 0x00, 0x11, 0x00, 0x35, 0x00, 0x09,
- 0x00, 0x35, 0x00, 0x12, 0x00, 0x35, 0x00, 0x0a, 0x00, 0x35,
- 0x00, 0x13, 0x00, 0x35, 0x00, 0x0b, 0x00, 0x35, 0x00, 0x14,
- 0x00, 0xff, 0xff,
-};
-const byte MMCHAR_5[] = {
- 0x01, 0x31, 0x00, 0x08, 0x00, 0x37, 0x00, 0x34, 0x00, 0x02,
- 0x00, 0x80, 0x00, 0xf7, 0x00, 0x48, 0x34, 0x00, 0x01, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0x34, 0x00, 0x00, 0x00, 0x43,
- 0x00, 0x00, 0x00, 0x34, 0x00, 0x03, 0x00, 0x43, 0x00, 0x01,
- 0x00, 0x34, 0x00, 0x04, 0x00, 0x43, 0x00, 0x02, 0x00, 0x34,
- 0x00, 0x05, 0x00, 0x43, 0x00, 0x03, 0x00, 0x34, 0x00, 0x06,
- 0x00, 0x43, 0x00, 0x04, 0x00, 0x34, 0x00, 0x07, 0x00, 0x43,
- 0x00, 0x05, 0x00, 0x34, 0x00, 0x08, 0x00, 0x43, 0x00, 0x06,
- 0x00, 0x34, 0x00, 0x09, 0x00, 0x43, 0x00, 0x07, 0x00, 0x34,
- 0x00, 0x0a, 0x00, 0x43, 0x00, 0x08, 0x00, 0x34, 0x00, 0x0b,
- 0x00, 0x43, 0x00, 0x09, 0x00, 0x34, 0x00, 0x0c, 0x00, 0x43,
- 0x00, 0x0a, 0x00, 0x34, 0x00, 0x0d, 0x00, 0x43, 0x00, 0x0b,
- 0x00, 0x34, 0x00, 0x0e, 0x00, 0x43, 0x00, 0x0c, 0x00, 0x34,
- 0x00, 0x0f, 0x00, 0x43, 0x00, 0x0d, 0x00, 0x34, 0x00, 0x10,
- 0x00, 0xff, 0xff,
-};
-const byte MMCHAR_6[] = {
- 0x02, 0x31, 0x00, 0x03, 0x00, 0x38, 0x00, 0x44, 0x00, 0x03,
- 0x00, 0x80, 0x00, 0xf7, 0x00, 0x4e, 0x44, 0x00, 0x01, 0x00,
- 0xff, 0x44, 0x00, 0x02, 0x00, 0x44, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_7[] = {
- 0x02, 0x31, 0x00, 0x01, 0x00, 0x39, 0x00, 0x38, 0x00, 0x02,
- 0x00, 0x80, 0x00, 0xf7, 0x00, 0x4c, 0x38, 0x00, 0x01, 0x00,
- 0xff, 0x38, 0x00, 0x03, 0x00, 0x38, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_8[] = {
- 0x03, 0xff, 0xff, 0xff, 0xff, 0x3a, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x3b, 0x00, 0x01, 0x00,
- 0xff, 0x3b, 0x00, 0x02, 0x00, 0x3b, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_9[] = {
- 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x59, 0x4a, 0x00, 0x01, 0x00,
- 0xff, 0x4a, 0x00, 0x02, 0x00, 0x4a, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_10[] = {
- 0x01, 0x31, 0x00, 0x0a, 0x00, 0x3c, 0x00, 0x36, 0x00, 0x02,
- 0x00, 0x80, 0x00, 0xf7, 0x00, 0x4a, 0x36, 0x00, 0x01, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0x36, 0x00, 0x00, 0x00, 0x36,
- 0x00, 0x03, 0x00, 0x36, 0x00, 0x13, 0x00, 0x36, 0x00, 0x04,
- 0x00, 0x36, 0x00, 0x14, 0x00, 0x36, 0x00, 0x05, 0x00, 0x36,
- 0x00, 0x15, 0x00, 0x36, 0x00, 0x06, 0x00, 0x36, 0x00, 0x16,
- 0x00, 0x36, 0x00, 0x07, 0x00, 0x36, 0x00, 0x17, 0x00, 0x36,
- 0x00, 0x08, 0x00, 0x36, 0x00, 0x18, 0x00, 0x36, 0x00, 0x09,
- 0x00, 0x36, 0x00, 0x19, 0x00, 0x36, 0x00, 0x0a, 0x00, 0x36,
- 0x00, 0x1a, 0x00, 0x36, 0x00, 0x0b, 0x00, 0x36, 0x00, 0x1b,
- 0x00, 0x36, 0x00, 0x0c, 0x00, 0x36, 0x00, 0x1c, 0x00, 0x36,
- 0x00, 0x0d, 0x00, 0x36, 0x00, 0x1d, 0x00, 0x36, 0x00, 0x0e,
- 0x00, 0x36, 0x00, 0x1e, 0x00, 0x36, 0x00, 0x0f, 0x00, 0x36,
- 0x00, 0x1f, 0x00, 0x36, 0x00, 0x10, 0x00, 0x36, 0x00, 0x20,
- 0x00, 0x36, 0x00, 0x11, 0x00, 0x36, 0x00, 0x21, 0x00, 0x36,
- 0x00, 0x12, 0x00, 0x36, 0x00, 0x22, 0x00, 0xff, 0xff,
-};
-const byte MMCHAR_11[] = {
- 0x03, 0xff, 0xff, 0xff, 0xff, 0x3d, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x55, 0x45, 0x00, 0x01, 0x00,
- 0xff, 0x45, 0x00, 0x02, 0x00, 0x45, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_12[] = {
- 0x03, 0xff, 0xff, 0xff, 0xff, 0x3e, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x4f, 0x40, 0x00, 0x01, 0x00,
- 0xff, 0x40, 0x00, 0x02, 0x00, 0x40, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_13[] = {
- 0x00, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x46, 0x00, 0x02,
- 0x00, 0x80, 0x00, 0xf7, 0x00, 0x56, 0x46, 0x00, 0x01, 0x00,
- 0xff, 0x46, 0x00, 0x03, 0x00, 0x46, 0x00, 0x00, 0x00, 0x46,
- 0x00, 0x04, 0x00, 0x46, 0x00, 0x0d, 0x00, 0x46, 0x00, 0x05,
- 0x00, 0x46, 0x00, 0x0e, 0x00, 0x46, 0x00, 0x06, 0x00, 0x46,
- 0x00, 0x0f, 0x00, 0x46, 0x00, 0x07, 0x00, 0x46, 0x00, 0x10,
- 0x00, 0x46, 0x00, 0x08, 0x00, 0x46, 0x00, 0x11, 0x00, 0x46,
- 0x00, 0x09, 0x00, 0x46, 0x00, 0x12, 0x00, 0x46, 0x00, 0x0a,
- 0x00, 0x46, 0x00, 0x13, 0x00, 0x46, 0x00, 0x0b, 0x00, 0x46,
- 0x00, 0x14, 0x00, 0x46, 0x00, 0x0c, 0x00, 0x46, 0x00, 0x15,
- 0x00, 0xff, 0xff,
-};
-const byte MMCHAR_15[] = {
- 0x00, 0xff, 0xff, 0xff, 0xff, 0x41, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x57, 0x47, 0x00, 0x01, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0x47, 0x00, 0x00, 0x00, 0x47,
- 0x00, 0x02, 0x00, 0x47, 0x00, 0x05, 0x00, 0x47, 0x00, 0x03,
- 0x00, 0x47, 0x00, 0x06, 0x00, 0x47, 0x00, 0x04, 0x00, 0x47,
- 0x00, 0x07, 0x00, 0xff, 0xff,
-};
-const byte MMCHAR_16[] = {
- 0x03, 0xff, 0xff, 0xff, 0xff, 0x42, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x54, 0x41, 0x00, 0x01, 0x00,
- 0xff, 0x41, 0x00, 0x02, 0x00, 0x41, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_18[] = {
- 0x02, 0x31, 0x00, 0x07, 0x00, 0x44, 0x00, 0x3c, 0x00, 0x03,
- 0x00, 0x80, 0x00, 0xf7, 0x00, 0x50, 0x3c, 0x00, 0x01, 0x00,
- 0xff, 0x3c, 0x00, 0x02, 0x00, 0x3c, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_19[] = {
- 0x02, 0x31, 0x00, 0x07, 0x00, 0x45, 0x00, 0x3d, 0x00, 0x03,
- 0x00, 0x80, 0x00, 0xf7, 0x00, 0x51, 0x3d, 0x00, 0x01, 0x00,
- 0xff, 0x3d, 0x00, 0x02, 0x00, 0x3d, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_20[] = {
- 0x02, 0x31, 0x00, 0x02, 0x00, 0x46, 0x00, 0x48, 0x00, 0x02,
- 0x00, 0x80, 0x00, 0xf7, 0x00, 0x58, 0x48, 0x00, 0x01, 0x00,
- 0xff, 0x48, 0x00, 0x03, 0x00, 0x48, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_21[] = {
- 0x02, 0x31, 0x00, 0x07, 0x00, 0x47, 0x00, 0x3e, 0x00, 0x03,
- 0x00, 0x80, 0x00, 0xf7, 0x00, 0x52, 0x3e, 0x00, 0x01, 0x00,
- 0xff, 0x3e, 0x00, 0x02, 0x00, 0x3e, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_23[] = {
- 0x02, 0x31, 0x00, 0x08, 0x00, 0x49, 0x00, 0x3f, 0x00, 0x03,
- 0x00, 0x80, 0x00, 0xf7, 0x00, 0x53, 0x3f, 0x00, 0x01, 0x00,
- 0xff, 0x3f, 0x00, 0x02, 0x00, 0x3f, 0x00, 0x00, 0x00, 0xff,
- 0xff,
-};
-const byte MMCHAR_24[] = {
- 0x02, 0x32, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x47, 0x32, 0x00, 0x02, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0x32, 0x00, 0x01, 0x00, 0x32,
- 0x00, 0x03, 0x00, 0x32, 0x00, 0x0a, 0x00, 0x32, 0x00, 0x04,
- 0x00, 0x32, 0x00, 0x0b, 0x00, 0x32, 0x00, 0x05, 0x00, 0x32,
- 0x00, 0x0c, 0x00, 0x32, 0x00, 0x06, 0x00, 0x32, 0x00, 0x0d,
- 0x00, 0x32, 0x00, 0x07, 0x00, 0x32, 0x00, 0x0e, 0x00, 0x32,
- 0x00, 0x08, 0x00, 0x32, 0x00, 0x0f, 0x00, 0x32, 0x00, 0x09,
- 0x00, 0x32, 0x00, 0x10, 0x00, 0xff, 0xff
-};
-const byte MMCHAR_25[] = {
- 0x02, 0x39, 0x00, 0x01, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
- 0x39, 0x00, 0x00, 0x00, 0x39, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0xFF, 0xFF
-};
-const byte MMCHAR_26[] = {
- 0x01, 0x3a, 0x00, 0x01, 0x00, 0x0a, 0x00, 0xff, 0xff, 0xff,
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x3a, 0x00, 0x02, 0x00,
- 0xff, 0x3a, 0x00, 0x03, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x42,
- 0x00, 0x00, 0x00, 0x3a, 0x00, 0x04, 0x00, 0x42, 0x00, 0x01,
- 0x00, 0x3a, 0x00, 0x05, 0x00, 0x42, 0x00, 0x02, 0x00, 0x3a,
- 0x00, 0x06, 0x00, 0x42, 0x00, 0x03, 0x00, 0x3a, 0x00, 0x07,
- 0x00, 0x42, 0x00, 0x04, 0x00, 0x3a, 0x00, 0x08, 0x00, 0x42,
- 0x00, 0x05, 0x00, 0x3a, 0x00, 0x09, 0x00, 0x42, 0x00, 0x06,
- 0x00, 0x3a, 0x00, 0x0a, 0x00, 0x42, 0x00, 0x07, 0x00, 0x3a,
- 0x00, 0x0b, 0x00, 0x42, 0x00, 0x08, 0x00, 0x3a, 0x00, 0x0c,
- 0x00, 0x42, 0x00, 0x09, 0x00, 0x3a, 0x00, 0x0d, 0x00, 0x42,
- 0x00, 0x0a, 0x00, 0x3a, 0x00, 0x0e, 0x00, 0x42, 0x00, 0x0b,
- 0x00, 0x3a, 0x00, 0x0f, 0x00, 0x42, 0x00, 0x0c, 0x00, 0x3a,
- 0x00, 0x10, 0x00, 0x42, 0x00, 0x0d, 0x00, 0x3a, 0x00, 0x11,
- 0x00, 0x42, 0x00, 0x0e, 0x00, 0x3a, 0x00, 0x12, 0x00, 0x42,
- 0x00, 0x0f, 0x00, 0x3a, 0x00, 0x13, 0x00, 0x42, 0x00, 0x10,
- 0x00, 0x3a, 0x00, 0x14, 0x00, 0x42, 0x00, 0x11, 0x00, 0x3a,
- 0x00, 0x15, 0x00, 0xff, 0xff
-};
-const byte MMCHAR_27[] = {
- 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0x00, 0x00, 0x00, 0x00, 0x58, 0x49, 0x00, 0x01, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0xff, 0x49, 0x00, 0x00, 0x00, 0x49,
- 0x00, 0x02, 0x00, 0x49, 0x00, 0x0a, 0x00, 0x49, 0x00, 0x03,
- 0x00, 0x49, 0x00, 0x0b, 0x00, 0x49, 0x00, 0x04, 0x00, 0x49,
- 0x00, 0x0c, 0x00, 0x49, 0x00, 0x05, 0x00, 0x49, 0x00, 0x0d,
- 0x00, 0x49, 0x00, 0x06, 0x00, 0x49, 0x00, 0x0e, 0x00, 0x49,
- 0x00, 0x07, 0x00, 0x49, 0x00, 0x0f, 0x00, 0x49, 0x00, 0x08,
- 0x00, 0x49, 0x00, 0x10, 0x00, 0x49, 0x00, 0x09, 0x00, 0x49,
- 0x00, 0x11, 0x00, 0xff, 0xff,
-};
-
-// HACK: MMCHAR_0 has been used to replace the missing CHAR: 1, 14, 17 and 22
-const byte *const CHARTBL_MM[] = {
- MMCHAR_0, MMCHAR_0, MMCHAR_2, MMCHAR_3, MMCHAR_4,
- MMCHAR_5, MMCHAR_6, MMCHAR_7, MMCHAR_8, MMCHAR_9,
- MMCHAR_10, MMCHAR_11, MMCHAR_12, MMCHAR_13, MMCHAR_0,
- MMCHAR_15, MMCHAR_16, MMCHAR_0, MMCHAR_18, MMCHAR_19,
- MMCHAR_20, MMCHAR_21, MMCHAR_0, MMCHAR_23, MMCHAR_24,
- MMCHAR_25, MMCHAR_26, MMCHAR_27
-};
-
const int SIDEOFFR[] = { 4, 0, 7, 10, 3, 1, 2, 13, 0, 0, 0, 0 };
const int SIDEOFFL[] = { 11, 6, 1, 4, 10, 6, 1, 4, 0, 0, 0, 0 };
const int SIDEOFFU[] = { 1, 2, 0, 2, 2, 1, 1, 0, 0, 0, 0, 0 };
@@ -765,7 +80,7 @@ const char *const TRAVDATA[] = {
"COOPER BRADBURY", nullptr
};
-const char *const _askTBL[] = {
+const char *const ASK_TBL[] = {
"NONE", "MARSHALL ALEXANDER", "TERRAFORM CORP.", "COLLIER STANTON", "ROCKWELL BACHE",
"JOCQUES SPARROW", "NORA DESMOND ALEXANDER", "GALACTIC PICTURES", "LAWRENCE BARKLEY", "TMS",
"MAC MALDEN", "STANTON EXPEDITION", "LOWELL PERCIVAL", "CHANTAL VARGAS", "RICK LOGAN",
@@ -783,33 +98,6 @@ byte HELP[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};
-const byte DEATH_SCREENS[] = {
- 5, 5, 3, 3, 7, 4, 6, 2, 2, 2, 1, 5, 3, 5, 2, 8, 5, 3, 8, 5
-};
-
-const char *const DEATHMESSAGE[] = {
- "A VICIOUS THUG PULLS OUT HIS GUN AND AIR CONDITIONS YOUR BRAIN.",
- "BIG DICK COMES BACK AND ANNOUNCES YOUR TIME IS UP. ONE OF HIS BOYS PROCEEDS TO PART YOUR EYEBROWS.",
- "ALTHOUGH HIS FIRST SHOT MISSED, THE PUNK FINDS YOU AND TURNS YOU INTO A DOUGHNUT.",
- "THE CREEP SPOTS YOU. HE TURNS AND FIRES HIS WEAPON. IT BURNS A HOLE A BUZZARD CAN FLY THROUGH.",
- "OBVIOUSLY RICK LOGAN HAS A FEW TRICK UP HIS SLEEVE. A TREMENDOUS WEIGHT HITS YOUR HEAD. YOU MUMBLE; WATCH OUT FOR THAT TREE...",
- "SLOWLY SINKING IN THE SLIMY OOZE, YOU THINK OF SEVERAL JELLO WRESTLING MATCHES YOU'VE ATTENDED. BUT NO MORE...",
- "THE PATH SUDDENLY GIVES WAY AND YOU FEEL MANY STAKES TEAR THROUGH YOUR FLESH. HOW DO YOU LIKE YOUR STAKE",
- "THE SNAKE SINKS ITS FANGS INTO YOU LEG. THE POISON WORKS QUICKLY. THE SNAKE THEN SWALLOWS YOU WHOLE.",
- "YOU FADE AWAY, GLOWING LIKE A LIGHTBULB.",
- "YOU TOUCH THE BUBBLING RADIOACTIVE SELTZER. IT IMMEDIATELY CAUSES VITAL ORGANS TO ELONGATE AND EXPLODE. YOU DIE WITH AN ABSURD AND FOOLISH LOOK ON YOUR FACE.",
- "THE DOGS PRETTY HUNGRY. IT WON'T TAKE HIM LONG TO FINISH SO SIT BACK AND ENJOY IT.",
- "ROCKY DOESN'T LIKE BEING FOLLOWED. HE DECIDES TO BEAT YOU. WITHIN AND INCH OF YOUR LIFE. UNFORTUNATELY, HE MISJUDGED THE DISTANCE",
- "YOU STUMBLE INTO DEADLY LASER FIRE.",
- "THE OUTPOST AND YOUR BODY PARTS ARE BLOWN TO KINGDOM COME.",
- "YOU REACH THE TOP, BUT YOUR AIR SOON RUNS OUT LEAVING YOU BREATHLESS.",
- "YOU DIE IN THE FIERY EXPLOSION.",
- "YOU FALL HUNDREDS OF FEET TO YOUR DEATH.",
- "YOU WALK ONTO A PRESSURE SENSITIVE SECURITY PAD. A LASER ZEROS IN AND BLOWS A HOLE THE SIZE OF A SUBARU TIRE THROUGH YOU.",
- "DANGERFIELD'S EXPERIMENT BACKFIRES. IT RELEASES A DEMON FROM HIS SUBCONSCIOUS WHICH DESTROYS THE ENTIRE PLANET.",
- "ONCE DANGERFIELD GETS OUT OF HIS CHAMBER, HE PULLS OUT A WEAPON AND LETS YOU HAVE IT."
-};
-
const char *const SPEC7MESSAGE = {
"THOMAS DANGERFIELD'S MAD EXPERIMENT OF ATTEMPTING TO HARNESS THE STONE'S POWER, ENDED HIS LIFE. DANGERFIELD WAS A DECENT HUMAN " \
"BEING ONCE, BUT WAS DRIVEN INSANE BY HIS QUEST FOR THE ULTIMATE POWER. ALEXIS AND I DECIDE THAT DEACON HAWKE IS THE ONLY " \
diff --git a/engines/access/martian/martian_resources.h b/engines/access/martian/martian_resources.h
index 2eb810ac80..46cf6a71c1 100644
--- a/engines/access/martian/martian_resources.h
+++ b/engines/access/martian/martian_resources.h
@@ -24,31 +24,17 @@
#define ACCESS_MARTIAN_RESOURCES_H
#include "common/scummsys.h"
+#include "access/resources.h"
namespace Access {
namespace Martian {
-extern const char *const FILENAMES[];
-
extern const int SIDEOFFR[];
extern const int SIDEOFFL[];
extern const int SIDEOFFU[];
extern const int SIDEOFFD[];
-extern const byte *const CURSORS[4];
-
-extern const int _travelPos[][2];
-
-extern const int INVENTORY_SIZE;
-extern const char *const INVENTORY_NAMES[];
-
-extern const byte *const ROOM_TABLE[];
-extern const char *const ROOM_DESCR[];
-extern const int ROOM_NUMB;
-
-extern const byte *const CHARTBL_MM[];
-
extern const int SIDEOFFR[];
extern const int SIDEOFFL[];
extern const int SIDEOFFU[];
@@ -60,16 +46,24 @@ extern const byte ICON_PALETTE[];
extern const int RMOUSE[10][2];
extern byte HELP[];
-extern const char *const _askTBL[];
+extern const char *const ASK_TBL[];
extern const char *const TRAVDATA[];
-extern const byte DEATH_SCREENS[];
-extern const char *const DEATHMESSAGE[];
extern const char *const SPEC7MESSAGE;
extern const byte _byte1EEB5[];
extern const int PICTURERANGE[][2];
+class MartianResources : public Resources {
+public:
+
+public:
+ MartianResources(AccessEngine *vm) : Resources(vm) {}
+ virtual ~MartianResources() {}
+};
+
+#define MMRES (*((Martian::MartianResources *)_vm->_res))
+
} // End of namespace Martian
} // End of namespace Access
diff --git a/engines/access/martian/martian_room.cpp b/engines/access/martian/martian_room.cpp
index d5b03db246..0b8b4a842a 100644
--- a/engines/access/martian/martian_room.cpp
+++ b/engines/access/martian/martian_room.cpp
@@ -39,7 +39,7 @@ MartianRoom::~MartianRoom() {
}
void MartianRoom::loadRoom(int roomNumber) {
- loadRoomData(ROOM_TABLE[roomNumber]);
+ loadRoomData(&MMRES.ROOMTBL[roomNumber]._data[0]);
}
void MartianRoom::reloadRoom() {
diff --git a/engines/access/module.mk b/engines/access/module.mk
index f7cf7f2261..cccb603d31 100644
--- a/engines/access/module.mk
+++ b/engines/access/module.mk
@@ -21,6 +21,7 @@ MODULE_OBJS := \
scripts.o \
sound.o \
video.o \
+ video/movie_decoder.o \
amazon/amazon_game.o \
amazon/amazon_logic.o \
amazon/amazon_player.o \
diff --git a/engines/access/resources.cpp b/engines/access/resources.cpp
index 8699a4a82f..096fb15b35 100644
--- a/engines/access/resources.cpp
+++ b/engines/access/resources.cpp
@@ -22,9 +22,140 @@
#include "access/resources.h"
#include "access/access.h"
+#include "access/amazon/amazon_resources.h"
+#include "access/martian/martian_resources.h"
namespace Access {
+Resources *Resources::init(AccessEngine *vm) {
+ if (vm->getGameID() == GType_Amazon)
+ return new Amazon::AmazonResources(vm);
+ else if (vm->getGameID() == GType_MartianMemorandum)
+ return new Martian::MartianResources(vm);
+
+ error("Unknown game");
+}
+
+bool Resources::load(Common::String &errorMessage) {
+ Common::File f;
+ if (!f.open("access.dat")) {
+ errorMessage = "Could not locate required access.dat file";
+ return false;
+ }
+
+ // Check for the magic identifier
+ char buffer[4];
+ f.read(buffer, 4);
+ if (strncmp(buffer, "SVMA", 4)) {
+ errorMessage = "Located access.dat file had invalid contents";
+ return false;
+ }
+
+ // Validate the version number
+ uint expectedVersion = 1;
+ uint version = f.readUint16LE();
+ if (version != expectedVersion) {
+ errorMessage = Common::String::format(
+ "Incorrect version of access.dat found. Expected %d but got %d",
+ expectedVersion, version);
+ return false;
+ }
+
+ // Load in the index
+ uint count = f.readUint16LE();
+ _datIndex.resize(count);
+ for (uint idx = 0; idx < _datIndex.size(); ++idx) {
+ _datIndex[idx]._gameId = f.readByte();
+ _datIndex[idx]._discType = f.readByte();
+ _datIndex[idx]._demoType = f.readByte();
+ _datIndex[idx]._language = (Common::Language)f.readByte();
+ _datIndex[idx]._fileOffset = f.readUint32LE();
+ }
+
+ // Load in the data for the game
+ load(f);
+
+ return true;
+}
+
+void Resources::load(Common::SeekableReadStream &s) {
+ uint count;
+
+ // Get the offset of the data for the game
+ uint entryOffset = findEntry(_vm->getGameID(), _vm->isCD() ? 1 : 0,
+ _vm->isDemo() ? 1 : 0, _vm->getLanguage());
+ s.seek(entryOffset);
+
+ // Load filename list
+ count = s.readUint16LE();
+ FILENAMES.resize(count);
+ for (uint idx = 0; idx < count; ++idx)
+ FILENAMES[idx] = readString(s);
+
+ // Load the character data
+ count = s.readUint16LE();
+ CHARTBL.resize(count);
+ for (uint idx = 0; idx < count; ++idx) {
+ uint count2 = s.readUint16LE();
+ CHARTBL[idx].resize(count2);
+ if (count2 > 0)
+ s.read(&CHARTBL[idx][0], count2);
+ }
+
+ // Load the room data
+ count = s.readUint16LE();
+ ROOMTBL.resize(count);
+ for (uint idx = 0; idx < count; ++idx) {
+ ROOMTBL[idx]._desc = readString(s);
+ ROOMTBL[idx]._travelPos.x = s.readSint16LE();
+ ROOMTBL[idx]._travelPos.y = s.readSint16LE();
+ uint count2 = s.readUint16LE();
+ ROOMTBL[idx]._data.resize(count2);
+ if (count2 > 0)
+ s.read(&ROOMTBL[idx]._data[0], count2);
+ }
+
+ // Load the deaths list
+ count = s.readUint16LE();
+ DEATHS.resize(count);
+ for (uint idx = 0; idx < count; ++idx) {
+ DEATHS[idx]._screenId = s.readByte();
+ DEATHS[idx]._msg = readString(s);
+ }
+
+ // Load in the inventory list
+ count = s.readUint16LE();
+ INVENTORY.resize(count);
+ for (uint idx = 0; idx < count; ++idx) {
+ INVENTORY[idx]._desc = readString(s);
+ for (uint idx2 = 0; idx2 < 4; ++idx2)
+ INVENTORY[idx]._combo[idx2] = s.readSint16LE();
+ }
+}
+
+uint Resources::findEntry(byte gameId, byte discType, byte demoType, Common::Language language) {
+ for (uint idx = 0; idx < _datIndex.size(); ++idx) {
+ DATEntry &de = _datIndex[idx];
+ if (de._gameId == gameId && de._discType == discType &&
+ de._demoType == demoType && de._language == language)
+ return de._fileOffset;
+ }
+
+ error("Could not locate appropriate access.dat entry");
+}
+
+Common::String Resources::readString(Common::SeekableReadStream &s) {
+ Common::String result;
+ char c;
+
+ while ((c = s.readByte()) != 0)
+ result += c;
+
+ return result;
+}
+
+/*------------------------------------------------------------------------*/
+
const byte INITIAL_PALETTE[18 * 3] = {
0x00, 0x00, 0x00,
0xff, 0xff, 0xff,
@@ -49,14 +180,14 @@ const byte INITIAL_PALETTE[18 * 3] = {
const char *const GENERAL_MESSAGES[] = {
"LOOKING THERE REVEALS NOTHING OF INTEREST.", // LOOK_MESSAGE
"THAT DOESN'T OPEN.", // OPEN_MESSAGE
- "THAT WON'T MOVE." // MOVE_MESSAGE
+ "THAT WON'T MOVE.", // MOVE_MESSAGE
"YOU CAN'T TAKE THAT.", // GET_MESSAGE
"THAT DOESN'T SEEM TO WORK.", // USE_MESSAGE
"YOU CAN'T CLIMB THAT.", // GO_MESSAGE
"THERE SEEMS TO BE NO RESPONSE.", // TALK_MESSAGE
"THIS OBJECT REQUIRES NO HINTS", // HELP_MESSAGE
"THIS OBJECT REQUIRES NO HINTS", // HELP_MESSAGE
- "THAT DOESN'T SEEM TO WORK.", // USE_MESSAGE
+ "THAT DOESN'T SEEM TO WORK." // USE_MESSAGE
};
const int INVCOORDS[][4] = {
diff --git a/engines/access/resources.h b/engines/access/resources.h
index 07b8e5ada9..bb5c3f9f61 100644
--- a/engines/access/resources.h
+++ b/engines/access/resources.h
@@ -24,6 +24,11 @@
#define ACCESS_RESOURCES_H
#include "common/scummsys.h"
+#include "common/array.h"
+#include "common/language.h"
+#include "common/rect.h"
+#include "common/str-array.h"
+#include "common/stream.h"
namespace Access {
@@ -33,6 +38,66 @@ extern const char *const GENERAL_MESSAGES[];
extern const int INVCOORDS[][4];
+class AccessEngine;
+
+class Resources {
+ struct DATEntry {
+ byte _gameId;
+ byte _discType;
+ byte _demoType;
+ Common::Language _language;
+ uint _fileOffset;
+ };
+ struct RoomEntry {
+ Common::String _desc;
+ Common::Point _travelPos;
+ Common::Array<byte> _data;
+ };
+ struct DeathEntry {
+ byte _screenId;
+ Common::String _msg;
+ };
+ struct InventoryEntry {
+ Common::String _desc;
+ int _combo[4];
+ };
+protected:
+ AccessEngine *_vm;
+ Common::Array<DATEntry> _datIndex;
+
+ /**
+ * Locate a specified entry in the index and return it's file offset
+ */
+ uint findEntry(byte gameId, byte discType, byte demoType, Common::Language language);
+
+ /**
+ * Read a string in from the passed stream
+ */
+ Common::String readString(Common::SeekableReadStream &s);
+
+ /**
+ * Load data from the access.dat file
+ */
+ virtual void load(Common::SeekableReadStream &s);
+public:
+ Common::StringArray FILENAMES;
+ Common::Array< Common::Array<byte> > CHARTBL;
+ Common::Array<RoomEntry> ROOMTBL;
+ Common::Array<DeathEntry> DEATHS;
+ Common::Array<InventoryEntry> INVENTORY;
+ Common::Array< Common::Array<byte> > CURSORS;
+ Common::String CANT_GET_THERE;
+public:
+ Resources(AccessEngine *vm) : _vm(vm) {}
+ virtual ~Resources() {}
+ static Resources *init(AccessEngine *vm);
+
+ /**
+ * Load the access.dat file
+ */
+ bool load(Common::String &errorMessage);
+};
+
} // End of namespace Access
#endif /* ACCESS_RESOURCES_H */
diff --git a/engines/access/room.cpp b/engines/access/room.cpp
index c91b37c65d..f54b6170bc 100644
--- a/engines/access/room.cpp
+++ b/engines/access/room.cpp
@@ -111,8 +111,7 @@ void Room::takePicture() {
return;
}
- // TODO: simplify the second part of the test when tested
- if ((_vm->_scrollCol < 35) || ((_vm->_scrollRow >= 10) && (_vm->_scrollRow >= 20))){
+ if ((_vm->_scrollCol < 35) || (_vm->_scrollRow >= 20)){
Common::String msg = "THAT ISN'T INTERESTING ENOUGH TO WASTE FILM ON.";
_vm->_scripts->doCmdPrint_v1(msg);
return;
@@ -173,12 +172,14 @@ void Room::doRoom() {
reloadFlag = false;
_vm->_startup = 8;
_function = FN_NONE;
+ bool fadeIn = true;
while (!_vm->shouldQuit()) {
_vm->_images.clear();
- if (_vm->_startup != -1 && --_vm->_startup == 0) {
+ if (_vm->_startup == -1 && !fadeIn) {
_vm->_events->showCursor();
_vm->_screen->fadeIn();
+ fadeIn = true;
}
// Poll for events
@@ -612,6 +613,7 @@ void Room::handleCommand(int commandId) {
void Room::executeCommand(int commandId) {
EventsManager &events = *_vm->_events;
+ Screen &screen = *_vm->_screen;
_selectCommand = commandId;
if (_vm->getGameID() == GType_MartianMemorandum) {
@@ -698,8 +700,8 @@ void Room::executeCommand(int commandId) {
break;
}
}
- _vm->_screen->saveScreen();
- _vm->_screen->setDisplayScan();
+ screen.saveScreen();
+ screen.setDisplayScan();
// Get the toolbar icons resource
Resource *iconData = _vm->_files->loadFile("ICONS.LZ");
@@ -707,7 +709,9 @@ void Room::executeCommand(int commandId) {
delete iconData;
// Draw the button as selected
- _vm->_screen->plotImage(spr, _selectCommand + 2,
+ screen.plotImage(spr, 0, Common::Point(0, 177));
+ screen.plotImage(spr, 1, Common::Point(143, 177));
+ screen.plotImage(spr, _selectCommand + 2,
Common::Point(_rMouse[_selectCommand][0], (_vm->getGameID() == GType_MartianMemorandum) ? 184 : 176));
_vm->_screen->restoreScreen();
@@ -928,16 +932,9 @@ RoomInfo::RoomInfo(const byte *data, int gameType, bool isCD, bool isDemo) {
_roomFlag = stream.readByte();
- if (gameType == GType_Amazon) {
- if (isCD)
- _estIndex = stream.readSint16LE();
- else {
- _estIndex = -1;
- if (!isDemo)
- stream.readSint16LE();
- }
- } else
- _estIndex = -1;
+ _estIndex = -1;
+ if (gameType == GType_Amazon && isCD)
+ _estIndex = stream.readSint16LE();
_musicFile.load(stream);
_scaleH1 = stream.readByte();
diff --git a/engines/access/screen.cpp b/engines/access/screen.cpp
index 41f6194238..98e188c0ca 100644
--- a/engines/access/screen.cpp
+++ b/engines/access/screen.cpp
@@ -89,6 +89,11 @@ void Screen::setPanel(int num) {
}
void Screen::updateScreen() {
+ if (_vm->_startup >= 0) {
+ --_vm->_startup;
+ return;
+ }
+
// Merge the dirty rects
mergeDirtyRects();
@@ -181,7 +186,7 @@ void Screen::forceFadeOut() {
int v = *srcP;
if (v) {
repeatFlag = true;
- *srcP = MAX(*srcP - FADE_AMOUNT, 0);
+ *srcP = MAX((int)*srcP - FADE_AMOUNT, 0);
}
}
@@ -296,7 +301,7 @@ void Screen::transBlitFrom(ASurface *src, const Common::Rect &bounds) {
ASurface::transBlitFrom(src, bounds);
}
-void Screen::blitFrom(Graphics::Surface &src) {
+void Screen::blitFrom(const Graphics::Surface &src) {
addDirtyRect(Common::Rect(0, 0, src.w, src.h));
ASurface::blitFrom(src);
}
diff --git a/engines/access/screen.h b/engines/access/screen.h
index 52485e5c7c..5cb85471c6 100644
--- a/engines/access/screen.h
+++ b/engines/access/screen.h
@@ -98,7 +98,7 @@ public:
virtual void transBlitFrom(ASurface *src, const Common::Rect &bounds);
- virtual void blitFrom(Graphics::Surface &src);
+ virtual void blitFrom(const Graphics::Surface &src);
virtual void copyBuffer(Graphics::Surface *src);
diff --git a/engines/access/scripts.cpp b/engines/access/scripts.cpp
index 41dd5cc0d0..bb2875013b 100644
--- a/engines/access/scripts.cpp
+++ b/engines/access/scripts.cpp
@@ -164,7 +164,7 @@ void Scripts::charLoop() {
_sequence = 2000;
searchForSequence();
_vm->_images.clear();
- _vm->_buffer2.blitFrom(_vm->_buffer1);
+ _vm->_buffer2.copyBlock(&_vm->_buffer1, Common::Rect(0, 0, _vm->_buffer2.w, _vm->_buffer2.h));
_vm->_newRects.clear();
executeScript();
@@ -536,6 +536,7 @@ void Scripts::cmdDispInv_v1() {
void Scripts::cmdDispInv_v2() {
_vm->_inventory->newDisplayInv();
+ _vm->_events->forceSetCursor(CURSOR_ARROW);
}
void Scripts::cmdSetAbout() {
@@ -689,19 +690,20 @@ void Scripts::cmdDoTravel() {
int idx = _vm->_travelBox->_tempListIdx[boxX];
if (Martian::_byte1EEB5[idx] != _vm->_byte26CB5) {
_vm->_bubbleBox->_bubbleTitle = "_travel";
- _vm->_bubbleBox->printString("YOU CAN'T GET THERE FROM HERE.");
+ _vm->_bubbleBox->printString(_vm->_res->CANT_GET_THERE);
continue;
}
if (_vm->_player->_roomNumber != idx) {
_vm->_player->_roomNumber = idx;
_vm->_room->_function = FN_CLEAR1;
- if (Martian::_travelPos[idx][0] == -1) {
+ if (_vm->_res->ROOMTBL[idx]._travelPos.x == -1) {
+ // For x == -1, the y value is a script Id, not a co-ordinate
_vm->_player->_roomNumber = idx;
_vm->_room->_conFlag = true;
- _vm->_scripts->converse1(Martian::_travelPos[idx][1]);
+ _vm->_scripts->converse1(_vm->_res->ROOMTBL[idx]._travelPos.y);
return;
}
- _vm->_player->_rawPlayer = Common::Point(Martian::_travelPos[idx][0], Martian::_travelPos[idx][1]);
+ _vm->_player->_rawPlayer = _vm->_res->ROOMTBL[idx]._travelPos;
cmdRetPos();
return;
}
@@ -1033,7 +1035,7 @@ void Scripts::cmdPrintWatch() {
}
void Scripts::cmdDispAbout() {
- _vm->_travelBox->getList(Martian::_askTBL, _vm->_ask);
+ _vm->_travelBox->getList(Martian::ASK_TBL, _vm->_ask);
int btnSelected = 0;
int boxX = _vm->_aboutBox->doBox_v1(_vm->_startAboutItem, _vm->_startAboutBox, btnSelected);
_vm->_startAboutItem = _vm->_boxDataStart;
diff --git a/engines/access/scripts.h b/engines/access/scripts.h
index 07fd6acfb1..4cfedf3b3f 100644
--- a/engines/access/scripts.h
+++ b/engines/access/scripts.h
@@ -39,13 +39,13 @@ typedef void(Scripts::*ScriptMethodPtr)();
class Scripts : public Manager {
private:
- Resource *_resource;
int _specialFunction;
void clearWatch();
void printWatch();
protected:
+ Resource *_resource;
Common::SeekableReadStream *_data;
ScriptMethodPtr COMMAND_LIST[100];
diff --git a/engines/access/sound.cpp b/engines/access/sound.cpp
index 51ffb88f37..38f544de4e 100644
--- a/engines/access/sound.cpp
+++ b/engines/access/sound.cpp
@@ -51,11 +51,20 @@ void SoundManager::clearSounds() {
_mixer->stopHandle(_effectsHandle);
while (_queue.size()) {
- delete _queue[0];
+ delete _queue[0]._stream;
_queue.remove_at(0);
}
}
+bool SoundManager::isSoundQueued(int soundId) const {
+ for (uint idx = 0; idx < _queue.size(); ++idx) {
+ if (_queue[idx]._soundId == soundId)
+ return true;
+ }
+
+ return false;
+}
+
void SoundManager::loadSoundTable(int idx, int fileNum, int subfile, int priority) {
debugC(1, kDebugSound, "loadSoundTable(%d, %d, %d)", idx, fileNum, subfile);
@@ -77,12 +86,15 @@ Resource *SoundManager::loadSound(int fileNum, int subfile) {
void SoundManager::playSound(int soundIndex, bool loop) {
debugC(1, kDebugSound, "playSound(%d, %d)", soundIndex, loop);
+ if (isSoundQueued(soundIndex))
+ // Prevent duplicate copies of a sound from being queued
+ return;
int priority = _soundTable[soundIndex]._priority;
- playSound(_soundTable[soundIndex]._res, priority, loop);
+ playSound(_soundTable[soundIndex]._res, priority, loop, soundIndex);
}
-void SoundManager::playSound(Resource *res, int priority, bool loop) {
+void SoundManager::playSound(Resource *res, int priority, bool loop, int soundIndex) {
debugC(1, kDebugSound, "playSound");
byte *resourceData = res->data();
@@ -109,7 +121,7 @@ void SoundManager::playSound(Resource *res, int priority, bool loop) {
byte internalSampleRate = resourceData[5];
int sampleSize = READ_LE_UINT16(resourceData + 7);
- assert( (sampleSize + 32) == res->_size);
+ assert( (sampleSize + 32) <= res->_size);
int sampleRate = 0;
switch (internalSampleRate) {
@@ -139,14 +151,15 @@ void SoundManager::playSound(Resource *res, int priority, bool loop) {
error("Unknown format");
if (loop) {
- _queue.push_back(new Audio::LoopingAudioStream(audioStream, 0, DisposeAfterUse::NO));
+ _queue.push_back(QueuedSound(new Audio::LoopingAudioStream(audioStream, 0,
+ DisposeAfterUse::NO), soundIndex));
} else {
- _queue.push_back(audioStream);
+ _queue.push_back(QueuedSound(audioStream, soundIndex));
}
if (!_mixer->isSoundHandleActive(_effectsHandle))
_mixer->playStream(Audio::Mixer::kSFXSoundType, &_effectsHandle,
- _queue[0], -1, _mixer->kMaxChannelVolume, 0,
+ _queue[0]._stream, -1, _mixer->kMaxChannelVolume, 0,
DisposeAfterUse::NO);
}
@@ -156,12 +169,12 @@ void SoundManager::checkSoundQueue() {
if (_queue.empty() || _mixer->isSoundHandleActive(_effectsHandle))
return;
- delete _queue[0];
+ delete _queue[0]._stream;
_queue.remove_at(0);
- if (_queue.size() && _queue[0])
+ if (_queue.size() && _queue[0]._stream)
_mixer->playStream(Audio::Mixer::kSFXSoundType, &_effectsHandle,
- _queue[0], -1, _mixer->kMaxChannelVolume, 0,
+ _queue[0]._stream, -1, _mixer->kMaxChannelVolume, 0,
DisposeAfterUse::NO);
}
@@ -213,7 +226,7 @@ MusicManager::MusicManager(AccessEngine *vm) : _vm(vm) {
//
switch (musicType) {
case MT_ADLIB: {
- if (_vm->getGameID() == GType_Amazon) {
+ if (_vm->getGameID() == GType_Amazon && !_vm->isDemo()) {
Resource *midiDrvResource = _vm->_files->loadFile(92, 1);
Common::MemoryReadStream *adLibInstrumentStream = new Common::MemoryReadStream(midiDrvResource->data(), midiDrvResource->_size);
diff --git a/engines/access/sound.h b/engines/access/sound.h
index e11a6b9730..b372e566d2 100644
--- a/engines/access/sound.h
+++ b/engines/access/sound.h
@@ -45,15 +45,24 @@ struct SoundEntry {
};
class SoundManager {
+ struct QueuedSound {
+ Audio::AudioStream *_stream;
+ int _soundId;
+
+ QueuedSound() : _stream(nullptr), _soundId(-1) {}
+ QueuedSound(Audio::AudioStream *stream, int soundId) : _stream(stream), _soundId(soundId) {}
+ };
private:
AccessEngine *_vm;
Audio::Mixer *_mixer;
Audio::SoundHandle _effectsHandle;
- Common::Array<Audio::AudioStream *> _queue;
+ Common::Array<QueuedSound> _queue;
void clearSounds();
- void playSound(Resource *res, int priority, bool loop);
+ void playSound(Resource *res, int priority, bool loop, int soundIndex = -1);
+
+ bool isSoundQueued(int soundId) const;
public:
Common::Array<SoundEntry> _soundTable;
bool _playingSound;
diff --git a/engines/access/video/movie_decoder.cpp b/engines/access/video/movie_decoder.cpp
new file mode 100644
index 0000000000..05ec25d54c
--- /dev/null
+++ b/engines/access/video/movie_decoder.cpp
@@ -0,0 +1,741 @@
+/* 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.
+ *
+ */
+
+#include "common/scummsys.h"
+#include "common/stream.h"
+#include "common/textconsole.h"
+
+#include "audio/audiostream.h"
+#include "audio/decoders/raw.h"
+
+#include "access/access.h"
+#include "access/video/movie_decoder.h"
+
+// for Test-Code
+#include "common/system.h"
+#include "common/events.h"
+#include "common/keyboard.h"
+#include "engines/engine.h"
+#include "engines/util.h"
+#include "graphics/palette.h"
+#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
+
+namespace Access {
+
+AccessVIDMovieDecoder::AccessVIDMovieDecoder()
+ : _stream(0), _videoTrack(0), _audioTrack(0) {
+ _streamSeekOffset = 0;
+ _streamVideoIndex = 0;
+ _streamAudioIndex = 0;
+}
+
+AccessVIDMovieDecoder::~AccessVIDMovieDecoder() {
+ close();
+}
+
+bool AccessVIDMovieDecoder::loadStream(Common::SeekableReadStream *stream) {
+ uint32 videoCodecTag = 0;
+ uint32 videoHeight = 0;
+ uint32 videoWidth = 0;
+ uint16 regularDelay = 0;
+ uint32 audioSampleRate = 0;
+
+ close();
+
+ _stream = stream;
+ _streamSeekOffset = 15; // offset of first chunk
+ _streamVideoIndex = 0;
+ _streamAudioIndex = 0;
+
+ // read header
+ // ID [dword] "VID"
+ // ?? [byte]
+ // ?? [word]
+ // width [word]
+ // height [word]
+ // regular delay between frames (60 per second) [word]
+ // ?? [word]
+
+ videoCodecTag = _stream->readUint32BE();
+ if (videoCodecTag != MKTAG('V','I','D',0x00)) {
+ warning("AccessVIDMoviePlay: bad codec tag, not a video file?");
+ close();
+ return false;
+ }
+ _stream->skip(3);
+ videoWidth = _stream->readUint16LE();
+ videoHeight = _stream->readUint16LE();
+ regularDelay = _stream->readUint16LE();
+ _stream->skip(2);
+
+ if (!regularDelay) {
+ warning("AccessVIDMoviePlay: delay between frames is zero?");
+ close();
+ return false;
+ }
+
+ // create video track
+ _videoTrack = new StreamVideoTrack(videoWidth, videoHeight, regularDelay);
+ addTrack(_videoTrack);
+
+ //warning("width %d, height %d", videoWidth, videoHeight);
+
+ // Look through the first few packets
+ static const int maxPacketCheckCount = 10;
+
+ for (int i = 0; i < maxPacketCheckCount; i++) {
+ byte chunkId = _stream->readByte();
+
+ // Bail out if done
+ if (_stream->eos())
+ break;
+
+ // Bail also in case end of file chunk was found
+ if (chunkId == kVIDMovieChunkId_EndOfFile)
+ break;
+
+ uint32 chunkStartOffset = _stream->pos();
+ //warning("data chunk at %x", chunkStartOffset);
+
+ switch (chunkId) {
+ case kVIDMovieChunkId_FullFrame:
+ case kVIDMovieChunkId_FullFrameCompressed:
+ case kVIDMovieChunkId_PartialFrameCompressed:
+ case kVIDMovieChunkId_FullFrameCompressedFill: {
+ if (!_videoTrack->skipOverFrame(_stream, chunkId)) {
+ close();
+ return false;
+ }
+ break;
+ }
+
+ case kVIDMovieChunkId_Palette: {
+ if (!_videoTrack->skipOverPalette(_stream)) {
+ close();
+ return false;
+ }
+ break;
+ }
+
+ case kVIDMovieChunkId_AudioFirstChunk:
+ case kVIDMovieChunkId_Audio: {
+ // sync [word]
+ // sampling rate [byte]
+ // size of audio data [word]
+ // sample data [] (mono, 8-bit, unsigned)
+ //
+ // Only first chunk has sync + sampling rate
+ if (chunkId == kVIDMovieChunkId_AudioFirstChunk) {
+ byte soundblasterRate;
+
+ _stream->skip(2); // skip over sync
+ soundblasterRate = _stream->readByte();
+ audioSampleRate = 1000000 / (256 - soundblasterRate);
+
+ _audioTrack = new StreamAudioTrack(audioSampleRate);
+ addTrack(_audioTrack);
+
+ _stream->seek(chunkStartOffset); // seek back
+ }
+
+ if (!_audioTrack) {
+ warning("AccessVIDMoviePlay: regular audio chunk, before audio chunk w/ header");
+ close();
+ return false;
+ }
+ if (!_audioTrack->skipOverAudio(_stream, chunkId)) {
+ close();
+ return false;
+ }
+ break;
+ }
+
+ default:
+ warning("AccessVIDMoviePlay: Unknown chunk-id '%x' inside VID movie", chunkId);
+ close();
+ return false;
+ }
+
+ // Remember this chunk inside our cache
+ IndexCacheEntry indexCacheEntry;
+
+ indexCacheEntry.chunkId = chunkId;
+ indexCacheEntry.offset = chunkStartOffset;
+
+ _indexCacheTable.push_back(indexCacheEntry);
+
+ // Got an audio chunk now? -> exit b/c we are done
+ if (audioSampleRate)
+ break;
+ }
+
+ // Remember offset of latest not-indexed-yet chunk
+ _streamSeekOffset = _stream->pos();
+
+ // If sample rate was found, create an audio track
+ if (audioSampleRate) {
+ _audioTrack = new StreamAudioTrack(audioSampleRate);
+ addTrack(_audioTrack);
+ }
+
+ // Rewind back to the beginning right to the first chunk
+ _stream->seek(15);
+
+ return true;
+}
+
+void AccessVIDMovieDecoder::close() {
+ Video::VideoDecoder::close();
+
+ delete _stream; _stream = 0;
+ _videoTrack = 0;
+
+ _indexCacheTable.clear();
+}
+
+// We try to at least decode 1 frame
+// and also try to get at least 0.5 seconds of audio queued up
+void AccessVIDMovieDecoder::readNextPacket() {
+ uint32 currentMovieTime = getTime();
+ uint32 wantedAudioQueued = currentMovieTime + 500; // always try to be 0.500 seconds in front of movie time
+
+ uint32 streamIndex = 0;
+ IndexCacheEntry indexEntry;
+ bool currentlySeeking = false;
+
+ bool videoDone = false;
+ bool audioDone = false;
+
+ // Seek to smallest stream offset
+ if ((_streamVideoIndex <= _streamAudioIndex) || (!_audioTrack)) {
+ streamIndex = _streamVideoIndex;
+ } else {
+ streamIndex = _streamAudioIndex;
+ }
+
+ if (_audioTrack) {
+ if (wantedAudioQueued <= _audioTrack->getTotalAudioQueued()) {
+ // already got enough audio queued up
+ audioDone = true;
+ }
+ } else {
+ // no audio track, audio is always done
+ audioDone = true;
+ }
+
+ while (1) {
+ // Check, if stream-index is already cached
+ if (streamIndex < _indexCacheTable.size()) {
+ indexEntry.chunkId = _indexCacheTable[streamIndex].chunkId;
+ indexEntry.offset = _indexCacheTable[streamIndex].offset;
+ currentlySeeking = false;
+
+ } else {
+ // read from file
+ _stream->seek(_streamSeekOffset);
+ indexEntry.chunkId = _stream->readByte();
+ indexEntry.offset = _stream->pos();
+ currentlySeeking = true;
+
+ // and store that as well
+ _indexCacheTable.push_back(indexEntry);
+ }
+
+ // end of stream -> exit
+ if (_stream->eos())
+ break;
+
+ // end of file chunk -> exit
+ if (indexEntry.chunkId == kVIDMovieChunkId_EndOfFile)
+ break;
+
+// warning("chunk %x", indexEntry.chunkId);
+
+ switch (indexEntry.chunkId) {
+ case kVIDMovieChunkId_FullFrame:
+ case kVIDMovieChunkId_FullFrameCompressed:
+ case kVIDMovieChunkId_PartialFrameCompressed:
+ case kVIDMovieChunkId_FullFrameCompressedFill: {
+ if ((_streamVideoIndex <= streamIndex) && (!videoDone)) {
+ // We are at an index, that is still relevant for video decoding
+ // and we are not done with video yet
+ if (!currentlySeeking) {
+ // seek to stream position in case we used the cache
+ _stream->seek(indexEntry.offset);
+ }
+ //warning("video decode chunk %x at %lx", indexEntry.chunkId, _stream->pos());
+ _videoTrack->decodeFrame(_stream, indexEntry.chunkId);
+ videoDone = true;
+ _streamVideoIndex = streamIndex + 1;
+ } else {
+ if (currentlySeeking) {
+ // currently seeking, so we have to skip the frame bytes manually
+ _videoTrack->skipOverFrame(_stream, indexEntry.chunkId);
+ }
+ }
+ break;
+ }
+
+ case kVIDMovieChunkId_Palette: {
+ if ((_streamVideoIndex <= streamIndex) && (!videoDone)) {
+ // We are at an index, that is still relevant for video decoding
+ // and we are not done with video yet
+ if (!currentlySeeking) {
+ // seek to stream position in case we used the cache
+ _stream->seek(indexEntry.offset);
+ }
+ _videoTrack->decodePalette(_stream);
+ _streamVideoIndex = streamIndex + 1;
+ } else {
+ if (currentlySeeking) {
+ // currently seeking, so we have to skip the frame bytes manually
+ _videoTrack->skipOverPalette(_stream);
+ }
+ }
+ break;
+ }
+
+ case kVIDMovieChunkId_AudioFirstChunk:
+ case kVIDMovieChunkId_Audio: {
+ if ((_streamAudioIndex <= streamIndex) && (!audioDone)) {
+ // We are at an index that is still relevant for audio decoding
+ if (!currentlySeeking) {
+ // seek to stream position in case we used the cache
+ _stream->seek(indexEntry.offset);
+ }
+ _audioTrack->queueAudio(_stream, indexEntry.chunkId);
+ _streamAudioIndex = streamIndex + 1;
+
+ if (wantedAudioQueued <= _audioTrack->getTotalAudioQueued()) {
+ // Got enough audio
+ audioDone = true;
+ }
+ } else {
+ if (!_audioTrack) {
+ error("AccessVIDMoviePlay: audio chunks found without audio track active");
+ }
+ if (currentlySeeking) {
+ // currently seeking, so we have to skip the audio bytes manually
+ _audioTrack->skipOverAudio(_stream, indexEntry.chunkId);
+ }
+ }
+ break;
+ }
+
+ default:
+ error("AccessVIDMoviePlay: Unknown chunk-id '%x' inside VID movie", indexEntry.chunkId);
+ }
+
+ if (currentlySeeking) {
+ // remember currently stream offset in case we are seeking
+ _streamSeekOffset = _stream->pos();
+ }
+
+ // go to next index
+ streamIndex++;
+
+ if ((videoDone) && (audioDone)) {
+ return;
+ }
+ }
+
+ if (!videoDone) {
+ // no more video frames? set end of video track
+ _videoTrack->setEndOfTrack();
+ }
+}
+
+AccessVIDMovieDecoder::StreamVideoTrack::StreamVideoTrack(uint32 width, uint32 height, uint16 regularFrameDelay) {
+ _width = width;
+ _height = height;
+ _regularFrameDelay = regularFrameDelay;
+ _curFrame = -1;
+ _nextFrameStartTime = 0;
+ _endOfTrack = false;
+ _dirtyPalette = false;
+
+ memset(&_palette, 0, sizeof(_palette));
+
+ _surface = new Graphics::Surface();
+ _surface->create(_width, _height, Graphics::PixelFormat::createFormatCLUT8());
+}
+
+AccessVIDMovieDecoder::StreamVideoTrack::~StreamVideoTrack() {
+ delete _surface;
+}
+
+bool AccessVIDMovieDecoder::StreamVideoTrack::endOfTrack() const {
+ return _endOfTrack;
+}
+
+Graphics::PixelFormat AccessVIDMovieDecoder::StreamVideoTrack::getPixelFormat() const {
+ return _surface->format;
+}
+
+void AccessVIDMovieDecoder::StreamVideoTrack::decodeFrame(Common::SeekableReadStream *stream, byte chunkId) {
+ byte *framePixelsPtr = (byte *)_surface->getPixels();
+ byte *pixelsPtr = framePixelsPtr;
+ byte rleByte = 0;
+ uint16 additionalDelay = 0;
+ int32 expectedPixels = 0;
+
+ switch (chunkId) {
+ case kVIDMovieChunkId_FullFrame: {
+ // Full frame is:
+ // data [width * height]
+ additionalDelay = stream->readUint16LE();
+ stream->read(framePixelsPtr, _width * _height);
+ break;
+ }
+
+ case kVIDMovieChunkId_FullFrameCompressed:
+ case kVIDMovieChunkId_PartialFrameCompressed: {
+ // Skip manually over compressed data
+ // Full frame compressed is:
+ // additional delay [word]
+ // REPEAT:
+ // RLE [byte]
+ // RLE upper bit set: skip over RLE & 0x7F pixels
+ // RLE upper bit not set: draw RLE amount of pixels (those pixels follow right after RLE byte)
+ //
+ // Partial frame compressed is:
+ // sync [word]
+ // horizontal start position [word]
+ // REPEAT:
+ // see full frame compressed
+ uint16 horizontalStartPosition = 0;
+
+ additionalDelay = stream->readUint16LE();
+
+ if (chunkId == kVIDMovieChunkId_PartialFrameCompressed) {
+ horizontalStartPosition = stream->readUint16LE();
+ if (horizontalStartPosition >= _height) {
+ error("AccessVIDMoviePlay: starting position larger than height during partial frame compressed, data corrupt?");
+ return;
+ }
+ }
+
+ expectedPixels = _width * (_height - horizontalStartPosition);
+
+ // adjust frame destination pointer
+ pixelsPtr += (horizontalStartPosition * _width);
+
+ while (expectedPixels >= 0) {
+ rleByte = stream->readByte();
+ if (!rleByte) // NUL means end of stream
+ break;
+
+ if (rleByte & 0x80) {
+ rleByte = rleByte & 0x7F;
+ expectedPixels -= rleByte;
+ } else {
+ // skip over pixels
+ expectedPixels -= rleByte;
+ stream->read(pixelsPtr, rleByte); // read pixel data into frame
+ }
+ pixelsPtr += rleByte;
+ }
+ // expectedPixels may be positive here in case stream got terminated with a NUL
+ if (expectedPixels < 0) {
+ error("AccessVIDMoviePlay: pixel count mismatch during full/partial frame compressed, data corrupt?");
+ }
+ break;
+ }
+
+ case kVIDMovieChunkId_FullFrameCompressedFill: {
+ // Full frame compressed fill is:
+ // additional delay [word]
+ // REPEAT:
+ // RLE [byte]
+ // RLE upper bit set: draw RLE amount (& 0x7F) of pixels with specified color (color byte follows after RLE byte)
+ // RLE upper bit not set: draw RLE amount of pixels (those pixels follow right after RLE byte)
+ additionalDelay = stream->readUint16LE();
+ expectedPixels = _width * _height;
+
+ while (expectedPixels > 0) {
+ rleByte = stream->readByte();
+
+ if (rleByte & 0x80) {
+ rleByte = rleByte & 0x7F;
+ expectedPixels -= rleByte;
+
+ byte fillColor = stream->readByte();
+ memset(pixelsPtr, fillColor, rleByte);
+ } else {
+ // skip over pixels
+ expectedPixels -= rleByte;
+ stream->read(pixelsPtr, rleByte); // read pixel data into frame
+ }
+ pixelsPtr += rleByte;
+ }
+ if (expectedPixels < 0) {
+ error("AccessVIDMoviePlay: pixel count mismatch during full frame compressed fill, data corrupt?");
+ }
+ break;
+ }
+ default:
+ assert(0);
+ break;
+ }
+
+ _curFrame++;
+
+ // TODO: not sure, if additionalDelay is supposed to affect the follow-up frame or the current frame
+ // the videos, that I found, don't have it set
+ uint32 currentFrameStartTime = getNextFrameStartTime();
+ uint32 nextFrameStartTime = (_regularFrameDelay * _curFrame) * 1000 / 60;
+ if (additionalDelay) {
+ nextFrameStartTime += additionalDelay * 1000 / 60;
+ }
+ assert(currentFrameStartTime <= nextFrameStartTime);
+ setNextFrameStartTime(nextFrameStartTime);
+}
+
+bool AccessVIDMovieDecoder::StreamVideoTrack::skipOverFrame(Common::SeekableReadStream *stream, byte chunkId) {
+ byte rleByte = 0;
+ int32 expectedPixels = 0;
+
+ switch (chunkId) {
+ case kVIDMovieChunkId_FullFrame: {
+ // Full frame is:
+ // additional delay [word]
+ // data [width * height]
+ stream->skip(2);
+ stream->skip(_width * _height);
+ break;
+ }
+
+ case kVIDMovieChunkId_FullFrameCompressed:
+ case kVIDMovieChunkId_PartialFrameCompressed: {
+ // Skip manually over compressed data
+ // Full frame compressed is:
+ // additional delay [word]
+ // REPEAT:
+ // RLE [byte]
+ // RLE upper bit set: skip over RLE & 0x7F pixels
+ // RLE upper bit not set: draw RLE amount of pixels (those pixels follow right after RLE byte)
+ //
+ // Partial frame compressed is:
+ // sync [word]
+ // horizontal start position [word]
+ // REPEAT:
+ // see full frame compressed
+ uint16 horizontalStartPosition = 0;
+
+ stream->skip(2);
+
+ if (chunkId == kVIDMovieChunkId_PartialFrameCompressed) {
+ horizontalStartPosition = stream->readUint16LE();
+ if (horizontalStartPosition >= _height) {
+ warning("AccessVIDMoviePlay: starting position larger than height during partial frame compressed, data corrupt?");
+ return false;
+ }
+ }
+
+ expectedPixels = _width * (_height - horizontalStartPosition);
+
+ while (expectedPixels >= 0) {
+ rleByte = stream->readByte();
+ if (!rleByte) // NUL means end of stream
+ break;
+
+ if (rleByte & 0x80) {
+ expectedPixels -= rleByte & 0x7F;
+ } else {
+ // skip over pixels
+ expectedPixels -= rleByte;
+ stream->skip(rleByte); // skip over pixel data
+ }
+ }
+ // expectedPixels may be positive here in case stream got terminated with a NUL
+ if (expectedPixels < 0) {
+ warning("AccessVIDMoviePlay: pixel count mismatch during full/partial frame compressed, data corrupt?");
+ return false;
+ }
+ break;
+ }
+
+ case kVIDMovieChunkId_FullFrameCompressedFill: {
+ // Full frame compressed fill is:
+ // additional delay [word]
+ // REPEAT:
+ // RLE [byte]
+ // RLE upper bit set: draw RLE amount (& 0x7F) of pixels with specified color (color byte follows after RLE byte)
+ // RLE upper bit not set: draw RLE amount of pixels (those pixels follow right after RLE byte)
+ stream->skip(2);
+ expectedPixels = _width * _height;
+
+ while (expectedPixels > 0) {
+ rleByte = stream->readByte();
+
+ if (rleByte & 0x80) {
+ expectedPixels -= rleByte & 0x7F;
+ stream->skip(1);
+ } else {
+ // skip over pixels
+ expectedPixels -= rleByte;
+ stream->skip(rleByte); // skip over pixel data
+ }
+ }
+ if (expectedPixels < 0) {
+ warning("AccessVIDMoviePlay: pixel count mismatch during full frame compressed fill, data corrupt?");
+ return false;
+ }
+ break;
+ }
+ default:
+ assert(0);
+ break;
+ }
+ return true;
+}
+
+bool AccessVIDMovieDecoder::StreamVideoTrack::skipOverPalette(Common::SeekableReadStream *stream) {
+ stream->skip(0x300); // 3 bytes per color, 256 colors
+ return true;
+}
+
+void AccessVIDMovieDecoder::StreamVideoTrack::decodePalette(Common::SeekableReadStream *stream) {
+ byte red, green, blue;
+ assert(stream);
+
+ // VID files use a 6-bit palette and not a 8-bit one, we change it to 8-bit
+ for (uint16 curColor = 0; curColor < 256; curColor++) {
+ red = stream->readByte() & 0x3F;
+ green = stream->readByte() & 0x3F;
+ blue = stream->readByte() & 0x3F;
+ _palette[curColor * 3] = (red << 2) | (red >> 4);
+ _palette[curColor * 3 + 1] = (green << 2) | (green >> 4);
+ _palette[curColor * 3 + 2] = (blue << 2) | (blue >> 4);
+ }
+
+ _dirtyPalette = true;
+}
+
+const byte *AccessVIDMovieDecoder::StreamVideoTrack::getPalette() const {
+ _dirtyPalette = false;
+ return _palette;
+}
+
+bool AccessVIDMovieDecoder::StreamVideoTrack::hasDirtyPalette() const {
+ return _dirtyPalette;
+}
+
+AccessVIDMovieDecoder::StreamAudioTrack::StreamAudioTrack(uint32 sampleRate) {
+ _totalAudioQueued = 0; // currently 0 milliseconds queued
+
+ _sampleRate = sampleRate;
+ _stereo = false; // always mono
+
+ _audioStream = Audio::makeQueuingAudioStream(sampleRate, _stereo);
+}
+
+AccessVIDMovieDecoder::StreamAudioTrack::~StreamAudioTrack() {
+ delete _audioStream;
+}
+
+void AccessVIDMovieDecoder::StreamAudioTrack::queueAudio(Common::SeekableReadStream *stream, byte chunkId) {
+ Common::SeekableReadStream *rawAudioStream = 0;
+ Audio::RewindableAudioStream *audioStream = 0;
+ uint32 audioLengthMSecs = 0;
+
+ if (chunkId == kVIDMovieChunkId_AudioFirstChunk) {
+ stream->skip(3); // skip over additional delay + sample rate
+ }
+
+ uint32 audioSize = stream->readUint16LE();
+
+ // Read the specified chunk into memory
+ rawAudioStream = stream->readStream(audioSize);
+ audioLengthMSecs = audioSize * 1000 / _sampleRate; // 1 byte == 1 8-bit sample
+
+ audioStream = Audio::makeRawStream(rawAudioStream, _sampleRate, Audio::FLAG_UNSIGNED | Audio::FLAG_LITTLE_ENDIAN, DisposeAfterUse::YES);
+ if (audioStream) {
+ _totalAudioQueued += audioLengthMSecs;
+ _audioStream->queueAudioStream(audioStream, DisposeAfterUse::YES);
+ } else {
+ // in case there was an error
+ delete rawAudioStream;
+ }
+}
+
+bool AccessVIDMovieDecoder::StreamAudioTrack::skipOverAudio(Common::SeekableReadStream *stream, byte chunkId) {
+ if (chunkId == kVIDMovieChunkId_AudioFirstChunk) {
+ stream->skip(3); // skip over additional delay + sample rate
+ }
+ uint32 audioSize = stream->readUint16LE();
+ stream->skip(audioSize);
+ return true;
+}
+
+Audio::AudioStream *AccessVIDMovieDecoder::StreamAudioTrack::getAudioStream() const {
+ return _audioStream;
+}
+
+bool AccessEngine::playMovie(const Common::String &filename, const Common::Point &pos) {
+ AccessVIDMovieDecoder *videoDecoder = new AccessVIDMovieDecoder();
+
+ Common::Point framePos(pos.x, pos.y);
+
+ if (!videoDecoder->loadFile(filename)) {
+ warning("AccessVIDMoviePlay: could not open '%s'", filename.c_str());
+ return false;
+ }
+
+ bool skipVideo = false;
+
+ _events->clearEvents();
+ videoDecoder->start();
+
+ while (!shouldQuit() && !videoDecoder->endOfVideo() && !skipVideo) {
+ if (videoDecoder->needsUpdate()) {
+ const Graphics::Surface *frame = videoDecoder->decodeNextFrame();
+
+ if (frame) {
+ _screen->blitFrom(*frame);
+
+ if (videoDecoder->hasDirtyPalette()) {
+ const byte *palette = videoDecoder->getPalette();
+ g_system->getPaletteManager()->setPalette(palette, 0, 256);
+ }
+
+ _screen->updateScreen();
+ }
+ }
+
+ _events->pollEventsAndWait();
+
+ Common::KeyState keyState;
+ if (_events->getKey(keyState)) {
+ if (keyState.keycode == Common::KEYCODE_ESCAPE)
+ skipVideo = true;
+ }
+ }
+
+ videoDecoder->close();
+ delete videoDecoder;
+
+ return !skipVideo;
+}
+
+} // End of namespace Access
diff --git a/engines/access/video/movie_decoder.h b/engines/access/video/movie_decoder.h
new file mode 100644
index 0000000000..fe8a89fcde
--- /dev/null
+++ b/engines/access/video/movie_decoder.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 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.
+ *
+ */
+
+#ifndef ACCESS_VIDEO_MOVIE_DECODER_H
+#define ACCESS_VIDEO_MOVIE_DECODER_H
+
+#include "common/rect.h"
+#include "video/video_decoder.h"
+#include "audio/decoders/raw.h"
+
+namespace Audio {
+class QueuingAudioStream;
+}
+
+namespace Common {
+class SeekableReadStream;
+}
+
+namespace Image {
+class Codec;
+}
+
+namespace Access {
+
+enum kDebugLevels {
+ kVIDMovieChunkId_FullFrame = 0x00,
+ kVIDMovieChunkId_FullFrameCompressed = 0x01,
+ kVIDMovieChunkId_Palette = 0x02,
+ kVIDMovieChunkId_FullFrameCompressedFill = 0x03,
+ kVIDMovieChunkId_PartialFrameCompressed = 0x04,
+ kVIDMovieChunkId_EndOfFile = 0x14,
+ kVIDMovieChunkId_AudioFirstChunk = 0x7C,
+ kVIDMovieChunkId_Audio = 0x7D
+};
+
+// This video format is used in at least the following Access engine games:
+// - Noctropolis
+// - Synnergist
+
+class AccessVIDMovieDecoder : public Video::VideoDecoder {
+public:
+ AccessVIDMovieDecoder();
+ ~AccessVIDMovieDecoder();
+
+ bool loadStream(Common::SeekableReadStream *stream);
+ void close();
+
+protected:
+ void readNextPacket();
+
+private:
+ bool streamSkipFullFrameCompressedFill();
+
+private:
+ int32 _streamSeekOffset; /* current stream offset, pointing to not-yet-indexed stream position */
+ uint32 _streamVideoIndex; /* current stream index for video decoding */
+ uint32 _streamAudioIndex; /* current stream index for audio decoding */
+
+ struct IndexCacheEntry {
+ byte chunkId;
+ int32 offset;
+ };
+
+ Common::Array<IndexCacheEntry> _indexCacheTable;
+
+private:
+ class StreamVideoTrack : public VideoTrack {
+ public:
+ StreamVideoTrack(uint32 width, uint32 height, uint16 regularFrameDelay);
+ ~StreamVideoTrack();
+
+ bool endOfTrack() const;
+
+ uint16 getWidth() const { return _width; }
+ uint16 getHeight() const { return _height; }
+ Graphics::PixelFormat getPixelFormat() const;
+ int getCurFrame() const { return _curFrame; }
+ void setNextFrameStartTime(uint32 nextFrameStartTime) { _nextFrameStartTime = nextFrameStartTime; }
+ uint32 getNextFrameStartTime() const { return _nextFrameStartTime; }
+ const Graphics::Surface *decodeNextFrame() { return _surface; }
+
+ const byte *getPalette() const;
+ bool hasDirtyPalette() const;
+
+ void decodePalette(Common::SeekableReadStream *stream);
+ void decodeFrame(Common::SeekableReadStream *stream, byte chunkId);
+ bool skipOverFrame(Common::SeekableReadStream *stream, byte chunkId);
+ bool skipOverPalette(Common::SeekableReadStream *stream);
+
+ void setEndOfTrack() { _endOfTrack = true; }
+
+ private:
+ Graphics::Surface *_surface;
+
+ int _curFrame;
+ uint32 _nextFrameStartTime;
+
+ byte _palette[3 * 256];
+ mutable bool _dirtyPalette;
+ uint16 _width, _height;
+
+ uint16 _regularFrameDelay; // delay between frames (1 = 1/60 of a second)
+ bool _endOfTrack;
+ };
+
+ class StreamAudioTrack : public AudioTrack {
+ public:
+ StreamAudioTrack(uint32 sampleRate);
+ ~StreamAudioTrack();
+
+ void queueAudio(Common::SeekableReadStream *stream, byte chunkId);
+ bool skipOverAudio(Common::SeekableReadStream *stream, byte chunkId);
+
+ protected:
+ Audio::AudioStream *getAudioStream() const;
+
+ private:
+ Audio::QueuingAudioStream *_audioStream;
+ uint32 _totalAudioQueued; /* total amount of milliseconds of audio, that we queued up already */
+
+ public:
+ uint32 getTotalAudioQueued() const { return _totalAudioQueued; }
+
+ private:
+ int16 decodeSample(uint8 dataNibble);
+
+ uint16 _sampleRate;
+ bool _stereo;
+ };
+
+ Common::SeekableReadStream *_stream;
+ StreamVideoTrack *_videoTrack;
+ StreamAudioTrack *_audioTrack;
+};
+
+} // End of namespace Access
+
+#endif
diff --git a/engines/agi/console.cpp b/engines/agi/console.cpp
index 6d7f9384cd..89838b3be9 100644
--- a/engines/agi/console.cpp
+++ b/engines/agi/console.cpp
@@ -35,6 +35,7 @@ Console::Console(AgiEngine *vm) : GUI::Debugger() {
registerCmd("debug", WRAP_METHOD(Console, Cmd_Debug));
registerCmd("cont", WRAP_METHOD(Console, Cmd_Cont));
registerCmd("agiver", WRAP_METHOD(Console, Cmd_Agiver));
+ registerCmd("version", WRAP_METHOD(Console, Cmd_Version));
registerCmd("flags", WRAP_METHOD(Console, Cmd_Flags));
registerCmd("logic0", WRAP_METHOD(Console, Cmd_Logic0));
registerCmd("objs", WRAP_METHOD(Console, Cmd_Objs));
@@ -125,11 +126,154 @@ bool Console::Cmd_Agiver(int argc, const char **argv) {
maj = (ver >> 12) & 0xf;
min = ver & 0xfff;
+ debugPrintf("AGI version: ");
debugPrintf(maj <= 2 ? "%x.%03x\n" : "%x.002.%03x\n", maj, min);
return true;
}
+#define CONSOLE_VERSION_MAXLEN 10
+
+bool Console::Cmd_Version(int argc, const char **argv) {
+ AgiGame *game = &_vm->_game;
+ int scriptNr = 0;
+ int scriptTextCount = 0;
+ int scriptTextNr = 0;
+ const char *scriptTextPtr = NULL;
+ const char *wordScanPtr = NULL;
+ const char *wordStartPtr = NULL;
+ const char *versionStartPtr = NULL;
+ int wordLen = 0;
+ char curChar = 0;
+ int versionLen = 0;
+ bool wordFound = false;
+ bool versionFound = false;
+ char versionString[CONSOLE_VERSION_MAXLEN];
+ bool scriptLoadedByUs = false;
+
+ // Show AGI version
+ Cmd_Agiver(argc, argv);
+
+ // And now try to figure out the version of the game
+ // We do this by scanning through all script texts
+ // This is the best we can do about it. There is no special location for the game version number.
+ // There are multiple variations, like "ver. X.XX", "ver X.XX" and even "verion X.XX".
+ for (scriptNr = 0; scriptNr < MAX_DIRS; scriptNr++) {
+ if (game->dirLogic[scriptNr].offset != _EMPTY) {
+ // Script is supposed to exist?
+ scriptLoadedByUs = false;
+ if (!(game->dirLogic[scriptNr].flags & RES_LOADED)) {
+ // But not currently loaded? -> load it now
+ if (_vm->agiLoadResource(rLOGIC, scriptNr) != errOK) {
+ // In case we can't load the source, skip it
+ continue;
+ }
+ scriptLoadedByUs = true;
+ }
+ // Script currently loaded
+ // Now scan all texts
+ scriptTextCount = game->logics[scriptNr].numTexts;
+ for (scriptTextNr = 0; scriptTextNr < scriptTextCount; scriptTextNr++) {
+ scriptTextPtr = game->logics[scriptNr].texts[scriptTextNr];
+
+ // Now scan this text for version information
+ wordScanPtr = scriptTextPtr;
+
+ do {
+ curChar = *wordScanPtr;
+
+ if ((curChar == 'V') || (curChar == 'v')) {
+ // "V" gefunden, ggf. beginning of version?
+ wordStartPtr = wordScanPtr;
+ wordFound = false;
+
+ do {
+ curChar = *wordScanPtr;
+ if (curChar == ' ') {
+ break;
+ }
+ wordScanPtr++;
+ } while (curChar);
+
+ if (curChar) {
+ // end of "version" found
+ wordLen = wordScanPtr - wordStartPtr;
+
+ if (wordLen >= 3) {
+ if (strncmp(wordStartPtr, "ver", wordLen) == 0)
+ wordFound = true;
+ if (strncmp(wordStartPtr, "Ver", wordLen) == 0)
+ wordFound = true;
+ }
+ if ((!wordFound) && (wordLen >= 4)) {
+ if (strncmp(wordStartPtr, "ver.", wordLen) == 0)
+ wordFound = true;
+ if (strncmp(wordStartPtr, "Ver.", wordLen) == 0)
+ wordFound = true;
+ }
+ if ((!versionFound) && (wordLen >= 7)) {
+ if (strncmp(wordStartPtr, "version", wordLen) == 0)
+ wordFound = true;
+ if (strncmp(wordStartPtr, "Version", wordLen) == 0)
+ wordFound = true;
+ if (strncmp(wordStartPtr, "VERSION", wordLen) == 0)
+ wordFound = true;
+ }
+
+ if (wordFound) {
+ // We found something interesting
+ //debugPrintf("%d: %s\n", scriptNr, scriptTextPtr);
+
+ wordScanPtr++; // skip space
+ versionStartPtr = wordScanPtr;
+ curChar = *wordScanPtr;
+ if ((curChar >= '0') && (curChar <= '9')) {
+ // Next word starts with a number
+ wordScanPtr++;
+ curChar = *wordScanPtr;
+ if (curChar == '.') {
+ // Followed by a point? then we assume that we found a version number
+ // Now we try to find the end of it
+ wordScanPtr++;
+ do {
+ curChar = *wordScanPtr;
+ if ((curChar == ' ') || (curChar == '\\') || (!curChar))
+ break; // space or potential new line or NUL? -> found the end
+ wordScanPtr++;
+ } while (1);
+
+ versionLen = wordScanPtr - versionStartPtr;
+ if (versionLen < CONSOLE_VERSION_MAXLEN) {
+ // Looks fine, now extract and show it
+ memcpy(versionString, versionStartPtr, versionLen);
+ versionString[versionLen] = 0;
+ debugPrintf("Scanned game version: %s\n", versionString);
+ versionFound = true;
+ }
+ }
+ }
+ }
+ }
+
+ // Seek back
+ wordScanPtr = wordStartPtr;
+ }
+ wordScanPtr++;
+ } while (curChar);
+ }
+
+ if (scriptLoadedByUs) {
+ _vm->agiUnloadResource(rLOGIC, scriptNr);
+ }
+ }
+ }
+
+ if (!versionFound) {
+ debugPrintf("Scanned game version: [not found]\n");
+ }
+ return true;
+}
+
bool Console::Cmd_Flags(int argc, const char **argv) {
int i, j;
diff --git a/engines/agi/console.h b/engines/agi/console.h
index 6e86067373..c650e143a0 100644
--- a/engines/agi/console.h
+++ b/engines/agi/console.h
@@ -50,6 +50,7 @@ private:
bool Cmd_SetObj(int argc, const char **argv);
bool Cmd_RunOpcode(int argc, const char **argv);
bool Cmd_Agiver(int argc, const char **argv);
+ bool Cmd_Version(int argc, const char **argv);
bool Cmd_Flags(int argc, const char **argv);
bool Cmd_Vars(int argc, const char **argv);
bool Cmd_Objs(int argc, const char **argv);
diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp
index 6b34605364..145b827160 100644
--- a/engines/agi/cycle.cpp
+++ b/engines/agi/cycle.cpp
@@ -84,13 +84,23 @@ void AgiEngine::newRoom(int n) {
break;
}
- _game.vars[vBorderTouchEgo] = 0;
- setflag(fNewRoomExec, true);
+ if (getVersion() < 0x2000) {
+ warning("STUB: NewRoom(%d)", n);
- _game.exitAllLogics = true;
+ v->flags &= ~fDidntMove;
+ // animateObject(0);
+ agiLoadResource(rVIEW, _game.viewTable[0].currentView);
+ setView(&_game.viewTable[0], _game.viewTable[0].currentView);
- writeStatus();
- writePrompt();
+ } else {
+ _game.vars[vBorderTouchEgo] = 0;
+ setflag(fNewRoomExec, true);
+
+ _game.exitAllLogics = true;
+
+ writeStatus();
+ writePrompt();
+ }
}
void AgiEngine::resetControllers() {
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index 662454f3c1..bf2a2ed77b 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -1711,22 +1711,6 @@ void cmdCallV1(AgiGame *state, uint8 *p) {
_v[13] = 1;
}
-void cmdNewRoomV1(AgiGame *state, uint8 *p) {
- warning("cmdNewRoomV1()");
- state->_vm->agiLoadResource(rLOGIC, p0);
- state->max_logics = 1;
- state->logic_list[1] = p0;
- _v[13] = 1;
-}
-
-void cmdNewRoomVV1(AgiGame *state, uint8 *p) {
- warning("cmdNewRoomVV1()");
- state->_vm->agiLoadResource(rLOGIC, _v[p0]);
- state->max_logics = 1;
- state->logic_list[1] = _v[p0];
- _v[13] = 1;
-}
-
void cmdUnknown(AgiGame *state, uint8 *p) {
warning("Skipping unknown opcode %2X", *(code + ip - 1));
}
diff --git a/engines/agi/opcodes.cpp b/engines/agi/opcodes.cpp
index 621fbb8e82..0d7d180ec9 100644
--- a/engines/agi/opcodes.cpp
+++ b/engines/agi/opcodes.cpp
@@ -60,7 +60,7 @@ AgiInstruction insV1[] = {
{ "subv", "vv", &cmdSubV }, // 08
{ "load.view", "n", &cmdLoadView }, // 09
{ "animate.obj", "n", &cmdAnimateObj }, // 0A
- { "new.room", "n", &cmdNewRoomV1 }, // 0B
+ { "new.room", "n", &cmdNewRoom }, // 0B
{ "draw.pic", "v", &cmdDrawPicV1 }, // 0C
{ "print", "s", &cmdPrint }, // 0D TODO
{ "status", "", &cmdStatus }, // 0E TODO
@@ -112,7 +112,7 @@ AgiInstruction insV1[] = {
{ "set.v", "v", &cmdSetV }, // 3C
{ "reset.v", "v", &cmdResetV }, // 3D
{ "toggle.v", "v", &cmdToggleV }, // 3E
- { "new.room.v", "v", &cmdNewRoomVV1 }, // 3F TODO
+ { "new.room.v", "v", &cmdNewRoom }, // 3F
{ "call", "n", &cmdCallV1 }, // 40 TODO
{ "quit", "", &cmdQuitV1 }, // 41
{ "set.speed", "v", &cmdSetSpeed }, // 42
diff --git a/engines/agi/opcodes.h b/engines/agi/opcodes.h
index 6bd31c339a..5466bc6ee0 100644
--- a/engines/agi/opcodes.h
+++ b/engines/agi/opcodes.h
@@ -237,8 +237,6 @@ void cmdAdjEgoMoveToXY(AgiGame *state, uint8 *p);
void cmdSetSpeed(AgiGame *state, uint8 *p);
void cmdSetItemView(AgiGame *state, uint8 *p);
void cmdCallV1(AgiGame *state, uint8 *p);
-void cmdNewRoomV1(AgiGame *state, uint8 *p);
-void cmdNewRoomVV1(AgiGame *state, uint8 *p);
void cmdUnknown(AgiGame *state, uint8 *p);
void condEqual(AgiGame *state, uint8 *p);
diff --git a/engines/agi/sound_2gs.cpp b/engines/agi/sound_2gs.cpp
index b940eed762..b221afbc23 100644
--- a/engines/agi/sound_2gs.cpp
+++ b/engines/agi/sound_2gs.cpp
@@ -345,7 +345,7 @@ void SoundGen2GS::advanceMidiPlayer() {
case MIDI_PITCH_WHEEL:
parm1 = *p++;
parm2 = *p++;
- debugC(3, kDebugLevelSound, "channel %X: pitch wheel (unimplemented)", chn);
+ debugC(3, kDebugLevelSound, "channel %X: pitch wheel (unimplemented) %02X, %02X", chn, parm1, parm2);
break;
default:
diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp
index 0b49866531..54f8eaf90b 100644
--- a/engines/agi/wagparser.cpp
+++ b/engines/agi/wagparser.cpp
@@ -79,7 +79,7 @@ bool WagProperty::read(Common::SeekableReadStream &stream) {
uint32 readBytes = stream.read(_propData, _propSize); // Read the data in
_propData[_propSize] = 0; // Set the trailing zero for easy C-style string access
- _readOk = (_propData != NULL && readBytes == _propSize); // Check that we got the whole data
+ _readOk = (readBytes == _propSize); // Check that we got the whole data
return _readOk;
}
diff --git a/engines/agi/words.cpp b/engines/agi/words.cpp
index ff9049fdc5..438c1ce354 100644
--- a/engines/agi/words.cpp
+++ b/engines/agi/words.cpp
@@ -161,11 +161,13 @@ void AgiEngine::dictionaryWords(char *msg) {
char *q = NULL;
int wid, wlen;
+ assert(msg);
+
debugC(2, kDebugLevelScripts, "msg = \"%s\"", msg);
cleanInput();
- for (p = msg; p && *p && getvar(vWordNotFound) == 0;) {
+ for (p = msg; *p && getvar(vWordNotFound) == 0;) {
if (*p == 0x20)
p++;
@@ -205,7 +207,7 @@ void AgiEngine::dictionaryWords(char *msg) {
break;
}
- if (p != NULL && *p) {
+ if (*p) {
debugC(2, kDebugLevelScripts, "p = %s", p);
*p = 0;
p++;
diff --git a/engines/bbvs/bbvs.cpp b/engines/bbvs/bbvs.cpp
index 11e4b6cea7..d40d5e482f 100644
--- a/engines/bbvs/bbvs.cpp
+++ b/engines/bbvs/bbvs.cpp
@@ -39,6 +39,8 @@
#include "common/error.h"
#include "common/fs.h"
#include "common/timer.h"
+#include "common/translation.h"
+#include "engines/advancedDetector.h"
#include "engines/util.h"
#include "graphics/cursorman.h"
#include "graphics/font.h"
@@ -116,9 +118,19 @@ BbvsEngine::BbvsEngine(OSystem *syst, const ADGameDescription *gd) :
Engine::syncSoundSettings();
+#ifdef USE_TRANSLATION
+ _oldGUILanguage = TransMan.getCurrentLanguage();
+
+ if (gd->flags & GF_GUILANGSWITCH)
+ TransMan.setLanguage(getLanguageLocale(gd->language));
+#endif
}
BbvsEngine::~BbvsEngine() {
+#ifdef USE_TRANSLATION
+ if (TransMan.getCurrentLanguage() != _oldGUILanguage)
+ TransMan.setLanguage(_oldGUILanguage);
+#endif
delete _random;
@@ -1376,7 +1388,7 @@ void BbvsEngine::checkEasterEgg(char key) {
};
if (_currSceneNum == kCredits) {
- memcpy(&_easterEggInput[1], &_easterEggInput[0], 6);
+ memmove(&_easterEggInput[1], &_easterEggInput[0], 6);
_easterEggInput[0] = key;
for (int i = 0; i < ARRAYSIZE(kEasterEggStrings); ++i) {
if (!scumm_strnicmp(kEasterEggStrings[i], _easterEggInput, kEasterEggLengths[i])) {
diff --git a/engines/bbvs/bbvs.h b/engines/bbvs/bbvs.h
index bbd8046a8b..ff4afe9526 100644
--- a/engines/bbvs/bbvs.h
+++ b/engines/bbvs/bbvs.h
@@ -63,6 +63,10 @@ class SoundMan;
#define BBVS_SAVEGAME_VERSION 0
enum {
+ GF_GUILANGSWITCH = (1 << 0) // If GUI language switch is required for menus
+};
+
+enum {
kVerbLook = 0,
kVerbUse = 1,
kVerbTalk = 2,
@@ -226,9 +230,15 @@ public:
void continueGameFromQuickSave();
void setNewSceneNum(int newSceneNum);
const Common::String getTargetName() { return _targetName; }
-private:
const ADGameDescription *_gameDescription;
+
+private:
Graphics::PixelFormat _pixelFormat;
+
+#ifdef USE_TRANSLATION
+ Common::String _oldGUILanguage;
+#endif
+
public:
Common::RandomSource *_random;
diff --git a/engines/bbvs/configure.engine b/engines/bbvs/configure.engine
index c1dc1ef924..8be3e078d9 100644
--- a/engines/bbvs/configure.engine
+++ b/engines/bbvs/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine bbvs "Beavis and Butthead in Virtual Stupidity" no
+add_engine bbvs "Beavis and Butthead in Virtual Stupidity" yes
diff --git a/engines/bbvs/detection.cpp b/engines/bbvs/detection.cpp
index 3e247aad99..d2e3ab8e42 100644
--- a/engines/bbvs/detection.cpp
+++ b/engines/bbvs/detection.cpp
@@ -30,7 +30,7 @@
#include "graphics/thumbnail.h"
static const PlainGameDescriptor bbvsGames[] = {
- { "bbvs", "Beavis and Butthead in Virtual Stupidity" },
+ { "bbvs", "Beavis and Butt-head in Virtual Stupidity" },
{ 0, 0 }
};
@@ -40,10 +40,19 @@ static const ADGameDescription gameDescriptions[] = {
{
"bbvs",
0,
- AD_ENTRY1s("game0001.vnm", "637e5411751c7065bc385dd73d224561", 64004),
+ AD_ENTRY1s("vspr0001.vnm", "7ffe9b9e7ca322db1d48e86f5130578e", 1166628),
Common::EN_ANY,
Common::kPlatformWindows,
- ADGF_NO_FLAGS,
+ ADGF_NO_FLAGS | ADGF_TESTING,
+ GUIO0()
+ },
+ {
+ "bbvs",
+ 0,
+ AD_ENTRY1s("vspr0001.vnm", "91c76b1048f93208cd7b1a05ebccb408", 1176976),
+ Common::RU_RUS,
+ Common::kPlatformWindows,
+ GF_GUILANGSWITCH | ADGF_TESTING,
GUIO0()
},
@@ -66,7 +75,7 @@ public:
}
virtual const char *getName() const {
- return "MTV's Beavis and Butt-Head in Virtual Stupidity";
+ return "MTV's Beavis and Butt-head in Virtual Stupidity";
}
virtual const char *getOriginalCopyright() const {
diff --git a/engines/bbvs/dialogs.cpp b/engines/bbvs/dialogs.cpp
index af95f06c1e..ef7f3c9320 100644
--- a/engines/bbvs/dialogs.cpp
+++ b/engines/bbvs/dialogs.cpp
@@ -24,6 +24,7 @@
#include "common/events.h"
#include "gui/gui-manager.h"
#include "gui/ThemeEval.h"
+#include "engines/advancedDetector.h"
namespace Bbvs {
@@ -53,6 +54,27 @@ static const MenuButton kMenuButtons[] = {
{"Back ..", kCmdBack}
};
+static const MenuButton kMenuButtonsRu[] = {
+ // Main menu
+ {"\xBD\xDE\xD2\xD0\xEF \xD8\xD3\xE0\xD0", kCmdNewGame},
+ {"\xBF\xE0\xDE\xD4\xDE\xDB\xD6\xD8\xE2\xEC", kCmdContinue},
+ {"\xB5\xE9\xD5 ..", kCmdOptions},
+ {"\xBC\xD8\xDD\xD8 \xB8\xD3\xE0\xEB", kCmdMiniGames},
+ {"\xB2\xEB\xE5\xDE\xD4", kCmdQuit},
+ // Options
+ {"\xB4\xD5\xD8\xDD\xE1\xE2\xD0\xDB\xDB\xEF\xE6\xD8\xEF", kCmdUninstall},
+ {"\xB0\xD2\xE2\xDE\xE0\xEB", kCmdCredits},
+ {"\xBF\xE0\xDE\xDB\xDE\xD3", kCmdOpening},
+ {"\xC0\xD5\xDA\xDB\xD0\xDC\xD0", kCmdChicksNStuff},
+ {"\xBD\xD0\xD7\xD0\xD4 ..", kCmdBack},
+ // Minigames
+ {"\xC1\xDD\xD0\xD9\xDF\xD5\xE0", kCmdHockALoogie},
+ {"\xB6\xE3\xDA\xDE\xD6\xD0\xE0\xDA\xD0", kCmdBugJustice},
+ {"\xBF\xE2\xD5\xDD\xD8\xE1", kCmdCourtChaos},
+ {"\xB6\xD8\xD0\xDE\xD9 \xB7\xD2\xE3\xDA", kCmdAirGuitar},
+ {"\xBD\xD0\xD7\xD0\xD4 ..", kCmdBack}
+};
+
MainMenu::MainMenu(BbvsEngine *vm) : Dialog(0, 0, 1, 1), _vm(vm) {
init();
}
@@ -160,7 +182,13 @@ void MainMenu::handleCommand(GUI::CommandSender *sender, uint32 command, uint32
void MainMenu::gotoMenuScreen(int screen) {
for (int i = 0; i < 5; ++i) {
- const MenuButton *btn = &kMenuButtons[screen * 5 + i];
+ const MenuButton *btn;
+
+ if (_vm->_gameDescription->language == Common::RU_RUS) {
+ btn = &kMenuButtonsRu[screen * 5 + i];
+ } else {
+ btn = &kMenuButtons[screen * 5 + i];
+ }
_buttons[i]->setLabel(btn->label);
_buttons[i]->setCmd(btn->cmd);
_buttons[i]->setEnabled(btn->cmd != 0);
diff --git a/engines/bbvs/minigames/bbtennis.cpp b/engines/bbvs/minigames/bbtennis.cpp
index 7763548330..6c7d8cbf31 100644
--- a/engines/bbvs/minigames/bbtennis.cpp
+++ b/engines/bbvs/minigames/bbtennis.cpp
@@ -516,7 +516,7 @@ void MinigameBbTennis::updateObjs() {
}
obj->blinkCtr = _vm->getRandom(64) + 60;
_tennisPlayerDelay = _vm->getRandom(128) + 400 - _playerDecrease;
- if (_vm->getRandom(10) == 1 && !isAnySoundPlaying(kAllSounds, 0x11))
+ if (_vm->getRandom(10) == 1 && !isAnySoundPlaying(kAllSounds, 11))
playSound(kYuppieEnteringCourtSounds[_vm->getRandom(2)]);
}
diff --git a/engines/bbvs/videoplayer.cpp b/engines/bbvs/videoplayer.cpp
index 9ea73ad10b..1b721c434f 100644
--- a/engines/bbvs/videoplayer.cpp
+++ b/engines/bbvs/videoplayer.cpp
@@ -43,6 +43,8 @@ void BbvsEngine::playVideo(int videoNum) {
return;
}
+ debug(0, "Screen format: %s", _system->getScreenFormat().toString().c_str());
+
Video::VideoDecoder *videoDecoder = new Video::AVIDecoder();
if (!videoDecoder->loadFile(videoFilename)) {
delete videoDecoder;
@@ -58,7 +60,14 @@ void BbvsEngine::playVideo(int videoNum) {
if (videoDecoder->needsUpdate()) {
const Graphics::Surface *frame = videoDecoder->decodeNextFrame();
if (frame) {
- _system->copyRectToScreen(frame->getPixels(), frame->pitch, 0, 0, frame->w, frame->h);
+ if (frame->format.bytesPerPixel > 1) {
+ Graphics::Surface *frame1 = frame->convertTo(_system->getScreenFormat());
+ _system->copyRectToScreen(frame1->getPixels(), frame1->pitch, 0, 0, frame1->w, frame1->h);
+ frame1->free();
+ delete frame1;
+ } else {
+ _system->copyRectToScreen(frame->getPixels(), frame->pitch, 0, 0, frame->w, frame->h);
+ }
_system->updateScreen();
}
}
diff --git a/engines/bbvs/walk.cpp b/engines/bbvs/walk.cpp
index 5ef14101a0..e97182ff5d 100644
--- a/engines/bbvs/walk.cpp
+++ b/engines/bbvs/walk.cpp
@@ -326,12 +326,10 @@ void BbvsEngine::canWalkToDest(WalkArea *walkArea, int infoCount) {
}
bool BbvsEngine::walkTestLineWalkable(const Common::Point &sourcePt, const Common::Point &destPt, WalkInfo *walkInfo) {
- const float ptDeltaX = destPt.x - sourcePt.x;
+ const float ptDeltaX = MAX<float>(destPt.x - sourcePt.x, 1.0f);
const float ptDeltaY = destPt.y - sourcePt.y;
const float wDeltaX = walkInfo->x - sourcePt.x;
const float wDeltaY = walkInfo->y - sourcePt.y;
- if (destPt.x == sourcePt.x)
- return true;
if (walkInfo->direction) {
const float nDeltaY = wDeltaX * ptDeltaY / ptDeltaX + (float)sourcePt.y - (float)walkInfo->y;
return (nDeltaY >= 0.0f) && (nDeltaY < (float)walkInfo->delta);
diff --git a/engines/cge2/sound.h b/engines/cge2/sound.h
index 6673b67b7a..02afe610a2 100644
--- a/engines/cge2/sound.h
+++ b/engines/cge2/sound.h
@@ -68,7 +68,7 @@ class Sound {
public:
SmpInfo _smpinf;
- Sound(CGE2Engine *vm);
+ explicit Sound(CGE2Engine *vm);
~Sound();
void open();
void close();
@@ -116,7 +116,7 @@ private:
// Stop MIDI File
void sndMidiStop();
public:
- MusicPlayer(CGE2Engine *vm);
+ explicit MusicPlayer(CGE2Engine *vm);
~MusicPlayer();
void loadMidi(int ref);
diff --git a/engines/cge2/vga13h.cpp b/engines/cge2/vga13h.cpp
index f4064f3565..eb111c3255 100644
--- a/engines/cge2/vga13h.cpp
+++ b/engines/cge2/vga13h.cpp
@@ -629,11 +629,11 @@ void Sprite::gotoxyz(V2D pos) {
if (!_follow) {
FXP m = _vm->_eye->_z / (_pos3D._z - _vm->_eye->_z);
_pos3D._x = (_vm->_eye->_x + (_vm->_eye->_x - _pos2D.x) / m);
- _pos3D._x.round();
+ _pos3D._x = _pos3D._x.round();
if (!_constY) {
_pos3D._y = _vm->_eye->_y + (_vm->_eye->_y - _pos2D.y) / m;
- _pos3D._y.round();
+ _pos3D._y = _pos3D._y.round();
}
}
diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp
index c0f0960aba..6c361d6f1a 100644
--- a/engines/fullpipe/scenes/scene04.cpp
+++ b/engines/fullpipe/scenes/scene04.cpp
@@ -238,7 +238,7 @@ int scene04_updateCursor() {
}
}
- if (g_fp->_objectIdAtCursor == PIC_CSR_ITN && g_fp->_objectIdAtCursor == PIC_SC4_DOWNTRUBA)
+ if (g_fp->_cursorId == PIC_CSR_ITN && g_fp->_objectIdAtCursor == PIC_SC4_DOWNTRUBA)
g_fp->_cursorId = PIC_CSR_GOD;
return g_fp->_cursorId;
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index de3e1ea728..8ee3b14d0c 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -106,9 +106,14 @@ bool StepArray::gotoNextPoint() {
}
void StepArray::insertPoints(Common::Point **points, int pointsCount) {
- if (_currPointIndex + pointsCount >= _pointsCount)
+ if (_currPointIndex + pointsCount >= _pointsCount) {
_points = (Common::Point **)realloc(_points, sizeof(Common::Point *) * (_currPointIndex + pointsCount));
+ if (!_points) {
+ error("Out of memory at StepArray::insertPoints()");
+ }
+ }
+
_maxPointIndex = _currPointIndex + pointsCount;
for (int i = 0; i < pointsCount; i++) {
diff --git a/engines/kyra/sound_intern.h b/engines/kyra/sound_intern.h
index 007ca3d3f5..4b77bf1351 100644
--- a/engines/kyra/sound_intern.h
+++ b/engines/kyra/sound_intern.h
@@ -151,7 +151,7 @@ private:
uint8 *_sfxFileData;
uint8 _sfxChannel;
- TownsEuphonyDriver *_driver;
+ EuphonyPlayer *_player;
bool _cdaPlaying;
diff --git a/engines/kyra/sound_towns.cpp b/engines/kyra/sound_towns.cpp
index 725dedae3f..65ab4f31ef 100644
--- a/engines/kyra/sound_towns.cpp
+++ b/engines/kyra/sound_towns.cpp
@@ -37,13 +37,13 @@ SoundTowns::SoundTowns(KyraEngine_v1 *vm, Audio::Mixer *mixer)
: Sound(vm, mixer), _lastTrack(-1), _musicTrackData(0), _sfxFileData(0), _cdaPlaying(0),
_sfxFileIndex((uint)-1), _musicFadeTable(0), _sfxWDTable(0), _sfxBTTable(0), _sfxChannel(0x46), _currentResourceSet(0) {
memset(&_resInfo, 0, sizeof(_resInfo));
- _driver = new TownsEuphonyDriver(_mixer);
+ _player = new EuphonyPlayer(_mixer);
}
SoundTowns::~SoundTowns() {
g_system->getAudioCDManager()->stop();
haltTrack();
- delete _driver;
+ delete _player;
delete[] _musicTrackData;
delete[] _sfxFileData;
for (int i = 0; i < 3; i++)
@@ -58,15 +58,15 @@ bool SoundTowns::init() {
_sfxBTTable = _vm->staticres()->loadRawData(k1TownsSFXbtTable, unused);
_musicTrackData = new uint8[50570];
- if (!_driver->init())
+ if (!_player->init())
return false;
if (!loadInstruments())
return false;
- _driver->intf()->callback(68);
- _driver->intf()->callback(70, 0x33);
- _driver->setOutputVolume(1, 118, 118);
+ /*_player->driver()->intf()->callback(68);
+ _player->driver()->intf()->callback(70, 0x33);*/
+ _player->driver()->setOutputVolume(1, 118, 118);
return true;
}
@@ -93,7 +93,7 @@ void SoundTowns::playTrack(uint8 track) {
beginFadeOut();
if (_musicEnabled == 2 && trackNum != -1) {
- _driver->setOutputVolume(1, 118, 118);
+ _player->driver()->setOutputVolume(1, 118, 118);
g_system->getAudioCDManager()->play(trackNum + 1, loop ? -1 : 1, 0, 0);
g_system->getAudioCDManager()->updateCD();
_cdaPlaying = true;
@@ -112,12 +112,12 @@ void SoundTowns::haltTrack() {
_cdaPlaying = false;
for (int i = 0; i < 6; i++)
- _driver->chanVolume(i, 0);
+ _player->driver()->channelVolume(i, 0);
for (int i = 0x40; i < 0x46; i++)
- _driver->chanVolume(i, 0);
+ _player->driver()->channelVolume(i, 0);
for (int i = 0; i < 32; i++)
- _driver->configChan_enable(i, 0);
- _driver->stopParser();
+ _player->configPart_enable(i, 0);
+ _player->stop();
}
void SoundTowns::initAudioResourceInfo(int set, void *info) {
@@ -179,11 +179,11 @@ void SoundTowns::playSoundEffect(uint8 track, uint8) {
if (offset == -1)
return;
- if (!_driver->soundEffectIsPlaying(_sfxChannel ^ 1)) {
+ if (!_player->driver()->soundEffectIsPlaying(_sfxChannel ^ 1)) {
_sfxChannel ^= 1;
- } else if (_driver->soundEffectIsPlaying(_sfxChannel)) {
+ } else if (_player->driver()->soundEffectIsPlaying(_sfxChannel)) {
_sfxChannel ^= 1;
- _driver->stopSoundEffect(_sfxChannel);
+ _player->driver()->stopSoundEffect(_sfxChannel);
}
uint32 *sfxHeader = (uint32 *)(fileBody + offset);
@@ -221,57 +221,57 @@ void SoundTowns::playSoundEffect(uint8 track, uint8) {
}
}
- _driver->chanVolume(_sfxChannel, 127);
- _driver->chanPanPos(_sfxChannel, 0x40);
- _driver->chanPitch(_sfxChannel, 0);
- _driver->playSoundEffect(_sfxChannel, note, 127, sfxPlaybackBuffer);
+ _player->driver()->channelVolume(_sfxChannel, 127);
+ _player->driver()->channelPan(_sfxChannel, 0x40);
+ _player->driver()->channelPitch(_sfxChannel, 0);
+ _player->driver()->playSoundEffect(_sfxChannel, note, 127, sfxPlaybackBuffer);
delete[] sfxPlaybackBuffer;
}
void SoundTowns::updateVolumeSettings() {
- if (!_driver)
+ if (!_player)
return;
bool mute = false;
- _driver->setSoundEffectVolume(ConfMan.getInt("sfx_volume"));
+ _player->driver()->setSoundEffectVolume(ConfMan.getInt("sfx_volume"));
if (ConfMan.hasKey("mute"))
mute = ConfMan.getBool("mute");
- _driver->setMusicVolume((mute ? 0 : ConfMan.getInt("music_volume")));
- _driver->setSoundEffectVolume((mute ? 0 : ConfMan.getInt("sfx_volume")));
+ _player->driver()->setMusicVolume((mute ? 0 : ConfMan.getInt("music_volume")));
+ _player->driver()->setSoundEffectVolume((mute ? 0 : ConfMan.getInt("sfx_volume")));
}
void SoundTowns::stopAllSoundEffects() {
- _driver->chanVolume(0x46, 0);
- _driver->chanVolume(0x47, 0);
- _driver->stopSoundEffect(0x46);
- _driver->stopSoundEffect(0x47);
+ _player->driver()->channelVolume(0x46, 0);
+ _player->driver()->channelVolume(0x47, 0);
+ _player->driver()->stopSoundEffect(0x46);
+ _player->driver()->stopSoundEffect(0x47);
_sfxChannel = 0x46;
}
void SoundTowns::beginFadeOut() {
if (_cdaPlaying) {
for (int i = 118; i > 103; i--) {
- _driver->setOutputVolume(1, i, i);
+ _player->driver()->setOutputVolume(1, i, i);
_vm->delay(2 * _vm->tickLength());
}
for (int i = 103; i > 83; i -= 2) {
- _driver->setOutputVolume(1, i, i);
+ _player->driver()->setOutputVolume(1, i, i);
_vm->delay(2 * _vm->tickLength());
}
for (int i = 83; i > 58; i -= 2) {
- _driver->setOutputVolume(1, i, i);
+ _player->driver()->setOutputVolume(1, i, i);
_vm->delay(_vm->tickLength());
}
for (int i = 58; i > 0; i--) {
- _driver->setOutputVolume(1, i, i);
+ _player->driver()->setOutputVolume(1, i, i);
_vm->delay(1);
}
- _driver->setOutputVolume(1, 0, 0);
+ _player->driver()->setOutputVolume(1, 0, 0);
} else {
if (_lastTrack == -1)
@@ -292,9 +292,9 @@ void SoundTowns::beginFadeOut() {
for (int i = 0; i < 12; i++) {
for (int ii = 0; ii < 6; ii++)
- _driver->chanVolume(ii, fadeVolCur[ii]);
+ _player->driver()->channelVolume(ii, fadeVolCur[ii]);
for (int ii = 0x40; ii < 0x46; ii++)
- _driver->chanVolume(ii, fadeVolCur[ii - 0x3A]);
+ _player->driver()->channelVolume(ii, fadeVolCur[ii - 0x3A]);
for (int ii = 0; ii < 6; ii++) {
fadeVolCur[ii] -= fadeVolStep[ii];
@@ -323,20 +323,20 @@ bool SoundTowns::loadInstruments() {
Screen::decodeFrame4(twm, _musicTrackData, 50570);
for (int i = 0; i < 128; i++)
- _driver->loadInstrument(0, i, &_musicTrackData[i * 48 + 8]);
+ _player->driver()->loadInstrument(0, i, &_musicTrackData[i * 48 + 8]);
Screen::decodeFrame4(twm + 3232, _musicTrackData, 50570);
for (int i = 0; i < 32; i++)
- _driver->loadInstrument(0x40, i, &_musicTrackData[i * 128 + 8]);
+ _player->driver()->loadInstrument(0x40, i, &_musicTrackData[i * 128 + 8]);
- _driver->unloadWaveTable(-1);
+ _player->driver()->unloadWaveTable(-1);
uint8 *src = &_musicTrackData[32 * 128 + 8];
for (int i = 0; i < 10; i++) {
- _driver->loadWaveTable(src);
+ _player->driver()->loadWaveTable(src);
src = src + READ_LE_UINT16(&src[12]) + 32;
}
- _driver->reserveSoundEffectChannels(2);
+ _player->driver()->reserveSoundEffectChannels(2);
delete[] twm;
@@ -350,26 +350,26 @@ void SoundTowns::playEuphonyTrack(uint32 offset, int loop) {
const uint8 *src = _musicTrackData + 852;
for (int i = 0; i < 32; i++)
- _driver->configChan_enable(i, *src++);
+ _player->configPart_enable(i, *src++);
for (int i = 0; i < 32; i++)
- _driver->configChan_setMode(i, *src++);
+ _player->configPart_setType(i, *src++);
for (int i = 0; i < 32; i++)
- _driver->configChan_remap(i, *src++);
+ _player->configPart_remap(i, *src++);
for (int i = 0; i < 32; i++)
- _driver->configChan_adjustVolume(i, *src++);
+ _player->configPart_adjustVolume(i, *src++);
for (int i = 0; i < 32; i++)
- _driver->configChan_setTranspose(i, *src++);
+ _player->configPart_setTranspose(i, *src++);
src = _musicTrackData + 1748;
for (int i = 0; i < 6; i++)
- _driver->assignChannel(i, *src++);
+ _player->driver()->assignPartToChannel(i, *src++);
for (int i = 0x40; i < 0x46; i++)
- _driver->assignChannel(i, *src++);
+ _player->driver()->assignPartToChannel(i, *src++);
uint32 trackSize = READ_LE_UINT32(_musicTrackData + 2048);
uint8 startTick = _musicTrackData[2052];
- _driver->setMusicTempo(_musicTrackData[2053]);
+ _player->setTempo(_musicTrackData[2053]);
src = _musicTrackData + 2054;
uint32 l = READ_LE_UINT32(src + trackSize);
@@ -377,14 +377,14 @@ void SoundTowns::playEuphonyTrack(uint32 offset, int loop) {
l = READ_LE_UINT32(src + trackSize);
trackSize += (l + 4);
- _driver->setMusicLoop(loop);
- _driver->startMusicTrack(src, trackSize, startTick);
+ _player->setLoopStatus(loop);
+ _player->startTrack(src, trackSize, startTick);
}
void SoundTowns::fadeOutSoundEffects() {
for (int i = 127; i > 0; i-= 12) {
- _driver->chanVolume(0x46, i);
- _driver->chanVolume(0x47, i);
+ _player->driver()->channelVolume(0x46, i);
+ _player->driver()->channelVolume(0x47, i);
_vm->delay(_vm->tickLength());
}
stopAllSoundEffects();
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 731f2f4ce5..1a2e2c093c 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -39,7 +39,7 @@
namespace Kyra {
-#define RESFILE_VERSION 86
+#define RESFILE_VERSION 87
namespace {
bool checkKyraDat(Common::SeekableReadStream *file) {
diff --git a/engines/lab/anim.cpp b/engines/lab/anim.cpp
new file mode 100644
index 0000000000..eb825fb4c0
--- /dev/null
+++ b/engines/lab/anim.cpp
@@ -0,0 +1,349 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "lab/lab.h"
+
+#include "lab/anim.h"
+#include "lab/dispman.h"
+#include "lab/eventman.h"
+#include "lab/music.h"
+#include "lab/utils.h"
+
+namespace Lab {
+
+Anim::Anim(LabEngine *vm) : _vm(vm) {
+ _lastBlockHeader = 0;
+ _numChunks = 1;
+ _headerdata._width = 0;
+ _headerdata._height = 0;
+ _headerdata._fps = 0;
+ _headerdata._flags = 0;
+ _delayMicros = 0;
+ _continuous = false;
+ _isPlaying = false;
+ _isAnim = false;
+ _isPal = false;
+ _noPalChange = false;
+ _donePal = false;
+ _frameNum = 0;
+ _playOnce = false;
+ _diffFile = nullptr;
+ _diffFileStart = 0;
+ _size = 0;
+ _scrollScreenBuffer = nullptr;
+ _waitForEffect = false;
+ _stopPlayingEnd = false;
+ _sampleSpeed = 0;
+ _doBlack = false;
+ _diffWidth = 0;
+ _diffHeight = 0;
+
+ for (int i = 0; i < 3 * 256; i++)
+ _diffPalette[i] = 0;
+
+ _outputBuffer = nullptr; // output to screen
+}
+
+Anim::~Anim() {
+ delete[] _vm->_anim->_scrollScreenBuffer;
+ _vm->_anim->_scrollScreenBuffer = nullptr;
+}
+
+void Anim::setOutputBuffer(byte *memoryBuffer) {
+ _outputBuffer = memoryBuffer;
+}
+
+
+void Anim::diffNextFrame(bool onlyDiffData) {
+ if (_lastBlockHeader == 65535)
+ // Already done.
+ return;
+
+ bool drawOnScreen = false;
+ byte *startOfBuf = _outputBuffer;
+ int bufPitch = _vm->_graphics->_screenWidth;
+
+ if (!_outputBuffer) {
+ startOfBuf = _vm->_graphics->getCurrentDrawingBuffer();
+ drawOnScreen = true;
+ }
+ byte *endOfBuf = startOfBuf + (int)_diffWidth * _diffHeight;
+
+ _vm->_event->mouseHide();
+
+ int curBit = 0;
+
+ while (1) {
+ byte *buf = startOfBuf + 0x10000 * curBit;
+
+ if (buf >= endOfBuf) {
+ _vm->_event->mouseShow();
+
+ if (!onlyDiffData) {
+ if (_headerdata._fps) {
+ uint32 targetMillis = _vm->_system->getMillis() + _delayMicros;
+ while (_vm->_system->getMillis() < targetMillis)
+ _vm->_system->delayMillis(10);
+ }
+
+ if (_isPal && !_noPalChange) {
+ _vm->_graphics->setPalette(_diffPalette, 256);
+ _isPal = false;
+ }
+
+ _donePal = true;
+ }
+
+ if (_isPal && !_noPalChange && !onlyDiffData && !_donePal) {
+ _vm->_graphics->setPalette(_diffPalette, 256);
+ _isPal = false;
+ }
+
+ _donePal = false;
+
+ _frameNum++;
+
+ if ((_frameNum == 1) && (_continuous || !_playOnce))
+ _diffFileStart = _diffFile->pos();
+
+ _isAnim = (_frameNum >= 3) && (!_playOnce);
+
+ if (drawOnScreen)
+ _vm->_graphics->screenUpdate();
+
+ // done with the next frame.
+ return;
+ }
+
+ _vm->updateMusicAndEvents();
+ _lastBlockHeader = _diffFile->readUint32LE();
+ _size = _diffFile->readUint32LE();
+
+ uint32 curPos = 0;
+
+ switch (_lastBlockHeader) {
+ case 8:
+ _diffFile->read(_diffPalette, _size);
+ _isPal = true;
+ break;
+
+ case 10:
+ if (onlyDiffData) {
+ if (curBit > 0)
+ error("diffNextFrame: attempt to read screen to non-zero plane (%d)", curBit);
+ delete[] _scrollScreenBuffer;
+ _scrollScreenBuffer = new byte[_headerdata._width * _headerdata._height];
+ _diffFile->read(_scrollScreenBuffer, _size);
+ } else {
+ _diffFile->read(buf, _size);
+ }
+ curBit++;
+ break;
+
+ case 11:
+ curPos = _diffFile->pos();
+ _diffFile->skip(4);
+ _vm->_utils->runLengthDecode(buf, _diffFile);
+ curBit++;
+ _diffFile->seek(curPos + _size, SEEK_SET);
+ break;
+
+ case 12:
+ curPos = _diffFile->pos();
+ _diffFile->skip(4);
+ _vm->_utils->verticalRunLengthDecode(buf, _diffFile, bufPitch);
+ curBit++;
+ _diffFile->seek(curPos + _size, SEEK_SET);
+ break;
+
+ case 20:
+ curPos = _diffFile->pos();
+ _vm->_utils->unDiff(buf, buf, _diffFile, bufPitch, false);
+ curBit++;
+ _diffFile->seek(curPos + _size, SEEK_SET);
+ break;
+
+ case 21:
+ curPos = _diffFile->pos();
+ _vm->_utils->unDiff(buf, buf, _diffFile, bufPitch, true);
+ curBit++;
+ _diffFile->seek(curPos + _size, SEEK_SET);
+ break;
+
+ case 25:
+ case 26:
+ curBit++;
+ break;
+
+ case 30:
+ case 31:
+ if (_waitForEffect) {
+ while (_vm->_music->isSoundEffectActive()) {
+ _vm->updateMusicAndEvents();
+ _vm->waitTOF();
+ }
+ }
+
+ _size -= 8;
+
+ _diffFile->skip(4);
+ _sampleSpeed = _diffFile->readUint16LE();
+ _diffFile->skip(2);
+
+ _vm->_music->playSoundEffect(_sampleSpeed, _size, _diffFile);
+ break;
+
+ case 65535:
+ if ((_frameNum == 1) || _playOnce || _stopPlayingEnd) {
+ bool didTOF = false;
+
+ if (_waitForEffect) {
+ while (_vm->_music->isSoundEffectActive()) {
+ _vm->updateMusicAndEvents();
+ _vm->waitTOF();
+
+ if (drawOnScreen)
+ didTOF = true;
+ }
+ }
+
+ _isPlaying = false;
+ _vm->_event->mouseShow();
+
+ if (!didTOF)
+ _vm->_graphics->screenUpdate();
+
+ return;
+ }
+
+ // Random frame number so it never gets back to 2
+ _frameNum = 4;
+ _diffFile->seek(_diffFileStart, SEEK_SET);
+ break;
+
+ default:
+ _diffFile->skip(_size);
+ break;
+ }
+ }
+}
+
+void Anim::stopDiff() {
+ if (_isPlaying && _isAnim)
+ _vm->_graphics->blackScreen();
+}
+
+void Anim::stopDiffEnd() {
+ if (!_isPlaying)
+ return;
+
+ _stopPlayingEnd = true;
+ while (_isPlaying) {
+ _vm->updateMusicAndEvents();
+ diffNextFrame();
+ }
+}
+
+void Anim::readDiff(Common::File *diffFile, bool playOnce, bool onlyDiffData) {
+ _playOnce = playOnce;
+ _delayMicros = 0;
+ _frameNum = 0;
+ _numChunks = 1;
+ _donePal = false;
+ _stopPlayingEnd = false;
+ _isPlaying = true;
+
+ if (_doBlack) {
+ _doBlack = false;
+ _vm->_graphics->blackScreen();
+ }
+
+ _diffFile = diffFile;
+
+ _continuous = false;
+ uint32 signature1 = _diffFile->readUint32BE();
+ uint32 signature2 = _diffFile->readUint32LE();
+
+ if ((signature1 != MKTAG('D', 'I', 'F', 'F')) || (signature2 != 1219009121)) {
+ _isPlaying = false;
+ return;
+ }
+
+ uint32 signature3 = _diffFile->readUint32LE();
+ _size = _diffFile->readUint32LE();
+
+ if (signature3 != 0)
+ return;
+
+ // sizeof(headerdata) != 18, but the padding might be at the end
+ // 2 bytes, version, unused.
+ _diffFile->skip(2);
+ _headerdata._width = _diffFile->readUint16LE();
+ _headerdata._height = _diffFile->readUint16LE();
+ // 1 byte, depth, unused
+ _diffFile->skip(1);
+ _headerdata._fps = _diffFile->readByte();
+
+ // HACK: The original game defines a 1 second delay when changing screens, which is
+ // very annoying. We first removed the delay, but it looked wrong when changing screens
+ // as it was possible to see that something was displayed, without being able to tell
+ // what it was. A shorter delay (150ms) makes it acceptable during gameplay and
+ // readable. The big question is: do we need that message?
+ _vm->_system->delayMillis(150);
+
+ if (_headerdata._fps == 1)
+ _headerdata._fps = 0;
+
+ // 4 + 2 bytes, buffer size and machine, unused
+ _diffFile->skip(6);
+ _headerdata._flags = _diffFile->readUint32LE();
+
+ _diffFile->skip(_size - 18);
+
+ _continuous = CONTINUOUS & _headerdata._flags;
+ _diffWidth = _headerdata._width;
+ _diffHeight = _headerdata._height;
+ _vm->_utils->setBytesPerRow(_diffWidth);
+
+ delete[] _scrollScreenBuffer;
+ _scrollScreenBuffer = nullptr;
+
+ if (_headerdata._fps)
+ _delayMicros = 1000 / _headerdata._fps;
+
+ _lastBlockHeader = signature3;
+ if (_playOnce) {
+ while (_lastBlockHeader != 65535)
+ diffNextFrame(onlyDiffData);
+ } else
+ diffNextFrame(onlyDiffData);
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/anim.h b/engines/lab/anim.h
new file mode 100644
index 0000000000..1979aa5979
--- /dev/null
+++ b/engines/lab/anim.h
@@ -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 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#ifndef LAB_ANIM_H
+#define LAB_ANIM_H
+
+namespace Lab {
+
+class LabEngine;
+#define CONTINUOUS 0xFFFF
+
+struct DIFFHeader {
+ uint16 _width;
+ uint16 _height;
+ char _fps;
+ uint32 _flags;
+};
+
+class Anim {
+private:
+ LabEngine *_vm;
+
+ uint32 _lastBlockHeader;
+ uint16 _numChunks;
+ uint32 _delayMicros;
+ bool _continuous;
+ bool _isPlaying;
+ bool _isAnim;
+ bool _isPal;
+ bool _donePal;
+ uint16 _frameNum;
+ bool _playOnce;
+ Common::File *_diffFile;
+ uint32 _diffFileStart;
+ uint32 _size;
+ bool _stopPlayingEnd;
+ uint16 _sampleSpeed;
+ uint32 _diffWidth;
+ uint32 _diffHeight;
+
+ byte *_outputBuffer;
+
+public:
+ Anim(LabEngine *vm);
+ virtual ~Anim();
+
+ DIFFHeader _headerdata;
+ char _diffPalette[256 * 3];
+ bool _waitForEffect; // Wait for each sound effect to finish before continuing.
+ bool _doBlack; // Black the screen before new picture
+ bool _noPalChange; // Don't change the palette.
+ byte *_scrollScreenBuffer;
+
+ /**
+ * Reads in a DIFF file.
+ */
+ void setOutputBuffer(byte *memoryBuffer); // nullptr for output to screen
+ void readDiff(Common::File *diffFile, bool playOnce, bool onlyDiffData);
+ void diffNextFrame(bool onlyDiffData = false);
+
+ /**
+ * Stops an animation from running.
+ */
+ void stopDiff();
+
+ /**
+ * Stops an animation from running.
+ */
+ void stopDiffEnd();
+};
+
+} // End of namespace Lab
+
+#endif // LAB_ANIM_H
diff --git a/engines/lab/configure.engine b/engines/lab/configure.engine
new file mode 100644
index 0000000000..18091b1b84
--- /dev/null
+++ b/engines/lab/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]
+add_engine lab "Labyrinth of Time" no
diff --git a/engines/lab/console.cpp b/engines/lab/console.cpp
new file mode 100644
index 0000000000..12eafd3789
--- /dev/null
+++ b/engines/lab/console.cpp
@@ -0,0 +1,128 @@
+/* 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.
+ *
+ */
+
+#include "gui/debugger.h"
+
+#include "lab/lab.h"
+#include "lab/console.h"
+#include "lab/processroom.h"
+#include "lab/resource.h"
+
+namespace Lab {
+
+Console::Console(LabEngine *vm) : GUI::Debugger(), _vm(vm) {
+ registerCmd("scene", WRAP_METHOD(Console, Cmd_Scene));
+ registerCmd("scene_resources", WRAP_METHOD(Console, Cmd_DumpSceneResources));
+ registerCmd("find_action", WRAP_METHOD(Console, Cmd_FindAction));
+}
+
+Console::~Console() {
+}
+
+bool Console::Cmd_Scene(int argc, const char **argv) {
+ if (argc != 2) {
+ const char *directions[] = { "North", "South", "East", "West" };
+ debugPrintf("Current scene is %d, direction: %s\n", _vm->_roomNum, directions[_vm->getDirection()]);
+ debugPrintf("Use %s <scene number> to change the current scene\n", argv[0]);
+ return true;
+ }
+
+ _vm->_roomNum = atoi(argv[1]);
+
+ return false;
+}
+
+bool Console::Cmd_DumpSceneResources(int argc, const char **argv) {
+ if (argc != 2) {
+ debugPrintf("Usage: %s <scene number> to dump the resources for a scene\n", argv[0]);
+ return true;
+ }
+
+ int scene = atoi(argv[1]);
+ _vm->_resource->readViews(scene);
+ RoomData *roomData = &_vm->_rooms[scene];
+ RuleList &rules = roomData->_rules;
+ const char *transitions[] = { "None", "Wipe", "ScrollWipe", "ScrollBlack", "ScrollBounce", "Transporter", "ReadFirstFrame", "ReadNextFrame" };
+ const char *ruleTypes[] = { "None", "Action", "Operate", "Go forward", "Conditions", "Turn", "Go main view", "Turn from to" };
+ const char *directions[] = { "", "North", "South", "East", "West" };
+ const char *actionTypes[] = {
+ "", "PlaySound", "PlaySoundLooping", "ShowDiff", "ShowDiffLooping", "LoadDiff", "LoadBitmap", "ShowBitmap", "Transition", "NoUpdate", "ForceUpdate",
+ "ShowCurPict", "SetElement", "UnsetElement", "ShowMessage", "ShowMessages", "ChangeRoom", "SetCloseup", "MainView", "SubInv", "AddInv", "ShowDir",
+ "WaitSecs", "StopMusic", "StartMusic", "ChangeMusic", "ResetMusic", "FillMusic", "WaitSound", "ClearSound", "WinMusic", "WinGame", "LostGame",
+ "ResetBuffer", "SpecialCmd", "CShowMessage", "PlaySoundNoWait"
+ };
+
+ debugPrintf("Room mesage: %s\n", roomData->_roomMsg.c_str());
+ debugPrintf("Transition: %s (%d)\n", transitions[roomData->_transitionType], roomData->_transitionType);
+
+ debugPrintf("Script:\n");
+
+ for (RuleList::iterator rule = rules.begin(); rule != rules.end(); ++rule) {
+ debugPrintf("Rule type: %s", ruleTypes[rule->_ruleType]);
+ if (rule->_ruleType == kRuleTypeAction || rule->_ruleType == kRuleTypeOperate)
+ debugPrintf(" (item %d, closeup %d)", rule->_param1, rule->_param2);
+ else if (rule->_ruleType == kRuleTypeGoForward)
+ debugPrintf(" (%s)", directions[rule->_param1]);
+ else if (rule->_ruleType == kRuleTypeTurnFromTo)
+ debugPrintf(" (from %s to %s)", directions[rule->_param1], directions[rule->_param2]);
+ debugPrintf("\n");
+
+ ActionList::iterator action;
+ for (action = rule->_actionList.begin(); action != rule->_actionList.end(); ++action) {
+ debugPrintf(" - %s ('%s', %d, %d, %d)\n", actionTypes[action->_actionType], action->_messages[0].c_str(), action->_param1, action->_param2, action->_param3);
+ }
+ }
+
+ return true;
+}
+
+bool Console::Cmd_FindAction(int argc, const char **argv) {
+ if (argc < 2) {
+ debugPrintf("Usage: %s <action id> [param 1] [param 2] [param 3]\n", argv[0]);
+ return true;
+ }
+
+ int actionId = atoi(argv[1]);
+ int param1 = (argc > 2) ? atoi(argv[2]) : -1;
+ int param2 = (argc > 3) ? atoi(argv[3]) : -1;
+ int param3 = (argc > 4) ? atoi(argv[4]) : -1;
+
+ for (int i = 1; i <= _vm->_manyRooms; i++) {
+ _vm->_resource->readViews(i);
+
+ for (RuleList::iterator rule = _vm->_rooms[i]._rules.begin(); rule != _vm->_rooms[i]._rules.end(); ++rule) {
+ ActionList::iterator action;
+ for (action = rule->_actionList.begin(); action != rule->_actionList.end(); ++action) {
+ if (action->_actionType == actionId &&
+ (action->_param1 == param1 || param1 == -1) &&
+ (action->_param2 == param2 || param2 == -1) &&
+ (action->_param3 == param3 || param3 == -1)) {
+ debugPrintf("Found at script %d\n", i);
+ }
+ }
+ }
+ }
+
+ return true;
+}
+
+} // End of namespace Neverhood
diff --git a/engines/lab/console.h b/engines/lab/console.h
new file mode 100644
index 0000000000..af41b6034b
--- /dev/null
+++ b/engines/lab/console.h
@@ -0,0 +1,46 @@
+/* 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.
+ *
+ */
+
+#ifndef LAB_CONSOLE_H
+#define LAB_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Lab {
+
+class LabEngine;
+
+class Console : public GUI::Debugger {
+public:
+ Console(LabEngine *vm);
+ virtual ~Console(void);
+
+private:
+ LabEngine *_vm;
+
+ bool Cmd_Scene(int argc, const char **argv);
+ bool Cmd_DumpSceneResources(int argc, const char **argv);
+ bool Cmd_FindAction(int argc, const char **argv);
+};
+
+} // End of namespace Lab
+#endif
diff --git a/engines/lab/detection.cpp b/engines/lab/detection.cpp
new file mode 100644
index 0000000000..805594bf6a
--- /dev/null
+++ b/engines/lab/detection.cpp
@@ -0,0 +1,248 @@
+/* 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.
+ *
+ */
+
+ /*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "engines/advancedDetector.h"
+
+#include "lab/lab.h"
+
+static const PlainGameDescriptor lab_setting[] = {
+ { "lab", "Labyrinth of Time" },
+ { 0, 0 }
+};
+
+static const ADGameDescription labDescriptions[] = {
+ {
+ "lab",
+ "",
+ {
+ { "doors", 0, "d77536010e7e5ae17ee066323ceb9585", 2537 }, // game/doors
+ { "noteold.fon", 0, "6c1d90ad55149556e79d3f7bfddb4bd7", 9252 }, // game/spict/noteold.fon
+ { NULL, 0, NULL, 0 }
+ },
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ {
+ "lab",
+ "Lowres",
+ {
+ { "doors", 0, "d77536010e7e5ae17ee066323ceb9585", 2537 }, // game/doors
+ { "64b", 0, "3a84d41bcc6a782f22e8e954bce09721", 39916 }, // game/pict/h2/64b
+ { NULL, 0, NULL, 0 }
+ },
+ Common::EN_ANY,
+ Common::kPlatformDOS,
+ Lab::GF_LOWRES,
+ GUIO0()
+ },
+ {
+ "lab",
+ "Rerelease",
+ {
+ { "doors", 0, "d77536010e7e5ae17ee066323ceb9585", 2537 }, // game/doors
+ { "noteold.fon", 0, "6c1d90ad55149556e79d3f7bfddb4bd7", 9252 }, // game/spict/noteold.fon
+ { "wyrmkeep",0, "97c7064c54c28b952d37c4ebff6efa50", 52286 }, // game/spict/intro
+ { NULL, 0, NULL, 0 }
+ },
+ Common::EN_ANY,
+ Common::kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO0()
+ },
+ {
+ "lab",
+ "",
+ AD_ENTRY1s("doors", "7bf458df6ec30cc8ef4665e4d7c77f59", 2537), // game/doors
+ Common::EN_ANY,
+ Common::kPlatformAmiga,
+ Lab::GF_LOWRES,
+ GUIO0()
+ },
+ AD_TABLE_END_MARKER
+};
+
+static const char *const directoryGlobs[] = {
+ "game",
+ "pict",
+ "spict",
+ "rooms",
+ "h2",
+ "intro",
+ 0
+};
+
+namespace Lab {
+
+Common::Platform LabEngine::getPlatform() const {
+ return _gameDescription->platform;
+}
+
+uint32 LabEngine::getFeatures() const {
+ return _gameDescription->flags | _extraGameFeatures;
+}
+
+} // End of namespace Lab
+
+class LabMetaEngine : public AdvancedMetaEngine {
+public:
+ LabMetaEngine() : AdvancedMetaEngine(labDescriptions, sizeof(ADGameDescription), lab_setting) {
+ _singleid = "lab";
+
+ _maxScanDepth = 4;
+ _directoryGlobs = directoryGlobs;
+ _flags = kADFlagUseExtraAsHint;
+ }
+
+ virtual const char *getName() const {
+ return "Lab";
+ }
+
+ virtual const char *getOriginalCopyright() const {
+ return "Labyrinth of Time (c) 2004 The Wyrmkeep Entertainment Co. and Terra Nova Development";
+ }
+
+ virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
+ // Instantiate Engine even if the game data is not found.
+ *engine = new Lab::LabEngine(syst, desc);
+ return true;
+ }
+
+ virtual bool hasFeature(MetaEngineFeature f) const;
+ SaveStateList listSaves(const char *target) const;
+ virtual int getMaximumSaveSlot() const;
+ void removeSaveState(const char *target, int slot) const;
+ SaveStateDescriptor querySaveMetaInfos(const char *target, int slot) const;
+};
+
+bool LabMetaEngine::hasFeature(MetaEngineFeature f) const {
+ return
+ (f == kSupportsListSaves) ||
+ //(f == kSupportsLoadingDuringStartup) ||
+ (f == kSupportsDeleteSave) ||
+ (f == kSavesSupportMetaInfo) ||
+ (f == kSavesSupportThumbnail) ||
+ (f == kSavesSupportCreationDate) ||
+ (f == kSavesSupportPlayTime);
+}
+
+bool Lab::LabEngine::hasFeature(EngineFeature f) const {
+ return (f == kSupportsRTL);
+ //(f == kSupportsLoadingDuringRuntime) ||
+ //(f == kSupportsSavingDuringRuntime);
+}
+
+SaveStateList LabMetaEngine::listSaves(const char *target) const {
+ Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+ Lab::SaveGameHeader header;
+ Common::String pattern = target;
+ pattern += ".???";
+
+ Common::StringArray filenames;
+ filenames = saveFileMan->listSavefiles(pattern.c_str());
+ Common::sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)*/
+
+ SaveStateList saveList;
+
+ for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
+ // Obtain the last 3 digits of the filename, since they correspond to the save slot
+ int slotNum = atoi(file->c_str() + file->size() - 3);
+
+ if ((slotNum >= 0) && (slotNum <= 999)) {
+ Common::InSaveFile *in = saveFileMan->openForLoading(file->c_str());
+ if (in) {
+ if (Lab::readSaveGameHeader(in, header))
+ saveList.push_back(SaveStateDescriptor(slotNum, header._descr.getDescription()));
+ delete in;
+ }
+ }
+ }
+
+ return saveList;
+}
+
+int LabMetaEngine::getMaximumSaveSlot() const {
+ return 999;
+}
+
+void LabMetaEngine::removeSaveState(const char *target, int slot) const {
+ Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
+ Common::String filename = Common::String::format("%s.%03u", target, slot);
+
+ saveFileMan->removeSavefile(filename.c_str());
+
+ Common::StringArray filenames;
+ Common::String pattern = target;
+ pattern += ".???";
+ filenames = saveFileMan->listSavefiles(pattern.c_str());
+ Common::sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
+
+ for (Common::StringArray::const_iterator file = filenames.begin(); file != filenames.end(); ++file) {
+ // Obtain the last 3 digits of the filename, since they correspond to the save slot
+ int slotNum = atoi(file->c_str() + file->size() - 3);
+
+ // Rename every slot greater than the deleted slot,
+ if (slotNum > slot) {
+ saveFileMan->renameSavefile(file->c_str(), filename.c_str());
+ filename = Common::String::format("%s.%03u", target, ++slot);
+ }
+ }
+}
+
+SaveStateDescriptor LabMetaEngine::querySaveMetaInfos(const char *target, int slot) const {
+ Common::String filename = Common::String::format("%s.%03u", target, slot);
+ Common::InSaveFile *in = g_system->getSavefileManager()->openForLoading(filename.c_str());
+
+ if (in) {
+ Lab::SaveGameHeader header;
+
+ bool successfulRead = Lab::readSaveGameHeader(in, header);
+ delete in;
+
+ if (successfulRead) {
+ SaveStateDescriptor desc(slot, header._descr.getDescription());
+ // Do not allow save slot 0 (used for auto-saving) to be deleted or
+ // overwritten.
+ //desc.setDeletableFlag(slot != 0);
+ //desc.setWriteProtectedFlag(slot == 0);
+
+ return header._descr;
+ }
+ }
+
+ return SaveStateDescriptor();
+}
+
+#if PLUGIN_ENABLED_DYNAMIC(LAB)
+ REGISTER_PLUGIN_DYNAMIC(LAB, PLUGIN_TYPE_ENGINE, LabMetaEngine);
+#else
+ REGISTER_PLUGIN_STATIC(LAB, PLUGIN_TYPE_ENGINE, LabMetaEngine);
+#endif
diff --git a/engines/lab/dispman.cpp b/engines/lab/dispman.cpp
new file mode 100644
index 0000000000..8ff6a61675
--- /dev/null
+++ b/engines/lab/dispman.cpp
@@ -0,0 +1,971 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "graphics/palette.h"
+
+#include "lab/lab.h"
+
+#include "lab/anim.h"
+#include "lab/dispman.h"
+#include "lab/eventman.h"
+#include "lab/music.h"
+#include "lab/image.h"
+#include "lab/resource.h"
+#include "lab/utils.h"
+
+namespace Lab {
+
+DisplayMan::DisplayMan(LabEngine *vm) : _vm(vm) {
+ _longWinInFront = false;
+ _lastMessageLong = false;
+ _actionMessageShown = false;
+
+ _screenBytesPerPage = 0;
+ _curBitmap = nullptr;
+ _displayBuffer = nullptr;
+ _currentDisplayBuffer = nullptr;
+ _fadePalette = nullptr;
+
+ _screenWidth = 0;
+ _screenHeight = 0;
+
+ for (int i = 0; i < 256 * 3; i++)
+ _curvgapal[i] = 0;
+}
+
+DisplayMan::~DisplayMan() {
+ freePict();
+ delete[] _displayBuffer;
+}
+
+void DisplayMan::loadPict(const Common::String filename) {
+ freePict();
+ _curBitmap = _vm->_resource->openDataFile(filename);
+}
+
+void DisplayMan::loadBackPict(const Common::String fileName, uint16 *highPal) {
+ _fadePalette = highPal;
+ _vm->_anim->_noPalChange = true;
+ readPict(fileName);
+
+ for (int i = 0; i < 16; i++) {
+ highPal[i] = ((_vm->_anim->_diffPalette[i * 3] >> 2) << 8) +
+ ((_vm->_anim->_diffPalette[i * 3 + 1] >> 2) << 4) +
+ ((_vm->_anim->_diffPalette[i * 3 + 2] >> 2));
+ }
+
+ _vm->_anim->_noPalChange = false;
+}
+
+void DisplayMan::readPict(const Common::String filename, bool playOnce, bool onlyDiffData, byte *memoryBuffer) {
+ _vm->_anim->stopDiff();
+ loadPict(filename);
+ _vm->updateMusicAndEvents();
+
+ if (!_vm->_music->_loopSoundEffect)
+ _vm->_music->stopSoundEffect();
+
+ _vm->_anim->setOutputBuffer(memoryBuffer);
+ _vm->_anim->readDiff(_curBitmap, playOnce, onlyDiffData);
+}
+
+void DisplayMan::freePict() {
+ delete _curBitmap;
+ _curBitmap = nullptr;
+}
+
+Common::String DisplayMan::getWord(const char *mainBuffer) {
+ Common::String result;
+
+ for (int i = 0; mainBuffer[i] && (mainBuffer[i] != ' ') && (mainBuffer[i] != '\n'); i++)
+ result += mainBuffer[i];
+
+ return result;
+}
+
+Common::String DisplayMan::getLine(TextFont *tf, const char **mainBuffer, uint16 lineWidth) {
+ uint16 curWidth = 0;
+ Common::String result;
+
+ while ((*mainBuffer)[0]) {
+ Common::String wordBuffer = getWord(*mainBuffer);
+
+ if ((curWidth + textLength(tf, wordBuffer)) <= lineWidth) {
+ result += wordBuffer;
+ (*mainBuffer) += wordBuffer.size();
+
+ // end of line
+ if ((*mainBuffer)[0] == '\n') {
+ (*mainBuffer)++;
+ break;
+ }
+
+ // append any space after the word
+ if ((*mainBuffer)[0]) {
+ result += (*mainBuffer)[0];
+ (*mainBuffer)++;
+ }
+
+ curWidth = textLength(tf, result);
+ } else
+ break;
+ }
+
+ return result;
+}
+
+int DisplayMan::flowText(TextFont *font, int16 spacing, byte penColor, byte backPen,
+ bool fillBack, bool centerh, bool centerv, bool output, Common::Rect textRect, const char *str, Image *targetImage) {
+
+ byte *saveDisplayBuffer = _currentDisplayBuffer;
+
+ if (targetImage) {
+ _currentDisplayBuffer = targetImage->_imageData;
+ assert(_screenBytesPerPage == (uint32)(targetImage->_width * targetImage->_height));
+ }
+
+ if (fillBack)
+ rectFill(textRect, backPen);
+
+ if (!str)
+ return 0;
+
+ const char *orig = str;
+
+ TextFont *msgFont = font;
+ uint16 fontHeight = textHeight(msgFont) + spacing;
+ uint16 numLines = (textRect.height() + 1) / fontHeight;
+ uint16 width = textRect.width() + 1;
+ uint16 y = textRect.top;
+
+ if (centerv && output) {
+ const char *temp = str;
+ uint16 actlines = 0;
+
+ while (temp[0]) {
+ getLine(msgFont, &temp, width);
+ actlines++;
+ }
+
+ if (actlines <= numLines)
+ y += ((textRect.height() + 1) - (actlines * fontHeight)) / 2;
+ }
+
+ while (numLines && str[0]) {
+ Common::String lineBuffer;
+ lineBuffer = getLine(msgFont, &str, width);
+
+ uint16 x = textRect.left;
+
+ if (centerh)
+ x += (width - textLength(msgFont, lineBuffer)) / 2;
+
+ if (output)
+ drawText(msgFont, x, y, penColor, lineBuffer);
+
+ numLines--;
+ y += fontHeight;
+ }
+
+ _currentDisplayBuffer = saveDisplayBuffer;
+
+ return (str - orig);
+}
+
+void DisplayMan::createBox(uint16 y2) {
+ // Message box area
+ rectFillScaled(4, 154, 315, y2 - 2, 7);
+
+ // Box around message area
+ drawHLine(_vm->_utils->vgaScaleX(2), _vm->_utils->vgaScaleY(152), _vm->_utils->vgaScaleX(317), 0);
+ drawVLine(_vm->_utils->vgaScaleX(317), _vm->_utils->vgaScaleY(152), _vm->_utils->vgaScaleY(y2), 0);
+ drawHLine(_vm->_utils->vgaScaleX(2), _vm->_utils->vgaScaleY(y2), _vm->_utils->vgaScaleX(317), 0);
+ drawVLine(_vm->_utils->vgaScaleX(2), _vm->_utils->vgaScaleY(152), _vm->_utils->vgaScaleY(y2), 0);
+}
+
+int DisplayMan::longDrawMessage(Common::String str, bool isActionMessage) {
+ if (isActionMessage) {
+ _actionMessageShown = true;
+ } else if (_actionMessageShown) {
+ _actionMessageShown = false;
+ return 0;
+ }
+
+ if (str.empty())
+ return 0;
+
+ _vm->_event->attachButtonList(nullptr);
+ _vm->_event->mouseHide();
+
+ if (!_longWinInFront) {
+ _longWinInFront = true;
+ // Clear Area
+ rectFill(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), _vm->_utils->vgaScaleY(199), 3);
+ }
+
+ createBox(198);
+ _vm->_event->mouseShow();
+
+ return flowText(_vm->_msgFont, 0, 1, 7, false, true, true, true, _vm->_utils->vgaRectScale(6, 155, 313, 195), str.c_str());
+}
+
+void DisplayMan::drawMessage(Common::String str, bool isActionMessage) {
+ if (isActionMessage) {
+ _actionMessageShown = true;
+ } else if (_actionMessageShown) {
+ _actionMessageShown = false;
+ return;
+ }
+
+ if (str.empty())
+ return;
+
+ if ((textLength(_vm->_msgFont, str) > _vm->_utils->vgaScaleX(306))) {
+ longDrawMessage(str, isActionMessage);
+ _lastMessageLong = true;
+ } else {
+ if (_longWinInFront) {
+ _longWinInFront = false;
+ drawPanel();
+ }
+
+ _vm->_event->mouseHide();
+ createBox(168);
+ drawText(_vm->_msgFont, _vm->_utils->vgaScaleX(7), _vm->_utils->vgaScaleY(155) + _vm->_utils->svgaCord(2), 1, str);
+ _vm->_event->mouseShow();
+ _lastMessageLong = false;
+ }
+}
+
+void DisplayMan::drawPanel() {
+ _vm->_event->mouseHide();
+
+ // Clear Area
+ rectFill(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), _vm->_utils->vgaScaleY(199), 3);
+
+ // First Line
+ drawHLine(0, _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), 0);
+ // Second Line
+ drawHLine(0, _vm->_utils->vgaScaleY(149) + 1 + _vm->_utils->svgaCord(2), _vm->_utils->vgaScaleX(319), 5);
+ // Button Separators
+ drawHLine(0, _vm->_utils->vgaScaleY(170), _vm->_utils->vgaScaleX(319), 0);
+
+ if (!_vm->_alternate) {
+ // The horizontal lines under the black one
+ drawHLine(0, _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(319), 4);
+ _vm->_event->drawButtonList(&_vm->_moveButtonList);
+ } else {
+ if (_vm->getPlatform() != Common::kPlatformWindows) {
+ // Vertical Black lines
+ drawVLine(_vm->_utils->vgaScaleX(124), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199), 0);
+ drawVLine(_vm->_utils->vgaScaleX(194), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199), 0);
+ } else {
+ // Vertical Black lines
+ drawVLine(_vm->_utils->vgaScaleX(90), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199), 0);
+ drawVLine(_vm->_utils->vgaScaleX(160), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199), 0);
+ drawVLine(_vm->_utils->vgaScaleX(230), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleY(199), 0);
+ }
+
+ // The horizontal lines under the black one
+ drawHLine(0, _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(122), 4);
+ drawHLine(_vm->_utils->vgaScaleX(126), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(192), 4);
+ drawHLine(_vm->_utils->vgaScaleX(196), _vm->_utils->vgaScaleY(170) + 1, _vm->_utils->vgaScaleX(319), 4);
+ // The vertical high light lines
+ drawVLine(_vm->_utils->vgaScaleX(1), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198), 4);
+
+ if (_vm->getPlatform() != Common::kPlatformWindows) {
+ drawVLine(_vm->_utils->vgaScaleX(126), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198), 4);
+ drawVLine(_vm->_utils->vgaScaleX(196), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198), 4);
+ } else {
+ drawVLine(_vm->_utils->vgaScaleX(92), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198), 4);
+ drawVLine(_vm->_utils->vgaScaleX(162), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198), 4);
+ drawVLine(_vm->_utils->vgaScaleX(232), _vm->_utils->vgaScaleY(170) + 2, _vm->_utils->vgaScaleY(198), 4);
+ }
+
+ _vm->_event->drawButtonList(&_vm->_invButtonList);
+ }
+
+ _vm->_event->mouseShow();
+}
+
+void DisplayMan::setUpScreens() {
+ EventManager *e = _vm->_event;
+ ButtonList *moveButtonList = &_vm->_moveButtonList;
+ ButtonList *invButtonList = &_vm->_invButtonList;
+ Image **moveImages = _vm->_moveImages;
+ Image **invImages = _vm->_invImages;
+
+ createScreen(_vm->_isHiRes);
+
+ // TODO: The CONTROL file is not present in the Amiga version
+ Common::File *controlFile = _vm->_resource->openDataFile("P:Control");
+ for (int i = 0; i < 20; i++)
+ _vm->_moveImages[i] = new Image(controlFile, _vm);
+ delete controlFile;
+
+ // Creates the buttons for the movement control panel
+ // The key mapping was only set for the Windows version.
+ // It's very convenient to have those shortcut, so I added them
+ // for all versions. (Strangerke)
+ uint16 y = _vm->_utils->vgaScaleY(173) - _vm->_utils->svgaCord(2);
+ moveButtonList->push_back(e->createButton( 1, y, 0, Common::KEYCODE_t, moveImages[0], moveImages[1]));
+ moveButtonList->push_back(e->createButton( 33, y, 1, Common::KEYCODE_m, moveImages[2], moveImages[3]));
+ moveButtonList->push_back(e->createButton( 65, y, 2, Common::KEYCODE_o, moveImages[4], moveImages[5]));
+ moveButtonList->push_back(e->createButton( 97, y, 3, Common::KEYCODE_c, moveImages[6], moveImages[7]));
+ moveButtonList->push_back(e->createButton(129, y, 4, Common::KEYCODE_l, moveImages[8], moveImages[9]));
+ moveButtonList->push_back(e->createButton(161, y, 5, Common::KEYCODE_i, moveImages[12], moveImages[13]));
+ moveButtonList->push_back(e->createButton(193, y, 6, Common::KEYCODE_LEFT, moveImages[14], moveImages[15]));
+ moveButtonList->push_back(e->createButton(225, y, 7, Common::KEYCODE_UP, moveImages[16], moveImages[17]));
+ moveButtonList->push_back(e->createButton(257, y, 8, Common::KEYCODE_RIGHT, moveImages[18], moveImages[19]));
+ moveButtonList->push_back(e->createButton(289, y, 9, Common::KEYCODE_p, moveImages[10], moveImages[11]));
+
+ // TODO: The INV file is not present in the Amiga version
+ Common::File *invFile = _vm->_resource->openDataFile("P:Inv");
+ if (_vm->getPlatform() == Common::kPlatformWindows) {
+ for (int imgIdx = 0; imgIdx < 10; imgIdx++)
+ _vm->_invImages[imgIdx] = new Image(invFile, _vm);
+ } else {
+ for (int imgIdx = 0; imgIdx < 6; imgIdx++)
+ _vm->_invImages[imgIdx] = new Image(invFile, _vm);
+ }
+ invButtonList->push_back(e->createButton( 24, y, 0, Common::KEYCODE_ESCAPE, invImages[0], invImages[1]));
+ invButtonList->push_back(e->createButton( 56, y, 1, Common::KEYCODE_g, invImages[2], invImages[3]));
+ invButtonList->push_back(e->createButton( 94, y, 2, Common::KEYCODE_u, invImages[4], invImages[5]));
+ invButtonList->push_back(e->createButton(126, y, 3, Common::KEYCODE_l, moveImages[8], moveImages[9]));
+ invButtonList->push_back(e->createButton(164, y, 4, Common::KEYCODE_LEFT, moveImages[14], moveImages[15]));
+ invButtonList->push_back(e->createButton(196, y, 5, Common::KEYCODE_RIGHT, moveImages[18], moveImages[19]));
+
+ // The windows version has 2 extra buttons for breadcrumb trail
+ // CHECKME: the game is really hard to play without those, maybe we could add something to enable that.
+ if (_vm->getPlatform() == Common::kPlatformWindows) {
+ invButtonList->push_back(e->createButton(234, y, 6, Common::KEYCODE_b, invImages[6], invImages[7]));
+ invButtonList->push_back(e->createButton(266, y, 7, Common::KEYCODE_f, invImages[8], invImages[9]));
+ }
+
+ delete invFile;
+}
+
+void DisplayMan::rectFill(Common::Rect fillRect, byte color) {
+ int width = fillRect.width() + 1;
+ int height = fillRect.height() + 1;
+
+ if (fillRect.left + width > _screenWidth)
+ width = _screenWidth - fillRect.left;
+
+ if (fillRect.top + height > _screenHeight)
+ height = _screenHeight - fillRect.top;
+
+ if ((width > 0) && (height > 0)) {
+ char *d = (char *)getCurrentDrawingBuffer() + fillRect.top * _screenWidth + fillRect.left;
+
+ while (height-- > 0) {
+ char *dd = d;
+ int ww = width;
+
+ while (ww-- > 0) {
+ *dd++ = color;
+ }
+
+ d += _screenWidth;
+ }
+ }
+}
+
+void DisplayMan::rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte color) {
+ rectFill(Common::Rect(x1, y1, x2, y2), color);
+}
+
+void DisplayMan::rectFillScaled(uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte color) {
+ rectFill(_vm->_utils->vgaRectScale(x1, y1, x2, y2), color);
+}
+
+void DisplayMan::drawVLine(uint16 x, uint16 y1, uint16 y2, byte color) {
+ rectFill(x, y1, x, y2, color);
+}
+
+void DisplayMan::drawHLine(uint16 x1, uint16 y, uint16 x2, byte color) {
+ rectFill(x1, y, x2, y, color);
+}
+
+void DisplayMan::screenUpdate() {
+ _vm->_system->copyRectToScreen(_displayBuffer, _screenWidth, 0, 0, _screenWidth, _screenHeight);
+ _vm->_system->updateScreen();
+
+ _vm->_event->processInput();
+}
+
+void DisplayMan::createScreen(bool hiRes) {
+ if (hiRes) {
+ _screenWidth = 640;
+ _screenHeight = 480;
+ } else {
+ _screenWidth = 320;
+ _screenHeight = 200;
+ }
+ _screenBytesPerPage = _screenWidth * _screenHeight;
+
+ if (_displayBuffer)
+ delete[] _displayBuffer;
+ _displayBuffer = new byte[_screenBytesPerPage];
+}
+
+void DisplayMan::setAmigaPal(uint16 *pal) {
+ byte vgaPal[16 * 3];
+ uint16 vgaIdx = 0;
+
+ for (int i = 0; i < 16; i++) {
+ vgaPal[vgaIdx++] = (byte)(((pal[i] & 0xf00) >> 8) << 2);
+ vgaPal[vgaIdx++] = (byte)(((pal[i] & 0x0f0) >> 4) << 2);
+ vgaPal[vgaIdx++] = (byte)(((pal[i] & 0x00f)) << 2);
+ }
+
+ writeColorRegs(vgaPal, 0, 16);
+ _vm->waitTOF();
+}
+
+void DisplayMan::writeColorRegs(byte *buf, uint16 first, uint16 numReg) {
+ assert(first + numReg <= 256);
+ byte tmp[256 * 3];
+
+ for (int i = 0; i < numReg * 3; i++)
+ tmp[i] = (buf[i] << 2) | (buf[i] >> 4); // better results than buf[i] * 4
+
+ _vm->_system->getPaletteManager()->setPalette(tmp, first, numReg);
+ memcpy(&(_curvgapal[first * 3]), buf, numReg * 3);
+}
+
+void DisplayMan::setPalette(void *newPal, uint16 numColors) {
+ if (memcmp(newPal, _curvgapal, numColors * 3) != 0)
+ writeColorRegs((byte *)newPal, 0, numColors);
+}
+
+byte *DisplayMan::getCurrentDrawingBuffer() {
+ if (_currentDisplayBuffer)
+ return _currentDisplayBuffer;
+
+ return _displayBuffer;
+}
+
+void DisplayMan::checkerboardEffect(uint16 penColor, uint16 x1, uint16 y1, uint16 x2, uint16 y2) {
+ int w = x2 - x1 + 1;
+ int h = y2 - y1 + 1;
+
+ if (x1 + w > _screenWidth)
+ w = _screenWidth - x1;
+
+ if (y1 + h > _screenHeight)
+ h = _screenHeight - y1;
+
+ if ((w > 0) && (h > 0)) {
+ byte *d = (byte *)getCurrentDrawingBuffer() + y1 * _screenWidth + x1;
+
+ while (h-- > 0) {
+ byte *dd = d;
+ int ww = w;
+
+ if (y1 & 1) {
+ dd++;
+ ww--;
+ }
+
+ while (ww > 0) {
+ *dd = penColor;
+ dd += 2;
+ ww -= 2;
+ }
+
+ d += _screenWidth;
+ y1++;
+ }
+ }
+}
+
+void DisplayMan::freeFont(TextFont **font) {
+ if (*font) {
+ if ((*font)->_data)
+ delete[] (*font)->_data;
+
+ delete *font;
+ *font = nullptr;
+ }
+}
+
+uint16 DisplayMan::textLength(TextFont *font, const Common::String text) {
+ uint16 length = 0;
+
+ if (font) {
+ int numChars = text.size();
+ for (int i = 0; i < numChars; i++) {
+ length += font->_widths[(byte)text[i]];
+ }
+ }
+
+ return length;
+}
+
+uint16 DisplayMan::textHeight(TextFont *tf) {
+ return (tf) ? tf->_height : 0;
+}
+
+void DisplayMan::drawText(TextFont *tf, uint16 x, uint16 y, uint16 color, const Common::String text) {
+ byte *vgaTop = getCurrentDrawingBuffer();
+ int numChars = text.size();
+
+ for (int i = 0; i < numChars; i++) {
+ uint32 realOffset = (_screenWidth * y) + x;
+ uint16 curPage = realOffset / _screenBytesPerPage;
+ uint32 segmentOffset = realOffset - (curPage * _screenBytesPerPage);
+ int32 leftInSegment = _screenBytesPerPage - segmentOffset;
+ byte *vgaCur = vgaTop + segmentOffset;
+
+ if (tf->_widths[(byte)text[i]]) {
+ byte *cdata = tf->_data + tf->_offsets[(byte)text[i]];
+ uint16 bwidth = *cdata++;
+ byte *vgaTemp = vgaCur;
+ byte *vgaTempLine = vgaCur;
+
+ for (int rows = 0; rows < tf->_height; rows++) {
+ int32 templeft = leftInSegment;
+
+ vgaTemp = vgaTempLine;
+
+ for (int cols = 0; cols < bwidth; cols++) {
+ uint16 data = *cdata++;
+
+ if (data && (templeft >= 8)) {
+ for (int j = 7; j >= 0; j--) {
+ if ((1 << j) & data)
+ *vgaTemp = color;
+ vgaTemp++;
+ }
+
+ templeft -= 8;
+ } else if (data) {
+ uint16 mask = 0x80;
+ templeft = leftInSegment;
+
+ for (int counterb = 0; counterb < 8; counterb++) {
+ if (templeft <= 0) {
+ curPage++;
+ vgaTemp = (byte *)(vgaTop - templeft);
+ // Set up VGATempLine for next line
+ vgaTempLine -= _screenBytesPerPage;
+ // Set up LeftInSegment for next line
+ leftInSegment += _screenBytesPerPage + templeft;
+ templeft += _screenBytesPerPage;
+ }
+
+ if (mask & data)
+ *vgaTemp = color;
+
+ vgaTemp++;
+
+ mask = mask >> 1;
+ templeft--;
+ }
+ } else {
+ templeft -= 8;
+ vgaTemp += 8;
+ }
+ }
+
+ vgaTempLine += _screenWidth;
+ leftInSegment -= _screenWidth;
+
+ if (leftInSegment <= 0) {
+ curPage++;
+ vgaTempLine -= _screenBytesPerPage;
+ leftInSegment += _screenBytesPerPage;
+ }
+ }
+ }
+
+ x += tf->_widths[(byte)text[i]];
+ }
+}
+
+void DisplayMan::doScrollBlack() {
+ uint16 width = _vm->_utils->vgaScaleX(320);
+ uint16 height = _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2);
+
+ _vm->_event->mouseHide();
+
+ byte *mem = new byte[width * height];
+ int16 by = _vm->_utils->vgaScaleX(4);
+ int16 verticalScroll = height;
+
+ while (verticalScroll > 0) {
+ scrollDisplayY(-by, 0, 0, width - 1, height - 1, mem);
+ verticalScroll -= by;
+
+ _vm->updateMusicAndEvents();
+ _vm->waitTOF();
+ }
+
+ delete[] mem;
+
+ _vm->_event->mouseShow();
+}
+
+void DisplayMan::copyPage(uint16 width, uint16 height, uint16 nheight, uint16 startLine, byte *mem) {
+ byte *baseAddr = getCurrentDrawingBuffer();
+
+ uint32 size = (int32)(height - nheight) * (int32)width;
+ mem += startLine * width;
+ uint16 curPage = ((int32)nheight * (int32)width) / _screenBytesPerPage;
+ uint32 offSet = ((int32)nheight * (int32)width) - (curPage * _screenBytesPerPage);
+
+ while (size) {
+ uint32 copySize;
+ if (size > (_screenBytesPerPage - offSet))
+ copySize = _screenBytesPerPage - offSet;
+ else
+ copySize = size;
+
+ size -= copySize;
+
+ memcpy(baseAddr + (offSet >> 2), mem, copySize);
+ mem += copySize;
+ curPage++;
+ offSet = 0;
+ }
+}
+
+void DisplayMan::doScrollWipe(const Common::String filename) {
+ _vm->_event->mouseHide();
+ uint16 width = _vm->_utils->vgaScaleX(320);
+ uint16 height = _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2);
+
+ while (_vm->_music->isSoundEffectActive()) {
+ _vm->updateMusicAndEvents();
+ _vm->waitTOF();
+ }
+
+ readPict(filename, true, true);
+ setPalette(_vm->_anim->_diffPalette, 256);
+ byte *mem = _vm->_anim->_scrollScreenBuffer;
+
+ _vm->updateMusicAndEvents();
+ uint16 by = _vm->_utils->vgaScaleX(3);
+ uint16 nheight = height;
+ uint16 startLine = 0, onRow = 0;
+
+ while (onRow < _vm->_anim->_headerdata._height) {
+ _vm->updateMusicAndEvents();
+
+ if ((by > nheight) && nheight)
+ by = nheight;
+
+ if ((startLine + by) > (_vm->_anim->_headerdata._height - height - 1))
+ break;
+
+ if (nheight)
+ nheight -= by;
+
+ copyPage(width, height, nheight, startLine, mem);
+
+ screenUpdate();
+
+ if (!nheight)
+ startLine += by;
+
+ onRow += by;
+
+ if (nheight <= (height / 4))
+ by = _vm->_utils->vgaScaleX(5);
+ else if (nheight <= (height / 3))
+ by = _vm->_utils->vgaScaleX(4);
+ else if (nheight <= (height / 2))
+ by = _vm->_utils->vgaScaleX(3);
+ }
+
+ _vm->_event->mouseShow();
+}
+
+void DisplayMan::doScrollBounce() {
+ const uint16 offsets[8] = { 3, 3, 2, 2, 2, 1, 1, 1 };
+ const int multiplier = (_vm->_isHiRes) ? 2 : 1;
+
+ _vm->_event->mouseHide();
+ int width = _vm->_utils->vgaScaleX(320);
+ int height = _vm->_utils->vgaScaleY(149) + _vm->_utils->svgaCord(2);
+ byte *mem = _vm->_anim->_scrollScreenBuffer;
+
+ _vm->updateMusicAndEvents();
+ int startLine = _vm->_anim->_headerdata._height - height - 1;
+
+ for (int i = 0; i < 5; i++) {
+ _vm->updateMusicAndEvents();
+ startLine -= (5 - i) * multiplier;
+ copyPage(width, height, 0, startLine, mem);
+ _vm->waitTOF();
+ }
+
+ for (int i = 8; i > 0; i--) {
+ _vm->updateMusicAndEvents();
+ startLine += offsets[i - 1] * multiplier;
+ copyPage(width, height, 0, startLine, mem);
+ _vm->waitTOF();
+ }
+
+ _vm->_event->mouseShow();
+}
+
+void DisplayMan::doTransWipe(CloseDataPtr *closePtrList, const Common::String filename) {
+ uint16 lastY, linesLast;
+
+ if (_vm->_isHiRes) {
+ linesLast = 3;
+ lastY = 358;
+ } else {
+ linesLast = 1;
+ lastY = 148;
+ }
+
+ uint16 linesDone = 0;
+
+ for (int j = 0; j < 2; j++) {
+ for (int i = 0; i < 2; i++) {
+ uint16 curY = i * 2;
+
+ while (curY < lastY) {
+ if (linesDone >= linesLast) {
+ _vm->updateMusicAndEvents();
+ _vm->waitTOF();
+ linesDone = 0;
+ }
+
+ if (j == 0)
+ checkerboardEffect(0, 0, curY, _screenWidth - 1, curY + 1);
+ else
+ rectFill(0, curY, _screenWidth - 1, curY + 1, 0);
+ curY += 4;
+ linesDone++;
+ } // while
+ } // for i
+ } // for j
+
+ if (filename.empty())
+ _vm->_curFileName = _vm->getPictName(closePtrList);
+ else if (filename[0] > ' ')
+ _vm->_curFileName = filename;
+ else
+ _vm->_curFileName = _vm->getPictName(closePtrList);
+
+ byte *bitMapBuffer = new byte[_screenWidth * (lastY + 5)];
+ readPict(_vm->_curFileName, true, false, bitMapBuffer);
+
+ setPalette(_vm->_anim->_diffPalette, 256);
+
+ Image imSource(_vm);
+ imSource._width = _screenWidth;
+ imSource._height = lastY;
+ imSource._imageData = bitMapBuffer;
+
+ Image imDest(_vm);
+ imDest._width = _screenWidth;
+ imDest._height = _screenHeight;
+ imDest._imageData = getCurrentDrawingBuffer();
+
+ for (int j = 0; j < 2; j++) {
+ for (int i = 0; i < 2; i++) {
+ uint16 curY = i * 2;
+
+ while (curY < lastY) {
+ if (linesDone >= linesLast) {
+ _vm->updateMusicAndEvents();
+ _vm->waitTOF();
+ linesDone = 0;
+ }
+
+ imDest._imageData = getCurrentDrawingBuffer();
+
+ if (j == 0) {
+ imSource.blitBitmap(0, curY, &imDest, 0, curY, _screenWidth, 2, false);
+ checkerboardEffect(0, 0, curY, _screenWidth - 1, curY + 1);
+ } else {
+ uint16 bitmapHeight = (curY == lastY) ? 1 : 2;
+ imSource.blitBitmap(0, curY, &imDest, 0, curY, _screenWidth, bitmapHeight, false);
+ }
+ curY += 4;
+ linesDone++;
+ } // while
+ } // for i
+ } // for j
+
+ // Prevent the Image destructor from deleting the drawing buffer
+ imDest._imageData = nullptr;
+
+ // bitMapBuffer will be deleted by the Image destructor
+}
+
+void DisplayMan::doTransition(TransitionType transitionType, CloseDataPtr *closePtrList, const Common::String filename) {
+ switch (transitionType) {
+ case kTransitionWipe:
+ case kTransitionTransporter:
+ doTransWipe(closePtrList, filename);
+ break;
+ case kTransitionScrollWipe:
+ doScrollWipe(filename);
+ break;
+ case kTransitionScrollBlack:
+ doScrollBlack();
+ break;
+ case kTransitionScrollBounce:
+ doScrollBounce();
+ break;
+ case kTransitionReadFirstFrame:
+ readPict(filename, false);
+ break;
+ case kTransitionReadNextFrame:
+ _vm->_anim->diffNextFrame();
+ break;
+ case kTransitionNone:
+ default:
+ break;
+ }
+}
+
+void DisplayMan::blackScreen() {
+ byte pal[256 * 3];
+ memset(pal, 0, 248 * 3);
+ writeColorRegs(pal, 8, 248);
+
+ _vm->_system->delayMillis(32);
+}
+
+void DisplayMan::whiteScreen() {
+ byte pal[256 * 3];
+ memset(pal, 255, 248 * 3);
+ writeColorRegs(pal, 8, 248);
+}
+
+void DisplayMan::blackAllScreen() {
+ byte pal[256 * 3];
+ memset(pal, 0, 256 * 3);
+ writeColorRegs(pal, 0, 256);
+
+ _vm->_system->delayMillis(32);
+}
+
+void DisplayMan::scrollDisplayX(int16 dx, uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte *buffer) {
+ Image im(_vm);
+ im._imageData = buffer;
+
+ if (x1 > x2)
+ SWAP<uint16>(x1, x2);
+
+ if (y1 > y2)
+ SWAP<uint16>(y1, y2);
+
+ if (dx > 0) {
+ im._width = x2 - x1 + 1 - dx;
+ im._height = y2 - y1 + 1;
+
+ im.readScreenImage(x1, y1);
+ im.drawImage(x1 + dx, y1);
+
+ rectFill(x1, y1, x1 + dx - 1, y2, 0);
+ } else if (dx < 0) {
+ im._width = x2 - x1 + 1 + dx;
+ im._height = y2 - y1 + 1;
+
+ im.readScreenImage(x1 - dx, y1);
+ im.drawImage(x1, y1);
+
+ rectFill(x2 + dx + 1, y1, x2, y2, 0);
+ }
+
+ // Prevent the Image destructor from deleting the external buffer
+ im._imageData = nullptr;
+}
+
+void DisplayMan::scrollDisplayY(int16 dy, uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte *buffer) {
+ Image im(_vm);
+ im._imageData = buffer;
+
+ if (x1 > x2)
+ SWAP<uint16>(x1, x2);
+
+ if (y1 > y2)
+ SWAP<uint16>(y1, y2);
+
+ if (dy > 0) {
+ im._width = x2 - x1 + 1;
+ im._height = y2 - y1 + 1 - dy;
+
+ im.readScreenImage(x1, y1);
+ im.drawImage(x1, y1 + dy);
+
+ rectFill(x1, y1, x2, y1 + dy - 1, 0);
+ } else if (dy < 0) {
+ im._width = x2 - x1 + 1;
+ im._height = y2 - y1 + 1 + dy;
+
+ im.readScreenImage(x1, y1 - dy);
+ im.drawImage(x1, y1);
+
+ rectFill(x1, y2 + dy + 1, x2, y2, 0);
+ }
+
+ // Prevent the Image destructor from deleting the external buffer
+ im._imageData = nullptr;
+}
+
+uint16 DisplayMan::fadeNumIn(uint16 num, uint16 res, uint16 counter) {
+ return (num - ((((int32)(15 - counter)) * ((int32)(num - res))) / 15));
+}
+
+uint16 DisplayMan::fadeNumOut(uint16 num, uint16 res, uint16 counter) {
+ return (num - ((((int32) counter) * ((int32)(num - res))) / 15));
+}
+
+void DisplayMan::fade(bool fadeIn) {
+ uint16 newPal[16];
+
+ for (int i = 0; i < 16; i++) {
+ for (int palIdx = 0; palIdx < 16; palIdx++) {
+ if (fadeIn)
+ newPal[palIdx] = (0x00F & fadeNumIn(0x00F & _fadePalette[palIdx], 0, i)) +
+ (0x0F0 & fadeNumIn(0x0F0 & _fadePalette[palIdx], 0, i)) +
+ (0xF00 & fadeNumIn(0xF00 & _fadePalette[palIdx], 0, i));
+ else
+ newPal[palIdx] = (0x00F & fadeNumOut(0x00F & _fadePalette[palIdx], 0, i)) +
+ (0x0F0 & fadeNumOut(0x0F0 & _fadePalette[palIdx], 0, i)) +
+ (0xF00 & fadeNumOut(0xF00 & _fadePalette[palIdx], 0, i));
+ }
+
+ setAmigaPal(newPal);
+ _vm->waitTOF();
+ _vm->updateMusicAndEvents();
+ }
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/dispman.h b/engines/lab/dispman.h
new file mode 100644
index 0000000000..2cf58c379f
--- /dev/null
+++ b/engines/lab/dispman.h
@@ -0,0 +1,278 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#ifndef LAB_DISPMAN_H
+#define LAB_DISPMAN_H
+
+namespace Lab {
+
+class LabEngine;
+class Image;
+
+struct TextFont {
+ uint32 _dataLength;
+ uint16 _height;
+ byte _widths[256];
+ uint16 _offsets[256];
+ byte *_data;
+};
+
+enum TransitionType {
+ kTransitionNone,
+ kTransitionWipe,
+ kTransitionScrollWipe,
+ kTransitionScrollBlack,
+ kTransitionScrollBounce,
+ kTransitionTransporter,
+ kTransitionReadFirstFrame,
+ kTransitionReadNextFrame
+};
+
+class DisplayMan {
+private:
+ LabEngine *_vm;
+
+ /**
+ * Does the fading of the Palette on the screen.
+ */
+ uint16 fadeNumIn(uint16 num, uint16 res, uint16 counter);
+ uint16 fadeNumOut(uint16 num, uint16 res, uint16 counter);
+
+ /**
+ * Extracts the first word from a string.
+ */
+ Common::String getWord(const char *mainBuffer);
+
+ byte _curPen;
+ Common::File *_curBitmap;
+ byte _curvgapal[256 * 3];
+
+public:
+ DisplayMan(LabEngine *lab);
+ virtual ~DisplayMan();
+
+ void loadPict(const Common::String filename);
+ void loadBackPict(const Common::String fileName, uint16 *highPal);
+
+ /**
+ * Reads in a picture into the display bitmap.
+ */
+ void readPict(const Common::String filename, bool playOnce = true, bool onlyDiffData = false, byte *memoryBuffer = nullptr);
+ void freePict();
+
+ /**
+ * Scrolls the display to black.
+ */
+ void doScrollBlack();
+ void copyPage(uint16 width, uint16 height, uint16 nheight, uint16 startline, byte *mem);
+
+ /**
+ * Scrolls the display to a new picture from a black screen.
+ */
+ void doScrollWipe(const Common::String filename);
+
+ /**
+ * Does the scroll bounce. Assumes bitmap already in memory.
+ */
+ void doScrollBounce();
+
+ /**
+ * Does the transporter wipe.
+ */
+ void doTransWipe(CloseDataPtr *closePtrList, const Common::String filename);
+
+ /**
+ * Does a certain number of pre-programmed wipes.
+ */
+ void doTransition(TransitionType transitionType, CloseDataPtr *closePtrList, const Common::String filename);
+
+ /**
+ * Changes the front screen to black.
+ */
+ void blackScreen();
+
+ /**
+ * Changes the front screen to white.
+ */
+ void whiteScreen();
+
+ /**
+ * Changes the entire screen to black.
+ */
+ void blackAllScreen();
+ void createBox(uint16 y2);
+
+ /**
+ * Draws the control panel display.
+ */
+ void drawPanel();
+
+ /**
+ * Sets up the Labyrinth screens, and opens up the initial windows.
+ */
+ void setUpScreens();
+
+ int longDrawMessage(Common::String str, bool isActionMessage);
+
+ /**
+ * Draws a message to the message box.
+ */
+ void drawMessage(Common::String str, bool isActionMessage);
+
+ void setActionMessage(bool val) { _actionMessageShown = val; }
+
+ /**
+ * Sets the pen number to use on all the drawing operations.
+ */
+ void setPen(byte pennum);
+
+ /**
+ * Fills in a rectangle.
+ */
+ void rectFill(uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte color);
+ void rectFill(Common::Rect fillRect, byte color);
+ void rectFillScaled(uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte color);
+ /**
+ * Dumps a chunk of text to an arbitrary box; flows it within that box and
+ * optionally centers it. Returns the number of characters that were processed.
+ * @note Every individual word MUST be int16 enough to fit on a line, and
+ * each line less than 255 characters.
+ * @param font Pointer on the font used
+ * @param spacing How much vertical spacing between the lines
+ * @param penColor Pen number to use for text
+ * @param backPen Background color
+ * @param fillBack Whether to fill the background
+ * @param centerh Whether to center the text horizontally
+ * @param centerv Whether to center the text vertically
+ * @param output Whether to output any text
+ * @param textRect Coords
+ * @param text The text itself
+ */
+ int flowText(TextFont *font, int16 spacing, byte penColor, byte backPen, bool fillBack,
+ bool centerh, bool centerv, bool output, Common::Rect textRect, const char *text, Image *targetImage = nullptr);
+
+ /**
+ * Draws a vertical line.
+ */
+ void drawHLine(uint16 x, uint16 y1, uint16 y2, byte color);
+
+ /**
+ * Draws a horizontal line.
+ */
+ void drawVLine(uint16 x1, uint16 y, uint16 x2, byte color);
+ void screenUpdate();
+
+ /**
+ * Sets up either a low-res or a high-res 256 color screen.
+ */
+ void createScreen(bool hiRes);
+
+ /**
+ * Converts a 16-color Amiga palette to a VGA palette, then sets
+ * the VGA palette.
+ */
+ void setAmigaPal(uint16 *pal);
+
+ /**
+ * Writes any number of the 256 color registers.
+ * @param buf A char pointer which contains the selected color registers.
+ * Each value representing a color register occupies 3 bytes in the array. The
+ * order is red, green then blue. The first byte in the array is the red component
+ * of the first element selected. The length of the buffer is 3 times the number
+ * of registers selected.
+ * @param first The number of the first color register to write.
+ * @param numReg The number of registers to write.
+ */
+ void writeColorRegs(byte *buf, uint16 first, uint16 numReg);
+ void setPalette(void *newPal, uint16 numColors);
+
+ /**
+ * Overlays a region on the screen using the desired pen color.
+ */
+ void checkerboardEffect(uint16 penColor, uint16 x1, uint16 y1, uint16 x2, uint16 y2);
+
+ /**
+ * Returns the base address of the current VGA display.
+ */
+ byte *getCurrentDrawingBuffer();
+
+ /**
+ * Scrolls the display in the x direction by blitting.
+ * The _tempScrollData variable must be initialized to some memory, or this
+ * function will fail.
+ */
+ void scrollDisplayX(int16 dx, uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte *buffer);
+
+ /**
+ * Scrolls the display in the y direction by blitting.
+ */
+ void scrollDisplayY(int16 dy, uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte *buffer);
+ void fade(bool fadein);
+
+ /**
+ * Closes a font and frees all memory associated with it.
+ */
+ void freeFont(TextFont **font);
+
+ /**
+ * Returns the length of a text in the specified font.
+ */
+ uint16 textLength(TextFont *font, const Common::String text);
+
+ /**
+ * Returns the height of a specified font.
+ */
+ uint16 textHeight(TextFont *tf);
+
+ /**
+ * Draws the text to the screen.
+ */
+ void drawText(TextFont *tf, uint16 x, uint16 y, uint16 color, const Common::String text);
+
+ /**
+ * Gets a line of text for flowText; makes sure that its length is less than
+ * or equal to the maximum width.
+ */
+ Common::String getLine(TextFont *tf, const char **mainBuffer, uint16 lineWidth);
+
+ bool _longWinInFront;
+ bool _lastMessageLong;
+ bool _actionMessageShown;
+ uint32 _screenBytesPerPage;
+ int _screenWidth;
+ int _screenHeight;
+ byte *_displayBuffer;
+ byte *_currentDisplayBuffer;
+ uint16 *_fadePalette;
+};
+
+} // End of namespace Lab
+
+#endif // LAB_DISPMAN_H
diff --git a/engines/lab/engine.cpp b/engines/lab/engine.cpp
new file mode 100644
index 0000000000..91388ea1b4
--- /dev/null
+++ b/engines/lab/engine.cpp
@@ -0,0 +1,1123 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "lab/lab.h"
+
+#include "lab/anim.h"
+#include "lab/dispman.h"
+#include "lab/eventman.h"
+#include "lab/image.h"
+#include "lab/intro.h"
+#include "lab/labsets.h"
+#include "lab/music.h"
+#include "lab/processroom.h"
+#include "lab/resource.h"
+#include "lab/tilepuzzle.h"
+#include "lab/utils.h"
+
+namespace Lab {
+
+// LAB: Labyrinth specific code for the special puzzles
+#define SPECIALLOCK 100
+#define SPECIALBRICK 101
+#define SPECIALBRICKNOMOUSE 102
+
+enum Items {
+ kItemHelmet = 1,
+ kItemBelt = 3,
+ kItemPithHelmet = 7,
+ kItemJournal = 9,
+ kItemNotes = 12,
+ kItemWestPaper = 18,
+ kItemWhiskey = 25,
+ kItemLamp = 27,
+ kItemMap = 28,
+ kItemQuarter = 30
+};
+
+enum Monitors {
+ kMonitorMuseum = 71,
+ kMonitorGramophone = 72,
+ kMonitorUnicycle = 73,
+ kMonitorStatue = 74,
+ kMonitorTalisman = 75,
+ kMonitorLute = 76,
+ kMonitorClock = 77,
+ kMonitorWindow = 78,
+ //kMonitorBelt = 79,
+ kMonitorLibrary = 80,
+ kMonitorTerminal = 81
+ //kMonitorLevers = 82
+};
+
+enum AltButtons {
+ kButtonMainDisplay,
+ kButtonSaveLoad,
+ kButtonUseItem,
+ kButtonLookAtItem,
+ kButtonPrevItem,
+ kButtonNextItem,
+ kButtonBreadCrumbs,
+ kButtonFollowCrumbs
+};
+
+static char initColors[] = { '\x00', '\x00', '\x00', '\x30',
+ '\x30', '\x30', '\x10', '\x10',
+ '\x10', '\x14', '\x14', '\x14',
+ '\x20', '\x20', '\x20', '\x24',
+ '\x24', '\x24', '\x2c', '\x2c',
+ '\x2c', '\x08', '\x08', '\x08' };
+
+uint16 LabEngine::getQuarters() {
+ return _inventory[kItemQuarter]._quantity;
+}
+
+void LabEngine::setQuarters(uint16 quarters) {
+ _inventory[kItemQuarter]._quantity = quarters;
+}
+
+void LabEngine::drawRoomMessage(uint16 curInv, CloseDataPtr closePtr) {
+ if (_lastTooLong) {
+ _lastTooLong = false;
+ return;
+ }
+
+ if (_alternate) {
+ if ((curInv <= _numInv) && _conditions->in(curInv) && !_inventory[curInv]._bitmapName.empty()) {
+ if ((curInv == kItemLamp) && _conditions->in(kCondLampOn))
+ // LAB: Labyrinth specific
+ drawStaticMessage(kTextkLampOn);
+ else if (_inventory[curInv]._quantity > 1) {
+ Common::String roomMessage = _inventory[curInv]._name + " (" + Common::String::format("%d", _inventory[curInv]._quantity) + ")";
+ _graphics->drawMessage(roomMessage.c_str(), false);
+ } else
+ _graphics->drawMessage(_inventory[curInv]._name.c_str(), false);
+ }
+ } else
+ drawDirection(closePtr);
+
+ _lastTooLong = _graphics->_lastMessageLong;
+}
+
+void LabEngine::freeScreens() {
+ for (int i = 0; i < 20; i++) {
+ delete _moveImages[i];
+ _moveImages[i] = nullptr;
+ }
+
+ for (int imgIdx = 0; imgIdx < 10; imgIdx++) {
+ delete _invImages[imgIdx];
+ _invImages[imgIdx] = nullptr;
+ }
+}
+
+void LabEngine::perFlipButton(uint16 buttonId) {
+ for (ButtonList::iterator button = _moveButtonList.begin(); button != _moveButtonList.end(); ++button) {
+ Button *topButton = *button;
+ if (topButton->_buttonId == buttonId) {
+ Image *tmpImage = topButton->_image;
+ topButton->_image = topButton->_altImage;
+ topButton->_altImage = tmpImage;
+
+ if (!_alternate) {
+ _event->mouseHide();
+ topButton->_image->drawImage(topButton->_x, topButton->_y);
+ _event->mouseShow();
+ }
+
+ break;
+ }
+ }
+}
+
+void LabEngine::eatMessages() {
+ IntuiMessage *msg;
+
+ do {
+ msg = _event->getMsg();
+ } while (msg && !shouldQuit());
+}
+
+bool LabEngine::doCloseUp(CloseDataPtr closePtr) {
+ if (!closePtr)
+ return false;
+
+ int luteRight;
+ Common::Rect textRect;
+
+ if (getPlatform() != Common::kPlatformWindows) {
+ textRect.left = 0;
+ textRect.right = 319;
+ textRect.top = 0;
+ textRect.bottom = 165;
+ luteRight = 124;
+ } else {
+ textRect.left = 2;
+ textRect.right = 317;
+ textRect.top = 2;
+ textRect.bottom = 165;
+ luteRight = 128;
+ }
+
+ switch (closePtr->_closeUpType) {
+ case kMonitorMuseum:
+ case kMonitorLibrary:
+ case kMonitorWindow:
+ doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
+ break;
+ case kMonitorGramophone:
+ textRect.right = 171;
+ doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
+ break;
+ case kMonitorUnicycle:
+ textRect.left = 100;
+ doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
+ break;
+ case kMonitorStatue:
+ textRect.left = 117;
+ doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
+ break;
+ case kMonitorTalisman:
+ textRect.right = 184;
+ doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
+ break;
+ case kMonitorLute:
+ textRect.right = luteRight;
+ doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
+ break;
+ case kMonitorClock:
+ textRect.right = 206;
+ doMonitor(closePtr->_graphicName, closePtr->_message, false, textRect);
+ break;
+ case kMonitorTerminal:
+ doMonitor(closePtr->_graphicName, closePtr->_message, true, textRect);
+ break;
+ default:
+ return false;
+ }
+
+ _curFileName = " ";
+ _graphics->drawPanel();
+
+ return true;
+}
+
+Common::String LabEngine::getInvName(uint16 curInv) {
+ if (_mainDisplay)
+ return _inventory[curInv]._bitmapName;
+
+ if ((curInv == kItemLamp) && _conditions->in(kCondLampOn))
+ return "P:Mines/120";
+
+ if ((curInv == kItemBelt) && _conditions->in(kCondBeltGlowing))
+ return "P:Future/kCondBeltGlowing";
+
+ if (curInv == kItemWestPaper) {
+ _curFileName = _inventory[curInv]._bitmapName;
+ _anim->_noPalChange = true;
+ _graphics->readPict(_curFileName, false);
+ _anim->_noPalChange = false;
+ doWestPaper();
+ } else if (curInv == kItemNotes) {
+ _curFileName = _inventory[curInv]._bitmapName;
+ _anim->_noPalChange = true;
+ _graphics->readPict(_curFileName, false);
+ _anim->_noPalChange = false;
+ doNotes();
+ }
+
+ return _inventory[curInv]._bitmapName;
+}
+
+void LabEngine::interfaceOff() {
+ if (!_interfaceOff) {
+ _event->attachButtonList(nullptr);
+ _event->mouseHide();
+ _interfaceOff = true;
+ }
+}
+
+void LabEngine::interfaceOn() {
+ if (_interfaceOff) {
+ _interfaceOff = false;
+ _event->mouseShow();
+ }
+
+ if (_graphics->_longWinInFront)
+ _event->attachButtonList(nullptr);
+ else if (_alternate)
+ _event->attachButtonList(&_invButtonList);
+ else
+ _event->attachButtonList(&_moveButtonList);
+}
+
+bool LabEngine::doUse(uint16 curInv) {
+ switch (curInv) {
+ case kItemMap:
+ drawStaticMessage(kTextUseMap);
+ interfaceOff();
+ _anim->stopDiff();
+ _curFileName = " ";
+ _closeDataPtr = nullptr;
+ doMap(_roomNum);
+ _graphics->setPalette(initColors, 8);
+ _graphics->drawMessage("", false);
+ _graphics->drawPanel();
+ return true;
+ case kItemJournal:
+ drawStaticMessage(kTextUseJournal);
+ interfaceOff();
+ _anim->stopDiff();
+ _curFileName = " ";
+ _closeDataPtr = nullptr;
+ doJournal();
+ _graphics->drawPanel();
+ _graphics->drawMessage("", false);
+ return true;
+ case kItemLamp:
+ interfaceOff();
+
+ if (_conditions->in(kCondLampOn)) {
+ drawStaticMessage(kTextTurnLampOff);
+ _conditions->exclElement(kCondLampOn);
+ } else {
+ drawStaticMessage(kTextTurnkLampOn);
+ _conditions->inclElement(kCondLampOn);
+ }
+
+ _anim->_doBlack = false;
+ _anim->_waitForEffect = true;
+ _graphics->readPict("Music:Click");
+ _anim->_waitForEffect = false;
+
+ _anim->_doBlack = false;
+ _nextFileName = getInvName(curInv);
+ return true;
+ case kItemBelt:
+ if (!_conditions->in(kCondBeltGlowing))
+ _conditions->inclElement(kCondBeltGlowing);
+
+ _anim->_doBlack = false;
+ _nextFileName = getInvName(curInv);
+ return true;
+ case kItemWhiskey:
+ _conditions->inclElement(kCondUsedHelmet);
+ drawStaticMessage(kTextUseWhiskey);
+ return true;
+ case kItemPithHelmet:
+ _conditions->inclElement(kCondUsedHelmet);
+ drawStaticMessage(kTextUsePith);
+ return true;
+ case kItemHelmet:
+ _conditions->inclElement(kCondUsedHelmet);
+ drawStaticMessage(kTextUseHelmet);
+ return true;
+ default:
+ return false;
+ }
+}
+
+void LabEngine::decIncInv(uint16 *curInv, bool decreaseFl) {
+ int8 step = (decreaseFl) ? -1 : 1;
+ uint newInv = *curInv + step;
+
+ // Handle wrapping
+ if (newInv < 1)
+ newInv = _numInv;
+ if (newInv > _numInv)
+ newInv = 1;
+
+ interfaceOff();
+
+ while (newInv && (newInv <= _numInv)) {
+ if (_conditions->in(newInv) && !_inventory[newInv]._bitmapName.empty()) {
+ _nextFileName = getInvName(newInv);
+ *curInv = newInv;
+ break;
+ }
+
+ newInv += step;
+
+ // Handle wrapping
+ if (newInv < 1)
+ newInv = _numInv;
+ if (newInv > _numInv)
+ newInv = 1;
+ }
+}
+
+void LabEngine::mainGameLoop() {
+ uint16 actionMode = 4;
+ uint16 curInv = kItemMap;
+
+ bool forceDraw = false;
+ bool gotMessage = true;
+
+ _graphics->setPalette(initColors, 8);
+
+ _closeDataPtr = nullptr;
+ _roomNum = 1;
+ _direction = kDirectionNorth;
+
+ _resource->readRoomData("LAB:Doors");
+ if (!(_inventory = _resource->readInventory("LAB:Inventor")))
+ return;
+
+ if (!(_conditions = new LargeSet(_highestCondition + 1, this)))
+ return;
+
+ if (!(_roomsFound = new LargeSet(_manyRooms + 1, this)))
+ return;
+
+ _conditions->readInitialConditions("LAB:Conditio");
+
+ _graphics->_longWinInFront = false;
+ _graphics->drawPanel();
+
+ perFlipButton(actionMode);
+
+ // Set up initial picture.
+ while (1) {
+ _event->processInput();
+ _system->delayMillis(10);
+
+ if (gotMessage) {
+ if (_quitLab || shouldQuit()) {
+ _anim->stopDiff();
+ break;
+ }
+
+ _music->resumeBackMusic();
+
+ // Sees what kind of close up we're in and does the appropriate stuff, if any.
+ if (doCloseUp(_closeDataPtr)) {
+ _closeDataPtr = nullptr;
+ mayShowCrumbIndicator();
+ _graphics->screenUpdate();
+ }
+
+ // Sets the current picture properly on the screen
+ if (_mainDisplay)
+ _nextFileName = getPictName(&_closeDataPtr);
+
+ if (_noUpdateDiff) {
+ // Potentially entered another room
+ _roomsFound->inclElement(_roomNum);
+ forceDraw |= (_nextFileName != _curFileName);
+
+ _noUpdateDiff = false;
+ _curFileName = _nextFileName;
+ } else if (_nextFileName != _curFileName) {
+ interfaceOff();
+ // Potentially entered another room
+ _roomsFound->inclElement(_roomNum);
+ _curFileName = _nextFileName;
+
+ if (_closeDataPtr) {
+ switch (_closeDataPtr->_closeUpType) {
+ case SPECIALLOCK:
+ if (_mainDisplay)
+ _tilePuzzle->showCombination(_curFileName);
+ break;
+ case SPECIALBRICK:
+ case SPECIALBRICKNOMOUSE:
+ if (_mainDisplay)
+ _tilePuzzle->showTile(_curFileName, (_closeDataPtr->_closeUpType == SPECIALBRICKNOMOUSE));
+ break;
+ default:
+ _graphics->readPict(_curFileName, false);
+ break;
+ }
+ } else
+ _graphics->readPict(_curFileName, false);
+
+ drawRoomMessage(curInv, _closeDataPtr);
+ forceDraw = false;
+
+ mayShowCrumbIndicator();
+ _graphics->screenUpdate();
+
+ if (!_followingCrumbs)
+ eatMessages();
+ }
+
+ if (forceDraw) {
+ drawRoomMessage(curInv, _closeDataPtr);
+ forceDraw = false;
+ _graphics->screenUpdate();
+ }
+ }
+
+ // Make sure we check the music at least after every message
+ updateMusicAndEvents();
+ interfaceOn();
+ IntuiMessage *curMsg = _event->getMsg();
+ if (shouldQuit()) {
+ _quitLab = true;
+ return;
+ }
+
+ if (!curMsg) {
+ // Does music load and next animation frame when you've run out of messages
+ gotMessage = false;
+ _music->checkRoomMusic();
+ updateMusicAndEvents();
+ _anim->diffNextFrame();
+
+ if (_followingCrumbs) {
+ MainButton code = followCrumbs();
+
+ if (code == kButtonForward || code == kButtonLeft || code == kButtonRight) {
+ gotMessage = true;
+ mayShowCrumbIndicator();
+ _graphics->screenUpdate();
+ if (!processEvent(kMessageButtonUp, code, 0, _event->updateAndGetMousePos(), curInv, curMsg, forceDraw, code, actionMode))
+ break;
+ }
+ }
+
+ mayShowCrumbIndicator();
+ _graphics->screenUpdate();
+ } else {
+ gotMessage = true;
+ _followingCrumbs = false;
+ if (!processEvent(curMsg->_msgClass, curMsg->_code, curMsg->_qualifier, curMsg->_mouse, curInv, curMsg, forceDraw, curMsg->_code, actionMode))
+ break;
+ }
+ }
+}
+
+void LabEngine::showLab2Teaser() {
+ _graphics->blackAllScreen();
+ _graphics->readPict("P:End/L2In.1");
+
+ for (int i = 0; i < 120; i++) {
+ updateMusicAndEvents();
+ waitTOF();
+ }
+
+ _graphics->readPict("P:End/L2In.9");
+ _graphics->readPict("P:End/Lost");
+
+ while (!_event->getMsg() && !shouldQuit()) {
+ updateMusicAndEvents();
+ _anim->diffNextFrame();
+ waitTOF();
+ }
+}
+
+bool LabEngine::processEvent(MessageClass tmpClass, uint16 code, uint16 qualifier, Common::Point tmpPos,
+ uint16 &curInv, IntuiMessage *curMsg, bool &forceDraw, uint16 buttonId, uint16 &actionMode) {
+ MessageClass msgClass = tmpClass;
+ Common::Point curPos = tmpPos;
+ uint16 oldDirection = 0;
+ uint16 lastInv = kItemMap;
+
+ if (code == Common::KEYCODE_RETURN)
+ msgClass = kMessageLeftClick;
+
+ bool leftButtonClick = (msgClass == kMessageLeftClick);
+ bool rightButtonClick = (msgClass == kMessageRightClick);
+
+ _anim->_doBlack = false;
+
+ if (shouldQuit())
+ return false;
+
+ if (msgClass == kMessageRawKey && !_graphics->_longWinInFront) {
+ if (!processKey(curMsg, msgClass, qualifier, curPos, curInv, forceDraw, code))
+ return false;
+ } else if ((msgClass == kMessageRawKey || leftButtonClick || rightButtonClick) && _graphics->_longWinInFront) {
+ _graphics->_longWinInFront = false;
+ _graphics->drawPanel();
+ drawRoomMessage(curInv, _closeDataPtr);
+ _graphics->screenUpdate();
+ } else if (msgClass == kMessageButtonUp) {
+ if (!_alternate)
+ processMainButton(curInv, lastInv, oldDirection, forceDraw, buttonId, actionMode);
+ else
+ processAltButton(curInv, lastInv, buttonId, actionMode);
+ } else if (leftButtonClick && _mainDisplay) {
+ interfaceOff();
+ _mainDisplay = true;
+
+ if (_closeDataPtr && _closeDataPtr->_closeUpType == SPECIALLOCK)
+ _tilePuzzle->mouseCombination(curPos);
+ else if (_closeDataPtr && _closeDataPtr->_closeUpType == SPECIALBRICK)
+ _tilePuzzle->mouseTile(curPos);
+ else
+ performAction(actionMode, curPos, curInv);
+
+ mayShowCrumbIndicator();
+ _graphics->screenUpdate();
+ } else if (rightButtonClick) {
+ eatMessages();
+ _alternate = !_alternate;
+ _anim->_doBlack = true;
+ _mainDisplay = true;
+ // Sets the correct button list
+ interfaceOn();
+
+ if (_alternate) {
+ if (lastInv && _conditions->in(lastInv))
+ curInv = lastInv;
+ else
+ decIncInv(&curInv, false);
+ }
+
+ _graphics->drawPanel();
+ drawRoomMessage(curInv, _closeDataPtr);
+
+ mayShowCrumbIndicator();
+ _graphics->screenUpdate();
+ } else if (code == Common::KEYCODE_TAB) {
+ CloseDataPtr tmpClosePtr = _closeDataPtr;
+
+ // get next close-up in list after the one pointed to by curPos
+ setCurrentClose(curPos, &tmpClosePtr, true, true);
+
+ if (tmpClosePtr != _closeDataPtr)
+ _event->setMousePos(Common::Point(_utils->scaleX((tmpClosePtr->_x1 + tmpClosePtr->_x2) / 2), _utils->scaleY((tmpClosePtr->_y1 + tmpClosePtr->_y2) / 2)));
+ }
+
+ return true;
+}
+
+bool LabEngine::processKey(IntuiMessage *curMsg, uint32 msgClass, uint16 &qualifier, Common::Point &curPos, uint16 &curInv, bool &forceDraw, uint16 code) {
+ if ((getPlatform() == Common::kPlatformWindows) && (code == Common::KEYCODE_b)) {
+ // Start bread crumbs
+ _breadCrumbs[0]._roomNum = 0;
+ _numCrumbs = 0;
+ _droppingCrumbs = true;
+ mayShowCrumbIndicator();
+ _graphics->screenUpdate();
+ } else if ((code == Common::KEYCODE_f) || (code == Common::KEYCODE_r)) {
+ // Follow bread crumbs
+ if (_droppingCrumbs) {
+ if (_numCrumbs > 0) {
+ _followingCrumbs = true;
+ _followCrumbsFast = (code == Common::KEYCODE_r);
+ _isCrumbTurning = false;
+ _isCrumbWaiting = false;
+ _crumbTimestamp = _system->getMillis();
+
+ if (_alternate) {
+ eatMessages();
+ _alternate = false;
+ _anim->_doBlack = true;
+
+ _mainDisplay = true;
+ // Sets the correct button list
+ interfaceOn();
+ _graphics->drawPanel();
+ drawRoomMessage(curInv, _closeDataPtr);
+ _graphics->screenUpdate();
+ }
+ } else {
+ _breadCrumbs[0]._roomNum = 0;
+ _droppingCrumbs = false;
+
+ // Need to hide indicator!!!!
+ mayShowCrumbIndicatorOff();
+ _graphics->screenUpdate();
+ }
+ }
+ } else if ((code == Common::KEYCODE_x) || (code == Common::KEYCODE_q)) {
+ // Quit?
+ _graphics->drawMessage("Do you want to quit? (Y/N)", false);
+ eatMessages();
+ interfaceOff();
+
+ while (1) {
+ // Make sure we check the music at least after every message
+ updateMusicAndEvents();
+ curMsg = _event->getMsg();
+
+ if (shouldQuit())
+ return false;
+
+ if (!curMsg) {
+ // Does music load and next animation frame when you've run out of messages
+ updateMusicAndEvents();
+ _anim->diffNextFrame();
+ } else if (curMsg->_msgClass == kMessageRawKey) {
+ if ((curMsg->_code == Common::KEYCODE_y) || (curMsg->_code == Common::KEYCODE_q)) {
+ _anim->stopDiff();
+ return false;
+ } else if (curMsg->_code < 128)
+ break;
+ } else if ((curMsg->_msgClass == kMessageLeftClick) || (curMsg->_msgClass == kMessageRightClick))
+ break;
+ }
+
+ forceDraw = true;
+ interfaceOn();
+ } else if (code == Common::KEYCODE_ESCAPE)
+ _closeDataPtr = nullptr;
+
+ eatMessages();
+
+ return true;
+}
+
+void LabEngine::processMainButton(uint16 &curInv, uint16 &lastInv, uint16 &oldDirection, bool &forceDraw, uint16 buttonId, uint16 &actionMode) {
+ uint16 newDir;
+ uint16 oldRoomNum;
+
+ switch (buttonId) {
+ case kButtonPickup:
+ case kButtonUse:
+ case kButtonOpen:
+ case kButtonClose:
+ case kButtonLook:
+ if ((actionMode == 4) && (buttonId == kButtonLook) && _closeDataPtr) {
+ doMainView(&_closeDataPtr);
+
+ _anim->_doBlack = true;
+ _closeDataPtr = nullptr;
+ mayShowCrumbIndicator();
+ } else {
+ uint16 oldActionMode = actionMode;
+ actionMode = buttonId;
+
+ if (oldActionMode < 5)
+ perFlipButton(oldActionMode);
+
+ perFlipButton(actionMode);
+ drawStaticMessage(kTextTakeWhat + buttonId);
+ }
+ break;
+
+ case kButtonInventory:
+ eatMessages();
+
+ _alternate = true;
+ _anim->_doBlack = true;
+ // Sets the correct button list
+ interfaceOn();
+ _mainDisplay = false;
+
+ if (lastInv && _conditions->in(lastInv)) {
+ curInv = lastInv;
+ _nextFileName = getInvName(curInv);
+ } else
+ decIncInv(&curInv, false);
+
+ _graphics->drawPanel();
+ drawRoomMessage(curInv, _closeDataPtr);
+
+ mayShowCrumbIndicator();
+ break;
+
+ case kButtonLeft:
+ case kButtonRight:
+ _closeDataPtr = nullptr;
+ if (buttonId == kButtonLeft)
+ drawStaticMessage(kTextTurnLeft);
+ else
+ drawStaticMessage(kTextTurnRight);
+
+ _curFileName = " ";
+ oldDirection = _direction;
+
+ newDir = processArrow(_direction, buttonId - 6);
+ doTurn(_direction, newDir, &_closeDataPtr);
+ _anim->_doBlack = true;
+ _direction = newDir;
+ forceDraw = true;
+ mayShowCrumbIndicator();
+ break;
+
+ case kButtonForward:
+ _closeDataPtr = nullptr;
+ oldRoomNum = _roomNum;
+
+ if (doGoForward(&_closeDataPtr)) {
+ if (oldRoomNum == _roomNum)
+ _anim->_doBlack = true;
+ } else {
+ _anim->_doBlack = true;
+ _direction = processArrow(_direction, buttonId - 6);
+
+ if (oldRoomNum != _roomNum) {
+ drawStaticMessage(kTextGoForward);
+ // Potentially entered a new room
+ _roomsFound->inclElement(_roomNum);
+ _curFileName = " ";
+ forceDraw = true;
+ } else {
+ _anim->_doBlack = true;
+ drawStaticMessage(kTextNoPath);
+ }
+ }
+
+ if (_followingCrumbs) {
+ if (_isCrumbTurning) {
+ if (_direction == oldDirection)
+ _followingCrumbs = false;
+ } else if (_roomNum == oldRoomNum) { // didn't get there?
+ _followingCrumbs = false;
+ }
+ } else if (_droppingCrumbs && (oldRoomNum != _roomNum)) {
+ // If in surreal maze, turn off DroppingCrumbs.
+ if ((_roomNum >= 245) && (_roomNum <= 280)) {
+ _followingCrumbs = false;
+ _droppingCrumbs = false;
+ _numCrumbs = 0;
+ _breadCrumbs[0]._roomNum = 0;
+ } else {
+ bool intersect = false;
+ for (int idx = 0; idx < _numCrumbs; idx++) {
+ if (_breadCrumbs[idx]._roomNum == _roomNum) {
+ _numCrumbs = idx + 1;
+ _breadCrumbs[_numCrumbs]._roomNum = 0;
+ intersect = true;
+ }
+ }
+
+ if (!intersect) {
+ if (_numCrumbs == MAX_CRUMBS) {
+ _numCrumbs = MAX_CRUMBS - 1;
+ memcpy(&_breadCrumbs[0], &_breadCrumbs[1], _numCrumbs * sizeof _breadCrumbs[0]);
+ }
+
+ _breadCrumbs[_numCrumbs]._roomNum = _roomNum;
+ _breadCrumbs[_numCrumbs++]._direction = _direction;
+ }
+ }
+ }
+
+ mayShowCrumbIndicator();
+ break;
+
+ case kButtonMap:
+ doUse(kItemMap);
+
+ mayShowCrumbIndicator();
+ break;
+ }
+
+ _graphics->screenUpdate();
+}
+
+void LabEngine::processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonId, uint16 &actionMode) {
+ bool saveRestoreSuccessful = true;
+
+ _anim->_doBlack = true;
+
+ switch (buttonId) {
+ case kButtonMainDisplay:
+ eatMessages();
+ _alternate = false;
+ _anim->_doBlack = true;
+
+ _mainDisplay = true;
+ // Sets the correct button list
+ interfaceOn();
+ _graphics->drawPanel();
+ drawRoomMessage(curInv, _closeDataPtr);
+ break;
+
+ case kButtonSaveLoad:
+ interfaceOff();
+ _anim->stopDiff();
+ _curFileName = " ";
+
+ saveRestoreSuccessful = saveRestoreGame();
+ _closeDataPtr = nullptr;
+ _mainDisplay = true;
+
+ curInv = lastInv = kItemMap;
+ _nextFileName = getInvName(curInv);
+
+ _graphics->drawPanel();
+
+ if (!saveRestoreSuccessful) {
+ _graphics->drawMessage("Save/restore aborted", false);
+ _graphics->setPalette(initColors, 8);
+ _system->delayMillis(1000);
+ }
+ break;
+
+ case kButtonUseItem:
+ if (!doUse(curInv)) {
+ uint16 oldActionMode = actionMode;
+ // Use button
+ actionMode = 5;
+
+ if (oldActionMode < 5)
+ perFlipButton(oldActionMode);
+
+ drawStaticMessage(kTextUseOnWhat);
+ _mainDisplay = true;
+ }
+ break;
+
+ case kButtonLookAtItem:
+ _mainDisplay = !_mainDisplay;
+
+ if ((curInv == 0) || (curInv > _numInv)) {
+ curInv = 1;
+
+ while ((curInv <= _numInv) && !_conditions->in(curInv))
+ curInv++;
+ }
+
+ if ((curInv <= _numInv) && _conditions->in(curInv) && !_inventory[curInv]._bitmapName.empty())
+ _nextFileName = getInvName(curInv);
+
+ break;
+
+ case kButtonPrevItem:
+ decIncInv(&curInv, true);
+ lastInv = curInv;
+ drawRoomMessage(curInv, _closeDataPtr);
+ break;
+
+ case kButtonNextItem:
+ decIncInv(&curInv, false);
+ lastInv = curInv;
+ drawRoomMessage(curInv, _closeDataPtr);
+ break;
+
+ case kButtonBreadCrumbs:
+ _breadCrumbs[0]._roomNum = 0;
+ _numCrumbs = 0;
+ _droppingCrumbs = true;
+ mayShowCrumbIndicator();
+ break;
+
+ case kButtonFollowCrumbs:
+ if (_droppingCrumbs) {
+ if (_numCrumbs > 0) {
+ _followingCrumbs = true;
+ _followCrumbsFast = false;
+ _isCrumbTurning = false;
+ _isCrumbWaiting = false;
+ _crumbTimestamp = _system->getMillis();
+
+ eatMessages();
+ _alternate = false;
+ _anim->_doBlack = true;
+
+ _mainDisplay = true;
+ // Sets the correct button list
+ interfaceOn();
+ _graphics->drawPanel();
+ drawRoomMessage(curInv, _closeDataPtr);
+ } else {
+ _breadCrumbs[0]._roomNum = 0;
+ _droppingCrumbs = false;
+
+ // Need to hide indicator!!!!
+ mayShowCrumbIndicatorOff();
+ }
+ }
+ break;
+ }
+
+ _graphics->screenUpdate();
+}
+
+void LabEngine::performAction(uint16 actionMode, Common::Point curPos, uint16 &curInv) {
+ eatMessages();
+
+ switch (actionMode) {
+ case 0:
+ // Take something.
+ if (doActionRule(curPos, actionMode, _roomNum, &_closeDataPtr))
+ _curFileName = _newFileName;
+ else if (takeItem(curPos, &_closeDataPtr))
+ drawStaticMessage(kTextTakeItem);
+ else if (doActionRule(curPos, kRuleActionTakeDef, _roomNum, &_closeDataPtr))
+ _curFileName = _newFileName;
+ else if (doActionRule(curPos, kRuleActionTake, 0, &_closeDataPtr))
+ _curFileName = _newFileName;
+ else if (curPos.y < (_utils->vgaScaleY(149) + _utils->svgaCord(2)))
+ drawStaticMessage(kTextNothing);
+
+ break;
+
+ case 1:
+ case 2:
+ case 3:
+ // Manipulate an object, Open up a "door" or Close a "door"
+ if (doActionRule(curPos, actionMode, _roomNum, &_closeDataPtr))
+ _curFileName = _newFileName;
+ else if (!doActionRule(curPos, actionMode, 0, &_closeDataPtr)) {
+ if (curPos.y < (_utils->vgaScaleY(149) + _utils->svgaCord(2)))
+ drawStaticMessage(kTextNothing);
+ }
+ break;
+
+ case 4: {
+ // Look at closeups
+ CloseDataPtr tmpClosePtr = _closeDataPtr;
+ setCurrentClose(curPos, &tmpClosePtr, true);
+
+ if (_closeDataPtr == tmpClosePtr) {
+ if (curPos.y < (_utils->vgaScaleY(149) + _utils->svgaCord(2)))
+ drawStaticMessage(kTextNothing);
+ } else if (!tmpClosePtr->_graphicName.empty()) {
+ _anim->_doBlack = true;
+ _closeDataPtr = tmpClosePtr;
+ } else if (curPos.y < (_utils->vgaScaleY(149) + _utils->svgaCord(2)))
+ drawStaticMessage(kTextNothing);
+ }
+ break;
+
+ case 5:
+ if (_conditions->in(curInv)) {
+ // Use an item on something else
+ if (doOperateRule(curPos, curInv, &_closeDataPtr)) {
+ _curFileName = _newFileName;
+
+ if (!_conditions->in(curInv))
+ decIncInv(&curInv, false);
+ }
+ else if (curPos.y < (_utils->vgaScaleY(149) + _utils->svgaCord(2)))
+ drawStaticMessage(kTextNothing);
+ }
+ }
+}
+
+void LabEngine::go() {
+ _isHiRes = ((getFeatures() & GF_LOWRES) == 0);
+ _graphics->setUpScreens();
+
+ _event->initMouse();
+ if (_msgFont)
+ _graphics->freeFont(&_msgFont);
+
+ if (getPlatform() != Common::kPlatformAmiga)
+ _msgFont = _resource->getFont("F:AvanteG.12");
+ else
+ _msgFont = _resource->getFont("F:Map.fon");
+ _event->mouseHide();
+
+ Intro *intro = new Intro(this);
+ intro->play();
+ delete intro;
+
+ _event->mouseShow();
+ mainGameLoop();
+
+ _graphics->freeFont(&_msgFont);
+ _graphics->freePict();
+
+ freeScreens();
+
+ _music->freeMusic();
+}
+
+MainButton LabEngine::followCrumbs() {
+ // kDirectionNorth, kDirectionSouth, kDirectionEast, kDirectionWest
+ MainButton movement[4][4] = {
+ { kButtonForward, kButtonRight, kButtonRight, kButtonLeft },
+ { kButtonRight, kButtonForward, kButtonLeft, kButtonRight },
+ { kButtonLeft, kButtonRight, kButtonForward, kButtonRight },
+ { kButtonRight, kButtonLeft, kButtonRight, kButtonForward }
+ };
+
+ if (_isCrumbWaiting) {
+ if (_system->getMillis() <= _crumbTimestamp)
+ return kButtonNone;
+
+ _isCrumbWaiting = false;
+ }
+
+ if (!_isCrumbTurning)
+ _breadCrumbs[_numCrumbs--]._roomNum = 0;
+
+ // Is the current crumb this room? If not, logic error.
+ if (_roomNum != _breadCrumbs[_numCrumbs]._roomNum) {
+ _numCrumbs = 0;
+ _breadCrumbs[0]._roomNum = 0;
+ _droppingCrumbs = false;
+ _followingCrumbs = false;
+ return kButtonNone;
+ }
+
+ Direction exitDir;
+ // which direction is last crumb
+ if (_breadCrumbs[_numCrumbs]._direction == kDirectionEast)
+ exitDir = kDirectionWest;
+ else if (_breadCrumbs[_numCrumbs]._direction == kDirectionWest)
+ exitDir = kDirectionEast;
+ else if (_breadCrumbs[_numCrumbs]._direction == kDirectionNorth)
+ exitDir = kDirectionSouth;
+ else
+ exitDir = kDirectionNorth;
+
+ MainButton moveDir = movement[_direction][exitDir];
+
+ if (_numCrumbs == 0) {
+ _isCrumbTurning = false;
+ _breadCrumbs[0]._roomNum = 0;
+ _droppingCrumbs = false;
+ _followingCrumbs = false;
+ } else {
+ _isCrumbTurning = (moveDir != kButtonForward);
+ _isCrumbWaiting = true;
+
+ int theDelay = (_followCrumbsFast ? 1000 / 4 : 1000);
+ _crumbTimestamp = theDelay + _system->getMillis();
+ }
+
+ return moveDir;
+}
+
+
+void LabEngine::mayShowCrumbIndicator() {
+ static Image dropCrumbsImage(24, 24, nullptr, this);
+ if (getPlatform() != Common::kPlatformWindows)
+ return;
+
+ if (_droppingCrumbs && _mainDisplay) {
+ _event->mouseHide();
+ dropCrumbsImage.drawMaskImage(612, 4);
+ _event->mouseShow();
+ }
+}
+
+void LabEngine::mayShowCrumbIndicatorOff() {
+ static Image dropCrumbsOffImage(24, 24, nullptr, this);
+
+ if (getPlatform() != Common::kPlatformWindows)
+ return;
+
+ if (_mainDisplay) {
+ _event->mouseHide();
+ dropCrumbsOffImage.drawMaskImage(612, 4);
+ _event->mouseShow();
+ }
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/eventman.cpp b/engines/lab/eventman.cpp
new file mode 100644
index 0000000000..83c50b9771
--- /dev/null
+++ b/engines/lab/eventman.cpp
@@ -0,0 +1,227 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "common/events.h"
+
+#include "lab/lab.h"
+
+#include "lab/dispman.h"
+#include "lab/eventman.h"
+#include "lab/image.h"
+
+namespace Lab {
+
+static const byte mouseData[] = {
+ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 7, 1, 0, 0, 0, 0, 0, 0, 0,
+ 1, 7, 7, 1, 0, 0, 0, 0, 0, 0,
+ 1, 7, 7, 7, 1, 0, 0, 0, 0, 0,
+ 1, 7, 7, 7, 7, 1, 0, 0, 0, 0,
+ 1, 7, 7, 7, 7, 7, 1, 0, 0, 0,
+ 1, 7, 7, 7, 7, 7, 7, 1, 0, 0,
+ 1, 7, 7, 7, 7, 7, 7, 7, 1, 0,
+ 1, 7, 7, 7, 7, 7, 1, 1, 1, 1,
+ 1, 7, 7, 1, 7, 7, 1, 0, 0, 0,
+ 1, 7, 1, 0, 1, 7, 7, 1, 0, 0,
+ 1, 1, 0, 0, 1, 7, 7, 1, 0, 0,
+ 0, 0, 0, 0, 0, 1, 7, 7, 1, 0,
+ 0, 0, 0, 0, 0, 1, 7, 7, 1, 0,
+ 0, 0, 0, 0, 0, 0, 1, 1, 0, 0
+};
+
+#define MOUSE_WIDTH 10
+#define MOUSE_HEIGHT 15
+
+EventManager::EventManager(LabEngine *vm) : _vm(vm) {
+ _leftClick = false;
+ _rightClick = false;
+
+ _lastButtonHit = nullptr;
+ _screenButtonList = nullptr;
+ _hitButton = nullptr;
+ _mousePos = Common::Point(0, 0);
+ _keyPressed = Common::KEYCODE_INVALID;
+}
+
+Button *EventManager::checkButtonHit(ButtonList *buttonList, Common::Point pos) {
+ for (ButtonList::iterator buttonItr = buttonList->begin(); buttonItr != buttonList->end(); ++buttonItr) {
+ Button *button = *buttonItr;
+ Common::Rect buttonRect(button->_x, button->_y, button->_x + button->_image->_width - 1, button->_y + button->_image->_height - 1);
+
+ if (buttonRect.contains(pos) && button->_isEnabled) {
+ if (_vm->_isHiRes) {
+ _hitButton = button;
+ } else {
+ mouseHide();
+ button->_altImage->drawImage(button->_x, button->_y);
+ mouseShow();
+
+ for (int i = 0; i < 3; i++)
+ _vm->waitTOF();
+
+ mouseHide();
+ button->_image->drawImage(button->_x, button->_y);
+ mouseShow();
+ }
+
+ return button;
+ }
+ }
+
+ return nullptr;
+}
+
+void EventManager::attachButtonList(ButtonList *buttonList) {
+ if (_screenButtonList != buttonList)
+ _lastButtonHit = nullptr;
+
+ _screenButtonList = buttonList;
+}
+
+Button *EventManager::getButton(uint16 id) {
+ for (ButtonList::iterator buttonItr = _screenButtonList->begin(); buttonItr != _screenButtonList->end(); ++buttonItr) {
+ Button *button = *buttonItr;
+ if (button->_buttonId == id)
+ return button;
+ }
+
+ return nullptr;
+}
+
+void EventManager::updateMouse() {
+ if (!_hitButton)
+ return;
+
+ mouseHide();
+ _hitButton->_altImage->drawImage(_hitButton->_x, _hitButton->_y);
+ mouseShow();
+
+ for (int i = 0; i < 3; i++)
+ _vm->waitTOF();
+
+ mouseHide();
+ _hitButton->_image->drawImage(_hitButton->_x, _hitButton->_y);
+ mouseShow();
+ _hitButton = nullptr;
+ _vm->_graphics->screenUpdate();
+}
+
+void EventManager::initMouse() {
+ _vm->_system->setMouseCursor(mouseData, MOUSE_WIDTH, MOUSE_HEIGHT, 0, 0, 0);
+ _vm->_system->showMouse(false);
+
+ setMousePos(Common::Point(0, 0));
+}
+
+void EventManager::mouseShow() {
+ _vm->_system->showMouse(true);
+}
+
+void EventManager::mouseHide() {
+ _vm->_system->showMouse(false);
+}
+
+Common::Point EventManager::getMousePos() {
+ if (_vm->_isHiRes)
+ return _mousePos;
+ else
+ return Common::Point(_mousePos.x / 2, _mousePos.y);
+}
+
+void EventManager::setMousePos(Common::Point pos) {
+ if (_vm->_isHiRes)
+ _vm->_system->warpMouse(pos.x, pos.y);
+ else
+ _vm->_system->warpMouse(pos.x * 2, pos.y);
+}
+
+void EventManager::processInput() {
+ Common::Event event;
+ Button *curButton = nullptr;
+
+ while (_vm->_system->getEventManager()->pollEvent(event)) {
+ switch (event.type) {
+ case Common::EVENT_LBUTTONDOWN:
+ if (_screenButtonList)
+ curButton = checkButtonHit(_screenButtonList, _vm->_isHiRes ? _mousePos : Common::Point(_mousePos.x / 2, _mousePos.y));
+
+ if (curButton)
+ _lastButtonHit = curButton;
+ else
+ _leftClick = true;
+ break;
+ case Common::EVENT_RBUTTONDOWN:
+ _rightClick = true;
+ break;
+ case Common::EVENT_MOUSEMOVE:
+ _mousePos = event.mouse;
+ break;
+ case Common::EVENT_KEYDOWN:
+ switch (event.kbd.keycode) {
+ case Common::KEYCODE_LEFTBRACKET:
+ _vm->changeVolume(-1);
+ break;
+ case Common::KEYCODE_RIGHTBRACKET:
+ _vm->changeVolume(1);
+ break;
+ case Common::KEYCODE_z:
+ //saveSettings();
+ break;
+ case Common::KEYCODE_d:
+ if (event.kbd.hasFlags(Common::KBD_CTRL)) {
+ // Open debugger console
+ _vm->_console->attach();
+ continue;
+ }
+ // Intentional fall through
+ default:
+ _keyPressed = event.kbd;
+ break;
+ }
+ break;
+ case Common::EVENT_QUIT:
+ case Common::EVENT_RTL:
+ default:
+ break;
+ }
+ }
+
+ _vm->_system->copyRectToScreen(_vm->_graphics->_displayBuffer, _vm->_graphics->_screenWidth, 0, 0, _vm->_graphics->_screenWidth, _vm->_graphics->_screenHeight);
+ _vm->_console->onFrame();
+ _vm->_system->updateScreen();
+}
+
+Common::Point EventManager::updateAndGetMousePos() {
+ processInput();
+
+ return _mousePos;
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/eventman.h b/engines/lab/eventman.h
new file mode 100644
index 0000000000..34cd3b0492
--- /dev/null
+++ b/engines/lab/eventman.h
@@ -0,0 +1,138 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#ifndef LAB_EVENTMAN_H
+#define LAB_EVENTMAN_H
+
+#include "common/events.h"
+
+namespace Lab {
+
+class LabEngine;
+class Image;
+
+struct IntuiMessage {
+ MessageClass _msgClass;
+ uint16 _code; // KeyCode or Button Id
+ uint16 _qualifier;
+ Common::Point _mouse;
+};
+
+struct Button {
+ uint16 _x, _y, _buttonId;
+ Common::KeyCode _keyEquiv; // the key which activates this button
+ bool _isEnabled;
+ Image *_image, *_altImage;
+};
+
+typedef Common::List<Button *> ButtonList;
+
+class EventManager {
+private:
+ LabEngine *_vm;
+
+ bool _leftClick;
+ bool _rightClick;
+
+ uint16 _nextKeyIn;
+ uint16 _nextKeyOut;
+
+ Button *_hitButton;
+ Button *_lastButtonHit;
+ ButtonList *_screenButtonList;
+ Common::Point _mousePos;
+ Common::KeyState _keyPressed;
+
+private:
+ /**
+ * Checks whether or not the cords fall within one of the buttons in a list
+ * of buttons.
+ */
+ Button *checkButtonHit(ButtonList *buttonList, Common::Point pos);
+
+ /**
+ * Checks whether or not the coords fall within one of the buttons in a list
+ * of buttons.
+ */
+ Button *checkNumButtonHit(ButtonList *buttonList, Common::KeyCode key);
+
+ /**
+ * Make a key press have the right case for a button KeyEquiv value.
+ */
+ uint16 makeButtonKeyEquiv(uint16 key);
+
+public:
+ EventManager (LabEngine *vm);
+
+ void attachButtonList(ButtonList *buttonList);
+ Button *createButton(uint16 x, uint16 y, uint16 id, Common::KeyCode key, Image *image, Image *altImage);
+ void toggleButton(Button *button, uint16 penColor, bool enable);
+
+ /**
+ * Draws a button list to the screen.
+ */
+ void drawButtonList(ButtonList *buttonList);
+ void freeButtonList(ButtonList *buttonList);
+ Button *getButton(uint16 id);
+
+ /**
+ * Gets the current mouse co-ordinates. NOTE: On IBM version, will scale
+ * from virtual to screen co-ordinates automatically.
+ */
+ Common::Point getMousePos();
+ IntuiMessage *getMsg();
+
+ /**
+ * Initializes the mouse.
+ */
+ void initMouse();
+
+ /**
+ * Shows the mouse.
+ */
+ void mouseShow();
+
+ /**
+ * Hides the mouse.
+ */
+ void mouseHide();
+ void processInput();
+
+ /**
+ * Moves the mouse to new co-ordinates.
+ */
+ void setMousePos(Common::Point pos);
+ void updateMouse();
+ Common::Point updateAndGetMousePos();
+};
+
+} // End of namespace Lab
+
+#endif // LAB_EVENTMAN_H
diff --git a/engines/lab/image.cpp b/engines/lab/image.cpp
new file mode 100644
index 0000000000..ce0d5431b6
--- /dev/null
+++ b/engines/lab/image.cpp
@@ -0,0 +1,133 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "common/file.h"
+
+#include "lab/lab.h"
+
+#include "lab/dispman.h"
+#include "lab/image.h"
+
+namespace Lab {
+
+Image::Image(Common::File *s, LabEngine *vm) : _vm(vm) {
+ _width = s->readUint16LE();
+ _height = s->readUint16LE();
+ s->skip(4);
+
+ uint32 size = _width * _height;
+ if (size & 1)
+ size++;
+
+ _imageData = new byte[size];
+ s->read(_imageData, size);
+}
+
+Image::~Image() {
+ delete[] _imageData;
+}
+
+void Image::blitBitmap(uint16 xs, uint16 ys, Image *imDest,
+ uint16 xd, uint16 yd, uint16 width, uint16 height, byte masked) {
+ int w = width;
+ int h = height;
+ int destWidth = (imDest) ? imDest->_width : _vm->_graphics->_screenWidth;
+ int destHeight = (imDest) ? imDest->_height : _vm->_graphics->_screenHeight;
+ byte *destBuffer = (imDest) ? imDest->_imageData : _vm->_graphics->getCurrentDrawingBuffer();
+
+ if (xd + w > destWidth)
+ w = destWidth - xd;
+
+ if (yd + h > destHeight)
+ h = destHeight - yd;
+
+ if ((w > 0) && (h > 0)) {
+ byte *s = _imageData + ys * _width + xs;
+ byte *d = destBuffer + yd * destWidth + xd;
+
+ if (!masked) {
+ while (h-- > 0) {
+ memcpy(d, s, w);
+ s += _width;
+ d += destWidth;
+ }
+ } else {
+ while (h-- > 0) {
+ byte *ss = s;
+ byte *dd = d;
+ int ww = w;
+
+ while (ww-- > 0) {
+ byte c = *ss++;
+
+ if (c)
+ *dd++ = c - 1;
+ else
+ dd++;
+ }
+
+ s += _width;
+ d += destWidth;
+ }
+ }
+ }
+}
+
+void Image::drawImage(uint16 x, uint16 y) {
+ blitBitmap(0, 0, nullptr, x, y, _width, _height, false);
+}
+
+void Image::drawMaskImage(uint16 x, uint16 y) {
+ blitBitmap(0, 0, nullptr, x, y, _width, _height, true);
+}
+
+void Image::readScreenImage(uint16 x, uint16 y) {
+ int w = _width;
+ int h = _height;
+
+ if (x + w > _vm->_graphics->_screenWidth)
+ w = _vm->_graphics->_screenWidth - x;
+
+ if (y + h > _vm->_graphics->_screenHeight)
+ h = _vm->_graphics->_screenHeight - y;
+
+ if ((w > 0) && (h > 0)) {
+ byte *s = _imageData;
+ byte *d = _vm->_graphics->getCurrentDrawingBuffer() + y * _vm->_graphics->_screenWidth + x;
+
+ while (h-- > 0) {
+ memcpy(s, d, w);
+ s += _width;
+ d += _vm->_graphics->_screenWidth;
+ }
+ }
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/image.h b/engines/lab/image.h
new file mode 100644
index 0000000000..bac32cd763
--- /dev/null
+++ b/engines/lab/image.h
@@ -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 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#ifndef LAB_IMAGE_H
+#define LAB_IMAGE_H
+
+namespace Common {
+ class File;
+}
+
+namespace Lab {
+
+class LabEngine;
+
+class Image {
+ LabEngine *_vm;
+
+public:
+ uint16 _width;
+ uint16 _height;
+ byte *_imageData;
+
+ Image(LabEngine *vm) : _width(0), _height(0), _imageData(nullptr), _vm(vm) {}
+ Image(int w, int h, byte *d, LabEngine *vm) : _width(w), _height(h), _imageData(d), _vm(vm) {}
+ Image(Common::File *s, LabEngine *vm);
+ virtual ~Image();
+
+ /**
+ * Draws an image to the screen.
+ */
+ void drawImage(uint16 x, uint16 y);
+
+ /**
+ * Draws an image to the screen with transparency.
+ */
+ void drawMaskImage(uint16 x, uint16 y);
+
+ /**
+ * Reads an image from the screen.
+ */
+ void readScreenImage(uint16 x, uint16 y);
+
+ /**
+ * Blits a piece of one image to another.
+ */
+ void blitBitmap(uint16 xs, uint16 ys, Image *ImDest, uint16 xd, uint16 yd, uint16 width, uint16 height, byte masked);
+};
+
+} // End of namespace Lab
+
+#endif // LAB_IMAGE_H
diff --git a/engines/lab/interface.cpp b/engines/lab/interface.cpp
new file mode 100644
index 0000000000..507e0b27d5
--- /dev/null
+++ b/engines/lab/interface.cpp
@@ -0,0 +1,159 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "common/events.h"
+
+#include "lab/lab.h"
+
+#include "lab/dispman.h"
+#include "lab/eventman.h"
+#include "lab/image.h"
+#include "lab/utils.h"
+
+namespace Lab {
+
+Button *EventManager::createButton(uint16 x, uint16 y, uint16 id, Common::KeyCode key, Image *image, Image *altImage) {
+ Button *button = new Button();
+
+ if (button) {
+ button->_x = _vm->_utils->vgaScaleX(x);
+ button->_y = y;
+ button->_buttonId = id;
+ button->_keyEquiv = key;
+ button->_image = image;
+ button->_altImage = altImage;
+ button->_isEnabled = true;
+
+ return button;
+ } else
+ return nullptr;
+}
+
+void EventManager::freeButtonList(ButtonList *buttonList) {
+ for (ButtonList::iterator buttonIter = buttonList->begin(); buttonIter != buttonList->end(); ++buttonIter) {
+ Button *button = *buttonIter;
+ delete button->_image;
+ delete button->_altImage;
+ delete button;
+ }
+
+ buttonList->clear();
+}
+
+void EventManager::drawButtonList(ButtonList *buttonList) {
+ for (ButtonList::iterator button = buttonList->begin(); button != buttonList->end(); ++button) {
+ toggleButton((*button), 1, true);
+
+ if (!(*button)->_isEnabled)
+ toggleButton((*button), 1, false);
+ }
+}
+
+void EventManager::toggleButton(Button *button, uint16 disabledPenColor, bool enable) {
+ if (!enable)
+ _vm->_graphics->checkerboardEffect(disabledPenColor, button->_x, button->_y, button->_x + button->_image->_width - 1, button->_y + button->_image->_height - 1);
+ else
+ button->_image->drawImage(button->_x, button->_y);
+
+ button->_isEnabled = enable;
+}
+
+uint16 EventManager::makeButtonKeyEquiv(uint16 key) {
+ if (Common::isAlnum(key))
+ key = tolower(key);
+
+ return key;
+}
+
+Button *EventManager::checkNumButtonHit(ButtonList *buttonList, Common::KeyCode key) {
+ uint16 gkey = key - '0';
+
+ if (!buttonList)
+ return nullptr;
+
+ for (ButtonList::iterator buttonItr = buttonList->begin(); buttonItr != buttonList->end(); ++buttonItr) {
+ Button *button = *buttonItr;
+ if (!button->_isEnabled)
+ continue;
+
+ if ((gkey - 1 == button->_buttonId) || (gkey == 0 && button->_buttonId == 9) || (button->_keyEquiv != Common::KEYCODE_INVALID && key == button->_keyEquiv)) {
+ button->_altImage->drawImage(button->_x, button->_y);
+ _vm->_system->delayMillis(80);
+ button->_image->drawImage(button->_x, button->_y);
+ return button;
+ }
+ }
+
+ return nullptr;
+}
+
+IntuiMessage *EventManager::getMsg() {
+ static IntuiMessage message;
+
+ updateMouse();
+ processInput();
+
+ if (_lastButtonHit) {
+ updateMouse();
+ message._msgClass = kMessageButtonUp;
+ message._code = _lastButtonHit->_buttonId;
+ message._qualifier = _keyPressed.flags;
+ _lastButtonHit = nullptr;
+ return &message;
+ } else if (_leftClick || _rightClick) {
+ message._msgClass = (_leftClick) ? kMessageLeftClick : kMessageRightClick;
+ message._qualifier = 0;
+ message._mouse = _mousePos;
+ if (!_vm->_isHiRes)
+ message._mouse.x /= 2;
+ _leftClick = _rightClick = false;
+ return &message;
+ } else if (_keyPressed.keycode != Common::KEYCODE_INVALID) {
+ Button *curButton = checkNumButtonHit(_screenButtonList, _keyPressed.keycode);
+
+ if (curButton) {
+ message._msgClass = kMessageButtonUp;
+ message._code = curButton->_buttonId;
+ } else {
+ message._msgClass = kMessageRawKey;
+ message._code = _keyPressed.keycode;
+ }
+
+ message._qualifier = _keyPressed.flags;
+ message._mouse = _mousePos;
+
+ _keyPressed.keycode = Common::KEYCODE_INVALID;
+
+ return &message;
+ } else
+ return nullptr;
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/intro.cpp b/engines/lab/intro.cpp
new file mode 100644
index 0000000000..8971c96786
--- /dev/null
+++ b/engines/lab/intro.cpp
@@ -0,0 +1,438 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "lab/lab.h"
+
+#include "lab/anim.h"
+#include "lab/dispman.h"
+#include "lab/eventman.h"
+#include "lab/intro.h"
+#include "lab/music.h"
+#include "lab/resource.h"
+#include "lab/utils.h"
+
+namespace Lab {
+
+Intro::Intro(LabEngine *vm) : _vm(vm) {
+ _quitIntro = false;
+ _introDoBlack = false;
+ _font = _vm->_resource->getFont("F:Map.fon");
+}
+
+Intro::~Intro() {
+ _vm->_graphics->freeFont(&_font);
+}
+
+void Intro::introEatMessages() {
+ while (1) {
+ IntuiMessage *msg = _vm->_event->getMsg();
+
+ if (_vm->shouldQuit()) {
+ _quitIntro = true;
+ return;
+ }
+
+ if (!msg)
+ return;
+
+ if ((msg->_msgClass == kMessageRightClick)
+ || ((msg->_msgClass == kMessageRawKey) && (msg->_code == Common::KEYCODE_ESCAPE)))
+ _quitIntro = true;
+ }
+}
+
+void Intro::doPictText(const Common::String filename, bool isScreen) {
+ Common::String path = Common::String("Lab:rooms/Intro/") + filename;
+
+ uint timeDelay = (isScreen) ? 35 : 7;
+ _vm->updateMusicAndEvents();
+
+ if (_quitIntro)
+ return;
+
+ uint32 lastMillis = 0;
+ bool drawNextText = true;
+ bool doneFl = false;
+ bool begin = true;
+
+ Common::File *textFile = _vm->_resource->openDataFile(path);
+ byte *textBuffer = new byte[textFile->size()];
+ textFile->read(textBuffer, textFile->size());
+ delete textFile;
+ byte *curText = textBuffer;
+
+ while (1) {
+ if (drawNextText) {
+ if (begin)
+ begin = false;
+ else if (isScreen)
+ _vm->_graphics->fade(false);
+
+ if (isScreen) {
+ _vm->_graphics->rectFillScaled(10, 10, 310, 190, 7);
+
+ curText += _vm->_graphics->flowText(_font, _vm->_isHiRes ? 0 : -1, 5, 7, false, false, true, true, _vm->_utils->vgaRectScale(14, 11, 306, 189), (char *)curText);
+ _vm->_graphics->fade(true);
+ } else
+ curText += _vm->_graphics->longDrawMessage(Common::String((char *)curText), false);
+
+ doneFl = (*curText == 0);
+
+ drawNextText = false;
+ introEatMessages();
+
+ if (_quitIntro) {
+ if (isScreen)
+ _vm->_graphics->fade(false);
+
+ delete[] textBuffer;
+ return;
+ }
+
+ lastMillis = _vm->_system->getMillis();
+ }
+
+ IntuiMessage *msg = _vm->_event->getMsg();
+ if (_vm->shouldQuit()) {
+ _quitIntro = true;
+ return;
+ }
+
+ if (!msg) {
+ _vm->updateMusicAndEvents();
+ _vm->_anim->diffNextFrame();
+
+ uint32 elapsedSeconds = (_vm->_system->getMillis() - lastMillis) / 1000;
+
+ if (elapsedSeconds > timeDelay) {
+ if (doneFl) {
+ if (isScreen)
+ _vm->_graphics->fade(false);
+
+ delete[] textBuffer;
+ return;
+ } else {
+ drawNextText = true;
+ }
+ }
+ _vm->waitTOF();
+ } else {
+ uint32 msgClass = msg->_msgClass;
+ uint16 code = msg->_code;
+
+ if ((msgClass == kMessageRightClick) ||
+ ((msgClass == kMessageRawKey) && (code == Common::KEYCODE_ESCAPE))) {
+ _quitIntro = true;
+
+ if (isScreen)
+ _vm->_graphics->fade(false);
+
+ delete[] textBuffer;
+ return;
+ } else if ((msgClass == kMessageLeftClick) || (msgClass == kMessageRightClick)) {
+ if (msgClass == kMessageLeftClick) {
+ if (doneFl) {
+ if (isScreen)
+ _vm->_graphics->fade(false);
+
+ delete[] textBuffer;
+ return;
+ } else
+ drawNextText = true;
+ }
+
+ introEatMessages();
+
+ if (_quitIntro) {
+ if (isScreen)
+ _vm->_graphics->fade(false);
+
+ delete[] textBuffer;
+ return;
+ }
+ }
+
+ if (doneFl) {
+ if (isScreen)
+ _vm->_graphics->fade(false);
+
+ delete[] textBuffer;
+ return;
+ } else
+ drawNextText = true;
+ }
+ } // while(1)
+}
+
+void Intro::musicDelay() {
+ _vm->updateMusicAndEvents();
+
+ if (_quitIntro)
+ return;
+
+ for (int i = 0; i < 20; i++) {
+ _vm->updateMusicAndEvents();
+ _vm->waitTOF();
+ _vm->waitTOF();
+ _vm->waitTOF();
+ }
+}
+
+void Intro::nReadPict(const Common::String filename, bool playOnce) {
+ Common::String finalFileName = Common::String("P:Intro/") + filename;
+
+ _vm->updateMusicAndEvents();
+ introEatMessages();
+
+ if (_quitIntro)
+ return;
+
+ _vm->_anim->_doBlack = _introDoBlack;
+ _vm->_anim->stopDiffEnd();
+ _vm->_graphics->readPict(finalFileName, playOnce);
+}
+
+void Intro::play() {
+ uint16 palette[16] = {
+ 0x0000, 0x0855, 0x0FF9, 0x0EE7,
+ 0x0ED5, 0x0DB4, 0x0CA2, 0x0C91,
+ 0x0B80, 0x0B80, 0x0B91, 0x0CA2,
+ 0x0CB3, 0x0DC4, 0x0DD6, 0x0EE7
+ };
+
+ _vm->_anim->_doBlack = true;
+
+ if (_vm->getPlatform() == Common::kPlatformDOS) {
+ nReadPict("EA0");
+ nReadPict("EA1");
+ nReadPict("EA2");
+ nReadPict("EA3");
+ } else if (_vm->getPlatform() == Common::kPlatformWindows) {
+ nReadPict("WYRMKEEP");
+ // Wait 4 seconds
+ for (int i = 0; i < 4 * 1000 / 10; i++) {
+ introEatMessages();
+ if (_quitIntro)
+ break;
+ _vm->_system->delayMillis(10);
+ }
+ }
+
+ _vm->_graphics->blackAllScreen();
+
+ if (_vm->getPlatform() == Common::kPlatformAmiga)
+ _vm->_music->initMusic("Music:BackGround");
+ else
+ _vm->_music->initMusic("Music:BackGrou");
+
+ _vm->_anim->_noPalChange = true;
+ if (_vm->getPlatform() == Common::kPlatformDOS)
+ nReadPict("TNDcycle.pic");
+ else
+ nReadPict("TNDcycle2.pic");
+ _vm->_anim->_noPalChange = false;
+
+ _vm->_graphics->_fadePalette = palette;
+
+ for (int i = 0; i < 16; i++) {
+ if (_quitIntro)
+ break;
+
+ palette[i] = ((_vm->_anim->_diffPalette[i * 3] >> 2) << 8) +
+ ((_vm->_anim->_diffPalette[i * 3 + 1] >> 2) << 4) +
+ (_vm->_anim->_diffPalette[i * 3 + 2] >> 2);
+ }
+
+ _vm->updateMusicAndEvents();
+ _vm->_graphics->fade(true);
+
+ for (int times = 0; times < 150; times++) {
+ if (_quitIntro)
+ break;
+
+ _vm->updateMusicAndEvents();
+ uint16 temp = palette[2];
+
+ for (int i = 2; i < 15; i++)
+ palette[i] = palette[i + 1];
+
+ palette[15] = temp;
+
+ _vm->_graphics->setAmigaPal(palette);
+ _vm->waitTOF();
+ }
+
+ _vm->_graphics->fade(false);
+ _vm->_graphics->blackAllScreen();
+ _vm->updateMusicAndEvents();
+
+ nReadPict("Title.A");
+ nReadPict("AB");
+ musicDelay();
+ nReadPict("BA");
+ nReadPict("AC");
+ musicDelay();
+
+ if (_vm->getPlatform() == Common::kPlatformWindows)
+ musicDelay(); // more credits on this page now
+
+ nReadPict("CA");
+ nReadPict("AD");
+ musicDelay();
+
+ if (_vm->getPlatform() == Common::kPlatformWindows)
+ musicDelay(); // more credits on this page now
+
+ nReadPict("DA");
+ musicDelay();
+
+ _vm->updateMusicAndEvents();
+ _vm->_graphics->blackAllScreen();
+ _vm->updateMusicAndEvents();
+
+ _vm->_anim->_noPalChange = true;
+ nReadPict("Intro.1");
+ _vm->_anim->_noPalChange = false;
+
+ for (int i = 0; i < 16; i++) {
+ palette[i] = ((_vm->_anim->_diffPalette[i * 3] >> 2) << 8) +
+ ((_vm->_anim->_diffPalette[i * 3 + 1] >> 2) << 4) +
+ (_vm->_anim->_diffPalette[i * 3 + 2] >> 2);
+ }
+
+ doPictText("i.1", true);
+ if (_vm->getPlatform() == Common::kPlatformWindows) {
+ doPictText("i.2A", true);
+ doPictText("i.2B", true);
+ }
+
+ _vm->_graphics->blackAllScreen();
+ _vm->updateMusicAndEvents();
+
+ _introDoBlack = true;
+ nReadPict("Station1");
+ doPictText("i.3");
+
+ nReadPict("Station2");
+ doPictText("i.4");
+
+ nReadPict("Stiles4");
+ doPictText("i.5");
+
+ nReadPict("Stiles3");
+ doPictText("i.6");
+
+ if (_vm->getPlatform() == Common::kPlatformWindows)
+ nReadPict("Platform2");
+ else
+ nReadPict("Platform");
+ doPictText("i.7");
+
+ nReadPict("Subway.1");
+ doPictText("i.8");
+
+ nReadPict("Subway.2");
+
+ doPictText("i.9");
+ doPictText("i.10");
+ doPictText("i.11");
+
+ if (!_quitIntro)
+ for (int i = 0; i < 50; i++) {
+ for (int idx = (8 * 3); idx < (255 * 3); idx++)
+ _vm->_anim->_diffPalette[idx] = 255 - _vm->_anim->_diffPalette[idx];
+
+ _vm->updateMusicAndEvents();
+ _vm->waitTOF();
+ _vm->_graphics->setPalette(_vm->_anim->_diffPalette, 256);
+ _vm->waitTOF();
+ _vm->waitTOF();
+ }
+
+ doPictText("i.12");
+ doPictText("i.13");
+
+ _introDoBlack = false;
+ nReadPict("Daed0");
+ doPictText("i.14");
+
+ nReadPict("Daed1");
+ doPictText("i.15");
+
+ nReadPict("Daed2");
+ doPictText("i.16");
+ doPictText("i.17");
+ doPictText("i.18");
+
+ nReadPict("Daed3");
+ doPictText("i.19");
+ doPictText("i.20");
+
+ nReadPict("Daed4");
+ doPictText("i.21");
+
+ nReadPict("Daed5");
+ doPictText("i.22");
+ doPictText("i.23");
+ doPictText("i.24");
+
+ nReadPict("Daed6");
+ doPictText("i.25");
+ doPictText("i.26");
+
+ nReadPict("Daed7", false);
+ doPictText("i.27");
+ doPictText("i.28");
+ _vm->_anim->stopDiffEnd();
+
+ nReadPict("Daed8");
+ doPictText("i.29");
+ doPictText("i.30");
+
+ nReadPict("Daed9");
+ doPictText("i.31");
+ doPictText("i.32");
+ doPictText("i.33");
+
+ nReadPict("Daed9a");
+ nReadPict("Daed10");
+ doPictText("i.34");
+ doPictText("i.35");
+ doPictText("i.36");
+
+ nReadPict("SubX");
+
+ if (_quitIntro) {
+ _vm->_graphics->rectFill(0, 0, _vm->_graphics->_screenWidth - 1, _vm->_graphics->_screenHeight - 1, 0);
+ _vm->_anim->_doBlack = true;
+ }
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/intro.h b/engines/lab/intro.h
new file mode 100644
index 0000000000..9961be6226
--- /dev/null
+++ b/engines/lab/intro.h
@@ -0,0 +1,71 @@
+/* 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.
+ *
+ */
+
+ /*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#ifndef LAB_INTRO_H
+#define LAB_INTRO_H
+
+namespace Lab {
+
+class Intro {
+public:
+ Intro(LabEngine *vm);
+ ~Intro();
+
+ /**
+ * Does the introduction sequence for Labyrinth.
+ */
+ void play();
+
+private:
+ /**
+ * Goes through, and responds to all the intuition messages currently in the
+ * message queue.
+ */
+ void introEatMessages();
+
+ /**
+ * Reads in a picture.
+ */
+ void doPictText(const Common::String filename, bool isScreen = false);
+
+ /**
+ * Does a one second delay, but checks the music while doing it.
+ */
+ void musicDelay();
+ void nReadPict(const Common::String filename, bool playOnce = true);
+
+ LabEngine *_vm;
+ bool _quitIntro, _introDoBlack;
+ TextFont *_font;
+};
+
+} // End of namespace Lab
+
+#endif // LAB_INTRO_H
diff --git a/engines/lab/lab.cpp b/engines/lab/lab.cpp
new file mode 100644
index 0000000000..e942617a26
--- /dev/null
+++ b/engines/lab/lab.cpp
@@ -0,0 +1,247 @@
+/* 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.
+ *
+ */
+
+ /*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "common/debug-channels.h"
+#include "common/error.h"
+
+#include "engines/util.h"
+#include "gui/message.h"
+
+#include "lab/lab.h"
+
+#include "lab/anim.h"
+#include "lab/console.h"
+#include "lab/dispman.h"
+#include "lab/eventman.h"
+#include "lab/image.h"
+#include "lab/music.h"
+#include "lab/processroom.h"
+#include "lab/resource.h"
+#include "lab/tilepuzzle.h"
+#include "lab/utils.h"
+
+namespace Lab {
+LabEngine::LabEngine(OSystem *syst, const ADGameDescription *gameDesc)
+ : Engine(syst), _gameDescription(gameDesc), _extraGameFeatures(0) {
+ _lastWaitTOFTicks = 0;
+
+ _isHiRes = false;
+ _roomNum = -1;
+ for (int i = 0; i < MAX_CRUMBS; i++) {
+ _breadCrumbs[i]._roomNum = 0;
+ _breadCrumbs[i]._direction = kDirectionNorth;
+ }
+
+ _numCrumbs = 0;
+ _droppingCrumbs = false;
+ _followingCrumbs = false;
+ _followCrumbsFast = false;
+ _isCrumbTurning = false;
+ _isCrumbWaiting = false;
+ _noUpdateDiff = false;
+ _quitLab = false;
+ _mainDisplay = true;
+
+ _numInv = 0;
+ _manyRooms = 0;
+ _direction = 0;
+ _highestCondition = 0;
+ _crumbTimestamp = 0;
+ _maxRooms = 0;
+
+ _event = nullptr;
+ _resource = nullptr;
+ _music = nullptr;
+ _anim = nullptr;
+ _closeDataPtr = nullptr;
+ _conditions = nullptr;
+ _graphics = nullptr;
+ _rooms = nullptr;
+ _roomsFound = nullptr;
+ _tilePuzzle = nullptr;
+ _utils = nullptr;
+ _console = nullptr;
+ _journalBackImage = nullptr;
+
+ _lastTooLong = false;
+ _interfaceOff = false;
+ _alternate = false;
+
+ for (int i = 0; i < 20; i++)
+ _moveImages[i] = nullptr;
+
+ for (int i = 0; i < 10; i++)
+ _invImages[i] = nullptr;
+
+ _curFileName = " ";
+ _msgFont = nullptr;
+ _inventory = nullptr;
+
+ _imgMap = nullptr;
+ _imgRoom = nullptr;
+ _imgUpArrowRoom = nullptr;
+ _imgDownArrowRoom = nullptr;
+ _imgBridge = nullptr;
+ _imgHRoom = nullptr;
+ _imgVRoom = nullptr;
+ _imgMaze = nullptr;
+ _imgHugeMaze = nullptr;
+ _imgPath = nullptr;
+ for (int i = 0; i < 4; i++)
+ _imgMapX[i] = nullptr;
+ _maps = nullptr;
+
+ _blankJournal = nullptr;
+ _journalFont = nullptr;
+ _journalPage = 0;
+ _lastPage = false;
+ _monitorPage = 0;
+ _monitorTextFilename = "";
+ _monitorButton = nullptr;
+ _monitorButtonHeight = 1;
+ for (int i = 0; i < 20; i++)
+ _highPalette[i] = 0;
+
+ //const Common::FSNode gameDataDir(ConfMan.get("path"));
+ //SearchMan.addSubDirectoryMatching(gameDataDir, "game");
+ //SearchMan.addSubDirectoryMatching(gameDataDir, "game/pict");
+ //SearchMan.addSubDirectoryMatching(gameDataDir, "game/spict");
+ //SearchMan.addSubDirectoryMatching(gameDataDir, "music");
+}
+
+LabEngine::~LabEngine() {
+ // Remove all of our debug levels here
+ DebugMan.clearAllDebugChannels();
+
+ freeMapData();
+ delete[] _rooms;
+ delete[] _inventory;
+
+ delete _conditions;
+ delete _roomsFound;
+ delete _event;
+ delete _resource;
+ delete _music;
+ delete _anim;
+ delete _graphics;
+ delete _tilePuzzle;
+ delete _utils;
+ delete _console;
+ delete _journalBackImage;
+}
+
+Common::Error LabEngine::run() {
+ if (getFeatures() & GF_LOWRES)
+ initGraphics(320, 200, false);
+ else
+ initGraphics(640, 480, true);
+
+ _event = new EventManager(this);
+ _resource = new Resource(this);
+ _music = new Music(this);
+ _graphics = new DisplayMan(this);
+ _anim = new Anim(this);
+ _tilePuzzle = new TilePuzzle(this);
+ _utils = new Utils(this);
+ _console = new Console(this);
+ _journalBackImage = new Image(this);
+
+ if (getPlatform() == Common::kPlatformWindows) {
+ // Check if this is the Wyrmkeep trial
+ Common::File roomFile;
+ bool knownVersion = true;
+ bool roomFileOpened = roomFile.open("game/rooms/48");
+
+ if (!roomFileOpened)
+ knownVersion = false;
+ else if (roomFile.size() != 892)
+ knownVersion = false;
+ else {
+ roomFile.seek(352);
+ byte checkByte = roomFile.readByte();
+ if (checkByte == 0x00) {
+ // Full Windows version
+ } else if (checkByte == 0x80) {
+ // Wyrmkeep trial version
+ _extraGameFeatures = GF_WINDOWS_TRIAL;
+
+ GUI::MessageDialog trialMessage("This is a trial Windows version of the game. To play the full version, you will need to use the original interpreter and purchase a key from Wyrmkeep");
+ trialMessage.runModal();
+ } else {
+ knownVersion = false;
+ }
+
+ roomFile.close();
+
+ if (!knownVersion) {
+ warning("Unknown Windows version found, please report this version to the ScummVM team");
+ return Common::kNoGameDataFoundError;
+ }
+ }
+ }
+
+ go();
+
+ return Common::kNoError;
+}
+
+Common::String LabEngine::generateSaveFileName(uint slot) {
+ return Common::String::format("%s.%03u", _targetName.c_str(), slot);
+}
+
+void LabEngine::drawStaticMessage(byte index) {
+ _graphics->drawMessage(_resource->getStaticText((StaticText)index), false);
+}
+
+void LabEngine::changeVolume(int delta) {
+ warning("STUB: changeVolume()");
+}
+
+void LabEngine::waitTOF() {
+ _system->copyRectToScreen(_graphics->_displayBuffer, _graphics->_screenWidth, 0, 0, _graphics->_screenWidth, _graphics->_screenHeight);
+ _system->updateScreen();
+
+ _event->processInput();
+
+ uint32 now;
+
+ for (now = _system->getMillis(); now - _lastWaitTOFTicks <= 0xF; now = _system->getMillis() )
+ _system->delayMillis(_lastWaitTOFTicks - now + 17);
+
+ _lastWaitTOFTicks = now;
+}
+
+void LabEngine::updateMusicAndEvents() {
+ _event->processInput();
+ _event->updateMouse();
+ _music->updateMusic();
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/lab.h b/engines/lab/lab.h
new file mode 100644
index 0000000000..958f1596c8
--- /dev/null
+++ b/engines/lab/lab.h
@@ -0,0 +1,501 @@
+/* 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.
+ *
+ */
+
+ /*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#ifndef LAB_LAB_H
+#define LAB_LAB_H
+
+#include "common/system.h"
+#include "common/random.h"
+#include "common/rect.h"
+#include "common/savefile.h"
+#include "engines/engine.h"
+#include "engines/savestate.h"
+
+#include "lab/console.h"
+#include "lab/image.h"
+#include "lab/labsets.h"
+
+struct ADGameDescription;
+
+namespace Lab {
+
+struct MapData;
+struct Action;
+struct CloseData;
+struct Button;
+struct IntuiMessage;
+struct InventoryData;
+struct RoomData;
+struct Rule;
+struct TextFont;
+struct ViewData;
+
+class Anim;
+class DisplayMan;
+class EventManager;
+class Image;
+class Music;
+class Resource;
+class TilePuzzle;
+class Utils;
+
+struct SaveGameHeader {
+ byte _version;
+ SaveStateDescriptor _descr;
+ uint16 _roomNumber;
+ uint16 _direction;
+};
+
+enum GameFeatures {
+ GF_LOWRES = 1 << 0,
+ GF_WINDOWS_TRIAL = 1 << 1
+};
+
+typedef Common::List<Button *> ButtonList;
+
+struct CrumbData {
+ uint16 _roomNum;
+ uint16 _direction;
+};
+
+#define MAX_CRUMBS 128
+
+typedef CloseData *CloseDataPtr;
+typedef Common::List<Rule> RuleList;
+typedef Common::List<Action> ActionList;
+typedef Common::List<CloseData> CloseDataList;
+typedef Common::List<ViewData> ViewDataList;
+
+enum Direction {
+ kDirectionNorth,
+ kDirectionSouth,
+ kDirectionEast,
+ kDirectionWest
+};
+
+enum MainButton {
+ kButtonNone = -1,
+ kButtonPickup,
+ kButtonUse,
+ kButtonOpen,
+ kButtonClose,
+ kButtonLook,
+ kButtonInventory,
+ kButtonLeft,
+ kButtonForward,
+ kButtonRight,
+ kButtonMap
+};
+
+enum MessageClass {
+ kMessageLeftClick,
+ kMessageRightClick,
+ kMessageButtonUp,
+ kMessageRawKey
+};
+
+class LabEngine : public Engine {
+private:
+ bool _interfaceOff;
+ bool _isCrumbWaiting;
+ bool _lastTooLong;
+ bool _lastPage;
+ bool _mainDisplay;
+ bool _noUpdateDiff;
+ bool _quitLab;
+
+ byte *_blankJournal;
+
+ int _lastWaitTOFTicks;
+
+ uint16 _direction;
+ uint16 _highPalette[20];
+ uint16 _journalPage;
+ uint16 _maxRooms;
+ uint16 _monitorPage;
+ uint16 _monitorButtonHeight;
+
+ uint32 _extraGameFeatures;
+
+ Common::String _journalText;
+ Common::String _journalTextTitle;
+ Common::String _nextFileName;
+ Common::String _newFileName;
+ Common::String _monitorTextFilename;
+
+ CloseDataPtr _closeDataPtr;
+ ButtonList _journalButtonList;
+ ButtonList _mapButtonList;
+ Image *_imgMap, *_imgRoom, *_imgUpArrowRoom, *_imgDownArrowRoom, *_imgBridge;
+ Image *_imgHRoom, *_imgVRoom, *_imgMaze, *_imgHugeMaze, *_imgPath;
+ Image *_imgMapX[4];
+ InventoryData *_inventory;
+ MapData *_maps;
+ Image *_monitorButton;
+ Image *_journalBackImage;
+ TextFont *_journalFont;
+
+public:
+ bool _alternate;
+ bool _droppingCrumbs;
+ bool _followingCrumbs;
+ bool _followCrumbsFast;
+ bool _isCrumbTurning;
+ bool _isHiRes;
+
+ int _roomNum;
+
+ uint16 _highestCondition;
+ uint16 _manyRooms;
+ uint16 _numCrumbs;
+ uint16 _numInv;
+
+ uint32 _crumbTimestamp;
+
+ Common::String _curFileName;
+
+ Anim *_anim;
+ CrumbData _breadCrumbs[MAX_CRUMBS];
+ DisplayMan *_graphics;
+ EventManager *_event;
+ ButtonList _invButtonList;
+ ButtonList _moveButtonList;
+ Image *_invImages[10];
+ Image *_moveImages[20];
+ LargeSet *_conditions, *_roomsFound;
+ Music *_music;
+ Resource *_resource;
+ RoomData *_rooms;
+ TextFont *_msgFont;
+ TilePuzzle *_tilePuzzle;
+ Utils *_utils;
+ Console *_console;
+ GUI::Debugger *getDebugger() { return _console; }
+
+public:
+ LabEngine(OSystem *syst, const ADGameDescription *gameDesc);
+ ~LabEngine();
+
+ virtual Common::Error run();
+ void go();
+
+ const ADGameDescription *_gameDescription;
+ Common::Platform getPlatform() const;
+ uint32 getFeatures() const;
+
+ bool hasFeature(EngineFeature f) const;
+ Common::String generateSaveFileName(uint slot);
+
+ void changeVolume(int delta);
+ uint16 getDirection() { return _direction; }
+
+ /**
+ * Returns the current picture name.
+ */
+ Common::String getPictName(CloseDataPtr *closePtrList);
+ uint16 getQuarters();
+ void setDirection(uint16 direction) { _direction = direction; };
+ void setQuarters(uint16 quarters);
+ void updateMusicAndEvents();
+ void waitTOF();
+
+private:
+ /**
+ * Checks whether all the conditions in a condition list are met.
+ */
+ bool checkConditions(const Common::Array<int16> &cond);
+
+ /**
+ * Decrements the current inventory number.
+ */
+ void decIncInv(uint16 *CurInv, bool dec);
+
+ /**
+ * Processes the action list.
+ */
+ void doActions(const ActionList &actionList, CloseDataPtr *closePtrList);
+
+ /**
+ * Goes through the rules if an action is taken.
+ */
+ bool doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr *closePtrList);
+
+ /**
+ * Does the work for doActionRule.
+ */
+ bool doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults);
+
+ /**
+ * Checks whether the close up is one of the special case closeups.
+ */
+ bool doCloseUp(CloseDataPtr closePtr);
+
+ /**
+ * Goes through the rules if the user tries to go forward.
+ */
+ bool doGoForward(CloseDataPtr *closePtrList);
+
+ /**
+ * Does the journal processing.
+ */
+ void doJournal();
+
+ /**
+ * Goes through the rules if the user tries to go to the main view
+ */
+ bool doMainView(CloseDataPtr *closePtrList);
+
+ /**
+ * Does the map processing.
+ */
+ void doMap(uint16 curRoom);
+
+ /**
+ * Does what's necessary for the monitor.
+ */
+ void doMonitor(const Common::String background, const Common::String textfile, bool isinteractive, Common::Rect textRect);
+
+ /**
+ * Does the things to properly set up the detective notes.
+ */
+ void doNotes();
+
+ /**
+ * Does the work for doActionRule.
+ */
+ bool doOperateRuleSub(int16 itemNum, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults);
+
+ /**
+ * Goes through the rules if the user tries to operate an item on an object.
+ */
+ bool doOperateRule(Common::Point pos, int16 ItemNum, CloseDataPtr *closePtrList);
+
+ /**
+ * Goes through the rules if the user tries to turn.
+ */
+ bool doTurn(uint16 from, uint16 to, CloseDataPtr *closePtrList);
+
+ /**
+ * If the user hits the "Use" button; things that can get used on themselves.
+ */
+ bool doUse(uint16 curInv);
+
+ /**
+ * Does the things to properly set up the old west newspaper. Assumes that
+ * OpenHiRes already called.
+ */
+ void doWestPaper();
+
+ /**
+ * Draws the current direction to the screen.
+ */
+ void drawDirection(CloseDataPtr closePtr);
+
+ /**
+ * Draws the journal from page x.
+ */
+ void drawJournal(uint16 wipenum, bool needFade);
+
+ /**
+ * Draws the text to the back journal screen to the appropriate Page number
+ */
+ void drawJournalText();
+
+ /**
+ * Draws the map
+ */
+ void drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fadeIn);
+
+ /**
+ * Draws the text for the monitor.
+ */
+ void drawMonText(const char *text, TextFont *monitorFont, Common::Rect textRect, bool isinteractive);
+
+ /**
+ * Draws a room map.
+ */
+ void drawRoomMap(uint16 curRoom, bool drawMarkFl);
+
+ /**
+ * Draws the message for the room.
+ */
+ void drawRoomMessage(uint16 curInv, CloseDataPtr closePtr);
+ void drawStaticMessage(byte index);
+
+ /**
+ * Eats all the available messages.
+ */
+ void eatMessages();
+
+ /**
+ * Goes through the list of closeups to find a match.
+ * @note Known bug here. If there are two objects that have closeups, and
+ * some of the closeups have the same hit boxes, then this returns the first
+ * occurrence of the object with the same hit box.
+ */
+ CloseDataPtr findClosePtrMatch(CloseDataPtr closePtr, CloseDataList &list);
+
+ /**
+ * Checks if a floor has been visited.
+ */
+ bool floorVisited(uint16 floorNum);
+
+ /**
+ * New code to allow quick(er) return navigation in game.
+ */
+ MainButton followCrumbs();
+ void freeMapData();
+ void freeScreens();
+ bool processEvent(MessageClass tmpClass, uint16 code, uint16 qualifier, Common::Point tmpPos,
+ uint16 &curInv, IntuiMessage *curMsg, bool &forceDraw, uint16 buttonId, uint16 &actionMode);
+
+ /**
+ * Gets the current inventory name.
+ */
+ Common::String getInvName(uint16 curInv);
+
+ /**
+ * Returns the floor to show when the down arrow is pressed
+ * @note The original did not show all the visited floors, but we do
+ */
+ uint16 getLowerFloor(uint16 floorNum);
+
+ /**
+ * Gets an object, if any, from the user's click on the screen.
+ */
+ CloseData *getObject(Common::Point pos, CloseDataPtr closePtr);
+
+ /**
+ * Returns the floor to show when the up arrow is pressed
+ * @note The original did not show all the visited floors, but we do
+ */
+ uint16 getUpperFloor(uint16 floorNum);
+
+ /**
+ * Gets the current ViewDataPointer.
+ */
+ ViewData *getViewData(uint16 roomNum, uint16 direction);
+
+ /**
+ * Turns the interface off.
+ */
+ void interfaceOff();
+
+ /**
+ * Turns the interface on.
+ */
+ void interfaceOn();
+
+ /**
+ * Loads in the data for the journal.
+ */
+ void loadJournalData();
+
+ /**
+ * Loads in the map data.
+ */
+ void loadMapData();
+
+ /**
+ * The main game loop.
+ */
+ void mainGameLoop();
+ void showLab2Teaser();
+ void mayShowCrumbIndicator();
+ void mayShowCrumbIndicatorOff();
+
+ /**
+ * Permanently flips the imagery of a button.
+ */
+ void perFlipButton(uint16 buttonId);
+
+ /**
+ * process a arrow button movement.
+ */
+ uint16 processArrow(uint16 curDirection, uint16 arrow);
+
+ /**
+ * Processes user input.
+ */
+ void processJournal();
+
+ /**
+ * Processes the map.
+ */
+ void processMap(uint16 curRoom);
+
+ /**
+ * Processes user input.
+ */
+ void processMonitor(const char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect);
+
+ /**
+ * Figures out what a room's coordinates should be.
+ */
+ Common::Rect roomCoords(uint16 curRoom);
+ bool saveRestoreGame();
+
+ /**
+ * Sets the current close up data.
+ */
+ void setCurrentClose(Common::Point pos, CloseDataPtr *closePtrList, bool useAbsoluteCoords, bool next=false);
+
+ /**
+ * Takes the currently selected item.
+ */
+ bool takeItem(Common::Point pos, CloseDataPtr *closePtrList);
+
+ /**
+ * Does the turn page wipe.
+ */
+ void turnPage(bool fromLeft);
+ bool processKey(IntuiMessage *curMsg, uint32 msgClass, uint16 &qualifier, Common::Point &curPos, uint16 &curInv, bool &forceDraw, uint16 code);
+ void processMainButton(uint16 &curInv, uint16 &lastInv, uint16 &oldDirection, bool &forceDraw, uint16 buttonId, uint16 &actionMode);
+ void processAltButton(uint16 &curInv, uint16 &lastInv, uint16 buttonId, uint16 &actionMode);
+ void performAction(uint16 actionMode, Common::Point curPos, uint16 &curInv);
+
+private:
+ /**
+ * Writes the game out to disk.
+ */
+ bool saveGame(int slot, const Common::String desc);
+
+ /**
+ * Reads the game from disk.
+ */
+ bool loadGame(int slot);
+ void writeSaveGameHeader(Common::OutSaveFile *out, const Common::String &saveName);
+};
+
+bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header);
+
+} // End of namespace Lab
+
+#endif // LAB_LAB_H
diff --git a/engines/lab/labsets.cpp b/engines/lab/labsets.cpp
new file mode 100644
index 0000000000..3e84275fa4
--- /dev/null
+++ b/engines/lab/labsets.cpp
@@ -0,0 +1,77 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "common/file.h"
+
+#include "lab/lab.h"
+
+#include "lab/labsets.h"
+#include "lab/resource.h"
+
+namespace Lab {
+
+LargeSet::LargeSet(uint16 last, LabEngine *vm) : _vm(vm) {
+ last = (((last + 15) >> 4) << 4);
+
+ _array = new uint16[last >> 3];
+ memset(_array, 0, last >> 3);
+ _lastElement = last;
+}
+
+LargeSet::~LargeSet() {
+ delete[] _array;
+}
+
+bool LargeSet::in(uint16 element) {
+ return ((1 << ((element - 1) % 16)) & (_array[(element - 1) >> 4])) > 0;
+}
+
+void LargeSet::inclElement(uint16 element) {
+ _array[(element - 1) >> 4] |= 1 << ((element - 1) % 16);
+}
+
+void LargeSet::exclElement(uint16 element) {
+ _array[(element - 1) >> 4] &= ~(1 << ((element - 1) % 16));
+}
+
+bool LargeSet::readInitialConditions(const Common::String fileName) {
+ Common::File *file = _vm->_resource->openDataFile(fileName, MKTAG('C', 'O', 'N', '0'));
+
+ uint16 conditions = file->readUint16LE();
+ for (int i = 0; i < conditions; i++) {
+ inclElement(file->readUint16LE());
+ }
+
+ delete file;
+ return true;
+}
+
+
+} // End of namespace Lab
diff --git a/engines/lab/labsets.h b/engines/lab/labsets.h
new file mode 100644
index 0000000000..afd997e9eb
--- /dev/null
+++ b/engines/lab/labsets.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 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.
+ *
+ */
+
+ /*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#ifndef LAB_LABSETS_H
+#define LAB_LABSETS_H
+
+namespace Lab {
+
+//---------------------------
+//----- From LabSets.c ------
+//---------------------------
+
+class LabEngine;
+
+class LargeSet {
+public:
+ LargeSet(uint16 last, LabEngine *vm);
+ ~LargeSet();
+ bool in(uint16 element);
+ void inclElement(uint16 element);
+ void exclElement(uint16 element);
+ bool readInitialConditions(const Common::String fileName);
+
+private:
+ LabEngine *_vm;
+
+public:
+ uint16 _lastElement;
+ uint16 *_array;
+};
+
+} // End of namespace Lab
+
+#endif // LAB_LABSETS_H
diff --git a/engines/lab/map.cpp b/engines/lab/map.cpp
new file mode 100644
index 0000000000..21a0830913
--- /dev/null
+++ b/engines/lab/map.cpp
@@ -0,0 +1,564 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "lab/lab.h"
+
+#include "lab/dispman.h"
+#include "lab/eventman.h"
+#include "lab/image.h"
+#include "lab/labsets.h"
+#include "lab/music.h"
+#include "lab/processroom.h"
+#include "lab/resource.h"
+#include "lab/utils.h"
+
+namespace Lab {
+
+/*---------------------------------------------------------------------------*/
+/*------------------------------ The Map stuff ------------------------------*/
+/*---------------------------------------------------------------------------*/
+
+enum MapFloor {
+ kFloorNone,
+ kFloorLower,
+ kFloorMiddle,
+ kFloorUpper,
+ kFloorMedMaze,
+ kFloorHedgeMaze,
+ kFloorSurMaze,
+ kFloorCarnival
+};
+
+void LabEngine::loadMapData() {
+ Common::File *mapImages = _resource->openDataFile("P:MapImage");
+
+ _imgMap = new Image(mapImages, this);
+ _imgRoom = new Image(mapImages, this);
+ _imgUpArrowRoom = new Image(mapImages, this);
+ _imgDownArrowRoom = new Image(mapImages, this);
+ _imgHRoom = new Image(mapImages, this);
+ _imgVRoom = new Image(mapImages, this);
+ _imgMaze = new Image(mapImages, this);
+ _imgHugeMaze = new Image(mapImages, this);
+
+ _imgMapX[kDirectionNorth] = new Image(mapImages, this);
+ _imgMapX[kDirectionEast] = new Image(mapImages, this);
+ _imgMapX[kDirectionSouth] = new Image(mapImages, this);
+ _imgMapX[kDirectionWest] = new Image(mapImages, this);
+ _imgPath = new Image(mapImages, this);
+ _imgBridge = new Image(mapImages, this);
+
+ _mapButtonList.push_back(_event->createButton( 8, _utils->vgaScaleY(105), 0, Common::KEYCODE_ESCAPE, new Image(mapImages, this), new Image(mapImages, this))); // back
+ _mapButtonList.push_back(_event->createButton( 55, _utils->vgaScaleY(105), 1, Common::KEYCODE_UP, new Image(mapImages, this), new Image(mapImages, this))); // up
+ _mapButtonList.push_back(_event->createButton(101, _utils->vgaScaleY(105), 2, Common::KEYCODE_DOWN, new Image(mapImages, this), new Image(mapImages, this))); // down
+
+ delete mapImages;
+
+ Common::File *mapFile = _resource->openDataFile("Lab:Maps", MKTAG('M', 'A', 'P', '0'));
+ updateMusicAndEvents();
+ if (!_music->_loopSoundEffect)
+ _music->stopSoundEffect();
+
+ _maxRooms = mapFile->readUint16LE();
+ _maps = new MapData[_maxRooms + 1]; // will be freed when the user exits the map
+ for (int i = 1; i <= _maxRooms; i++) {
+ _maps[i]._x = mapFile->readUint16LE();
+ _maps[i]._y = mapFile->readUint16LE();
+ _maps[i]._pageNumber = mapFile->readUint16LE();
+ _maps[i]._specialID = mapFile->readUint16LE();
+ _maps[i]._mapFlags = mapFile->readUint32LE();
+ }
+
+ delete mapFile;
+}
+
+void LabEngine::freeMapData() {
+ _event->freeButtonList(&_mapButtonList);
+
+ delete _imgMap;
+ delete _imgRoom;
+ delete _imgUpArrowRoom;
+ delete _imgDownArrowRoom;
+ delete _imgBridge;
+ delete _imgHRoom;
+ delete _imgVRoom;
+ delete _imgMaze;
+ delete _imgHugeMaze;
+ delete _imgPath;
+ for (int i = 0; i < 4; i++)
+ delete _imgMapX[i];
+ delete[] _maps;
+
+ _imgMap = nullptr;
+ _imgRoom = nullptr;
+ _imgUpArrowRoom = nullptr;
+ _imgDownArrowRoom = nullptr;
+ _imgBridge = nullptr;
+ _imgHRoom = nullptr;
+ _imgVRoom = nullptr;
+ _imgMaze = nullptr;
+ _imgHugeMaze = nullptr;
+ _imgPath = nullptr;
+ for (int i = 0; i < 4; i++)
+ _imgMapX[i] = nullptr;
+ _maps = nullptr;
+}
+
+Common::Rect LabEngine::roomCoords(uint16 curRoom) {
+ Image *curRoomImg = nullptr;
+
+ switch (_maps[curRoom]._specialID) {
+ case NORMAL:
+ case UPARROWROOM:
+ case DOWNARROWROOM:
+ curRoomImg = _imgRoom;
+ break;
+ case BRIDGEROOM:
+ curRoomImg = _imgBridge;
+ break;
+ case VCORRIDOR:
+ curRoomImg = _imgVRoom;
+ break;
+ case HCORRIDOR:
+ curRoomImg = _imgHRoom;
+ break;
+ default:
+ // Some rooms (like the map) do not have an image
+ break;
+ }
+
+ int x1 = _utils->mapScaleX(_maps[curRoom]._x);
+ int y1 = _utils->mapScaleY(_maps[curRoom]._y);
+ int x2 = x1;
+ int y2 = y1;
+
+ if (curRoomImg) {
+ x2 += curRoomImg->_width;
+ y2 += curRoomImg->_height;
+ }
+
+ return Common::Rect(x1, y1, x2, y2);
+}
+
+void LabEngine::drawRoomMap(uint16 curRoom, bool drawMarkFl) {
+ uint16 drawX, drawY, offset;
+
+ uint16 x = _utils->mapScaleX(_maps[curRoom]._x);
+ uint16 y = _utils->mapScaleY(_maps[curRoom]._y);
+ uint32 flags = _maps[curRoom]._mapFlags;
+
+ switch (_maps[curRoom]._specialID) {
+ case NORMAL:
+ case UPARROWROOM:
+ case DOWNARROWROOM:
+ if (_maps[curRoom]._specialID == NORMAL)
+ _imgRoom->drawImage(x, y);
+ else if (_maps[curRoom]._specialID == DOWNARROWROOM)
+ _imgDownArrowRoom->drawImage(x, y);
+ else
+ _imgUpArrowRoom->drawImage(x, y);
+
+ offset = (_imgRoom->_width - _imgPath->_width) / 2;
+
+ if ((kDoorLeftNorth & flags) && (y >= _imgPath->_height))
+ _imgPath->drawImage(x + offset, y - _imgPath->_height);
+
+ if (kDoorLeftSouth & flags)
+ _imgPath->drawImage(x + offset, y + _imgRoom->_height);
+
+ offset = (_imgRoom->_height - _imgPath->_height) / 2;
+
+ if (kDoorLeftEast & flags)
+ _imgPath->drawImage(x + _imgRoom->_width, y + offset);
+
+ if (kDoorLeftWest & flags)
+ _imgPath->drawImage(x - _imgPath->_width, y + offset);
+
+ drawX = x + (_imgRoom->_width - _imgMapX[_direction]->_width) / 2;
+ drawY = y + (_imgRoom->_height - _imgMapX[_direction]->_height) / 2;
+
+ break;
+
+ case BRIDGEROOM:
+ _imgBridge->drawImage(x, y);
+
+ drawX = x + (_imgBridge->_width - _imgMapX[_direction]->_width) / 2;
+ drawY = y + (_imgBridge->_height - _imgMapX[_direction]->_height) / 2;
+
+ break;
+
+ case VCORRIDOR:
+ _imgVRoom->drawImage(x, y);
+
+ offset = (_imgVRoom->_width - _imgPath->_width) / 2;
+
+ if (kDoorLeftNorth & flags)
+ _imgPath->drawImage(x + offset, y - _imgPath->_height);
+
+ if (kDoorLeftSouth & flags)
+ _imgPath->drawImage(x + offset, y + _imgVRoom->_height);
+
+ offset = (_imgRoom->_height - _imgPath->_height) / 2;
+
+ if (kDoorLeftEast & flags)
+ _imgPath->drawImage(x + _imgVRoom->_width, y + offset);
+
+ if (kDoorLeftWest & flags)
+ _imgPath->drawImage(x - _imgPath->_width, y + offset);
+
+ if (kDoorBottomEast & flags)
+ _imgPath->drawImage(x + _imgVRoom->_width, y - offset - _imgPath->_height + _imgVRoom->_height);
+
+ if (kDoorBottomWest & flags)
+ _imgPath->drawImage(x - _imgPath->_width, y - offset - _imgPath->_height + _imgVRoom->_height);
+
+ offset = (_imgVRoom->_height - _imgPath->_height) / 2;
+
+ if (kDoorMiddleEast & flags)
+ _imgPath->drawImage(x + _imgVRoom->_width, y - offset - _imgPath->_height + _imgVRoom->_height);
+
+ if (kDoorMiddleWest & flags)
+ _imgPath->drawImage(x - _imgPath->_width, y - offset - _imgPath->_height + _imgVRoom->_height);
+
+ drawX = x + (_imgVRoom->_width - _imgMapX[_direction]->_width) / 2;
+ drawY = y + (_imgVRoom->_height - _imgMapX[_direction]->_height) / 2;
+
+ break;
+
+ case HCORRIDOR:
+ _imgHRoom->drawImage(x, y);
+
+ offset = (_imgRoom->_width - _imgPath->_width) / 2;
+
+ if (kDoorLeftNorth & flags)
+ _imgPath->drawImage(x + offset, y - _imgPath->_height);
+
+ if (kDoorLeftSouth & flags)
+ _imgPath->drawImage(x + offset, y + _imgRoom->_height);
+
+ if (kDoorRightNorth & flags)
+ _imgPath->drawImage(x - offset - _imgPath->_width + _imgHRoom->_width, y - _imgPath->_height);
+
+ if (kDoorRightSouth & flags)
+ _imgPath->drawImage(x - offset - _imgPath->_width + _imgHRoom->_width, y + _imgRoom->_height);
+
+ offset = (_imgHRoom->_width - _imgPath->_width) / 2;
+
+ if (kDoorMiddleNorth & flags)
+ _imgPath->drawImage(x - offset - _imgPath->_width + _imgHRoom->_width, y - _imgPath->_height);
+
+ if (kDoorMiddleSouth & flags)
+ _imgPath->drawImage(x - offset - _imgPath->_width + _imgHRoom->_width, y + _imgRoom->_height);
+
+ offset = (_imgRoom->_height - _imgPath->_height) / 2;
+
+ if (kDoorLeftEast & flags)
+ _imgPath->drawImage(x + _imgHRoom->_width, y + offset);
+
+ if (kDoorLeftWest & flags)
+ _imgPath->drawImage(x - _imgPath->_width, y + offset);
+
+ drawX = x + (_imgHRoom->_width - _imgMapX[_direction]->_width) / 2;
+ drawY = y + (_imgHRoom->_height - _imgMapX[_direction]->_height) / 2;
+
+ break;
+
+ default:
+ return;
+ }
+
+ if (drawMarkFl)
+ _imgMapX[_direction]->drawImage(drawX, drawY);
+}
+
+bool LabEngine::floorVisited(uint16 floorNum) {
+ for (int i = 0; i < _maxRooms; i++) {
+ if ((_maps[i]._pageNumber == floorNum) && _roomsFound->in(i) && _maps[i]._x)
+ return true;
+ }
+
+ return false;
+}
+
+uint16 LabEngine::getUpperFloor(uint16 floorNum) {
+ if ((floorNum == kFloorCarnival) || (floorNum == kFloorNone))
+ return kFloorNone;
+
+ for (int i = floorNum; i < kFloorCarnival; i++)
+ if (floorVisited(i + 1))
+ return i + 1;
+
+ return kFloorNone;
+}
+
+uint16 LabEngine::getLowerFloor(uint16 floorNum) {
+ if ((floorNum == kFloorLower) || (floorNum == kFloorNone))
+ return kFloorNone;
+
+ for (int i = floorNum; i > kFloorLower; i--)
+ if (floorVisited(i - 1))
+ return i - 1;
+
+ return kFloorNone;
+}
+
+void LabEngine::drawMap(uint16 curRoom, uint16 curMsg, uint16 floorNum, bool fadeIn) {
+ _event->mouseHide();
+
+ _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
+ _imgMap->drawImage(0, 0);
+ _event->drawButtonList(&_mapButtonList);
+
+ for (int i = 1; i <= _maxRooms; i++) {
+ if ((_maps[i]._pageNumber == floorNum) && _roomsFound->in(i) && _maps[i]._x) {
+ drawRoomMap(i, (bool)(i == curRoom));
+ updateMusicAndEvents();
+ }
+ }
+
+ // Makes sure the X is drawn in corridors
+ // NOTE: this here on purpose just in case there's some weird
+ // condition, like the surreal maze where there are no rooms
+ if ((_maps[curRoom]._pageNumber == floorNum) && _roomsFound->in(curRoom) && _maps[curRoom]._x)
+ drawRoomMap(curRoom, true);
+
+ _event->toggleButton(_event->getButton(1), 12, (getUpperFloor(floorNum) != kFloorNone)); // up button
+ _event->toggleButton(_event->getButton(2), 12, (getLowerFloor(floorNum) != kFloorNone)); // down button
+
+ // Labyrinth specific code
+ if (floorNum == kFloorLower) {
+ if (floorVisited(kFloorSurMaze))
+ _imgMaze->drawImage(_utils->mapScaleX(538), _utils->mapScaleY(277));
+ } else if (floorNum == kFloorMiddle) {
+ if (floorVisited(kFloorCarnival))
+ _imgMaze->drawImage(_utils->mapScaleX(358), _utils->mapScaleY(72));
+
+ if (floorVisited(kFloorMedMaze))
+ _imgMaze->drawImage(_utils->mapScaleX(557), _utils->mapScaleY(325));
+ } else if (floorNum == kFloorUpper) {
+ if (floorVisited(kFloorHedgeMaze))
+ _imgHugeMaze->drawImage(_utils->mapScaleX(524), _utils->mapScaleY(97));
+ } else if (floorNum == kFloorSurMaze) {
+ Common::Rect textRect = Common::Rect(_utils->mapScaleX(360), 0, _utils->mapScaleX(660), _utils->mapScaleY(450));
+ const char *textPtr = _resource->getStaticText(kTextSurmazeMessage).c_str();
+ _graphics->flowText(_msgFont, 0, 7, 0, true, true, true, true, textRect, textPtr);
+ }
+
+ if ((floorNum >= kFloorLower) && (floorNum <= kFloorCarnival)) {
+ const char *textPrt = _resource->getStaticText(floorNum - 1).c_str();
+ _graphics->flowText(_msgFont, 0, 5, 3, true, true, true, true, _utils->vgaRectScale(14, 75, 134, 97), textPrt);
+ }
+
+ if (!_rooms[curMsg]._roomMsg.empty())
+ _graphics->flowText(_msgFont, 0, 5, 3, true, true, true, true, _utils->vgaRectScale(14, 148, 134, 186), _rooms[curMsg]._roomMsg.c_str());
+
+ if (fadeIn)
+ _graphics->fade(true);
+
+ _event->mouseShow();
+}
+
+void LabEngine::processMap(uint16 curRoom) {
+ byte place = 1;
+ uint16 curMsg = curRoom;
+ uint16 curFloor = _maps[curRoom]._pageNumber;
+
+ while (1) {
+ // Make sure we check the music at least after every message
+ updateMusicAndEvents();
+ IntuiMessage *msg = _event->getMsg();
+ if (shouldQuit()) {
+ _quitLab = true;
+ return;
+ }
+
+ if (!msg) {
+ updateMusicAndEvents();
+
+ byte newcolor[3];
+
+ if (place <= 14) {
+ newcolor[0] = 14 << 2;
+ newcolor[1] = place << 2;
+ newcolor[2] = newcolor[1];
+ } else {
+ newcolor[0] = 14 << 2;
+ newcolor[1] = (28 - place) << 2;
+ newcolor[2] = newcolor[1];
+ }
+
+ waitTOF();
+ _graphics->writeColorRegs(newcolor, 1, 1);
+ _event->updateMouse();
+ waitTOF();
+
+ place++;
+
+ if (place >= 28)
+ place = 1;
+
+ } else {
+ uint32 msgClass = msg->_msgClass;
+ uint16 msgCode = msg->_code;
+ uint16 mouseX = msg->_mouse.x;
+ uint16 mouseY = msg->_mouse.y;
+
+ if ((msgClass == kMessageRightClick) || ((msgClass == kMessageRawKey) && (msgCode == Common::KEYCODE_ESCAPE)))
+ return;
+
+ if (msgClass == kMessageButtonUp) {
+ if (msgCode == 0) {
+ // Quit menu button
+ return;
+ } else if (msgCode == 1) {
+ // Up arrow
+ uint16 upperFloor = getUpperFloor(curFloor);
+ if (upperFloor != kFloorNone) {
+ curFloor = upperFloor;
+ _graphics->fade(false);
+ drawMap(curRoom, curMsg, curFloor, false);
+ _graphics->fade(true);
+ }
+ } else if (msgCode == 2) {
+ // Down arrow
+ uint16 lowerFloor = getLowerFloor(curFloor);
+ if (lowerFloor != kFloorNone) {
+ curFloor = lowerFloor;
+ _graphics->fade(false);
+ drawMap(curRoom, curMsg, curFloor, false);
+ _graphics->fade(true);
+ }
+ }
+ } else if (msgClass == kMessageLeftClick) {
+ if ((curFloor == kFloorLower) && _utils->mapRectScale(538, 277, 633, 352).contains(mouseX, mouseY)
+ && floorVisited(kFloorSurMaze)) {
+ curFloor = kFloorSurMaze;
+
+ _graphics->fade(false);
+ drawMap(curRoom, curMsg, curFloor, false);
+ _graphics->fade(true);
+ } else if ((curFloor == kFloorMiddle) && _utils->mapRectScale(358, 71, 452, 147).contains(mouseX, mouseY)
+ && floorVisited(kFloorCarnival)) {
+ curFloor = kFloorCarnival;
+
+ _graphics->fade(false);
+ drawMap(curRoom, curMsg, curFloor, false);
+ _graphics->fade(true);
+ } else if ((curFloor == kFloorMiddle) && _utils->mapRectScale(557, 325, 653, 401).contains(mouseX, mouseY)
+ && floorVisited(kFloorMedMaze)) {
+ curFloor = kFloorMedMaze;
+
+ _graphics->fade(false);
+ drawMap(curRoom, curMsg, curFloor, false);
+ _graphics->fade(true);
+ } else if ((curFloor == kFloorUpper) && _utils->mapRectScale(524, 97, 645, 207).contains(mouseX, mouseY)
+ && floorVisited(kFloorHedgeMaze)) {
+ curFloor = kFloorHedgeMaze;
+
+ _graphics->fade(false);
+ drawMap(curRoom, curMsg, curFloor, false);
+ _graphics->fade(true);
+ } else if (mouseX > _utils->mapScaleX(314)) {
+ uint16 oldMsg = curMsg;
+ Common::Rect curCoords;
+
+ for (int i = 1; i <= _maxRooms; i++) {
+ curCoords = roomCoords(i);
+
+ if ((_maps[i]._pageNumber == curFloor)
+ && _roomsFound->in(i) && curCoords.contains(Common::Point(mouseX, mouseY))) {
+ curMsg = i;
+ }
+ }
+
+ if (oldMsg != curMsg) {
+ if (!_rooms[curMsg]._roomMsg.empty())
+ _resource->readViews(curMsg);
+
+ const char *sptr;
+ if ((sptr = _rooms[curMsg]._roomMsg.c_str())) {
+ _event->mouseHide();
+ _graphics->rectFillScaled(13, 148, 135, 186, 3);
+ _graphics->flowText(_msgFont, 0, 5, 3, true, true, true, true, _utils->vgaRectScale(14, 148, 134, 186), sptr);
+
+ if (_maps[oldMsg]._pageNumber == curFloor)
+ drawRoomMap(oldMsg, (bool)(oldMsg == curRoom));
+
+ curCoords = roomCoords(curMsg);
+ int right = (curCoords.left + curCoords.right) / 2;
+ int left = right - 1;
+ int top, bottom;
+ top = bottom = (curCoords.top + curCoords.bottom) / 2;
+
+ if ((curMsg != curRoom) && (_maps[curMsg]._pageNumber == curFloor)) {
+ _graphics->rectFill(left, top, right, bottom, 1);
+ }
+
+ _event->mouseShow();
+ }
+ }
+ }
+ }
+
+ _graphics->screenUpdate();
+ }
+ }
+}
+
+void LabEngine::doMap(uint16 curRoom) {
+ static uint16 amigaMapPalette[] = {
+ 0x0BA8, 0x0C11, 0x0A74, 0x0076,
+ 0x0A96, 0x0DCB, 0x0CCA, 0x0222,
+ 0x0444, 0x0555, 0x0777, 0x0999,
+ 0x0AAA, 0x0ED0, 0x0EEE, 0x0694
+ };
+
+ _graphics->_fadePalette = amigaMapPalette;
+
+ updateMusicAndEvents();
+ loadMapData();
+ _graphics->blackAllScreen();
+ _event->attachButtonList(&_mapButtonList);
+ drawMap(curRoom, curRoom, _maps[curRoom]._pageNumber, true);
+ _event->mouseShow();
+ _graphics->screenUpdate();
+ processMap(curRoom);
+ _event->attachButtonList(nullptr);
+ _graphics->fade(false);
+ _graphics->blackAllScreen();
+ _event->mouseHide();
+ _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
+ freeMapData();
+ _graphics->blackAllScreen();
+ _event->mouseShow();
+ _graphics->screenUpdate();
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/module.mk b/engines/lab/module.mk
new file mode 100644
index 0000000000..a619cba6ed
--- /dev/null
+++ b/engines/lab/module.mk
@@ -0,0 +1,30 @@
+MODULE := engines/lab
+
+MODULE_OBJS := \
+ anim.o \
+ console.o \
+ detection.o \
+ dispman.o \
+ engine.o \
+ eventman.o \
+ image.o \
+ interface.o \
+ intro.o \
+ lab.o \
+ labsets.o \
+ map.o \
+ music.o \
+ processroom.o \
+ resource.o \
+ savegame.o \
+ special.o \
+ tilepuzzle.o \
+ utils.o
+
+# This module can be built as a plugin
+ifeq ($(ENABLE_LAB), DYNAMIC_PLUGIN)
+PLUGIN := 1
+endif
+
+# Include common rules
+include $(srcdir)/rules.mk
diff --git a/engines/lab/music.cpp b/engines/lab/music.cpp
new file mode 100644
index 0000000000..95581aec5c
--- /dev/null
+++ b/engines/lab/music.cpp
@@ -0,0 +1,336 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "audio/decoders/raw.h"
+
+#include "lab/lab.h"
+
+#include "lab/anim.h"
+#include "lab/eventman.h"
+#include "lab/music.h"
+#include "lab/resource.h"
+
+namespace Lab {
+
+#define MUSICBUFSIZE (2 * 65536)
+#define SAMPLESPEED 15000
+
+#define CLOWNROOM 123
+#define DIMROOM 80
+
+Music::Music(LabEngine *vm) : _vm(vm) {
+ _file = 0;
+ _tFile = 0;
+ _musicPaused = false;
+
+ _oldMusicOn = false;
+ _tLeftInFile = 0;
+
+ _leftInFile = 0;
+
+ _musicOn = false;
+ _loopSoundEffect = false;
+ _queuingAudioStream = nullptr;
+ _lastMusicRoom = 1;
+ _doReset = true;
+}
+
+void Music::updateMusic() {
+ if (!_musicOn || (getPlayingBufferCount() >= MAXBUFFERS))
+ return;
+
+ // NOTE: We need to use malloc(), cause this will be freed with free()
+ // by the music code
+ byte *musicBuffer = (byte *)malloc(MUSICBUFSIZE);
+ fillbuffer(musicBuffer);
+
+ // Queue a music block, and start the music, if needed
+ bool startMusicFlag = false;
+
+ if (!_queuingAudioStream) {
+ _queuingAudioStream = Audio::makeQueuingAudioStream(SAMPLESPEED, false);
+ startMusicFlag = true;
+ }
+
+ byte soundFlags = Audio::FLAG_LITTLE_ENDIAN;
+ if (_vm->getPlatform() == Common::kPlatformWindows)
+ soundFlags |= Audio::FLAG_16BITS;
+ else if (_vm->getPlatform() == Common::kPlatformDOS)
+ soundFlags |= Audio::FLAG_UNSIGNED;
+
+ _queuingAudioStream->queueBuffer(musicBuffer, MUSICBUFSIZE, DisposeAfterUse::YES, soundFlags);
+
+ if (startMusicFlag)
+ _vm->_mixer->playStream(Audio::Mixer::kMusicSoundType, &_musicHandle, _queuingAudioStream);
+}
+
+uint16 Music::getPlayingBufferCount() {
+ return (_queuingAudioStream) ? _queuingAudioStream->numQueuedStreams() : 0;
+}
+
+void Music::playSoundEffect(uint16 sampleSpeed, uint32 length, Common::File *dataFile) {
+ pauseBackMusic();
+ stopSoundEffect();
+
+ if (sampleSpeed < 4000)
+ sampleSpeed = 4000;
+
+ byte soundFlags = Audio::FLAG_LITTLE_ENDIAN;
+ if (_vm->getPlatform() == Common::kPlatformWindows)
+ soundFlags |= Audio::FLAG_16BITS;
+ else
+ soundFlags |= Audio::FLAG_UNSIGNED;
+
+ // NOTE: We need to use malloc(), cause this will be freed with free()
+ // by the music code
+ byte *soundData = (byte *)malloc(length);
+ dataFile->read(soundData, length);
+
+ Audio::SeekableAudioStream *audioStream = Audio::makeRawStream((const byte *)soundData, length, sampleSpeed, soundFlags);
+ uint loops = (_loopSoundEffect) ? 0 : 1;
+ Audio::LoopingAudioStream *loopingAudioStream = new Audio::LoopingAudioStream(audioStream, loops);
+ _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_sfxHandle, loopingAudioStream);
+}
+
+void Music::stopSoundEffect() {
+ if (isSoundEffectActive())
+ _vm->_mixer->stopHandle(_sfxHandle);
+}
+
+bool Music::isSoundEffectActive() const {
+ return _vm->_mixer->isSoundHandleActive(_sfxHandle);
+}
+
+void Music::fillbuffer(byte *musicBuffer) {
+ if (MUSICBUFSIZE < _leftInFile) {
+ _file->read(musicBuffer, MUSICBUFSIZE);
+ _leftInFile -= MUSICBUFSIZE;
+ } else {
+ _file->read(musicBuffer, _leftInFile);
+
+ memset((char *)musicBuffer + _leftInFile, 0, MUSICBUFSIZE - _leftInFile);
+
+ _file->seek(0);
+ _leftInFile = _file->size();
+ }
+}
+
+void Music::startMusic(bool restartFl) {
+ if (!_musicOn)
+ return;
+
+ stopSoundEffect();
+
+ if (restartFl) {
+ _file->seek(0);
+ _leftInFile = _file->size();
+ }
+
+ _musicOn = true;
+ _vm->updateMusicAndEvents();
+}
+
+bool Music::initMusic(const Common::String filename) {
+ _musicOn = true;
+ _musicPaused = false;
+ _file = _vm->_resource->openDataFile(filename);
+ startMusic(true);
+ return true;
+}
+
+void Music::freeMusic() {
+ _musicOn = false;
+
+ _vm->_mixer->stopHandle(_musicHandle);
+ _queuingAudioStream = nullptr;
+ _vm->_mixer->stopHandle(_sfxHandle);
+
+ delete _file;
+ _file = nullptr;
+}
+
+void Music::pauseBackMusic() {
+ if (!_musicPaused && _musicOn) {
+ _vm->updateMusicAndEvents();
+ _musicOn = false;
+ stopSoundEffect();
+
+ _vm->_mixer->pauseHandle(_musicHandle, true);
+
+ _musicPaused = true;
+ }
+}
+
+void Music::resumeBackMusic() {
+ if (_musicPaused) {
+ stopSoundEffect();
+ _musicOn = true;
+
+ _vm->_mixer->pauseHandle(_musicHandle, false);
+
+ _vm->updateMusicAndEvents();
+ _musicPaused = false;
+ }
+}
+
+void Music::setMusic(bool on) {
+ stopSoundEffect();
+
+ if (on && !_musicOn) {
+ _musicOn = true;
+ startMusic(true);
+ } else if (!on && _musicOn) {
+ _musicOn = false;
+ _vm->updateMusicAndEvents();
+ } else
+ _musicOn = on;
+}
+
+void Music::checkRoomMusic() {
+ if ((_lastMusicRoom == _vm->_roomNum) || !_musicOn)
+ return;
+
+ if (_vm->_roomNum == CLOWNROOM)
+ changeMusic("Music:Laugh");
+ else if (_vm->_roomNum == DIMROOM)
+ changeMusic("Music:Rm81");
+ else if (_doReset)
+ resetMusic();
+
+ _lastMusicRoom = _vm->_roomNum;
+}
+
+void Music::changeMusic(const Common::String filename) {
+ if (!_tFile) {
+ _tFile = _file;
+ _oldMusicOn = _musicOn;
+ _tLeftInFile = _leftInFile + 65536;
+
+ if (_tLeftInFile > (uint32)_tFile->size())
+ _tLeftInFile = _leftInFile;
+ }
+
+ _file = _vm->_resource->openDataFile(filename);
+ // turn music off
+ _musicOn = true;
+ setMusic(false);
+
+ // turn it back on
+ _musicOn = false;
+ setMusic(true);
+}
+
+void Music::resetMusic() {
+ if (!_tFile)
+ return;
+
+ if (_file->isOpen())
+ _file->close();
+
+ _file = _tFile;
+ _leftInFile = _tLeftInFile;
+
+ _file->seek(_file->size() - _leftInFile);
+
+ _musicOn = true;
+ setMusic(false);
+ _vm->updateMusicAndEvents();
+
+ if (!_oldMusicOn) {
+ _tFile = 0;
+ return;
+ }
+
+ _musicOn = _oldMusicOn;
+ startMusic(false);
+
+ _tFile = 0;
+}
+
+bool Music::readMusic(const Common::String filename, bool waitTillFinished) {
+ Common::File *file = _vm->_resource->openDataFile(filename, MKTAG('D', 'I', 'F', 'F'));
+ _vm->updateMusicAndEvents();
+ if (!_loopSoundEffect)
+ stopSoundEffect();
+
+ if (!file)
+ return false;
+
+ _vm->_anim->_doBlack = false;
+ readSound(waitTillFinished, file);
+
+ return true;
+}
+
+void Music::readSound(bool waitTillFinished, Common::File *file) {
+ uint32 magicBytes = file->readUint32LE();
+ if (magicBytes != 1219009121) {
+ warning("readSound: Bad signature, skipping");
+ return;
+ }
+ uint32 soundTag = file->readUint32LE();
+ uint32 soundSize = file->readUint32LE();
+
+ if (soundTag == 0)
+ file->skip(soundSize); // skip the header
+ else
+ return;
+
+ while (soundTag != 65535) {
+ _vm->updateMusicAndEvents();
+ soundTag = file->readUint32LE();
+ soundSize = file->readUint32LE() - 8;
+
+ if ((soundTag == 30) || (soundTag == 31)) {
+ if (waitTillFinished) {
+ while (isSoundEffectActive()) {
+ _vm->updateMusicAndEvents();
+ _vm->waitTOF();
+ }
+ }
+
+ file->skip(4);
+
+ uint16 sampleRate = file->readUint16LE();
+ file->skip(2);
+ playSoundEffect(sampleRate, soundSize, file);
+ } else if (soundTag == 65535) {
+ if (waitTillFinished) {
+ while (isSoundEffectActive()) {
+ _vm->updateMusicAndEvents();
+ _vm->waitTOF();
+ }
+ }
+ } else
+ file->skip(soundSize);
+ }
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/music.h b/engines/lab/music.h
new file mode 100644
index 0000000000..42fdf41d67
--- /dev/null
+++ b/engines/lab/music.h
@@ -0,0 +1,143 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#ifndef LAB_MUSIC_H
+#define LAB_MUSIC_H
+
+#include "common/file.h"
+#include "audio/mixer.h"
+#include "audio/audiostream.h"
+
+namespace Lab {
+
+class LabEngine;
+
+//---------------------------
+//----- From LabMusic.c -----
+//---------------------------
+
+#define MAXBUFFERS 5
+
+class Music {
+private:
+ LabEngine *_vm;
+
+ Common::File *_file;
+ Common::File *_tFile;
+
+ bool _doReset;
+ bool _musicOn;
+ bool _musicPaused;
+ bool _oldMusicOn;
+
+ uint16 _lastMusicRoom ;
+
+ uint32 _tLeftInFile;
+ uint32 _leftInFile;
+
+ Audio::SoundHandle _musicHandle;
+ Audio::SoundHandle _sfxHandle;
+ Audio::QueuingAudioStream *_queuingAudioStream;
+
+private:
+ void fillbuffer(byte *musicBuffer);
+ uint16 getPlayingBufferCount();
+
+ /**
+ * Pauses the background music.
+ */
+ void pauseBackMusic();
+ void readSound(bool waitTillFinished, Common::File *file);
+
+ /**
+ * Starts up the music initially.
+ */
+ void startMusic(bool restartFl);
+
+public:
+ bool _loopSoundEffect;
+
+public:
+ Music(LabEngine *vm);
+
+ /**
+ * Changes the background music to something else.
+ */
+ void changeMusic(const Common::String filename);
+
+ /**
+ * Checks the music that should be playing in a particular room.
+ */
+ void checkRoomMusic();
+
+ /**
+ * Frees up the music buffers and closes the file.
+ */
+ void freeMusic();
+
+ /**
+ * Initializes the music buffers.
+ */
+ bool initMusic(const Common::String filename);
+ bool isSoundEffectActive() const;
+ void playSoundEffect(uint16 sampleSpeed, uint32 length, Common::File *dataFile);
+
+ /**
+ * Reads in a music file. Ignores any graphics.
+ */
+ bool readMusic(const Common::String filename, bool waitTillFinished);
+
+ /**
+ * Changes the background music to the original piece playing.
+ */
+ void resetMusic();
+
+ /**
+ * Resumes the paused background music.
+ */
+ void resumeBackMusic();
+
+ /**
+ * Turns the music on and off.
+ */
+ void setMusic(bool on);
+ void setMusicReset(bool reset) { _doReset = reset; }
+ void stopSoundEffect();
+
+ /**
+ * Figures out which buffer is currently playing based on messages sent to
+ * it from the Audio device.
+ */
+ void updateMusic();
+};
+
+} // End of namespace Lab
+
+#endif // LAB_MUSIC_H
diff --git a/engines/lab/processroom.cpp b/engines/lab/processroom.cpp
new file mode 100644
index 0000000000..4d42f96b50
--- /dev/null
+++ b/engines/lab/processroom.cpp
@@ -0,0 +1,640 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "gui/message.h"
+
+#include "lab/lab.h"
+
+#include "lab/anim.h"
+#include "lab/dispman.h"
+#include "lab/labsets.h"
+#include "lab/music.h"
+#include "lab/processroom.h"
+#include "lab/resource.h"
+#include "lab/utils.h"
+
+namespace Lab {
+
+#define NOFILE "no file"
+
+bool LabEngine::checkConditions(const Common::Array<int16> &condition) {
+ for (unsigned int i = 0; i < condition.size(); ++i)
+ if (!_conditions->in(condition[i]))
+ return false;
+
+ return true;
+}
+
+ViewData *LabEngine::getViewData(uint16 roomNum, uint16 direction) {
+ if (_rooms[roomNum]._roomMsg.empty())
+ _resource->readViews(roomNum);
+
+ ViewDataList &views = _rooms[roomNum]._view[direction];
+ ViewDataList::iterator view;
+
+ for (view = views.begin(); view != views.end(); ++view) {
+ if (checkConditions(view->_condition))
+ return &(*view);
+ }
+
+ error("No view with matching condition found");
+}
+
+CloseData *LabEngine::getObject(Common::Point pos, CloseDataPtr closePtr) {
+ CloseDataList *list;
+ if (!closePtr)
+ list = &(getViewData(_roomNum, _direction)->_closeUps);
+ else
+ list = &(closePtr->_subCloseUps);
+
+ CloseDataList::iterator wrkClosePtr;
+
+ for (wrkClosePtr = list->begin(); wrkClosePtr != list->end(); ++wrkClosePtr) {
+ Common::Rect objRect;
+ objRect = _utils->rectScale(wrkClosePtr->_x1, wrkClosePtr->_y1, wrkClosePtr->_x2, wrkClosePtr->_y2);
+ if (objRect.contains(pos))
+ return &(*wrkClosePtr);
+ }
+
+ return nullptr;
+}
+
+CloseDataPtr LabEngine::findClosePtrMatch(CloseDataPtr closePtr, CloseDataList &list) {
+ CloseDataList::iterator i;
+
+ for (i = list.begin(); i != list.end(); ++i) {
+ if ((closePtr->_x1 == i->_x1) && (closePtr->_x2 == i->_x2) &&
+ (closePtr->_y1 == i->_y1) && (closePtr->_y2 == i->_y2) &&
+ (closePtr->_depth == i->_depth))
+ return &(*i);
+
+ CloseDataPtr resClosePtr = findClosePtrMatch(closePtr, i->_subCloseUps);
+
+ if (resClosePtr)
+ return resClosePtr;
+ }
+
+ return nullptr;
+}
+
+Common::String LabEngine::getPictName(CloseDataPtr *closePtrList) {
+ ViewData *viewPtr = getViewData(_roomNum, _direction);
+
+ if (*closePtrList) {
+ *closePtrList = findClosePtrMatch(*closePtrList, viewPtr->_closeUps);
+
+ if (*closePtrList)
+ return (*closePtrList)->_graphicName;
+ }
+
+ return viewPtr->_graphicName;
+}
+
+void LabEngine::drawDirection(CloseDataPtr closePtr) {
+ if (closePtr && !closePtr->_message.empty()) {
+ _graphics->drawMessage(closePtr->_message, false);
+ return;
+ }
+
+ Common::String message;
+
+ if (!_rooms[_roomNum]._roomMsg.empty())
+ message = _rooms[_roomNum]._roomMsg + ", ";
+
+ if (_direction == kDirectionNorth)
+ message += _resource->getStaticText(kTextFacingNorth);
+ else if (_direction == kDirectionEast)
+ message += _resource->getStaticText(kTextFacingEast);
+ else if (_direction == kDirectionSouth)
+ message += _resource->getStaticText(kTextFacingSouth);
+ else if (_direction == kDirectionWest)
+ message += _resource->getStaticText(kTextFacingWest);
+
+ _graphics->drawMessage(message, false);
+}
+
+uint16 LabEngine::processArrow(uint16 curDirection, uint16 arrow) {
+ if (arrow == 1) { // Forward
+ uint16 room = _rooms[_roomNum]._doors[curDirection];
+ if (room != 0)
+ _roomNum = room;
+
+ return curDirection;
+ } else if (arrow == 0) { // Left
+ if (curDirection == kDirectionNorth)
+ return kDirectionWest;
+ else if (curDirection == kDirectionWest)
+ return kDirectionSouth;
+ else if (curDirection == kDirectionSouth)
+ return kDirectionEast;
+ else
+ return kDirectionNorth;
+ } else if (arrow == 2) { // Right
+ if (curDirection == kDirectionNorth)
+ return kDirectionEast;
+ else if (curDirection == kDirectionEast)
+ return kDirectionSouth;
+ else if (curDirection == kDirectionSouth)
+ return kDirectionWest;
+ else
+ return kDirectionNorth;
+ }
+
+ // Should never reach here!
+ return curDirection;
+}
+
+void LabEngine::setCurrentClose(Common::Point pos, CloseDataPtr *closePtrList, bool useAbsoluteCoords, bool next) {
+ CloseDataList *list;
+
+ if (!*closePtrList)
+ list = &(getViewData(_roomNum, _direction)->_closeUps);
+ else
+ list = &((*closePtrList)->_subCloseUps);
+
+ CloseDataList::iterator closePtr;
+ for (closePtr = list->begin(); closePtr != list->end(); ++closePtr) {
+ Common::Rect target;
+ if (!useAbsoluteCoords)
+ target = Common::Rect(closePtr->_x1, closePtr->_y1, closePtr->_x2, closePtr->_y2);
+ else
+ target = _utils->rectScale(closePtr->_x1, closePtr->_y1, closePtr->_x2, closePtr->_y2);
+
+ if (target.contains(pos) && (next || !closePtr->_graphicName.empty())) {
+
+ if (next) {
+ // cycle to the next one
+ ++closePtr;
+ if (closePtr == list->end())
+ closePtr = list->begin();
+ }
+ *closePtrList = &(*closePtr);
+
+ return;
+ }
+ }
+
+ // If we got here, no match was found. If we want the "next" close-up,
+ // return the first one in the list, if any.
+ if (next) {
+ if (!list->empty())
+ *closePtrList = &(*list->begin());
+ }
+}
+
+bool LabEngine::takeItem(Common::Point pos, CloseDataPtr *closePtrList) {
+ CloseDataList *list;
+ if (!*closePtrList) {
+ list = &(getViewData(_roomNum, _direction)->_closeUps);
+ } else if ((*closePtrList)->_closeUpType < 0) {
+ _conditions->inclElement(abs((*closePtrList)->_closeUpType));
+ return true;
+ } else
+ list = &((*closePtrList)->_subCloseUps);
+
+ CloseDataList::iterator closePtr;
+ for (closePtr = list->begin(); closePtr != list->end(); ++closePtr) {
+ Common::Rect objRect;
+ objRect = _utils->rectScale(closePtr->_x1, closePtr->_y1, closePtr->_x2, closePtr->_y2);
+ if (objRect.contains(pos) && (closePtr->_closeUpType < 0)) {
+ _conditions->inclElement(abs(closePtr->_closeUpType));
+ return true;
+ }
+ }
+
+ return false;
+}
+
+void LabEngine::doActions(const ActionList &actionList, CloseDataPtr *closePtrList) {
+ ActionList::const_iterator action;
+ for (action = actionList.begin(); action != actionList.end(); ++action) {
+ updateMusicAndEvents();
+
+ switch (action->_actionType) {
+ case kActionPlaySound:
+ _music->_loopSoundEffect = false;
+ _music->readMusic(action->_messages[0], true);
+ break;
+
+ case kActionPlaySoundNoWait:
+ _music->_loopSoundEffect = false;
+ _music->readMusic(action->_messages[0], false);
+ break;
+
+ case kActionPlaySoundLooping:
+ _music->_loopSoundEffect = true;
+ _music->readMusic(action->_messages[0], false);
+ break;
+
+ case kActionShowDiff:
+ _graphics->readPict(action->_messages[0], true);
+ break;
+
+ case kActionShowDiffLooping:
+ _graphics->readPict(action->_messages[0], false);
+ break;
+
+ case kActionLoadDiff:
+ if (!action->_messages[0].empty())
+ // Puts a file into memory
+ _graphics->loadPict(action->_messages[0]);
+ break;
+
+ case kActionLoadBitmap:
+ error("Unused opcode kActionLoadBitmap has been called");
+
+ case kActionShowBitmap:
+ error("Unused opcode kActionShowBitmap has been called");
+
+ case kActionTransition:
+ _graphics->doTransition((TransitionType)action->_param1, closePtrList, action->_messages[0].c_str());
+ break;
+
+ case kActionNoUpdate:
+ _noUpdateDiff = true;
+ _anim->_doBlack = false;
+ break;
+
+ case kActionForceUpdate:
+ _curFileName = " ";
+ break;
+
+ case kActionShowCurPict: {
+ Common::String test = getPictName(closePtrList);
+
+ if (test != _curFileName) {
+ _curFileName = test;
+ _graphics->readPict(_curFileName);
+ }
+ }
+ break;
+
+ case kActionSetElement:
+ _conditions->inclElement(action->_param1);
+ break;
+
+ case kActionUnsetElement:
+ _conditions->exclElement(action->_param1);
+ break;
+
+ case kActionShowMessage:
+ if (_graphics->_longWinInFront)
+ _graphics->longDrawMessage(action->_messages[0], true);
+ else
+ _graphics->drawMessage(action->_messages[0], true);
+ break;
+
+ case kActionCShowMessage:
+ if (!*closePtrList)
+ _graphics->drawMessage(action->_messages[0], true);
+ break;
+
+ case kActionShowMessages:
+ _graphics->drawMessage(action->_messages[_utils->getRandom(action->_param1)], true);
+ break;
+
+ case kActionChangeRoom:
+ if (action->_param1 & 0x8000) {
+ // This is a Wyrmkeep Windows trial version, thus stop at this
+ // point, since we can't check for game payment status
+ _graphics->readPict(getPictName(closePtrList));
+ GUI::MessageDialog trialMessage("This is the end of the trial version. You can play the full game using the original interpreter from Wyrmkeep");
+ trialMessage.runModal();
+ break;
+ }
+
+ _roomNum = action->_param1;
+ _direction = action->_param2 - 1;
+ *closePtrList = nullptr;
+ _anim->_doBlack = true;
+ break;
+
+ case kActionSetCloseup: {
+ Common::Point curPos = Common::Point(_utils->scaleX(action->_param1), _utils->scaleY(action->_param2));
+ CloseDataPtr tmpClosePtr = getObject(curPos, *closePtrList);
+
+ if (tmpClosePtr)
+ *closePtrList = tmpClosePtr;
+ }
+ break;
+
+ case kActionMainView:
+ *closePtrList = nullptr;
+ break;
+
+ case kActionSubInv:
+ if (_inventory[action->_param1]._quantity)
+ (_inventory[action->_param1]._quantity)--;
+
+ if (_inventory[action->_param1]._quantity == 0)
+ _conditions->exclElement(action->_param1);
+
+ break;
+
+ case kActionAddInv:
+ (_inventory[action->_param1]._quantity) += action->_param2;
+ _conditions->inclElement(action->_param1);
+ break;
+
+ case kActionShowDir:
+ _graphics->setActionMessage(false);
+ break;
+
+ case kActionWaitSecs: {
+ uint32 targetMillis = _system->getMillis() + action->_param1 * 1000;
+
+ _graphics->screenUpdate();
+
+ while (_system->getMillis() < targetMillis) {
+ updateMusicAndEvents();
+ _anim->diffNextFrame();
+ }
+ }
+ break;
+
+ case kActionStopMusic:
+ _music->setMusic(false);
+ break;
+
+ case kActionStartMusic:
+ _music->setMusic(true);
+ break;
+
+ case kActionChangeMusic:
+ _music->changeMusic(action->_messages[0]);
+ _music->setMusicReset(false);
+ break;
+
+ case kActionResetMusic:
+ _music->resetMusic();
+ _music->setMusicReset(true);
+ break;
+
+ case kActionFillMusic:
+ updateMusicAndEvents();
+ break;
+
+ case kActionWaitSound:
+ while (_music->isSoundEffectActive()) {
+ updateMusicAndEvents();
+ _anim->diffNextFrame();
+ waitTOF();
+ }
+
+ break;
+
+ case kActionClearSound:
+ if (_music->_loopSoundEffect) {
+ _music->_loopSoundEffect = false;
+ _music->stopSoundEffect();
+ } else if (_music->isSoundEffectActive())
+ _music->stopSoundEffect();
+
+ break;
+
+ case kActionWinMusic:
+ _music->freeMusic();
+ _music->initMusic("Music:WinGame");
+ break;
+
+ case kActionWinGame:
+ _quitLab = true;
+ showLab2Teaser();
+ break;
+
+ case kActionLostGame:
+ error("Unused opcode kActionLostGame has been called");
+
+ case kActionResetBuffer:
+ _graphics->freePict();
+ break;
+
+ case kActionSpecialCmd:
+ if (action->_param1 == 0)
+ _anim->_doBlack = true;
+ else if (action->_param1 == 1)
+ _anim->_doBlack = (_closeDataPtr == nullptr);
+ else if (action->_param1 == 2)
+ _anim->_doBlack = (_closeDataPtr != nullptr);
+ else if (action->_param1 == 5) {
+ // inverse the palette
+ for (int idx = (8 * 3); idx < (255 * 3); idx++)
+ _anim->_diffPalette[idx] = 255 - _anim->_diffPalette[idx];
+
+ waitTOF();
+ _graphics->setPalette(_anim->_diffPalette, 256);
+ waitTOF();
+ waitTOF();
+ } else if (action->_param1 == 4) {
+ // white the palette
+ _graphics->whiteScreen();
+ waitTOF();
+ waitTOF();
+ } else if (action->_param1 == 6) {
+ // Restore the palette
+ waitTOF();
+ _graphics->setPalette(_anim->_diffPalette, 256);
+ waitTOF();
+ waitTOF();
+ } else if (action->_param1 == 7) {
+ // Quick pause
+ waitTOF();
+ waitTOF();
+ waitTOF();
+ }
+
+ break;
+ }
+ }
+
+ if (_music->_loopSoundEffect) {
+ _music->_loopSoundEffect = false;
+ _music->stopSoundEffect();
+ } else {
+ while (_music->isSoundEffectActive()) {
+ updateMusicAndEvents();
+ _anim->diffNextFrame();
+ waitTOF();
+ }
+ }
+}
+
+bool LabEngine::doActionRuleSub(int16 action, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults) {
+ action++;
+
+ if (closePtr) {
+ RuleList *rules = &(_rooms[_roomNum]._rules);
+
+ if (!rules && (roomNum == 0)) {
+ _resource->readViews(roomNum);
+ rules = &(_rooms[roomNum]._rules);
+ }
+
+ for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) {
+ if ((rule->_ruleType == kRuleTypeAction) &&
+ ((rule->_param1 == action) || ((rule->_param1 == 0) && allowDefaults))) {
+ if (((rule->_param2 == closePtr->_closeUpType) ||
+ ((rule->_param2 == 0) && allowDefaults)) ||
+ ((action == 1) && (rule->_param2 == -closePtr->_closeUpType))) {
+ if (checkConditions(rule->_condition)) {
+ doActions(rule->_actionList, setCloseList);
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
+bool LabEngine::doActionRule(Common::Point pos, int16 action, int16 roomNum, CloseDataPtr *closePtrList) {
+ if (roomNum)
+ _newFileName = NOFILE;
+ else
+ _newFileName = _curFileName;
+
+ CloseDataPtr curClosePtr = getObject(pos, *closePtrList);
+
+ if (doActionRuleSub(action, roomNum, curClosePtr, closePtrList, false))
+ return true;
+ else if (doActionRuleSub(action, roomNum, *closePtrList, closePtrList, false))
+ return true;
+ else if (doActionRuleSub(action, roomNum, curClosePtr, closePtrList, true))
+ return true;
+ else if (doActionRuleSub(action, roomNum, *closePtrList, closePtrList, true))
+ return true;
+
+ return false;
+}
+
+bool LabEngine::doOperateRuleSub(int16 itemNum, int16 roomNum, CloseDataPtr closePtr, CloseDataPtr *setCloseList, bool allowDefaults) {
+ if (closePtr)
+ if (closePtr->_closeUpType > 0) {
+ RuleList *rules = &(_rooms[roomNum]._rules);
+
+ if (!rules && (roomNum == 0)) {
+ _resource->readViews(roomNum);
+ rules = &(_rooms[roomNum]._rules);
+ }
+
+ for (RuleList::iterator rule = rules->begin(); rule != rules->end(); ++rule) {
+ if ((rule->_ruleType == kRuleTypeOperate) &&
+ ((rule->_param1 == itemNum) || ((rule->_param1 == 0) && allowDefaults)) &&
+ ((rule->_param2 == closePtr->_closeUpType) || ((rule->_param2 == 0) && allowDefaults))) {
+ if (checkConditions(rule->_condition)) {
+ doActions(rule->_actionList, setCloseList);
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
+bool LabEngine::doOperateRule(Common::Point pos, int16 ItemNum, CloseDataPtr *closePtrList) {
+ _newFileName = NOFILE;
+ CloseDataPtr closePtr = getObject(pos, *closePtrList);
+
+ if (doOperateRuleSub(ItemNum, _roomNum, closePtr, closePtrList, false))
+ return true;
+ else if (doOperateRuleSub(ItemNum, _roomNum, *closePtrList, closePtrList, false))
+ return true;
+ else if (doOperateRuleSub(ItemNum, _roomNum, closePtr, closePtrList, true))
+ return true;
+ else if (doOperateRuleSub(ItemNum, _roomNum, *closePtrList, closePtrList, true))
+ return true;
+ else {
+ _newFileName = _curFileName;
+
+ if (doOperateRuleSub(ItemNum, 0, closePtr, closePtrList, false))
+ return true;
+ else if (doOperateRuleSub(ItemNum, 0, *closePtrList, closePtrList, false))
+ return true;
+ else if (doOperateRuleSub(ItemNum, 0, closePtr, closePtrList, true))
+ return true;
+ else if (doOperateRuleSub(ItemNum, 0, *closePtrList, closePtrList, true))
+ return true;
+ }
+
+ return false;
+}
+
+bool LabEngine::doGoForward(CloseDataPtr *closePtrList) {
+ RuleList &rules = _rooms[_roomNum]._rules;
+
+ for (RuleList::iterator rule = rules.begin(); rule != rules.end(); ++rule) {
+ if ((rule->_ruleType == kRuleTypeGoForward) && (rule->_param1 == (_direction + 1))) {
+ if (checkConditions(rule->_condition)) {
+ doActions(rule->_actionList, closePtrList);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool LabEngine::doTurn(uint16 from, uint16 to, CloseDataPtr *closePtrList) {
+ from++;
+ to++;
+
+ RuleList &rules = _rooms[_roomNum]._rules;
+
+ for (RuleList::iterator rule = rules.begin(); rule != rules.end(); ++rule) {
+ if ((rule->_ruleType == kRuleTypeTurn) ||
+ ((rule->_ruleType == kRuleTypeTurnFromTo) &&
+ (rule->_param1 == from) && (rule->_param2 == to))) {
+ if (checkConditions(rule->_condition)) {
+ doActions(rule->_actionList, closePtrList);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+bool LabEngine::doMainView(CloseDataPtr *closePtrList) {
+ RuleList &rules = _rooms[_roomNum]._rules;
+ for (RuleList::iterator rule = rules.begin(); rule != rules.end(); ++rule) {
+ if (rule->_ruleType == kRuleTypeGoMainView) {
+ if (checkConditions(rule->_condition)) {
+ doActions(rule->_actionList, closePtrList);
+ return true;
+ }
+ }
+ }
+
+ return false;
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/processroom.h b/engines/lab/processroom.h
new file mode 100644
index 0000000000..d8657587a7
--- /dev/null
+++ b/engines/lab/processroom.h
@@ -0,0 +1,196 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#ifndef LAB_PROCESSROOM_H
+#define LAB_PROCESSROOM_H
+
+namespace Lab {
+
+enum ActionType {
+ kActionPlaySound = 1,
+ kActionPlaySoundLooping = 2,
+ kActionShowDiff = 3,
+ kActionShowDiffLooping = 4,
+ kActionLoadDiff = 5,
+ kActionLoadBitmap = 6, // unused
+ kActionShowBitmap = 7, // unused
+ kActionTransition = 8,
+ kActionNoUpdate = 9,
+ kActionForceUpdate = 10,
+ kActionShowCurPict = 11,
+ kActionSetElement = 12,
+ kActionUnsetElement = 13,
+ kActionShowMessage = 14,
+ kActionShowMessages = 15,
+ kActionChangeRoom = 16,
+ kActionSetCloseup = 17,
+ kActionMainView = 18,
+ kActionSubInv = 19,
+ kActionAddInv = 20,
+ kActionShowDir = 21,
+ kActionWaitSecs = 22,
+ kActionStopMusic = 23,
+ kActionStartMusic = 24,
+ kActionChangeMusic = 25,
+ kActionResetMusic = 26,
+ kActionFillMusic = 27,
+ kActionWaitSound = 28,
+ kActionClearSound = 29,
+ kActionWinMusic = 30,
+ kActionWinGame = 31,
+ kActionLostGame = 32, // unused
+ kActionResetBuffer = 33,
+ kActionSpecialCmd = 34,
+ kActionCShowMessage = 35,
+ kActionPlaySoundNoWait = 36
+};
+
+enum RuleType {
+ kRuleTypeNone = 0,
+ kRuleTypeAction = 1,
+ kRuleTypeOperate = 2,
+ kRuleTypeGoForward = 3,
+ kRuleTypeConditions = 4, // unused?
+ kRuleTypeTurn = 5,
+ kRuleTypeGoMainView = 6,
+ kRuleTypeTurnFromTo = 7
+};
+
+enum RuleAction {
+ kRuleActionTake = 0,
+ kRuleActionMove = 1, // unused?
+ kRuleActionOpenDoor = 2, // unused?
+ kRuleActionCloseDoor = 3, // unused?
+ kRuleActionTakeDef = 4
+};
+
+enum Condition {
+ kCondBeltGlowing = 70,
+ kCondBridge1 = 104,
+ kCondNoNews = 135,
+ kCondBridge0 = 148,
+ kCondLampOn = 151,
+ kCondNoClean = 152,
+ kCondDirty = 175,
+ kCondUsedHelmet = 184
+};
+
+enum MapDoors {
+ kDoorLeftNorth = 1,
+ kDoorLeftEast = 2,
+ kDoorLeftSouth = 4,
+ kDoorLeftWest = 8,
+
+ kDoorMiddleNorth = 16,
+ kDoorRightNorth = 32,
+ kDoorMiddleSouth = 64,
+ kDoorRightSouth = 128,
+
+ kDoorMiddleEast = 16,
+ kDoorBottomEast = 32,
+ kDoorMiddleWest = 64,
+ kDoorBottomWest = 128
+};
+
+// Special Map ID's
+#define NORMAL 0
+#define UPARROWROOM 1
+#define DOWNARROWROOM 2
+#define BRIDGEROOM 3
+#define VCORRIDOR 4
+#define HCORRIDOR 5
+#define MEDMAZE 6
+#define HEDGEMAZE 7
+#define SURMAZE 8
+#define MULTIMAZEF1 9
+#define MULTIMAZEF2 10
+#define MULTIMAZEF3 11
+
+#if defined(WIN32)
+#pragma pack(push, 1)
+#endif
+
+struct CloseData {
+ uint16 _x1, _y1, _x2, _y2;
+ int16 _closeUpType; // if > 0, an object. If < 0, an item
+ uint16 _depth; // Level of the closeup.
+ Common::String _graphicName;
+ Common::String _message;
+ CloseDataList _subCloseUps;
+};
+
+struct ViewData {
+ Common::Array<int16> _condition;
+ Common::String _graphicName;
+ CloseDataList _closeUps;
+};
+
+struct Action {
+ ActionType _actionType;
+ int16 _param1;
+ int16 _param2;
+ int16 _param3;
+ Common::Array<Common::String> _messages;
+};
+
+struct Rule {
+ RuleType _ruleType;
+ int16 _param1;
+ int16 _param2;
+ Common::Array<int16> _condition;
+ ActionList _actionList;
+};
+
+struct RoomData {
+ uint16 _doors[4];
+ byte _transitionType;
+ ViewDataList _view[4];
+ RuleList _rules;
+ Common::String _roomMsg;
+};
+
+struct InventoryData {
+ uint16 _quantity;
+ Common::String _name;
+ Common::String _bitmapName;
+};
+
+struct MapData {
+ uint16 _x, _y, _pageNumber, _specialID;
+ uint32 _mapFlags;
+};
+
+#if defined(WIN32)
+#pragma pack(pop)
+#endif
+
+} // End of namespace Lab
+
+#endif // LAB_PROCESSROOM_H
diff --git a/engines/lab/resource.cpp b/engines/lab/resource.cpp
new file mode 100644
index 0000000000..17535a7659
--- /dev/null
+++ b/engines/lab/resource.cpp
@@ -0,0 +1,308 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "lab/lab.h"
+
+#include "lab/dispman.h"
+#include "lab/music.h"
+#include "lab/processroom.h"
+#include "lab/resource.h"
+
+namespace Lab {
+
+Resource::Resource(LabEngine *vm) : _vm(vm) {
+ readStaticText();
+}
+
+void Resource::readStaticText() {
+ Common::File *labTextFile = openDataFile("Lab:Rooms/LabText");
+
+ for (int i = 0; i < 48; i++)
+ _staticText[i] = labTextFile->readLine();
+
+ delete labTextFile;
+}
+
+TextFont *Resource::getFont(const Common::String fileName) {
+ // TODO: Add support for the font format of the Amiga version
+ Common::File *dataFile = openDataFile(fileName, MKTAG('V', 'G', 'A', 'F'));
+
+ uint32 headerSize = 4 + 2 + 256 * 3 + 4;
+ uint32 fileSize = dataFile->size();
+ if (fileSize <= headerSize)
+ return nullptr;
+
+ _vm->updateMusicAndEvents();
+
+ TextFont *textfont = new TextFont();
+ textfont->_dataLength = fileSize - headerSize;
+ textfont->_height = dataFile->readUint16LE();
+ dataFile->read(textfont->_widths, 256);
+ for (int i = 0; i < 256; i++)
+ textfont->_offsets[i] = dataFile->readUint16LE();
+ dataFile->skip(4);
+ textfont->_data = new byte[textfont->_dataLength + 4];
+ dataFile->read(textfont->_data, textfont->_dataLength);
+ return textfont;
+}
+
+Common::String Resource::getText(const Common::String fileName) {
+ Common::File *dataFile = openDataFile(fileName);
+
+ _vm->updateMusicAndEvents();
+
+ uint32 count = dataFile->size();
+ byte *buffer = new byte[count];
+ byte *text = buffer;
+ dataFile->read(buffer, count);
+
+ while (text && (*text != '\0'))
+ *text++ -= (byte)95;
+
+ delete dataFile;
+
+ Common::String str = (char *)buffer;
+ delete[] buffer;
+
+ return str;
+}
+
+void Resource::readRoomData(const Common::String fileName) {
+ Common::File *dataFile = openDataFile(fileName, MKTAG('D', 'O', 'R', '1'));
+
+ _vm->_manyRooms = dataFile->readUint16LE();
+ _vm->_highestCondition = dataFile->readUint16LE();
+ _vm->_rooms = new RoomData[_vm->_manyRooms + 1];
+
+ for (int i = 1; i <= _vm->_manyRooms; i++) {
+ RoomData *curRoom = &_vm->_rooms[i];
+ curRoom->_doors[kDirectionNorth] = dataFile->readUint16LE();
+ curRoom->_doors[kDirectionSouth] = dataFile->readUint16LE();
+ curRoom->_doors[kDirectionEast] = dataFile->readUint16LE();
+ curRoom->_doors[kDirectionWest] = dataFile->readUint16LE();
+ curRoom->_transitionType = dataFile->readByte();
+ }
+
+ delete dataFile;
+}
+
+InventoryData *Resource::readInventory(const Common::String fileName) {
+ Common::File *dataFile = openDataFile(fileName, MKTAG('I', 'N', 'V', '1'));
+
+ _vm->_numInv = dataFile->readUint16LE();
+ InventoryData *inventory = new InventoryData[_vm->_numInv + 1];
+
+ for (int i = 1; i <= _vm->_numInv; i++) {
+ inventory[i]._quantity = dataFile->readUint16LE();
+ inventory[i]._name = readString(dataFile);
+ inventory[i]._bitmapName = readString(dataFile);
+ }
+
+ delete dataFile;
+ return inventory;
+}
+
+void Resource::readViews(uint16 roomNum) {
+ Common::String fileName = "LAB:Rooms/" + Common::String::format("%d", roomNum);
+ Common::File *dataFile = openDataFile(fileName, MKTAG('R', 'O', 'M', '4'));
+
+ RoomData *curRoom = &_vm->_rooms[roomNum];
+
+ curRoom->_roomMsg = readString(dataFile);
+ readView(dataFile, curRoom->_view[kDirectionNorth]);
+ readView(dataFile, curRoom->_view[kDirectionSouth]);
+ readView(dataFile, curRoom->_view[kDirectionEast]);
+ readView(dataFile, curRoom->_view[kDirectionWest]);
+ readRule(dataFile, curRoom->_rules);
+
+ _vm->updateMusicAndEvents();
+ delete dataFile;
+}
+
+Common::String Resource::translateFileName(const Common::String filename) {
+ Common::String upperFilename = filename;
+ upperFilename.toUppercase();
+ Common::String fileNameStrFinal;
+
+ if (upperFilename.hasPrefix("P:") || upperFilename.hasPrefix("F:")) {
+ if (_vm->_isHiRes)
+ fileNameStrFinal = "GAME/SPICT/";
+ else
+ fileNameStrFinal = "GAME/PICT/";
+
+ if (_vm->getPlatform() == Common::kPlatformAmiga) {
+ if (upperFilename.hasPrefix("P:")) {
+ fileNameStrFinal = "PICT/";
+ } else {
+ fileNameStrFinal = "LABFONTS/";
+ upperFilename += "T"; // all the Amiga fonts have a ".FONT" suffix
+ }
+ }
+ } else if (upperFilename.hasPrefix("LAB:")) {
+ if (_vm->getPlatform() != Common::kPlatformAmiga)
+ fileNameStrFinal = "GAME/";
+ } else if (upperFilename.hasPrefix("MUSIC:")) {
+ if (_vm->getPlatform() != Common::kPlatformAmiga)
+ fileNameStrFinal = "GAME/MUSIC/";
+ else
+ fileNameStrFinal = "MUSIC/";
+ }
+
+ if (upperFilename.contains(':')) {
+ while (upperFilename[0] != ':') {
+ upperFilename.deleteChar(0);
+ }
+
+ upperFilename.deleteChar(0);
+ }
+
+ fileNameStrFinal += upperFilename;
+
+ return fileNameStrFinal;
+}
+
+Common::File *Resource::openDataFile(const Common::String fileName, uint32 fileHeader) {
+ Common::File *dataFile = new Common::File();
+ dataFile->open(translateFileName(fileName));
+ if (!dataFile->isOpen())
+ error("openDataFile: Couldn't open %s (%s)", translateFileName(fileName).c_str(), fileName.c_str());
+
+ if (fileHeader > 0) {
+ uint32 headerTag = dataFile->readUint32BE();
+ if (headerTag != fileHeader) {
+ dataFile->close();
+ error("openDataFile: Unexpected header in %s (%s) - expected: %d, got: %d", translateFileName(fileName).c_str(), fileName.c_str(), fileHeader, headerTag);
+ }
+ }
+
+ return dataFile;
+}
+
+Common::String Resource::readString(Common::File *file) {
+ byte size = file->readByte();
+ if (!size)
+ return Common::String("");
+
+ char *str = new char[size];
+ for (int i = 0; i < size; i++) {
+ char c = file->readByte();
+ // Decrypt char
+ c = (i < size - 1) ? c - 95 : '\0';
+ str[i] = c;
+ }
+
+ Common::String result = str;
+ delete[] str;
+ return result;
+}
+
+Common::Array<int16> Resource::readConditions(Common::File *file) {
+ int16 cond;
+ Common::Array<int16> list;
+
+ while ((cond = file->readUint16LE()) != 0)
+ list.push_back(cond);
+
+ if (list.size() > 24) {
+ // The original only allocated 24 elements, and silently
+ // dropped remaining parts.
+ warning("More than 24 parts in condition");
+ }
+
+ return list;
+}
+
+void Resource::readRule(Common::File *file, RuleList &rules) {
+ rules.clear();
+ while (file->readByte() == 1) {
+ rules.push_back(Rule());
+ Rule &rule = rules.back();
+
+ rule._ruleType = (RuleType)file->readSint16LE();
+ rule._param1 = file->readSint16LE();
+ rule._param2 = file->readSint16LE();
+ rule._condition = readConditions(file);
+ readAction(file, rule._actionList);
+ }
+}
+
+void Resource::readAction(Common::File *file, ActionList &list) {
+ list.clear();
+
+ while (file->readByte() == 1) {
+ list.push_back(Action());
+ Action &action = list.back();
+
+ action._actionType = (ActionType)file->readSint16LE();
+ action._param1 = file->readSint16LE();
+ action._param2 = file->readSint16LE();
+ action._param3 = file->readSint16LE();
+
+ if (action._actionType == kActionShowMessages) {
+ action._messages.reserve(action._param1);
+ for (int i = 0; i < action._param1; i++)
+ action._messages.push_back(readString(file));
+ } else {
+ action._messages.push_back(readString(file));
+ }
+ }
+}
+
+void Resource::readCloseUps(uint16 depth, Common::File *file, CloseDataList &list) {
+ list.clear();
+ while (file->readByte() != '\0') {
+ list.push_back(CloseData());
+ CloseData &closeup = list.back();
+
+ closeup._x1 = file->readUint16LE();
+ closeup._y1 = file->readUint16LE();
+ closeup._x2 = file->readUint16LE();
+ closeup._y2 = file->readUint16LE();
+ closeup._closeUpType = file->readSint16LE();
+ closeup._depth = depth;
+ closeup._graphicName = readString(file);
+ closeup._message = readString(file);
+ readCloseUps(depth + 1, file, closeup._subCloseUps);
+ }
+}
+
+void Resource::readView(Common::File *file, ViewDataList &list) {
+ list.clear();
+ while (file->readByte() == 1) {
+ list.push_back(ViewData());
+ ViewData &view = list.back();
+
+ view._condition = readConditions(file);
+ view._graphicName = readString(file);
+ readCloseUps(0, file, view._closeUps);
+ }
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/resource.h b/engines/lab/resource.h
new file mode 100644
index 0000000000..307eac3068
--- /dev/null
+++ b/engines/lab/resource.h
@@ -0,0 +1,124 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#ifndef LAB_RESOURCE_H
+#define LAB_RESOURCE_H
+
+namespace Lab {
+
+struct ViewData;
+
+enum StaticText {
+ kTextLowerFloor,
+ kTextMiddleFloor,
+ kTextUpperFloor,
+ kTextMedMazeFloor,
+ kTextHedgeMazeFloor,
+ kTextSurMazeFloor,
+ kTextCarnivalFloor,
+
+ kTextSurmazeMessage,
+
+ kTextFacingNorth,
+ kTextFacingEast,
+ kTextFacingSouth,
+ kTextFacingWest,
+
+ kTextkLampOn,
+
+ kTextTurnLeft,
+ kTextTurnRight,
+ kTextGoForward,
+ kTextNoPath,
+ kTextTakeItem,
+ kTextSave,
+ kTextLoad,
+ kTextBookmark,
+ kTextPersonal,
+ kTextDisk,
+ kTextSaveBook,
+ kTextRestoreBook,
+ kTextSaveFlash,
+ kTextRestoreFlash,
+ kTextSaveDisk,
+ kTextRestoreDisk,
+ kTextNoDiskInDrive,
+ kTextWriteProtected,
+ kTextSelectDisk,
+ kTextFormatFloppy,
+ kTextFormatting,
+
+ kTextNothing,
+ kTextUseOnWhat,
+ kTextTakeWhat,
+ kTextMoveWhat,
+ kTextOpenWhat,
+ kTextCloseWhat,
+ kTextLookWhat,
+
+ kTextUseMap,
+ kTextUseJournal,
+ kTextTurnkLampOn,
+ kTextTurnLampOff,
+ kTextUseWhiskey,
+ kTextUsePith,
+ kTextUseHelmet
+};
+
+class Resource {
+public:
+ Resource(LabEngine *vm);
+ ~Resource() {}
+
+ Common::File *openDataFile(const Common::String fileName, uint32 fileHeader = 0);
+ void readRoomData(const Common::String fileName);
+ InventoryData *readInventory(const Common::String fileName);
+ void readViews(uint16 roomNum);
+ TextFont *getFont(const Common::String fileName);
+ Common::String getText(const Common::String fileName);
+ Common::String getStaticText(byte index) const { return _staticText[index]; }
+
+private:
+ LabEngine *_vm;
+ Common::String readString(Common::File *file);
+ Common::Array<int16> readConditions(Common::File *file);
+ void readRule(Common::File *file, RuleList &rules);
+ void readAction(Common::File *file, ActionList &action);
+ void readCloseUps(uint16 depth, Common::File *file, CloseDataList &close);
+ void readView(Common::File *file, ViewDataList &view);
+ void readStaticText();
+ Common::String translateFileName(const Common::String filename);
+
+ Common::String _staticText[48];
+};
+
+} // End of namespace Lab
+
+#endif // LAB_RESOURCE_H
diff --git a/engines/lab/savegame.cpp b/engines/lab/savegame.cpp
new file mode 100644
index 0000000000..0bdaf74865
--- /dev/null
+++ b/engines/lab/savegame.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 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "common/savefile.h"
+#include "common/translation.h"
+
+#include "gui/message.h"
+#include "gui/saveload.h"
+
+#include "graphics/thumbnail.h"
+#include "engines/savestate.h"
+
+#include "lab/lab.h"
+#include "lab/dispman.h"
+#include "lab/eventman.h"
+#include "lab/labsets.h"
+#include "lab/music.h"
+#include "lab/processroom.h"
+#include "lab/tilepuzzle.h"
+
+namespace Lab {
+
+#define SAVEGAME_ID MKTAG('L', 'O', 'T', 'S')
+#define SAVEGAME_VERSION 1
+
+void LabEngine::writeSaveGameHeader(Common::OutSaveFile *out, const Common::String &saveName) {
+ out->writeUint32BE(SAVEGAME_ID);
+
+ // Write version
+ out->writeByte(SAVEGAME_VERSION);
+
+ // Write savegame name
+ out->writeString(saveName);
+ out->writeByte(0);
+
+ // Save the game thumbnail
+ Graphics::saveThumbnail(*out);
+
+ // Creation date/time
+ TimeDate curTime;
+ _system->getTimeAndDate(curTime);
+
+ uint32 saveDate = ((curTime.tm_mday & 0xFF) << 24) | (((curTime.tm_mon + 1) & 0xFF) << 16) | ((curTime.tm_year + 1900) & 0xFFFF);
+ uint16 saveTime = ((curTime.tm_hour & 0xFF) << 8) | ((curTime.tm_min) & 0xFF);
+ uint32 playTime = getTotalPlayTime() / 1000;
+
+ out->writeUint32BE(saveDate);
+ out->writeUint16BE(saveTime);
+ out->writeUint32BE(playTime);
+}
+
+bool readSaveGameHeader(Common::InSaveFile *in, SaveGameHeader &header) {
+ uint32 id = in->readUint32BE();
+
+ // Check if it's a valid ScummVM savegame
+ if (id != SAVEGAME_ID)
+ return false;
+
+ // Read in the version
+ header._version = in->readByte();
+
+ // Check that the save version isn't newer than this binary
+ if (header._version > SAVEGAME_VERSION)
+ return false;
+
+ // Read in the save name
+ Common::String saveName;
+ char ch;
+ while ((ch = (char)in->readByte()) != '\0')
+ saveName += ch;
+ header._descr.setDescription(saveName);
+
+ // Get the thumbnail
+ header._descr.setThumbnail(Graphics::loadThumbnail(*in));
+
+ uint32 saveDate = in->readUint32BE();
+ uint16 saveTime = in->readUint16BE();
+ uint32 playTime = in->readUint32BE();
+
+ int day = (saveDate >> 24) & 0xFF;
+ int month = (saveDate >> 16) & 0xFF;
+ int year = saveDate & 0xFFFF;
+ header._descr.setSaveDate(year, month, day);
+
+ int hour = (saveTime >> 8) & 0xFF;
+ int minutes = saveTime & 0xFF;
+ header._descr.setSaveTime(hour, minutes);
+
+ header._descr.setPlayTime(playTime * 1000);
+ g_engine->setTotalPlayTime(playTime * 1000);
+
+ return true;
+}
+
+bool LabEngine::saveGame(int slot, const Common::String desc) {
+ Common::String fileName = generateSaveFileName(slot);
+ Common::SaveFileManager *saveFileManager = _system->getSavefileManager();
+ Common::OutSaveFile *file = saveFileManager->openForSaving(fileName);
+
+ if (!file)
+ return false;
+
+ // Load scene pic
+ CloseDataPtr closePtr = nullptr;
+ _graphics->readPict(getPictName(&closePtr));
+
+ writeSaveGameHeader(file, desc);
+ file->writeUint16LE(_roomNum);
+ file->writeUint16LE(getDirection());
+ file->writeUint16LE(getQuarters());
+
+ // Conditions
+ for (int i = 0; i < _conditions->_lastElement / (8 * 2); i++)
+ file->writeUint16LE(_conditions->_array[i]);
+
+ // Rooms found
+ for (int i = 0; i < _roomsFound->_lastElement / (8 * 2); i++)
+ file->writeUint16LE(_roomsFound->_array[i]);
+
+ _tilePuzzle->save(file);
+
+ // Breadcrumbs
+ for (uint i = 0; i < MAX_CRUMBS; i++) {
+ file->writeUint16LE(_breadCrumbs[i]._roomNum);
+ file->writeUint16LE(_breadCrumbs[i]._direction);
+ }
+
+ file->flush();
+ file->finalize();
+ delete file;
+
+ return true;
+}
+
+bool LabEngine::loadGame(int slot) {
+ Common::String fileName = generateSaveFileName(slot);
+ Common::SaveFileManager *saveFileManager = _system->getSavefileManager();
+ Common::InSaveFile *file = saveFileManager->openForLoading(fileName);
+
+ if (!file)
+ return false;
+
+ SaveGameHeader header;
+ readSaveGameHeader(file, header);
+ _roomNum = file->readUint16LE();
+ setDirection(file->readUint16LE());
+ setQuarters(file->readUint16LE());
+
+ // Conditions
+ for (int i = 0; i < _conditions->_lastElement / (8 * 2); i++)
+ _conditions->_array[i] = file->readUint16LE();
+
+ // Rooms found
+ for (int i = 0; i < _roomsFound->_lastElement / (8 * 2); i++)
+ _roomsFound->_array[i] = file->readUint16LE();
+
+ _tilePuzzle->load(file);
+
+ // Breadcrumbs
+ for (int i = 0; i < MAX_CRUMBS; i++) {
+ _breadCrumbs[i]._roomNum = file->readUint16LE();
+ _breadCrumbs[i]._direction = file->readUint16LE();
+ }
+
+ _droppingCrumbs = (_breadCrumbs[0]._roomNum != 0);
+ _followingCrumbs = false;
+
+ for (int i = 0; i < MAX_CRUMBS; i++) {
+ if (_breadCrumbs[i]._roomNum == 0)
+ break;
+ _numCrumbs = i;
+ }
+
+ delete file;
+
+ return true;
+}
+
+bool LabEngine::saveRestoreGame() {
+ bool isOK = false;
+
+ // The original had one screen for saving/loading. We have two.
+ // Ask the user which screen to use.
+ GUI::MessageDialog saveOrLoad(_("Would you like to save or restore a game?"), _("Save"), _("Restore"));
+
+ int choice = saveOrLoad.runModal();
+ if (choice == GUI::kMessageOK) {
+ // Save
+ GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
+ int slot = dialog->runModalWithCurrentTarget();
+ if (slot >= 0) {
+ Common::String desc = dialog->getResultString();
+
+ if (desc.empty()) {
+ // create our own description for the saved game, the user didn't enter it
+ desc = dialog->createDefaultSaveDescription(slot);
+ }
+
+ isOK = saveGame(slot, desc);
+ }
+ delete dialog;
+ } else {
+ // Restore
+ GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
+ int slot = dialog->runModalWithCurrentTarget();
+ if (slot >= 0) {
+ isOK = loadGame(slot);
+ if (isOK)
+ _music->resetMusic();
+ }
+ delete dialog;
+ }
+
+ _alternate = false;
+ _mainDisplay = true;
+ _event->initMouse();
+ _graphics->screenUpdate();
+
+ return isOK;
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/special.cpp b/engines/lab/special.cpp
new file mode 100644
index 0000000000..e15561d9fb
--- /dev/null
+++ b/engines/lab/special.cpp
@@ -0,0 +1,467 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "lab/lab.h"
+
+#include "lab/anim.h"
+#include "lab/dispman.h"
+#include "lab/eventman.h"
+#include "lab/image.h"
+#include "lab/labsets.h"
+#include "lab/music.h"
+#include "lab/processroom.h"
+#include "lab/resource.h"
+#include "lab/utils.h"
+
+namespace Lab {
+
+void LabEngine::doNotes() {
+ TextFont *noteFont = _resource->getFont("F:Note.fon");
+ Common::String noteText = _resource->getText("Lab:Rooms/Notes");
+
+ Common::Rect textRect = Common::Rect(_utils->vgaScaleX(25) + _utils->svgaCord(15), _utils->vgaScaleY(50), _utils->vgaScaleX(295) - _utils->svgaCord(15), _utils->vgaScaleY(148));
+ _graphics->flowText(noteFont, -2 + _utils->svgaCord(1), 0, 0, false, false, true, true, textRect, noteText.c_str());
+ _graphics->setPalette(_anim->_diffPalette, 256);
+ _graphics->freeFont(&noteFont);
+}
+
+void LabEngine::doWestPaper() {
+ TextFont *paperFont = _resource->getFont("F:News22.fon");
+ Common::String paperText = _resource->getText("Lab:Rooms/Date");
+
+ Common::Rect textRect = Common::Rect(_utils->vgaScaleX(57), _utils->vgaScaleY(77) + _utils->svgaCord(2), _utils->vgaScaleX(262), _utils->vgaScaleY(91));
+ _graphics->flowText(paperFont, 0, 0, 0, false, true, false, true, textRect, paperText.c_str());
+ _graphics->freeFont(&paperFont);
+
+ paperFont = _resource->getFont("F:News32.fon");
+ paperText = _resource->getText("Lab:Rooms/Headline");
+
+ int fileLen = paperText.size() - 1;
+ textRect = Common::Rect(_utils->vgaScaleX(57), _utils->vgaScaleY(86) - _utils->svgaCord(2), _utils->vgaScaleX(262), _utils->vgaScaleY(118));
+ int charsPrinted = _graphics->flowText(paperFont, -8, 0, 0, false, true, false, true, textRect, paperText.c_str());
+
+ uint16 y;
+
+ if (charsPrinted < fileLen) {
+ y = 130 - _utils->svgaCord(5);
+ textRect = Common::Rect(_utils->vgaScaleX(57), _utils->vgaScaleY(86) - _utils->svgaCord(2), _utils->vgaScaleX(262), _utils->vgaScaleY(132));
+ _graphics->flowText(paperFont, -8 - _utils->svgaCord(1), 0, 0, false, true, false, true, textRect, paperText.c_str());
+ } else
+ y = 115 - _utils->svgaCord(5);
+
+ _graphics->freeFont(&paperFont);
+
+ paperFont = _resource->getFont("F:Note.fon");
+ paperText = _resource->getText("Lab:Rooms/Col1");
+ _graphics->flowText(paperFont, -4, 0, 0, false, false, false, true, _utils->vgaRectScale(45, y, 158, 148), paperText.c_str());
+
+ paperText = _resource->getText("Lab:Rooms/Col2");
+ _graphics->flowText(paperFont, -4, 0, 0, false, false, false, true, _utils->vgaRectScale(162, y, 275, 148), paperText.c_str());
+
+ _graphics->freeFont(&paperFont);
+ _graphics->setPalette(_anim->_diffPalette, 256);
+}
+
+void LabEngine::loadJournalData() {
+ if (_journalFont)
+ _graphics->freeFont(&_journalFont);
+
+ _journalFont = _resource->getFont("F:Journal.fon");
+ updateMusicAndEvents();
+
+ Common::String filename = "Lab:Rooms/j";
+
+ bool bridge = _conditions->in(kCondBridge0) || _conditions->in(kCondBridge1);
+ bool dirty = _conditions->in(kCondDirty);
+ bool news = !_conditions->in(kCondNoNews);
+ bool clean = !_conditions->in(kCondNoClean);
+
+ if (bridge && clean && news)
+ filename += '8';
+ else if (clean && news)
+ filename += '9';
+ else if (bridge && clean)
+ filename += '6';
+ else if (clean)
+ filename += '7';
+ else if (bridge && dirty && news)
+ filename += '4';
+ else if (dirty && news)
+ filename += '5';
+ else if (bridge && dirty)
+ filename += '2';
+ else if (dirty)
+ filename += '3';
+ else if (bridge)
+ filename += '1';
+ else
+ filename += '0';
+
+ _journalText = _resource->getText(filename);
+ _journalTextTitle = _resource->getText("Lab:Rooms/jt");
+
+ Common::File *journalFile = _resource->openDataFile("P:JImage");
+ _journalButtonList.push_back(_event->createButton( 80, _utils->vgaScaleY(162) + _utils->svgaCord(1), 0, Common::KEYCODE_LEFT, new Image(journalFile, this), new Image(journalFile, this))); // back
+ _journalButtonList.push_back(_event->createButton(194, _utils->vgaScaleY(162) + _utils->svgaCord(1), 2, Common::KEYCODE_ESCAPE, new Image(journalFile, this), new Image(journalFile, this))); // cancel
+ _journalButtonList.push_back(_event->createButton(144, _utils->vgaScaleY(164) - _utils->svgaCord(1), 1, Common::KEYCODE_RIGHT, new Image(journalFile, this), new Image(journalFile, this))); // forward
+ delete journalFile;
+
+ _anim->_noPalChange = true;
+ _journalBackImage->_imageData = new byte[_graphics->_screenBytesPerPage];
+ _graphics->readPict("P:Journal.pic", true, false, _journalBackImage->_imageData);
+ _anim->_noPalChange = false;
+
+ // Keep a copy of the blank journal
+ _blankJournal = new byte[_graphics->_screenBytesPerPage];
+ memcpy(_blankJournal, _journalBackImage->_imageData, _graphics->_screenBytesPerPage);
+}
+
+void LabEngine::drawJournalText() {
+ uint16 drawingToPage = 1;
+ const char *curText = _journalText.c_str();
+
+ assert((_journalPage & 1) == 0);
+
+ while (drawingToPage < _journalPage) {
+ updateMusicAndEvents();
+
+ // flowText without output
+ curText += _graphics->flowText(_journalFont, -2, 2, 0, false, false, false, false, _utils->vgaRectScale(52, 32, 152, 148), curText);
+
+ _lastPage = (*curText == 0);
+
+ if (_lastPage) {
+ // Reset _journalPage to this page, in case it was set too high
+ _journalPage = (drawingToPage / 2) * 2;
+ break;
+ }
+
+ drawingToPage++;
+ }
+
+ if (_journalPage == 0) {
+ // draw title page centered
+ _graphics->flowText(_journalFont, -2, 2, 0, false, true, true, true, _utils->vgaRectScale(52, 32, 152, 148), _journalTextTitle.c_str(), _journalBackImage);
+ } else {
+ curText += _graphics->flowText(_journalFont, -2, 2, 0, false, false, false, true, _utils->vgaRectScale(52, 32, 152, 148), curText, _journalBackImage);
+ }
+
+ updateMusicAndEvents();
+ curText += _graphics->flowText(_journalFont, -2, 2, 0, false, false, false, true, _utils->vgaRectScale(171, 32, 271, 148), curText, _journalBackImage);
+
+ _lastPage = (*curText == 0);
+}
+
+void LabEngine::turnPage(bool fromLeft) {
+ if (fromLeft) {
+ for (int i = 0; i < _graphics->_screenWidth; i += 8) {
+ updateMusicAndEvents();
+ waitTOF();
+ _journalBackImage->blitBitmap(i, 0, nullptr, i, 0, 8, _graphics->_screenHeight, false);
+ }
+ } else {
+ for (int i = (_graphics->_screenWidth - 8); i > 0; i -= 8) {
+ updateMusicAndEvents();
+ waitTOF();
+ _journalBackImage->blitBitmap(i, 0, nullptr, i, 0, 8, _graphics->_screenHeight, false);
+ }
+ }
+}
+
+void LabEngine::drawJournal(uint16 wipenum, bool needFade) {
+ _event->mouseHide();
+ updateMusicAndEvents();
+ drawJournalText();
+ _graphics->loadBackPict("P:Journal.pic", _highPalette);
+
+ if (wipenum == 0)
+ _journalBackImage->blitBitmap(0, 0, nullptr, 0, 0, _graphics->_screenWidth, _graphics->_screenHeight, false);
+ else
+ turnPage((wipenum == 1));
+
+ _event->toggleButton(_event->getButton(0), 15, (_journalPage > 0)); // back button
+ _event->toggleButton(_event->getButton(2), 15, (!_lastPage)); // forward button
+
+ if (needFade)
+ _graphics->fade(true);
+
+ // Reset the journal background, so that all the text that has been blitted on it is erased
+ memcpy(_journalBackImage->_imageData, _blankJournal, _graphics->_screenBytesPerPage);
+
+ eatMessages();
+ _event->mouseShow();
+}
+
+void LabEngine::processJournal() {
+ while (1) {
+ // Make sure we check the music at least after every message
+ updateMusicAndEvents();
+ IntuiMessage *msg = _event->getMsg();
+ if (shouldQuit()) {
+ _quitLab = true;
+ return;
+ }
+
+ if (!msg)
+ updateMusicAndEvents();
+ else {
+ uint32 msgClass = msg->_msgClass;
+ uint16 buttonId = msg->_code;
+
+ if ((msgClass == kMessageRightClick) ||
+ ((msgClass == kMessageRawKey) && (buttonId == Common::KEYCODE_ESCAPE)))
+ return;
+ else if (msgClass == kMessageButtonUp) {
+ if (buttonId == 0) {
+ if (_journalPage >= 2) {
+ _journalPage -= 2;
+ drawJournal(1, false);
+ }
+ } else if (buttonId == 1) {
+ return;
+ } else if (buttonId == 2) {
+ if (!_lastPage) {
+ _journalPage += 2;
+ drawJournal(2, false);
+ }
+ }
+ }
+ }
+ }
+}
+
+void LabEngine::doJournal() {
+ _graphics->blackAllScreen();
+ _lastPage = false;
+
+ _journalBackImage->_width = _graphics->_screenWidth;
+ _journalBackImage->_height = _graphics->_screenHeight;
+ _journalBackImage->_imageData = nullptr;
+
+ updateMusicAndEvents();
+ loadJournalData();
+ _event->attachButtonList(&_journalButtonList);
+ drawJournal(0, true);
+ _event->mouseShow();
+ processJournal();
+ _event->attachButtonList(nullptr);
+ _graphics->fade(false);
+ _event->mouseHide();
+
+ delete[] _blankJournal;
+ delete[] _journalBackImage->_imageData;
+ _blankJournal = _journalBackImage->_imageData = nullptr;
+
+ _event->freeButtonList(&_journalButtonList);
+ _graphics->freeFont(&_journalFont);
+
+ _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
+ _graphics->blackScreen();
+}
+
+void LabEngine::drawMonText(const char *text, TextFont *monitorFont, Common::Rect textRect, bool isinteractive) {
+ uint16 drawingToPage = 0, yspacing = 0;
+ int charsDrawn = 0;
+ const char *curText = text;
+
+ _event->mouseHide();
+
+ if (*text == '%') {
+ text++;
+ uint16 numlines = (*text - '0') * 10;
+ text++;
+ numlines += (*text - '0');
+ text += 2;
+
+ uint16 fheight = _graphics->textHeight(monitorFont);
+ textRect.left = _monitorButton->_width + _utils->vgaScaleX(3);
+ _monitorButtonHeight = _monitorButton->_height + _utils->vgaScaleY(3);
+
+ if (_monitorButtonHeight > fheight)
+ yspacing = _monitorButtonHeight - fheight;
+ else
+ _monitorButtonHeight = fheight;
+
+ _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, textRect.bottom, 0);
+
+ for (int i = 0; i < numlines; i++)
+ _monitorButton->drawImage(0, i * _monitorButtonHeight);
+ } else if (isinteractive) {
+ _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, textRect.bottom, 0);
+ } else {
+ _graphics->rectFill(textRect, 0);
+ }
+
+ while (drawingToPage < _monitorPage) {
+ updateMusicAndEvents();
+ curText = text + charsDrawn;
+ charsDrawn += _graphics->flowText(monitorFont, yspacing, 0, 0, false, false, false, false, textRect, curText);
+ _lastPage = (*curText == 0);
+
+ if (_lastPage)
+ _monitorPage = drawingToPage;
+ else
+ drawingToPage++;
+ }
+
+ curText = text + charsDrawn;
+ _lastPage = (*curText == 0);
+ charsDrawn = _graphics->flowText(monitorFont, yspacing, 2, 0, false, false, false, true, textRect, curText);
+ _event->mouseShow();
+}
+
+void LabEngine::processMonitor(const char *ntext, TextFont *monitorFont, bool isInteractive, Common::Rect textRect) {
+ Common::String startFileName = _monitorTextFilename;
+ CloseDataPtr startClosePtr = _closeDataPtr, lastClosePtr[10];
+ uint16 depth = 0;
+
+ lastClosePtr[0] = _closeDataPtr;
+
+ while (1) {
+ if (isInteractive) {
+ if (!_closeDataPtr)
+ _closeDataPtr = startClosePtr;
+
+ Common::String test;
+ if (_closeDataPtr == startClosePtr)
+ test = startFileName;
+ else
+ test = _closeDataPtr->_graphicName;
+
+ if (test != _monitorTextFilename) {
+ _monitorPage = 0;
+ _monitorTextFilename = test;
+
+ Common::String text = _resource->getText(_monitorTextFilename);
+ _graphics->fade(false);
+ drawMonText(text.c_str(), monitorFont, textRect, isInteractive);
+ _graphics->fade(true);
+ }
+ }
+
+ // Make sure we check the music at least after every message
+ updateMusicAndEvents();
+ IntuiMessage *msg = _event->getMsg();
+ if (shouldQuit()) {
+ _quitLab = true;
+ return;
+ }
+
+ if (!msg) {
+ updateMusicAndEvents();
+ } else {
+ uint32 msgClass = msg->_msgClass;
+ uint16 mouseX = msg->_mouse.x;
+ uint16 mouseY = msg->_mouse.y;
+ uint16 code = msg->_code;
+
+ if ((msgClass == kMessageRightClick) ||
+ ((msgClass == kMessageRawKey) && (code == Common::KEYCODE_ESCAPE)))
+ return;
+ else if (msgClass == kMessageLeftClick) {
+ if ((mouseY >= _utils->vgaScaleY(171)) && (mouseY <= _utils->vgaScaleY(200))) {
+ if (mouseX <= _utils->vgaScaleX(31)) {
+ return;
+ } else if (mouseX <= _utils->vgaScaleX(59)) {
+ if (isInteractive) {
+ _monitorPage = 0;
+
+ if (depth) {
+ depth--;
+ _closeDataPtr = lastClosePtr[depth];
+ }
+ } else if (_monitorPage > 0) {
+ _monitorPage = 0;
+ drawMonText(ntext, monitorFont, textRect, isInteractive);
+ }
+ } else if (mouseX < _utils->vgaScaleX(259)) {
+ return;
+ } else if (mouseX <= _utils->vgaScaleX(289)) {
+ if (!_lastPage) {
+ _monitorPage += 1;
+ drawMonText(ntext, monitorFont, textRect, isInteractive);
+ }
+ } else if (_monitorPage >= 1) {
+ // mouseX between 290 and 320 (scaled)
+ _monitorPage -= 1;
+ drawMonText(ntext, monitorFont, textRect, isInteractive);
+ }
+ } else if (isInteractive) {
+ CloseDataPtr tmpClosePtr = _closeDataPtr;
+ mouseY = 64 + (mouseY / _monitorButtonHeight) * 42;
+ mouseX = 101;
+ setCurrentClose(Common::Point(mouseX, mouseY), &_closeDataPtr, false);
+
+ if (tmpClosePtr != _closeDataPtr) {
+ lastClosePtr[depth] = tmpClosePtr;
+ depth++;
+ }
+ }
+ }
+ }
+ }
+}
+
+void LabEngine::doMonitor(const Common::String background, const Common::String textfile, bool isinteractive, Common::Rect textRect) {
+ Common::Rect scaledRect = _utils->vgaRectScale(textRect.left, textRect.top, textRect.right, textRect.bottom);
+ _monitorTextFilename = textfile;
+
+ _graphics->blackAllScreen();
+ _graphics->readPict("P:Mon/Monitor.1");
+ _graphics->readPict("P:Mon/NWD1");
+ _graphics->readPict("P:Mon/NWD2");
+ _graphics->readPict("P:Mon/NWD3");
+ _graphics->blackAllScreen();
+
+ _monitorPage = 0;
+ _lastPage = false;
+ _graphics->_fadePalette = _highPalette;
+
+ TextFont *monitorFont = _resource->getFont("F:Map.fon");
+ Common::File *buttonFile = _resource->openDataFile("P:MonImage");
+ _monitorButton = new Image(buttonFile, this);
+ delete buttonFile;
+
+ Common::String ntext = _resource->getText(textfile);
+ _graphics->loadBackPict(background, _highPalette);
+ drawMonText(ntext.c_str(), monitorFont, scaledRect, isinteractive);
+ _event->mouseShow();
+ _graphics->fade(true);
+ processMonitor(ntext.c_str(), monitorFont, isinteractive, scaledRect);
+ _graphics->fade(false);
+ _event->mouseHide();
+ _graphics->freeFont(&monitorFont);
+
+ _graphics->rectFill(0, 0, _graphics->_screenWidth - 1, _graphics->_screenHeight - 1, 0);
+ _graphics->blackAllScreen();
+ _graphics->freePict();
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/tilepuzzle.cpp b/engines/lab/tilepuzzle.cpp
new file mode 100644
index 0000000000..8f21cee4b4
--- /dev/null
+++ b/engines/lab/tilepuzzle.cpp
@@ -0,0 +1,399 @@
+/* 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.
+ *
+ */
+
+ /*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "common/file.h"
+
+#include "gui/message.h"
+
+#include "lab/lab.h"
+#include "lab/anim.h"
+#include "lab/dispman.h"
+#include "lab/image.h"
+#include "lab/labsets.h"
+#include "lab/resource.h"
+#include "lab/tilepuzzle.h"
+#include "lab/utils.h"
+
+namespace Lab {
+
+#define BRICKOPEN 115
+#define COMBINATIONUNLOCKED 130
+
+enum TileScroll {
+ kScrollLeft = 1,
+ kScrollRight = 2,
+ kScrollUp = 3,
+ kScrollDown = 4
+};
+
+const uint16 INIT_TILE[4][4] = {
+ { 1, 5, 9, 13 },
+ { 2, 6, 10, 14 },
+ { 3, 7, 11, 15 },
+ { 4, 8, 12, 0 }
+};
+
+const uint16 SOLUTION[4][4] = {
+ { 7, 1, 8, 3 },
+ { 2, 11, 15, 4 },
+ { 9, 5, 14, 6 },
+ { 10, 13, 12, 0 }
+};
+
+const int COMBINATION_X[6] = { 45, 83, 129, 166, 211, 248 };
+
+TilePuzzle::TilePuzzle(LabEngine *vm) : _vm(vm) {
+ for (int i = 0; i < 16; i++)
+ _tiles[i] = nullptr;
+
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++)
+ _curTile[i][j] = INIT_TILE[i][j];
+ }
+
+ for (int i = 0; i < 6; i++)
+ _combination[i] = 0;
+
+ for (int i = 0; i < 10; i++)
+ _numberImages[i] = nullptr;
+}
+
+TilePuzzle::~TilePuzzle() {
+ for (int i = 0; i < 16; i++)
+ delete _tiles[i];
+
+ for (int imgIdx = 0; imgIdx < 10; imgIdx++) {
+ delete _numberImages[imgIdx];
+ _numberImages[imgIdx] = nullptr;
+ }
+}
+
+void TilePuzzle::mouseTile(Common::Point pos) {
+ Common::Point realPos = _vm->_utils->vgaUnscale(pos);
+
+ if ((realPos.x < 101) || (realPos.y < 26))
+ return;
+
+ int tileX = (realPos.x - 101) / 30;
+ int tileY = (realPos.y - 26) / 25;
+
+ if ((tileX < 4) && (tileY < 4))
+ changeTile(tileX, tileY);
+}
+
+void TilePuzzle::changeTile(uint16 col, uint16 row) {
+ int16 scrolltype = -1;
+
+ if (row > 0) {
+ if (_curTile[col][row - 1] == 0) {
+ _curTile[col][row - 1] = _curTile[col][row];
+ _curTile[col][row] = 0;
+ scrolltype = kScrollDown;
+ }
+ }
+
+ if (col > 0) {
+ if (_curTile[col - 1][row] == 0) {
+ _curTile[col - 1][row] = _curTile[col][row];
+ _curTile[col][row] = 0;
+ scrolltype = kScrollRight;
+ }
+ }
+
+ if (row < 3) {
+ if (_curTile[col][row + 1] == 0) {
+ _curTile[col][row + 1] = _curTile[col][row];
+ _curTile[col][row] = 0;
+ scrolltype = kScrollUp;
+ }
+ }
+
+ if (col < 3) {
+ if (_curTile[col + 1][row] == 0) {
+ _curTile[col + 1][row] = _curTile[col][row];
+ _curTile[col][row] = 0;
+ scrolltype = kScrollLeft;
+ }
+ }
+
+ if (scrolltype != -1) {
+ if (_vm->getFeatures() & GF_WINDOWS_TRIAL) {
+ GUI::MessageDialog trialMessage("This puzzle is not available in the trial version of the game");
+ trialMessage.runModal();
+ return;
+ }
+
+ doTileScroll(col, row, scrolltype);
+ bool check = true;
+ row = 0;
+ col = 0;
+
+ while (row < 4) {
+ while (col < 4) {
+ check &= (_curTile[row][col] == SOLUTION[row][col]);
+ col++;
+ }
+
+ row++;
+ col = 0;
+ }
+
+ if (check) {
+ // unlocked combination
+ _vm->_conditions->inclElement(BRICKOPEN);
+ _vm->_anim->_doBlack = true;
+ _vm->_graphics->readPict("p:Up/BDOpen");
+ }
+ }
+}
+
+void TilePuzzle::mouseCombination(Common::Point pos) {
+ Common::Point realPos = _vm->_utils->vgaUnscale(pos);
+
+ if (!Common::Rect(44, 63, 285, 99).contains(realPos))
+ return;
+
+ uint16 number = 0;
+ if (realPos.x < 83)
+ number = 0;
+ else if (realPos.x < 127)
+ number = 1;
+ else if (realPos.x < 165)
+ number = 2;
+ else if (realPos.x < 210)
+ number = 3;
+ else if (realPos.x < 245)
+ number = 4;
+ else if (realPos.x < 286)
+ number = 5;
+
+ changeCombination(number);
+}
+
+void TilePuzzle::doTile(bool showsolution) {
+ uint16 row = 0, col = 0, rowm, colm, num;
+ int16 rows, cols;
+
+ if (showsolution) {
+ rowm = _vm->_utils->vgaScaleY(23);
+ colm = _vm->_utils->vgaScaleX(27);
+
+ rows = _vm->_utils->vgaScaleY(31);
+ cols = _vm->_utils->vgaScaleX(105);
+ } else {
+ _vm->_graphics->rectFillScaled(97, 22, 220, 126, 0);
+
+ rowm = _vm->_utils->vgaScaleY(25);
+ colm = _vm->_utils->vgaScaleX(30);
+
+ rows = _vm->_utils->vgaScaleY(25);
+ cols = _vm->_utils->vgaScaleX(100);
+ }
+
+ while (row < 4) {
+ while (col < 4) {
+ if (showsolution)
+ num = SOLUTION[col][row];
+ else
+ num = _curTile[col][row];
+
+ if (showsolution || num)
+ _tiles[num]->drawImage(cols + (col * colm), rows + (row * rowm));
+
+ col++;
+ }
+
+ row++;
+ col = 0;
+ }
+}
+
+void TilePuzzle::showTile(const Common::String filename, bool showSolution) {
+ _vm->_anim->_doBlack = true;
+ _vm->_anim->_noPalChange = true;
+ _vm->_graphics->readPict(filename);
+ _vm->_anim->_noPalChange = false;
+ _vm->_graphics->blackScreen();
+
+ Common::File *tileFile = _vm->_resource->openDataFile(showSolution ? "P:TileSolution" : "P:Tile");
+
+ int start = showSolution ? 0 : 1;
+
+ for (int curBit = start; curBit < 16; curBit++)
+ _tiles[curBit] = new Image(tileFile, _vm);
+
+ delete tileFile;
+
+ doTile(showSolution);
+ _vm->_graphics->setPalette(_vm->_anim->_diffPalette, 256);
+}
+
+void TilePuzzle::doTileScroll(uint16 col, uint16 row, uint16 scrolltype) {
+ int16 dX = 0, dY = 0, dx = 0, dy = 0, sx = 0, sy = 0;
+ int last = 0;
+
+ if (scrolltype == kScrollLeft) {
+ dX = _vm->_utils->vgaScaleX(5);
+ sx = _vm->_utils->vgaScaleX(5);
+ last = 6;
+ } else if (scrolltype == kScrollRight) {
+ dX = _vm->_utils->vgaScaleX(-5);
+ dx = _vm->_utils->vgaScaleX(-5);
+ sx = _vm->_utils->vgaScaleX(5);
+ last = 6;
+ } else if (scrolltype == kScrollUp) {
+ dY = _vm->_utils->vgaScaleY(5);
+ sy = _vm->_utils->vgaScaleY(5);
+ last = 5;
+ } else if (scrolltype == kScrollDown) {
+ dY = _vm->_utils->vgaScaleY(-5);
+ dy = _vm->_utils->vgaScaleY(-5);
+ sy = _vm->_utils->vgaScaleY(5);
+ last = 5;
+ }
+
+ sx += _vm->_utils->svgaCord(2);
+
+ uint16 x1 = _vm->_utils->vgaScaleX(100) + (col * _vm->_utils->vgaScaleX(30)) + dx;
+ uint16 y1 = _vm->_utils->vgaScaleY(25) + (row * _vm->_utils->vgaScaleY(25)) + dy;
+
+ byte *buffer = new byte[_tiles[1]->_width * _tiles[1]->_height * 2];
+
+ for (int i = 0; i < last; i++) {
+ _vm->waitTOF();
+ scrollRaster(dX, dY, x1, y1, x1 + _vm->_utils->vgaScaleX(28) + sx, y1 + _vm->_utils->vgaScaleY(23) + sy, buffer);
+ x1 += dX;
+ y1 += dY;
+ }
+
+ delete[] buffer;
+}
+
+void TilePuzzle::changeCombination(uint16 number) {
+ const int solution[6] = { 0, 4, 0, 8, 7, 2 };
+
+ Image display(_vm);
+
+ if (_combination[number] < 9)
+ (_combination[number])++;
+ else
+ _combination[number] = 0;
+
+ uint16 combnum = _combination[number];
+
+ display._imageData = _vm->_graphics->getCurrentDrawingBuffer();
+ display._width = _vm->_graphics->_screenWidth;
+ display._height = _vm->_graphics->_screenHeight;
+
+ byte *buffer = new byte[_tiles[1]->_width * _tiles[1]->_height * 2];
+
+ for (int i = 1; i <= (_numberImages[combnum]->_height / 2); i++) {
+ if (_vm->_isHiRes) {
+ if (i & 1)
+ _vm->waitTOF();
+ } else
+ _vm->waitTOF();
+
+ display._imageData = _vm->_graphics->getCurrentDrawingBuffer();
+ _vm->_graphics->scrollDisplayY(2, _vm->_utils->vgaScaleX(COMBINATION_X[number]), _vm->_utils->vgaScaleY(65), _vm->_utils->vgaScaleX(COMBINATION_X[number]) + (_numberImages[combnum])->_width - 1, _vm->_utils->vgaScaleY(65) + (_numberImages[combnum])->_height, buffer);
+ _numberImages[combnum]->blitBitmap(0, (_numberImages[combnum])->_height - (2 * i), &(display), _vm->_utils->vgaScaleX(COMBINATION_X[number]), _vm->_utils->vgaScaleY(65), (_numberImages[combnum])->_width, 2, false);
+ }
+
+ // Prevent the Image destructor from deleting the display buffer
+ display._imageData = nullptr;
+
+ delete[] buffer;
+
+ bool unlocked = true;
+ for (int i = 0; i < 6; i++)
+ unlocked &= (_combination[i] == solution[i]);
+
+ if (unlocked)
+ _vm->_conditions->inclElement(COMBINATIONUNLOCKED);
+ else
+ _vm->_conditions->exclElement(COMBINATIONUNLOCKED);
+}
+
+void TilePuzzle::scrollRaster(int16 dx, int16 dy, uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte *buffer) {
+ if (dx)
+ _vm->_graphics->scrollDisplayX(dx, x1, y1, x2, y2, buffer);
+
+ if (dy)
+ _vm->_graphics->scrollDisplayY(dy, x1, y1, x2, y2, buffer);
+}
+
+void TilePuzzle::doCombination() {
+ for (int i = 0; i <= 5; i++)
+ _numberImages[_combination[i]]->drawImage(_vm->_utils->vgaScaleX(COMBINATION_X[i]), _vm->_utils->vgaScaleY(65));
+}
+
+void TilePuzzle::showCombination(const Common::String filename) {
+ _vm->_anim->_doBlack = true;
+ _vm->_anim->_noPalChange = true;
+ _vm->_graphics->readPict(filename);
+ _vm->_anim->_noPalChange = false;
+
+ _vm->_graphics->blackScreen();
+
+ Common::File *numFile = _vm->_resource->openDataFile("P:Numbers");
+
+ for (int CurBit = 0; CurBit < 10; CurBit++)
+ _numberImages[CurBit] = new Image(numFile, _vm);
+
+ delete numFile;
+
+ doCombination();
+
+ _vm->_graphics->setPalette(_vm->_anim->_diffPalette, 256);
+}
+
+void TilePuzzle::save(Common::OutSaveFile *file) {
+ // Combination lock and tile stuff
+ for (int i = 0; i < 6; i++)
+ file->writeByte(_combination[i]);
+
+ // Tiles
+ for (int i = 0; i < 4; i++)
+ for (int j = 0; j < 4; j++)
+ file->writeUint16LE(_curTile[i][j]);
+}
+
+void TilePuzzle::load(Common::InSaveFile *file) {
+ // Combination lock and tile stuff
+ for (int i = 0; i < 6; i++)
+ _combination[i] = file->readByte();
+
+ // Tiles
+ for (int i = 0; i < 4; i++)
+ for (int j = 0; j < 4; j++)
+ _curTile[i][j] = file->readUint16LE();
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/tilepuzzle.h b/engines/lab/tilepuzzle.h
new file mode 100644
index 0000000000..dd4abba8ec
--- /dev/null
+++ b/engines/lab/tilepuzzle.h
@@ -0,0 +1,104 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#ifndef LAB_TILEPUZZLE_H
+#define LAB_TILEPUZZLE_H
+
+#include "common/savefile.h"
+
+namespace Lab {
+
+class LabEngine;
+
+class TilePuzzle {
+private:
+ LabEngine *_vm;
+ Image *_tiles[16];
+ Image *_numberImages[10];
+ uint16 _curTile[4][4];
+ byte _combination[6];
+
+public:
+ TilePuzzle(LabEngine *vm);
+ virtual ~TilePuzzle();
+
+ /**
+ * Processes mouse clicks and changes the combination.
+ */
+ void mouseTile(Common::Point pos);
+
+ /**
+ * Processes mouse clicks and changes the combination.
+ */
+ void mouseCombination(Common::Point pos);
+
+ /**
+ * Reads in a backdrop picture.
+ */
+ void showCombination(const Common::String filename);
+
+ /**
+ * Reads in a backdrop picture.
+ */
+ void showTile(const Common::String filename, bool showSolution);
+ void save(Common::OutSaveFile *file);
+ void load(Common::InSaveFile *file);
+
+private:
+ /**
+ * Changes the combination number of one of the slots
+ */
+ void changeCombination(uint16 number);
+
+ /**
+ * Changes the combination number of one of the slots
+ */
+ void changeTile(uint16 col, uint16 row);
+
+ /**
+ * Draws the images of the combination lock to the display bitmap.
+ */
+ void doCombination();
+
+ /**
+ * Draws the images of the combination lock to the display bitmap.
+ */
+ void doTile(bool showsolution);
+
+ /**
+ * Does the scrolling for the tiles on the tile puzzle.
+ */
+ void doTileScroll(uint16 col, uint16 row, uint16 scrolltype);
+ void scrollRaster(int16 dx, int16 dy, uint16 x1, uint16 y1, uint16 x2, uint16 y2, byte *buffer);
+};
+
+} // End of namespace Lab
+
+#endif // LAB_TILEPUZZLE_H
diff --git a/engines/lab/utils.cpp b/engines/lab/utils.cpp
new file mode 100644
index 0000000000..a1409d231b
--- /dev/null
+++ b/engines/lab/utils.cpp
@@ -0,0 +1,272 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#include "common/file.h"
+
+#include "lab/lab.h"
+#include "lab/utils.h"
+
+namespace Lab {
+Utils::Utils(LabEngine *vm) : _vm(vm), _rnd("lab") {
+ _dataBytesPerRow = 0;
+}
+
+uint16 Utils::scaleX(uint16 x) {
+ if (_vm->_isHiRes)
+ return (uint16)((x * 16) / 9);
+ else
+ return (uint16)((x * 8) / 9);
+}
+
+uint16 Utils::scaleY(uint16 y) {
+ if (_vm->_isHiRes)
+ return (y + (y / 14));
+ else
+ return ((y * 10) / 24);
+}
+
+Common::Rect Utils::rectScale(int16 x1, int16 y1, int16 x2, int16 y2) {
+ return Common::Rect(scaleX(x1), scaleY(y1), scaleX(x2), scaleY(y2));
+}
+
+uint16 Utils::mapScaleX(uint16 x) {
+ if (_vm->_isHiRes)
+ return (x - 45);
+ else
+ return ((x - 45) >> 1);
+}
+
+uint16 Utils::mapScaleY(uint16 y) {
+ if (_vm->_isHiRes)
+ return y;
+ else
+ return ((y - 35) >> 1) - (y >> 6);
+}
+
+Common::Rect Utils::mapRectScale(int16 x1, int16 y1, int16 x2, int16 y2) {
+ return Common::Rect(mapScaleX(x1), mapScaleY(y1), mapScaleX(x2), mapScaleY(y2));
+}
+
+int16 Utils::vgaScaleX(int16 x) {
+ if (_vm->_isHiRes)
+ return (x * 2);
+ else
+ return x;
+}
+
+int16 Utils::vgaScaleY(int16 y) {
+ if (_vm->_isHiRes)
+ return ((y * 12) / 5);
+ else
+ return y;
+}
+
+Common::Rect Utils::vgaRectScale(int16 x1, int16 y1, int16 x2, int16 y2) {
+ return Common::Rect(vgaScaleX(x1), vgaScaleY(y1), vgaScaleX(x2), vgaScaleY(y2));
+}
+
+uint16 Utils::svgaCord(uint16 cord) {
+ if (_vm->_isHiRes)
+ return cord;
+ else
+ return 0;
+}
+
+Common::Point Utils::vgaUnscale(Common::Point pos) {
+ Common::Point result;
+ if (_vm->_isHiRes) {
+ result.x = pos.x / 2;
+ result.y = (pos.y * 5) / 12;
+ } else
+ result = pos;
+
+ return result;
+}
+
+template<typename T>
+void Utils::unDiff(T *dest, Common::File *sourceFile) {
+ byte bytesPerWord = sizeof(T);
+
+ while (1) {
+ uint16 skip = sourceFile->readByte();
+ uint16 copy = sourceFile->readByte();
+
+ if (skip == 255) {
+ if (copy == 0) {
+ skip = sourceFile->readUint16LE();
+ copy = sourceFile->readUint16LE();
+ } else if (copy == 255)
+ return;
+ }
+
+ dest += skip;
+
+ if (bytesPerWord == 1) {
+ sourceFile->read(dest, copy);
+ dest += copy;
+ } else {
+ while (copy) {
+ *dest = sourceFile->readUint16LE();
+ dest++;
+ copy--;
+ }
+ }
+ }
+}
+
+template<typename T>
+void Utils::verticalUnDiff(T *dest, Common::File *sourceFile, uint16 bytesPerRow) {
+ uint16 counter = 0;
+ byte bytesPerWord = sizeof(T);
+ uint16 wordsPerRow = bytesPerRow / bytesPerWord;
+
+ while (counter < wordsPerRow) {
+ T *curPtr = dest + counter;
+
+ for (;;) {
+ uint16 skip = sourceFile->readByte();
+ uint16 copy = sourceFile->readByte();
+
+ if (skip == 255) {
+ counter += copy;
+ break;
+ } else {
+ curPtr += (skip * wordsPerRow);
+
+ while (copy) {
+ if (bytesPerWord == 1)
+ *curPtr++ = sourceFile->readByte();
+ else if (bytesPerWord == 2)
+ *curPtr = sourceFile->readUint16LE();
+ else if (bytesPerWord == 4)
+ *curPtr = sourceFile->readUint32LE();
+ else
+ error("verticalUnDiff: Invalid bytesPerWord (%d)", bytesPerWord);
+ curPtr += wordsPerRow;
+ copy--;
+ }
+ }
+ }
+ }
+}
+
+void Utils::runLengthDecode(byte *dest, Common::File *sourceFile) {
+ int8 num;
+ int16 count;
+
+ while (1) {
+ num = sourceFile->readSByte();
+
+ if (num == 127) {
+ return;
+ } else if (num > '\0') {
+ sourceFile->read(dest, num);
+ dest += num;
+ } else {
+ count = (int16)(-num);
+ num = sourceFile->readSByte();
+
+ while (count) {
+ *dest = num;
+ dest++;
+ count--;
+ }
+ }
+ }
+}
+
+void Utils::verticalRunLengthDecode(byte *dest, Common::File *sourceFile, uint16 bytesPerRow) {
+ int16 count;
+ byte *top = dest;
+
+ for (int i = 0; i < _dataBytesPerRow; i++) {
+ dest = top;
+ dest += i;
+
+ int8 num = sourceFile->readSByte();
+
+ while (num != 127) {
+ if (num > '\0') {
+ while (num) {
+ *dest = sourceFile->readByte();
+ dest += bytesPerRow;
+ num--;
+ }
+ } else {
+ count = (int16)(-num);
+ num = sourceFile->readSByte();
+
+ while (count) {
+ *dest = num;
+ dest += bytesPerRow;
+ count--;
+ }
+ }
+
+ num = sourceFile->readSByte();
+ }
+ }
+}
+
+void Utils::unDiff(byte *newBuf, byte *oldBuf, Common::File *sourceFile, uint16 bytesPerRow, bool isVertical) {
+ sourceFile->skip(1);
+ byte bufType = sourceFile->readByte();
+
+ if (isVertical) {
+ if (bufType == 0)
+ verticalUnDiff<byte>(newBuf, sourceFile, bytesPerRow);
+ else if (bufType == 1)
+ verticalUnDiff<uint16>((uint16 *)newBuf, sourceFile, bytesPerRow);
+ else if (bufType == 3)
+ verticalUnDiff<uint32>((uint32 *)newBuf, sourceFile, bytesPerRow);
+ else
+ error("Unexpected variable compression scheme %d", bufType);
+ } else {
+ if (bufType == 0)
+ unDiff<byte>(newBuf, sourceFile);
+ else if (bufType == 1)
+ unDiff<uint16>((uint16 *)newBuf, sourceFile);
+ else
+ error("Unexpected compression scheme %d", bufType);
+ }
+}
+
+void Utils::setBytesPerRow(int num) {
+ _dataBytesPerRow = num;
+}
+
+uint16 Utils::getRandom(uint16 max) {
+ if (max > 1)
+ return _rnd.getRandomNumber(max - 1);
+ else
+ return 0;
+}
+
+} // End of namespace Lab
diff --git a/engines/lab/utils.h b/engines/lab/utils.h
new file mode 100644
index 0000000000..a7bb42007e
--- /dev/null
+++ b/engines/lab/utils.h
@@ -0,0 +1,105 @@
+/* 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.
+ *
+ */
+
+/*
+ * This code is based on Labyrinth of Time code with assistance of
+ *
+ * Copyright (c) 1993 Terra Nova Development
+ * Copyright (c) 2004 The Wyrmkeep Entertainment Co.
+ *
+ */
+
+#ifndef LAB_UTILS_H
+#define LAB_UTILS_H
+
+namespace Lab {
+
+class Utils {
+private:
+ LabEngine *_vm;
+ uint16 _dataBytesPerRow;
+
+ /**
+ * Undiffs a piece of memory based on the header size.
+ */
+ template<typename T>
+ void unDiff(T *dest, Common::File *sourceFile);
+
+ /**
+ * Undiffs a piece of memory when header size is a byte, and copy/skip size
+ * is a byte or a word or a double word.
+ */
+ template<typename T>
+ void verticalUnDiff(T *dest, Common::File *sourceFile, uint16 bytesPerRow);
+
+public:
+ Utils(LabEngine *vm);
+
+ Common::RandomSource _rnd;
+
+ /**
+ * Scales the x co-ordinates to that of the new display. In the room parser
+ * file, co-ordinates are set up on a 360x336 display.
+ */
+ uint16 scaleX(uint16 x);
+
+ /**
+ * Scales the y co-ordinates to that of the new display. In the room parser
+ * file, co-ordinates are set up on a 368x336 display.
+ */
+ uint16 scaleY(uint16 y);
+ Common::Rect rectScale(int16 x1, int16 y1, int16 x2, int16 y2);
+
+ /**
+ * Scales the VGA x coords to SVGA if necessary; otherwise, returns VGA coords.
+ */
+ int16 vgaScaleX(int16 x);
+
+ /**
+ * Scales the VGA y coords to SVGA if necessary; otherwise, returns VGA coords.
+ */
+ int16 vgaScaleY(int16 y);
+ Common::Rect vgaRectScale(int16 x1, int16 y1, int16 x2, int16 y2);
+ uint16 svgaCord(uint16 cord);
+ uint16 mapScaleX(uint16 x);
+ uint16 mapScaleY(uint16 y);
+ Common::Rect mapRectScale(int16 x1, int16 y1, int16 x2, int16 y2);
+
+ /**
+ * Converts SVGA coords to VGA if necessary, otherwise returns VGA coords.
+ */
+ Common::Point vgaUnscale(Common::Point pos);
+
+ /**
+ * Does the undiffing between the bitmaps.
+ */
+ void unDiff(byte *newBuf, byte *oldBuf, Common::File *sourceFile, uint16 bytesPerRow, bool isVertical);
+ void runLengthDecode(byte *dest, Common::File *sourceFile);
+ void verticalRunLengthDecode(byte *dest, Common::File *sourceFile, uint16 bytesPerRow);
+ void setBytesPerRow(int num);
+ uint16 getRandom(uint16 max);
+};
+
+
+} // End of namespace Lab
+
+#endif // LAB_UTILS_H
diff --git a/engines/lastexpress/game/savegame.cpp b/engines/lastexpress/game/savegame.cpp
index d9f2993c17..e2682ba0d1 100644
--- a/engines/lastexpress/game/savegame.cpp
+++ b/engines/lastexpress/game/savegame.cpp
@@ -497,9 +497,6 @@ void SaveLoad::loadLastGame() {
return;
}
- if (!_savegame)
- error("[SaveLoad::loadGame] No savegame stream present");
-
// Load the last entry
_savegame->seek(header.offsetEntry);
diff --git a/engines/lure/res.cpp b/engines/lure/res.cpp
index 6b2705463d..7a79f48b87 100644
--- a/engines/lure/res.cpp
+++ b/engines/lure/res.cpp
@@ -44,6 +44,10 @@ Resources::Resources() : _rnd(LureEngine::getReference().rnd()) {
MemoryBlock *mb = Disk::getReference().getEntry(STRING_LIST_RESOURCE_ID);
_stringList.load(mb);
delete mb;
+
+ // WORKAROUND: In Spanish the look "Obsevar" should be "Observar"
+ if (!Common::String(_stringList.getString(LOOK)).compareTo("Obsevar"))
+ _stringList.setString(LOOK, "Observar");
}
Resources::~Resources() {
diff --git a/engines/lure/res_struct.cpp b/engines/lure/res_struct.cpp
index 5a4761c87b..ec1a546d05 100644
--- a/engines/lure/res_struct.cpp
+++ b/engines/lure/res_struct.cpp
@@ -1217,26 +1217,19 @@ void BarmanLists::loadFromStream(Common::ReadStream *stream) {
// String list resource class
void StringList::load(MemoryBlock *data) {
- _data = Memory::allocate(data->size());
- _data->copyFrom(data);
+ // Get the number of entries
+ uint numEntries = READ_LE_UINT16(data->data());
- _numEntries = READ_LE_UINT16(_data->data());
- char *p = (char *) _data->data() + sizeof(uint16);
-
- _entries = (char **) Memory::alloc(_numEntries * sizeof(char *));
-
- for (int index = 0; index < _numEntries; ++index) {
- _entries[index] = p;
+ // Iterate through loading the strings one at a time
+ const char *p = (const char *)data->data() + sizeof(uint16);
+ for (uint index = 0; index < numEntries; ++index) {
+ _entries.push_back(p);
p += strlen(p) + 1;
}
}
void StringList::clear() {
- if (_numEntries != 0) {
- Memory::dealloc(_entries);
- delete _data;
- _numEntries = 0;
- }
+ _entries.clear();
}
// Field list and miscellaneous variables
diff --git a/engines/lure/res_struct.h b/engines/lure/res_struct.h
index 9190912f5b..685c55ab13 100644
--- a/engines/lure/res_struct.h
+++ b/engines/lure/res_struct.h
@@ -28,6 +28,7 @@
#include "common/list.h"
#include "common/file.h"
#include "common/ptr.h"
+#include "common/str-array.h"
#include "common/textconsole.h"
namespace Lure {
@@ -850,22 +851,19 @@ enum StringEnum {S_CREDITS = 25, S_RESTART_GAME = 26, S_SAVE_GAME = 27, S_RESTOR
class StringList {
private:
- MemoryBlock *_data;
- int _numEntries;
- char **_entries;
+ Common::StringArray _entries;
public:
- StringList() { _numEntries = 0; }
- ~StringList() { clear(); }
+ StringList() {}
void load(MemoryBlock *data);
void clear();
- int count() { return _numEntries; }
+ int count() { return _entries.size(); }
const char *getString(int index) {
- if ((index < 0) || (index >= _numEntries)) error("Invalid index specified to String List");
- return _entries[index];
+ return _entries[index].c_str();
}
const char *getString(Action action) { return getString((int) action - 1); }
const char *getString(StringEnum sEnum) { return getString((int) sEnum); }
+ void setString(Action action, const Common::String &s) { _entries[(int)action - 1] = s; }
};
// The following class holds the field list used by the script engine as
diff --git a/engines/mads/animation.cpp b/engines/mads/animation.cpp
index e4f44fc308..605c63e91d 100644
--- a/engines/mads/animation.cpp
+++ b/engines/mads/animation.cpp
@@ -162,6 +162,7 @@ Animation::Animation(MADSEngine *vm, Scene *scene) : _vm(vm), _scene(scene) {
_flags = 0;
_font = nullptr;
_resetFlag = false;
+ _canChangeView = false;
_messageCtr = 0;
_skipLoad = false;
_freeFlag = false;
@@ -177,6 +178,7 @@ Animation::Animation(MADSEngine *vm, Scene *scene) : _vm(vm), _scene(scene) {
_oldFrameEntry = 0;
_rgbResult = -1;
_palIndex1 = _palIndex2 = -1;
+ _dynamicHotspotIndex = -1;
}
Animation::~Animation() {
@@ -375,6 +377,7 @@ void Animation::loadFrame(int frameNumber) {
pt.x = _unkList[_unkIndex].x;
pt.y = _unkList[_unkIndex].y;
_unkIndex = 1 - _unkIndex;
+ warning("LoadFrame - Using unknown array");
}
if (drawFrame(spriteSet, pt, frameNumber))
@@ -463,21 +466,25 @@ void Animation::update() {
scene._spriteSlots.fullRefresh();
}
- // Handle any offset adjustment for sprites as of this frame
- bool paChanged = false;
- if (scene._posAdjust.x != misc._posAdjust.x) {
- scene._posAdjust.x = misc._posAdjust.x;
- paChanged = true;
- }
- if (scene._posAdjust.y != misc._posAdjust.y) {
- scene._posAdjust.y = misc._posAdjust.y;
- paChanged = true;
- }
+ bool isV2 = (_vm->getGameID() != GType_RexNebular);
+ if (isV2 && _canChangeView) {
+ // Handle any offset adjustment for sprites as of this frame
+ bool paChanged = false;
+ if (getFramePosAdjust(_currentFrame).x != scene._posAdjust.x) {
+ scene._posAdjust.x = getFramePosAdjust(_currentFrame).x;
+ paChanged = true;
+ }
+
+ if (getFramePosAdjust(_currentFrame).y != scene._posAdjust.y) {
+ scene._posAdjust.y = getFramePosAdjust(_currentFrame).y;
+ paChanged = true;
+ }
- if (paChanged) {
- int newIndex = scene._spriteSlots.add();
- scene._spriteSlots[newIndex]._seqIndex = -1;
- scene._spriteSlots[newIndex]._flags = IMG_REFRESH;
+ if (paChanged) {
+ int newIndex = scene._spriteSlots.add();
+ scene._spriteSlots[newIndex]._seqIndex = -1;
+ scene._spriteSlots[newIndex]._flags = IMG_REFRESH;
+ }
}
// Main frame animation loop - frames get animated by being placed, as necessary, into the
@@ -598,8 +605,8 @@ void Animation::setCurrentFrame(int frameNumber) {
_freeFlag = false;
}
-void Animation::setNextFrameTimer(int frameNumber) {
- _nextFrameTimer = frameNumber;
+void Animation::setNextFrameTimer(uint32 newTimer) {
+ _nextFrameTimer = newTimer;
}
void Animation::eraseSprites() {
@@ -611,4 +618,9 @@ void Animation::eraseSprites() {
}
}
+Common::Point Animation::getFramePosAdjust(int idx) {
+ warning("TODO: Implement getFramePosAdjust");
+
+ return Common::Point(0, 0);
+}
} // End of namespace MADS
diff --git a/engines/mads/animation.h b/engines/mads/animation.h
index 46ef85c5eb..a6a4cfbc8b 100644
--- a/engines/mads/animation.h
+++ b/engines/mads/animation.h
@@ -34,11 +34,12 @@
namespace MADS {
enum AnimFlag {
- ANIMFLAG_DITHER = 0x1000, // Dither to 16 colors
- ANIMFLAG_CUSTOM_FONT = 0x2000, // Load ccustom font
- ANIMFLAG_LOAD_BACKGROUND = 0x0100, // Load background
+ ANIMFLAG_LOAD_BACKGROUND = 0x0100, // Load background
ANIMFLAG_LOAD_BACKGROUND_ONLY = 0x0200, // Load background only
- ANIMFLAG_ANIMVIEW = 0x4000 // Cutscene animation
+
+ ANIMFLAG_DITHER = 0x0001, // Dither to 16 colors
+ ANIMFLAG_CUSTOM_FONT = 0x2000, // Load custom fonts
+ ANIMFLAG_ANIMVIEW = 0x4000 // Cutscene animation
};
enum AnimBgType {
@@ -189,8 +190,10 @@ public:
Common::Array<AnimUIEntry> _uiEntries;
Common::Array<AnimMessage> _messages;
bool _resetFlag;
+ bool _canChangeView;
int _currentFrame;
int _oldFrameEntry;
+ int _dynamicHotspotIndex;
static Animation *init(MADSEngine *vm, Scene *scene);
/*
@@ -224,8 +227,8 @@ public:
*/
void eraseSprites();
- void setNextFrameTimer(int frameNumber);
- int getNextFrameTimer() const { return _nextFrameTimer; }
+ void setNextFrameTimer(uint32 newTimer);
+ uint32 getNextFrameTimer() const { return _nextFrameTimer; }
void setCurrentFrame(int frameNumber);
int getCurrentFrame() const { return _currentFrame; }
@@ -235,6 +238,8 @@ public:
void resetSpriteSetsCount() { _header._spriteSetsCount = 0; } // CHECKME: See if it doesn't leak the memory when the destructor is called
SpriteAsset *getSpriteSet(int idx) { return _spriteSets[idx]; }
+
+ Common::Point getFramePosAdjust(int idx);
};
} // End of namespace MADS
diff --git a/engines/mads/assets.h b/engines/mads/assets.h
index 8a0dc2cd44..0aae534498 100644
--- a/engines/mads/assets.h
+++ b/engines/mads/assets.h
@@ -99,8 +99,9 @@ public:
int getCount() { return _frameCount; }
int getFrameRate() const { return _frameRate; }
int getPixelSpeed() const { return _pixelSpeed; }
- int getFrameWidth(int index);
- int getFrameHeight(int index);
+ Common::Point getFramePos(int index) { assert (index < _frameCount); return Common::Point(_frames[index]._bounds.left, _frames[index]._bounds.top); }
+ int getFrameWidth(int index) { assert (index < _frameCount); return _frames[index]._bounds.width(); }
+ int getFrameHeight(int index) { assert (index < _frameCount); return _frames[index]._bounds.height(); }
int getMaxFrameWidth() const { return _maxWidth; }
int getMaxFrameHeight() const { return _maxHeight; }
MSprite *getFrame(int frameIndex);
diff --git a/engines/mads/camera.cpp b/engines/mads/camera.cpp
new file mode 100644
index 0000000000..a727042551
--- /dev/null
+++ b/engines/mads/camera.cpp
@@ -0,0 +1,192 @@
+/* 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.
+ *
+ */
+
+#include "mads/mads.h"
+#include "mads/camera.h"
+
+namespace MADS {
+
+Camera::Camera(MADSEngine *vm) : _vm(vm) {
+ _panAllowedFl = false;
+ _activeFl = false;
+ _currentFrameFl = false;
+ _manualFl = false;
+ _speed = -1;
+ _rate = -1;
+ _target = -1;
+ _distOffCenter = -1;
+ _startTolerance = -1;
+ _endTolerance = -1;
+ _direction = -1;
+ _timer = 0;
+}
+
+void Camera::setDefaultPanX() {
+ _activeFl = false;
+ Scene &scene = _vm->_game->_scene;
+ _panAllowedFl = (scene._sceneInfo->_width > MADS_SCREEN_WIDTH);
+
+ if (_panAllowedFl) {
+ _manualFl = false;
+ _rate = 4;
+ _speed = 4;
+ _target = 0;
+ _distOffCenter = 80;
+ _startTolerance = 80;
+ _endTolerance = 4;
+ _timer = scene._frameStartTime;
+ }
+}
+
+void Camera::setDefaultPanY() {
+ _activeFl = false;
+ Scene &scene = _vm->_game->_scene;
+ _panAllowedFl = (scene._sceneInfo->_height > MADS_SCENE_HEIGHT);
+
+ if (_panAllowedFl) {
+ _manualFl = true;
+ _rate = 4;
+ _speed = 2;
+ _target = 0;
+ _distOffCenter = 80;
+ _startTolerance = 60;
+ _endTolerance = 4;
+ _timer = scene._frameStartTime;
+ }
+}
+
+void Camera::camPanTo(int target) {
+ if (_panAllowedFl) {
+ _activeFl = true;
+ _manualFl = true;
+ _target = target;
+ _timer = _vm->_game->_scene._frameStartTime;
+ }
+}
+
+bool Camera::camPan(int16 *picture_view, int16 *player_loc, int display_size, int picture_size) {
+ bool panningFl = false;
+ if (_panAllowedFl) {
+ Scene &scene = _vm->_game->_scene;
+ Player &player = _vm->_game->_player;
+
+ _currentFrameFl = false;
+
+ uint32 timer;
+ if ((abs((int32) (_timer - player._priorTimer)) < _rate) && (player._ticksAmount == _rate))
+ timer = player._priorTimer;
+ else
+ timer = _timer;
+
+ if (_activeFl && (scene._frameStartTime < timer))
+ return (panningFl);
+
+ _timer = scene._frameStartTime + _rate;
+
+ if (_manualFl) {
+ if (_activeFl) {
+ int diff = _target - *picture_view;
+ int direction = 0;
+ if (diff < 0)
+ direction = -1;
+ else if (diff > 0)
+ direction = 1;
+
+ int magnitude = MIN(abs(diff), _speed);
+
+ if (magnitude == 0)
+ _activeFl = false;
+ else {
+ int panAmount;
+ if (direction < 0)
+ panAmount = -magnitude;
+ else
+ panAmount = magnitude;
+
+ *picture_view += panAmount;
+
+ panningFl = true;
+ _currentFrameFl = true;
+ }
+ }
+ } else {
+ if (!_activeFl) {
+ int lowEdge = *picture_view + _startTolerance;
+ int highEdge = *picture_view - _startTolerance + display_size - 1;
+
+ if ((*player_loc < lowEdge) && (picture_view > 0)) {
+ _activeFl = true;
+ _direction = -1;
+ }
+
+ if ((*player_loc > highEdge) && (*picture_view < (picture_size - display_size))) {
+ _activeFl = true;
+ _direction = 1;
+ }
+ }
+
+ int newTarget = *player_loc - (display_size >> 1);
+
+ if (_direction < 0)
+ newTarget -= _distOffCenter;
+ else
+ newTarget += _distOffCenter;
+
+ newTarget = MAX(0, newTarget);
+ newTarget = MIN(newTarget, (picture_size - display_size));
+
+ _target = newTarget;
+
+ int diff = newTarget - *picture_view;
+ int magnitude = abs(diff);
+
+ int direction = 0;
+ if (diff < 0)
+ direction = -1;
+ else if (diff > 0)
+ direction = 1;
+
+ if (_activeFl && (magnitude <= _endTolerance))
+ _activeFl = false;
+
+ if (_activeFl) {
+ magnitude = MIN(magnitude, _speed);
+
+ int panAmount;
+ if (direction < 0)
+ panAmount = -magnitude;
+ else
+ panAmount = magnitude;
+
+ if (panAmount) {
+ *picture_view += panAmount;
+ panningFl = true;
+ _currentFrameFl = true;
+ }
+ }
+ }
+ }
+
+ return (panningFl);
+}
+
+} // End of namespace MADS
diff --git a/engines/mads/camera.h b/engines/mads/camera.h
new file mode 100644
index 0000000000..63f1f9f7ff
--- /dev/null
+++ b/engines/mads/camera.h
@@ -0,0 +1,63 @@
+/* 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.
+ *
+ */
+
+#ifndef MADS_CAMERA_H
+#define MADS_CAMERA_H
+
+#include "mads/scene.h"
+#include "mads/player.h"
+#include "mads/camera.h"
+
+namespace MADS {
+
+class MADSEngine;
+
+class Camera {
+private:
+ MADSEngine *_vm;
+
+public:
+ bool _panAllowedFl;
+ bool _activeFl;
+ bool _currentFrameFl;
+ bool _manualFl;
+
+ int _speed;
+ int _rate;
+ int _target;
+ int _distOffCenter;
+ int _startTolerance;
+ int _endTolerance;
+ int _direction;
+ uint32 _timer;
+
+ Camera(MADSEngine *vm);
+
+ void camPanTo(int target);
+ bool camPan(int16 *picture_view, int16 *player_loc, int display_size, int picture_size);
+ void setDefaultPanX();
+ void setDefaultPanY();
+};
+
+} // End of namespace MADS
+
+#endif /* MADS_CAMERA_H */
diff --git a/engines/mads/configure.engine b/engines/mads/configure.engine
index 60d833e9e8..412d65e180 100644
--- a/engines/mads/configure.engine
+++ b/engines/mads/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine mads "Rex Nebular and the Cosmic Gender Bender" no
+add_engine mads "Rex Nebular and the Cosmic Gender Bender" yes
diff --git a/engines/mads/conversations.cpp b/engines/mads/conversations.cpp
new file mode 100644
index 0000000000..53b8e7900d
--- /dev/null
+++ b/engines/mads/conversations.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 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.
+ *
+ */
+
+#include "mads/conversations.h"
+#include "mads/mads.h"
+#include "mads/compression.h"
+#include "common/file.h"
+#include "common/util.h" // for Common::hexdump
+
+namespace MADS {
+
+#define MAX_SPEAKERS 5
+
+enum DialogCommands {
+ cmdNodeEnd = 0,
+ //
+ cmdHide = 2,
+ cmdUnhide = 3,
+ cmdMessage = 4,
+ //
+ //
+ cmdGoto = 7,
+ //
+ cmdAssign = 9,
+ cmdDialogEnd = 255
+};
+
+struct ConvDialog {
+ int16 textLineIndex; // 0-based
+ int16 speechIndex; // 1-based
+ uint16 nodeOffset; // offset in section 6
+ uint16 nodeSize; // size in section 6
+};
+
+struct ConvNode {
+ uint16 index;
+ uint16 dialogCount;
+ int16 unk1;
+ int16 unk2;
+ int16 unk3;
+
+ Common::Array<ConvDialog> dialogs;
+};
+
+struct ConvData {
+ uint16 nodeCount; // conversation nodes, each one containing several dialog options and messages
+ uint16 dialogCount; // messages (non-selectable) + texts (selectable)
+ uint16 messageCount; // messages (non-selectable)
+ uint16 textLineCount;
+ uint16 unk2;
+ uint16 importCount;
+ uint16 speakerCount;
+ Common::String portraits[MAX_SPEAKERS];
+ bool speakerExists[MAX_SPEAKERS];
+ Common::String speechFile;
+ Common::Array<Common::String> textLines;
+ Common::Array<ConvNode> convNodes;
+};
+
+GameConversation::GameConversation(MADSEngine *vm)
+ : _vm(vm) {
+ _running = _restoreRunning = 0;
+ _nextStartNode = nullptr;
+}
+
+GameConversation::~GameConversation() {
+}
+
+void GameConversation::get(int id) {
+ Common::File inFile;
+ Common::String fileName = Common::String::format("CONV%03d.CNV", id);
+ // TODO: Also handle the .CND file
+
+ inFile.open(fileName);
+ MadsPack convFileUnpacked(&inFile);
+ Common::SeekableReadStream *convFile = convFileUnpacked.getItemStream(0);
+
+ char buffer[16];
+
+ ConvData conv;
+
+ // **** Section 0: Header *************************************************
+ conv.nodeCount = convFile->readUint16LE();
+ conv.dialogCount = convFile->readUint16LE();
+ conv.messageCount = convFile->readUint16LE();
+ conv.textLineCount = convFile->readUint16LE();
+ conv.unk2 = convFile->readUint16LE();
+ conv.importCount = convFile->readUint16LE();
+ conv.speakerCount = convFile->readUint16LE();
+
+ //debug("Conv %d has %d nodes, %d dialogs, %d messages, %d text lines, %d unk2, %d imports and %d speakers",
+ // id, conv.nodeCount, conv.dialogCount, conv.messageCount, conv.textLineCount, conv.unk2, conv.importCount, conv.speakerCount);
+
+ for (uint16 i = 0; i < MAX_SPEAKERS; i++) {
+ convFile->read(buffer, 16);
+ conv.portraits[i] = buffer;
+ //debug("Speaker %d, portrait %s", i, conv.portraits[i].c_str());
+ }
+
+ for (uint16 i = 0; i < MAX_SPEAKERS; i++) {
+ conv.speakerExists[i] = convFile->readUint16LE();
+ //debug("Speaker %d exists: %d", i, conv.speakerExists[i]);
+ }
+
+ convFile->read(buffer, 14);
+ conv.speechFile = Common::String(buffer);
+ //debug("Speech file %s", conv.speechFile.c_str());
+
+ uint16 textLength = convFile->readUint16LE(); // Total text length in section 5
+ convFile->skip(2); // TODO: unknown
+ uint16 commandLength = convFile->readUint16LE(); // Total length of commands in section 6
+ //debug("Node entry commands length: %d", commandLength);
+
+#if 0
+ debug("Section 0 unknown bytes");
+ byte *tmp0 = new byte[26];
+ convFile->read(tmp0, 26);
+ Common::hexdump(tmp0, 26);
+ delete[] tmp0;
+ delete convFile;
+#else
+ warning("Section 0 unknown bytes");
+#endif
+ // **** Section 1: Nodes **************************************************
+ convFile = convFileUnpacked.getItemStream(1);
+
+ for (uint16 i = 0; i < conv.nodeCount; i++) {
+ ConvNode node;
+ node.index = convFile->readUint16LE();
+ node.dialogCount = convFile->readUint16LE();
+ node.unk1 = convFile->readSint16LE(); // TODO
+ node.unk2 = convFile->readSint16LE(); // TODO
+ node.unk3 = convFile->readSint16LE(); // TODO
+ conv.convNodes.push_back(node);
+ //debug("Node %d, index %d, entries %d - %d, %d, %d", i, node.index, node.dialogCount, node.unk1, node.unk2, node.unk3);
+ }
+ delete convFile;
+
+ // **** Section 2: Dialogs ************************************************
+ convFile = convFileUnpacked.getItemStream(2);
+ assert(convFile->size() == conv.dialogCount * 8);
+
+ for (uint16 i = 0; i < conv.nodeCount; i++) {
+ uint16 dialogCount = conv.convNodes[i].dialogCount;
+
+ for (uint16 j = 0; j < dialogCount; j++) {
+ ConvDialog dialog;
+ dialog.textLineIndex = convFile->readSint16LE();
+ dialog.speechIndex = convFile->readSint16LE();
+ dialog.nodeOffset = convFile->readUint16LE();
+ dialog.nodeSize = convFile->readUint16LE();
+ conv.convNodes[i].dialogs.push_back(dialog);
+ //debug("Node %d, dialog %d: text line %d, speech index %d, node offset %d, node size %d", j, i, dialog.textLineIndex, dialog.speechIndex, dialog.nodeOffset, dialog.nodeSize);
+ }
+ }
+ delete convFile;
+
+ // **** Section 3: ???? ***************************************************
+#if 0
+ debug("Section 3");
+ convFile = convFileUnpacked.getItemStream(3);
+ byte *tmp1 = new byte[convFile->size()];
+ convFile->read(tmp1, convFile->size());
+ Common::hexdump(tmp1, convFile->size());
+ delete[] tmp1;
+ delete convFile;
+#else
+ warning("Section 3 - TODO");
+#endif
+ // **** Section 4: Text line offsets **************************************
+ convFile = convFileUnpacked.getItemStream(4);
+ assert(convFile->size() == conv.textLineCount * 2);
+
+ uint16 *textLineOffsets = new uint16[conv.textLineCount]; // deleted below in section 5
+ for (uint16 i = 0; i < conv.textLineCount; i++)
+ textLineOffsets[i] = convFile->readUint16LE();
+
+ delete convFile;
+
+ // **** Section 5: Text lines *********************************************
+ convFile = convFileUnpacked.getItemStream(5);
+ assert(convFile->size() == textLength);
+
+ Common::String textLine;
+ conv.textLines.resize(conv.textLineCount);
+ char textLineBuffer[256];
+ uint16 nextOffset;
+ for (uint16 i = 0; i < conv.textLineCount; i++) {
+ nextOffset = (i != conv.textLineCount - 1) ? textLineOffsets[i + 1] : convFile->size();
+ convFile->read(textLineBuffer, nextOffset - textLineOffsets[i]);
+ conv.textLines[i] = Common::String(textLineBuffer);
+ //debug("Text line %d: %s", i, conv.textLines[i].c_str());
+ }
+
+ delete[] textLineOffsets;
+ delete convFile;
+
+ // **** Section 6: Node entry commands ************************************
+ convFile = convFileUnpacked.getItemStream(6);
+ assert(convFile->size() == commandLength);
+
+ for (uint16 i = 0; i < conv.nodeCount; i++) {
+ uint16 dialogCount = conv.convNodes[i].dialogCount;
+
+ for (uint16 j = 0; j < dialogCount; j++) {
+ //ConvDialog dialog = conv.convNodes[i].dialogs[j];
+ byte command;
+ uint16 chk;
+
+ do {
+ command = convFile->readByte();
+ chk = convFile->readUint16BE();
+ if (chk != 0xFF00 && chk != 0x0000) {
+ warning("Error while reading conversation node entries - bailing out");
+ break;
+ }
+
+ switch (command) {
+ case cmdNodeEnd:
+ //debug("Node end");
+ break;
+ case cmdDialogEnd:
+ //debug("Dialog end");
+ break;
+ case cmdHide: {
+ byte count = convFile->readByte();
+ for (byte k = 0; k < count; k++) {
+ /*uint16 nodeRef = */convFile->readUint16LE();
+ //debug("Hide node %d", nodeRef);
+ }
+
+ }
+ break;
+ case cmdUnhide: {
+ byte count = convFile->readByte();
+ for (byte k = 0; k < count; k++) {
+ /*uint16 nodeRef = */convFile->readUint16LE();
+ //debug("Unhide node %d", nodeRef);
+ }
+
+ }
+ break;
+ case cmdMessage:
+ //debug("Message");
+ convFile->skip(7); // TODO
+ break;
+ case cmdGoto: {
+ convFile->skip(3); // unused?
+ /*byte nodeRef = */convFile->readByte();
+ //debug("Goto %d", nodeRef);
+ }
+ break;
+ case cmdAssign: {
+ convFile->skip(3); // unused?
+ /*uint16 value = */convFile->readUint16LE();
+ /*uint16 variable = */convFile->readUint16LE();
+ //debug("Variable %d = %d", variable, value);
+ }
+ break;
+ default:
+ error("Unknown conversation command %d", command);
+ break;
+ }
+ } while (command != cmdNodeEnd && command != cmdDialogEnd);
+ }
+ }
+
+ delete convFile;
+ inFile.close();
+
+ /*
+ // DEBUG: Show the very first message, and play the very first speech
+ _vm->_audio->setSoundGroup(conv.speechFile);
+ uint16 firstText = 0, firstSpeech = 1;
+
+ for (uint16 i = 0; i < conv.convNodes.size(); i++) {
+ for (uint16 k = 0; k < conv.convNodes[i].dialogs.size(); k++) {
+ if (conv.convNodes[i].dialogs[k].textLineIndex >= 0) {
+ firstText = conv.convNodes[i].dialogs[k].textLineIndex;
+ firstSpeech = conv.convNodes[i].dialogs[k].speechIndex;
+ break;
+ }
+ }
+ }
+
+ _vm->_audio->playSound(firstSpeech - 1);
+
+ TextDialog *dialog = new TextDialog(_vm, FONT_INTERFACE, Common::Point(0, 100), 30);
+ dialog->addLine(conv.textLines[firstText]);
+ dialog->show();
+ delete dialog;
+ */
+
+ warning("TODO GameConversation::get");
+}
+
+void GameConversation::run(int id) {
+ warning("TODO GameConversation::run");
+}
+
+void GameConversation::stop() {
+ warning("TODO GameConversation::stop");
+}
+
+void GameConversation::exportPointer(int *val) {
+ warning("TODO GameConversation::exportPointer");
+}
+
+void GameConversation::exportValue(int val) {
+ warning("TODO GameConversation::exportValue");
+}
+
+void GameConversation::setHeroTrigger(int val) {
+ _vm->_game->_trigger = val; // HACK
+ _running = -1; // HACK
+ warning("TODO: GameConversation::setHeroTrigger");
+}
+
+void GameConversation::setInterlocutorTrigger(int val) {
+ warning("TODO: GameConversation::setInterlocutorTrigger");
+}
+
+int* GameConversation::getVariable(int idx) {
+ warning("TODO: GameConversation::getVariable");
+ return nullptr;
+}
+
+void GameConversation::hold() {
+ warning("TODO: GameConversation::hold");
+}
+
+void GameConversation::release() {
+ warning("TODO: GameConversation::release");
+}
+
+void GameConversation::reset(int id) {
+ warning("TODO: GameConversation::reset");
+}
+
+void GameConversation::abortConv() {
+ warning("TODO: GameConversation::abort");
+}
+} // End of namespace MADS
diff --git a/backends/mixer/sdl13/sdl13-mixer.h b/engines/mads/conversations.h
index ff2bb43084..c4bf06e6dc 100644
--- a/backends/mixer/sdl13/sdl13-mixer.h
+++ b/engines/mads/conversations.h
@@ -20,48 +20,47 @@
*
*/
-#ifndef BACKENDS_MIXER_SDL13_H
-#define BACKENDS_MIXER_SDL13_H
+#ifndef MADS_CONVERSATIONS_H
+#define MADS_CONVERSATIONS_H
-#include "backends/mixer/sdl/sdl-mixer.h"
+namespace MADS {
-/**
- * SDL mixer manager. It wraps the actual implementation
- * of the Audio:Mixer used by the engine, and setups
- * the SDL audio subsystem and the callback for the
- * audio mixer implementation.
- */
-class Sdl13MixerManager : public SdlMixerManager {
-public:
- Sdl13MixerManager();
- virtual ~Sdl13MixerManager();
+class MADSEngine;
- /**
- * Initialize and setups the mixer
- */
- virtual void init();
+class GameConversation {
+private:
+ MADSEngine *_vm;
+public:
/**
- * Pauses the audio system
+ * Constructor
*/
- virtual void suspendAudio();
+ GameConversation(MADSEngine *vm);
/**
- * Resumes the audio system
+ * Destructor
*/
- virtual int resumeAudio();
+ virtual ~GameConversation();
-protected:
+ int* _nextStartNode;
+ int* getVariable(int idx);
- /**
- * The opened SDL audio device
- */
- SDL_AudioDeviceID _device;
+ void get(int id);
+ void run(int id);
+ void stop();
+ void exportPointer(int *val);
+ void exportValue(int val);
+ void setHeroTrigger(int val);
+ void setInterlocutorTrigger(int val);
+ void hold();
+ void release();
+ void reset(int id);
+ void abortConv();
- /**
- * Starts SDL audio
- */
- virtual void startAudio();
+ int _running;
+ int _restoreRunning;
};
-#endif
+} // End of namespace MADS
+
+#endif /* MADS_CONVERSATIONS_H */
diff --git a/engines/mads/debugger.cpp b/engines/mads/debugger.cpp
index a6a4d3edbc..740c19abad 100644
--- a/engines/mads/debugger.cpp
+++ b/engines/mads/debugger.cpp
@@ -49,6 +49,7 @@ Debugger::Debugger(MADSEngine *vm) : GUI::Debugger(), _vm(vm) {
registerCmd("item", WRAP_METHOD(Debugger, Cmd_Item));
registerCmd("play_anim", WRAP_METHOD(Debugger, Cmd_PlayAnim));
registerCmd("play_text", WRAP_METHOD(Debugger, Cmd_PlayText));
+ registerCmd("set_camera", WRAP_METHOD(Debugger, Cmd_SetCamera));
}
static int strToInt(const char *s) {
@@ -391,4 +392,17 @@ bool Debugger::Cmd_PlayText(int argc, const char **argv) {
}
}
+bool Debugger::Cmd_SetCamera(int argc, const char **argv) {
+ if (argc != 3) {
+ debugPrintf("Usage: %s <x> <y>\n", argv[0]);
+ return true;
+ } else {
+ int x = strToInt(argv[1]);
+ int y = strToInt(argv[2]);
+ _vm->_game->_scene.setCamera(Common::Point(x, y));
+ _vm->_game->_scene.resetScene();
+ _vm->_game->_scene.drawElements(kTransitionNone, false);
+ return false;
+ }
+}
} // End of namespace MADS
diff --git a/engines/mads/debugger.h b/engines/mads/debugger.h
index 70b2cadc65..f6b58ac0de 100644
--- a/engines/mads/debugger.h
+++ b/engines/mads/debugger.h
@@ -51,6 +51,7 @@ protected:
bool Cmd_Item(int argc, const char **argv);
bool Cmd_PlayAnim(int argc, const char **argv);
bool Cmd_PlayText(int argc, const char **argv);
+ bool Cmd_SetCamera(int argc, const char **argv);
public:
bool _showMousePos;
public:
diff --git a/engines/mads/detection_tables.h b/engines/mads/detection_tables.h
index 56df09577c..f0eb21f5d9 100644
--- a/engines/mads/detection_tables.h
+++ b/engines/mads/detection_tables.h
@@ -55,7 +55,7 @@ static const MADSGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformDOS,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO5(GUIO_NOSPEECH, GAMEOPTION_EASY_MOUSE, GAMEOPTION_ANIMATED_INVENTORY, GAMEOPTION_ANIMATED_INTERFACE, GAMEOPTION_NAUGHTY_MODE)
},
GType_RexNebular,
@@ -73,7 +73,7 @@ static const MADSGameDescription gameDescriptions[] = {
},
Common::EN_ANY,
Common::kPlatformDOS,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO5(GUIO_NOSPEECH, GAMEOPTION_EASY_MOUSE, GAMEOPTION_ANIMATED_INVENTORY, GAMEOPTION_ANIMATED_INTERFACE, GAMEOPTION_NAUGHTY_MODE)
},
GType_RexNebular,
diff --git a/engines/mads/dialogs.h b/engines/mads/dialogs.h
index efd2871d89..27bc0a43ee 100644
--- a/engines/mads/dialogs.h
+++ b/engines/mads/dialogs.h
@@ -226,6 +226,11 @@ public:
virtual void showItem(int objectId, int messageId, int speech = 0) = 0;
virtual Common::String getVocab(int vocabId) = 0;
virtual bool show(int messageId, int objectId = -1) = 0;
+
+ /**
+ * Show a spinning picture of an object, used in V2+ games
+ */
+ virtual void spinObject(int idx) { warning("TODO: spinObject"); }
};
class FullScreenDialog: public EventTarget {
diff --git a/engines/mads/dragonsphere/dragonsphere_scenes.cpp b/engines/mads/dragonsphere/dragonsphere_scenes.cpp
index 6f5a28bff9..938931e80d 100644
--- a/engines/mads/dragonsphere/dragonsphere_scenes.cpp
+++ b/engines/mads/dragonsphere/dragonsphere_scenes.cpp
@@ -28,6 +28,7 @@
#include "mads/scene.h"
#include "mads/dragonsphere/game_dragonsphere.h"
#include "mads/dragonsphere/dragonsphere_scenes.h"
+#include "mads/dragonsphere/dragonsphere_scenes1.h"
namespace MADS {
@@ -42,15 +43,15 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) {
switch (scene._nextSceneId) {
// Scene group #1 (Castle, river and caves)
case 101: // king's bedroom
- return new DummyScene(vm); // TODO
+ return new Scene101(vm);
case 102: // queen's bedroom
- return new DummyScene(vm); // TODO
+ return new Scene102(vm);
case 103: // outside king's bedroom
- return new DummyScene(vm); // TODO
+ return new Scene103(vm);
case 104: // fireplace / bookshelf
- return new DummyScene(vm); // TODO
+ return new Scene104(vm);
case 105: // dining room
- return new DummyScene(vm); // TODO
+ return new Scene105(vm);
case 106: // throne room
return new DummyScene(vm); // TODO
case 107: // council chamber
@@ -201,12 +202,12 @@ Common::String DragonsphereScene::formAnimName(char sepChar, int suffixNum) {
/*------------------------------------------------------------------------*/
void SceneInfoDragonsphere::loadCodes(MSurface &depthSurface, int variant) {
- // The intro scenes do not have any codes
- if (_sceneId >= 900)
+ Common::String ext = Common::String::format(".WW%d", variant);
+ Common::String fileName = Resources::formatName(RESPREFIX_RM, _sceneId, ext);
+ if (!Common::File::exists(fileName))
return;
- Common::String ext = Common::String::format(".WW%d", variant);
- File f(Resources::formatName(RESPREFIX_RM, _sceneId, ext));
+ File f(fileName);
MadsPack codesPack(&f);
Common::SeekableReadStream *stream = codesPack.getItemStream(0);
diff --git a/engines/mads/dragonsphere/dragonsphere_scenes.h b/engines/mads/dragonsphere/dragonsphere_scenes.h
index 173cc667ce..e9b48715db 100644
--- a/engines/mads/dragonsphere/dragonsphere_scenes.h
+++ b/engines/mads/dragonsphere/dragonsphere_scenes.h
@@ -29,29 +29,49 @@
#include "mads/dragonsphere/game_dragonsphere.h"
//#include "mads/dragonsphere/globals_dragonsphere.h"
-
namespace MADS {
namespace Dragonsphere {
+enum Verb {
+ VERB_LOOK = 0x3,
+ VERB_TAKE = 0x4,
+ VERB_PUSH = 0x5,
+ VERB_OPEN = 0x6,
+ VERB_PUT = 0x7,
+ VERB_TALK_TO = 0x8,
+ VERB_GIVE = 0x9,
+ VERB_PULL = 0xA,
+ VERB_CLOSE = 0xB,
+ VERB_THROW = 0xC,
+ VERB_WALK_TO = 0xD,
+ VERB_WALK_ACROSS = 0x11,
+ VERB_WALK_BEHIND = 0x1C,
+ VERB_LOOK_AT = 0x1E,
+ VERB_WALK_THROUGH = 0x25,
+ VERB_WALK_INTO = 0x27,
+ VERB_INVOKE = 0x2F,
+ VERB_ATTACK = 0x39,
+ VERB_CARVE_UP = 0x3A,
+ VERB_THRUST = 0x57,
+ VERB_POUR = 0x62,
+ VERB_POUR_CONTENTS_OF = 0x63,
+ VERB_DRINK = 0x64,
+ VERB_SHIFT_SELF = 0x73,
+ VERB_SHIFT_INTO_BEAR = 0x74,
+ VERB_SHIFT_INTO_SEAL = 0x75,
+ VERB_SHIFT_INTO_SNAKE = 0x76,
+ VERB_WALK_DOWN = 0xA9,
+ VERB_WALK = 0x1CB,
+ VERB_WALK_AROUND = 0x221
+};
+
enum Noun {
NOUN_GAME = 0x1,
NOUN_QSAVE = 0x2,
- NOUN_LOOK = 0x3,
- NOUN_TAKE = 0x4,
- NOUN_PUSH = 0x5,
- NOUN_OPEN = 0x6,
- NOUN_PUT = 0x7,
- NOUN_TALK_TO = 0x8,
- NOUN_GIVE = 0x9,
- NOUN_PULL = 0xA,
- NOUN_CLOSE = 0xB,
- NOUN_THROW = 0xC,
- NOUN_WALK_TO = 0xD,
NOUN_NOTHING = 0xE,
NOUN_ = 0xF,
NOUN_FLOOR = 0x10,
- NOUN_WALK_ACROSS = 0x11,
NOUN_RUG = 0x12,
NOUN_CARPET = 0x13,
NOUN_WALL = 0x14,
@@ -62,18 +82,14 @@ enum Noun {
NOUN_NIGHTSTAND = 0x19,
NOUN_TAPESTRY = 0x1A,
NOUN_DRESSING_SCREEN = 0x1B,
- NOUN_WALK_BEHIND = 0x1C,
NOUN_ROYAL_CREST = 0x1D,
- NOUN_LOOK_AT = 0x1E,
NOUN_WASHBASIN = 0x1F,
NOUN_WASH_AT = 0x20,
NOUN_BOOK = 0x21,
NOUN_FIREPLACE = 0x22,
NOUN_FIREPLACE_SCREEN = 0x23,
NOUN_DOOR_TO_QUEENS_ROOM = 0x24,
- NOUN_WALK_THROUGH = 0x25,
NOUN_HALL_TO_SOUTH = 0x26,
- NOUN_WALK_INTO = 0x27,
NOUN_WALL_PLAQUE = 0x28,
NOUN_DECORATION = 0x29,
NOUN_SWORDS = 0x2A,
@@ -81,7 +97,6 @@ enum Noun {
NOUN_BUST_ON_WALL = 0x2C,
NOUN_WALL_ARCH = 0x2D,
NOUN_SIGNET_RING = 0x2E,
- NOUN_INVOKE = 0x2F,
NOUN_POLISH = 0x30,
NOUN_GANGBANG = 0x31,
NOUN_BIRD_FIGURINE = 0x32,
@@ -91,8 +106,6 @@ enum Noun {
NOUN_MAKE_NOISE = 0x36,
NOUN_SHIELDSTONE = 0x37,
NOUN_SWORD = 0x38,
- NOUN_ATTACK = 0x39,
- NOUN_CARVE_UP = 0x3A,
NOUN_GOBLET = 0x3B,
NOUN_FILL = 0x3C,
NOUN_DRINK_FROM = 0x3D,
@@ -121,7 +134,6 @@ enum Noun {
NOUN_MAGIC_BELT = 0x54,
NOUN_ADJUST = 0x55,
NOUN_AMULET = 0x56,
- NOUN_THRUST = 0x57,
NOUN_MUD = 0x58,
NOUN_FEEL = 0x59,
NOUN_TASTE = 0x5A,
@@ -132,9 +144,6 @@ enum Noun {
NOUN_FLASK = 0x5F,
NOUN_FLASK_FULL_OF_ACID = 0x60,
NOUN_POUR_CONTENTS = 0x61,
- NOUN_POUR = 0x62,
- NOUN_POUR_CONTENTS_OF = 0x63,
- NOUN_DRINK = 0x64,
NOUN_ROPE = 0x65,
NOUN_TIE = 0x66,
NOUN_POWER_VACUUM_STONE = 0x67,
@@ -149,10 +158,6 @@ enum Noun {
NOUN_BLACK_SPHERE = 0x70,
NOUN_SOPTUS_SOPORIFIC = 0x71,
NOUN_SHIFTER_RING = 0x72,
- NOUN_SHIFT_SELF = 0x73,
- NOUN_SHIFT_INTO_BEAR = 0x74,
- NOUN_SHIFT_INTO_SEAL = 0x75,
- NOUN_SHIFT_INTO_SNAKE = 0x76,
NOUN_REVERT = 0x77,
NOUN_MEDICINE_BUNDLE = 0x78,
NOUN_SHAKE = 0x79,
@@ -203,7 +208,6 @@ enum Noun {
NOUN_DOOR = 0xA6,
NOUN_WALL_SWITCH = 0xA7,
NOUN_STAIRS = 0xA8,
- NOUN_WALK_DOWN = 0xA9,
NOUN_EDGE_OF_ABYSS = 0xAA,
NOUN_COURTYARD = 0xAB,
NOUN_ROCK = 0xAC,
@@ -493,7 +497,6 @@ enum Noun {
NOUN_PATH_TO_HIGHTOWER = 0x1C8,
NOUN_SPIRIT_PLANE = 0x1C9,
NOUN_SPIRIT_TREE = 0x1CA,
- NOUN_WALK = 0x1CB,
NOUN_REMAINS = 0x1CC,
NOUN_DOORWAY_TO_ELEVATOR = 0x1CD,
NOUN_DRAGON_DOOR = 0x1CE,
@@ -579,7 +582,6 @@ enum Noun {
NOUN_SHIFTER_VILLAGE = 0x21E,
NOUN_SLATHAN_SKY = 0x21F,
NOUN_SHIFTER = 0x220,
- NOUN_WALK_AROUND = 0x221,
NOUN_WRECKED_BRIDGE = 0x222,
NOUN_SHACK = 0x223,
NOUN_WRECKED_SHACK = 0x224,
@@ -656,27 +658,6 @@ protected:
};
// TODO: Temporary, remove once implemented properly
-class Scene1xx : public DragonsphereScene {
-protected:
- /**
- * Plays an appropriate sound when entering a scene
- */
- void sceneEntrySound() {}
-
- /**
- *Sets the AA file to use for the scene
- */
- void setAAName() {}
-
- /**
- * Updates the prefix used for getting player sprites for the scene
- */
- void setPlayerSpritesPrefix() {}
-public:
- Scene1xx(MADSEngine *vm) : DragonsphereScene(vm) {}
-};
-
-// TODO: Temporary, remove once implemented properly
class DummyScene : public DragonsphereScene {
public:
DummyScene(MADSEngine *vm) : DragonsphereScene(vm) {
diff --git a/engines/mads/dragonsphere/dragonsphere_scenes1.cpp b/engines/mads/dragonsphere/dragonsphere_scenes1.cpp
new file mode 100644
index 0000000000..8a89d8ed08
--- /dev/null
+++ b/engines/mads/dragonsphere/dragonsphere_scenes1.cpp
@@ -0,0 +1,3694 @@
+/* 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.
+ *
+ */
+
+#include "common/scummsys.h"
+#include "mads/mads.h"
+#include "mads/conversations.h"
+#include "mads/scene.h"
+#include "mads/dragonsphere/dragonsphere_scenes.h"
+#include "mads/dragonsphere/dragonsphere_scenes1.h"
+
+namespace MADS {
+
+namespace Dragonsphere {
+
+void Scene1xx::setAAName() {
+ int interface;
+
+ switch (_scene->_nextSceneId) {
+ case 108:
+ case 109:
+ interface = 3;
+ break;
+ case 110:
+ interface = 5;
+ break;
+ case 113:
+ case 114:
+ case 115:
+ case 117:
+ case 119:
+ interface = 1;
+ break;
+ case 116:
+ interface = 2;
+ break;
+ case 120:
+ interface = 8;
+ break;
+ default:
+ interface = 0;
+ break;
+ }
+
+ _game._aaName = Resources::formatAAName(interface);
+ _vm->_palette->setEntry(254, 56, 47, 32);
+
+}
+
+void Scene1xx::sceneEntrySound() {
+ if (!_vm->_musicFlag)
+ return;
+
+ switch (_scene->_nextSceneId) {
+ case 104:
+ if (_globals[kPlayerPersona] == 1)
+ _vm->_sound->command(44);
+ else
+ _vm->_sound->command(16);
+ break;
+
+ case 106:
+ if (_globals[kEndOfGame])
+ _vm->_sound->command(47);
+ else
+ _vm->_sound->command(16);
+ break;
+
+ case 108:
+ if (_game._visitedScenes.exists(109))
+ _vm->_sound->command(32);
+ else
+ _vm->_sound->command(33);
+ break;
+
+ case 109:
+ _vm->_sound->command(32);
+ break;
+
+ case 110:
+ _vm->_sound->command(37);
+ break;
+
+ case 111:
+ _vm->_sound->command(34);
+ break;
+
+ case 112:
+ _vm->_sound->command(38);
+ break;
+
+ case 113:
+ _vm->_sound->command(5);
+ if (_globals[kPlayerIsSeal])
+ _vm->_sound->command(35);
+ else
+ _vm->_sound->command(36);
+ break;
+
+ case 114:
+ _vm->_sound->command(36);
+ break;
+
+ case 115:
+ _vm->_sound->command(39);
+ break;
+
+ case 116:
+ _vm->_sound->command(40);
+ break;
+
+ case 117:
+ _vm->_sound->command(35);
+ break;
+
+ case 119:
+ _vm->_sound->command(41);
+ break;
+
+ case 120:
+ _vm->_sound->command(46);
+ break;
+
+ default:
+ _vm->_sound->command(16);
+ break;
+ }
+}
+
+void Scene1xx::setPlayerSpritesPrefix() {
+ int darkSceneFl = false;
+ int noPlayerFl = false;
+
+ _vm->_sound->command(5);
+ Common::String oldName = _game._player._spritesPrefix;
+
+ _globals[kPerformDisplacements] = true;
+
+ switch (_scene->_nextSceneId) {
+ case 106:
+ if (_scene->_currentSceneId == 120)
+ noPlayerFl = true;
+ break;
+
+ case 108:
+ case 109:
+ case 114:
+ case 115:
+ darkSceneFl = true;
+ break;
+
+ case 111:
+ case 112:
+ case 117:
+ case 120:
+ case 119:
+ noPlayerFl = true;
+ break;
+
+ case 113:
+ if (!_globals[kPlayerPersona])
+ noPlayerFl = true;
+ darkSceneFl = true;
+ break;
+ }
+
+ if (noPlayerFl || _globals[kNoLoadWalker]) {
+ _game._player._spritesPrefix = "";
+ } else if (!_game._player._forcePrefix) {
+ if (!_globals[kPlayerPersona] || _scene->_nextSceneId == 108 || _scene->_nextSceneId == 109) {
+ if (_scene->_nextSceneId == 113 || _scene->_nextSceneId == 114 || _scene->_nextSceneId == 115 || _scene->_nextSceneId == 116)
+ _game._player._spritesPrefix = "PD";
+ else
+ _game._player._spritesPrefix = "KG";
+ } else
+ _game._player._spritesPrefix = "PD";
+
+ if (darkSceneFl)
+ _game._player._spritesPrefix += "D";
+ }
+
+ if (oldName != _game._player._spritesPrefix)
+ _game._player._spritesChanged = true;
+
+ _game._player._scalingVelocity = true;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene101::Scene101(MADSEngine *vm) : Scene1xx(vm) {
+}
+
+void Scene101::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+}
+
+void Scene101::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene101::enter() {
+ sceneEntrySound();
+}
+
+void Scene101::step() {
+}
+
+void Scene101::actions() {
+ if (_action.isObject(NOUN_BED)) {
+ int sprIdx = _scene->_sprites.addSprites("*ob001i");
+ int seqIdx = _scene->_sequences.addStampCycle(sprIdx, false, 1);
+ _scene->_sequences.setDepth(seqIdx, 0);
+ _scene->_sequences.setPosition(seqIdx, Common::Point(10, 50));
+ _action._inProgress = false;
+ }
+}
+
+void Scene101::preActions() {
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene102::Scene102(MADSEngine *vm) : Scene1xx(vm) {
+ _diaryHotspotIdx1 = -1;
+ _diaryHotspotIdx2 = -1;
+ _diaryFrame = -1;
+ _animRunning = -1;
+}
+
+void Scene102::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+ s.syncAsSint16LE(_diaryHotspotIdx1);
+ s.syncAsSint16LE(_diaryHotspotIdx2);
+ s.syncAsSint16LE(_diaryFrame);
+ s.syncAsSint16LE(_animRunning);
+}
+
+void Scene102::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_DIARIES);
+ _scene->addActiveVocab(VERB_WALK_TO);
+}
+
+void Scene102::enter() {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('p', 0));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('p', 1));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('y', 0));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('y', 1));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('x', -1));
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites("*KGRD_6");
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('y', 2));
+
+ _globals._sequenceIndexes[4] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[4], false, 7, 0);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 7, 0);
+ _globals._sequenceIndexes[8] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[8], false, 7, 0);
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 12);
+ _diaryHotspotIdx1 = _scene->_dynamicHotspots.add(NOUN_DIARIES, VERB_WALK_TO, SYNTAX_PLURAL, _globals._sequenceIndexes[1], Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots.setPosition(_diaryHotspotIdx1, Common::Point(47, 123), FACING_NORTHWEST);
+
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 12);
+ _diaryHotspotIdx2 = _scene->_dynamicHotspots.add(NOUN_DIARIES, VERB_WALK_TO, SYNTAX_PLURAL, _globals._sequenceIndexes[2], Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots.setPosition(_diaryHotspotIdx2, Common::Point(47, 123), FACING_NORTHWEST);
+
+ if (_scene->_priorSceneId == 103) {
+ _game._player._playerPos = Common::Point(170, 152);
+ _game._player._facing = FACING_NORTHWEST;
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 5);
+ } else if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 5);
+ _game._player.firstWalk(Common::Point(-10, 130), FACING_EAST, Common::Point(35, 144), FACING_EAST, false);
+ _game._player.setWalkTrigger(70);
+ } else {
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 5);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene102::step() {
+ int resetFrame;
+
+ if ((_animRunning == 1) && _scene->_animation[_globals._animationIndexes[0]]) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() != _diaryFrame) {
+ _diaryFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ resetFrame = -1;
+
+ switch (_diaryFrame) {
+ case 6:
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[1], SYNC_ANIM, _globals._animationIndexes[0]);
+ break;
+
+ case 10:
+ _vm->_sound->command(65);
+ break;
+
+ case 26:
+ _vm->_dialogs->show(10210);
+ _vm->_dialogs->show(10211);
+ _vm->_dialogs->show(10212);
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ if (resetFrame != _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame()) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _diaryFrame = resetFrame;
+ }
+ }
+ }
+ }
+
+ if ((_animRunning == 2) && _scene->_animation[_globals._animationIndexes[0]]) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() != _diaryFrame) {
+ _diaryFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+
+ switch (_diaryFrame) {
+ case 6:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[2], SYNC_ANIM, _globals._animationIndexes[0]);
+ break;
+
+ case 26:
+ _vm->_dialogs->show(10213);
+ _vm->_dialogs->show(10214);
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ if (_game._trigger >= 70) {
+ switch (_game._trigger) {
+ case 70:
+ _scene->deleteSequence(_globals._sequenceIndexes[6]);
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[6] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[6], false, 9, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 5);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[6], 1, 4);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 71);
+ break;
+
+ case 71: {
+ int idx = _globals._sequenceIndexes[6];
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], -2);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[6], SYNC_SEQ, idx);
+ _game._player._stepEnabled = true;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
+void Scene102::actions() {
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(10201);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_KINGS_ROOM) || _action.isAction(VERB_OPEN, NOUN_DOOR_TO_KINGS_ROOM) || _action.isAction(VERB_PULL, NOUN_DOOR_TO_KINGS_ROOM)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[7] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[7], true, 8, 2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[7], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_SPRITE, 2, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[6]);
+ _vm->_sound->command(24);
+ _globals._sequenceIndexes[6] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[6], false, 9, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 5);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2: {
+ int idx = _globals._sequenceIndexes[6];
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 5);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[6], SYNC_SEQ, idx);
+ }
+ break;
+
+ case 3:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[7]);
+ _game._player.walk(Common::Point(0, 130), FACING_WEST);
+ _game._player._walkOffScreenSceneId = 101;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_HALLWAY) || _action.isAction(VERB_OPEN, NOUN_DOOR_TO_HALLWAY) || _action.isAction(VERB_PULL, NOUN_DOOR_TO_HALLWAY)) {
+ _scene->_nextSceneId = 103;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_DIARIES) || _action.isAction(VERB_OPEN, NOUN_DIARIES)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _animRunning = 1;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('B',-1), 1);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ break;
+
+ case 1:
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 12);
+ _diaryHotspotIdx1 = _scene->_dynamicHotspots.add(NOUN_DIARIES, VERB_WALK_TO, SYNTAX_PLURAL, _globals._sequenceIndexes[1], Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots.setPosition(_diaryHotspotIdx1, Common::Point(47, 123), FACING_NORTHWEST);
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _scene->_sequences.addTimer(6, 2);
+ break;
+
+ case 2:
+ _game._player.walk(Common::Point(51, 121), FACING_NORTHWEST);
+ _game._player.setWalkTrigger(3);
+ break;
+
+ case 3:
+ _game._player._visible = false;
+ _animRunning = 2;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('A',-1), 4);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ break;
+
+ case 4:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 12);
+ _diaryHotspotIdx2 = _scene->_dynamicHotspots.add(NOUN_DIARIES, VERB_WALK_TO, SYNTAX_PLURAL, _globals._sequenceIndexes[2], Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots.setPosition(_diaryHotspotIdx2, Common::Point(47, 123), FACING_NORTHWEST);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FIREPLACE)) {
+ _vm->_dialogs->show(10202);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BED)) {
+ _vm->_dialogs->show(10203);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SHUTTERS)) {
+ _vm->_dialogs->show(10204);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RUG)) {
+ _vm->_dialogs->show(10206);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOOKCASE)) {
+ _vm->_dialogs->show(10208);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DIARIES)) {
+ _vm->_dialogs->show(10209);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR_TO_KINGS_ROOM)) {
+ _vm->_dialogs->show(10215);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOWERS)) {
+ _vm->_dialogs->show(10216);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WINDOW)) {
+ _vm->_dialogs->show(10217);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WOOD_BASKET)) {
+ _vm->_dialogs->show(10219);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FIREPLACE_SCREEN)) {
+ _vm->_dialogs->show(10220);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_NIGHTSTAND)) {
+ _vm->_dialogs->show(10222);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR_TO_HALLWAY)) {
+ _vm->_dialogs->show(10223);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHEST)) {
+ _vm->_dialogs->show(10224);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TAPESTRY)) {
+ _vm->_dialogs->show(10226);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SCONCE)) {
+ _vm->_dialogs->show(10227);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(10228);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(10229);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DECORATION)) {
+ _vm->_dialogs->show(10230);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(10231);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_CHEST)) {
+ _vm->_dialogs->show(10224);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_FLOWERS)) {
+ _vm->_dialogs->show(10225);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_WINDOW)) {
+ _vm->_dialogs->show(10218);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL)) && _action.isObject(NOUN_FIREPLACE_SCREEN)) {
+ _vm->_dialogs->show(10221);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_SHUTTERS)) {
+ _vm->_dialogs->show(10205);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_PULL, NOUN_RUG)) {
+ _vm->_dialogs->show(10207);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene102::preActions() {
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene103::Scene103(MADSEngine *vm) : Scene1xx(vm) {
+}
+
+void Scene103::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+}
+
+void Scene103::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene103::enter() {
+ _vm->_disableFastwalk = true;
+
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('y', 1));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('y', 2));
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('y', 7));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('y', 0));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('y', 3));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('y', 4));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('y', 5));
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('y', 6));
+ _globals._spriteIndexes[9] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[10] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[11] = _scene->_sprites.addSprites("*KGRD_9");
+
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 7, 0, 0);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 7, 0, 4);
+ _globals._sequenceIndexes[8] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[8], false, 7, 0, 0);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 7, 0, 0);
+ _globals._sequenceIndexes[4] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[4], false, 7, 0, 3);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 7, 0, 2);
+ _globals._sequenceIndexes[6] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[6], false, 7, 0, 0);
+ _globals._sequenceIndexes[7] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[7], false, 7, 0, 5);
+
+ if ((_scene->_priorSceneId == 104) || (_scene->_priorSceneId == 105)) {
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 8);
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 8);
+ }
+
+ if (_scene->_priorSceneId == 102) {
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 6);
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 14);
+ _scene->setCamera(Common::Point(320, 0));
+ _game._player.walk(Common::Point(482, 128), FACING_SOUTH);
+ _game._player.firstWalk(Common::Point(471, 108), FACING_SOUTH, Common::Point(482, 128), FACING_SOUTH, false);
+ _game._player.setWalkTrigger(72);
+ } else if (_scene->_priorSceneId == 104) {
+ _game._player._playerPos = Common::Point(130, 152);
+ _game._player._facing = FACING_NORTHEAST;
+ } else if (_scene->_priorSceneId == 105) {
+ _game._player._playerPos = Common::Point(517, 152);
+ _game._player._facing = FACING_NORTHWEST;
+ _scene->setCamera(Common::Point(320, 0));
+ } else if ((_scene->_priorSceneId == 101) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 6);
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 14);
+ _game._player.firstWalk(Common::Point(173, 108), FACING_SOUTH, Common::Point(162, 127), FACING_SOUTH, false);
+ _game._player.setWalkTrigger(70);
+ } else {
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 6);
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 6);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene103::step() {
+ switch (_game._trigger) {
+ case 70:
+ _scene->deleteSequence(_globals._sequenceIndexes[9]);
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[9] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[9], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 6);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[9], 1, 3);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[9], SEQUENCE_TRIGGER_EXPIRE, 0, 71);
+ break;
+
+ case 71: {
+ int tmpIdx = _globals._sequenceIndexes[9];
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 6);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[9], SYNC_SEQ, tmpIdx);
+ _game._player._stepEnabled = true;
+ }
+ break;
+
+ case 72:
+ _scene->deleteSequence(_globals._sequenceIndexes[10]);
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[10] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[10], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 6);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[10], 1, 3);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_EXPIRE, 0, 73);
+ break;
+
+ case 73: {
+ int tmpIdx = _globals._sequenceIndexes[10];
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 6);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[10], SYNC_SEQ, tmpIdx);
+ _game._player._stepEnabled = true;
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene103::actions() {
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(10301);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_KINGS_ROOM) || _action.isAction(VERB_OPEN, NOUN_DOOR_TO_KINGS_ROOM) || _action.isAction(VERB_PULL, NOUN_DOOR_TO_KINGS_ROOM)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[11] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[11], false, 7, 2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[11], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[11], SEQUENCE_TRIGGER_SPRITE, 2, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[11], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[9]);
+ _vm->_sound->command(24);
+ _globals._sequenceIndexes[9] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[9], false, 7, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 8);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[9], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2: {
+ int tmpIdx = _globals._sequenceIndexes[9];
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 14);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[9], SYNC_SEQ, tmpIdx);
+ }
+ break;
+
+ case 3:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[11]);
+ _scene->_sequences.addTimer(1, 4);
+ break;
+
+ case 4:
+ _game._player.walk(Common::Point(173, 108), FACING_NORTH);
+ _game._player.setWalkTrigger(5);
+ break;
+
+ case 5:
+ _scene->deleteSequence(_globals._sequenceIndexes[9]);
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[9] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[9], false, 7, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[9], SEQUENCE_TRIGGER_EXPIRE, 0, 6);
+ break;
+
+ case 6: {
+ int tmpIdx = _globals._sequenceIndexes[9];
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 1);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[9], SYNC_SEQ, tmpIdx);
+ _scene->_sequences.addTimer(6, 7);
+ }
+ break;
+
+ case 7:
+ _scene->_nextSceneId = 101;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_QUEENS_ROOM) || _action.isAction(VERB_OPEN, NOUN_DOOR_TO_QUEENS_ROOM) || _action.isAction(VERB_PULL, NOUN_DOOR_TO_QUEENS_ROOM)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[11] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[11], true, 7, 2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[11], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[11], SEQUENCE_TRIGGER_SPRITE, 2, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[11], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[10]);
+ _vm->_sound->command(24);
+ _globals._sequenceIndexes[10] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[10], false, 7, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 8);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2: {
+ int tmpIdx = _globals._sequenceIndexes[10];
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 14);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[10], SYNC_SEQ, tmpIdx);
+ }
+ break;
+
+ case 3:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[11]);
+ _scene->_sequences.addTimer(1, 4);
+ break;
+
+ case 4:
+ _game._player.walk(Common::Point(471, 108), FACING_NORTH);
+ _game._player.setWalkTrigger(5);
+ break;
+
+ case 5:
+ _scene->deleteSequence(_globals._sequenceIndexes[10]);
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[10] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[10], false, 7, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_EXPIRE, 0, 6);
+ break;
+
+ case 6: {
+ int tmpIdx = _globals._sequenceIndexes[10];
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 1);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[10], SYNC_SEQ, tmpIdx);
+ _scene->_sequences.addTimer(6, 7);
+ }
+ break;
+
+ case 7:
+ _scene->_nextSceneId = 102;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_MEETING_ROOM) || _action.isAction(VERB_OPEN, NOUN_DOOR_TO_MEETING_ROOM) || _action.isAction(VERB_PULL, NOUN_DOOR_TO_MEETING_ROOM)) {
+ _scene->_nextSceneId = 104;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_BALLROOM) || _action.isAction(VERB_OPEN, NOUN_DOOR_TO_BALLROOM) || _action.isAction(VERB_PULL, NOUN_DOOR_TO_BALLROOM)) {
+ _scene->_nextSceneId = 105;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_TAPESTRY)) {
+ if ((_scene->_customDest.x <= 75) && (_scene->_customDest.y <= 130))
+ _vm->_dialogs->show(10302);
+ else
+ _vm->_dialogs->show(10303);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COAT_OF_ARMS)) {
+ _vm->_dialogs->show(10305);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR_TO_QUEENS_ROOM)) {
+ _vm->_dialogs->show(10307);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR_TO_KINGS_ROOM)) {
+ _vm->_dialogs->show(10308);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEDAR_CHEST)) {
+ _vm->_dialogs->show(10309);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TABLE)) {
+ _vm->_dialogs->show(10311);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SMALL_WINDOW)) {
+ _vm->_dialogs->show(10312);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LARGE_WINDOW)) {
+ _vm->_dialogs->show(10314);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BATTLE_AXES)) {
+ _vm->_dialogs->show(10315);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BUST_ON_WALL)) {
+ _vm->_dialogs->show(10317);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DECORATION)) {
+ _vm->_dialogs->show(10320);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL_PLAQUE)) {
+ _vm->_dialogs->show(10322);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR_TO_BALLROOM)) {
+ _vm->_dialogs->show(10323);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR_TO_MEETING_ROOM)) {
+ _vm->_dialogs->show(10324);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if ((_action.isAction(VERB_TAKE) || _action.isAction(VERB_PULL)) && _action.isObject(NOUN_BATTLE_AXES)) {
+ _vm->_dialogs->show(10316);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL)) && _action.isObject(NOUN_TAPESTRY)) {
+ _vm->_dialogs->show(10304);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_PULL, NOUN_COAT_OF_ARMS)) {
+ _vm->_dialogs->show(10306);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_CEDAR_CHEST)) {
+ _vm->_dialogs->show(10310);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_SMALL_WINDOW) || _action.isAction(VERB_OPEN, NOUN_LARGE_WINDOW)) {
+ _vm->_dialogs->show(10313);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene103::preActions() {
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene104::Scene104(MADSEngine *vm) : Scene1xx(vm) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ _anim4ActvFl = false;
+ _anim5ActvFl = false;
+ _activateTimerFl = false;
+ _wasBearFl = false;
+ _amuletWorksFl = false;
+ _pidDrawnSword = false;
+ _anim6ActvFl = false;
+
+ _animationRunning = -1;
+ _deathTimer = -1;
+ _deathFrame = -1;
+ _doorwayHotspotId = -1;
+
+ _kingStatus = -1;
+ _kingFrame = -1;
+ _kingCount = -1;
+ _macCount = -1;
+ _macFrame = -1;
+ _macStatus = -1;
+ _queenStatus = -1;
+ _queenFrame = -1;
+ _queenCount = -1;
+ _pidStatus = -1;
+ _pidFrame = -1;
+ _pidCount = -1;
+ _twinklesFrame = -1;
+ _twinklesStatus = -1;
+ _twinklesCount = -1;
+
+ _tapestryFrame = -1;
+ _clock = -1;
+}
+
+void Scene104::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_anim2ActvFl);
+ s.syncAsByte(_anim3ActvFl);
+ s.syncAsByte(_anim4ActvFl);
+ s.syncAsByte(_anim5ActvFl);
+ s.syncAsByte(_activateTimerFl);
+ s.syncAsByte(_wasBearFl);
+ s.syncAsByte(_amuletWorksFl);
+ s.syncAsByte(_pidDrawnSword);
+ s.syncAsByte(_anim6ActvFl);
+
+ s.syncAsSint16LE(_animationRunning);
+ s.syncAsSint16LE(_deathTimer);
+ s.syncAsSint16LE(_deathFrame);
+ s.syncAsSint16LE(_doorwayHotspotId);
+
+ s.syncAsSint16LE(_kingStatus);
+ s.syncAsSint16LE(_kingFrame);
+ s.syncAsSint16LE(_kingCount);
+ s.syncAsSint16LE(_queenStatus);
+ s.syncAsSint16LE(_queenFrame);
+ s.syncAsSint16LE(_queenCount);
+ s.syncAsSint16LE(_macStatus);
+ s.syncAsSint16LE(_macFrame);
+ s.syncAsSint16LE(_macCount);
+ s.syncAsSint16LE(_pidStatus);
+ s.syncAsSint16LE(_pidFrame);
+ s.syncAsSint16LE(_pidCount);
+ s.syncAsSint16LE(_twinklesStatus);
+ s.syncAsSint16LE(_twinklesFrame);
+ s.syncAsSint16LE(_twinklesCount);
+
+ s.syncAsSint16LE(_tapestryFrame);
+ s.syncAsSint32LE(_clock);
+}
+
+void Scene104::setup() {
+ if (_scene->_currentSceneId == 119)
+ _globals[kNoLoadWalker] = true;
+
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_DOORWAY);
+ _scene->addActiveVocab(NOUN_QUEEN_MOTHER);
+ _scene->addActiveVocab(NOUN_KING);
+}
+
+void Scene104::enter() {
+ _vm->_gameConv->get(1);
+
+ if (_globals[kPlayerPersona] == 1) {
+ _scene->_sprites.addSprites(formAnimName('e', 8));
+ _scene->_sprites.addSprites(formAnimName('b', 5));
+ }
+
+ _scene->_hotspots.activate(NOUN_MACMORN, false);
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _animationRunning = 0;
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ _anim4ActvFl = false;
+ _anim5ActvFl = false;
+ _kingCount = 0;
+ _macCount = 0;
+ _queenCount = 0;
+ _twinklesCount = 0;
+ _deathTimer = 0;
+ _clock = 0;
+ _activateTimerFl = false;
+ _wasBearFl = false;
+ _amuletWorksFl = false;
+ _pidDrawnSword = false;
+ }
+
+ _anim6ActvFl = false;
+
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('x', 3));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('x', 5));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('x', 4));
+
+ if (_globals[kNoLoadWalker]) {
+ _scene->drawToBackground(_globals._spriteIndexes[6], 5, Common::Point(-32000, -32000), 0, 100);
+ _scene->_sprites.remove(_globals._spriteIndexes[6]);
+ }
+
+ if (_globals[kPlayerPersona] == 0) {
+ _scene->_hotspots.activateAtPos(NOUN_TABLE, false, Common::Point(139, 132));
+
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites("*KGRD_8");
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites("*KGRM1_8");
+ _globals._spriteIndexes[11] = _scene->_sprites.addSprites(formAnimName('y', 5));
+ _globals._spriteIndexes[10] = _scene->_sprites.addSprites(formAnimName('y', 4));
+ _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('y', 1));
+
+ if (_globals[kTapestryStatus] == 0 || _globals[kTapestryStatus] == 2) {
+ _scene->_hotspots.activate(NOUN_WALL_PANEL, false);
+ _scene->_hotspots.activate(NOUN_SECRET_DOOR, false);
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 6);
+ } else {
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 6);
+ _scene->_hotspots.activateAtPos(NOUN_TAPESTRY, false, Common::Point(310, 70));
+ }
+
+ if (_globals[kBooksStatus] == 1 || _globals[kBooksStatus] == 3) {
+ if (_globals[kTapestryStatus] == 1 || _globals[kTapestryStatus] == 3)
+ _scene->_hotspots.activate(NOUN_SECRET_DOOR, false);
+ } else if (_globals[kBooksStatus] == 2 || _globals[kBooksStatus] == 4) {
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 8);
+
+ if (_globals[kTapestryStatus] == 1 || _globals[kTapestryStatus] == 3) {
+ _scene->_hotspots.activate(NOUN_WALL_PANEL, false);
+ _scene->_hotspots.activate(NOUN_SECRET_DOOR, true);
+ }
+ }
+ } else {
+ _globals._spriteIndexes[14] = _scene->_sprites.addSprites(formAnimName('e', 5));
+ _scene->_sprites.addSprites(formAnimName('b', 0));
+ _globals._spriteIndexes[13] = _scene->_sprites.addSprites(formAnimName('b', 3));
+ _scene->_hotspots.activateAtPos(NOUN_TABLE, false, Common::Point(140, 107));
+ _scene->_hotspots.activateAtPos(NOUN_TABLE, true, Common::Point(139, 132));
+ _globals._spriteIndexes[10] = _scene->_sprites.addSprites(formAnimName('y', 4));
+
+ if (_globals[kNoLoadWalker]) {
+ _scene->drawToBackground(_globals._spriteIndexes[10], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_sprites.remove(_globals._spriteIndexes[10]);
+ }
+
+ _globals._spriteIndexes[9] = _scene->_sprites.addSprites(formAnimName('y', 3));
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 8);
+ _doorwayHotspotId = _scene->_dynamicHotspots.add(NOUN_DOORWAY, VERB_WALK_THROUGH, SYNTAX_SINGULAR, _globals._sequenceIndexes[9], Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots.setPosition(_doorwayHotspotId, Common::Point(295, 145), FACING_NORTHEAST);
+
+ _globals[kBooksStatus] = 0;
+ _scene->_hotspots.activateAtPos(NOUN_TAPESTRY, false, Common::Point(310, 70));
+ }
+
+ if (_globals[kBooksStatus] == 0)
+ _scene->_hotspots.activate(NOUN_BOOKS, false);
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 7, 0, 5);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 7, 0);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 7, 0);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 3);
+ _globals._sequenceIndexes[4] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[4], false, 7, 0);
+
+
+ if (_globals[kPlayerPersona] == 0) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 4);
+ }
+
+ if (_scene->_priorSceneId == 106) {
+ _game._player._playerPos = Common::Point(201, 152);
+ _game._player._facing = FACING_NORTHWEST;
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14);
+ } else if ((_scene->_priorSceneId == 119) || (_scene->_priorSceneId == 104)) {
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 4);
+ _scene->_sequences.addTimer(60, 77);
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('k', 1), 0);
+ _anim0ActvFl = true;
+ _kingStatus = 2;
+ _scene->setAnimFrame(_globals._animationIndexes[0], 22);
+
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('q', 1), 0);
+ _anim2ActvFl = true;
+ _queenStatus = 0;
+
+ _globals._sequenceIndexes[14] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[14], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[14], 6);
+
+ _globals._animationIndexes[4] = _scene->loadAnimation(formAnimName('p', 1), 79);
+
+ int idx = _scene->_dynamicHotspots.add(NOUN_QUEEN_MOTHER, VERB_WALK_TO, SYNTAX_FEM_NOT_PROPER, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[idx]._articleNumber = PREP_ON;
+ _scene->setDynamicAnim(idx, _globals._animationIndexes[2], 0);
+
+ _scene->_hotspots.activate(NOUN_MACMORN, true);
+
+ idx = _scene->_dynamicHotspots.add(NOUN_KING, VERB_WALK_TO, SYNTAX_MASC_NOT_PROPER, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[idx]._articleNumber = PREP_ON;
+ _scene->setDynamicAnim(idx, _globals._animationIndexes[0], 0);
+ } else if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14);
+ _game._player.firstWalk(Common::Point(77, 93), FACING_SOUTH, Common::Point(74, 107), FACING_SOUTH, false);
+ _game._player.setWalkTrigger(70);
+ } else if (_globals[kNoLoadWalker]) {
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('k', 1), 0);
+ _anim0ActvFl = true;
+ _kingStatus = 0;
+ _scene->setAnimFrame(_globals._animationIndexes[0], 14);
+
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('q', 1), 0);
+ _anim2ActvFl = true;
+ _queenStatus = 0;
+
+ _globals._animationIndexes[4] = _scene->loadAnimation(formAnimName('p', 2), 0);
+ _anim4ActvFl = true;
+ _pidStatus = 0;
+ if (_amuletWorksFl)
+ _scene->setAnimFrame(_globals._animationIndexes[4], 89);
+
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('m', 1), 0);
+ _anim1ActvFl = true;
+ _macStatus = 0;
+ _scene->setAnimFrame(_globals._animationIndexes[1], 25);
+
+ int idx = _scene->_dynamicHotspots.add(NOUN_QUEEN_MOTHER, VERB_WALK_TO, SYNTAX_FEM_NOT_PROPER, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[idx]._articleNumber = PREP_ON;
+ _scene->setDynamicAnim(idx, _globals._animationIndexes[2], 0);
+
+ _scene->_hotspots.activate(NOUN_MACMORN, true);
+
+ idx = _scene->_dynamicHotspots.add(NOUN_KING, VERB_WALK_TO, SYNTAX_MASC_NOT_PROPER, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[idx]._articleNumber = PREP_ON;
+ _scene->setDynamicAnim(idx, _globals._animationIndexes[0], 0);
+
+ if (_vm->_gameConv->_restoreRunning == 1) {
+ _game._player._stepEnabled = false;
+ _vm->_gameConv->run(1);
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->exportValue(0);
+ if (_globals[kLlanieStatus] != 2)
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+ } else {
+ _activateTimerFl = true;
+ _deathTimer = 0;
+ _clock = 0;
+ _game._player._stepEnabled = true;
+ }
+ } else {
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 12);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene104::step() {
+ if (_anim0ActvFl)
+ handleKingAnimation();
+
+ if (_anim1ActvFl)
+ handleMacAnimation1();
+
+ if (_anim2ActvFl)
+ handleQueenAnimation();
+
+ if (_anim3ActvFl)
+ handleTwinklesAnimation();
+
+ if (_anim4ActvFl)
+ handlePidAnimation();
+
+ if (_anim5ActvFl)
+ handleMacAnimation2();
+
+ if (_anim6ActvFl)
+ handleDeathAnimation();
+
+ if ((_animationRunning == 1) && _scene->_animation[_globals._animationIndexes[0]]) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() != _tapestryFrame) {
+ _tapestryFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+
+ if (_tapestryFrame == 13) {
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ }
+ }
+ }
+
+ switch (_game._trigger) {
+ case 70:
+ _scene->deleteSequence(_globals._sequenceIndexes[6]);
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[6] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[6], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[6], 1, 4);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 71);
+ break;
+
+ case 71: {
+ int idx = _globals._sequenceIndexes[6];
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[6], SYNC_SEQ, idx);
+ _game._player._stepEnabled = true;
+ }
+ break;
+ }
+
+ if (_game._trigger == 77)
+ _kingStatus = 0;
+
+ if (_game._trigger == 79) {
+ _scene->freeAnimation(_globals._animationIndexes[4]);
+
+ _globals._animationIndexes[4] = _scene->loadAnimation(formAnimName('p', 2), 0);
+ _anim4ActvFl = true;
+ _pidStatus = 0;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[4], SYNC_CLOCK, 0);
+
+ _scene->deleteSequence(_globals._sequenceIndexes[14]);
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('m', 1), 0);
+ _anim1ActvFl = true;
+ _macStatus = 0;
+
+ _game._player._stepEnabled = false;
+ _vm->_gameConv->run(1);
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->exportValue(0);
+
+ if (_globals[kLlanieStatus] != 2)
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+ }
+
+ if (_game._trigger == 85) {
+ _vm->_sound->command(100);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+ }
+
+ if (_activateTimerFl) {
+ long clockDiff = _scene->_frameStartTime - _clock;
+ if ((clockDiff >= 0) && (clockDiff <= 4))
+ _deathTimer += clockDiff;
+ else
+ _deathTimer += 1;
+
+ _clock = _scene->_frameStartTime;
+
+ if (_deathTimer >= 1300) {
+ _activateTimerFl = false;
+ if (_pidDrawnSword) {
+ _pidStatus = 6;
+ _vm->_gameConv->run(1);
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->exportValue(1);
+ _vm->_gameConv->exportValue(0);
+ if (_globals[kLlanieStatus] != 2)
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->hold();
+ } else
+ _pidStatus = 8;
+
+ _game._player._stepEnabled = false;
+ }
+ }
+
+
+ if ((_globals[kTapestryStatus] == 1 || _globals[kTapestryStatus] == 3)
+ && (_globals[kBooksStatus] == 2 || _globals[kBooksStatus] == 4))
+ _globals[kCanViewCrownHole] = true;
+
+ if (_game._trigger == 95) {
+ _vm->_gameConv->reset(1);
+ _vm->_dialogs->show(10466);
+ _globals[kNoLoadWalker] = false;
+ _scene->_nextSceneId = 119;
+ }
+}
+
+void Scene104::actions() {
+ if (_vm->_gameConv->_running == 1) {
+ handleFinalConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10401);
+ else
+ _vm->_dialogs->show(10437);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_THRONE_ROOM) || _action.isAction(VERB_OPEN, NOUN_DOOR_TO_THRONE_ROOM) || _action.isAction(VERB_PULL, NOUN_DOOR_TO_THRONE_ROOM)) {
+ if (_globals[kPlayerPersona] == 0)
+ _scene->_nextSceneId = 106;
+ else
+ _vm->_dialogs->show(10434);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_HALLWAY) || _action.isAction(VERB_OPEN, NOUN_DOOR_TO_HALLWAY) || _action.isAction(VERB_PULL, NOUN_DOOR_TO_HALLWAY)) {
+ if (_globals[kPlayerPersona] == 0) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[7] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[7], false, 8, 2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[7], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_SPRITE, 2, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[6]);
+ _vm->_sound->command(24);
+ _globals._sequenceIndexes[6] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[6], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2: {
+ int tmpIdx = _globals._sequenceIndexes[6];
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[6], SYNC_SEQ, tmpIdx);
+ }
+ break;
+
+ case 3:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[7]);
+ _scene->_sequences.addTimer(1, 4);
+ break;
+
+ case 4:
+ _game._player.walk(Common::Point(77, 93), FACING_NORTH);
+ _game._player.setWalkTrigger(5);
+ break;
+
+ case 5:
+ _scene->deleteSequence(_globals._sequenceIndexes[6]);
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[6] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[6], false, 7, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 6);
+ break;
+
+ case 6: {
+ int tmpIdx = _globals._sequenceIndexes[6];
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 1);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[6], SYNC_SEQ, tmpIdx);
+ _scene->_sequences.addTimer(6, 7);
+ }
+ break;
+
+ case 7:
+ _scene->_nextSceneId = 103;
+ break;
+
+ default:
+ break;
+ }
+ } else
+ _vm->_dialogs->show(10434);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_PULL) || _action.isAction(VERB_TAKE) || _action.isAction(VERB_OPEN)) && _action.isObject(NOUN_BOOKS)) {
+ if ((_globals[kBooksStatus] == 1) || (_globals[kBooksStatus] == 3) || _game._trigger) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], false, 8, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], -1, 3);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 3, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 1:
+ _globals._sequenceIndexes[12] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[12], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 8);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[12], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2: {
+ int tmpIdx = _globals._sequenceIndexes[12];
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, -2);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[12], SYNC_SEQ, tmpIdx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 8);
+ if ((_globals[kTapestryStatus] == 1) || (_globals[kTapestryStatus] == 3)) {
+ _scene->_hotspots.activate(NOUN_WALL_PANEL, false);
+ _scene->_hotspots.activate(NOUN_SECRET_DOOR, true);
+ }
+ }
+ break;
+
+ case 3:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ _scene->_sequences.addTimer(5, 4);
+ break;
+
+ case 4:
+ if (_globals[kBooksStatus] == 1) {
+ _globals[kPlayerScore] += 2;
+ _globals[kBooksStatus] = 2;
+ if ((_globals[kTapestryStatus] == 1) || (_globals[kTapestryStatus] == 3))
+ _vm->_dialogs->show(10428);
+ else {
+ _vm->_sound->command(94);
+ _vm->_sound->command(67);
+ _vm->_dialogs->show(10427);
+ }
+ } else {
+ _vm->_sound->command(94);
+ _vm->_sound->command(67);
+ _globals[kBooksStatus] = 4;
+ }
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_PUSH, NOUN_BOOKS)) {
+ if ((_globals[kBooksStatus] == 2) || (_globals[kBooksStatus] == 4)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], false, 8, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], -1, 3);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 3, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 1:
+ _vm->_sound->command(94);
+ _vm->_sound->command(67);
+ _scene->deleteSequence(_globals._sequenceIndexes[12]);
+ _globals._sequenceIndexes[12] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[12], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 8);
+ _scene->_sequences.addTimer(6, 2);
+ break;
+
+ case 2:
+ if ((_globals[kTapestryStatus] == 1) || (_globals[kTapestryStatus] == 3)) {
+ _scene->_hotspots.activate(NOUN_WALL_PANEL, true);
+ _scene->_hotspots.activate(NOUN_SECRET_DOOR, false);
+ }
+ break;
+
+ case 3:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ _scene->_sequences.addTimer(5, 4);
+ break;
+
+ case 4:
+ if (_globals[kBooksStatus] == 2)
+ _vm->_dialogs->show(10429);
+ _globals[kBooksStatus] = 3;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if ((_action.isAction(VERB_PULL) || _action.isAction(VERB_OPEN) || _action.isAction(VERB_PUSH)) && _action.isObject(NOUN_TAPESTRY)) {
+ if (_globals[kPlayerPersona] == 0) {
+ if (_scene->_customDest.x >= 279) {
+ if ((_globals[kTapestryStatus] == 0) || (_globals[kTapestryStatus] == 2)) {
+ switch (_game._trigger) {
+ case 0:
+ _scene->deleteSequence(_globals._sequenceIndexes[11]);
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _animationRunning = 1;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('a', -1), 1);
+ break;
+
+ case 1:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 6);
+ _scene->_hotspots.activateAtPos(NOUN_TAPESTRY, true, Common::Point(290, 20));
+ _scene->_hotspots.activateAtPos(NOUN_TAPESTRY, false, Common::Point(310, 70));
+ if ((_globals[kBooksStatus] == 2) || (_globals[kBooksStatus] == 4)) {
+ _scene->_hotspots.activate(NOUN_WALL_PANEL, false);
+ _scene->_hotspots.activate(NOUN_SECRET_DOOR, true);
+ } else {
+ _scene->_hotspots.activate(NOUN_WALL_PANEL, true);
+ _scene->_hotspots.activate(NOUN_SECRET_DOOR, false);
+ }
+ _scene->_sequences.addTimer(6, 2);
+ break;
+
+ case 2:
+ if (_globals[kTapestryStatus] == 0) {
+ _globals[kTapestryStatus] = 1;
+ _globals[kPlayerScore] += 2;
+ if (_globals[kBooksStatus] == 0 || _globals[kBooksStatus] == 1 || _globals[kBooksStatus] == 3)
+ _vm->_dialogs->show(10424);
+ else if (_globals[kBooksStatus] == 2 || _globals[kBooksStatus] == 4)
+ _vm->_dialogs->show(10425);
+ } else
+ _globals[kTapestryStatus] = 3;
+
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ } else
+ _vm->_dialogs->show(10404);
+ } else
+ _vm->_dialogs->show(10445);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_PULL) || _action.isAction(VERB_CLOSE) || _action.isAction(VERB_PUSH)) && _action.isObject(NOUN_TAPESTRY)) {
+ if (_globals[kPlayerPersona] == 0) {
+ if (_scene->_customDest.x >= 279) {
+ if (_globals[kTapestryStatus] == 1 || _globals[kTapestryStatus] == 3) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _scene->deleteSequence(_globals._sequenceIndexes[10]);
+ _animationRunning = 2;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', -1), 1);
+ break;
+
+ case 1:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 6);
+ _scene->_hotspots.activateAtPos(NOUN_TAPESTRY, false, Common::Point(290, 20));
+ _scene->_hotspots.activateAtPos(NOUN_TAPESTRY, true, Common::Point(310, 70));
+ _scene->_hotspots.activate(NOUN_SECRET_DOOR, false);
+ _scene->_hotspots.activate(NOUN_WALL_PANEL, false);
+ _scene->_sequences.addTimer(6, 2);
+ break;
+
+ case 2:
+ _globals[kTapestryStatus] = 2;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+ } else {
+ _vm->_dialogs->show(10445);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_BOOKS) || _action.isObject(NOUN_BOOKSHELF)) {
+ if (_globals[kPlayerPersona] == 0) {
+ switch (_globals[kBooksStatus]) {
+ case 0:
+ _scene->_hotspots.activate(NOUN_BOOKS, true);
+ _globals[kBooksStatus] = 1;
+ _vm->_dialogs->show(10418);
+ _action._inProgress = false;
+ return;
+
+ case 1:
+ _vm->_dialogs->show(10418);
+ _action._inProgress = false;
+ return;
+
+ case 2:
+ case 4:
+ _vm->_dialogs->show(10419);
+ _action._inProgress = false;
+ return;
+
+ case 3:
+ _vm->_dialogs->show(10420);
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+ } else {
+ _vm->_dialogs->show(10439);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isObject(NOUN_FIREPLACE)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10402);
+ else
+ _vm->_dialogs->show(10438);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TAPESTRY)) {
+ if (_globals[kPlayerPersona] == 0) {
+ if (_scene->_customDest.x >= 209 && _scene->_customDest.x <= 278)
+ _vm->_dialogs->show(10403);
+ else if (_scene->_customDest.x >= 107 && _scene->_customDest.x <= 190)
+ _vm->_dialogs->show(10422);
+ else if (_globals[kTapestryStatus] == 1 || _globals[kTapestryStatus] == 3)
+ _vm->_dialogs->show(10460);
+ else
+ _vm->_dialogs->show(10423);
+ } else
+ _vm->_dialogs->show(10439);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RUG)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10405);
+ else
+ _vm->_dialogs->show(10439);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FIREPLACE_SCREEN)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10407);
+ else
+ _vm->_dialogs->show(10439);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR_TO_THRONE_ROOM)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10409);
+ else
+ _vm->_dialogs->show(10434);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SCONCE)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10410);
+ else
+ _vm->_dialogs->show(10440);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WOOD_BASKET)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10411);
+ else
+ _vm->_dialogs->show(10439);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TROPHY)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10412);
+ else
+ _vm->_dialogs->show(10441);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_READING_BENCH)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10414);
+ else
+ _vm->_dialogs->show(10439);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LOVESEAT)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10416);
+ else
+ _vm->_dialogs->show(10439);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR_TO_HALLWAY)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10421);
+ else
+ _vm->_dialogs->show(10434);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SECRET_DOOR)) {
+ _vm->_dialogs->show(10430);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isObject(NOUN_DOORWAY) || _action.isAction(VERB_WALK_THROUGH, NOUN_DOORWAY) || _action.isAction(VERB_OPEN, NOUN_DOORWAY)) && (_globals[kPlayerPersona] == 1)) {
+ _vm->_dialogs->show(10432);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK, NOUN_WALL_PANEL)) {
+ if ((_globals[kBooksStatus] == 0) || (_globals[kBooksStatus] == 1))
+ _vm->_dialogs->show(10435);
+ else
+ _vm->_dialogs->show(10436);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_KING) && _globals[kPlayerPersona] == 1) {
+ _vm->_dialogs->show(10443);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MUSIC_BOX) && _globals[kNoLoadWalker]) {
+ _vm->_dialogs->showItem(OBJ_MAGIC_MUSIC_BOX, 843, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MACMORN) && (_globals[kPlayerPersona] == 1)) {
+ _vm->_dialogs->show(10444);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TABLE)) {
+ if (_globals[kPlayerPersona] == 1)
+ _vm->_dialogs->show(10455);
+ else if (_scene->_customDest.x < 174)
+ _vm->_dialogs->show(10451);
+ else
+ _vm->_dialogs->show(10448);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DECORATION)) {
+ if (_globals[kPlayerPersona] == 1)
+ _vm->_dialogs->show(10439);
+ else
+ _vm->_dialogs->show(10449);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SWORD)) {
+ if (_globals[kPlayerPersona] == 1)
+ _vm->_dialogs->show(10439);
+ else
+ _vm->_dialogs->show(10450);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR) && (_globals[kPlayerPersona] == 1)) {
+ _vm->_dialogs->show(10439);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL) && (_globals[kPlayerPersona] == 1)) {
+ _vm->_dialogs->show(10439);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CANDLESTICK)) {
+ if (_globals[kPlayerPersona] == 1)
+ _vm->_dialogs->show(10439);
+ else
+ _vm->_dialogs->show(10461);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_QUEEN_MOTHER)) {
+ _vm->_dialogs->show(10456);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MACMORN)) {
+ _vm->_dialogs->show(10444);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if ((_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL)) && _action.isObject(NOUN_RUG)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10406);
+ else
+ _vm->_dialogs->show(10445);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL)) && _action.isObject(NOUN_FIREPLACE_SCREEN)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10408);
+ else
+ _vm->_dialogs->show(10445);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL)) && _action.isObject(NOUN_TROPHY)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10413);
+ else
+ _vm->_dialogs->show(10445);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_READING_BENCH)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10415);
+ else
+ _vm->_dialogs->show(10445);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL)) && _action.isObject(NOUN_LOVESEAT)) {
+ if (_globals[kPlayerPersona] == 0)
+ _vm->_dialogs->show(10417);
+ else
+ _vm->_dialogs->show(10445);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_OPEN) || _action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL)) && (_action.isObject(NOUN_SECRET_DOOR) || _action.isObject(NOUN_WALL_PANEL))) {
+ _vm->_dialogs->show(10431);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_INVOKE, NOUN_SIGNET_RING) && (_globals[kPlayerPersona] == 1)) {
+ _vm->_dialogs->show(10433);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_PUT, NOUN_TENTACLE_PARTS, NOUN_WALL_PANEL) && (_globals[kPlayerPersona] == 0)) {
+ _vm->_dialogs->show(10446);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_SHIFT_INTO_BEAR) && _anim0ActvFl) {
+ if (_wasBearFl)
+ _vm->_dialogs->show(10457);
+ else if (_amuletWorksFl)
+ _vm->_dialogs->show(10459);
+ else {
+ _wasBearFl = true;
+ _globals[kPlayerScore] += 2;
+ _vm->_gameConv->run(1);
+ _vm->_gameConv->exportValue(1);
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->exportValue(0);
+ if (_globals[kLlanieStatus] != 2)
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_ATTACK, NOUN_SWORD, NOUN_MACMORN) || _action.isAction(VERB_CARVE_UP, NOUN_SWORD, NOUN_MACMORN) || _action.isAction(VERB_THRUST, NOUN_SWORD, NOUN_MACMORN) || _action.isAction(VERB_TAKE, NOUN_SWORD)) && _anim0ActvFl) {
+ _activateTimerFl = false;
+ _pidStatus = 6;
+
+ if (!_amuletWorksFl) {
+ _globals[kPlayerScore] += 5;
+ _vm->_gameConv->run(1);
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->exportValue(1);
+ _vm->_gameConv->exportValue(0);
+ if (_globals[kLlanieStatus] != 2)
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+
+ _vm->_gameConv->hold();
+ } else {
+ _macStatus = 6;
+ _game._player._stepEnabled = false;
+ }
+ _amuletWorksFl = true;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_INVOKE, NOUN_AMULET) && _anim0ActvFl) {
+ if (_amuletWorksFl) {
+ _activateTimerFl = false;
+ _pidStatus = 5;
+ _globals[kPlayerScore] += 15;
+ _globals[kAmuletStatus] = 2;
+ _game._player._stepEnabled = false;
+
+ _scene->freeAnimation(_globals._animationIndexes[1]);
+
+ _globals._sequenceIndexes[14] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[14], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[14], 6);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[14], SYNC_CLOCK, 0);
+
+ _globals._spriteIndexes[15] = _scene->_sprites.addSprites(formAnimName('e', 3), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('m', 2), 0);
+ _anim1ActvFl = false;
+ _anim5ActvFl = true;
+ } else
+ _vm->_dialogs->showItem(OBJ_AMULET, 945, 0);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_ATTACK, NOUN_SWORD, NOUN_QUEEN_MOTHER) || _action.isAction(VERB_CARVE_UP, NOUN_SWORD, NOUN_QUEEN_MOTHER) || _action.isAction(VERB_THRUST, NOUN_SWORD, NOUN_QUEEN_MOTHER)) {
+ _vm->_dialogs->show(10458);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_MACMORN)) {
+ _vm->_dialogs->show(10464);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_QUEEN_MOTHER)) {
+ _vm->_dialogs->show(10463);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_KING)) {
+ _vm->_dialogs->show(10465);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_POUR_CONTENTS_OF, NOUN_MACMORN)) {
+ _vm->_dialogs->show(10462);
+ _action._inProgress = false;
+ return;
+ }
+
+
+ if (_anim2ActvFl && (_action.isAction(VERB_WALK_ACROSS) || _action.isAction(VERB_WALK_TO))) {
+ _vm->_dialogs->show(10445);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_CANDLESTICK)) {
+ _vm->_dialogs->show(10468);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_MUSIC_BOX) && _globals[kNoLoadWalker]) {
+ _vm->_dialogs->show(10470);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene104::preActions() {
+ if ((_action.isAction(VERB_PULL) || _action.isAction(VERB_OPEN) || _action.isAction(VERB_CLOSE) || _action.isAction(VERB_PUSH))
+ && _action.isObject(NOUN_TAPESTRY) && (_scene->_customDest.x > 280))
+ _game._player.walk(Common::Point(295, 145), FACING_NORTHEAST);
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_THRONE_ROOM)
+ || _action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_HALLWAY)
+ || _action.isAction(VERB_WALK_THROUGH, NOUN_DOORWAY)
+ || ((_action.isAction(VERB_PULL) || _action.isAction(VERB_OPEN) || _action.isAction(VERB_PUSH)) && _action.isObject(NOUN_TAPESTRY))
+ || ((_action.isAction(VERB_PULL) || _action.isAction(VERB_CLOSE) || _action.isAction(VERB_PUSH)) && _action.isObject(NOUN_TAPESTRY))
+ || ((_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL))
+ && (_action.isObject(NOUN_RUG) || _action.isObject(NOUN_FIREPLACE_SCREEN) || _action.isObject(NOUN_TROPHY) || _action.isObject(NOUN_LOVESEAT)))
+ || _action.isAction(VERB_OPEN, NOUN_READING_BENCH)) {
+ if (_globals[kPlayerPersona] == 1)
+ _game._player.cancelWalk();
+ }
+
+ if (_globals[kNoLoadWalker])
+ _game._player._needToWalk = false;
+}
+
+void Scene104::handleFinalConversation() {
+ bool interlocutorFl = false;
+ bool heroFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 11:
+ _deathTimer = 0;
+ _clock = 0;
+ _activateTimerFl = true;
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ case 14:
+ if (!_game._trigger)
+ _macStatus = 3;
+
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ case 17:
+ _pidStatus = 3;
+ _vm->_gameConv->hold();
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ case 20:
+ if (!_game._trigger)
+ _macStatus = 2;
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ case 30:
+ *_vm->_gameConv->_nextStartNode = 31;
+ _vm->_gameConv->abortConv();
+
+ if (_globals[kLlanieStatus] == 2) {
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('l', 1), 0);
+ _anim3ActvFl = true;
+ _twinklesStatus = 1;
+ }
+ break;
+
+ case 38:
+ _globals[kEndOfGame] = true;
+ _scene->_nextSceneId = 106;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 81:
+ switch (_action._activeAction._verbId) {
+ case 0:
+ case 2:
+ case 4:
+ case 5:
+ case 7:
+ case 8:
+ case 11:
+ case 17:
+ if (_macStatus == 0)
+ _macStatus = 1;
+
+ _pidStatus = 0;
+ if (_queenStatus != 2)
+ _queenStatus = 0;
+
+ _kingStatus = 0;
+ break;
+
+ case 1:
+ case 3:
+ case 6:
+ case 20:
+ case 22:
+ case 24:
+ case 26:
+ case 28:
+ case 32:
+ case 34:
+ case 39:
+ case 41:
+ case 43:
+ _kingStatus = 1;
+ _pidStatus = 0;
+ if (_queenStatus != 2)
+ _queenStatus = 0;
+
+ if (_macStatus == 1)
+ _macStatus = 0;
+
+ break;
+
+ case 21:
+ case 23:
+ case 25:
+ case 27:
+ case 35:
+ case 40:
+ case 42:
+ if (_queenStatus != 2)
+ _queenStatus = 1;
+
+ _pidStatus = 0;
+ if (_macStatus == 1)
+ _macStatus = 0;
+
+ _kingStatus = 0;
+ break;
+
+ case 31:
+ case 33:
+ _twinklesStatus = 1;
+ _pidStatus = 0;
+ if (_queenStatus != 2)
+ _queenStatus = 0;
+
+ if (_macStatus == 1)
+ _macStatus = 0;
+
+ _kingStatus = 0;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 83:
+ if ((_action._activeAction._verbId == 8) || (_action._activeAction._verbId == 11))
+ _pidStatus = 2;
+ else
+ _pidStatus = 1;
+
+ if (_macStatus == 1)
+ _macStatus = 0;
+
+ if (_queenStatus != 2)
+ _queenStatus = 0;
+
+ _kingStatus = 0;
+ break;
+
+ default:
+ break;
+ }
+
+ if (!heroFl)
+ _vm->_gameConv->setHeroTrigger(83);
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(81);
+
+ _kingCount = 0;
+ _queenCount = 0;
+ _macCount = 0;
+ _twinklesCount = 0;
+ _pidCount = 0;
+}
+
+void Scene104::handleKingAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _kingFrame)
+ return;
+
+ _kingFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_kingFrame) {
+ case 14:
+ case 21:
+ switch (_kingStatus) {
+ case 0:
+ if (_kingCount > _vm->getRandomNumber(40, 50)) {
+ _kingCount = 0;
+ if (_vm->getRandomNumber(1,2) == 1)
+ resetFrame = 13;
+ else
+ resetFrame = 14;
+ } else {
+ ++_kingCount;
+ resetFrame = 13;
+ }
+ break;
+
+ case 1:
+ resetFrame = 14;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 16:
+ case 17:
+ case 18:
+ case 19:
+ switch (_kingStatus) {
+ case 0:
+ if (_kingCount > _vm->getRandomNumber(40, 50)) {
+ _kingCount = 0;
+ if (_vm->getRandomNumber(1,2) == 1)
+ resetFrame = 15;
+ else
+ resetFrame = 19;
+ } else {
+ ++_kingCount;
+ resetFrame = 15;
+ }
+ break;
+
+ case 1:
+ resetFrame = _vm->getRandomNumber(16, 18);
+ ++_kingCount;
+ if (_kingCount > 15) {
+ _kingStatus = 0;
+ _kingCount = 0;
+ resetFrame = 15;
+ }
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 22:
+ if (_kingStatus == 2)
+ resetFrame = 21;
+ else
+ resetFrame = 0;
+
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _kingFrame = resetFrame;
+ }
+}
+
+
+void Scene104::handleMacAnimation1() {
+ if (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == _macFrame)
+ return;
+
+ _macFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_macFrame) {
+ case 1:
+ case 2:
+ case 7:
+ switch (_macStatus) {
+ case 0:
+ resetFrame = 0;
+ break;
+
+ case 1:
+ if (_macCount == 0) {
+ if (_vm->getRandomNumber(1,2) == 1)
+ resetFrame = 2;
+ else
+ resetFrame = 1;
+
+ ++_macCount;
+ } else {
+ resetFrame = _vm->getRandomNumber(0, 1);
+ ++_macCount;
+ if (_macCount > 15) {
+ _macStatus = 0;
+ _macCount = 0;
+ resetFrame = 0;
+ }
+ }
+ break;
+
+ case 2:
+ resetFrame = 90;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 3:
+ case 4:
+ case 5:
+ switch (_macStatus) {
+ case 0:
+ case 2:
+ case 3:
+ case 4:
+ resetFrame = 5;
+ break;
+
+ case 1:
+ if (_macCount == 0) {
+ if (_vm->getRandomNumber(1,2) == 1)
+ resetFrame = 5;
+ else
+ resetFrame = 3;
+
+ ++_macCount;
+
+ } else {
+ resetFrame = _vm->getRandomNumber(3, 4);
+ ++_macCount;
+ if (_macCount > 15) {
+ _macStatus = 0;
+ _macCount = 0;
+ resetFrame = 5;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 25:
+ _game._player._stepEnabled = true;
+ break;
+
+ case 26:
+ case 90:
+ case 174:
+ switch (_macStatus) {
+ case 3:
+ resetFrame = 76;
+ _macStatus = 0;
+ _game._player._stepEnabled = false;
+ break;
+
+ case 4:
+ break;
+
+ case 5:
+ resetFrame = 147;
+ _macStatus = 0;
+ break;
+
+ case 6:
+ _pidFrame = 105;
+ resetFrame = 26;
+ _scene->setAnimFrame(_globals._animationIndexes[4], 105);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[4], SYNC_ANIM, _globals._animationIndexes[1]);
+ break;
+
+ default:
+ resetFrame = 25;
+ break;
+ }
+ break;
+
+ case 36:
+ _globals._sequenceIndexes[13] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[13], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[13], 13);
+ break;
+
+ case 37:
+ _scene->setAnimFrame(_globals._animationIndexes[4], 89);
+ _pidFrame = 89;
+ _pidStatus = 7;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[4], SYNC_ANIM, _globals._animationIndexes[1]);
+ break;
+
+ case 76:
+ _vm->_gameConv->reset(1);
+ _vm->_dialogs->show(10467);
+ _globals[kNoLoadWalker] = false;
+ _scene->_nextSceneId = 119;
+ break;
+
+ case 82:
+ _pidStatus = 4;
+ break;
+
+ case 97:
+ _activateTimerFl = true;
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 10, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 85);
+ break;
+
+ case 112:
+ resetFrame = 8;
+ _macStatus = 0;
+ break;
+
+ case 162:
+ _vm->_gameConv->release();
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _macFrame = resetFrame;
+ }
+}
+
+
+void Scene104::handleMacAnimation2() {
+
+ if (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == _macFrame)
+ return;
+
+ _macFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_macFrame) {
+ case 1:
+ if (_macStatus != 4)
+ resetFrame = 0;
+ break;
+
+ case 2:
+ _scene->deleteSequence(_globals._sequenceIndexes[14]);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[14], SYNC_ANIM, _globals._animationIndexes[1]);
+ break;
+
+ case 37:
+ _scene->freeAnimation(_globals._animationIndexes[1]);
+ _scene->_sprites.remove(_globals._spriteIndexes[15]);
+ _anim5ActvFl = false;
+ resetFrame = -1;
+
+ _vm->_dialogs->show(10426);
+ _vm->_sound->command(45);
+ _vm->_gameConv->run(1);
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->exportValue(1);
+ if (_globals[kLlanieStatus] != 2)
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _macFrame = resetFrame;
+ }
+}
+
+void Scene104::handleQueenAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame() == _queenFrame)
+ return;
+
+ _queenFrame = _scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_queenFrame) {
+ case 1:
+ case 8:
+ case 15:
+ case 24:
+ switch (_queenStatus) {
+ case 0:
+ if (_queenCount > _vm->getRandomNumber(40, 50)) {
+ _queenCount = 0;
+ if (_vm->getRandomNumber(1,2) == 1)
+ resetFrame = 0;
+ else
+ resetFrame = 8;
+ } else {
+ ++_queenCount;
+ resetFrame = 0;
+ }
+ break;
+
+ case 1:
+ if (_vm->getRandomNumber(1,2) == 1)
+ resetFrame = 1;
+ else
+ resetFrame = 15;
+
+ _queenStatus = 0;
+ break;
+
+ case 2:
+ resetFrame = 8;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 12:
+ case 29:
+ switch (_queenStatus) {
+ case 0:
+ if (_queenCount > _vm->getRandomNumber(40, 50)) {
+ _queenCount = 0;
+ if (_vm->getRandomNumber(1,2) == 1)
+ resetFrame = 11;
+ else
+ resetFrame = 12;
+ } else {
+ ++_queenCount;
+ resetFrame = 11;
+ }
+ break;
+
+ case 1:
+ resetFrame = 12;
+ break;
+
+ case 2:
+ resetFrame = 24;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 27:
+ switch (_queenStatus) {
+ case 0:
+ case 1:
+ resetFrame = 27;
+ break;
+
+ case 2:
+ resetFrame = 26;
+ break;
+
+ case 3:
+ resetFrame = 27;
+ _queenStatus = 0;
+ break;
+
+ default:
+ break;
+ }
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[2], resetFrame);
+ _queenFrame = resetFrame;
+ }
+}
+
+void Scene104::handleTwinklesAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame() == _twinklesFrame)
+ return;
+
+ _twinklesFrame = _scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_twinklesFrame) {
+ case 1:
+ if (_twinklesStatus == 2)
+ resetFrame = 0;
+ break;
+
+ case 10:
+ _queenStatus = 2;
+ break;
+
+ case 28:
+ _vm->_gameConv->run(1);
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->exportValue(1);
+ if (_globals[kLlanieStatus] != 2)
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+ break;
+
+ case 36:
+ _queenStatus = 3;
+ break;
+
+ case 37:
+ case 38:
+ case 47:
+ switch (_twinklesStatus) {
+ case 0:
+ if (_twinklesFrame != 37 && _twinklesFrame != 38)
+ _twinklesFrame = 38;
+
+ if (_twinklesCount > _vm->getRandomNumber(40, 50)) {
+ _twinklesCount = 0;
+ if (_vm->getRandomNumber(1, 2) == 1)
+ resetFrame = 36;
+ else
+ resetFrame = 37;
+ } else {
+ ++_twinklesCount;
+ resetFrame = _twinklesFrame - 1;
+ }
+ break;
+
+ case 1:
+ resetFrame = 38;
+ _twinklesStatus = 0;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[3], resetFrame);
+ _twinklesFrame = resetFrame;
+ }
+}
+
+void Scene104::handleDeathAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[4]]->getCurrentFrame() == _deathFrame)
+ return;
+
+ _deathFrame = _scene->_animation[_globals._animationIndexes[4]]->getCurrentFrame();
+
+ if (_deathFrame == 11)
+ _scene->playSpeech(7);
+ else if (_deathFrame == 17)
+ _scene->playSpeech(6);
+}
+
+void Scene104::handlePidAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[4]]->getCurrentFrame() == _pidFrame)
+ return;
+
+ _pidFrame = _scene->_animation[_globals._animationIndexes[4]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_pidFrame) {
+ case 1:
+ case 2:
+ case 3:
+ case 9:
+ case 47:
+ case 81:
+ switch (_pidStatus) {
+ case 0:
+ resetFrame = 0;
+ break;
+
+ case 1:
+ resetFrame = _vm->getRandomNumber(0, 2);
+ ++_pidCount;
+ if (_pidCount > 20) {
+ _pidStatus = 0;
+ _pidCount = 0;
+ resetFrame = 0;
+ }
+ break;
+
+ case 2:
+ resetFrame = 3;
+ break;
+
+ case 3:
+ _activateTimerFl = false;
+ resetFrame = 10;
+ break;
+
+ case 5:
+ _game._player._stepEnabled = false;
+ _activateTimerFl = false;
+ resetFrame = 47;
+ _pidStatus = 0;
+ break;
+
+ case 6:
+ resetFrame = 81;
+ break;
+
+ case 8:
+ _scene->freeAnimation(_globals._animationIndexes[1]);
+ _scene->freeAnimation(_globals._animationIndexes[4]);
+ _anim1ActvFl = false;
+ _anim4ActvFl = false;
+ _globals._animationIndexes[4] = _scene->loadAnimation(formAnimName('d', 2), 95);
+ _anim6ActvFl = true;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[4], SYNC_CLOCK, 0);
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ if (_pidStatus == 2) {
+ resetFrame = _vm->getRandomNumber(4, 6);
+ ++_pidCount;
+ if (_pidCount > 20) {
+ _pidStatus = 0;
+ _pidCount = 0;
+ resetFrame = 7;
+ }
+ } else
+ resetFrame = 7;
+ break;
+
+ case 24:
+ _vm->_gameConv->release();
+ break;
+
+ case 25:
+ if (_pidStatus == 4) {
+ resetFrame = 25;
+ _pidStatus = 0;
+ } else
+ resetFrame = 24;
+ break;
+
+ case 46:
+ _activateTimerFl = true;
+ _clock = 0;
+ _deathTimer = 0;
+ _game._player._stepEnabled = true;
+ break;
+
+ case 60:
+ resetFrame = 107;
+ break;
+
+ case 62:
+ _macStatus = 4;
+ break;
+
+ case 88:
+ if (_deathTimer < 1300)
+ _macStatus = 5;
+ break;
+
+ case 89:
+ if (_pidStatus == 5) {
+ resetFrame = 55;
+ _pidStatus = 0;
+ } else if (_deathTimer >= 1300)
+ _macStatus = 6;
+ else {
+ _pidDrawnSword = true;
+ resetFrame = 88;
+ }
+ break;
+
+ case 91:
+ _scene->playSpeech(7);
+ break;
+
+ case 95:
+ _scene->playSpeech(6);
+ break;
+
+ case 105:
+ resetFrame = 104;
+ break;
+
+ case 106:
+ if (_pidStatus == 7)
+ resetFrame = 89;
+ else
+ resetFrame = 105;
+ break;
+
+ case 111:
+ resetFrame = 60;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[4], resetFrame);
+ _pidFrame = resetFrame;
+ }
+}
+/*------------------------------------------------------------------------*/
+
+Scene105::Scene105(MADSEngine *vm) : Scene1xx(vm) {
+ _maidTalkingFl = false;
+ _sitUpFl = false;
+ _goodNumberFl = false;
+
+ _maidFrame = -1;
+ _newStatus = -1;
+ _previousStatus = -1;
+ _maidHotspotId1 = -1;
+ _maidHotspotId2 = -1;
+ _bucketHotspotId = -1;
+ _boneHotspotId = -1;
+ _gobletHotspotId = -1;
+}
+
+void Scene105::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+ s.syncAsByte(_maidTalkingFl);
+ s.syncAsByte(_sitUpFl);
+ s.syncAsByte(_goodNumberFl);
+
+ s.syncAsSint16LE(_maidFrame);
+ s.syncAsSint16LE(_newStatus);
+ s.syncAsSint16LE(_previousStatus);
+ s.syncAsSint16LE(_maidHotspotId1);
+ s.syncAsSint16LE(_maidHotspotId2);
+ s.syncAsSint16LE(_bucketHotspotId);
+ s.syncAsSint16LE(_boneHotspotId);
+ s.syncAsSint16LE(_gobletHotspotId);
+}
+
+void Scene105::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_SCULLERY_MAID);
+ _scene->addActiveVocab(NOUN_BUCKET);
+ _scene->addActiveVocab(VERB_WALK_TO);
+ _scene->addActiveVocab(NOUN_BONE);
+ _scene->addActiveVocab(NOUN_GOBLET);
+}
+
+void Scene105::enter() {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites("*KGRD_8");
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 7, 0);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 7, 0, 3);
+
+ _maidHotspotId1 = _scene->_dynamicHotspots.add(NOUN_SCULLERY_MAID, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(189, 123, 189 + 25, 123 + 11));
+ _scene->_dynamicHotspots.setPosition(_maidHotspotId1, Common::Point(174, 151), FACING_NORTHEAST);
+ _scene->_dynamicHotspots[_maidHotspotId1]._articleNumber = PREP_ON;
+
+ _maidHotspotId2 = _scene->_dynamicHotspots.add(NOUN_SCULLERY_MAID, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(189, 134, 189 + 38, 134 + 9));
+ _scene->_dynamicHotspots.setPosition(_maidHotspotId2, Common::Point(174, 151), FACING_NORTHEAST);
+ _scene->_dynamicHotspots[_maidHotspotId2]._articleNumber = PREP_ON;
+
+ _bucketHotspotId = _scene->_dynamicHotspots.add(NOUN_BUCKET, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(176, 137, 176 + 10, 137 + 8));
+ _scene->_dynamicHotspots.setPosition(_bucketHotspotId, Common::Point(174, 151), FACING_NORTHEAST);
+
+ if (_game._objects.isInRoom(OBJ_GOBLET)) {
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('p', 1));
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites("*KGRM_6");
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -1);
+ _gobletHotspotId = _scene->_dynamicHotspots.add(NOUN_GOBLET, VERB_WALK_TO, SYNTAX_SINGULAR, _globals._sequenceIndexes[5], Common::Rect(0, 0, 0, 0));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 6);
+ _scene->_dynamicHotspots.setPosition(_gobletHotspotId, Common::Point(63, 142), FACING_WEST);
+ }
+
+ if (_game._objects.isInRoom(OBJ_BONE)) {
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('p', 0));
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites("*KGRL_6");
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, -1);
+ _boneHotspotId = _scene->_dynamicHotspots.add(NOUN_BONE, VERB_WALK_TO, SYNTAX_SINGULAR, _globals._sequenceIndexes[6], Common::Rect(0, 0, 0, 0));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 6);
+ _scene->_dynamicHotspots.setPosition(_boneHotspotId, Common::Point(255, 145), FACING_EAST);
+ }
+
+ _vm->_gameConv->get(2);
+ _newStatus = 1;
+ _previousStatus = 0;
+ _maidTalkingFl = false;
+ _sitUpFl = false;
+ _goodNumberFl = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('A',-1), 1);
+
+
+ if (_scene->_priorSceneId == 106) {
+ _game._player._playerPos = Common::Point(104, 152);
+ _game._player._facing = FACING_NORTHEAST;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 12);
+ } else if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 6);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 12);
+ _game._player.firstWalk(Common::Point(120, 96), FACING_SOUTH, Common::Point(117, 108), FACING_SOUTH, false);
+ _game._player.setWalkTrigger(70);
+ } else {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 15);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene105::step() {
+ if (_scene->_animation[_globals._animationIndexes[0]]) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() != _maidFrame) {
+ _maidFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ if (_sitUpFl && !_maidTalkingFl) {
+ _previousStatus = _newStatus;
+ _newStatus = 4;
+ }
+
+ if (_maidTalkingFl) {
+ _previousStatus = _newStatus;
+ _newStatus = 5;
+ }
+
+ switch (_maidFrame) {
+ case 16:
+ if (_newStatus == 1) {
+ _goodNumberFl = false;
+ while (!_goodNumberFl)
+ setRandomStatus();
+ }
+
+ if (_newStatus == 1)
+ resetFrame = 1;
+ else if ((_newStatus == 3 && !_sitUpFl) || _newStatus == 4)
+ resetFrame = 53;
+ else if ((_newStatus == 3) && (_sitUpFl))
+ resetFrame = 24;
+ break;
+
+ case 24:
+ if (_newStatus == 2) {
+ _goodNumberFl = false;
+ while (!_goodNumberFl)
+ setRandomStatus();
+ }
+
+ if ((_newStatus == 3) || (_newStatus == 5))
+ resetFrame = 53;
+ else if (_newStatus == 1)
+ resetFrame = 56;
+ else if (_newStatus == 4)
+ resetFrame = 53;
+
+ break;
+
+ case 32:
+ if (_newStatus == 3) {
+ _goodNumberFl = false;
+ while (!_goodNumberFl)
+ setRandomStatus();
+ }
+
+ if ((_newStatus == 1) || (_newStatus == 2))
+ resetFrame = 57;
+ else if (_newStatus == 4)
+ resetFrame = 55;
+ break;
+
+ case 53:
+ _maidTalkingFl = false;
+ _goodNumberFl = false;
+ while (!_goodNumberFl)
+ setRandomStatus();
+
+ if (_newStatus == 1)
+ resetFrame = 60;
+ else if (_newStatus == 2)
+ resetFrame = 57;
+ else if (_newStatus == 3)
+ resetFrame = 63;
+ else if (_newStatus == 4)
+ resetFrame = 55;
+ break;
+
+ case 56:
+ if (_newStatus == 4) {
+ _goodNumberFl = false;
+ while (!_goodNumberFl)
+ setRandomWipebrow();
+ }
+
+ if (_newStatus == 4)
+ resetFrame = 55;
+ else if (_newStatus == 5)
+ resetFrame = 32;
+ else if (_newStatus == 3)
+ resetFrame = 24;
+ break;
+
+ case 57:
+ if (_newStatus == 1)
+ resetFrame = 1;
+ break;
+
+ case 60:
+ if (_newStatus == 1)
+ resetFrame = 1;
+ else if (_newStatus == 2)
+ resetFrame = 16;
+ break;
+
+ case 63:
+ if (_newStatus == 1)
+ resetFrame = 1;
+ break;
+
+ case 64:
+ resetFrame = 24;
+ break;
+
+ default:
+ break;
+ }
+
+ if ((resetFrame >= 0) && (resetFrame != _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame())) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _maidFrame = resetFrame;
+ }
+ }
+ }
+
+ if (_game._trigger >= 70) {
+ switch (_game._trigger) {
+ case 70:
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 12);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 5);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 71);
+ break;
+
+ case 71: {
+ int seqIdx = _globals._sequenceIndexes[3];
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 15);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[3], SYNC_SEQ, seqIdx);
+ _game._player._stepEnabled = true;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
+void Scene105::actions() {
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(10501);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 2) {
+ handleConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_HALLWAY) || _action.isAction(VERB_OPEN, NOUN_DOOR_TO_HALLWAY) || _action.isAction(VERB_PULL, NOUN_DOOR_TO_HALLWAY)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 8, 2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[4],true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 2, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _vm->_sound->command(24);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 12);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2: {
+ int seqIdx = _globals._sequenceIndexes[3];
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 12);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[3], SYNC_SEQ, seqIdx);
+ }
+ break;
+
+ case 3:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[4]);
+ _scene->_sequences.addTimer(1,4);
+ break;
+
+ case 4:
+ _game._player.walk(Common::Point(120, 96), FACING_NORTH);
+ _game._player.setWalkTrigger(5);
+ break;
+
+ case 5:
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 7, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 6);
+ break;
+
+ case 6: {
+ int seqIdx = _globals._sequenceIndexes[3];
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 1);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[3], SYNC_SEQ, seqIdx);
+ _scene->_sequences.addTimer(6, 7);
+ }
+ break;
+
+ case 7:
+ _scene->_nextSceneId = 103;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_THRONE_ROOM) || _action.isAction(VERB_OPEN, NOUN_DOOR_TO_THRONE_ROOM) || _action.isAction(VERB_PULL, NOUN_DOOR_TO_THRONE_ROOM)) {
+ _scene->_nextSceneId = 106;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_SCULLERY_MAID)) {
+ _vm->_gameConv->run(2);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_GOBLET)) {
+ if (_game._trigger || !_game._objects.isInInventory(OBJ_GOBLET)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], true, 6, 2);
+ _scene->_sequences.setAnimRange (_globals._sequenceIndexes[8], 1, 7);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 7, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ _scene->deleteSequence (_globals._sequenceIndexes[5]);
+ _scene->_dynamicHotspots.remove(_gobletHotspotId);
+ _vm->_sound->command(26);
+ _game._objects.addToInventory(OBJ_GOBLET);
+ _vm->_dialogs->showItem(OBJ_GOBLET, 10519, 0);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ _globals[kPlayerScore] += 1;
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_BONE) && _action._mainObjectSource == CAT_HOTSPOT) {
+ if (_game._trigger || !_game._objects.isInInventory(OBJ_BONE)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[7] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[7], false, 6, 2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[7], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_SPRITE, 6, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ _scene->deleteSequence (_globals._sequenceIndexes[6]);
+ _vm->_sound->command(26);
+ _scene->_dynamicHotspots.remove(_boneHotspotId);
+ _game._objects.addToInventory(OBJ_BONE);
+ _vm->_dialogs->showItem(OBJ_BONE, 10520, 0);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[7]);
+ if (!(_globals[kPlayerScoreFlags] & 2048)) {
+ _globals[kPlayerScoreFlags] |= 2048;
+ _globals[kPlayerScore] += 1;
+ }
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_BONE) && _game._objects.isInInventory(OBJ_BONE) && (_action._mainObjectSource == CAT_HOTSPOT)) {
+ _vm->_dialogs->show(40112);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(10502);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BRAZIER)) {
+ _vm->_dialogs->show(10503);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DINING_TABLE)) {
+ if (_scene->_customDest.x <= 98) {
+ if (_game._objects[OBJ_GOBLET]._roomNumber == _scene->_currentSceneId)
+ _vm->_dialogs->show(10505);
+ else
+ _vm->_dialogs->show(10522);
+ } else
+ _vm->_dialogs->show(10504);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHAIR)) {
+ _vm->_dialogs->show(10507);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WINDOW)) {
+ _vm->_dialogs->show(10508);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TAPESTRY)) {
+ _vm->_dialogs->show(10509);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR_TO_THRONE_ROOM)) {
+ _vm->_dialogs->show(10511);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(10512);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR_TO_HALLWAY)) {
+ _vm->_dialogs->show(10513);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DIVIDING_WALL)) {
+ _vm->_dialogs->show(10514);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(10515);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SCULLERY_MAID)) {
+ _vm->_dialogs->show(10516);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GOBLET) && _game._objects.isInRoom(OBJ_GOBLET)) {
+ _vm->_dialogs->show(10517);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BONE) && _game._objects.isInRoom(OBJ_BONE)) {
+ _vm->_dialogs->show(10518);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SCONCE)) {
+ _vm->_dialogs->show(10524);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BUCKET)) {
+ _vm->_dialogs->show(10521);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_SCULLERY_MAID)) {
+ _vm->_dialogs->show(30);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL)) && _action.isObject(NOUN_DINING_TABLE)) {
+ _vm->_dialogs->show(10506);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL)) && _action.isObject(NOUN_TAPESTRY)) {
+ _vm->_dialogs->show(10510);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene105::preActions() {
+ if (_action.isAction(VERB_TALK_TO, NOUN_SCULLERY_MAID))
+ _sitUpFl = true;
+}
+
+void Scene105::setRandomStatus() {
+ _previousStatus = _newStatus;
+ int rndVal = _vm->getRandomNumber(1, 30);
+ if (rndVal < 20) {
+ _newStatus = 1;
+ _goodNumberFl = true;
+ } else if ((rndVal > 19) && (rndVal < 27) && (_previousStatus != 2)) {
+ _newStatus = 2;
+ _goodNumberFl = true;
+ } else if (_previousStatus != 3) {
+ _newStatus = 3;
+ _goodNumberFl = true;
+ }
+}
+
+void Scene105::setRandomWipebrow() {
+ _previousStatus = _newStatus;
+
+ if (_vm->getRandomNumber(1, 100) < 100) {
+ _newStatus = 4;
+ _goodNumberFl = true;
+ } else if (_previousStatus != 3) {
+ _newStatus = 3;
+ _goodNumberFl = true;
+ }
+}
+
+void Scene105::handleConversation() {
+ if ((_action._activeAction._verbId == 0) && !_sitUpFl)
+ _sitUpFl = true;
+
+ if ((_action._activeAction._verbId == 1) || (_action._activeAction._verbId == 2)) {
+ switch (_game._trigger) {
+ case 0:
+ _vm->_gameConv->setInterlocutorTrigger(1);
+ break;
+
+ case 1:
+ _maidTalkingFl = true;
+ _sitUpFl = false;
+ _vm->_gameConv->setHeroTrigger(2);
+ break;
+
+ case 2:
+ _maidTalkingFl = false;
+ break;
+
+ default:
+ break;
+ }
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+} // End of namespace Dragonsphere
+} // End of namespace MADS
diff --git a/engines/mads/dragonsphere/dragonsphere_scenes1.h b/engines/mads/dragonsphere/dragonsphere_scenes1.h
new file mode 100644
index 0000000000..fe51ed4135
--- /dev/null
+++ b/engines/mads/dragonsphere/dragonsphere_scenes1.h
@@ -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 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.
+ *
+ */
+
+#ifndef MADS_DRAGON_SCENES1_H
+#define MADS_DRAGON_SCENES1_H
+
+#include "common/scummsys.h"
+#include "common/serializer.h"
+#include "mads/game.h"
+#include "mads/scene.h"
+#include "mads/dragonsphere/dragonsphere_scenes.h"
+
+namespace MADS {
+
+namespace Dragonsphere {
+
+class Scene1xx : public DragonsphereScene {
+protected:
+ /**
+ * Plays an appropriate sound when entering a scene
+ */
+ void sceneEntrySound();
+
+ /**
+ *Sets the AA file to use for the scene
+ */
+ void setAAName();
+
+ /**
+ * Updates the prefix used for getting player sprites for the scene
+ */
+ void setPlayerSpritesPrefix();
+public:
+ Scene1xx(MADSEngine *vm) : DragonsphereScene(vm) {}
+};
+
+class Scene101 : public Scene1xx {
+public:
+ Scene101(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene102 : public Scene1xx {
+private:
+ int _diaryHotspotIdx1;
+ int _diaryHotspotIdx2;
+ int _diaryFrame;
+ int _animRunning;
+
+public:
+ Scene102(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene103 : public Scene1xx {
+public:
+ Scene103(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene104 : public Scene1xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _anim2ActvFl;
+ bool _anim3ActvFl;
+ bool _anim4ActvFl;
+ bool _anim5ActvFl;
+ bool _anim6ActvFl;
+ bool _activateTimerFl;
+ bool _wasBearFl;
+ bool _amuletWorksFl;
+ bool _pidDrawnSword;
+ int _animationRunning;
+ int _deathTimer;
+ int _deathFrame;
+ int _doorwayHotspotId;
+
+ int _kingStatus;
+ int _kingFrame;
+ int _kingCount;
+ int _queenStatus;
+ int _queenFrame;
+ int _queenCount;
+ int _pidStatus;
+ int _pidFrame;
+ int _pidCount;
+ int _macStatus;
+ int _macFrame;
+ int _macCount;
+ int _twinklesStatus;
+ int _twinklesFrame;
+ int _twinklesCount;
+ int _tapestryFrame;
+
+ int32 _clock;
+
+ void handleFinalConversation();
+ void handleKingAnimation();
+ void handleMacAnimation1();
+ void handleMacAnimation2();
+ void handleQueenAnimation();
+ void handleTwinklesAnimation();
+ void handleDeathAnimation();
+ void handlePidAnimation();
+
+public:
+ Scene104(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene105 : public Scene1xx {
+private:
+ bool _maidTalkingFl;
+ bool _sitUpFl;
+ bool _goodNumberFl;
+
+ int _maidFrame;
+ int _maidHotspotId1;
+ int _maidHotspotId2;
+ int _newStatus;
+ int _previousStatus;
+ int _bucketHotspotId;
+ int _boneHotspotId;
+ int _gobletHotspotId;
+
+ void setRandomStatus();
+ void setRandomWipebrow();
+ void handleConversation();
+
+public:
+ Scene105(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+} // End of namespace Dragonsphere
+} // End of namespace MADS
+
+#endif /* MADS_DRAGON_SCENES1_H */
diff --git a/engines/mads/dragonsphere/game_dragonsphere.cpp b/engines/mads/dragonsphere/game_dragonsphere.cpp
index b07eab9daa..f528056a54 100644
--- a/engines/mads/dragonsphere/game_dragonsphere.cpp
+++ b/engines/mads/dragonsphere/game_dragonsphere.cpp
@@ -28,7 +28,7 @@
#include "mads/msurface.h"
#include "mads/dragonsphere/game_dragonsphere.h"
//#include "mads/nebular/dialogs_nebular.h"
-//#include "mads/nebular/globals_nebular.h"
+#include "mads/dragonsphere/globals_dragonsphere.h"
#include "mads/dragonsphere/dragonsphere_scenes.h"
namespace MADS {
diff --git a/engines/mads/dragonsphere/game_dragonsphere.h b/engines/mads/dragonsphere/game_dragonsphere.h
index b57f8833c6..b9eb86af64 100644
--- a/engines/mads/dragonsphere/game_dragonsphere.h
+++ b/engines/mads/dragonsphere/game_dragonsphere.h
@@ -26,7 +26,7 @@
#include "common/scummsys.h"
#include "mads/game.h"
#include "mads/globals.h"
-//#include "mads/nebular/globals_nebular.h"
+#include "mads/dragonsphere/globals_dragonsphere.h"
namespace MADS {
@@ -80,7 +80,7 @@ enum InventoryObject {
OBJ_DIAMOND_DUST = 40,
OBJ_RUBY_RING = 41,
OBJ_GOLD_NUGGET = 42,
- OBJ_MUSIC_BOX = 43,
+ OBJ_MAGIC_MUSIC_BOX = 43,
OBJ_EMERALD = 44,
OBJ_PARCHMENT = 45,
OBJ_GAME = 46,
@@ -88,15 +88,6 @@ enum InventoryObject {
OBJ_NEW_BUNDLE = 48
};
-// HACK: A stub for now, remove from here once it's implemented properly
-class DragonsphereGlobals : public Globals {
-public:
- DragonsphereGlobals() {
- resize(210); // Rex has 210 globals
- }
- virtual ~DragonsphereGlobals() {}
-};
-
class GameDragonsphere : public Game {
friend class Game;
protected:
diff --git a/engines/mads/dragonsphere/globals_dragonsphere.cpp b/engines/mads/dragonsphere/globals_dragonsphere.cpp
new file mode 100644
index 0000000000..fa05ed97c2
--- /dev/null
+++ b/engines/mads/dragonsphere/globals_dragonsphere.cpp
@@ -0,0 +1,51 @@
+/* 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.
+ *
+ */
+
+#include "common/scummsys.h"
+#include "common/config-manager.h"
+#include "mads/dragonsphere/globals_dragonsphere.h"
+
+namespace MADS {
+
+namespace Dragonsphere {
+
+DragonsphereGlobals::DragonsphereGlobals()
+ : Globals() {
+ // Initialize lists
+ resize(140);
+ _spriteIndexes.resize(30);
+ _sequenceIndexes.resize(30);
+ _animationIndexes.resize(30);
+}
+
+void DragonsphereGlobals::synchronize(Common::Serializer &s) {
+ Globals::synchronize(s);
+
+ _spriteIndexes.synchronize(s);
+ _sequenceIndexes.synchronize(s);
+ _animationIndexes.synchronize(s);
+}
+
+
+} // End of namespace Dragonsphere
+
+} // End of namespace MADS
diff --git a/engines/mads/dragonsphere/globals_dragonsphere.h b/engines/mads/dragonsphere/globals_dragonsphere.h
new file mode 100644
index 0000000000..cc0e42eb43
--- /dev/null
+++ b/engines/mads/dragonsphere/globals_dragonsphere.h
@@ -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 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.
+ *
+ */
+
+#ifndef MADS_GLOBALS_DRAGONSPHERE_H
+#define MADS_GLOBALS_DRAGONSPHERE_H
+
+#include "common/scummsys.h"
+#include "common/array.h"
+#include "mads/game.h"
+#include "mads/resources.h"
+
+namespace MADS {
+
+namespace Dragonsphere {
+
+enum GlobalId {
+ // Global variables
+
+ kWalkerTiming = 0,
+ kWalkerTiming2 = 1,
+ kPlayerPersona = 10,
+ kPlayerScore = 11,
+ kDragonHighScene = 12,
+ kDragonMyScene = 13,
+ kNoLoadWalker = 14,
+ kPlayerScoreFlags = 15,
+ kSorcerorDefeated = 16,
+ kPreRoom = 17,
+ kPerformDisplacements = 18,
+
+ kKingStatus = 20,
+ kWardStatus = 21,
+ kTalkedToSoptus = 22,
+ kTalkedToShifter = 23,
+ kAmuletStatus = 24,
+ kBooksStatus = 25,
+ kTapestryStatus = 26,
+ kTalkedToMerchant = 27,
+ kCanViewCrownHole = 28,
+ kTalkedToStatus = 29,
+
+ kGuardPidStatus = 30,
+ kCrawledOutOfBed101 = 31,
+ kStatueIsOnStairway114 = 32,
+ kDogIsAsleep = 33,
+ kCrystalBallDead = 34,
+ kThrewBone = 35,
+ kWoodenDoorOpen = 36,
+ kKingIsInStairwell = 37,
+ kLlanieStatus = 38,
+ kNoTalkToGuard = 39,
+
+ kObjectGiven201 = 40,
+ kKingGotStabbed = 41,
+ kGivenObjectBefore = 42,
+ kGuardsAreAsleep = 43,
+ kDomeUp = 44,
+ kTalkedToWise = 45,
+ kDollGiven = 46,
+ kResetConv = 47,
+ kTalkedToGreta = 48,
+ kSlimeHealed = 49,
+
+ kDanceMusicOn = 50,
+ kPlayerIsSeal = 51,
+ kVinesHavePlayer = 52,
+ kEndOfGame = 53,
+ kResetConv2 = 54,
+ kInvokedFrom111 = 55,
+
+ kSaveWinsInDesert = 60,
+ kBubblesUpIn301 = 61,
+ kBubbleWontAttack = 62,
+ kPidLookedAtDoll = 63,
+
+ kOasis = 80,
+ kFireHoles = 81,
+ kDesertRoom = 82,
+ kFromDirection = 83,
+ kDesertCounter = 84,
+ kMoveDirection409 = 85,
+ kHealVerbsVisible = 86,
+ kGrapesHaveGrown = 87,
+ kPidTalkShamon = 88,
+ kPidJustDied = 89,
+
+ kGrapesAreDead = 90,
+ kRocIsChewingDates = 91,
+ kWinsInDesert = 92,
+ kWinsTillPrize = 93,
+ kPidHasBeenHealedSop = 94,
+ kGamePoints = 95,
+ kDancePoints = 96,
+ kCluePoints = 97,
+ kPrizesOwedToPlayer = 98,
+ kObjectFlags = 99,
+
+ kWaterfallDiverted = 100,
+ kShakStatus = 101,
+ kMaxGridValue = 102,
+ kMoveDirection510 = 103,
+ kShak506Angry = 104,
+ kMonsterIsDead = 105,
+ kDoneTalkingLani502 = 106,
+ kFoundLani504 = 107,
+ kSaidUseSwordShak = 108,
+ kGobletFilledSoporific = 109,
+
+ kBeenIn504AsPid = 110,
+ kSeenLaniDeadFirstTime = 111,
+ kSaidPoemIn504 = 112,
+ kTriedToHealLlanie504 = 113,
+ kPutBundleOnLlanie504 = 114,
+ kMake504Empty = 115,
+ kHasTakenMud = 116,
+ kPlatformClicked606 = 117,
+ kHadSpiritBundle = 118,
+
+ kMudIsInEye603 = 120,
+ kRopeIsAlive = 121,
+ kRatCageIsOpen = 122,
+ kFlaskOnPlate = 123,
+ kFluidIsDripping = 124,
+ kHoleIsIn607 = 125,
+ kRopeIsHangingIn607 = 126,
+ kObjectIsInFreezer605 = 127,
+ kObjectImitated = 128,
+ kHasRed = 129,
+
+ kHasYellow = 130,
+ kHasBlue = 131,
+ kWizardDead = 132,
+ kVineWillGrab = 133,
+ kFloorIsCool = 134,
+ kRatMelted = 135,
+ kDoorIsCool = 136,
+ kUsedElevator = 137,
+ kBeenOnTopFloor = 138,
+ kTorchIsIn609 = 139,
+
+ kGridPosition = 140
+ };
+
+class DragonsphereGlobals : public Globals {
+public:
+ SynchronizedList _spriteIndexes;
+ SynchronizedList _sequenceIndexes;
+ SynchronizedList _animationIndexes;
+public:
+ /**
+ * Constructor
+ */
+ DragonsphereGlobals();
+
+ /**
+ * Synchronize the globals data
+ */
+ virtual void synchronize(Common::Serializer &s);
+};
+
+} // End of namespace Dragonsphere
+
+} // End of namespace MADS
+
+#endif /* MADS_GLOBALS_DRAGONSPHERE_H */
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp
index 91f6cd5630..8ebea2a3b2 100644
--- a/engines/mads/game.cpp
+++ b/engines/mads/game.cpp
@@ -57,8 +57,7 @@ Game *Game::init(MADSEngine *vm) {
}
Game::Game(MADSEngine *vm)
- : _vm(vm), _surface(nullptr), _objects(vm), _scene(vm),
- _screenObjects(vm), _player(vm) {
+ : _vm(vm), _surface(nullptr), _objects(vm), _scene(vm), _screenObjects(vm), _player(vm), _camX(vm), _camY(vm) {
_sectionNumber = 1;
_priorSectionNumber = 0;
_loadGameSlot = -1;
@@ -82,6 +81,7 @@ Game::Game(MADSEngine *vm)
_winStatus = 0;
_widepipeCtr = 0;
_fx = kTransitionNone;
+ _panningSpeed = 1; // Medium speed
// Load the inventory object list
_objects.load();
@@ -218,6 +218,10 @@ void Game::sectionLoop() {
}
_scene.loadScene(_scene._nextSceneId, _aaName, 0);
+ camInitDefault();
+ camSetSpeed();
+
+
_vm->_sound->pauseNewCommands();
if (!_player._spritesLoaded) {
@@ -297,8 +301,10 @@ void Game::sectionLoop() {
_vm->_events->waitCursor();
_kernelMode = KERNEL_ROOM_PRELOAD;
- delete _scene._activeAnimation;
- _scene._activeAnimation = nullptr;
+ for (int i = 0; i < 10; i++) {
+ delete _scene._animation[i];
+ _scene._animation[i] = nullptr;
+ }
_scene._reloadSceneFlag = false;
@@ -597,4 +603,78 @@ void Game::createThumbnail() {
::createThumbnail(_saveThumb, _vm->_screen.getData(), MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT, thumbPalette);
}
+void Game::syncTimers(SyncType slaveType, int slaveId, SyncType masterType, int masterId) {
+ uint32 syncTime = 0;
+
+ switch (masterType) {
+ case SYNC_SEQ:
+ syncTime = _scene._sequences[masterId]._timeout;
+ break;
+
+ case SYNC_ANIM:
+ syncTime = _scene._animation[masterId]->getNextFrameTimer();
+ break;
+
+ case SYNC_CLOCK:
+ syncTime = _scene._frameStartTime + masterId;
+ break;
+
+ case SYNC_PLAYER:
+ syncTime = _player._priorTimer;
+ break;
+ }
+
+
+ switch (slaveType) {
+ case SYNC_SEQ:
+ _scene._sequences[slaveId]._timeout = syncTime;
+ break;
+
+ case SYNC_PLAYER:
+ _player._priorTimer = syncTime;
+ break;
+
+ case SYNC_ANIM:
+ _scene._animation[slaveId]->setNextFrameTimer(syncTime);
+ break;
+
+ case SYNC_CLOCK:
+ error("syncTimer is trying to force _frameStartTime");
+ }
+}
+
+void Game::camInitDefault() {
+ _camX.setDefaultPanX();
+ _camY.setDefaultPanY();
+}
+
+void Game::camSetSpeed() {
+ switch (_panningSpeed) {
+ case 1:
+ _camX._speed = 8;
+ _camY._speed = 4;
+ break;
+
+ case 2:
+ _camX._speed = 320;
+ _camY._speed = 160;
+ break;
+
+ default:
+ _camX._speed = 4;
+ _camY._speed = 2;
+ break;
+ }
+}
+
+void Game::camUpdate() {
+ bool any_pan = _camX.camPan(&_scene._posAdjust.x, &_player._playerPos.x, 320, _scene._sceneInfo->_width);
+ any_pan |= _camY.camPan(&_scene._posAdjust.y, &_player._playerPos.y, 156, _scene._sceneInfo->_height);
+
+ if (any_pan) {
+ _scene.setCamera(_scene._posAdjust);
+ _screenObjects._forceRescan = true;
+ }
+}
+
} // End of namespace MADS
diff --git a/engines/mads/game.h b/engines/mads/game.h
index 95b54b0d1a..9defb58b1a 100644
--- a/engines/mads/game.h
+++ b/engines/mads/game.h
@@ -34,6 +34,7 @@
#include "mads/inventory.h"
#include "mads/player.h"
#include "mads/screen.h"
+#include "mads/camera.h"
namespace MADS {
@@ -44,6 +45,11 @@ enum KernelMode {
KERNEL_ROOM_PRELOAD = 3, KERNEL_ROOM_INIT = 4, KERNEL_ACTIVE_CODE = 5
};
+enum SyncType {
+ SYNC_SEQ = 1, SYNC_PLAYER = 2, SYNC_ANIM = 3, SYNC_CLOCK = 4
+};
+
+
#define MADS_SAVEGAME_VERSION 1
struct MADSSavegameHeader {
@@ -142,6 +148,8 @@ public:
int _winStatus;
int _widepipeCtr;
int _loadGameSlot;
+ int _panningSpeed;
+ Camera _camX, _camY;
public:
virtual ~Game();
@@ -235,6 +243,12 @@ public:
* Creates a temporary thumbnail for use in saving games
*/
void createThumbnail();
+
+ void syncTimers(SyncType slaveType, int slaveId, SyncType masterType, int masterId);
+
+ void camInitDefault();
+ void camSetSpeed();
+ void camUpdate();
};
} // End of namespace MADS
diff --git a/engines/mads/hotspots.cpp b/engines/mads/hotspots.cpp
index 8afef2e524..098313eca4 100644
--- a/engines/mads/hotspots.cpp
+++ b/engines/mads/hotspots.cpp
@@ -27,6 +27,7 @@ namespace MADS {
DynamicHotspot::DynamicHotspot() {
_seqIndex = 0;
+ _animIndex = -1;
_facing = FACING_NONE;
_descId = 0;
_verbId = 0;
@@ -52,6 +53,11 @@ DynamicHotspots::DynamicHotspots(MADSEngine *vm) : _vm(vm) {
_count = 0;
}
+int DynamicHotspots::add(int descId, int verbId, int syntax, int seqIndex, const Common::Rect &bounds) {
+ warning("TODO: DynamicHotspots::add(5 params))");
+ return add(descId, verbId, seqIndex, bounds);
+}
+
int DynamicHotspots::add(int descId, int verbId, int seqIndex, const Common::Rect &bounds) {
// Find a free slot
uint idx = 0;
@@ -69,6 +75,7 @@ int DynamicHotspots::add(int descId, int verbId, int seqIndex, const Common::Rec
_entries[idx]._verbId = verbId;
_entries[idx]._articleNumber = PREP_IN;
_entries[idx]._cursor = CURSOR_NONE;
+ _entries[idx]._animIndex = -1;
++_count;
_changed = true;
@@ -101,6 +108,8 @@ void DynamicHotspots::remove(int index) {
if (index >= 0 && _entries[index]._active) {
if (_entries[index]._seqIndex >= 0)
scene._sequences[_entries[index]._seqIndex]._dynamicHotspotIndex = -1;
+ if (_entries[index]._animIndex >= 0)
+ scene._animation[_entries[index]._animIndex]->_dynamicHotspotIndex = -1;
_entries[index]._active = false;
--_count;
@@ -212,4 +221,16 @@ void Hotspots::activate(int vocabId, bool active) {
}
}
+void Hotspots::activateAtPos(int vocabId, bool active, Common::Point pos) {
+ for (uint idx = 0; idx < size(); ++idx) {
+ Hotspot &hotspot = (*this)[idx];
+ if ((hotspot._vocabId == vocabId) && (pos.x >= hotspot._bounds.left) &&
+ (pos.x <= hotspot._bounds.right) && (pos.y >= hotspot._bounds.top) &&
+ (pos.y <= hotspot._bounds.bottom)) {
+ hotspot._active = active;
+ _vm->_game->_screenObjects.setActive(CAT_HOTSPOT, idx, active);
+ }
+ }
+}
+
} // End of namespace MADS
diff --git a/engines/mads/hotspots.h b/engines/mads/hotspots.h
index 902275bb21..ffd53e5a70 100644
--- a/engines/mads/hotspots.h
+++ b/engines/mads/hotspots.h
@@ -35,6 +35,7 @@ class DynamicHotspot {
public:
bool _active;
int _seqIndex;
+ int _animIndex;
Common::Rect _bounds;
Common::Point _feetPos;
Facing _facing;
@@ -54,7 +55,17 @@ public:
void synchronize(Common::Serializer &s);
};
-#define DYNAMIC_HOTSPOTS_SIZE 8
+#define DYNAMIC_HOTSPOTS_SIZE 16
+
+#define SYNTAX_SINGULAR 0
+#define SYNTAX_PLURAL 1
+#define SYNTAX_PARTITIVE 2
+#define SYNTAX_SINGULAR_MASC 3
+#define SYNTAX_SINGULAR_FEM 4
+#define SYNTAX_SINGULAR_LIVING 5
+#define SYNTAX_MASC_NOT_PROPER 6
+#define SYNTAX_FEM_NOT_PROPER 7
+#define MAX_SYNTAX 8
class DynamicHotspots {
private:
@@ -68,6 +79,7 @@ public:
Common::Array<MADS::DynamicHotspot>::size_type size() const { return _entries.size(); }
DynamicHotspot &operator[](uint idx) { return _entries[idx]; }
+ int add(int descId, int verbId, int syntax, int seqIndex, const Common::Rect &bounds);
int add(int descId, int verbId, int seqIndex, const Common::Rect &bounds);
int setPosition(int index, const Common::Point &pos, Facing facing);
int setCursor(int index, CursorType cursor);
@@ -113,6 +125,12 @@ public:
* Sets the active state of a given hotspot
*/
void activate(int vocabId, bool active);
+
+ /**
+ * Sets the active state of a given hotspot if it includes a given position
+ */
+ void activateAtPos(int vocabId, bool active, Common::Point pos);
+
};
} // End of namespace MADS
diff --git a/engines/mads/mads.cpp b/engines/mads/mads.cpp
index 8c7b6b1ce3..0bdf484c9a 100644
--- a/engines/mads/mads.cpp
+++ b/engines/mads/mads.cpp
@@ -46,12 +46,14 @@ MADSEngine::MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc) :
_musicFlag = true;
_soundFlag = true;
_dithering = false;
+ _disableFastwalk = false;
_debugger = nullptr;
_dialogs = nullptr;
_events = nullptr;
_font = nullptr;
_game = nullptr;
+ _gameConv = nullptr;
_palette = nullptr;
_resources = nullptr;
_sound = nullptr;
@@ -65,6 +67,7 @@ MADSEngine::~MADSEngine() {
delete _font;
Font::deinit();
delete _game;
+ delete _gameConv;
delete _palette;
delete _resources;
delete _sound;
@@ -96,6 +99,14 @@ void MADSEngine::initialize() {
_audio = new AudioPlayer(_mixer, getGameID());
_game = Game::init(this);
+ switch (getGameID()) {
+ case GType_RexNebular:
+ _gameConv = nullptr;
+ break;
+ default:
+ _gameConv = new GameConversation(this);
+ }
+
loadOptions();
_screen.empty();
diff --git a/engines/mads/mads.h b/engines/mads/mads.h
index 901035320a..1b0f96a656 100644
--- a/engines/mads/mads.h
+++ b/engines/mads/mads.h
@@ -30,6 +30,7 @@
#include "common/util.h"
#include "engines/engine.h"
#include "graphics/surface.h"
+#include "mads/conversations.h"
#include "mads/debugger.h"
#include "mads/dialogs.h"
#include "mads/events.h"
@@ -96,6 +97,7 @@ public:
EventsManager *_events;
Font *_font;
Game *_game;
+ GameConversation * _gameConv;
Palette *_palette;
Resources *_resources;
ScreenSurface _screen;
@@ -108,6 +110,7 @@ public:
bool _musicFlag;
bool _soundFlag;
bool _dithering;
+ bool _disableFastwalk;
public:
MADSEngine(OSystem *syst, const MADSGameDescription *gameDesc);
virtual ~MADSEngine();
diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp
index cfc3b09461..10d5a2179a 100644
--- a/engines/mads/menu_views.cpp
+++ b/engines/mads/menu_views.cpp
@@ -1,24 +1,24 @@
/* 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.
- *
- */
+*
+* 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.
+*
+*/
#include "common/scummsys.h"
#include "mads/game.h"
@@ -254,6 +254,7 @@ void TextView::processCommand() {
sceneInfo->_width = MADS_SCREEN_WIDTH;
sceneInfo->_height = MADS_SCENE_HEIGHT;
_spareScreens[spareIndex].setSize(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT);
+
sceneInfo->loadMadsV1Background(screenId, "", SCENEFLAG_TRANSLATE,
_spareScreens[spareIndex]);
delete sceneInfo;
@@ -795,4 +796,40 @@ int AnimationView::getParameter() {
return result;
}
+void AnimationView::checkResource(const Common::String &resourceName) {
+ //bool hasSuffix = false;
+
+}
+
+int AnimationView::scanResourceIndex(const Common::String &resourceName) {
+ int foundIndex = -1;
+
+ if (_v1) {
+ const char *chP = strchr(resourceName.c_str(), '\\');
+ if (!chP) {
+ chP = strchr(resourceName.c_str(), '*');
+ }
+
+ Common::String resName = chP ? Common::String(chP + 1) : resourceName;
+
+ if (_v2 != 3) {
+ assert(_resIndex.size() == 0);
+ }
+
+ // Scan for the resource name
+ for (uint resIndex = 0; resIndex < _resIndex.size(); ++resIndex) {
+ ResIndexEntry &resEntry = _resIndex[resIndex];
+ if (resEntry._resourceName.compareToIgnoreCase(resourceName)) {
+ foundIndex = resIndex;
+ break;
+ }
+ }
+ }
+
+ if (foundIndex >= 0) {
+ // TODO
+ }
+ return -1;
+}
+
} // End of namespace MADS
diff --git a/engines/mads/menu_views.h b/engines/mads/menu_views.h
index 6c8a2a8bdd..c203248ad9 100644
--- a/engines/mads/menu_views.h
+++ b/engines/mads/menu_views.h
@@ -8,12 +8,20 @@
* 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.
+<<<<<<< HEAD
+
+=======
*
+>>>>>>> master
* 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.
+<<<<<<< HEAD
+
+=======
*
+>>>>>>> master
* 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.
@@ -119,8 +127,8 @@ protected:
virtual void doFrame();
/**
- * Called when the script is finished
- */
+ * Called when the script is finished
+ */
virtual void scriptDone();
public:
/**
@@ -191,6 +199,11 @@ private:
int _manualFrame2;
int _animFrameNumber;
bool _nextCyclingActive;
+private:
+ void checkResource(const Common::String &resourceName);
+
+ int scanResourceIndex(const Common::String &resourceName);
+
uint _scrollFrameCtr;
private:
void load();
diff --git a/engines/mads/messages.cpp b/engines/mads/messages.cpp
index d88806150d..2bee77dae7 100644
--- a/engines/mads/messages.cpp
+++ b/engines/mads/messages.cpp
@@ -193,6 +193,10 @@ void KernelMessages::processText(int msgIndex) {
msg._timeout = 0;
}
+ if (msg._flags & KMSG_ANIM) {
+ warning("TODO: Implement animated text");
+ }
+
if ((msg._timeout <= 0) && (_vm->_game->_trigger == 0)) {
msg._flags |= KMSG_EXPIRE;
if (msg._trigger != 0) {
@@ -465,6 +469,16 @@ void KernelMessages::initRandomMessages(int maxSimultaneousMessages,
va_end(va);
}
+void KernelMessages::setAnim(int msgId, int seqId, int val3 = 0) {
+ if (msgId < 0)
+ return;
+
+ _entries[msgId]._flags |= KMSG_ANIM;
+ _entries[msgId]._sequenceIndex = seqId;
+
+ warning("TODO: KernelMessages::setAnim, unused parameter");
+}
+
/*------------------------------------------------------------------------*/
diff --git a/engines/mads/messages.h b/engines/mads/messages.h
index 764477a7fc..2b673a8a4d 100644
--- a/engines/mads/messages.h
+++ b/engines/mads/messages.h
@@ -39,14 +39,14 @@ namespace MADS {
enum KernelMessageFlags {
KMSG_QUOTED = 1, KMSG_PLAYER_TIMEOUT = 2, KMSG_SEQ_ENTRY = 4, KMSG_SCROLL = 8,
KMSG_RIGHT_ALIGN = 0x10, KMSG_CENTER_ALIGN = 0x20, KMSG_EXPIRE = 0x40,
- KMSG_ACTIVE = 0x80
+ KMSG_ACTIVE = 0x80, KMSG_ANIM = 0x100
};
class MADSEngine;
class KernelMessage {
public:
- uint8 _flags;
+ uint16 _flags;
int _sequenceIndex;
int _color1;
int _color2;
@@ -104,6 +104,7 @@ public:
int addQuote(int quoteId, int endTrigger, uint32 timeout);
void scrollMessage(int msgIndex, int numTicks, bool quoted);
void setSeqIndex(int msgIndex, int seqIndex);
+ void setAnim(int msgId, int seqId, int val3);
void remove(int msgIndex);
void reset();
void update();
diff --git a/engines/mads/module.mk b/engines/mads/module.mk
index 7cb7a91e8c..8f154394bf 100644
--- a/engines/mads/module.mk
+++ b/engines/mads/module.mk
@@ -3,10 +3,16 @@ MODULE := engines/mads
MODULE_OBJS := \
dragonsphere/game_dragonsphere.o \
dragonsphere/dragonsphere_scenes.o \
+ dragonsphere/dragonsphere_scenes1.o \
+ dragonsphere/globals_dragonsphere.o \
phantom/game_phantom.o \
phantom/globals_phantom.o \
phantom/phantom_scenes.o \
phantom/phantom_scenes1.o \
+ phantom/phantom_scenes2.o \
+ phantom/phantom_scenes3.o \
+ phantom/phantom_scenes4.o \
+ phantom/phantom_scenes5.o \
nebular/dialogs_nebular.o \
nebular/game_nebular.o \
nebular/globals_nebular.o \
@@ -25,7 +31,9 @@ MODULE_OBJS := \
animation.o \
assets.o \
audio.o \
+ camera.o \
compression.o \
+ conversations.o \
debugger.o \
detection.o \
dialogs.o \
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index 960a2cc2f4..ede16e1f99 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -82,11 +82,14 @@ bool DialogsNebular::show(int messageId, int objectId) {
if (centerFlag) {
crFlag = true;
} else {
- if (objectId == -1) {
+ if (dialog)
+ delete dialog;
+
+ if (objectId == -1)
dialog = new TextDialog(_vm, FONT_INTERFACE, _defaultPosition, _dialogWidth);
- } else {
+ else
dialog = new PictureDialog(_vm, _defaultPosition, _dialogWidth, objectId);
- }
+
dialog->wordWrap(dialogText);
dialog->incNumLines();
}
@@ -146,11 +149,10 @@ bool DialogsNebular::show(int messageId, int objectId) {
}
if (!dialog) {
- if (objectId == -1) {
+ if (objectId == -1)
dialog = new TextDialog(_vm, FONT_INTERFACE, _defaultPosition, _dialogWidth);
- } else {
+ else
dialog = new PictureDialog(_vm, _defaultPosition, _dialogWidth, objectId);
- }
}
if (centerFlag) {
@@ -366,6 +368,8 @@ void DialogsNebular::showScummVMSaveDialog() {
// Flag for scene loading that we're returning from a dialog
scene._currentSceneId = RETURNING_FROM_DIALOG;
+
+ delete dialog;
}
void DialogsNebular::showScummVMRestoreDialog() {
@@ -382,6 +386,8 @@ void DialogsNebular::showScummVMRestoreDialog() {
// Flag for scene loading that we're returning from a dialog
scene._currentSceneId = RETURNING_FROM_DIALOG;
}
+
+ delete dialog;
}
/*------------------------------------------------------------------------*/
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp
index 8f40bc15c8..c4b7f57281 100644
--- a/engines/mads/nebular/game_nebular.cpp
+++ b/engines/mads/nebular/game_nebular.cpp
@@ -354,7 +354,7 @@ void GameNebular::setSectionHandler() {
void GameNebular::checkShowDialog() {
// Loop for showing dialogs, if any need to be shown
- if (_vm->_dialogs->_pendingDialog && (_player._stepEnabled || _winStatus)
+ if (_vm->_dialogs->_pendingDialog && (_player._stepEnabled || _winStatus)
&& !_globals[kCopyProtectFailed]) {
_player.releasePlayerSprites();
@@ -693,8 +693,6 @@ void GameNebular::doObjectAction() {
_globals[kHandsetCellStatus] = _difficulty != DIFFICULTY_HARD || _globals[kHandsetCellStatus] ? 1 : 2;
dialogs.show(425);
}
- } else if (action.isAction(VERB_SET, NOUN_TIMEBOMB)) {
- dialogs.show(427);
} else if (action.isAction(VERB_PUT, NOUN_BOMB, NOUN_CHICKEN) || action.isAction(VERB_PUT, NOUN_BOMBS, NOUN_CHICKEN)) {
_objects.setRoom(OBJ_CHICKEN, NOWHERE);
if (_objects.isInInventory(OBJ_BOMBS)) {
@@ -828,7 +826,7 @@ void GameNebular::unhandledAction() {
void GameNebular::step() {
if (_player._visible && _player._stepEnabled && !_player._moving &&
(_player._facing == _player._turnToFacing)) {
- if (_scene._frameStartTime >= *((uint32 *)&_globals[kWalkerTiming])) {
+ if (_scene._frameStartTime >= (uint32)_globals[kWalkerTiming]) {
if (!_player._stopWalkerIndex) {
int randomVal = _vm->getRandomNumber(29999);
if (_globals[kSexOfRex] == REX_MALE) {
@@ -877,19 +875,19 @@ void GameNebular::step() {
}
}
- *((uint32 *)&_globals[kWalkerTiming]) += 6;
+ _globals[kWalkerTiming] += 6;
}
}
// Below is countdown to set the timebomb off in room 604
if (_globals[kTimebombStatus] == TIMEBOMB_ACTIVATED) {
- int diff = _scene._frameStartTime - *((uint32 *)&_globals[kTimebombClock]);
- if ((diff >= 0) && (diff <= 60)) {
- *((uint32 *)&_globals[kTimebombTimer]) += diff;
- } else {
- ++*((uint32 *)&_globals[kTimebombTimer]);
- }
- *((uint32 *)&_globals[kTimebombClock]) = _scene._frameStartTime;
+ int diff = _scene._frameStartTime - _globals[kTimebombClock];
+ if ((diff >= 0) && (diff <= 60))
+ _globals[kTimebombTimer] += diff;
+ else
+ ++_globals[kTimebombTimer];
+
+ _globals[kTimebombClock] = (int) _scene._frameStartTime;
}
}
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index 6fe17f3beb..0520294b29 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -48,6 +48,7 @@ MainMenu::MainMenu(MADSEngine *vm): MenuView(vm) {
_highlightedIndex = -1;
_selectedIndex = -1;
_buttonDown = false;
+ _showEvolve = _showSets = false;
for (int i = 0; i < 7; ++i)
_menuItems[i] = nullptr;
@@ -137,12 +138,14 @@ void MainMenu::doFrame() {
}
_vm->_events->showCursor();
+ showBonusItems();
} else {
if ((_menuItemIndex == -1) || (_frameIndex == 0)) {
if (++_menuItemIndex == 6) {
// Reached end of display animation
_vm->_events->showCursor();
+ showBonusItems();
return;
} else if (_menuItemIndex == 4 && !shouldShowQuotes()) {
++_menuItemIndex;
@@ -180,6 +183,17 @@ void MainMenu::addSpriteSlot() {
_redrawFlag = true;
}
+void MainMenu::showBonusItems() {
+ Scene &scene = _vm->_game->_scene;
+ _showEvolve = Common::File::exists("SECTION0.HAG") && Common::File::exists("evolve.res");
+ _showSets = Common::File::exists("SECTION0.HAG") && Common::File::exists("sets.res");
+
+ if (_showSets)
+ scene._kernelMessages.add(Common::Point(290, 143), 0x4140, 0, 0, 0, "S");
+ if (_showEvolve)
+ scene._kernelMessages.add(Common::Point(305, 143), 0x4140, 0, 0, 0, "E");
+}
+
bool MainMenu::onEvent(Common::Event &event) {
Scene &scene = _vm->_game->_scene;
if (_selectedIndex != -1)
@@ -280,6 +294,10 @@ bool MainMenu::onEvent(Common::Event &event) {
_selectedIndex = _highlightedIndex;
unhighlightItem();
_frameIndex = 0;
+ } else if (_showSets && Common::Rect(290, 165, 300, 185).contains(event.mouse)) {
+ handleAction(SETS);
+ } else if (_showEvolve && Common::Rect(305, 165, 315, 185).contains(event.mouse)) {
+ handleAction(EVOLVE);
}
return true;
@@ -334,6 +352,14 @@ void MainMenu::handleAction(MADSGameAction action) {
TextView::execute(_vm, "quotes");
return;
+ case SETS:
+ AnimationView::execute(_vm, "sets");
+ break;
+
+ case EVOLVE:
+ AnimationView::execute(_vm, "evolve");
+ break;
+
case EXIT:
_vm->_dialogs->_pendingDialog = DIALOG_ADVERT;
break;
diff --git a/engines/mads/nebular/menu_nebular.h b/engines/mads/nebular/menu_nebular.h
index 35af0bb34f..8a0cc3575d 100644
--- a/engines/mads/nebular/menu_nebular.h
+++ b/engines/mads/nebular/menu_nebular.h
@@ -35,7 +35,10 @@ class MADSEngine;
namespace Nebular {
-enum MADSGameAction { START_GAME, RESUME_GAME, SHOW_INTRO, CREDITS, QUOTES, EXIT };
+enum MADSGameAction {
+ START_GAME, RESUME_GAME, SHOW_INTRO, CREDITS, QUOTES, EXIT,
+ SETS, EVOLVE
+};
class MainMenu: public MenuView {
private:
@@ -45,6 +48,7 @@ private:
int _frameIndex;
uint32 _delayTimeout;
bool _skipFlag;
+ bool _showEvolve, _showSets;
/**
* Currently highlighted menu item
@@ -81,7 +85,16 @@ private:
*/
void addSpriteSlot();
+ /**
+ * Returns true if the Quotes item should be shown.
+ * i.e. if the player has completed the game
+ */
bool shouldShowQuotes();
+
+ /**
+ * Show the bonus item icons, if available
+ */
+ void showBonusItems();
protected:
/**
* Display the menu
diff --git a/engines/mads/nebular/nebular_scenes.cpp b/engines/mads/nebular/nebular_scenes.cpp
index eb6f7a5610..da419a70a2 100644
--- a/engines/mads/nebular/nebular_scenes.cpp
+++ b/engines/mads/nebular/nebular_scenes.cpp
@@ -485,7 +485,7 @@ void SceneTeleporter::teleporterHandleKey() {
if (_scene->_currentSceneId != 711) {
if (_curMessageId >= 0)
_scene->_kernelMessages.remove(_curMessageId);
- _curMessageId = _scene->_kernelMessages.add(Common::Point(143, 61), 0xFDFC, 16, 0, 9999999, _msgText);
+ _curMessageId = _scene->_kernelMessages.add(Common::Point(143, 61), 0xFDFC, 16, 0, INDEFINITE_TIMEOUT, _msgText);
}
break;
@@ -563,8 +563,8 @@ void SceneTeleporter::teleporterEnter() {
Common::String msgText2 = Common::String::format("#%.4d", codeVal);
if (_scene->_currentSceneId != 711) {
- _scene->_kernelMessages.add(Common::Point(133, 34), 0, 32, 0, 9999999, msgText2);
- _scene->_kernelMessages.add(Common::Point(143, 61), 0xFDFC, 16, 0, 9999999, _msgText);
+ _scene->_kernelMessages.add(Common::Point(133, 34), 0, 32, 0, INDEFINITE_TIMEOUT, msgText2);
+ _scene->_kernelMessages.add(Common::Point(143, 61), 0xFDFC, 16, 0, INDEFINITE_TIMEOUT, _msgText);
}
_meteorologistCurPlace = 0;
@@ -577,9 +577,9 @@ void SceneTeleporter::teleporterEnter() {
bool SceneTeleporter::teleporterActions() {
bool retVal = false;
- static int _buttonList[12] = { NOUN_0_KEY, NOUN_1_KEY, NOUN_2_KEY, NOUN_3_KEY, NOUN_4_KEY, NOUN_5_KEY, NOUN_6_KEY, NOUN_7_KEY, NOUN_8_KEY, NOUN_9_KEY, NOUN_SMILE_KEY, NOUN_FROWN_KEY };
if (_action.isAction(VERB_PRESS) || _action.isAction(VERB_PUSH)) {
+ static int _buttonList[12] = { NOUN_0_KEY, NOUN_1_KEY, NOUN_2_KEY, NOUN_3_KEY, NOUN_4_KEY, NOUN_5_KEY, NOUN_6_KEY, NOUN_7_KEY, NOUN_8_KEY, NOUN_9_KEY, NOUN_SMILE_KEY, NOUN_FROWN_KEY };
for (int i = 0; i < 12; i++) {
if (_action._activeAction._objectNameId == _buttonList[i])
_buttonTyped = i;
diff --git a/engines/mads/nebular/nebular_scenes1.cpp b/engines/mads/nebular/nebular_scenes1.cpp
index 0cb1b11ee9..9207d87be7 100644
--- a/engines/mads/nebular/nebular_scenes1.cpp
+++ b/engines/mads/nebular/nebular_scenes1.cpp
@@ -258,32 +258,32 @@ void Scene101::step() {
break;
}
- if (_scene->_activeAnimation != nullptr) {
- if ((_scene->_activeAnimation->getCurrentFrame() >= 6) && (_messageNum == 0)) {
+ if (_scene->_animation[0] != nullptr) {
+ if ((_scene->_animation[0]->getCurrentFrame() >= 6) && (_messageNum == 0)) {
_messageNum++;
_scene->_kernelMessages.add(Common::Point(63, _posY), 0x1110, 0, 0, 240, _game.getQuote(49));
_posY += 14;
}
- if ((_scene->_activeAnimation->getCurrentFrame() >= 7) && (_messageNum == 1)) {
+ if ((_scene->_animation[0]->getCurrentFrame() >= 7) && (_messageNum == 1)) {
_messageNum++;
_scene->_kernelMessages.add(Common::Point(63, _posY), 0x1110, 0, 0, 240, _game.getQuote(54));
_posY += 14;
}
- if ((_scene->_activeAnimation->getCurrentFrame() >= 10) && (_messageNum == 2)) {
+ if ((_scene->_animation[0]->getCurrentFrame() >= 10) && (_messageNum == 2)) {
_messageNum++;
_scene->_kernelMessages.add(Common::Point(63, _posY), 0x1110, 0, 0, 240, _game.getQuote(55));
_posY += 14;
}
- if ((_scene->_activeAnimation->getCurrentFrame() >= 17) && (_messageNum == 3)) {
+ if ((_scene->_animation[0]->getCurrentFrame() >= 17) && (_messageNum == 3)) {
_messageNum++;
_scene->_kernelMessages.add(Common::Point(63, _posY), 0x1110, 0, 0, 240, _game.getQuote(56));
_posY += 14;
}
- if ((_scene->_activeAnimation->getCurrentFrame() >= 20) && (_messageNum == 4)) {
+ if ((_scene->_animation[0]->getCurrentFrame() >= 20) && (_messageNum == 4)) {
_messageNum++;
_scene->_kernelMessages.add(Common::Point(63, _posY), 0x1110, 0, 0, 240, _game.getQuote(50));
_posY += 14;
@@ -1263,7 +1263,7 @@ void Scene102::actions() {
return;
}
- if (_action.isAction(VERB_LOOK, NOUN_BURGER) && (_action._mainObjectSource == 4)) {
+ if (_action.isAction(VERB_LOOK, NOUN_BURGER) && (_action._mainObjectSource == CAT_HOTSPOT)) {
_vm->_dialogs->show(801);
_action._inProgress = false;
}
@@ -1782,7 +1782,7 @@ void Scene104::step() {
if ((_game._player._special > 0) && _game._player._stepEnabled)
_game._player._stepEnabled = false;
- if (_kargShootingFl && (_scene->_activeAnimation->getCurrentFrame() >= 19)) {
+ if (_kargShootingFl && (_scene->_animation[0]->getCurrentFrame() >= 19)) {
_scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 120, _game.getQuote(52));
_kargShootingFl = false;
}
@@ -2079,7 +2079,7 @@ void Scene106::step() {
}
}
- if (_firstEmergingFl && (_scene->_activeAnimation->getCurrentFrame() >= 19)) {
+ if (_firstEmergingFl && (_scene->_animation[0]->getCurrentFrame() >= 19)) {
_firstEmergingFl = false;
_scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 120, _game.getQuote(52));
}
@@ -2263,7 +2263,7 @@ void Scene107::enter() {
}
void Scene107::step() {
- if (_shootingFl && (_scene->_activeAnimation->getCurrentFrame() >= 19)) {
+ if (_shootingFl && (_scene->_animation[0]->getCurrentFrame() >= 19)) {
_scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 34, 0, 120, _game.getQuote(52));
_shootingFl = false;
}
@@ -2295,7 +2295,7 @@ void Scene107::actions() {
_scene->_nextSceneId = 105;
else if (_action.isAction(VERB_LOOK, NOUN_NORTHERN_SEA_CLIFF))
_vm->_dialogs->show(10701);
- else if (_action.isAction(VERB_LOOK, NOUN_DEAD_FISH) && (_action._mainObjectSource == 4))
+ else if (_action.isAction(VERB_LOOK, NOUN_DEAD_FISH) && (_action._mainObjectSource == CAT_HOTSPOT))
_vm->_dialogs->show(10702);
else if (_action.isAction(VERB_LOOK, NOUN_BUSH_LIKE_FORMATION))
_vm->_dialogs->show(10703);
@@ -2919,7 +2919,7 @@ void Scene110::actions() {
switch (_game._trigger) {
case 0:
_scene->loadAnimation(Resources::formatName(110, 'T', 0, EXT_AA, ""), 1);
- _scene->_activeAnimation->setNextFrameTimer(_game._player._ticksAmount + _game._player._priorTimer);
+ _scene->_animation[0]->setNextFrameTimer(_game._player._ticksAmount + _game._player._priorTimer);
_game._player._stepEnabled = false;
_game._player._visible = false;
break;
@@ -3066,7 +3066,7 @@ void Scene111::step() {
if (_game._trigger == 73)
_vm->_sound->command(37);
- if (_rexDivingFl && (_scene->_activeAnimation->getCurrentFrame() >= 9)) {
+ if (_rexDivingFl && (_scene->_animation[0]->getCurrentFrame() >= 9)) {
_vm->_sound->command(36);
_rexDivingFl = false;
}
@@ -3138,8 +3138,8 @@ void Scene112::enter() {
}
void Scene112::step() {
- if ((_scene->_activeAnimation != nullptr) && (_game._storyMode == STORYMODE_NICE)) {
- if (_scene->_activeAnimation->getCurrentFrame() >= 54) {
+ if ((_scene->_animation[0] != nullptr) && (_game._storyMode == STORYMODE_NICE)) {
+ if (_scene->_animation[0]->getCurrentFrame() >= 54) {
_scene->freeAnimation();
_game._trigger = 70;
}
diff --git a/engines/mads/nebular/nebular_scenes2.cpp b/engines/mads/nebular/nebular_scenes2.cpp
index 1cbd6f56ef..5210f59f47 100644
--- a/engines/mads/nebular/nebular_scenes2.cpp
+++ b/engines/mads/nebular/nebular_scenes2.cpp
@@ -484,7 +484,7 @@ void Scene202::enter() {
}
_scene->loadAnimation(formAnimName('M', -1), 71);
- _scene->_activeAnimation->setCurrentFrame(200);
+ _scene->_animation[0]->setCurrentFrame(200);
} else {
if (_ladderTopFl) {
_game._player._visible = false;
@@ -596,7 +596,7 @@ void Scene202::step() {
break;
}
- if (!_scene->_activeAnimation && (_globals[kMeteorologistStatus] != METEOROLOGIST_GONE) && (_meteoClock2 <= _scene->_frameStartTime) && (_meteoClock1 <= _scene->_frameStartTime)) {
+ if (!_scene->_animation[0] && (_globals[kMeteorologistStatus] != METEOROLOGIST_GONE) && (_meteoClock2 <= _scene->_frameStartTime) && (_meteoClock1 <= _scene->_frameStartTime)) {
int randVal = _vm->getRandomNumber(1, 500);
int threshold = 1;
if (_ladderTopFl)
@@ -615,11 +615,11 @@ void Scene202::step() {
}
}
- if (!_scene->_activeAnimation)
+ if (!_scene->_animation[0])
return;
if (_waitingMeteoFl) {
- if (_scene->_activeAnimation->getCurrentFrame() >= 200) {
+ if (_scene->_animation[0]->getCurrentFrame() >= 200) {
if ((_globals[kMeteorologistWatch] == METEOROLOGIST_TOWER) || _globals[kLadderBroken]) {
_scene->_nextSceneId = 213;
} else {
@@ -628,7 +628,7 @@ void Scene202::step() {
}
}
- if ((_scene->_activeAnimation->getCurrentFrame() == 160) && (_meteoFrame != _scene->_activeAnimation->getCurrentFrame())) {
+ if ((_scene->_animation[0]->getCurrentFrame() == 160) && (_meteoFrame != _scene->_animation[0]->getCurrentFrame())) {
Common::Point msgPos;
int msgFlag;
if (!_ladderTopFl) {
@@ -647,15 +647,15 @@ void Scene202::step() {
_toTeleportFl = true;
}
- if (_scene->_activeAnimation->getCurrentFrame() == _meteoFrame) {
+ if (_scene->_animation[0]->getCurrentFrame() == _meteoFrame) {
return;
}
- _meteoFrame = _scene->_activeAnimation->getCurrentFrame();
+ _meteoFrame = _scene->_animation[0]->getCurrentFrame();
int randVal = _vm->getRandomNumber(1, 1000);
int frameStep = -1;
- switch (_scene->_activeAnimation->getCurrentFrame()) {
+ switch (_scene->_animation[0]->getCurrentFrame()) {
case 42:
case 77:
case 96:
@@ -693,8 +693,8 @@ void Scene202::step() {
break;
}
- if (frameStep >= 0 && frameStep != _scene->_activeAnimation->getCurrentFrame() + 1) {
- _scene->_activeAnimation->setCurrentFrame(frameStep);
+ if (frameStep >= 0 && frameStep != _scene->_animation[0]->getCurrentFrame() + 1) {
+ _scene->_animation[0]->setCurrentFrame(frameStep);
_meteoFrame = frameStep;
}
}
@@ -797,7 +797,7 @@ void Scene202::actions() {
_scene->_nextSceneId = 203;
} else if (_action.isAction(VERB_WALK_TOWARDS, NOUN_FIELD_TO_NORTH)) {
if (_globals[kMeteorologistStatus] != METEOROLOGIST_GONE) {
- if (_scene->_activeAnimation)
+ if (_scene->_animation[0])
_globals[kMeteorologistStatus] = METEOROLOGIST_PRESENT;
else
_globals[kMeteorologistStatus] = METEOROLOGIST_ABSENT;
@@ -890,7 +890,7 @@ void Scene202::actions() {
_globals._sequenceIndexes[10] = _scene->_sequences.startCycle(_globals._spriteIndexes[9], false, 6);
_scene->_sequences.setDepth(_globals._sequenceIndexes[10], 1);
_scene->_sequences.setPosition(_globals._sequenceIndexes[10], Common::Point(172, 123));
- if (_scene->_activeAnimation) {
+ if (_scene->_animation[0]) {
_waitingMeteoFl = true;
_globals[kMeteorologistWatch] = METEOROLOGIST_GROUND;
} else {
@@ -898,7 +898,7 @@ void Scene202::actions() {
}
break;
case 2:
- if (!_scene->_activeAnimation && !_meteorologistSpecial) {
+ if (!_scene->_animation[0] && !_meteorologistSpecial) {
_vm->_dialogs->show(20222);
}
_scene->_sequences.remove(_globals._sequenceIndexes[10]);
@@ -932,13 +932,13 @@ void Scene202::actions() {
_globals._sequenceIndexes[10] = _scene->_sequences.startCycle(_globals._spriteIndexes[9], true, -2);
_scene->_sequences.setPosition(_globals._sequenceIndexes[10], Common::Point(247, 82));
_scene->_sequences.setDepth(_globals._sequenceIndexes[10], 1);
- if (_scene->_activeAnimation) {
- if (_scene->_activeAnimation->getCurrentFrame() > 200) {
+ if (_scene->_animation[0]) {
+ if (_scene->_animation[0]->getCurrentFrame() > 200) {
_scene->_sequences.addTimer(120, 2);
} else {
_waitingMeteoFl = true;
_globals[kMeteorologistWatch] = METEOROLOGIST_GONE;
- if ((_scene->_activeAnimation->getCurrentFrame() >= 44) && (_scene->_activeAnimation->getCurrentFrame() <= 75)) {
+ if ((_scene->_animation[0]->getCurrentFrame() >= 44) && (_scene->_animation[0]->getCurrentFrame() <= 75)) {
_scene->_kernelMessages.reset();
int msgIndex = _scene->_kernelMessages.add(Common::Point(248, 15), 0x1110, 32, 0, 60, _game.getQuote(100));
_scene->_kernelMessages.setQuoted(msgIndex, 4, false);
@@ -952,7 +952,7 @@ void Scene202::actions() {
}
break;
case 2:
- if (!_scene->_activeAnimation)
+ if (!_scene->_animation[0])
_vm->_dialogs->show(20222);
_meteorologistSpecial = false;
_scene->_sequences.remove(_globals._sequenceIndexes[10]);
@@ -1227,7 +1227,7 @@ void Scene205::enter() {
if (_globals[kSexOfRex] != SEX_MALE) {
_scene->loadAnimation(formAnimName('a', -1));
- _scene->_activeAnimation->_resetFlag = true;
+ _scene->_animation[0]->_resetFlag = true;
} else {
_beingKicked = true;
_globals._sequenceIndexes[8] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[8], false, 8, 1, 0, 0);
@@ -1284,7 +1284,7 @@ void Scene205::step() {
}
void Scene205::handleWomanSpeech(int quote) {
- _kernelMessage = _scene->_kernelMessages.add(Common::Point(186, 27), 0xFBFA, 0, 0, 9999999, _game.getQuote(quote));
+ _kernelMessage = _scene->_kernelMessages.add(Common::Point(186, 27), 0xFBFA, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(quote));
}
void Scene205::actions() {
@@ -1379,8 +1379,8 @@ void Scene205::actions() {
_scene->_sequences.updateTimeout(_globals._sequenceIndexes[9], -1);
_vm->_sound->command(27);
} else if (_game._trigger == 1) {
- if (_scene->_activeAnimation != nullptr)
- _scene->_activeAnimation->resetSpriteSetsCount();
+ if (_scene->_animation[0] != nullptr)
+ _scene->_animation[0]->resetSpriteSetsCount();
_vm->_dialogs->show(20516);
_scene->_reloadSceneFlag = true;
@@ -1405,9 +1405,9 @@ void Scene205::actions() {
_vm->_dialogs->show(20503);
else if (_action.isAction(VERB_LOOK, NOUN_HUT))
_vm->_dialogs->show(20504);
- else if (_action.isAction(VERB_LOOK, NOUN_CHICKEN) && (_action._mainObjectSource == 4))
+ else if (_action.isAction(VERB_LOOK, NOUN_CHICKEN) && (_action._mainObjectSource == CAT_HOTSPOT))
_vm->_dialogs->show(20505);
- else if (_action.isAction(VERB_TAKE, NOUN_CHICKEN) && (_action._mainObjectSource == 4))
+ else if (_action.isAction(VERB_TAKE, NOUN_CHICKEN) && (_action._mainObjectSource == CAT_HOTSPOT))
_vm->_dialogs->show(20506);
else if (_action.isAction(VERB_LOOK, NOUN_CHICKEN_ON_SPIT))
_vm->_dialogs->show(20507);
@@ -1746,9 +1746,9 @@ void Scene208::enter() {
}
void Scene208::step() {
- if (_boundingFl && _scene->_activeAnimation &&
- (_rhotundaTime <= _scene->_activeAnimation->getCurrentFrame())) {
- _rhotundaTime = _scene->_activeAnimation->getCurrentFrame();
+ if (_boundingFl && _scene->_animation[0] &&
+ (_rhotundaTime <= _scene->_animation[0]->getCurrentFrame())) {
+ _rhotundaTime = _scene->_animation[0]->getCurrentFrame();
if (_rhotundaTime == 125)
_scene->_sequences.remove(_globals._sequenceIndexes[4]);
@@ -4064,7 +4064,7 @@ void Scene210::setDialogNode(int node) {
_vm->_palette->lock();
_scene->_kernelMessages.reset();
_scene->freeAnimation();
- _scene->_activeAnimation = nullptr;
+ _scene->_animation[0] = nullptr;
_scene->resetScene();
_globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('c', -1));
@@ -4109,7 +4109,7 @@ void Scene210::setDialogNode(int node) {
}
void Scene210::handleTwinklesSpeech(int quoteId, int shiftX, uint32 delay) {
- _scene->_kernelMessages.add(Common::Point(10, 70 + (shiftX * 14)), 0xFDFC, 0, 0, (delay == 0) ? 9999999 : delay, _game.getQuote(quoteId));
+ _scene->_kernelMessages.add(Common::Point(10, 70 + (shiftX * 14)), 0xFDFC, 0, 0, (delay == 0) ? INDEFINITE_TIMEOUT : delay, _game.getQuote(quoteId));
}
void Scene210::newNode(int node) {
@@ -4263,8 +4263,8 @@ void Scene210::enter() {
}
restoreDialogNode(_curDialogNode, quote, number);
- if (_scene->_activeAnimation)
- _scene->_activeAnimation->setCurrentFrame(131);
+ if (_scene->_animation[0])
+ _scene->_animation[0]->setCurrentFrame(131);
}
_vm->_palette->setEntry(252, 63, 63, 10);
@@ -4274,9 +4274,9 @@ void Scene210::enter() {
}
void Scene210::step() {
- if ((_twinkleAnimationType == 1) && _scene->_activeAnimation) {
- if (_twinklesCurrentFrame != _scene->_activeAnimation->getCurrentFrame()) {
- _twinklesCurrentFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_twinkleAnimationType == 1) && _scene->_animation[0]) {
+ if (_twinklesCurrentFrame != _scene->_animation[0]->getCurrentFrame()) {
+ _twinklesCurrentFrame = _scene->_animation[0]->getCurrentFrame();
int reset_frame = -1;
int random = _vm->getRandomNumber(1, 1000);
@@ -4396,8 +4396,8 @@ void Scene210::step() {
}
if (reset_frame >= 0) {
- if (reset_frame != _scene->_activeAnimation->getCurrentFrame()) {
- _scene->_activeAnimation->setCurrentFrame(reset_frame);
+ if (reset_frame != _scene->_animation[0]->getCurrentFrame()) {
+ _scene->_animation[0]->setCurrentFrame(reset_frame);
_twinklesCurrentFrame = reset_frame;
}
@@ -4411,9 +4411,9 @@ void Scene210::step() {
}
}
- if ((_twinkleAnimationType == 2) && _scene->_activeAnimation) {
- if (_twinklesCurrentFrame != _scene->_activeAnimation->getCurrentFrame()) {
- _twinklesCurrentFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_twinkleAnimationType == 2) && _scene->_animation[0]) {
+ if (_twinklesCurrentFrame != _scene->_animation[0]->getCurrentFrame()) {
+ _twinklesCurrentFrame = _scene->_animation[0]->getCurrentFrame();
int reset_frame = -1;
if (_twinklesCurrentFrame == 53) {
@@ -4422,8 +4422,8 @@ void Scene210::step() {
} else if ((_twinklesCurrentFrame == 75) && _shouldTalk)
reset_frame = 60;
- if ((reset_frame >= 0) && (reset_frame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(reset_frame);
+ if ((reset_frame >= 0) && (reset_frame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(reset_frame);
_twinklesCurrentFrame = reset_frame;
}
}
@@ -4646,7 +4646,7 @@ void Scene211::enter() {
_game._player._stepEnabled = false;
_game._player._visible = false;
_scene->loadAnimation(formAnimName('A', -1), 100);
- _scene->_activeAnimation->setCurrentFrame(169);
+ _scene->_animation[0]->setCurrentFrame(169);
} else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) {
_game._player._playerPos = Common::Point(310, 31);
_game._player._facing = FACING_SOUTHWEST;
@@ -4725,8 +4725,8 @@ void Scene211::step() {
}
}
- if (_ambushFl && (_scene->_activeAnimation->getCurrentFrame() > _monkeyFrame)) {
- _monkeyFrame = _scene->_activeAnimation->getCurrentFrame();
+ if (_ambushFl && (_scene->_animation[0]->getCurrentFrame() > _monkeyFrame)) {
+ _monkeyFrame = _scene->_animation[0]->getCurrentFrame();
switch (_monkeyFrame) {
case 2: {
int msgIndex = _scene->_kernelMessages.add(Common::Point(12, 4), 0xFDFC, 0, 0, 60, _game.getQuote(157));
@@ -4798,9 +4798,9 @@ void Scene211::step() {
_wakeFl = false;
}
- if (_scene->_activeAnimation->getCurrentFrame() > _monkeyFrame) {
- _monkeyFrame = _scene->_activeAnimation->getCurrentFrame();
- switch (_scene->_activeAnimation->getCurrentFrame()) {
+ if (_scene->_animation[0]->getCurrentFrame() > _monkeyFrame) {
+ _monkeyFrame = _scene->_animation[0]->getCurrentFrame();
+ switch (_scene->_animation[0]->getCurrentFrame()) {
case 177: {
int msgIndex = _scene->_kernelMessages.add(Common::Point(63, _scrollY), 0x1110, 0, 0, 180, _game.getQuote(165));
_scene->_kernelMessages.setQuoted(msgIndex, 4, true);
diff --git a/engines/mads/nebular/nebular_scenes3.cpp b/engines/mads/nebular/nebular_scenes3.cpp
index 5a6edbf995..0fb13a706c 100644
--- a/engines/mads/nebular/nebular_scenes3.cpp
+++ b/engines/mads/nebular/nebular_scenes3.cpp
@@ -293,8 +293,8 @@ void Scene302::step() {
if (_game._trigger == 71)
_scene->_nextSceneId = 303;
- if ((_scene->_activeAnimation != nullptr) && (_scene->_activeAnimation->getCurrentFrame() != _oldFrame)) {
- _oldFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_scene->_animation[0] != nullptr) && (_scene->_animation[0]->getCurrentFrame() != _oldFrame)) {
+ _oldFrame = _scene->_animation[0]->getCurrentFrame();
if (_oldFrame == 147) {
_game._objects.setRoom(OBJ_POISON_DARTS, 1);
_game._objects.setRoom(OBJ_BLOWGUN, 1);
@@ -551,7 +551,7 @@ void Scene307::handlePrisonerEncounter() {
}
}
-void Scene307::handlePrisonerSpeech(int firstQuoteId, int number, long timeout) {
+void Scene307::handlePrisonerSpeech(int firstQuoteId, int number, uint32 timeout) {
int height = number * 14;
int posY;
@@ -581,13 +581,13 @@ void Scene307::setDialogNode(int node) {
case 1:
_globals[kMetBuddyBeast] = true;
- handlePrisonerSpeech(0x10F, 2, 9999999);
+ handlePrisonerSpeech(0x10F, 2, INDEFINITE_TIMEOUT);
_dialog1.start();
break;
case 2:
_globals[kMetBuddyBeast] = true;
- handlePrisonerSpeech(0x111, 2, 9999999);
+ handlePrisonerSpeech(0x111, 2, INDEFINITE_TIMEOUT);
_dialog1.start();
break;
@@ -598,7 +598,7 @@ void Scene307::setDialogNode(int node) {
case 5:
_globals[kKnowsBuddyBeast] = true;
- handlePrisonerSpeech(0x117, 2, 9999999);
+ handlePrisonerSpeech(0x117, 2, INDEFINITE_TIMEOUT);
_dialog2.start();
break;
@@ -609,7 +609,7 @@ void Scene307::setDialogNode(int node) {
case 7:
_globals[kKnowsBuddyBeast] = true;
- handlePrisonerSpeech(0x124, 10, 9999999);
+ handlePrisonerSpeech(0x124, 10, INDEFINITE_TIMEOUT);
_dialog2.write(0x11A, false);
_dialog2.write(0x11B, true);
_dialog2.write(0x120, true);
@@ -617,7 +617,7 @@ void Scene307::setDialogNode(int node) {
break;
case 8:
- handlePrisonerSpeech(0x12E, 6, 9999999);
+ handlePrisonerSpeech(0x12E, 6, INDEFINITE_TIMEOUT);
_dialog2.write(0x11A, false);
_dialog2.write(0x11B, false);
_dialog2.write(0x11C, true);
@@ -627,38 +627,38 @@ void Scene307::setDialogNode(int node) {
break;
case 9:
- handlePrisonerSpeech(0x134, 4, 9999999);
+ handlePrisonerSpeech(0x134, 4, INDEFINITE_TIMEOUT);
_dialog2.write(0x11D, false);
_dialog2.start();
break;
case 10:
- handlePrisonerSpeech(0x138, 6, 9999999);
+ handlePrisonerSpeech(0x138, 6, INDEFINITE_TIMEOUT);
_dialog2.write(0x11E, false);
_dialog2.start();
break;
case 11:
- handlePrisonerSpeech(0x13E, 6, 9999999);
+ handlePrisonerSpeech(0x13E, 6, INDEFINITE_TIMEOUT);
_dialog2.write(0x11F, false);
_dialog2.write(0x121, true);
_dialog2.start();
break;
case 12:
- handlePrisonerSpeech(0x144, 4, 9999999);
+ handlePrisonerSpeech(0x144, 4, INDEFINITE_TIMEOUT);
_dialog2.write(0x11C, false);
_dialog2.start();
break;
case 13:
- handlePrisonerSpeech(0x148, 7, 9999999);
+ handlePrisonerSpeech(0x148, 7, INDEFINITE_TIMEOUT);
_dialog2.write(0x120, false);
_dialog2.start();
break;
case 14:
- handlePrisonerSpeech(0x14F, 3, 9999999);
+ handlePrisonerSpeech(0x14F, 3, INDEFINITE_TIMEOUT);
_dialog2.write(0x121, false);
_dialog2.start();
break;
@@ -670,7 +670,7 @@ void Scene307::setDialogNode(int node) {
case 16:
_globals[kKnowsBuddyBeast] = true;
- handlePrisonerSpeech(0x10C, 1, 9999999);
+ handlePrisonerSpeech(0x10C, 1, INDEFINITE_TIMEOUT);
_dialog2.start();
break;
@@ -828,23 +828,23 @@ void Scene307::enter() {
void Scene307::step() {
handleForceField(&_forceField, &_globals._spriteIndexes[0]);
- if ((_animationMode == 1) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() == 126) {
+ if ((_animationMode == 1) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() == 126) {
_forceField._flag = false;
_vm->_sound->command(5);
}
- if (_scene->_activeAnimation->getCurrentFrame() == 194) {
+ if (_scene->_animation[0]->getCurrentFrame() == 194) {
_forceField._flag = true;
_vm->_sound->command(24);
}
}
- if ((_animationMode == 2) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() == 54)
+ if ((_animationMode == 2) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() == 54)
_forceField._flag = false;
- if (_scene->_activeAnimation->getCurrentFrame() == 150) {
+ if (_scene->_animation[0]->getCurrentFrame() == 150) {
_game._player._visible = false;
_game._player._priorTimer = _scene->_frameStartTime - _game._player._ticksAmount;
}
@@ -869,7 +869,7 @@ void Scene307::step() {
}
_lastFrameTime = _scene->_frameStartTime;
- if ((_guardTime > 3000) && !_duringPeeingFl && (_scene->_activeAnimation == nullptr)
+ if ((_guardTime > 3000) && !_duringPeeingFl && (_scene->_animation[0] == nullptr)
&& (_game._screenObjects._inputMode != kInputConversation) && _globals[kMetBuddyBeast] && !_activePrisonerFl) {
if (!_game._objects.isInInventory(OBJ_SCALPEL) && !_grateOpenedFl) {
_game._player._stepEnabled = false;
@@ -879,7 +879,7 @@ void Scene307::step() {
_scene->loadAnimation(formAnimName('b', -1), 70);
}
_guardTime = 0;
- } else if ((_prisonerTimer > 300) && (_game._screenObjects._inputMode != kInputConversation) && (_scene->_activeAnimation == nullptr) && !_activePrisonerFl) {
+ } else if ((_prisonerTimer > 300) && (_game._screenObjects._inputMode != kInputConversation) && (_scene->_animation[0] == nullptr) && !_activePrisonerFl) {
if (!_globals[kMetBuddyBeast]) {
int idx = _scene->_kernelMessages.add(Common::Point(5, 51), 0xFDFC, 0, 81, 120, _game.getQuote(_prisonerMessageId));
_scene->_kernelMessages.setQuoted(idx, 4, true);
@@ -1380,9 +1380,9 @@ void Scene309::enter() {
_game._player._stepEnabled = false;
_scene->loadAnimation(formAnimName('a', -1), 60);
- _characterSpriteIndexes[0] = _scene->_activeAnimation->_spriteListIndexes[2];
- _characterSpriteIndexes[1] = _scene->_activeAnimation->_spriteListIndexes[2];
- _characterSpriteIndexes[2] = _scene->_activeAnimation->_spriteListIndexes[1];
+ _characterSpriteIndexes[0] = _scene->_animation[0]->_spriteListIndexes[2];
+ _characterSpriteIndexes[1] = _scene->_animation[0]->_spriteListIndexes[2];
+ _characterSpriteIndexes[2] = _scene->_animation[0]->_spriteListIndexes[1];
_messagesIndexes[0] = -1;
_messagesIndexes[1] = -1;
@@ -1404,9 +1404,9 @@ void Scene309::step() {
if (_game._trigger == 62)
_messagesIndexes[2] = -1;
- if (_scene->_activeAnimation != nullptr) {
- if (_lastFrame != _scene->_activeAnimation->getCurrentFrame()) {
- _lastFrame = _scene->_activeAnimation->getCurrentFrame();
+ if (_scene->_animation[0] != nullptr) {
+ if (_lastFrame != _scene->_animation[0]->getCurrentFrame()) {
+ _lastFrame = _scene->_animation[0]->getCurrentFrame();
if (_lastFrame == 39) {
_messagesIndexes[0] = _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 32, 61, 210, _game.getQuote(348));
_messagesIndexes[1] = _scene->_kernelMessages.add(Common::Point(0, 0), 0x1110, 32, 0, 210, _game.getQuote(349));
@@ -1419,15 +1419,15 @@ void Scene309::step() {
if (_messagesIndexes[charIdx] >= 0) {
bool match = false;
int j = -1;
- for (j = _scene->_activeAnimation->_oldFrameEntry; j < _scene->_activeAnimation->_header._frameEntriesCount; j++) {
- if (_scene->_activeAnimation->_frameEntries[j]._spriteSlot._spritesIndex == _characterSpriteIndexes[charIdx]) {
+ for (j = _scene->_animation[0]->_oldFrameEntry; j < _scene->_animation[0]->_header._frameEntriesCount; j++) {
+ if (_scene->_animation[0]->_frameEntries[j]._spriteSlot._spritesIndex == _characterSpriteIndexes[charIdx]) {
match = true;
break;
}
}
if (match) {
- SpriteSlotSubset *curSpriteSlot = &_scene->_activeAnimation->_frameEntries[j]._spriteSlot;
+ SpriteSlotSubset *curSpriteSlot = &_scene->_animation[0]->_frameEntries[j]._spriteSlot;
_scene->_kernelMessages._entries[_messagesIndexes[charIdx]]._position.x = curSpriteSlot->_position.x;
_scene->_kernelMessages._entries[_messagesIndexes[charIdx]]._position.y = curSpriteSlot->_position.y - (50 + (14 * ((charIdx == 0) ? 2 : 1)));
}
@@ -2465,59 +2465,59 @@ void Scene318::handleDialog() {
switch (_action._activeAction._verbId) {
case 0x191:
- handleInternDialog(0x19E, 2, 9999999);
+ handleInternDialog(0x19E, 2, INDEFINITE_TIMEOUT);
_dialog1.write(0x192, true);
break;
case 0x192:
- handleInternDialog(0x1A0, 5, 9999999);
+ handleInternDialog(0x1A0, 5, INDEFINITE_TIMEOUT);
_dialog1.write(0x193, true);
break;
case 0x193:
- handleInternDialog(0x1A5, 4, 9999999);
+ handleInternDialog(0x1A5, 4, INDEFINITE_TIMEOUT);
_dialog1.write(0x194, true);
break;
case 0x194:
- handleInternDialog(0x1A9, 6, 9999999);
+ handleInternDialog(0x1A9, 6, INDEFINITE_TIMEOUT);
_dialog1.write(0x195, true);
_dialog1.write(0x196, true);
_dialog1.write(0x19D, false);
break;
case 0x195:
- handleInternDialog(0x1AF, 7, 9999999);
+ handleInternDialog(0x1AF, 7, INDEFINITE_TIMEOUT);
if (!_dialog1.read(0x196))
_dialog1.write(0x197, true);
break;
case 0x196:
- handleInternDialog(0x1B6, 5, 9999999);
+ handleInternDialog(0x1B6, 5, INDEFINITE_TIMEOUT);
if (!_dialog1.read(0x195))
_dialog1.write(0x197, true);
break;
case 0x197:
- handleInternDialog(0x1BB, 5, 9999999);
+ handleInternDialog(0x1BB, 5, INDEFINITE_TIMEOUT);
break;
case 0x198:
- handleInternDialog(0x1C0, 5, 9999999);
+ handleInternDialog(0x1C0, 5, INDEFINITE_TIMEOUT);
_dialog1.write(0x19A, true);
break;
case 0x199:
- handleInternDialog(0x1C5, 3, 9999999);
+ handleInternDialog(0x1C5, 3, INDEFINITE_TIMEOUT);
break;
case 0x19A:
- handleInternDialog(0x1C8, 5, 9999999);
+ handleInternDialog(0x1C8, 5, INDEFINITE_TIMEOUT);
_dialog1.write(0x19B, true);
break;
case 0x19B:
- handleInternDialog(0x1CD, 3, 9999999);
+ handleInternDialog(0x1CD, 3, INDEFINITE_TIMEOUT);
break;
case 0x19C:
@@ -2602,7 +2602,7 @@ void Scene318::enter() {
if (_globals[kAfterHavoc]) {
_scene->loadAnimation(formAnimName('f', -1));
- _scene->_activeAnimation->_resetFlag = true;
+ _scene->_animation[0]->_resetFlag = true;
} else if (!_globals[kHasSeenProfPyro]) {
_scene->_hotspots.activate(NOUN_PROFESSORS_GURNEY, false);
_scene->_hotspots.activate(NOUN_PROFESSOR, false);
@@ -2655,7 +2655,7 @@ void Scene318::enter() {
0x1C8, 0x1C9, 0x1CA, 0x1CB, 0x1CC, 0x1CD, 0x1CE, 0x1CF, 0x1D0, 0x1D1, 0x1D2, 0x1D3,
0x190, 0x19D, 0);
- if ((_scene->_priorSceneId == RETURNING_FROM_DIALOG) || (((_scene->_priorSceneId == 318) ||
+ if ((_scene->_priorSceneId == RETURNING_FROM_DIALOG) || (((_scene->_priorSceneId == 318) ||
(_scene->_priorSceneId == RETURNING_FROM_LOADING)) && (!_globals[kAfterHavoc]))) {
if (!_globals[kAfterHavoc]) {
_game._player._visible = false;
@@ -2705,9 +2705,9 @@ void Scene318::enter() {
}
void Scene318::step() {
- if ((_scene->_activeAnimation != nullptr) && (_animMode == 2)) {
- if (_lastFrame != _scene->_activeAnimation->getCurrentFrame()) {
- _lastFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_scene->_animation[0] != nullptr) && (_animMode == 2)) {
+ if (_lastFrame != _scene->_animation[0]->getCurrentFrame()) {
+ _lastFrame = _scene->_animation[0]->getCurrentFrame();
int nextFrame = -1;
switch (_lastFrame) {
@@ -2759,8 +2759,8 @@ void Scene318::step() {
break;
}
- if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(nextFrame);
+ if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(nextFrame);
_lastFrame = nextFrame;
}
}
@@ -2865,7 +2865,7 @@ void Scene318::actions() {
case 1:
_game._player._stepEnabled = true;
- handleInternDialog(0x18F, 1, 9999999);
+ handleInternDialog(0x18F, 1, INDEFINITE_TIMEOUT);
_dialog1.start();
break;
@@ -3152,27 +3152,27 @@ void Scene319::enter() {
_slacheInitFl = true;
if (_globals[kRexHasMetSlache]) {
- handleSlacheDialogs(VERB_WALK_OUTSIDE, 2, 9999999);
+ handleSlacheDialogs(VERB_WALK_OUTSIDE, 2, INDEFINITE_TIMEOUT);
_slachePosY = 3;
} else {
- handleSlacheDialogs(0x186, 4, 9999999);
+ handleSlacheDialogs(0x186, 4, INDEFINITE_TIMEOUT);
_slachePosY = 5;
}
}
switch (_slacheTopic) {
case 1:
- handleSlacheDialogs(0x15F, 2, 9999999);
+ handleSlacheDialogs(0x15F, 2, INDEFINITE_TIMEOUT);
_dialog1.start();
break;
case 2:
- handleSlacheDialogs(0x16B, 2, 9999999);
+ handleSlacheDialogs(0x16B, 2, INDEFINITE_TIMEOUT);
_dialog2.start();
break;
case 3:
- handleSlacheDialogs(0x177, 2, 9999999);
+ handleSlacheDialogs(0x177, 2, INDEFINITE_TIMEOUT);
_dialog3.start();
break;
@@ -3185,11 +3185,11 @@ void Scene319::enter() {
}
void Scene319::step() {
- if (_scene->_activeAnimation == nullptr)
+ if (_scene->_animation[0] == nullptr)
return;
- if (_animFrame != _scene->_activeAnimation->getCurrentFrame()) {
- _animFrame = _scene->_activeAnimation->getCurrentFrame();
+ if (_animFrame != _scene->_animation[0]->getCurrentFrame()) {
+ _animFrame = _scene->_animation[0]->getCurrentFrame();
int nextFrame = -1;
if (_animMode == 1) {
switch (_animFrame) {
@@ -3305,8 +3305,8 @@ void Scene319::step() {
if ((_animMode == 4) && (_animFrame == 16))
_vm->_screen._shakeCountdown = 80;
- if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(nextFrame);
+ if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(nextFrame);
_animFrame = nextFrame;
}
}
@@ -3320,11 +3320,11 @@ void Scene319::step() {
_scene->freeAnimation();
_scene->loadAnimation(formAnimName('b', 0));
if (_nextAction1 == 3)
- _scene->_activeAnimation->setCurrentFrame(85);
+ _scene->_animation[0]->setCurrentFrame(85);
else if (_nextAction1 == 1)
- _scene->_activeAnimation->setCurrentFrame(40);
+ _scene->_animation[0]->setCurrentFrame(40);
- _animFrame = _scene->_activeAnimation->getCurrentFrame();
+ _animFrame = _scene->_animation[0]->getCurrentFrame();
_slacheTalkingFl = true;
_vm->_screen._shakeCountdown = 1;
@@ -3394,7 +3394,7 @@ void Scene319::actions() {
if (!_slacheTalkingFl) {
_scene->_sequences.addTimer(4, 2);
} else {
- handleSlacheDialogs(0x16B, 2, 9999999);
+ handleSlacheDialogs(0x16B, 2, INDEFINITE_TIMEOUT);
_dialog2.start();
_game._player._stepEnabled = true;
}
@@ -3411,7 +3411,7 @@ void Scene319::actions() {
if (!_slacheTalkingFl) {
_scene->_sequences.addTimer(4, 2);
} else {
- handleSlacheDialogs(0x177, 2, 9999999);
+ handleSlacheDialogs(0x177, 2, INDEFINITE_TIMEOUT);
_dialog3.start();
_game._player._stepEnabled = true;
}
@@ -3480,7 +3480,7 @@ void Scene319::actions() {
curDialog = &_dialog3;
}
- handleSlacheDialogs(nextDocQuote, 2, 9999999);
+ handleSlacheDialogs(nextDocQuote, 2, INDEFINITE_TIMEOUT);
if (addDialogLine) {
curDialog->write(_action._activeAction._verbId, false);
curDialog->write(addVerbId, true);
@@ -3512,7 +3512,7 @@ void Scene319::actions() {
curDialog = &_dialog3;
}
- handleSlacheDialogs(nextDocQuote, 2, 9999999);
+ handleSlacheDialogs(nextDocQuote, 2, INDEFINITE_TIMEOUT);
if (addDialogLine) {
curDialog->write(_action._activeAction._verbId, false);
curDialog->write(addVerbId, true);
@@ -3710,9 +3710,9 @@ void Scene320::enter() {
}
void Scene320::step() {
- if (_scene->_activeAnimation != nullptr) {
- if (_lastFrame != _scene->_activeAnimation->getCurrentFrame()) {
- _lastFrame = _scene->_activeAnimation->getCurrentFrame();
+ if (_scene->_animation[0] != nullptr) {
+ if (_lastFrame != _scene->_animation[0]->getCurrentFrame()) {
+ _lastFrame = _scene->_animation[0]->getCurrentFrame();
switch (_lastFrame) {
case 95:
_blinkFl = true;
@@ -3892,8 +3892,8 @@ void Scene321::enter() {
}
void Scene321::step() {
- if (_scene->_activeAnimation != nullptr) {
- if ((_scene->_activeAnimation->getCurrentFrame() >= 260) && (_globals[kSexOfRex] == REX_MALE) && (_game._storyMode >= STORYMODE_NICE))
+ if (_scene->_animation[0] != nullptr) {
+ if ((_scene->_animation[0]->getCurrentFrame() >= 260) && (_globals[kSexOfRex] == REX_MALE) && (_game._storyMode >= STORYMODE_NICE))
_scene->_nextSceneId = 316;
}
@@ -5045,7 +5045,7 @@ void Scene359::actions() {
_vm->_dialogs->show(35918);
else if (_action.isAction(VERB_TAKE, NOUN_LIMB))
_vm->_dialogs->show(35919);
- else if (_action.isAction(VERB_LOOK, NOUN_SECURITY_CARD) && (_action._mainObjectSource == 4))
+ else if (_action.isAction(VERB_LOOK, NOUN_SECURITY_CARD) && (_action._mainObjectSource == CAT_HOTSPOT))
_vm->_dialogs->show(35921);
else if (_action.isAction(VERB_LOOK, NOUN_BLOOD_STAIN)) {
if ((_game._difficulty != DIFFICULTY_HARD) && (_game._objects[OBJ_SECURITY_CARD]._roomNumber == 359))
diff --git a/engines/mads/nebular/nebular_scenes3.h b/engines/mads/nebular/nebular_scenes3.h
index cf925b3867..af75b14193 100644
--- a/engines/mads/nebular/nebular_scenes3.h
+++ b/engines/mads/nebular/nebular_scenes3.h
@@ -158,7 +158,7 @@ private:
void handlePrisonerDialog();
void handlePrisonerEncounter();
void setDialogNode(int node);
- void handlePrisonerSpeech(int firstQuoteId, int number, long timeout);
+ void handlePrisonerSpeech(int firstQuoteId, int number, uint32 timeout);
public:
Scene307(MADSEngine *vm);
diff --git a/engines/mads/nebular/nebular_scenes4.cpp b/engines/mads/nebular/nebular_scenes4.cpp
index c981f6a6e4..d71fd9f8c9 100644
--- a/engines/mads/nebular/nebular_scenes4.cpp
+++ b/engines/mads/nebular/nebular_scenes4.cpp
@@ -396,7 +396,7 @@ void Scene402::handleConversation1() {
break;
}
_scene->_kernelMessages.reset();
- _scene->_kernelMessages.add(Common::Point(quotePosX, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(quoteId));
+ _scene->_kernelMessages.add(Common::Point(quotePosX, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(quoteId));
_game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON;
_scene->_sequences.addTimer(1, 100);
_talkTimer = 120;
@@ -406,7 +406,7 @@ void Scene402::handleConversation1() {
case 0x215:
_scene->_kernelMessages.reset();
- _scene->_kernelMessages.add(Common::Point(260, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1EC));
+ _scene->_kernelMessages.add(Common::Point(260, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1EC));
_game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON;
_scene->_sequences.addTimer(1, 100);
_talkTimer = 120;
@@ -502,8 +502,8 @@ void Scene402::handleConversation2() {
_scene->_sequences.addTimer(1, 100);
_talkTimer = 180;
_scene->_kernelMessages.reset();
- _scene->_kernelMessages.add(Common::Point(198, 27), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E7));
- _scene->_kernelMessages.add(Common::Point(201, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E8));
+ _scene->_kernelMessages.add(Common::Point(198, 27), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E7));
+ _scene->_kernelMessages.add(Common::Point(201, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E8));
_bartenderCurrentQuestion = 7;
break;
@@ -512,8 +512,8 @@ void Scene402::handleConversation2() {
_scene->_sequences.addTimer(1, 100);
_talkTimer = 180;
_scene->_kernelMessages.reset();
- _scene->_kernelMessages.add(Common::Point(220, 27), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E9));
- _scene->_kernelMessages.add(Common::Point(190, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1EA));
+ _scene->_kernelMessages.add(Common::Point(220, 27), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E9));
+ _scene->_kernelMessages.add(Common::Point(190, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1EA));
_bartenderCurrentQuestion = 8;
break;
@@ -522,7 +522,7 @@ void Scene402::handleConversation2() {
_scene->_sequences.addTimer(1, 100);
_talkTimer = 150;
_scene->_kernelMessages.reset();
- _scene->_kernelMessages.add(Common::Point(196, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1EB));
+ _scene->_kernelMessages.add(Common::Point(196, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1EB));
_bartenderCurrentQuestion = 9;
break;
@@ -548,8 +548,8 @@ void Scene402::handleConversation3() {
_game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON;
_scene->_sequences.addTimer(1, 86);
_scene->_kernelMessages.reset();
- _scene->_kernelMessages.add(Common::Point(188, 27), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1ED));
- _scene->_kernelMessages.add(Common::Point(199, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1EE));
+ _scene->_kernelMessages.add(Common::Point(188, 27), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1ED));
+ _scene->_kernelMessages.add(Common::Point(199, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1EE));
setDialogNode(4);
_bartenderCurrentQuestion = 2;
break;
@@ -799,47 +799,47 @@ void Scene402::enter() {
switch (_bartenderCurrentQuestion) {
case 1:
- _scene->_kernelMessages.add(Common::Point(260, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1EC));
+ _scene->_kernelMessages.add(Common::Point(260, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1EC));
break;
case 2:
- _scene->_kernelMessages.add(Common::Point(188, 27), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1ED));
- _scene->_kernelMessages.add(Common::Point(199, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1EE));
+ _scene->_kernelMessages.add(Common::Point(188, 27), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1ED));
+ _scene->_kernelMessages.add(Common::Point(199, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1EE));
break;
case 3:
- _scene->_kernelMessages.add(Common::Point(177, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1EF));
+ _scene->_kernelMessages.add(Common::Point(177, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1EF));
break;
case 4:
- _scene->_kernelMessages.add(Common::Point(205, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E4));
+ _scene->_kernelMessages.add(Common::Point(205, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E4));
break;
case 5:
- _scene->_kernelMessages.add(Common::Point(203, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E5));
+ _scene->_kernelMessages.add(Common::Point(203, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E5));
break;
case 6:
- _scene->_kernelMessages.add(Common::Point(260, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E6));
+ _scene->_kernelMessages.add(Common::Point(260, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E6));
break;
case 7:
- _scene->_kernelMessages.add(Common::Point(198, 27), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E7));
- _scene->_kernelMessages.add(Common::Point(201, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E8));
+ _scene->_kernelMessages.add(Common::Point(198, 27), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E7));
+ _scene->_kernelMessages.add(Common::Point(201, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E8));
break;
case 8:
- _scene->_kernelMessages.add(Common::Point(220, 27), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E9));
- _scene->_kernelMessages.add(Common::Point(190, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1EA));
+ _scene->_kernelMessages.add(Common::Point(220, 27), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E9));
+ _scene->_kernelMessages.add(Common::Point(190, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1EA));
break;
case 9:
- _scene->_kernelMessages.add(Common::Point(196, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1EB));
+ _scene->_kernelMessages.add(Common::Point(196, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1EB));
break;
case 10:
- _scene->_kernelMessages.add(Common::Point(198, 27), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E2));
- _scene->_kernelMessages.add(Common::Point(199, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E3));
+ _scene->_kernelMessages.add(Common::Point(198, 27), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E2));
+ _scene->_kernelMessages.add(Common::Point(199, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E3));
break;
default:
@@ -876,7 +876,7 @@ void Scene402::enter() {
_refuseAlienLiquor = false;
_scene->loadAnimation(Resources::formatName(402, 'd', 1, EXT_AA, ""));
- _scene->_activeAnimation->_resetFlag = true;
+ _scene->_animation[0]->_resetFlag = true;
_globals._sequenceIndexes[5] = _scene->_sequences.startCycle(_globals._spriteIndexes[5], false, 1);
_scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
@@ -1536,43 +1536,43 @@ void Scene402::step() {
if (_game._trigger == 32)
_rightWomanMoving = false;
- if (_scene->_activeAnimation->getCurrentFrame() == 1) {
+ if (_scene->_animation[0]->getCurrentFrame() == 1) {
switch (_vm->getRandomNumber(1, 50)) {
case 1:
- _scene->_activeAnimation->setCurrentFrame(2);
+ _scene->_animation[0]->setCurrentFrame(2);
break;
case 2:
- _scene->_activeAnimation->setCurrentFrame(7);
+ _scene->_animation[0]->setCurrentFrame(7);
break;
case 3:
- _scene->_activeAnimation->setCurrentFrame(11);
+ _scene->_animation[0]->setCurrentFrame(11);
break;
default:
- _scene->_activeAnimation->setCurrentFrame(0);
+ _scene->_animation[0]->setCurrentFrame(0);
break;
}
}
- if ((_scene->_activeAnimation->getCurrentFrame() == 4) && (_drinkTimer < 10)) {
+ if ((_scene->_animation[0]->getCurrentFrame() == 4) && (_drinkTimer < 10)) {
++ _drinkTimer;
- _scene->_activeAnimation->setCurrentFrame(3);
+ _scene->_animation[0]->setCurrentFrame(3);
}
if (_drinkTimer == 10) {
_drinkTimer = 0;
- _scene->_activeAnimation->setCurrentFrame(4);
- _scene->_activeAnimation->_currentFrame = 5;
+ _scene->_animation[0]->setCurrentFrame(4);
+ _scene->_animation[0]->_currentFrame = 5;
}
- switch (_scene->_activeAnimation->getCurrentFrame()) {
+ switch (_scene->_animation[0]->getCurrentFrame()) {
case 6:
case 10:
case 14:
- _scene->_activeAnimation->setCurrentFrame(0);
+ _scene->_animation[0]->setCurrentFrame(0);
break;
default:
@@ -2268,8 +2268,8 @@ void Scene402::actions() {
if (_game._objects.isInRoom(OBJ_ALIEN_LIQUOR)) {
if (!_refuseAlienLiquor) {
_scene->_kernelMessages.reset();
- _scene->_kernelMessages.add(Common::Point(198, 27), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E2));
- _scene->_kernelMessages.add(Common::Point(199, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1E3));
+ _scene->_kernelMessages.add(Common::Point(198, 27), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E2));
+ _scene->_kernelMessages.add(Common::Point(199, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1E3));
_bartenderCurrentQuestion = 10;
_game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON;
_scene->_sequences.addTimer(1, 100);
@@ -2281,7 +2281,7 @@ void Scene402::actions() {
_dialog1.start();
} else {
- _scene->_kernelMessages.add(Common::Point(177, 41), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x1EF));
+ _scene->_kernelMessages.add(Common::Point(177, 41), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x1EF));
_game._triggerSetupMode = SEQUENCE_TRIGGER_DAEMON;
_scene->_sequences.addTimer(1, 100);
_talkTimer = 120;
@@ -3126,36 +3126,36 @@ void Scene410::enter() {
sceneEntrySound();
_scene->loadAnimation(Resources::formatName(410, 'r', -1, EXT_AA, ""));
- _scene->_activeAnimation->_resetFlag = true;
+ _scene->_animation[0]->_resetFlag = true;
}
void Scene410::step() {
- if (_scene->_activeAnimation->getCurrentFrame() == 1) {
+ if (_scene->_animation[0]->getCurrentFrame() == 1) {
if (_vm->getRandomNumber(1, 30) == 1)
- _scene->_activeAnimation->setCurrentFrame(2);
+ _scene->_animation[0]->setCurrentFrame(2);
else
- _scene->_activeAnimation->setCurrentFrame(0);
+ _scene->_animation[0]->setCurrentFrame(0);
}
- if (_scene->_activeAnimation->getCurrentFrame() == 9) {
+ if (_scene->_animation[0]->getCurrentFrame() == 9) {
if (_vm->getRandomNumber(1, 30) == 1)
- _scene->_activeAnimation->setCurrentFrame(10);
+ _scene->_animation[0]->setCurrentFrame(10);
else
- _scene->_activeAnimation->setCurrentFrame(8);
+ _scene->_animation[0]->setCurrentFrame(8);
}
- if (_scene->_activeAnimation->getCurrentFrame() == 5) {
+ if (_scene->_animation[0]->getCurrentFrame() == 5) {
if (_vm->getRandomNumber(1, 30) == 1)
- _scene->_activeAnimation->setCurrentFrame(6);
+ _scene->_animation[0]->setCurrentFrame(6);
else
- _scene->_activeAnimation->setCurrentFrame(4);
+ _scene->_animation[0]->setCurrentFrame(4);
}
- if (_scene->_activeAnimation->getCurrentFrame() == 3) {
+ if (_scene->_animation[0]->getCurrentFrame() == 3) {
if (_vm->getRandomNumber(1, 2) == 1)
- _scene->_activeAnimation->setCurrentFrame(4);
+ _scene->_animation[0]->setCurrentFrame(4);
else // == 2
- _scene->_activeAnimation->setCurrentFrame(8);
+ _scene->_animation[0]->setCurrentFrame(8);
}
}
@@ -3491,7 +3491,7 @@ void Scene411::handleDialog() {
_game._player._priorTimer = _scene->_frameStartTime + _game._player._ticksAmount;
_game._player._visible = false;
_game._player._stepEnabled = false;
- _scene->_activeAnimation->setCurrentFrame(_resetFrame);
+ _scene->_animation[0]->setCurrentFrame(_resetFrame);
}
_scene->_kernelMessages.reset();
_newQuantity = computeQuoteAndQuantity();
@@ -3661,16 +3661,16 @@ void Scene411::enter() {
}
_scene->loadAnimation(formAnimName('a', -1));
- _scene->_activeAnimation->setCurrentFrame(128);
+ _scene->_animation[0]->setCurrentFrame(128);
_makeMushroomCloud = false;
_killRox = false;
}
void Scene411::step() {
- if (_scene->_activeAnimation != nullptr) {
- if (_curAnimationFrame != _scene->_activeAnimation->getCurrentFrame()) {
- _curAnimationFrame = _scene->_activeAnimation->getCurrentFrame();
+ if (_scene->_animation[0] != nullptr) {
+ if (_curAnimationFrame != _scene->_animation[0]->getCurrentFrame()) {
+ _curAnimationFrame = _scene->_animation[0]->getCurrentFrame();
_resetFrame = -1;
switch (_curAnimationFrame) {
@@ -3738,14 +3738,14 @@ void Scene411::step() {
break;
}
- if ((_resetFrame >= 0) && (_resetFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(_resetFrame);
+ if ((_resetFrame >= 0) && (_resetFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(_resetFrame);
_curAnimationFrame = _resetFrame;
}
}
}
- if (_scene->_activeAnimation->getCurrentFrame() == 86)
+ if (_scene->_animation[0]->getCurrentFrame() == 86)
_vm->_sound->command(59);
}
@@ -4113,10 +4113,10 @@ void Scene413::enter() {
}
void Scene413::step() {
- if (_scene->_activeAnimation && _scene->_activeAnimation->getCurrentFrame() == 38)
- _scene->_activeAnimation->setCurrentFrame(37);
+ if (_scene->_animation[0] && _scene->_animation[0]->getCurrentFrame() == 38)
+ _scene->_animation[0]->setCurrentFrame(37);
- if (_scene->_activeAnimation && _scene->_activeAnimation->getCurrentFrame() == 21 && _canMove) {
+ if (_scene->_animation[0] && _scene->_animation[0]->getCurrentFrame() == 21 && _canMove) {
_vm->_sound->command(27);
_canMove = false;
}
diff --git a/engines/mads/nebular/nebular_scenes5.cpp b/engines/mads/nebular/nebular_scenes5.cpp
index 95eb429193..3778a59eb3 100644
--- a/engines/mads/nebular/nebular_scenes5.cpp
+++ b/engines/mads/nebular/nebular_scenes5.cpp
@@ -722,9 +722,9 @@ void Scene504::enter() {
}
void Scene504::step() {
- if ((_carAnimationMode == 1) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) {
- _carFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_carAnimationMode == 1) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _carFrame) {
+ _carFrame = _scene->_animation[0]->getCurrentFrame();
int nextFrame;
if (_carFrame == 1)
@@ -732,8 +732,8 @@ void Scene504::step() {
else
nextFrame = -1;
- if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(nextFrame);
+ if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(nextFrame);
_carFrame = nextFrame;
}
}
@@ -943,15 +943,15 @@ void Scene505::enter() {
_game._player._stepEnabled = false;
_frame = -1;
_scene->loadAnimation(formAnimName('a', -1));
- _scene->_activeAnimation->setCurrentFrame(86);
+ _scene->_animation[0]->setCurrentFrame(86);
sceneEntrySound();
_vm->_sound->command(16);
}
void Scene505::step() {
- if (_frame != _scene->_activeAnimation->getCurrentFrame()) {
- _frame = _scene->_activeAnimation->getCurrentFrame();
+ if (_frame != _scene->_animation[0]->getCurrentFrame()) {
+ _frame = _scene->_animation[0]->getCurrentFrame();
int resetFrame = -1;
switch (_frame) {
@@ -1088,8 +1088,8 @@ void Scene505::step() {
break;
}
- if ((resetFrame >= 0) && (resetFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(resetFrame);
+ if ((resetFrame >= 0) && (resetFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(resetFrame);
_frame = resetFrame;
}
}
@@ -1254,7 +1254,7 @@ void Scene506::step() {
switch (_game._trigger) {
case 70:
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
_scene->_sequences.addTimer(6, 71);
break;
@@ -1943,9 +1943,9 @@ void Scene511::enter() {
}
void Scene511::step() {
- if ((_lineAnimationMode == 1) && _scene->_activeAnimation) {
- if (_lineFrame != _scene->_activeAnimation->getCurrentFrame()) {
- _lineFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_lineAnimationMode == 1) && _scene->_animation[0]) {
+ if (_lineFrame != _scene->_animation[0]->getCurrentFrame()) {
+ _lineFrame = _scene->_animation[0]->getCurrentFrame();
int resetFrame = -1;
if ((_lineAnimationPosition == 2) && (_lineFrame == 14))
@@ -1961,8 +1961,8 @@ void Scene511::step() {
resetFrame = 2;
}
- if ((resetFrame >= 0) && (resetFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(resetFrame);
+ if ((resetFrame >= 0) && (resetFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(resetFrame);
_lineFrame = resetFrame;
}
}
@@ -1971,7 +1971,7 @@ void Scene511::step() {
switch (_game._trigger) {
case 70:
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
_scene->_sequences.addTimer(6, 71);
break;
@@ -2009,7 +2009,7 @@ void Scene511::preActions() {
_scene->loadAnimation(formAnimName('R',2), 1);
} else if (_game._trigger == 1) {
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
_game._objects.setRoom(OBJ_FISHING_LINE, 1);
_handingLine = false;
_game._player._stepEnabled = true;
@@ -2089,7 +2089,7 @@ void Scene511::actions() {
} else {
_vm->_dialogs->show(51130);
}
- } else if (_action.isAction(VERB_TIE, NOUN_FISHING_LINE, NOUN_BOAT) ||
+ } else if (_action.isAction(VERB_TIE, NOUN_FISHING_LINE, NOUN_BOAT) ||
_action.isAction(VERB_ATTACH, NOUN_FISHING_LINE, NOUN_BOAT)) {
if (_globals[kBoatRaised])
_vm->_dialogs->show(51131);
@@ -2118,8 +2118,8 @@ void Scene511::actions() {
_globals[kLineStatus] = 3;
_game._player._stepEnabled = true;
- if (_scene->_activeAnimation)
- _scene->_activeAnimation->eraseSprites();
+ if (_scene->_animation[0])
+ _scene->_animation[0]->eraseSprites();
_game._player.update();
}
}
@@ -2159,9 +2159,9 @@ void Scene511::actions() {
_vm->_dialogs->show(51128);
} else if (_action.isAction(VERB_LOOK, NOUN_PORTHOLE))
_vm->_dialogs->show(51122);
- else if (_action.isAction(VERB_LOOK, NOUN_FISHING_LINE) && (_action._mainObjectSource == 4) && (_globals[kLineStatus] == 2))
+ else if (_action.isAction(VERB_LOOK, NOUN_FISHING_LINE) && (_action._mainObjectSource == CAT_HOTSPOT) && (_globals[kLineStatus] == 2))
_vm->_dialogs->show(51126);
- else if (_action.isAction(VERB_LOOK, NOUN_FISHING_LINE) && (_action._mainObjectSource == 4) && (_globals[kLineStatus] == 3))
+ else if (_action.isAction(VERB_LOOK, NOUN_FISHING_LINE) && (_action._mainObjectSource == CAT_HOTSPOT) && (_globals[kLineStatus] == 3))
_vm->_dialogs->show(51133);
else if (_action.isAction(VERB_LOOK, NOUN_STATUE))
_vm->_dialogs->show(51127);
@@ -2434,8 +2434,8 @@ void Scene512::actions() {
_vm->_dialogs->show(51225);
else if (_action.isAction(VERB_LOOK, NOUN_PADLOCK_KEY) && _game._objects.isInRoom(OBJ_PADLOCK_KEY))
_vm->_dialogs->show(51215);
- else if (_action.isAction(VERB_LOOK, NOUN_FISHING_ROD) && (!_scene->_activeAnimation ||
- _scene->_activeAnimation->getCurrentFrame() == 4))
+ else if (_action.isAction(VERB_LOOK, NOUN_FISHING_ROD) && (!_scene->_animation[0] ||
+ _scene->_animation[0]->getCurrentFrame() == 4))
_vm->_dialogs->show(51216);
else if (_action.isAction(VERB_LOOK, NOUN_SHIPS_WHEEL))
_vm->_dialogs->show(51218);
@@ -2570,7 +2570,7 @@ void Scene513::step() {
switch (_game._trigger) {
case 70:
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
_scene->_sequences.addTimer(6, 71);
break;
diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp
index d97e37ea0b..e6e286392c 100644
--- a/engines/mads/nebular/nebular_scenes6.cpp
+++ b/engines/mads/nebular/nebular_scenes6.cpp
@@ -124,7 +124,7 @@ void Scene601::step() {
switch (_game._trigger) {
case 70:
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
_scene->_sequences.addTimer(30, 71);
break;
@@ -431,7 +431,7 @@ void Scene602::actions() {
case 1: {
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
_lastSpriteIdx = _globals._spriteIndexes[3];
_lastSequenceIdx = _scene->_sequences.startCycle(_lastSpriteIdx, false, -1);
_scene->_sequences.setDepth(_lastSequenceIdx, 14);
@@ -684,7 +684,7 @@ void Scene603::actions() {
_vm->_dialogs->show(60327);
else
_vm->_dialogs->show(60328);
- } else if (_action.isAction(VERB_LOOK, NOUN_COMPACT_CASE) && (_action._mainObjectSource == 4))
+ } else if (_action.isAction(VERB_LOOK, NOUN_COMPACT_CASE) && (_action._mainObjectSource == CAT_HOTSPOT))
_vm->_dialogs->show(60329);
// For the next two checks, the second part of the check wasn't surrounded par parenthesis, which was obviously wrong
else if (_action.isAction(VERB_LOOK) && (_action.isObject(NOUN_BRA) || _action.isObject(NOUN_BOA) || _action.isObject(NOUN_SLIP)))
@@ -775,7 +775,7 @@ void Scene604::step() {
switch (_game._trigger) {
case 70:
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
_scene->_sequences.addTimer(30, 71);
break;
@@ -797,9 +797,9 @@ void Scene604::step() {
break;
}
- if (_monsterActive && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _monsterFrame) {
- _monsterFrame = _scene->_activeAnimation->getCurrentFrame();
+ if (_monsterActive && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _monsterFrame) {
+ _monsterFrame = _scene->_animation[0]->getCurrentFrame();
int nextMonsterFrame = -1;
switch (_monsterFrame) {
@@ -837,7 +837,7 @@ void Scene604::step() {
}
if ((nextMonsterFrame >= 0) && (nextMonsterFrame != _monsterFrame)) {
- _scene->_activeAnimation->setCurrentFrame(nextMonsterFrame);
+ _scene->_animation[0]->setCurrentFrame(nextMonsterFrame);
_monsterFrame = nextMonsterFrame;
}
}
@@ -1297,7 +1297,7 @@ void Scene607::step() {
switch (_game._trigger) {
case 80:
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
_scene->_sequences.addTimer(6, 81);
break;
@@ -1331,7 +1331,7 @@ void Scene607::handleThrowingBone() {
case 1:
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
if (_animationMode != 1)
_scene->_hotspots.activate(NOUN_OBNOXIOUS_DOG, false);
@@ -1605,7 +1605,7 @@ void Scene608::restoreAnimations() {
_scene->_sequences.remove(_globals._sequenceIndexes[6]);
_scene->_sequences.remove(_globals._sequenceIndexes[7]);
_scene->loadAnimation(formAnimName('A', -1));
- _scene->_activeAnimation->setCurrentFrame(6);
+ _scene->_animation[0]->setCurrentFrame(6);
}
}
@@ -1757,7 +1757,7 @@ void Scene608::enter() {
int idx = _scene->_dynamicHotspots.add(NOUN_CAR, VERB_WALKTO, -1, Common::Rect(100, 100, 100 + 82, 100 + 25));
_carHotspotId = _scene->_dynamicHotspots.setPosition(idx, Common::Point(96, 132), FACING_NORTHEAST);
_scene->loadAnimation(formAnimName('A', -1));
- _scene->_activeAnimation->setCurrentFrame(6);
+ _scene->_animation[0]->setCurrentFrame(6);
} else if (_globals[kCarStatus] == CAR_SQUASHES_DOG) {
_carMode = 2;
_dogDeathMode = 0;
@@ -1927,13 +1927,13 @@ void Scene608::step() {
_animationMode = 0;
}
- if ((_carMode == 4) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) {
- _carFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_carMode == 4) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _carFrame) {
+ _carFrame = _scene->_animation[0]->getCurrentFrame();
if (_carFrame == 10) {
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
} else if (_carFrame == 56) {
resetDogVariables();
_animationMode = 0;
@@ -1942,12 +1942,12 @@ void Scene608::step() {
}
}
- if ((_carMode == 5) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) {
- _carFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_carMode == 5) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _carFrame) {
+ _carFrame = _scene->_animation[0]->getCurrentFrame();
if (_carFrame == 10) {
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
} else if (_carFrame == 52) {
resetDogVariables();
_animationMode = 0;
@@ -1956,13 +1956,13 @@ void Scene608::step() {
}
}
- if ((_carMode == 6) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) {
- _carFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_carMode == 6) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _carFrame) {
+ _carFrame = _scene->_animation[0]->getCurrentFrame();
if (_carFrame == 11) {
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
} else if (_carFrame == 41) {
_globals._sequenceIndexes[10] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[10], false, 9, 0, 0, 0);
_scene->_sequences.setAnimRange(_globals._sequenceIndexes[10], 10, 11);
@@ -2000,9 +2000,9 @@ void Scene608::step() {
if (_game._trigger == 112)
_dogYelping = false;
- if ((_carMode == 0) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) {
- _carFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_carMode == 0) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _carFrame) {
+ _carFrame = _scene->_animation[0]->getCurrentFrame();
int nextFrame = -1;
if ((_globals[kCarStatus] == CAR_UP) || (_globals[kCarStatus] == CAR_DOWN)) {
@@ -2015,7 +2015,7 @@ void Scene608::step() {
break;
case 1:
- if (_scene->_activeAnimation->getCurrentFrame() >= 12) {
+ if (_scene->_animation[0]->getCurrentFrame() >= 12) {
nextFrame = 0;
_carMoveMode = 0;
_globals[kCarStatus] = CAR_UP;
@@ -2023,7 +2023,7 @@ void Scene608::step() {
break;
case 2:
- if (_scene->_activeAnimation->getCurrentFrame() >= 6) {
+ if (_scene->_animation[0]->getCurrentFrame() >= 6) {
nextFrame = 6;
_carMoveMode = 0;
_globals[kCarStatus] = CAR_DOWN;
@@ -2035,35 +2035,35 @@ void Scene608::step() {
}
}
- if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(nextFrame);
+ if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(nextFrame);
_carFrame = nextFrame;
}
}
}
- if ((_carMode == 2) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) {
- _carFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_carMode == 2) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _carFrame) {
+ _carFrame = _scene->_animation[0]->getCurrentFrame();
int nextFrame = -1;
if (_carMoveMode == 0)
nextFrame = 28;
- else if (_scene->_activeAnimation->getCurrentFrame() >= 28) {
+ else if (_scene->_animation[0]->getCurrentFrame() >= 28) {
nextFrame = 28;
_carMoveMode = 0;
}
- if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(nextFrame);
+ if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(nextFrame);
_carFrame = nextFrame;
}
}
}
- if ((_carMode == 3) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) {
- _carFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_carMode == 3) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _carFrame) {
+ _carFrame = _scene->_animation[0]->getCurrentFrame();
int nextFrame = -1;
if (_resetPositionsFl) {
@@ -2071,22 +2071,22 @@ void Scene608::step() {
_carMoveMode = 0;
} else if (_carMoveMode == 0)
nextFrame = 6;
- else if (_scene->_activeAnimation->getCurrentFrame() >= 6) {
+ else if (_scene->_animation[0]->getCurrentFrame() >= 6) {
nextFrame = 6;
_carMoveMode = 0;
}
- if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(nextFrame);
+ if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(nextFrame);
_carFrame = nextFrame;
}
}
}
- if ((_carMode == 1) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _carFrame) {
- _carFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_carMode == 1) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _carFrame) {
+ _carFrame = _scene->_animation[0]->getCurrentFrame();
int nextFrame = -1;
if (_resetPositionsFl) {
@@ -2094,13 +2094,13 @@ void Scene608::step() {
_carMoveMode = 0;
} else if (_carMoveMode == 0)
nextFrame = 6;
- else if (_scene->_activeAnimation->getCurrentFrame() >= 6) {
+ else if (_scene->_animation[0]->getCurrentFrame() >= 6) {
nextFrame = 6;
_carMoveMode = 0;
}
- if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(nextFrame);
+ if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(nextFrame);
_carFrame = nextFrame;
}
}
@@ -2476,7 +2476,7 @@ void Scene608::actions() {
_vm->_dialogs->show(60824);
} else if (_action.isAction(VERB_OPEN, NOUN_STORAGE_BOX))
_vm->_dialogs->show(60826);
- else if (_action.isAction(VERB_LOOK, NOUN_REARVIEW_MIRROR) && (_action._mainObjectSource == 4))
+ else if (_action.isAction(VERB_LOOK, NOUN_REARVIEW_MIRROR) && (_action._mainObjectSource == CAT_HOTSPOT))
_vm->_dialogs->show(60828);
else if (_action.isAction(VERB_LOOK, NOUN_TOOL_BOX)) {
if (_game._objects[OBJ_POLYCEMENT]._roomNumber == _scene->_currentSceneId)
@@ -2605,7 +2605,7 @@ void Scene609::step() {
switch (_game._trigger) {
case 70:
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
_scene->_sequences.addTimer(6, 71);
break;
@@ -3014,7 +3014,7 @@ void Scene610::actions() {
_vm->_dialogs->show(61024);
else if (_action.isAction(VERB_LOOK, NOUN_SPOTLIGHT))
_vm->_dialogs->show(61025);
- else if (_action.isAction(VERB_LOOK, NOUN_PHONE_HANDSET) && (_action._mainObjectSource == 4))
+ else if (_action.isAction(VERB_LOOK, NOUN_PHONE_HANDSET) && (_action._mainObjectSource == CAT_HOTSPOT))
_vm->_dialogs->show(61026);
else if (_action.isAction(VERB_LOOK, NOUN_PHONE_CRADLE))
_vm->_dialogs->show(61027);
@@ -3466,12 +3466,12 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x281);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x282);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 14), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 14), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3479,12 +3479,12 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x283);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x284);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 14), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 14), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3492,7 +3492,7 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x285);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 14), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 14), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3500,7 +3500,7 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x286);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 14), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 14), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3508,17 +3508,17 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x297);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y - 14), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y - 14), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x298);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x299);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 14), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 14), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3526,12 +3526,12 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x29A);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x29B);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 14), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 14), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3539,12 +3539,12 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2A0);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2A1);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3552,17 +3552,17 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2A2);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2A3);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2A4);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3570,12 +3570,12 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2A5);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2A6);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3583,17 +3583,17 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2A8);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2A9);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2AA);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3601,22 +3601,22 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2AB);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2AC);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2AD);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2AE);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3624,22 +3624,22 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2AF);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2B0);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2B1);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2B2);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3647,26 +3647,26 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2B3);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 3), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 3), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2B4);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2B5);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2B6);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
- _scene->_kernelMessages.add(Common::Point(11, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x2B7));
- _scene->_kernelMessages.add(Common::Point(11, _defaultDialogPos.y + 73), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x2B8));
- _scene->_kernelMessages.add(Common::Point(11, _defaultDialogPos.y + 87), 0xFDFC, 0, 0, 9999999, _game.getQuote(0x2B9));
+ _scene->_kernelMessages.add(Common::Point(11, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x2B7));
+ _scene->_kernelMessages.add(Common::Point(11, _defaultDialogPos.y + 73), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x2B8));
+ _scene->_kernelMessages.add(Common::Point(11, _defaultDialogPos.y + 87), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, _game.getQuote(0x2B9));
}
break;
@@ -3674,22 +3674,22 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2BA);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2BB);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2BC);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2BD);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3697,22 +3697,22 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2BE);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2BF);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2C0);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2C1);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3720,27 +3720,27 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2C2);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 3), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 3), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2C3);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2C4);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2C5);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2C6);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3748,22 +3748,22 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2C7);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2C8);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2C0);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2CA);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3771,17 +3771,17 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2CB);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2CC);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2CD);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3789,17 +3789,17 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2CE);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2CF);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2D0);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3807,27 +3807,27 @@ void Scene611::displayHermitQuestions(int question) {
Common::String curQuote = _game.getQuote(0x2E1);
int width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
int quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 3), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 3), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2E2);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 17), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2E3);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 31), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2E4);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 45), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
curQuote = _game.getQuote(0x2E5);
width = _vm->_font->getWidth(curQuote, _scene->_textSpacing);
quotePosX = _defaultDialogPos.x - (width / 2);
- _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, 9999999, curQuote);
+ _scene->_kernelMessages.add(Common::Point(quotePosX, _defaultDialogPos.y + 59), 0xFDFC, 0, 0, INDEFINITE_TIMEOUT, curQuote);
}
break;
@@ -3930,7 +3930,7 @@ void Scene611::enter() {
0x2D9, 0x2DA, 0x2DB, 0x2DC, 0x2DD, 0x2DE, 0x2DF, 0x2E0, 0x2E1, 0x2E2, 0x2E3, 0x2E4, 0x2E5, 0x2E6,
0x323, 0x324, 0);
- _dialog1.setup(kConvHermit1, 0x287, 0x288, 0x289, 0x28A, 0x28B, 0x28C, 0x28D, 0x28E, 0x28F, 0x290,
+ _dialog1.setup(kConvHermit1, 0x287, 0x288, 0x289, 0x28A, 0x28B, 0x28C, 0x28D, 0x28E, 0x28F, 0x290,
0x291, 0x292, 0x293, 0x294, 0x295, 0x296, 0);
_dialog2.setup(kConvHermit2, 0x29C, 0x29D, 0x29E, 0x29F, 0);
@@ -4145,13 +4145,13 @@ void Scene611::step() {
_hermitMovingFl = true;
}
- if (_stickFingerFl && (_scene->_activeAnimation->getCurrentFrame() == 47)) {
+ if (_stickFingerFl && (_scene->_animation[0]->getCurrentFrame() == 47)) {
_stickFingerFl = false;
_hermitMovingFl = true;
_hermitMode = 1;
}
- if (_scene->_activeAnimation != nullptr && (_scene->_activeAnimation->getCurrentFrame() == 240) && _check1Fl) {
+ if (_scene->_animation[0] != nullptr && (_scene->_animation[0]->getCurrentFrame() == 240) && _check1Fl) {
_check1Fl = false;
_scene->_kernelMessages.add(Common::Point(33, 88), 0xFDFC, 0, 0, 90, _game.getQuote(0x27E));
_scene->_sequences.addTimer(120, 120);
@@ -4240,7 +4240,7 @@ void Scene611::step() {
}
}
- if (_scene->_activeAnimation != nullptr && _scene->_activeAnimation->getCurrentFrame() == 254)
+ if (_scene->_animation[0] != nullptr && _scene->_animation[0]->getCurrentFrame() == 254)
_game._player._stepEnabled = true;
if (_game._trigger == 110) {
@@ -4266,7 +4266,7 @@ void Scene611::step() {
}
if (_hermitMode == 6) {
- if ((_scene->_activeAnimation->getCurrentFrame() == 9) && _check1Fl) {
+ if ((_scene->_animation[0]->getCurrentFrame() == 9) && _check1Fl) {
_scene->_sequences.remove(_globals._sequenceIndexes[3]);
_globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 7, 1, 0, 0);
_scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 2);
@@ -4275,7 +4275,7 @@ void Scene611::step() {
_check1Fl = false;
}
- if ((_scene->_activeAnimation->getCurrentFrame() == 17) && !_check1Fl) {
+ if ((_scene->_animation[0]->getCurrentFrame() == 17) && !_check1Fl) {
_nextFrame = 26;
_hermitMode = 4;
_check1Fl = true;
@@ -4283,13 +4283,13 @@ void Scene611::step() {
}
if (_hermitMode == 4) {
- if ((_scene->_activeAnimation->getCurrentFrame() == 33) && _check1Fl) {
+ if ((_scene->_animation[0]->getCurrentFrame() == 33) && _check1Fl) {
displayHermitQuestions(_hermitDisplayedQuestion);
_nextFrame = 1;
_check1Fl = false;
}
- if ((_scene->_activeAnimation->getCurrentFrame() == 9) && !_check1Fl) {
+ if ((_scene->_animation[0]->getCurrentFrame() == 9) && !_check1Fl) {
_nextFrame = 8;
_scene->_sequences.addTimer(1, 113);
_check1Fl = true;
@@ -4315,8 +4315,8 @@ void Scene611::step() {
_scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 115);
}
- if ((_nextFrame >= 0) && (_nextFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(_nextFrame);
+ if ((_nextFrame >= 0) && (_nextFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(_nextFrame);
_nextFrame = -1;
}
@@ -4588,7 +4588,7 @@ void Scene612::step() {
switch (_game._trigger) {
case 70:
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
_scene->_sequences.addTimer(6, 71);
break;
diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp
index c2a249e5f8..6caebb7f79 100644
--- a/engines/mads/nebular/nebular_scenes7.cpp
+++ b/engines/mads/nebular/nebular_scenes7.cpp
@@ -361,7 +361,7 @@ void Scene701::actions() {
case 1: {
_game._player._visible = true;
- _game._player._priorTimer = _scene->_activeAnimation->getNextFrameTimer() - _game._player._ticksAmount;
+ _game._player._priorTimer = _scene->_animation[0]->getNextFrameTimer() - _game._player._ticksAmount;
_globals._sequenceIndexes[2] = _scene->_sequences.startCycle(_globals._spriteIndexes[2], false, -1);
_scene->_sequences.setDepth (_globals._sequenceIndexes[2], 9);
int idx = _scene->_dynamicHotspots.add(NOUN_BOAT, VERB_CLIMB_INTO, _globals._sequenceIndexes[2], Common::Rect(0, 0, 0, 0));
@@ -498,7 +498,7 @@ void Scene702::actions() {
_game._player._stepEnabled = false;
_game._player._visible = false;
_scene->_nextSceneId = 711;
- } else if (_action.isAction(VERB_TAKE, NOUN_BONES) && (_action._mainObjectSource == 4) && (!_game._objects.isInInventory(OBJ_BONES) || _game._trigger)) {
+ } else if (_action.isAction(VERB_TAKE, NOUN_BONES) && (_action._mainObjectSource == CAT_HOTSPOT) && (!_game._objects.isInInventory(OBJ_BONES) || _game._trigger)) {
switch (_game._trigger) {
case 0:
_game._player._stepEnabled = false;
@@ -537,9 +537,9 @@ void Scene702::actions() {
_vm->_dialogs->show(70215);
else if (_action.isAction(VERB_LOOK, NOUN_TELEPORTER))
_vm->_dialogs->show(70216);
- else if (_action.isAction(VERB_LOOK, NOUN_BONES) && (_action._mainObjectSource == 4))
+ else if (_action.isAction(VERB_LOOK, NOUN_BONES) && (_action._mainObjectSource == CAT_HOTSPOT))
_vm->_dialogs->show(70217);
- else if (_action.isAction(VERB_TAKE, NOUN_BONES) && (_action._mainObjectSource == 4)) {
+ else if (_action.isAction(VERB_TAKE, NOUN_BONES) && (_action._mainObjectSource == CAT_HOTSPOT)) {
if (_game._objects.isInInventory(OBJ_BONES))
_vm->_dialogs->show(70219);
} else if (_action.isAction(VERB_LOOK, NOUN_SUBMERGED_CITY))
@@ -694,7 +694,7 @@ void Scene703::enter() {
_boatDir = 2;
_monsterMode = 0;
_scene->loadAnimation(formAnimName('A', -1));
- _scene->_activeAnimation->setCurrentFrame(34);
+ _scene->_animation[0]->setCurrentFrame(34);
} else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) {
_game._player._stepEnabled = false;
_boatDir = 1;
@@ -712,17 +712,17 @@ void Scene703::enter() {
_boatDir = 1;
_monsterMode = 1;
_scene->loadAnimation(formAnimName('B', -1));
- _scene->_activeAnimation->setCurrentFrame(39);
+ _scene->_animation[0]->setCurrentFrame(39);
} else if (_boatDir == 1) {
_curSequence = 0;
_monsterMode = 0;
_scene->loadAnimation(formAnimName('A', -1));
- _scene->_activeAnimation->setCurrentFrame(9);
+ _scene->_animation[0]->setCurrentFrame(9);
} else if (_boatDir == 2) {
_curSequence = 0;
_monsterMode = 0;
_scene->loadAnimation(formAnimName('A', -1));
- _scene->_activeAnimation->setCurrentFrame(56);
+ _scene->_animation[0]->setCurrentFrame(56);
}
if (_scene->_roomChanged) {
@@ -764,9 +764,9 @@ void Scene703::step() {
if (_game._trigger == 70)
_scene->_reloadSceneFlag = true;
- if ((_monsterMode == 3) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _boatFrame) {
- _boatFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_monsterMode == 3) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _boatFrame) {
+ _boatFrame = _scene->_animation[0]->getCurrentFrame();
int nextBoatFrame = -1;
if (_boatFrame == 62) {
@@ -777,8 +777,8 @@ void Scene703::step() {
}
}
- if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(nextBoatFrame);
+ if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(nextBoatFrame);
_boatFrame = nextBoatFrame;
}
}
@@ -787,9 +787,9 @@ void Scene703::step() {
if (_game._trigger == 70)
_scene->_reloadSceneFlag = true;
- if ((_monsterMode == 0) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _boatFrame) {
- _boatFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_monsterMode == 0) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _boatFrame) {
+ _boatFrame = _scene->_animation[0]->getCurrentFrame();
int nextBoatFrame = -1;
switch (_boatFrame) {
@@ -860,8 +860,8 @@ void Scene703::step() {
break;
}
- if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(nextBoatFrame);
+ if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(nextBoatFrame);
_boatFrame = nextBoatFrame;
}
}
@@ -895,9 +895,9 @@ void Scene703::step() {
}
- if ((_monsterMode == 1) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _boatFrame) {
- _boatFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_monsterMode == 1) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _boatFrame) {
+ _boatFrame = _scene->_animation[0]->getCurrentFrame();
int nextBoatFrame = -1;
switch (_boatFrame) {
@@ -934,16 +934,16 @@ void Scene703::step() {
break;
}
- if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(nextBoatFrame);
+ if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(nextBoatFrame);
_boatFrame = nextBoatFrame;
}
}
}
- if ((_monsterMode == 2) && (_scene->_activeAnimation != nullptr)) {
- if (_scene->_activeAnimation->getCurrentFrame() != _boatFrame) {
- _boatFrame = _scene->_activeAnimation->getCurrentFrame();
+ if ((_monsterMode == 2) && (_scene->_animation[0] != nullptr)) {
+ if (_scene->_animation[0]->getCurrentFrame() != _boatFrame) {
+ _boatFrame = _scene->_animation[0]->getCurrentFrame();
int nextBoatFrame = -1;
switch (_boatFrame) {
@@ -983,7 +983,7 @@ void Scene703::step() {
_scene->freeAnimation();
_monsterMode = 1;
_scene->loadAnimation(formAnimName('B', -1));
- _scene->_activeAnimation->setCurrentFrame(39);
+ _scene->_animation[0]->setCurrentFrame(39);
_game._player._stepEnabled = true;
break;
@@ -992,7 +992,7 @@ void Scene703::step() {
_scene->freeAnimation();
_monsterMode = 1;
_scene->loadAnimation(formAnimName('B', -1));
- _scene->_activeAnimation->setCurrentFrame(39);
+ _scene->_animation[0]->setCurrentFrame(39);
_game._player._stepEnabled = true;
} else
_game._objects.setRoom(OBJ_CHICKEN_BOMB, 1);
@@ -1005,7 +1005,7 @@ void Scene703::step() {
_scene->freeAnimation();
_monsterMode = 0;
_scene->loadAnimation(formAnimName('A', -1));
- _scene->_activeAnimation->setCurrentFrame(9);
+ _scene->_animation[0]->setCurrentFrame(9);
_game._player._stepEnabled = true;
if (_game._storyMode == STORYMODE_NAUGHTY)
_vm->_dialogs->show(70321);
@@ -1018,8 +1018,8 @@ void Scene703::step() {
break;
}
- if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(nextBoatFrame);
+ if ((nextBoatFrame >= 0) && (nextBoatFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(nextBoatFrame);
_boatFrame = nextBoatFrame;
}
}
@@ -1055,7 +1055,7 @@ void Scene703::actions() {
_scene->freeAnimation();
_monsterMode = 2;
_scene->loadAnimation(formAnimName('C', -1));
- _scene->_activeAnimation->setCurrentFrame(19);
+ _scene->_animation[0]->setCurrentFrame(19);
} else if (_action.isAction(VERB_THROW, NOUN_CHICKEN, NOUN_SEA_MONSTER)) {
_game._player._stepEnabled = false;
_scene->freeAnimation();
@@ -1066,13 +1066,13 @@ void Scene703::actions() {
_scene->freeAnimation();
_monsterMode = 2;
_scene->loadAnimation(formAnimName('C', -1));
- _scene->_activeAnimation->setCurrentFrame(39);
+ _scene->_animation[0]->setCurrentFrame(39);
} else if (_action.isAction(VERB_THROW, NOUN_BOMB, NOUN_SEA_MONSTER)) {
_game._player._stepEnabled = false;
_scene->freeAnimation();
_monsterMode = 2;
_scene->loadAnimation(formAnimName('C', -1));
- _scene->_activeAnimation->setCurrentFrame(59);
+ _scene->_animation[0]->setCurrentFrame(59);
} else if (_action.isAction(VERB_THROW, NOUN_CHICKEN_BOMB, NOUN_SEA_MONSTER)) {
_useBomb = true;
_game._player._stepEnabled = false;
@@ -1241,21 +1241,21 @@ void Scene704::enter() {
_animationMode = 2;
_boatDirection = 2;
_scene->loadAnimation(formAnimName('A', -1));
- _scene->_activeAnimation->setCurrentFrame(36);
+ _scene->_animation[0]->setCurrentFrame(36);
} else if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) {
_game._player._stepEnabled = false;
_boatDirection = 1;
_scene->loadAnimation(formAnimName('A', -1));
} else if (_boatDirection == 1) {
_scene->loadAnimation(formAnimName('A', -1));
- _scene->_activeAnimation->setCurrentFrame(8);
+ _scene->_animation[0]->setCurrentFrame(8);
} else if (_boatDirection == 2) {
if (_game._objects[OBJ_BOTTLE]._roomNumber == _scene->_currentSceneId) {
_scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(123, 125));
_scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
}
_scene->loadAnimation(formAnimName('A', -1));
- _scene->_activeAnimation->setCurrentFrame(57);
+ _scene->_animation[0]->setCurrentFrame(57);
}
if (_scene->_roomChanged)
@@ -1269,9 +1269,9 @@ void Scene704::enter() {
}
void Scene704::step() {
- if (_scene->_activeAnimation != nullptr) {
- if (_scene->_activeAnimation->getCurrentFrame() != _boatCurrentFrame) {
- _boatCurrentFrame = _scene->_activeAnimation->getCurrentFrame();
+ if (_scene->_animation[0] != nullptr) {
+ if (_scene->_animation[0]->getCurrentFrame() != _boatCurrentFrame) {
+ _boatCurrentFrame = _scene->_animation[0]->getCurrentFrame();
int nextFrame = -1;
switch (_boatCurrentFrame) {
@@ -1377,8 +1377,8 @@ void Scene704::step() {
break;
}
- if ((nextFrame >= 0) && (nextFrame != _scene->_activeAnimation->getCurrentFrame())) {
- _scene->_activeAnimation->setCurrentFrame(nextFrame);
+ if ((nextFrame >= 0) && (nextFrame != _scene->_animation[0]->getCurrentFrame())) {
+ _scene->_animation[0]->setCurrentFrame(nextFrame);
_boatCurrentFrame = nextFrame;
}
}
@@ -1455,7 +1455,7 @@ void Scene704::actions() {
_vm->_dialogs->show(70412);
} else if (_action.isAction(VERB_LOOK, NOUN_VOLCANO_RIM))
_vm->_dialogs->show(70413);
- else if (_action.isAction(VERB_LOOK, NOUN_BOTTLE) && (_action._mainObjectSource == 4))
+ else if (_action.isAction(VERB_LOOK, NOUN_BOTTLE) && (_action._mainObjectSource == CAT_HOTSPOT))
_vm->_dialogs->show(70414);
else if (_action.isAction(VERB_LOOK, NOUN_OPEN_WATER_TO_SOUTH))
_vm->_dialogs->show(70416);
@@ -1906,9 +1906,9 @@ void Scene706::step() {
_scene->_reloadSceneFlag = true;
}
- if (_scene->_activeAnimation != nullptr) {
- if ((_animationMode != 0) && (_scene->_activeAnimation->getCurrentFrame() != _animationFrame)) {
- _animationFrame = _scene->_activeAnimation->getCurrentFrame();
+ if (_scene->_animation[0] != nullptr) {
+ if ((_animationMode != 0) && (_scene->_animation[0]->getCurrentFrame() != _animationFrame)) {
+ _animationFrame = _scene->_animation[0]->getCurrentFrame();
if (_animationFrame == 6) {
_scene->_sequences.remove(_globals._sequenceIndexes[1]);
@@ -2017,7 +2017,7 @@ void Scene706::actions() {
_vm->_dialogs->show(70623);
else if (_action.isAction(VERB_LOOK, NOUN_VASE) && (_game._objects[OBJ_VASE]._roomNumber == _scene->_currentSceneId))
_vm->_dialogs->show(70624);
- else if (_action.isAction(VERB_LOOK, NOUN_BOTTLE) && (_action._mainObjectSource == 4))
+ else if (_action.isAction(VERB_LOOK, NOUN_BOTTLE) && (_action._mainObjectSource == CAT_HOTSPOT))
_vm->_dialogs->show(70632);
else
return;
diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp
index a904569624..951b270a1c 100644
--- a/engines/mads/nebular/nebular_scenes8.cpp
+++ b/engines/mads/nebular/nebular_scenes8.cpp
@@ -930,7 +930,7 @@ void Scene804::enter() {
void Scene804::step() {
if (!_messWithThrottle) {
- if ((_throttleGone) && (_movingThrottle) && (_scene->_activeAnimation->getCurrentFrame() == 39)) {
+ if ((_throttleGone) && (_movingThrottle) && (_scene->_animation[0]->getCurrentFrame() == 39)) {
_globals._sequenceIndexes[1] = _scene->_sequences.startCycle
(_globals._spriteIndexes[1], false, 1);
_scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(133, 139));
@@ -938,7 +938,7 @@ void Scene804::step() {
_throttleGone = false;
}
- if ((_movingThrottle) && (_scene->_activeAnimation->getCurrentFrame() == 42)) {
+ if ((_movingThrottle) && (_scene->_animation[0]->getCurrentFrame() == 42)) {
_resetFrame = 0;
_movingThrottle = false;
}
@@ -947,12 +947,12 @@ void Scene804::step() {
_resetFrame = 42;
}
- if (_scene->_activeAnimation->getCurrentFrame() == 65)
+ if (_scene->_animation[0]->getCurrentFrame() == 65)
_scene->_sequences.remove(_globals._sequenceIndexes[7]);
switch (_game._storyMode) {
case STORYMODE_NAUGHTY:
- if (_scene->_activeAnimation->getCurrentFrame() == 81) {
+ if (_scene->_animation[0]->getCurrentFrame() == 81) {
_resetFrame = 80;
_globals[kInSpace] = false;
_globals[kBeamIsUp] = true;
@@ -964,7 +964,7 @@ void Scene804::step() {
break;
case STORYMODE_NICE:
- if (_scene->_activeAnimation->getCurrentFrame() == 68) {
+ if (_scene->_animation[0]->getCurrentFrame() == 68) {
_resetFrame = 66;
_globals[kInSpace] = false;
_globals[kBeamIsUp] = true;
@@ -975,12 +975,12 @@ void Scene804::step() {
}
}
- if (_scene->_activeAnimation->getCurrentFrame() == 34) {
+ if (_scene->_animation[0]->getCurrentFrame() == 34) {
_resetFrame = 36;
_scene->_sequences.remove(_globals._sequenceIndexes[1]);
}
- if (_scene->_activeAnimation->getCurrentFrame() == 37) {
+ if (_scene->_animation[0]->getCurrentFrame() == 37) {
_resetFrame = 36;
if (!_dontPullThrottleAgain) {
_dontPullThrottleAgain = true;
@@ -992,20 +992,20 @@ void Scene804::step() {
_scene->_nextSceneId = 803;
}
- if ((_scene->_activeAnimation->getCurrentFrame() == 7) && (!_globals[kWindowFixed])) {
+ if ((_scene->_animation[0]->getCurrentFrame() == 7) && (!_globals[kWindowFixed])) {
_globals._sequenceIndexes[4] = _scene->_sequences.startCycle(_globals._spriteIndexes[4], false, 1);
_scene->_sequences.addTimer(20, 110);
_globals[kWindowFixed] = true;
}
- if (_scene->_activeAnimation->getCurrentFrame() == 10) {
+ if (_scene->_animation[0]->getCurrentFrame() == 10) {
_resetFrame = 0;
_game._player._stepEnabled = true;
_game._objects.setRoom(OBJ_POLYCEMENT, NOWHERE);
}
// FIXME: Original doesn't have resetFrame check. Check why this has been needed
- if (_resetFrame == -1 && _scene->_activeAnimation->getCurrentFrame() == 1) {
+ if (_resetFrame == -1 && _scene->_animation[0]->getCurrentFrame() == 1) {
int randomVal = _vm->getRandomNumber(29) + 1;
switch (randomVal) {
case 1:
@@ -1023,7 +1023,7 @@ void Scene804::step() {
}
}
- switch (_scene->_activeAnimation->getCurrentFrame()) {
+ switch (_scene->_animation[0]->getCurrentFrame()) {
case 26:
case 28:
case 31:
@@ -1031,12 +1031,12 @@ void Scene804::step() {
break;
}
} else {
- if ((_scene->_activeAnimation->getCurrentFrame() == 36) && (!_throttleGone)) {
+ if ((_scene->_animation[0]->getCurrentFrame() == 36) && (!_throttleGone)) {
_scene->_sequences.remove(_globals._sequenceIndexes[1]);
_throttleGone = true;
}
- if (_scene->_activeAnimation->getCurrentFrame() == 39) {
+ if (_scene->_animation[0]->getCurrentFrame() == 39) {
_movingThrottle = false;
switch (_throttleCounter) {
case 1:
@@ -1074,8 +1074,8 @@ void Scene804::step() {
}
if (_resetFrame >= 0) {
- if (_resetFrame != _scene->_activeAnimation->getCurrentFrame()) {
- _scene->_activeAnimation->setCurrentFrame(_resetFrame);
+ if (_resetFrame != _scene->_animation[0]->getCurrentFrame()) {
+ _scene->_animation[0]->setCurrentFrame(_resetFrame);
_resetFrame = -1;
}
}
@@ -1084,12 +1084,12 @@ void Scene804::step() {
_scene->_nextSceneId = 803;
}
- if ((_scene->_activeAnimation->getCurrentFrame() == 72) && !_alreadyPop) {
+ if ((_scene->_animation[0]->getCurrentFrame() == 72) && !_alreadyPop) {
_vm->_sound->command(21);
_alreadyPop = true;
}
- if ((_scene->_activeAnimation->getCurrentFrame() == 80) && !_alreadyOrgan) {
+ if ((_scene->_animation[0]->getCurrentFrame() == 80) && !_alreadyOrgan) {
_vm->_sound->command(22);
_alreadyOrgan = true;
}
@@ -1606,7 +1606,7 @@ void Scene810::enter() {
}
void Scene810::step() {
- if (_scene->_activeAnimation && (_scene->_activeAnimation->getCurrentFrame() == 200)
+ if (_scene->_animation[0] && (_scene->_animation[0]->getCurrentFrame() == 200)
&& _moveAllowed) {
_scene->_sequences.addTimer(100, 70);
_moveAllowed = false;
diff --git a/engines/mads/nebular/sound_nebular.cpp b/engines/mads/nebular/sound_nebular.cpp
index ab6bd8215c..4c360b23d5 100644
--- a/engines/mads/nebular/sound_nebular.cpp
+++ b/engines/mads/nebular/sound_nebular.cpp
@@ -2027,8 +2027,8 @@ const ASound4::CommandPtr ASound4::_commandList[61] = {
&ASound4::nullCommand, &ASound4::nullCommand, &ASound4::nullCommand, &ASound4::command43,
&ASound4::nullCommand, &ASound4::nullCommand, &ASound4::nullCommand, &ASound4::nullCommand,
&ASound4::nullCommand, &ASound4::nullCommand, &ASound4::nullCommand, &ASound4::nullCommand,
- &ASound4::nullCommand, &ASound4::nullCommand, &ASound4::nullCommand, &ASound4::nullCommand,
- &ASound4::nullCommand, &ASound4::command57, &ASound4::nullCommand, &ASound4::command59,
+ &ASound4::command52, &ASound4::command53, &ASound4::command54, &ASound4::command55,
+ &ASound4::command56, &ASound4::command57, &ASound4::command58, &ASound4::command59,
&ASound4::command60
};
diff --git a/engines/mads/palette.h b/engines/mads/palette.h
index 6c98947384..1efe63b324 100644
--- a/engines/mads/palette.h
+++ b/engines/mads/palette.h
@@ -316,7 +316,7 @@ public:
void refreshSceneColors();
- static int closestColor(const byte *matchColor, const byte *refPalette,
+ static int closestColor(const byte *matchColor, const byte *refPalette,
int paletteInc, int count);
};
diff --git a/engines/mads/phantom/game_phantom.cpp b/engines/mads/phantom/game_phantom.cpp
index 592a108aea..27849cce1e 100644
--- a/engines/mads/phantom/game_phantom.cpp
+++ b/engines/mads/phantom/game_phantom.cpp
@@ -35,10 +35,111 @@ namespace MADS {
namespace Phantom {
-GamePhantom::GamePhantom(MADSEngine *vm)
- : Game(vm) {
+ Catacombs _easyCatacombs[32] = {
+ { 401, { -1, 1, 2, 6 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 404, { 10, 11, 3, 0 }, { 2, 3, 0, 1 }, MAZE_EVENT_PUDDLE },
+ { 404, { 0, 3, 4, -2 }, { 2, 3, 0, 1 }, MAZE_EVENT_BLOCK },
+ { 401, { 1, 14, 5, 2 }, { 2, 3, 0, 1 }, MAZE_EVENT_POT },
+ { 453, { 2, 4, -1, 4 }, { 2, 3, 0, 1 }, MAZE_EVENT_DRAIN },
+ { 403, { 3, 6, -1, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK | MAZE_EVENT_PLANK },
+ { 406, { -1, 0, -1, 5 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 453, { -1, 8, -1, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 406, { -1, 9, -1, 7 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 401, { 1, -1, 10, 8 }, { 2, 3, 0, 1 }, MAZE_EVENT_RAT_NEST | MAZE_EVENT_SKULL },
+ { 408, { 9, -1, 1, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 453, { 12, -1, -1, 1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK | MAZE_EVENT_STONE },
+ { 408, { 13, -1, 11, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 401, { 13, 20, 12, 13 }, { 3, 3, 0, 0 }, MAZE_EVENT_BRICK },
+ { 453, { 16, 15, -1, 3 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK | MAZE_EVENT_RAT_NEST },
+ { 456, { -1, -1, -1, 14 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 404, { -1, 17, 14, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_WEB | MAZE_EVENT_POT },
+ { 401, { 18, -1, 19, 16 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 408, { -1, -1, 17, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 403, { 17, -1, -1, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_HOLE | MAZE_EVENT_WEB },
+ { 403, { 21, 22, -1, 13 }, { 2, 3, 0, 1 }, MAZE_EVENT_WEB | MAZE_EVENT_SKULL },
+ { 404, { -1, -1, 20, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 406, { -1, 23, -1, 20 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 404, { 24, 23, 23, 22 }, { 2, 2, 1, 1 }, MAZE_EVENT_RAT_NEST | MAZE_EVENT_BRICK },
+ { 401, { -1, 1, 23, 25 }, { 2, 1, 0, 1 }, MAZE_EVENT_PUDDLE | MAZE_EVENT_POT | MAZE_EVENT_BRICK },
+ { 407, { 29, 24, 28, 26 }, { 3, 3, 1, 1 }, MAZE_EVENT_NONE },
+ { 401, { 27, 25, 23, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_SKULL },
+ { 404, { -1, 28, 26, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_WEB | MAZE_EVENT_FALLEN_BLOCK },
+ { 456, { -1, 25, -1, 27 }, { 2, 2, 0, 1 }, MAZE_EVENT_NONE },
+ { 406, { -1, 30, -1, 25 }, { 2, 3, 0, 0 }, MAZE_EVENT_NONE },
+ { 453, { -3, 30, -1, 29 }, { 2, 3, 0, 1 }, MAZE_EVENT_STONE | MAZE_EVENT_RAT_NEST | MAZE_EVENT_WEB },
+ { 408, { -5, -1, -4, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_WEB | MAZE_EVENT_BRICK }
+ };
+
+ Catacombs _hardCatacombs[62] = {
+ { 401, { -1, 1, 2, 6 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 404, { 10, 11, 3, 0 }, { 2, 3, 0, 1 }, MAZE_EVENT_PUDDLE },
+ { 404, { 0, 3, 4, -2 }, { 2, 3, 0, 1 }, MAZE_EVENT_BLOCK },
+ { 401, { 1, 20, 5, 2 }, { 2, 0, 0, 1 }, MAZE_EVENT_POT },
+ { 453, { 2, 4, -1, 4 }, { 2, 3, 0, 1 }, MAZE_EVENT_DRAIN },
+ { 403, { 3, 6, -1, 4 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK | MAZE_EVENT_PLANK },
+ { 406, { -1, 0, -1, 5 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 453, { -1, 8, -1, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 406, { -1, 9, -1, 7 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 401, { 1, -1, 10, 8 }, { 0, 3, 0, 1 }, MAZE_EVENT_RAT_NEST | MAZE_EVENT_SKULL },
+ { 408, { 9, -1, 1, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 453, { 12, -1, -1, 1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK | MAZE_EVENT_STONE },
+ { 408, { 13, -1, 11, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 401, { 13, 21, 12, 13 }, { 3, 3, 0, 0 }, MAZE_EVENT_BRICK },
+ { 453, { 16, 15, -1, 20 }, { 2, 3, 0, 2 }, MAZE_EVENT_RAT_NEST | MAZE_EVENT_BRICK },
+ { 456, { -1, -1, -1, 14 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 404, { -1, 17, 14, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_WEB | MAZE_EVENT_POT },
+ { 401, { 18, -1, 19, 16 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 408, { -1, -1, 17, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 403, { 17, -1, -1, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_HOLE | MAZE_EVENT_WEB },
+ { 408, { 3, -1, 14, -1 }, { 1, 3, 3, 1 }, MAZE_EVENT_NONE },
+ { 404, { 9, 30, 22, 13 }, { 0, 3, 0, 1 }, MAZE_EVENT_RAT_NEST },
+ { 403, { 21, 23, -1, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_HOLE | MAZE_EVENT_WEB },
+ { 401, { -1, -1, 24, 22 }, { 2, 3, 3, 1 }, MAZE_EVENT_BRICK },
+ { 406, { -1, 26, -1, 23 }, { 2, 0, 0, 2 }, MAZE_EVENT_NONE },
+ { 407, { 36, 33, 35, 34 }, { 3, 3, 1, 1 }, MAZE_EVENT_NONE },
+ { 453, { 24, 27, -1, -1 }, { 1, 0, 0, 1 }, MAZE_EVENT_BRICK },
+ { 403, { 26, -1, -1, 28 }, { 1, 3, 0, 0 }, MAZE_EVENT_BRICK | MAZE_EVENT_SKULL },
+ { 404, { 27, 28, 28, 29 }, { 3, 2, 1, 2 }, MAZE_EVENT_NONE },
+ { 408, { -1, -1, 28, -1 }, { 2, 3, 3, 1 }, MAZE_EVENT_BRICK },
+ { 406, { -1, 31, -1, 21 }, { 2, 0, 0, 1 }, MAZE_EVENT_NONE },
+ { 401, { 30, 33, 1, -1 }, { 1, 2, 1, 1 }, MAZE_EVENT_PUDDLE | MAZE_EVENT_POT },
+ { 456, { -1, 31, -1, 33 }, { 2, 1, 0, 0 }, MAZE_EVENT_NONE },
+ { 404, { 32, -1, 31, 25 }, { 3, 3, 1, 1 }, MAZE_EVENT_NONE },
+ { 401, { 46, 25, 31, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_SKULL },
+ { 401, { -1, 25, 41, -1 }, { 2, 2, 1, 1 }, MAZE_EVENT_BRICK | MAZE_EVENT_POT },
+ { 406, { -1, 37, -1, 25 }, { 2, 3, 0, 0 }, MAZE_EVENT_NONE },
+ { 453, { -3, 37, -1, 36 }, { 2, 3, 0, 1 }, MAZE_EVENT_STONE | MAZE_EVENT_RAT_NEST | MAZE_EVENT_WEB },
+ { 408, { 57, -1, 54, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 408, { 40, -1, -4, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK | MAZE_EVENT_WEB },
+ { 404, { 40, 40, 39, 53 }, { 1, 0, 0, 1 }, MAZE_EVENT_BLOCK | MAZE_EVENT_FALLEN_BLOCK },
+ { 456, { -1, 35, -1, 42 }, { 2, 2, 0, 2 }, MAZE_EVENT_NONE },
+ { 408, { 43, -1, 41, -1 }, { 1, 3, 3, 1 }, MAZE_EVENT_BRICK },
+ { 406, { -1, 42, -1, 61 }, { 2, 0, 0, 1 }, MAZE_EVENT_NONE },
+ { 403, { 58, 45, -1, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK | MAZE_EVENT_RAT_NEST },
+ { 401, { 34, -1, 46, 44 }, { 0, 3, 0, 1 }, MAZE_EVENT_RAT_NEST | MAZE_EVENT_BRICK },
+ { 404, { 45, -1, 34, 47 }, { 2, 3, 0, 1 }, MAZE_EVENT_WEB | MAZE_EVENT_FALLEN_BLOCK },
+ { 406, { -1, 46, -1, 48 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 403, { 49, 47, -1, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK | MAZE_EVENT_SKULL | MAZE_EVENT_WEB },
+ { 408, { 50, -1, 48, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 408, { 51, -1, 49, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 408, { 52, -1, 50, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 408, { -1, -1, 51, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK },
+ { 406, { -1, 40, -1, 54 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 403, { 38, 53, -1, 55 }, { 2, 3, 0, 1 }, MAZE_EVENT_SKULL },
+ { 453, { 56, 54, -1, -1 }, { 2, 3, 0, 1 }, MAZE_EVENT_BRICK | MAZE_EVENT_WEB },
+ { 401, { 56, -5, 55, 56 }, { 3, 3, 0, 0 }, MAZE_EVENT_BRICK | MAZE_EVENT_SKULL },
+ { 404, { -1, 57, 38, 57 }, { 2, 3, 0, 1 }, MAZE_EVENT_POT | MAZE_EVENT_BLOCK },
+ { 404, { 59, 59, 44, 60 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 404, { 59, 60, 59, 58 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 404, { 61, 58, 59, 59 }, { 2, 3, 0, 1 }, MAZE_EVENT_NONE },
+ { 404, { 34, 43, 60, 44 }, { 0, 3, 0, 1 }, MAZE_EVENT_NONE }
+ };
+
+GamePhantom::GamePhantom(MADSEngine *vm) : Game(vm) {
_surface = new MSurface(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT);
- _storyMode = STORYMODE_NAUGHTY;
+ _difficulty = DIFFICULTY_HARD;
+ _catacombs = nullptr;
+ _catacombSize = -1;
}
void GamePhantom::startGame() {
@@ -51,8 +152,7 @@ void GamePhantom::startGame() {
void GamePhantom::initializeGlobals() {
_globals.reset();
-
- // TODO: Catacombs setup
+ setupCatacombs();
_player._facing = FACING_NORTH;
_player._turnToFacing = FACING_NORTH;
@@ -104,7 +204,7 @@ void GamePhantom::initializeGlobals() {
_globals[kChristineToldEnvelope] = false;
_globals[kLeaveAngelMusicOn] = false;
_globals[kDoorIn409IsOpen] = false;
- _globals[kUnknown] = false;
+ _globals[kPriestPistonPuke] = false;
_globals[kCobwebIsCut] = false;
_globals[kChristineIsInBoat] = false;
_globals[kRightDoorIsOpen504] = false;
@@ -161,27 +261,561 @@ void GamePhantom::checkShowDialog() {
}
}
+void GamePhantom::genericObjectExamine() {
+ MADSAction &action = _scene._action;
+ int id = _objects.getIdFromDesc(action._activeAction._objectNameId);
+
+ if (action.isAction(VERB_LOOK, NOUN_RED_FRAME))
+ _vm->_dialogs->showItem(id, (_globals[kCurrentYear] == 1993) ? 802 : 842, 0);
+ else if (action.isAction(VERB_LOOK, NOUN_YELLOW_FRAME))
+ _vm->_dialogs->showItem(id, (_globals[kCurrentYear] == 1993) ? 804 : 843, 0);
+ else if (action.isAction(VERB_LOOK, NOUN_BLUE_FRAME))
+ _vm->_dialogs->showItem(id, (_globals[kCurrentYear] == 1993) ? 817 : 844, 0);
+ else if (action.isAction(VERB_LOOK, NOUN_GREEN_FRAME))
+ _vm->_dialogs->showItem(id, (_globals[kCurrentYear] == 1993) ? 819 : 845, 0);
+ else if (action.isAction(VERB_LOOK, NOUN_LANTERN))
+ _vm->_dialogs->showItem(id, (_globals[kLanternStatus] == 1) ? 831 : 801, 0);
+ else if (action.isAction(VERB_LOOK, NOUN_SMALL_NOTE))
+ _vm->_dialogs->showItem(OBJ_SMALL_NOTE, 846, 2);
+ else if (action.isAction(VERB_LOOK, NOUN_PARCHMENT))
+ _vm->_dialogs->showItem(OBJ_PARCHMENT, 812, 3);
+ else if (action.isAction(VERB_LOOK, NOUN_LETTER))
+ _vm->_dialogs->showItem(OBJ_LETTER, 813, 4);
+ else if (action.isAction(VERB_LOOK, NOUN_NOTICE))
+ _vm->_dialogs->showItem(OBJ_NOTICE, 814, 5);
+ else if (action.isAction(VERB_LOOK, NOUN_CRUMPLED_NOTE))
+ _vm->_dialogs->showItem(OBJ_CRUMPLED_NOTE, 816, 6);
+ else if (action.isAction(VERB_LOOK, NOUN_LARGE_NOTE))
+ _vm->_dialogs->showItem(OBJ_LARGE_NOTE, 818, 7);
+ else
+ _vm->_dialogs->showItem(id, 800 + id, 0);
+}
+
void GamePhantom::doObjectAction() {
- // TODO: Copied from Nebular
- //Scene &scene = _scene;
MADSAction &action = _scene._action;
- //Dialogs &dialogs = *_vm->_dialogs;
- //int id;
- action._inProgress = false;
+ if ((_scene._currentSceneId >= 401) && (_scene._currentSceneId <= 456)
+ && (action.isObject(NOUN_RED_FRAME) || action.isObject(NOUN_YELLOW_FRAME) || action.isObject(NOUN_GREEN_FRAME) || action.isObject(NOUN_BLUE_FRAME))
+ && action.isAction(VERB_PUT)) {
+ if (action.isTarget(NOUN_UNLUCKY_ADVENTURER)) {
+ _vm->_dialogs->show(35);
+ action._inProgress = false;
+ return;
+ } else if (action.isTarget(NOUN_HOLE)) {
+ _vm->_dialogs->show(36);
+ action._inProgress = false;
+ return;
+ } else if (action.isTarget(NOUN_GRATE)) {
+ _vm->_dialogs->show(37);
+ action._inProgress = false;
+ return;
+ } else if (action.isTarget(NOUN_WALL)) {
+ _vm->_dialogs->show(38);
+ action._inProgress = false;
+ return;
+ }
+ }
+
+ if (action._lookFlag) {
+ _vm->_dialogs->show(810);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_PUT, NOUN_RED_FRAME) || action.isAction(VERB_PUT, NOUN_BLUE_FRAME) || action.isAction(VERB_PUT, NOUN_YELLOW_FRAME) || action.isAction(VERB_PUT, NOUN_GREEN_FRAME)) {
+ _vm->_dialogs->show((action.isTarget(NOUN_PUDDLE)) ? 40124 : 40125);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_WEAR, NOUN_WEDDING_RING)) {
+ if (_globals[kRingIsOnFinger])
+ _vm->_dialogs->show(849);
+ else {
+ _vm->_dialogs->show(835);
+ _globals[kRingIsOnFinger] = true;
+ }
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_REMOVE, NOUN_WEDDING_RING)) {
+ if (!_globals[kRingIsOnFinger])
+ _vm->_dialogs->show(848);
+ else {
+ _vm->_dialogs->show(836);
+ _globals[kRingIsOnFinger] = false;
+ }
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_ARCHWAY_TO_WEST) || action.isAction(VERB_LOOK, NOUN_ARCHWAY_TO_EAST) || action.isAction(VERB_LOOK, NOUN_ARCHWAY_TO_NORTH)) {
+ _vm->_dialogs->show(34);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_ATTACK, NOUN_CHRISTINE)) {
+ _vm->_dialogs->show(33);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_KEY)) {
+ _vm->_dialogs->showItem(OBJ_KEY, 800, 0);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_SANDBAG)) {
+ _vm->_dialogs->showItem(OBJ_SANDBAG, 803, 0);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_SMALL_NOTE) || action.isAction(VERB_READ, NOUN_SMALL_NOTE)) {
+ _vm->_dialogs->showItem(OBJ_SMALL_NOTE, 806, 2);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_ROPE)) {
+ _vm->_dialogs->showItem(OBJ_ROPE, 807, 0);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_SWORD)) {
+ _vm->_dialogs->showItem(OBJ_SWORD, 808, 0);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_ENVELOPE) || action.isAction(VERB_READ, NOUN_ENVELOPE)) {
+ _vm->_dialogs->showItem(OBJ_ENVELOPE, 809, 0);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_TICKET) || action.isAction(VERB_READ, NOUN_TICKET)) {
+ _vm->_dialogs->showItem(OBJ_TICKET, 810, 0);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_PIECE_OF_PAPER) || action.isAction(VERB_READ, NOUN_PIECE_OF_PAPER)) {
+ _vm->_dialogs->showItem(OBJ_PIECE_OF_PAPER, 811, 1);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_PARCHMENT) || action.isAction(VERB_READ, NOUN_PARCHMENT)) {
+ _vm->_dialogs->showItem(OBJ_PARCHMENT, 812, 3);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_LETTER) || action.isAction(VERB_READ, NOUN_LETTER)) {
+ _vm->_dialogs->showItem(OBJ_LETTER, 813, 4);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_NOTICE) || action.isAction(VERB_READ, NOUN_NOTICE)) {
+ _vm->_dialogs->showItem(OBJ_NOTICE, 814, 5);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_BOOK) || action.isAction(VERB_READ, NOUN_BOOK)) {
+ _vm->_dialogs->showItem(OBJ_BOOK, 815, 0);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_CRUMPLED_NOTE) || action.isAction(VERB_READ, NOUN_CRUMPLED_NOTE)) {
+ _vm->_dialogs->showItem(OBJ_CRUMPLED_NOTE, 816, 6);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_LARGE_NOTE) || action.isAction(VERB_READ, NOUN_LARGE_NOTE)) {
+ _vm->_dialogs->showItem(OBJ_LARGE_NOTE, 818, 7);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_MUSIC_SCORE) || action.isAction(VERB_READ, NOUN_MUSIC_SCORE)) {
+ _vm->_dialogs->showItem(OBJ_MUSIC_SCORE, 820, 0);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_WEDDING_RING)) {
+ _vm->_dialogs->showItem(OBJ_WEDDING_RING, 821, 0);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_CABLE_HOOK)) {
+ _vm->_dialogs->showItem(OBJ_CABLE_HOOK, 822, 0);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_ROPE_WITH_HOOK)) {
+ _vm->_dialogs->showItem(OBJ_ROPE_WITH_HOOK, 823, 0);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK, NOUN_OAR)) {
+ _vm->_dialogs->showItem(OBJ_OAR, 824, 0);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_LOOK) && _objects.isInInventory(_objects.getIdFromDesc(action._activeAction._objectNameId))) {
+ genericObjectExamine();
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_TURN_ON, NOUN_LANTERN)) {
+ if ((_globals[kLanternStatus] == 1) && !_trigger)
+ _vm->_dialogs->show(828);
+ else {
+ switch (_trigger) {
+ case 0:
+ _scene._sequences.addTimer(4, 1);
+ _globals[kLanternStatus] = 1;
+ _vm->_dialogs->spinObject(OBJ_LANTERN);
+ break;
+
+ case 1:
+ _vm->_dialogs->show(825);
+ break;
+
+ default:
+ break;
+ }
+ }
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_TURN_OFF, NOUN_LANTERN)) {
+ if ((_globals[kLanternStatus] == 0) && !_trigger)
+ _vm->_dialogs->show(829);
+ else if ((_scene._currentSceneId / 100) == 4)
+ _vm->_dialogs->show(826);
+ else {
+ switch (_trigger) {
+ case 0:
+ _scene._sequences.addTimer(4, 1);
+ _globals[kLanternStatus] = 0;
+ _vm->_dialogs->spinObject(OBJ_LANTERN);
+ break;
+
+ case 1:
+ _vm->_dialogs->show(827);
+ break;
+
+ default:
+ break;
+ }
+ }
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_OPEN, NOUN_ENVELOPE)) {
+ _objects.setRoom(OBJ_ENVELOPE, NOWHERE);
+ _objects.addToInventory(OBJ_TICKET);
+ _objects.addToInventory(OBJ_PIECE_OF_PAPER);
+ _vm->_dialogs->show(833);
+ action._inProgress = false;
+ return;
+ }
+
+ if (action.isAction(VERB_ATTACH, NOUN_CABLE_HOOK, NOUN_ROPE)) {
+ if (!_objects.isInInventory(OBJ_ROPE))
+ _vm->_dialogs->show(11438);
+ else {
+ _objects.setRoom(OBJ_CABLE_HOOK, NOWHERE);
+ _objects.setRoom(OBJ_ROPE, NOWHERE);
+ _objects.addToInventory(OBJ_ROPE_WITH_HOOK);
+ _vm->_dialogs->showItem(OBJ_ROPE_WITH_HOOK, 823, 0);
+ }
+ action._inProgress = false;
+ }
}
void GamePhantom::unhandledAction() {
- // TODO
+ int messageId = 0;
+ int rndNum = _vm->getRandomNumber(1, 1000);
+ MADSAction &action = _scene._action;
+
+ if (action.isAction(VERB_PUT, NOUN_CHANDELIER, NOUN_SEATS))
+ _vm->_dialogs->show(10123);
+ else if (action.isAction(VERB_TAKE)) {
+ if (_objects.isInInventory(_objects.getIdFromDesc(action._activeAction._objectNameId)))
+ messageId = 25;
+ else {
+ if (rndNum <= 333)
+ messageId = 1;
+ else if (rndNum <= 666)
+ messageId = 2;
+ else
+ messageId = 3;
+ }
+ } else if (action.isAction(VERB_PUSH)) {
+ if (rndNum < 750)
+ messageId = 4;
+ else
+ messageId = 5;
+ } else if (action.isAction(VERB_PULL)) {
+ if (rndNum < 750)
+ messageId = 6;
+ else
+ messageId = 7;
+ } else if (action.isAction(VERB_OPEN)) {
+ if (rndNum <= 500)
+ messageId = 8;
+ else if (rndNum <= 750)
+ messageId = 9;
+ else
+ messageId = 10;
+ } else if (action.isAction(VERB_CLOSE)) {
+ if (rndNum <= 500)
+ messageId = 11;
+ else if (rndNum <= 750)
+ messageId = 12;
+ else
+ messageId = 13;
+ } else if (action.isAction(VERB_PUT)) {
+ if (_objects.isInInventory(_objects.getIdFromDesc(action._activeAction._objectNameId)))
+ messageId = 26;
+ else if (rndNum < 500)
+ messageId = 14;
+ else
+ messageId = 15;
+ } else if (action.isAction(VERB_TALK_TO)) {
+ if (rndNum <= 500)
+ messageId = 16;
+ else
+ messageId = 17;
+ } else if (action.isAction(VERB_GIVE)) {
+ if (_objects.isInInventory(_objects.getIdFromDesc(action._activeAction._objectNameId)))
+ messageId = 27;
+ else
+ messageId = 18;
+ } else if (action.isAction(VERB_THROW)) {
+ if (_objects.isInInventory(_objects.getIdFromDesc(action._activeAction._objectNameId)))
+ messageId = 19;
+ else
+ messageId = 28;
+ } else if (action.isAction(VERB_LOOK)) {
+ if (rndNum <= 333)
+ messageId = 20;
+ else if (rndNum <= 666)
+ messageId = 21;
+ else
+ messageId = 22;
+ } else if ((action.isAction(VERB_UNLOCK) || action.isAction(VERB_LOCK))
+ && (action.isObject(NOUN_DOOR) || action.isObject(NOUN_LEFT_DOOR) || action.isObject(NOUN_MIDDLE_DOOR) || action.isObject(NOUN_RIGHT_DOOR) || action.isObject(NOUN_TRAP_DOOR)))
+ messageId = 32;
+ else if (!action.isAction(VERB_WALK_TO) && !action.isAction(VERB_WALK_ACROSS) && !action.isAction(VERB_WALK_DOWN) && !action.isAction(VERB_WALK_UP)) {
+ if (rndNum < 500)
+ messageId = 23;
+ else
+ messageId = 24;
+ }
+
+ if (messageId)
+ _vm->_dialogs->show(messageId);
+}
+
+void GamePhantom::stopWalker() {
+ int state = _globals[kWalkerConverseState];
+ int command = _globals[kWalkerConverse];
+
+ _globals[kWalkerConverseNow] = state;
+
+ if ((_player._facing != FACING_NORTHEAST) && (_player._facing != FACING_NORTHWEST)) {
+ state = 0;
+ command = 0;
+ }
+
+ switch (state) {
+ case 1:
+ switch (command) {
+ case 1:
+ _player.addWalker(3, 0);
+ break;
+
+ case 2:
+ case 3:
+ _player.addWalker(6, 0);
+ _player.addWalker(5, 0);
+ _player.addWalker(4, 0);
+ state = 2;
+ break;
+
+ case 4:
+ _player.addWalker(8, 0);
+ _player.addWalker(4, 0);
+ state = 4;
+ break;
+
+ default:
+ _player.addWalker(-2, 0);
+ state = 0;
+ break;
+ }
+ break;
+
+ case 2:
+ case 3:
+ switch (command) {
+ case 2:
+ case 3:
+ if (state == 2) {
+ if (_vm->getRandomNumber(1, 30000) < 2000) {
+ _player.addWalker(10, 0);
+ _player.addWalker(7, 0);
+ state = 3;
+ } else
+ _player.addWalker(6, 0);
+ } else {
+ if (_vm->getRandomNumber(1, 30000) < 1000) {
+ _player.addWalker(6, 0);
+ _player.addWalker(7, 0);
+ state = 2;
+ } else
+ _player.addWalker(10, 0);
+ }
+ break;
+
+ default:
+ _player.addWalker(-4, 0);
+ _player.addWalker(-5, 0);
+ if (state == 3) {
+ _player.addWalker(6, 0);
+ _player.addWalker(7, 0);
+ }
+ state = 1;
+ break;
+ }
+ break;
+
+ case 4:
+ if (command == 4)
+ _player.addWalker(9, 0);
+ else {
+ _player.addWalker(-4, 0);
+ _player.addWalker(-8, 0);
+ state = 1;
+ }
+ break;
+
+ case 0:
+ default:
+ switch (command) {
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ _player.addWalker(2, 0);
+ state = 1;
+ break;
+
+ default:
+ stopWalkerBasic();
+ break;
+ }
+ break;
+ }
+
+ _globals[kWalkerConverse] = command;
+ _globals[kWalkerConverseState] = state;
}
void GamePhantom::step() {
- if (_player._visible && _player._stepEnabled && !_player._moving &&
- (_player._facing == _player._turnToFacing)) {
+ if (_player._visible && !_globals[kStopWalkerDisabled]
+ && (_player._stepEnabled || (_vm->_gameConv->_running >= 0))
+ && !_player._moving && (_player._facing == _player._turnToFacing)
+ && (_scene._frameStartTime >= (uint32)_globals[kWalkerTiming])) {
+ if (!_player._stopWalkerIndex)
+ stopWalker();
- // TODO
+ _globals[kWalkerTiming] += 6;
}
+}
+
+void GamePhantom::stopWalkerBasic() {
+ int rndVal = _vm->getRandomNumber(1, 30000);
+
+ switch (_player._facing) {
+ case FACING_SOUTH:
+ if (rndVal < 500) {
+ int maxSteps = _vm->getRandomNumber(4, 10);
+ for (int i = 0; i < maxSteps; i++)
+ _player.addWalker((rndVal < 250) ? 1 : 2, 0);
+ } else if (rndVal < 750) {
+ for (int i = 0; i < 4; i++)
+ _player.addWalker(1, 0);
+ _player.addWalker(0, 0);
+
+ for (int i = 0; i < 4; i++)
+ _player.addWalker(2, 0);
+
+ _player.addWalker(0, 0);
+ }
+ break;
+
+ case FACING_SOUTHEAST:
+ case FACING_SOUTHWEST:
+ case FACING_NORTHEAST:
+ case FACING_NORTHWEST:
+ if (rndVal < 150) {
+ _player.addWalker(-1, 0);
+ _player.addWalker(1, 0);
+ for (int i = 0; i < 6; i++)
+ _player.addWalker(0, 0);
+ }
+ break;
+
+ case FACING_EAST:
+ case FACING_WEST:
+ if (rndVal < 250) {
+ _player.addWalker(-1, 0);
+ int maxSteps = _vm->getRandomNumber(2, 6);
+ for (int i = 0; i < maxSteps; i++)
+ _player.addWalker(2, 0);
+ _player.addWalker(1, 0);
+ _player.addWalker(0, 0);
+ _player.addWalker(0, 0);
+ } else if (rndVal < 500)
+ _globals[kWalkerTiming] = (int)_scene._frameStartTime;
+ break;
+
+ case FACING_NORTH:
+ if (rndVal < 250) {
+ _player.addWalker(-1, 0);
+ int maxSteps = _vm->getRandomNumber(3, 7);
+ for (int i = 0; i < maxSteps; i++)
+ _player.addWalker(2, 0);
+ _player.addWalker(1, 0);
+ _player.addWalker(0, 0);
+ }
+ break;
+
+ default:
+ break;
+ }
}
void GamePhantom::synchronize(Common::Serializer &s, bool phase1) {
@@ -193,6 +827,121 @@ void GamePhantom::synchronize(Common::Serializer &s, bool phase1) {
}
}
+void GamePhantom::enterCatacombs(bool val) {
+ setupCatacombs();
+
+ int var4, var2;
+ if (_scene._currentSceneId == 409) {
+ if (val) {
+ var4 = _globals[kCatacombs409b];
+ var2 = _globals[kCatacombs409bFrom];
+ } else {
+ var4 = _globals[kCatacombs409a];
+ var2 = _globals[kCatacombs409aFrom];
+ }
+ } else if (_scene._currentSceneId == 501) {
+ var4 = _globals[kCatacombs501];
+ var2 = _globals[kCatacombs501From];
+ } else {
+ var4 = _globals[kCatacombs309];
+ var2 = _globals[kCatacombs309From];
+ }
+
+ newCatacombRoom(var4, var2);
+}
+
+void GamePhantom::initCatacombs() {
+ _globals[kCatacombsRoom] = _globals[kCatacombsNextRoom];
+}
+
+void GamePhantom::setupCatacombs() {
+ switch (_difficulty) {
+ case DIFFICULTY_EASY:
+ _catacombs = _easyCatacombs;
+ _catacombSize = 32;
+
+ _globals[kCatacombs309] = 2;
+ _globals[kCatacombs309From] = 3;
+ _globals[kCatacombs409a] = 30;
+ _globals[kCatacombs409aFrom] = 0;
+ _globals[kCatacombs409b] = 31;
+ _globals[kCatacombs409bFrom] = 2;
+ _globals[kCatacombs501] = 31;
+ _globals[kCatacombs501From] = 0;
+ break;
+
+ case DIFFICULTY_MEDIUM:
+ // TODO: FIXME. Do we need to set something here?
+ break;
+
+ case DIFFICULTY_HARD:
+ _catacombs = _hardCatacombs;
+ _catacombSize = 62;
+
+ _globals[kCatacombs309] = 2;
+ _globals[kCatacombs309From] = 3;
+ _globals[kCatacombs409a] = 37;
+ _globals[kCatacombs409aFrom] = 0;
+ _globals[kCatacombs409b] = 39;
+ _globals[kCatacombs409bFrom] = 2;
+ _globals[kCatacombs501] = 56;
+ _globals[kCatacombs501From] = 1;
+ break;
+ }
+}
+
+int GamePhantom::exitCatacombs(int dir) {
+ assert(_globals[kCatacombsRoom] == CLIP(_globals[kCatacombsRoom], 0, _catacombSize - 1));
+ assert(dir == CLIP(dir, 0, 3));
+
+ return (_catacombs[_globals[kCatacombsRoom]]._exit[dir]);
+}
+
+void GamePhantom::moveCatacombs(int dir) {
+ assert(_globals[kCatacombsRoom] == CLIP(_globals[kCatacombsRoom], 0, _catacombSize - 1));
+ assert(dir == CLIP(dir, 0, 3));
+
+ newCatacombRoom(_catacombs[_globals[kCatacombsRoom]]._fromDirection[dir], _catacombs[_globals[kCatacombsRoom]]._exit[dir]);
+}
+
+void GamePhantom::newCatacombRoom(int toRoom, int fromExit) {
+ _globals[kCatacombsNextRoom] = toRoom;
+ _globals[kCatacombsFrom] = fromExit & 0x03;
+ _globals[kCatacombsFlag] = fromExit & 0xFC;
+
+ int newSceneNum = -1;
+
+ if (toRoom < 0) {
+ switch (toRoom) {
+ case -5:
+ newSceneNum = 501;
+ break;
+
+ case -4:
+ case -3:
+ newSceneNum = 409;
+ break;
+
+ case -2:
+ newSceneNum = 309;
+ break;
+
+ default:
+ error("Unexpected room in newCatacombRoom");
+ }
+ } else {
+ newSceneNum = _catacombs[toRoom]._sceneNum;
+ _globals[81] = _catacombs[toRoom]._flags;
+ }
+
+ if (_triggerSetupMode == SEQUENCE_TRIGGER_PREPARE) {
+ _player._walkOffScreenSceneId = newSceneNum;
+ } else {
+ _scene._reloadSceneFlag = true;
+ _scene._nextSceneId = newSceneNum;
+ }
+}
+
} // End of namespace Phantom
} // End of namespace MADS
diff --git a/engines/mads/phantom/game_phantom.h b/engines/mads/phantom/game_phantom.h
index 44b2321f42..2f0204f331 100644
--- a/engines/mads/phantom/game_phantom.h
+++ b/engines/mads/phantom/game_phantom.h
@@ -32,8 +32,9 @@ namespace MADS {
namespace Phantom {
-// TODO: Adapt for Phantom's difficulty setting
-enum StoryMode { STORYMODE_NAUGHTY = 1, STORYMODE_NICE = 2 };
+enum Difficulty {
+ DIFFICULTY_HARD = 1, DIFFICULTY_MEDIUM = 2, DIFFICULTY_EASY = 3
+};
enum InventoryObject {
OBJ_NONE = -1,
@@ -64,8 +65,40 @@ enum InventoryObject {
OBJ_OAR = 24
};
+enum MazeEvent {
+ MAZE_EVENT_NONE = 0,
+ MAZE_EVENT_PUDDLE = 0x0001,
+ MAZE_EVENT_RAT_NEST = 0x0002,
+ MAZE_EVENT_SKULL = 0x0004,
+ MAZE_EVENT_POT = 0x0008,
+ MAZE_EVENT_BRICK = 0x0010,
+ MAZE_EVENT_HOLE = 0x0020,
+ MAZE_EVENT_WEB = 0x0040,
+ MAZE_EVENT_PLANK = 0x0080,
+ MAZE_EVENT_DRAIN = 0x0100,
+ MAZE_EVENT_STONE = 0x0200,
+ MAZE_EVENT_BLOCK = 0x0400,
+ MAZE_EVENT_FALLEN_BLOCK = 0x0800
+};
+
+struct Catacombs {
+ int _sceneNum;
+ int _exit[4];
+ int _fromDirection[4];
+ int _flags;
+};
+
class GamePhantom : public Game {
friend class Game;
+
+private:
+ void genericObjectExamine();
+ void stopWalker();
+ void stopWalkerBasic();
+
+ Catacombs *_catacombs;
+ int _catacombSize;
+
protected:
GamePhantom(MADSEngine *vm);
@@ -78,7 +111,8 @@ protected:
virtual void checkShowDialog();
public:
PhantomGlobals _globals;
- StoryMode _storyMode;
+ Difficulty _difficulty;
+
virtual Globals &globals() { return _globals; }
@@ -89,20 +123,25 @@ public:
virtual void step();
virtual void synchronize(Common::Serializer &s, bool phase1);
-};
+ void setupCatacombs();
+ void enterCatacombs(bool val);
+ void initCatacombs();
+ void moveCatacombs(int dir);
+ int exitCatacombs(int dir);
+ void newCatacombRoom(int fromRoom, int fromExit);
+};
+// Section handlers aren't needed in ScummVM implementation
class Section1Handler : public SectionHandler {
public:
Section1Handler(MADSEngine *vm) : SectionHandler(vm) {}
- // TODO: Properly implement handler methods
virtual void preLoadSection() {}
virtual void sectionPtr2() {}
virtual void postLoadSection() {}
};
-// TODO: Properly implement handler classes
typedef Section1Handler Section2Handler;
typedef Section1Handler Section3Handler;
typedef Section1Handler Section4Handler;
diff --git a/engines/mads/phantom/globals_phantom.cpp b/engines/mads/phantom/globals_phantom.cpp
index e0db0a1bb0..eea84762fe 100644
--- a/engines/mads/phantom/globals_phantom.cpp
+++ b/engines/mads/phantom/globals_phantom.cpp
@@ -28,12 +28,12 @@ namespace MADS {
namespace Phantom {
-PhantomGlobals::PhantomGlobals()
- : Globals() {
+PhantomGlobals::PhantomGlobals() : Globals() {
// Initialize lists
resize(210);
_spriteIndexes.resize(30);
_sequenceIndexes.resize(30);
+ _animationIndexes.resize(30);
}
void PhantomGlobals::synchronize(Common::Serializer &s) {
@@ -41,6 +41,7 @@ void PhantomGlobals::synchronize(Common::Serializer &s) {
_spriteIndexes.synchronize(s);
_sequenceIndexes.synchronize(s);
+ _animationIndexes.synchronize(s);
}
diff --git a/engines/mads/phantom/globals_phantom.h b/engines/mads/phantom/globals_phantom.h
index c23b53cdf5..f120df3c47 100644
--- a/engines/mads/phantom/globals_phantom.h
+++ b/engines/mads/phantom/globals_phantom.h
@@ -99,9 +99,20 @@ enum GlobalId {
// Section #4 Variables
kCatacombsRoom = 80,
- // TODO
+ kCatacombsMisc = 81,
+ kCatacombsFlag = 82,
+ kCatacombsFrom = 83,
+ kCatacombs309 = 84,
+ kCatacombs409a = 85,
+ kCatacombs409b = 86,
+ kCatacombs501 = 87,
+ kCatacombs309From = 88,
+ kCatacombs409aFrom = 89,
+ kCatacombs409bFrom = 90,
+ kCatacombs501From = 91,
+ kCatacombsNextRoom = 92,
kDoorIn409IsOpen = 93,
- kUnknown = 94, // TODO
+ kPriestPistonPuke = 94,
kCobwebIsCut = 95,
// Section #5 Variables
@@ -124,6 +135,7 @@ class PhantomGlobals : public Globals {
public:
SynchronizedList _spriteIndexes;
SynchronizedList _sequenceIndexes;
+ SynchronizedList _animationIndexes;
public:
/**
* Constructor
diff --git a/engines/mads/phantom/phantom_scenes.cpp b/engines/mads/phantom/phantom_scenes.cpp
index f7f4d154df..f7a7153fbe 100644
--- a/engines/mads/phantom/phantom_scenes.cpp
+++ b/engines/mads/phantom/phantom_scenes.cpp
@@ -29,6 +29,10 @@
#include "mads/phantom/game_phantom.h"
#include "mads/phantom/phantom_scenes.h"
#include "mads/phantom/phantom_scenes1.h"
+#include "mads/phantom/phantom_scenes2.h"
+#include "mads/phantom/phantom_scenes3.h"
+#include "mads/phantom/phantom_scenes4.h"
+#include "mads/phantom/phantom_scenes5.h"
namespace MADS {
@@ -37,8 +41,9 @@ namespace Phantom {
SceneLogic *SceneFactory::createScene(MADSEngine *vm) {
Scene &scene = vm->_game->_scene;
- // TODO
- //scene.addActiveVocab(NOUN_DROP);
+ // When changing from one section to the other, set the scaling velocity
+ if ((scene._nextSceneId / 100) != (scene._priorSceneId / 100))
+ vm->_game->_player._scalingVelocity = true;
switch (scene._nextSceneId) {
// Scene group #1 (theater, stage and dressing rooms)
@@ -47,107 +52,107 @@ SceneLogic *SceneFactory::createScene(MADSEngine *vm) {
case 102: // music stands
return new Scene102(vm);
case 103: // below stage
- return new DummyScene(vm); // TODO
+ return new Scene103(vm);
case 104: // stage
- return new DummyScene(vm); // TODO
+ return new Scene104(vm);
case 105: // ground floor, storage room
- return new DummyScene(vm); // TODO
+ return new Scene105(vm);
case 106: // behind stage
- return new DummyScene(vm); // TODO
+ return new Scene106(vm);
case 107: // stage right wing
- return new DummyScene(vm); // TODO
+ return new Scene107(vm);
case 108: // stage left wing
- return new DummyScene(vm); // TODO
+ return new Scene108(vm);
case 109: // upper floor, staircase
- return new DummyScene(vm); // TODO
+ return new Scene109(vm);
case 110: // outside dressing rooms 1
- return new DummyScene(vm); // TODO
+ return new Scene110(vm);
case 111: // outside dressing rooms 2
- return new DummyScene(vm); // TODO
+ return new Scene111(vm);
case 112: // inside dressing room 1
- return new DummyScene(vm); // TODO
+ return new Scene112(vm);
case 113: // inside dressing room 2
- return new DummyScene(vm); // TODO
+ return new Scene113(vm);
case 114: // lower floor, storage room
- return new DummyScene(vm); // TODO
+ return new Scene114(vm);
case 150: // cutscene
- return new DummyScene(vm); // TODO
+ return new Scene150(vm);
// Scene group #2 (theater entrance, offices, balcony)
case 201: // entrance / ticket office
- return new DummyScene(vm); // TODO
+ return new Scene201(vm);
case 202: // outside offices / paintings room
- return new DummyScene(vm); // TODO
+ return new Scene202(vm);
case 203: // office
- return new DummyScene(vm); // TODO
+ return new Scene203(vm);
case 204: // library
- return new DummyScene(vm); // TODO
+ return new Scene204(vm);
case 205: // upper floor, outside balcony boxes
- return new DummyScene(vm); // TODO
+ return new Scene205(vm);
case 206: // balcony box #1
- return new DummyScene(vm); // TODO
+ return new Scene206(vm);
case 207: // balcony box #2
- return new DummyScene(vm); // TODO
+ return new Scene207(vm);
case 208: // stage and balcony view
- return new DummyScene(vm); // TODO
+ return new Scene208(vm);
case 250: // cutscene
- return new DummyScene(vm); // TODO
+ return new Scene250(vm);
// Scene group #3 (catwalks, chandelier, lake / catacombs entrance)
case 301: // catwalk #1 above stage
- return new DummyScene(vm); // TODO
+ return new Scene301(vm);
case 302: // catwalk #2 above stage
- return new DummyScene(vm); // TODO
+ return new Scene302(vm);
case 303: // above chandelier
- return new DummyScene(vm); // TODO
+ return new Scene303(vm);
case 304: // chandelier
- return new DummyScene(vm); // TODO
+ return new Scene304(vm);
case 305: // chandelier fight, phantom closeup
- return new DummyScene(vm); // TODO
+ return new Scene305(vm);
case 306: // chandelier #2
- return new DummyScene(vm); // TODO
+ return new Scene306(vm);
case 307: // catwalk #3 above stage
- return new DummyScene(vm); // TODO
+ return new Scene307(vm);
case 308: // hidden staircase behind balcony box
- return new DummyScene(vm); // TODO
+ return new Scene308(vm);
case 309: // lake and archway
- return new DummyScene(vm); // TODO
+ return new Scene309(vm);
case 310: // lake
- return new DummyScene(vm); // TODO
+ return new Scene310(vm);
// Scene group #4 (labyrinth)
case 401: // labyrinth room, 3 exits
- return new DummyScene(vm); // TODO
+ return new Scene401(vm);
case 403: // labyrinth room (big), 4 exits + 1 bricked door, left
- return new DummyScene(vm); // TODO
+ return new Scene403(vm);
case 404: // labyrinth room, 3 exits
- return new DummyScene(vm); // TODO
+ return new Scene404(vm);
case 406: // labyrinth room, 2 exits
- return new DummyScene(vm); // TODO
+ return new Scene406(vm);
case 407: // catacomb room / lake
- return new DummyScene(vm); // TODO
+ return new Scene407(vm);
case 408: // catacomb corridor
- return new DummyScene(vm); // TODO
+ return new Scene408(vm);
case 409: // catacomb room, door with switch panel
- return new DummyScene(vm); // TODO
+ return new Scene409(vm);
case 410: // skull switch panel
- return new DummyScene(vm); // TODO
+ return new Scene410(vm);
case 453: // Labyrinth room (big), 4 exits + 1 bricked door, right
- return new DummyScene(vm); // TODO
+ return new Scene453(vm);
case 456: // Labyrinth room, 2 exits
- return new DummyScene(vm); // TODO
+ return new Scene456(vm);
// Scene group #5 (Phantom's hideout)
case 501: // catacombs, outside phantom's hideout, lake and boat
- return new DummyScene(vm); // TODO
+ return new Scene501(vm);
case 502: // push panel trap
- return new DummyScene(vm); // TODO
+ return new Scene502(vm);
case 504: // Phantom's hideout, church organ
- return new DummyScene(vm); // TODO
+ return new Scene504(vm);
case 505: // Phantom's hideout, sarcophagus
- return new DummyScene(vm); // TODO
+ return new Scene505(vm);
case 506: // catacomb room with ramp
- return new DummyScene(vm); // TODO
+ return new Scene506(vm);
default:
error("Invalid scene %d called", scene._nextSceneId);
@@ -170,12 +175,12 @@ Common::String PhantomScene::formAnimName(char sepChar, int suffixNum) {
/*------------------------------------------------------------------------*/
void SceneInfoPhantom::loadCodes(MSurface &depthSurface, int variant) {
- // The intro scenes do not have any codes
- if (_sceneId >= 900)
+ Common::String ext = Common::String::format(".WW%d", variant);
+ Common::String fileName = Resources::formatName(RESPREFIX_RM, _sceneId, ext);
+ if (!Common::File::exists(fileName))
return;
- Common::String ext = Common::String::format(".WW%d", variant);
- File f(Resources::formatName(RESPREFIX_RM, _sceneId, ext));
+ File f(fileName);
MadsPack codesPack(&f);
Common::SeekableReadStream *stream = codesPack.getItemStream(0);
diff --git a/engines/mads/phantom/phantom_scenes.h b/engines/mads/phantom/phantom_scenes.h
index c0a823ae06..a6a8395a2c 100644
--- a/engines/mads/phantom/phantom_scenes.h
+++ b/engines/mads/phantom/phantom_scenes.h
@@ -46,13 +46,19 @@ enum Verb {
VERB_CLOSE = 0xB,
VERB_THROW = 0xC,
VERB_WALK_TO = 0xD,
+ VERB_ATTACK = 0x14,
VERB_CLIMB_DOWN = 0x21,
VERB_CLIMB_INTO = 0x22,
VERB_CLIMB_THROUGH = 0x23,
+ VERB_EXIT = 0x34,
VERB_EXIT_TO = 0x37,
VERB_JUMP_INTO = 0x53,
+ VERB_LASSO = 0x59,
+ VERB_LOCK = 0x5D,
VERB_LOOK_AT = 0x60,
VERB_LOOK_THROUGH = 0x61,
+ VERB_READ = 0x7A,
+ VERB_REMOVE = 0x7C,
VERB_TURN_OFF = 0x95,
VERB_TURN_ON = 0x96,
VERB_UNLOCK = 0x97,
@@ -60,9 +66,18 @@ enum Verb {
VERB_WALK_DOWN = 0x9A,
VERB_WALK_THROUGH = 0x9B,
VERB_WALK_UP = 0x9C,
+ VERB_WEAR = 0xA1,
VERB_CLIMB_UP = 0xA5,
VERB_WALK_ONTO = 0xA6,
- VERB_WALK = 0xA7
+ VERB_WALK = 0xA7,
+ VERB_ENTER = 0xEC,
+ VERB_WALK_BEHIND = 0xF3,
+ VERB_CLIMB = 0x120,
+ VERB_ATTACH = 0x131,
+ VERB_GRAPPLE = 0x133,
+ VERB_SIT_ON = 0x138,
+ VERB_SIT_IN = 0x13A,
+ VERB_WALK_DOWN_STAIRS_TO = 0x153
};
enum Noun {
@@ -74,7 +89,6 @@ enum Noun {
NOUN_ACT_CURTAIN = 0x11,
NOUN_AISLE = 0x12,
NOUN_APRON = 0x13,
- NOUN_ATTACK = 0x14,
NOUN_BACKSTAGE = 0x15,
NOUN_BEAR_PROP = 0x16,
NOUN_BLUE_FRAME = 0x17,
@@ -103,7 +117,6 @@ enum Noun {
NOUN_DRESSING_TABLE = 0x31,
NOUN_ELEPHANT_PROP = 0x32,
NOUN_ENVELOPE = 0x33,
- NOUN_EXIT = 0x34,
NOUN_EXIT_DOWN = 0x35,
NOUN_EXIT_SIGN = 0x36,
NOUN_EXIT_TO_BACKSTAGE = 0x38,
@@ -138,11 +151,9 @@ enum Noun {
NOUN_LAMP = 0x56,
NOUN_LANTERN = 0x57,
NOUN_LARGE_NOTE = 0x58,
- NOUN_LASSO = 0x59,
NOUN_LEG = 0x5A,
NOUN_LETTER = 0x5B,
NOUN_LIGHT_FIXTURE = 0x5C,
- NOUN_LOCK = 0x5D,
NOUN_LOCKING_RAIL = 0x5E,
NOUN_LOCKRAIL = 0x5F,
NOUN_MANNEQUINS = 0x62,
@@ -169,9 +180,7 @@ enum Noun {
NOUN_PROSCENIUM_ARCH = 0x77,
NOUN_PURCHASE_LINES = 0x78,
NOUN_RAILING = 0x79,
- NOUN_READ = 0x7A,
NOUN_RED_FRAME = 0x7B,
- NOUN_REMOVE = 0x7C,
NOUN_ROPE = 0x7D,
NOUN_RUG = 0x7E,
NOUN_SANDBAG = 0x7F,
@@ -201,7 +210,6 @@ enum Noun {
NOUN_WARDROBE = 0x9E,
NOUN_WASTE_BASKET = 0x9F,
NOUN_WATER_PIPE = 0xA0,
- NOUN_WEAR = 0xA1,
NOUN_WEDDING_RING = 0xA2,
NOUN_YELLOW_FRAME = 0xA3,
NOUN_PROP = 0xA4,
@@ -273,14 +281,12 @@ enum Noun {
NOUN_DECORATIVE_VASE = 0xE9,
NOUN_MARBLE_COLUMN = 0xEA,
NOUN_BOX_FIVE = 0xEB,
- NOUN_ENTER = 0xEC,
NOUN_BOX_SIX = 0xED,
NOUN_BOX_SEVEN = 0xEE,
NOUN_BOX_EIGHT = 0xEF,
NOUN_BOX_NINE = 0xF0,
NOUN_STEP = 0xF1,
NOUN_PANEL = 0xF2,
- NOUN_WALK_BEHIND = 0xF3,
NOUN_MIDDLE_DOORWAY = 0xF4,
NOUN_LIGHT = 0xF5,
NOUN_CANDLE = 0xF6,
@@ -325,7 +331,6 @@ enum Noun {
NOUN_MIDDLE_LEVEL = 0x11D,
NOUN_LOWER_LEVEL = 0x11E,
NOUN_LADDER = 0x11F,
- NOUN_CLIMB = 0x120,
NOUN_CHANDELIER_TRAP = 0x121,
NOUN_PIECE_OF_WOOD = 0x122,
NOUN_CUT_HEMP = 0x123,
@@ -342,16 +347,12 @@ enum Noun {
NOUN_MONSIEUR_RICHARD = 0x12E,
NOUN_JULIE2 = 0x12F,
NOUN_CABLE_HOOK = 0x130,
- NOUN_ATTACH = 0x131,
NOUN_ROPE_WITH_HOOK = 0x132,
- NOUN_GRAPPLE = 0x133,
NOUN_OAR = 0x134,
NOUN_ORGAN = 0x135,
NOUN_SIT_AT = 0x136,
NOUN_ORGAN_BENCH = 0x137,
- NOUN_SIT_ON = 0x138,
NOUN_LARGE_CHAIR = 0x139,
- NOUN_SIT_IN = 0x13A,
NOUN_SARCOPHAGUS = 0x13B,
NOUN_SKULL = 0x13C,
NOUN_SKULLS = 0x13D,
@@ -376,7 +377,6 @@ enum Noun {
NOUN_BOX_TEN = 0x150,
NOUN_FOYER = 0x151,
NOUN_WALK_DOWN_STAIRCASE = 0x152,
- NOUN_WALK_DOWN_STAIRS_TO = 0x153,
NOUN_HAT_RACK = 0x154,
NOUN_VASE = 0x155,
NOUN_CLOTHES_DUMMY = 0x156,
@@ -484,20 +484,7 @@ protected:
SceneInfoPhantom(MADSEngine *vm) : SceneInfo(vm) {}
};
-// TODO: Temporary, remove once implemented properly
-class DummyScene : public PhantomScene {
-public:
- DummyScene(MADSEngine *vm) : PhantomScene(vm) {
- warning("Unimplemented scene");
- }
-
- virtual void setup() {}
- virtual void enter() {}
- virtual void actions() {}
-};
-
} // End of namespace Phantom
-
} // End of namespace MADS
#endif /* MADS_PHANTOM_SCENES_H */
diff --git a/engines/mads/phantom/phantom_scenes1.cpp b/engines/mads/phantom/phantom_scenes1.cpp
index 2d991fd3bc..c86d2852c7 100644
--- a/engines/mads/phantom/phantom_scenes1.cpp
+++ b/engines/mads/phantom/phantom_scenes1.cpp
@@ -11,7 +11,7 @@
* 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
+ * 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
@@ -22,6 +22,7 @@
#include "common/scummsys.h"
#include "mads/mads.h"
+#include "mads/conversations.h"
#include "mads/scene.h"
#include "mads/phantom/phantom_scenes.h"
#include "mads/phantom/phantom_scenes1.h"
@@ -31,72 +32,284 @@ namespace MADS {
namespace Phantom {
void Scene1xx::setAAName() {
- // TODO
- //int idx = 0;
- //_game._aaName = Resources::formatAAName(idx);
+ _game._aaName = Resources::formatAAName(_globals[kTempInterface]);
+ _vm->_palette->setEntry(254, 43, 47, 51);
}
void Scene1xx::sceneEntrySound() {
- // TODO
+ if (!_vm->_musicFlag)
+ return;
+
+ if (_globals[kDoneBrieConv203] == 3) {
+ _vm->_sound->command(39);
+ } else {
+ switch (_scene->_nextSceneId) {
+ case 101:
+ if (!_game._visitedScenes._sceneRevisited)
+ _vm->_sound->command(38);
+ else
+ _vm->_sound->command(16);
+ break;
+
+ case 102:
+ if (_scene->_priorSceneId == 104)
+ _vm->_sound->command(27);
+ else
+ _vm->_sound->command(16);
+ break;
+
+ case 103:
+ if (_globals[kJacquesStatus] == 2) {
+ _vm->_sound->command(32);
+ _globals[kJacquesStatus] = 3;
+ } else
+ _vm->_sound->command(16);
+ break;
+
+ case 104:
+ if ((_vm->_gameConv->_restoreRunning == 7) || (_scene->_priorSceneId == 301)) {
+ _vm->_sound->command(33);
+ } else if (!_globals[kRoom103104Transition] && !_globals[kObservedPhan104]) {
+ _vm->_sound->command(37);
+ _globals[kObservedPhan104] = true;
+ } else
+ _vm->_sound->command(16);
+ break;
+
+ case 111:
+ if (_scene->_priorSceneId == 150)
+ _vm->_sound->command(38);
+ else if (_globals[kLeaveAngelMusicOn])
+ _vm->_sound->command(34);
+ else
+ _vm->_sound->command(16);
+ break;
+ case 113:
+ if (_globals[kLeaveAngelMusicOn])
+ _vm->_sound->command(34);
+ else if (_globals[kCurrentYear] == 1993)
+ _vm->_sound->command(36);
+ else
+ _vm->_sound->command(35);
+ break;
+
+ default:
+ if ((_scene->_priorSceneId != 204) && (_scene->_nextSceneId != 150))
+ _vm->_sound->command(16);
+ break;
+ }
+ }
+}
+
+void Scene1xx::setPlayerSpritesPrefix() {
+ _vm->_sound->command(5);
+
+ Common::String oldName = _game._player._spritesPrefix;
+
+ if (!_game._player._forcePrefix)
+ _game._player._spritesPrefix = "RAL";
+
+ if (oldName != _game._player._spritesPrefix)
+ _game._player._spritesChanged = true;
+
+ _game._player._scalingVelocity = true;
}
/*------------------------------------------------------------------------*/
Scene101::Scene101(MADSEngine *vm) : Scene1xx(vm) {
-
+ _chanStatus = -1;
+ _wipeStatus = -1;
+ _callingStatus = -1;
+ _chandelierStatus = -1;
+ _callingFrame = -1;
+ _chandelierFrame = -1;
+ _convCounter = 0;
+ _talkCounter = -1;
+ _brieAnimId = 0;
+ _startWalkingFl = false;
+ _startWalking0Fl = false;
+ _anim0Running = false;
+ _anim1Running = false;
+ _startSittingFl = false;
}
void Scene101::synchronize(Common::Serializer &s) {
Scene1xx::synchronize(s);
-
+ s.syncAsSint16LE(_chanStatus);
+ s.syncAsSint16LE(_wipeStatus);
+ s.syncAsSint16LE(_callingStatus);
+ s.syncAsSint16LE(_chandelierStatus);
+ s.syncAsSint16LE(_callingFrame);
+ s.syncAsSint16LE(_chandelierFrame);
+ s.syncAsSint16LE(_convCounter);
+ s.syncAsSint16LE(_talkCounter);
+ s.syncAsSint16LE(_brieAnimId);
+ s.syncAsByte(_startWalkingFl);
+ s.syncAsByte(_startWalking0Fl);
+ s.syncAsByte(_anim0Running);
+ s.syncAsByte(_anim1Running);
+ s.syncAsByte(_startSittingFl);
}
void Scene101::setup() {
- //setPlayerSpritesPrefix();
+ setPlayerSpritesPrefix();
setAAName();
+ _scene->addActiveVocab(NOUN_MONSIEUR_BRIE);
}
void Scene101::enter() {
- // TODO
+ _vm->_disableFastwalk = true;
+
+ if (_scene->_priorSceneId != RETURNING_FROM_DIALOG) {
+ _chanStatus = _wipeStatus = -1;
+ _startWalkingFl = _startWalking0Fl = false;
+ _anim0Running = _anim1Running = false;
+ _startSittingFl = false;
+ }
+
+ // Load Dialogs
+ _vm->_gameConv->get(0);
+ _vm->_gameConv->get(1);
if (_globals[kCurrentYear] == 1993) {
_globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
- // TODO
- //_scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
} else {
- // TODO
+ _scene->_hotspots.activate(NOUN_CHANDELIER, false);
+ }
+
+ if (_globals[kBrieTalkStatus] == 0) {
+ _game._player.firstWalk(Common::Point(-20, 75), FACING_EAST, Common::Point(18, 79), FACING_EAST, true);
+ _callingStatus = 0;
+ _chandelierStatus = 3;
+ _game._player.setWalkTrigger(50);
+
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('b', 9), 1);
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 8), 1);
+
+ _anim0Running = true;
+ _anim1Running = true;
+
+ _brieAnimId = _scene->_dynamicHotspots.add(NOUN_MONSIEUR_BRIE, VERB_WALKTO, SYNTAX_SINGULAR_MASC, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[_brieAnimId]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_brieAnimId, Common::Point(490, 119), FACING_NONE);
+ _scene->setDynamicAnim(_brieAnimId, _globals._animationIndexes[0], 0);
+ _scene->setDynamicAnim(_brieAnimId, _globals._animationIndexes[0], 1);
+ _scene->setDynamicAnim(_brieAnimId, _globals._animationIndexes[0], 2);
+ _scene->setDynamicAnim(_brieAnimId, _globals._animationIndexes[0], 3);
+ _scene->setDynamicAnim(_brieAnimId, _globals._animationIndexes[0], 4);
+
+ int tmpIdx = _scene->_dynamicHotspots.add(NOUN_MONSIEUR_BRIE, VERB_WALKTO, SYNTAX_SINGULAR_MASC, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[tmpIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(tmpIdx, Common::Point(25, 80), FACING_NONE);
+ _scene->setDynamicAnim(tmpIdx, _globals._animationIndexes[1], 1);
+ _scene->setDynamicAnim(tmpIdx, _globals._animationIndexes[1], 2);
+
+ _talkCounter = 0;
+ } else if (_globals[kBrieTalkStatus] == 1) {
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('b', 9), 1);
+ _brieAnimId = _scene->_dynamicHotspots.add(NOUN_MONSIEUR_BRIE, VERB_WALKTO, SYNTAX_SINGULAR_MASC, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[_brieAnimId]._articleNumber = PREP_ON;
+ _scene->setDynamicAnim(_brieAnimId, _globals._animationIndexes[1], 1);
+ _scene->setDynamicAnim(_brieAnimId, _globals._animationIndexes[1], 2);
+ _anim1Running = true;
+ _talkCounter = 0;
+ _chandelierStatus = 3;
+
+ if (_vm->_gameConv->_restoreRunning == 1) {
+ _vm->_gameConv->run(1);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _chandelierStatus = 4;
+ _scene->setAnimFrame(_globals._animationIndexes[1], 25);
+ }
+ } else if (_scene->_priorSceneId == 202) {
+ if (_globals[kJacquesStatus] == 1)
+ _globals[kJacquesStatus] = 2;
+ _game._player.firstWalk(Common::Point(-20, 75), FACING_EAST, Common::Point(18, 79), FACING_EAST, true);
+ } else if ((_scene->_priorSceneId == 102) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player.firstWalk(Common::Point(655, 130), FACING_WEST, Common::Point(625, 127), FACING_WEST, true);
+ _scene->setCamera(Common::Point(320, 0));
}
- // TODO
+ sceneEntrySound();
}
void Scene101::step() {
- // TODO
+ if (_anim0Running)
+ handleAnimation0();
+
+ if ((_globals[kWalkerConverse] == 2) || (_globals[kWalkerConverse] == 3)) {
+ ++_convCounter;
+ if (_convCounter > 200)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+
+ if (_anim1Running) {
+ handleAnimation1();
+
+ if (_scene->getAnimFrame(_globals._animationIndexes[1]) == 80) {
+ _game._player._stepEnabled = true;
+ _game._player.setWalkTrigger(55);
+ }
+ }
+
+ if (_scene->_posAdjust.x > 200 && !_startSittingFl && (_globals[kBrieTalkStatus] != 2)) {
+ _startSittingFl = true;
+ _game._player.walk(Common::Point(490, 119), FACING_NORTHEAST);
+ _game._player._stepEnabled = false;
+ _game._player.setWalkTrigger(55);
+ _chandelierStatus = 4;
+ }
+
+ if (_game._trigger == 55) {
+ _game._player._stepEnabled = true;
+ _vm->_gameConv->run(1);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _chandelierFrame = -1;
+ _talkCounter = 0;
+ }
+
+ if (_game._trigger == 50) {
+ _vm->_gameConv->run(0);
+ _callingStatus = 1;
+ }
}
void Scene101::preActions() {
if (_action.isAction(VERB_EXIT_TO, NOUN_ORCHESTRA_PIT)) {
- // TODO: Handle Brie
- _game._player._walkOffScreenSceneId = 102;
+ if ((_globals[kBrieTalkStatus] == 2) || _startWalkingFl) {
+ _game._player._walkOffScreenSceneId = 102;
+ _globals[kBrieTalkStatus] = 2;
+ } else {
+ _vm->_gameConv->run(0);
+ _game._player._needToWalk = false;
+ }
} else if (_action.isAction(VERB_EXIT_TO, NOUN_GRAND_FOYER)) {
- // TODO: Handle Brie
- _game._player._walkOffScreenSceneId = 202;
- } else if (_action.isAction(VERB_TAKE, NOUN_MONSIEUR_BRIE)) {
- _vm->_dialogs->show(10121);
- } else if (_action.isAction(VERB_TALK_TO, NOUN_MONSIEUR_BRIE)) {
- if (_globals[kBrieTalkStatus] == 2)
+ if ((_globals[kBrieTalkStatus] == 2) || _startWalkingFl)
+ _game._player._walkOffScreenSceneId = 202;
+ else {
+ _vm->_gameConv->run(0);
_game._player._needToWalk = false;
- }
-
- // TODO
+ }
+ } else if (_action.isAction(VERB_TAKE, NOUN_MONSIEUR_BRIE))
+ _vm->_dialogs->show(10121);
+ else if (_action.isAction(VERB_TALK_TO, NOUN_MONSIEUR_BRIE) && (_globals[kBrieTalkStatus] == 2))
+ _game._player._needToWalk = false;
}
void Scene101::actions() {
- // TODO: Brie conversation
-
- // TODO: Look around
-
- if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_vm->_gameConv->_running == 0)
+ handleConversation0();
+ else if (_vm->_gameConv->_running == 1)
+ handleConversation1();
+ else if (_action._lookFlag) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(10110);
+ else
+ _vm->_dialogs->show(10111);
+ } else if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
if (_action.isObject(NOUN_AISLE)) {
_vm->_dialogs->show(10112);
} else if (_action.isObject(NOUN_CHANDELIER)) {
@@ -106,8 +319,10 @@ void Scene101::actions() {
} else if (_action.isObject(NOUN_SIDE_WALL)) {
_vm->_dialogs->show(10115);
} else if (_action.isObject(NOUN_SEATS)) {
- // TODO: Finish this
- _vm->_dialogs->show(10116);
+ if ((_globals[kBrieTalkStatus] > 1) || _startWalkingFl)
+ _vm->_dialogs->show(10119);
+ else
+ _vm->_dialogs->show(10116);
} else if (_action.isObject(NOUN_GRAND_FOYER)) {
_vm->_dialogs->show(10117);
} else if (_action.isObject(NOUN_ORCHESTRA_PIT)) {
@@ -115,64 +330,357 @@ void Scene101::actions() {
} else if (_action.isObject(NOUN_MONSIEUR_BRIE)) {
_vm->_dialogs->show(10120);
}
-
- _game._player._stepEnabled = true;
} else if (_action.isAction(VERB_TALK_TO, NOUN_MONSIEUR_BRIE)) {
if (_globals[kBrieTalkStatus] == 2)
_vm->_dialogs->show(10122);
- _game._player._stepEnabled = true;
- } else if (_action.isAction(VERB_TAKE, NOUN_MONSIEUR_BRIE)) {
- _game._player._stepEnabled = true;
+ } else if (!_action.isAction(VERB_TAKE, NOUN_MONSIEUR_BRIE))
+ return;
+
+ _action._inProgress = false;
+}
+
+void Scene101::handleConversation0() {
+ _vm->_gameConv->setHeroTrigger(90);
+
+ if (_game._trigger == 90) {
+ _globals[kBrieTalkStatus] = 1;
+ _startWalking0Fl = true;
+ }
+}
+
+void Scene101::handleConversation1() {
+ if ((_action._activeAction._verbId >= 0) && (_action._activeAction._verbId <= 27)) {
+ bool interlocutorFl = false;
+
+ if (_game._trigger == 60) {
+ switch (_action._activeAction._verbId) {
+ case 0:
+ _chandelierStatus = 6;
+ _wipeStatus = 2;
+ break;
+
+ case 1:
+ _chandelierStatus = 2;
+ _chanStatus = 9;
+ break;
+
+ case 4:
+ _chandelierStatus = 0;
+ _chanStatus = -1;
+ _wipeStatus = -1;
+ break;
+
+ case 8:
+ case 10:
+ case 18:
+ case 22:
+ case 24:
+ _startWalkingFl = true;
+ _chanStatus = -1;
+ _wipeStatus = -1;
+ _globals[kWalkerConverse] = 0;
+ _vm->_gameConv->setInterlocutorTrigger(105);
+ interlocutorFl = true;
+ break;
+
+ case 12:
+ _chandelierStatus = 5;
+ _chanStatus = -1;
+ _wipeStatus = -1;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(60);
+
+ _vm->_gameConv->setHeroTrigger(70);
+
+ _talkCounter = 0;
+
+ if (_game._trigger == 60) {
+ if (!_startWalkingFl)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+
+ _chandelierStatus = 2;
+ } else if ((_game._trigger == 70) && !_startWalkingFl) {
+ _chandelierStatus = 4;
+ _chanStatus = -1;
+ _wipeStatus = -1;
+ if (!_startWalkingFl)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(2, 3);
+
+ _convCounter = 0;
+ }
+ }
+}
+
+void Scene101::handleAnimation0() {
+ if (_scene->getAnimFrame(_globals._animationIndexes[0]) == _callingFrame)
+ return;
+
+ _callingFrame = _scene->getAnimFrame(_globals._animationIndexes[0]);
+ int resetFrame = -1;
+ switch (_callingFrame) {
+ case 1:
+ case 9:
+ case 12:
+ if (_callingStatus == 1) {
+ if (_callingFrame == 9) {
+ if (_startWalking0Fl) {
+ resetFrame = 13;
+ _callingStatus = 3;
+ } else
+ _callingStatus = 2;
+ } else
+ resetFrame = 1;
+ }
+
+ if (_callingStatus == 0) {
+ if (_startWalking0Fl) {
+ resetFrame = 60;
+ _callingStatus = 3;
+ } else
+ resetFrame = 0;
+ }
+
+ if (_callingStatus == 2) {
+ if (_startWalking0Fl) {
+ resetFrame = 13;
+ _callingStatus = 3;
+ } else {
+ ++_talkCounter;
+
+ if (_talkCounter < 18) {
+ if (_vm->getRandomNumber(1, 2) == 1)
+ resetFrame = 7;
+ else
+ resetFrame = 10;
+ } else {
+ resetFrame = 54;
+ _callingStatus = 0;
+ }
+ }
+ }
+ break;
+
+ case 53:
+ _anim0Running = false;
+ _scene->freeAnimation(0);
+ break;
+
+ case 59:
+ if (_startWalking0Fl) {
+ resetFrame = 60;
+ _callingStatus = 3;
+ } else {
+ resetFrame = 0;
+ _callingStatus = 0;
+ }
+ break;
+
+ case 66:
+ resetFrame = 24;
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _callingFrame = resetFrame;
+ }
+}
+
+void Scene101::handleAnimation1() {
+ if (_scene->getAnimFrame(_globals._animationIndexes[1]) == _chandelierFrame)
+ return;
+
+ _chandelierFrame = _scene->getAnimFrame(_globals._animationIndexes[1]);
+ int resetFrame = -1;
+ switch (_chandelierFrame) {
+ case 1:
+ if (_chandelierStatus == 3)
+ resetFrame = 0;
+ break;
+
+ case 11:
+ case 14:
+ case 17:
+ case 19:
+ case 26:
+ case 44:
+ case 333:
+ if (_talkCounter == _chanStatus) {
+ _chandelierStatus = 0;
+ ++_talkCounter;
+ _chanStatus = -1;
+ }
+
+ if (_talkCounter == _wipeStatus) {
+ _chandelierStatus = 6;
+ ++_talkCounter;
+ _wipeStatus = -1;
+ }
+
+ if (_startWalkingFl) {
+ if (_vm->_gameConv->_running == 1) {
+ if (_talkCounter > 13)
+ _chandelierStatus = 1;
+ } else
+ _chandelierStatus = 1;
+ }
+
+ switch (_chandelierStatus) {
+ case 0:
+ resetFrame = 27;
+ _chandelierStatus = 2;
+ break;
+
+ case 1:
+ _globals[kBrieTalkStatus] = 2;
+ resetFrame = 45;
+ if (_vm->_gameConv->_running == 1)
+ _vm->_gameConv->stop();
+ _scene->_dynamicHotspots.remove(_brieAnimId);
+ _game._player._stepEnabled = false;
+ break;
+
+ case 2:
+ ++_talkCounter;
+ if (_talkCounter < 15) {
+ switch (_vm->getRandomNumber(1, 3)) {
+ case 1:
+ resetFrame = 12;
+ break;
+
+ case 2:
+ resetFrame = 14;
+ break;
+
+ case 3:
+ resetFrame = 17;
+ }
+ } else {
+ _chandelierStatus = 4;
+ resetFrame = 25;
+ }
+ break;
+
+ case 4:
+ resetFrame = 25;
+ break;
+
+ case 5:
+ resetFrame = 21;
+ _chandelierStatus = 2;
+ break;
+
+ case 6:
+ resetFrame = 316;
+ _chandelierStatus = 2;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 315:
+ _scene->freeAnimation(1);
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _chandelierFrame = resetFrame;
}
}
/*------------------------------------------------------------------------*/
Scene102::Scene102(MADSEngine *vm) : Scene1xx(vm) {
- _animRunningFl = false;
+ _anim0Running = false;
}
void Scene102::synchronize(Common::Serializer &s) {
Scene1xx::synchronize(s);
- s.syncAsByte(_animRunningFl);
+ s.syncAsByte(_anim0Running);
}
void Scene102::setup() {
- //setPlayerSpritesPrefix();
+ setPlayerSpritesPrefix();
setAAName();
}
void Scene102::enter() {
- _animRunningFl = false;
+ _anim0Running = false;
_globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0));
_globals._spriteIndexes[3] = _scene->_sprites.addSprites("*RAL86");
if (_globals[kCurrentYear] == 1993) {
_globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
- // TODO
- //_scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
} else {
- // TODO
+ _scene->_hotspots.activate(NOUN_CHANDELIER, false);
}
if (_scene->_priorSceneId == 101) {
_game._player._playerPos = Common::Point(97, 79);
_game._player._facing = FACING_SOUTHEAST;
- // TODO
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 4);
_game._player.walk(Common::Point(83, 87), FACING_SOUTHEAST);
_scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
} else if (_scene->_priorSceneId == 104) {
// Player fell from pit -> death
- // TODO
- } else if (_scene->_priorSceneId == 103 || _scene->_priorSceneId != -1) {
+ Common::Point deathPos = Common::Point(0, 0);
+ int deathScale = 0;
+ int deathDepth = 0;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+
+ switch (_globals[36]) {
+ case 0:
+ deathPos = Common::Point(221, 57);
+ deathScale = 50;
+ deathDepth = 14;
+ break;
+
+ case 1:
+ deathPos = Common::Point(219, 85);
+ deathScale = 60;
+ deathDepth = 6;
+ break;
+
+ case 2:
+ deathPos = Common::Point(257, 138);
+ deathScale = 76;
+ deathDepth = 1;
+ break;
+
+ default:
+ break;
+ }
+ _scene->_userInterface.emptyConversationList();
+ _scene->_userInterface.setup(kInputConversation);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], deathDepth);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], deathPos);
+ _scene->_sequences.setScale(_globals._sequenceIndexes[3], deathScale);
+ _scene->_sequences.addTimer(120, 65);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 4);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ } else if (_scene->_priorSceneId == 103 || _scene->_priorSceneId != RETURNING_FROM_LOADING) {
_game._player._playerPos = Common::Point(282, 145);
_game._player._facing = FACING_WEST;
- _animRunningFl = true;
- // TODO: Door closing animation
+ _anim0Running = true;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 1), 60);
} else if (_scene->_priorSceneId == -1) {
- // TODO
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 4);
_scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
}
@@ -180,52 +688,56 @@ void Scene102::enter() {
}
void Scene102::step() {
- if (_game._trigger == 60) { // Door closes
- // TODO
- _animRunningFl = false;
- } else if (_game._trigger == 65) { // Death
- // TODO
- _scene->_currentSceneId = 104;
+ if (_game._trigger == 60) {
+ // Door closes
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 4);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ _anim0Running = false;
+ } else if (_game._trigger == 65) {
+ // Death
+ if (_globals[kDeathLocation] == 0)
+ _vm->_dialogs->show(10232);
+ else
+ _vm->_dialogs->show(10229);
+
+ _vm->_sound->command(16);
+ _scene->_nextSceneId = 104;
}
}
void Scene102::preActions() {
- if (_action.isAction(VERB_OPEN, NOUN_ORCHESTRA_DOOR) || _action.isAction(VERB_PUSH, NOUN_ORCHESTRA_DOOR)) {
+ if (_action.isAction(VERB_OPEN, NOUN_ORCHESTRA_DOOR) || _action.isAction(VERB_PUSH, NOUN_ORCHESTRA_DOOR))
_game._player.walk(Common::Point(282, 145), FACING_EAST);
- }
}
void Scene102::actions() {
if (_action.isAction(VERB_WALK_DOWN, NOUN_AISLE)) {
_scene->_nextSceneId = 101;
- _game._player._stepEnabled = true;
- }
-
- if (_action.isAction(VERB_WALK_THROUGH, NOUN_ORCHESTRA_DOOR) ||
+ } else if (_action.isAction(VERB_WALK_THROUGH, NOUN_ORCHESTRA_DOOR) ||
_action.isAction(VERB_PUSH, NOUN_ORCHESTRA_DOOR) ||
_action.isAction(VERB_OPEN, NOUN_ORCHESTRA_DOOR)) {
- if (_animRunningFl) {
- // TODO
+ if (_anim0Running) {
+ _scene->_sequences.addTimer(15, 70);
+ _game._player._stepEnabled = false;
} else {
- _scene->_nextSceneId = 103; // FIXME: temporary HACK - remove!
-
switch (_game._trigger) {
case 70: // try again
case 0:
- // TODO
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 0), 1);
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
break;
case 1:
_scene->_nextSceneId = 103;
break;
+ default:
+ break;
}
}
-
- _game._player._stepEnabled = true;
- }
-
- // TODO: Look around
-
- if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ } else if (_action._lookFlag)
+ _vm->_dialogs->show(10210);
+ else if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
if (_action.isObject(NOUN_PIT))
_vm->_dialogs->show(10211);
else if (_action.isObject(NOUN_SEATS))
@@ -263,18 +775,8777 @@ void Scene102::actions() {
_vm->_dialogs->show(10227);
else if (_action.isObject(NOUN_CHANDELIER))
_vm->_dialogs->show(10231);
+ } else if (_action.isAction(VERB_CLOSE, NOUN_ORCHESTRA_DOOR))
+ _vm->_dialogs->show(10228);
+
+ _game._player._stepEnabled = false;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene103::Scene103(MADSEngine *vm) : Scene1xx(vm) {
+ _jacquesAction = -1;
+ _lastRandom = -1;
+ _standPosition = -1;
+ _hotspotPrompt1 = -1;
+ _hotspotPrompt2 = -1;
+ _hotspotPrompt3 = -1;
+ _hotspotPrompt4 = -1;
+ _hotspotPrompt5 = -1;
+ _hotspotRightFloor1 = -1;
+ _hotspotRightFloor2 = -1;
+ _hotspotLeftFloor1 = -1;
+ _hotspotLeftFloor2 = -1;
+ _hotspotGentleman = -1;
+ _convCount = -1;
+ _lastStairFrame = -1;
+ _lastJacquesFrame = -1;
+ _talkCount = -1;
+
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ _anim4ActvFl = false;
+ _anim5ActvFl = false;
+ _anim6ActvFl = false;
+ _climbThroughTrapFl = false;
+ _guardFrameFl = false;
+ _sitFl = false;
+}
+
+void Scene103::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+ s.syncAsSint16LE(_jacquesAction);
+ s.syncAsSint16LE(_lastRandom);
+ s.syncAsSint16LE(_standPosition);
+ s.syncAsSint16LE(_hotspotPrompt1);
+ s.syncAsSint16LE(_hotspotPrompt2);
+ s.syncAsSint16LE(_hotspotPrompt3);
+ s.syncAsSint16LE(_hotspotPrompt4);
+ s.syncAsSint16LE(_hotspotPrompt5);
+ s.syncAsSint16LE(_hotspotRightFloor1);
+ s.syncAsSint16LE(_hotspotRightFloor2);
+ s.syncAsSint16LE(_hotspotLeftFloor1);
+ s.syncAsSint16LE(_hotspotLeftFloor2);
+ s.syncAsSint16LE(_convCount);
+ s.syncAsSint16LE(_lastStairFrame);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_anim2ActvFl);
+ s.syncAsByte(_anim3ActvFl);
+ s.syncAsByte(_anim4ActvFl);
+ s.syncAsByte(_anim5ActvFl);
+ s.syncAsByte(_anim6ActvFl);
+ s.syncAsByte(_climbThroughTrapFl);
+ s.syncAsByte(_guardFrameFl);
+ s.syncAsByte(_sitFl);
+}
+
+void Scene103::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->_variant = 0;
+
+ if ((_globals[kPrompterStandStatus] == 1) || (_globals[kCurrentYear] == 1881)) {
+ _scene->_variant = 1;
+ if ((_globals[kJacquesStatus] == 0) && (_globals[kCurrentYear] == 1881))
+ _scene->_variant = 2;
+ else if ((_globals[kJacquesStatus] >= 1) && (_globals[kCurrentYear] == 1881))
+ _scene->_variant = 3;
+ }
+
+ _scene->addActiveVocab(NOUN_PROMPTERS_STAND);
+ _scene->addActiveVocab(NOUN_JACQUES);
+ _scene->addActiveVocab(NOUN_GENTLEMAN);
+ _scene->addActiveVocab(VERB_CLIMB);
+}
+
+void Scene103::enter() {
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ _anim4ActvFl = false;
+ _anim5ActvFl = false;
+ _anim6ActvFl = false;
+ _climbThroughTrapFl = false;
+ _guardFrameFl = false;
+ _sitFl = false;
+ _jacquesAction = 1;
+ _lastRandom = 0;
+ _standPosition = 0;
+ }
+
+ if (_globals[kJacquesStatus] >= 1) {
+ if (_game._objects.isInRoom(OBJ_KEY)) {
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites("*RRD_9");
+ }
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('f', 3));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('c', 1));
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ } else {
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[10] = _scene->_sprites.addSprites(formAnimName('a', 3));
+ }
+
+ _globals._spriteIndexes[9] = _scene->_sprites.addSprites(formAnimName('x', 3));
+ _globals._spriteIndexes[11] = _scene->_sprites.addSprites(formAnimName('a', 2));
+ _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('f', 2));
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites("*RDR_6");
+
+ adjustRails(_scene->_variant);
+
+ _scene->_hotspots.activate(NOUN_JACQUES, false);
+ _scene->_hotspots.activate(NOUN_KEY, false);
+
+ _vm->_gameConv->get(12);
+
+ if (_globals[kTrapDoorStatus] == 0) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, 2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 3);
+ } else if (_globals[kTrapDoorStatus] == 1) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 3);
+ }
+
+ Common::Point promptPos;
+ Facing promptFacing;
+
+ if (_globals[kJacquesStatus] == 0) {
+ promptPos = Common::Point(115, 142);
+ promptFacing = FACING_NORTHEAST;
+ } else {
+ promptPos = Common::Point(171, 142);
+ promptFacing = FACING_NORTHWEST;
+ }
+
+ if ((_globals[kPrompterStandStatus] == 1) || (_globals[kCurrentYear] == 1881)) {
+ if (_globals[kJacquesStatus] >= 1) {
+ _globals._sequenceIndexes[7] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[7], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[7], 1);
+
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 4);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(154, 139));
+
+ } else {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 4);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(154, 139));
+
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 1);
+ }
+
+ _hotspotPrompt1 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(121, 79, 121 + 40, 79 + 63));
+ _scene->_dynamicHotspots[_hotspotPrompt1]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt1, promptPos, promptFacing);
+
+ _hotspotPrompt2 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(161, 67, 161 + 16, 67 + 75));
+ _scene->_dynamicHotspots[_hotspotPrompt2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt2, promptPos, promptFacing);
+
+ _hotspotPrompt3 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(177, 90, 177 + 18, 90 + 52));
+ _scene->_dynamicHotspots[_hotspotPrompt3]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt3, promptPos, promptFacing);
+
+ _hotspotPrompt4 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(114, 100, 114 + 7, 100 + 38));
+ _scene->_dynamicHotspots[_hotspotPrompt4]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt4, promptPos, promptFacing);
+
+ _hotspotPrompt5 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_CLIMB, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(121, 49, 121 + 40, 49 + 30));
+ _scene->_dynamicHotspots[_hotspotPrompt5]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt5, Common::Point(196, 134), FACING_SOUTHWEST);
+ _scene->_dynamicHotspots.setCursor(_hotspotPrompt5, CURSOR_GO_UP);
+
+ _hotspotRightFloor1 = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(154, 6, 154 + 41, 6 + 6));
+ _scene->_dynamicHotspots[_hotspotRightFloor1]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotRightFloor1, Common::Point(171, 142), FACING_NONE);
+
+ _hotspotRightFloor2 = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(114, 136, 114 + 32, 136 + 6));
+ _scene->_dynamicHotspots[_hotspotRightFloor2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotRightFloor2, Common::Point(127, 140), FACING_NONE);
+
+ if ((_globals[kJacquesStatus] == 0) && (_globals[kCurrentYear] == 1881)) {
+ if (_globals[kJacquesNameIsKnown] >= 1) {
+ _hotspotGentleman = _scene->_dynamicHotspots.add(NOUN_JACQUES, VERB_WALKTO, SYNTAX_SINGULAR_MASC, EXT_NONE, Common::Rect(156, 116, 156 + 33, 116 + 31));
+ _scene->_dynamicHotspots[_hotspotGentleman]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotGentleman, Common::Point(206, 148), FACING_NORTHWEST);
+ } else {
+ _hotspotGentleman = _scene->_dynamicHotspots.add(NOUN_GENTLEMAN, VERB_WALKTO, SYNTAX_MASC_NOT_PROPER, -1, Common::Rect(156, 116, 156 + 33, 116 + 31));
+ _scene->_dynamicHotspots[_hotspotGentleman]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotGentleman, Common::Point(206, 148), FACING_NORTHWEST);
+ }
+ int tmpIdx = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(149, 140, 149 + 13, 140 + 7));
+ _scene->_dynamicHotspots[tmpIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(tmpIdx, Common::Point(155, 144), FACING_NONE);
+
+ tmpIdx = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(187, 136, 187 + 8, 136 + 7));
+ _scene->_dynamicHotspots[tmpIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(tmpIdx, Common::Point(195, 139), FACING_NONE);
+ } else if ((_globals[kJacquesStatus] >= 1) && (_globals[kCurrentYear] == 1881)) {
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 3);
+ if (_game._objects.isInRoom(OBJ_KEY)) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+ _scene->_hotspots.activate(NOUN_KEY, true);
+ }
+ _scene->_hotspots.activate(NOUN_JACQUES, true);
+ _scene->_dynamicHotspots.remove(_hotspotRightFloor2);
+
+ int tmpIdx = _scene->_dynamicHotspots.add(NOUN_JACQUES, VERB_WALKTO, SYNTAX_SINGULAR_MASC, EXT_NONE, Common::Rect(114, 132, 114 + 30, 132 + 10));
+ _scene->_dynamicHotspots[tmpIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(tmpIdx, Common::Point(95, 144), FACING_NORTHEAST);
+
+ tmpIdx = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(94, 129, 94 + 18, 129 + 4));
+ _scene->_dynamicHotspots[tmpIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(tmpIdx, Common::Point(95, 133), FACING_NONE);
+
+ tmpIdx = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(94, 132, 94 + 3, 132 + 9));
+ _scene->_dynamicHotspots[tmpIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(tmpIdx, Common::Point(93, 135), FACING_NONE);
+
+ tmpIdx = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(112, 150, 112 + 21, 150 + 3));
+ _scene->_dynamicHotspots[tmpIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(tmpIdx, Common::Point(118, 154), FACING_NONE);
+
+ tmpIdx = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(98, 146, 98 + 21, 146 + 4));
+ _scene->_dynamicHotspots[tmpIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(tmpIdx, Common::Point(104, 148), FACING_NONE);
+ }
+ } else if (_globals[kPrompterStandStatus] == 0) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 4);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(37, 139));
+
+ _hotspotPrompt1 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(2, 79, 2 + 40, 79 + 63));
+ _scene->_dynamicHotspots[_hotspotPrompt1]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt1, Common::Point(59, 140), FACING_NORTHWEST);
+
+ _hotspotPrompt2 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(42, 67, 42 + 16, 67 + 75));
+ _scene->_dynamicHotspots[_hotspotPrompt2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt2, Common::Point(59, 140), FACING_NORTHWEST);
+
+ _hotspotPrompt3 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(58, 90, 58 + 18, 90 + 52));
+ _scene->_dynamicHotspots[_hotspotPrompt3]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt3, Common::Point(59, 140), FACING_NORTHWEST);
+
+ _hotspotPrompt5 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_CLIMB, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(2, 49, 2 + 40, 49 + 30));
+ _scene->_dynamicHotspots[_hotspotPrompt5]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt5, Common::Point(79, 132), FACING_SOUTHWEST);
+ _scene->_dynamicHotspots.setCursor(_hotspotPrompt5, CURSOR_GO_UP);
+
+ _hotspotLeftFloor1 = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(35, 137, 35 + 40, 137 + 5));
+ _scene->_dynamicHotspots[_hotspotLeftFloor1]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotLeftFloor1, Common::Point(59, 140), FACING_NONE);
+ _hotspotLeftFloor2 = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(76, 129, 76 + 6, 129 + 6));
+ _scene->_dynamicHotspots[_hotspotLeftFloor2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotLeftFloor2, Common::Point(80, 135), FACING_NONE);
+ }
+
+ if ((_globals[kJacquesStatus] == 0) && (_globals[kCurrentYear] == 1881)) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('j', 1), 1);
+ _anim0ActvFl = true;
+ _scene->setAnimFrame(_globals._animationIndexes[0], 9);
+ }
+
+ if (_scene->_priorSceneId == 104) {
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ if (_globals[kRoom103104Transition] == 0) {
+ _globals[kRoom103104Transition] = 1;
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 4);
+ _standPosition = 1;
+ _game._player._playerPos = Common::Point(79, 132);
+ _scene->_sequences.addTimer(1, 100);
+ } else {
+ _standPosition = 2;
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('w', 1), 0);
+ _anim3ActvFl = true;
+ _game._player._stepEnabled = true;
+ _game._player._playerPos = Common::Point(196, 134);
+ _scene->setAnimFrame(_globals._animationIndexes[3], 36);
+
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 13);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(154, 139));
+ }
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ } else if (_scene->_priorSceneId == 102) {
+ _game._player.firstWalk(Common::Point(-20, 140), FACING_EAST, Common::Point(15, 147), FACING_EAST, true);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ } else if ((_scene->_priorSceneId == 105) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(287, 135);
+ _game._player._facing = FACING_WEST;
+ _game._player._stepEnabled = false;
+ _game._player.walk(Common::Point(252, 134), FACING_WEST);
+ _game._player.setWalkTrigger(65);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 6);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ } else if (_scene->_priorSceneId == -1) {
+ if (_standPosition == 1) {
+ _game._player._visible = false;
+ _globals._animationIndexes[5] = _scene->loadAnimation(formAnimName('w', 3), 0);
+ _anim5ActvFl = true;
+ _scene->setAnimFrame(_globals._animationIndexes[5], 33);
+ } else if (_standPosition == 2) {
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 13);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(154, 139));
+ _game._player._visible = false;
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('w', 1), 0);
+ _anim3ActvFl = true;
+ _game._player._stepEnabled = true;
+ _scene->setAnimFrame(_globals._animationIndexes[3], 36);
+ } else if (_vm->_gameConv->_restoreRunning == 12) {
+ _vm->_gameConv->run(12);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportValue(_globals[kMusicSelected]);
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene103::step() {
+ if (_anim0ActvFl)
+ handleJacquesAnim();
+
+ if (_anim3ActvFl)
+ climbRightStairs();
+
+ if (_anim5ActvFl)
+ climbLeftStairs();
+
+ if (_anim4ActvFl)
+ descendRightStairs();
+
+ if (_anim6ActvFl)
+ descendLeftStairs();
+
+ if ((_globals[kWalkerConverse] == 2) || (_globals[kWalkerConverse] == 3)) {
+ ++_convCount;
+ if (_convCount > 200)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+
+ switch (_game._trigger) {
+ case 65:
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 6);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 66);
+ _vm->_sound->command(66);
+ break;
+
+ case 66: {
+ int syncIdx = _globals._sequenceIndexes[1];
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[1], SYNC_SEQ, syncIdx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _game._player._stepEnabled = true;
+ }
+ break;
+
+ case 80:
+ _scene->_nextSceneId = 104;
+ _scene->_reloadSceneFlag = true;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 100:
+ _scene->deleteSequence(_globals._sequenceIndexes[10]);
+ _globals._sequenceIndexes[10] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[10], false, 6, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_EXPIRE, 0, 101);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[10], -1, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 4);
+ break;
+
+ case 101:
+ _globals._animationIndexes[5] = _scene->loadAnimation(formAnimName('w', 3), 0);
+ _anim5ActvFl = true;
+ _scene->setAnimFrame(_globals._animationIndexes[5], 33);
+ _game._player._stepEnabled = true;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[5], SYNC_SEQ, _globals._sequenceIndexes[10]);
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 0:
+ if (_anim1ActvFl) {
+ if ((_scene->getAnimFrame(_globals._animationIndexes[1]) == 10) && !_guardFrameFl) {
+ _vm->_sound->command(64);
+ _guardFrameFl = true;
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _scene->deleteSequence(_globals._sequenceIndexes[9]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 105);
+ }
+ } else if (_anim2ActvFl) {
+ if ((_scene->getAnimFrame(_globals._animationIndexes[2]) == 7) && !_guardFrameFl) {
+ _vm->_sound->command(64);
+ _guardFrameFl = true;
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _scene->deleteSequence(_globals._sequenceIndexes[9]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[0], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 110);
+ }
+ }
+ break;
+
+ case 105:
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 2);
+ _guardFrameFl = false;
+ break;
+
+ case 110:
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 2);
+ _guardFrameFl = false;
+ break;
+
+ default:
+ break;
+ }
+
+ if (_globals[kJacquesStatus] == 3) {
+ warning("TODO: add a check on the return value of _vm->_sound->command ???");
+ _vm->_sound->command(38);
+ }
+}
+
+void Scene103::preActions() {
+ if (_action.isAction(VERB_OPEN, NOUN_DOOR))
+ _game._player._needToWalk = true;
+
+ if (_action.isAction(VERB_OPEN, NOUN_DOOR_TO_PIT)) {
+ _game._player.walk(Common::Point(0, 150), FACING_WEST);
+ _game._player._walkOffScreenSceneId = 102;
+ }
+
+ if ((_standPosition != 0) && !_action.isAction(VERB_CLIMB_THROUGH, NOUN_TRAP_DOOR) &&
+ !_action.isAction(VERB_OPEN, NOUN_TRAP_DOOR) &&
+ !_action.isAction(VERB_CLIMB, NOUN_PROMPTERS_STAND) &&
+ !_action.isAction(VERB_PUSH, NOUN_TRAP_DOOR) &&
+ !_action.isAction(VERB_LOOK_THROUGH, NOUN_PROMPTERS_BOX) &&
+ !_action.isAction(VERB_PULL, NOUN_TRAP_DOOR)) {
+
+ if (_action.isAction(VERB_PULL) || _action.isAction(VERB_PUSH)) {
+ if (!_action.isObject(NOUN_LEVER) && !_game._trigger)
+ _game._player._needToWalk = false;
+ }
+
+ if ((_action.isAction(VERB_PUSH, NOUN_PROMPTERS_STAND)) || (_action.isAction(VERB_PULL, NOUN_PROMPTERS_STAND))) {
+ if (!_game._trigger)
+ _game._player._needToWalk = true;
+ }
+
+ if (_game._player._needToWalk) {
+ if (_globals[kPrompterStandStatus] == 0) {
+ switch (_game._trigger) {
+ case 0:
+ _scene->freeAnimation(5);
+ _game._player._readyToWalk = false;
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _anim5ActvFl = false;
+ _anim6ActvFl = true;
+ _globals._animationIndexes[6] = _scene->loadAnimation(formAnimName('w', 4), 1);
+ break;
+
+ case 1:
+ _game._player._playerPos = Common::Point(79, 132);
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ _standPosition = 0;
+ _game._player._readyToWalk = true;
+ if (_action.isAction(VERB_PUSH, NOUN_PROMPTERS_STAND))
+ _game._player._needToWalk = false;
+ _anim6ActvFl = false;
+ _game._player.resetFacing(FACING_NORTHEAST);
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[6]);
+ break;
+
+ default:
+ break;
+ }
+ } else {
+ switch (_game._trigger) {
+ case 0:
+ _scene->freeAnimation(3);
+ _game._player._readyToWalk = false;
+ if (_action.isAction(VERB_PUSH, NOUN_PROMPTERS_STAND))
+ _game._player._needToWalk = true;
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _anim3ActvFl = false;
+ _anim4ActvFl = true;
+ _globals._animationIndexes[4] = _scene->loadAnimation(formAnimName('w', 2), 1);
+ break;
+
+ case 1:
+ _game._player._playerPos = Common::Point(196, 134);
+ _game._player._stepEnabled = true;
+ _game._player._readyToWalk = true;
+ if (_action.isAction(VERB_PUSH, NOUN_PROMPTERS_STAND))
+ _game._player._needToWalk = false;
+ _game._player._visible = true;
+ _standPosition = 0;
+ _anim4ActvFl = false;
+ _game._player.resetFacing(FACING_NORTHEAST);
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[4]);
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ }
+
+ if (_standPosition == 0) {
+ if ((_action.isAction(VERB_PUSH, NOUN_PROMPTERS_STAND)) || (_action.isAction(VERB_PULL, NOUN_PROMPTERS_STAND))) {
+ if (_globals[kCurrentYear] == 1993) {
+ if (_globals[kPrompterStandStatus] == 0)
+ _game._player.walk(Common::Point(2, 138), FACING_WEST);
+ else
+ _game._player.walk(Common::Point(176, 142), FACING_WEST);
+ }
+ }
+ }
+
+ if (_action.isAction(VERB_LOOK_THROUGH, NOUN_PROMPTERS_BOX) && (_standPosition == 0) && (_globals[kPrompterStandStatus] == 0) && (_globals[kCurrentYear] == 1993))
+ _game._player.walk(Common::Point(79, 132), FACING_SOUTHWEST);
+
+ if (_action.isAction(VERB_CLIMB_THROUGH, NOUN_TRAP_DOOR) && (_standPosition == 0) && (_globals[kPrompterStandStatus] == 1) && (_globals[kTrapDoorStatus] == 0))
+ _game._player.walk(Common::Point(196, 134), FACING_SOUTHWEST);
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_PIT))
+ _game._player._walkOffScreenSceneId = 102;
+
+ if ((_action.isAction(VERB_OPEN, NOUN_DOOR) || _action.isAction(VERB_UNLOCK, NOUN_DOOR) || _action.isAction(VERB_LOCK, NOUN_DOOR)) && (_standPosition == 0))
+ _game._player.walk(Common::Point(252, 134), FACING_EAST);
+}
+
+void Scene103::actions() {
+ if (_action.isAction(VERB_OPEN, NOUN_DOOR_TO_PIT)) {
+ _scene->_nextSceneId = 102;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 12) {
+ process_conv_jacques();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_THROUGH, NOUN_TRAP_DOOR)) {
+ if (_globals[kTrapDoorStatus] == 1) {
+ _vm->_dialogs->show(10333);
+ _action._inProgress = false;
+ return;
+ } else if (_globals[kPrompterStandStatus] == 0) {
+ _vm->_dialogs->show(10341);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if ((_action.isAction(VERB_LOOK_THROUGH, NOUN_PROMPTERS_BOX)) && (_globals[kPrompterStandStatus] == 1)) {
+ _vm->_dialogs->show(10342);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_CLIMB, NOUN_PROMPTERS_STAND) && _standPosition == 0) ||
+ (_action.isAction(VERB_LOOK_THROUGH, NOUN_PROMPTERS_BOX) && (_standPosition == 0)) ||
+ (_action.isAction(VERB_CLIMB_THROUGH, NOUN_TRAP_DOOR) && (_standPosition == 0))) {
+ if (_globals[kPrompterStandStatus] == 0) {
+ if (_game._trigger == 0) {
+ if (_action.isAction(VERB_LOOK_THROUGH, NOUN_PROMPTERS_BOX)) {
+ _sitFl = true;
+ _globals._animationIndexes[5] = _scene->loadAnimation(formAnimName('w', 3), 115);
+ } else
+ _globals._animationIndexes[5] = _scene->loadAnimation(formAnimName('w', 3), 0);
+
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _anim5ActvFl = true;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[5], SYNC_PLAYER, 0);
+ _action._inProgress = false;
+ return;
+ }
+ } else if (_game._trigger == 0) {
+ if (_action.isAction(VERB_CLIMB_THROUGH, NOUN_TRAP_DOOR)) {
+ _climbThroughTrapFl = true;
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('w', 1), 120);
+ } else
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('w', 1), 0);
+
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _anim3ActvFl = true;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[3], SYNC_PLAYER, 0);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_CLIMB, NOUN_PROMPTERS_STAND) && (_standPosition != 0)) {
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_PUSH, NOUN_PROMPTERS_STAND)) || (_action.isAction(VERB_PULL, NOUN_PROMPTERS_STAND))) {
+ if (_globals[kCurrentYear] == 1993) {
+ if (_globals[kPrompterStandStatus] == 0) {
+ switch (_game._trigger) {
+ case 0:
+ if (_globals[kPrompterStandStatus] == 0) {
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('s', 1), 75);
+ _game._player._priorTimer = _scene->_frameStartTime;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ }
+ break;
+
+ case 75:
+ if (_globals[kPrompterStandStatus] == 0) {
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 1);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 4);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(154, 139));
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[3], SYNC_ANIM, _globals._animationIndexes[0]);
+ _globals[kPrompterStandStatus] = 1;
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ _game._player._playerPos = Common::Point(117, 139);
+ _game._player.resetFacing(FACING_EAST);
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+
+ _scene->_dynamicHotspots.remove(_hotspotPrompt1);
+ _scene->_dynamicHotspots.remove(_hotspotPrompt2);
+ _scene->_dynamicHotspots.remove(_hotspotPrompt3);
+ _scene->_dynamicHotspots.remove(_hotspotPrompt5);
+ _scene->_dynamicHotspots.remove(_hotspotLeftFloor1);
+ _scene->_dynamicHotspots.remove(_hotspotLeftFloor2);
+
+ _hotspotPrompt1 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(121, 79, 121 + 40, 79 + 63));
+ _scene->_dynamicHotspots[_hotspotPrompt1]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt1, Common::Point(171, 142), FACING_NORTHWEST);
+
+ _hotspotPrompt2 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(161, 67, 161 + 16, 67 + 75));
+ _scene->_dynamicHotspots[_hotspotPrompt2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt2, Common::Point(171, 142), FACING_NORTHWEST);
+
+ _hotspotPrompt3 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(177, 90, 177 + 18, 90 + 52));
+ _scene->_dynamicHotspots[_hotspotPrompt3]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt3, Common::Point(171, 142), FACING_NORTHWEST);
+
+ _hotspotPrompt4 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(114, 100, 114 + 7, 100 + 38));
+ _scene->_dynamicHotspots[_hotspotPrompt4]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt4, Common::Point(171, 142), FACING_NORTHWEST);
+
+ _hotspotPrompt5 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_CLIMB, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(121, 49, 121 + 40, 49 + 30));
+ _scene->_dynamicHotspots[_hotspotPrompt5]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt5, Common::Point(196, 134), FACING_SOUTHWEST);
+ _scene->_dynamicHotspots.setCursor(_hotspotPrompt5, CURSOR_GO_UP);
+
+ _hotspotRightFloor1 = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(154, 6, 154 + 41, 6 + 6));
+ _scene->_dynamicHotspots[_hotspotRightFloor1]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotRightFloor1, Common::Point(171, 142), FACING_NONE);
+
+ _hotspotRightFloor2 = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(114, 136, 114 + 32, 132 + 6));
+ _scene->_dynamicHotspots[_hotspotRightFloor2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotRightFloor2, Common::Point(127, 140), FACING_NONE);
+
+ _scene->changeVariant(1);
+ adjustRails(1);
+ }
+ break;
+
+ default:
+ break;
+ }
+ } else {
+ switch (_game._trigger) {
+ case 0:
+ if (_globals[kPrompterStandStatus] == 1) {
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('s', 2), 75);
+ _game._player._priorTimer = _scene->_frameStartTime;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ _scene->deleteSequence(_globals._sequenceIndexes[12]);
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ }
+ break;
+
+ case 75:
+ if (_globals[kPrompterStandStatus] == 1) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 4);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(37, 139));
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[3], SYNC_ANIM, _globals._animationIndexes[0]);
+ _globals[kPrompterStandStatus] = 0;
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ _game._player._playerPos = Common::Point(62, 142);
+ _game._player.resetFacing(FACING_WEST);
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _scene->_dynamicHotspots.remove(_hotspotPrompt1);
+ _scene->_dynamicHotspots.remove(_hotspotPrompt2);
+ _scene->_dynamicHotspots.remove(_hotspotPrompt3);
+ _scene->_dynamicHotspots.remove(_hotspotPrompt4);
+ _scene->_dynamicHotspots.remove(_hotspotPrompt5);
+ _scene->_dynamicHotspots.remove(_hotspotRightFloor1);
+ _scene->_dynamicHotspots.remove(_hotspotRightFloor2);
+
+ _hotspotPrompt1 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(2, 79, 2 + 40, 79 + 63));
+ _scene->_dynamicHotspots[_hotspotPrompt1]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt1, Common::Point(59, 140), FACING_NORTHWEST);
+
+ _hotspotPrompt2 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(42, 67, 42 + 16, 67 + 75));
+ _scene->_dynamicHotspots[_hotspotPrompt2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt2, Common::Point(59, 140), FACING_NORTHWEST);
+
+ _hotspotPrompt3 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(58, 90, 58 + 18, 90 + 52));
+ _scene->_dynamicHotspots[_hotspotPrompt3]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt3, Common::Point(59, 140), FACING_NORTHWEST);
+
+ _hotspotLeftFloor1 = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(35, 137, 35 + 40, 137 + 5));
+ _scene->_dynamicHotspots[_hotspotLeftFloor1]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotLeftFloor1, Common::Point(59, 140), FACING_NONE);
+
+ _hotspotLeftFloor2 = _scene->_dynamicHotspots.add(NOUN_FLOOR, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(76, 129, 76 + 6, 129 + 6));
+ _scene->_dynamicHotspots[_hotspotLeftFloor2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotLeftFloor2, Common::Point(80, 135), FACING_NONE);
+
+ _hotspotPrompt5 = _scene->_dynamicHotspots.add(NOUN_PROMPTERS_STAND, VERB_CLIMB, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(2, 49, 2 + 40, 49 + 30));
+ _scene->_dynamicHotspots[_hotspotPrompt5]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotPrompt5, Common::Point(79, 132), FACING_SOUTHWEST);
+ _scene->_dynamicHotspots.setCursor(_hotspotPrompt5, CURSOR_GO_UP);
+
+ _scene->changeVariant(0);
+ adjustRails(0);
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ } else if (_globals[kJacquesNameIsKnown])
+ _vm->_dialogs->show(10340);
else
+ _vm->_dialogs->show(10350);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR) || _action.isAction(VERB_OPEN, NOUN_DOOR) || _action.isAction(VERB_UNLOCK, NOUN_DOOR) || _action.isAction(VERB_LOCK, NOUN_DOOR)) {
+ if ((_globals[kCurrentYear] == 1881) && !_action.isAction(VERB_LOCK, NOUN_DOOR) && !_action.isAction(VERB_UNLOCK, NOUN_DOOR)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[2], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 3, 70);
+ break;
+
+ case 2:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[2]);
+ _game._player.walk(Common::Point(295, 132), FACING_WEST);
+ _scene->_sequences.addTimer(180, 3);
+ break;
+
+ case 3:
+ _scene->_nextSceneId = 105;
+ break;
+
+ case 70:
+ _vm->_sound->command(24);
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 71);
+ _vm->_sound->command(66);
+ break;
+
+ case 71: {
+ int oldIdx = _globals._sequenceIndexes[1];
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -2);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[1], SYNC_SEQ, oldIdx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ }
+ break;
+
+ default:
+ break;
+ }
+ } else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[2], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1: {
+ int oldIdx = _globals._sequenceIndexes[2];
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 4);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[2], SYNC_SEQ, oldIdx);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[2], false);
+ _scene->_sequences.addTimer(15, 2);
+ _vm->_sound->command(73);
+ }
+ break;
+
+ case 2:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[2], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[2]);
+ _game._player._visible = true;
+ if (_action.isAction(VERB_LOCK) || _action.isAction(VERB_UNLOCK))
+ _vm->_dialogs->show(00032);
+ else
+ _vm->_dialogs->show(10335);
+
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_KEY) && (_game._objects.isInRoom(OBJ_KEY) || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ _action._inProgress = false;
+ return;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+ _scene->_hotspots.activate(NOUN_KEY, false);
+ _game._objects.addToInventory(OBJ_KEY);
+ _vm->_sound->command(26);
+ _action._inProgress = false;
+ return;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ _action._inProgress = false;
+ return;
+
+ case 3:
+ _globals[kPlayerScore] += 5;
+ _vm->_dialogs->showItem(OBJ_KEY, 800, 0);
+ _game._player._stepEnabled = true;
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_GENTLEMAN) || _action.isAction(VERB_TALK_TO, NOUN_JACQUES)) {
+ if (_globals[kJacquesStatus] == 0) {
+ _vm->_gameConv->run(12);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportValue(_globals[kMusicSelected]);
+ } else
+ _vm->_dialogs->show(10343);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_THROUGH, NOUN_TRAP_DOOR) || _climbThroughTrapFl) {
+ if ((_standPosition == 2) && (_globals[kTrapDoorStatus] == 0)) {
+ switch (_game._trigger) {
+ case 0:
+ case 120:
+ if (!(_globals[kPlayerScoreFlags] & 1)) {
+ _globals[kPlayerScoreFlags] |= 1;
+ _globals[kPlayerScore] += 3;
+ }
+
+ _scene->freeAnimation(3);
+ _anim3ActvFl = false;
+ _climbThroughTrapFl = false;
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[11] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[11], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 5);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[11], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[11], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1:
+ _globals[kRoom103104Transition] = 1;
+ _scene->_nextSceneId = 104;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK_THROUGH, NOUN_PROMPTERS_BOX) || _sitFl) {
+ if (_standPosition == 1) {
+ switch (_game._trigger) {
+ case 0:
+ case 115:
+ _scene->freeAnimation(5);
+ _anim5ActvFl = false;
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[10] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[10], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 4);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[10], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ if (!_sitFl)
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[10], SYNC_ANIM, _globals._animationIndexes[5]);
+ _sitFl = false;
+ break;
+
+ case 1:
+ _globals[kRoom103104Transition] = 0;
+ _scene->_nextSceneId = 104;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_PUSH, NOUN_LEVER) || _action.isAction(VERB_PULL, NOUN_LEVER)) {
+ if (_globals[kTrapDoorStatus] == 1) {
+ switch (_game._trigger) {
+ case 0:
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('l', 1), 1);
+ _anim1ActvFl = true;
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[1], SYNC_PLAYER, 0);
+ break;
+
+ case 1:
+ _anim1ActvFl = false;
+ _game._player._visible = true;
+ _globals[kTrapDoorStatus] = 0;
+ _game._player._stepEnabled = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[1]);
+ break;
+
+ default:
+ break;
+ }
+ } else {
+ switch (_game._trigger) {
+ case 0:
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('l', 2), 1);
+ _anim2ActvFl = true;
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[2], SYNC_PLAYER, 0);
+ break;
+
+ case 1:
+ _anim2ActvFl = false;
+ _game._player._visible = true;
+ _globals[kTrapDoorStatus] = 1;
+ _game._player._stepEnabled = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[2]);
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ if ((_globals[kCurrentYear] == 1881) && (_globals[kJacquesStatus] >= 1))
+ _vm->_dialogs->show(10311);
+ else
+ _vm->_dialogs->show(10310);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_PROMPTERS_STAND)) {
+ if (_globals[kJacquesStatus] >= 1)
+ _vm->_dialogs->show(10349);
+ else if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(10312);
+ else
+ _vm->_dialogs->show(10345);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(10313);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TRAP_CEILING)) {
+ _vm->_dialogs->show(10314);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR)) {
+ _vm->_dialogs->show(10315);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR_TO_PIT)) {
+ _vm->_dialogs->show(10316);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(10317);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PROMPTERS_BOX)) {
+ _vm->_dialogs->show(10318);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TRAP_DOOR)) {
+ _vm->_dialogs->show(10319);
+ _action._inProgress = false;
return;
+ }
+
+ if (_action.isObject(NOUN_JUNK)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(10320);
+ else
+ _vm->_dialogs->show(10346);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CARTON)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(10321);
+ else
+ _vm->_dialogs->show(10347);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GARBAGE_CAN)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(10322);
+ else
+ _vm->_dialogs->show(10348);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CABLE)) {
+ _vm->_dialogs->show(10323);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_JACQUES) || _action.isObject(NOUN_GENTLEMAN)) {
+ if (_globals[kJacquesStatus] == 0)
+ _vm->_dialogs->show(10324);
+ else
+ _vm->_dialogs->show(10325);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_KEY) && _game._objects.isInRoom(OBJ_KEY)) {
+ _vm->_dialogs->show(10326);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAIR_UNIT)) {
+ _vm->_dialogs->show(10327);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_EXPOSED_BRICK)) {
+ _vm->_dialogs->show(10328);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WATER_PIPE)) {
+ _vm->_dialogs->show(10329);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PROMPTERS_SEAT)) {
+ _vm->_dialogs->show(10338);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LEVER)) {
+ _vm->_dialogs->show(10339);
+ _action._inProgress = false;
+ return;
+ }
+
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_DOOR_TO_PIT)) {
+ _vm->_dialogs->show(10331);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_DOOR)) {
+ _vm->_dialogs->show(10331);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_OPEN, NOUN_TRAP_DOOR)) || (_action.isAction(VERB_CLOSE, NOUN_TRAP_DOOR))) {
+ _vm->_dialogs->show(10344);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_JACQUES) || _action.isAction(VERB_TAKE, NOUN_GENTLEMAN)) {
+ if (_globals[kJacquesStatus] == 0) {
+ if (_globals[kJacquesNameIsKnown])
+ _vm->_dialogs->show(10336);
+ else
+ _vm->_dialogs->show(10351);
+ } else
+ _vm->_dialogs->show(10337);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene103::adjustRails(int variant) {
+ switch (variant) {
+ case 0:
+ _scene->_rails.disableNode(3);
+ _scene->_rails.disableNode(4);
+ _scene->_rails.disableNode(5);
+ _scene->_rails.disableNode(6);
+ _scene->_rails.disableNode(12);
+ _scene->_rails.disableNode(13);
+ _scene->_rails.disableNode(14);
+ break;
+
+ case 1:
+ _scene->_rails.disableNode(1);
+ _scene->_rails.disableNode(2);
+ _scene->_rails.disableNode(3);
+ _scene->_rails.disableNode(4);
+ _scene->_rails.disableNode(5);
+ _scene->_rails.disableNode(6);
+ _scene->_rails.disableNode(7);
+ _scene->_rails.disableNode(9);
+ _scene->_rails.disableNode(10);
+ _scene->_rails.disableNode(11);
+ break;
+
+ case 2:
+ _scene->_rails.disableNode(1);
+ _scene->_rails.disableNode(2);
+ _scene->_rails.disableNode(5);
+ _scene->_rails.disableNode(6);
+ _scene->_rails.disableNode(7);
+ _scene->_rails.disableNode(9);
+ _scene->_rails.disableNode(10);
+ _scene->_rails.disableNode(11);
+ break;
+
+ case 3:
+ _scene->_rails.disableNode(1);
+ _scene->_rails.disableNode(2);
+ _scene->_rails.disableNode(3);
+ _scene->_rails.disableNode(4);
+ _scene->_rails.disableNode(10);
+ _scene->_rails.disableNode(11);
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene103::handleJacquesAnim() {
+ if (_scene->getAnimFrame(_globals._animationIndexes[0]) == _lastJacquesFrame)
+ return;
+
+ _lastJacquesFrame = _scene->getAnimFrame(_globals._animationIndexes[0]);
+ int resetFrame = -1;
+ int random;
+
+ switch (_lastJacquesFrame) {
+ case 1:
+ case 2:
+ case 3:
+ case 9:
+ case 17:
+ case 23:
+ case 33:
+ case 51:
+ switch (_jacquesAction) {
+ case 2:
+ random = 4;
+ _jacquesAction = 0;
+ break;
+
+ case 3:
+ random = 5;
+ _jacquesAction = 0;
+ break;
+
+ case 4:
+ random = 6;
+ break;
+
+ case 0:
+ random = _vm->getRandomNumber(1, 3);
+ ++_talkCount;
+ if (_talkCount > 22) {
+ _jacquesAction = 1;
+ random = 9;
+ }
+ break;
+
+ default:
+ random = _vm->getRandomNumber(6, 50);
+ while (_lastRandom == random)
+ random = _vm->getRandomNumber(6, 50);
+
+ _lastRandom = random;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 0;
+ break;
+
+ case 2:
+ resetFrame = 1;
+ break;
+
+ case 3:
+ resetFrame = 2;
+ break;
+
+ case 4:
+ resetFrame = 4;
+ break;
+
+ case 5:
+ resetFrame = 10;
+ break;
+
+ case 6:
+ resetFrame = 34;
+ break;
+
+ case 7:
+ resetFrame = 24;
+ break;
+
+ case 8:
+ resetFrame = 18;
+ break;
+
+ default:
+ resetFrame = 8;
+ break;
+ }
+ break;
+
+ case 36:
+ case 40:
+ case 48:
+ switch (_jacquesAction) {
+ case 0:
+ case 2:
+ case 3:
+ random = 2;
+ break;
+
+ case 4:
+ random = 1;
+ _jacquesAction = 0;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(2, 50);
+ while (_lastRandom == random)
+ random = _vm->getRandomNumber(2, 50);
+ _lastRandom = random;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 37;
+ break;
+
+ case 2:
+ resetFrame = 49;
+ break;
+
+ case 3:
+ resetFrame = 41;
+ break;
+
+ default:
+ resetFrame = 35;
+ break;
+ }
+ break;
+
+ case 44:
+ random = _vm->getRandomNumber(1, 50);
+ while (_lastRandom == random)
+ random = _vm->getRandomNumber(1, 50);
+
+ _lastRandom = random;
+
+ switch (_jacquesAction) {
+ case 0:
+ case 2:
+ case 3:
+ case 4:
+ random = 1;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(1, 50);
+ while (_lastRandom == random)
+ random = _vm->getRandomNumber(1, 50);
+ _lastRandom = random;
+ break;
+ }
+ switch (random) {
+ case 1:
+ resetFrame = 45;
+ break;
+
+ default:
+ resetFrame = 43;
+ break;
+ }
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _lastJacquesFrame = resetFrame;
+ }
+}
+
+void Scene103::climbRightStairs() {
+ if (_scene->getAnimFrame(_globals._animationIndexes[3]) == _lastStairFrame)
+ return;
+
+ _lastStairFrame = _scene->getAnimFrame(_globals._animationIndexes[3]);
+ int stairsResetFrame = -1;
+
+ if (_lastStairFrame == 37) {
+ stairsResetFrame = 36;
+ _standPosition = 2;
_game._player._stepEnabled = true;
}
- if (_action.isAction(VERB_CLOSE, NOUN_ORCHESTRA_DOOR)) {
- _vm->_dialogs->show(10228);
+ if (_lastStairFrame == 2) {
+ _scene->deleteSequence(3);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 13);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(154, 139));
+ }
+
+ if (stairsResetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[3], stairsResetFrame);
+ _lastStairFrame = stairsResetFrame;
+ }
+}
+
+void Scene103::climbLeftStairs() {
+ if (_scene->getAnimFrame(_globals._animationIndexes[5]) == _lastStairFrame)
+ return;
+
+ _lastStairFrame = _scene->getAnimFrame(_globals._animationIndexes[5]);
+ int stairsResetFrame = -1;
+
+ if (_lastStairFrame == 34) {
+ stairsResetFrame = 33;
+ _standPosition = 1;
+ _game._player._stepEnabled = true;
+ }
+
+ if (_lastStairFrame == 2) {
+ _scene->deleteSequence(3);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 13);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(37, 139));
+ }
+
+ if (stairsResetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[5], stairsResetFrame);
+ _lastStairFrame = stairsResetFrame;
+ }
+}
+
+void Scene103::descendRightStairs() {
+ if (_scene->getAnimFrame(_globals._animationIndexes[4]) == _lastStairFrame)
+ return;
+
+ _lastStairFrame = _scene->getAnimFrame(_globals._animationIndexes[4]);
+
+ if (_lastStairFrame == 2) {
+ _scene->deleteSequence(3);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 4);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(154, 139));
+ }
+}
+
+void Scene103::descendLeftStairs() {
+ if (_scene->getAnimFrame(_globals._animationIndexes[6]) == _lastStairFrame)
+ return;
+
+ _lastStairFrame = _scene->getAnimFrame(_globals._animationIndexes[6]);
+
+ if (_lastStairFrame == 2) {
+ _scene->deleteSequence(3);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 4);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(37, 139));
+ }
+}
+
+void Scene103::process_conv_jacques() {
+ bool quitConversationFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 1:
+ _vm->_gameConv->setInterlocutorTrigger(96);
+ if (_globals[kJacquesNameIsKnown] == 0) {
+ _globals[kJacquesNameIsKnown] = 1;
+ _scene->_dynamicHotspots.remove(_hotspotGentleman);
+ _hotspotGentleman = _scene->_dynamicHotspots.add(NOUN_JACQUES, VERB_WALKTO, SYNTAX_SINGULAR_MASC, EXT_NONE, Common::Rect(156, 116, 156 + 33, 116 + 31));
+ _scene->_dynamicHotspots[_hotspotGentleman]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_hotspotGentleman, Common::Point(206, 148), FACING_NORTHWEST);
+ }
+ break;
+
+ case 4:
+ case 6:
+ case 7:
+ case 10:
+ case 19:
+ case 30: {
+ _globals[kWalkerConverse] = 0;
+ int *val = _vm->_gameConv->getVariable(26);
+ if (*val)
+ _globals[kJacquesNameIsKnown] = 2;
+
+ quitConversationFl = true;
+ }
+ break;
+
+ case 8:
+ _vm->_gameConv->setInterlocutorTrigger(94);
+ break;
+
+ case 12:
+ _vm->_gameConv->setInterlocutorTrigger(96);
+ break;
+
+ case 29:
+ _vm->_gameConv->setInterlocutorTrigger(98);
+ break;
+
+ default:
+ break;
+ }
+
+ if ((_action._activeAction._verbId != 1) && (_action._activeAction._verbId != 8)
+ && (_action._activeAction._verbId != 12) && (_action._activeAction._verbId != 29))
+ _vm->_gameConv->setInterlocutorTrigger(90);
+
+ _vm->_gameConv->setHeroTrigger(92);
+
+ switch (_game._trigger) {
+ case 90:
+ if (!quitConversationFl)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _jacquesAction = 0;
+ break;
+
+ case 92:
+ if (!quitConversationFl)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(2, 3);
+ _convCount = 0;
+ _jacquesAction = 1;
+ break;
+
+ case 94:
+ if (!quitConversationFl)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _jacquesAction = 2;
+ break;
+
+ case 96:
+ if (!quitConversationFl)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _jacquesAction = 3;
+ break;
+
+ case 98:
+ if (!quitConversationFl)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _jacquesAction = 4;
+ break;
+
+ default:
+ break;
+ }
+
+ _talkCount = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene104::Scene104(MADSEngine *vm) : Scene1xx(vm) {
+ _anim0ActvFl = _anim1ActvFl = _anim2ActvFl = false;
+ _needToTalk = false;
+ _needToGetUp = false;
+ _sittingUp = false;
+ _beforeHeLeaves = false;
+ _beforeSheLeaves = false;
+ _needToStandUp = false;
+
+ _walkStatus = -1;
+ _walkFrame = -1;
+ _coupleStatus = -1;
+ _richStatus = -1;
+ _richTalkCount = -1;
+ _manTalkCount = -1;
+ _womanTalkCount = -1;
+ _lookCount = -1;
+ _coupleFrame = -1;
+ _lastPlayerFrame = -1;
+ _richFrame = -1;
+}
+
+void Scene104::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_anim2ActvFl);
+ s.syncAsByte(_needToTalk);
+ s.syncAsByte(_needToGetUp);
+ s.syncAsByte(_sittingUp);
+ s.syncAsByte(_beforeHeLeaves);
+ s.syncAsByte(_beforeSheLeaves);
+ s.syncAsByte(_needToStandUp);
+
+ s.syncAsSint16LE(_walkStatus);
+ s.syncAsSint16LE(_walkFrame);
+ s.syncAsSint16LE(_coupleStatus);
+ s.syncAsSint16LE(_richStatus);
+ s.syncAsSint16LE(_richTalkCount);
+ s.syncAsSint16LE(_manTalkCount);
+ s.syncAsSint16LE(_womanTalkCount);
+ s.syncAsSint16LE(_lookCount);
+ s.syncAsSint16LE(_coupleFrame);
+ s.syncAsSint16LE(_lastPlayerFrame);
+}
+
+void Scene104::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if (_globals[kTrapDoorStatus] == 1)
+ _scene->_variant = 1;
+
+ _scene->addActiveVocab(NOUN_MONSIEUR_RICHARD);
+}
+
+void Scene104::enter() {
+ _vm->_disableFastwalk = true;
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _needToTalk = false;
+ _needToGetUp = false;
+ _sittingUp = false;
+ _beforeSheLeaves = false;
+ _needToStandUp = false;
+ }
+
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('a', 0));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('a', 6));
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 0));
+
+ if (_globals[kCurrentYear] == 1993)
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('z', 0));
+
+ _vm->_gameConv->get(7);
+
+ if (_globals[kTrapDoorStatus] == 1) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 15);
+ } else {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 15);
+ }
+
+ if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ if (_vm->_gameConv->_restoreRunning == 7) {
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('r', 1), 1);
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('d', 1), 1);
+ _walkStatus = 0;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('m', 1), 1);
+ if (_coupleStatus < 11) {
+ _coupleStatus = 1;
+ _richStatus = 0;
+ _scene->setAnimFrame(_globals._animationIndexes[1], 14);
+ } else {
+ _coupleStatus = 17;
+ _richStatus = 4;
+ _scene->setAnimFrame(_globals._animationIndexes[1], 105);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 216);
+ }
+
+ _vm->_gameConv->run(7);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _game._player._visible = false;
+ }
+
+ } else if (_scene->_priorSceneId == 301) {
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('r', 1), 1);
+ _anim1ActvFl = true;
+ _coupleStatus = 11;
+
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('d', 1), 1);
+ _anim2ActvFl = true;
+ _walkStatus = 0;
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('m', 1), 1);
+ _anim0ActvFl = true;
+ _richStatus = 0;
+
+ cleanInventory();
+
+ _game._player._visible = false;
+ _game._visitedScenes.pop_back();
+ _globals[kTrapDoorStatus] = 1;
+ _globals[kCurrentYear] = 1881;
+ _globals[kPrompterStandStatus] = 1;
+ _globals[kTicketPeoplePresent] = 1;
+ _globals[kMakeBrieLeave203] = false;
+ _game._player._playerPos.x = 161;
+
+ _game._visitedScenes.add(301);
+ _game._visitedScenes.add(101);
+
+ _scene->setCamera(Common::Point(60, 0));
+ _scene->_sequences.addTimer(1, 91);
+
+ } else if (_scene->_priorSceneId == 103) {
+ if (_globals[kRoom103104Transition] == 0) {
+ _scene->_userInterface.emptyConversationList();
+ _scene->_userInterface.setup(kInputConversation);
+
+ if (!_globals[kObservedPhan104]) {
+ _globals._animationIndexes[4] = _scene->loadAnimation(formAnimName('p', 1), 93);
+ _game._player._playerPos.x = 319;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _scene->setCamera(Common::Point(158, 0));
+ } else {
+ _globals._animationIndexes[5] = _scene->loadAnimation(formAnimName('p', 2), 94);
+ _game._player._playerPos.x = 319;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _scene->setCamera(Common::Point(158, 0));
+ }
+ } else {
+ _game._player._playerPos = Common::Point(319, 96);
+ _game._player._facing = FACING_SOUTH;
+ _scene->setCamera(Common::Point(158, 0));
+ }
+ } else if (_scene->_priorSceneId == 102) {
+ switch (_globals[kDeathLocation]) {
+ case 0:
+ _game._player._playerPos = Common::Point(496, 79);
+ _scene->setCamera(Common::Point(320, 0));
+ break;
+
+ case 1:
+ _game._player._playerPos = Common::Point(346, 71);
+ _scene->setCamera(Common::Point(158, 0));
+ break;
+
+ case 2:
+ _game._player._playerPos = Common::Point(172, 73);
+ break;
+
+ default:
+ break;
+ }
+ } else if (_scene->_priorSceneId == 108) {
+ if (_game._player._playerPos.x > 213)
+ _game._player._playerPos.y = 97;
+ else if (_game._player._playerPos.x > 110)
+ _game._player._playerPos.y = 128;
+ else
+ _game._player._playerPos.y = 148;
+
+ _game._player.firstWalk(Common::Point(-20, _game._player._playerPos.y), FACING_EAST, Common::Point(12, _game._player._playerPos.y), FACING_EAST, true);
+ } else if ((_scene->_priorSceneId == 107) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ if (_game._player._playerPos.x > 191)
+ _game._player._playerPos.y = 142;
+ else if (_game._player._playerPos.x > 104)
+ _game._player._playerPos.y = 120;
+ else
+ _game._player._playerPos.y = 95;
+
+ _game._player.firstWalk(Common::Point(655, _game._player._playerPos.y), FACING_WEST, Common::Point(627, _game._player._playerPos.y), FACING_WEST, true);
+ _scene->setCamera(Common::Point(320, 0));
+ }
+
+ if (_globals[kCurrentYear] == 1993) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ } else
+ _scene->_hotspots.activate(NOUN_CHANDELIER, false);
+
+ if (_globals[kTrapDoorStatus] == 1) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 15);
+ } else {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 15);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene104::step() {
+ if (_anim0ActvFl)
+ handleRichAnimations();
+
+ if (_anim1ActvFl)
+ handleCoupleAnimations();
+
+ if (_anim2ActvFl)
+ handleWalkAnimation();
+
+ if (_game._player._moving)
+ handlePlayerWalk();
+
+ if (_game._trigger == 91) {
+ _vm->_dialogs->show(10434);
+ _vm->_gameConv->run(7);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ }
+
+ if (_game._trigger == 93) {
+ _scene->_nextSceneId = 103;
+ _game._player._playerPos.x = 400;
+ _globals[kRoom103104Transition] = 0;
+ }
+
+ if (_game._trigger == 94) {
+ _scene->_nextSceneId = 103;
+ _globals[kRoom103104Transition] = 0;
+ }
+}
+
+void Scene104::preActions() {
+ if (_action.isAction(VERB_EXIT, NOUN_STAGE_LEFT))
+ _game._player._walkOffScreenSceneId = 108;
+
+ if (_action.isAction(VERB_EXIT, NOUN_STAGE_RIGHT))
+ _game._player._walkOffScreenSceneId = 107;
+
+ if (_action.isAction(VERB_OPEN, NOUN_TRAP_DOOR) || _action.isAction(VERB_CLOSE, NOUN_TRAP_DOOR))
+ _game._player.walk(Common::Point(320, 92), FACING_NORTH);
+}
+
+void Scene104::actions() {
+ if (_vm->_gameConv->_running == 7) {
+ processConversations();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_THROUGH, NOUN_TRAP_DOOR)) {
+ if (_globals[kTrapDoorStatus] == 0) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 13);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 16);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 60);
+ break;
+
+ case 60:
+ _scene->_nextSceneId = 103;
+ _globals[kRoom103104Transition] = 1;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ } else {
+ _vm->_dialogs->show(10429);
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_JUMP_INTO, NOUN_ORCHESTRA_PIT)) {
+ switch (_game._trigger) {
+ case 0:
+ if (_game._player._playerPos.x > 400)
+ _globals[kDeathLocation] = 0;
+ else if (_game._player._playerPos.x > 200)
+ _globals[kDeathLocation] = 1;
+ else
+ _globals[kDeathLocation] = 2;
+
+ _scene->changeVariant(2);
+
+ if (_globals[kTrapDoorStatus] == 1)
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ else
+ _scene->drawToBackground(_globals._spriteIndexes[0], 2, Common::Point(-32000, -32000), 0, 100);
+
+ _vm->_dialogs->show(10426);
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 7, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 15);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, 4);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], _game._player._playerPos);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1:
+ _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 1, 10);
+ _scene->_sequences.addTimer(60, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 4, 4);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 15);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], true);
+ _scene->_sequences.setMotion(_globals._sequenceIndexes[3], 0, 0, 200);
+ break;
+
+ case 2:
+ _vm->_sound->command(1);
+ _vm->_sound->command(67);
+ _scene->_nextSceneId = 102;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(10410);
+ else
+ _vm->_dialogs->show(10411);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_STAGE)) {
+ _vm->_dialogs->show(10412);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_APRON)) {
+ _vm->_dialogs->show(10413);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PROSCENIUM_ARCH)) {
+ _vm->_dialogs->show(10414);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ACT_CURTAIN)) {
+ _vm->_dialogs->show(10415);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ORCHESTRA_PIT)) {
+ _vm->_dialogs->show(10416);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CONDUCTORS_STAND)) {
+ _vm->_dialogs->show(10417);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isObject(NOUN_MUSIC_STAND)) || (_action.isObject(NOUN_MUSIC_STANDS))) {
+ _vm->_dialogs->show(10418);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PROMPTERS_BOX)) {
+ _vm->_dialogs->show(10419);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TRAP_DOOR)) {
+ _vm->_dialogs->show(10420);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HOUSE)) {
+ if (_globals[kCurrentYear] == 1881)
+ _vm->_dialogs->show(10421);
+ else
+ _vm->_dialogs->show(10427);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAGE_LEFT)) {
+ _vm->_dialogs->show(10422);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAGE_RIGHT)) {
+ _vm->_dialogs->show(10423);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHANDELIER)) {
+ _vm->_dialogs->show(10428);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MONSIEUR_RICHARD)) {
+ _vm->_dialogs->show(10433);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_JUMP_INTO, NOUN_ORCHESTRA_PIT)) {
+ _vm->_dialogs->show(10426);
+ _scene->_nextSceneId = 102;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_PROMPTERS_BOX) || _action.isAction(VERB_CLOSE, NOUN_PROMPTERS_BOX)) {
+ _vm->_dialogs->show(10430);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_TRAP_DOOR)) {
+ if (_globals[kTrapDoorStatus] == 0)
+ _vm->_dialogs->show(10424);
+ else
+ _vm->_dialogs->show(10432);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_TRAP_DOOR)) {
+ if (_globals[kTrapDoorStatus] == 1)
+ _vm->_dialogs->show(10425);
+ else
+ _vm->_dialogs->show(10433);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_CHANDELIER)) {
+ _vm->_dialogs->show(10435);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene104::cleanInventory() {
+ if (_game._objects.isInInventory(OBJ_LARGE_NOTE))
+ _game._objects.setRoom(OBJ_LARGE_NOTE, NOWHERE);
+
+ if (_game._objects.isInInventory(OBJ_SANDBAG))
+ _game._objects.setRoom(OBJ_SANDBAG, NOWHERE);
+
+ if (_game._objects.isInInventory(OBJ_SMALL_NOTE))
+ _game._objects.setRoom(OBJ_SMALL_NOTE, NOWHERE);
+
+ if (_game._objects.isInInventory(OBJ_PARCHMENT))
+ _game._objects.setRoom(OBJ_PARCHMENT, NOWHERE);
+
+ if (_game._objects.isInInventory(OBJ_BOOK))
+ _game._objects.setRoom(OBJ_BOOK, NOWHERE);
+
+ if (_game._objects.isInInventory(OBJ_RED_FRAME))
+ _game._objects.setRoom(OBJ_RED_FRAME, 105);
+
+ if (_game._objects.isInInventory(OBJ_YELLOW_FRAME))
+ _game._objects.setRoom(OBJ_YELLOW_FRAME, 107);
+
+ if (_game._objects.isInInventory(OBJ_BLUE_FRAME))
+ _game._objects.setRoom(OBJ_BLUE_FRAME, 302);
+
+ if (_game._objects.isInInventory(OBJ_GREEN_FRAME))
+ _game._objects.setRoom(OBJ_GREEN_FRAME, 307);
+}
+
+void Scene104::processConversations() {
+ bool interlocutorTriggerFl = false;
+ bool heroTriggerFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 2:
+ case 10:
+ case 12:
+ case 16:
+ case 20:
+ case 21:
+ case 24:
+ _vm->_gameConv->setInterlocutorTrigger(75);
+ interlocutorTriggerFl = true;
+ break;
+
+ case 3:
+ if (!_needToGetUp) {
+ _vm->_gameConv->setInterlocutorTrigger(67);
+ interlocutorTriggerFl = true;
+ _needToGetUp = true;
+ }
+ break;
+
+ case 8:
+ _vm->_gameConv->setInterlocutorTrigger(87);
+ interlocutorTriggerFl = true;
+ break;
+
+ case 11:
+ _vm->_gameConv->setInterlocutorTrigger(77);
+ interlocutorTriggerFl = true;
+ break;
+
+ case 14:
+ case 25:
+ if (!_game._trigger) {
+ _richStatus = 0;
+ _coupleStatus = 5;
+ _vm->_gameConv->hold();
+ }
+ break;
+
+ case 22:
+ _vm->_gameConv->setInterlocutorTrigger(75);
+ _vm->_gameConv->setHeroTrigger(79);
+ interlocutorTriggerFl = true;
+ heroTriggerFl = true;
+ break;
+
+ case 23:
+ _vm->_gameConv->setInterlocutorTrigger(89);
+ interlocutorTriggerFl = true;
+ break;
+
+ case 28:
+ _vm->_gameConv->setInterlocutorTrigger(81);
+ interlocutorTriggerFl = true;
+ break;
+
+ case 30:
+ if (!_game._trigger) {
+ _vm->_gameConv->hold();
+ _richStatus = 4;
+ }
+ break;
+
+ case 32:
+ _coupleStatus = 14;
+ heroTriggerFl = true;
+ interlocutorTriggerFl = true;
+ _vm->_gameConv->hold();
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 67:
+ _vm->_gameConv->hold();
+ _coupleStatus = 12;
+ break;
+
+ case 69:
+ if (!_beforeSheLeaves && !_beforeHeLeaves && (_coupleStatus != 14) && !_needToStandUp) {
+ _richStatus = 0;
+ if (_sittingUp)
+ _coupleStatus = 4;
+ else
+ _coupleStatus = 12;
+ }
+ break;
+
+ case 71:
+ if (!_beforeSheLeaves && !_beforeHeLeaves && (_coupleStatus != 14) && !_needToStandUp) {
+ _richStatus = 0;
+ if (_sittingUp && !_beforeSheLeaves) {
+ _coupleStatus = 3;
+ _richStatus = 0;
+ }
+ }
+ break;
+
+ case 75:
+ _richStatus = 1;
+
+ if (_sittingUp) {
+ if (_action._activeAction._verbId == 20) {
+ _lookCount = 0;
+ _coupleStatus = 9;
+ } else if ((_action._activeAction._verbId == 21) || (_action._activeAction._verbId == 22)) {
+ _lookCount = 0;
+ _coupleStatus = 10;
+ } else {
+ _coupleStatus = 1;
+ }
+ } else {
+ _coupleStatus = 11;
+ }
+ break;
+
+ case 77:
+ _richStatus = 0;
+ _coupleStatus = 8;
+ break;
+
+ case 79:
+ _richStatus = 0;
+ _coupleStatus = 7;
+ break;
+
+ case 81:
+ _richStatus = 1;
+ _beforeHeLeaves = true;
+ _coupleStatus = 15;
+ break;
+
+ case 83:
+ _vm->_gameConv->release();
+ if (_coupleStatus != 17)
+ _game._player._stepEnabled = false;
+ break;
+
+ case 87:
+ _richStatus = 3;
+ break;
+
+ case 89:
+ _richStatus = 2;
+ break;
+
+ default:
+ break;
+ }
+
+ if (!heroTriggerFl && !_beforeSheLeaves)
+ _vm->_gameConv->setHeroTrigger(71);
+
+ if (!interlocutorTriggerFl)
+ _vm->_gameConv->setInterlocutorTrigger(69);
+
+ _richTalkCount = 0;
+ _manTalkCount = 0;
+ _womanTalkCount = 0;
+}
+
+void Scene104::handleWalkAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame() == _walkFrame)
+ return;
+
+ _walkFrame = _scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame();
+ int daaeResetFrame = -1;
+
+ switch (_walkFrame) {
+ case 1:
+ if (_walkStatus == 0) {
+ daaeResetFrame = 0;
+ } else {
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[2], SYNC_ANIM, _globals._animationIndexes[1]);
+ daaeResetFrame = 1;
+ }
+ break;
+
+ case 138:
+ _walkStatus = 0;
+ daaeResetFrame = 0;
+ break;
+
+ default:
+ break;
+ }
+
+ if (daaeResetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[2], daaeResetFrame);
+ _walkFrame = daaeResetFrame;
+ }
+}
+
+void Scene104::handleRichAnimations() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _richFrame)
+ return;
+
+ _richFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int random;
+ int resetFrame = -1;
+
+ switch (_richFrame) {
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 8:
+ case 14:
+ case 22:
+ case 34:
+ case 40:
+ case 44:
+ case 48:
+ random = -1;
+ if (_richStatus == 1) {
+ random = _vm->getRandomNumber(1, 3);
+ ++_richTalkCount;
+ if (_richTalkCount > 15) {
+ _richStatus = 0;
+ random = 40;
+ }
+ }
+
+ if (_richStatus == 0)
+ random = _vm->getRandomNumber(7, 80);
+
+ if (_richStatus == 2) {
+ random = 4;
+ _richStatus = 1;
+ _richTalkCount = 8;
+ }
+
+ if (_richStatus == 3) {
+ random = 5;
+ _richStatus = 1;
+ _richTalkCount = 8;
+ }
+
+ if (_richStatus == 4)
+ random = 6;
+
+ if (_richStatus == 5)
+ random = 7;
+
+ switch (random) {
+ case 1:
+ resetFrame = 1;
+ break;
+
+ case 2:
+ resetFrame = 2;
+ break;
+
+ case 3:
+ resetFrame = 3;
+ break;
+
+ case 4:
+ resetFrame = 23;
+ break;
+
+ case 5:
+ resetFrame = 35;
+ break;
+
+ case 6:
+ resetFrame = 49;
+ break;
+
+ case 7:
+ resetFrame = 41;
+ break;
+
+ case 8:
+ resetFrame = 45;
+ break;
+
+ case 9:
+ resetFrame = 9;
+ break;
+
+ case 10:
+ resetFrame = 5;
+ break;
+
+ case 11:
+ resetFrame = 15;
+ break;
+
+ default:
+ resetFrame = 0;
+ break;
+ }
+ break;
+
+ case 117:
+ _coupleStatus = 13;
+ break;
+
+ case 125:
+ resetFrame = 124;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _richFrame = resetFrame;
+ }
+}
+
+void Scene104::handleCoupleAnimations() {
+ if (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == _coupleFrame)
+ return;
+
+ _coupleFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random;
+
+ switch (_coupleFrame) {
+ case 1:
+ case 103:
+ case 104:
+ case 105:
+ if (_coupleStatus == 11)
+ resetFrame = 0;
+ else {
+ resetFrame = _vm->getRandomNumber(102, 104);
+ ++_womanTalkCount;
+ if (_womanTalkCount > 15) {
+ if (_needToGetUp) {
+ _coupleStatus = 6;
+ resetFrame = 1;
+ } else {
+ _coupleStatus = 11;
+ resetFrame = 0;
+ }
+ }
+ }
+ break;
+
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ case 14:
+ case 15:
+ case 25:
+ case 33:
+ case 41:
+ switch (_coupleFrame) {
+ case 9:
+ _coupleStatus = 6;
+ break;
+
+ case 33:
+ _vm->_gameConv->release();
+ if (_action._activeAction._verbId == 13)
+ _coupleStatus = 4;
+
+ break;
+
+ case 41:
+ _vm->_gameConv->release();
+ _sittingUp = true;
+ if (_needToTalk)
+ _coupleStatus = 3;
+ else
+ _coupleStatus = 1;
+ break;
+
+ default:
+ break;
+ }
+
+ random = -1;
+
+ switch (_coupleStatus) {
+ case 1:
+ random = 12;
+ break;
+
+ case 2:
+ case 7:
+ case 8:
+ random = 11;
+ break;
+
+ case 3:
+ random = _vm->getRandomNumber(4, 6);
+ ++_manTalkCount;
+ if (_manTalkCount > 15) {
+ _coupleStatus = 1;
+ random = 12;
+ }
+ break;
+
+ case 4:
+ if (_beforeSheLeaves) {
+ random = 10;
+ } else {
+ random = _vm->getRandomNumber(1, 3);
+ ++_womanTalkCount;
+ if (_womanTalkCount > 15) {
+ _coupleStatus = 1;
+ random = 12;
+ }
+ }
+ break;
+
+ case 5:
+ _coupleStatus = 1;
+ random = 8;
+ break;
+
+ case 6:
+ _coupleStatus = 1;
+ random = 7;
+ break;
+
+ case 13:
+ random = 9;
+ break;
+
+ case 15:
+ random = 10;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 12;
+ break;
+
+ case 2:
+ resetFrame = 13;
+ break;
+
+ case 3:
+ resetFrame = 14;
+ break;
+
+ case 4:
+ resetFrame = 9;
+ break;
+
+ case 5:
+ resetFrame = 10;
+ break;
+
+ case 6:
+ resetFrame = 11;
+ break;
+
+ case 7:
+ resetFrame = 33;
+ break;
+
+ case 8:
+ resetFrame = 25;
+ break;
+
+ case 9:
+ resetFrame = 54;
+ break;
+
+ case 10:
+ resetFrame = 41;
+ break;
+
+ case 11:
+ resetFrame = 15;
+ break;
+
+ case 12:
+ resetFrame = 14;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 17:
+ case 18:
+ case 19:
+ case 20:
+ case 21:
+ case 22:
+ case 23:
+ random = -1;
+ switch (_coupleStatus) {
+ case 1:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 15:
+ case 16:
+ random = 7;
+ break;
+
+ case 2:
+ random = 8;
+ break;
+
+ case 7:
+ random = _vm->getRandomNumber(4, 6);
+ ++_manTalkCount;
+ if (_manTalkCount > 15) {
+ _coupleStatus = 2;
+ random = 8;
+ }
+ break;
+
+ case 8:
+ random = _vm->getRandomNumber(1, 3);
+ ++_womanTalkCount;
+ if (_womanTalkCount > 15) {
+ _coupleStatus = 1;
+ random = 7;
+ }
+ break;
+
+ case 9:
+ random = 1;
+ ++_lookCount;
+ if (_lookCount > 6) {
+ _coupleStatus = 1;
+ random = 7;
+ }
+ break;
+
+ case 10:
+ random = 1;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 20;
+ break;
+
+ case 2:
+ resetFrame = 21;
+ break;
+
+ case 3:
+ resetFrame = 22;
+ break;
+
+ case 4:
+ resetFrame = 17;
+ break;
+
+ case 5:
+ resetFrame = 18;
+ break;
+
+ case 6:
+ resetFrame = 19;
+ break;
+
+ case 7:
+ resetFrame = 23;
+ break;
+
+ case 8:
+ resetFrame = 20;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 52:
+ _walkStatus = 1;
+ resetFrame = 54;
+ break;
+
+ case 55:
+ if (_coupleStatus != 13)
+ resetFrame = 54;
+
+ break;
+
+ case 89:
+ _vm->_gameConv->release();
+ break;
+
+ case 90:
+ if (_coupleStatus != 14) {
+ resetFrame = 89;
+ } else {
+ resetFrame = 90;
+ _globals[kTempVar] = 200;
+ }
+ break;
+
+ case 102:
+ _vm->_gameConv->release();
+ _game._player._playerPos = Common::Point(166, 126);
+ _game._player.resetFacing(FACING_SOUTH);
+ resetFrame = 105;
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[1]);
+ break;
+
+ case 106:
+ _coupleStatus = 17;
+ resetFrame = 105;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _coupleFrame = resetFrame;
+ }
+}
+
+void Scene104::handlePlayerWalk() {
+ if (_game._player._frameNumber == _lastPlayerFrame)
+ return;
+
+ _lastPlayerFrame = _game._player._frameNumber;
+ switch (_game._player._facing) {
+ case FACING_NORTH:
+ case FACING_SOUTH:
+ if ((_game._player._frameNumber == 5) || (_game._player._frameNumber == 11))
+ _vm->_sound->command(68);
+ break;
+
+ case FACING_NORTHEAST:
+ case FACING_NORTHWEST:
+ case FACING_SOUTHEAST:
+ case FACING_SOUTHWEST:
+ if ((_game._player._frameNumber == 7) || (_game._player._frameNumber == 14))
+ _vm->_sound->command(68);
+ break;
+
+ case FACING_EAST:
+ case FACING_WEST:
+ if ((_game._player._frameNumber == 8) || (_game._player._frameNumber == 16))
+ _vm->_sound->command(68);
+ break;
+
+ default:
+ break;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene105::Scene105(MADSEngine *vm) : Scene1xx(vm) {
+}
+
+void Scene105::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+}
+
+void Scene105::setup() {
+ if (_globals[kCurrentYear] == 1993)
+ _scene->_variant = 1;
+
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_LIGHT_FIXTURE);
+}
+
+void Scene105::enter() {
+ _scene->loadSpeech(8);
+
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('x', 3));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*RDR_9");
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('a', 0));
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('a', 1));
+ if (_globals[kCurrentYear] == 1993)
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('z', -1));
+
+ if ((_globals[kCurrentYear] == 1881) && (!_globals[kHintThatDaaeIsHome2])) {
+ if ((_globals[kJacquesNameIsKnown] == 2) && (_globals[kMadameNameIsKnown] == 2) &&
+ _globals[kPanelIn206] && _globals[kDoneRichConv203] && _game._objects.isInInventory(OBJ_LANTERN) &&
+ ((_game._objects.isInInventory(OBJ_CABLE_HOOK) && _game._objects.isInInventory(OBJ_ROPE)) || _game._objects.isInInventory(OBJ_ROPE_WITH_HOOK))) {
+ _globals[kHintThatDaaeIsHome2] = true;
+ _scene->_sequences.addTimer(300, 75);
+ }
+ }
+
+ if ((_game._objects.isInRoom(OBJ_LANTERN)) && (_globals[kCurrentYear] == 1881)) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ } else {
+ _scene->_hotspots.activate(NOUN_LANTERN, false);
+ }
+
+ if (_game._objects.isInRoom(OBJ_RED_FRAME)) {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ } else {
+ _scene->_hotspots.activate(NOUN_RED_FRAME, false);
+ }
+
+ if (_globals[kCurrentYear] == 1993) {
+ _scene->drawToBackground(_globals._spriteIndexes[3], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_PROPS, false);
+ _scene->_hotspots.activate(NOUN_BEAR_PROP, false);
+ _scene->_hotspots.activate(NOUN_STAIR_UNIT, false);
+ _scene->_hotspots.activate(NOUN_PROP, false);
+ _scene->_hotspots.activate(NOUN_ELEPHANT_PROP, false);
+ _scene->_hotspots.activate(NOUN_COLUMN_PROP, false);
+
+ int tmpIdx = _scene->_dynamicHotspots.add(NOUN_COLUMN_PROP, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(132, 24, 132 + 21, 24 + 105));
+ _scene->_dynamicHotspots.setPosition(tmpIdx, Common::Point(159, 133), FACING_NORTHWEST);
+
+ tmpIdx = _scene->_dynamicHotspots.add(NOUN_COLUMN_PROP, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(56, 45, 56 + 11, 45 + 77));
+ _scene->_dynamicHotspots.setPosition(tmpIdx, Common::Point(72, 126), FACING_NORTHWEST);
+
+ _scene->_dynamicHotspots.add(NOUN_PROP, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(0, 125, 29, 125 + 31));
+ _scene->_dynamicHotspots.add(NOUN_PROP, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(29, 136, 29 + 50, 136 + 20));
+ _scene->_dynamicHotspots.add(NOUN_PROP, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(79, 141, 79 + 53, 141 + 15));
+
+ _scene->_dynamicHotspots.add(NOUN_BEAR_PROP, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(278, 132, 278 + 21, 132 + 24));
+ _scene->_dynamicHotspots.add(NOUN_BEAR_PROP, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(299, 146, 299 + 8, 146 + 10));
+ _scene->_dynamicHotspots.add(NOUN_BEAR_PROP, VERB_WALKTO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(269, 142, 269 + 8, 142 + 8));
+
+ _scene->_dynamicHotspots.add(NOUN_LIGHT_FIXTURE, VERB_LOOK_AT, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(102, 14, 102 + 24, 102 + 10));
+ }
+
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ if ((_scene->_priorSceneId == 106) || (_scene->_priorSceneId == 114)) {
+ _game._player._playerPos = Common::Point(198, 132);
+ _game._player._facing = FACING_WEST;
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ } else if ((_scene->_priorSceneId == 103) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(3, 112);
+ _game._player._facing = FACING_SOUTHEAST;
+ _game._player.walk(Common::Point(45, 131), FACING_SOUTHEAST);
+ _game._player.setWalkTrigger(60);
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 8);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ } else if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene105::step() {
+ switch (_game._trigger) {
+ case 60:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 8);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 61);
+ _vm->_sound->command(66);
+ break;
+
+ case 61:
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ _game._player._stepEnabled = true;
+ break;
+
+ case 75:
+ _scene->playSpeech(8);
+ _scene->_sequences.addTimer(120, 76);
+ break;
+
+ case 76:
+ _vm->_dialogs->show(10537);
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene105::actions() {
+ if ((_action.isAction(VERB_PUSH, NOUN_THUNDER_MACHINE)) || (_action.isAction(VERB_PULL, NOUN_THUNDER_MACHINE))) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('t', 1), 70);
+ _scene->deleteSequence(_globals._sequenceIndexes[4]);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[4], SYNC_ANIM, _globals._animationIndexes[0]);
+ _scene->_sequences.setSeqPlayer(_globals._animationIndexes[0], false);
+ break;
+
+ case 70:
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[4], SYNC_ANIM, _globals._animationIndexes[0]);
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_UP, NOUN_CIRCULAR_STAIRCASE)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('u', 1), 1);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ break;
+
+ case 1:
+ _scene->_nextSceneId = 106;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_DOWN, NOUN_CIRCULAR_STAIRCASE)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 1), 1);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ break;
+
+ case 1:
+ _scene->_nextSceneId = 114;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_RED_FRAME) && (_game._objects.isInRoom(OBJ_RED_FRAME) || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ if (_globals[kCurrentYear] == 1881) {
+ int count = 0;
+
+ if (_game._objects.isInInventory(NOUN_YELLOW_FRAME))
+ ++count;
+
+ if (_game._objects.isInInventory(NOUN_GREEN_FRAME))
+ ++count;
+
+ if (_game._objects.isInInventory(NOUN_BLUE_FRAME))
+ ++count;
+
+ if (count < 3)
+ _globals[kPlayerScore] += 5;
+ }
+
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[5], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _scene->_hotspots.activate(NOUN_RED_FRAME, false);
+ _game._objects.addToInventory(OBJ_RED_FRAME);
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[5]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ break;
+
+ case 3:
+ if (_globals[kCurrentYear] == 1881)
+ _vm->_dialogs->showItem(OBJ_RED_FRAME, 842, 0);
+ else
+ _vm->_dialogs->showItem(OBJ_RED_FRAME, 802, 0);
+
+ _game._player._stepEnabled = true;
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_LANTERN) && (_game._objects.isInRoom(OBJ_LANTERN) || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _globals[kPlayerScore] += 5;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[6] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[6], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[6], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[6], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_SPRITE, 4, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _scene->_hotspots.activate(NOUN_LANTERN, false);
+ _game._objects.addToInventory(OBJ_LANTERN);
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[6]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ break;
+
+ case 3:
+ _vm->_dialogs->showItem(OBJ_LANTERN, 801, 0);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR) || _action.isAction(VERB_OPEN, NOUN_DOOR) || (_game._trigger) ||
+ _action.isAction(VERB_UNLOCK, NOUN_DOOR) || _action.isAction(VERB_LOCK, NOUN_DOOR)) {
+ if ((_globals[kCurrentYear] == 1881) && !_action.isAction(VERB_UNLOCK) && !_action.isAction(VERB_LOCK)){
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[6] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[6], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[6], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[6], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_SPRITE, 4, 65);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2:
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(180, 3);
+ break;
+
+ case 3:
+ _scene->_nextSceneId = 103;
+ break;
+
+ case 65:
+ _vm->_sound->command(24);
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 8);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 66);
+ _vm->_sound->command(66);
+ break;
+
+ case 66: {
+ int tmpIdx = _globals._sequenceIndexes[2];
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 8);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[2], SYNC_SEQ, tmpIdx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ _game._player.walk(Common::Point(0, 111), FACING_NORTHWEST);
+ }
+ break;
+
+ default:
+ break;
+ }
+ } else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[6] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[6], true, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[6], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[6], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1: {
+ int tmpIdx = _globals._sequenceIndexes[6];
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], true, 4);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[6], SYNC_SEQ, tmpIdx);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[6], false);
+ _vm->_sound->command(73);
+ _scene->_sequences.addTimer(15, 2);
+ }
+ break;
+
+ case 2:
+ _scene->deleteSequence(_globals._sequenceIndexes[6]);
+ _globals._sequenceIndexes[6] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[6], true, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[6], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[6], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[6]);
+ _game._player._visible = true;
+ if (_action.isAction(VERB_LOCK) || _action.isAction(VERB_UNLOCK))
+ _vm->_dialogs->show(32);
+ else
+ _vm->_dialogs->show(10536);
+
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(10510);
+ else
+ _vm->_dialogs->show(10511);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(10512);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CIRCULAR_STAIRCASE)) {
+ _vm->_dialogs->show(10513);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LANTERN) && _game._objects.isInRoom(OBJ_LANTERN)) {
+ _vm->_dialogs->show(10514);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RED_FRAME) && _game._objects.isInRoom(OBJ_RED_FRAME)){
+ if (_globals[kCurrentYear] == 1881)
+ _vm->_dialogs->show(10530);
+ else
+ _vm->_dialogs->show(10515);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR)) {
+ _vm->_dialogs->show(10516);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(10517);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PROP_TABLE)) {
+ _vm->_dialogs->show(10518);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BEAR_PROP)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(10519);
+ else
+ _vm->_dialogs->show(10538);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ELEPHANT_PROP)) {
+ _vm->_dialogs->show(10520);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COLUMN_PROP)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(10521);
+ else
+ _vm->_dialogs->show(10539);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_THUNDER_MACHINE)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(10522);
+ else
+ _vm->_dialogs->show(10540);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAIR_UNIT)) {
+ _vm->_dialogs->show(10523);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PROP)) {
+ _vm->_dialogs->show(10524);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PROPS)) {
+ _vm->_dialogs->show(10525);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_EXIT_SIGN)) {
+ _vm->_dialogs->show(10526);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLATS)) {
+ _vm->_dialogs->show(10527);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HEMP)) {
+ _vm->_dialogs->show(10528);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PIPE)) {
+ _vm->_dialogs->show(10529);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GRAFFITI)) {
+ _vm->_dialogs->show(10531);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LIGHT_FIXTURE)) {
+ _vm->_dialogs->show(10535);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_BEAR_PROP)) {
+ _vm->_dialogs->show(10532);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_BEAR_PROP)) {
+ _vm->_dialogs->show(10533);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_DOOR)) {
+ _vm->_dialogs->show(10534);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene105::preActions() {
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR_TO_PIT))
+ _game._player._walkOffScreenSceneId = 102;
+
+ if (_action.isAction(VERB_OPEN, NOUN_DOOR) || _action.isAction(VERB_UNLOCK, NOUN_DOOR) || _action.isAction(VERB_LOCK, NOUN_DOOR))
+ _game._player.walk(Common::Point(33, 128), FACING_NORTHWEST);
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene106::Scene106(MADSEngine *vm) : Scene1xx(vm) {
+ _sandbagHostpotId = -1;
+}
+
+void Scene106::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+ s.syncAsSint16LE(_sandbagHostpotId);
+}
+
+void Scene106::setup() {
+ if (_globals[kCurrentYear] == 1881)
+ _scene->_variant = 1;
+
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene106::enter() {
+ _scene->loadSpeech(8);
+
+ if (_globals[kCurrentYear] == 1993) {
+ if (!_game._objects.isInInventory(OBJ_SANDBAG)) {
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ }
+ } else {
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('z', -1));
+ if (_game._objects.isInRoom(OBJ_CABLE_HOOK) && !_game._objects.isInInventory(OBJ_ROPE_WITH_HOOK)) {
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('p', 0));
+ }
+ }
+
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('a', 0));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites("*RDR_9");
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('a', 1));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('a', 2));
+
+ if ((_globals[kCurrentYear] == 1881) && (!_globals[kHintThatDaaeIsHome1])) {
+ if ((_globals[kJacquesNameIsKnown] == 2) && (_globals[kMadameNameIsKnown] == 2)
+ && (_globals[kPanelIn206]) && (_globals[kDoneRichConv203]) && (_game._objects.isInInventory(OBJ_LANTERN))
+ && ((_game._objects.isInInventory(OBJ_CABLE_HOOK) && _game._objects.isInInventory(OBJ_ROPE))
+ || _game._objects.isInInventory(OBJ_ROPE_WITH_HOOK))) {
+ _globals[kHintThatDaaeIsHome1] = true;
+ _scene->_sequences.addTimer(300, 85);
+ }
+ }
+
+ if ((_globals[kSandbagStatus] == 1) && (_globals[kCurrentYear] == 1993) && _game._objects.isInRoom(OBJ_SANDBAG)) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -2);
+ _sandbagHostpotId = _scene->_dynamicHotspots.add(NOUN_SANDBAG, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(227, 140, 227 + 18, 140 + 11));
+ _scene->_dynamicHotspots.setPosition(_sandbagHostpotId, Common::Point(224, 152), FACING_NORTHEAST);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 2);
+ }
+
+ if (_globals[kCurrentYear] == 1881) {
+ _scene->drawToBackground(_globals._spriteIndexes[7], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_BIG_PROP, false);
+ _scene->_hotspots.activate(NOUN_STATUE, false);
+ _scene->_hotspots.activate(NOUN_PLANT_PROP, false);
+ _scene->_hotspots.activate(NOUN_PEDESTAL, false);
+ _scene->_hotspots.activate(NOUN_SANDBAG, false);
+ _scene->_hotspots.activate(NOUN_CRATE, false);
+
+ _scene->_dynamicHotspots.add(NOUN_SANDBAG, VERB_LOOK_AT, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(40, 47, 40 + 11, 47 + 17));
+ _scene->_dynamicHotspots.add(NOUN_SANDBAG, VERB_LOOK_AT, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(98, 14, 98 + 5, 14 + 10));
+ _scene->_dynamicHotspots.add(NOUN_SANDBAG, VERB_LOOK_AT, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(111, 23, 111 + 6, 23 + 9));
+ _scene->_dynamicHotspots.add(NOUN_SANDBAG, VERB_LOOK_AT, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(119, 12, 119 + 5, 12 + 8));
+
+ int idx = _scene->_dynamicHotspots.add(NOUN_STAGE, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(80, 114, 80 + 24, 114 + 4));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(93, 121), FACING_NONE);
+
+ idx = _scene->_dynamicHotspots.add(NOUN_STAGE, VERB_WALK_ACROSS, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(106, 102, 106 + 5, 102 + 10));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(108, 109), FACING_NONE);
+ } else {
+ _scene->_hotspots.activate(NOUN_BOXES, false);
+ _scene->_hotspots.activate(NOUN_CASE, false);
+ }
+
+ if ((_game._objects.isInRoom(OBJ_CABLE_HOOK)) && (_globals[kCurrentYear] == 1881) && !_game._objects.isInInventory(OBJ_ROPE_WITH_HOOK)){
+ _globals._sequenceIndexes[8] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[8], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[8], 3);
+ } else {
+ _scene->_hotspots.activate(NOUN_CABLE_HOOK, false);
+ }
+
+ if (_scene->_priorSceneId == 109) {
+ _game._player._playerPos = Common::Point(180, 58);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(179, 63), FACING_SOUTH);
+ _game._player.setWalkTrigger(60);
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ } else if ((_scene->_priorSceneId == 105) || (_scene->_priorSceneId == 301)) {
+ _game._player._playerPos = Common::Point(235, 142);
+ _game._player._facing = FACING_WEST;
+ _game._player.walk(Common::Point(227, 143), FACING_WEST);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ } else if (_scene->_priorSceneId == 107) {
+ _game._player._playerPos = Common::Point(143, 68);
+ _game._player._facing = FACING_WEST;
+ _game._player.walk(Common::Point(163, 68), FACING_SOUTHEAST);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ } else if ((_scene->_priorSceneId == 108) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player.firstWalk(Common::Point(-20, 130), FACING_SOUTHEAST, Common::Point(19, 147), FACING_NORTHEAST, true);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ } else if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene106::step() {
+ switch (_game._trigger) {
+ case 85:
+ _scene->playSpeech(8);
+ _scene->_sequences.addTimer(120, 86);
+ break;
+
+ case 86:
+ _vm->_dialogs->show(10637);
+ break;
+
+ case 60:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 5);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 61);
+ break;
+
+ case 61:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ _vm->_sound->command(25);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene106::actions() {
+ if ((_action.isAction(VERB_TAKE, NOUN_SANDBAG)) && (_scene->_customDest.y < 61)) {
+ _vm->_dialogs->show(10635);
+ _action._inProgress = false;
+ return;
+ } else if (_action.isAction(VERB_TAKE, NOUN_SANDBAG)) {
+ if (_game._objects.isInRoom(OBJ_SANDBAG)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[5], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _scene->_dynamicHotspots.remove(_sandbagHostpotId);
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[5]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ break;
+
+ case 3:
+ _game._objects.addToInventory(OBJ_SANDBAG);
+ _vm->_dialogs->showItem(OBJ_SANDBAG, 803, 0);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_CABLE_HOOK)) {
+ if (_game._objects.isInRoom(OBJ_CABLE_HOOK)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[5], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ _globals[kPlayerScore] += 5;
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[8]);
+ _scene->_hotspots.activate(NOUN_CABLE_HOOK, false);
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[5]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ break;
+
+ case 3:
+ _game._objects.addToInventory(OBJ_CABLE_HOOK);
+ _vm->_dialogs->showItem(OBJ_CABLE_HOOK, 822, 0);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ switch (_game._trigger) {
+ case 75:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 1), 76);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ _action._inProgress = false;
+ return;
+
+ case 76:
+ _scene->_nextSceneId = 105;
+ _action._inProgress = false;
+ return;
+
+ case 80:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('u', 1), 81);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ _action._inProgress = false;
+ return;
+
+ case 81:
+ _scene->_sequences.addTimer(120, 82);
+ _action._inProgress = false;
+ return;
+
+ case 82:
+ _scene->_nextSceneId = 301;
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_STAGE_RIGHT_WING)) {
+ _scene->_nextSceneId = 107;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_DOWN) || _action.isAction(VERB_CLIMB_UP)) {
+ if (_globals[kSandbagStatus] == 1) {
+ switch (_game._trigger) {
+ case 0:
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('s',-1), 1);
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ break;
+
+ case 1:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _game._player._visible = true;
+ _game._player._playerPos = Common::Point(225, 143);
+ _game._player.resetFacing(FACING_EAST);
+ _game._player.walk(Common::Point(236, 142), FACING_EAST);
+
+ if (_action.isAction(VERB_CLIMB_DOWN))
+ _game._player.setWalkTrigger(75);
+ else
+ _game._player.setWalkTrigger(80);
+ break;
+
+ default:
+ break;
+ }
+ } else {
+ switch (_game._trigger) {
+ case 0:
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 4, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 9);
+ _scene->_sequences.addTimer(6, 2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1:
+ _vm->_sound->command(70);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 2);
+ _sandbagHostpotId = _scene->_dynamicHotspots.add(NOUN_SANDBAG, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(227, 140, 227 + 18, 140 + 11));
+ _scene->_dynamicHotspots.setPosition(_sandbagHostpotId, Common::Point(224, 152), FACING_NORTHEAST);
+ break;
+
+ case 2:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('s', 1), 3);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ break;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ _game._player._playerPos = Common::Point(228, 140);
+ _game._player.resetFacing(FACING_SOUTHEAST);
+ _globals[kSandbagStatus] = 1;
+ _vm->_dialogs->show(10632);
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR) || _action.isAction(VERB_OPEN, NOUN_DOOR)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_SPRITE, 4, 65);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 67);
+ break;
+
+ case 65:
+ _vm->_sound->command(24);
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 5);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 66);
+ break;
+
+ case 66: {
+ int idx = _globals._sequenceIndexes[2];
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 5);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[2], SYNC_SEQ, idx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ }
+ break;
+
+ case 67:
+ _game._player._visible = true;
+ _game._player.walk(Common::Point(180, 60), FACING_NORTH);
+ _game._player.setWalkTrigger(68);
+ break;
+
+ case 68:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 69);
+ break;
+
+ case 69:
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ _scene->_nextSceneId = 109;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(10610);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_STAGE_RIGHT_WING)) {
+ _vm->_dialogs->show(10611);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAGE_LEFT_WING)) {
+ _vm->_dialogs->show(10612);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_IN_TWO)) {
+ _vm->_dialogs->show(10613);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CYCLORAMA)) {
+ _vm->_dialogs->show(10614);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAGE)) {
+ _vm->_dialogs->show(10615);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PEDESTAL)) {
+ _vm->_dialogs->show(10616);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PLANT_PROP)) {
+ _vm->_dialogs->show(10617);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SANDBAG)) {
+ if (_scene->_customDest.y < 60) {
+ _vm->_dialogs->show(10618);
+ _action._inProgress = false;
+ return;
+ } else if (_game._objects.isInRoom(OBJ_SANDBAG)) {
+ _vm->_dialogs->show(10633);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isObject(NOUN_STATUE)) {
+ _vm->_dialogs->show(10619);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CIRCULAR_STAIRCASE)) {
+ _vm->_dialogs->show(10620);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BATTEN)) {
+ _vm->_dialogs->show(10621);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR)) {
+ _vm->_dialogs->show(10622);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOXES) || _action.isObject(NOUN_BOX)) {
+ _vm->_dialogs->show(10623);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BIG_PROP)) {
+ _vm->_dialogs->show(10624);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CRATE)) {
+ _vm->_dialogs->show(10625);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CASE)) {
+ if (_globals[kCurrentYear] == 1881)
+ _vm->_dialogs->show(10638);
+ else
+ _vm->_dialogs->show(10636);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_VENTILATION_DUCT)) {
+ _vm->_dialogs->show(10626);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_JUNK)) {
+ _vm->_dialogs->show(10627);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLATS)) {
+ _vm->_dialogs->show(10628);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(10629);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CABLE_HOOK) && _game._objects.isInRoom(OBJ_CABLE_HOOK)) {
+ _vm->_dialogs->show(10639);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_STATUE)) {
+ _vm->_dialogs->show(10630);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_DOOR)) {
+ _vm->_dialogs->show(10634);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene106::preActions() {
+ if (_action.isAction(VERB_EXIT_TO, NOUN_STAGE_LEFT_WING))
+ _game._player._walkOffScreenSceneId = 108;
+
+ if (_action.isAction(VERB_OPEN, NOUN_DOOR))
+ _game._player.walk(Common::Point(179, 63), FACING_NORTHWEST);
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene107::Scene107(MADSEngine *vm) : Scene1xx(vm) {
+}
+
+void Scene107::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+}
+
+void Scene107::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene107::enter() {
+ if (_globals[kCurrentYear] == 1993)
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
+
+ if (_game._objects.isInRoom(OBJ_YELLOW_FRAME)) {
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites("*RRD_9");
+ }
+
+ if (_game._objects.isInRoom(OBJ_YELLOW_FRAME)) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ } else {
+ _scene->_hotspots.activate(NOUN_YELLOW_FRAME, false);
+ }
+
+ if (_globals[kCurrentYear] == 1993) {
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_PROP_TABLE, false);
+ } else {
+ _scene->_hotspots.activate(NOUN_HEADSET, false);
+ }
+
+ if (_scene->_priorSceneId == 106) {
+ _game._player._playerPos = Common::Point(276, 73);
+ _game._player._facing = FACING_SOUTHWEST;
+ _game._player.walk(Common::Point(248, 75), FACING_SOUTHWEST);
+ } else if ((_scene->_priorSceneId == 104) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ if (_game._player._playerPos.y > 128) {
+ _game._player._playerPos.x = 216;
+ _game._player._facing = FACING_NORTHWEST;
+ } else if (_game._player._playerPos.y > 99) {
+ _game._player._playerPos.x = 127;
+ _game._player._facing = FACING_NORTHWEST;
+ } else {
+ _game._player._playerPos.x = 44;
+ _game._player._facing = FACING_NORTHEAST;
+ }
+ _game._player._playerPos.y = 143;
+ }
+
+ sceneEntrySound();
+}
+
+void Scene107::step() {
+}
+
+void Scene107::actions() {
+ if (_action.isAction(VERB_WALK_ONTO, NOUN_STAGE)) {
+ _scene->_nextSceneId = 104;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK, NOUN_BACKSTAGE)) {
+ _scene->_nextSceneId = 106;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_YELLOW_FRAME) && (_game._objects.isInRoom(OBJ_YELLOW_FRAME) || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ if (_globals[kCurrentYear] == 1881) {
+ int count = 0;
+ if (_game._objects.isInInventory(OBJ_GREEN_FRAME))
+ ++count;
+ if (_game._objects.isInInventory(OBJ_RED_FRAME))
+ ++count;
+ if (_game._objects.isInInventory(OBJ_BLUE_FRAME))
+ ++count;
+
+ if (count < 3)
+ _globals[kPlayerScore] += 5;
+ }
+
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _scene->_hotspots.activate(NOUN_YELLOW_FRAME, false);
+ _game._objects.addToInventory(OBJ_YELLOW_FRAME);
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[1]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ break;
+
+ case 3:
+ if (_globals[kCurrentYear] == 1881)
+ _vm->_dialogs->showItem(OBJ_YELLOW_FRAME, 843, 0);
+ else
+ _vm->_dialogs->showItem(OBJ_YELLOW_FRAME, 804, 0);
+
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(10710);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_STAGE)) {
+ _vm->_dialogs->show(10711);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_IN_TWO)) {
+ _vm->_dialogs->show(10712);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_IN_ONE)) {
+ _vm->_dialogs->show(10713);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CYCLORAMA)) {
+ _vm->_dialogs->show(10714);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COUNTERWEIGHT_SYSTEM)) {
+ _vm->_dialogs->show(10715);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PURCHASE_LINES)) {
+ _vm->_dialogs->show(10716);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LOCKRAIL)) {
+ _vm->_dialogs->show(10717);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAGE)) {
+ _vm->_dialogs->show(10718);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PROP_TABLE)) {
+ _vm->_dialogs->show(10719);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ACT_CURTAIN)) {
+ _vm->_dialogs->show(10720);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LEG)) {
+ _vm->_dialogs->show(10721);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_APRON)) {
+ _vm->_dialogs->show(10722);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PROSCENIUM_ARCH)) {
+ _vm->_dialogs->show(10723);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAGE)) {
+ _vm->_dialogs->show(10724);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BACKSTAGE)) {
+ _vm->_dialogs->show(10725);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME) && _game._objects.isInRoom(OBJ_YELLOW_FRAME)) {
+ if (_globals[kCurrentYear] == 1881)
+ _vm->_dialogs->show(10727);
+ else
+ _vm->_dialogs->show(10726);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HEADSET)) {
+ _vm->_dialogs->show(10728);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(10730);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_HEADSET)) {
+ _vm->_dialogs->show(10729);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_HEADSET)) {
+ _vm->_dialogs->show(10732);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_PULL, NOUN_PURCHASE_LINES)) {
+ _vm->_dialogs->show(10731);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene107::preActions() {
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene108::Scene108(MADSEngine *vm) : Scene1xx(vm) {
+ _anim0ActvFl = false;
+ _handRaisedFl = false;
+ _shutUpCount = -1;
+ _maxTalkCount = -1;
+ _charAction = -1;
+ _charFrame = -1;
+ _charHotspotId = -1;
+ _charTalkCount = -1;
+ _conversationCount = -1;
+ _prevShutUpFrame = -1;
+}
+
+void Scene108::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_handRaisedFl);
+ s.syncAsSint16LE(_shutUpCount);
+ s.syncAsSint16LE(_maxTalkCount);
+ s.syncAsSint16LE(_charAction);
+ s.syncAsSint16LE(_charFrame);
+ s.syncAsSint16LE(_charHotspotId);
+ s.syncAsSint16LE(_charTalkCount);
+ s.syncAsSint16LE(_conversationCount);
+ s.syncAsSint16LE(_prevShutUpFrame);
+}
+
+void Scene108::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if (_globals[kCurrentYear] == 1993)
+ _scene->_variant = 1;
+
+ _scene->addActiveVocab(NOUN_GENTLEMAN);
+ _scene->addActiveVocab(NOUN_CHARLES);
+}
+
+void Scene108::enter() {
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _anim0ActvFl = false;
+ _handRaisedFl = false;
+ _charTalkCount = 0;
+ _shutUpCount = 40;
+ _maxTalkCount = 15;
+ }
+
+ _vm->_gameConv->get(2);
+
+ if (_globals[kCurrentYear] == 1993) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
+ _scene->_hotspots.activate(NOUN_STOOL, false);
+ int idx = _scene->_dynamicHotspots.add(NOUN_STOOL, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(250, 68, 250 + 8, 68 + 21));
+ _scene->_dynamicHotspots[idx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(253, 75), FACING_SOUTHEAST);
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ } else {
+ _scene->_hotspots.activate(NOUN_HEADSET, false);
+ int idx = _scene->_dynamicHotspots.add(NOUN_WALL, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(258, 58, 258 + 6, 58 + 10));
+ _scene->_dynamicHotspots[idx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(236, 69), FACING_NORTHEAST);
+ }
+
+ if ((_globals[kCurrentYear] == 1993) && (_globals[kDoneBrieConv203] == 0)) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('c', 1), 1);
+ _anim0ActvFl = true;
+
+ if (_vm->_gameConv->_running == 2) {
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _charAction = 0;
+ _vm->_gameConv->run(2);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportValue(_globals[kJulieNameIsKnown]);
+ _vm->_gameConv->exportValue(_globals[kObservedPhan104]);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 55);
+ _shutUpCount = 40;
+ } else {
+ _charAction = 2;
+ }
+
+ if (_globals[kCharlesNameIsKnown]) {
+ _charHotspotId = _scene->_dynamicHotspots.add(NOUN_CHARLES, VERB_WALK_TO, SYNTAX_SINGULAR_MASC, EXT_NONE, Common::Rect(253, 52, 253 + 15, 52 + 34));
+ _scene->_dynamicHotspots[_charHotspotId]._articleNumber = PREP_ON;
+ } else {
+ _charHotspotId = _scene->_dynamicHotspots.add(NOUN_GENTLEMAN, VERB_WALK_TO, SYNTAX_MASC_NOT_PROPER, EXT_NONE, Common::Rect(253, 52, 253 + 15, 52 + 34));
+ _scene->_dynamicHotspots[_charHotspotId]._articleNumber = PREP_ON;
+ }
+ _scene->_dynamicHotspots.setPosition(_charHotspotId, Common::Point(235, 102), FACING_NORTHEAST);
+ }
+
+ if (_scene->_priorSceneId == 106) {
+ _game._player._playerPos = Common::Point(48, 81);
+ _game._player._facing = FACING_SOUTHEAST;
+ _game._player.walk(Common::Point(71, 76), FACING_SOUTHEAST);
+ } else if ((_scene->_priorSceneId == 104) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ if (_game._player._playerPos.y > 128) {
+ _game._player._playerPos.x = 124;
+ _game._player._facing = FACING_NORTHEAST;
+ } else if (_game._player._playerPos.y > 99) {
+ _game._player._playerPos.x = 185;
+ _game._player._facing = FACING_NORTHEAST;
+ } else {
+ _game._player._playerPos.x = 243;
+ _game._player._facing = FACING_NORTHWEST;
+ }
+
+ _game._player._playerPos.y = 143;
+ }
+
+ sceneEntrySound();
+}
+
+void Scene108::step() {
+ if (_anim0ActvFl)
+ handleCharAnimation();
+
+ if ((_globals[kWalkerConverse] == 2) || (_globals[kWalkerConverse] == 3)) {
+ ++_conversationCount;
+ if (_conversationCount > 200)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+}
+
+void Scene108::actions() {
+ if (_vm->_gameConv->_running == 2) {
+ handleCharlesConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_GENTLEMAN) || _action.isAction(VERB_TALK_TO, NOUN_CHARLES)) {
+ _charAction = 6;
+ _game._player._stepEnabled = false;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_ONTO, NOUN_STAGE)) {
+ _scene->_nextSceneId = 104;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK, NOUN_BACKSTAGE)) {
+ _scene->_nextSceneId = 106;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(10810);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(10730);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAGE)) {
+ _vm->_dialogs->show(10811);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_IN_TWO)) {
+ _vm->_dialogs->show(10812);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_IN_ONE)) {
+ _vm->_dialogs->show(10813);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PROSCENIUM_ARCH)) {
+ _vm->_dialogs->show(10814);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ACT_CURTAIN)) {
+ _vm->_dialogs->show(10815);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LEG)) {
+ _vm->_dialogs->show(10816);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CYCLORAMA)) {
+ _vm->_dialogs->show(10817);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLATS)) {
+ _vm->_dialogs->show(10818);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAGEMANAGERS_POST)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(10819);
+ else
+ _vm->_dialogs->show(10820);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STOOL)) {
+ _vm->_dialogs->show(10821);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BACKSTAGE)) {
+ _vm->_dialogs->show(10822);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAGE)) {
+ _vm->_dialogs->show(10823);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HEADSET)) {
+ _vm->_dialogs->show(10824);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(10826);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHARLES) || _action.isObject(NOUN_GENTLEMAN)) {
+ _vm->_dialogs->show(10827);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_CHARLES) || _action.isAction(VERB_TAKE, NOUN_GENTLEMAN)) {
+ _vm->_dialogs->show(10828);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_HEADSET)) {
+ _vm->_dialogs->show(10825);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_STOOL) && (_globals[kCurrentYear] == 1993)) {
+ _vm->_dialogs->show(10829);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_HEADSET)) {
+ _vm->_dialogs->show(10830);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene108::preActions() {
+}
+
+void Scene108::handleCharAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _charFrame)
+ return;
+
+ _charFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random = -1;
+
+ switch (_charFrame) {
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 92:
+ if (_charAction == 2)
+ random = _vm->getRandomNumber(2, 15);
+
+ if (_charAction == 6) {
+ _charTalkCount = 0;
+ _charAction = 1;
+ random = 1;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 5;
+ break;
+
+ case 2:
+ resetFrame = 0;
+ break;
+
+ case 3:
+ resetFrame = 1;
+ break;
+
+ case 4:
+ resetFrame = 2;
+ break;
+
+ default:
+ resetFrame = 3;
+ break;
+ }
+ break;
+
+ case 18:
+ case 19:
+ case 20:
+ case 21:
+ case 27:
+ case 33:
+ case 41:
+ case 51:
+ case 52:
+ case 53:
+ case 54:
+ case 55:
+ case 56:
+ case 57:
+ case 62:
+ case 73:
+ if (_charFrame == 18) {
+ _game._player._stepEnabled = true;
+ _vm->_gameConv->run(2);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportValue(_globals[kJulieNameIsKnown]);
+ _vm->_gameConv->exportValue(_globals[kObservedPhan104]);
+ }
+
+ if (_charAction == 1) {
+ if (_handRaisedFl) {
+ random = _vm->getRandomNumber(1, 3);
+ } else {
+ random = _vm->getRandomNumber(1, 4);
+ if (random == 4)
+ random = _vm->getRandomNumber(1, 4);
+ }
+
+ if (random == 4)
+ _handRaisedFl = true;
+
+ ++_charTalkCount;
+ if (_charTalkCount > _maxTalkCount) {
+ _charAction = 0;
+ _shutUpCount = 0;
+ _prevShutUpFrame = 10;
+ random = 12;
+ }
+ } else if (_charAction == 0) {
+ int delay = _vm->getRandomNumber(10, 15);
+ ++_shutUpCount;
+ if (_shutUpCount > delay) {
+ random = _vm->getRandomNumber(10, 16);
+ _prevShutUpFrame = random;
+ if (random == 15)
+ _shutUpCount = 16;
+ else
+ _shutUpCount = 0;
+ } else {
+ random = _prevShutUpFrame;
+ }
+ } else if (_charAction == 7) {
+ _charAction = 1;
+ random = 5;
+ } else if (_charAction == 3) {
+ _charAction = 1;
+ random = 6;
+ } else if (_charAction == 5) {
+ _charAction = 1;
+ random = 7;
+ } else if (_charAction == 4) {
+ _charAction = 1;
+ random = 8;
+ } else if (_charAction == 2) {
+ random = 9;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 18;
+ break;
+
+ case 2:
+ resetFrame = 19;
+ break;
+
+ case 3:
+ resetFrame = 20;
+ break;
+
+ case 4:
+ resetFrame = 62;
+ _charTalkCount += 5;
+ break;
+
+ case 5:
+ resetFrame = 21;
+ break;
+
+ case 6:
+ resetFrame = 41;
+ break;
+
+ case 7:
+ resetFrame = 33;
+ break;
+
+ case 8:
+ resetFrame = 27;
+ break;
+
+ case 9:
+ resetFrame = 74;
+ break;
+
+ case 10:
+ resetFrame = 51;
+ break;
+
+ case 11:
+ resetFrame = 53;
+ break;
+
+ case 12:
+ resetFrame = 54;
+ break;
+
+ case 13:
+ resetFrame = 55;
+ break;
+
+ case 14:
+ resetFrame = 56;
+ break;
+
+ case 15:
+ resetFrame = 57;
+ break;
+
+ case 16:
+ resetFrame = 52;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _charFrame = resetFrame;
+ }
+}
+
+void Scene108::handleCharlesConversation() {
+ switch (_action._activeAction._verbId) {
+ case 1:
+ case 25:
+ case 26:
+ _globals[kWalkerConverse] = 0;
+ _vm->_gameConv->setHeroTrigger(64);
+ if (_action._activeAction._verbId == 26)
+ _globals[kCharlesNameIsKnown] = 2;
+ break;
+
+ case 2:
+ if (!_globals[kCharlesNameIsKnown]) {
+ _scene->_dynamicHotspots.remove(_charHotspotId);
+ _charHotspotId = _scene->_dynamicHotspots.add(NOUN_CHARLES, VERB_WALK_TO, SYNTAX_SINGULAR_MASC, EXT_NONE, Common::Rect(253, 52, 253 + 15, 52 + 34));
+ _scene->_dynamicHotspots[_charHotspotId]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_charHotspotId, Common::Point(235, 102), FACING_NORTHEAST);
+ _globals[kCharlesNameIsKnown] = true;
+ }
+ break;
+
+ case 5:
+ _vm->_gameConv->setInterlocutorTrigger(66);
+ _maxTalkCount = 35;
+ break;
+
+ case 6:
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 15:
+ _maxTalkCount = 35;
+ break;
+
+ case 16:
+ _vm->_gameConv->setInterlocutorTrigger(68);
+ _maxTalkCount = 35;
+ break;
+
+ case 19:
+ _vm->_gameConv->setInterlocutorTrigger(72);
+ break;
+
+ case 22:
+ _vm->_gameConv->setInterlocutorTrigger(70);
+ break;
+
+ default:
+ _maxTalkCount = 15;
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 60:
+ _charAction = 1;
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ break;
+
+ case 62:
+ _globals[kWalkerConverse] = _vm->getRandomNumber(2, 3);
+ _conversationCount = 0;
+ _charAction = 0;
+ break;
+
+ case 64:
+ _charAction = 2;
+ break;
+
+ case 66:
+ _charAction = 5;
+ break;
+
+ case 68:
+ _charAction = 4;
+ break;
+
+ case 70:
+ _charAction = 7;
+ break;
+
+ case 72:
+ _charAction = 3;
+ break;
+
+ default:
+ break;
+ }
+
+ if ((_action._activeAction._verbId != 1) && (_action._activeAction._verbId != 5) &&
+ (_action._activeAction._verbId != 16) && (_action._activeAction._verbId != 19) &&
+ (_action._activeAction._verbId != 22) && (_action._activeAction._verbId != 25) &&
+ (_action._activeAction._verbId != 26) && (_charAction != 2)) {
+ _vm->_gameConv->setInterlocutorTrigger(60);
+ _vm->_gameConv->setHeroTrigger(62);
+ }
+
+ _charTalkCount = 0;
+ _shutUpCount = 40;
+ _handRaisedFl = false;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene109::Scene109(MADSEngine *vm) : Scene1xx(vm) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+
+ _currentFloor = -1;
+}
+
+void Scene109::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_anim2ActvFl);
+ s.syncAsByte(_anim3ActvFl);
+
+ s.syncAsSint16LE(_currentFloor);
+}
+
+void Scene109::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene109::enter() {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites("*RDR_6");
+
+ if (_globals[kCurrentYear] == 1881) {
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 3));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('x', 4));
+
+ _scene->_hotspots.activate(NOUN_LIGHT_FIXTURE, false);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+ _scene->_sequences.addTimer(1, 70);
+ } else {
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('z', 0));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('z', 1));
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('z', 2));
+
+ _scene->_hotspots.activate(NOUN_LAMP, false);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1);
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, 1);
+ _globals._sequenceIndexes[7] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[7], false, 1);
+ }
+
+ if (_scene->_priorSceneId == 106) {
+ _game._player._playerPos = Common::Point(31, 459);
+ _game._player._facing = FACING_NORTHEAST;
+ _scene->setCamera(Common::Point(0, 312));
+ _scene->sceneScale(467, 95, 442, 78);
+ _currentFloor = 1;
+ } else if (_scene->_priorSceneId == 111) {
+ if (_globals[kLeaveAngelMusicOn]) {
+ _globals[kLeaveAngelMusicOn] = false;
+ sceneEntrySound();
+ }
+ _game._player._playerPos = Common::Point(4, 136);
+ _game._player._facing = FACING_EAST;
+ _game._player.walk(Common::Point(32, 138), FACING_EAST);
+ _game._player.setWalkTrigger(60);
+ _game._player._stepEnabled = false;
+ _scene->setCamera(Common::Point(0, 0));
+ _scene->sceneScale(155, 95, 130, 78);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 3);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _currentFloor = 3;
+ } else if ((_scene->_priorSceneId == 110) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(3, 292);
+ _game._player._facing = FACING_EAST;
+ _game._player.walk(Common::Point(31, 295), FACING_EAST);
+ _game._player.setWalkTrigger(65);
+ _game._player._stepEnabled = false;
+ _scene->setCamera(Common::Point(0, 156));
+ _scene->sceneScale(311, 95, 286, 78);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 3);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _currentFloor = 2;
+ } else if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ if (_currentFloor == 2) {
+ _scene->setCamera(Common::Point(0, 156));
+ _scene->sceneScale(311, 95, 286, 78);
+ } else if (_currentFloor == 3) {
+ _scene->setCamera(Common::Point(0, 0));
+ _scene->sceneScale(155, 95, 130, 78);
+ } else {
+ _scene->setCamera(Common::Point(0, 312));
+ _scene->sceneScale(467, 95, 442, 78);
+ }
+ }
+
+ sceneEntrySound();
+}
+
+void Scene109::step() {
+ if (_anim0ActvFl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 80)
+ _game._camY.camPanTo(156);
+ }
+
+ if (_anim1ActvFl) {
+ if (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == 80)
+ _game._camY.camPanTo(0);
+ }
+
+ if (_anim2ActvFl) {
+ if (_scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame() == 7)
+ _game._camY.camPanTo(312);
+ }
+
+ if (_anim3ActvFl) {
+ if (_scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame() == 14)
+ _game._camY.camPanTo(156);
+ }
+
+ switch (_game._trigger) {
+ case 60:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[0], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 3);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 61);
+ break;
+
+ case 61:
+ _vm->_sound->command(25);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 65:
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 3);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 66);
+ break;
+
+ case 66:
+ _vm->_sound->command(25);
_game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+
+ if (_game._trigger == 70) {
+ int rndFrame = _vm->getRandomNumber(1, 3);
+ int rndDelay = _vm->getRandomNumber(4, 7);
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _scene->deleteSequence(_globals._sequenceIndexes[4]);
+
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, rndFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, rndFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, rndFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ _scene->_sequences.addTimer(rndDelay, 70);
}
}
+void Scene109::actions() {
+ if (_action.isAction(VERB_WALK, NOUN_BACKSTAGE)) {
+ _scene->_nextSceneId = 106;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_UP, NOUN_STAIRCASE)) {
+ if (_currentFloor == 2) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player.walk(Common::Point(58, 295), FACING_EAST);
+ _game._player.setWalkTrigger(1);
+ break;
+
+ case 1:
+ _anim1ActvFl = true;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('w', 2), 2);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[1], SYNC_PLAYER, 0);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[1]);
+ _scene->sceneScale(155, 95, 130, 78);
+ _anim1ActvFl = false;
+ _game._player._visible = true;
+ _game._player._playerPos = Common::Point(261, 137);
+ _game._player.walk(Common::Point(281, 143), FACING_SOUTHWEST);
+ _game._player.setWalkTrigger(3);
+ break;
+
+ case 3:
+ _game._player._stepEnabled = true;
+ _currentFloor = 3;
+ break;
+
+ default:
+ break;
+ }
+ } else if (_currentFloor == 1) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player.walk(Common::Point(58, 452), FACING_EAST);
+ _game._player.setWalkTrigger(1);
+ break;
+
+ case 1:
+ _anim0ActvFl = true;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('w', 1), 2);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _scene->sceneScale(311, 95, 286, 78);
+ _anim0ActvFl = false;
+ _game._player._visible = true;
+ _game._player._playerPos = Common::Point(264, 295);
+ _game._player.walk(Common::Point(289, 299), FACING_SOUTHWEST);
+ _game._player.setWalkTrigger(3);
+ break;
+
+ case 3:
+ _game._player._stepEnabled = true;
+ _currentFloor = 2;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_DOWN, NOUN_STAIRCASE)) {
+ if (_currentFloor == 2) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player.walk(Common::Point(287, 291), FACING_WEST);
+ _game._player.setWalkTrigger(1);
+ break;
+
+ case 1:
+ _game._player.walk(Common::Point(269, 292), FACING_WEST);
+ _game._player.setWalkTrigger(2);
+ break;
+
+ case 2:
+ _anim2ActvFl = true;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('w', 3), 3);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[2], SYNC_PLAYER, 0);
+ break;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[2]);
+ _scene->sceneScale(467, 95, 442, 78);
+ _anim2ActvFl = false;
+ _game._player._visible = true;
+ _game._player._playerPos = Common::Point(61, 450);
+ _game._player.walk(Common::Point(36, 450), FACING_SOUTHEAST);
+ _game._player.setWalkTrigger(4);
+ break;
+
+ case 4:
+ _game._player._stepEnabled = true;
+ _currentFloor = 1;
+ break;
+
+ default:
+ break;
+ }
+ } else if (_currentFloor == 3) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player.walk(Common::Point(287, 137), FACING_WEST);
+ _game._player.setWalkTrigger(1);
+ break;
+
+ case 1:
+ _game._player.walk(Common::Point(269, 138), FACING_WEST);
+ _game._player.setWalkTrigger(2);
+ break;
+
+ case 2:
+ _anim3ActvFl = true;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('w', 4), 3);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[3], SYNC_PLAYER, 0);
+ break;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[3]);
+ _scene->sceneScale(311, 95, 286, 78);
+ _anim3ActvFl = false;
+ _game._player._visible = true;
+ _game._player._playerPos = Common::Point(59, 296);
+ _game._player.walk(Common::Point(40, 294), FACING_SOUTHEAST);
+ _game._player.setWalkTrigger(4);
+ break;
+
+ case 4:
+ _game._player._stepEnabled = true;
+ _currentFloor = 2;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR) || _action.isAction(VERB_OPEN, NOUN_DOOR) || _game._trigger) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], -1, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 4, 75);
+ break;
+
+ case 2:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ if (_currentFloor == 3)
+ _game._player.walk(Common::Point(2, 131), FACING_WEST);
+ else if (_currentFloor == 2)
+ _game._player.walk(Common::Point(2, 281), FACING_WEST);
+
+ _scene->_sequences.addTimer(180, 3);
+ break;
+
+ case 3:
+ if (_currentFloor == 3)
+ _scene->_nextSceneId = 111;
+ else if (_currentFloor == 2)
+ _scene->_nextSceneId = 110;
+ break;
+
+ case 75:
+ _vm->_sound->command(24);
+ if (_currentFloor == 3) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 3);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 76);
+ } else if (_currentFloor == 2) {
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 3);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 76);
+ }
+ break;
+
+ case 76:
+ if (_currentFloor == 3) {
+ int idx = _globals._sequenceIndexes[0];
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 3);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[0], SYNC_SEQ, idx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ } else if (_currentFloor == 2) {
+ int idx = _globals._sequenceIndexes[1];
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 3);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[1], SYNC_SEQ, idx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ }
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(10910);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_STAIRCASE)) {
+ if (_currentFloor == 1)
+ _vm->_dialogs->show(10911);
+ else if (_currentFloor == 2)
+ _vm->_dialogs->show(10921);
+ else if (_currentFloor == 3)
+ _vm->_dialogs->show(10922);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(10912);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BACKSTAGE)) {
+ _vm->_dialogs->show(10913);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR)) {
+ _vm->_dialogs->show(10914);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RAILING)) {
+ _vm->_dialogs->show(10915);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(10916);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LIGHT_FIXTURE)) {
+ _vm->_dialogs->show(10917);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LAMP)) {
+ _vm->_dialogs->show(10918);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HOLE)) {
+ _vm->_dialogs->show(10919);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(10920);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_LAMP)) {
+ _vm->_dialogs->show(10924);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_DOOR)) {
+ _vm->_dialogs->show(10923);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene109::preActions() {
+ if (_action.isAction(VERB_OPEN, NOUN_DOOR)) {
+ if (_currentFloor == 3)
+ _game._player.walk(Common::Point(32, 138), FACING_WEST);
+ else if (_currentFloor == 2)
+ _game._player.walk(Common::Point(31, 295), FACING_WEST);
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene110::Scene110(MADSEngine *vm) : Scene1xx(vm) {
+}
+
+void Scene110::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+}
+
+void Scene110::setup() {
+ if (_globals[kCurrentYear] == 1993)
+ _scene->_variant = 1;
+
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene110::enter() {
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites("*RDR_9");
+
+ if (_globals[kCurrentYear] == 1993) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_POSTER, false);
+ _scene->_hotspots.activate(NOUN_WASTE_BASKET, false);
+
+ if (_globals[kDoneBrieConv203] == 0) {
+ if (_globals[kJuliesDoor] == 0) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 3);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 8);
+ }
+ } else {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 8);
+ }
+ } else {
+ _scene->_hotspots.activate(NOUN_BULLETIN_BOARD, false);
+ _scene->_hotspots.activate(NOUN_PAPER, false);
+ _scene->_hotspots.activate(NOUN_TRASH_BUCKET, false);
+ }
+
+ if (_scene->_priorSceneId == 112) {
+ _game._player._playerPos = Common::Point(261, 121);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(221, 131), FACING_SOUTH);
+ } else if ((_scene->_priorSceneId == 109) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player.firstWalk(Common::Point(335, 150), FACING_WEST, Common::Point(310, 150), FACING_WEST, true);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene110::step() {
+}
+
+void Scene110::actions() {
+ if ((_action.isAction(VERB_WALK_THROUGH, NOUN_RIGHT_DOOR) || _action.isAction(VERB_UNLOCK, NOUN_RIGHT_DOOR) || _action.isAction(VERB_LOCK, NOUN_RIGHT_DOOR))
+ && (_globals[kDoneBrieConv203] == 0) && (_globals[kCurrentYear] == 1993) && (_globals[kJuliesDoor] == 0)) {
+ _scene->_nextSceneId = 112;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_LEFT_DOOR) || _action.isAction(VERB_OPEN, NOUN_LEFT_DOOR)
+ || _action.isAction(VERB_UNLOCK, NOUN_LEFT_DOOR) || _action.isAction(VERB_LOCK, NOUN_LEFT_DOOR)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1: {
+ int idx = _globals._sequenceIndexes[1];
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 4);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[1], SYNC_SEQ, idx);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], false);
+ _scene->_sequences.addTimer(30, 2);
+ _vm->_sound->command(73);
+ }
+ break;
+
+ case 2:
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[1]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ if (_action.isAction(VERB_LOCK) || _action.isAction(VERB_UNLOCK))
+ _vm->_dialogs->show(32);
+ else
+ _vm->_dialogs->show(11022);
+
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_RIGHT_DOOR) || _action.isAction(VERB_OPEN, NOUN_RIGHT_DOOR)
+ || _action.isAction(VERB_UNLOCK, NOUN_RIGHT_DOOR) || _action.isAction(VERB_LOCK, NOUN_RIGHT_DOOR)) {
+ if (((_globals[kCurrentYear] == 1881) || (_globals[kDoneBrieConv203] >= 1))
+ && !_action.isAction(VERB_UNLOCK, NOUN_RIGHT_DOOR) && !_action.isAction(VERB_LOCK, NOUN_RIGHT_DOOR)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1: {
+ int idx = _globals._sequenceIndexes[1];
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 4);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[1], SYNC_SEQ, idx);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], false);
+ _scene->_sequences.addTimer(30, 2);
+ _vm->_sound->command(73);
+ }
+ break;
+
+ case 2:
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[1]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ if (_action.isAction(VERB_LOCK) || _action.isAction(VERB_UNLOCK))
+ _vm->_dialogs->show(32);
+ else
+ _vm->_dialogs->show(11023);
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ } else if (_globals[kJuliesDoor] == 1) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 7, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 4, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 1:
+ _vm->_sound->command(24);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 10, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 3);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ break;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[1]);
+ _game._player._visible = true;
+ _game._player.walk(Common::Point(261, 121), FACING_NORTHEAST);
+ _game._player.setWalkTrigger(4);
+ break;
+
+ case 4:
+ _scene->_nextSceneId = 112;
+ _globals[kJuliesDoor] = 0;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(11010);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(11011);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(11012);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(11013);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAIRWELL)) {
+ _vm->_dialogs->show(11014);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RIGHT_DOOR)) {
+ if (_globals[kDoneBrieConv203] >= 1)
+ _vm->_dialogs->show(11016);
+ else if (_globals[kChrisFStatus] == 1)
+ _vm->_dialogs->show(11015);
+ else
+ _vm->_dialogs->show(11016);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LEFT_DOOR)) {
+ _vm->_dialogs->show(11016);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isObject(NOUN_WASTE_BASKET)) || (_action.isObject(NOUN_TRASH_BUCKET))) {
+ _vm->_dialogs->show(11017);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_POSTER)) {
+ _vm->_dialogs->show(11018);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BULLETIN_BOARD)) {
+ _vm->_dialogs->show(11019);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PAPER)) {
+ _vm->_dialogs->show(11029);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_WASTE_BASKET) || _action.isAction(VERB_TAKE, NOUN_TRASH_BUCKET)) {
+ _vm->_dialogs->show(11020);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LIGHT_FIXTURE)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11021);
+ else
+ _vm->_dialogs->show(11028);
+
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_PAPER)) {
+ _vm->_dialogs->show(11030);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_RIGHT_DOOR)) {
+ if (_globals[kDoneBrieConv203] >= 1)
+ _vm->_dialogs->show(11026);
+ else if (_globals[kChrisFStatus] == 1)
+ _vm->_dialogs->show(11024);
+ else
+ _vm->_dialogs->show(11026);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_LEFT_DOOR)) {
+ _vm->_dialogs->show(11025);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_RIGHT_DOOR)) {
+ if ((_globals[kChrisFStatus] == 1) && (_globals[kDoneBrieConv203] == 0))
+ _vm->_dialogs->show(11027);
+
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene110::preActions() {
+ if (_action.isAction(VERB_EXIT_TO, NOUN_STAIRWELL))
+ _game._player._walkOffScreenSceneId = 109;
+
+ if (_action.isAction(VERB_OPEN, NOUN_LEFT_DOOR) || _action.isAction(VERB_UNLOCK, NOUN_LEFT_DOOR) || _action.isAction(VERB_LOCK, NOUN_LEFT_DOOR))
+ _game._player.walk(Common::Point(111, 126), FACING_NORTHEAST);
+
+ if (_action.isAction(VERB_OPEN, NOUN_RIGHT_DOOR) || _action.isAction(VERB_WALK_THROUGH, NOUN_RIGHT_DOOR)
+ || _action.isAction(VERB_UNLOCK, NOUN_RIGHT_DOOR) || _action.isAction(VERB_LOCK, NOUN_RIGHT_DOOR)) {
+ if ((_globals[kCurrentYear] == 1881) || (_globals[kDoneBrieConv203] >= 1))
+ _game._player.walk(Common::Point(221, 131), FACING_NORTHEAST);
+ else if ((_globals[kJuliesDoor] == 1) || _action.isAction(VERB_OPEN))
+ _game._player.walk(Common::Point(223, 128), FACING_NORTHEAST);
+ else if (_globals[kJuliesDoor] == 0)
+ _game._player.walk(Common::Point(261, 120), FACING_NORTHEAST);
+ }
+
+ if (_action.isAction(VERB_LOOK, NOUN_PAPER))
+ _game._player._needToWalk = true;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene111::Scene111(MADSEngine *vm) : Scene1xx(vm) {
+ _removeAxe = false;
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _closedFl = false;
+ _listenFrame = -1;
+ _listenStatus = -1;
+
+}
+
+void Scene111::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+ s.syncAsByte(_removeAxe);
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_closedFl);
+ s.syncAsSint16LE(_listenFrame);
+ s.syncAsSint16LE(_listenStatus);
+}
+
+void Scene111::setup() {
+ if (_globals[kCurrentYear] == 1993)
+ _scene->_variant = 1;
+
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene111::enter() {
+ _scene->_hotspots.activate(NOUN_HOOK, false);
+
+ _removeAxe = false;
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _closedFl = true;
+
+ if (_globals[kCurrentYear] == 1881) {
+ if ((_globals[kJacquesNameIsKnown] == 2) && (_globals[kMadameNameIsKnown] == 2) && (_globals[kPanelIn206]) &&
+ (_globals[kDoneRichConv203]) && (_game._objects.isInInventory(OBJ_LANTERN)) &&
+ ((_game._objects.isInInventory(OBJ_CABLE_HOOK) && _game._objects.isInInventory(OBJ_ROPE)) || _game._objects.isInInventory(OBJ_ROPE_WITH_HOOK))) {
+ _closedFl = false;
+ } else
+ _closedFl = true;
+ } else
+ _closedFl = false;
+
+ if (_globals[kJacquesStatus]) {
+ _scene->_hotspots.activate(NOUN_HOOK, true);
+ _scene->_hotspots.activate(NOUN_FIRE_AXE, false);
+ }
+
+ _vm->_gameConv->get(14);
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites("*RDR_9");
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('a', 1));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('a', 3));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('x', 0));
+
+ if (_globals[kCurrentYear] == 1881)
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('a', 2));
+
+ if (_globals[kCurrentYear] == 1993) {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('z', -1));
+ _scene->drawToBackground(_globals._spriteIndexes[1], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_LAMP, false);
+ int idx = _scene->_dynamicHotspots.add(NOUN_WALL, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(35, 82, 35 + 13, 82 + 11));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(78, 122), FACING_NORTHEAST);
+ } else {
+ _scene->_hotspots.activate(NOUN_LIGHT, false);
+ if (_globals[kChristineDoorStatus] == 2) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 10);
+ _scene->drawToBackground(_globals._spriteIndexes[4], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_FIRE_AXE, false);
+ _scene->_hotspots.activate(NOUN_DOOR_CHUNKS, true);
+ _scene->_hotspots.activate(NOUN_HANDLE, true);
+ _scene->_hotspots.activate(NOUN_AXE, true);
+ }
+ }
+
+ if ((_globals[kChristineDoorStatus] == 0) && (_scene->_priorSceneId != 113) && !_closedFl) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 3);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+ }
+
+ if ((_globals[kCurrentYear] == 1993) || (_globals[kChristineDoorStatus] <= 1)) {
+ if (!_globals[kJacquesStatus]) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 5);
+ _scene->_hotspots.activate(NOUN_AXE, false);
+ }
+ _scene->_hotspots.activate(NOUN_DOOR_CHUNKS, false);
+ _scene->_hotspots.activate(NOUN_HANDLE, false);
+ }
+
+ if (_scene->_priorSceneId == 113) {
+ _game._player._playerPos = Common::Point(146, 108);
+ _game._player.walk(Common::Point(112, 126), FACING_SOUTH);
+
+ if (!_globals[kLeaveAngelMusicOn])
+ sceneEntrySound();
+
+ if (_globals[kChristineDoorStatus] != 2) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 3);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+
+ if ((_globals[kCurrentYear] == 1881) && (_globals[kLeaveAngelMusicOn])) {
+ _game._player.setWalkTrigger(60);
+ _game._player._stepEnabled = false;
+ _globals[kChristineDoorStatus] = 1;
+ _globals[kChrisKickedRaoulOut] = true;
+ _globals[kHintThatDaaeIsHome1] = true;
+ _globals[kHintThatDaaeIsHome2] = true;
+ }
+ }
+ } else if ((_scene->_priorSceneId == 109) || (_scene->_priorSceneId != RETURNING_FROM_LOADING))
+ _game._player.firstWalk(Common::Point(335, 150), FACING_WEST, Common::Point(311, 150), FACING_WEST, true);
+
+ sceneEntrySound();
+}
+
+void Scene111::step() {
+ if (_anim0ActvFl)
+ handleListenAnimation();
+
+ if (!_removeAxe && _anim1ActvFl && (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == 5)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _game._objects.addToInventory(OBJ_FIRE_AXE);
+ _removeAxe = true;
+ }
+
+ if (_game._objects.isInInventory(OBJ_FIRE_AXE) && _anim1ActvFl && (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == 36))
+ _game._objects.setRoom(OBJ_FIRE_AXE, NOWHERE);
+
+ if (_game._player._playerPos == Common::Point(145, 108))
+ _scene->_nextSceneId = 113;
+
+ switch (_game._trigger) {
+ case 60:
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[5], false, 7, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 62);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], -1, -2);
+ break;
+
+ case 62:
+ _vm->_sound->command(25);
+ _game._player._stepEnabled = true;
+ _vm->_gameConv->run(14);
+ if (_game._difficulty == DIFFICULTY_EASY)
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+
+ _game._player.walk(Common::Point(119, 124), FACING_EAST);
+ _game._player.setWalkTrigger(64);
+ break;
+
+ case 64:
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('l', 1), 70);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ _anim0ActvFl = true;
+ _listenStatus = 0;
+ _game._player._visible = false;
+ break;
+
+ case 70:
+ _game._player._visible = true;
+ _anim0ActvFl = false;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _scene->_sequences.addTimer(30, 71);
+ break;
+
+ case 71:
+ _vm->_gameConv->release();
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene111::actions() {
+ if (_vm->_gameConv->_running == 14) {
+ handleListenConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_RIGHT_DOOR) || _action.isAction(VERB_OPEN, NOUN_RIGHT_DOOR) || _action.isAction(VERB_UNLOCK) || _action.isAction(VERB_LOCK)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ _action._inProgress = false;
+ return;
+
+ case 1: {
+ int idx = _globals._sequenceIndexes[0];
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 4);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[0], SYNC_SEQ, idx);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], false);
+ _scene->_sequences.addTimer(30, 2);
+ _vm->_sound->command(73);
+ _action._inProgress = false;
+ return;
+ }
+
+ case 2:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[0], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ _action._inProgress = false;
+ return;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[0]);
+ _game._player._visible = true;
+ if (_action.isAction(VERB_LOCK) || _action.isAction(VERB_UNLOCK))
+ _vm->_dialogs->show(32);
+ else
+ _vm->_dialogs->show(11123);
+
+ _game._player._stepEnabled = true;
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_LEFT_DOOR) || _action.isAction(VERB_OPEN, NOUN_LEFT_DOOR) || _action.isAction(VERB_UNLOCK, NOUN_LEFT_DOOR) || _action.isAction(VERB_LOCK, NOUN_LEFT_DOOR)) {
+ if ((_globals[kChristineDoorStatus] == 1) || _closedFl || _action.isAction(VERB_UNLOCK, NOUN_LEFT_DOOR) || _action.isAction(VERB_LOCK, NOUN_LEFT_DOOR)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ _action._inProgress = false;
+ return;
+
+ case 1: {
+ int idx = _globals._sequenceIndexes[0];
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 4);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[0], SYNC_SEQ, idx);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], false);
+ _scene->_sequences.addTimer(30, 2);
+ _vm->_sound->command(73);
+ _action._inProgress = false;
+ return;
+ }
+
+ case 2:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[0], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ _action._inProgress = false;
+ return;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[0]);
+ _game._player._visible = true;
+
+ if (_action.isAction(VERB_LOCK) || _action.isAction(VERB_UNLOCK))
+ _vm->_dialogs->show(32);
+ else if ((_globals[kChrisKickedRaoulOut]) && (_globals[kTicketPeoplePresent] == 1) && (_globals[kJacquesStatus] == 0))
+ _vm->_dialogs->show(11135);
+ else
+ _vm->_dialogs->show(11124);
+
+ _game._player._stepEnabled = true;
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+ } else if (_globals[kChristineDoorStatus] == 2) {
+ _vm->_dialogs->show(11137);
+ _action._inProgress = false;
+ return;
+ } else {
+ _vm->_dialogs->show(11126);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_FIRE_AXE)) {
+ if ((_globals[kCurrentYear] == 1881) && (_globals[kJacquesStatus] == 0) && (_globals[kChristineDoorStatus] == 1) && (_globals[kChrisKickedRaoulOut])) {
+ switch (_game._trigger) {
+ case 0:
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('q', -1), 1);
+ _scene->_hotspots.activate(NOUN_FIRE_AXE, false);
+ _scene->_hotspots.activate(NOUN_DOOR_CHUNKS, true);
+ _scene->_hotspots.activate(NOUN_HANDLE, true);
+ _scene->_hotspots.activate(NOUN_AXE, true);
+ _anim1ActvFl = true;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ break;
+
+ case 1:
+ _globals[kChristineDoorStatus] = 2;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[3], SYNC_ANIM, _globals._animationIndexes[1]);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 10);
+ _scene->drawToBackground(_globals._spriteIndexes[4], 1, Common::Point(-32000, -32000), 0, 100);
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[1]);
+ _game._player._visible = true;
+ _game._player._playerPos = Common::Point(126, 126);
+ _anim1ActvFl = false;
+ _game._player.walk(Common::Point(145, 108), FACING_NORTHEAST);
+ _game._player.resetFacing(FACING_NORTHWEST);
+ break;
+
+ default:
+ break;
+ }
+ } else if (_globals[kCurrentYear] == 1993 && _globals[kMakeBrieLeave203])
+ _vm->_dialogs->show(11142);
+ else
+ _vm->_dialogs->show(11134);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11110);
+ else
+ _vm->_dialogs->show(11111);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(11112);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(11113);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(11114);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAIRWELL)) {
+ _vm->_dialogs->show(11115);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TABLE)) {
+ _vm->_dialogs->show(11118);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PLANT)) {
+ _vm->_dialogs->show(11119);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FIRE_AXE)) {
+ _vm->_dialogs->show(11120);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HANDLE)) {
+ _vm->_dialogs->show(11121);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_AXE)) {
+ _vm->_dialogs->show(11122);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR_CHUNKS)) {
+ _vm->_dialogs->show(11129);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LIGHT)) {
+ _vm->_dialogs->show(11131);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LAMP)) {
+ _vm->_dialogs->show(11132);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HOOK)) {
+ _vm->_dialogs->show(11141);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LEFT_DOOR)) {
+ if (_globals[kJacquesStatus])
+ _vm->_dialogs->show(11140);
+ else if (_globals[kChristineDoorStatus] == 2)
+ _vm->_dialogs->show(11130);
+ else if ((_globals[kChrisKickedRaoulOut]) && (_globals[kTicketPeoplePresent] == 1))
+ _vm->_dialogs->show(11136);
+ else if ((_globals[kChristineDoorStatus] == 1) || _closedFl)
+ _vm->_dialogs->show(11117);
+ else if (_globals[kChristineDoorStatus] == 0)
+ _vm->_dialogs->show(11116);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RIGHT_DOOR)) {
+ _vm->_dialogs->show(11117);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_RIGHT_DOOR)) {
+ _vm->_dialogs->show(11128);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_LEFT_DOOR)) {
+ if (_closedFl)
+ _vm->_dialogs->show(11128);
+ else if ((_globals[kChristineDoorStatus] == 2) && (!_globals[kTicketPeoplePresent]))
+ _vm->_dialogs->show(11138);
+ else if (_globals[kChristineDoorStatus] == 1)
+ _vm->_dialogs->show(11127);
+ else if (_globals[kChristineDoorStatus] == 0)
+ _vm->_dialogs->show(11125);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_LEFT_DOOR)) {
+ if (_globals[kChristineDoorStatus] == 0)
+ _vm->_dialogs->show(11126);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene111::preActions() {
+ if (_action.isAction(VERB_EXIT_TO, NOUN_STAIRWELL)) {
+ if (_globals[kLeaveAngelMusicOn]) {
+ _vm->_dialogs->show(11139);
+ _game._player._needToWalk = false;
+ _game._player.cancelCommand();
+ } else
+ _game._player._walkOffScreenSceneId = 109;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_FIRE_AXE) && _game._objects.isInRoom(OBJ_FIRE_AXE) && (_globals[kCurrentYear] == 1881)
+ && (_globals[kChristineDoorStatus] == 1) && (_globals[kChrisKickedRaoulOut]) && (_globals[kJacquesStatus] == 0))
+ _game._player.walk(Common::Point(119, 124), FACING_EAST);
+
+ if (_action.isAction(VERB_OPEN, NOUN_RIGHT_DOOR) || _action.isAction(VERB_UNLOCK, NOUN_RIGHT_DOOR) || _action.isAction(VERB_LOCK, NOUN_RIGHT_DOOR))
+ _game._player.walk(Common::Point(219, 131), FACING_NORTHEAST);
+
+ if (_action.isAction(VERB_OPEN, NOUN_LEFT_DOOR) || _action.isAction(VERB_UNLOCK, NOUN_LEFT_DOOR) || _action.isAction(VERB_LOCK, NOUN_LEFT_DOOR))
+ _game._player.walk(Common::Point(109, 124), FACING_NORTHEAST);
+
+ if ((_action.isAction(VERB_WALK_THROUGH, NOUN_LEFT_DOOR) || _action.isAction(VERB_UNLOCK, NOUN_LEFT_DOOR) || _action.isAction(VERB_LOCK, NOUN_LEFT_DOOR))
+ && !_closedFl && ((_globals[kChristineDoorStatus] == 2) || (_globals[kChristineDoorStatus] == 0)))
+ _game._player.walk(Common::Point(145, 108), FACING_NORTHEAST);
+}
+
+void Scene111::handleListenAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _listenFrame)
+ return;
+
+ int nextFrame = -1;
+ _listenFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+
+ if (_listenFrame == 6) {
+ if (_listenStatus == 0)
+ nextFrame = 5;
+ else if (_listenStatus == 1)
+ nextFrame = 7;
+ }
+
+ if (nextFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], nextFrame);
+ _listenFrame = nextFrame;
+ }
+}
+
+void Scene111::handleListenConversation() {
+ if (_action._activeAction._verbId == 1)
+ _vm->_gameConv->setInterlocutorTrigger(66);
+
+ if (_action._activeAction._verbId == 7)
+ _vm->_gameConv->setInterlocutorTrigger(68);
+
+ if (_game._trigger == 66)
+ _listenStatus = 0;
+
+ if (_game._trigger == 68) {
+ _listenStatus = 1;
+ _vm->_gameConv->hold();
+ }
+
+ if ((_action._activeAction._verbId != 1) && (_action._activeAction._verbId != 7))
+ _vm->_gameConv->setInterlocutorTrigger(72);
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene112::Scene112(MADSEngine *vm) : Scene1xx(vm) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _raoulAction = -1;
+ _raoulFrame = -1;
+ _didOptionFl = -1;
+ _julieFrame = -1;
+ _julieAction = -1;
+ _julieHotspotId = -1;
+ _julieCounter = -1;
+}
+
+void Scene112::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsSint16LE(_raoulAction);
+ s.syncAsSint16LE(_raoulFrame);
+ s.syncAsSint16LE(_didOptionFl);
+ s.syncAsSint16LE(_julieFrame);
+ s.syncAsSint16LE(_julieAction);
+ s.syncAsSint16LE(_julieCounter);
+}
+
+void Scene112::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_WOMAN);
+ _scene->addActiveVocab(NOUN_JULIE);
+}
+
+void Scene112::enter() {
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _raoulAction = 2;
+ _didOptionFl = 0;
+ }
+
+ _vm->_gameConv->get(3);
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('j', 1), 1);
+ _anim0ActvFl = true;
+ _julieAction = 2;
+ _scene->setAnimFrame(_globals._animationIndexes[0], 3);
+ if (_globals[kJulieNameIsKnown] == 2) {
+ _julieHotspotId = _scene->_dynamicHotspots.add(NOUN_JULIE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(255, 82, 255 + 30, 82 + 44));
+ _scene->_dynamicHotspots[_julieHotspotId]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_julieHotspotId, Common::Point(216, 137), FACING_NORTHEAST);
+ _scene->_hotspots.activate(NOUN_WOMAN, false);
+ }
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('r', 1), 1);
+ _anim1ActvFl = true;
+ _scene->setAnimFrame(_globals._animationIndexes[1], 82);
+ _raoulAction = 2;
+
+ if (_vm->_gameConv->_restoreRunning == 3) {
+ _vm->_gameConv->run(3);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _scene->setAnimFrame(_globals._animationIndexes[1], 17);
+ _raoulAction = 1;
+ _game._player._playerPos = Common::Point(53, 128);
+ _game._player._facing = FACING_EAST;
+ _game._player._visible = false;
+ } else if ((_scene->_priorSceneId == 110) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(128, 145);
+ _game._player._facing = FACING_NORTH;
+ }
+
+ sceneEntrySound();
+}
+
+void Scene112::step() {
+ if (_anim0ActvFl)
+ handleJulieAnimation();
+
+ if (_anim1ActvFl)
+ handleRaoulChair();
+}
+
+void Scene112::actions() {
+ if (_vm->_gameConv->_running == 3) {
+ handleConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_TALK_TO, NOUN_JULIE)) || (_action.isAction(VERB_TALK_TO, NOUN_WOMAN))) {
+ if (_globals[kJulieNameIsKnown] > 0) {
+ _game._player._visible = false;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[1], SYNC_PLAYER, 0);
+ _scene->setAnimFrame(_globals._animationIndexes[1], 1);
+ _raoulAction = 1;
+ }
+ _vm->_gameConv->run(3);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_CORRIDOR)) {
+ _scene->_nextSceneId = 110;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(11210);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(11211);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(11212);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MIRROR)) {
+ _vm->_dialogs->show(11213);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BALLET_BAR)) {
+ _vm->_dialogs->show(11214);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CORRIDOR)) {
+ _vm->_dialogs->show(11215);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_THROW_RUGS)) {
+ _vm->_dialogs->show(11216);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DRESSING_SCREEN)) {
+ _vm->_dialogs->show(11217);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DRESSING_TABLE)) {
+ _vm->_dialogs->show(11218);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHAIR)) {
+ _vm->_dialogs->show(11219);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PLANT)) {
+ _vm->_dialogs->show(11220);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COAT_RACK)) {
+ _vm->_dialogs->show(11221);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_UMBRELLA)) {
+ _vm->_dialogs->show(11222);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PAINTINGS)) {
+ _vm->_dialogs->show(11223);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TRASH_BUCKET)) {
+ _vm->_dialogs->show(11224);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SHELF)) {
+ _vm->_dialogs->show(11225);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CONTAINER)) {
+ _vm->_dialogs->show(11226);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TORN_POSTER)) {
+ _vm->_dialogs->show(11227);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_POSTER)) {
+ _vm->_dialogs->show(11228);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isObject(NOUN_REVIEW)) || (_action.isObject(NOUN_REVIEWS))) {
+ _vm->_dialogs->show(11229);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_JULIE)) {
+ _vm->_dialogs->show(11231);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COSTUME_RACK)) {
+ _vm->_dialogs->show(11232);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LIGHT_FIXTURE)) {
+ _vm->_dialogs->show(11233);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WARDROBE)) {
+ _vm->_dialogs->show(11234);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WOMAN)) {
+ _vm->_dialogs->show(11237);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE)) {
+ if (_action.isObject(NOUN_WOMAN) || _action.isObject(NOUN_JULIE)) {
+ _vm->_dialogs->show(11238);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_WARDROBE)) {
+ _vm->_dialogs->show(11235);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_CONTAINER)) {
+ _vm->_dialogs->show(11236);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene112::preActions() {
+ if ((_action.isAction(VERB_TALK_TO, NOUN_JULIE) || _action.isAction(VERB_TALK_TO, NOUN_WOMAN)) && (_globals[kJulieNameIsKnown] > 0))
+ _game._player.walk(Common::Point(53, 128), FACING_EAST);
+}
+
+void Scene112::handleConversation() {
+ switch (_action._activeAction._verbId) {
+ case 1:
+ if (!_game._trigger && (_raoulAction == 2))
+ _vm->_gameConv->setInterlocutorTrigger(68);
+ break;
+
+ case 3:
+ case 4:
+ if (_globals[kJulieNameIsKnown] < 2) {
+ _globals[kJulieNameIsKnown] = 2;
+ _scene->_hotspots.activate(NOUN_WOMAN, false);
+ _julieHotspotId = _scene->_dynamicHotspots.add(NOUN_JULIE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(255, 82, 255 + 30, 82 + 44));
+ _scene->_dynamicHotspots[_julieHotspotId]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_julieHotspotId, Common::Point(216, 137), FACING_NORTHEAST);
+ }
+ break;
+
+ case 5:
+ _vm->_gameConv->setInterlocutorTrigger(74);
+ _globals[kJulieNameIsKnown] = 1;
+ break;
+
+ case 6:
+ case 7:
+ case 10:
+ case 23:
+ case 27:
+ _vm->_gameConv->setInterlocutorTrigger(74);
+ _globals[kJulieNameIsKnown] = 2;
+ break;
+
+ case 13:
+ _julieAction = 1;
+ _raoulAction = 1;
+ break;
+
+ case 14:
+ case 15:
+ case 16:
+ _julieAction = 0;
+ _raoulAction = 1;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 60:
+ _julieAction = 0;
+ _raoulAction = 1;
+ break;
+
+ case 62:
+ _julieAction = 2;
+ if (_raoulAction != 2)
+ _raoulAction = 0;
+ break;
+
+ case 68:
+ _scene->_sequences.addTimer(120, 70);
+ _vm->_gameConv->hold();
+ break;
+
+ case 70:
+ _game._player.walk(Common::Point(53, 128), FACING_EAST);
+ _game._player.setWalkTrigger(72);
+ break;
+
+ case 72:
+ _vm->_gameConv->release();
+ _game._player._visible = false;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[1], SYNC_PLAYER, 0);
+ _scene->setAnimFrame(_globals._animationIndexes[1], 1);
+ _raoulAction = 1;
+ break;
+
+ case 74:
+ _raoulAction = 3;
+ _vm->_gameConv->hold();
+ break;
+
+ default:
+ break;
+ }
+
+ if ((_action._activeAction._verbId != 0) && (_action._activeAction._verbId != 1) &&
+ (_action._activeAction._verbId != 2) && (_action._activeAction._verbId != 5) &&
+ (_action._activeAction._verbId != 6) && (_action._activeAction._verbId != 7) &&
+ (_action._activeAction._verbId != 10) && (_action._activeAction._verbId != 23) &&
+ (_action._activeAction._verbId != 27)) {
+ _vm->_gameConv->setInterlocutorTrigger(60);
+ _vm->_gameConv->setHeroTrigger(62);
+ }
+
+ if (_action._activeAction._verbId == 18)
+ _globals[kCanFindBookInLibrary] = true;
+
+ _julieCounter = 0;
+}
+
+void Scene112::handleJulieAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _julieFrame)
+ return;
+
+ _julieFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int random = -1;
+ int resetFrame = -1;
+
+ switch (_julieFrame) {
+ case 1:
+ case 2:
+ case 3:
+ case 22:
+ case 39:
+ case 71:
+ case 107:
+ switch (_julieAction) {
+ case 0:
+ random = _vm->getRandomNumber(4, 6);
+ ++_julieCounter;
+ if (_julieCounter > 25)
+ _julieAction = 2;
+ break;
+
+ case 1:
+ random = 3;
+ break;
+
+ case 2:
+ random = _vm->getRandomNumber(1, 3);
+ while (_didOptionFl == random)
+ random = _vm->getRandomNumber(1, 3);
+ _didOptionFl = random;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 22;
+ break;
+
+ case 2:
+ resetFrame = 39;
+ break;
+
+ case 3:
+ resetFrame = 83;
+ break;
+
+ case 4:
+ resetFrame = 0;
+ break;
+
+ case 5:
+ resetFrame = 1;
+ break;
+
+ case 6:
+ resetFrame = 2;
+ break;
+
+ default:
+ break;
+ }
+ break;
+ case 56:
+ case 77:
+ case 83:
+ random = _vm->getRandomNumber(1, 3);
+ while (_didOptionFl == random)
+ random = _vm->getRandomNumber(1, 3);
+ _didOptionFl = random;
+
+ if ((_julieAction == 0) || (_julieAction == 1))
+ random = 3;
+
+ switch (random) {
+ case 1:
+ resetFrame = 71;
+ break;
+
+ case 2:
+ resetFrame = 77;
+ break;
+
+ case 3:
+ resetFrame = 56;
+ break;
+
+ default:
+ break;
+ }
+
+ break;
+
+ case 95:
+ if (_julieAction == 1)
+ random = 2;
+ else
+ random = 1;
+
+ switch (random) {
+ case 1:
+ resetFrame = 95;
+ break;
+
+ case 2:
+ resetFrame = 107;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 130:
+ resetFrame = 95;
+ _julieAction = 2;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _julieFrame = resetFrame;
+ }
+}
+
+void Scene112::handleRaoulChair() {
+ if (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == _raoulFrame)
+ return;
+
+ _raoulFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random = -1;
+
+ switch (_raoulFrame) {
+ case 18:
+ case 30:
+ case 41:
+ case 49:
+ case 56:
+ case 65:
+ switch (_raoulAction) {
+ case 0:
+ random = _vm->getRandomNumber(1, 4);
+ _raoulAction = 1;
+ break;
+
+ case 2:
+ random = 6;
+ break;
+
+ case 3:
+ random = 5;
+ _raoulAction = 2;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(7, 50);
+ while (_didOptionFl == random)
+ random = _vm->getRandomNumber(7, 50);
+ _didOptionFl = random;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 49;
+ break;
+
+ case 2:
+ resetFrame = 41;
+ break;
+
+ case 3:
+ resetFrame = 18;
+ break;
+
+ case 4:
+ resetFrame = 30;
+ break;
+
+ case 5:
+ resetFrame = 65;
+ break;
+
+ case 6:
+ resetFrame = 82;
+ break;
+
+ case 7:
+ resetFrame = 56;
+ break;
+
+ default:
+ resetFrame = 17;
+ break;
+ }
+ break;
+
+ case 61:
+ if (_raoulAction == 1)
+ random = 1;
+ else
+ random = 2;
+
+ switch (random) {
+ case 1:
+ resetFrame = 60;
+ break;
+
+ case 2:
+ resetFrame = 61;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 82:
+ _raoulAction = 2;
+ _game._player._visible = true;
+ _vm->_gameConv->release();
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[1]);
+ break;
+
+ case 83:
+ if (_raoulAction == 2)
+ random = 1;
+ else
+ random = 2;
+
+ switch (random) {
+ case 1:
+ resetFrame = 82;
+ break;
+
+ case 2:
+ resetFrame = 0;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _raoulFrame = resetFrame;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene113::Scene113(MADSEngine *vm) : Scene1xx(vm) {
+ _standingAndTalking = false;
+ _dayWantsToTalk = false;
+ _musicPlaying = false;
+ _afterKissFl = false;
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ _anim4ActvFl = false;
+ _prevent1 = false;
+ _prevent2 = false;
+ _raoulStandingFl = false;
+ _armsOutFl = false;
+
+ _dayStatus = -1;
+ _raoulAction = -1;
+ _christineHotspotId1 = -1;
+ _christineHotspotId2 = -1;
+ _raoulCount = -1;
+ _dayCount = -1;
+ _standCount = -1;
+ _julieStatus = -1;
+ _florentStatus = -1;
+ _florentFrame = -1;
+ _florentCount = -1;
+ _dayFrame = -1;
+ _lastDayResetFrame = -1;
+ _raoulFrame = -1;
+ _julieFrame = -1;
+ _julieCount = -1;
+}
+
+void Scene113::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+
+ s.syncAsByte(_standingAndTalking);
+ s.syncAsByte(_dayWantsToTalk);
+ s.syncAsByte(_musicPlaying);
+ s.syncAsByte(_afterKissFl);
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_anim2ActvFl);
+ s.syncAsByte(_anim3ActvFl);
+ s.syncAsByte(_anim4ActvFl);
+ s.syncAsByte(_prevent1);
+ s.syncAsByte(_prevent2);
+ s.syncAsByte(_raoulStandingFl);
+ s.syncAsByte(_armsOutFl);
+
+ s.syncAsSint16LE(_dayStatus);
+ s.syncAsSint16LE(_raoulAction);
+ s.syncAsSint16LE(_christineHotspotId1);
+ s.syncAsSint16LE(_christineHotspotId2);
+ s.syncAsSint16LE(_raoulCount);
+ s.syncAsSint16LE(_dayCount);
+ s.syncAsSint16LE(_standCount);
+ s.syncAsSint16LE(_julieStatus);
+ s.syncAsSint16LE(_florentStatus);
+ s.syncAsSint16LE(_florentFrame);
+ s.syncAsSint16LE(_florentCount);
+ s.syncAsSint16LE(_dayFrame);
+ s.syncAsSint16LE(_lastDayResetFrame);
+ s.syncAsSint16LE(_raoulFrame);
+ s.syncAsSint16LE(_julieFrame);
+ s.syncAsSint16LE(_julieCount);
+}
+
+void Scene113::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_CHRISTINE);
+ _scene->addActiveVocab(NOUN_WOMAN);
+ _scene->addActiveVocab(NOUN_JULIE);
+}
+
+void Scene113::enter() {
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _standingAndTalking = false;
+ _dayWantsToTalk = false;
+ _musicPlaying = false;
+ _afterKissFl = false;
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ _anim4ActvFl = false;
+ _prevent1 = false;
+ _prevent2 = false;
+ _raoulStandingFl = false;
+ _armsOutFl = false;
+ }
+
+ _scene->_hotspots.activate(NOUN_SMALL_NOTE, false);
+ _scene->_hotspots.activate(NOUN_DRESSING_GOWN, false);
+ _scene->_hotspots.activate(NOUN_CHRISTINE, false);
+ _scene->_hotspots.activate(NOUN_JULIE, false);
+ _scene->_hotspots.activate(NOUN_LIGHT_FIXTURE, false);
+
+ if (_globals[kCurrentYear] == 1993) {
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('z', -1));
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('f', 0));
+
+ if (_game._objects.isInRoom(OBJ_SMALL_NOTE))
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('f', 1));
+
+ if ((_globals[kDoneBrieConv203] == 1) || (_globals[kDoneBrieConv203] == 3))
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('c', 3));
+ }
+
+ if (_globals[kCurrentYear] == 1993) {
+ _vm->_gameConv->get(4);
+ if ((_globals[kDoneBrieConv203] == 1) || (_globals[kDoneBrieConv203] == 3))
+ _vm->_gameConv->get(6);
+ } else {
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites("*faceral", false);
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites("*facecrsd", false);
+ _vm->_gameConv->get(13);
+ }
+
+ if (_globals[kCurrentYear] == 1993) {
+ _scene->drawToBackground(_globals._spriteIndexes[3], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_VASE, false);
+ _scene->_hotspots.activate(NOUN_FAN, false);
+ _scene->_hotspots.activateAtPos(NOUN_LIGHT_FIXTURE, true, Common::Point(155, 17));
+ } else {
+ _scene->_hotspots.activateAtPos(NOUN_LIGHT_FIXTURE, true, Common::Point(150, 46));
+ _scene->_hotspots.activate(NOUN_NOTICE, false);
+ }
+
+ if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ if (_globals[kCurrentYear] == 1881) {
+ if (_dayStatus <= 3) {
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('r', 1), 1);
+ _anim1ActvFl = true;
+ }
+
+ if (_raoulAction == 3)
+ _scene->setAnimFrame(_globals._animationIndexes[1], 33);
+ else {
+ _raoulAction = 1;
+ _game._player._visible = false;
+ _scene->setAnimFrame(_globals._animationIndexes[1], 8);
+ }
+
+ if (_musicPlaying) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 2), 0);
+ _anim0ActvFl = true;
+ _christineHotspotId1 = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[_christineHotspotId1]._articleNumber = PREP_ON;
+ _scene->setDynamicAnim(_christineHotspotId1, _globals._animationIndexes[0], 13);
+ _scene->setDynamicAnim(_christineHotspotId1, _globals._animationIndexes[0], 14);
+ _scene->setDynamicAnim(_christineHotspotId1, _globals._animationIndexes[0], 16);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 212);
+ _game._player._visible = true;
+ _anim1ActvFl = false;
+ } else {
+ switch (_dayStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 1), 0);
+ _anim0ActvFl = true;
+ _dayStatus = 2;
+ _scene->setAnimFrame(_globals._animationIndexes[0], 208);
+ _scene->_hotspots.activate(NOUN_CHRISTINE, true);
+ _scene->_hotspots.activateAtPos(NOUN_CHRISTINE, false, Common::Point(220, 130));
+ break;
+
+ default:
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 2), 0);
+ _anim0ActvFl = true;
+ _dayStatus = 7;
+ _game._player._visible = false;
+ _scene->setAnimFrame(_globals._animationIndexes[0], 165);
+ break;
+ }
+ _christineHotspotId1 = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[_christineHotspotId1]._articleNumber = PREP_ON;
+ _scene->setDynamicAnim(_christineHotspotId1, _globals._animationIndexes[0], 13);
+ _scene->setDynamicAnim(_christineHotspotId1, _globals._animationIndexes[0], 14);
+ _scene->setDynamicAnim(_christineHotspotId1, _globals._animationIndexes[0], 16);
+ }
+
+ if (_dayStatus == 2) {
+ _scene->_hotspots.activate(NOUN_CHRISTINE, true);
+ _scene->_hotspots.activateAtPos(NOUN_CHRISTINE, false, Common::Point(220, 130));
+ } else {
+ _game._player._playerPos = Common::Point(175, 148);
+ _game._player._facing = FACING_NORTHEAST;
+ }
+
+ } else if ((_globals[kDoneBrieConv203] == 1) || (_globals[kDoneBrieConv203] == 3)) {
+ _globals._animationIndexes[4] = _scene->loadAnimation(formAnimName('x', 1), 1);
+ _julieStatus = 0;
+ _anim4ActvFl = true;
+ _globals[kMakeBrieLeave203] = true;
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ _scene->_hotspots.activate(NOUN_DRESSING_GOWN, true);
+ _scene->_hotspots.activate(NOUN_JULIE, true);
+ _scene->_hotspots.activateAtPos(NOUN_CHRISTINE, true, Common::Point(220, 130));
+ } else if (_globals[kCurrentYear] == 1993) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('f', 1), 1);
+ _anim2ActvFl = true;
+
+ if (_florentStatus != 3)
+ _florentStatus = 1;
+
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('r', 1), 1);
+ _anim3ActvFl = true;
+
+ if (_raoulAction == 3)
+ _scene->setAnimFrame(_globals._animationIndexes[3], 33);
+ else {
+ _scene->setAnimFrame(_globals._animationIndexes[3], 8);
+ _raoulAction = 1;
+ _game._player._playerPos = Common::Point(201, 120);
+ _game._player._facing = FACING_SOUTH;
+ _game._player._visible = false;
+ }
+
+ if (_florentStatus == 3)
+ _scene->setAnimFrame(_globals._animationIndexes[2], 41);
+
+ if (_globals[kFlorentNameIsKnown] >= 1) {
+ _christineHotspotId2 = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(43, 118, 43 + 15, 118 + 29));
+ _scene->_dynamicHotspots[_christineHotspotId2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_christineHotspotId2, Common::Point(106, 127), FACING_SOUTHWEST);
+ } else {
+ _christineHotspotId2 = _scene->_dynamicHotspots.add(NOUN_WOMAN, VERB_WALK_TO, SYNTAX_FEM_NOT_PROPER, EXT_NONE, Common::Rect(43, 118, 43 + 15, 118 + 29));
+ _scene->_dynamicHotspots[_christineHotspotId2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_christineHotspotId2, Common::Point(106, 127), FACING_SOUTHWEST);
+ }
+
+ _scene->_hotspots.activate(NOUN_DRESSING_GOWN, true);
+
+ if (_game._objects.isInRoom(OBJ_SMALL_NOTE)) {
+ _scene->_hotspots.activate(NOUN_SMALL_NOTE, true);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 13);
+ }
+ }
+ } else if (_globals[kCurrentYear] == 1993) {
+ if ((_globals[kDoneBrieConv203] == 1) || (_globals[kDoneBrieConv203] == 3)) {
+ if (!(_globals[kPlayerScoreFlags] & 4)) {
+ _globals[kPlayerScoreFlags] = _globals[kPlayerScoreFlags] | 4;
+ _globals[kPlayerScore] += 5;
+ }
+
+ _globals._animationIndexes[4] = _scene->loadAnimation(formAnimName('x', 1), 1);
+ _julieStatus = 0;
+ _anim4ActvFl = true;
+ _globals[kMakeBrieLeave203] = true;
+ _game._player._playerPos = Common::Point(190, 148);
+ _game._player._facing = FACING_NORTH;
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ _scene->_hotspots.activate(NOUN_DRESSING_GOWN, true);
+ _scene->_hotspots.activate(NOUN_JULIE, true);
+ _scene->_hotspots.activateAtPos(NOUN_CHRISTINE, true, Common::Point(220, 130));
+ _game._player.walk(Common::Point(175, 128), FACING_NORTHEAST);
+ _game._player.setWalkTrigger(102);
+ } else {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('f', 1), 1);
+ _florentStatus = 1;
+ _anim2ActvFl = true;
+
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('r', 1), 1);
+ _raoulAction = 3;
+ _anim3ActvFl = true;
+ _scene->setAnimFrame(_globals._animationIndexes[3], 33);
+
+ if (_globals[kFlorentNameIsKnown] >= 1) {
+ _christineHotspotId2 = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(43, 118, 43 + 15, 118 + 29));
+ _scene->_dynamicHotspots[_christineHotspotId2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_christineHotspotId2, Common::Point(106, 127), FACING_SOUTHWEST);
+ } else {
+ _christineHotspotId2 = _scene->_dynamicHotspots.add(NOUN_WOMAN, VERB_WALK_TO, SYNTAX_FEM_NOT_PROPER, EXT_NONE, Common::Rect(43, 118, 43 + 15, 118 + 29));
+ _scene->_dynamicHotspots[_christineHotspotId2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_christineHotspotId2, Common::Point(106, 127), FACING_SOUTHWEST);
+ }
+
+ _game._player._playerPos = Common::Point(190, 148);
+ _game._player._facing = FACING_NORTH;
+
+ _scene->_hotspots.activate(NOUN_DRESSING_GOWN, true);
+ if (_game._objects.isInRoom(OBJ_SMALL_NOTE)) {
+ _scene->_hotspots.activate(NOUN_SMALL_NOTE, true);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 13);
+ }
+ }
+ } else if ((_globals[kCurrentYear] == 1881) && (! _globals[kChrisKickedRaoulOut])) {
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('r', 1), 1);
+ _raoulAction = 3;
+ _anim1ActvFl = true;
+ _scene->setAnimFrame(_globals._animationIndexes[1], 33);
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 1), 1);
+ _dayStatus = 2;
+ _anim0ActvFl = true;
+
+ _scene->_hotspots.activate(NOUN_CHRISTINE, true);
+ _scene->_hotspots.activateAtPos(NOUN_CHRISTINE, false, Common::Point(220, 130));
+ _scene->_sequences.addTimer(60, 60);
+ _game._player._playerPos = Common::Point(190, 148);
+ _game._player._facing = FACING_NORTH;
+ } else if ((_globals[kCurrentYear] == 1881) && _globals[kChrisKickedRaoulOut]) {
+ _globals[kChrisKickedRaoulOut] = 2;
+ _game._player._playerPos = Common::Point(190, 148);
+ _game._player._facing = FACING_NORTH;
+ _globals[kCameFromFade] = true;
+ _game._player._stepEnabled = false;
+ _globals[kPlayerScore] += 8;
+ _scene->_sequences.addTimer(60, 110);
+ } else if (_scene->_priorSceneId == 111) {
+ _game._player._playerPos = Common::Point(190, 148);
+ _game._player._facing = FACING_NORTH;
+ }
+
+ switch (_vm->_gameConv->_restoreRunning) {
+ case 4:
+ _vm->_gameConv->run(4);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ break;
+
+ case 6:
+ _vm->_gameConv->run(6);
+ break;
+
+ case 13:
+ _vm->_gameConv->run(13);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ break;
+
+ default:
+ break;
+ }
+
+ sceneEntrySound();
+}
+
+void Scene113::step() {
+ if (_anim1ActvFl)
+ handleRaoulAnimation2();
+
+ if (_anim4ActvFl)
+ handleJulieAnimation();
+
+ if (_anim2ActvFl)
+ handleFlorentAnimation();
+
+ if (_anim3ActvFl) {
+ handleRaoulAnimation();
+
+ if ((!_game._objects.isInInventory(OBJ_SMALL_NOTE)) && (_scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame() == 26)) {
+ _scene->_hotspots.activate(NOUN_SMALL_NOTE, false);
+ _game._objects.addToInventory(OBJ_SMALL_NOTE);
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _vm->_sound->command(26);
+ _vm->_dialogs->showItem(OBJ_SMALL_NOTE, 806, 2);
+ }
+ }
+
+ if ((_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 86) && (!_prevent2)) {
+ _scene->freeAnimation(_globals._animationIndexes[0]);
+ _prevent2 = true;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 2), 0);
+ _scene->setAnimFrame (_globals._animationIndexes[0], 86);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_CLOCK, 0);
+ _scene->animations_tick();
+ }
+
+ if (_anim0ActvFl) {
+ handleDayAnimation();
+
+ if ((_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 95) && (!_armsOutFl)) {
+ _standingAndTalking = true;
+ _dayStatus = 7;
+ _raoulAction = 3;
+ _armsOutFl = true;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_ANIM, _globals._animationIndexes[1]);
+ }
+
+ if ((_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 165) && !_afterKissFl)
+ _afterKissFl = true;
+ }
+
+ switch (_game._trigger) {
+ case 60:
+ if (!_game._visitedScenes._sceneRevisited)
+ _vm->_dialogs->show(11342);
+ break;
+
+ case 102:
+ _game._player._stepEnabled = true;
+ _vm->_gameConv->run(6);
+ break;
+
+ case 108:
+ _vm->_dialogs->show(11332);
+ _vm->_dialogs->show(11333);
+ _scene->_nextSceneId = 150;
+ _globals[kLeaveAngelMusicOn] = false;
+ break;
+
+ case 110:
+ _vm->_dialogs->show(11331);
+ _game._player.walk(Common::Point(272, 138), FACING_EAST);
+ _game._player.setWalkTrigger(108);
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene113::actions() {
+ if (_vm->_gameConv->_running == 13) {
+ handleLoveConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 4) {
+ handleFlorentConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 6) {
+ handleDeadConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_TALK_TO, NOUN_WOMAN)) || (_action.isAction(VERB_TALK_TO, NOUN_CHRISTINE))) {
+ if (_globals[kCurrentYear] == 1881) {
+ _game._player._stepEnabled = true;
+ _vm->_gameConv->run(13);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ } else if (_globals[kDoneBrieConv203]) {
+ _vm->_dialogs->show(11348);
+ } else {
+ _game._player._stepEnabled = true;
+ _vm->_gameConv->run(4);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_CORRIDOR)) {
+ if (_globals[kDoneBrieConv203] == 1)
+ _globals[kDoneBrieConv203] = 3;
+
+ _scene->_nextSceneId = 111;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ if (_globals[kCurrentYear] == 1993) {
+ if (_globals[kDoneBrieConv203])
+ _vm->_dialogs->show(11340);
+ else
+ _vm->_dialogs->show(11310);
+ } else {
+ _vm->_dialogs->show(11311);
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(11312);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RUG)) {
+ _vm->_dialogs->show(11313);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(11314);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COUCH)) {
+ _vm->_dialogs->show(11315);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MURAL)) {
+ _vm->_dialogs->show(11316);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PAINTING)) {
+ if (_globals[kCurrentYear] == 1881)
+ _vm->_dialogs->show(11317);
+ else
+ _vm->_dialogs->show(11343);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PAINTING)) {
+ _vm->_dialogs->show(11317);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DRESSING_TABLE)) {
+ _vm->_dialogs->show(11318);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHAIR)) {
+ _vm->_dialogs->show(11319);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MIRROR)) {
+ if (_globals[kCurrentYear] == 1993) {
+ _vm->_dialogs->show(11344);
+ } else {
+ _vm->_dialogs->show(11320);
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FAN)) {
+ _vm->_dialogs->show(11321);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_VASE)) {
+ _vm->_dialogs->show(11322);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HAT_RACK)) {
+ _vm->_dialogs->show(11323);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LIGHT_FIXTURE)) {
+ _vm->_dialogs->show(11324);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(11325);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WARDROBE)) {
+ _vm->_dialogs->show(11326);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DRESSING_SCREEN)) {
+ _vm->_dialogs->show(11327);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CORRIDOR)) {
+ _vm->_dialogs->show(11328);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DRESSING_GOWN)) {
+ _vm->_dialogs->show(11330);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SMALL_NOTE) && _game._objects.isInRoom(OBJ_SMALL_NOTE)) {
+ _vm->_dialogs->show(11349);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHRISTINE) && _globals[kDoneBrieConv203]) {
+ _vm->_dialogs->show(11338);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_JULIE)) {
+ _vm->_dialogs->show(11339);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_NOTICE)) {
+ _vm->_dialogs->show(11347);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CLOTHES_DUMMY)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11345);
+ else
+ _vm->_dialogs->show(11346);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WOMAN) || _action.isObject(NOUN_CHRISTINE)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11341);
+ else {
+ if (_musicPlaying)
+ _vm->_dialogs->show(11336);
+ else
+ _vm->_dialogs->show(11342);
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_WARDROBE)) {
+ _vm->_dialogs->show(11329);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_SMALL_NOTE) && _game._objects.isInRoom(OBJ_SMALL_NOTE)) {
+ _vm->_dialogs->show(11334);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_DRESSING_GOWN)) {
+ _vm->_dialogs->show(11335);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_CHRISTINE) || _action.isAction(VERB_TAKE, NOUN_WOMAN)) {
+ _vm->_dialogs->show(11337);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene113::preActions() {
+ if (_action.isAction(VERB_WALK_UP, NOUN_AISLE))
+ _game._player._walkOffScreenSceneId = 101;
+
+ if (_action.isAction(VERB_LOOK, NOUN_MIRROR))
+ _game._player.walk(Common::Point(272, 138), FACING_EAST);
+
+ if (! _action.isAction(VERB_EXIT_TO, NOUN_CORRIDOR) && !_globals[kChrisKickedRaoulOut]
+ && !_action.isAction(VERB_LOOK, NOUN_CHRISTINE) && !_action.isAction(VERB_TAKE, NOUN_CHRISTINE) && _musicPlaying) {
+ _vm->_gameConv->run(13);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _game._player.cancelCommand();
+ } else if (_action.isAction(VERB_TALK_TO, NOUN_WOMAN) || _action.isAction(VERB_TALK_TO, NOUN_CHRISTINE)) {
+ _game._player.walk(Common::Point(106, 127), FACING_SOUTHWEST);
+ }
+
+ if (!_action.isAction(VERB_EXIT_TO, NOUN_CORRIDOR) && !_action.isAction(VERB_LOOK, NOUN_JULIE)
+ && !_action.isAction(VERB_LOOK, NOUN_CHRISTINE) && !_action._lookFlag && (_globals[kDoneBrieConv203] != 0)
+ && (_globals[kCurrentYear] == 1993)) {
+ if (_action.isAction(VERB_TALK_TO, NOUN_CHRISTINE)) {
+ _game._player._needToWalk = false;
+
+ } else if (_action.isAction(VERB_LOOK)) {
+ _game._player._needToWalk = false;
+
+ } else if (_action.isAction(VERB_TALK_TO, NOUN_JULIE)) {
+ _game._player._needToWalk = false;
+ _vm->_gameConv->run(6);
+ _game._player.cancelCommand();
+
+ } else {
+ _vm->_dialogs->show(11350);
+ _game._player._needToWalk = false;
+ _game._player.cancelCommand();
+ }
+ }
+}
+
+void Scene113::handleFlorentAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame() == _florentFrame)
+ return;
+
+ int random;
+ _florentFrame = _scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_florentFrame) {
+ case 1:
+ case 11:
+ case 23:
+ case 38:
+ case 45:
+ random = _vm->getRandomNumber(4, 30);
+
+ if (_florentStatus == 2) {
+ random = 1;
+ }
+
+ if (_florentStatus == 0) {
+ random = 2;
+ }
+
+ if (_florentStatus == 3) {
+ random = 3;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 2;
+ _florentStatus = 1;
+ break;
+
+ case 2:
+ resetFrame = 28;
+ break;
+
+ case 3:
+ resetFrame = 39;
+ break;
+
+ case 4:
+ resetFrame = 12;
+ break;
+
+ default:
+ resetFrame = 0;
+ break;
+ }
+ break;
+
+ case 24:
+ case 25:
+ case 26:
+ case 27:
+ case 33:
+ random = _vm->getRandomNumber(5, 20);
+
+ if (_florentStatus == 0) {
+ random = _vm->getRandomNumber(1, 4);
+ ++_florentCount;
+ if (_florentCount > 5) {
+ _florentStatus = 1;
+ random = 5;
+ }
+ }
+
+ if ((_florentStatus == 2) ||
+ (_florentStatus == 3)) {
+ random = 5;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 23;
+ break;
+
+ case 2:
+ resetFrame = 24;
+ break;
+
+ case 3:
+ resetFrame = 25;
+ break;
+
+ case 4:
+ resetFrame = 26;
+ break;
+
+ case 5:
+ resetFrame = 34;
+ break;
+
+ default:
+ resetFrame = 32;
+ break;
+ }
+ break;
+
+ case 42:
+ if (_florentStatus == 3)
+ resetFrame = 41;
+
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[2], resetFrame);
+ _florentFrame = resetFrame;
+ }
+}
+
+void Scene113::handleDayAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _dayFrame)
+ return;
+
+ _dayFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int random;
+ int resetFrame = -1;
+ switch (_dayFrame) {
+ case 1:
+ case 4:
+ case 14:
+ case 17:
+ case 20:
+ case 26:
+ case 166:
+ case 206:
+ case 207:
+ case 208:
+ case 209:
+ case 210:
+ case 211:
+ case 219:
+ case 231:
+ case 253:
+ switch (_dayStatus) {
+ case 0:
+ random = _vm->getRandomNumber(1, 3);
+ ++_dayCount;
+ if (_dayCount < 6) {
+ if (random == 1) {
+ resetFrame = 1;
+ } else if (random == 2) {
+ resetFrame = 15;
+ } else {
+ resetFrame = 18;
+ }
+ } else {
+ _dayStatus = 1;
+ resetFrame = 25;
+ _dayWantsToTalk = false;
+ }
+ break;
+
+ case 1:
+ if (_dayWantsToTalk) {
+ _dayStatus = 0;
+ _dayWantsToTalk = false;
+ resetFrame = 1;
+ } else {
+ resetFrame = 25;
+ }
+ break;
+
+ case 2:
+ random = _vm->getRandomNumber(1, 50);
+ switch (random) {
+ case 1:
+ resetFrame = 212;
+ break;
+
+ case 2:
+ resetFrame = 219;
+ break;
+
+ case 3:
+ resetFrame = 231;
+ break;
+
+ default:
+ resetFrame = 0;
+ break;
+ }
+ break;
+
+ case 3:
+ resetFrame = 5;
+ _dayStatus = 0;
+ break;
+
+ case 4:
+ resetFrame = 31;
+ break;
+
+ case 5:
+ resetFrame = _vm->getRandomNumber(205, 207);
+ ++_standCount;
+ if (_standCount > 18) {
+ _dayStatus = 7;
+ resetFrame = 165;
+ }
+ if (_musicPlaying)
+ resetFrame = 167;
+ break;
+
+ case 6:
+ resetFrame = _vm->getRandomNumber(208, 210);
+ while (_lastDayResetFrame == resetFrame)
+ resetFrame = _vm->getRandomNumber(208, 210);
+
+ _lastDayResetFrame = resetFrame;
+
+ ++_standCount;
+ if (_standCount > 18) {
+ _dayStatus = 7;
+ resetFrame = 165;
+ }
+
+ if (_musicPlaying)
+ resetFrame = 167;
+ break;
+
+ case 7:
+ resetFrame = 165;
+ if (_musicPlaying)
+ resetFrame = 167;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 182:
+ _game._player._visible = true;
+ _vm->_gameConv->release();
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[1]);
+ _game._player._playerPos = Common::Point(175, 148);
+ _game._player._turnToFacing = FACING_NORTHEAST;
+ _game._player.resetFacing(FACING_SOUTHEAST);
+ _game._player._turnToFacing = FACING_NORTHEAST;
+ break;
+
+ case 205:
+ case 212:
+ resetFrame = 211;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _dayFrame = resetFrame;
+ }
+}
+
+void Scene113::handleRaoulAnimation() {
+ if (_globals[kFlorentNameIsKnown] == 2)
+ _raoulAction = 3;
+
+ if (_scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame() == _raoulFrame)
+ return;
+
+ _raoulFrame = _scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_raoulFrame) {
+ case 9:
+ case 10:
+ case 11:
+ case 34:
+ case 33:
+ if (_raoulFrame == 33)
+ _vm->_gameConv->release();
+
+ switch (_raoulAction) {
+ case 0:
+ resetFrame = _vm->getRandomNumber(7, 9);
+ ++_raoulCount;
+
+ if (_raoulCount > 17) {
+ _raoulAction = 1;
+ resetFrame = 8;
+ }
+ break;
+
+ case 1:
+ resetFrame = 8;
+ break;
+
+ case 2:
+ resetFrame = 11;
+ break;
+
+ case 3:
+ resetFrame = 33;
+ break;
+
+ case 4:
+ resetFrame = 38;
+ _raoulStandingFl = true;
+ _vm->_gameConv->hold();
+ break;
+
+ case 5:
+ resetFrame = 20;
+ _raoulAction = 1;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 19:
+ if ((_raoulAction == 5) && (!_game._objects.isInInventory(OBJ_SMALL_NOTE))) {
+ resetFrame = 20;
+ _raoulAction = 1;
+ } else if (_raoulAction == 4) {
+ resetFrame = 38;
+ _raoulStandingFl = true;
+ } else if (_raoulAction == 0) {
+ resetFrame = 9;
+ } else {
+ resetFrame = 8;
+ _raoulAction = 1;
+ }
+ break;
+
+ case 42:
+ if (_raoulAction == 4) {
+ if (!_prevent2) {
+ _vm->_gameConv->release();
+ }
+ resetFrame = 33;
+ _raoulAction = 3;
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[3]);
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[3], resetFrame);
+ _raoulFrame = resetFrame;
+ }
+}
+
+void Scene113::handleRaoulAnimation2() {
+ if (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == _raoulFrame)
+ return;
+
+ _raoulFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+ int resetFrame = -1;
+ switch (_raoulFrame) {
+ case 9:
+ case 10:
+ case 11:
+ case 34:
+ switch (_raoulAction) {
+ case 0:
+ resetFrame = _vm->getRandomNumber(7, 9);
+ ++_raoulCount;
+
+ if (_raoulCount > 17) {
+ _raoulAction = 1;
+ resetFrame = 8;
+ }
+ break;
+
+ case 1:
+ resetFrame = 8;
+ break;
+
+ case 2:
+ resetFrame = 11;
+ break;
+
+ case 3:
+ resetFrame = 33;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 19:
+ if (_raoulAction == 0)
+ resetFrame = 9;
+ else {
+ resetFrame = 8;
+ _raoulAction = 1;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _raoulFrame = resetFrame;
+ }
+}
+
+void Scene113::handleJulieAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[4]]->getCurrentFrame() == _julieFrame)
+ return;
+
+ _julieFrame = _scene->_animation[_globals._animationIndexes[4]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random;
+
+ switch (_julieFrame) {
+ case 1:
+ case 2:
+ case 3:
+ case 11:
+ case 16:
+ case 17:
+ switch (_julieStatus) {
+ case 0:
+ random = _vm->getRandomNumber(4, 20);
+ break;
+
+ case 1:
+ random = _vm->getRandomNumber(1, 3);
+ ++_julieCount;
+ if (_julieCount > 20) {
+ _julieStatus = 0;
+ random = 6;
+ }
+ break;
+
+ default:
+ random = -1;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 0;
+ break;
+
+ case 2:
+ resetFrame = 1;
+ break;
+
+ case 3:
+ resetFrame = 2;
+ break;
+
+ case 4:
+ resetFrame = 12;
+ break;
+
+ case 5:
+ resetFrame = 4;
+ break;
+
+ default:
+ resetFrame = 16;
+ break;
+ }
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[4], resetFrame);
+ _julieFrame = resetFrame;
+ }
+}
+
+void Scene113::handleDeadConversation() {
+ switch (_game._trigger) {
+ case 106:
+ _julieStatus = 1;
+ break;
+
+ case 104:
+ _julieStatus = 0;
+ break;
+
+ default:
+ break;
+ }
+
+ _vm->_gameConv->setInterlocutorTrigger(106);
+ _vm->_gameConv->setHeroTrigger(104);
+
+ _julieCount = 0;
+}
+
+void Scene113::handleFlorentConversation() {
+ switch (_action._activeAction._verbId) {
+ case 3:
+ case 4:
+ if (!_prevent1) {
+ _globals[kFlorentNameIsKnown] = 1;
+ _vm->_gameConv->setInterlocutorTrigger(82);
+ _scene->_dynamicHotspots.remove(_christineHotspotId2);
+ _christineHotspotId2 = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(43, 118, 43 + 15, 118 + 29));
+ _scene->_dynamicHotspots[_christineHotspotId2]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(_christineHotspotId2, Common::Point(106, 127), FACING_SOUTHWEST);
+ _prevent1 = true;
+ }
+ break;
+
+ case 19:
+ _florentStatus = 2;
+ _vm->_gameConv->setInterlocutorTrigger(86);
+ break;
+
+ case 25:
+ if (_raoulAction != 3)
+ _raoulAction = 4;
+ break;
+
+ case 26:
+ if (!_prevent2) {
+ _scene->_sequences.addTimer(120, 92);
+ _vm->_gameConv->setInterlocutorTrigger(96);
+ _florentStatus = 0;
+ _prevent2 = true;
+ }
+ break;
+
+ case 27:
+ case 30:
+ _vm->_gameConv->setInterlocutorTrigger(98);
+ break;
+
+ case 28:
+ case 29:
+ _vm->_gameConv->setInterlocutorTrigger(100);
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 62:
+ if ((_action._activeAction._verbId != 3) && (_action._activeAction._verbId != 4) && (_action._activeAction._verbId != 19) &&
+ (_action._activeAction._verbId != 27) && (_action._activeAction._verbId != 28) && (_action._activeAction._verbId != 29)) {
+ if ((_raoulAction != 5) && (_raoulAction != 4) && !_raoulStandingFl)
+ _raoulAction = 0;
+
+ if ((_florentStatus != 3) && (_florentStatus != 2))
+ _florentStatus = 1;
+ }
+ break;
+
+ case 66:
+ if ((_florentStatus != 3) &&
+ (_florentStatus != 2)) {
+ if (_vm->getRandomNumber(1, 5) == 1)
+ _florentStatus = 0;
+ }
+
+ if ((_raoulAction != 3) && (_raoulAction != 5) && (_raoulAction != 4) && (!_raoulStandingFl)) {
+ _raoulAction = 1;
+ if (_vm->getRandomNumber(1, 2) == 1)
+ _raoulAction = 2;
+ }
+ break;
+
+ case 80:
+ _vm->_gameConv->release();
+ _game._player._visible = false;
+ _raoulAction = 1;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[3], SYNC_PLAYER, 0);
+ _scene->setAnimFrame(_globals._animationIndexes[3], 1);
+ break;
+
+ case 82:
+ _florentStatus = 0;
+ _scene->_sequences.addTimer(120, 84);
+ _vm->_gameConv->hold();
+ break;
+
+ case 84:
+ _game._player.walk(Common::Point(201, 120), FACING_SOUTH);
+ _game._player.setWalkTrigger(80);
+ break;
+
+ case 86:
+ _raoulAction = 5;
+ _vm->_gameConv->hold();
+ break;
+
+ case 92:
+ _game._player.walk(Common::Point(68, 142), FACING_SOUTHWEST);
+ _game._player.setWalkTrigger(94);
+ break;
+
+ case 94:
+ _globals[kStopWalkerDisabled] = true;
+ _globals[kFlorentNameIsKnown] = 2;
+ _vm->_gameConv->release();
+ break;
+
+ case 96:
+ _vm->_gameConv->hold();
+ break;
+
+ case 98:
+ _florentStatus = 3;
+ break;
+
+ case 100:
+ _florentStatus = 1;
+ _globals[kStopWalkerDisabled] = false;
+ break;
+
+ default:
+ break;
+ }
+
+ if ((_action._activeAction._verbId != 3) && (_action._activeAction._verbId != 4) && (_action._activeAction._verbId != 19) &&
+ (_action._activeAction._verbId != 28) && (_action._activeAction._verbId != 29) && (_action._activeAction._verbId != 27) &&
+ (_action._activeAction._verbId != 30) && (_action._activeAction._verbId != 26))
+ _vm->_gameConv->setInterlocutorTrigger(66);
+
+ _vm->_gameConv->setHeroTrigger(62);
+ _raoulCount = 0;
+ _florentCount = 0;
+}
+
+void Scene113::handleLoveConversation() {
+ switch (_action._activeAction._verbId) {
+ case 1:
+ case 2:
+ if (!_prevent1) {
+ _vm->_gameConv->setInterlocutorTrigger(82);
+ _prevent1 = true;
+ }
+ break;
+
+ case 21:
+ if (!_armsOutFl) {
+ _dayStatus = 4;
+ _scene->_sequences.addTimer(1, 70);
+ _scene->_userInterface.emptyConversationList();
+ _scene->_userInterface.setup(kInputConversation);
+ _scene->_hotspots.activate(NOUN_CHRISTINE, false);
+ _vm->_gameConv->hold();
+ }
+ break;
+
+ case 27:
+ _vm->_sound->command(34);
+ _globals[kLeaveAngelMusicOn] = true;
+ break;
+
+ case 31:
+ if (!_musicPlaying) {
+ _vm->_gameConv->hold();
+ _dayStatus = 7;
+ _musicPlaying = true;
+ _christineHotspotId1 = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[_christineHotspotId1]._articleNumber = PREP_ON;
+ _scene->setDynamicAnim(_christineHotspotId1, _globals._animationIndexes[0], 14);
+ _scene->setDynamicAnim(_christineHotspotId1, _globals._animationIndexes[0], 16);
+ }
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 62:
+ if (_action._activeAction._verbId != 0) {
+ if (_standingAndTalking) {
+ _dayStatus = 6;
+ } else if (_dayStatus != 4) {
+ _dayStatus = 1;
+ _raoulAction = 0;
+ _dayWantsToTalk = false;
+ }
+ }
+ break;
+
+ case 66:
+ if (_standingAndTalking) {
+ _dayStatus = 5;
+
+ } else {
+ if (_action._activeAction._verbId == 19) {
+ _dayStatus = 3;
+ } else {
+ _dayStatus = 1;
+ _dayWantsToTalk = true;
+ }
+
+ if (_raoulAction != 3) {
+ _raoulAction = 1;
+ if (_vm->getRandomNumber(1, 2) == 1)
+ _raoulAction = 2;
+ }
+ }
+ break;
+
+ case 70:
+ if (_armsOutFl) {
+ _vm->_gameConv->release();
+ _vm->_gameConv->setInterlocutorTrigger(76);
+ }
+ break;
+
+ case 72:
+ if (_afterKissFl)
+ _vm->_gameConv->release();
+ else
+ _scene->_sequences.addTimer(1, 72);
+ break;
+
+ case 76:
+ _vm->_gameConv->hold();
+ _scene->_sequences.addTimer(1, 72);
+ break;
+
+ case 78:
+ if (_armsOutFl) {
+ _vm->_gameConv->release();
+ _vm->_gameConv->setInterlocutorTrigger(76);
+ }
+ break;
+
+ case 80:
+ _vm->_gameConv->release();
+ _game._player._visible = false;
+ _raoulAction = 1;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[1], SYNC_PLAYER, 0);
+ _scene->setAnimFrame(_globals._animationIndexes[1], 1);
+ break;
+
+ case 82:
+ _scene->_sequences.addTimer(120, 84);
+ _vm->_gameConv->hold();
+ _dayStatus = 1;
+ _dayWantsToTalk = true;
+ break;
+
+ case 84:
+ _game._player.walk(Common::Point(201, 120), FACING_SOUTH);
+ _game._player.setWalkTrigger(80);
+ break;
+
+ default:
+ break;
+ }
+
+ if ((_action._activeAction._verbId != 21) && (_action._activeAction._verbId != 1) && (_action._activeAction._verbId != 2))
+ _vm->_gameConv->setInterlocutorTrigger(66);
+
+ _vm->_gameConv->setHeroTrigger(62);
+
+ _raoulCount = 0;
+ _dayCount = 0;
+ _standCount = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene114::Scene114(MADSEngine *vm) : Scene1xx(vm) {
+}
+
+void Scene114::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+}
+
+void Scene114::setup() {
+ if (_globals[kCurrentYear] == 1993)
+ _scene->_variant = 1;
+
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene114::enter() {
+ if (_globals[kCurrentYear] == 1993) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
+ } else if (_game._objects.isInRoom(OBJ_ROPE) && !_game._objects.isInInventory(OBJ_ROPE_WITH_HOOK)) {
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites("*RDR_9");
+ }
+
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('a', 0));
+
+ if ((_game._objects.isInRoom(OBJ_ROPE)) && (_globals[kCurrentYear] == 1881) && !_game._objects.isInInventory(OBJ_ROPE_WITH_HOOK)) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2);
+ } else
+ _scene->_hotspots.activate(NOUN_ROPE, false);
+
+ if (_globals[kCurrentYear] == 1993) {
+ _scene->_hotspots.activate(NOUN_CYLINDER, false);
+ _scene->_hotspots.activate(NOUN_MANNEQUINS, false);
+ _scene->_hotspots.activate(NOUN_PROP, false);
+ _scene->_hotspots.activate(NOUN_BUST, false);
+ _scene->_hotspots.activate(NOUN_SCAFFOLDING, false);
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ } else {
+ _scene->_hotspots.activate(NOUN_BOXES, false);
+ _scene->_hotspots.activate(NOUN_DINETTE_SET, false);
+ _scene->_hotspots.activate(NOUN_CRATE, false);
+ _scene->_hotspots.activate(NOUN_CASES, false);
+ }
+
+ if ((_scene->_priorSceneId == 105) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(218, 123);
+ _game._player._facing = FACING_WEST;
+ }
+
+ sceneEntrySound();
+}
+
+void Scene114::step() {
+}
+
+void Scene114::actions() {
+ if (_action.isAction(VERB_CLIMB_UP, NOUN_CIRCULAR_STAIRCASE)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('u', 1), 1);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ break;
+
+ case 1:
+ _scene->_nextSceneId = 105;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_UP, NOUN_CIRCULAR_STAIRCASE)) {
+ _scene->_nextSceneId = 105;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_ROPE) && (_game._objects.isInRoom(OBJ_ROPE) || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _globals[kPlayerScore] += 5;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 6, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 3);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 3, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _scene->_hotspots.activate(NOUN_ROPE, false);
+ _game._objects.addToInventory(OBJ_ROPE);
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[1]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ break;
+
+ case 3:
+ _vm->_dialogs->showItem(OBJ_ROPE, 807, 0);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(11410);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(11411);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CIRCULAR_STAIRCASE)) {
+ _vm->_dialogs->show(11412);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ROPE) && _game._objects.isInRoom(OBJ_ROPE)) {
+ _vm->_dialogs->show(11413);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(11414);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MANNEQUINS)) {
+ _vm->_dialogs->show(11415);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLAT)) {
+ _vm->_dialogs->show(11416);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SCAFFOLDING)) {
+ _vm->_dialogs->show(11417);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MUMMY_PROP)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11418);
+ else
+ _vm->_dialogs->show(11433);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CRATES)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11419);
+ else
+ _vm->_dialogs->show(11434);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CRATE)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11420);
+ else
+ _vm->_dialogs->show(11435);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CARTONS)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11421);
+ else
+ _vm->_dialogs->show(11436);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CARTON)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11422);
+ else
+ _vm->_dialogs->show(11437);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PROP)) {
+ _vm->_dialogs->show(11423);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BUST)) {
+ _vm->_dialogs->show(11424);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MUG)) {
+ _vm->_dialogs->show(11425);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isObject(NOUN_CASES)) || (_action.isObject(NOUN_CASE))) {
+ _vm->_dialogs->show(11426);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOXES) || _action.isObject(NOUN_BOX)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11427);
+ else
+ _vm->_dialogs->show(11439);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOX)) {
+ if (_globals[kCurrentYear] == 1881) {
+ _vm->_dialogs->show(11439);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isObject(NOUN_DINETTE_SET)) {
+ _vm->_dialogs->show(11428);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CYLINDER)) {
+ _vm->_dialogs->show(11429);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_CARTONS)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11421);
+ else
+ _vm->_dialogs->show(11436);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_CARTON)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11422);
+ else
+ _vm->_dialogs->show(11437);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_CRATES)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11419);
+ else
+ _vm->_dialogs->show(11434);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_CRATE)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11419);
+ else
+ _vm->_dialogs->show(11435);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_CASES)) {
+ _vm->_dialogs->show(11426);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_BOXES) || _action.isAction(VERB_OPEN, NOUN_BOX)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(11427);
+ else
+ _vm->_dialogs->show(11439);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_MUG)) {
+ _vm->_dialogs->show(11430);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_MUMMY_PROP)) {
+ _vm->_dialogs->show(11431);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_MUMMY_PROP)) {
+ _vm->_dialogs->show(11432);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene114::preActions() {
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene150::Scene150(MADSEngine *vm) : Scene1xx(vm) {
+}
+
+void Scene150::synchronize(Common::Serializer &s) {
+ Scene1xx::synchronize(s);
+}
+
+void Scene150::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene150::enter() {
+ warning("TODO: Switch to letter box view. See definition of MADS_MENU_Y");
+
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+
+ if (_scene->_priorSceneId == 113)
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('l', 1), 1);
+ else if (_scene->_priorSceneId == 203) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('f', 1), 2);
+ sceneEntrySound();
+ } else if (_scene->_priorSceneId == 306)
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('e', 1), 4);
+ else if (_scene->_priorSceneId == 208)
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('h', 1), 3);
+ else
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('q', 1), 5);
+}
+
+void Scene150::step() {
+ if (_game._trigger == 1)
+ _scene->_nextSceneId = 203;
+
+ if (_game._trigger == 2)
+ _scene->_nextSceneId = 111;
+
+ if (_game._trigger == 4)
+ _scene->_nextSceneId = 204;
+
+ if (_game._trigger == 3) {
+ _globals[kJacquesStatus] = 1;
+ _scene->_nextSceneId = 205;
+ }
+
+ if (_game._trigger == 5)
+ _game._winStatus = 1;
+
+ if (_scene->_nextSceneId != _scene->_currentSceneId) {
+ byte pal[768];
+ _vm->_palette->getFullPalette(pal);
+ Common::fill(&pal[12], &pal[756], 0);
+ _vm->_palette->setFullPalette(pal);
+ }
+}
+
+void Scene150::actions() {
+}
+
+void Scene150::preActions() {
+}
/*------------------------------------------------------------------------*/
diff --git a/engines/mads/phantom/phantom_scenes1.h b/engines/mads/phantom/phantom_scenes1.h
index 0f5f56a4cf..cadfcefbef 100644
--- a/engines/mads/phantom/phantom_scenes1.h
+++ b/engines/mads/phantom/phantom_scenes1.h
@@ -55,8 +55,20 @@ public:
class Scene101 : public Scene1xx {
private:
- // TODO
-
+ int _chanStatus;
+ int _wipeStatus;
+ int _callingStatus;
+ int _chandelierStatus;
+ int _callingFrame;
+ int _chandelierFrame;
+ int _talkCounter;
+ int _convCounter;
+ int _brieAnimId;
+ bool _startWalkingFl;
+ bool _startWalking0Fl;
+ bool _anim0Running;
+ bool _anim1Running;
+ bool _startSittingFl;
public:
Scene101(MADSEngine *vm);
virtual void synchronize(Common::Serializer &s);
@@ -66,11 +78,16 @@ public:
virtual void step();
virtual void preActions();
virtual void actions();
+
+ void handleConversation0();
+ void handleConversation1();
+ void handleAnimation0();
+ void handleAnimation1();
};
class Scene102 : public Scene1xx {
private:
- bool _animRunningFl;
+ bool _anim0Running;
public:
Scene102(MADSEngine *vm);
@@ -83,6 +100,321 @@ public:
virtual void actions();
};
+class Scene103 : public Scene1xx {
+private:
+ int _jacquesAction;
+ int _lastRandom;
+ int _standPosition;
+ int _hotspotPrompt1;
+ int _hotspotPrompt2;
+ int _hotspotPrompt3;
+ int _hotspotPrompt4;
+ int _hotspotPrompt5;
+ int _hotspotRightFloor1;
+ int _hotspotRightFloor2;
+ int _hotspotLeftFloor1;
+ int _hotspotLeftFloor2;
+ int _hotspotGentleman;
+ int _convCount;
+ int _lastStairFrame;
+ int _lastJacquesFrame;
+ int _talkCount;
+
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _anim2ActvFl;
+ bool _anim3ActvFl;
+ bool _anim4ActvFl;
+ bool _anim5ActvFl;
+ bool _anim6ActvFl;
+ bool _climbThroughTrapFl;
+ bool _guardFrameFl;
+ bool _sitFl;
+
+ void adjustRails(int variant);
+ void handleJacquesAnim();
+ void climbRightStairs();
+ void climbLeftStairs();
+ void descendRightStairs();
+ void descendLeftStairs();
+ void process_conv_jacques();
+
+public:
+ Scene103(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene104 : public Scene1xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _anim2ActvFl;
+ bool _needToGetUp;
+ bool _needToStandUp;
+ bool _needToTalk;
+ bool _sittingUp;
+ bool _beforeSheLeaves;
+ bool _beforeHeLeaves;
+
+ int _walkStatus;
+ int _walkFrame;
+ int _coupleStatus;
+ int _coupleFrame;
+ int _richStatus;
+ int _richFrame;
+ int _manTalkCount;
+ int _womanTalkCount;
+ int _lookCount;
+ int _richTalkCount;
+ int _lastPlayerFrame;
+
+ void cleanInventory();
+ void processConversations();
+ void handleWalkAnimation();
+ void handleCoupleAnimations();
+ void handleRichAnimations();
+ void handlePlayerWalk();
+
+public:
+ Scene104(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene105 : public Scene1xx {
+public:
+ Scene105(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene106 : public Scene1xx {
+private:
+ int _sandbagHostpotId;
+public:
+ Scene106(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene107 : public Scene1xx {
+public:
+ Scene107(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene108 : public Scene1xx {
+private:
+ bool _anim0ActvFl;
+ bool _handRaisedFl;
+ int _shutUpCount;
+ int _maxTalkCount;
+ int _charAction;
+ int _charFrame;
+ int _charTalkCount;
+ int _charHotspotId;
+ int _conversationCount;
+ int _prevShutUpFrame;
+
+ void handleCharAnimation();
+ void handleCharlesConversation();
+
+public:
+ Scene108(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene109 : public Scene1xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _anim2ActvFl;
+ bool _anim3ActvFl;
+ int _currentFloor;
+
+public:
+ Scene109(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene110 : public Scene1xx {
+public:
+ Scene110(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene111 : public Scene1xx {
+private:
+ bool _removeAxe;
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _closedFl;
+ int _listenFrame;
+ int _listenStatus;
+
+ void handleListenAnimation();
+ void handleListenConversation();
+
+public:
+ Scene111(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene112 : public Scene1xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+
+ int _raoulAction;
+ int _raoulFrame;
+ int _didOptionFl;
+ int _julieFrame;
+ int _julieAction;
+ int _julieCounter;
+ int _julieHotspotId;
+
+ void handleConversation();
+ void handleJulieAnimation();
+ void handleRaoulChair();
+
+public:
+ Scene112(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene113 : public Scene1xx {
+private:
+ bool _standingAndTalking;
+ bool _dayWantsToTalk;
+ bool _musicPlaying;
+ bool _afterKissFl;
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _anim2ActvFl;
+ bool _anim3ActvFl;
+ bool _anim4ActvFl;
+ bool _prevent1;
+ bool _prevent2;
+ bool _raoulStandingFl;
+ bool _armsOutFl;
+
+ int _christineHotspotId1;
+ int _christineHotspotId2;
+ int _dayStatus;
+ int _dayFrame;
+ int _dayCount;
+ int _florentStatus;
+ int _florentFrame;
+ int _florentCount;
+ int _julieStatus;
+ int _julieFrame;
+ int _julieCount;
+ int _raoulAction;
+ int _raoulFrame;
+ int _raoulCount;
+ int _lastDayResetFrame;
+ int _standCount;
+
+ void handleFlorentAnimation();
+ void handleDayAnimation();
+ void handleRaoulAnimation();
+ void handleRaoulAnimation2();
+ void handleJulieAnimation();
+ void handleDeadConversation();
+ void handleFlorentConversation();
+ void handleLoveConversation();
+
+public:
+ Scene113(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene114 : public Scene1xx {
+public:
+ Scene114(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene150 : public Scene1xx {
+public:
+ Scene150(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
} // End of namespace Phantom
} // End of namespace MADS
diff --git a/engines/mads/phantom/phantom_scenes2.cpp b/engines/mads/phantom/phantom_scenes2.cpp
new file mode 100644
index 0000000000..eff0bf8db9
--- /dev/null
+++ b/engines/mads/phantom/phantom_scenes2.cpp
@@ -0,0 +1,7001 @@
+/* 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.
+ *
+ */
+
+#include "common/scummsys.h"
+#include "mads/mads.h"
+#include "mads/conversations.h"
+#include "mads/scene.h"
+#include "mads/phantom/phantom_scenes.h"
+#include "mads/phantom/phantom_scenes2.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+void Scene2xx::setAAName() {
+ _game._aaName = Resources::formatAAName(_globals[kTempInterface]);
+ _vm->_palette->setEntry(254, 43, 47, 51);
+}
+
+void Scene2xx::sceneEntrySound() {
+ if (!_vm->_musicFlag)
+ return;
+
+ switch (_scene->_nextSceneId) {
+ case 206:
+ if (!_globals[kKnockedOverHead])
+ _vm->_sound->command(16);
+ break;
+
+ case 208:
+ _vm->_sound->command(34);
+ break;
+
+ default:
+ if (_scene->_nextSceneId != 250)
+ _vm->_sound->command(16);
+ break;
+ }
+}
+
+void Scene2xx::setPlayerSpritesPrefix() {
+ _vm->_sound->command(5);
+
+ if (_scene->_nextSceneId == 208)
+ _game._player._spritesPrefix = "";
+ else {
+ Common::String oldName = _game._player._spritesPrefix;
+ if (!_game._player._forcePrefix)
+ _game._player._spritesPrefix = "RAL";
+ if (oldName != _game._player._spritesPrefix)
+ _game._player._spritesChanged = true;
+ }
+
+ _game._player._scalingVelocity = true;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene201::Scene201(MADSEngine *vm) : Scene2xx(vm) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _needHoldFl = false;
+ _sellerCount = -1;
+ _sellerStatus = -1;
+ _sellerFrame = -1;
+ _raoulFrame = -1;
+ _raoulStatus = -1;
+}
+
+void Scene201::synchronize(Common::Serializer &s) {
+ Scene2xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_needHoldFl);
+ s.syncAsSint16LE(_sellerCount);
+ s.syncAsSint16LE(_sellerStatus);
+ s.syncAsSint16LE(_sellerFrame);
+ s.syncAsSint16LE(_raoulFrame);
+ s.syncAsSint16LE(_raoulStatus);
+}
+
+void Scene201::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene201::enter() {
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ }
+
+ _sellerCount = 0;
+ _needHoldFl = false;
+
+ _vm->_gameConv->get(16);
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('f', 0));
+
+ if (_globals[kTicketPeoplePresent]) {
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('s', 1), 0);
+ _anim1ActvFl = true;
+ _sellerStatus = 2;
+ _scene->setAnimFrame(_globals._animationIndexes[1], 5);
+ } else {
+ _scene->_hotspots.activate(NOUN_TICKET_SELLER, false);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ }
+
+ if (_vm->_gameConv->_restoreRunning == 16) {
+ _game._player._playerPos = Common::Point(72, 101);
+ _game._player._facing = FACING_NORTHWEST;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('r', 1), 0);
+ _anim0ActvFl = true;
+ _raoulStatus = 1;
+ _game._player._visible = false;
+
+ _vm->_gameConv->run(16);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportPointer(&_globals[kChristineToldEnvelope]);
+ }
+
+ if ((_scene->_priorSceneId == 202) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(314, 86);
+ _game._player.walk(Common::Point(266, 98), FACING_SOUTHWEST);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene201::step() {
+ if (_anim0ActvFl)
+ handleRaoulAnimation();
+
+ if (_anim1ActvFl)
+ handleSellerAnimation();
+
+ if ((_needHoldFl) && (_vm->_gameConv->_running != 16)) {
+ _game._player._stepEnabled = false;
+ _needHoldFl = false;
+ }
+}
+
+void Scene201::actions() {
+ if (_vm->_gameConv->_running == 16) {
+ handleConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY)) {
+ _scene->_nextSceneId = 202;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_TICKET_SELLER)) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('r', 1), 0);
+ _anim0ActvFl = true;
+ _raoulStatus = 1;
+ _vm->_gameConv->run(16);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportPointer(&_globals[kChristineToldEnvelope]);
+ _game._player._visible = false;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(20110);
+ else
+ _vm->_dialogs->show(20111);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(20112);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(20113);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BUST)) {
+ _vm->_dialogs->show(20114);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PEDESTAL)) {
+ _vm->_dialogs->show(20115);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BARRIER)) {
+ _vm->_dialogs->show(20116);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PLACARD)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(20117);
+ else
+ _vm->_dialogs->show(20118);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TICKET_WINDOW)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(20119);
+ else
+ _vm->_dialogs->show(20120);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ARCHWAY)) {
+ _vm->_dialogs->show(20121);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TICKET_SELLER)) {
+ _vm->_dialogs->show(20123);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_TICKET_SELLER)) {
+ _vm->_dialogs->show(20124);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_BUST)) {
+ _vm->_dialogs->show(20122);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene201::preActions() {
+ if ((_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) && _action.isObject(NOUN_PLACARD))
+ _game._player.walk(Common::Point(147, 104), FACING_NORTHWEST);
+}
+
+void Scene201::handleRaoulAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _raoulFrame)
+ return;
+
+ _raoulFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int random = -1;
+ int resetFrame = -1;
+
+ switch (_raoulFrame) {
+ case 1:
+ case 19:
+ case 49:
+ random = _vm->getRandomNumber(4, 50);
+
+ switch (_raoulStatus) {
+ case 0:
+ random = 1;
+ break;
+
+ case 2:
+ random = 2;
+ _game._player._stepEnabled = false;
+ break;
+
+ case 3:
+ random = 3;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 9;
+ _raoulStatus = 1;
+ break;
+
+ case 2:
+ resetFrame = 1;
+ break;
+
+ case 3:
+ _game._player._visible = true;
+ _sellerStatus = 2;
+ _anim0ActvFl = false;
+ resetFrame = 49;
+ _game._player._stepEnabled = true;
+ _needHoldFl = false;
+ break;
+
+ case 4:
+ resetFrame = 19;
+ break;
+
+ default:
+ resetFrame = 0;
+ break;
+
+ }
+ break;
+
+ case 5:
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _game._objects.addToInventory(OBJ_ENVELOPE);
+ _vm->_sound->command(26);
+ _vm->_dialogs->showItem(OBJ_ENVELOPE, 834, 0);
+ break;
+
+ case 9:
+ _game._player._visible = true;
+ _anim0ActvFl = false;
+ _game._player._stepEnabled = true;
+ resetFrame = 49;
+ break;
+
+ case 23:
+ case 35:
+ case 45:
+ random = _vm->getRandomNumber(3, 70);
+
+ switch (_raoulStatus) {
+ case 0:
+ random = 2;
+ break;
+
+ case 2:
+ case 3:
+ random = 1;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 45;
+ break;
+
+ case 2:
+ resetFrame = 23;
+ _raoulStatus = 1;
+ break;
+
+ case 3:
+ resetFrame = 35;
+ break;
+
+ default:
+ resetFrame = 22;
+ break;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _raoulFrame = resetFrame;
+ }
+}
+
+void Scene201::handleSellerAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == _sellerFrame )
+ return;
+
+ int random = -1;
+ int resetFrame = -1;
+ _sellerFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+
+ switch (_sellerFrame ) {
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 10:
+ if (_sellerFrame == 10)
+ _raoulStatus = 2;
+
+ switch (_sellerStatus) {
+ case 0:
+ random = 1;
+ break;
+
+ case 1:
+ random = _vm->getRandomNumber(1, 5);
+ ++_sellerCount;
+ if (_sellerCount > 30) {
+ _sellerStatus = 0;
+ random = 6;
+ }
+ break;
+
+ case 2:
+ if (_sellerFrame == 6)
+ random = 6;
+ else if (_sellerFrame == 7)
+ random = 7;
+ else
+ random = _vm->getRandomNumber(6, 7);
+
+ ++_sellerCount;
+ if (_sellerCount > 30) {
+ _sellerCount = 0;
+ random = _vm->getRandomNumber(6, 7);
+ }
+ break;
+
+ case 3:
+ random = 8;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 0;
+ break;
+
+ case 2:
+ resetFrame = 1;
+ break;
+
+ case 3:
+ resetFrame = 2;
+ break;
+
+ case 4:
+ resetFrame = 3;
+ break;
+
+ case 5:
+ resetFrame = 4;
+ break;
+
+ case 6:
+ resetFrame = 5;
+ break;
+
+ case 7:
+ resetFrame = 6;
+ break;
+
+ case 8:
+ resetFrame = 7;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 9:
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ _sellerStatus = 2;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _sellerFrame = resetFrame;
+ }
+}
+
+void Scene201::handleConversation() {
+ bool interlocutorFl = false;
+ bool heroFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 4:
+ case 12:
+ case 13:
+ case 14:
+ _vm->_gameConv->setInterlocutorTrigger(90);
+ _needHoldFl = true;
+ interlocutorFl = true;
+ break;
+
+ case 6:
+ _sellerStatus = 3;
+ _needHoldFl = true;
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 65:
+ if (_sellerStatus != 3)
+ _sellerStatus = 1;
+ break;
+
+ case 70:
+ if (_sellerStatus != 3) {
+ _sellerStatus = 0;
+ _raoulStatus = 0;
+ }
+ break;
+
+ case 90:
+ _vm->_gameConv->setHeroTrigger(91);
+ heroFl = true;
+ break;
+
+ case 91:
+ _raoulStatus = 3;
+ heroFl = true;
+ interlocutorFl = true;
+ break;
+
+ default:
+ break;
+ }
+
+ if (!heroFl)
+ _vm->_gameConv->setHeroTrigger(70);
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(65);
+
+ _sellerCount = 0;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene202::Scene202(MADSEngine *vm) : Scene2xx(vm) {
+ _ticketGivenFl = false;
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _skipWalkFl = false;
+
+ for (int i = 0; i < 5; i++) {
+ _chandeliersPosX[i] = -1;
+ _chandeliersHotspotId[i] = -1;
+ }
+
+ _conversationCount = -1;
+ _usherStatus = -1;
+ _usherFrame = -1;
+ _usherCount = -1;
+ _degasStatus = -1;
+ _degasFrame = -1;
+}
+
+void Scene202::synchronize(Common::Serializer &s) {
+ Scene2xx::synchronize(s);
+
+ s.syncAsByte(_ticketGivenFl);
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_skipWalkFl);
+
+ for (int i = 0; i < 5; i++) {
+ s.syncAsSint16LE(_chandeliersPosX[i]);
+ s.syncAsSint16LE(_chandeliersHotspotId[i]);
+ }
+
+ s.syncAsSint16LE(_conversationCount);
+ s.syncAsSint16LE(_usherStatus);
+ s.syncAsSint16LE(_usherFrame);
+ s.syncAsSint16LE(_usherCount);
+ s.syncAsSint16LE(_degasStatus);
+ s.syncAsSint16LE(_degasFrame);
+}
+
+void Scene202::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if (_globals[kTicketPeoplePresent] == 2)
+ _scene->_variant = 1;
+
+ _scene->addActiveVocab(NOUN_CHANDELIER);
+ _scene->addActiveVocab(NOUN_EDGAR_DEGAS);
+}
+
+void Scene202::enter() {
+ _vm->_disableFastwalk = true;
+ _ticketGivenFl = false;
+ _chandeliersPosX[0] = 77;
+ _chandeliersPosX[1] = 192;
+ _chandeliersPosX[2] = 319;
+ _chandeliersPosX[3] = 445;
+ _chandeliersPosX[4] = 560;
+
+ if (_globals[kTicketPeoplePresent] == 2)
+ _globals[kMakeRichLeave203] = true;
+
+ if ((_globals[kDegasNameIsKnown]) || (_globals[kCurrentYear] == 1993))
+ _scene->_hotspots.activate(NOUN_GENTLEMAN, false);
+
+ for (int i = 0; i < 5; i++) {
+ _globals._sequenceIndexes[2 + i] = -1;
+ _chandeliersHotspotId[i] = -1;
+ }
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _skipWalkFl = false;
+ }
+
+ _conversationCount = 0;
+ _vm->_gameConv->get(17);
+ _vm->_gameConv->get(9);
+
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites("*RDR_9");
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('f', 0));
+
+ if (_globals[kTicketPeoplePresent] == 2) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 0), 0);
+ _anim0ActvFl = true;
+ _usherStatus = 2;
+ } else
+ _scene->_hotspots.activate(NOUN_USHER, false);
+
+ if (_globals[kDegasNameIsKnown])
+ _anim1ActvFl = false;
+
+ if ((_globals[kCurrentYear] == 1881) && (!_globals[kDegasNameIsKnown])) {
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('d', 1), 100);
+ _anim1ActvFl = true;
+ _degasStatus = 4;
+ }
+
+ if (_vm->_gameConv->_restoreRunning == 17) {
+ _vm->_gameConv->run(17);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET));
+ _vm->_gameConv->exportValue(0);
+ _game._player._playerPos = Common::Point(569, 147);
+ _game._player._facing = FACING_NORTHEAST;
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+
+ if (_vm->_gameConv->_restoreRunning == 9) {
+ _vm->_gameConv->run(9);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _game._player._playerPos = Common::Point(400, 141);
+ _game._player._facing = FACING_NORTHWEST;
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+
+ if (_scene->_priorSceneId == 201) {
+ _game._player._playerPos = Common::Point(3, 141);
+ _game._player.walk(Common::Point(40, 141), FACING_EAST);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ } else if (_scene->_priorSceneId == 203) {
+ _game._player._playerPos = Common::Point(134, 112);
+ _game._player._facing = FACING_SOUTH;
+ _game._player._stepEnabled = false;
+ _game._player.walk(Common::Point(126, 123), FACING_SOUTH);
+ _game._player.setWalkTrigger(60);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ } else if (_scene->_priorSceneId == 204) {
+ _game._player._playerPos = Common::Point(253, 117);
+ _game._player.walk(Common::Point(255, 133), FACING_SOUTH);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->setCamera(Common::Point(70, 0));
+ } else if (_scene->_priorSceneId == 205) {
+ _game._player._playerPos = Common::Point(510, 117);
+ _game._player.walk(Common::Point(512, 133), FACING_SOUTH);
+ _scene->setCamera(Common::Point(320, 0));
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ } else if ((_scene->_priorSceneId == 101) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(636, 143);
+ _game._player.walk(Common::Point(598, 143), FACING_WEST);
+ _scene->setCamera(Common::Point(320, 0));
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ } else if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ }
+
+ handleChandeliersPositions();
+ sceneEntrySound();
+}
+
+void Scene202::step() {
+ if (_game._camX._currentFrameFl)
+ handleChandeliersPositions();
+
+ if (_anim0ActvFl)
+ handleUsherAnimation();
+
+ if (_game._trigger == 100)
+ _anim1ActvFl = false;
+
+ if (_anim1ActvFl)
+ handleDegasAnimation();
+
+ if ((_globals[kCurrentYear] == 1881) && !_globals[kDegasNameIsKnown] && (_game._player._playerPos.x < 405) && !_skipWalkFl) {
+ _game._player.walk(Common::Point(400, 141), FACING_NORTHWEST);
+ _game._player.setWalkTrigger(90);
+ _game._player._stepEnabled = false;
+ _skipWalkFl = true;
+ }
+
+ if (_game._trigger == 90) {
+ _game._player._stepEnabled = true;
+ _vm->_gameConv->run(9);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+
+ switch (_game._trigger) {
+ case 60:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[0], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 5);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 61);
+ break;
+
+ case 61:
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+
+ if ((_globals[kWalkerConverse] == 2) || (_globals[kWalkerConverse] == 3)) {
+ ++_conversationCount;
+ if (_conversationCount > 200)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+}
+
+void Scene202::actions() {
+ if (_vm->_gameConv->_running == 17) {
+ handleConversation1();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 9) {
+ handleConversation2();
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_globals[kTicketPeoplePresent] == 2) && (_action.isAction(VERB_WALK_THROUGH, NOUN_RIGHT_ARCHWAY) || _action.isAction(VERB_TALK_TO, NOUN_USHER))) {
+ _vm->_gameConv->run(17);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET));
+ _vm->_gameConv->exportValue(0);
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_GIVE, NOUN_TICKET, NOUN_USHER)) {
+ _ticketGivenFl = true;
+ _vm->_gameConv->run(17);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET));
+ _vm->_gameConv->exportValue(1);
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_GENTLEMAN) || _action.isAction(VERB_TALK_TO, NOUN_EDGAR_DEGAS)) {
+ if (!_globals[kDegasNameIsKnown] ) {
+ _vm->_gameConv->run(9);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ } else
+ _vm->_dialogs->show(20224);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_LEFT_DOOR) || _action.isAction(VERB_OPEN, NOUN_LEFT_DOOR)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 4, 80);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 82);
+ break;
+
+ case 80:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 5);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 81);
+ _vm->_sound->command(24);
+ break;
+
+ case 81: {
+ int idx = _globals._sequenceIndexes[0];
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 5);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[0], SYNC_SEQ, idx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _game._player.walk(Common::Point(134, 112), FACING_NORTH);
+ _game._player.setWalkTrigger(83);
+ }
+ break;
+
+ case 82:
+ _game._player._visible = true;
+ break;
+
+ case 83:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[0], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 5);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 84);
+ _vm->_sound->command(25);
+ break;
+
+ case 84:
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 1);
+ _scene->_nextSceneId = 203;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_LEFT_ARCHWAY)) {
+ _scene->_nextSceneId = 201;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_RIGHT_ARCHWAY)) {
+ _scene->_nextSceneId = 101;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_MIDDLE_DOOR)) {
+ _scene->_nextSceneId = 204;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_RIGHT_DOOR)) {
+ _scene->_nextSceneId = 205;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(20210);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(20211);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(20212);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LEFT_ARCHWAY)) {
+ _vm->_dialogs->show(20213);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RIGHT_ARCHWAY)) {
+ _vm->_dialogs->show(20214);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LEFT_DOOR)) {
+ _vm->_dialogs->show(20215);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MIDDLE_DOOR)) {
+ _vm->_dialogs->show(20216);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RIGHT_DOOR)) {
+ _vm->_dialogs->show(20217);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LIGHT_FIXTURE)) {
+ _vm->_dialogs->show(20218);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_OVERDOOR_MEDALLION)) {
+ _vm->_dialogs->show(20219);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DECORATIVE_MOLDING)) {
+ _vm->_dialogs->show(20220);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PAINTING)) {
+ _vm->_dialogs->show(20221);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_EDGAR_DEGAS) || _action.isObject(NOUN_GENTLEMAN)) {
+ _vm->_dialogs->show(20223);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_USHER)) {
+ _vm->_dialogs->show(20225);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHANDELIER)) {
+ _vm->_dialogs->show(20218);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE) && (_action.isObject(NOUN_GENTLEMAN) || _action.isObject(NOUN_EDGAR_DEGAS))) {
+ _vm->_dialogs->show(20226);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_USHER)) {
+ _vm->_dialogs->show(20227);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_DOOR)) {
+ _vm->_dialogs->show(20222);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene202::preActions() {
+ if (_action.isAction(VERB_OPEN, NOUN_LEFT_DOOR))
+ _game._player.walk(Common::Point(126, 123), FACING_NORTHEAST);
+
+ if ((_globals[kTicketPeoplePresent] == 2) && _action.isAction(VERB_WALK_THROUGH, NOUN_RIGHT_ARCHWAY))
+ _game._player.walk(Common::Point(569, 147), FACING_NORTHEAST);
+
+ if (_action.isAction(VERB_TAKE, NOUN_GENTLEMAN) || _action.isAction(VERB_TAKE, NOUN_EDGAR_DEGAS))
+ _game._player._needToWalk = false;
+}
+
+void Scene202::handleConversation1() {
+ bool interlocutorFl = false;
+ bool heroFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 0:
+ if (!_ticketGivenFl)
+ _usherStatus = 4;
+
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ case 3:
+ _vm->_gameConv->setInterlocutorTrigger(72);
+ _vm->_gameConv->setHeroTrigger(76);
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ case 4:
+ _vm->_gameConv->setHeroTrigger(76);
+ heroFl = true;
+ interlocutorFl = true;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 70:
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _usherStatus = 0;
+ break;
+
+ case 72:
+ _usherStatus = 17;
+ break;
+
+ case 74:
+ _globals[kWalkerConverse] = _vm->getRandomNumber(2, 3);
+ _usherStatus = 2;
+ _conversationCount = 0;
+ break;
+
+ case 76:
+ _globals[kWalkerConverse] = 0;
+ _ticketGivenFl = false;
+ heroFl = true;
+ interlocutorFl = true;
+ break;
+
+ default:
+ break;
+ }
+
+ if (!heroFl)
+ _vm->_gameConv->setHeroTrigger(74);
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(70);
+
+ _usherCount = 0;
+}
+
+void Scene202::handleConversation2() {
+ bool interlocutorFl = false;
+ bool heroFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 1:
+ _globals[kDegasNameIsKnown] = 1;
+ break;
+
+ case 10:
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _vm->_gameConv->setHeroTrigger(96);
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 74:
+ _globals[kWalkerConverse] = _vm->getRandomNumber(2, 3);
+ _degasStatus = 4;
+ _conversationCount = 0;
+ break;
+
+ case 93:
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ switch (_action._activeAction._verbId) {
+ case 1:
+ _degasStatus = 1;
+ break;
+
+ case 2:
+ _degasStatus = 2;
+ break;
+
+ default:
+ if ((_action._activeAction._verbId != 11) && (_action._activeAction._verbId != 12))
+ _degasStatus = 0;
+ break;
+ }
+ break;
+
+ case 96:
+ _vm->_gameConv->setInterlocutorTrigger(97);
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ case 97:
+ _vm->_gameConv->setHeroTrigger(98);
+ _degasStatus = 0;
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ case 98:
+ _globals[kWalkerConverse] = 0;
+ _degasStatus = 3;
+
+ if (_globals[kDegasNameIsKnown] == 1) {
+ int idx = _scene->_dynamicHotspots.add(NOUN_EDGAR_DEGAS, VERB_WALK_TO, SYNTAX_SINGULAR_MASC, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[idx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(596, 144), FACING_EAST);
+ _scene->setDynamicAnim(idx, _globals._animationIndexes[1], 1);
+ } else {
+ int idx = _scene->_dynamicHotspots.add(NOUN_GENTLEMAN, VERB_WALK_TO, SYNTAX_SINGULAR_MASC, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[idx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(596, 144), FACING_EAST);
+ _scene->setDynamicAnim(idx, _globals._animationIndexes[1], 1);
+ }
+
+ _globals[kDegasNameIsKnown] = 2;
+ interlocutorFl = true;
+ heroFl = true;
+ _scene->_hotspots.activate(NOUN_GENTLEMAN, false);
+ _game._player._stepEnabled = false;
+ _vm->_gameConv->hold();
+ break;
+
+ default:
+ break;
+ }
+
+ if (!heroFl)
+ _vm->_gameConv->setHeroTrigger(74);
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(93);
+}
+
+void Scene202::handleChandeliersPositions() {
+ int center = _scene->_posAdjust.x + 160;
+
+ for (int chandelier = 0; chandelier < 5; chandelier++) {
+ if (_globals._sequenceIndexes[chandelier + 2] >= 0)
+ _scene->deleteSequence(_globals._sequenceIndexes[chandelier + 2]);
+
+ int diff = center - _chandeliersPosX[chandelier];
+ int dir = 0;
+
+ if (diff < 0)
+ dir = 1;
+ else if (diff > 0)
+ dir = -1;
+
+ int shiftBase = (int)(abs(diff) / 5);
+ if (dir < 0)
+ shiftBase = -shiftBase;
+
+ int posX = _chandeliersPosX[chandelier] + shiftBase - 1;
+ int posY = _scene->_sprites[_globals._spriteIndexes[2]]->getFrameHeight(0) - 1;
+ int frameWidth = _scene->_sprites[_globals._spriteIndexes[2]]->getFrameWidth(0);
+
+ if (((posX - ((frameWidth >> 1) + 1)) >= (_scene->_posAdjust.x + 320)) || ((posX + ((frameWidth >> 1) + 1)) < _scene->_posAdjust.x))
+ _globals._sequenceIndexes[chandelier + 2] = -1;
+ else {
+ if (_chandeliersHotspotId[chandelier] != -1)
+ _scene->_dynamicHotspots.remove(_chandeliersHotspotId[chandelier]);
+
+ _chandeliersHotspotId[chandelier] = _scene->_dynamicHotspots.add(NOUN_CHANDELIER, VERB_LOOK_AT, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(posX - 8, posY - 12, posX + 8, posY + 1));
+
+ _globals._sequenceIndexes[chandelier + 2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[chandelier + 2], Common::Point(posX, posY));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[chandelier + 2], 1);
+ }
+ }
+}
+
+void Scene202::handleUsherAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _usherFrame)
+ return;
+
+ _usherFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random;
+ switch (_usherFrame) {
+ case 1:
+ case 13:
+ case 35:
+ case 51:
+ case 52:
+ case 53:
+ case 54:
+ switch (_usherStatus) {
+ case 0:
+ random = _vm->getRandomNumber(1, 3);
+ ++_usherCount;
+ if (_usherCount > 15) {
+ if (_action._activeAction._verbId == 0) {
+ _usherStatus = 3;
+ random = 5;
+ } else {
+ _usherStatus = 2;
+ random = 7;
+ }
+ }
+ break;
+
+ case 3:
+ random = 5;
+ break;
+
+ case 4:
+ random = 6;
+ break;
+
+ case 17:
+ random = 4;
+ break;
+
+ default:
+ random = 7;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 51;
+ break;
+
+ case 2:
+ resetFrame = 52;
+ break;
+
+ case 3:
+ resetFrame = 53;
+ break;
+
+ case 4:
+ resetFrame = 21;
+ _usherStatus = 17;
+ break;
+
+ case 5:
+ resetFrame = 1;
+ break;
+
+ case 6:
+ resetFrame = 35;
+ _usherStatus = 0;
+ break;
+
+ default:
+ resetFrame = 0;
+ break;
+ }
+ break;
+
+ case 7:
+ if (_usherStatus == 3)
+ random = 1;
+ else
+ random = 2;
+
+ if (random == 1)
+ resetFrame = 6;
+ else
+ resetFrame = 7;
+
+ break;
+
+ case 28:
+ if (_usherStatus == 17) {
+ random = 1;
+ ++_usherCount;
+ if (_usherCount > 15) {
+ _usherStatus = 2;
+ random = 2;
+ }
+ } else
+ random = 2;
+
+ if (random == 1)
+ resetFrame = 27;
+ else
+ resetFrame = 28;
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _usherFrame = resetFrame;
+ }
+}
+
+void Scene202::handleDegasAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == _degasFrame)
+ return;
+
+ _degasFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random;
+
+ switch (_degasFrame) {
+ case 1:
+ case 17:
+ case 58:
+ switch (_degasStatus) {
+ case 0:
+ _degasStatus = 4;
+ random = 1;
+ break;
+
+ case 1:
+ case 2:
+ case 3:
+ random = 2;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(3, 50);
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 1;
+ break;
+
+ case 2:
+ resetFrame = 58;
+ break;
+
+ case 3:
+ resetFrame = 58;
+ break;
+
+ default:
+ resetFrame = 0;
+ break;
+ }
+ break;
+
+ case 33:
+ case 40:
+ case 55:
+ case 62:
+ switch (_degasStatus) {
+ case 0:
+ _degasStatus = 4;
+ random = 1;
+ break;
+
+ case 1:
+ _degasStatus = 4;
+ random = 2;
+ break;
+
+ case 2:
+ _degasStatus = 4;
+ random = 3;
+ break;
+
+ case 3:
+ random = 4;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(5, 50);
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 33;
+ break;
+
+ case 2:
+ resetFrame = 17;
+ break;
+
+ case 3:
+ resetFrame = 42;
+ break;
+
+ case 4:
+ resetFrame = 62;
+ break;
+
+ case 5:
+ resetFrame = 41;
+ break;
+
+ case 6:
+ resetFrame = 55;
+ break;
+
+ default:
+ resetFrame = 39;
+ break;
+ }
+ break;
+
+ case 42:
+ switch (_degasStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ random = 1;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(1, 50);
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 39;
+ else
+ resetFrame = 41;
+
+ break;
+
+ case 110:
+ _vm->_gameConv->release();
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _degasFrame = resetFrame;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene203::Scene203(MADSEngine *vm) : Scene2xx(vm) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ _showNoteFl = false;
+
+ _brieStatus = -1;
+ _brieFrame = -1;
+ _brieCount = -1;
+ _raoulStatus = -1;
+ _raoulFrame = -1;
+ _raoulCount = -1;
+ _richardStatus = -1;
+ _richardFrame = -1;
+ _daaeStatus = -1;
+ _daaeFrame = -1;
+ _conversationCount = -1;
+}
+
+void Scene203::synchronize(Common::Serializer &s) {
+ Scene2xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_anim2ActvFl);
+ s.syncAsByte(_anim3ActvFl);
+ s.syncAsByte(_showNoteFl);
+
+ s.syncAsSint16LE(_brieStatus);
+ s.syncAsSint16LE(_brieFrame);
+ s.syncAsSint16LE(_brieCount);
+ s.syncAsSint16LE(_raoulStatus);
+ s.syncAsSint16LE(_raoulFrame);
+ s.syncAsSint16LE(_raoulCount);
+ s.syncAsSint16LE(_richardStatus);
+ s.syncAsSint16LE(_richardFrame);
+ s.syncAsSint16LE(_daaeStatus);
+ s.syncAsSint16LE(_daaeFrame);
+ s.syncAsSint16LE(_conversationCount);
+}
+
+void Scene203::setup() {
+ if (_globals[kCurrentYear] == 1993)
+ _scene->_variant = 1;
+
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene203::enter() {
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ _showNoteFl = false;
+ }
+
+ _conversationCount = 0;
+ _scene->_hotspots.activate(NOUN_LETTER, false);
+ _scene->_hotspots.activate(NOUN_PARCHMENT, false);
+ _scene->_hotspots.activate(NOUN_NOTICE, false);
+
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('p', 1));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('p', 0));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites("*RDR_6");
+
+ if (_globals[kCurrentYear] == 1993) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
+ _vm->_gameConv->get(5);
+ } else {
+ _vm->_gameConv->get(8);
+ _vm->_gameConv->get(15);
+ }
+
+ if (_globals[kCurrentYear] == 1993) {
+ if (_game._objects.isInRoom(OBJ_PARCHMENT)) {
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 3);
+ _scene->_hotspots.activate(NOUN_PARCHMENT, true);
+ }
+
+ _scene->_hotspots.activate(NOUN_MONSIEUR_RICHARD, false);
+ _scene->_hotspots.activate(NOUN_MANAGERS_CHAIR, false);
+
+ if (!_globals[kMakeBrieLeave203]) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 9), 1);
+ _anim0ActvFl = true;
+ _brieStatus = 4;
+ } else {
+ _scene->_hotspots.activate(NOUN_MONSIEUR_BRIE, false);
+ _scene->_hotspots.activate(NOUN_MANAGERS_CHAIR, true);
+ }
+
+ if ((_scene->_priorSceneId == RETURNING_FROM_LOADING) && (_vm->_gameConv->_restoreRunning == 5)) {
+ _brieStatus = 4;
+ _raoulStatus = 0;
+ _anim1ActvFl = true;
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('c', 1), 0);
+ _scene->setAnimFrame(_globals._animationIndexes[1], 9);
+ _vm->_gameConv->run(5);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_SMALL_NOTE));
+ _vm->_gameConv->exportValue(_globals[kReadBook]);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_LARGE_NOTE));
+ _vm->_gameConv->exportValue(_globals[kLookedAtCase]);
+ _vm->_gameConv->exportValue(_globals[kCharlesNameIsKnown]);
+ _vm->_gameConv->exportValue(_globals[kCanFindBookInLibrary]);
+ _vm->_gameConv->exportValue(_globals[kFlorentNameIsKnown]);
+ _vm->_gameConv->exportValue(_globals[kSandbagStatus]);
+ _vm->_gameConv->exportValue(_globals[kObservedPhan104]);
+ }
+
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_CANDLE, false);
+ } else if (_globals[kJacquesStatus] == 0) {
+ _scene->_hotspots.activate(NOUN_DESK_LAMP, false);
+ _scene->_hotspots.activate(NOUN_MONSIEUR_BRIE, false);
+ _scene->_hotspots.activate(NOUN_MANAGERS_CHAIR, false);
+
+ if (!_globals[kMakeRichLeave203]) {
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('r', 1), 1);
+ _anim2ActvFl = true;
+ _richardStatus = 4;
+ } else {
+ _scene->_hotspots.activate(NOUN_MONSIEUR_RICHARD, false);
+ _scene->_hotspots.activate(NOUN_MANAGERS_CHAIR, true);
+ }
+
+ if ((_scene->_priorSceneId == RETURNING_FROM_LOADING) && (_vm->_gameConv->_restoreRunning == 8)) {
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('c', 1), 0);
+ _scene->setAnimFrame(_globals._animationIndexes[1], 9);
+ _anim1ActvFl = true;
+ _game._player._visible = false;
+ _raoulStatus = 0;
+ _vm->_gameConv->run(8);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ }
+
+ if (_game._objects.isInRoom(OBJ_LETTER)) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 3);
+ _scene->_hotspots.activate(NOUN_LETTER, true);
+ }
+
+ if (_game._objects.isInRoom(OBJ_NOTICE)) {
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 3);
+ _scene->_hotspots.activate(NOUN_NOTICE, true);
+ }
+ } else {
+ _scene->_hotspots.activate(NOUN_MONSIEUR_BRIE, false);
+ _scene->_hotspots.activate(NOUN_MONSIEUR_RICHARD, false);
+ _scene->_hotspots.activate(NOUN_DESK_LAMP, false);
+ }
+
+ if (_vm->_gameConv->_restoreRunning == 15) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+ _game._player._playerPos = Common::Point(98, 137);
+ _game._player._facing = FACING_NORTHEAST;
+ _vm->_gameConv->run(15);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportPointer(&_globals[kChristineToldEnvelope]);
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+
+ if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+ } else if (_scene->_priorSceneId == 202) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+ _game._player._playerPos = Common::Point(195, 147);
+ _game._player._facing = FACING_NORTH;
+ } else if (_scene->_priorSceneId == 150) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+ _game._player._playerPos = Common::Point(98, 137);
+ _game._player._facing = FACING_NORTHEAST;
+ _vm->_gameConv->run(15);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportPointer(&_globals[kChristineToldEnvelope]);
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ } else if ((_scene->_priorSceneId == 204) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+ _game._player._playerPos = Common::Point(319, 123);
+ _game._player._facing = FACING_SOUTHWEST;
+ _game._player.walk(Common::Point(276, 123), FACING_WEST);
+ _game._player.setWalkTrigger(95);
+ _game._player._stepEnabled = false;
+ }
+
+ sceneEntrySound();
+}
+
+void Scene203::step() {
+ if (_anim0ActvFl)
+ handleBrieAnimation();
+
+ if (_anim1ActvFl)
+ handleRaoulAnimation();
+
+ if (_anim2ActvFl)
+ handleRichardAnimation();
+
+ if (_anim3ActvFl)
+ handleDaaeAnimation();
+
+ if ((_globals[kWalkerConverse] == 2) || (_globals[kWalkerConverse] == 3)) {
+ ++_conversationCount;
+ if (_conversationCount > 200)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+
+ switch (_game._trigger) {
+ case 95:
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[5], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 10);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 96);
+ break;
+
+ case 96:
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+ if (_vm->_gameConv->_running != 15)
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene203::actions() {
+ if (_vm->_gameConv->_running == 5) {
+ handleBrieConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 8) {
+ handleRichardConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 15) {
+ handleRichardAndDaaeConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR) || _action.isAction(VERB_OPEN, NOUN_DOOR) || _game._trigger) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[4], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 4, 90);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 92);
+ break;
+
+ case 90:
+ _vm->_sound->command(24);
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 91);
+ break;
+
+ case 91:
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+ break;
+
+ case 92:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[4]);
+ _game._player.walk(Common::Point(319, 123), FACING_WEST);
+ _game._player.setWalkTrigger(93);
+ break;
+
+ case 93:
+ _scene->_nextSceneId = 204;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_MONSIEUR_BRIE)) {
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('c', 1), 0);
+ _anim1ActvFl = true;
+ _game._player._visible = false;
+ _raoulStatus = 0;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[1], SYNC_PLAYER, 0);
+
+ _vm->_gameConv->run(5);
+ _vm->_gameConv->hold();
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_SMALL_NOTE));
+ _vm->_gameConv->exportValue(_globals[kReadBook]);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_LARGE_NOTE));
+ _vm->_gameConv->exportValue(_globals[kLookedAtCase]);
+ if (_globals[kCharlesNameIsKnown] == 2)
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+
+ _vm->_gameConv->exportValue(_globals[kCanFindBookInLibrary]);
+ _vm->_gameConv->exportValue(_globals[kFlorentNameIsKnown]);
+ _vm->_gameConv->exportValue(_globals[kSandbagStatus]);
+ _vm->_gameConv->exportValue(_globals[kObservedPhan104]);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_MONSIEUR_RICHARD)) {
+ if (_globals[kCameFromFade]) {
+ _vm->_gameConv->run(15);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportPointer(&_globals[kChristineToldEnvelope]);
+ } else {
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('c', 1), 0);
+ _anim1ActvFl = true;
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _raoulStatus = 0;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[1], SYNC_PLAYER, 0);
+
+ _vm->_gameConv->run(8);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->hold();
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_GRAND_FOYER)) {
+ _scene->_nextSceneId = 202;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ if (_globals[kMakeBrieLeave203])
+ _vm->_dialogs->show(20337);
+ else
+ _vm->_dialogs->show(20310);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(20311);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(20312);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOOKCASE)) {
+ _vm->_dialogs->show(20313);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOORWAY)) {
+ _vm->_dialogs->show(20314);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COMFY_CHAIR)) {
+ _vm->_dialogs->show(20315);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DESK)) {
+ _vm->_dialogs->show(20316);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MANAGERS_CHAIR)) {
+ _vm->_dialogs->show(20317);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DESK_LAMP)) {
+ _vm->_dialogs->show(20318);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LAMP)) {
+ _vm->_dialogs->show(20319);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LIGHT_FIXTURE)) {
+ _vm->_dialogs->show(20320);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WINDOW)) {
+ _vm->_dialogs->show(20321);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SHEERS)) {
+ _vm->_dialogs->show(20322);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TAPESTRY)) {
+ _vm->_dialogs->show(20323);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GRAND_FOYER)) {
+ _vm->_dialogs->show(20324);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TABLE)) {
+ _vm->_dialogs->show(20325);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CANDLE)) {
+ _vm->_dialogs->show(20326);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MONSIEUR_BRIE)) {
+ _vm->_dialogs->show(20327);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MONSIEUR_RICHARD)) {
+ _vm->_dialogs->show(20328);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PARCHMENT) && _game._objects.isInRoom(OBJ_PARCHMENT)) {
+ _vm->_dialogs->show(20329);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LETTER) && _game._objects.isInRoom(OBJ_LETTER)) {
+ _vm->_dialogs->show(20331);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_NOTICE) && _game._objects.isInRoom(OBJ_NOTICE)) {
+ _vm->_dialogs->show(20333);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_PARCHMENT)) {
+ _vm->_dialogs->show(20330);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_LETTER)) {
+ _vm->_dialogs->show(20332);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_NOTICE)) {
+ _vm->_dialogs->show(20334);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_MONSIEUR_BRIE)) {
+ _vm->_dialogs->show(20335);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_MONSIEUR_RICHARD)) {
+ _vm->_dialogs->show(20336);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene203::preActions() {
+ if (_action.isAction(VERB_TALK_TO, NOUN_MONSIEUR_RICHARD)) {
+ if (_globals[kCameFromFade])
+ _game._player.walk(Common::Point(98, 137), FACING_NORTHEAST);
+ else
+ _game._player.walk(Common::Point(154, 131), FACING_NORTHWEST);
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_MONSIEUR_BRIE))
+ _game._player.walk(Common::Point(154, 131), FACING_NORTHWEST);
+
+ if (_action.isAction(VERB_OPEN, NOUN_DOOR))
+ _game._player.walk(Common::Point(276, 123), FACING_EAST);
+}
+
+void Scene203::handleBrieConversation() {
+ bool interlocutorFl = false;
+ bool heroFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 9:
+ case 12:
+ case 35:
+ case 42:
+ _vm->_gameConv->setInterlocutorTrigger(70);
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ case 14:
+ if (!_game._trigger) {
+ _vm->_gameConv->hold();
+ _raoulStatus = 5;
+ }
+ break;
+
+ case 17:
+ _raoulStatus = 0;
+ _vm->_gameConv->hold();
+ break;
+
+ case 24:
+ _vm->_gameConv->setInterlocutorTrigger(78);
+ interlocutorFl = true;
+ break;
+
+ case 20:
+ case 25:
+ _vm->_gameConv->setInterlocutorTrigger(76);
+ interlocutorFl = true;
+ break;
+
+ case 37:
+ if (!_game._trigger) {
+ _vm->_gameConv->hold();
+ if (_vm->_sound->_preferRoland)
+ _vm->_sound->command(65);
+ else
+ _scene->playSpeech(1);
+
+ _scene->_sequences.addTimer(60, 110);
+ }
+ break;
+
+ case 41:
+ _globals[kDoneBrieConv203] = 1;
+ _globals[kChrisFStatus] = 0;
+ break;
+
+ case 44:
+ if (!_game._trigger) {
+ _vm->_gameConv->hold();
+ _raoulStatus = 3;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 60:
+ _brieStatus = 0;
+ break;
+
+ case 65:
+ _brieStatus = 4;
+ break;
+
+ case 70:
+ _vm->_gameConv->setHeroTrigger(71);
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ case 71:
+ _raoulStatus = 2;
+ break;
+
+ case 74:
+ _vm->_gameConv->hold();
+ _raoulStatus = 3;
+ break;
+
+ case 76:
+ _brieStatus = 1;
+ break;
+
+ case 78:
+ _brieStatus = 2;
+ break;
+
+ case 110:
+ _vm->_gameConv->release();
+ break;
+
+ default:
+ break;
+ }
+
+ if (!heroFl && (_raoulStatus != 5))
+ _vm->_gameConv->setHeroTrigger(65);
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(60);
+
+ _brieCount = 0;
+ _raoulCount = 0;
+}
+
+void Scene203::handleRichardConversation() {
+ bool interlocutorFl = false;
+ bool heroFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 4:
+ _vm->_gameConv->setInterlocutorTrigger(83);
+ interlocutorFl = true;
+ break;
+
+ case 5:
+ case 15:
+ case 20:
+ case 21:
+ case 27:
+ _vm->_gameConv->setInterlocutorTrigger(70);
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ case 7:
+ if (_game._objects.isInRoom(OBJ_NOTICE) && !_game._trigger) {
+ _vm->_gameConv->hold();
+ _raoulStatus = 3;
+ }
+ break;
+
+ case 9:
+ if (_game._objects.isInRoom(OBJ_LETTER) && !_game._trigger) {
+ _vm->_gameConv->hold();
+ _raoulStatus = 4;
+ }
+ break;
+
+ case 17:
+ _vm->_gameConv->setInterlocutorTrigger(85);
+ interlocutorFl = true;
+ break;
+
+ case 19:
+ _vm->_gameConv->setInterlocutorTrigger(81);
+ interlocutorFl = true;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 65:
+ _richardStatus = 4;
+ break;
+
+ case 70:
+ _vm->_gameConv->setHeroTrigger(71);
+ interlocutorFl = true;
+ heroFl = true;
+ break;
+
+ case 71: {
+ _raoulStatus = 2;
+ int *val1 = _vm->_gameConv->getVariable(24);
+ int *val2 = _vm->_gameConv->getVariable(26);
+ if ((*val1) && (*val2)) {
+ _globals[kDoneRichConv203] = true;
+ _globals[kMadameGiryShowsUp] = true;
+ }
+ }
+ break;
+
+ case 74:
+ _vm->_gameConv->hold();
+ _raoulStatus = 3;
+ break;
+
+ case 81:
+ _richardStatus = 2;
+ break;
+
+ case 83:
+ _richardStatus = 1;
+ break;
+
+ case 85:
+ _richardStatus = 3;
+ break;
+
+ case 100:
+ _richardStatus = 0;
+ break;
+
+ default:
+ break;
+ }
+
+ if (!heroFl && (_raoulStatus != 5))
+ _vm->_gameConv->setHeroTrigger(65);
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(100);
+
+ _brieCount = 0;
+ _raoulCount = 0;
+}
+
+void Scene203::handleRichardAndDaaeConversation() {
+ bool interlocutorFl = false;
+ bool heroFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 5:
+ if (!_game._trigger) {
+ _vm->_gameConv->hold();
+
+ _vm->_sound->command(24);
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 90);
+ interlocutorFl = true;
+ heroFl = true;
+ }
+ break;
+
+ case 11:
+ if (!_game._trigger) {
+ _vm->_gameConv->hold();
+ _daaeStatus = 3;
+ }
+ break;
+
+ case 13:
+ case 14:
+ case 15:
+ _globals[kChristineDoorStatus] = 1;
+ _globals[kTicketPeoplePresent] = 2;
+ heroFl = true;
+ interlocutorFl = true;
+ _vm->_gameConv->setInterlocutorTrigger(115);
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 65:
+ if (_globals[kWalkerConverse] != 0)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(2, 3);
+
+ if ((_richardStatus != 5) && (_richardStatus != 7))
+ _richardStatus = 4;
+
+ _conversationCount = 0;
+ break;
+
+ case 90:
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('d', 1), 0);
+ _anim3ActvFl = true;
+ _daaeStatus = 0;
+ break;
+
+ case 100:
+ if (_globals[kWalkerConverse] != 0)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+
+ if ((_action._activeAction._verbId == 7) || (_action._activeAction._verbId == 9))
+ _daaeStatus = 1;
+ else if (_richardStatus == 7)
+ _richardStatus = 5;
+ else if (_richardStatus != 5)
+ _richardStatus = 0;
+
+ break;
+
+ case 115:
+ _globals[kWalkerConverse] = 0;
+ heroFl = true;
+ interlocutorFl = true;
+ break;
+
+ default:
+ break;
+ }
+
+ if (!heroFl)
+ _vm->_gameConv->setHeroTrigger(65);
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(100);
+
+ _brieCount = 0;
+ _raoulCount = 0;
+}
+
+void Scene203::handleBrieAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _brieFrame)
+ return;
+
+ _brieFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random = -1;
+
+ switch (_brieFrame) {
+ case 1:
+ case 2:
+ case 4:
+ case 11:
+ case 22:
+ case 31:
+ case 35:
+ case 29:
+ random = _vm->getRandomNumber(6, 45);
+
+ switch (_brieStatus) {
+ case 0:
+ random = _vm->getRandomNumber(1, 2);
+ ++_brieCount;
+ if (_brieCount > 20) {
+ _brieStatus = 4;
+ random = 45;
+ }
+ break;
+
+ case 1:
+ random = 5;
+ break;
+
+ case 2:
+ random = 4;
+ break;
+
+ case 3:
+ random = 3;
+ _brieStatus = 0;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 0;
+ break;
+
+ case 2:
+ resetFrame = 1;
+ break;
+
+ case 3:
+ resetFrame = 2;
+ break;
+
+ case 4:
+ resetFrame = 22;
+ _brieStatus = 0;
+ break;
+
+ case 5:
+ resetFrame = 13;
+ break;
+
+ case 6:
+ resetFrame = 4;
+ break;
+
+ case 7:
+ resetFrame = 29;
+ break;
+
+ case 8:
+ resetFrame = 31;
+ break;
+
+ default:
+ resetFrame = 0;
+ break;
+ }
+ break;
+
+ case 30:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_brieStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ random = 1;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 30;
+ else
+ resetFrame = 29;
+
+ break;
+
+ case 8:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_brieStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ random = 3;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 11;
+ break;
+
+ case 2:
+ resetFrame = 12;
+ break;
+
+ case 3:
+ resetFrame = 8;
+ break;
+
+ default:
+ resetFrame = 7;
+ break;
+ }
+ break;
+
+ case 12:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_brieStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ random = 1;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 7;
+ else
+ resetFrame = 11;
+
+ break;
+
+ case 13:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_brieStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ random = 1;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 7;
+ else
+ resetFrame = 12;
+
+ break;
+
+ case 17:
+ case 18:
+ switch (_brieStatus) {
+ case 0:
+ case 2:
+ case 3:
+ random = 3;
+ break;
+ case 1:
+ random = _vm->getRandomNumber(1, 2);
+ ++_brieCount;
+ if (_brieCount > 20) {
+ _brieStatus = 4;
+ random = 3;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 16;
+ break;
+
+ case 2:
+ resetFrame = 17;
+ break;
+
+ case 3:
+ resetFrame = 18;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 33:
+ case 40:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_brieStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ random = 1;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 33;
+ break;
+
+ case 2:
+ resetFrame = 35;
+ break;
+
+ default:
+ resetFrame = 32;
+ break;
+ }
+ break;
+
+ case 38:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_brieStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ random = 1;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 38;
+ else
+ resetFrame = 37;
+
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _brieFrame = resetFrame;
+ }
+}
+
+void Scene203::handleRichardAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame() == _richardFrame)
+ return;
+
+ _richardFrame = _scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random = -1;
+
+ switch (_richardFrame) {
+ case 1:
+ case 2:
+ case 3:
+ case 7:
+ case 15:
+ case 25:
+ case 37:
+ case 53:
+ case 59:
+ case 63:
+ case 67:
+ case 69:
+ case 79:
+ case 87:
+ case 108:
+ random = _vm->getRandomNumber(8, 45);
+
+ switch (_richardStatus) {
+ case 0:
+ random = _vm->getRandomNumber(1, 3);
+ ++_brieCount;
+ if (_brieCount > 20) {
+ _richardStatus = 4;
+ random = 45;
+ }
+ break;
+
+ case 1:
+ random = 4;
+ _richardStatus = 0;
+ break;
+
+ case 2:
+ random = 5;
+ _richardStatus = 0;
+ break;
+
+ case 3:
+ random = 6;
+ _richardStatus = 0;
+ break;
+
+ case 5:
+ random = 7;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 0;
+ break;
+
+ case 2:
+ resetFrame = 1;
+ break;
+
+ case 3:
+ resetFrame = 2;
+ break;
+
+ case 4:
+ resetFrame = 69;
+ break;
+
+ case 5:
+ resetFrame = 53;
+ _richardStatus = 0;
+ break;
+
+ case 6:
+ resetFrame = 42;
+ break;
+
+ case 7:
+ resetFrame = 87;
+ break;
+
+ case 8:
+ resetFrame = 25;
+ break;
+
+ case 9:
+ resetFrame = 15;
+ break;
+
+ case 10:
+ resetFrame = 3;
+ break;
+
+ case 11:
+ resetFrame = 7;
+ break;
+
+ case 12:
+ resetFrame = 59;
+ break;
+
+ case 13:
+ resetFrame = 63;
+ break;
+
+ case 14:
+ resetFrame = 67;
+ break;
+
+ case 15:
+ resetFrame = 79;
+ break;
+
+ default:
+ resetFrame = 0;
+ break;
+ }
+ break;
+
+ case 5:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_richardStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 5:
+ random = 1;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 5;
+ else
+ resetFrame = 4;
+
+ break;
+
+ case 11:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_richardStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 5:
+ random = 1;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 11;
+ else
+ resetFrame = 10;
+
+ break;
+
+ case 61:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_richardStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 5:
+ random = 1;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 61;
+ else
+ resetFrame = 60;
+
+ break;
+
+ case 65:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_richardStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 5:
+ random = 1;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 65;
+ else
+ resetFrame = 64;
+
+ break;
+
+ case 68:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_richardStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 5:
+ random = 1;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 68;
+ else
+ resetFrame = 67;
+
+ break;
+
+ case 83:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_richardStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 5:
+ random = 1;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 83;
+ else
+ resetFrame = 82;
+
+ break;
+
+ case 92:
+ _vm->_gameConv->release();
+ break;
+
+ case 93:
+ case 94:
+ case 95:
+ if (_richardStatus == 5) {
+ random = _vm->getRandomNumber(1, 3);
+ ++_brieCount;
+ if (_brieCount > 20) {
+ _richardStatus = 7;
+ random = 4;
+ }
+ } else
+ random = 4;
+
+ switch (random) {
+ case 1:
+ resetFrame = 92;
+ break;
+
+ case 2:
+ resetFrame = 93;
+ break;
+
+ case 3:
+ resetFrame = 94;
+ break;
+
+ case 4:
+ resetFrame = 95;
+ break;
+ }
+ break;
+
+ case 100:
+ case 101:
+ case 102:
+ switch (_richardStatus) {
+ case 5:
+ random = _vm->getRandomNumber(1, 3);
+ ++_brieCount;
+ if (_brieCount > 20) {
+ _richardStatus = 7;
+ random = 1;
+ }
+ break;
+
+ case 7:
+ random = 1;
+ break;
+
+ default:
+ random = 4;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 99;
+ break;
+
+ case 2:
+ resetFrame = 100;
+ break;
+
+ case 3:
+ resetFrame = 101;
+ break;
+
+ case 4:
+ resetFrame = 102;
+ break;
+
+ default:
+ break;
+ }
+ break;
+
+ case 31:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_richardStatus) {
+ case 0 :
+ case 1:
+ case 2:
+ case 3:
+ case 5:
+ random = 1;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 31;
+ else
+ resetFrame = 30;
+
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[2], resetFrame);
+ _richardFrame = resetFrame;
+ }
+}
+
+void Scene203::handleRaoulAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == _raoulFrame)
+ return;
+
+ _raoulFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random = -1;
+
+ switch (_raoulFrame) {
+ case 9:
+ case 21:
+ case 57:
+ _vm->_gameConv->release();
+ break;
+
+ case 10:
+ case 22:
+ case 30:
+ case 34:
+ case 58:
+ if (_raoulFrame == 22)
+ _raoulStatus = 0;
+
+ random = _vm->getRandomNumber(5, 45);
+
+ switch (_raoulStatus) {
+ case 1:
+ random = 1;
+ break;
+
+ case 2:
+ _game._player._stepEnabled = false;
+ random = 2;
+ break;
+
+ case 3:
+ case 5:
+ random = 3;
+ break;
+
+ case 4:
+ random = 4;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(5, 100);
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 22;
+ break;
+
+ case 2:
+ resetFrame = 34;
+ break;
+
+ case 3:
+ resetFrame = 10;
+ break;
+
+ case 4:
+ resetFrame = 45;
+ break;
+
+ case 5:
+ resetFrame = 30;
+ break;
+
+ default:
+ resetFrame = 9;
+ break;
+ }
+ break;
+
+ case 16:
+ switch (_raoulStatus) {
+ case 3:
+ random = 1;
+ break;
+
+ case 0:
+ case 2:
+ random = 2;
+ break;
+
+ case 5:
+ random = 3;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ if (_globals[kCurrentYear] == 1881) {
+ resetFrame = 16;
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _scene->_hotspots.activate(NOUN_NOTICE, false);
+ _game._objects.addToInventory(OBJ_NOTICE);
+ _vm->_sound->command(26);
+ _scene->_speechReady = -1;
+ _vm->_dialogs->showItem(OBJ_NOTICE, 814, 5);
+ _raoulStatus = 0;
+ } else {
+ resetFrame = 16;
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _scene->_hotspots.activate(NOUN_PARCHMENT, false);
+ _game._objects.addToInventory(OBJ_PARCHMENT);
+ _vm->_sound->command(26);
+ _scene->_speechReady = -1;
+ _vm->_dialogs->showItem(OBJ_PARCHMENT, 812, 3);
+ _raoulStatus = 0;
+ }
+ break;
+
+ case 2:
+ if (_showNoteFl) {
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _showNoteFl = false;
+ }
+ break;
+
+ default:
+ if (!_showNoteFl) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], true, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 3);
+ _vm->_gameConv->release();
+ _showNoteFl = true;
+ }
+ resetFrame = 15;
+ break;
+ }
+ break;
+
+ case 26:
+ random = _vm->getRandomNumber(1, 45);
+
+ switch (_raoulStatus) {
+ case 0:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ random = 1;
+ break;
+
+ case 1:
+ random = 2;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 26;
+ else
+ resetFrame = 25;
+
+ break;
+
+ case 45:
+ _anim1ActvFl = false;
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[1]);
+ resetFrame = 58;
+ if (_globals[kDoneBrieConv203] && (_globals[kCurrentYear] == 1993)) {
+ _globals[kPrompterStandStatus] = 1;
+ _scene->_nextSceneId = 150;
+ }
+ break;
+
+ case 52:
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _scene->_hotspots.activate(NOUN_LETTER, false);
+ _game._objects.addToInventory(OBJ_LETTER);
+ _vm->_sound->command(26);
+ _scene->_speechReady = -1;
+ _vm->_dialogs->showItem(OBJ_LETTER, 813, 4);
+ _raoulStatus = 0;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _raoulFrame = resetFrame;
+ }
+}
+
+void Scene203::handleDaaeAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame() == _daaeFrame)
+ return;
+
+ _daaeFrame = _scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random = -1;
+
+ switch (_daaeFrame) {
+ case 20:
+ _vm->_gameConv->release();
+ _richardStatus = 5;
+ break;
+
+ case 175:
+ _richardStatus = 4;
+ break;
+
+ case 198:
+ _vm->_gameConv->release();
+ break;
+
+ case 201:
+ _scene->_sequences.addTimer(1, 95);
+ break;
+
+ case 76:
+ case 92:
+ case 102:
+ case 123:
+ switch (_daaeStatus) {
+ case 1:
+ random = _vm->getRandomNumber(1, 2);
+ _daaeStatus = 2;
+ break;
+
+ case 2:
+ random = 3;
+ _daaeStatus = 0;
+ break;
+
+ case 3:
+ random = 4;
+ break;
+
+ default:
+ random = 5;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 79;
+ break;
+
+ case 2:
+ resetFrame = 92;
+ break;
+
+ case 3:
+ resetFrame = 102;
+ break;
+
+ case 4:
+ resetFrame = 123;
+ break;
+
+ case 5:
+ resetFrame = 75;
+ break;
+
+ default:
+ break;
+ }
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[3], resetFrame);
+ _daaeFrame = resetFrame;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene204::Scene204(MADSEngine *vm) : Scene2xx(vm) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ _raoulDown = false;
+ _florentGone = false;
+ _skip1Fl = false;
+ _skip2Fl = false;
+ _skip3Fl = false;
+ _endGameFl = false;
+
+ _brieStatus = -1;
+ _brieFrame = -1;
+ _florStatus = -1;
+ _florFrame = -1;
+ _raoulStatus = -1;
+ _raoulFrame = -1;
+ _raoulCount = -1;
+}
+
+void Scene204::synchronize(Common::Serializer &s) {
+ Scene2xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_anim2ActvFl);
+ s.syncAsByte(_anim3ActvFl);
+ s.syncAsByte(_raoulDown);
+ s.syncAsByte(_florentGone);
+ s.syncAsByte(_skip1Fl);
+ s.syncAsByte(_skip2Fl);
+ s.syncAsByte(_skip3Fl);
+ s.syncAsByte(_endGameFl);
+
+ s.syncAsSint16LE(_brieStatus);
+ s.syncAsSint16LE(_brieFrame);
+ s.syncAsSint16LE(_florStatus);
+ s.syncAsSint16LE(_florFrame);
+ s.syncAsSint16LE(_raoulStatus);
+ s.syncAsSint16LE(_raoulFrame);
+ s.syncAsSint16LE(_raoulCount);
+}
+
+void Scene204::setup() {
+ if ((_globals[kCurrentYear] == 1993) || _globals[kRightDoorIsOpen504])
+ _scene->_variant = 1;
+
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene204::enter() {
+ _skip3Fl = false;
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ _florentGone = false;
+ _skip1Fl = false;
+ _skip2Fl = false;
+ _endGameFl = false;
+ _raoulDown = true;
+ }
+
+ if (_globals[kTicketPeoplePresent] == 2)
+ _globals[kMakeRichLeave203] = true;
+
+ if (_globals[kRightDoorIsOpen504])
+ _endGameFl = true;
+
+ warning("TODO: If end of game, remove the walking areas");
+
+ _scene->_hotspots.activate(NOUN_BOOK, false);
+ _vm->_gameConv->get(22);
+
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('p', 0));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 6));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites("*RALRH_9");
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites("*RDRR_6");
+
+ if (_game._objects.isInRoom(OBJ_BOOK) || (_globals[kCurrentYear] == 1881) || _endGameFl) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 5);
+ if (_globals[kScannedBookcase] && (_globals[kCurrentYear] == 1993))
+ _scene->_hotspots.activate(NOUN_BOOK, true);
+ }
+
+ if ((_globals[kCurrentYear] == 1993) || _endGameFl) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_sprites.remove(_globals._spriteIndexes[0]);
+ _scene->_hotspots.activate(NOUN_CANDLE, false);
+ _scene->_hotspots.activate(NOUN_BUST, false);
+ _scene->_hotspots.activate(NOUN_COFFEE_TABLE, false);
+
+ int idx = _scene->_dynamicHotspots.add(NOUN_COFFEE_TABLE, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(83, 140, 83 + 45, 140 + 12));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(84, 150), FACING_SOUTHEAST);
+
+ idx = _scene->_dynamicHotspots.add(NOUN_GRAND_FOYER, VERB_EXIT_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(199, 147, 199 + 52, 147 + 8));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(224, 152), FACING_SOUTH);
+ _scene->_dynamicHotspots.setCursor(idx, CURSOR_GO_DOWN);
+
+ idx = _scene->_dynamicHotspots.add(NOUN_GRAND_FOYER, VERB_EXIT_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(145, 147, 145 + 54, 147 + 8));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(175, 152), FACING_SOUTH);
+ _scene->_dynamicHotspots.setCursor(idx, CURSOR_GO_DOWN);
+ } else {
+ _scene->_hotspots.activate(NOUN_LIGHT, false);
+ _scene->_hotspots.activate(NOUN_GLASS_CASE, false);
+
+ int idx = _scene->_dynamicHotspots.add(NOUN_COMFY_CHAIR, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(220, 147, 220 + 6, 147 + 8));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(220, 150), FACING_SOUTHEAST);
+
+ idx = _scene->_dynamicHotspots.add(NOUN_COMFY_CHAIR, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(226, 134, 226 + 12, 134 + 21));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(220, 150), FACING_SOUTHEAST);
+
+ idx = _scene->_dynamicHotspots.add(NOUN_COMFY_CHAIR, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(238, 128, 238 + 13, 128 + 27));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(220, 150), FACING_SOUTHEAST);
+
+ idx = _scene->_dynamicHotspots.add(NOUN_GRAND_FOYER, VERB_EXIT_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(199, 147, 199 + 19, 147 + 8));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(209, 152), FACING_SOUTH);
+ _scene->_dynamicHotspots.setCursor(idx, CURSOR_GO_DOWN);
+
+ idx = _scene->_dynamicHotspots.add(NOUN_GRAND_FOYER, VERB_EXIT_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(84, 147, 84 + 61, 147 + 8));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(115, 152), FACING_SOUTH);
+ _scene->_dynamicHotspots.setCursor(idx, CURSOR_GO_DOWN);
+ }
+
+ if ((_scene->_priorSceneId == 306) || (_endGameFl)) {
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _scene->drawToBackground(_globals._spriteIndexes[6], 1, Common::Point(-32000, -32000), 0, 100);
+ } else if (_globals[kCurrentYear] == 1993) {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ _scene->drawToBackground(_globals._spriteIndexes[1], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_sprites.remove(_globals._spriteIndexes[1]);
+ }
+
+ if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ if (_endGameFl) {
+ _game.loadQuoteSet(0x75, 0);
+
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('r', 1), 0);
+ _anim2ActvFl = true;
+
+ if (_florentGone) {
+ _scene->setAnimFrame(_globals._animationIndexes[2], 9);
+ _raoulStatus = 1;
+ } else {
+ _scene->setAnimFrame(_globals._animationIndexes[2], 32);
+ _raoulStatus = 4;
+ }
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('m', 1), 0);
+ _anim0ActvFl = true;
+ _brieStatus = 2;
+
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('f', 1), 0);
+ _anim1ActvFl = true;
+ _florStatus = 2;
+
+ if (_florentGone)
+ _scene->setAnimFrame(_globals._animationIndexes[1], 172);
+ else if (!_raoulDown)
+ _scene->setAnimFrame(_globals._animationIndexes[1], 21);
+
+ _game._player._visible = false;
+ _vm->_gameConv->run(22);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ } else {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 5);
+ }
+ } else if (_scene->_priorSceneId == 202) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 5);
+ if (_globals[kCurrentYear] == 1993)
+ _game._player._playerPos = Common::Point(175, 145);
+ else
+ _game._player._playerPos = Common::Point(115, 147);
+
+ _game._player._facing = FACING_NORTHWEST;
+ } else if (_scene->_priorSceneId == 150) {
+ int size = _game._objects.size();
+ for (int i = 0; i < size; i++)
+ _game._objects.setRoom(i, 1);
+
+ _game.loadQuoteSet(0x75, 0);
+
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('r', 1), 0);
+ _anim2ActvFl = true;
+ _raoulStatus = 4;
+ _scene->setAnimFrame(_globals._animationIndexes[2], 32);
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('m', 1), 0);
+ _anim0ActvFl = true;
+ _brieStatus = 2;
+
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('f', 1), 0);
+ _anim1ActvFl = true;
+ _raoulDown = true;
+ _florStatus = 2;
+
+ _game._player._visible = false;
+ _endGameFl = true;
+
+ _vm->_gameConv->run(22);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ } else if ((_scene->_priorSceneId == 203) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player.firstWalk(Common::Point(-10, 136), FACING_EAST, Common::Point(30, 140), FACING_EAST, true);
+ _game._player.setWalkTrigger(70);
+ _game._player._stepEnabled = false;
+ }
+
+ sceneEntrySound();
+}
+
+void Scene204::step() {
+ if (_anim0ActvFl)
+ handleBrieAnimation();
+
+ if (_anim1ActvFl)
+ handleFlorAnimation();
+
+ if (_anim2ActvFl)
+ handleRaoulAnimation();
+
+ if (_anim3ActvFl)
+ handleEndAnimation();
+
+ if (_game._trigger == 85)
+ _scene->_nextSceneId = 250;
+
+ if ((_vm->_gameConv->_running != 22) && !_skip1Fl && _endGameFl) {
+ _game._player._stepEnabled = false;
+ _skip1Fl = true;
+ }
+
+ if (_game._trigger == 70) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 10);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 71);
+ } else if (_game._trigger == 71) {
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 5);
+ _game._player._stepEnabled = true;
+ }
+}
+
+void Scene204::actions() {
+ if (_vm->_gameConv->_running == 22) {
+ handleConversation();
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR) || _action.isAction(VERB_OPEN, NOUN_DOOR)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[5], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_SPRITE, 4, 60);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 61);
+ break;
+
+ case 60:
+ _vm->_sound->command(24);
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ break;
+
+ case 61:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[5]);
+ _game._player.walk(Common::Point(0, 136), FACING_WEST);
+ _game._player.setWalkTrigger(62);
+ break;
+
+ case 62:
+ _scene->_nextSceneId = 203;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_BOOK) && (_game._objects.isInRoom(OBJ_BOOK) || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], -1, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[4], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 8, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _scene->_hotspots.activate(NOUN_BOOK, false);
+ _game._objects.addToInventory(OBJ_BOOK);
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[4]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ break;
+
+ case 3:
+ _vm->_dialogs->showItem(OBJ_BOOK, 815, 0);
+ _globals[kReadBook] = true;
+ _globals[kPlayerScore] += 5;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_GRAND_FOYER)) {
+ _scene->_nextSceneId = 202;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(20410);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(20411);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(20412);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RUG)) {
+ _vm->_dialogs->show(20413);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GLASS_CASE)) {
+ _vm->_dialogs->show(20414);
+ _globals[kLookedAtCase] = true;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ if (_globals[kSandbagStatus] == 0)
+ _vm->_dialogs->show(20429);
+ else
+ _vm->_dialogs->show(20416);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOOKCASE)) {
+ if (_globals[kCanFindBookInLibrary] && (_globals[kCurrentYear] == 1993)) {
+ if ((_scene->_customDest.x < 46) && !_game._objects.isInInventory(OBJ_BOOK)) {
+ if (!_globals[kScannedBookcase]) {
+ _vm->_dialogs->show(20433);
+ _scene->_hotspots.activate(NOUN_BOOK, true);
+ _globals[kScannedBookcase] = true;
+ } else {
+ _vm->_dialogs->show(20437);
+ }
+ } else {
+ _vm->_dialogs->show(20417);
+ }
+ } else {
+ _vm->_dialogs->show(20417);
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SOFA)) {
+ _vm->_dialogs->show(20418);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_END_TABLE)) {
+ _vm->_dialogs->show(20419);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LAMP)) {
+ _vm->_dialogs->show(20420);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BUST)) {
+ _vm->_dialogs->show(20421);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COFFEE_TABLE)) {
+ _vm->_dialogs->show(20422);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COMFY_CHAIR)) {
+ _vm->_dialogs->show(20423);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DECORATIVE_VASE )) {
+ _vm->_dialogs->show(20424);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PAINTING)) {
+ _vm->_dialogs->show(20425);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GRAND_FOYER)) {
+ _vm->_dialogs->show(20426);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR)) {
+ _vm->_dialogs->show(20427);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WINDOW)) {
+ _vm->_dialogs->show(20428);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOOK) && _game._objects.isInRoom(OBJ_BOOK)) {
+ _vm->_dialogs->show(20434);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_BUST)) {
+ _vm->_dialogs->show(20436);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene204::preActions() {
+ if (_action.isAction(VERB_LOOK, NOUN_BOOKCASE))
+ _game._player._needToWalk = true;
+
+ if (_action.isAction(VERB_LOOK, NOUN_BOOK) && _game._objects.isInRoom(OBJ_BOOK))
+ _game._player._needToWalk = true;
+
+ if (_action.isAction(VERB_OPEN, NOUN_DOOR))
+ _game._player.walk(Common::Point(27, 139), FACING_WEST);
+}
+
+void Scene204::handleConversation() {
+ bool interlocutorFl = false;
+ bool heroFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 6:
+ case 7:
+ case 8:
+ if (_raoulDown) {
+ _vm->_gameConv->hold();
+ _raoulDown = false;
+ }
+ break;
+
+ case 17:
+ if (!_game._trigger) {
+ _florStatus = 3;
+ _florentGone = true;
+ interlocutorFl = true;
+ heroFl = true;
+ _vm->_gameConv->hold();
+ }
+ break;
+
+ case 25:
+ if (!_game._trigger) {
+ _raoulStatus = 5;
+ _florStatus = 5;
+ interlocutorFl = true;
+ heroFl = true;
+ _vm->_gameConv->hold();
+ }
+ break;
+
+ case 29:
+ interlocutorFl = true;
+ heroFl = true;
+ if (!_game._trigger) {
+ _brieStatus = 3;
+ _vm->_gameConv->hold();
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 75:
+ if (_florentGone) {
+ if (_raoulStatus != 2)
+ _raoulStatus = 0;
+ } else
+ _florStatus = 4;
+
+ break;
+
+ case 80:
+ if (_florentGone) {
+ if ((_action._activeAction._verbId != 18) && (_action._activeAction._verbId != 23))
+ _brieStatus = 0;
+ } else {
+ switch (_action._activeAction._verbId) {
+ case 1:
+ case 7:
+ case 8:
+ case 9:
+ case 13:
+ case 15:
+ case 19:
+ case 20:
+ case 21:
+ case 22:
+ _brieStatus = 0;
+ break;
+
+ default:
+ _florStatus = 0;
+ break;
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (!heroFl && !_raoulDown)
+ _vm->_gameConv->setHeroTrigger(75);
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(80);
+
+ _raoulCount = 0;
+}
+
+void Scene204::handleBrieAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _brieFrame)
+ return;
+
+ _brieFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random;
+
+ switch (_brieFrame) {
+ case 80:
+ _vm->_gameConv->release();
+ _raoulStatus = 2;
+ break;
+
+ case 173:
+ _game._player._stepEnabled = true;
+ _vm->_dialogs->show(20430);
+ _game._player._stepEnabled = false;
+ break;
+
+ case 174:
+ _raoulStatus = 3;
+ resetFrame = 173;
+ break;
+
+ case 1:
+ case 22:
+ case 49:
+ case 7:
+ case 13:
+ case 33:
+ case 61:
+ switch (_brieStatus) {
+ case 0:
+ random = _vm->getRandomNumber(1, 4);
+ _brieStatus = 2;
+ break;
+
+ case 1:
+ random = 5;
+ break;
+
+ case 3:
+ random = 6;
+ break;
+
+ case 4:
+ random = 7;
+ break;
+
+ default:
+ random = 8;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 1;
+ _brieStatus = 2;
+ break;
+
+ case 2:
+ resetFrame = 7;
+ _brieStatus = 2;
+ break;
+
+ case 3:
+ resetFrame = 22;
+ _brieStatus = 2;
+ break;
+
+ case 4:
+ resetFrame = 49;
+ _brieStatus = 2;
+ break;
+
+ case 5:
+ resetFrame = 13;
+ _brieStatus = 2;
+ break;
+
+ case 6:
+ resetFrame = 61;
+ break;
+
+ default:
+ resetFrame = 0;
+ break;
+ }
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _brieFrame = resetFrame;
+ }
+}
+
+void Scene204::handleFlorAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == _florFrame)
+ return;
+
+ _florFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random;
+
+ switch (_florFrame) {
+ case 80:
+ _scene->setAnimFrame(_globals._animationIndexes[2], 1);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[2], SYNC_ANIM, _globals._animationIndexes[1]);
+ _raoulStatus = 1;
+ break;
+
+ case 86:
+ _vm->_gameConv->release();
+ break;
+
+ case 173:
+ resetFrame = 172;
+ break;
+
+ case 1:
+ case 2:
+ case 3:
+ if (_raoulDown) {
+ random = _vm->getRandomNumber(1, 1000);
+ if (random < 300)
+ resetFrame = 0;
+ else if (random < 600)
+ resetFrame = 1;
+ else
+ resetFrame = 2;
+ }
+ break;
+
+ case 21:
+ case 180:
+ _vm->_gameConv->release();
+ break;
+
+ case 22:
+ case 50:
+ case 30:
+ case 174:
+ case 175:
+ case 176:
+ case 181:
+ switch (_florStatus) {
+ case 0:
+ random = 1;
+ _florStatus = 2;
+ break;
+
+ case 1:
+ random = 2;
+ _florStatus = 2;
+ break;
+
+ case 3:
+ random = 3;
+ break;
+
+ case 5:
+ random = 4;
+ _florStatus = 2;
+ break;
+
+ case 4:
+ random = _vm->getRandomNumber(5, 7);
+ ++_raoulCount;
+ if (_raoulCount > 17) {
+ _florStatus = 2;
+ random = 8;
+ }
+ break;
+
+ default:
+ random = 7;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 22;
+ break;
+
+ case 2:
+ resetFrame = 30;
+ break;
+
+ case 3:
+ resetFrame = 53;
+ break;
+
+ case 4:
+ resetFrame = 176;
+ break;
+
+ case 5:
+ resetFrame = 173;
+ break;
+
+ case 6:
+ resetFrame = 174;
+ break;
+
+ case 7:
+ resetFrame = 175;
+ break;
+
+ default:
+ resetFrame = 21;
+ break;
+ }
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _florFrame = resetFrame;
+ }
+}
+
+void Scene204::handleRaoulAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame() == _raoulFrame)
+ return;
+
+ _raoulFrame = _scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame();
+ int resetFrame = -1;
+ int random;
+
+ switch (_raoulFrame) {
+ case 1:
+ if (_raoulStatus == 4)
+ resetFrame = 0;
+
+ break;
+
+ case 10:
+ case 14:
+ case 20:
+ case 258:
+ switch (_raoulStatus) {
+ case 0:
+ random = _vm->getRandomNumber(1, 2);
+ _raoulStatus = 1;
+ break;
+
+ case 2:
+ random = 3;
+ break;
+
+ case 5:
+ random = 4;
+ break;
+
+ default:
+ random = 5;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 10;
+ _raoulStatus = 1;
+ break;
+
+ case 2:
+ resetFrame = 14;
+ _raoulStatus = 1;
+ break;
+
+ case 3:
+ resetFrame = 20;
+ break;
+
+ case 4:
+ resetFrame = 253;
+ _raoulStatus = 1;
+ break;
+
+ default:
+ resetFrame = 9;
+ break;
+ }
+ break;
+
+ case 31:
+ if (_raoulStatus == 3)
+ resetFrame = 33;
+ else
+ resetFrame = 30;
+
+ break;
+
+ case 33:
+ resetFrame = 32;
+ break;
+
+ case 114:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _game._objects.addToInventory(OBJ_BOOK);
+ break;
+
+ case 213:
+ _game._player._stepEnabled = true;
+ _vm->_dialogs->showItem(OBJ_BOOK, 20431, 0);
+ _game._player._stepEnabled = false;
+ break;
+
+ case 229:
+ _game._player._stepEnabled = true;
+ _vm->_dialogs->showItem(OBJ_BOOK, 20432, 0);
+ _game._player._stepEnabled = false;
+ break;
+
+ case 237:
+ _scene->freeAnimation(_globals._animationIndexes[1]);
+ _scene->freeAnimation(_globals._animationIndexes[0]);
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim3ActvFl = true;
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('e', 1), 0);
+ _scene->loadSpeech(9);
+ break;
+
+ case 253:
+ resetFrame = 244;
+ break;
+
+ case 257:
+ _vm->_gameConv->release();
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[2], resetFrame);
+ _raoulFrame = resetFrame;
+ }
+}
+
+void Scene204::handleEndAnimation() {
+ if ((_scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame() == 15) && !_skip3Fl) {
+ _scene->playSpeech(9);
+ _skip3Fl = true;
+ }
+
+ if ((_scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame() == 26) && !_skip2Fl) {
+ _scene->_sequences.addTimer(300, 85);
+ _scene->_kernelMessages.add(Common::Point(123, 137), 0x1110, 0, 0, 360, _game.getQuote(0x75));
+ _skip2Fl = true;
+ }
+
+ if (_scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame() == 27)
+ _scene->setAnimFrame(_globals._animationIndexes[3], 12);
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene205::Scene205(MADSEngine *vm) : Scene2xx(vm) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _noConversationHold = false;
+ _giveTicketFl = false;
+
+ _richardFrame = -1;
+ _richardStatus = -1;
+ _richardCount = -1;
+ _giryFrame = -1;
+ _giryStatus = -1;
+ _giryCount = -1;
+ _conversationCounter = -1;
+ _lastRandom = -1;
+}
+
+void Scene205::synchronize(Common::Serializer &s) {
+ Scene2xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_noConversationHold);
+ s.syncAsByte(_giveTicketFl);
+
+ s.syncAsSint16LE(_richardFrame);
+ s.syncAsSint16LE(_richardStatus);
+ s.syncAsSint16LE(_richardCount);
+ s.syncAsSint16LE(_giryFrame);
+ s.syncAsSint16LE(_giryStatus);
+ s.syncAsSint16LE(_giryCount);
+ s.syncAsSint16LE(_conversationCounter);
+ s.syncAsSint16LE(_lastRandom);
+}
+
+void Scene205::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if (_globals[kCurrentYear] != 1881)
+ return;
+
+ if (_globals[kJacquesStatus] == 1)
+ _scene->_variant = 3;
+ else if (_globals[kJacquesStatus] == 0) {
+ if (_globals[kMadameGiryLocation] == 0)
+ _scene->_variant = 2;
+ else if (_globals[kMadameGiryLocation] == 1)
+ _scene->_variant = 1;
+ }
+}
+
+void Scene205::enter() {
+ _vm->_disableFastwalk = true;
+
+ if (_globals[kJacquesStatus] != 1) {
+ _scene->_rails.disableNode(6);
+ _scene->_rails.disableNode(7);
+ _scene->_rails.disableNode(8);
+ _scene->_rails.disableNode(9);
+ }
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _lastRandom = -1;
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ }
+
+ _conversationCounter = 0;
+ _noConversationHold = false;
+ _giveTicketFl = false;
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites("*RDR_9");
+
+ _scene->_hotspots.activate(NOUN_MONSIEUR_RICHARD, false);
+ _scene->_hotspots.activate(NOUN_MADAME_GIRY, false);
+ _scene->_hotspots.activate(NOUN_WOMAN, false);
+
+ _vm->_gameConv->get(18);
+ _vm->_gameConv->get(10);
+ _vm->_gameConv->get(11);
+
+ if (_globals[kCurrentYear] == 1881) {
+ if ((_globals[kMadameGiryShowsUp]) && (_globals[kJacquesStatus] == 0)) {
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('g', 1), 1);
+ _anim1ActvFl = true;
+ _giryStatus = 2;
+
+ int idx = _scene->_dynamicHotspots.add(NOUN_MADAME_GIRY, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[idx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(75, 84), FACING_NORTHWEST);
+ _scene->setDynamicAnim(idx, _globals._animationIndexes[1], 1);
+ _scene->setDynamicAnim(idx, _globals._animationIndexes[1], 2);
+
+ switch (_globals[kMadameGiryLocation]) {
+ case 0:
+ _scene->setAnimFrame(_globals._animationIndexes[1], 138);
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(62, 54));
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(62, 66));
+ break;
+
+ case 1:
+ if (_globals[kMadameNameIsKnown] >= 1) {
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(113, 44));
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(107, 66));
+ } else
+ _scene->_hotspots.activate(NOUN_WOMAN, true);
+
+ break;
+
+ case 2:
+ _scene->setAnimFrame(_globals._animationIndexes[1], 273);
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(283, 51));
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(289, 62));
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ if (_vm->_gameConv->_restoreRunning == 10) {
+ int count = 0;
+
+ if (_game._objects.isInInventory(OBJ_RED_FRAME))
+ ++count;
+ if (_game._objects.isInInventory(OBJ_GREEN_FRAME))
+ ++count;
+ if (_game._objects.isInInventory(OBJ_YELLOW_FRAME))
+ ++count;
+ if (_game._objects.isInInventory(OBJ_BLUE_FRAME))
+ ++count;
+
+ _vm->_gameConv->run(10);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportValue(_game._difficulty);
+
+ if (count > 2)
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _noConversationHold = true;
+
+ if (_giryStatus == 4)
+ _scene->setAnimFrame(_globals._animationIndexes[1], 66);
+ else
+ _giryStatus = 2;
+ } else if (_vm->_gameConv->_restoreRunning == 11) {
+ _vm->_gameConv->run(11);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET));
+ _vm->_gameConv->exportValue(0);
+ _vm->_gameConv->exportValue(0);
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+ }
+ }
+
+ if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+
+ if (_globals[kJacquesStatus] == 1) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 9), 1);
+ _anim0ActvFl = true;
+ _richardStatus = 3;
+ _scene->_hotspots.activate(NOUN_MONSIEUR_RICHARD, true);
+
+ if (_vm->_gameConv->_restoreRunning == 18) {
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _richardStatus = 3;
+ _vm->_gameConv->run(18);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 1);
+ }
+ }
+ }
+
+ if (_scene->_priorSceneId == 206) {
+ _game._player._playerPos = Common::Point(37, 64);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(41, 67), FACING_SOUTH);
+ _game._player.setWalkTrigger(90);
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ if (_globals[kJacquesStatus] == 1) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 9), 1);
+ _anim0ActvFl = true;
+ _richardStatus = 3;
+ _scene->_hotspots.activate(NOUN_MONSIEUR_RICHARD, true);
+ }
+ } else if (_scene->_priorSceneId == 207) {
+ _game._player._playerPos = Common::Point(263, 59);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(262, 63), FACING_SOUTH);
+ _game._player.setWalkTrigger(95);
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ } else if (_scene->_priorSceneId == 150) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 9), 1);
+ _anim0ActvFl = true;
+ _richardStatus = 3;
+ _game._player._playerPos = Common::Point(132, 112);
+ _game._player._facing = FACING_NORTHWEST;
+ _globals[kDoorsIn205] = 1;
+ _globals[kTicketPeoplePresent] = 0;
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -1);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_hotspots.activate(NOUN_MONSIEUR_RICHARD, true);
+ _vm->_gameConv->run(18);
+ } else if ((_scene->_priorSceneId == 202) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ if (_globals[kJacquesStatus] == 1) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 9), 1);
+ _anim0ActvFl = true;
+ _richardStatus = 3;
+ _scene->_hotspots.activate(NOUN_MONSIEUR_RICHARD, true);
+ }
+
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+
+ _game._player.firstWalk(Common::Point(-20, 144), FACING_EAST, Common::Point(19, 144), FACING_NORTHEAST, true);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene205::step() {
+ if (_anim0ActvFl)
+ handleRichardAnimation();
+
+ if (_anim1ActvFl)
+ handleGiryAnimation();
+
+ if ((_globals[kWalkerConverse] == 2) || (_globals[kWalkerConverse] == 3)) {
+ ++_conversationCounter;
+ if (_conversationCounter > 200)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+
+ if (_giveTicketFl && !_action.isAction(VERB_GIVE)) {
+ _globals[kWalkerConverse] = 0;
+ _game._player.walk(Common::Point(_game._player._playerPos.x + 5, _game._player._playerPos.y - 10), FACING_NORTHWEST);
+ _game._player.setWalkTrigger(100);
+ _giveTicketFl = false;
+ }
+
+ switch (_game._trigger) {
+ case 100:
+ _game._player._visible = false;
+ _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[2], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 102);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 4, 101);
+ break;
+
+ case 101:
+ _game._objects.setRoom(OBJ_TICKET, NOWHERE);
+ _giryStatus = 2;
+ break;
+
+ case 102:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[2]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ _vm->_gameConv->release();
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 90:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[0], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 91);
+ break;
+
+ case 91:
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _vm->_sound->command(25);
+ _game._player._stepEnabled = true;
+ break;
+
+ case 95:
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 96);
+ break;
+
+ case 96:
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _vm->_sound->command(25);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene205::actions() {
+ if (_vm->_gameConv->_running == 18) {
+ handleConversation18();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 10) {
+ handleConversation10();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 11) {
+ handleConversation11();
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_OPEN, NOUN_BOX_FIVE)) || (_action.isAction(VERB_ENTER, NOUN_BOX_FIVE))) {
+ if (_globals[kTicketPeoplePresent] == 2) {
+ if (_globals[kMadameGiryLocation] == 2) {
+ _vm->_gameConv->run(11);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET));
+ _vm->_gameConv->exportValue(3);
+ _vm->_gameConv->exportValue(0);
+ } else {
+ _vm->_gameConv->run(11);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET));
+ _vm->_gameConv->exportValue(4);
+ _vm->_gameConv->exportValue(0);
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_DOWN_STAIRS_TO, NOUN_GRAND_FOYER)) {
+ if (_globals[kTicketPeoplePresent] == 2) {
+ if (_globals[kMadameGiryLocation] == 2) {
+ _vm->_gameConv->run(11);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET));
+ _vm->_gameConv->exportValue(1);
+ _vm->_gameConv->exportValue(0);
+ } else {
+ _vm->_gameConv->run(11);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET));
+ _vm->_gameConv->exportValue(2);
+ _vm->_gameConv->exportValue(0);
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if ((_action.isAction(VERB_ENTER)) || (_action.isAction(VERB_OPEN)) || _action.isAction(VERB_UNLOCK) || _action.isAction(VERB_LOCK)) {
+ if (((_action.isObject(NOUN_BOX_FIVE) && ((_globals[kDoorsIn205] == 0) || (_globals[kDoorsIn205] == 2)))
+ || _action.isAction(VERB_UNLOCK) || _action.isAction(VERB_LOCK))
+ || ((_action.isObject(NOUN_BOX_NINE) && ((_globals[kDoorsIn205] == 0) || (_globals[kDoorsIn205] == 1))))
+ || (_action.isObject(NOUN_BOX_SIX)) || (_action.isObject(NOUN_BOX_SEVEN)) || (_action.isObject(NOUN_BOX_EIGHT))) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[2], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ _action._inProgress = false;
+ return;
+
+ case 1: {
+ int idx = _globals._sequenceIndexes[2];
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 4);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[2], SYNC_SEQ, idx);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[2], false);
+ _vm->_sound->command(72);
+ _scene->_sequences.addTimer(15, 2);
+ _action._inProgress = false;
+ return;
+ }
+
+ case 2:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[2], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ _action._inProgress = false;
+ return;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[2]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ if (_action.isAction(VERB_UNLOCK) || _action.isAction(VERB_LOCK))
+ _vm->_dialogs->show(20528);
+ else
+ _vm->_dialogs->show(20527);
+
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+ } else if (((_action.isObject(NOUN_BOX_FIVE)) && ((_globals[kDoorsIn205] == 3) || (_globals[kDoorsIn205] == 1)))
+ || ((_action.isObject(NOUN_BOX_NINE)) && ((_globals[kDoorsIn205] == 3) || (_globals[kDoorsIn205] == 2)))) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[2] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[2], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[2], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_SPRITE, 4, 80);
+ _action._inProgress = false;
+ return;
+
+ case 80:
+ _vm->_sound->command(24);
+ if (_action.isObject(NOUN_BOX_FIVE)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 81);
+ } else if (_action.isObject(NOUN_BOX_NINE)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 81);
+ }
+ _action._inProgress = false;
+ return;
+
+ case 81:
+ if (_action.isObject(NOUN_BOX_FIVE)) {
+ int idx = _globals._sequenceIndexes[0];
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -2);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[0], SYNC_SEQ, idx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ } else if (_action.isObject(NOUN_BOX_NINE)) {
+ int idx = _globals._sequenceIndexes[1];
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -2);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[1], SYNC_SEQ, idx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ }
+ _action._inProgress = false;
+ return;
+
+ case 2:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[2]);
+ if (_action.isObject(NOUN_BOX_FIVE)) {
+ _game._player.walk(Common::Point(37, 64), FACING_NORTH);
+ _game._player.setWalkTrigger(3);
+
+ } else if (_action.isObject(NOUN_BOX_NINE)) {
+ _game._player.walk(Common::Point(263, 59), FACING_NORTH);
+ _game._player.setWalkTrigger(3);
+ }
+ _action._inProgress = false;
+ return;
+
+ case 3:
+ if (_action.isObject(NOUN_BOX_FIVE)) {
+ _scene->_nextSceneId = 206;
+ _globals[kMadameGiryLocation] = 1;
+ } else if (_action.isObject(NOUN_BOX_NINE)) {
+ _scene->_nextSceneId = 207;
+ _globals[kMadameGiryLocation] = 1;
+ }
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+ }
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_MONSIEUR_RICHARD)) {
+ _vm->_gameConv->run(18);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_MADAME_GIRY) || _action.isAction(VERB_TALK_TO, NOUN_WOMAN) || _action.isAction(VERB_GIVE, NOUN_TICKET, NOUN_MADAME_GIRY)) {
+ if (_globals[kTicketPeoplePresent] == 2) {
+ if ((_globals[kDoorsIn205] == 2) || (_globals[kDoorsIn205] == 3)) {
+ if (_globals[kMadameGiryLocation] == 2) {
+ _vm->_gameConv->run(11);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET));
+ _vm->_gameConv->exportValue(1);
+
+ if (_action.isAction(VERB_GIVE))
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+ } else {
+ _vm->_gameConv->run(11);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET));
+ _vm->_gameConv->exportValue(2);
+
+ if (_action.isAction(VERB_GIVE))
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+ }
+ } else {
+ _vm->_gameConv->run(11);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_TICKET));
+ _vm->_gameConv->exportValue(0);
+
+ if (_action.isAction(VERB_GIVE))
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+ }
+ } else {
+ int count = 0;
+
+ if (_game._objects.isInInventory(OBJ_RED_FRAME))
+ ++count;
+ if (_game._objects.isInInventory(OBJ_GREEN_FRAME))
+ ++count;
+ if (_game._objects.isInInventory(OBJ_YELLOW_FRAME))
+ ++count;
+ if (_game._objects.isInInventory(OBJ_BLUE_FRAME))
+ ++count;
+
+ _vm->_gameConv->run(10);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _vm->_gameConv->exportValue(_game._difficulty);
+
+ if (count > 2)
+ _vm->_gameConv->exportValue(1);
+ else
+ _vm->_gameConv->exportValue(0);
+
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(20510);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_BOX_SIX)) {
+ _vm->_dialogs->show(20511);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOX_SEVEN)) {
+ _vm->_dialogs->show(20512);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOX_EIGHT)) {
+ _vm->_dialogs->show(20513);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOX_NINE)) {
+ if ((_globals[kDoorsIn205] == 0) || (_globals[kDoorsIn205] == 1))
+ _vm->_dialogs->show(20516);
+ else
+ _vm->_dialogs->show(20517);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOX_FIVE)) {
+ if ((_globals[kDoorsIn205] == 0) || (_globals[kDoorsIn205] == 2))
+ _vm->_dialogs->show(20514);
+ else
+ _vm->_dialogs->show(20515);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(20518);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MARBLE_COLUMN)) {
+ _vm->_dialogs->show(20519);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(20520);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(20521);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BUST)) {
+ _vm->_dialogs->show(20522);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CARPET)) {
+ _vm->_dialogs->show(20523);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GRAND_FOYER)) {
+ _vm->_dialogs->show(20524);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WOMAN) || _action.isObject(NOUN_MADAME_GIRY)) {
+ _vm->_dialogs->show(20525);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MONSIEUR_RICHARD)) {
+ _vm->_dialogs->show(20526);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_BUST)) {
+ _vm->_dialogs->show(20529);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_BOX_TEN) || _action.isAction(VERB_ENTER, NOUN_BOX_TEN) || _action.isAction(VERB_LOOK, NOUN_BOX_TEN)) {
+ _vm->_dialogs->show(20513);
+ _action._inProgress = false;
+ return;
+ }
+
+ // FIX: the original was doing a | between the two 'objects'
+ if (_action.isAction(VERB_TAKE) && (_action.isObject(NOUN_WOMAN) || _action.isObject(NOUN_MADAME_GIRY))) {
+ _vm->_dialogs->show(20530);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene205::preActions() {
+ if (_action.isObject(NOUN_BOX_FIVE) && (_action.isAction(VERB_LOCK) || _action.isAction(VERB_UNLOCK) || _action.isAction(VERB_OPEN)))
+ _game._player.walk(Common::Point(37, 67), FACING_NORTHEAST);
+
+ if (_action.isObject(NOUN_BOX_SIX) && (_action.isAction(VERB_LOCK) || _action.isAction(VERB_UNLOCK) || _action.isAction(VERB_OPEN)))
+ _game._player.walk(Common::Point(80, 68), FACING_NORTHEAST);
+
+ if (_action.isObject(NOUN_BOX_SEVEN) && (_action.isAction(VERB_LOCK) || _action.isAction(VERB_UNLOCK) || _action.isAction(VERB_OPEN)))
+ _game._player.walk(Common::Point(167, 65), FACING_NORTHEAST);
+
+ if (_action.isObject(NOUN_BOX_EIGHT) && (_action.isAction(VERB_LOCK) || _action.isAction(VERB_UNLOCK) || _action.isAction(VERB_OPEN)))
+ _game._player.walk(Common::Point(212, 64), FACING_NORTHEAST);
+
+ if (_action.isObject(NOUN_BOX_NINE) && (_action.isAction(VERB_LOCK) || _action.isAction(VERB_UNLOCK) || _action.isAction(VERB_OPEN)))
+ _game._player.walk(Common::Point(258, 63), FACING_NORTHEAST);
+
+ if (_action.isAction(VERB_WALK_DOWN_STAIRS_TO, NOUN_GRAND_FOYER) && (_globals[kDoorsIn205] != 2) && (_globals[kDoorsIn205] != 3)) {
+ _game._player._walkOffScreenSceneId = 202;
+ _globals[kMadameGiryLocation] = 1;
+ }
+}
+
+void Scene205::handleConversation18() {
+ int interlocutorFl = false;
+ int heroFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 0:
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _richardStatus = 0;
+ break;
+
+ case 3:
+ case 4:
+ _vm->_gameConv->setHeroTrigger(64);
+ _globals[kRanConvIn205] = true;
+ heroFl = true;
+ interlocutorFl = true;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 64:
+ _globals[kWalkerConverse] = 0;
+ heroFl = true;
+ interlocutorFl = true;
+ break;
+
+ case 62:
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+ _richardStatus = 0;
+ break;
+
+ case 60:
+ _globals[kWalkerConverse] = _vm->getRandomNumber(2, 3);
+ _richardStatus = 3;
+ _conversationCounter = 0;
+ break;
+
+ default:
+ break;
+ }
+
+ if (!heroFl)
+ _vm->_gameConv->setHeroTrigger(60);
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(62);
+
+ _richardCount = 0;
+}
+
+void Scene205::handleConversation10() {
+ int interlocutorFl = false;
+ int heroFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 9:
+ _vm->_gameConv->setInterlocutorTrigger(68);
+ interlocutorFl = true;
+ _globals[kMadameNameIsKnown] = 1;
+ _scene->_hotspots.activate(NOUN_WOMAN, false);
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(113, 44));
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(107, 66));
+ break;
+
+ case 10:
+ _globals[kMadameNameIsKnown] = 1;
+ _scene->_hotspots.activate(NOUN_WOMAN, false);
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(113, 44));
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(107, 66));
+ break;
+
+ case 7:
+ if (!_game._trigger) {
+ _giryStatus = 6;
+ _globals[kMadameNameIsKnown] = 2;
+ _globals[kMadameGiryLocation] = 0;
+ _scene->changeVariant(2);
+ _scene->_rails.disableNode(6);
+ _scene->_rails.disableNode(7);
+ _scene->_rails.disableNode(8);
+ _scene->_rails.disableNode(9);
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, false, Common::Point(113, 44));
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, false, Common::Point(107, 66));
+ interlocutorFl = true;
+ heroFl = true;
+ if (_globals[kDoorsIn205] == 0)
+ _globals[kDoorsIn205] = 1;
+ else if (_globals[kDoorsIn205] == 2)
+ _globals[kDoorsIn205] = 3;
+ }
+ break;
+
+ case 13:
+ case 45:
+ _vm->_gameConv->setInterlocutorTrigger(70);
+ interlocutorFl = true;
+ break;
+
+ case 21:
+ if (!_game._trigger && !_noConversationHold) {
+ _vm->_gameConv->hold();
+ _giryStatus = 4;
+ } else
+ _noConversationHold = false;
+
+ break;
+
+ case 17:
+ _vm->_gameConv->setInterlocutorTrigger(72);
+ interlocutorFl = true;
+ break;
+
+ case 11:
+ if (!_game._trigger) {
+ _vm->_gameConv->setInterlocutorTrigger(74);
+ }
+ heroFl = true;
+ interlocutorFl = true;
+ break;
+
+ case 23:
+ case 25:
+ if ((!_game._trigger) && (_giryStatus == 4)) {
+ _vm->_gameConv->hold();
+ _giryStatus = 0;
+ }
+ break;
+
+ case 4:
+ case 5:
+ case 8:
+ case 14:
+ case 16:
+ case 19:
+ case 40:
+ case 46:
+ _vm->_gameConv->setInterlocutorTrigger(64);
+ interlocutorFl = true;
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 64:
+ switch (_action._activeAction._verbId) {
+ case 5:
+ case 14:
+ case 16:
+ case 19:
+ case 40:
+ case 46:
+ _giryStatus = 0;
+ break;
+ }
+ _globals[kWalkerConverse] = 0;
+ heroFl = true;
+ interlocutorFl = true;
+ break;
+
+ case 68:
+ _giryStatus = 5;
+ break;
+
+ case 74:
+ _giryStatus = 8;
+ _globals[kWalkerConverse] = 0;
+ heroFl = true;
+ interlocutorFl = true;
+ break;
+
+ case 72:
+ _giryStatus = 3;
+ break;
+
+ case 70:
+ if (_action._activeAction._verbId == 13) {
+ _globals[kWalkerConverse] = 0;
+ heroFl = true;
+ interlocutorFl = true;
+ }
+ _giryStatus = 1;
+ break;
+
+ case 66:
+ if (_globals[kWalkerConverse] != 0)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+
+ if ((_giryStatus != 4) && (_giryStatus != 6) && (_giryStatus != 7))
+ _giryStatus = 0;
+ break;
+
+ case 60:
+ if (_globals[kWalkerConverse] != 0)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(2, 3);
+
+ if ((_giryStatus != 4) && (_giryStatus != 6) && (_giryStatus != 7))
+ _giryStatus = 2;
+
+ _conversationCounter = 0;
+ break;
+ }
+
+ if (!heroFl)
+ _vm->_gameConv->setHeroTrigger(60);
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(66);
+
+ _giryCount = 0;
+}
+
+void Scene205::handleConversation11() {
+ int interlocutorFl = false;
+ int heroFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 5:
+ if (!_game._trigger) {
+ _vm->_gameConv->hold();
+ _giryStatus = 9;
+ }
+ break;
+
+ case 8:
+ if (!_game._trigger) {
+ _vm->_gameConv->hold();
+ _giryStatus = 7;
+ _vm->_gameConv->setInterlocutorTrigger(64);
+ _game._player.walk(Common::Point(225,79), FACING_NORTHEAST);
+ interlocutorFl = true;
+ _globals[kMadameGiryLocation] = 2;
+ _scene->changeVariant(4);
+ _scene->_rails.disableNode(6);
+ _scene->_rails.disableNode(7);
+ _scene->_rails.disableNode(8);
+ _scene->_rails.disableNode(9);
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, false, Common::Point(113, 44));
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, false, Common::Point(107, 66));
+ if (_globals[kDoorsIn205] == 0)
+ _globals[kDoorsIn205] = 2;
+ else if (_globals[kDoorsIn205] == 1)
+ _globals[kDoorsIn205] = 3;
+ }
+ break;
+
+ case 9:
+ case 10:
+ case 12:
+ case 13:
+ case 14:
+ _vm->_gameConv->setInterlocutorTrigger(64);
+ interlocutorFl = true;
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 64:
+ switch (_action._activeAction._verbId) {
+ case 6:
+ case 10:
+ case 12:
+ case 13:
+ case 14:
+ _giryStatus = 0;
+ break;
+ }
+ _globals[kWalkerConverse] = 0;
+ heroFl = true;
+ interlocutorFl = true;
+ break;
+
+ case 110:
+ _vm->_gameConv->hold();
+ _giryStatus = 7;
+ break;
+
+ case 66:
+ if (_globals[kWalkerConverse] != 0)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(1, 4);
+
+ if (_giryStatus != 9)
+ _giryStatus = 0;
+ break;
+
+ case 60:
+ if (_globals[kWalkerConverse] != 0)
+ _globals[kWalkerConverse] = _vm->getRandomNumber(2, 3);
+
+ if (_giryStatus != 9)
+ _giryStatus = 2;
+
+ _conversationCounter = 0;
+ break;
+ }
+
+ if (!heroFl)
+ _vm->_gameConv->setHeroTrigger(60);
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(66);
+
+ _giryCount = 0;
+}
+
+void Scene205::handleRichardAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _richardFrame)
+ return;
+
+ _richardFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int random;
+ int resetFrame = -1;
+
+ switch (_richardFrame) {
+ case 1:
+ case 2:
+ case 3:
+ case 11:
+ case 19:
+ case 35:
+ case 47:
+ case 57:
+ case 69:
+ switch (_richardStatus) {
+ case 0:
+ random = _vm->getRandomNumber(1, 3);
+ ++_richardCount;
+ if (_richardCount > 30) {
+ _richardStatus = 3;
+ random = 9;
+ }
+ break;
+
+ case 1:
+ random = 4;
+ _richardStatus = 0;
+ break;
+
+ case 2:
+ random = 6;
+ break;
+
+ case 4:
+ random = 5;
+ _richardStatus = 0;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(7, 50);
+ while (_lastRandom == random)
+ random = _vm->getRandomNumber(7, 50);
+
+ _lastRandom = random;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 0;
+ break;
+
+ case 2:
+ resetFrame = 1;
+ break;
+
+ case 3:
+ resetFrame = 2;
+ break;
+
+ case 4:
+ resetFrame = 11;
+ break;
+
+ case 5:
+ resetFrame = 3;
+ break;
+
+ case 6:
+ resetFrame = 57;
+ break;
+
+ case 7:
+ resetFrame = 23;
+ break;
+
+ case 8:
+ resetFrame = 19;
+ break;
+
+ case 9:
+ resetFrame = 21;
+ break;
+
+ case 10:
+ resetFrame = 25;
+ break;
+
+ case 11:
+ resetFrame = 35;
+ break;
+
+ case 12:
+ resetFrame = 47;
+ break;
+
+ default:
+ resetFrame = 0;
+ break;
+ }
+ break;
+
+ case 30:
+ switch (_richardStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ random = 1;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(1, 50);
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 30;
+ else
+ resetFrame = 29;
+
+ break;
+
+ case 24:
+ switch (_richardStatus) {
+ case 1:
+ case 2:
+ case 4:
+ case 0:
+ random = 1;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(1, 30);
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 0;
+ else
+ resetFrame = 23;
+
+ break;
+
+ case 20:
+ switch (_richardStatus) {
+ case 1:
+ case 2:
+ case 4:
+ case 0:
+ random = 1;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(1, 50);
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 0;
+ else
+ resetFrame = 19;
+
+ break;
+
+ case 22:
+ switch (_richardStatus) {
+ case 1:
+ case 2:
+ case 4:
+ case 0:
+ random = 1;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(1, 50);
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 0;
+ else
+ resetFrame = 21;
+
+ break;
+
+ case 41:
+ switch (_richardStatus) {
+ case 1:
+ case 2:
+ case 4:
+ case 0:
+ random = 1;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(1, 50);
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 41;
+ else
+ resetFrame = 40;
+
+ break;
+
+ case 52:
+ switch (_richardStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ random = 1;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(1, 50);
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 52;
+ else
+ resetFrame = 51;
+
+ break;
+
+ case 65:
+ switch (_richardStatus) {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ random = 1;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(1, 50);
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 65;
+ else
+ resetFrame = 64;
+
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _richardFrame = resetFrame;
+ }
+}
+
+void Scene205::handleGiryAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == _giryFrame)
+ return;
+
+ _giryFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+ int random;
+ int resetFrame = -1;
+
+ switch (_giryFrame) {
+ case 77:
+ _vm->_gameConv->release();
+ break;
+
+ case 1:
+ case 2:
+ case 3:
+ case 44:
+ case 14:
+ case 21:
+ case 35:
+ case 56:
+ case 78:
+ case 284:
+ switch (_giryStatus) {
+ case 0:
+ random = _vm->getRandomNumber(1, 3);
+ ++_giryCount;
+ if (_giryCount > 30) {
+ _giryStatus = 2;
+ random = 100;
+ }
+ break;
+
+ case 8:
+ random = 4;
+ _giryStatus = 0;
+ break;
+
+ case 3:
+ random = 5;
+ _giryStatus = 0;
+ break;
+
+ case 1:
+ random = 6;
+ break;
+
+ case 5:
+ _giryStatus = 0;
+ random = 7;
+ break;
+
+ case 4:
+ random = 8;
+ break;
+
+ case 6:
+ random = 9;
+ _giryStatus = 2;
+ break;
+
+ case 7:
+ random = 10;
+ _giryStatus = 2;
+ break;
+
+ case 9:
+ random = 11;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(12, 100);
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 0;
+ break;
+
+ case 2:
+ resetFrame = 1;
+ break;
+
+ case 3:
+ resetFrame = 2;
+ break;
+
+ case 4:
+ resetFrame = 3;
+ break;
+
+ case 5:
+ resetFrame = 16;
+ break;
+
+ case 6:
+ resetFrame = 21;
+ break;
+
+ case 7:
+ resetFrame = 44;
+ break;
+
+ case 8:
+ resetFrame = 56;
+ break;
+
+ case 9:
+ resetFrame = 78;
+ _vm->_gameConv->hold();
+ break;
+
+ case 10:
+ resetFrame = 140;
+ break;
+
+ case 11:
+ resetFrame = 276;
+ break;
+
+ case 12:
+ resetFrame = 35;
+ break;
+
+ default:
+ resetFrame = 0;
+ break;
+ }
+ break;
+
+ case 27:
+ case 28:
+ case 29:
+ switch (_giryStatus) {
+ case 0:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ case 9:
+ random = 4;
+ break;
+
+ default:
+ random = _vm->getRandomNumber(1, 3);
+ ++_giryCount;
+ if (_giryCount > 30) {
+ _giryStatus = 2;
+ random = 100;
+ }
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 26;
+ break;
+
+ case 2:
+ resetFrame = 27;
+ break;
+
+ case 3:
+ resetFrame = 28;
+ break;
+
+ default:
+ resetFrame = 29;
+ break;
+ }
+ break;
+
+ case 265:
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(283, 51));
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(289, 62));
+ _vm->_gameConv->release();
+ break;
+
+ case 274:
+ case 275:
+ case 276:
+ if (_giryStatus == 0) {
+ random = _vm->getRandomNumber(1, 3);
+ ++_giryCount;
+ if (_giryCount > 30) {
+ _giryStatus = 2;
+ random = 100;
+ }
+ } else
+ random = 100;
+
+ switch (random) {
+ case 1:
+ resetFrame = 273;
+ break;
+
+ case 2:
+ resetFrame = 274;
+ break;
+
+ case 3:
+ resetFrame = 275;
+ break;
+
+ default:
+ resetFrame = 273;
+ break;
+ }
+ break;
+
+ case 85:
+ _vm->_gameConv->release();
+ break;
+
+ case 110:
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(62, 54));
+ _scene->_hotspots.activateAtPos(NOUN_MADAME_GIRY, true, Common::Point(62, 66));
+ break;
+
+ case 138:
+ case 139:
+ case 140:
+ switch (_giryStatus) {
+ case 0:
+ case 1:
+ random = _vm->getRandomNumber(1, 3);
+ ++_giryCount;
+ if (_giryCount > 30) {
+ _giryStatus = 2;
+ random = 100;
+ }
+ break;
+
+ default:
+ random = 100;
+ break;
+ }
+
+ switch (random) {
+ case 1:
+ resetFrame = 137;
+ break;
+
+ case 2:
+ resetFrame = 138;
+ break;
+
+ case 3:
+ resetFrame = 139;
+ break;
+
+ default:
+ resetFrame = 137;
+ break;
+ }
+ break;
+
+ case 66:
+ _vm->_gameConv->release();
+ break;
+
+ case 67:
+ switch (_giryStatus) {
+ case 0:
+ case 9:
+ case 2:
+ case 3:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ random = 1;
+ break;
+
+ default:
+ random = 100;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 67;
+ else
+ resetFrame = 66;
+
+ break;
+
+ case 8:
+ case 9:
+ switch (_giryStatus) {
+ case 0:
+ case 9:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ random = 1;
+ break;
+
+ default:
+ random = 100;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 9;
+ else
+ resetFrame = 8;
+
+ break;
+
+ case 280:
+ _giveTicketFl = true;
+ break;
+
+ case 281:
+ switch (_giryStatus) {
+ case 0:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ random = 1;
+ break;
+
+ default:
+ random = 100;
+ break;
+ }
+
+ if (random == 1)
+ resetFrame = 281;
+ else
+ resetFrame = 280;
+
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _giryFrame = resetFrame;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene206::Scene206(MADSEngine *vm) : Scene2xx(vm) {
+ _anim0ActvFl = false;
+ _skip1Fl = false;
+ _skip2Fl = false;
+}
+
+void Scene206::synchronize(Common::Serializer &s) {
+ Scene2xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_skip1Fl);
+ s.syncAsByte(_skip2Fl);
+}
+
+void Scene206::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene206::enter() {
+ _anim0ActvFl = false;
+ _skip1Fl = false;
+ _skip2Fl = false;
+
+ _scene->loadSpeech(1);
+ _vm->_gameConv->get(26);
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 3));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites("*RDR_9");
+
+ if (_scene->_priorSceneId != 308) {
+ if (_globals[kPanelIn206] == 0) {
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ } else {
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 3);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 13);
+ }
+ }
+
+ if (_globals[kPanelIn206] == 0) {
+ _scene->_hotspots.activate(NOUN_PANEL, false);
+ _scene->_hotspots.activate(NOUN_KEYHOLE, false);
+ }
+
+ if (_game._objects.isInRoom(OBJ_CRUMPLED_NOTE)) {
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('p', 0));
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 10);
+ } else
+ _scene->_hotspots.activate(NOUN_CRUMPLED_NOTE, false);
+
+ if (_globals[kTrapDoorStatus] == 0) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ }
+
+ if (_globals[kRightDoorIsOpen504] && !_globals[kKnockedOverHead]) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('h', 1), 88);
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _anim0ActvFl = true;
+ } else if (_scene->_priorSceneId == 308) {
+ _game._player._playerPos = Common::Point(67, 127);
+ _game._player._stepEnabled = false;
+ _game._player.walk(Common::Point(108, 137), FACING_EAST);
+ _game._player.setWalkTrigger(82);
+ } else if ((_scene->_priorSceneId == 205) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(153, 148);
+ _game._player._facing = FACING_NORTH;
+ }
+
+ sceneEntrySound();
+}
+
+void Scene206::step() {
+ switch (_game._trigger) {
+ case 82:
+ _vm->_sound->command(24);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 13);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 83);
+ break;
+
+ case 83:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 3);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 13);
+ _game._player._stepEnabled = true;
+ break;
+
+ case 88:
+ _game._player._playerPos = Common::Point(168, 138);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ _anim0ActvFl = false;
+ _game._player.resetFacing(FACING_WEST);
+ break;
+
+ default:
+ break;
+ }
+
+ if (_anim0ActvFl && !_skip1Fl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 118) {
+ _globals[kKnockedOverHead] = true;
+ _skip1Fl = true;
+ _scene->_sequences.addTimer(1, 84);
+ }
+ }
+
+ if (_anim0ActvFl && !_skip2Fl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 61) {
+ if (_vm->_sound->_preferRoland)
+ _vm->_sound->command(65);
+ else
+ _scene->playSpeech(1);
+
+ _skip2Fl = true;
+ }
+ }
+
+ switch (_game._trigger) {
+ case 84:
+ _vm->_sound->command(24);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 13);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 85);
+ break;
+
+ case 85:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 3);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 13);
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene206::actions() {
+ if (_action.isAction(VERB_EXIT_TO, NOUN_LOGE_CORRIDOR)) {
+ if (_globals[kRightDoorIsOpen504]) {
+ if (_vm->_sound->_preferRoland)
+ _vm->_sound->command(65);
+ else
+ _scene->playSpeech(1);
+
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(4);
+ } else
+ _scene->_nextSceneId = 205;
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_CRUMPLED_NOTE) && (_game._objects.isInRoom(OBJ_CRUMPLED_NOTE) || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _globals[kPlayerScore] += 5;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], -1, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[5], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_SPRITE, 4, 77);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 78);
+ _action._inProgress = false;
+ return;
+
+ case 77:
+ _scene->deleteSequence(_globals._sequenceIndexes[4]);
+ _scene->_hotspots.activate(NOUN_CRUMPLED_NOTE, false);
+ _game._objects.addToInventory(OBJ_CRUMPLED_NOTE);
+ _vm->_sound->command(26);
+ _action._inProgress = false;
+ return;
+
+ case 78:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[5]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 79);
+ _action._inProgress = false;
+ return;
+
+ case 79:
+ _vm->_dialogs->showItem(OBJ_CRUMPLED_NOTE, 816, 6);
+ _game._player._stepEnabled = true;
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_BEHIND, NOUN_PANEL) || _action.isAction(VERB_OPEN, NOUN_PANEL)
+ || ((_game._trigger >= 70) && (_game._trigger < 77))) {
+ if (_globals[kPanelIn206] == 3) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], true, 7, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 3);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[5], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_SPRITE, 3, 70);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 71);
+ break;
+
+ case 70:
+ _vm->_sound->command(24);
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 13);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ break;
+
+ case 71:
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ _game._player.walk(Common::Point(67, 127), FACING_NORTHWEST);
+ _game._player.setWalkTrigger(72);
+ break;
+
+ case 72:
+ _vm->_sound->command(24);
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 13);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 73);
+ break;
+
+ case 73:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ _scene->_nextSceneId = 308;
+ break;
+
+ default:
+ break;
+ }
+ } else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[5] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[5], true, 7, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 3);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[5], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 74);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_SPRITE, 3, 75);
+ break;
+
+ case 74:
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ _vm->_dialogs->show(20625);
+ break;
+
+ case 75:
+ _vm->_sound->command(72);
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_UNLOCK, NOUN_PANEL) || _action.isAction(VERB_LOCK, NOUN_PANEL) || _action.isAction(VERB_PUT, NOUN_KEY, NOUN_KEYHOLE)
+ || _action.isAction(VERB_UNLOCK, NOUN_KEYHOLE) || _action.isAction(VERB_LOCK, NOUN_KEYHOLE) || (_game._trigger >= 64)) {
+ if (_globals[kPanelIn206] >= 1) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], true, 7, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 3);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[5], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 64);
+ break;
+
+ case 64: {
+ _vm->_sound->command(71);
+ int idx = _globals._sequenceIndexes[5];
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], true, -2);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[5], SYNC_SEQ, idx);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[5], false);
+ _scene->_sequences.addTimer(30, 65);
+ }
+ break;
+
+ case 65:
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[5], true, 7, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], 1, 3);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[5], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 66);
+ break;
+
+ case 66:
+ if (_action.isAction(VERB_LOCK)) {
+ _globals[kPanelIn206] = 2;
+ _vm->_dialogs->show(20629);
+ } else if (_action.isAction(VERB_UNLOCK)) {
+ _globals[kPanelIn206] = 3;
+ _vm->_dialogs->show(20628);
+ }
+
+ if (_action.isAction(VERB_PUT)) {
+ if (_globals[kPanelIn206] <= 2) {
+ _globals[kPanelIn206] = 3;
+ _vm->_dialogs->show(20628);
+ } else {
+ _globals[kPanelIn206] = 2;
+ _vm->_dialogs->show(20629);
+ }
+ }
+
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[5]);
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(20610);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(20611);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(20612);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RIGHT_COLUMN)) {
+ _vm->_dialogs->show(20614);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_KEYHOLE)) {
+ _vm->_dialogs->show(20615);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RAIL)) {
+ _vm->_dialogs->show(20616);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SEAT)) {
+ _vm->_dialogs->show(20617);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LOGE_CORRIDOR)) {
+ _vm->_dialogs->show(20618);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAGE)) {
+ if (_globals[kJacquesStatus])
+ _vm->_dialogs->show(20630);
+ else
+ _vm->_dialogs->show(20619);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HOUSE)) {
+ _vm->_dialogs->show(20620);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(20621);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HOUSE_LIGHT)) {
+ _vm->_dialogs->show(20622);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PANEL)) {
+ if (_globals[kPanelIn206] == 3)
+ _vm->_dialogs->show(20624);
+ else
+ _vm->_dialogs->show(20626);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isObject(NOUN_LEFT_COLUMN)) && (!_game._trigger)) {
+ if (_globals[kPanelIn206] == 0) {
+ _vm->_dialogs->show(20613);
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('k', 1), 95);
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ } else
+ _vm->_dialogs->show(20623);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CRUMPLED_NOTE) && _game._objects.isInRoom(OBJ_CRUMPLED_NOTE)) {
+ _vm->_dialogs->show(20627);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ switch (_game._trigger) {
+ case 95:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _scene->_hotspots.activate(NOUN_PANEL, true);
+ _scene->_hotspots.activate(NOUN_KEYHOLE, true);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 3);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 13);
+ if (!(_globals[kPlayerScoreFlags] & 8)) {
+ _globals[kPlayerScoreFlags] |= 8;
+ _globals[kPlayerScore] += 5;
+ }
+ _scene->_sequences.addTimer(15, 96);
+
+ _action._inProgress = false;
+ return;
+
+ case 96:
+ _game._player._stepEnabled = true;
+ _globals[kPanelIn206] = 1;
+ _vm->_dialogs->show(20623);
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+}
+
+void Scene206::preActions() {
+ if (_action.isAction(VERB_LOOK, NOUN_LEFT_COLUMN))
+ _game._player._needToWalk = true;
+
+ if (_action.isAction(VERB_UNLOCK, NOUN_PANEL) || _action.isAction(VERB_WALK_BEHIND, NOUN_PANEL)
+ || _action.isAction(VERB_LOCK, NOUN_PANEL) || _action.isAction(VERB_OPEN, NOUN_PANEL))
+ _game._player.walk(Common::Point(108, 137), FACING_NORTHWEST);
+
+ if (_action.isObject(NOUN_LEFT_COLUMN) && (_globals[kPanelIn206] == 0))
+ _game._player.walk(Common::Point(103, 137), FACING_NORTHWEST);
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene207::Scene207(MADSEngine *vm) : Scene2xx(vm) {
+ _skip1Fl = false;
+ _anim0ActvFl = false;
+}
+
+void Scene207::synchronize(Common::Serializer &s) {
+ Scene2xx::synchronize(s);
+
+ s.syncAsByte(_skip1Fl);
+ s.syncAsByte(_anim0ActvFl);
+}
+
+void Scene207::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene207::enter() {
+ _scene->loadSpeech(2);
+ _skip1Fl = false;
+ _anim0ActvFl = false;
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('a', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('c', 0));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0));
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 10);
+
+ if ((_scene->_priorSceneId == 205) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(159, 147);
+ _game._player._facing = FACING_NORTH;
+ }
+
+ sceneEntrySound();
+}
+
+void Scene207::step() {
+ if (_anim0ActvFl && !_skip1Fl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 6) {
+ if (_vm->_sound->_preferRoland)
+ _vm->_sound->command(69);
+ else
+ _scene->playSpeech(2);
+
+ _skip1Fl = true;
+ }
+ }
+}
+
+void Scene207::actions() {
+ if (_action.isAction(VERB_TAKE, NOUN_SEAT)) {
+ switch (_game._trigger) {
+ case 0:
+ _globals[kPlayerScore] += 5;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _vm->_sound->command(3);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 7, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1:
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ _scene->_sequences.addTimer(120, 2);
+ _scene->_sequences.addTimer(240, 3);
+ break;
+
+ case 2:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 4);
+ break;
+
+ case 3:
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('s', 1), 5);
+ _anim0ActvFl = true;
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ break;
+
+ case 4:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ break;
+
+ case 5:
+ _scene->_nextSceneId = 208;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_LOGE_CORRIDOR)) {
+ _scene->_nextSceneId = 205;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(20710);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(20711);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(20712);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LEFT_COLUMN)) {
+ _vm->_dialogs->show(20713);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RIGHT_COLUMN)) {
+ _vm->_dialogs->show(20714);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RAIL)) {
+ _vm->_dialogs->show(20715);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SEAT)) {
+ _vm->_dialogs->show(20716);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LOGE_CORRIDOR)) {
+ _vm->_dialogs->show(20717);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAGE)) {
+ _vm->_dialogs->show(20718);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HOUSE)) {
+ _vm->_dialogs->show(20719);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(20720);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HOUSE_LIGHT)) {
+ _vm->_dialogs->show(20721);
+ _action._inProgress = false;
+ return;
+ }
+ }
+}
+
+void Scene207::preActions() {
+ if (_action.isAction(VERB_TAKE, NOUN_SEAT))
+ _game._player.walk(Common::Point(139, 124), FACING_NORTH);
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene208::Scene208(MADSEngine *vm) : Scene2xx(vm) {
+ _skip1Fl = false;
+ _skip2Fl = false;
+
+ _topLeftPeopleFrame = -1;
+ _topRightPeopleFrame = -1;
+ _middleLeftPeopleFrame = -1;
+ _centerPeopleFrame = -1;
+ _middleRightPeopleFrame = -1;
+ _bottomLeftPeopleFrame = -1;
+ _bottomMiddlePeopleFrame = -1;
+ _bottomRightPeopleFrame = -1;
+ _direction = -1;
+}
+
+void Scene208::synchronize(Common::Serializer &s) {
+ Scene2xx::synchronize(s);
+
+ s.syncAsByte(_skip1Fl);
+ s.syncAsByte(_skip2Fl);
+
+ s.syncAsSint16LE(_topLeftPeopleFrame);
+ s.syncAsSint16LE(_topRightPeopleFrame);
+ s.syncAsSint16LE(_middleLeftPeopleFrame);
+ s.syncAsSint16LE(_centerPeopleFrame);
+ s.syncAsSint16LE(_middleRightPeopleFrame);
+ s.syncAsSint16LE(_bottomLeftPeopleFrame);
+ s.syncAsSint16LE(_bottomMiddlePeopleFrame);
+ s.syncAsSint16LE(_bottomRightPeopleFrame);
+ s.syncAsSint16LE(_direction);
+}
+
+void Scene208::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene208::enter() {
+ _scene->loadSpeech(1);
+
+ _skip1Fl = false;
+ _skip2Fl = false;
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 3));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('x', 4));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('x', 5));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('x', 6));
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('x', 7));
+
+ _scene->_userInterface.emptyConversationList();
+ _scene->_userInterface.setup(kInputConversation);
+
+ _scene->loadSpeech(1);
+
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+
+ _topLeftPeopleFrame = 2;
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, _topLeftPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 1);
+ _scene->_sequences.addTimer(120, 60);
+
+ _topRightPeopleFrame = 2;
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, _topRightPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ _scene->_sequences.addTimer(30, 62);
+
+ _middleLeftPeopleFrame = 2;
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, _middleLeftPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ _scene->_sequences.addTimer(30, 64);
+
+ _centerPeopleFrame = 1;
+ _direction = 1;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, _centerPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+ _scene->_sequences.addTimer(300, 66);
+
+ _middleRightPeopleFrame = 3;
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, _middleRightPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 1);
+ _scene->_sequences.addTimer(60, 68);
+
+ _bottomLeftPeopleFrame = 4;
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, _bottomLeftPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+ _scene->_sequences.addTimer(60, 70);
+
+ _bottomMiddlePeopleFrame = 4;
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, _bottomMiddlePeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14);
+ _scene->_sequences.addTimer(30, 72);
+
+ _bottomRightPeopleFrame = 3;
+ _globals._sequenceIndexes[7] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[7], false, _bottomRightPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[7], 1);
+ _scene->_sequences.addTimer(15, 74);
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('p', 1), 80);
+
+ sceneEntrySound();
+}
+
+void Scene208::step() {
+ animateTopLeftPeople();
+ animateTopRightPeople();
+ animateMiddleLeftPeople();
+ animateCenterPeople();
+ animateMiddleRightPeople();
+ animateBottomLeftPeople();
+ animateBottomMiddlePeople();
+ animateBottomRightPeople();
+
+ if (!_skip1Fl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 49) {
+ if (_vm->_sound->_preferRoland)
+ _vm->_sound->command(65);
+ else
+ _scene->playSpeech(1);
+
+ _skip1Fl = true;
+ }
+ }
+
+ if (!_skip2Fl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 68) {
+ if (_vm->_sound->_preferRoland)
+ _vm->_sound->command(65);
+ else
+ _scene->playSpeech(1);
+
+ _skip2Fl = true;
+ }
+ }
+
+ if (_game._trigger == 80)
+ _scene->_nextSceneId = 150;
+}
+
+void Scene208::actions() {
+}
+
+void Scene208::preActions() {
+}
+
+void Scene208::animateTopLeftPeople() {
+
+ if (_game._trigger != 60)
+ return;
+
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+
+ int triggerVal;
+ int rndVal = _vm->getRandomNumber(1, 2);
+ if (_topLeftPeopleFrame == 3)
+ triggerVal = 1;
+ else
+ triggerVal = rndVal;
+
+ if (rndVal == triggerVal) {
+ _topLeftPeopleFrame += _vm->getRandomNumber(-1, 1);
+ if (_topLeftPeopleFrame == 0)
+ _topLeftPeopleFrame = 1;
+ else if (_topLeftPeopleFrame == 4)
+ _topLeftPeopleFrame = 3;
+ }
+
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, _topLeftPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 1);
+ int delay = _vm->getRandomNumber(15, 60);
+ _scene->_sequences.addTimer(delay, 60);
+}
+
+void Scene208::animateTopRightPeople() {
+ if (_game._trigger != 62)
+ return;
+
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+
+ int triggerVal;
+ int rndVal = _vm->getRandomNumber(1, 2);
+ if (_topRightPeopleFrame == 4)
+ triggerVal = 1;
+ else
+ triggerVal = rndVal;
+
+ if (rndVal == triggerVal) {
+ _topRightPeopleFrame += _vm->getRandomNumber(-1, 1);
+ if (_topRightPeopleFrame == 0)
+ _topRightPeopleFrame = 1;
+ else if (_topRightPeopleFrame == 5)
+ _topRightPeopleFrame = 4;
+ }
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, _topRightPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ int delay = _vm->getRandomNumber(15, 60);
+ _scene->_sequences.addTimer(delay, 62);
+}
+
+void Scene208::animateMiddleLeftPeople() {
+ if (_game._trigger != 64)
+ return;
+
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ int delay = _vm->getRandomNumber(60, 120);
+
+ int triggerVal;
+ int rndVal = _vm->getRandomNumber(1, 2);
+ if (_middleLeftPeopleFrame == 2)
+ triggerVal = 1;
+ else
+ triggerVal = rndVal;
+
+ if (rndVal == triggerVal) {
+ _middleLeftPeopleFrame += _vm->getRandomNumber(-1, 1);
+ if (_middleLeftPeopleFrame == 0)
+ _middleLeftPeopleFrame = 1;
+ else if (_middleLeftPeopleFrame == 5)
+ _middleLeftPeopleFrame = 4;
+ }
+
+ if ((_centerPeopleFrame == 3) && (_middleLeftPeopleFrame < 4)) {
+ ++_middleLeftPeopleFrame;
+ delay = 10;
+ }
+
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, _middleLeftPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ _scene->_sequences.addTimer(delay, 64);
+}
+
+
+void Scene208::animateCenterPeople() {
+ if (_game._trigger != 66)
+ return;
+
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+
+ int delay;
+
+ if (_direction) {
+ ++_centerPeopleFrame;
+ delay = 15;
+ if (_centerPeopleFrame == 4) {
+ delay = _vm->getRandomNumber(300, 420);
+ --_centerPeopleFrame;
+ _direction = 0;
+ }
+ } else {
+ --_centerPeopleFrame;
+ delay = 15;
+ if (_centerPeopleFrame == 0) {
+ delay = _vm->getRandomNumber(600, 900);
+ ++_centerPeopleFrame;
+ _direction = 1;
+ }
+ }
+
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, _centerPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+ _scene->_sequences.addTimer(delay, 66);
+}
+
+void Scene208::animateMiddleRightPeople() {
+ if (_game._trigger != 68)
+ return;
+
+ _scene->deleteSequence(_globals._sequenceIndexes[4]);
+
+ int triggerVal;
+ int rndVal = _vm->getRandomNumber(1, 2);
+ if (_middleRightPeopleFrame == 1)
+ triggerVal = 1;
+ else
+ triggerVal = rndVal;
+
+ if (rndVal == triggerVal) {
+ _middleRightPeopleFrame += _vm->getRandomNumber(-1, 1);
+ if (_middleRightPeopleFrame == 0)
+ _middleRightPeopleFrame = 1;
+ else if (_middleRightPeopleFrame == 4)
+ _middleRightPeopleFrame = 3;
+
+ if (_centerPeopleFrame == 3)
+ _middleRightPeopleFrame = 3;
+ }
+
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, _middleRightPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 1);
+ int delay = _vm->getRandomNumber(15, 60);
+ _scene->_sequences.addTimer(delay, 68);
+}
+
+void Scene208::animateBottomLeftPeople() {
+ if (_game._trigger != 70)
+ return;
+
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+
+ int triggerVal;
+ int rndVal = _vm->getRandomNumber(1, 2);
+ if (_bottomLeftPeopleFrame == 4)
+ triggerVal = 1;
+ else
+ triggerVal = rndVal;
+
+ if (rndVal == triggerVal) {
+ _bottomLeftPeopleFrame += _vm->getRandomNumber(-1, 1);
+ if (_bottomLeftPeopleFrame == 0)
+ _bottomLeftPeopleFrame = 1;
+ else if (_bottomLeftPeopleFrame == 5)
+ _bottomLeftPeopleFrame = 4;
+ }
+
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, _bottomLeftPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+ int delay = _vm->getRandomNumber(15, 60);
+ _scene->_sequences.addTimer(delay, 70);
+}
+
+void Scene208::animateBottomMiddlePeople() {
+ if (_game._trigger != 72)
+ return;
+
+ _scene->deleteSequence(_globals._sequenceIndexes[6]);
+
+ int triggerVal;
+ int rndVal = _vm->getRandomNumber(1, 2);
+ if (_bottomMiddlePeopleFrame == 4)
+ triggerVal = 1;
+ else
+ triggerVal = rndVal;
+
+ if (rndVal == triggerVal) {
+ _bottomMiddlePeopleFrame += _vm->getRandomNumber(-1, 1);
+ if (_bottomMiddlePeopleFrame == 0)
+ _bottomMiddlePeopleFrame = 1;
+ else if (_bottomMiddlePeopleFrame == 5)
+ _bottomMiddlePeopleFrame = 4;
+ }
+
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, _bottomMiddlePeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14);
+ int delay = _vm->getRandomNumber(15, 60);
+ _scene->_sequences.addTimer(delay, 72);
+}
+
+void Scene208::animateBottomRightPeople() {
+ if (_game._trigger != 74)
+ return;
+
+ _scene->deleteSequence(_globals._sequenceIndexes[7]);
+
+ int triggerVal;
+ int rndVal = _vm->getRandomNumber(1, 2);
+ if ((_bottomRightPeopleFrame == 3) || (_bottomRightPeopleFrame == 1))
+ triggerVal = 1;
+ else
+ triggerVal = rndVal;
+
+ if (rndVal == triggerVal) {
+ _bottomRightPeopleFrame += _vm->getRandomNumber(-1, 1);
+ if (_bottomRightPeopleFrame == 0)
+ _bottomRightPeopleFrame = 1;
+ else if (_bottomRightPeopleFrame == 4)
+ _bottomRightPeopleFrame = 3;
+ }
+
+ _globals._sequenceIndexes[7] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[7], false, _bottomRightPeopleFrame);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[7], 1);
+ int delay = _vm->getRandomNumber(15, 60);
+ _scene->_sequences.addTimer(delay, 74);
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene250::Scene250(MADSEngine *vm) : Scene2xx(vm) {
+}
+
+void Scene250::synchronize(Common::Serializer &s) {
+ Scene2xx::synchronize(s);
+}
+
+void Scene250::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene250::enter() {
+ warning("TODO: Switch to letter box view. See definition of MADS_MENU_Y");
+
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+
+ _game.loadQuoteSet(0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x41, 0);
+ _globals._animationIndexes[0] = _scene->loadAnimation("*RM150Q1", 1);
+}
+
+void Scene250::step() {
+ if (_game._trigger == 1)
+ _scene->_sequences.addTimer(12, 2);
+
+ if (_game._trigger == 2) {
+ int y = 68;
+
+ _scene->_kernelMessages.add(Common::Point(160, y), 0x1110, 0x20, 0, 900, _game.getQuote(0x36));
+ y += 16;
+
+ if (_globals[kPlayerScore] > 250)
+ _globals[kPlayerScore] = 250;
+
+ Common::String message = Common::String::format("%d", _globals[kPlayerScore]);
+ message += " ";
+ message += _game.getQuote(0x37);
+ message += " 250 ";
+ message += _game.getQuote(0x38);
+
+ _scene->_kernelMessages.add(Common::Point(160, y), 0x1110, 0x20, 3, 900, message);
+ y += 16;
+
+ _scene->_kernelMessages.add(Common::Point(160, y), 0x1110, 0x20, 0, 900, _game.getQuote(0x39));
+ y += 16;
+
+ int score = _globals[kPlayerScore];
+ int messageId;
+
+ if (score <= 25)
+ // Score level: Stage sweeper
+ messageId = 0x3A;
+ else if (score <= 50)
+ // Score level: Dresser
+ messageId = 0x3B;
+ else if (score <= 75)
+ // Score level: Usher
+ messageId = 0x3C;
+ else if (score <= 100)
+ // Score level: Stagehand
+ messageId = 0x3D;
+ else if (score <= 150)
+ // Score level: Chorus member
+ messageId = 0x3E;
+ else if (score <= 200)
+ // Score level: Supporting player
+ messageId = 0x3F;
+ else if (score <= 249)
+ // Score level: Star player
+ messageId = 0x40;
+ else
+ // Score level: Director
+ messageId = 0x41;
+
+ _scene->_kernelMessages.add(Common::Point(160, y), 0x1110, 0x20, 0, 900, _game.getQuote(messageId));
+ _scene->_sequences.addTimer(930, 3);
+ }
+
+ if (_game._trigger == 3)
+ _game._winStatus = 1;
+}
+
+void Scene250::actions() {
+}
+
+void Scene250::preActions() {
+}
+
+/*------------------------------------------------------------------------*/
+
+} // End of namespace Phantom
+} // End of namespace MADS
diff --git a/engines/mads/phantom/phantom_scenes2.h b/engines/mads/phantom/phantom_scenes2.h
new file mode 100644
index 0000000000..7e86e2ce0f
--- /dev/null
+++ b/engines/mads/phantom/phantom_scenes2.h
@@ -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 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.
+ *
+ */
+
+#ifndef MADS_PHANTOM_SCENES2_H
+#define MADS_PHANTOM_SCENES2_H
+
+#include "common/scummsys.h"
+#include "common/serializer.h"
+#include "mads/game.h"
+#include "mads/scene.h"
+#include "mads/phantom/phantom_scenes.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+class Scene2xx : public PhantomScene {
+protected:
+ /**
+ * Plays an appropriate sound when entering a scene
+ */
+ void sceneEntrySound();
+
+ /**
+ *Sets the AA file to use for the scene
+ */
+ void setAAName();
+
+ /**
+ * Updates the prefix used for getting player sprites for the scene
+ */
+ void setPlayerSpritesPrefix();
+public:
+ Scene2xx(MADSEngine *vm) : PhantomScene(vm) {}
+};
+
+class Scene201 : public Scene2xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _needHoldFl;
+ int _sellerCount;
+ int _sellerStatus;
+ int _sellerFrame;
+ int _raoulFrame;
+ int _raoulStatus;
+
+ void handleSellerAnimation();
+ void handleRaoulAnimation();
+ void handleConversation();
+
+public:
+ Scene201(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene202 : public Scene2xx {
+private:
+ bool _ticketGivenFl;
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _skipWalkFl;
+ int _chandeliersPosX[5];
+ int _chandeliersHotspotId[5];
+ int _conversationCount;
+ int _usherStatus;
+ int _usherFrame;
+ int _usherCount;
+ int _degasStatus;
+ int _degasFrame;
+
+ void handleConversation1();
+ void handleConversation2();
+ void handleUsherAnimation();
+ void handleDegasAnimation();
+ void handleChandeliersPositions();
+
+public:
+ Scene202(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene203 : public Scene2xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _anim2ActvFl;
+ bool _anim3ActvFl;
+ bool _showNoteFl;
+
+ int _brieStatus;
+ int _brieFrame;
+ int _brieCount;
+ int _raoulStatus;
+ int _raoulFrame;
+ int _raoulCount;
+ int _richardStatus;
+ int _richardFrame;
+ int _daaeStatus;
+ int _daaeFrame;
+ int _conversationCount;
+
+ void handleBrieConversation();
+ void handleRichardConversation();
+ void handleRichardAndDaaeConversation();
+ void handleBrieAnimation();
+ void handleRichardAnimation();
+ void handleRaoulAnimation();
+ void handleDaaeAnimation();
+
+public:
+ Scene203(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene204 : public Scene2xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _anim2ActvFl;
+ bool _anim3ActvFl;
+ bool _raoulDown;
+ bool _florentGone;
+ bool _skip1Fl;
+ bool _skip2Fl;
+ bool _skip3Fl;
+ bool _endGameFl;
+
+ int _brieStatus;
+ int _brieFrame;
+ int _florStatus;
+ int _florFrame;
+ int _raoulStatus;
+ int _raoulFrame;
+ int _raoulCount;
+
+ void handleConversation();
+ void handleBrieAnimation();
+ void handleFlorAnimation();
+ void handleRaoulAnimation();
+ void handleEndAnimation();
+
+public:
+ Scene204(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene205 : public Scene2xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _noConversationHold;
+ bool _giveTicketFl;
+
+ int _richardFrame;
+ int _richardStatus;
+ int _richardCount;
+ int _giryFrame;
+ int _giryStatus;
+ int _giryCount;
+ int _conversationCounter;
+ int _lastRandom;
+
+ void handleConversation18();
+ void handleConversation10();
+ void handleConversation11();
+ void handleRichardAnimation();
+ void handleGiryAnimation();
+
+public:
+ Scene205(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene206 : public Scene2xx {
+private:
+ bool _anim0ActvFl;
+ bool _skip1Fl;
+ bool _skip2Fl;
+
+public:
+ Scene206(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene207 : public Scene2xx {
+private:
+ bool _skip1Fl;
+ bool _anim0ActvFl;
+
+public:
+ Scene207(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene208 : public Scene2xx {
+private:
+ bool _skip1Fl;
+ bool _skip2Fl;
+
+ int _topLeftPeopleFrame;
+ int _topRightPeopleFrame;
+ int _middleLeftPeopleFrame;
+ int _centerPeopleFrame;
+ int _middleRightPeopleFrame;
+ int _bottomLeftPeopleFrame;
+ int _bottomMiddlePeopleFrame;
+ int _bottomRightPeopleFrame;
+ int _direction;
+
+ void animateTopLeftPeople();
+ void animateTopRightPeople();
+ void animateMiddleLeftPeople();
+ void animateCenterPeople();
+ void animateMiddleRightPeople();
+ void animateBottomLeftPeople();
+ void animateBottomMiddlePeople();
+ void animateBottomRightPeople();
+
+public:
+ Scene208(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene250 : public Scene2xx {
+public:
+ Scene250(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+} // End of namespace Phantom
+} // End of namespace MADS
+
+#endif /* MADS_PHANTOM_SCENES2_H */
diff --git a/engines/mads/phantom/phantom_scenes3.cpp b/engines/mads/phantom/phantom_scenes3.cpp
new file mode 100644
index 0000000000..bb9bcee80c
--- /dev/null
+++ b/engines/mads/phantom/phantom_scenes3.cpp
@@ -0,0 +1,2767 @@
+/* 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.
+ *
+ */
+
+#include "common/scummsys.h"
+#include "mads/mads.h"
+#include "mads/conversations.h"
+#include "mads/scene.h"
+#include "mads/phantom/phantom_scenes.h"
+#include "mads/phantom/phantom_scenes3.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+void Scene3xx::setAAName() {
+ _game._aaName = Resources::formatAAName(_globals[kTempInterface]);
+ _vm->_palette->setEntry(254, 43, 47, 51);
+}
+
+void Scene3xx::sceneEntrySound() {
+ if (!_vm->_musicFlag)
+ return;
+
+ switch (_scene->_nextSceneId) {
+ case 303:
+ case 304:
+ case 305:
+ case 307:
+ case 308:
+ if (_globals[kKnockedOverHead])
+ _vm->_sound->command(33);
+ else
+ _vm->_sound->command(16);
+ break;
+
+ case 310:
+ case 320:
+ case 330:
+ case 340:
+ _vm->_sound->command(36);
+ break;
+
+ default:
+ if (_scene->_nextSceneId != 306)
+ _vm->_sound->command(16);
+ break;
+ }
+}
+
+void Scene3xx::setPlayerSpritesPrefix() {
+ _vm->_sound->command(5);
+
+ if ((_scene->_nextSceneId == 304) || (_scene->_nextSceneId == 305) || (_scene->_nextSceneId == 306) || (_scene->_nextSceneId == 310))
+ _game._player._spritesPrefix = "";
+ else {
+ Common::String oldName = _game._player._spritesPrefix;
+ if (!_game._player._forcePrefix)
+ _game._player._spritesPrefix = "RAL";
+ if (oldName != _game._player._spritesPrefix)
+ _game._player._spritesChanged = true;
+ }
+
+ _game._player._scalingVelocity = true;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene301::Scene301(MADSEngine *vm) : Scene3xx(vm) {
+ _anim0ActvFl = false;
+ _skip1Fl = false;
+ _skip2Fl = false;
+
+ _lightingHotspotId = -1;
+ _sandbagHotspotId = -1;
+}
+
+void Scene301::synchronize(Common::Serializer &s) {
+ Scene3xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_skip1Fl);
+ s.syncAsByte(_skip2Fl);
+
+ s.syncAsSint16LE(_lightingHotspotId);
+ s.syncAsSint16LE(_sandbagHotspotId);
+}
+
+void Scene301::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene301::enter() {
+ _vm->_disableFastwalk = true;
+
+ _anim0ActvFl = false;
+ _skip2Fl = false;
+ _skip1Fl = false;
+
+ _scene->loadSpeech(6);
+
+ _scene->_hotspots.activate(NOUN_CABLE, false);
+ _scene->_hotspots.activate(NOUN_STOOL, false);
+
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('a', 0));
+
+ if (_globals[kCurrentYear] == 1993) {
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('a', 1));
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('z', 1));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('z', 2));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('z', 3));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('z', 4));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('z', 5));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('z', 6));
+
+ _lightingHotspotId = _scene->_dynamicHotspots.add(NOUN_LIGHTING_INSTRUMENT, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(50, 116, 50 + 19, 116 + 10));
+ _scene->_dynamicHotspots.setPosition(_lightingHotspotId, Common::Point(67, 129), FACING_NORTHWEST);
+ _lightingHotspotId = _scene->_dynamicHotspots.add(NOUN_LIGHTING_INSTRUMENT, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(126, 118, 126 + 29, 118 + 8));
+ _scene->_dynamicHotspots.setPosition(_lightingHotspotId, Common::Point(152, 129), FACING_NORTHWEST);
+
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14);
+
+ _scene->_hotspots.activate(NOUN_CABLE, true);
+ } else {
+ _sandbagHotspotId = _scene->_dynamicHotspots.add(NOUN_SANDBAG, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(464, 114, 464 + 11, 114 + 9));
+ _scene->_dynamicHotspots.setPosition(_sandbagHotspotId, Common::Point(475, 125), FACING_NORTHWEST);
+ _scene->_dynamicHotspots.add(NOUN_SANDBAG, VERB_LOOK_AT, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(468, 42, 468 + 6, 42 + 13));
+ _scene->_hotspots.activate(NOUN_STOOL, true);
+ _scene->_hotspots.activate(NOUN_BIG_PROP, false);
+ }
+
+ if (_scene->_priorSceneId == 302) {
+ _game._player.firstWalk(Common::Point(-20, 132), FACING_WEST, Common::Point(19, 132), FACING_EAST, true);
+ _scene->setCamera(Common::Point(0, 0));
+ } else if ((_scene->_priorSceneId == 106) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(568, 133);
+ _game._player._facing = FACING_WEST;
+ _scene->setCamera(Common::Point(320, 0));
+ }
+
+ if (!_game._visitedScenes._sceneRevisited) {
+ _globals._spriteIndexes[9] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._sequenceIndexes[9] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[9], false, 7, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 5);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[9], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[9], SEQUENCE_TRIGGER_EXPIRE, 0, 64);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene301::step() {
+ if ((_globals[kDoneBrieConv203] == 3) && (_scene->_posAdjust.x < 320) && (_game._player._playerPos.x < 350)) {
+ _game._player.cancelCommand();
+ _game._player.walk(Common::Point(256, 130), FACING_NORTHWEST);
+ _game._player.setWalkTrigger(60);
+ _globals[kDoneBrieConv203] = 0;
+ _game._player._stepEnabled = false;
+ }
+
+ if (_game._trigger == 60) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('p', 1), 0);
+ _anim0ActvFl = true;
+ _game._player._visible = false;
+ _globals[kPlayerScore] += 10;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ }
+
+ if (_anim0ActvFl && !_skip1Fl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 50) {
+ _scene->playSpeech(6);
+ _skip1Fl = true;
+ }
+ }
+
+ if (_anim0ActvFl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 61) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], 60);
+ if (!_skip2Fl) {
+ _vm->_sound->command(1);
+ _scene->_sequences.addTimer(420, 70);
+ _skip2Fl = true;
+ }
+ }
+ }
+
+ if (_game._trigger == 70) {
+ _scene->_userInterface.noInventoryAnim();
+ // CHECKME: Not sure about the next function call
+ _scene->_userInterface.refresh();
+ _scene->_nextSceneId = 104;
+ }
+
+ if (_game._trigger == 64)
+ _scene->_sequences.addTimer(60, 65);
+
+ if (_game._trigger == 65)
+ _vm->_dialogs->show(30137);
+}
+
+void Scene301::actions() {
+ if (_action.isAction(VERB_CLIMB_DOWN, NOUN_CIRCULAR_STAIRCASE)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 1), 1);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ break;
+
+ case 1:
+ _scene->_nextSceneId = 106;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(30110);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_GRID)) {
+ _vm->_dialogs->show(30111);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CATWALK)) {
+ _vm->_dialogs->show(30112);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SIDE_WALL)) {
+ _vm->_dialogs->show(30113);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BACK_WALL)) {
+ _vm->_dialogs->show(30114);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SUPPORT)) {
+ _vm->_dialogs->show(30115);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ACT_CURTAIN)) {
+ _vm->_dialogs->show(30116);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HOUSE)) {
+ _vm->_dialogs->show(30117);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_OTHER_CATWALK)) {
+ _vm->_dialogs->show(30118);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GRIDWORK)) {
+ _vm->_dialogs->show(30119);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BEAM_POSITION)) {
+ _vm->_dialogs->show(30120);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LIGHTING_INSTRUMENT)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(30121);
+ else
+ _vm->_dialogs->show(30122);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TARP)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(30123);
+ else
+ _vm->_dialogs->show(30140);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COUNTERWEIGHT_SYSTEM)) {
+ _vm->_dialogs->show(30124);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SANDBAG) && (_action._mainObjectSource == CAT_HOTSPOT)) {
+ _vm->_dialogs->show(30125);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BATTEN)) {
+ _vm->_dialogs->show(30126);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STOOL)) {
+ _vm->_dialogs->show(30127);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HEMP)) {
+ _vm->_dialogs->show(30128);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CIRCULAR_STAIRCASE)) {
+ _vm->_dialogs->show(30129);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CATWALK_OVER_HOUSE)) {
+ _vm->_dialogs->show(30130);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STAIRCASE_POST)) {
+ _vm->_dialogs->show(30131);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RAILING)) {
+ _vm->_dialogs->show(30132);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CYCLORAMA)) {
+ _vm->_dialogs->show(30133);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BIG_PROP)) {
+ _vm->_dialogs->show(30134);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PROSCENIUM_ARCH)) {
+ _vm->_dialogs->show(30135);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CABLE)) {
+ _vm->_dialogs->show(30136);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_HEMP)) {
+ _vm->_dialogs->show(30138);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_PULL, NOUN_HEMP)) {
+ _vm->_dialogs->show(30141);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_SANDBAG) && (_action._mainObjectSource == CAT_HOTSPOT)) {
+ _vm->_dialogs->show(30139);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_TARP)) {
+ _vm->_dialogs->show(30142);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene301::preActions() {
+ if (_action.isAction(VERB_EXIT_TO, NOUN_CATWALK_OVER_HOUSE))
+ _game._player._walkOffScreenSceneId = 302;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene302::Scene302(MADSEngine *vm) : Scene3xx(vm) {
+}
+
+void Scene302::synchronize(Common::Serializer &s) {
+ Scene3xx::synchronize(s);
+}
+
+void Scene302::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene302::enter() {
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('p', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites("*RRD_9");
+
+ if (_game._objects.isInRoom(OBJ_BLUE_FRAME)) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ } else
+ _scene->_hotspots.activate(NOUN_BLUE_FRAME, false);
+
+ if (_globals[kCurrentYear] == 1993) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ }
+
+ if (_scene->_priorSceneId == 303)
+ _game._player.firstWalk(Common::Point(-20, 134), FACING_WEST, Common::Point(15, 134), FACING_EAST, true);
+ else if ((_scene->_priorSceneId == 301) || (_scene->_priorSceneId != RETURNING_FROM_LOADING))
+ _game._player.firstWalk(Common::Point(340, 134), FACING_WEST, Common::Point(297, 134), FACING_WEST, true);
+
+ sceneEntrySound();
+}
+
+void Scene302::step() {
+}
+
+void Scene302::actions() {
+ if (_action.isAction(VERB_TAKE, NOUN_BLUE_FRAME) && (_game._objects.isInRoom(OBJ_BLUE_FRAME) || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ if (_globals[kCurrentYear] == 1881) {
+ int count = 0;
+ if (_game._objects.isInInventory(OBJ_YELLOW_FRAME))
+ ++count;
+ if (_game._objects.isInInventory(OBJ_RED_FRAME))
+ ++count;
+ if (_game._objects.isInInventory(OBJ_GREEN_FRAME))
+ ++count;
+ if (count < 3)
+ _globals[kPlayerScore] += 5;
+ }
+
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _scene->_hotspots.activate(NOUN_BLUE_FRAME, false);
+ _game._objects.addToInventory(OBJ_BLUE_FRAME);
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[1]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ break;
+
+ case 3:
+ if (_globals[kCurrentYear] == 1881)
+ _vm->_dialogs->showItem(OBJ_BLUE_FRAME, 844, 0);
+ else
+ _vm->_dialogs->showItem(OBJ_BLUE_FRAME, 817, 0);
+
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(30210);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_CATWALK)) {
+ _vm->_dialogs->show(30211);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GRID)) {
+ _vm->_dialogs->show(30212);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HEMP)) {
+ _vm->_dialogs->show(30213);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SIDE_WALL)) {
+ _vm->_dialogs->show(30214);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CATWALK)) {
+ _vm->_dialogs->show(30215);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RAILING)) {
+ _vm->_dialogs->show(30216);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BEAM_POSITION)) {
+ _vm->_dialogs->show(30217);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LIGHTING_INSTRUMENT)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(30218);
+ else
+ _vm->_dialogs->show(30219);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME) && _game._objects.isInRoom(OBJ_BLUE_FRAME)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(30220);
+ else
+ _vm->_dialogs->show(30221);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SUPPORT)) {
+ _vm->_dialogs->show(30222);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_OTHER_CATWALK)) {
+ _vm->_dialogs->show(30223);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_HEMP)) {
+ _vm->_dialogs->show(30224);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_PULL, NOUN_HEMP)) {
+ _vm->_dialogs->show(30141);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene302::preActions() {
+ if (_action.isAction(VERB_EXIT_TO, NOUN_CATWALK)) {
+ if (_scene->_customDest.x > 160)
+ _game._player._walkOffScreenSceneId = 301;
+ else
+ _game._player._walkOffScreenSceneId = 303;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene303::Scene303(MADSEngine *vm) : Scene3xx(vm) {
+ _anim0ActvFl = false;
+ _hempHotspotId = -1;
+ _skipFrameCheckFl = -1;
+}
+
+void Scene303::synchronize(Common::Serializer &s) {
+ Scene3xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsSint16LE(_hempHotspotId);
+ s.syncAsSint16LE(_skipFrameCheckFl);
+}
+
+void Scene303::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_CHANDELIER_CABLE);
+ _scene->addActiveVocab(VERB_CLIMB_DOWN);
+}
+
+void Scene303::enter() {
+ _anim0ActvFl = false;
+ _skipFrameCheckFl = false;
+
+ if (_globals[kRightDoorIsOpen504])
+ _vm->_gameConv->get(26);
+
+ if (_globals[kCurrentYear] == 1993) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('z', -1));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('p', 0));
+ }
+
+ if ((_game._objects.isInRoom(OBJ_LARGE_NOTE)) && (_globals[kCurrentYear] == 1993)) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 4);
+ } else
+ _scene->_hotspots.activate(NOUN_LARGE_NOTE, false);
+
+ if (_globals[kCurrentYear] == 1993)
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ else {
+ _hempHotspotId = _scene->_dynamicHotspots.add(NOUN_CHANDELIER_CABLE, VERB_CLIMB_DOWN, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(74, 92, 74 + 7, 92 + 12));
+ _scene->_dynamicHotspots.setPosition(_hempHotspotId, Common::Point(95, 107), FACING_NORTHWEST);
+ _scene->_dynamicHotspots[_hempHotspotId]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setCursor(_hempHotspotId, CURSOR_GO_DOWN);
+ }
+
+ if (_scene->_priorSceneId == 307)
+ _game._player.firstWalk(Common::Point(-20, 135), FACING_EAST, Common::Point(16, 135), FACING_EAST, true);
+ else if (_scene->_priorSceneId == 304) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('u', 1), 60);
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ } else if (_scene->_priorSceneId == 305) {
+ _game._objects.addToInventory(OBJ_SWORD);
+ _game._player._playerPos = Common::Point(117, 92);
+ _game._player._facing = FACING_SOUTHWEST;
+ } else if ((_scene->_priorSceneId == 302) || (_scene->_priorSceneId != RETURNING_FROM_LOADING))
+ _game._player.firstWalk(Common::Point(340, 136), FACING_WEST, Common::Point(303, 136), FACING_WEST, true);
+
+ _scene->_rails.disableLine(5, 9);
+ _scene->_rails.disableLine(5, 12);
+ _scene->_rails.disableLine(5, 8);
+ _scene->_rails.disableLine(6, 3);
+ _scene->_rails.disableLine(6, 2);
+ _scene->_rails.disableLine(11, 3);
+ _scene->_rails.disableLine(11, 4);
+ _scene->_rails.disableLine(10, 2);
+ _scene->_rails.disableLine(4, 9);
+ _scene->_rails.disableLine(8, 0);
+
+ sceneEntrySound();
+}
+
+void Scene303::step() {
+ if (_game._trigger == 60) {
+ _game._player._playerPos = Common::Point(110, 95);
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _game._player.resetFacing(FACING_SOUTHWEST);
+ }
+
+ if (_anim0ActvFl) {
+ if ((_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() >= 6) && !_skipFrameCheckFl) {
+ _skipFrameCheckFl = true;
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _scene->_hotspots.activate(NOUN_LARGE_NOTE, false);
+ _game._objects.addToInventory(OBJ_LARGE_NOTE);
+ _vm->_sound->command(26);
+ }
+ }
+}
+
+void Scene303::actions() {
+ if ((_action.isAction(VERB_TAKE, NOUN_LARGE_NOTE) && _game._objects.isInRoom(OBJ_LARGE_NOTE)) || ((_game._trigger > 0) && _game._trigger < 3)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('n', 1), 1);
+ _anim0ActvFl = true;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ _globals[kPlayerScore] += 5;
+ break;
+
+ case 1:
+ _anim0ActvFl = false;
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _scene->_sequences.addTimer(20, 2);
+ break;
+
+ case 2:
+ _vm->_dialogs->showItem(OBJ_LARGE_NOTE, 818, 7);
+ _game._player._stepEnabled = true;
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_INTO, NOUN_HOLE) || _action.isAction(VERB_CLIMB_DOWN, NOUN_CHANDELIER_CABLE)) {
+ if (_globals[kCurrentYear] == 1881) {
+ switch (_game._trigger) {
+ case 0:
+ if (_globals[kRightDoorIsOpen504])
+ _vm->_dialogs->show(30331);
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 1), 3);
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ break;
+
+ case 3:
+ _scene->_nextSceneId = 304;
+ break;
+
+ default:
+ break;
+ }
+ } else
+ _vm->_dialogs->show(30325);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_CATWALK)) {
+ if (_globals[kRightDoorIsOpen504]) {
+ if (_vm->_sound->_preferRoland)
+ _vm->_sound->command(74);
+ else
+ _scene->playSpeech(1);
+
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(4);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(30310);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ // CHECKME: That's illogical, the check is always false... Should be out of the big 'look' check
+ // It looks to me like an original bug
+ if (_action.isAction(VERB_EXIT_TO, NOUN_CATWALK)) {
+ _vm->_dialogs->show(30316);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CATWALK)) {
+ _vm->_dialogs->show(30311);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GRID)) {
+ _vm->_dialogs->show(30312);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHANDELIER_CABLE)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(30317);
+ else if (_globals[kRightDoorIsOpen504])
+ _vm->_dialogs->show(30330);
+ else
+ _vm->_dialogs->show(30329);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HEMP)) {
+ _vm->_dialogs->show(30313);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BACK_WALL)) {
+ _vm->_dialogs->show(30314);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DUCTWORK)) {
+ _vm->_dialogs->show(30315);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CRATE)) {
+ _vm->_dialogs->show(30318);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SUPPORT)) {
+ _vm->_dialogs->show(30319);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PIECE_OF_WOOD)) {
+ _vm->_dialogs->show(30320);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RAILING)) {
+ _vm->_dialogs->show(30321);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHANDELIER_TRAP)) {
+ _vm->_dialogs->show(30322);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HOLE)) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(30326);
+ else
+ _vm->_dialogs->show(30323);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LARGE_NOTE) && _game._objects.isInRoom(OBJ_LARGE_NOTE)) {
+ _vm->_dialogs->show(30324);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_TO, NOUN_HOLE)) {
+ _vm->_dialogs->show(30325);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_HEMP)) {
+ _vm->_dialogs->show(30327);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_PULL, NOUN_HEMP)) {
+ _vm->_dialogs->show(30141);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene303::preActions() {
+ if (_action.isAction(VERB_EXIT_TO, NOUN_CATWALK) && !_globals[kRightDoorIsOpen504]) {
+ if (_scene->_customDest.x > 160)
+ _game._player._walkOffScreenSceneId = 302;
+ else
+ _game._player._walkOffScreenSceneId = 307;
+ }
+
+ if (_action.isAction(VERB_CLIMB_INTO, NOUN_HOLE) || _action.isAction(VERB_CLIMB_DOWN, NOUN_CHANDELIER_CABLE))
+ _game._player.walk(Common::Point(110, 95), FACING_SOUTHWEST);
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene304::Scene304(MADSEngine *vm) : Scene3xx(vm) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+
+ _raoulFrame = -1;
+ _raoulStatus = -1;
+ _fightFrame = -1;
+ _fightStatus = -1;
+ _fightCount = -1;
+ _phantomFrame = -1;
+ _phantomStatus = -1;
+}
+
+void Scene304::synchronize(Common::Serializer &s) {
+ Scene3xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_anim2ActvFl);
+
+ s.syncAsSint16LE(_raoulFrame);
+ s.syncAsSint16LE(_raoulStatus);
+ s.syncAsSint16LE(_fightFrame);
+ s.syncAsSint16LE(_fightStatus);
+ s.syncAsSint16LE(_fightCount);
+ s.syncAsSint16LE(_phantomFrame);
+ s.syncAsSint16LE(_phantomStatus);
+}
+
+void Scene304::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene304::enter() {
+ _game._player._playerPos.x = 0;
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ }
+
+ if (_globals[kRightDoorIsOpen504])
+ _vm->_gameConv->get(23);
+
+ if (!_globals[kRightDoorIsOpen504]) {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('n', 1), 0);
+ _anim0ActvFl = true;
+ _raoulStatus = 1;
+ _game._player._stepEnabled = false;
+ } else {
+ _scene->_userInterface.setup(kInputLimitedSentences);
+
+ if (_scene->_priorSceneId == 305) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+
+ _game._player._stepEnabled = false;
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('f', 1), 0);
+ _anim1ActvFl = true;
+ _scene->setAnimFrame(_globals._animationIndexes[1], 138);
+
+ } else {
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('f', 1), 0);
+ _anim1ActvFl = true;
+ _phantomStatus = 0;
+
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('r', 1), 0);
+ _anim2ActvFl = true;
+ _fightStatus = 0;
+
+ _game._player._stepEnabled = false;
+ _fightCount = 0;
+
+ _globals[kPlayerScore] += 10;
+
+ _vm->_gameConv->run(23);
+ _vm->_gameConv->hold();
+ }
+ }
+
+
+ if ((_scene->_priorSceneId == RETURNING_FROM_LOADING) && !_globals[kRightDoorIsOpen504]) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], 53);
+ _game._player._stepEnabled = true;
+ }
+
+ _game._player._visible = false;
+
+ sceneEntrySound();
+}
+
+void Scene304::step() {
+ if (_anim0ActvFl)
+ handleRaoulAnimation();
+
+ if (_anim1ActvFl)
+ handlePhantomAnimation();
+
+ if (_anim2ActvFl)
+ handleFightAnimation();
+}
+
+void Scene304::actions() {
+ if (_vm->_gameConv->_running == 23) {
+ handleConversation23();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_THROUGH, NOUN_OPENING) || _action.isAction(VERB_CLIMB, NOUN_CHANDELIER_CABLE)) {
+ _raoulStatus = 0;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(30410);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(30411);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOME)) {
+ _vm->_dialogs->show(30412);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LATTICEWORK)) {
+ _vm->_dialogs->show(30413);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_OPENING)) {
+ _vm->_dialogs->show(30414);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHANDELIER)) {
+ _vm->_dialogs->show(30415);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHANDELIER_CABLE)) {
+ _vm->_dialogs->show(30416);
+ _action._inProgress = false;
+ return;
+ }
+ }
+}
+
+void Scene304::preActions() {
+}
+
+void Scene304::handleConversation23() {
+ switch (_action._activeAction._verbId) {
+ case 5:
+ _phantomStatus = 1;
+ _vm->_gameConv->hold();
+ break;
+
+ case 6:
+ if (_phantomStatus != 1)
+ _fightStatus = 0;
+
+ _vm->_gameConv->hold();
+ break;
+
+ case 9:
+ if (_phantomStatus != 1)
+ _fightStatus = 2;
+
+ break;
+
+ case 12:
+ _phantomStatus = 2;
+ break;
+
+ default:
+ break;
+ }
+
+ _fightCount = 0;
+}
+
+void Scene304::handleRaoulAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _raoulFrame)
+ return;
+
+ _raoulFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_raoulFrame) {
+ case 20:
+ _game._player._stepEnabled = true;
+ resetFrame = 53;
+ break;
+
+ case 53:
+ _scene->_nextSceneId = 303;
+ break;
+
+ case 54:
+ case 55:
+ case 56:
+ if (_raoulStatus == 0) {
+ resetFrame = 20;
+ _game._player._stepEnabled = false;
+ } else {
+ int random = _vm->getRandomNumber(1, 50);
+ switch (_raoulFrame) {
+ case 54:
+ if (random == 1)
+ resetFrame = 54;
+ else if (random == 2)
+ resetFrame = 55;
+ else
+ resetFrame = _raoulFrame - 1;
+
+ break;
+
+ case 55:
+ if (random == 1)
+ resetFrame = 54;
+ else if (random == 2)
+ resetFrame = 53;
+ else
+ resetFrame = _raoulFrame - 1;
+
+ break;
+
+ case 56:
+ if (random == 1)
+ resetFrame = 55;
+ else if (random == 2)
+ resetFrame = 53;
+ else
+ resetFrame = _raoulFrame - 1;
+
+ break;
+
+ default:
+ break;
+ }
+ }
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _raoulFrame = resetFrame;
+ }
+}
+
+void Scene304::handlePhantomAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame() == _phantomFrame)
+ return;
+
+ _phantomFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_phantomFrame) {
+ case 7:
+ case 11:
+ resetFrame = _vm->getRandomNumber(6, 7);
+
+ if (_phantomStatus == 1)
+ resetFrame = 7;
+
+ break;
+
+ case 9:
+ case 15:
+ switch (_vm->getRandomNumber(1, 3)) {
+ case 1:
+ resetFrame = 8;
+ break;
+
+ case 2:
+ resetFrame = 9;
+ break;
+
+ case 3:
+ resetFrame = 11;
+ break;
+ }
+
+ if (_phantomStatus == 1)
+ resetFrame = 11;
+
+ break;
+
+ case 13:
+ case 24:
+ switch (_vm->getRandomNumber(1, 3)) {
+ case 1:
+ resetFrame = 12;
+ break;
+
+ case 2:
+ resetFrame = 13;
+ break;
+
+ case 3:
+ resetFrame = 16;
+ break;
+ }
+
+ if (_phantomStatus == 1)
+ resetFrame = 16;
+
+ break;
+
+ case 20:
+ if (_vm->getRandomNumber(1, 2) == 1)
+ resetFrame = 19;
+ else
+ resetFrame = 20;
+
+ if (_phantomStatus == 1)
+ resetFrame = 24;
+
+ break;
+
+ case 25:
+ _vm->_gameConv->release();
+ break;
+
+ case 47:
+ _fightStatus = 0;
+ break;
+
+ case 59:
+ if (_phantomStatus == 2)
+ resetFrame = 59;
+ else
+ resetFrame = 58;
+ break;
+
+ case 60:
+ _game._player._stepEnabled = false;
+ break;
+
+ case 80:
+ _game._objects.setRoom(OBJ_SWORD, NOWHERE);
+ break;
+
+ case 137:
+ _game._player._playerPos.x = 100;
+ _scene->_nextSceneId = 305;
+ break;
+
+ case 176:
+ _game._player._playerPos.x = 200;
+ _scene->_nextSceneId = 305;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _phantomFrame = resetFrame;
+ }
+}
+
+void Scene304::handleFightAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame() == _fightFrame)
+ return;
+
+ _fightFrame = _scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_fightFrame) {
+ case 22:
+ _vm->_gameConv->release();
+ break;
+
+ case 23:
+ if (_fightStatus != 2)
+ resetFrame = 22;
+ break;
+
+ case 25:
+ case 26:
+ case 27:
+ if (_fightStatus == 2) {
+ resetFrame = _vm->getRandomNumber(24, 26);
+ ++_fightCount;
+ if (_fightCount > 17)
+ resetFrame = 24;
+ }
+ break;
+
+ case 28:
+ _fightStatus = 2;
+ break;
+
+ case 45:
+ _vm->_gameConv->release();
+ break;
+
+ case 46:
+ case 47:
+ case 48:
+ if (_fightStatus == 2) {
+ resetFrame = _vm->getRandomNumber(45, 47);
+ ++_fightCount;
+ if (_fightCount > 17)
+ resetFrame = 45;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[2], resetFrame);
+ _fightFrame = resetFrame;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene305::Scene305(MADSEngine *vm) : Scene3xx(vm) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _skipFl = false;
+ _unmaskFl = false;
+
+ _unmaskFrame = -1;
+}
+
+void Scene305::synchronize(Common::Serializer &s) {
+ Scene3xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_skipFl);
+ s.syncAsByte(_unmaskFl);
+
+ s.syncAsSint16LE(_unmaskFrame);
+}
+
+void Scene305::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene305::enter() {
+ _unmaskFl = false;
+ _skipFl = false;
+ _game._player._visible = false;
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+
+ _scene->_userInterface.setup(kInputLimitedSentences);
+ _scene->loadSpeech(5);
+ _game.loadQuoteSet(0x64, 0x65, 0);
+
+ if (_game._player._playerPos.x == 100) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('r', 1), 60);
+ _scene->_hotspots.activate(NOUN_MASK, false);
+ _anim1ActvFl = true;
+ } else if (_game._player._playerPos.x == 200) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('u', 1), 0);
+ _anim0ActvFl = true;
+ _scene->_hotspots.activate(NOUN_CANE, false);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene305::step() {
+ if (_anim0ActvFl)
+ handle_animation_unmask ();
+
+ if (_anim1ActvFl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 53)
+ _game._player._stepEnabled = false;
+
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 54 && !_skipFl) {
+ _scene->playSpeech(5);
+ _skipFl = true;
+ }
+ }
+
+ if (_game._trigger == 60) {
+ _globals[kPlayerScore] -= 10;
+ _scene->_userInterface.noInventoryAnim();
+ // CHECKME: Not sure about the next function call
+ _scene->_userInterface.refresh();
+ _scene->_nextSceneId = 303;
+ }
+}
+
+void Scene305::actions() {
+ if (_action.isAction(VERB_PUSH, NOUN_CANE)) {
+ _scene->_nextSceneId = 304;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_MASK)) {
+ _unmaskFl = true;
+ _game._player._stepEnabled = false;
+ _action._inProgress = false;
+ }
+}
+
+void Scene305::preActions() {
+}
+
+void Scene305::handle_animation_unmask() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _unmaskFrame)
+ return;
+
+ _unmaskFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_unmaskFrame) {
+ case 25:
+ if (!_unmaskFl)
+ resetFrame = 0;
+
+ break;
+
+ case 60:
+ _scene->playSpeech(10);
+ _scene->_kernelMessages.add(Common::Point(176, 53), 0x1110, 0, 0, 360, _game.getQuote(0x64));
+ _scene->_kernelMessages.add(Common::Point(176, 68), 0x1110, 0, 0, 360, _game.getQuote(0x65));
+ break;
+
+ case 95:
+ _scene->_nextSceneId = 306;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _unmaskFrame = resetFrame;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene306::Scene306(MADSEngine *vm) : Scene3xx(vm) {
+ _speechDoneFl = false;
+}
+
+void Scene306::synchronize(Common::Serializer &s) {
+ Scene3xx::synchronize(s);
+
+ s.syncAsByte(_speechDoneFl);
+}
+
+void Scene306::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene306::enter() {
+ _scene->loadSpeech(6);
+ _speechDoneFl = false;
+
+ warning("TODO: Switch to letter box view. See definition of MADS_MENU_Y");
+
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('a', 1), 60);
+
+ sceneEntrySound();
+}
+
+void Scene306::step() {
+ if (_game._trigger == 60) {
+ if (_vm->_sound->_preferRoland)
+ _scene->_sequences.addTimer(120, 61);
+ else
+ _scene->_sequences.addTimer(300, 61);
+ }
+
+ if (!_speechDoneFl && (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 3)) {
+ _scene->playSpeech(6);
+ _speechDoneFl = true;
+ }
+
+ if (_game._trigger == 61) {
+ _vm->_sound->command(1);
+ _vm->_sound->command(66);
+ _scene->_sequences.addTimer(120, 62);
+ }
+
+ if (_game._trigger == 62)
+ _scene->_nextSceneId = 150;
+}
+
+void Scene306::actions() {
+}
+
+void Scene306::preActions() {
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene307::Scene307(MADSEngine *vm) : Scene3xx(vm) {
+}
+
+void Scene307::synchronize(Common::Serializer &s) {
+ Scene3xx::synchronize(s);
+}
+
+void Scene307::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene307::enter() {
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('p', 0));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites("*RDR_9");
+
+ if (_globals[kRightDoorIsOpen504])
+ _scene->_hotspots.activate(NOUN_DOOR, true);
+ else
+ _scene->_hotspots.activate(NOUN_DOOR, false);
+
+ if (_game._objects.isInRoom(OBJ_GREEN_FRAME) && (_game._difficulty == DIFFICULTY_EASY)) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ } else
+ _scene->_hotspots.activate(NOUN_GREEN_FRAME, false);
+
+ if (_scene->_priorSceneId == 308) {
+ _game._player._playerPos = Common::Point(18, 134);
+ _game._player._facing = FACING_SOUTHEAST;
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, -2);
+ if (!(_globals[kPlayerScoreFlags] & 16)) {
+ _globals[kPlayerScoreFlags] |= 16;
+ _globals[kPlayerScore] += 5;
+ }
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 4);
+ _game._player.walk(Common::Point(41, 137), FACING_EAST);
+ _game._player.setWalkTrigger(60);
+ } else if ((_scene->_priorSceneId == 303) || (_scene->_priorSceneId != RETURNING_FROM_LOADING))
+ _game._player.firstWalk(Common::Point(340, 137), FACING_WEST, Common::Point(304, 137), FACING_WEST, true);
+
+ sceneEntrySound();
+}
+
+void Scene307::step() {
+ switch (_game._trigger) {
+ case 60:
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 10);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 61);
+ break;
+
+ case 61:
+ _vm->_sound->command(25);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene307::actions() {
+ if (_action.isAction(VERB_TAKE, NOUN_GREEN_FRAME) && (_game._objects.isInRoom(OBJ_GREEN_FRAME) || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ if (_globals[kCurrentYear] == 1881) {
+ int count = 0;
+ if (_game._objects.isInInventory(OBJ_YELLOW_FRAME))
+ ++count;
+ if (_game._objects.isInInventory(OBJ_RED_FRAME))
+ ++count;
+ if (_game._objects.isInInventory(OBJ_BLUE_FRAME))
+ ++count;
+
+ if (count < 3)
+ _globals[kPlayerScore] += 5;
+ }
+
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _scene->_hotspots.activate(NOUN_GREEN_FRAME, false);
+ _game._objects.addToInventory(OBJ_GREEN_FRAME);
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[1]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ break;
+
+ case 3:
+ if (_globals[kCurrentYear] == 1881)
+ _vm->_dialogs->showItem(OBJ_GREEN_FRAME, 845, 0);
+ else
+ _vm->_dialogs->showItem(OBJ_GREEN_FRAME, 819, 0);
+
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR) || _action.isAction(VERB_OPEN, NOUN_DOOR)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[4], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 4, 70);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 72);
+ break;
+
+ case 70:
+ _vm->_sound->command(24);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 71);
+ break;
+
+ case 71: {
+ int idx = _globals._sequenceIndexes[3];
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, -2);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[3], SYNC_SEQ, idx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+ _scene->_sequences.addTimer(10, 73);
+ }
+ break;
+
+ case 72:
+ _game._player._visible = true;
+ break;
+
+ case 73:
+ _scene->_nextSceneId = 308;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(30710);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_COLUMN)) {
+ if (_globals[kRightDoorIsOpen504])
+ _vm->_dialogs->show(30725);
+ else
+ _vm->_dialogs->show(30711);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CATWALK)) {
+ _vm->_dialogs->show(30712);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GRID)) {
+ _vm->_dialogs->show(30713);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GIRDER)) {
+ _vm->_dialogs->show(30714);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GRIDWORK)) {
+ _vm->_dialogs->show(30715);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HEMP)) {
+ _vm->_dialogs->show(30716);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BACK_WALL)) {
+ _vm->_dialogs->show(30717);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DUCTWORK)) {
+ _vm->_dialogs->show(30718);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isObject(NOUN_GREEN_FRAME)) && (_game._objects.isInRoom(OBJ_GREEN_FRAME))) {
+ if (_globals[kCurrentYear] == 1993)
+ _vm->_dialogs->show(30719);
+ else
+ _vm->_dialogs->show(30720);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ALCOVE)) {
+ _vm->_dialogs->show(30721);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RAILING)) {
+ _vm->_dialogs->show(30722);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR)) {
+ _vm->_dialogs->show(30726);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_HEMP)) {
+ _vm->_dialogs->show(30723);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_PULL, NOUN_HEMP)) {
+ _vm->_dialogs->show(30141);
+ _action._inProgress = false;
+ }
+}
+
+void Scene307::preActions() {
+ if (_action.isAction(VERB_EXIT_TO, NOUN_ALCOVE))
+ _game._player._walkOffScreenSceneId = 303;
+
+ if (_action.isAction(VERB_OPEN, NOUN_DOOR))
+ _game._player.walk(Common::Point(28, 137), FACING_NORTHWEST);
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene308::Scene308(MADSEngine *vm) : Scene3xx(vm) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ _skip1Fl = false;
+ _skip2Fl = false;
+
+ _currentFloor = -1;
+}
+
+void Scene308::synchronize(Common::Serializer &s) {
+ Scene3xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_anim2ActvFl);
+ s.syncAsByte(_anim3ActvFl);
+ s.syncAsByte(_skip1Fl);
+ s.syncAsByte(_skip2Fl);
+
+ s.syncAsSint16LE(_currentFloor);
+}
+
+void Scene308::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene308::enter() {
+ _scene->loadSpeech(4);
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ }
+
+ _skip1Fl = false;
+ _skip2Fl = false;
+
+ _vm->_gameConv->get(26);
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('a', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('b', 0));
+ _scene->_userInterface.setup(kInputLimitedSentences);
+ _game._player._visible = false;
+
+ if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ switch (_currentFloor) {
+ case 1:
+ if (_globals[kRightDoorIsOpen504]) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], Common::Point(160, 104));
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 10);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(161, 124));
+ } else {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], Common::Point(160, 127));
+ }
+ break;
+
+ case 2:
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], Common::Point(160, 76));
+ break;
+
+ case 3:
+ if (_globals[kRightDoorIsOpen504] && !_globals[kKnockedOverHead]) {
+ _anim0ActvFl = true;
+ _skip1Fl = true;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 2), 2);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 76);
+ } else {
+ _anim0ActvFl = true;
+ _skip1Fl = true;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('u', 2), 2);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 96);
+ }
+ break;
+
+ default:
+ break;
+ }
+ } else if (_scene->_priorSceneId == 309) {
+ _currentFloor = 1;
+ if (_globals[kRightDoorIsOpen504]) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], Common::Point(160, 104));
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 10);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[1], Common::Point(161, 124));
+ } else {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], Common::Point(160, 127));
+ }
+ } else if (_scene->_priorSceneId == 206) {
+ _currentFloor = 2;
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], Common::Point(160, 76));
+ } else if (_scene->_priorSceneId == 307) {
+ _currentFloor = 3;
+ _anim0ActvFl = true;
+ _skip1Fl = true;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('u', 2), 2);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 96);
+ }
+
+ if (!_game._visitedScenes._sceneRevisited) {
+ _globals[kPlayerScore] += 5;
+ _scene->_sequences.addTimer(1, 60);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene308::step() {
+ if (_game._trigger == 60)
+ _vm->_dialogs->show(30810);
+
+ if (_anim2ActvFl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 77) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], 76);
+ if (!_skip1Fl) {
+ _game._player._stepEnabled = true;
+ _vm->_dialogs->show(30811);
+ _skip1Fl = true;
+ }
+ }
+ }
+
+ if (_anim0ActvFl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 97) {
+ if (_globals[kTopFloorLocked]) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], 96);
+ if (!_skip1Fl) {
+ _game._player._stepEnabled = true;
+ _vm->_dialogs->show(30811);
+ _skip1Fl = true;
+ }
+ }
+ } else if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 116) {
+ _globals[kTopFloorLocked] = true;
+ _scene->_nextSceneId = 307;
+ }
+ }
+
+ if (_anim1ActvFl) {
+ if ((_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 51) && _globals[kTopFloorLocked]) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], 50);
+ if (!_skip1Fl) {
+ _game._player._stepEnabled = true;
+ _vm->_dialogs->show(30811);
+ _skip1Fl = true;
+ }
+ }
+ }
+}
+
+void Scene308::actions() {
+ switch (_game._trigger) {
+ case 1:
+ _scene->_nextSceneId = 206;
+ _action._inProgress = false;
+ return;
+
+ case 2:
+ _scene->_nextSceneId = 307;
+ _action._inProgress = false;
+ return;
+
+ case 3:
+ _scene->_nextSceneId = 309;
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_MIDDLE_LEVEL)) {
+ switch (_currentFloor) {
+ case 1:
+ if (_globals[kRightDoorIsOpen504]) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 1), 1);
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _game._player._stepEnabled = false;
+ } else {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('u', 1), 1);
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _game._player._stepEnabled = false;
+ }
+ _action._inProgress = false;
+ return;
+
+ case 2:
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('m', 1), 1);
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _game._player._stepEnabled = false;
+ _action._inProgress = false;
+ return;
+
+ case 3:
+ if (_globals[kRightDoorIsOpen504] && !_globals[kKnockedOverHead]) {
+ _scene->freeAnimation(_globals._animationIndexes[0]);
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 4), 1);
+ _game._player._stepEnabled = false;
+ _anim2ActvFl = false;
+
+ } else {
+ _scene->freeAnimation(_globals._animationIndexes[0]);
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('x', 1), 1);
+ _game._player._stepEnabled = false;
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ }
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_UPPER_LEVEL)) {
+ switch (_currentFloor) {
+ case 1:
+ if (_globals[kRightDoorIsOpen504]) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 2), 1);
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _game._player._stepEnabled = false;
+ _anim2ActvFl = true;
+ _currentFloor = 3;
+ } else {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('u', 2), 2);
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _game._player._stepEnabled = false;
+ _anim0ActvFl = true;
+ _currentFloor = 3;
+ }
+ _action._inProgress = false;
+ return;
+
+ case 2:
+ if (_globals[kRightDoorIsOpen504]) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('u', 3), 2);
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _game._player._stepEnabled = false;
+ } else {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('u', 3), 2);
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _game._player._stepEnabled = false;
+ _anim1ActvFl = true;
+ _currentFloor = 3;
+ }
+ _action._inProgress = false;
+ return;
+
+ case 3:
+ if (_globals[kRightDoorIsOpen504])
+ _globals[kTopFloorLocked] = false;
+ else {
+ _skip2Fl = false;
+ _skip1Fl = false;
+ }
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_LOWER_LEVEL)) {
+ switch (_currentFloor) {
+ case 1:
+ if (_globals[kRightDoorIsOpen504]) {
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(1);
+ } else {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('l', 1), 3);
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _game._player._stepEnabled = false;
+ }
+ _action._inProgress = false;
+ return;
+
+ case 2:
+ if (_globals[kRightDoorIsOpen504]) {
+ if (_vm->_sound->_preferRoland)
+ _vm->_sound->command(74);
+ else
+ _scene->playSpeech(1);
+
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(6);
+
+ } else {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 1), 3);
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _game._player._stepEnabled = false;
+ }
+ _action._inProgress = false;
+ return;
+
+ case 3:
+ if (_globals[kRightDoorIsOpen504] && !_globals[kKnockedOverHead]) {
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(5);
+ } else if (_globals[kRightDoorIsOpen504] && _globals[kKnockedOverHead]) {
+ if (_vm->_sound->_preferRoland)
+ _vm->_sound->command(74);
+ else
+ _scene->playSpeech(1);
+
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(6);
+ } else {
+ _scene->freeAnimation(_globals._animationIndexes[0]);
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('x', 2), 3);
+ _game._player._stepEnabled = false;
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ }
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+ }
+}
+
+void Scene308::preActions() {
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene309::Scene309(MADSEngine *vm) : Scene3xx(vm) {
+ _anim0ActvFl = false;
+
+ _boatStatus = -1;
+ _boatFrame = -1;
+ _talkCount = -1;
+}
+
+void Scene309::synchronize(Common::Serializer &s) {
+ Scene3xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+
+ s.syncAsSint16LE(_boatStatus);
+ s.syncAsSint16LE(_boatFrame);
+ s.syncAsSint16LE(_talkCount);
+}
+
+void Scene309::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if (_globals[kRightDoorIsOpen504])
+ _scene->_variant = 1;
+}
+
+void Scene309::enter() {
+ _scene->_hotspots.activate(NOUN_CHRISTINE, false);
+ _scene->_hotspots.activate(NOUN_BOAT, false);
+
+ _anim0ActvFl = false;
+ _boatStatus = 1;
+ _vm->_gameConv->get(26);
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites("*RDR_9");
+
+ if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+
+ if (_game._visitedScenes.exists(310)) {
+ _anim0ActvFl = true;
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 1), 70);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 184);
+ int id = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots.setPosition(id, Common::Point(62, 146), FACING_NORTHWEST);
+ _scene->_dynamicHotspots[id]._articleNumber = PREP_ON;
+
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 10);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 11);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 12);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 13);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 14);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 15);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 16);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 17);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 18);
+ _scene->_hotspots.activate(NOUN_CHRISTINE, true);
+ _scene->_hotspots.activate(NOUN_BOAT, true);
+ }
+ }
+
+ if (_scene->_priorSceneId == 404) {
+ _game._player._playerPos = Common::Point(319, 136);
+ _game._player._facing = FACING_SOUTHWEST;
+ _game._player.walk(Common::Point(281, 148), FACING_SOUTHWEST);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ } else if (_scene->_priorSceneId == 310) {
+ _game._player._playerPos = Common::Point(209, 144);
+ _game._player._facing = FACING_SOUTH;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _anim0ActvFl = true;
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 1), 70);
+ int id = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots.setPosition(id, Common::Point(63, 146), FACING_NORTHWEST);
+ _scene->_dynamicHotspots[id]._articleNumber = PREP_ON;
+
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 10);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 11);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 12);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 13);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 14);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 15);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 16);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 17);
+ _scene->setDynamicAnim(id, _globals._animationIndexes[0], 18);
+ _scene->_hotspots.activate(NOUN_CHRISTINE, true);
+ _scene->_hotspots.activate(NOUN_BOAT, true);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ } else if ((_scene->_priorSceneId == 308) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(0, 121);
+ _game._player._facing = FACING_SOUTHEAST;
+ _game._player.walk(Common::Point(28, 142), FACING_SOUTHEAST);
+ _game._player.setWalkTrigger(65);
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene309::step() {
+ if (_anim0ActvFl)
+ handleBoatAnimation ();
+
+ switch (_game._trigger) {
+ case 65:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[0], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 66);
+ break;
+
+ case 66:
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 10);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene309::actions() {
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_STONE_ARCHWAY)) {
+ if (_globals[kRightDoorIsOpen504]) {
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(1);
+ _boatStatus = 0;
+ _talkCount = 0;
+ } else if (_globals[kLanternStatus] == 1)
+ _game.enterCatacombs(false);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_CHRISTINE)) {
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(1);
+ _boatStatus = 0;
+ _talkCount = 0;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR) || _action.isAction(VERB_OPEN, NOUN_DOOR)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 4, 60);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 62);
+ break;
+
+ case 60:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 61);
+ _vm->_sound->command(24);
+ break;
+
+ case 61: {
+ int idx = _globals._sequenceIndexes[0];
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 5);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[0], SYNC_SEQ, idx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _game._player.walk(Common::Point(0, 121), FACING_NORTHWEST);
+ _game._player.setWalkTrigger(63);
+ }
+ break;
+
+ case 62:
+ _game._player._visible = true;
+ break;
+
+ case 63:
+ if (!_globals[kRightDoorIsOpen504]) {
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[0], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 64);
+ _vm->_sound->command(25);
+ } else
+ _scene->setAnimFrame(_globals._animationIndexes[0], 186);
+
+ break;
+
+ case 64:
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 1);
+ _scene->_nextSceneId = 308;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(30910);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_STONE_WALL)) {
+ _vm->_dialogs->show(30911);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LAKE)) {
+ _vm->_dialogs->show(30912);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STONE_COLUMN)) {
+ _vm->_dialogs->show(30913);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOORWAY)) {
+ _vm->_dialogs->show(30914);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STONE_ARCHWAY)) {
+ _vm->_dialogs->show(30915);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STONE_FLOOR)) {
+ _vm->_dialogs->show(30916);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CATACOMBS)) {
+ _vm->_dialogs->show(30917);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHRISTINE)) {
+ _vm->_dialogs->show(30919);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOAT)) {
+ _vm->_dialogs->show(30921);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_CLIMB_INTO, NOUN_BOAT)) {
+ _vm->_dialogs->show(30920);
+ _action._inProgress = false;
+ }
+}
+
+void Scene309::preActions() {
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_STONE_ARCHWAY) && (_globals[kLanternStatus] == 0)) {
+ _game._player._needToWalk = false;
+ _vm->_dialogs->show(30918);
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_STONE_ARCHWAY) && _globals[kRightDoorIsOpen504])
+ _game._player.walk(Common::Point(285, 147), FACING_NORTHEAST);
+
+ if (_action.isAction(VERB_OPEN, NOUN_DOOR))
+ _game._player.walk(Common::Point(16, 139), FACING_NORTHEAST);
+}
+
+void Scene309::handleBoatAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _boatFrame)
+ return;
+
+ _boatFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int resetFrame = -1;
+
+ switch (_boatFrame) {
+ case 72:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _game._player._visible = true;
+ break;
+
+ case 130:
+ _game._player._stepEnabled = true;
+ break;
+
+ case 185:
+ if (_boatStatus == 0)
+ resetFrame = 244;
+ else
+ resetFrame = 184;
+
+ break;
+
+ case 244:
+ _scene->_nextSceneId = 308;
+ break;
+
+ case 245:
+ case 246:
+ case 247:
+ resetFrame = _vm->getRandomNumber(244, 246);
+ ++_talkCount;
+ if (_talkCount > 10) {
+ resetFrame = 184;
+ _boatStatus = 1;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _boatFrame = resetFrame;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene310::Scene310(MADSEngine *vm) : Scene3xx(vm) {
+ _raoulMessageColor = -1;
+ _chrisMessageColor = -1;
+ _lakeFrame = -1;
+ for (int i = 0; i < 4; i++)
+ _multiplanePosX[i] = -1;
+}
+
+void Scene310::synchronize(Common::Serializer &s) {
+ Scene3xx::synchronize(s);
+
+ s.syncAsSint16LE(_raoulMessageColor);
+ s.syncAsSint16LE(_chrisMessageColor);
+ s.syncAsSint16LE(_lakeFrame);
+ for (int i = 0; i < 4; i++)
+ s.syncAsSint16LE(_multiplanePosX[i]);
+}
+
+void Scene310::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene310::enter() {
+ warning("TODO: Switch to letter box view. See definition of MADS_MENU_Y");
+
+ for (int i = 0; i < 4; i++) {
+ _globals._spriteIndexes[i] = _scene->_sprites.addSprites(formAnimName('f', i));
+ _globals._sequenceIndexes[i] = -1;
+ }
+
+ _multiplanePosX[0] = 100;
+ _multiplanePosX[1] = 210;
+ _multiplanePosX[2] = 320;
+ _multiplanePosX[3] = 472;
+
+ _game.loadQuoteSet(0x66, 0x67, 0x69, 0x6A, 0x6C, 0x6D, 0x6E, 0x6F, 0x71, 0x72, 0x74, 0x70, 0x68, 0x73, 0x6B, 0);
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('l', 1), 80);
+ _scene->_animation[_globals._animationIndexes[0]]->_canChangeView = true;
+ _game._camX._manualFl = true;
+
+ _raoulMessageColor = 0x102;
+ _chrisMessageColor = 0x1110;
+
+ _scene->_userInterface.emptyConversationList();
+ _scene->_userInterface.setup(kInputConversation);
+
+ sceneEntrySound();
+}
+
+void Scene310::step() {
+ handleLakeAnimation();
+
+ if (_game._trigger == 80)
+ _scene->_nextSceneId = 309;
+
+ bool positionsSetFl = false;
+
+ if (_globals._animationIndexes[0] >= 0) {
+ MADS::Animation *anim = _scene->_animation[_globals._animationIndexes[0]];
+ int curFrame = anim->getCurrentFrame();
+ uint32 clock = anim->getNextFrameTimer();
+ if ((curFrame > 0) && (_scene->_frameStartTime >= clock)) {
+ Common::Point pos = anim->getFramePosAdjust(curFrame);
+ if (pos.x != _scene->_posAdjust.x) {
+ setMultiplanePos(pos.x);
+ positionsSetFl = true;
+ }
+ }
+ }
+
+ if (!positionsSetFl && (_game._fx != kTransitionNone))
+ setMultiplanePos(320);
+}
+
+void Scene310::actions() {
+}
+
+void Scene310::preActions() {
+}
+
+void Scene310::setMultiplanePos(int x_new) {
+ int center = x_new + 160;
+
+ for (int i = 0; i < 4; i++) {
+ if (_globals._sequenceIndexes[i] >= 0)
+ _scene->deleteSequence(_globals._sequenceIndexes[i]);
+
+ int difference = center - _multiplanePosX[i];
+
+ int direction = 0;
+ if (difference < 0)
+ direction = 1;
+ else if (difference > 0)
+ direction = -1;
+
+ int displace = abs(difference);
+ if (direction < 0)
+ displace = -displace;
+
+ int x = _multiplanePosX[i] + displace - 1;
+ int y = _scene->_sprites[_globals._spriteIndexes[i]]->getFrameWidth(0) + 29;
+ int halfWidth = 1 + (_scene->_sprites[_globals._spriteIndexes[i]]->getFrameHeight(0) / 2);
+
+ if (((x - halfWidth) >= (x_new + 320)) || ((x + halfWidth) < x_new))
+ _globals._sequenceIndexes[i] = -1;
+ else {
+ _globals._sequenceIndexes[i] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[i], false, 1);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[i], Common::Point(x, y));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[i], 1);
+ }
+ }
+}
+
+void Scene310::handleLakeAnimation() {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == _lakeFrame)
+ return;
+
+ _lakeFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ int id;
+
+ switch (_lakeFrame) {
+ case 60:
+ id = _scene->_kernelMessages.add(Common::Point(-142, 0), _chrisMessageColor, 0, 61, 600, _game.getQuote(0x66));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ id = _scene->_kernelMessages.add(Common::Point(-142, 15), _chrisMessageColor, 0, 0, 600, _game.getQuote(0x67));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ id = _scene->_kernelMessages.add(Common::Point(-142, 30), _chrisMessageColor, 0, 0, 600, _game.getQuote(0x68));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ break;
+
+ case 120:
+ _scene->_kernelMessages.reset();
+ break;
+
+ case 140:
+ id = _scene->_kernelMessages.add(Common::Point(-120, 0), _chrisMessageColor, 0, 63, 360, _game.getQuote(0x69));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ id = _scene->_kernelMessages.add(Common::Point(-120, 15), _chrisMessageColor, 0, 0, 360, _game.getQuote(0x6A));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ id = _scene->_kernelMessages.add(Common::Point(-120, 30), _chrisMessageColor, 0, 0, 360, _game.getQuote(0x6B));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ break;
+
+ case 200:
+ _scene->_kernelMessages.reset();
+ break;
+
+ case 220:
+ id = _scene->_kernelMessages.add(Common::Point(-32, 30), _chrisMessageColor, 0, 65, 240, _game.getQuote(0x6C));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ id = _scene->_kernelMessages.add(Common::Point(-32, 45), _chrisMessageColor, 0, 0, 240, _game.getQuote(0x6D));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ break;
+
+ case 280:
+ _scene->_kernelMessages.reset();
+ break;
+
+ case 300:
+ id = _scene->_kernelMessages.add(Common::Point(101, 0), _raoulMessageColor, 0, 67, 360, _game.getQuote(0x6E));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ id = _scene->_kernelMessages.add(Common::Point(101, 15), _raoulMessageColor, 0, 0, 360, _game.getQuote(0x6F));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ id = _scene->_kernelMessages.add(Common::Point(101, 30), _raoulMessageColor, 0, 0, 360, _game.getQuote(0x70));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ break;
+
+ case 360:
+ _scene->_kernelMessages.reset();
+ break;
+
+ case 380:
+ id = _scene->_kernelMessages.add(Common::Point(107, 0), _chrisMessageColor, 0, 69, 360, _game.getQuote(0x71));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ id = _scene->_kernelMessages.add(Common::Point(107, 15), _chrisMessageColor, 0, 0, 360, _game.getQuote(0x72));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ id = _scene->_kernelMessages.add(Common::Point(107, 30), _chrisMessageColor, 0, 0, 360, _game.getQuote(0x73));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ break;
+
+ case 440:
+ _scene->_kernelMessages.reset();
+ break;
+
+ case 460:
+ id = _scene->_kernelMessages.add(Common::Point(107, 7), _chrisMessageColor, 0, 0, 180, _game.getQuote(0x74));
+ _scene->_kernelMessages.setAnim(id, _globals._animationIndexes[0], 0);
+ break;
+
+ case 510:
+ _scene->_kernelMessages.reset();
+ break;
+
+ default:
+ break;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+} // End of namespace Phantom
+} // End of namespace MADS
diff --git a/engines/mads/phantom/phantom_scenes3.h b/engines/mads/phantom/phantom_scenes3.h
new file mode 100644
index 0000000000..9f58ad12bf
--- /dev/null
+++ b/engines/mads/phantom/phantom_scenes3.h
@@ -0,0 +1,248 @@
+/* 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.
+ *
+ */
+
+#ifndef MADS_PHANTOM_SCENES3_H
+#define MADS_PHANTOM_SCENES3_H
+
+#include "common/scummsys.h"
+#include "common/serializer.h"
+#include "mads/game.h"
+#include "mads/scene.h"
+#include "mads/phantom/phantom_scenes.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+class Scene3xx : public PhantomScene {
+protected:
+ /**
+ * Plays an appropriate sound when entering a scene
+ */
+ void sceneEntrySound();
+
+ /**
+ *Sets the AA file to use for the scene
+ */
+ void setAAName();
+
+ /**
+ * Updates the prefix used for getting player sprites for the scene
+ */
+ void setPlayerSpritesPrefix();
+public:
+ Scene3xx(MADSEngine *vm) : PhantomScene(vm) {}
+};
+
+class Scene301 : public Scene3xx {
+private:
+ bool _anim0ActvFl;
+ bool _skip1Fl;
+ bool _skip2Fl;
+
+ int _lightingHotspotId;
+ int _sandbagHotspotId;
+
+public:
+ Scene301(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene302 : public Scene3xx {
+public:
+ Scene302(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene303 : public Scene3xx {
+private:
+ bool _anim0ActvFl;
+ int _hempHotspotId;
+ int _skipFrameCheckFl;
+public:
+ Scene303(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene304 : public Scene3xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _anim2ActvFl;
+
+ int _raoulFrame;
+ int _raoulStatus;
+ int _fightFrame;
+ int _fightStatus;
+ int _fightCount;
+ int _phantomFrame;
+ int _phantomStatus;
+
+ void handleConversation23();
+ void handleRaoulAnimation();
+ void handlePhantomAnimation();
+ void handleFightAnimation();
+
+public:
+ Scene304(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene305 : public Scene3xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _skipFl;
+ bool _unmaskFl;
+
+ int _unmaskFrame;
+
+ void handle_animation_unmask();
+
+public:
+ Scene305(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene306 : public Scene3xx {
+private:
+ bool _speechDoneFl;
+
+public:
+ Scene306(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene307 : public Scene3xx {
+public:
+ Scene307(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene308 : public Scene3xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _anim2ActvFl;
+ bool _anim3ActvFl;
+ bool _skip1Fl;
+ bool _skip2Fl;
+ int _currentFloor;
+
+public:
+ Scene308(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene309 : public Scene3xx {
+private:
+ bool _anim0ActvFl;
+
+ int _boatStatus;
+ int _boatFrame;
+ int _talkCount;
+
+ void handleBoatAnimation();
+
+public:
+ Scene309(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene310 : public Scene3xx {
+private:
+ int _raoulMessageColor;
+ int _chrisMessageColor;
+ int _multiplanePosX[4];
+ int _lakeFrame;
+
+ void setMultiplanePos(int x_new);
+ void handleLakeAnimation();
+
+public:
+ Scene310(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+} // End of namespace Phantom
+} // End of namespace MADS
+
+#endif /* MADS_PHANTOM_SCENES3_H */
diff --git a/engines/mads/phantom/phantom_scenes4.cpp b/engines/mads/phantom/phantom_scenes4.cpp
new file mode 100644
index 0000000000..da6d62e727
--- /dev/null
+++ b/engines/mads/phantom/phantom_scenes4.cpp
@@ -0,0 +1,4975 @@
+/* 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.
+ *
+ */
+
+#include "common/scummsys.h"
+#include "mads/mads.h"
+#include "mads/conversations.h"
+#include "mads/scene.h"
+#include "mads/phantom/phantom_scenes.h"
+#include "mads/phantom/phantom_scenes4.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+void Scene4xx::setAAName() {
+ _game._aaName = Resources::formatAAName(1);
+ _vm->_palette->setEntry(254, 43, 47, 51);
+}
+
+void Scene4xx::sceneEntrySound() {
+ if (!_vm->_musicFlag)
+ return;
+
+ _vm->_sound->command(16);
+}
+
+void Scene4xx::setPlayerSpritesPrefix() {
+ _vm->_sound->command(5);
+
+ Common::String oldName = _game._player._spritesPrefix;
+ if (!_game._player._forcePrefix)
+ _game._player._spritesPrefix = "RAL";
+ if (oldName != _game._player._spritesPrefix)
+ _game._player._spritesChanged = true;
+
+ _game._player._scalingVelocity = true;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene401::Scene401(MADSEngine *vm) : Scene4xx(vm) {
+ _anim0ActvFl = false;
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ _redFrameHotspotId = -1;
+ _greenFrameHostpotId = -1;
+ _blueFrameHotspotId = -1;
+ _yellowFrameHotspotId = -1;
+}
+
+void Scene401::synchronize(Common::Serializer &s) {
+ Scene4xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_frameInRoomFl);
+ s.syncAsByte(_takingFrameInRoomFl);
+
+ s.syncAsSint16LE(_redFrameHotspotId);
+ s.syncAsSint16LE(_greenFrameHostpotId);
+ s.syncAsSint16LE(_blueFrameHotspotId);
+ s.syncAsSint16LE(_yellowFrameHotspotId);
+}
+
+void Scene401::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_PUDDLE)
+ _scene->_variant = 1;
+
+ _scene->addActiveVocab(NOUN_RED_FRAME);
+ _scene->addActiveVocab(NOUN_YELLOW_FRAME);
+ _scene->addActiveVocab(NOUN_BLUE_FRAME);
+ _scene->addActiveVocab(NOUN_GREEN_FRAME);
+}
+
+void Scene401::enter() {
+ _game.initCatacombs();
+ _anim0ActvFl = false;
+
+ _scene->_hotspots.activate(NOUN_PUDDLE, false);
+ _scene->_hotspots.activate(NOUN_RATS_NEST, false);
+ _scene->_hotspots.activate(NOUN_SKULL, false);
+ _scene->_hotspots.activate(NOUN_POT, false);
+
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[9] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[10] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ _globals._spriteIndexes[11] = _scene->_sprites.addSprites(formAnimName('f', 2));
+ _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('f', 3));
+
+ if (_game.exitCatacombs(0) == -1) {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('c', 1));
+ _scene->drawToBackground(_globals._spriteIndexes[1], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_NORTH, false);
+ }
+
+ if (_game.exitCatacombs(3) == -1) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('c', 0));
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_WEST, false);
+ }
+
+ if (_game.exitCatacombs(1) == -1) {
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('c', 2));
+ _scene->drawToBackground(_globals._spriteIndexes[2], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_EAST, false);
+ }
+
+ if (_game.exitCatacombs(2) == -1)
+ _scene->_hotspots.activate(NOUN_MORE_CATACOMBS, false);
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_RAT_NEST) {
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('c', 4));
+ _scene->drawToBackground(_globals._spriteIndexes[4], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_RATS_NEST, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_SKULL) {
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('c', 5));
+ _scene->drawToBackground(_globals._spriteIndexes[5], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_SKULL, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_POT) {
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('c', 6));
+ _scene->drawToBackground(_globals._spriteIndexes[6], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_POT, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_BRICK) {
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('c', 7));
+ _scene->drawToBackground(_globals._spriteIndexes[7], 1, Common::Point(-32000, -32000), 0, 100);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_PUDDLE) {
+ _scene->_hotspots.activate(NOUN_PUDDLE, true);
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 1), 0);
+ _anim0ActvFl = true;
+ }
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ switch (_globals[kCatacombsFrom]) {
+ case 0:
+ _game._player._playerPos = Common::Point(128, 78);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(128, 91), FACING_SOUTH);
+ break;
+
+ case 1:
+ _game._player._playerPos = Common::Point(311, 115);
+ _game._player._facing = FACING_WEST;
+ _game._player.walk(Common::Point(271, 123), FACING_WEST);
+ break;
+
+ case 2:
+ _game._player._playerPos = Common::Point(142, 146);
+ _game._player._facing = FACING_NORTH;
+ break;
+
+ case 3:
+ _game._player._playerPos = Common::Point(4, 113);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(48, 113), FACING_EAST);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _greenFrameHostpotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHostpotId , Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene401::step() {
+ if (_anim0ActvFl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 20)
+ _scene->setAnimFrame(_globals._animationIndexes[0], 0);
+ }
+}
+
+void Scene401::actions() {
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)) {
+ if (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME)) {
+ if (_frameInRoomFl)
+ _vm->_dialogs->show(29);
+ else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _game._objects.setRoom(OBJ_RED_FRAME, NOWHERE);
+ _game._objects[OBJ_RED_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _game._objects.setRoom(OBJ_GREEN_FRAME, NOWHERE);
+ _game._objects[OBJ_GREEN_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _greenFrameHostpotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHostpotId , Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _game._objects.setRoom(OBJ_BLUE_FRAME, NOWHERE);
+ _game._objects[OBJ_BLUE_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _game._objects.setRoom(OBJ_YELLOW_FRAME, NOWHERE);
+ _game._objects[OBJ_YELLOW_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE)) {
+ if (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_GREEN_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME)) {
+ if ((_takingFrameInRoomFl || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[9]);
+ _scene->_dynamicHotspots.remove(_redFrameHotspotId);
+ _game._objects.addToInventory(OBJ_RED_FRAME);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[10]);
+ _scene->_dynamicHotspots.remove(_greenFrameHostpotId );
+ _game._objects.addToInventory(OBJ_GREEN_FRAME);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[11]);
+ _scene->_dynamicHotspots.remove(_blueFrameHotspotId);
+ _game._objects.addToInventory(OBJ_BLUE_FRAME);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[12]);
+ _scene->_dynamicHotspots.remove(_yellowFrameHotspotId);
+ _game._objects.addToInventory(OBJ_YELLOW_FRAME);
+ }
+
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_NORTH)) {
+ _game.moveCatacombs(0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_WEST)) {
+ _game.moveCatacombs(3);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_MORE_CATACOMBS)) {
+ _game.moveCatacombs(2);
+ if ((_game._difficulty == DIFFICULTY_HARD) && (_globals[kCatacombsRoom] == 31))
+ _globals[kPriestPistonPuke] = true;
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_EAST)) {
+ _game.moveCatacombs(1);
+ if ((_game._difficulty == DIFFICULTY_EASY) && (_globals[kCatacombsRoom] == 24))
+ _globals[kPriestPistonPuke] = true;
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(40110);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(40111);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(40112);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ARCHWAY)) {
+ _vm->_dialogs->show(40113);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_EXPOSED_BRICK)) {
+ _vm->_dialogs->show(40114);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MORE_CATACOMBS)) {
+ _vm->_dialogs->show(40115);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLOCKED_ARCHWAY)) {
+ _vm->_dialogs->show(40116);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PUDDLE)) {
+ _vm->_dialogs->show(40117);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RATS_NEST)) {
+ _vm->_dialogs->show(40118);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SKULL)) {
+ _vm->_dialogs->show(40120);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RED_FRAME) && !_game._objects.isInInventory(OBJ_RED_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_RED_FRAME, 802, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME) && !_game._objects.isInInventory(OBJ_GREEN_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_GREEN_FRAME, 819, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME) && !_game._objects.isInInventory(OBJ_BLUE_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_BLUE_FRAME, 817, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME) && !_game._objects.isInInventory(OBJ_YELLOW_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_YELLOW_FRAME, 804, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+
+ if (_action.isObject(NOUN_BROKEN_POT)) {
+ _vm->_dialogs->show(40122);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_RATS_NEST)) {
+ _vm->_dialogs->show(40119);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_SKULL)) {
+ _vm->_dialogs->show(40121);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_BROKEN_POT)) {
+ _vm->_dialogs->show(40123);
+ _action._inProgress = false;
+ }
+}
+
+void Scene401::preActions() {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_RED_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_YELLOW_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_BLUE_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_GREEN_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME)
+ || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _game._player._needToWalk = false;
+ else {
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _game._player.walk(Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene403::Scene403(MADSEngine *vm) : Scene4xx(vm) {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ _redFrameHotspotId = -1;
+ _greenFrameHostpotId = -1;
+ _blueFrameHotspotId = -1;
+ _yellowFrameHotspotId = -1;
+}
+
+void Scene403::synchronize(Common::Serializer &s) {
+ Scene4xx::synchronize(s);
+
+ s.syncAsByte(_frameInRoomFl);
+ s.syncAsByte(_takingFrameInRoomFl);
+
+ s.syncAsSint16LE(_redFrameHotspotId);
+ s.syncAsSint16LE(_greenFrameHostpotId);
+ s.syncAsSint16LE(_blueFrameHotspotId);
+ s.syncAsSint16LE(_yellowFrameHotspotId);
+}
+
+void Scene403::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_HOLE)
+ _scene->_variant = 1;
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_PLANK)
+ _scene->_variant = 2;
+
+ _scene->addActiveVocab(NOUN_RED_FRAME);
+ _scene->addActiveVocab(NOUN_YELLOW_FRAME);
+ _scene->addActiveVocab(NOUN_BLUE_FRAME);
+ _scene->addActiveVocab(NOUN_GREEN_FRAME);
+}
+
+void Scene403::enter() {
+ _game.initCatacombs();
+
+ _scene->_hotspots.activate(NOUN_HOLE, false);
+ _scene->_hotspots.activate(NOUN_WEB, false);
+ _scene->_hotspots.activate(NOUN_RATS_NEST, false);
+ _scene->_hotspots.activate(NOUN_SKULL, false);
+ _scene->_hotspots.activate(NOUN_PLANK, false);
+ _scene->_hotspots.activate(NOUN_GATE, false);
+
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[9] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[10] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ _globals._spriteIndexes[11] = _scene->_sprites.addSprites(formAnimName('f', 2));
+ _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('f', 3));
+
+ if (_game.exitCatacombs(0) == -1) {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('c', 1));
+ _scene->drawToBackground(_globals._spriteIndexes[1], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_NORTH, false);
+ }
+
+ if (_game.exitCatacombs(3) == -1) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('c', 0));
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_WEST, false);
+ }
+
+ if (_game.exitCatacombs(1) == -1) {
+ _scene->_hotspots.activate(NOUN_MORE_CATACOMBS, false);
+ _scene->_hotspots.activate(NOUN_GATE, true);
+ _globals._spriteIndexes[13] = _scene->_sprites.addSprites(formAnimName('c', 9));
+ _scene->drawToBackground(_globals._spriteIndexes[13], 1, Common::Point(-32000, -32000), 0, 100);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_HOLE) {
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('c', 3));
+ _scene->drawToBackground(_globals._spriteIndexes[2], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_HOLE, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_WEB) {
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('c', 4));
+ _scene->drawToBackground(_globals._spriteIndexes[3], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_WEB, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_BRICK) {
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('c', 5));
+ _scene->drawToBackground(_globals._spriteIndexes[4], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activateAtPos(NOUN_EXPOSED_BRICK, false, Common::Point(178, 35));
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_RAT_NEST) {
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('c', 6));
+ _scene->drawToBackground(_globals._spriteIndexes[5], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_RATS_NEST, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_SKULL) {
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('c', 7));
+ _scene->drawToBackground(_globals._spriteIndexes[6], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_SKULL, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_PLANK) {
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('c', 8));
+ _scene->drawToBackground(_globals._spriteIndexes[7], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_PLANK, true);
+ }
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ switch (_globals[kCatacombsFrom]) {
+ case 0:
+ _game._player._playerPos = Common::Point(212, 86);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(212, 100), FACING_SOUTH);
+ break;
+
+ case 1:
+ _game._player.firstWalk(Common::Point(330, 126), FACING_EAST, Common::Point(305, 126), FACING_WEST, true);
+ break;
+
+ case 3:
+ _game._player._playerPos = Common::Point(3, 128);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(40, 128), FACING_EAST);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _greenFrameHostpotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHostpotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if ((_game._difficulty == DIFFICULTY_EASY) && (_globals[kCatacombsRoom] == 19))
+ _scene->_sequences.addTimer(120, 60);
+
+ sceneEntrySound();
+}
+
+void Scene403::step() {
+ if (_game._trigger == 60)
+ _vm->_dialogs->show(31);
+}
+
+void Scene403::actions() {
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _vm->_dialogs->show(29);
+ else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _game._objects.setRoom(OBJ_RED_FRAME, NOWHERE);
+ _game._objects[OBJ_RED_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _game._objects.setRoom(OBJ_GREEN_FRAME, NOWHERE);
+ _game._objects[OBJ_GREEN_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _greenFrameHostpotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHostpotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _game._objects.setRoom(OBJ_BLUE_FRAME, NOWHERE);
+ _game._objects[OBJ_BLUE_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _game._objects.setRoom(OBJ_YELLOW_FRAME, NOWHERE);
+ _game._objects[OBJ_YELLOW_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_GREEN_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME))) {
+ if ((_takingFrameInRoomFl || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[9]);
+ _scene->_dynamicHotspots.remove(_redFrameHotspotId);
+ _game._objects.addToInventory(OBJ_RED_FRAME);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[10]);
+ _scene->_dynamicHotspots.remove(_greenFrameHostpotId);
+ _game._objects.addToInventory(OBJ_GREEN_FRAME);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[11]);
+ _scene->_dynamicHotspots.remove(_blueFrameHotspotId);
+ _game._objects.addToInventory(OBJ_BLUE_FRAME);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[12]);
+ _scene->_dynamicHotspots.remove(_yellowFrameHotspotId);
+ _game._objects.addToInventory(OBJ_YELLOW_FRAME);
+ }
+
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_NORTH)) {
+ _game.moveCatacombs(0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_WEST)) {
+ _game.moveCatacombs(3);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(40310);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(40311);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(40312);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ARCHWAY)) {
+ _vm->_dialogs->show(40313);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_EXPOSED_BRICK)) {
+ _vm->_dialogs->show(40314);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MORE_CATACOMBS)) {
+ _vm->_dialogs->show(40315);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLOCKED_ARCHWAY)) {
+ _vm->_dialogs->show(40316);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RATS_NEST)) {
+ _vm->_dialogs->show(40318);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SKULL)) {
+ _vm->_dialogs->show(40320);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HOLE)) {
+ _vm->_dialogs->show(40323);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WEB)) {
+ _vm->_dialogs->show(40324);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RED_FRAME) && !_game._objects.isInInventory(OBJ_RED_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_RED_FRAME, 802, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME) && !_game._objects.isInInventory(OBJ_GREEN_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_GREEN_FRAME, 819, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME) && !_game._objects.isInInventory(OBJ_BLUE_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_BLUE_FRAME, 817, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME) && !_game._objects.isInInventory(OBJ_YELLOW_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_YELLOW_FRAME, 804, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GATE)) {
+ _vm->_dialogs->show(45330);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PLANK)) {
+ _vm->_dialogs->show(40325);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_GATE)) {
+ _vm->_dialogs->show(45331);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_RATS_NEST)) {
+ _vm->_dialogs->show(40319);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_SKULL)) {
+ _vm->_dialogs->show(40321);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_PLANK)) {
+ _vm->_dialogs->show(40326);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene403::preActions() {
+ if (_action.isAction(VERB_EXIT_TO, NOUN_MORE_CATACOMBS))
+ _game.moveCatacombs(1);
+
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_RED_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_YELLOW_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_BLUE_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_GREEN_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _game._player._needToWalk = false;
+ else {
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _game._player.walk(Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene404::Scene404(MADSEngine *vm) : Scene4xx(vm) {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+ _anim0ActvFl = false;
+
+ _redFrameHotspotId = -1;
+ _greenFrameHostpotId = -1;
+ _blueFrameHotspotId = -1;
+ _yellowFrameHotspotId = -1;
+}
+
+void Scene404::synchronize(Common::Serializer &s) {
+ Scene4xx::synchronize(s);
+
+ s.syncAsByte(_frameInRoomFl);
+ s.syncAsByte(_takingFrameInRoomFl);
+ s.syncAsByte(_anim0ActvFl);
+
+ s.syncAsSint16LE(_redFrameHotspotId);
+ s.syncAsSint16LE(_greenFrameHostpotId);
+ s.syncAsSint16LE(_blueFrameHotspotId);
+ s.syncAsSint16LE(_yellowFrameHotspotId);
+}
+
+void Scene404::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_BLOCK)
+ _scene->_variant = 1;
+
+ _scene->addActiveVocab(NOUN_RED_FRAME);
+ _scene->addActiveVocab(NOUN_YELLOW_FRAME);
+ _scene->addActiveVocab(NOUN_BLUE_FRAME);
+ _scene->addActiveVocab(NOUN_GREEN_FRAME);
+}
+
+void Scene404::enter() {
+ _game.initCatacombs();
+
+ _scene->_hotspots.activate(NOUN_RATS_NEST, false);
+ _scene->_hotspots.activate(NOUN_WEB, false);
+ _scene->_hotspots.activate(NOUN_BROKEN_POT, false);
+ _scene->_hotspots.activate(NOUN_BLOCK, false);
+ _scene->_hotspots.activate(NOUN_PUDDLE, false);
+
+ _anim0ActvFl = false;
+
+ _globals._spriteIndexes[9] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[10] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[11] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('f', 2));
+ _globals._spriteIndexes[13] = _scene->_sprites.addSprites(formAnimName('f', 3));
+
+
+ if (_game.exitCatacombs(0) == -1) {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('c', 1));
+ _scene->drawToBackground(_globals._spriteIndexes[1], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_NORTH, false);
+ }
+
+ if (_game.exitCatacombs(3) == -1) {
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('c', 0));
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_WEST, false);
+ }
+
+ if (_game.exitCatacombs(1) == -1) {
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('c', 2));
+ _scene->drawToBackground(_globals._spriteIndexes[2], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_EAST, false);
+ }
+
+ if (_game.exitCatacombs(2) == -1)
+ _scene->_hotspots.activate(NOUN_MORE_CATACOMBS, false);
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_RAT_NEST) {
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('c', 3));
+ _scene->drawToBackground(_globals._spriteIndexes[3], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_RATS_NEST, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_WEB) {
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('c', 4));
+ _scene->drawToBackground(_globals._spriteIndexes[4], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_WEB, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_POT) {
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('c', 5));
+ _scene->drawToBackground(_globals._spriteIndexes[5], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_BROKEN_POT, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_BLOCK) {
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('c', 7));
+ _scene->drawToBackground(_globals._spriteIndexes[7], 1, Common::Point(-32000, -32000), 0, 100);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_FALLEN_BLOCK) {
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('c', 8));
+ _scene->drawToBackground(_globals._spriteIndexes[8], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_BLOCK, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_PUDDLE) {
+ _scene->_hotspots.activate(NOUN_PUDDLE, true);
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('d', 1), 0);
+ _anim0ActvFl = true;
+ }
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ switch (_globals[kCatacombsFrom]) {
+ case 0:
+ _game._player._playerPos = Common::Point(156, 98);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(156, 117), FACING_SOUTH);
+ break;
+
+ case 1:
+ _game._player._playerPos = Common::Point(319, 135);
+ _game._player._facing = FACING_WEST;
+ _game._player.walk(Common::Point(279, 135), FACING_WEST);
+ break;
+
+ case 2:
+ _game._player._playerPos = Common::Point(175, 147);
+ _game._player._facing = FACING_NORTH;
+ break;
+
+ case 3:
+ _game._player._playerPos = Common::Point(17, 131);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(60, 131), FACING_EAST);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 14);
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[10]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[10]]->getFramePos(0);
+ _greenFrameHostpotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHostpotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[10]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[13] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[13], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[13], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[10]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_globals[kPriestPistonPuke])
+ _scene->_sequences.addTimer(120, 60);
+
+ sceneEntrySound();
+}
+
+void Scene404::step() {
+ if (_anim0ActvFl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 20)
+ _scene->setAnimFrame(_globals._animationIndexes[0], 0);
+ }
+
+ if (_game._trigger == 60) {
+ _vm->_dialogs->show(30);
+ _globals[kPriestPistonPuke] = false;
+ }
+}
+
+void Scene404::actions() {
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _vm->_dialogs->show(29);
+ else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[9] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[9], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[9], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[9], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[9], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[9], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _game._objects.setRoom(OBJ_RED_FRAME, NOWHERE);
+ _game._objects[OBJ_RED_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[10]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _game._objects.setRoom(OBJ_GREEN_FRAME, NOWHERE);
+ _game._objects[OBJ_GREEN_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[10]]->getFramePos(0);
+ _greenFrameHostpotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHostpotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _game._objects.setRoom(OBJ_BLUE_FRAME, NOWHERE);
+ _game._objects[OBJ_BLUE_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[10]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _game._objects.setRoom(OBJ_YELLOW_FRAME, NOWHERE);
+ _game._objects[OBJ_YELLOW_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[13] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[13], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[13], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[10]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[9]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE)) {
+ if ((_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_GREEN_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME)) && (_takingFrameInRoomFl || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[9] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[9], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[9], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[9], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[9], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[9], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[10]);
+ _scene->_dynamicHotspots.remove(_redFrameHotspotId);
+ _game._objects.addToInventory(OBJ_RED_FRAME);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[11]);
+ _scene->_dynamicHotspots.remove(_greenFrameHostpotId);
+ _game._objects.addToInventory(OBJ_GREEN_FRAME);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[12]);
+ _scene->_dynamicHotspots.remove(_blueFrameHotspotId);
+ _game._objects.addToInventory(OBJ_BLUE_FRAME);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[13]);
+ _scene->_dynamicHotspots.remove(_yellowFrameHotspotId);
+ _game._objects.addToInventory(OBJ_YELLOW_FRAME);
+ }
+
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[9]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_NORTH)) {
+ _game.moveCatacombs(0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_WEST)) {
+ _game.moveCatacombs(3);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_MORE_CATACOMBS)) {
+ _game.moveCatacombs(2);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_EAST)) {
+ _game.moveCatacombs(1);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(40410);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(40411);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(40412);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ARCHWAY)) {
+ _vm->_dialogs->show(40413);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_EXPOSED_BRICK)) {
+ _vm->_dialogs->show(40414);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MORE_CATACOMBS)) {
+ _vm->_dialogs->show(40415);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PUDDLE)) {
+ _vm->_dialogs->show(40417);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RATS_NEST)) {
+ _vm->_dialogs->show(40418);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BROKEN_POT)) {
+ _vm->_dialogs->show(40421);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WEB)) {
+ _vm->_dialogs->show(40424);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RED_FRAME) && !_game._objects.isInInventory(OBJ_RED_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_RED_FRAME, 802, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME) && !_game._objects.isInInventory(OBJ_GREEN_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_GREEN_FRAME, 819, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME) && !_game._objects.isInInventory(OBJ_BLUE_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_BLUE_FRAME, 817, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME) && !_game._objects.isInInventory(OBJ_YELLOW_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_YELLOW_FRAME, 804, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLOCK)) {
+ _vm->_dialogs->show(40430);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_RATS_NEST)) {
+ _vm->_dialogs->show(40419);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_BROKEN_POT)) {
+ _vm->_dialogs->show(40422);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_BLOCK)) {
+ _vm->_dialogs->show(40431);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene404::preActions() {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_RED_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_YELLOW_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_BLUE_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_GREEN_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _game._player._needToWalk = false;
+ else {
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[10]]->getFramePos(0);
+ _game._player.walk(Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene406::Scene406(MADSEngine *vm) : Scene4xx(vm) {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ _redFrameHotspotId = -1;
+ _greenFrameHostpotId = -1;
+ _blueFrameHotspotId = -1;
+ _yellowFrameHotspotId = -1;
+}
+
+void Scene406::synchronize(Common::Serializer &s) {
+ Scene4xx::synchronize(s);
+
+ s.syncAsByte(_frameInRoomFl);
+ s.syncAsByte(_takingFrameInRoomFl);
+
+ s.syncAsSint16LE(_redFrameHotspotId);
+ s.syncAsSint16LE(_greenFrameHostpotId);
+ s.syncAsSint16LE(_blueFrameHotspotId);
+ s.syncAsSint16LE(_yellowFrameHotspotId);
+}
+
+void Scene406::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_RED_FRAME);
+ _scene->addActiveVocab(NOUN_YELLOW_FRAME);
+ _scene->addActiveVocab(NOUN_BLUE_FRAME);
+ _scene->addActiveVocab(NOUN_GREEN_FRAME);
+}
+
+void Scene406::enter() {
+ _game.initCatacombs();
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('f', 2));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('f', 3));
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ switch (_globals[kCatacombsFrom]) {
+ case 1:
+ _game._player._playerPos = Common::Point(310, 118);
+ _game._player._facing = FACING_WEST;
+ _game._player.walk(Common::Point(271, 118), FACING_WEST);
+ break;
+
+ case 3:
+ _game._player._playerPos = Common::Point(20, 122);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(66, 122), FACING_EAST);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _greenFrameHostpotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHostpotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene406::step() {
+}
+
+void Scene406::actions() {
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _vm->_dialogs->show(29);
+ else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[0], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _game._objects.setRoom(OBJ_RED_FRAME, NOWHERE);
+ _game._objects[OBJ_RED_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _game._objects.setRoom(OBJ_GREEN_FRAME, NOWHERE);
+ _game._objects[OBJ_GREEN_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _greenFrameHostpotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHostpotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _game._objects.setRoom(OBJ_BLUE_FRAME, NOWHERE);
+ _game._objects[OBJ_BLUE_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _game._objects.setRoom(OBJ_YELLOW_FRAME, NOWHERE);
+ _game._objects[OBJ_YELLOW_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[0]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_GREEN_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME))) {
+ if ((_takingFrameInRoomFl || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[0], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _scene->_dynamicHotspots.remove(_redFrameHotspotId);
+ _game._objects.addToInventory(OBJ_RED_FRAME);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _scene->_dynamicHotspots.remove(_greenFrameHostpotId);
+ _game._objects.addToInventory(OBJ_GREEN_FRAME);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _scene->_dynamicHotspots.remove(_blueFrameHotspotId);
+ _game._objects.addToInventory(OBJ_BLUE_FRAME);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[4]);
+ _scene->_dynamicHotspots.remove(_yellowFrameHotspotId);
+ _game._objects.addToInventory(OBJ_YELLOW_FRAME);
+ }
+
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[0]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_WEST)) {
+ _game.moveCatacombs(3);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_EAST)) {
+ _game.moveCatacombs(1);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(40610);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(40611);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(40612);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ARCHWAY)) {
+ _vm->_dialogs->show(40613);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_EXPOSED_BRICK)) {
+ _vm->_dialogs->show(40614);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MORE_CATACOMBS)) {
+ _vm->_dialogs->show(40615);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLOCKED_ARCHWAY)) {
+ _vm->_dialogs->show(40616);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RED_FRAME) && !_game._objects.isInInventory(OBJ_RED_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_RED_FRAME, 802, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME) && !_game._objects.isInInventory(OBJ_GREEN_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_GREEN_FRAME, 819, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME) && !_game._objects.isInInventory(OBJ_BLUE_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_BLUE_FRAME, 817, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME) && !_game._objects.isInInventory(OBJ_YELLOW_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_YELLOW_FRAME, 804, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GRATE)) {
+ _vm->_dialogs->show(40617);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_GRATE) || _action.isAction(VERB_PUSH, NOUN_GRATE) || _action.isAction(VERB_PULL, NOUN_GRATE)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], true, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2:
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], true, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addTimer(30, 3);
+ break;
+
+ case 3:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[0], true, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 4);
+ break;
+
+ case 4:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[0]);
+ _scene->_sequences.addTimer(6, 5);
+ break;
+
+ case 5:
+ _game._player._stepEnabled = true;
+ _vm->_dialogs->show(40618);
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ }
+}
+
+void Scene406::preActions() {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_RED_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_YELLOW_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_BLUE_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_GREEN_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _game._player._needToWalk = false;
+ else {
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ pos.x += 12;
+ _game._player.walk(pos, FACING_NORTHWEST);
+ }
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene407::Scene407(MADSEngine *vm) : Scene4xx(vm) {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ _redFrameHotspotId = -1;
+ _greenFrameHotspotId = -1;
+ _blueFrameHotspotId = -1;
+ _yellowFrameHotspotId = -1;
+}
+
+void Scene407::synchronize(Common::Serializer &s) {
+ Scene4xx::synchronize(s);
+
+ s.syncAsByte(_frameInRoomFl);
+ s.syncAsByte(_takingFrameInRoomFl);
+
+ s.syncAsSint16LE(_redFrameHotspotId);
+ s.syncAsSint16LE(_greenFrameHotspotId);
+ s.syncAsSint16LE(_blueFrameHotspotId);
+ s.syncAsSint16LE(_yellowFrameHotspotId);
+}
+
+void Scene407::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_RED_FRAME);
+ _scene->addActiveVocab(NOUN_YELLOW_FRAME);
+ _scene->addActiveVocab(NOUN_BLUE_FRAME);
+ _scene->addActiveVocab(NOUN_GREEN_FRAME);
+}
+
+void Scene407::enter() {
+ _game.initCatacombs();
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('f', 2));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('f', 3));
+
+ if (_game.exitCatacombs(3) == -1) {
+ _scene->_hotspots.activateAtPos(NOUN_MORE_CATACOMBS, false, Common::Point(9, 46));
+ _scene->_hotspots.activateAtPos(NOUN_MORE_CATACOMBS, false, Common::Point(8, 138));
+ _scene->_hotspots.activateAtPos(NOUN_MORE_CATACOMBS, false, Common::Point(12, 149));
+ _scene->_hotspots.activateAtPos(NOUN_MORE_CATACOMBS, false, Common::Point(0, 151));
+ }
+
+ if (_game.exitCatacombs(1) == -1) {
+ _scene->_hotspots.activateAtPos(NOUN_MORE_CATACOMBS, false, Common::Point(310, 107));
+ _scene->_hotspots.activateAtPos(NOUN_MORE_CATACOMBS, false, Common::Point(308, 175));
+ _scene->_hotspots.activateAtPos(NOUN_MORE_CATACOMBS, false, Common::Point(308, 146));
+ _scene->_hotspots.activateAtPos(NOUN_MORE_CATACOMBS, false, Common::Point(309, 152));
+ }
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ switch (_globals[kCatacombsFrom]) {
+ case 0:
+ _game._player._playerPos = Common::Point(197, 14);
+ _game._player._facing = FACING_WEST;
+ _game._player.walk(Common::Point(181, 14), FACING_WEST);
+ break;
+
+ case 1:
+ _game._player.firstWalk(Common::Point(330, 146), FACING_WEST, Common::Point(298, 146), FACING_WEST, true);
+ break;
+
+ case 2:
+ _game._player._playerPos = Common::Point(147, 14);
+ _game._player._facing = FACING_EAST;
+ _game._player.walk(Common::Point(165, 14), FACING_EAST);
+ break;
+
+ case 3:
+ _game._player.firstWalk(Common::Point(-20, 143), FACING_WEST, Common::Point(20, 143), FACING_WEST, true);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _greenFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene407::step() {
+}
+
+void Scene407::actions() {
+ if (_action.isAction(VERB_WALK_TO, NOUN_WALL) && (_game._player._playerPos.y > 30) && (_scene->_customDest.x > 160) && (_scene->_customDest.x < 190)) {
+ _vm->_dialogs->show(40718);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_TO) && (_scene->_customDest.x < 130) && (_game._player._playerPos.y < 30)) {
+ _vm->_dialogs->show(40718);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_TO) && (_scene->_customDest.x > 203) && (_game._player._playerPos.y < 30)) {
+ _vm->_dialogs->show(40718);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_TO, NOUN_FLOOR)) {
+ if ((_game._player._playerPos.y < 30) && (_scene->_customDest.y > 29)) {
+ _vm->_dialogs->show(40718);
+ _action._inProgress = false;
+ return;
+ } else if ((_game._player._playerPos.y > 29) && (_scene->_customDest.y < 30)) {
+ _vm->_dialogs->show(40718);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)) {
+ if (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME)) {
+ if ((_game._player._playerPos.y < 30) && (_scene->_customDest.y < 30))
+ _vm->_dialogs->show(40717);
+ else if ((_game._player._playerPos.y < 30) && (_scene->_customDest.y > 29))
+ _vm->_dialogs->show(40718);
+ else if (_frameInRoomFl)
+ _vm->_dialogs->show(29);
+ else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[0], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _game._objects.setRoom(OBJ_RED_FRAME, NOWHERE);
+ _game._objects[OBJ_RED_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _game._objects.setRoom(OBJ_GREEN_FRAME, NOWHERE);
+ _game._objects[OBJ_GREEN_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _greenFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _game._objects.setRoom(OBJ_BLUE_FRAME, NOWHERE);
+ _game._objects[OBJ_BLUE_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _game._objects.setRoom(OBJ_YELLOW_FRAME, NOWHERE);
+ _game._objects[OBJ_YELLOW_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[0]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE)) {
+ if (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_GREEN_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME)) {
+ if ((_takingFrameInRoomFl || _game._trigger)) {
+ if (_game._player._playerPos.y < 30)
+ _vm->_dialogs->show(40718);
+ else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[0], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _scene->_dynamicHotspots.remove(_redFrameHotspotId);
+ _game._objects.addToInventory(OBJ_RED_FRAME);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _scene->_dynamicHotspots.remove(_greenFrameHotspotId);
+ _game._objects.addToInventory(OBJ_GREEN_FRAME);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _scene->_dynamicHotspots.remove(_blueFrameHotspotId);
+ _game._objects.addToInventory(OBJ_BLUE_FRAME);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[4]);
+ _scene->_dynamicHotspots.remove(_yellowFrameHotspotId);
+ _game._objects.addToInventory(OBJ_YELLOW_FRAME);
+ }
+
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[0]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_WEST)) {
+ if (_game._player._playerPos.y < 30)
+ _game.moveCatacombs(2);
+ else
+ _vm->_dialogs->show(40718);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_EAST)) {
+ if (_game._player._playerPos.y < 30)
+ _game.moveCatacombs(0);
+ else
+ _vm->_dialogs->show(40718);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_MORE_CATACOMBS) && (_game._player._playerPos.y < 30)) {
+ _vm->_dialogs->show(40718);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(40710);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(40711);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(40712);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ARCHWAY)) {
+ _vm->_dialogs->show(40713);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MORE_CATACOMBS)) {
+ _vm->_dialogs->show(40714);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COLUMN)) {
+ _vm->_dialogs->show(40715);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RED_FRAME) && !_game._objects.isInInventory(OBJ_RED_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_RED_FRAME, 802, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME) && !_game._objects.isInInventory(OBJ_GREEN_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_GREEN_FRAME, 818, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME) && !_game._objects.isInInventory(OBJ_BLUE_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_BLUE_FRAME, 817, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME) && !_game._objects.isInInventory(OBJ_YELLOW_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_YELLOW_FRAME, 804, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LAKE)) {
+ _vm->_dialogs->show(40716);
+ _action._inProgress = false;
+ }
+ }
+}
+
+void Scene407::preActions() {
+ if (_action.isAction(VERB_EXIT_TO, NOUN_MORE_CATACOMBS)) {
+ if (_game._player._playerPos.y > 30) {
+ if (_scene->_customDest.x < 100)
+ _game.moveCatacombs(3);
+ else
+ _game.moveCatacombs(1);
+ } else
+ _game._player._needToWalk = false;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH) && (_game._player._playerPos.y > 30))
+ _game._player._needToWalk = false;
+
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_RED_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_YELLOW_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_BLUE_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_GREEN_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if ((_frameInRoomFl) || (_game._player._playerPos.y < 30) || (_scene->_customDest.y < 30))
+ _game._player._needToWalk = false;
+ else {
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[1]]->getFramePos(0);
+ _game._player.walk(Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_GREEN_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME))) {
+ if (_takingFrameInRoomFl && (_game._player._playerPos.y < 30))
+ _game._player._needToWalk = false;
+ }
+
+ if (_action.isAction(VERB_WALK_ACROSS, NOUN_FLOOR) && (_game._player._playerPos.y < 30) && (_scene->_customDest.y > 29))
+ _game._player._needToWalk = false;
+
+ if (_action.isAction(VERB_WALK_TO, NOUN_LAKE) && (_game._player._playerPos.y < 30))
+ _game._player.walk(Common::Point(172, 18), FACING_SOUTH);
+
+ if (_action.isAction(VERB_WALK_TO) && (_scene->_customDest.x < 130) && (_game._player._playerPos.y < 30))
+ _game._player._needToWalk = false;
+
+ if (_action.isAction(VERB_WALK_TO) && (_scene->_customDest.x > 203) && (_game._player._playerPos.y < 30))
+ _game._player._needToWalk = false;
+
+ if (_action.isAction(VERB_WALK_TO, NOUN_WALL) && (_game._player._playerPos.y > 30) && (_scene->_customDest.x > 160) && (_scene->_customDest.x < 190))
+ _game._player._needToWalk = false;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene408::Scene408(MADSEngine *vm) : Scene4xx(vm) {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ _redFrameHotspotId = -1;
+ _greenFrameHotspotId = -1;
+ _blueFrameHotspotId = -1;
+ _yellowFrameHotspotId = -1;
+}
+
+void Scene408::synchronize(Common::Serializer &s) {
+ Scene4xx::synchronize(s);
+
+ s.syncAsByte(_frameInRoomFl);
+ s.syncAsByte(_takingFrameInRoomFl);
+
+ s.syncAsSint16LE(_redFrameHotspotId);
+ s.syncAsSint16LE(_greenFrameHotspotId);
+ s.syncAsSint16LE(_blueFrameHotspotId);
+ s.syncAsSint16LE(_yellowFrameHotspotId);
+}
+
+void Scene408::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if ((_globals[kCatacombsMisc] & MAZE_EVENT_WEB) && (!_globals[kCobwebIsCut]))
+ _scene->_variant = 1;
+
+ _scene->addActiveVocab(NOUN_RED_FRAME);
+ _scene->addActiveVocab(NOUN_YELLOW_FRAME);
+ _scene->addActiveVocab(NOUN_BLUE_FRAME);
+ _scene->addActiveVocab(NOUN_GREEN_FRAME);
+}
+
+void Scene408::enter() {
+ _game.initCatacombs();
+ _scene->_hotspots.activate(NOUN_COBWEB, false);
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('c', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('f', 2));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('f', 3));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('c', 1));
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('c', 2));
+
+ if (_game.exitCatacombs(0) == -1) {
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_NORTH, false);
+ _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(147, 121));
+ _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(153, 121));
+ _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(154, 115));
+ _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(161, 101));
+ _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(162, 106));
+ _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(187, 107));
+ _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(185, 101));
+ _scene->_hotspots.activateAtPos(NOUN_FLOOR, false, Common::Point(192, 119));
+ _scene->_hotspots.activateAtPos(NOUN_WALL, false, Common::Point(147, 76));
+ _scene->_hotspots.activateAtPos(NOUN_WALL, false, Common::Point(159, 108));
+ _scene->_hotspots.activateAtPos(NOUN_WALL, false, Common::Point(185, 93));
+ _scene->_hotspots.activateAtPos(NOUN_WALL, false, Common::Point(199, 91));
+ _scene->changeVariant(1);
+ } else
+ _scene->_hotspots.activate(NOUN_GATE, false);
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ switch (_globals[kCatacombsFrom]) {
+ case 0:
+ _game._player._playerPos = Common::Point(174, 100);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(174, 106), FACING_SOUTH);
+ break;
+
+ case 2:
+ _game._player._playerPos = Common::Point(175, 145);
+ _game._player._facing = FACING_NORTH;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_WEB) {
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('x', -1));
+ if (!_globals[kCobwebIsCut]) {
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('c', 1));
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 10);
+ _scene->_hotspots.activate(NOUN_COBWEB, true);
+ } else {
+ _globals._sequenceIndexes[8] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[8], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[8], 10);
+
+ int idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(199, 112, 199 + 6, 112 + 12));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(194, 125), FACING_NORTHEAST);
+ idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(202, 81, 202 + 5, 81 + 31));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(194, 125), FACING_NORTHEAST);
+
+ idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(138, 74, 138 + 7, 74 + 33));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(154, 124), FACING_NORTHWEST);
+ idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(143, 107, 143 + 6, 107 + 15));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(154, 124), FACING_NORTHWEST);
+ }
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_BRICK) {
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('c', 2));
+ _scene->drawToBackground(_globals._spriteIndexes[7], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_EXPOSED_BRICK, false);
+ }
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _greenFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if ((_game._difficulty == DIFFICULTY_HARD) && (_globals[kCatacombsRoom] == 52))
+ _scene->_sequences.addTimer(120, 60);
+
+ sceneEntrySound();
+}
+
+void Scene408::step() {
+ if (_game._trigger == 60)
+ _vm->_dialogs->show(31);
+}
+
+void Scene408::actions() {
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _vm->_dialogs->show(29);
+ else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _game._objects.setRoom(OBJ_RED_FRAME, NOWHERE);
+ _game._objects[OBJ_RED_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _game._objects.setRoom(OBJ_GREEN_FRAME, NOWHERE);
+ _game._objects[OBJ_GREEN_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _greenFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _game._objects.setRoom(OBJ_BLUE_FRAME, NOWHERE);
+ _game._objects[OBJ_BLUE_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _game._objects.setRoom(OBJ_YELLOW_FRAME, NOWHERE);
+ _game._objects[OBJ_YELLOW_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[1]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+
+ if (_action.isAction(VERB_TAKE)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_GREEN_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME))) {
+ if ((_takingFrameInRoomFl || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _scene->_dynamicHotspots.remove(_redFrameHotspotId);
+ _game._objects.addToInventory(OBJ_RED_FRAME);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _scene->_dynamicHotspots.remove(_greenFrameHotspotId);
+ _game._objects.addToInventory(OBJ_GREEN_FRAME);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[4]);
+ _scene->_dynamicHotspots.remove(_blueFrameHotspotId);
+ _game._objects.addToInventory(OBJ_BLUE_FRAME);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+ _scene->_dynamicHotspots.remove(_yellowFrameHotspotId);
+ _game._objects.addToInventory(OBJ_YELLOW_FRAME);
+ }
+
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[1]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_NORTH)) {
+ _game.moveCatacombs(0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_MORE_CATACOMBS)) {
+ _game.moveCatacombs(2);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(40810);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(40811);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(40812);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ARCHWAY)) {
+ _vm->_dialogs->show(40813);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_EXPOSED_BRICK)) {
+ _vm->_dialogs->show(40814);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MORE_CATACOMBS)) {
+ _vm->_dialogs->show(40815);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(40816);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RED_FRAME) && !_game._objects.isInInventory(OBJ_RED_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_RED_FRAME, 802, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME) && !_game._objects.isInInventory(OBJ_GREEN_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_GREEN_FRAME, 819, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME) && !_game._objects.isInInventory(OBJ_BLUE_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_BLUE_FRAME, 817, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME) && !_game._objects.isInInventory(OBJ_YELLOW_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_YELLOW_FRAME, 804, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GATE)) {
+ _vm->_dialogs->show(40817);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COBWEB)) {
+ if (_globals[kCobwebIsCut])
+ _vm->_dialogs->show(40820);
+ else
+ _vm->_dialogs->show(40819);
+
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if ((_action.isAction(VERB_ATTACK, NOUN_COBWEB) && !_globals[kCobwebIsCut])) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('W', 1), 70);
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _globals[kCobwebIsCut] = true;
+ _scene->deleteSequence(_globals._sequenceIndexes[6]);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_game._trigger == 70) {
+ _globals._sequenceIndexes[8] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[8], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[8], 14);
+ _scene->changeVariant(0);
+ _scene->_hotspots.activate(NOUN_COBWEB, false);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+
+ int idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(199, 112, 199 + 6, 112 + 12));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(194, 125), FACING_NORTHEAST);
+ idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(202, 81, 202 + 5, 81 + 31));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(194, 125), FACING_NORTHEAST);
+
+ idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(138, 74, 138 + 7, 74 + 33));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(154, 124), FACING_NORTHWEST);
+ idx = _scene->_dynamicHotspots.add(NOUN_COBWEB, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(143, 107, 143 + 6, 107 + 15));
+ _scene->_dynamicHotspots.setPosition(idx, Common::Point(154, 124), FACING_NORTHWEST);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_GATE)) {
+ _vm->_dialogs->show(40818);
+ _action._inProgress = false;
+ }
+}
+
+void Scene408::preActions() {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_RED_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_YELLOW_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_BLUE_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_GREEN_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _game._player._needToWalk = false;
+ else {
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _game._player.walk(Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene409::Scene409(MADSEngine *vm) : Scene4xx(vm) {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ _redFrameHotspotId = -1;
+ _greenFrameHotspotId = -1;
+ _blueFrameHotspotId = -1;
+ _yellowFrameHotspotId = -1;
+}
+
+void Scene409::synchronize(Common::Serializer &s) {
+ Scene4xx::synchronize(s);
+
+ s.syncAsByte(_frameInRoomFl);
+ s.syncAsByte(_takingFrameInRoomFl);
+
+ s.syncAsSint16LE(_redFrameHotspotId);
+ s.syncAsSint16LE(_greenFrameHotspotId);
+ s.syncAsSint16LE(_blueFrameHotspotId);
+ s.syncAsSint16LE(_yellowFrameHotspotId);
+}
+
+void Scene409::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_RED_FRAME);
+ _scene->addActiveVocab(NOUN_YELLOW_FRAME);
+ _scene->addActiveVocab(NOUN_BLUE_FRAME);
+ _scene->addActiveVocab(NOUN_GREEN_FRAME);
+}
+
+void Scene409::enter() {
+ _game.initCatacombs();
+
+ _scene->loadSpeech(3);
+ _scene->_hotspots.activate(NOUN_SWORD, false);
+
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites("*RDR_9");
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('f', 2));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('f', 3));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('a', 0));
+
+ if (_game._objects.isInRoom(OBJ_SWORD)) {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('p', 0));
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _scene->_hotspots.activate(NOUN_SWORD, true);
+ }
+
+ if (!_globals[kDoorIn409IsOpen]) {
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_NORTH, false);
+ } else
+ _scene->_hotspots.activate(NOUN_DOOR, false);
+
+ if (_scene->_priorSceneId == 410) {
+ _game._player._facing = FACING_NORTH;
+ _game._player._playerPos = Common::Point(229, 106);
+
+ if (_globals[kFlickedLever1] && _globals[kFlickedLever2] && _globals[kFlickedLever3] && _globals[kFlickedLever4]) {
+ if ((_globals[kFlickedLever1] == 5) && (_globals[kFlickedLever2] == 18) && (_globals[kFlickedLever3] == 9) && (_globals[kFlickedLever4] == 11)) {
+ if (!_globals[kDoorIn409IsOpen]) {
+ _globals[kPlayerScore] += 5;
+ _vm->_sound->command(24);
+ _scene->deleteSequence(_globals._sequenceIndexes[6]);
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[6] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[6], false, 7, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[6], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[6], SEQUENCE_TRIGGER_EXPIRE, 0, 65);
+ }
+ } else {
+ _globals[kFlickedLever1] = 0;
+ _globals[kFlickedLever2] = 0;
+ _globals[kFlickedLever3] = 0;
+ _globals[kFlickedLever4] = 0;
+ _game._player._stepEnabled = false;
+ _globals._sequenceIndexes[7] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[7], false, 9, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[7], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[7], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_SPRITE, 15, 60);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_EXPIRE, 0, 61);
+ _vm->_sound->command(68);
+ }
+ } else {
+ _globals[kFlickedLever1] = 0;
+ _globals[kFlickedLever2] = 0;
+ _globals[kFlickedLever3] = 0;
+ _globals[kFlickedLever4] = 0;
+ }
+ } else if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ switch (_globals[kCatacombsFrom]) {
+ case 0:
+ _game._player._playerPos = Common::Point(195, 92);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(195, 107), FACING_SOUTH);
+ break;
+
+ case 2:
+ _game._player._playerPos = Common::Point(184, 45);
+ _game._player._facing = FACING_NORTH;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _greenFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene409::step() {
+ if (_game._trigger == 60) {
+ _game._player._visible = false;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[7]);
+ _scene->playSpeech(3);
+ }
+
+ if (_game._trigger == 61) {
+ _globals._sequenceIndexes[7] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[7], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[7], 1);
+ _scene->_sequences.addTimer(60, 62);
+ _vm->_sound->command(27);
+ }
+
+ if (_game._trigger == 62)
+ _scene->_reloadSceneFlag = true;
+
+ if (_game._trigger == 65) {
+ _game._player._stepEnabled = true;
+ _globals[kDoorIn409IsOpen] = true;
+ _scene->_hotspots.activate(NOUN_DOOR, false);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_NORTH, true);
+ }
+}
+
+void Scene409::actions() {
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR) || _action.isAction(VERB_OPEN, NOUN_DOOR)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[8], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 4, 4);
+ _action._inProgress = false;
+ return;
+
+ case 1: {
+ int syncIdx = _globals._sequenceIndexes[8];
+ _globals._sequenceIndexes[8] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[8], false, 4);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[8], SYNC_SEQ, syncIdx);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], false);
+ _scene->_sequences.addTimer(30, 2);
+ _action._inProgress = false;
+ }
+ return;
+
+ case 2:
+ _scene->deleteSequence(_globals._sequenceIndexes[8]);
+ _globals._sequenceIndexes[8] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[8], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ _action._inProgress = false;
+ return;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ _game._player._visible = true;
+ _vm->_dialogs->show(40923);
+ _game._player._stepEnabled = true;
+ _action._inProgress = false;
+ return;
+
+ case 4:
+ _vm->_sound->command(70);
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+ }
+
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)) {
+ if (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME)) {
+ if (_frameInRoomFl) {
+ _vm->_dialogs->show(29);
+ } else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[0], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _game._objects.setRoom(OBJ_RED_FRAME, NOWHERE);
+ _game._objects[OBJ_RED_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _game._objects.setRoom(OBJ_GREEN_FRAME, NOWHERE);
+ _game._objects[OBJ_GREEN_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _greenFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _game._objects.setRoom(OBJ_BLUE_FRAME, NOWHERE);
+ _game._objects[OBJ_BLUE_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _game._objects.setRoom(OBJ_YELLOW_FRAME, NOWHERE);
+ _game._objects[OBJ_YELLOW_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[0]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE)) {
+ if ((_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_GREEN_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME))
+ && (_takingFrameInRoomFl || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[0], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _scene->_dynamicHotspots.remove(_redFrameHotspotId);
+ _game._objects.addToInventory(OBJ_RED_FRAME);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _scene->_dynamicHotspots.remove(_greenFrameHotspotId);
+ _game._objects.addToInventory(OBJ_GREEN_FRAME);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[4]);
+ _scene->_dynamicHotspots.remove(_blueFrameHotspotId);
+ _game._objects.addToInventory(OBJ_BLUE_FRAME);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+ _scene->_dynamicHotspots.remove(_yellowFrameHotspotId);
+ _game._objects.addToInventory(OBJ_YELLOW_FRAME);
+ }
+
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[0]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_NORTH)) {
+ _game.enterCatacombs(true);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_MORE_CATACOMBS)) {
+ _game.enterCatacombs(false);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(40910);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_SWORD) && (_game._objects.isInRoom(OBJ_SWORD) || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _globals[kPlayerScore] += 5;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[0], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _scene->_hotspots.activate(NOUN_SWORD, false);
+ _game._objects.addToInventory(OBJ_SWORD);
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[0]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ break;
+
+ case 3:
+ _vm->_dialogs->showItem(OBJ_SWORD, 808, 0);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(40911);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(40912);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ARCHWAY)) {
+ _vm->_dialogs->show(40913);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_EXPOSED_BRICK)) {
+ _vm->_dialogs->show(40914);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MORE_CATACOMBS)) {
+ _vm->_dialogs->show(40915);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLOCKED_ARCHWAY)) {
+ _vm->_dialogs->show(40916);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GRATE)) {
+ _vm->_dialogs->show(40917);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_UNLUCKY_ADVENTURER)) {
+ _vm->_dialogs->show(40920);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RED_FRAME) && !_game._objects.isInInventory(OBJ_RED_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_RED_FRAME, 802, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME) && !_game._objects.isInInventory(OBJ_GREEN_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_GREEN_FRAME, 819, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME) && !_game._objects.isInInventory(OBJ_BLUE_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_BLUE_FRAME, 817, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME) && !_game._objects.isInInventory(OBJ_YELLOW_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_YELLOW_FRAME, 804, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SWORD) && _game._objects.isInRoom(OBJ_SWORD)) {
+ _vm->_dialogs->show(40921);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_LOOK, NOUN_SWITCH_PANEL)) {
+ _vm->_dialogs->show(40919);
+ _scene->_nextSceneId = 410;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_TO, NOUN_SWITCH_PANEL)) {
+ _scene->_nextSceneId = 410;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_GRATE) || _action.isAction(VERB_PUSH, NOUN_GRATE) || _action.isAction(VERB_PULL, NOUN_GRATE)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 2:
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addTimer(30, 3);
+ break;
+
+ case 3:
+ _scene->deleteSequence(_globals._sequenceIndexes[0]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[0], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 4);
+ break;
+
+ case 4:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[0]);
+ _scene->_sequences.addTimer(6, 5);
+ break;
+
+ case 5:
+ _game._player._stepEnabled = true;
+ _vm->_dialogs->show(40918);
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_UNLUCKY_ADVENTURER)) {
+ _vm->_dialogs->show(40924);
+ _action._inProgress = false;
+ }
+}
+
+void Scene409::preActions() {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_RED_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_YELLOW_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_BLUE_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_GREEN_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _game._player._needToWalk = false;
+ else {
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _game._player.walk(Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ }
+
+ if (_action.isAction(VERB_LOOK, NOUN_SWITCH_PANEL))
+ _game._player.walk(Common::Point(229, 106), FACING_NORTH);
+
+ if (_action.isAction(VERB_OPEN, NOUN_DOOR))
+ _game._player.walk(Common::Point(191, 104), FACING_NORTHEAST);
+
+ if (_action.isAction(VERB_OPEN, NOUN_GRATE))
+ _game._player._needToWalk = true;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene410::Scene410(MADSEngine *vm) : Scene4xx(vm) {
+ for (int i = 0; i < 26; i++)
+ _skullSequence[i] = 0;
+}
+
+void Scene410::synchronize(Common::Serializer &s) {
+ Scene4xx::synchronize(s);
+
+ for (int i = 0; i < 26; i++)
+ s.syncAsSint16LE(_skullSequence[i]);
+}
+
+void Scene410::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene410::enter() {
+ _game._player._visible = false;
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('l', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('l', 1));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('l', 2));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('a', 0));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('f', 0));
+
+ for (int i = 1; i < 27; i++) {
+ Common::Point pos;
+ int type;
+
+ getLeverInfo(&pos, &type, i, NULL);
+ int stampType = -1;
+
+ switch (type) {
+ case 1:
+ stampType = _globals._spriteIndexes[0];
+ break;
+
+ case 2:
+ stampType = _globals._spriteIndexes[1];
+ break;
+
+ case 3:
+ stampType = _globals._spriteIndexes[2];
+ break;
+
+ default:
+ break;
+ }
+
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(stampType, false, 1);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], pos);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 2);
+ _skullSequence[i - 1] = _globals._sequenceIndexes[0];
+ }
+
+ if (_globals[kFlickedLever1]) {
+ Common::Point pos;
+ int type;
+
+ getLeverInfo(&pos, &type, _globals[kFlickedLever1], NULL);
+ int stampType = -1;
+
+ switch (type) {
+ case 1:
+ stampType = _globals._spriteIndexes[0];
+ break;
+
+ case 2:
+ stampType = _globals._spriteIndexes[1];
+ break;
+
+ case 3:
+ stampType = _globals._spriteIndexes[2];
+ break;
+
+ default:
+ break;
+ }
+ _scene->deleteSequence(_skullSequence[_globals[kFlickedLever1] - 1]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(stampType, false, -2);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], pos);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 2);
+ }
+
+ if (_globals[kFlickedLever2]) {
+ Common::Point pos;
+ int type;
+
+ getLeverInfo(&pos, &type, _globals[kFlickedLever2], NULL);
+ int stampType = -1;
+ switch (type) {
+ case 1:
+ stampType = _globals._spriteIndexes[0];
+ break;
+
+ case 2:
+ stampType = _globals._spriteIndexes[1];
+ break;
+
+ case 3:
+ stampType = _globals._spriteIndexes[2];
+ break;
+
+ default:
+ break;
+ }
+ _scene->deleteSequence(_skullSequence[_globals[kFlickedLever2] - 1]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(stampType, false, -2);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], pos);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 2);
+ }
+
+ if (_globals[kFlickedLever3]) {
+ Common::Point pos;
+ int type;
+
+ getLeverInfo(&pos, &type, _globals[kFlickedLever3], NULL);
+ int stampType = -1;
+ switch (type) {
+ case 1:
+ stampType = _globals._spriteIndexes[0];
+ break;
+
+ case 2:
+ stampType = _globals._spriteIndexes[1];
+ break;
+
+ case 3:
+ stampType = _globals._spriteIndexes[2];
+ break;
+
+ default:
+ break;
+ }
+ _scene->deleteSequence(_skullSequence[_globals[kFlickedLever3] - 1]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(stampType, false, -2);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], pos);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 2);
+ }
+
+ if (_globals[kFlickedLever4]) {
+ Common::Point pos;
+ int type;
+
+ getLeverInfo(&pos, &type, _globals[kFlickedLever4], NULL);
+ int stampType = -1;
+ switch (type) {
+ case 1:
+ stampType = _globals._spriteIndexes[0];
+ break;
+
+ case 2:
+ stampType = _globals._spriteIndexes[1];
+ break;
+
+ case 3:
+ stampType = _globals._spriteIndexes[2];
+ break;
+
+ default:
+ break;
+ }
+ _scene->deleteSequence(_skullSequence[_globals[kFlickedLever4] - 1]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(stampType, false, -2);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], pos);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 2);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene410::step() {
+}
+
+void Scene410::actions() {
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(41013);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_PUSH) || _action.isAction(VERB_PULL)) {
+ if (_globals[kDoorIn409IsOpen])
+ _vm->_dialogs->show(41014);
+ else {
+ Common::Point pos;
+ int type;
+ int number;
+
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ getLeverInfo(&pos, &type, 0, &number);
+ _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 4, 2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ if (pos.y == 46)
+ pos.y = 48;
+
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[3], Common::Point(pos.x + 4, pos.y + 107));
+ if (!_globals[kDoorIn409IsOpen])
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_SPRITE, 16, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ getLeverInfo(&pos, &type, 0, &number);
+
+ if ((_globals[kFlickedLever1] != number) && (_globals[kFlickedLever2] != number) && (_globals[kFlickedLever3] != number) && (_globals[kFlickedLever4] != number)) {
+ _vm->_sound->command(65);
+
+ if (!_globals[kFlickedLever1]) {
+ _globals[kFlickedLever1] = number;
+ if (_globals[kFlickedLever1] == 5)
+ _vm->_sound->command(66);
+ } else if (!_globals[kFlickedLever2]) {
+ _globals[kFlickedLever2] = number;
+ if ((_globals[kFlickedLever1] == 5) && (_globals[kFlickedLever2] == 18))
+ _vm->_sound->command(66);
+ } else if (!_globals[kFlickedLever3]) {
+ _globals[kFlickedLever3] = number;
+ if ((_globals[kFlickedLever1] == 5) && (_globals[kFlickedLever2] == 18) && (_globals[kFlickedLever3] == 9))
+ _vm->_sound->command(66);
+ } else if (!_globals[kFlickedLever4]) {
+ _globals[kFlickedLever4] = number;
+ if ((_globals[kFlickedLever1] == 5) && (_globals[kFlickedLever2] == 18) && (_globals[kFlickedLever3] == 9) && (_globals[kFlickedLever4] == 11))
+ _vm->_sound->command(66);
+ }
+
+ if (_game._difficulty == DIFFICULTY_EASY)
+ _scene->drawToBackground(_globals._spriteIndexes[4], number, Common::Point(-32000, -32000), 0, 100);
+
+ switch (type) {
+ case 1:
+ _scene->deleteSequence(_skullSequence[number - 1]);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 4, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 4);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], pos);
+ break;
+
+ case 2:
+ _scene->deleteSequence(_skullSequence[number - 1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 4, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 4);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[1], pos);
+ break;
+
+ case 3:
+ _scene->deleteSequence(_skullSequence[number - 1]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 4, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 4);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[2], pos);
+ break;
+
+ default:
+ break;
+ }
+ }
+ break;
+
+ case 2:
+ _game._player._stepEnabled = true;
+
+ if ((_globals[kFlickedLever1] == 5) && (_globals[kFlickedLever2] == 18) && (_globals[kFlickedLever3] == 9) && (_globals[kFlickedLever4] == 11) && !_globals[kDoorIn409IsOpen])
+ _vm->_sound->command(67);
+
+ if (_globals[kFlickedLever1] && _globals[kFlickedLever2] && _globals[kFlickedLever3] && _globals[kFlickedLever4])
+ _scene->_nextSceneId = 409;
+
+ break;
+
+ case 4:
+ getLeverInfo(&pos, &type, 0, &number);
+ _globals._sequenceIndexes[0] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[0], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 2);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[0], pos);
+ break;
+
+ case 5:
+ getLeverInfo(&pos, &type, 0, &number);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 2);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[1], pos);
+ break;
+
+ case 6:
+ getLeverInfo(&pos, &type, 0, &number);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 2);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[2], pos);
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(41011);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SWITCH_PANEL)) {
+ _vm->_dialogs->show(41011);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CATACOMB_ROOM)) {
+ _vm->_dialogs->show(41015);
+ _action._inProgress = false;
+ return;
+ }
+
+ switch (_action._activeAction._objectNameId) {
+ case NOUN_SKULL_SWITCH_1:
+ case NOUN_SKULL_SWITCH_2:
+ case NOUN_SKULL_SWITCH_3:
+ case NOUN_SKULL_SWITCH_4:
+ case NOUN_SKULL_SWITCH_5:
+ case NOUN_SKULL_SWITCH_6:
+ case NOUN_SKULL_SWITCH_7:
+ case NOUN_SKULL_SWITCH_8:
+ case NOUN_SKULL_SWITCH_9:
+ case NOUN_SKULL_SWITCH_10:
+ case NOUN_SKULL_SWITCH_11:
+ case NOUN_SKULL_SWITCH_12:
+ case NOUN_SKULL_SWITCH_13:
+ case NOUN_SKULL_SWITCH_14:
+ case NOUN_SKULL_SWITCH_15:
+ case NOUN_SKULL_SWITCH_16:
+ case NOUN_SKULL_SWITCH_17:
+ case NOUN_SKULL_SWITCH_18:
+ case NOUN_SKULL_SWITCH_19:
+ case NOUN_SKULL_SWITCH_20:
+ case NOUN_SKULL_SWITCH_21:
+ case NOUN_SKULL_SWITCH_22:
+ case NOUN_SKULL_SWITCH_23:
+ case NOUN_SKULL_SWITCH_24:
+ case NOUN_SKULL_SWITCH_25:
+ case NOUN_SKULL_SWITCH_26:
+ _vm->_dialogs->show(41012);
+ _action._inProgress = false;
+ return;
+ break;
+ }
+ }
+
+ if (_action.isAction(VERB_EXIT_TO, NOUN_CATACOMB_ROOM)) {
+ _scene->_nextSceneId = 409;
+ _action._inProgress = false;
+ }
+}
+
+void Scene410::preActions() {
+}
+
+void Scene410::getLeverInfo(Common::Point *pos, int *type, int lever, int *noun) {
+ if (noun != NULL) {
+ switch (_action._activeAction._objectNameId) {
+ case NOUN_SKULL_SWITCH_1:
+ lever = 1;
+ break;
+
+ case NOUN_SKULL_SWITCH_2:
+ lever = 2;
+ break;
+
+ case NOUN_SKULL_SWITCH_3:
+ lever = 3;
+ break;
+
+ case NOUN_SKULL_SWITCH_4:
+ lever = 4;
+ break;
+
+ case NOUN_SKULL_SWITCH_5:
+ lever = 5;
+ break;
+
+ case NOUN_SKULL_SWITCH_6:
+ lever = 6;
+ break;
+
+ case NOUN_SKULL_SWITCH_7:
+ lever = 7;
+ break;
+
+ case NOUN_SKULL_SWITCH_8:
+ lever = 8;
+ break;
+
+ case NOUN_SKULL_SWITCH_9:
+ lever = 9;
+ break;
+
+ case NOUN_SKULL_SWITCH_10:
+ lever = 10;
+ break;
+
+ case NOUN_SKULL_SWITCH_11:
+ lever = 11;
+ break;
+
+ case NOUN_SKULL_SWITCH_12:
+ lever = 12;
+ break;
+
+ case NOUN_SKULL_SWITCH_13:
+ lever = 13;
+ break;
+
+ case NOUN_SKULL_SWITCH_14:
+ lever = 14;
+ break;
+
+ case NOUN_SKULL_SWITCH_15:
+ lever = 15;
+ break;
+
+ case NOUN_SKULL_SWITCH_16:
+ lever = 16;
+ break;
+
+ case NOUN_SKULL_SWITCH_17:
+ lever = 17;
+ break;
+
+ case NOUN_SKULL_SWITCH_18:
+ lever = 18;
+ break;
+
+ case NOUN_SKULL_SWITCH_19:
+ lever = 19;
+ break;
+
+ case NOUN_SKULL_SWITCH_20:
+ lever = 20;
+ break;
+
+ case NOUN_SKULL_SWITCH_21:
+ lever = 21;
+ break;
+
+ case NOUN_SKULL_SWITCH_22:
+ lever = 22;
+ break;
+
+ case NOUN_SKULL_SWITCH_23:
+ lever = 23;
+ break;
+
+ case NOUN_SKULL_SWITCH_24:
+ lever = 24;
+ break;
+
+ case NOUN_SKULL_SWITCH_25:
+ lever = 25;
+ break;
+
+ case NOUN_SKULL_SWITCH_26:
+ lever = 26;
+ break;
+
+ default:
+ break;
+ }
+ *noun = lever;
+ }
+
+ switch (lever) {
+ case 1:
+ *pos = Common::Point(124, 46);
+ *type = 3;
+ break;
+
+ case 2:
+ *pos = Common::Point(143, 46);
+ *type = 2;
+ break;
+
+ case 3:
+ *pos = Common::Point(162, 46);
+ *type = 1;
+ break;
+
+ case 4:
+ *pos = Common::Point(181, 46);
+ *type = 3;
+ break;
+
+ case 5:
+ *pos = Common::Point(200, 46);
+ *type = 1;
+ break;
+
+ case 6:
+ *pos = Common::Point(219, 46);
+ *type = 2;
+ break;
+
+ case 7:
+ *pos = Common::Point(238, 46);
+ *type = 1;
+ break;
+
+ case 8:
+ *pos = Common::Point(133, 71);
+ *type = 3;
+ break;
+
+ case 9:
+ *pos = Common::Point(152, 71);
+ *type = 2;
+ break;
+
+ case 10:
+ *pos = Common::Point(171, 71);
+ *type = 1;
+ break;
+
+ case 11:
+ *pos = Common::Point(190, 71);
+ *type = 3;
+ break;
+
+ case 12:
+ *pos = Common::Point(209, 71);
+ *type = 2;
+ break;
+
+ case 13:
+ *pos = Common::Point(228, 71);
+ *type = 1;
+ break;
+
+ case 14:
+ *pos = Common::Point(124, 98);
+ *type = 1;
+ break;
+
+ case 15:
+ *pos = Common::Point(143, 98);
+ *type = 3;
+ break;
+
+ case 16:
+ *pos = Common::Point(162, 98);
+ *type = 2;
+ break;
+
+ case 17:
+ *pos = Common::Point(181, 98);
+ *type = 1;
+ break;
+
+ case 18:
+ *pos = Common::Point(200, 98);
+ *type = 1;
+ break;
+
+ case 19:
+ *pos = Common::Point(219, 98);
+ *type = 2;
+ break;
+
+ case 20:
+ *pos = Common::Point(238, 98);
+ *type = 1;
+ break;
+
+ case 21:
+ *pos = Common::Point(133, 125);
+ *type = 3;
+ break;
+
+ case 22:
+ *pos = Common::Point(152, 125);
+ *type = 1;
+ break;
+
+ case 23:
+ *pos = Common::Point(171, 125);
+ *type = 3;
+ break;
+
+ case 24:
+ *pos = Common::Point(190, 125);
+ *type = 2;
+ break;
+
+ case 25:
+ *pos = Common::Point(209, 125);
+ *type = 1;
+ break;
+
+ case 26:
+ *pos = Common::Point(228, 125);
+ *type = 2;
+ break;
+
+ default:
+ *pos = Common::Point(-1, -1);
+ *type = -1;
+ break;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene453::Scene453(MADSEngine *vm) : Scene4xx(vm) {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ _redFrameHotspotId = -1;
+ _greenFrameHotspotId = -1;
+ _blueFrameHotspotId = -1;
+ _yellowFrameHotspotId = -1;
+}
+
+void Scene453::synchronize(Common::Serializer &s) {
+ Scene4xx::synchronize(s);
+
+ s.syncAsByte(_frameInRoomFl);
+ s.syncAsByte(_takingFrameInRoomFl);
+
+ s.syncAsSint16LE(_redFrameHotspotId);
+ s.syncAsSint16LE(_greenFrameHotspotId);
+ s.syncAsSint16LE(_blueFrameHotspotId);
+ s.syncAsSint16LE(_yellowFrameHotspotId);
+}
+
+void Scene453::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_STONE)
+ _scene->_variant = 1;
+
+ _scene->addActiveVocab(NOUN_RED_FRAME);
+ _scene->addActiveVocab(NOUN_YELLOW_FRAME);
+ _scene->addActiveVocab(NOUN_BLUE_FRAME);
+ _scene->addActiveVocab(NOUN_GREEN_FRAME);
+}
+
+void Scene453::enter() {
+ _game.initCatacombs();
+
+ _scene->_hotspots.activate(NOUN_SKULL, false);
+ _scene->_hotspots.activate(NOUN_DRAIN, false);
+ _scene->_hotspots.activate(NOUN_RATS_NEST, false);
+ _scene->_hotspots.activate(NOUN_WEB, false);
+ _scene->_hotspots.activate(NOUN_STONE, false);
+ _scene->_hotspots.activate(NOUN_HOLE, false);
+ _scene->_hotspots.activate(NOUN_GATE, false);
+
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[9] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[10] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ _globals._spriteIndexes[11] = _scene->_sprites.addSprites(formAnimName('f', 2));
+ _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('f', 3));
+
+
+ if (_game.exitCatacombs(0) == -1) {
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('c', 1));
+ _scene->drawToBackground(_globals._spriteIndexes[1], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_NORTH, false);
+ }
+
+ if (_game.exitCatacombs(3) == -1) {
+ _globals._spriteIndexes[13] = _scene->_sprites.addSprites(formAnimName('c', 8));
+ _scene->drawToBackground(_globals._spriteIndexes[13], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_MORE_CATACOMBS, false);
+ _scene->_hotspots.activate(NOUN_GATE, true);
+ }
+
+ if (_game.exitCatacombs(1) == -1) {
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('c', 2));
+ _scene->drawToBackground(_globals._spriteIndexes[2], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_EAST, false);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_DRAIN) {
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('c', 3));
+ _scene->drawToBackground(_globals._spriteIndexes[3], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_DRAIN, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_RAT_NEST) {
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('c', 4));
+ _scene->drawToBackground(_globals._spriteIndexes[4], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_SKULL, true);
+ _scene->_hotspots.activate(NOUN_RATS_NEST, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_WEB) {
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('c', 5));
+ _scene->drawToBackground(_globals._spriteIndexes[5], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_WEB, true);
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_BRICK) {
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('c', 6));
+ _scene->drawToBackground(_globals._spriteIndexes[6], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activateAtPos(NOUN_EXPOSED_BRICK, false, Common::Point(138, 35));
+ _scene->_hotspots.activateAtPos(NOUN_EXPOSED_BRICK, false, Common::Point(84, 27));
+ }
+
+ if (_globals[kCatacombsMisc] & MAZE_EVENT_STONE) {
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('c', 7));
+ _scene->drawToBackground(_globals._spriteIndexes[7], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_HOLE, true);
+ _scene->_hotspots.activate(NOUN_STONE, true);
+ }
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ switch (_globals[kCatacombsFrom]) {
+ case 0:
+ _game._player._playerPos = Common::Point(107, 87);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(107, 98), FACING_SOUTH);
+ break;
+
+ case 1:
+ _game._player._playerPos = Common::Point(316, 129);
+ _game._player._facing = FACING_WEST;
+ _game._player.walk(Common::Point(277, 129), FACING_WEST);
+ break;
+
+ case 3:
+ _game._player.firstWalk(Common::Point(-20, 128), FACING_EAST, Common::Point(19, 128), FACING_EAST, true);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _greenFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene453::step() {
+}
+
+void Scene453::actions() {
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)) {
+ if (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME)) {
+ if (_frameInRoomFl)
+ _vm->_dialogs->show(29);
+ else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _game._objects.setRoom(OBJ_RED_FRAME, NOWHERE);
+ _game._objects[OBJ_RED_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _game._objects.setRoom(OBJ_GREEN_FRAME, NOWHERE);
+ _game._objects[OBJ_GREEN_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[10] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[10], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _greenFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _game._objects.setRoom(OBJ_BLUE_FRAME, NOWHERE);
+ _game._objects[OBJ_BLUE_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _game._objects.setRoom(OBJ_YELLOW_FRAME, NOWHERE);
+ _game._objects[OBJ_YELLOW_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE)) {
+ if (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_GREEN_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME)) {
+ if ((_takingFrameInRoomFl || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[9]);
+ _scene->_dynamicHotspots.remove(_redFrameHotspotId);
+ _game._objects.addToInventory(OBJ_RED_FRAME);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[10]);
+ _scene->_dynamicHotspots.remove(_greenFrameHotspotId);
+ _game._objects.addToInventory(OBJ_GREEN_FRAME);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[11]);
+ _scene->_dynamicHotspots.remove(_blueFrameHotspotId);
+ _game._objects.addToInventory(OBJ_BLUE_FRAME);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[12]);
+ _scene->_dynamicHotspots.remove(_yellowFrameHotspotId);
+ _game._objects.addToInventory(OBJ_YELLOW_FRAME);
+ }
+
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_NORTH)) {
+ _game.moveCatacombs(0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_EAST)) {
+ _game.moveCatacombs(1);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(45310);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(45311);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(45312);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ARCHWAY)) {
+ _vm->_dialogs->show(45313);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_EXPOSED_BRICK)) {
+ _vm->_dialogs->show(45314);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_HOLE)) {
+ _vm->_dialogs->show(45317);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SKULL)) {
+ _vm->_dialogs->show(45318);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WEB)) {
+ _vm->_dialogs->show(45324);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RATS_NEST)) {
+ _vm->_dialogs->show(45325);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DRAIN)) {
+ _vm->_dialogs->show(45327);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_STONE)) {
+ _vm->_dialogs->show(45328);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RED_FRAME) && !_game._objects.isInInventory(OBJ_RED_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_RED_FRAME, 802, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME) && !_game._objects.isInInventory(OBJ_GREEN_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_GREEN_FRAME, 819, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME) && !_game._objects.isInInventory(OBJ_BLUE_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_BLUE_FRAME, 817, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME) && !_game._objects.isInInventory(OBJ_YELLOW_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_YELLOW_FRAME, 804, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MORE_CATACOMBS)) {
+ _vm->_dialogs->show(45315);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GATE)) {
+ _vm->_dialogs->show(45330);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_SKULL)) {
+ _vm->_dialogs->show(45319);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_GATE)) {
+ _vm->_dialogs->show(45331);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_RATS_NEST)) {
+ _vm->_dialogs->show(45326);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_STONE)) {
+ _vm->_dialogs->show(45329);
+ _action._inProgress = false;
+ }
+}
+
+void Scene453::preActions() {
+ if (_action.isAction(VERB_EXIT_TO, NOUN_MORE_CATACOMBS))
+ _game.moveCatacombs(3);
+
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_RED_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_YELLOW_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_BLUE_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_GREEN_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR) && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _game._player._needToWalk = false;
+ else {
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[9]]->getFramePos(0);
+ _game._player.walk(Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene456::Scene456(MADSEngine *vm) : Scene4xx(vm) {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ _redFrameHotspotId = -1;
+ _greenFrameHotspotId = -1;
+ _blueFrameHotspotId = -1;
+ _yellowFrameHotspotId = -1;
+}
+
+void Scene456::synchronize(Common::Serializer &s) {
+ Scene4xx::synchronize(s);
+
+ s.syncAsByte(_frameInRoomFl);
+ s.syncAsByte(_takingFrameInRoomFl);
+
+ s.syncAsSint16LE(_redFrameHotspotId);
+ s.syncAsSint16LE(_greenFrameHotspotId);
+ s.syncAsSint16LE(_blueFrameHotspotId);
+ s.syncAsSint16LE(_yellowFrameHotspotId);
+}
+
+void Scene456::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_RED_FRAME);
+ _scene->addActiveVocab(NOUN_YELLOW_FRAME);
+ _scene->addActiveVocab(NOUN_BLUE_FRAME);
+ _scene->addActiveVocab(NOUN_GREEN_FRAME);
+}
+
+void Scene456::enter() {
+ _game.initCatacombs();
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('c', 1));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites("*RRD_9");
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('f', 0));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('f', 1));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('f', 2));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('f', 3));
+
+ if (_game.exitCatacombs(1) == -1) {
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_hotspots.activate(NOUN_ARCHWAY_TO_EAST, false);
+ }
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ switch (_globals[kCatacombsFrom]) {
+ case 1:
+ _game._player._playerPos = Common::Point(298, 123);
+ _game._player._facing = FACING_WEST;
+ _game._player.walk(Common::Point(254, 123), FACING_WEST);
+ break;
+
+ case 3:
+ _game._player._playerPos = Common::Point(14, 117);
+ _game._player._facing = FACING_SOUTH;
+ _game._player.walk(Common::Point(46, 117), FACING_EAST);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _greenFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene456::step() {
+}
+
+void Scene456::actions() {
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)) {
+ if (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME)) {
+ if (_frameInRoomFl) {
+ _vm->_dialogs->show(29);
+ } else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _game._objects.setRoom(OBJ_RED_FRAME, NOWHERE);
+ _game._objects[OBJ_RED_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _redFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_RED_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_redFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _game._objects.setRoom(OBJ_GREEN_FRAME, NOWHERE);
+ _game._objects[OBJ_GREEN_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _greenFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_GREEN_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_greenFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _game._objects.setRoom(OBJ_BLUE_FRAME, NOWHERE);
+ _game._objects[OBJ_BLUE_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _blueFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_BLUE_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_blueFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _game._objects.setRoom(OBJ_YELLOW_FRAME, NOWHERE);
+ _game._objects[OBJ_YELLOW_FRAME]._roomNumber = _globals[kCatacombsRoom] + 600;
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _yellowFrameHotspotId = _scene->_dynamicHotspots.add(NOUN_YELLOW_FRAME, VERB_WALK_TO, SYNTAX_SINGULAR, EXT_NONE, Common::Rect(pos.x - 5, pos.y - 5, pos.x + 5, pos.y + 1));
+ _scene->_dynamicHotspots.setPosition(_yellowFrameHotspotId, Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[1]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+
+ if (_action.isAction(VERB_TAKE)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_GREEN_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME))) {
+ if ((_takingFrameInRoomFl || _game._trigger)) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[1] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[1], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 5);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[1], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_SPRITE, 5, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1:
+ if (_action.isObject(NOUN_RED_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _scene->_dynamicHotspots.remove(_redFrameHotspotId);
+ _game._objects.addToInventory(OBJ_RED_FRAME);
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _scene->_dynamicHotspots.remove(_greenFrameHotspotId);
+ _game._objects.addToInventory(OBJ_GREEN_FRAME);
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[4]);
+ _scene->_dynamicHotspots.remove(_blueFrameHotspotId);
+ _game._objects.addToInventory(OBJ_BLUE_FRAME);
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME)) {
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+ _scene->_dynamicHotspots.remove(_yellowFrameHotspotId);
+ _game._objects.addToInventory(OBJ_YELLOW_FRAME);
+ }
+
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[1]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_WEST)) {
+ _game.moveCatacombs(3);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_EAST)) {
+ _game.moveCatacombs(1);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(45610);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(45611);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(45612);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ARCHWAY)) {
+ _vm->_dialogs->show(45613);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_EXPOSED_BRICK)) {
+ _vm->_dialogs->show(45614);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RED_FRAME) && !_game._objects.isInInventory(OBJ_RED_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_RED_FRAME, 802, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_GREEN_FRAME) && !_game._objects.isInInventory(OBJ_GREEN_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_GREEN_FRAME, 819, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BLUE_FRAME) && !_game._objects.isInInventory(OBJ_BLUE_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_BLUE_FRAME, 817, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_YELLOW_FRAME) && !_game._objects.isInInventory(OBJ_YELLOW_FRAME)) {
+ _vm->_dialogs->showItem(OBJ_YELLOW_FRAME, 804, 0);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MORE_CATACOMBS)) {
+ _vm->_dialogs->show(45615);
+ _action._inProgress = false;
+ }
+ }
+}
+
+void Scene456::preActions() {
+ _frameInRoomFl = false;
+ _takingFrameInRoomFl = false;
+
+ if (_game._objects[OBJ_RED_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_RED_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_YELLOW_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_YELLOW_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_BLUE_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_BLUE_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_game._objects[OBJ_GREEN_FRAME]._roomNumber == _globals[kCatacombsRoom] + 600) {
+ _frameInRoomFl = true;
+ if (_action.isAction(VERB_TAKE, NOUN_GREEN_FRAME))
+ _takingFrameInRoomFl = true;
+ }
+
+ if (_action.isAction(VERB_PUT) && _action.isTarget(NOUN_FLOOR)
+ && (_action.isObject(NOUN_RED_FRAME) || _action.isObject(NOUN_BLUE_FRAME) || _action.isObject(NOUN_YELLOW_FRAME) || _action.isObject(NOUN_GREEN_FRAME))) {
+ if (_frameInRoomFl)
+ _game._player._needToWalk = false;
+ else {
+ Common::Point pos = _scene->_sprites[_globals._spriteIndexes[2]]->getFramePos(0);
+ _game._player.walk(Common::Point(pos.x + 12, pos.y), FACING_NORTHWEST);
+ }
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+} // End of namespace Phantom
+} // End of namespace MADS
diff --git a/engines/mads/phantom/phantom_scenes4.h b/engines/mads/phantom/phantom_scenes4.h
new file mode 100644
index 0000000000..5aece98cd6
--- /dev/null
+++ b/engines/mads/phantom/phantom_scenes4.h
@@ -0,0 +1,265 @@
+/* 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.
+ *
+ */
+
+#ifndef MADS_PHANTOM_SCENES4_H
+#define MADS_PHANTOM_SCENES4_H
+
+#include "common/scummsys.h"
+#include "common/serializer.h"
+#include "mads/game.h"
+#include "mads/scene.h"
+#include "mads/phantom/phantom_scenes.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+class Scene4xx : public PhantomScene {
+protected:
+ /**
+ * Plays an appropriate sound when entering a scene
+ */
+ void sceneEntrySound();
+
+ /**
+ *Sets the AA file to use for the scene
+ */
+ void setAAName();
+
+ /**
+ * Updates the prefix used for getting player sprites for the scene
+ */
+ void setPlayerSpritesPrefix();
+public:
+ Scene4xx(MADSEngine *vm) : PhantomScene(vm) {}
+};
+
+class Scene401 : public Scene4xx {
+private:
+ bool _anim0ActvFl;
+ bool _frameInRoomFl;
+ bool _takingFrameInRoomFl;
+
+ int _redFrameHotspotId;
+ int _greenFrameHostpotId;
+ int _blueFrameHotspotId;
+ int _yellowFrameHotspotId;
+
+public:
+ Scene401(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene403 : public Scene4xx {
+private:
+ bool _frameInRoomFl;
+ bool _takingFrameInRoomFl;
+
+ int _redFrameHotspotId;
+ int _greenFrameHostpotId;
+ int _blueFrameHotspotId;
+ int _yellowFrameHotspotId;
+
+public:
+ Scene403(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene404 : public Scene4xx {
+private:
+ bool _frameInRoomFl;
+ bool _takingFrameInRoomFl;
+ bool _anim0ActvFl;
+
+ int _redFrameHotspotId;
+ int _greenFrameHostpotId;
+ int _blueFrameHotspotId;
+ int _yellowFrameHotspotId;
+
+public:
+ Scene404(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene406 : public Scene4xx {
+private:
+ bool _frameInRoomFl;
+ bool _takingFrameInRoomFl;
+
+ int _redFrameHotspotId;
+ int _greenFrameHostpotId;
+ int _blueFrameHotspotId;
+ int _yellowFrameHotspotId;
+
+public:
+ Scene406(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene407 : public Scene4xx {
+private:
+ bool _frameInRoomFl;
+ bool _takingFrameInRoomFl;
+
+ int _redFrameHotspotId;
+ int _greenFrameHotspotId;
+ int _blueFrameHotspotId;
+ int _yellowFrameHotspotId;
+
+public:
+ Scene407(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene408 : public Scene4xx {
+private:
+ bool _frameInRoomFl;
+ bool _takingFrameInRoomFl;
+
+ int _redFrameHotspotId;
+ int _greenFrameHotspotId;
+ int _blueFrameHotspotId;
+ int _yellowFrameHotspotId;
+
+public:
+ Scene408(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene409 : public Scene4xx {
+private:
+ bool _frameInRoomFl;
+ bool _takingFrameInRoomFl;
+
+ int _redFrameHotspotId;
+ int _greenFrameHotspotId;
+ int _blueFrameHotspotId;
+ int _yellowFrameHotspotId;
+
+public:
+ Scene409(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene410 : public Scene4xx {
+private:
+ int _skullSequence[26];
+ void getLeverInfo(Common::Point *pos, int *type, int lever_number, int *noun);
+
+public:
+ Scene410(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene453 : public Scene4xx {
+private:
+ bool _frameInRoomFl;
+ bool _takingFrameInRoomFl;
+
+ int _redFrameHotspotId;
+ int _greenFrameHotspotId;
+ int _blueFrameHotspotId;
+ int _yellowFrameHotspotId;
+
+public:
+ Scene453(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene456 : public Scene4xx {
+private:
+ bool _frameInRoomFl;
+ bool _takingFrameInRoomFl;
+
+ int _redFrameHotspotId;
+ int _greenFrameHotspotId;
+ int _blueFrameHotspotId;
+ int _yellowFrameHotspotId;
+
+public:
+ Scene456(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+} // End of namespace Phantom
+} // End of namespace MADS
+
+#endif /* MADS_PHANTOM_SCENES4_H */
diff --git a/engines/mads/phantom/phantom_scenes5.cpp b/engines/mads/phantom/phantom_scenes5.cpp
new file mode 100644
index 0000000000..2daaed9a90
--- /dev/null
+++ b/engines/mads/phantom/phantom_scenes5.cpp
@@ -0,0 +1,4308 @@
+/* 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.
+ *
+ */
+
+#include "common/scummsys.h"
+#include "mads/mads.h"
+#include "mads/conversations.h"
+#include "mads/scene.h"
+#include "mads/phantom/phantom_scenes.h"
+#include "mads/phantom/phantom_scenes5.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+void Scene5xx::setAAName() {
+ _game._aaName = Resources::formatAAName(1);
+ _vm->_palette->setEntry(254, 43, 47, 51);
+}
+
+void Scene5xx::sceneEntrySound() {
+ if (!_vm->_musicFlag)
+ return;
+
+ if ((_globals[kCoffinStatus] == 2) && !_game._visitedScenes.exists(506) && (_globals[kFightStatus] == 0) && (_scene->_currentSceneId == 504))
+ _vm->_sound->command(33);
+ else if (_scene->_currentSceneId == 505)
+ _vm->_sound->command((_vm->_gameConv->_restoreRunning == 20) ? 39 : 16);
+ else
+ _vm->_sound->command(16);
+}
+
+void Scene5xx::setPlayerSpritesPrefix() {
+ _vm->_sound->command(5);
+
+ Common::String oldName = _game._player._spritesPrefix;
+ if (!_game._player._forcePrefix)
+ _game._player._spritesPrefix = "RAL";
+ if (oldName != _game._player._spritesPrefix)
+ _game._player._spritesChanged = true;
+
+ _game._player._scalingVelocity = true;
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene501::Scene501(MADSEngine *vm) : Scene5xx(vm) {
+ _anim0ActvFl = false;
+ _skipFl = false;
+}
+
+void Scene501::synchronize(Common::Serializer &s) {
+ Scene5xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_skipFl);
+}
+
+void Scene501::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_CHRISTINE);
+ _scene->addActiveVocab(VERB_LOOK_AT);
+ _scene->addActiveVocab(VERB_WALK_TO);
+}
+
+void Scene501::enter() {
+ _scene->_hotspots.activate(NOUN_CHRISTINE, false);
+ _scene->_hotspots.activate(NOUN_BOAT, false);
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _anim0ActvFl = false;
+ _skipFl = false;
+ }
+
+ _vm->_gameConv->get(26);
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('a', 1));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('a', 0));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_6", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_9", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_8", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites("*RDRR_6");
+
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 6);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+
+ if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ if (_globals[kChristineIsInBoat]) {
+ _anim0ActvFl = true;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 1), 100);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 124);
+ _scene->_hotspots.activateAtPos(NOUN_CHRISTINE, true, Common::Point(113, 93));
+ _scene->_hotspots.activate(NOUN_BOAT, true);
+ }
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 4);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 4);
+ }
+
+ if (_scene->_priorSceneId == 506) {
+ _game._player._playerPos = Common::Point(305, 112);
+ _game._player._facing = FACING_WEST;
+ _game._player._stepEnabled = false;
+
+ if (_globals[kChristineIsInBoat]) {
+ _anim0ActvFl = true;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 1), 100);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 124);
+ _scene->_hotspots.activateAtPos(NOUN_CHRISTINE, true, Common::Point(113, 93));
+ _scene->_hotspots.activate(NOUN_BOAT, true);
+ _game._player.walk(Common::Point(260, 112), FACING_SOUTHWEST);
+ _game._player.setWalkTrigger(80);
+ _game._player.setWalkTrigger(55);
+ } else {
+ _anim0ActvFl = true;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('b', 1), 100);
+ _globals[kChristineIsInBoat] = true;
+ _scene->_hotspots.activate(NOUN_BOAT, true);
+ _game._player.walk(Common::Point(260, 112), FACING_SOUTHWEST);
+ _game._player.setWalkTrigger(80);
+ }
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 4);
+
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ } else if ((_scene->_priorSceneId == 401) || (_scene->_priorSceneId == 408) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player.firstWalk(Common::Point(-20, 109), FACING_EAST, Common::Point(24, 109), FACING_EAST, true);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 4);
+
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 4);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene501::step() {
+ switch (_game._trigger) {
+ case 55:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[2], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 56);
+ break;
+
+ case 56:
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 10);
+ if (!_globals[kChrisWillTakeSeat])
+ _game._player._stepEnabled = true;
+
+ _globals[kChrisWillTakeSeat] = false;
+ break;
+
+ default:
+ break;
+ }
+
+
+ switch (_game._trigger) {
+ case 60:
+ _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 4);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 61);
+ break;
+
+ case 61:
+ _vm->_sound->command(25);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, -1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 4);
+ _game._player._stepEnabled = true;
+ break;
+
+ case 80: {
+ _game._player.walk(Common::Point(255, 118), FACING_NORTHWEST);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 2);
+ int idx = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->setDynamicAnim(idx, _globals._animationIndexes[0], 0);
+ _scene->setDynamicAnim(idx, _globals._animationIndexes[0], 1);
+ _scene->setDynamicAnim(idx, _globals._animationIndexes[0], 2);
+ _scene->setDynamicAnim(idx, _globals._animationIndexes[0], 3);
+ }
+ break;
+
+ case 90:
+ _globals[kPlayerScore] += 5;
+ _scene->_nextSceneId = 310;
+ break;
+
+ case 100:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 9, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 90);
+ break;
+
+ default:
+ break;
+ }
+
+ if (_anim0ActvFl) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 103)
+ _scene->_hotspots.activateAtPos(NOUN_CHRISTINE, true, Common::Point(125, 94));
+
+ if ((_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 28) && !_skipFl) {
+ _skipFl = true;
+ _scene->_sequences.addTimer(1, 55);
+ }
+
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 124) {
+ _scene->_hotspots.activateAtPos(NOUN_CHRISTINE, false, Common::Point(125, 94));
+ _scene->_hotspots.activateAtPos(NOUN_CHRISTINE, true , Common::Point(113, 93));
+ }
+
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 125)
+ _scene->setAnimFrame(_globals._animationIndexes[0], 124);
+
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 1)
+ _scene->setAnimFrame(_globals._animationIndexes[0], 0);
+
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() == 84)
+ _game._player._stepEnabled = true;
+ }
+}
+
+void Scene501::actions() {
+ if (_vm->_gameConv->_running == 26) {
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_WEST) && (_globals[kChristineIsInBoat])) {
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(3);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_CHRISTINE)) {
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(1);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_INTO, NOUN_BOAT)) {
+ if (_game._objects.isInInventory(OBJ_OAR))
+ _anim0ActvFl = false;
+ else
+ _vm->_dialogs->show(50123);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_UNLOCK, NOUN_DOOR) || _action.isAction(VERB_LOCK, NOUN_DOOR)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1: {
+ int idx = _globals._sequenceIndexes[3];
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 4);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[3], SYNC_SEQ, idx);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], false);
+ _scene->_sequences.addTimer(15, 2);
+ _vm->_sound->command(74);
+ }
+ break;
+
+ case 2:
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[3]);
+ _game._player._visible = true;
+ _vm->_dialogs->show(50122);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR) || _action.isAction(VERB_OPEN, NOUN_DOOR)) {
+ if (_scene->_customDest.x < 287) {
+ if (!_globals[kChristineIsInBoat]) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1: {
+ int idx = _globals._sequenceIndexes[3];
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 4);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[3], SYNC_SEQ, idx);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], false);
+ _scene->_sequences.addTimer(15, 2);
+ _vm->_sound->command(74);
+ }
+ break;
+
+ case 2:
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[3]);
+ _game._player._visible = true;
+ _vm->_dialogs->show(50120);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ } else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_SPRITE, 4, 65);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 67);
+ break;
+
+ case 65:
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 4);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 66);
+ _vm->_sound->command(24);
+ break;
+
+ case 66:
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ _game._player.walk(Common::Point(305, 112), FACING_EAST);
+ _game._player.setWalkTrigger(68);
+ break;
+
+ case 67:
+ _game._player._visible = true;
+ break;
+
+ case 68:
+ _vm->_gameConv->abortConv();
+ _scene->_nextSceneId = 506;
+ break;
+ }
+ }
+ } else {
+ if (!_globals[kChristineIsInBoat]) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[3] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[3], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_SPRITE, 4, 65);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 67);
+ break;
+
+ case 65: {
+ int idx = _globals._sequenceIndexes[1];
+ _scene->deleteSequence(_globals._sequenceIndexes[1]);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 8, 1);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[1], SYNC_SEQ, idx);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 4);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 66);
+ _vm->_sound->command(24);
+ }
+ break;
+
+ case 66:
+ _game._player.walk(Common::Point(319, 116), FACING_NORTHWEST);
+ _game._player.setWalkTrigger(68);
+ break;
+
+ case 67:
+ _game._player._visible = true;
+ break;
+
+ case 68:
+ _globals._sequenceIndexes[1] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[1], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 69);
+ _vm->_sound->command(25);
+ break;
+
+ case 69:
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 5);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ _scene->_nextSceneId = 502;
+ break;
+ }
+ } else {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 1);
+ break;
+
+ case 1: {
+ int idx = _globals._sequenceIndexes[3];
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 4);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[3], SYNC_SEQ, idx);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], false);
+ _scene->_sequences.addTimer(15, 2);
+ _vm->_sound->command(73);
+ }
+ break;
+
+ case 2:
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[3], false);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 3);
+ break;
+
+ case 3:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[3]);
+ _game._player._visible = true;
+ _vm->_dialogs->show(50120);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(50110);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(50111);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(50112);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(50113);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LAKE)) {
+ _vm->_dialogs->show(50114);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_BOAT)) {
+ _vm->_dialogs->show(50126);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TORCH)) {
+ _vm->_dialogs->show(50117);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ARCHWAY_TO_WEST)) {
+ _vm->_dialogs->show(50118);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR)) {
+ if (_scene->_customDest.x < 287) {
+ if (_game._visitedScenes.exists(506))
+ _vm->_dialogs->show(50127);
+ else
+ _vm->_dialogs->show(50119);
+ } else {
+ if (_game._visitedScenes.exists(506))
+ _vm->_dialogs->show(50128);
+ else
+ _vm->_dialogs->show(50119);
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COLUMN)) {
+ _vm->_dialogs->show(50121);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHRISTINE)) {
+ _vm->_dialogs->show(50124);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_TORCH)) {
+ _vm->_dialogs->show(50125);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_CHRISTINE)) {
+ _vm->_dialogs->show(50129);
+ _action._inProgress = false;
+ }
+}
+
+void Scene501::preActions() {
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_WEST)) {
+ if (_globals[kLanternStatus] == 0) {
+ _game._player._needToWalk = false;
+ _vm->_dialogs->show(30918);
+ _game._player.cancelCommand();
+ } else if (!_globals[kChristineIsInBoat])
+ _game.enterCatacombs(0);
+ }
+
+ if ((_action.isObject(NOUN_DOOR)) && (_action.isAction(VERB_LOCK) || _action.isAction(VERB_UNLOCK) || _action.isAction(VERB_OPEN))) {
+ if (_scene->_customDest.x < 287)
+ _game._player.walk(Common::Point(266, 112), FACING_EAST);
+ else
+ _game._player.walk(Common::Point(287, 118), FACING_EAST);
+ }
+
+ if ((_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR) || _action.isAction(VERB_OPEN, NOUN_DOOR)) && _game._visitedScenes.exists(506) && _scene->_customDest.x < 287) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._readyToWalk = false;
+ _game._player._needToWalk = false;
+ _game._player._stepEnabled = false;
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(2);
+ _scene->_sequences.addTimer(6, 1);
+ break;
+
+ case 1:
+ if (_vm->_gameConv->_running >= 0)
+ _scene->_sequences.addTimer(6, 1);
+ else {
+ _game._player._stepEnabled = true;
+ _action._inProgress = true;
+ _game._player._needToWalk = true;
+ _game._player._readyToWalk = true;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_ARCHWAY_TO_WEST) && _globals[kLanternStatus] && _globals[kRightDoorIsOpen504])
+ _game._player.walk(Common::Point(24, 110), FACING_WEST);
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene502::Scene502(MADSEngine *vm) : Scene5xx(vm) {
+ _fire1ActiveFl = false;
+ _fire2ActiveFl = false;
+ _fire3ActiveFl = false;
+ _fire4ActiveFl = false;
+ _panelTurningFl = false;
+ _trapDoorHotspotEnabled = false;
+ _acceleratedFireActivationFl = false;
+
+ for (int i = 0; i < 16; i++) {
+ _puzzlePictures[i] = -1;
+ _puzzleSprites[i] = -1;
+ _puzzleSequences[i] = -1;
+ }
+
+ _panelPushedNum = -1;
+ _messageLevel = -1;
+ _cycleStage = -1;
+
+ _nextPos = Common::Point(-1, -1);
+
+ _lastFrameTime = 0;
+ _timer = 0;
+ _deathTimer = 0;
+
+ _cyclePointer = nullptr;
+}
+
+Scene502::~Scene502() {
+ if (_cyclePointer)
+ delete(_cyclePointer);
+}
+
+void Scene502::synchronize(Common::Serializer &s) {
+ Scene5xx::synchronize(s);
+
+ s.syncAsByte(_fire1ActiveFl);
+ s.syncAsByte(_fire2ActiveFl);
+ s.syncAsByte(_fire3ActiveFl);
+ s.syncAsByte(_fire4ActiveFl);
+ s.syncAsByte(_panelTurningFl);
+ s.syncAsByte(_trapDoorHotspotEnabled);
+ s.syncAsByte(_acceleratedFireActivationFl);
+
+ for (int i = 0; i < 16; i++) {
+ s.syncAsSint16LE(_puzzlePictures[i]);
+ s.syncAsSint16LE(_puzzleSprites[i]);
+ s.syncAsSint16LE(_puzzleSequences[i]);
+ }
+
+ s.syncAsSint16LE(_panelPushedNum);
+ s.syncAsSint16LE(_messageLevel);
+ s.syncAsSint16LE(_cycleStage);
+
+ s.syncAsSint16LE(_nextPos.x);
+ s.syncAsSint16LE(_nextPos.y);
+
+ s.syncAsUint32LE(_lastFrameTime);
+ s.syncAsUint32LE(_timer);
+ s.syncAsUint32LE(_deathTimer);
+
+ warning("more syncing required");
+}
+
+void Scene502::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+}
+
+void Scene502::enter() {
+ loadCyclingInfo();
+ _scene->loadSpeech(7);
+
+ _panelPushedNum = -1;
+ _panelTurningFl = false;
+ _fire1ActiveFl = false;
+ _fire2ActiveFl = false;
+ _fire3ActiveFl = false;
+ _fire4ActiveFl = false;
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _lastFrameTime = _scene->_frameStartTime;
+ _cycleStage = 0;
+ _timer = 0;
+ _deathTimer = 0;
+ _messageLevel = 1;
+ _acceleratedFireActivationFl = true;
+ _trapDoorHotspotEnabled = false;
+ }
+
+ _scene->_hotspots.activate(NOUN_ROPE, false);
+ _scene->_hotspots.activateAtPos(NOUN_TRAP_DOOR, false, Common::Point(225, 28));
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 3));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 4));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 5));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('a', 2));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('a', 1));
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('a', 3));
+ _globals._spriteIndexes[9] = _scene->_sprites.addSprites(formAnimName('x', 6));
+ _globals._spriteIndexes[10] = _scene->_sprites.addSprites(formAnimName('a', 0));
+ _globals._spriteIndexes[11] = _scene->_sprites.addSprites(formAnimName('j', 0));
+ _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('k', 0));
+ _globals._spriteIndexes[13] = _scene->_sprites.addSprites(formAnimName('l', 0));
+ _globals._spriteIndexes[14] = _scene->_sprites.addSprites(formAnimName('m', 0));
+ _globals._spriteIndexes[16] = _scene->_sprites.addSprites(formAnimName('h', 0));
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+ } else
+ _scene->drawToBackground(_globals._spriteIndexes[5], -2, Common::Point(-32000, -32000), 0, 100);
+
+ if ((_scene->_priorSceneId == 501) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ if (!_game._visitedScenes._sceneRevisited) {
+ if (_game._objects.isInInventory(OBJ_ROPE))
+ _globals[kCableHookWasSeparate] = true;
+ else
+ _globals[kCableHookWasSeparate] = false;
+ } else if (_globals[kCableHookWasSeparate]) {
+ _game._objects.addToInventory(OBJ_ROPE);
+ _game._objects.addToInventory(OBJ_CABLE_HOOK);
+ _game._objects.setRoom(OBJ_ROPE_WITH_HOOK, NOWHERE);
+ } else {
+ _game._objects.setRoom(OBJ_ROPE, NOWHERE);
+ _game._objects.setRoom(OBJ_CABLE_HOOK, NOWHERE);
+ _game._objects.addToInventory(OBJ_ROPE_WITH_HOOK);
+ }
+
+ _game._player._playerPos = Common::Point(43, 154);
+ _game._player._facing = FACING_EAST;
+ _game._player._stepEnabled = false;
+ _game._player.walk(Common::Point(87, 153), FACING_EAST);
+ _game._player.setWalkTrigger(77);
+ }
+
+ room_502_initialize_panels();
+
+ if (_trapDoorHotspotEnabled) {
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, 6);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 1);
+ _scene->_hotspots.activate(NOUN_TRAP_DOOR, false);
+ _scene->_hotspots.activateAtPos(NOUN_TRAP_DOOR, true, Common::Point(225, 28));
+ if (!_game._objects.isInInventory(OBJ_ROPE_WITH_HOOK) && !_game._objects.isInInventory(OBJ_CABLE_HOOK)) {
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 12);
+ _scene->_hotspots.activate(NOUN_ROPE, true);
+ }
+ } else {
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 14);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene502::step() {
+ if (_acceleratedFireActivationFl) {
+ int32 diff = _scene->_frameStartTime - _lastFrameTime;
+ if ((diff >= 0) && (diff <= 4)) {
+ _timer += diff;
+ _deathTimer += diff;
+ } else {
+ _timer += 1;
+ _deathTimer += 1;
+ }
+ _lastFrameTime = _scene->_frameStartTime;
+
+ if (_timer >= 300) {
+ _timer = 0;
+ if (_cycleStage < 8)
+ ++_cycleStage;
+ }
+ }
+
+ if ((_deathTimer >= 7200) && !_panelTurningFl) {
+ _vm->_dialogs->show(50215);
+ _game._player.walk(Common::Point(160, 148), FACING_NORTH);
+ _game._player.setWalkTrigger(71);
+ _game._player._stepEnabled = false;
+ _panelTurningFl = true;
+ _deathTimer = 0;
+ }
+
+ if ((_deathTimer > 900) && (_messageLevel == 1) && !_panelTurningFl) {
+ _messageLevel = 2;
+ _vm->_dialogs->show(50212);
+ }
+
+ if ((_deathTimer > 3600) && (_messageLevel == 2) && !_panelTurningFl) {
+ _messageLevel = 3;
+ _vm->_dialogs->show(50213);
+ }
+
+ if ((_deathTimer > 5400) && (_messageLevel == 3) && !_panelTurningFl) {
+ _messageLevel = 4;
+ _vm->_dialogs->show(50214);
+ }
+
+ switch (_game._trigger) {
+ case 71:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[4] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[4], false, 7, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 72);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 44, 73);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 51, 74);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 32, 75);
+ break;
+
+ case 72:
+ _globals._sequenceIndexes[4] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[4], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 1);
+ _scene->_userInterface.noInventoryAnim();
+ // CHECKME: Not sure about the next function call
+ _scene->_userInterface.refresh();
+ _scene->_sequences.addTimer(120, 76);
+ break;
+
+ case 73:
+ _vm->_sound->command(1);
+ _vm->_sound->command(67);
+ break;
+
+ case 74:
+ _vm->_sound->command(27);
+ break;
+
+ case 75:
+ _scene->playSpeech(7);
+ break;
+
+ case 76:
+ _scene->_reloadSceneFlag = true;
+ break;
+
+ case 77:
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 7, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 78);
+ break;
+
+ case 78:
+ _vm->_dialogs->show(50211);
+ _scene->drawToBackground(_globals._spriteIndexes[5], -2, Common::Point(-32000, -32000), 0, 100);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+
+ if (!_trapDoorHotspotEnabled)
+ animateFireBursts();
+
+ setPaletteCycle();
+}
+
+void Scene502::actions() {
+ if (_game._trigger >= 110) {
+ handlePanelAnimation();
+ _action._inProgress = false;
+ return;
+ }
+
+ switch (_game._trigger) {
+ case 80:
+ _globals._sequenceIndexes[6] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[6], false, 6);
+ _scene->_hotspots.activateAtPos(NOUN_ROPE, true, Common::Point(225, 28));
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[6], 1);
+ _scene->_hotspots.activate(NOUN_TRAP_DOOR, false);
+ _scene->_hotspots.activateAtPos(NOUN_TRAP_DOOR, true, Common::Point(225, 28));
+ if (!_panelTurningFl)
+ _vm->_dialogs->show(50216);
+
+ _action._inProgress = false;
+ return;
+
+ case 90:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[10] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[10], false, 7, 2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[10], true);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[10], 14, 18);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_EXPIRE, 0, 91);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_SPRITE, 18, 110);
+ _action._inProgress = false;
+ return;
+
+ case 91:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[10]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ _scene->_sequences.addTimer(5, 102);
+ _action._inProgress = false;
+ return;
+
+ case 95:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[10] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[10], false, 7, 2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[10], true);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[10], 8, 13);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_EXPIRE, 0, 96);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_SPRITE, 13, 110);
+ _action._inProgress = false;
+ return;
+
+ case 96:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[10]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ _scene->_sequences.addTimer(5, 102);
+ _action._inProgress = false;
+ return;
+
+ case 100:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[10] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[10], false, 9, 2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[10], true);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[10], 5, 7);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_EXPIRE, 0, 101);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_SPRITE, 7, 110);
+ _action._inProgress = false;
+ return;
+
+ case 101:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[10]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(5, 102);
+ _action._inProgress = false;
+ return;
+
+ case 102:
+ _panelTurningFl = false;
+ _game._player._stepEnabled = true;
+ _action._inProgress = false;
+ return;
+
+ case 105:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[10] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[10], false, 8, 2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[10], true);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[10], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[10], 1, 4);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_EXPIRE, 0, 106);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[10], SEQUENCE_TRIGGER_SPRITE, 4, 110);
+ _action._inProgress = false;
+ return;
+
+ case 106:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[10]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(5, 102);
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+
+ if (_action.isAction(VERB_PUSH, NOUN_PANEL)) {
+ if (_panelTurningFl) {
+ _action._inProgress = false;
+ return;
+ }
+
+ Common::Point walkToPos;
+ getPanelInfo(&walkToPos, &_panelPushedNum, _scene->_customDest, &_nextPos);
+ _panelTurningFl = true;
+
+ switch (_panelPushedNum) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ _scene->_sequences.addTimer(1, 90);
+ break;
+
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ _scene->_sequences.addTimer(1, 95);
+ break;
+
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ _scene->_sequences.addTimer(1, 100);
+ break;
+
+ default:
+ _scene->_sequences.addTimer(1, 105);
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_THROW, NOUN_ROPE_WITH_HOOK, NOUN_TRAP_DOOR) || _action.isAction(VERB_GRAPPLE, NOUN_TRAP_DOOR)) {
+ if (_trapDoorHotspotEnabled) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _panelTurningFl = true;
+ _globals._sequenceIndexes[7] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[7], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[7], 13);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[7], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_EXPIRE, 0, 82);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_SPRITE, 10, 83);
+ _game._objects.setRoom(OBJ_ROPE_WITH_HOOK, NOWHERE);
+ break;
+
+ case 82:
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ _panelTurningFl = false;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[7]);
+ _globals._sequenceIndexes[9] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[9], false, -2);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[9], 13);
+ _scene->_hotspots.activate(NOUN_ROPE, true);
+ break;
+
+ case 83:
+ _vm->_sound->command(69);
+ break;
+
+ default:
+ break;
+ }
+ } else
+ _vm->_dialogs->show(50229);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB_THROUGH, NOUN_TRAP_DOOR)
+ && (_game._objects.isInInventory(OBJ_ROPE_WITH_HOOK) || _game._objects.isInInventory(OBJ_CABLE_HOOK))) {
+ _vm->_dialogs->show(50228);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_THROW, NOUN_ROPE, NOUN_TRAP_DOOR)) {
+ _vm->_dialogs->show(50226);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_THROW, NOUN_CABLE_HOOK, NOUN_TRAP_DOOR)) {
+ _vm->_dialogs->show(50227);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLIMB, NOUN_ROPE) || _action.isAction(VERB_CLIMB_THROUGH, NOUN_TRAP_DOOR)) {
+ switch (_game._trigger) {
+ case 0:
+ _globals[kPlayerScore] += 5;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _panelTurningFl = true;
+ _globals._sequenceIndexes[8] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[8], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[8], 10);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 82);
+ break;
+
+ case 82:
+ _scene->_nextSceneId = 504;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(50210);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(50217);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TRAP_DOOR)) {
+ _vm->_dialogs->show(_trapDoorHotspotEnabled ? 50220 : 50225);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(50219);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR)) {
+ _vm->_dialogs->show(50221);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PANELS)) {
+ _vm->_dialogs->show(50222);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PANEL)) {
+ _vm->_dialogs->show(50223);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(50224);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ROPE) && !_game._objects.isInInventory(OBJ_ROPE)
+ && !_game._objects.isInInventory(OBJ_CABLE_HOOK) && !_game._objects.isInInventory(OBJ_ROPE_WITH_HOOK)) {
+ _vm->_dialogs->show(50233);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_TRAP_DOOR)) {
+ _vm->_dialogs->show(_trapDoorHotspotEnabled ? 50230 : 50228);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE, NOUN_TRAP_DOOR)) {
+ _vm->_dialogs->show(_trapDoorHotspotEnabled ? 50228 : 50231);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_ROPE) && !_game._objects.isInInventory(OBJ_ROPE)
+ && !_game._objects.isInInventory(OBJ_CABLE_HOOK) && !_game._objects.isInInventory(OBJ_ROPE_WITH_HOOK)) {
+ _vm->_dialogs->show(50234);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LASSO, NOUN_TRAP_DOOR)) {
+ _vm->_dialogs->show(50232);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene502::preActions() {
+ int panel;
+
+ if (_action.isAction(VERB_PUSH, NOUN_PANEL)) {
+ Common::Point walkToPos;
+ Common::Point tmpPos;
+ getPanelInfo(&walkToPos, &panel, _scene->_customDest, &tmpPos);
+ _game._player.walk(walkToPos, FACING_NORTH);
+ }
+
+ if (_trapDoorHotspotEnabled && (_action.isAction(VERB_CLIMB, NOUN_ROPE) || _action.isAction(VERB_CLIMB_THROUGH, NOUN_TRAP_DOOR)))
+ _game._player.walk(Common::Point(211, 149), FACING_NORTH);
+
+ if (_trapDoorHotspotEnabled && (_action.isAction(VERB_THROW, NOUN_ROPE_WITH_HOOK, NOUN_TRAP_DOOR) || _action.isAction(VERB_GRAPPLE, NOUN_TRAP_DOOR)))
+ _game._player.walk(Common::Point(200, 149), FACING_NORTH);
+}
+
+void Scene502::room_502_initialize_panels() {
+ for (int i = 0, curPuzzleSprite = 2, count = 1; i < 16; i++) {
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING)
+ _puzzlePictures[i] = _vm->getRandomNumber(1, 4);
+
+ curPuzzleSprite += (_puzzlePictures[i] * 3) - 3;
+ _puzzleSprites[i] = curPuzzleSprite;
+
+ int sprIdx;
+
+ switch (i) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ sprIdx = _globals._spriteIndexes[11];
+ break;
+
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ sprIdx = _globals._spriteIndexes[12];
+ break;
+
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ sprIdx = _globals._spriteIndexes[13];
+ break;
+
+ default:
+ sprIdx = _globals._spriteIndexes[14];
+ break;
+ }
+
+ _globals._sequenceIndexes[15] = _scene->_sequences.addStampCycle(sprIdx, false, curPuzzleSprite);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[15], 14);
+ _puzzleSequences[i] = _globals._sequenceIndexes[15];
+
+ ++count;
+ if (count >= 5)
+ count = 1;
+
+ switch (count) {
+ case 1:
+ curPuzzleSprite = 2;
+ break;
+
+ case 2:
+ curPuzzleSprite = 14;
+ break;
+
+ case 3:
+ curPuzzleSprite = 26;
+ break;
+
+ case 4:
+ curPuzzleSprite = 38;
+ break;
+ }
+ }
+}
+
+void Scene502::loadCyclingInfo() {
+ warning("TODO: loadCyclingInfo");
+}
+
+void Scene502::animateFireBursts() {
+ int rndTrigger;
+
+ if (_acceleratedFireActivationFl)
+ rndTrigger = _vm->getRandomNumber(1, 50);
+ else
+ rndTrigger = _vm->getRandomNumber(1, 400);
+
+ if (rndTrigger == 1) {
+ rndTrigger = _vm->getRandomNumber(1, 4);
+
+ switch (rndTrigger) {
+ case 1:
+ if (!_fire1ActiveFl) {
+ _scene->_sequences.addTimer(_vm->getRandomNumber(300, 600), 60);
+ _fire1ActiveFl = true;
+ }
+ break;
+
+ case 2:
+ if (!_fire2ActiveFl) {
+ _scene->_sequences.addTimer(_vm->getRandomNumber(300, 600), 63);
+ _fire2ActiveFl = true;
+ }
+ break;
+
+ case 3:
+ if (!_fire3ActiveFl) {
+ _scene->_sequences.addTimer(_vm->getRandomNumber(300, 600), 66);
+ _fire3ActiveFl = true;
+ }
+ break;
+
+ case 4:
+ if (!_fire4ActiveFl) {
+ _scene->_sequences.addTimer(_vm->getRandomNumber(300, 600), 69);
+ _fire4ActiveFl = true;
+ }
+ break;
+ }
+ }
+
+ switch (_game._trigger) {
+ case 60:
+ if ((_game._player._playerPos.x < 198) || (_game._player._playerPos.y > 150)) {
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 5, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], 1, 10);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 61);
+ }
+ break;
+
+ case 61:
+ _fire1ActiveFl = false;
+ break;
+
+ case 63:
+ if ((_game._player._playerPos.x > 127) || (_game._player._playerPos.y < 150)) {
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 5, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], 1, 10);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[1], SEQUENCE_TRIGGER_EXPIRE, 0, 64);
+ }
+ break;
+
+ case 64:
+ _fire2ActiveFl = false;
+ break;
+
+ case 66:
+ if (_game._player._playerPos.x < 198) {
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 5, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], 1, 10);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[2], SEQUENCE_TRIGGER_EXPIRE, 0, 67);
+ }
+ break;
+
+ case 67:
+ _fire3ActiveFl = false;
+ break;
+
+ case 69:
+ if ((_game._player._playerPos.x > 110) || (_game._player._playerPos.y > 150)) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 5, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], 1, 10);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 70);
+ }
+ break;
+
+ case 70:
+ _fire4ActiveFl = false;
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene502::setPaletteCycle() {
+ warning("TODO: setPaletteCycle");
+}
+
+void Scene502::getPanelInfo(Common::Point *walkToPos, int *panel, Common::Point mousePos, Common::Point *interimPos) {
+ walkToPos->y = 148;
+
+ if ((mousePos.x < 120) || (mousePos.y < 75) || (mousePos.y > 137))
+ return;
+
+ if (mousePos.x <= 139) {
+ interimPos->x = 129;
+ if (mousePos.y <= 90) {
+ *panel = 0;
+ interimPos->y = 90;
+ walkToPos->x = 107;
+ } else if (mousePos.y <= 106) {
+ *panel = 4;
+ interimPos->y = 106;
+ walkToPos->x = 107;
+ } else if (mousePos.y <= 122) {
+ *panel = 8;
+ interimPos->y = 122;
+ walkToPos->x = 107;
+ } else {
+ *panel = 12;
+ interimPos->y = 138;
+ walkToPos->x = 107;
+ }
+ } else if (mousePos.x <= 159) {
+ interimPos->x = 149;
+ if (mousePos.y <= 90) {
+ *panel = 1;
+ interimPos->y = 90;
+ walkToPos->x = 127;
+ } else if (mousePos.y <= 106) {
+ *panel = 5;
+ interimPos->y = 106;
+ walkToPos->x = 127;
+ } else if (mousePos.y <= 122) {
+ *panel = 9;
+ interimPos->y = 122;
+ walkToPos->x = 127;
+ } else {
+ *panel = 13;
+ interimPos->y = 138;
+ walkToPos->x = 127;
+ }
+ } else if (mousePos.x <= 179) {
+ interimPos->x = 169;
+ if (mousePos.y <= 90) {
+ *panel = 2;
+ interimPos->y = 90;
+ walkToPos->x = 147;
+ } else if (mousePos.y <= 106) {
+ *panel = 6;
+ interimPos->y = 106;
+ walkToPos->x = 147;
+ } else if (mousePos.y <= 122) {
+ *panel = 10;
+ interimPos->y = 122;
+ walkToPos->x = 147;
+ } else {
+ *panel = 14;
+ interimPos->y = 138;
+ walkToPos->x = 147;
+ }
+ } else if (mousePos.x <= 199) {
+ interimPos->x = 189;
+ if (mousePos.y <= 90) {
+ *panel = 3;
+ interimPos->y = 90;
+ walkToPos->x = 167;
+ } else if (mousePos.y <= 106) {
+ *panel = 7;
+ interimPos->y = 106;
+ walkToPos->x = 167;
+ } else if (mousePos.y <= 122) {
+ *panel = 11;
+ interimPos->y = 122;
+ walkToPos->x = 167;
+ } else {
+ *panel = 15;
+ interimPos->y = 138;
+ walkToPos->x = 167;
+ }
+ }
+}
+
+void Scene502::handlePanelAnimation() {
+ switch (_game._trigger) {
+ case 110:
+ _vm->_sound->command(65);
+ _scene->deleteSequence(_puzzleSequences[_panelPushedNum]);
+ switch (_panelPushedNum) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, _puzzleSprites[_panelPushedNum] - 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+ _scene->_sequences.addTimer(5, 111);
+ break;
+
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, _puzzleSprites[_panelPushedNum] - 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+ _scene->_sequences.addTimer(5, 111);
+ break;
+
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ _globals._sequenceIndexes[13] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[13], false, _puzzleSprites[_panelPushedNum] - 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[13], 14);
+ _scene->_sequences.addTimer(5, 111);
+ break;
+
+ default:
+ _globals._sequenceIndexes[14] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[14], false, _puzzleSprites[_panelPushedNum] - 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[14], 14);
+ _scene->_sequences.addTimer(5, 111);
+ break;
+ }
+ break;
+
+ case 111:
+ switch (_panelPushedNum) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ _scene->deleteSequence(_globals._sequenceIndexes[11]);
+ break;
+
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ _scene->deleteSequence(_globals._sequenceIndexes[12]);
+ break;
+
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ _scene->deleteSequence(_globals._sequenceIndexes[13]);
+ break;
+
+ default:
+ _scene->deleteSequence(_globals._sequenceIndexes[14]);
+ break;
+ }
+
+ _globals._sequenceIndexes[16] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[16], false, 5, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[16], 14);
+ _scene->_sequences.setPosition(_globals._sequenceIndexes[16], _nextPos);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[16], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[16], SEQUENCE_TRIGGER_EXPIRE, 0, 112);
+ break;
+
+ case 112: {
+ int idx = _globals._sequenceIndexes[16];
+ int newSprId = _puzzleSprites[_panelPushedNum] + 4;
+
+ switch (_panelPushedNum) {
+ case 0:
+ case 4:
+ case 8:
+ case 12:
+ if (newSprId > 12)
+ newSprId = 3;
+ break;
+
+ case 1:
+ case 5:
+ case 9:
+ case 13:
+ if (newSprId > 24)
+ newSprId = 15;
+ break;
+
+ case 2:
+ case 6:
+ case 10:
+ case 14:
+ if (newSprId > 36)
+ newSprId = 27;
+ break;
+
+ default:
+ if (newSprId > 48)
+ newSprId = 39;
+ break;
+ }
+
+ switch (_panelPushedNum) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, newSprId);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[11], SYNC_SEQ, idx);
+ _scene->_sequences.addTimer(5, 113);
+ break;
+
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, newSprId);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[12], SYNC_SEQ, idx);
+ _scene->_sequences.addTimer(5, 113);
+ break;
+
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ _globals._sequenceIndexes[13] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[13], false, newSprId);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[13], 14);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[13], SYNC_SEQ, idx);
+ _scene->_sequences.addTimer(5, 113);
+ break;
+
+ default:
+ _globals._sequenceIndexes[14] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[14], false, newSprId);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[14], 14);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[14], SYNC_SEQ, idx);
+ _scene->_sequences.addTimer(5, 113);
+ break;
+ }
+ }
+ break;
+
+ case 113: {
+ switch (_panelPushedNum) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ _scene->deleteSequence(_globals._sequenceIndexes[11]);
+ break;
+
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ _scene->deleteSequence(_globals._sequenceIndexes[12]);
+ break;
+
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ _scene->deleteSequence(_globals._sequenceIndexes[13]);
+ break;
+
+ default:
+ _scene->deleteSequence(_globals._sequenceIndexes[14]);
+ break;
+ }
+
+ int newSprId = _puzzleSprites[_panelPushedNum] + 3;
+
+ switch (_panelPushedNum) {
+ case 0:
+ case 4:
+ case 8:
+ case 12:
+ if (newSprId > 12)
+ newSprId = 2;
+ break;
+
+ case 1:
+ case 5:
+ case 9:
+ case 13:
+ if (newSprId > 24)
+ newSprId = 14;
+ break;
+
+ case 2:
+ case 6:
+ case 10:
+ case 14:
+ if (newSprId > 36)
+ newSprId = 26;
+ break;
+
+ default:
+ if (newSprId > 48)
+ newSprId = 38;
+ break;
+ }
+ _puzzleSprites[_panelPushedNum] = newSprId;
+ ++_puzzlePictures[_panelPushedNum];
+ if (_puzzlePictures[_panelPushedNum] >= 5)
+ _puzzlePictures[_panelPushedNum] = 1;
+
+ switch (_panelPushedNum) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ _globals._sequenceIndexes[11] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[11], false, newSprId);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[11], 14);
+ _puzzleSequences[_panelPushedNum] = _globals._sequenceIndexes[11];
+ break;
+
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ _globals._sequenceIndexes[12] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[12], false, newSprId);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[12], 14);
+ _puzzleSequences[_panelPushedNum] = _globals._sequenceIndexes[12];
+ break;
+
+ case 8:
+ case 9:
+ case 10:
+ case 11:
+ _globals._sequenceIndexes[13] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[13], false, newSprId);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[13], 14);
+ _puzzleSequences[_panelPushedNum] = _globals._sequenceIndexes[13];
+ break;
+
+ default:
+ _globals._sequenceIndexes[14] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[14], false, newSprId);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[14], 14);
+ _puzzleSequences[_panelPushedNum] = _globals._sequenceIndexes[14];
+ break;
+ }
+
+ int puzzleSolvedFl = true;
+ for (int i = 0; i < 16; i++) {
+ if (_puzzlePictures[i] != 1)
+ puzzleSolvedFl = false;
+ }
+
+ if (puzzleSolvedFl && !_trapDoorHotspotEnabled) {
+ _trapDoorHotspotEnabled = true;
+ _scene->deleteSequence(_globals._sequenceIndexes[6]);
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('t', 1), 80);
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene504::Scene504(MADSEngine *vm) : Scene5xx(vm) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _anim3ActvFl = false;
+ _anim4ActvFl = false;
+ _anim5ActvFl = false;
+ _playingMusicFl = false;
+ _chairDialogDoneFl = false;
+ _fireBreathFl = false;
+
+ _songNum = -1;
+ _input3Count = -1;
+ _playCount = -1;
+ _listenStatus = -1;
+ _listenFrame = -1;
+ _chairStatus = -1;
+ _chairFrame = -1;
+ _playStatus = -1;
+ _playFrame = -1;
+ _phantomStatus = -1;
+ _phantomFrame = -1;
+ _christineTalkCount = -1;
+ _deathCounter = -1;
+}
+
+void Scene504::synchronize(Common::Serializer &s) {
+ Scene5xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_anim2ActvFl);
+ s.syncAsByte(_anim3ActvFl);
+ s.syncAsByte(_anim4ActvFl);
+ s.syncAsByte(_anim5ActvFl);
+ s.syncAsByte(_playingMusicFl);
+ s.syncAsByte(_chairDialogDoneFl);
+ s.syncAsByte(_fireBreathFl);
+
+ s.syncAsSint16LE(_songNum);
+ s.syncAsSint16LE(_input3Count);
+ s.syncAsSint16LE(_playCount);
+ s.syncAsSint16LE(_listenStatus);
+ s.syncAsSint16LE(_listenFrame);
+ s.syncAsSint16LE(_chairStatus);
+ s.syncAsSint16LE(_chairFrame);
+ s.syncAsSint16LE(_playStatus);
+ s.syncAsSint16LE(_playFrame);
+ s.syncAsSint16LE(_phantomStatus);
+ s.syncAsSint16LE(_phantomFrame);
+ s.syncAsSint16LE(_christineTalkCount);
+ s.syncAsSint16LE(_deathCounter);
+}
+
+void Scene504::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_PHANTOM);
+ _scene->addActiveVocab(NOUN_CHRISTINE);
+}
+
+void Scene504::enter() {
+ _vm->_disableFastwalk = true;
+
+ _input3Count = 0;
+ _deathCounter = 0;
+ _anim2ActvFl = false;
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _playCount = 0;
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim3ActvFl = false;
+ _anim4ActvFl = false;
+ _anim5ActvFl = false;
+ _playingMusicFl = false;
+ _fireBreathFl = false;
+ _chairDialogDoneFl = false;
+ _songNum = 0;
+ _phantomStatus = 0;
+ }
+
+ _scene->_hotspots.activate(NOUN_CHRISTINE, false);
+
+ if (!_globals[kRightDoorIsOpen504]) {
+ _vm->_gameConv->get(19);
+ _vm->_gameConv->get(27);
+ } else
+ _vm->_gameConv->get(21);
+
+ _vm->_gameConv->get(26);
+
+ _globals._spriteIndexes[14] = _scene->_sprites.addSprites("*RDR_9");
+ _globals._spriteIndexes[15] = _scene->_sprites.addSprites(formAnimName('x', 8));
+
+ if (!_game._objects.isInRoom(OBJ_MUSIC_SCORE)) {
+ _globals._sequenceIndexes[15] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[15], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[15], 14);
+ _scene->_hotspots.activate(NOUN_MUSIC_SCORE, false);
+ }
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[13] = _scene->_sprites.addSprites(formAnimName('x', 7), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+
+ if (_globals[kFightStatus] == 0)
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 1));
+
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 3));
+
+ if ((_scene->_priorSceneId == 505) || ((_scene->_priorSceneId == 504) && _globals[kRightDoorIsOpen504])) {
+ if ((_globals[kFightStatus] == 0) && (_globals[kCoffinStatus] == 2)) {
+ _scene->_hotspots.activate(NOUN_CHRISTINE, true);
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+
+ _globals._spriteIndexes[13] = _scene->_sprites.addSprites(formAnimName('x', 7), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('b', 0));
+
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_6", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACERAL", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACEXDFR", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACEPHN", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+
+ _globals._spriteIndexes[11] = _scene->_sprites.addSprites(formAnimName('a', 5));
+ _globals._spriteIndexes[10] = _scene->_sprites.addSprites(formAnimName('a', 3), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('a', 6), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('a', 7), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[9] = _scene->_sprites.addSprites(formAnimName('a', 0), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('p', 1), 0);
+ int hotspotIdx = _scene->_dynamicHotspots.add(NOUN_PHANTOM, VERB_LOOK_AT, SYNTAX_MASC_NOT_PROPER, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[hotspotIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(hotspotIdx, Common::Point(-2, -2), FACING_NONE);
+
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 4);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 8);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 13);
+
+ _phantomStatus = 0;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _anim3ActvFl = true;
+ } else {
+ if (_globals[kFightStatus])
+ _scene->drawToBackground(_globals._spriteIndexes[13], 1, Common::Point(-32000, -32000), 0, 100);
+
+ if (_globals[kCoffinStatus] != 2) {
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ }
+
+ _game._player._playerPos = Common::Point(317, 115);
+ _game._player._facing = FACING_SOUTHWEST;
+ _game._player.walk(Common::Point(279, 121), FACING_SOUTHWEST);
+
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+
+ if (!_game._visitedScenes.exists(506) && (_globals[kCoffinStatus] == 2)) {
+ _scene->changeVariant(1);
+
+ _scene->drawToBackground(_globals._spriteIndexes[13], 1, Common::Point(-32000, -32000), 0, 100);
+ _anim5ActvFl = true;
+
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_2");
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACERAL", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACEXDFR",PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACEPHN", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('p', 3), 0);
+ int hotspotIdx = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _phantomStatus = 5;
+ _scene->_dynamicHotspots[hotspotIdx]._articleNumber = PREP_ON;
+ _scene->setAnimFrame(_globals._animationIndexes[3], 79);
+ _scene->_dynamicHotspots.setPosition(hotspotIdx, Common::Point(66, 119), FACING_NORTHWEST);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 0);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 1);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 2);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 3);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 4);
+ }
+ }
+ } else if (_scene->_priorSceneId == 506) {
+ _game._player._playerPos = Common::Point(0, 109);
+ _game._player._facing = FACING_SOUTHEAST;
+ _game._player.walk(Common::Point(39, 118), FACING_SOUTHEAST);
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->drawToBackground(_globals._spriteIndexes[13], 1, Common::Point(-32000, -32000), 0, 100);
+ } else if (_scene->_priorSceneId == 504) {
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+
+ _game._player._playerPos = Common::Point(147, 131);
+ _game._player._facing = FACING_EAST;
+ } else if ((_scene->_priorSceneId == 502) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('t', 1), 60);
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _game._player._playerPos = Common::Point(147, 131);
+ _game._player._facing = FACING_EAST;
+ }
+
+ if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ if (!_globals[kRightDoorIsOpen504]) {
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._sequenceIndexes[2] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[2], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ }
+
+ if (_vm->_gameConv->_restoreRunning == 19) {
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('l', 1), 67);
+ _anim0ActvFl = true;
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _game._player._playerPos = Common::Point(286, 120);
+ _game._player._facing = FACING_EAST;
+ _listenStatus = 0;
+ _scene->setAnimFrame(_globals._animationIndexes[0], 8);
+ _vm->_gameConv->run(19);
+ _vm->_gameConv->exportValue(_game._difficulty);
+ } else if (_vm->_gameConv->_restoreRunning == 27) {
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('x', 4), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('x', 5), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('o', 1), 100);
+
+ _scene->setAnimFrame(_globals._animationIndexes[1], 22);
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _playingMusicFl = false;
+ _anim1ActvFl = true;
+ _playStatus = 0;
+ _vm->_gameConv->run(27);
+ } else if ((_globals[kFightStatus] <= 1) && (_globals[kCoffinStatus] == 2)) {
+ if ((_phantomStatus == 1) || (_phantomStatus == 2)) {
+ _scene->_hotspots.activate(NOUN_CHRISTINE, true);
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('b', 0));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_6", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACERAL", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACEXDFR", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACEPHN", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+
+ _globals._spriteIndexes[11] = _scene->_sprites.addSprites(formAnimName('a', 5));
+ _globals._spriteIndexes[10] = _scene->_sprites.addSprites(formAnimName('a', 3), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('a', 6), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('a', 7), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[9] = _scene->_sprites.addSprites(formAnimName('a', 0), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('p', 1), 0);
+ int hotspotIdx = _scene->_dynamicHotspots.add(NOUN_PHANTOM, VERB_LOOK_AT, SYNTAX_MASC_NOT_PROPER, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[hotspotIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(hotspotIdx, Common::Point(-2, -2), FACING_NONE);
+
+ if (_phantomStatus == 1)
+ _scene->setAnimFrame(_globals._animationIndexes[3], _vm->getRandomNumber(109, 112));
+ else if (_phantomStatus == 2) {
+ _scene->setAnimFrame(_globals._animationIndexes[3], _vm->getRandomNumber(148, 150));
+ _scene->drawToBackground(_globals._spriteIndexes[13], 1, Common::Point(-32000, -32000), 0, 100);
+ }
+
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 4);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 8);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 13);
+
+ _game._player._visible = false;
+ _anim3ActvFl = true;
+
+ if (_vm->_gameConv->_restoreRunning == 21) {
+ _game._player._stepEnabled = false;
+ _vm->_gameConv->run(21);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_MUSIC_SCORE));
+ }
+ } else if (_phantomStatus == 4) {
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->drawToBackground(_globals._spriteIndexes[13], 1, Common::Point(-32000, -32000), 0, 100);
+
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_3");
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACERAL", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACEXDFR", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACEPHN", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('a', 8), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('p', 2), 130);
+ _scene->setAnimFrame(_globals._animationIndexes[3], 159);
+
+ _game._player._playerPos = Common::Point(130, 135);
+ _game._player._facing = FACING_NORTHEAST;
+ _game._player._visible = true;
+ _anim4ActvFl = true;
+
+ _game._player._stepEnabled = false;
+ _vm->_gameConv->run(21);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_MUSIC_SCORE));
+ }
+ } else if (_globals[kFightStatus] == 2) {
+ if (!_game._visitedScenes.exists(506)) {
+ _scene->changeVariant(1);
+
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->drawToBackground(_globals._spriteIndexes[13], 1, Common::Point(-32000, -32000), 0, 100);
+ _anim5ActvFl = true;
+
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_3");
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACERAL", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACEXDFR",PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*FACEPHN", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('p', 3), 0);
+ int hotspotIdx = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _phantomStatus = 5;
+ _scene->_dynamicHotspots[hotspotIdx]._articleNumber = PREP_ON;
+ _scene->setAnimFrame(_globals._animationIndexes[3], 79);
+ _scene->_dynamicHotspots.setPosition(hotspotIdx, Common::Point(66, 119), FACING_NORTHWEST);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 0);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 1);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 2);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 3);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 4);
+ } else {
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->drawToBackground(_globals._spriteIndexes[13], 1, Common::Point(-32000, -32000), 0, 100);
+ }
+ } else {
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _globals._sequenceIndexes[1] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[1], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ if (!_globals[kHeListened])
+ _scene->_sequences.addTimer(30, 62);
+ }
+ }
+
+ sceneEntrySound();
+}
+
+void Scene504::step() {
+ if (_anim0ActvFl)
+ handleListenAnimation();
+
+ if (_anim1ActvFl)
+ handleOrganAnimation();
+
+ if (_anim2ActvFl)
+ handleChairAnimation();
+
+ if (_anim3ActvFl)
+ handlePhantomAnimation1();
+
+ if (_anim4ActvFl)
+ handlePhantomAnimation2();
+
+ if (_anim5ActvFl)
+ handlePhantomAnimation3();
+
+ if (_game._trigger == 120) {
+ _game._player._stepEnabled = false;
+ _vm->_gameConv->run(21);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_MUSIC_SCORE));
+ _vm->_gameConv->exportValue(1);
+ _globals[kFightStatus] = 1;
+ }
+
+ if (_game._trigger == 60) {
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _scene->drawToBackground(_globals._spriteIndexes[0], 1, Common::Point(-32000, -32000), 0, 100);
+ _scene->_sequences.addTimer(30, 61);
+ }
+
+ if (_game._trigger == 61) {
+ _game._player._stepEnabled = true;
+ _scene->_sequences.addTimer(60, 62);
+ }
+
+ if (_game._trigger == 62) {
+ _globals[kHeListened] = true;
+ _game._player._stepEnabled = false;
+ _vm->_gameConv->run(19);
+ _vm->_gameConv->exportValue(_game._difficulty);
+ }
+
+ if (_game._trigger == 80) {
+ _vm->_sound->command(73);
+ _globals[kRightDoorIsOpen504] = true;
+ _scene->deleteSequence(_globals._sequenceIndexes[2]);
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2);
+
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 90);
+ }
+
+ if (_game._trigger == 90) {
+ _globals._sequenceIndexes[4] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[4], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 91);
+ }
+
+ if (_game._trigger == 91) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[5], SEQUENCE_TRIGGER_EXPIRE, 0, 92);
+ }
+
+ if (_game._trigger == 92)
+ _fireBreathFl = true;
+
+ if (_fireBreathFl) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ _globals._sequenceIndexes[4] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[4], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[4], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], -1, -2);
+ _globals._sequenceIndexes[5] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[5], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[5], -1, -2);
+ _fireBreathFl = false;
+ }
+
+ if (_game._trigger == 130) {
+ _scene->freeAnimation(_globals._animationIndexes[3]);
+ _scene->_sprites.remove(_globals._spriteIndexes[12]);
+
+ _anim4ActvFl = false;
+ _anim5ActvFl = true;
+
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_2", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_3", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+
+ _scene->changeVariant(1);
+
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('p', 3), 0);
+ int hotspotIdx = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[hotspotIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(hotspotIdx, Common::Point(66, 119), FACING_NORTHWEST);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 0);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 1);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 2);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 3);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[3], 4);
+ }
+
+ if (_game._trigger == 67) {
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ _anim0ActvFl = false;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ }
+
+ if (_game._trigger == 136)
+ _scene->_nextSceneId = 506;
+
+ if (_game._trigger == 100) {
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[1]);
+ _game._player._playerPos = Common::Point(156, 114);
+ _game._player._visible = true;
+ _anim1ActvFl = false;
+ _game._player.resetFacing(FACING_EAST);
+ _scene->_sequences.addTimer(10, 101);
+ }
+
+ if (_game._trigger == 101) {
+ _game._player._stepEnabled = true;
+ _scene->_sprites.remove(_globals._spriteIndexes[5]);
+ _scene->_sprites.remove(_globals._spriteIndexes[4]);
+ }
+}
+
+void Scene504::actions() {
+ if (_vm->_gameConv->_running == 26) {
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_SIT_IN, NOUN_LARGE_CHAIR)) {
+ if (!_anim2ActvFl) {
+ _chairStatus = 0;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _anim2ActvFl = true;
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('c', 1), 0);
+ _game.syncTimers(SYNC_ANIM, _globals._animationIndexes[0], SYNC_PLAYER, 0);
+ } else
+ _vm->_dialogs->show(50436);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_game._trigger == 95) {
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('l', 1), 67);
+ _listenStatus = 0;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _anim0ActvFl = true;
+ _globals[kHeListened] = true;
+ _vm->_gameConv->run(19);
+ _vm->_gameConv->exportValue(_game._difficulty);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_game._trigger == 67) {
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ _anim0ActvFl = false;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 19) {
+ handleListenConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 27) {
+ handlePlayConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 21) {
+ handleFightConversation();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_game._trigger == 100) {
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[1]);
+ _game._player._playerPos = Common::Point(156, 114);
+ _game._player._visible = true;
+ _anim1ActvFl = false;
+ _game._player.resetFacing(FACING_EAST);
+ _scene->_sequences.addTimer(10, 101);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_game._trigger == 101) {
+ _game._player._stepEnabled = true;
+ _scene->_sprites.remove(_globals._spriteIndexes[5]);
+ _scene->_sprites.remove(_globals._spriteIndexes[4]);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_SIT_ON, NOUN_ORGAN_BENCH)) {
+ if (_globals[kRightDoorIsOpen504])
+ _vm->_dialogs->show(50427);
+ else {
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('x', 4), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('x', 5), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('o', 1), 100);
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _playingMusicFl = false;
+ _anim1ActvFl = true;
+ _playStatus = 0;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_RIGHT_DOOR) || _action.isAction(VERB_OPEN, NOUN_RIGHT_DOOR)) {
+ if (_globals[kRightDoorIsOpen504]) {
+ if (_vm->_gameConv->_running == 26)
+ _vm->_gameConv->abortConv();
+
+ _scene->_nextSceneId = 505;
+ } else
+ _vm->_dialogs->show(50418);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_LEFT_DOOR) || _action.isAction(VERB_OPEN, NOUN_LEFT_DOOR)) {
+ if (_globals[kFightStatus]) {
+ if (_game._visitedScenes.exists(506))
+ _scene->_nextSceneId = 506;
+ else if (!_game._objects.isInInventory(OBJ_MUSIC_SCORE))
+ _vm->_dialogs->show(50425);
+ else {
+ _phantomStatus = 6;
+ _game._player._stepEnabled = false;
+ }
+ } else
+ _vm->_dialogs->show(50418);
+
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_MUSIC_SCORE)) {
+ switch (_game._trigger) {
+ case (0):
+ if (_game._objects.isInRoom(OBJ_MUSIC_SCORE)) {
+ _globals[kPlayerScore] += 5;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[14] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[14], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[14], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[14], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[14], SEQUENCE_TRIGGER_SPRITE, 4, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[14], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ _action._inProgress = false;
+ return;
+ }
+ break;
+
+ case 1:
+ _globals._sequenceIndexes[15] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[15], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[15], 14);
+ _scene->_hotspots.activate(NOUN_MUSIC_SCORE, false);
+ _game._objects.addToInventory(OBJ_MUSIC_SCORE);
+ _vm->_sound->command(26);
+ _action._inProgress = false;
+ return;
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[14]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ _action._inProgress = false;
+ return;
+ break;
+
+ case 3:
+ _vm->_dialogs->showItem(OBJ_MUSIC_SCORE, 820, 0);
+ _game._player._stepEnabled = true;
+ _action._inProgress = false;
+ return;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(50410);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(50411);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(50412);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ORGAN)) {
+ _vm->_dialogs->show(50413);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_ORGAN_BENCH)) {
+ _vm->_dialogs->show(50414);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_MUSIC_SCORE) && _game._objects.isInRoom(OBJ_MUSIC_SCORE)) {
+ _vm->_dialogs->show(50415);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LEFT_DOOR)) {
+ _vm->_dialogs->show(50416);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RIGHT_DOOR)) {
+ _vm->_dialogs->show(_globals[kRightDoorIsOpen504] ? 50434 : 50417);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TABLE)) {
+ _vm->_dialogs->show(50419);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TRAP_DOOR)) {
+ _vm->_dialogs->show(50420);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LARGE_CHAIR)) {
+ _vm->_dialogs->show(50422);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHRISTINE)) {
+ _vm->_dialogs->show(_globals[kFightStatus] ? 50426 : 50429);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_PHANTOM)) {
+ _vm->_dialogs->show(50428);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_TRAP_DOOR)) {
+ _vm->_dialogs->show(50421);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE) && _action.isObject(NOUN_RIGHT_DOOR) && !_globals[kRightDoorIsOpen504]) {
+ _vm->_dialogs->show(50433);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_CLOSE) && _action.isObject(NOUN_LEFT_DOOR) && !_globals[kFightStatus] && !_game._visitedScenes.exists(506)) {
+ _vm->_dialogs->show(50433);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_anim3ActvFl && (_action.isAction(VERB_TAKE, NOUN_SWORD) || _action.isAction(VERB_ATTACK, NOUN_PHANTOM))) {
+ _game._player._stepEnabled = false;
+ _input3Count = 0;
+ _phantomStatus = 4;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_CHRISTINE)) {
+ _vm->_gameConv->run(21);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_MUSIC_SCORE));
+ _vm->_gameConv->exportValue(0);
+ _phantomStatus = 7;
+ _christineTalkCount = 0;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_PHANTOM)) {
+ _vm->_dialogs->show(50431);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_CHRISTINE)) {
+ _vm->_dialogs->show(50435);
+ _action._inProgress = false;
+ return;
+ }
+}
+
+void Scene504::preActions() {
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_RIGHT_DOOR) || _action.isAction(VERB_OPEN, NOUN_RIGHT_DOOR)) {
+ if (_globals[kRightDoorIsOpen504]) {
+ if ((_globals[kFightStatus] == 2) && !_game._visitedScenes.exists(506)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player.walk(Common::Point(317, 115), FACING_NORTHEAST);
+ _game._player._readyToWalk = false;
+ _game._player._needToWalk = false;
+ _game._player._stepEnabled = false;
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(2);
+ _scene->_sequences.addTimer(6, 1);
+ break;
+
+ case 1:
+ if (_vm->_gameConv->_running >= 0)
+ _scene->_sequences.addTimer(6, 1);
+ else {
+ _game._player._stepEnabled = true;
+ _action._inProgress = true;
+ _game._player._needToWalk = true;
+ _game._player._readyToWalk = true;
+ }
+ break;
+
+ default:
+ break;
+ }
+ } else
+ _game._player.walk(Common::Point(317, 115), FACING_NORTHEAST);
+ } else if (_globals[kHeListened] || (_globals[kFightStatus] == 0))
+ _game._player.walk(Common::Point(286, 120), FACING_NORTHEAST);
+ }
+
+ if (_anim2ActvFl && !_action.isAction(VERB_SIT_IN) && _game._player._needToWalk) {
+ _chairStatus = 1;
+ _game._player._stepEnabled = false;
+ _game._player._readyToWalk = false;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_LEFT_DOOR) || _action.isAction(VERB_OPEN, NOUN_LEFT_DOOR)) {
+ if ((_globals[kFightStatus] == 0) && (_globals[kCoffinStatus] == 2) && !_game._visitedScenes.exists(506)) {
+ _vm->_dialogs->show(50432);
+ _game._player.cancelCommand();
+ return;
+ } else if (_game._visitedScenes.exists(506))
+ _game._player.walk(Common::Point(0, 109), FACING_NORTHWEST);
+ else if (!_game._objects.isInInventory(OBJ_MUSIC_SCORE) || (_globals[kFightStatus] == 0))
+ _game._player.walk(Common::Point(33, 116), FACING_NORTHWEST);
+ }
+
+ if ((_globals[kFightStatus] == 0) && (_globals[kCoffinStatus] == 2) && !_game._visitedScenes.exists(506)
+ && !_action.isAction(VERB_LOOK) && !_action.isAction(VERB_LOOK_AT) && !_action.isAction(VERB_ATTACK)
+ && !_action.isAction(VERB_TAKE, NOUN_SWORD) && !_action.isAction(VERB_TALK_TO, NOUN_PHANTOM)) {
+ _vm->_dialogs->show(50430);
+ _game._player.cancelCommand();
+ }
+}
+
+void Scene504::handleListenAnimation() {
+ int curFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ if (curFrame == _listenFrame)
+ return;
+
+ _listenFrame = curFrame;
+ int resetFrame = -1;
+
+ switch (_listenFrame) {
+ case 8:
+ _vm->_gameConv->release();
+ break;
+
+ case 9:
+ resetFrame = (_listenStatus == 0) ? 8 : 9;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _listenFrame = resetFrame;
+ }
+}
+
+void Scene504::handleOrganAnimation() {
+ int curFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+ if (curFrame == _playFrame)
+ return;
+
+ _playFrame = curFrame;
+ int resetFrame = -1;
+
+ switch (_playFrame) {
+ case 22:
+ _game._player._stepEnabled = true;
+ _vm->_gameConv->run(27);
+ break;
+
+ case 23:
+ if (_playStatus == 0)
+ resetFrame = 22;
+ else {
+ _game._player._stepEnabled = false;
+ if (_songNum == 5) {
+ _playingMusicFl = false;
+ _fireBreathFl = false;
+ resetFrame = 104;
+ }
+ }
+ break;
+
+ case 28:
+ if (!_playingMusicFl) {
+ _playingMusicFl = true;
+ _fireBreathFl = true;
+ _game._player._stepEnabled = false;
+
+ switch (_songNum) {
+ case 1:
+ _vm->_sound->command(34);
+ break;
+
+ case 2:
+ _vm->_sound->command(37);
+ break;
+
+ case 3:
+ _vm->_sound->command(35);
+ break;
+
+ case 4:
+ _vm->_sound->command(36);
+ break;
+
+ default:
+ break;
+ }
+ }
+ break;
+
+ case 69:
+ if ((_globals[kRightDoorIsOpen504]) && (_playCount >= 2)) {
+ _playCount = 0;
+ resetFrame = 102;
+ _vm->_sound->command(2);
+ _vm->_sound->command(16);
+ } else if (_songNum != _globals[kMusicSelected]) {
+ _vm->_sound->command(2);
+ _fireBreathFl = true;
+ resetFrame = 75;
+ } else {
+ resetFrame = 25;
+ ++_playCount;
+ if (!_globals[kRightDoorIsOpen504]) {
+ _scene->_sequences.addTimer(1, 80);
+ _globals[kPlayerScore] += 5;
+ }
+ }
+ break;
+
+ case 76:
+ _scene->playSpeech(7);
+ break;
+
+ case 90:
+ _vm->_sound->command(27);
+ break;
+
+ case 102:
+ ++_deathCounter;
+ if (_deathCounter >= 17)
+ _scene->_reloadSceneFlag = true;
+ else
+ resetFrame = 101;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _playFrame = resetFrame;
+ }
+}
+
+void Scene504::handlePhantomAnimation1() {
+ int curFrame = _scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame();
+ if (curFrame == _phantomFrame)
+ return;
+
+ _phantomFrame = curFrame;
+ int resetFrame = -1;
+
+ switch (_phantomFrame) {
+ case 41:
+ _vm->_gameConv->run(21);
+ _vm->_gameConv->exportValue(_game._objects.isInInventory(OBJ_MUSIC_SCORE));
+ _vm->_gameConv->exportValue(0);
+ break;
+
+ case 52:
+ case 53:
+ case 54:
+ case 55:
+ resetFrame = (_phantomStatus == 0) ? _vm->getRandomNumber(51, 54) : 55;
+ break;
+
+ case 78:
+ _vm->_gameConv->release();
+ break;
+
+ case 110:
+ case 111:
+ case 112:
+ case 113:
+ resetFrame = (_phantomStatus == 1) ? _vm->getRandomNumber(109, 112) : 113;
+ break;
+
+ case 142:
+ _scene->drawToBackground(_globals._spriteIndexes[13], 1, Common::Point(-32000, -32000), 0, 100);
+ break;
+
+ case 143:
+ _game._player._stepEnabled = true;
+ break;
+
+ case 149:
+ case 150:
+ case 151:
+ ++_input3Count;
+
+ if (_phantomStatus == 4) {
+ _game._player._stepEnabled = false;
+ resetFrame = 200;
+ } else if (_input3Count >= 9) {
+ _game._player._stepEnabled = false;
+ resetFrame = 151;
+ } else if (_phantomStatus == 2)
+ resetFrame = _vm->getRandomNumber(148, 150);
+ break;
+
+ case 169:
+ _vm->_sound->command(1);
+ _scene->playSpeech(7);
+ break;
+
+ case 180:
+ _vm->_sound->command(27);
+ break;
+
+ case 187:
+ _deathCounter = 0;
+ break;
+
+ case 189:
+ ++_deathCounter;
+ if (_deathCounter >= 29)
+ _scene->_reloadSceneFlag = true;
+ else
+ resetFrame = 188;
+ break;
+
+ case 227:
+
+ _scene->freeAnimation(_globals._animationIndexes[3]);
+ _scene->_sprites.remove(_globals._spriteIndexes[9]);
+ _scene->_sprites.remove(_globals._spriteIndexes[8]);
+ _scene->_sprites.remove(_globals._spriteIndexes[7]);
+ _scene->_sprites.remove(_globals._spriteIndexes[10]);
+ _scene->_sprites.remove(_globals._spriteIndexes[11]);
+
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_3", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[12] = _scene->_sprites.addSprites(formAnimName('a', 8), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._animationIndexes[3] = _scene->loadAnimation(formAnimName('p', 2), 130);
+
+ _scene->setAnimFrame(_globals._animationIndexes[3], 27);
+ resetFrame = -1;
+ _anim3ActvFl = false;
+ _anim4ActvFl = true;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[3], resetFrame);
+ _phantomFrame = resetFrame;
+ }
+}
+
+void Scene504::handlePhantomAnimation2() {
+ int curFrame = _scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame();
+ if (curFrame == _phantomFrame)
+ return;
+
+ _phantomFrame = curFrame;
+ int resetFrame = -1;
+
+ switch (_phantomFrame) {
+ case 78:
+ _scene->playSpeech(9);
+ break;
+
+ case 119:
+ _game._player._playerPos = Common::Point(114, 137);
+ _game._player._facing = FACING_WEST;
+ _game._player._visible = true;
+ _globals[kPlayerScore] += 5;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[3]);
+ _game._player.walk(Common::Point(130, 135), FACING_NORTHEAST);
+ _scene->_hotspots.activate(NOUN_CHRISTINE, false);
+ _game._player.setWalkTrigger(120);
+ _vm->_sound->command(1);
+ break;
+
+ case 150:
+ _vm->_sound->command(16);
+ break;
+
+ case 160:
+ switch (_playStatus) {
+ case 5:
+ resetFrame = 164;
+ break;
+
+ case 7:
+ resetFrame = 160;
+ break;
+
+ default:
+ resetFrame = 159;
+ break;
+ }
+ break;
+
+ case 161:
+ case 162:
+ case 163:
+ case 164:
+ resetFrame = (_phantomStatus == 5) ? 159 : _vm->getRandomNumber(160, 162);
+
+ ++_christineTalkCount;
+ if (_christineTalkCount > 10) {
+ resetFrame = 159;
+ if (_phantomStatus != 5)
+ _phantomStatus = 4;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[3], resetFrame);
+ _phantomFrame = resetFrame;
+ }
+}
+
+void Scene504::handlePhantomAnimation3() {
+ int curFrame = _scene->_animation[_globals._animationIndexes[3]]->getCurrentFrame();
+ if (curFrame == _phantomFrame)
+ return;
+
+ _phantomFrame = curFrame;
+ int resetFrame = -1;
+
+ switch (_phantomFrame) {
+ case 58:
+ _game._player._stepEnabled = true;
+ break;
+
+ case 80:
+ if (_phantomStatus == 7)
+ resetFrame = 116;
+ else if (_phantomStatus != 6)
+ resetFrame = 79;
+ break;
+
+ case 115:
+ _game._player.walk(Common::Point(0, 109), FACING_NORTHWEST);
+ _game._player.setWalkTrigger(136);
+ break;
+
+ case 116:
+ resetFrame = 115;
+ break;
+
+ case 117:
+ case 118:
+ case 119:
+ resetFrame = _vm->getRandomNumber(116, 118);
+ ++_christineTalkCount;
+ if (_christineTalkCount > 10) {
+ resetFrame = 79;
+ if (_phantomStatus != 6)
+ _phantomStatus = 5;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[3], resetFrame);
+ _phantomFrame = resetFrame;
+ }
+}
+
+void Scene504::handleChairAnimation() {
+ int curFrame = _scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame();
+ if (curFrame == _chairFrame)
+ return;
+
+ _chairFrame = curFrame;
+ int resetFrame = -1;
+
+ switch (_chairFrame) {
+ case 24:
+ _game._player._stepEnabled = true;
+ break;
+
+ case 25:
+ case 26:
+ case 30:
+ case 31:
+ if (!_chairDialogDoneFl) {
+ _chairDialogDoneFl = true;
+ _vm->_dialogs->show(50424);
+ }
+
+ if (_chairStatus == 0) {
+ if (_vm->getRandomNumber(1,5) == 1)
+ resetFrame = _vm->getRandomNumber(24, 30);
+ else
+ resetFrame = _chairFrame - 1;
+ } else
+ resetFrame = 31;
+ break;
+
+ case 47:
+ resetFrame = -1;
+ _game._player._stepEnabled = true;
+ _game._player._visible = true;
+ _game._player._readyToWalk = true;
+ _anim2ActvFl = false;
+ _chairDialogDoneFl = false;
+ _scene->freeAnimation(_globals._animationIndexes[2]);
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[2], resetFrame);
+ _chairFrame = resetFrame;
+ }
+}
+
+void Scene504::handleListenConversation() {
+ if ((_action._activeAction._verbId == 2) && !_game._trigger) {
+ _game._player.walk(Common::Point(286, 120), FACING_EAST);
+ _game._player.setWalkTrigger(95);
+ }
+
+ if (_action._activeAction._verbId == 12)
+ _listenStatus = 1;
+}
+
+void Scene504::handlePlayConversation() {
+ switch (_action._activeAction._verbId) {
+ case 2:
+ *_vm->_gameConv->_nextStartNode = 1;
+ _vm->_gameConv->abortConv();
+ _playStatus = 1;
+ _songNum = 1;
+ break;
+
+ case 3:
+ *_vm->_gameConv->_nextStartNode = 1;
+ _vm->_gameConv->abortConv();
+ _playStatus = 1;
+ _songNum = 2;
+ break;
+
+ case 4:
+ *_vm->_gameConv->_nextStartNode = 1;
+ _vm->_gameConv->abortConv();
+ _playStatus = 1;
+ _songNum = 3;
+ break;
+
+ case 5:
+ *_vm->_gameConv->_nextStartNode = 1;
+ _vm->_gameConv->abortConv();
+ _playStatus = 1;
+ _songNum = 4;
+ break;
+
+ case 6:
+ *_vm->_gameConv->_nextStartNode = 1;
+ _vm->_gameConv->abortConv();
+ _playStatus = 1;
+ _songNum = 5;
+ break;
+
+ case 8:
+ *_vm->_gameConv->_nextStartNode = 1;
+ _vm->_gameConv->abortConv();
+ _playStatus = 1;
+ break;
+
+ default:
+ break;
+ }
+}
+
+void Scene504::handleFightConversation() {
+ switch (_action._activeAction._verbId) {
+ case 3:
+ _vm->_gameConv->hold();
+ _phantomStatus = 1;
+ break;
+
+ case 8:
+ _phantomStatus = 2;
+ break;
+
+ case 10:
+ case 11:
+ case 12:
+ case 15:
+ _vm->_gameConv->setInterlocutorTrigger(145);
+ break;
+
+ case 14:
+ case 17:
+ _phantomStatus = 5;
+ _globals[kFightStatus] = 2;
+ break;
+
+ default:
+ break;
+ }
+
+ if ((_game._trigger == 145) && (_phantomStatus != 5)) {
+ _phantomStatus = 7;
+ _christineTalkCount = 0;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene505::Scene505(MADSEngine *vm) : Scene5xx(vm) {
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _checkFrame106 = false;
+ _leaveRoomFl = false;
+ _partedFl = false;
+
+ _raoulStatus = -1;
+ _raoulFrame = -1;
+ _raoulCount = -1;
+ _bothStatus = -1;
+ _bothFrame = -1;
+ _bothCount = -1;
+ _partStatus = -1;
+ _partFrame = -1;
+ _partCount = -1;
+}
+
+void Scene505::synchronize(Common::Serializer &s) {
+ Scene5xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_anim1ActvFl);
+ s.syncAsByte(_anim2ActvFl);
+ s.syncAsByte(_checkFrame106);
+ s.syncAsByte(_leaveRoomFl);
+ s.syncAsByte(_partedFl);
+
+ s.syncAsSint16LE(_raoulStatus);
+ s.syncAsSint16LE(_raoulFrame);
+ s.syncAsSint16LE(_raoulCount);
+ s.syncAsSint16LE(_bothStatus);
+ s.syncAsSint16LE(_bothFrame);
+ s.syncAsSint16LE(_bothCount);
+ s.syncAsSint16LE(_partStatus);
+ s.syncAsSint16LE(_partFrame);
+ s.syncAsSint16LE(_partCount);
+}
+
+void Scene505::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ if ((_globals[kCoffinStatus] == 2) && (!_globals[kChrisLeft505]))
+ _scene->_variant = 1;
+
+ _scene->addActiveVocab(NOUN_CHRISTINE);
+}
+
+void Scene505::enter() {
+ _vm->_disableFastwalk = true;
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _partedFl = false;
+ _leaveRoomFl = false;
+ _anim0ActvFl = false;
+ _anim1ActvFl = false;
+ _anim2ActvFl = false;
+ _checkFrame106 = false;
+ }
+
+ _vm->_gameConv->get(20);
+ _scene->_hotspots.activateAtPos(NOUN_LID, false, Common::Point(216, 44));
+ _scene->_hotspots.activate(NOUN_CHRISTINE, false);
+
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('x', 6));
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('a', 1));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites(formAnimName('x', 3));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('x', 4));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('x', 5));
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('a', 4));
+
+ if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ if (_vm->_gameConv->_restoreRunning == 20) {
+ _scene->_hotspots.activate(NOUN_LID, false);
+ _scene->_hotspots.activateAtPos(NOUN_LID, true, Common::Point(216, 44));
+ _globals._sequenceIndexes[7] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[7], false, 12);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[7], 1);
+
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('c', 1), 65);
+ _scene->setAnimFrame(_globals._animationIndexes[1], 109);
+ _anim1ActvFl = true;
+ _game._player._visible = false;
+ _game._player._stepEnabled = false;
+ _bothStatus = 3;
+
+ _vm->_gameConv->run(20);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ } else if (_partedFl && (_globals[kFightStatus] == 0)) {
+ _scene->_hotspots.activate(NOUN_LID, false);
+ _scene->_hotspots.activateAtPos(NOUN_LID, true, Common::Point(216, 44));
+ _globals._sequenceIndexes[7] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[7], false, 12);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[7], 1);
+
+ _anim2ActvFl = true;
+ _bothStatus = 3;
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('b', 1), 0);
+ int hotspotIdx = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[hotspotIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(hotspotIdx, Common::Point(91, 108), FACING_NORTHWEST);
+ _scene->setAnimFrame(_globals._animationIndexes[2], 89);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[2], 3);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[2], 4);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[2], 5);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[2], 6);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[2], 7);
+ } else if (_globals[kFightStatus]) {
+ _scene->_hotspots.activate(NOUN_LID, false);
+ _scene->_hotspots.activateAtPos(NOUN_LID, true, Common::Point(216, 44));
+ _globals._sequenceIndexes[7] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[7], false, 12);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[7], 1);
+ } else {
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('c', 1), 65);
+ _anim1ActvFl = true;
+ _bothStatus = 0;
+ _scene->_hotspots.activate(NOUN_CHRISTINE, true);
+ }
+ }
+
+ if ((_scene->_priorSceneId == 504) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(5, 87);
+ _game._player._facing = FACING_EAST;
+ _game._player._stepEnabled = false;
+ _game._player.walk(Common::Point(58, 104), FACING_SOUTHEAST);
+ if (_globals[kCoffinStatus] != 2) {
+ _game._player.setWalkTrigger(70);
+ _anim1ActvFl = true;
+ _bothStatus = 0;
+ _scene->_hotspots.activate(NOUN_CHRISTINE, true);
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('c', 1), 65);
+ } else {
+ _scene->_hotspots.activate(NOUN_LID, false);
+ _scene->_hotspots.activateAtPos(NOUN_LID, true, Common::Point(216, 44));
+ _globals._sequenceIndexes[7] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[7], false, 12);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[7], 1);
+ _game._player._stepEnabled = true;
+ }
+ }
+
+ sceneEntrySound();
+}
+
+void Scene505::step() {
+ if (_anim0ActvFl)
+ handleRaoulAnimation();
+
+ if (_anim1ActvFl)
+ handleBothanimation();
+
+ if (_anim2ActvFl)
+ handlePartedAnimation();
+
+ if (_game._trigger == 65) {
+ _scene->freeAnimation(_globals._animationIndexes[1]);
+ _vm->_sound->command(1);
+ _partedFl = true;
+ _anim2ActvFl = true;
+ _anim1ActvFl = false;
+ _globals._animationIndexes[2] = _scene->loadAnimation(formAnimName('b', 1), 0);
+
+ int hotspotIDx = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots.setPosition(hotspotIDx, Common::Point(91, 108), FACING_NORTHWEST);
+ _scene->_dynamicHotspots[hotspotIDx]._articleNumber = PREP_ON;
+ _scene->setDynamicAnim(hotspotIDx, _globals._animationIndexes[2], 3);
+ _scene->setDynamicAnim(hotspotIDx, _globals._animationIndexes[2], 4);
+ _scene->setDynamicAnim(hotspotIDx, _globals._animationIndexes[2], 5);
+ _scene->setDynamicAnim(hotspotIDx, _globals._animationIndexes[2], 6);
+ _scene->setDynamicAnim(hotspotIDx, _globals._animationIndexes[2], 7);
+ }
+
+ if (_game._trigger == 70) {
+ _game._player._stepEnabled = true;
+ if (!_game._visitedScenes._sceneRevisited) {
+ _vm->_gameConv->run(20);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ }
+ }
+}
+
+void Scene505::actions() {
+ if (_game._trigger == 80) {
+ _bothStatus = 2;
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 20) {
+ handleCoffinDialog();
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TALK_TO, NOUN_CHRISTINE)) {
+ if (_globals[kCoffinStatus] != 2)
+ _vm->_dialogs->show(50536);
+ else {
+ _vm->_gameConv->run(20);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ _partStatus = 10;
+ _partCount = 0;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_UNLOCK, NOUN_SARCOPHAGUS) || _action.isAction(VERB_UNLOCK, NOUN_LID)) && !_globals[kLookedAtSkullFace]) {
+ _vm->_dialogs->show(50539);
+ _action._inProgress = false;
+ return;
+ }
+
+ if ((_action.isAction(VERB_UNLOCK, NOUN_SKULL_FACE) || _action.isAction(VERB_PUT, NOUN_KEY, NOUN_SKULL_FACE)) || ((_action.isAction(VERB_UNLOCK, NOUN_SARCOPHAGUS) || _action.isAction(VERB_UNLOCK, NOUN_LID)) && _globals[kLookedAtSkullFace])) {
+ if (_globals[kCoffinStatus] == 0) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[8] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[8], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[8], -1, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[8], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_SPRITE, 9, 95);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[8], SEQUENCE_TRIGGER_EXPIRE, 0, 96);
+ _action._inProgress = false;
+ return;
+
+ case 95:
+ _vm->_sound->command(76);
+ _vm->_dialogs->show(50528);
+ _action._inProgress = false;
+ return;
+
+ case 96:
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ _globals[kCoffinStatus] = 1;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[8]);
+ _action._inProgress = false;
+ return;
+
+ default:
+ break;
+ }
+ } else {
+ _vm->_dialogs->show(50534);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_PUSH, NOUN_SKULL) && (_scene->_customDest.x >= 19)) {
+ switch (_game._trigger) {
+ case 0:
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[0] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[0], false, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[0], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_SPRITE, 6, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[0], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ break;
+
+ case 1: {
+ int sprIdx;
+ _vm->_sound->command(77);
+ if (_scene->_customDest.x <= 44)
+ sprIdx = _globals._spriteIndexes[4];
+ else if (_scene->_customDest.x <= 58)
+ sprIdx = _globals._spriteIndexes[3];
+ else if (_scene->_customDest.x <= 71)
+ sprIdx = _globals._spriteIndexes[2];
+ else if (_scene->_customDest.x <= 84) {
+ sprIdx = _globals._spriteIndexes[1];
+ if (_globals[kCoffinStatus] == 1) {
+ _bothStatus = 1;
+ _scene->_hotspots.activate(NOUN_LID, false);
+ _scene->_hotspots.activate(NOUN_CHRISTINE, false);
+ _scene->_hotspots.activateAtPos(NOUN_LID, true, Common::Point(216, 44));
+ _scene->changeVariant(1);
+ }
+ } else if (_scene->_customDest.x <= 100)
+ sprIdx = _globals._spriteIndexes[5];
+ else
+ sprIdx = _globals._spriteIndexes[6];
+
+ int skullSeqIdx = _scene->_sequences.startPingPongCycle(sprIdx, false, 5, 2);
+ _scene->_sequences.setAnimRange(skullSeqIdx, -1, -2);
+ _scene->_sequences.setDepth(skullSeqIdx, 1);
+ }
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[0]);
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ if (_bothStatus == 1) {
+ _game._player.walk(Common::Point(136, 126), FACING_EAST);
+ _game._player.setWalkTrigger(80);
+ _game._player._stepEnabled = false;
+ }
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR)) {
+ if (_anim2ActvFl) {
+ _leaveRoomFl = true;
+ _game._player._stepEnabled = false;
+ } else {
+ _globals[kChrisLeft505] = true;
+ _scene->_nextSceneId = 504;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(50510);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(50511);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(50512);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SARCOPHAGUS)) {
+ _vm->_dialogs->show((_globals[kCoffinStatus] <= 1) ? 50513 : 50514);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SKULL_FACE)) {
+ _globals[kLookedAtSkullFace] = true;
+ _vm->_dialogs->show(50529);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR)) {
+ _vm->_dialogs->show(50519);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SKULL)) {
+ _vm->_dialogs->show((_scene->_customDest.x < 19) ? 50521 : 50520);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_SKULLS)) {
+ _vm->_dialogs->show(50521);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TOTEM)) {
+ _vm->_dialogs->show(50522);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DESK)) {
+ _vm->_dialogs->show(50523);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_POLE)) {
+ _vm->_dialogs->show(50524);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CURTAIN)) {
+ _vm->_dialogs->show(50525);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHRISTINE)) {
+ _vm->_dialogs->show((_globals[kCoffinStatus] == 2) ? 50530 : 50537);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_LID)) {
+ _vm->_dialogs->show((_globals[kCoffinStatus] == 2) ? 50531 : 50532);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_LOCK, NOUN_SARCOPHAGUS) || _action.isAction(VERB_LOCK, NOUN_LID) || _action.isAction(VERB_LOCK, NOUN_SKULL_FACE)) {
+ _vm->_dialogs->show(50535);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_OPEN, NOUN_SARCOPHAGUS) || _action.isAction(VERB_OPEN, NOUN_LID)) {
+ if (_globals[kCoffinStatus] == 2)
+ _vm->_dialogs->show(50533);
+ else if (_globals[kCoffinStatus] == 1)
+ _vm->_dialogs->show(50518);
+ else
+ _vm->_dialogs->show(50515);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_CHRISTINE) && (_globals[kCoffinStatus] != 2)) {
+ _vm->_dialogs->show(50538);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_CHRISTINE)) {
+ _vm->_dialogs->show((_globals[kCoffinStatus] <= 1) ? 50538 : 50540);
+ _action._inProgress = false;
+ }
+}
+
+void Scene505::preActions() {
+ if ((_globals[kCoffinStatus] == 0) && (_action.isAction(VERB_UNLOCK, NOUN_SKULL_FACE) || _action.isAction(VERB_UNLOCK, NOUN_SARCOPHAGUS) || _action.isAction(VERB_PUT, NOUN_KEY, NOUN_SKULL_FACE) || _action.isAction(VERB_UNLOCK, NOUN_LID))) {
+ if (_action.isObject(NOUN_SKULL_FACE) || _globals[kLookedAtSkullFace])
+ _game._player.walk(Common::Point(279, 150), FACING_SOUTHWEST);
+ }
+
+ if (_action.isObject(NOUN_SKULL_FACE) && (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)))
+ _game._player.walk(Common::Point(279, 150), FACING_SOUTHWEST);
+
+ if (_action.isObject(NOUN_CURTAIN) && (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)))
+ _game._player._needToWalk = true;
+
+ if (_action.isObject(NOUN_SKULL) && (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)))
+ _game._player._needToWalk = true;
+}
+
+void Scene505::handleCoffinDialog() {
+ int interlocutorFl = false;
+ int heroFl = false;
+
+ switch (_action._activeAction._verbId) {
+ case 8:
+ heroFl = true;
+ interlocutorFl = true;
+ _bothStatus = 6;
+ break;
+
+ case 14:
+ heroFl = true;
+ interlocutorFl = true;
+ if (!_checkFrame106)
+ _vm->_gameConv->hold();
+ break;
+
+ case 17:
+ heroFl = true;
+ interlocutorFl = true;
+ if (!_game._trigger) {
+ _vm->_gameConv->hold();
+ _raoulStatus = 2;
+ }
+ break;
+
+ case 20:
+ heroFl = true;
+ interlocutorFl = true;
+ if (!_game._trigger) {
+ _vm->_gameConv->hold();
+ _game._player.walk(Common::Point(244, 130), FACING_SOUTHWEST);
+ _game._player.setWalkTrigger(71);
+ }
+ break;
+
+ case 22:
+ heroFl = true;
+ interlocutorFl = true;
+ if (!_game._trigger) {
+ _vm->_gameConv->hold();
+ _bothStatus = 7;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ switch (_game._trigger) {
+ case 70:
+ case 76:
+ _vm->_gameConv->release();
+ break;
+
+ case 71:
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('r', 1), 75);
+ _anim0ActvFl = true;
+ _raoulStatus = 0;
+ _raoulCount = 0;
+ _game._player._visible = false;
+ break;
+
+ case 75:
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ _scene->_sequences.addTimer(10, 76);
+ break;
+
+ case 85:
+ if ((_bothStatus != 6) && (_bothStatus != 0))
+ _bothStatus = 5;
+ break;
+
+ case 90:
+ if ((_bothStatus != 6) && (_bothStatus != 0))
+ _bothStatus = 4;
+ break;
+
+ default:
+ break;
+ }
+
+ if (!heroFl)
+ _vm->_gameConv->setHeroTrigger(85);
+
+ if (!interlocutorFl)
+ _vm->_gameConv->setInterlocutorTrigger(90);
+
+ _bothCount = 0;
+}
+
+void Scene505::handleRaoulAnimation() {
+ int curFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ if (curFrame == _raoulFrame)
+ return;
+
+ _raoulFrame = curFrame;
+ int resetFrame = -1;
+
+ switch (_raoulFrame) {
+ case 3:
+ _vm->_gameConv->release();
+ break;
+
+ case 4:
+ case 5:
+ case 6:
+ if (_raoulStatus == 0) {
+ resetFrame = _vm->getRandomNumber(3, 5);
+ ++_raoulCount;
+ if (_raoulCount > 20) {
+ _raoulStatus = 1;
+ resetFrame = 3;
+ }
+ break;
+ }
+
+ if (_raoulStatus == 1)
+ resetFrame = 3;
+
+ if (_raoulStatus == 2)
+ resetFrame = 6;
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[0], resetFrame);
+ _raoulFrame = resetFrame;
+ }
+}
+
+void Scene505::handleBothanimation() {
+ int curFrame = _scene->_animation[_globals._animationIndexes[1]]->getCurrentFrame();
+ if (curFrame == _bothFrame)
+ return;
+
+ _bothFrame = curFrame;
+ int resetFrame = -1;
+
+ switch (_bothFrame) {
+ case 1:
+ case 20:
+ case 39:
+ if (_bothStatus == 0) {
+ if (_vm->getRandomNumber(1, 35) == 1) {
+ if (_vm->getRandomNumber(1, 2) == 1)
+ resetFrame = 1;
+ else
+ resetFrame = 20;
+ } else
+ resetFrame = 0;
+ } else if (_bothStatus == 1)
+ resetFrame = 39;
+ else
+ resetFrame = 0;
+ break;
+
+ case 14:
+ if (_vm->getRandomNumber(1, 3) == 1)
+ resetFrame = 8;
+ break;
+
+ case 32:
+ if (_vm->getRandomNumber(1, 2) == 1)
+ resetFrame = 28;
+ break;
+
+ case 41:
+ _vm->_sound->command(39);
+ break;
+
+ case 51:
+ _globals._sequenceIndexes[7] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[7], false, 12);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[7], 1);
+ _globals[kCoffinStatus] = 2;
+ break;
+
+ case 66:
+ _game._player._stepEnabled = false;
+ _vm->_gameConv->run(20);
+ _vm->_gameConv->exportPointer(&_globals[kPlayerScore]);
+ break;
+
+ case 67:
+ if (_bothStatus == 1)
+ resetFrame = 66;
+ break;
+
+ case 68:
+ _game._player._visible = false;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[1]);
+ break;
+
+ case 106:
+ _checkFrame106 = true;
+ _vm->_gameConv->release();
+ break;
+
+ case 109:
+ case 130:
+ _vm->_gameConv->release();
+ break;
+
+ case 110:
+ case 111:
+ case 112:
+ case 113:
+ case 114:
+ case 115:
+ case 131:
+ switch (_bothStatus) {
+ case 4:
+ resetFrame = _vm->getRandomNumber(112, 114);
+ ++_bothCount;
+ if (_bothCount > 20) {
+ _bothStatus = 3;
+ resetFrame = 109;
+ }
+ break;
+
+ case 5:
+ resetFrame = _vm->getRandomNumber(109, 111);
+ ++_bothCount;
+ if (_bothCount > 20) {
+ _bothStatus = 3;
+ resetFrame = 109;
+ }
+ break;
+
+ case 6:
+ resetFrame = 131;
+ _bothStatus = 8;
+ _game._player._stepEnabled = false;
+ break;
+
+ case 7:
+ resetFrame = 115;
+ _bothStatus = 3;
+ break;
+
+ default:
+ resetFrame = 109;
+ break;
+ }
+ break;
+
+ case 127:
+ _vm->_sound->command(26);
+ _game._objects.addToInventory(OBJ_WEDDING_RING);
+ _vm->_dialogs->showItem(OBJ_WEDDING_RING, 821, 0);
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[1], resetFrame);
+ _bothFrame = resetFrame;
+ }
+}
+
+void Scene505::handlePartedAnimation() {
+ int curFrame = _scene->_animation[_globals._animationIndexes[2]]->getCurrentFrame();
+ if (curFrame == _partFrame)
+ return;
+
+ _partFrame = curFrame;
+ int resetFrame = -1;
+
+ switch (_partFrame) {
+ case 20:
+ _vm->_sound->command(16);
+ break;
+
+ case 25:
+ _game._player._playerPos = Common::Point(93, 133);
+ _game._player.resetFacing(FACING_WEST);
+ _game._player._visible = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[2]);
+ break;
+
+ case 70:
+ _game._player._stepEnabled = true;
+ break;
+
+ case 90:
+ if (_partStatus == 10)
+ resetFrame = 146;
+ else if (!_leaveRoomFl)
+ resetFrame = 89;
+ break;
+
+ case 145:
+ _scene->_nextSceneId = 504;
+ break;
+
+ case 147:
+ case 148:
+ case 149:
+ resetFrame = _vm->getRandomNumber(146, 148);
+ ++_partCount;
+ if (_partCount > 10) {
+ resetFrame = 89;
+ _partStatus = 8;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ if (resetFrame >= 0) {
+ _scene->setAnimFrame(_globals._animationIndexes[2], resetFrame);
+ _partFrame = resetFrame;
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+Scene506::Scene506(MADSEngine *vm) : Scene5xx(vm) {
+ _anim0ActvFl = false;
+ _skipFl = false;
+ _ascendingFl = false;
+}
+
+void Scene506::synchronize(Common::Serializer &s) {
+ Scene5xx::synchronize(s);
+
+ s.syncAsByte(_anim0ActvFl);
+ s.syncAsByte(_skipFl);
+ s.syncAsByte(_ascendingFl);
+}
+
+void Scene506::setup() {
+ setPlayerSpritesPrefix();
+ setAAName();
+
+ _scene->addActiveVocab(NOUN_CHRISTINE);
+ _scene->addActiveVocab(VERB_LOOK_AT);
+
+ if (!_globals[kChristineIsInBoat])
+ _scene->_variant = 1;
+}
+
+void Scene506::enter() {
+ _vm->_disableFastwalk = true;
+
+ if (_scene->_priorSceneId != RETURNING_FROM_LOADING) {
+ _anim0ActvFl = false;
+ _skipFl = false;
+ _ascendingFl = false;
+ }
+
+ _vm->_gameConv->get(26);
+
+ _globals._spriteIndexes[0] = _scene->_sprites.addSprites(formAnimName('x', 0));
+ _globals._spriteIndexes[1] = _scene->_sprites.addSprites(formAnimName('x', 1));
+ _globals._spriteIndexes[2] = _scene->_sprites.addSprites(formAnimName('x', 2));
+ _globals._spriteIndexes[3] = _scene->_sprites.addSprites(formAnimName('x', 3));
+ _globals._spriteIndexes[5] = _scene->_sprites.addSprites(formAnimName('p', 0));
+ _globals._spriteIndexes[7] = _scene->_sprites.addSprites(formAnimName('a', 1));
+ _globals._spriteIndexes[8] = _scene->_sprites.addSprites(formAnimName('a', 0));
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites(formAnimName('b', 0), PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[4] = _scene->_sprites.addSprites("*RDR_9");
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_6", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_3", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+ _globals._spriteIndexes[6] = _scene->_sprites.addSprites("*CHR_2", PALFLAG_ALL_TO_CLOSEST | PALFLAG_ANY_TO_CLOSEST);
+
+ if (_game._objects.isInRoom(OBJ_OAR)) {
+ _globals._sequenceIndexes[5] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[5], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[5], 14);
+ } else
+ _scene->_hotspots.activate(NOUN_OAR, false);
+
+ _globals._sequenceIndexes[0] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[0], false, 6, 0);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[0], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[0], -1, -2);
+
+ _globals._sequenceIndexes[1] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[1], false, 6, 0);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[1], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[1], -1, -2);
+
+ _globals._sequenceIndexes[2] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[2], false, 6, 0);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[2], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[2], -1, -2);
+
+ if (_scene->_priorSceneId == RETURNING_FROM_LOADING) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+ if (!_globals[kChristineIsInBoat]) {
+ _anim0ActvFl = true;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('r', 1), 0);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 239);
+ int hotspotIdx = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[hotspotIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(hotspotIdx, Common::Point(79, 133), FACING_SOUTHWEST);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[0], 6);
+ }
+ } else if (_scene->_priorSceneId == 504) {
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+
+ if (_game._visitedScenes._sceneRevisited) {
+ _game._player._playerPos = Common::Point(189, 123);
+ _game._player._facing = FACING_SOUTHWEST;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+
+ if (!_globals[kChristineIsInBoat]) {
+ _anim0ActvFl = true;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('r', 1), 0);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 239);
+ int hotspotIdx = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[hotspotIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(hotspotIdx, Common::Point(79, 133), FACING_SOUTHWEST);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[0], 6);
+ }
+ _globals._animationIndexes[1] = _scene->loadAnimation(formAnimName('r', 2), 95);
+ } else {
+ _game._player._playerPos = Common::Point(186, 122);
+ _game._player._facing = FACING_SOUTHWEST;
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _anim0ActvFl = true;
+ _globals._animationIndexes[0] = _scene->loadAnimation(formAnimName('r', 1), 0);
+ int hotspotIdx = _scene->_dynamicHotspots.add(NOUN_CHRISTINE, VERB_WALK_TO, SYNTAX_SINGULAR_FEM, EXT_NONE, Common::Rect(0, 0, 0, 0));
+ _scene->_dynamicHotspots[hotspotIdx]._articleNumber = PREP_ON;
+ _scene->_dynamicHotspots.setPosition(hotspotIdx, Common::Point(79, 133), FACING_SOUTHWEST);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[0], 2);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[0], 3);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[0], 4);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[0], 5);
+ _scene->setDynamicAnim(hotspotIdx, _globals._animationIndexes[0], 6);
+ }
+ } else if ((_scene->_priorSceneId == 501) || (_scene->_priorSceneId != RETURNING_FROM_LOADING)) {
+ _game._player._playerPos = Common::Point(0, 142);
+ _game._player._facing = FACING_EAST;
+ _game._player._stepEnabled = false;
+ _game._player.walk(Common::Point(23, 145), FACING_EAST);
+ _game._player.setWalkTrigger(60);
+ }
+
+ sceneEntrySound();
+}
+
+void Scene506::step() {
+ switch (_game._trigger) {
+ case 60:
+ _globals._sequenceIndexes[3] = _scene->_sequences.addReverseSpriteCycle(_globals._spriteIndexes[3], false, 6, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 61);
+ break;
+
+ case 61:
+ _globals._sequenceIndexes[3] = _scene->_sequences.addStampCycle(_globals._spriteIndexes[3], false, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+ _game._player._stepEnabled = true;
+ break;
+
+ case 95:
+ _game._player._visible = true;
+ _game._player._stepEnabled = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[1]);
+ break;
+
+ default:
+ break;
+ }
+
+ if (_anim0ActvFl) {
+ int curFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ if ((curFrame == 141) && !_skipFl) {
+ _game._player._visible = true;
+ _skipFl = true;
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_ANIM, _globals._animationIndexes[0]);
+ }
+
+ if (curFrame == 240)
+ _scene->setAnimFrame(_globals._animationIndexes[0], 239);
+
+ if (curFrame == 300)
+ _scene->setAnimFrame(_globals._animationIndexes[0], 239);
+
+ if (curFrame == 168)
+ _game._player._stepEnabled = true;
+
+ if (curFrame == 289)
+ _scene->_nextSceneId = 501;
+ }
+
+ if (_ascendingFl && (_vm->_gameConv->_running != 26)) {
+ _ascendingFl = false;
+ _game._player._stepEnabled = false;
+ }
+}
+
+void Scene506::actions() {
+ if (_action.isAction(VERB_TALK_TO, NOUN_CHRISTINE)) {
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(1);
+ _scene->setAnimFrame(_globals._animationIndexes[0], 290);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_OAR)) {
+ switch (_game._trigger) {
+ case (0):
+ if (_game._objects.isInRoom(OBJ_OAR)) {
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[4], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 4, 1);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 2);
+ }
+ break;
+
+ case 1:
+ _scene->deleteSequence(_globals._sequenceIndexes[5]);
+ _scene->_hotspots.activate(NOUN_OAR, false);
+ _game._objects.addToInventory(OBJ_OAR);
+ _vm->_sound->command(26);
+ break;
+
+ case 2:
+ _game.syncTimers(SYNC_PLAYER, 0, SYNC_SEQ, _globals._sequenceIndexes[4]);
+ _game._player._visible = true;
+ _scene->_sequences.addTimer(20, 3);
+ break;
+
+ case 3:
+ _vm->_dialogs->showItem(OBJ_OAR, 824, 0);
+ _game._player._stepEnabled = true;
+ break;
+
+ default:
+ break;
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+
+ if (_action.isAction(VERB_WALK_THROUGH, NOUN_DOOR) || _action.isAction(VERB_OPEN, NOUN_DOOR)) {
+ if (_scene->_customDest.x < 150) {
+ switch (_game._trigger) {
+ case (0):
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[4] = _scene->_sequences.startPingPongCycle(_globals._spriteIndexes[4], true, 5, 2);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[4], 1, 4);
+ _scene->_sequences.setSeqPlayer(_globals._sequenceIndexes[4], true);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_SPRITE, 4, 65);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[4], SEQUENCE_TRIGGER_EXPIRE, 0, 67);
+ break;
+
+ case 65:
+ _scene->deleteSequence(_globals._sequenceIndexes[3]);
+ _globals._sequenceIndexes[3] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[3], false, 8, 1);
+ _scene->_sequences.setDepth(_globals._sequenceIndexes[3], 14);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[3], -1, -2);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[3], SEQUENCE_TRIGGER_EXPIRE, 0, 66);
+ _vm->_sound->command(24);
+ break;
+
+ case 66:
+ _game._player.walk(Common::Point(0, 142), FACING_WEST);
+ _game._player.setWalkTrigger(68);
+ break;
+
+ case 67:
+ _game._player._visible = true;
+ break;
+
+ case 68:
+ if (_globals[kChristineIsInBoat])
+ _scene->_nextSceneId = 501;
+ else
+ _scene->setAnimFrame(_globals._animationIndexes[0], 241);
+ break;
+
+ default:
+ break;
+ }
+ } else {
+ switch (_game._trigger) {
+ case (0):
+ if (!_globals[kChristineIsInBoat]) {
+ _vm->_gameConv->run(26);
+ _vm->_gameConv->exportValue(2);
+ int curFrame = _scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame();
+ if (curFrame == 240 || curFrame == 239)
+ _scene->setAnimFrame(_globals._animationIndexes[0], 290);
+ _ascendingFl = true;
+ }
+ _game._player._stepEnabled = false;
+ _game._player._visible = false;
+ _globals._sequenceIndexes[7] = _scene->_sequences.addSpriteCycle(_globals._spriteIndexes[7], false, 5, 1);
+ _scene->_sequences.setAnimRange(_globals._sequenceIndexes[7], -1, -2);
+ _game.syncTimers(SYNC_SEQ, _globals._sequenceIndexes[7], SYNC_PLAYER, 0);
+ _scene->_sequences.addSubEntry(_globals._sequenceIndexes[7], SEQUENCE_TRIGGER_EXPIRE, 0, 90);
+ break;
+
+ case 90:
+ _vm->_gameConv->abortConv();
+ _scene->_nextSceneId = 504;
+ break;
+
+ default:
+ break;
+ }
+ }
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_vm->_gameConv->_running == 26) {
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action._lookFlag) {
+ _vm->_dialogs->show(50610);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_LOOK) || _action.isAction(VERB_LOOK_AT)) {
+ if (_action.isObject(NOUN_FLOOR)) {
+ _vm->_dialogs->show(50611);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_WALL)) {
+ _vm->_dialogs->show(50612);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_TORCH)) {
+ _vm->_dialogs->show(50613);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_COLUMN)) {
+ _vm->_dialogs->show(50614);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CEILING)) {
+ _vm->_dialogs->show(50615);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_RAMP)) {
+ _vm->_dialogs->show(50616);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_DOOR)) {
+ if (_scene->_customDest.x < 150)
+ _vm->_dialogs->show(50617);
+ else
+ _vm->_dialogs->show(50618);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_OAR) && _game._objects.isInRoom(OBJ_OAR)) {
+ _vm->_dialogs->show(50619);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isObject(NOUN_CHRISTINE)) {
+ if (_scene->_animation[_globals._animationIndexes[0]]->getCurrentFrame() < 235)
+ _vm->_dialogs->show(50621);
+ else
+ _vm->_dialogs->show(50620);
+ _action._inProgress = false;
+ return;
+ }
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_TORCH)) {
+ _vm->_dialogs->show(50613);
+ _action._inProgress = false;
+ return;
+ }
+
+ if (_action.isAction(VERB_TAKE, NOUN_CHRISTINE)) {
+ _vm->_dialogs->show(50622);
+ _action._inProgress = false;
+ }
+}
+
+void Scene506::preActions() {
+ if (_action.isAction(VERB_UNLOCK, NOUN_DOOR) || _action.isAction(VERB_LOCK, NOUN_DOOR))
+ _game._player.walk(Common::Point(33, 142), FACING_NORTHWEST);
+
+ if (_action.isAction(VERB_OPEN, NOUN_DOOR)) {
+ if (_scene->_customDest.x < 150)
+ _game._player.walk(Common::Point(33, 142), FACING_NORTHWEST);
+ else
+ _game._player.walk(Common::Point(191, 118), FACING_EAST);
+ }
+}
+
+/*------------------------------------------------------------------------*/
+
+} // End of namespace Phantom
+} // End of namespace MADS
diff --git a/engines/mads/phantom/phantom_scenes5.h b/engines/mads/phantom/phantom_scenes5.h
new file mode 100644
index 0000000000..33478304f3
--- /dev/null
+++ b/engines/mads/phantom/phantom_scenes5.h
@@ -0,0 +1,219 @@
+/* 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.
+ *
+ */
+
+#ifndef MADS_PHANTOM_SCENES5_H
+#define MADS_PHANTOM_SCENES5_H
+
+#include "common/scummsys.h"
+#include "common/serializer.h"
+#include "mads/game.h"
+#include "mads/scene.h"
+#include "mads/phantom/phantom_scenes.h"
+
+namespace MADS {
+
+namespace Phantom {
+
+class Scene5xx : public PhantomScene {
+protected:
+ /**
+ * Plays an appropriate sound when entering a scene
+ */
+ void sceneEntrySound();
+
+ /**
+ *Sets the AA file to use for the scene
+ */
+ void setAAName();
+
+ /**
+ * Updates the prefix used for getting player sprites for the scene
+ */
+ void setPlayerSpritesPrefix();
+public:
+ Scene5xx(MADSEngine *vm) : PhantomScene(vm) {}
+};
+
+class Scene501 : public Scene5xx {
+private:
+ bool _anim0ActvFl;
+ bool _skipFl;
+
+public:
+ Scene501(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene502 : public Scene5xx {
+private:
+ bool _fire1ActiveFl;
+ bool _fire2ActiveFl;
+ bool _fire3ActiveFl;
+ bool _fire4ActiveFl;
+ bool _panelTurningFl;
+ bool _trapDoorHotspotEnabled;
+ bool _acceleratedFireActivationFl;
+
+ int _panelPushedNum;
+ int _puzzlePictures[16];
+ int _puzzleSprites[16];
+ int _puzzleSequences[16];
+ int _messageLevel;
+ int _cycleStage;
+
+ Common::Point _nextPos;
+
+ uint32 _lastFrameTime;
+ uint32 _timer;
+ uint32 _deathTimer;
+
+ byte *_cyclePointer;
+
+ void room_502_initialize_panels();
+ void loadCyclingInfo();
+ void animateFireBursts();
+ void setPaletteCycle();
+ void handlePanelAnimation();
+ void getPanelInfo(Common::Point *walkToPos, int *panel, Common::Point mousePos, Common::Point *interimPos);
+
+public:
+ Scene502(MADSEngine *vm);
+ ~Scene502();
+
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene504 : public Scene5xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _anim2ActvFl;
+ bool _anim3ActvFl;
+ bool _anim4ActvFl;
+ bool _anim5ActvFl;
+ bool _playingMusicFl;
+ bool _chairDialogDoneFl;
+ bool _fireBreathFl;
+
+ int _songNum;
+ int _input3Count;
+ int _playCount;
+ int _listenStatus;
+ int _listenFrame;
+ int _chairStatus;
+ int _chairFrame;
+ int _playStatus;
+ int _playFrame;
+ int _phantomStatus;
+ int _phantomFrame;
+ int _christineTalkCount;
+ int _deathCounter;
+
+ void handleListenAnimation();
+ void handleOrganAnimation();
+ void handleChairAnimation();
+ void handlePhantomAnimation1();
+ void handlePhantomAnimation2();
+ void handlePhantomAnimation3();
+ void handleListenConversation();
+ void handlePlayConversation();
+ void handleFightConversation();
+
+public:
+ Scene504(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene505 : public Scene5xx {
+private:
+ bool _anim0ActvFl;
+ bool _anim1ActvFl;
+ bool _anim2ActvFl;
+ bool _checkFrame106;
+ bool _leaveRoomFl;
+ bool _partedFl;
+
+ int _raoulStatus;
+ int _raoulFrame;
+ int _raoulCount;
+ int _bothStatus;
+ int _bothFrame;
+ int _bothCount;
+ int _partStatus;
+ int _partFrame;
+ int _partCount;
+
+ void handleRaoulAnimation();
+ void handleBothanimation();
+ void handlePartedAnimation();
+ void handleCoffinDialog();
+
+public:
+ Scene505(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+class Scene506 : public Scene5xx {
+private:
+ bool _anim0ActvFl;
+ bool _skipFl;
+ bool _ascendingFl;
+
+public:
+ Scene506(MADSEngine *vm);
+ virtual void synchronize(Common::Serializer &s);
+
+ virtual void setup();
+ virtual void enter();
+ virtual void step();
+ virtual void preActions();
+ virtual void actions();
+};
+
+} // End of namespace Phantom
+} // End of namespace MADS
+
+#endif /* MADS_PHANTOM_SCENES5_H */
diff --git a/engines/mads/player.cpp b/engines/mads/player.cpp
index bb747f4b52..09a961825e 100644
--- a/engines/mads/player.cpp
+++ b/engines/mads/player.cpp
@@ -56,7 +56,6 @@ Player::Player(MADSEngine *vm)
_special = 0;
_ticksAmount = 0;
_priorTimer = 0;
- _trigger = 0;
_scalingVelocity = false;
_spritesChanged = false;
_forceRefresh = false;
@@ -80,6 +79,10 @@ Player::Player(MADSEngine *vm)
_moving = false;
_walkOffScreen = 0;
_walkOffScreenSceneId = -1;
+ _forcePrefix = false;
+ _commandsAllowed = false;
+ _enableAtTarget = false;
+ _walkTrigger = 0;
Common::fill(&_stopWalkerList[0], &_stopWalkerList[12], 0);
Common::fill(&_stopWalkerTrigger[0], &_stopWalkerTrigger[12], 0);
@@ -186,8 +189,10 @@ void Player::changeFacing() {
(Facing)_directionListIndexes[_facing + 10];
selectSeries();
- if ((_facing == _turnToFacing) && !_moving)
+ if ((_facing == _turnToFacing) && !_moving) {
updateFrame();
+ activateTrigger();
+ }
_priorTimer += 1;
}
@@ -242,8 +247,8 @@ void Player::updateFrame() {
Scene &scene = _vm->_game->_scene;
assert(scene._sprites[idx] != nullptr);
SpriteAsset &spriteSet = *scene._sprites[idx];
-
- // WORKAROUND: Certain cutscenes set up player sprites that don't have any
+
+ // WORKAROUND: Certain cutscenes set up player sprites that don't have any
// character info. In such cases, simply ignore player updates
if (!spriteSet._charInfo)
return;
@@ -278,6 +283,16 @@ void Player::updateFrame() {
_forceRefresh = true;
}
+void Player::activateTrigger() {
+ // TODO: Finish this!
+ // TODO: Also sync _walkTrigger, if necessary
+
+ if (_walkTrigger) {
+ _vm->_game->_trigger = _walkTrigger;
+ _walkTrigger = 0;
+ }
+}
+
void Player::update() {
Scene &scene = _vm->_game->_scene;
@@ -289,7 +304,7 @@ void Player::update() {
int newDepth = 1;
int yp = MIN(_playerPos.y, (int16)(MADS_SCENE_HEIGHT - 1));
- for (int idx = 1; idx < 15; ++idx) {
+ for (int idx = 1; idx < DEPTH_BANDS_SIZE; ++idx) {
if (scene._sceneInfo->_depthList[newDepth] >= yp)
newDepth = idx + 1;
}
@@ -441,10 +456,12 @@ void Player::move() {
if (newFacing && _moving)
startMovement();
- if (_turnToFacing != _facing)
+ if (_turnToFacing != _facing) {
changeFacing();
- else if (!_moving)
+ } else if (!_moving) {
updateFrame();
+ activateTrigger();
+ }
int velocity = _velocity;
if (_scalingVelocity && (_totalDistance > 0)) {
@@ -797,4 +814,26 @@ void Player::removePlayerSprites() {
_visible = false;
}
+void Player::firstWalk(Common::Point fromPos, Facing fromFacing, Common::Point destPos, Facing destFacing, bool enableFl) {
+ _playerPos = fromPos;
+ _facing = fromFacing;
+
+ walk(destPos, destFacing);
+ _walkAnywhere = true;
+
+ _commandsAllowed = false;
+ _enableAtTarget = enableFl;
+}
+
+void Player::setWalkTrigger(int val) {
+ _walkTrigger = val;
+ warning("TODO: Player::setWalkTrigger");
+}
+
+void Player::resetFacing(Facing facing) {
+ _facing = facing;
+ _turnToFacing = facing;
+ selectSeries();
+}
+
} // End of namespace MADS
diff --git a/engines/mads/player.h b/engines/mads/player.h
index e5765a9bca..55000047fb 100644
--- a/engines/mads/player.h
+++ b/engines/mads/player.h
@@ -95,6 +95,8 @@ private:
void startMovement();
void changeFacing();
+
+ void activateTrigger();
public:
MADSAction *_action;
@@ -131,13 +133,17 @@ public:
int _trigger;
bool _scalingVelocity;
bool _forceRefresh;
+ bool _forcePrefix;
bool _needToWalk;
bool _readyToWalk;
+ bool _commandsAllowed;
+ bool _enableAtTarget;
int _stopWalkerIndex;
int _centerOfGravity;
int _currentDepth;
int _currentScale;
Common::String _spritesPrefix;
+ int _walkTrigger;
public:
Player(MADSEngine *vm);
@@ -221,6 +227,13 @@ public:
}
void removePlayerSprites();
+
+ void firstWalk(Common::Point fromPos, Facing fromFacing, Common::Point destPos, Facing destFacing, bool enableFl);
+
+ void setWalkTrigger(int val);
+
+ void resetFacing(Facing facing);
+
};
} // End of namespace MADS
diff --git a/engines/mads/rails.cpp b/engines/mads/rails.cpp
index 9b2ec71de6..ee0ca98cd3 100644
--- a/engines/mads/rails.cpp
+++ b/engines/mads/rails.cpp
@@ -274,4 +274,18 @@ void Rails::synchronize(Common::Serializer &s) {
}
}
+void Rails::disableNode(int nodeIndex) {
+ _nodes[nodeIndex]._active = false;
+
+ for (uint16 i = 0; i < _nodes.size(); i++) {
+ if (i != nodeIndex)
+ disableLine(i, nodeIndex);
+ }
+}
+
+void Rails::disableLine(int from, int to) {
+ _nodes[from]._distances[to] = 0x3FFF;
+ _nodes[to]._distances[from] = 0x3FFF;
+}
+
} // End of namespace MADS
diff --git a/engines/mads/rails.h b/engines/mads/rails.h
index c95f5c47a6..ea12177038 100644
--- a/engines/mads/rails.h
+++ b/engines/mads/rails.h
@@ -127,6 +127,10 @@ public:
* Synchronize the data for the route
*/
void synchronize(Common::Serializer &s);
+
+ void disableNode(int idx);
+ void disableLine(int from, int to);
+
};
} // End of namespace MADS
diff --git a/engines/mads/resources.cpp b/engines/mads/resources.cpp
index d5352fb205..16019a4b07 100644
--- a/engines/mads/resources.cpp
+++ b/engines/mads/resources.cpp
@@ -79,7 +79,7 @@ private:
*/
ResourceType getResourceType(const Common::String &resourceName) const;
public:
- HagArchive(MADSEngine *vm);
+ explicit HagArchive(MADSEngine *vm);
virtual ~HagArchive();
// Archive implementation
@@ -151,7 +151,7 @@ void HagArchive::loadIndex(MADSEngine *vm) {
Common::File hagFile;
for (int sectionIndex = -1; sectionIndex < 11; ++sectionIndex) {
- if (sectionIndex == 0)
+ if (sectionIndex == 0 && !Common::File::exists("SECTION0.HAG"))
continue;
// Dragonsphere does not have some sections - skip them
@@ -239,7 +239,7 @@ Common::String HagArchive::getResourceFilename(const Common::String &resourceNam
int value = atoi(resourceName.c_str() + 2);
int hagFileNum = (resType == RESTYPE_ROOM) ? value / 100 : value;
- if (hagFileNum > 0)
+ if (hagFileNum >= 0)
outputFilename = Common::String::format("SECTION%d.HAG", hagFileNum);
}
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index ee5f1a5440..2875bc0b56 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -24,6 +24,7 @@
#include "mads/scene.h"
#include "mads/compression.h"
#include "mads/mads.h"
+#include "mads/audio.h"
#include "mads/dragonsphere/dragonsphere_scenes.h"
#include "mads/nebular/nebular_scenes.h"
#include "mads/phantom/phantom_scenes.h"
@@ -49,7 +50,8 @@ Scene::Scene(MADSEngine *vm)
_reloadSceneFlag = false;
_freeAnimationFlag = false;
_animationData = nullptr;
- _activeAnimation = nullptr;
+ for (int i = 0; i < 10; i++)
+ _animation[i] = nullptr;
_textSpacing = -1;
_frameStartTime = 0;
_mode = SCREENMODE_VGA;
@@ -60,6 +62,8 @@ Scene::Scene(MADSEngine *vm)
_spritesCount = 0;
_variant = 0;
+ _speechReady = -1;
+
_paletteUsageF.push_back(PaletteUsage::UsageEntry(0xF));
// Set up a scene surface that maps to our physical screen drawing surface
@@ -150,6 +154,8 @@ void Scene::loadScene(int sceneId, const Common::String &prefix, bool palFlag) {
_sequences.clear();
_kernelMessages.clear();
_vm->_palette->_paletteUsage.load(&_scenePaletteUsage);
+ if (_vm->getGameID() != GType_RexNebular)
+ setCamera(Common::Point(0, 0));
int flags = SCENEFLAG_LOAD_SHADOW;
if (_vm->_dithering)
@@ -385,6 +391,7 @@ void Scene::doFrame() {
!_vm->_game->_fx);
}
+ _vm->_game->camUpdate();
if (_action._selectedAction && player._stepEnabled && !player._needToWalk &&
!_vm->_game->_trigger && !player._trigger) {
_action.startAction();
@@ -430,8 +437,7 @@ void Scene::doFrame() {
_sequences.tick();
// Handle any active animation
- if (_activeAnimation)
- _activeAnimation->update();
+ animations_tick();
}
// If the debugget flag is set, show the mouse position
@@ -480,8 +486,10 @@ void Scene::doFrame() {
_vm->_game->_fx = kTransitionNone;
// Handle freeing animation if necessary
- if (_activeAnimation && _activeAnimation->freeFlag())
- _freeAnimationFlag = true;
+ for (int i = 0; i < 10; i++) {
+ if (_animation[i] && _animation[i]->freeFlag())
+ _freeAnimationFlag = true;
+ }
if (_freeAnimationFlag)
freeAnimation();
}
@@ -605,19 +613,29 @@ void Scene::checkKeyboard() {
}
}
-void Scene::loadAnimation(const Common::String &resName, int trigger) {
+int Scene::loadAnimation(const Common::String &resName, int trigger) {
// WORKAROUND: If there's already a previous active animation used by the
// scene, then free it before we create the new one
- if (_activeAnimation)
- freeAnimation();
+ if ((_vm->getGameID() == GType_RexNebular) && _animation[0])
+ freeAnimation(0);
DepthSurface depthSurface;
UserInterface interfaceSurface(_vm);
- _activeAnimation = Animation::init(_vm, this);
- _activeAnimation->load(interfaceSurface, depthSurface, resName,
- _vm->_dithering ? ANIMFLAG_DITHER : 0, nullptr, nullptr);
- _activeAnimation->startAnimation(trigger);
+ for (int i = 0; i < 10; i++) {
+ if (!_animation[i]) {
+ _animation[i] = Animation::init(_vm, this);
+ _animation[i]->load(interfaceSurface, depthSurface, resName,
+ _vm->_dithering ? ANIMFLAG_DITHER : 0, nullptr, nullptr);
+ _animation[i]->startAnimation(trigger);
+
+ return i;
+ }
+ }
+
+ error("Unable to find an available animation slot");
+
+ return -1;
}
void Scene::updateCursor() {
@@ -658,9 +676,12 @@ void Scene::freeCurrentScene() {
delete _animationData;
_animationData = nullptr;
}
- if (_activeAnimation) {
- delete _activeAnimation;
- _activeAnimation = nullptr;
+
+ for (int i = 0; i < 10; i++) {
+ if (_animation[i]) {
+ delete _animation[i];
+ _animation[i] = nullptr;
+ }
}
_vm->_palette->_paletteUsage.load(nullptr);
@@ -692,33 +713,40 @@ void Scene::resetScene() {
}
void Scene::freeAnimation() {
- if (_activeAnimation) {
- Player &player = _vm->_game->_player;
+ for (int j = 0; j < 10; j++)
+ freeAnimation(j);
- if (!_freeAnimationFlag) {
- _spriteSlots.fullRefresh(true);
- _sequences.scan();
- }
+ _freeAnimationFlag = false;
+}
+
+void Scene::freeAnimation(int idx) {
+ if (_animation[idx]) {
+ if (idx == 0) {
+ Player &player = _vm->_game->_player;
+
+ if (!_freeAnimationFlag) {
+ _spriteSlots.fullRefresh(true);
+ _sequences.scan();
+ }
- // Refresh the player
- if (player._visible) {
- player._forceRefresh = true;
- player.update();
+ // Refresh the player
+ if (player._visible) {
+ player._forceRefresh = true;
+ player.update();
+ }
}
// Remove any kernel messages in use by the animation
- for (uint i = 0; i < _activeAnimation->_messages.size(); ++i) {
- int msgIndex = _activeAnimation->_messages[i]._kernelMsgIndex;
+ for (uint i = 0; i < _animation[idx]->_messages.size(); ++i) {
+ int msgIndex = _animation[idx]->_messages[i]._kernelMsgIndex;
if (msgIndex >= 0)
_kernelMessages.remove(msgIndex);
}
// Delete the animation
- delete _activeAnimation;
- _activeAnimation = nullptr;
+ delete _animation[idx];
+ _animation[idx] = nullptr;
}
-
- _freeAnimationFlag = false;
}
void Scene::synchronize(Common::Serializer &s) {
@@ -729,7 +757,107 @@ void Scene::synchronize(Common::Serializer &s) {
s.syncAsByte(_roomChanged);
s.syncAsUint16LE(_nextSceneId);
s.syncAsUint16LE(_priorSceneId);
+ s.syncAsSint16LE(_variant);
_dynamicHotspots.synchronize(s);
}
+void Scene::setAnimFrame(int id, int val) {
+ if ((id >= 0) && _animation[id])
+ _animation[id]->setCurrentFrame(val);
+}
+
+int Scene::getAnimFrame(int id) {
+ if ((id >= 0) && _animation[id])
+ return _animation[id]->getCurrentFrame();
+
+ return -1;
+}
+
+void Scene::setDynamicAnim(int id, int anim_id, int segment) {
+ if (id >= 0 && id <= DYNAMIC_HOTSPOTS_SIZE && _animation[anim_id]) {
+ _animation[anim_id]->_dynamicHotspotIndex = id;
+ if (_dynamicHotspots[id]._animIndex < 0)
+ _dynamicHotspots[id]._active = false;
+ _dynamicHotspots[id]._animIndex = anim_id;
+
+ // TODO: Anim segments
+
+ // NOTE: Only remove the TODO below when _dynamicHotspotIndex
+ // in the Animation class is actually used in the engine!
+
+ warning("TODO: Scene::setDynamicAnim");
+ }
+}
+
+void Scene::setCamera(Common::Point pos) {
+ _posAdjust = pos;
+ warning("setCamera: Incomplete function");
+}
+
+void Scene::drawToBackground(int spriteId, int frameId, Common::Point pos, int depth, int scale) {
+ SpriteAsset &asset = *_sprites[spriteId];
+
+ if (pos.x == -32000)
+ pos.x = asset.getFramePos(frameId - 1).x;
+ if (pos.y == -32000)
+ pos.y = asset.getFramePos(frameId - 1).y;
+
+ int slotIndex = _spriteSlots.add();
+ SpriteSlot &slot = _spriteSlots[slotIndex];
+ slot._spritesIndex = spriteId;
+ slot._frameNumber = frameId;
+ slot._seqIndex = 1;
+ slot._position = pos;
+ slot._depth = depth;
+ slot._scale = scale;
+ slot._flags = IMG_DELTA;
+}
+
+void Scene::deleteSequence(int idx) {
+ if (_sequences[idx]._active && _sequences[idx]._dynamicHotspotIndex >= 0)
+ _dynamicHotspots.remove(_sequences[idx]._dynamicHotspotIndex);
+
+ _sequences[idx]._active = false;
+
+ if (!_sequences[idx]._doneFlag) {
+ warning("TODO: deleteSequence: Sequence %d not done", idx);
+ // TODO: This is wrong, and crashes Phantom at scene 102 when the door is opened
+ //doFrame(); // FIXME/CHECKME: Is this correct?
+ } else {
+ _sequences.remove(idx);
+ }
+}
+
+void Scene::loadSpeech(int idx) {
+ _vm->_audio->setDefaultSoundGroup();
+ // NOTE: The original actually preloads the speech sample here, but the samples
+ // are so small that it's not really worth it...
+
+ // TODO: As the speech samples aren't cached anymore, _speechReady should be remove
+ _speechReady = idx;
+}
+
+void Scene::playSpeech(int idx) {
+ _vm->_audio->stop();
+ _vm->_audio->playSound(idx - 1);
+}
+
+void Scene::sceneScale(int yFront, int maxScale, int yBack, int minScale) {
+ _sceneInfo->_yBandsEnd = yFront;
+ _sceneInfo->_maxScale = maxScale;
+ _sceneInfo->_yBandsStart = yBack;
+ _sceneInfo->_minScale = minScale;
+
+ _bandsRange = _sceneInfo->_yBandsEnd - _sceneInfo->_yBandsStart;
+ _scaleRange = _sceneInfo->_maxScale - _sceneInfo->_minScale;
+}
+
+void Scene::animations_tick() {
+ //warning("TODO: Implement _animations as an AnimationList and refactor (and check implementation)");
+ for (int i = 0; i < 10; i++) {
+ if (_animation[i])
+ _animation[i]->update();
+ }
+}
+
} // End of namespace MADS
diff --git a/engines/mads/scene.h b/engines/mads/scene.h
index c0784c3812..79e0fd4029 100644
--- a/engines/mads/scene.h
+++ b/engines/mads/scene.h
@@ -111,7 +111,7 @@ public:
Common::Array<PaletteCycle> _paletteCycles;
Common::StringArray _vocabStrings;
Animation *_animationData;
- Animation *_activeAnimation;
+ Animation *_animation[10];
bool _freeAnimationFlag;
int _depthStyle;
int _bandsRange;
@@ -128,7 +128,6 @@ public:
Common::Point _customDest;
Common::Array<PaletteUsage::UsageEntry> _paletteUsageF;
Common::Array<PaletteUsage::UsageEntry> _scenePaletteUsage;
-
/**
* Constructor
*/
@@ -214,7 +213,7 @@ public:
/**
* Load an animation
*/
- void loadAnimation(const Common::String &resName, int trigger = 0);
+ int loadAnimation(const Common::String &resName, int trigger = 0);
/**
* Returns a vocab entry
@@ -245,9 +244,28 @@ public:
void freeAnimation();
/**
+ * Frees any given active animation for the scene
+ */
+ void freeAnimation(int idx);
+
+ /**
* Synchronize the game
*/
void synchronize(Common::Serializer &s);
+
+ void setAnimFrame(int id, int val);
+ int getAnimFrame(int id);
+
+ void setDynamicAnim(int id, int anim_id, int segment);
+ void setCamera(Common::Point pos);
+ void drawToBackground(int spriteId, int frameId, Common::Point pos, int depth, int scale);
+ void deleteSequence(int idx);
+ void loadSpeech(int idx);
+ void playSpeech(int idx);
+ void sceneScale(int yFront, int maxScale, int yBack, int minScale);
+ void animations_tick();
+
+ int _speechReady;
};
} // End of namespace MADS
diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp
index e48bcd8c6f..7b0e64c1fe 100644
--- a/engines/mads/scene_data.cpp
+++ b/engines/mads/scene_data.cpp
@@ -108,7 +108,7 @@ SceneInfo::SceneInfo(MADSEngine *vm) : _vm(vm) {
_minScale = 0;
_field4A = 0;
_usageIndex = 0;
- for (int i = 0; i < 15; ++i)
+ for (int i = 0; i < DEPTH_BANDS_SIZE; ++i)
_depthList[i] = 0;
}
@@ -145,6 +145,15 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName,
// Read in basic data
Common::SeekableReadStream *infoStream = infoPack.getItemStream(0);
+
+ /*
+ byte *data = new byte[infoStream->size()];
+ infoStream->read(data, infoStream->size());
+ Common::hexdump(data, infoStream->size());
+ infoStream->seek(0);
+ delete[] data;
+ */
+
if (_vm->getGameID() == GType_RexNebular) {
_sceneId = infoStream->readUint16LE();
} else {
@@ -161,22 +170,28 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName,
_height = infoStream->readUint16LE();
infoStream->skip(24);
-
- nodeCount = infoStream->readUint16LE();
- _yBandsEnd = infoStream->readUint16LE();
- _yBandsStart = infoStream->readUint16LE();
- _maxScale = infoStream->readUint16LE();
- _minScale = infoStream->readUint16LE();
- for (int i = 0; i < DEPTH_BANDS_SIZE; ++i)
- _depthList[i] = infoStream->readUint16LE();
- _field4A = infoStream->readUint16LE();
} else {
_artFileNum = sceneId;
_depthStyle = 0;
_width = 320;
_height = 156;
- infoStream->skip(140);
+ infoStream->skip(98);
+ }
+
+ nodeCount = infoStream->readUint16LE();
+ _yBandsEnd = infoStream->readUint16LE();
+ _yBandsStart = infoStream->readUint16LE();
+ _maxScale = infoStream->readUint16LE();
+ _minScale = infoStream->readUint16LE();
+ for (int i = 0; i < DEPTH_BANDS_SIZE; ++i)
+ _depthList[i] = infoStream->readUint16LE();
+ _field4A = infoStream->readUint16LE();
+
+ // HACK for V2 games
+ if (_vm->getGameID() != GType_RexNebular) {
+ _minScale = _maxScale = 100;
+ memset(_depthList, 0, DEPTH_BANDS_SIZE * sizeof(int));
}
// Load the scene's walk nodes
@@ -184,27 +199,29 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName,
WalkNode node;
node.load(infoStream);
- if (i < nodeCount)
+ if (i < nodeCount) {
_nodes.push_back(node);
+ //debug("Node %d: %d,%d", i, node._walkPos.x, node._walkPos.y);
+ }
}
- int spriteSetsCount = infoStream->readUint16LE();
- int spriteInfoCount = infoStream->readUint16LE();
-
- // Load in sprite sets
Common::StringArray setNames;
- for (int i = 0; i < 10; ++i) {
- char name[64];
- infoStream->read(name, 64);
-
- if (i < spriteSetsCount)
- setNames.push_back(Common::String(name));
- }
-
- // Load in sprite draw information
Common::Array<SpriteInfo> spriteInfo;
- // TODO: The following isn't quite right for V2 games
+
if (_vm->getGameID() == GType_RexNebular) {
+ int spriteSetsCount = infoStream->readUint16LE();
+ int spriteInfoCount = infoStream->readUint16LE();
+
+ // Load in sprite sets
+ for (int i = 0; i < 10; ++i) {
+ char name[64];
+ infoStream->read(name, 64);
+
+ if (i < spriteSetsCount)
+ setNames.push_back(Common::String(name));
+ }
+
+ // Load in sprite draw information
for (int i = 0; i < 50; ++i) {
SpriteInfo info;
info.load(infoStream);
@@ -212,6 +229,12 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName,
if (i < spriteInfoCount)
spriteInfo.push_back(info);
}
+ } else {
+ uint16 shadowColors = infoStream->readUint16LE();
+ uint16 shadowR = infoStream->readUint16LE();
+ uint16 shadowG = infoStream->readUint16LE();
+ uint16 shadowB = infoStream->readUint16LE();
+ debug("Shadow colors: %d (%d, %d, %d)", shadowColors, shadowR, shadowG, shadowB);
}
delete infoStream;
@@ -422,6 +445,18 @@ void SceneInfo::loadMadsV2Background(int sceneId, const Common::String &resName,
assert(screenWidth == _width);
assert(screenHeight <= _height);
+ // Resize the background surface to hold all of the tiles
+ uint16 newWidth = bgSurface.w;
+ uint16 newHeight = bgSurface.h;
+
+ if (tileWidth < screenWidth && bgSurface.w != tileCount * tileWidth)
+ newWidth = tileCount * tileWidth;
+ if (tileHeight < screenHeight && bgSurface.h != tileCount * tileHeight)
+ newHeight = tileCount * tileHeight;
+
+ if (bgSurface.w != newWidth || bgSurface.h != newHeight)
+ bgSurface.setSize(newWidth, newHeight);
+
// --------------------------------------------------------------------------------
// Get tile data
@@ -474,6 +509,8 @@ void SceneInfo::loadMadsV2Background(int sceneId, const Common::String &resName,
}
tileSet.clear();
tileDataFile.close();
+
+ delete[] tileMap;
}
/*------------------------------------------------------------------------*/
diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp
index 3c27001ae0..90fbbe7e2a 100644
--- a/engines/mads/screen.cpp
+++ b/engines/mads/screen.cpp
@@ -687,7 +687,6 @@ void ScreenSurface::panTransition(MSurface &newScreen, byte *palData, int entryS
int y1, y2;
int startX = 0;
int deltaX;
- int xAt;
int loopStart;
// uint32 baseTicks, currentTicks;
byte paletteMap[256];
@@ -720,7 +719,7 @@ void ScreenSurface::panTransition(MSurface &newScreen, byte *palData, int entryS
loopStart = throughBlack == THROUGH_BLACK1 ? 0 : 1;
for (int loop = loopStart; loop < 2; ++loop) {
- xAt = startX;
+ int xAt = startX;
for (int xCtr = 0; xCtr < size.x; ++xCtr, xAt += deltaX) {
if (!loop) {
fillRect(Common::Rect(xAt + destPos.x, y1 + destPos.y,
@@ -732,7 +731,7 @@ void ScreenSurface::panTransition(MSurface &newScreen, byte *palData, int entryS
srcPos.x + xAt + 1, srcPos.y + size.y));
} else {
newScreen.copyRectToSurface(*this, xAt, destPos.y,
- Common::Rect(srcPos.x + xAt, srcPos.y,
+ Common::Rect(srcPos.x + xAt, srcPos.y,
srcPos.x + xAt + 1, srcPos.y + size.y));
}
@@ -778,8 +777,8 @@ void ScreenSurface::swapForeground(byte newPalette[PALETTE_SIZE], byte *paletteM
Common::Rect oldClip = _clipBounds;
resetClipBounds();
-
- copyRectTranslate(*this, oldMap, Common::Point(0, 0),
+
+ copyRectTranslate(*this, oldMap, Common::Point(0, 0),
Common::Rect(0, 0, MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT));
palette.setFullPalette(oldPalette);
@@ -789,9 +788,9 @@ void ScreenSurface::swapForeground(byte newPalette[PALETTE_SIZE], byte *paletteM
/**
* Translates a given palette into a mapping table.
* Palettes consist of 128 RGB entries for the foreground and background
- * respectively, with the two interleaved together. So the start
+ * respectively, with the two interleaved together. So the start
*/
-void ScreenSurface::swapPalette(const byte *palData, byte swapTable[PALETTE_COUNT],
+void ScreenSurface::swapPalette(const byte *palData, byte swapTable[PALETTE_COUNT],
bool foreground) {
int start = foreground ? 1 : 0;
const byte *dynamicList = &palData[start * RGB_SIZE];
@@ -807,7 +806,7 @@ void ScreenSurface::swapPalette(const byte *palData, byte swapTable[PALETTE_COUN
// Handle the 128 palette entries for the foreground or background
for (int idx = 0; idx < (PALETTE_COUNT / 2); ++idx) {
if (start >= PALETTE_START && start <= PALETTE_END) {
- swapTable[start] = Palette::closestColor(dynamicList, staticList,
+ swapTable[start] = Palette::closestColor(dynamicList, staticList,
2 * RGB_SIZE, PALETTE_COUNT / 2) * 2 + staticStart;
}
diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp
index e5bf1631c2..50b37de7ea 100644
--- a/engines/mads/sequence.cpp
+++ b/engines/mads/sequence.cpp
@@ -259,7 +259,7 @@ bool SequenceList::loadSprites(int seqIndex) {
}
if (seqEntry._flags & 2) {
- // Check for object having moved off-scren
+ // Check for object having moved off-screen
if ((pt.x + width) < 0 || (pt.x + width) >= MADS_SCREEN_WIDTH ||
pt.y < 0 || (pt.y - height) >= MADS_SCENE_HEIGHT) {
result = true;
@@ -550,4 +550,26 @@ void SequenceList::setMotion(int seqIndex, int flags, int deltaX, int deltaY) {
se._posAccum.x = se._posAccum.y = 0;
}
+int SequenceList::addStampCycle(int srcSpriteIdx, bool flipped, int sprite) {
+ int id;
+
+ id = addSpriteCycle(srcSpriteIdx, flipped, 32767, 0, 0, 0);
+ if (id >= 0) {
+ setAnimRange(id, sprite, sprite);
+ _entries[id]._animType = ANIMTYPE_STAMP;
+ }
+ return (id);
+}
+
+void SequenceList::setSeqPlayer(int idx, bool flag) {
+ Player &player = _vm->_game->_player;
+ int yp = player._playerPos.y + (player._centerOfGravity * player._currentScale) / 100;
+ setPosition(idx, Common::Point(player._playerPos.x, yp));
+ setDepth(idx, player._currentDepth);
+ setScale(idx, player._currentScale);
+
+ if (flag)
+ _vm->_game->syncTimers(SYNC_SEQ, idx, SYNC_PLAYER, 0);
+}
+
} // End of namespace
diff --git a/engines/mads/sequence.h b/engines/mads/sequence.h
index c3a277c5a5..05a7b616aa 100644
--- a/engines/mads/sequence.h
+++ b/engines/mads/sequence.h
@@ -38,7 +38,7 @@ enum SequenceTrigger {
SEQUENCE_TRIGGER_SPRITE = 2 // Trigger when sequence reaches specific sprite
};
-enum SpriteAnimType { ANIMTYPE_NONE = 0, ANIMTYPE_CYCLED = 1, ANIMTYPE_PING_PONG = 2 };
+enum SpriteAnimType { ANIMTYPE_NONE = 0, ANIMTYPE_CYCLED = 1, ANIMTYPE_PING_PONG = 2, ANIMTYPE_STAMP = 9 };
#define SEQUENCE_ENTRY_SUBSET_MAX 5
@@ -125,6 +125,9 @@ public:
void setMsgLayout(int seqIndex);
void setDone(int seqIndex);
void setMotion(int seqIndex, int flags, int deltaX, int deltaY);
+
+ int addStampCycle(int srcSpriteIdx, bool flipped, int sprite);
+ void setSeqPlayer(int idx, bool flag);
};
} // End of namespace MADS
diff --git a/engines/mads/sound.cpp b/engines/mads/sound.cpp
index 4a35edb80f..c96fd01882 100644
--- a/engines/mads/sound.cpp
+++ b/engines/mads/sound.cpp
@@ -39,6 +39,8 @@ SoundManager::SoundManager(MADSEngine *vm, Audio::Mixer *mixer) {
_newSoundsPaused = false;
_masterVolume = 255;
+ _preferRoland = false;
+
_opl = OPL::Config::create();
_opl->init();
diff --git a/engines/mads/sound.h b/engines/mads/sound.h
index 9882f65e5a..a9cdeddb37 100644
--- a/engines/mads/sound.h
+++ b/engines/mads/sound.h
@@ -48,6 +48,8 @@ public:
SoundManager(MADSEngine *vm, Audio::Mixer *mixer);
~SoundManager();
+ bool _preferRoland;
+
/**
* Initializes the sound driver for a given game section
*/
diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp
index 62fd036c03..e4b09ff54c 100644
--- a/engines/mads/user_interface.cpp
+++ b/engines/mads/user_interface.cpp
@@ -733,7 +733,7 @@ void UserInterface::loadElements() {
_categoryIndexes[CAT_HOTSPOT - 1] = _vm->_game->_screenObjects.size() + 1;
for (int hotspotIdx = scene._hotspots.size() - 1; hotspotIdx >= 0; --hotspotIdx) {
Hotspot &hs = scene._hotspots[hotspotIdx];
- ScreenObject *so = _vm->_game->_screenObjects.add(hs._bounds, SCREENMODE_VGA,
+ ScreenObject *so = _vm->_game->_screenObjects.add(hs._bounds, SCREENMODE_VGA,
CAT_HOTSPOT, hotspotIdx);
so->_active = hs._active;
}
diff --git a/engines/mads/user_interface.h b/engines/mads/user_interface.h
index 1366aa2c32..60cc1f736d 100644
--- a/engines/mads/user_interface.h
+++ b/engines/mads/user_interface.h
@@ -191,8 +191,6 @@ private:
*/
void writeVocab(ScrCategory category, int id);
- void refresh();
-
void updateRect(const Common::Rect &bounds);
public:
MSurface _surface;
@@ -304,6 +302,8 @@ public:
* Synchronize the data
*/
void synchronize(Common::Serializer &s);
+
+ void refresh();
};
} // End of namespace MADS
diff --git a/engines/mohawk/myst_stacks/myst.cpp b/engines/mohawk/myst_stacks/myst.cpp
index 98f0aa5349..9ad1635757 100644
--- a/engines/mohawk/myst_stacks/myst.cpp
+++ b/engines/mohawk/myst_stacks/myst.cpp
@@ -3683,16 +3683,16 @@ void Myst::boilerFireUpdate(bool init) {
void Myst::boilerGaugeInit() {
if (_vm->getCurCard() == 4098) {
_cabinGaugeMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabingau", kMystStack));
- if (!_cabinFireMovie)
+ if (!_cabinGaugeMovie)
error("Failed to open cabingau movie");
- _cabinFireMovie->moveTo(243, 96);
+ _cabinGaugeMovie->moveTo(243, 96);
} else {
_cabinGaugeMovie = _vm->_video->playMovie(_vm->wrapMovieFilename("cabcgfar", kMystStack));
- if (!_cabinFireMovie)
+ if (!_cabinGaugeMovie)
error("Failed to open cabcgfar movie");
- _cabinFireMovie->moveTo(254, 136);
+ _cabinGaugeMovie->moveTo(254, 136);
}
Audio::Timestamp frame;
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index cbc22e4886..651bd5bf57 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -1728,12 +1728,12 @@ void MortevielleEngine::showMoveMenuAlert() {
void MortevielleEngine::showConfigScreen() {
// FIXME: need a DOS palette, index 9 (light blue). Also we should show DOS font here
Common::String tmpStr;
- int width, cy = 0;
+ int cy = 0;
clearScreen();
do {
++cy;
tmpStr = getString(cy + kStartingScreenStringIndex);
- width = _screenSurface->getStringWidth(tmpStr);
+ int width = _screenSurface->getStringWidth(tmpStr);
_text->displayStr(tmpStr, 320 - width / 2, cy * 8, 80, 1, 2);
} while (cy != 20);
diff --git a/engines/neverhood/resourceman.cpp b/engines/neverhood/resourceman.cpp
index 2065a13347..81a9d8a907 100644
--- a/engines/neverhood/resourceman.cpp
+++ b/engines/neverhood/resourceman.cpp
@@ -96,24 +96,26 @@ struct EntrySizeFix {
static const EntrySizeFix entrySizeFixes[] = {
// fileHash offset diskSize size fixedSize
// Fixes for the Russian "Dyadyushka Risech" version
- { 0x041137051, 667019, 23391, 41398, 41401 }, // "Options" menu header text
+ { 0x041137051, 667019, 23391, 41398, 29191 }, // "Options" menu header text
{ 0x00f960021, 402268, 1704, 4378, 1870 }, // "Save" menu
{ 0x01301a7ea, 1220008, 2373, 4146, 2877 }, // "Load" menu
{ 0x084181e81, 201409, 1622, 5058, 1833 }, // "Delete" menu
+ { 0x0C10B2015, 690410, 5850, 11162, 7870 }, // Menu text
{ 0x008C0AC24, 1031009, 3030, 6498, 3646 }, // Overwrite dialog
- { 0x0c6604282, 12813649, 19623, 35894, 35895 }, // One of the fonts when reading Willie's notes
+ { 0x0c6604282, 12813649, 19623, 35894, 30370 }, // One of the fonts when reading Willie's notes
{ 0x080283101, 13104841, 1961, 3712, 3511 }, // First message from Willie
+ { 0x058208810, 46010519, 24852, 131874, 131776 }, // Entry to hut with musical lock (untested)
{ 0x000918480, 17676417, 581, 916, 706 }, // First wall in the museum
- { 0x00800090C, 16064875, 19555, 38518, 38526 }, // First wall in the museum
- { 0x058208810, 46010519, 24852, 131874, 131776 }, // Entry to hut with musical lock
+ { 0x00800090C, 16064875, 19555, 38518, 30263 }, // First wall in the museum
{ 0x00008E486, 39600019, 240, 454, 271 }, // Second wall in the museum
{ 0x003086004, 39621755, 482, 614, 600 }, // Second wall in the museum
- { 0x02008048E, 39611075, 3798, 21089, 21087 }, // Next couple of walls in the museum
- { 0x008586283, 39587864, 12155, 29731, 29730 }, // Next couple of walls in the museum
- { 0x030A84C80, 39606142, 4933, 16305, 16275 }, // Next couple of walls in the museum
- { 0x000C9A480, 39614873, 6882, 23915, 23913 }, // Next couple of walls in the museum
- { 0x000098880, 39603114, 3028, 10860, 10859 }, // Next couple of walls in the museum
- { 0x040080183, 39600259, 2855, 13400, 13395 }, // Last buggy wall in the museum
+ { 0x02008048E, 39611075, 3798, 21089, 6374 }, // Next walls in the museum
+ { 0x008586283, 39587864, 12155, 29731, 20582 }, // Next walls in the museum
+ { 0x030A84C80, 39606142, 4933, 16305, 8770 }, // Next walls in the museum
+ { 0x000C9A480, 39614873, 6882, 23915, 11571 }, // Next walls in the museum
+ { 0x000098880, 39603114, 3028, 10860, 4762 }, // Next walls in the museum
+ { 0x040080183, 39600259, 2855, 13400, 4305 }, // Next walls in the museum
+ { 0x004290188, 39580567, 7297, 27131, 12322 }, // Next walls in the museum
// Fixes for the Russian "Fargus" version
{ 0x041137051, 758264, 29037, 49590, 49591 }, // "Options" menu header text
diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp
index f556d81eab..3482d79f69 100644
--- a/engines/prince/graphics.cpp
+++ b/engines/prince/graphics.cpp
@@ -375,30 +375,30 @@ byte GraphicsMan::getBlendTableColor(byte pixelColor, byte backgroundPixelColor,
const byte *originalPalette = _vm->_roomBmp->getPalette();
int redFirstOrg = originalPalette[pixelColor * 3] * _vm->_mst_shadow / 256;
- CLIP(redFirstOrg, 0, 255);
+ redFirstOrg = CLIP(redFirstOrg, 0, 255);
if (_vm->_mst_shadow <= 256) {
int redFirstBack = originalPalette[backgroundPixelColor * 3] * (256 - _vm->_mst_shadow) / 256;
- CLIP(redFirstBack, 0, 255);
+ redFirstBack = CLIP(redFirstBack, 0, 255);
redFirstOrg += redFirstBack;
- CLIP(redFirstOrg, 0, 255);
+ redFirstOrg = CLIP(redFirstOrg, 0, 255);
}
int greenFirstOrg = originalPalette[pixelColor * 3 + 1] * _vm->_mst_shadow / 256;
- CLIP(greenFirstOrg, 0, 255);
+ greenFirstOrg = CLIP(greenFirstOrg, 0, 255);
if (_vm->_mst_shadow <= 256) {
int greenFirstBack = originalPalette[backgroundPixelColor * 3 + 1] * (256 - _vm->_mst_shadow) / 256;
- CLIP(greenFirstBack, 0, 255);
+ greenFirstBack = CLIP(greenFirstBack, 0, 255);
greenFirstOrg += greenFirstBack;
- CLIP(greenFirstOrg, 0, 255);
+ greenFirstOrg = CLIP(greenFirstOrg, 0, 255);
}
int blueFirstOrg = originalPalette[pixelColor * 3 + 2] * _vm->_mst_shadow / 256;
- CLIP(blueFirstOrg, 0, 255);
+ blueFirstOrg = CLIP(blueFirstOrg, 0, 255);
if (_vm->_mst_shadow <= 256) {
int blueFirstBack = originalPalette[backgroundPixelColor * 3 + 2] * (256 - _vm->_mst_shadow) / 256;
- CLIP(blueFirstBack, 0, 255);
+ blueFirstBack = CLIP(blueFirstBack, 0, 255);
blueFirstOrg += blueFirstBack;
- CLIP(blueFirstOrg, 0, 255);
+ blueFirstOrg = CLIP(blueFirstOrg, 0, 255);
}
int bigValue = PrinceEngine::kIntMax; // infinity
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index ffbe3aecaf..d37dd18df9 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -172,6 +172,16 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::ES_ESP, Common::kPlatformDOS, ADGF_ADDENGLISH, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ // Castle of Dr. Brain aka Dr. Brain Puzzle no Shiro - Japanese PC-98 Floppy (from m_kiewitz)
+ // includes both Japanese and English text
+ // Executable scanning reports "x.yyy.zzz", VERSION file reports "1.000"
+ {"castlebrain", "", {
+ {"resource.map", 0, "ff9674d5d0215a7ebae25ee38d5a72af", 2631},
+ {"resource.000", 0, "27ec5fa09cd12a7fd16e86d96a2ed245", 548272},
+ {"resource.001", 0, "7c3e82c390e934de9b7afcab6de9cec4", 1117317},
+ AD_LISTEND},
+ Common::JA_JPN, Common::kPlatformPC98, ADGF_ADDENGLISH, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+
#ifdef ENABLE_SCI32
// Inside the Chest / Behind the Developer's Shield
// SCI interpreter version 2.000.000
@@ -1641,7 +1651,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.000", 0, "4948e4e1506f1e1c4e1d47abfa06b7f8", 204385195},
{"resource.map", 0, "40ccafb2195301504eba2e4f4f2c7f3d", 18925},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 7 - English Windows (from the King's Quest Collection)
// Executable scanning reports "2.100.002", VERSION file reports "1.4"
@@ -1649,7 +1659,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "2be9ab94429c721af8e05c507e048a15", 18697},
{"resource.000", 0, "eb63ea3a2c2469dc2d777d351c626404", 203882535},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 7 - English DOS (from FRG)
// SCI interpreter version 2.100.002, VERSION file reports "2.00b"
@@ -1657,7 +1667,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "8676b0fbbd7362989a029fe72fea14c6", 18709},
{"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformDOS, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 7 - English Windows (from FRG)
// SCI interpreter version 2.100.002, VERSION file reports "2.00b"
@@ -1665,7 +1675,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "8676b0fbbd7362989a029fe72fea14c6", 18709},
{"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 7 - German Windows (supplied by markcoolio in bug report #2727402)
// SCI interpreter version 2.100.002
@@ -1673,7 +1683,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "838b9ff132bd6962026fee832e8a7ddb", 18697},
{"resource.000", 0, "eb63ea3a2c2469dc2d777d351c626404", 206626576},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformDOS, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 7 - Spanish DOS (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "2.00"
@@ -1681,7 +1691,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "0b62693cbe87e3aaca3e8655a437f27f", 18709},
{"resource.000", 0, "51c1ead1163e19a2de8f121c39df7a76", 200764100},
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformDOS, ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformDOS, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Quest 7 - English DOS Non-Interactive Demo
// SCI interpreter version 2.100.002
@@ -1697,7 +1707,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resource.map", 0, "38e627a37a975aea40cc72b0518b0709", 18412},
{"resource.000", 0, "bad61d50aaa64298fa57a7c6ccd3bccf", 84020382},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO5(GUIO_NOSPEECH, GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// King's Questions mini-game from the King's Quest Collection
// SCI interpreter version 2.000.000
@@ -4100,7 +4110,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "9a3e172cde9963d0a969f26469318cec", 3403},
{"ressci.000", 0, "db3e290481c35c3224e9602e71e4a1f1", 5073868},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_DEMO | ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Torin's Passage (Multilingual) - English Windows CD
// SCI interpreter version 2.100.002
@@ -4108,7 +4118,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformWindows, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Torin's Passage (Multilingual) - Spanish Windows CD (from jvprat)
// Executable scanning reports "2.100.002", VERSION file reports "1.0"
@@ -4117,7 +4127,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
// TODO: depend on one of the patches?
AD_LISTEND},
- Common::ES_ESP, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::ES_ESP, Common::kPlatformWindows, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Torin's Passage (Multilingual) - French Windows CD
// SCI interpreter version 2.100.002
@@ -4125,7 +4135,16 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformWindows, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+
+ // Torin's Passage - German Windows CD (from m_kiewitz)
+ // SCI interpreter version 2.100.002
+ // VERSION file "1.0"
+ {"torin", "", {
+ {"resmap.000", 0, "e55c3097329b3c53752301e01c6af2fb", 9787},
+ {"ressci.000", 0, "118f9bec04bfe17c4f87bbb5ddb43c18", 56127540},
+ AD_LISTEND},
+ Common::DE_DEU, Common::kPlatformWindows, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Torin's Passage (Multilingual) - German Windows CD
// SCI interpreter version 2.100.002
@@ -4133,7 +4152,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
AD_LISTEND},
- Common::DE_DEU, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::DE_DEU, Common::kPlatformWindows, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Torin's Passage (Multilingual) - Italian Windows CD (from glorifindel)
// SCI interpreter version 2.100.002
@@ -4141,7 +4160,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "bb3b0b22ff08df54fbe2d06263409be6", 9799},
{"ressci.000", 0, "693a259d346c9360f4a0c11fdaae430a", 55973887},
AD_LISTEND},
- Common::IT_ITA, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::IT_ITA, Common::kPlatformWindows, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Torin's Passage - French Windows (from LePhilousophe)
// SCI interpreter version 2.100.002
@@ -4149,7 +4168,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"resmap.000", 0, "66ed46e3e56f487e688d52f05b33d0ba", 9787},
{"ressci.000", 0, "118f9bec04bfe17c4f87bbb5ddb43c18", 56126981},
AD_LISTEND},
- Common::FR_FRA, Common::kPlatformWindows, ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::FR_FRA, Common::kPlatformWindows, ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
// Torin's Passage - English Macintosh
{"torin", "", {
@@ -4161,7 +4180,7 @@ static const struct ADGameDescription SciGameDescriptions[] = {
{"Data6", 0, "b639487c83d1dae0e001e700f3631566", 7594881},
{"Data7", 0, "2afd9b5434102b89610916b904c3f73a", 7627374},
AD_LISTEND},
- Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK | ADGF_UNSTABLE, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ Common::EN_ANY, Common::kPlatformMacintosh, ADGF_MACRESFORK | ADGF_UNSTABLE | ADGF_CD, GUIO4(GUIO_NOASPECT, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
#endif // ENABLE_SCI32
// SCI Fanmade Games
diff --git a/engines/sci/graphics/text16.cpp b/engines/sci/graphics/text16.cpp
index f463dff4b1..89c9be59f0 100644
--- a/engines/sci/graphics/text16.cpp
+++ b/engines/sci/graphics/text16.cpp
@@ -144,12 +144,41 @@ int16 GfxText16::CodeProcessing(const char *&text, GuiResourceId orgFontId, int1
}
// Has actually punctuation and characters in it, that may not be the first in a line
+// SCI1 didn't check for exclamation nor question marks, us checking for those too shouldn't be bad
static const uint16 text16_shiftJIS_punctuation[] = {
+ 0x4181, 0x4281, 0x7681, 0x7881, 0x4981, 0x4881, 0
+};
+
+// Table from Quest for Glory 1 PC-98 (SCI01)
+// has pronunciation and small combining form characters on top (details right after this table)
+static const uint16 text16_shiftJIS_punctuation_SCI01[] = {
0x9F82, 0xA182, 0xA382, 0xA582, 0xA782, 0xC182, 0xE182, 0xE382, 0xE582, 0xEC82, 0x4083, 0x4283,
0x4483, 0x4683, 0x4883, 0x6283, 0x8383, 0x8583, 0x8783, 0x8E83, 0x9583, 0x9683, 0x5B81, 0x4181,
0x4281, 0x7681, 0x7881, 0x4981, 0x4881, 0
};
+// Police Quest 2 (SCI0) only checked for: 0x4181, 0x4281, 0x7681, 0x7881, 0x4981, 0x4881
+// Castle of Dr. Brain/King's Quest 5/Space Quest 4 (SCI1) only checked for: 0x4181, 0x4281, 0x7681, 0x7881
+
+// SCI0/SCI01/SCI1:
+// 0x4181 -> comma, 0x4281 -> period / full stop
+// 0x7681 -> ending quotation mark, 0x7881 -> secondary quotation mark
+
+// SCI0/SCI01:
+// 0x4981 -> exclamation mark, 0x4881 -> question mark
+
+// SCI01 (Quest for Glory only):
+// 0x9F82, 0xA182, 0xA382, 0xA582, 0xA782 -> specifies vowel part of prev. hiragana char or pronunciation/extension of vowel
+// 0xC182 -> pronunciation
+// 0xE182, 0xE382, 0xE582, 0xEC82 -> small combining form of hiragana
+// 0x4083, 0x4283, 0x4483, 0x4683, 0x4883 -> small combining form of katagana
+// 0x6283 -> glottal stop / sokuon
+// 0x8383, 0x8583 0x8783, 0x8E83 -> small combining form of katagana
+// 0x9583 -> combining form
+// 0x9683 -> abbreviation for the kanji (ka), the counter for months, places or provisions
+// 0x5b81 -> low line / underscore (full width)
+
+
// return max # of chars to fit maxwidth with full words, does not include
// breaking space
// Also adjusts text pointer to the new position for the caller
@@ -201,9 +230,10 @@ int16 GfxText16::GetLongest(const char *&textPtr, int16 maxWidth, GuiResourceId
}
// it's meant to pass through here
case 0xA:
- case 0x9781: // this one is used by SQ4/japanese as line break as well
+ case 0x9781: // this one is used by SQ4/japanese as line break as well (was added for SCI1/PC98)
curCharCount++; textPtr++;
if (curChar > 0xFF) {
+ // skip another byte in case char is double-byte (PC-98)
curCharCount++; textPtr++;
}
// and it's also meant to pass through here
@@ -261,17 +291,27 @@ int16 GfxText16::GetLongest(const char *&textPtr, int16 maxWidth, GuiResourceId
// But it also checked, if the current character is not inside a punctuation table and it even
// went backwards in case it found multiple ones inside that table.
+ // Note: PQ2 PC-98 only went back 1 character and not multiple ones
uint nonBreakingPos = 0;
+ const uint16 *punctuationTable;
+
+ if (getSciVersion() != SCI_VERSION_01) {
+ punctuationTable = text16_shiftJIS_punctuation;
+ } else {
+ // Quest for Glory 1 PC-98 only
+ punctuationTable = text16_shiftJIS_punctuation_SCI01;
+ }
+
while (1) {
// Look up if character shouldn't be the first on a new line
nonBreakingPos = 0;
- while (text16_shiftJIS_punctuation[nonBreakingPos]) {
- if (text16_shiftJIS_punctuation[nonBreakingPos] == curChar)
+ while (punctuationTable[nonBreakingPos]) {
+ if (punctuationTable[nonBreakingPos] == curChar)
break;
nonBreakingPos++;
}
- if (!text16_shiftJIS_punctuation[nonBreakingPos]) {
+ if (!punctuationTable[nonBreakingPos]) {
// character is fine
break;
}
@@ -285,6 +325,14 @@ int16 GfxText16::GetLongest(const char *&textPtr, int16 maxWidth, GuiResourceId
error("Non double byte while seeking back");
curChar |= (*(const byte *)(textPtr + 1)) << 8;
}
+
+ if (curChar == 0x4081) {
+ // Skip over alphabetic double-byte space
+ // This was introduced for SCI1
+ // Happens in Castle of Dr. Brain PC-98 in room 120, when looking inside the mirror
+ // (game mentions Mixed Up Fairy Tales and uses English letters for that)
+ textPtr += 2;
+ }
}
// We split the word in that case
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 668ad053cc..eeea998b51 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -892,29 +892,77 @@ bool SciEngine::speechAndSubtitlesEnabled() {
}
void SciEngine::syncIngameAudioOptions() {
- // Sync the in-game speech/subtitles settings for SCI1.1 CD games
- if (isCD() && getSciVersion() == SCI_VERSION_1_1) {
- bool subtitlesOn = ConfMan.getBool("subtitles");
- bool speechOn = !ConfMan.getBool("speech_mute");
+ bool useGlobal90 = false;
- if (subtitlesOn && !speechOn) {
- _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 1); // subtitles
- } else if (!subtitlesOn && speechOn) {
- _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech
- } else if (subtitlesOn && speechOn) {
- // Is it a game that supports simultaneous speech and subtitles?
+ // Sync the in-game speech/subtitles settings for SCI1.1 CD games
+ if (isCD()) {
+ switch (getSciVersion()) {
+ case SCI_VERSION_1_1:
+ // All SCI1.1 CD games use global 90
+ useGlobal90 = true;
+ break;
+#ifdef ENABLE_SCI32
+ case SCI_VERSION_2:
+ case SCI_VERSION_2_1:
+ // Only use global 90 for some specific games, not all SCI32 games used this method
switch (_gameId) {
- case GID_SQ4:
- case GID_FREDDYPHARKAS:
- case GID_ECOQUEST:
- case GID_LSL6:
- case GID_LAURABOW2:
- case GID_KQ6:
- _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 3); // speech + subtitles
+ case GID_KQ7: // SCI2.1
+ case GID_GK1: // SCI2
+ case GID_GK2: // SCI2.1
+ case GID_SQ6: // SCI2.1
+ case GID_TORIN: // SCI2.1
+ case GID_QFG4: // SCI2.1
+ useGlobal90 = true;
+ break;
+ case GID_LSL6: // SCI2.1
+ // TODO: Uses gameFlags array
break;
+ // TODO: Unknown at the moment:
+ // Shivers - seems not to use global 90
+ // Police Quest: SWAT - unable to check
+ // Police Quest 4 - unable to check
+ // Mixed Up Mother Goose - unable to check
+ // Phantasmagoria - seems to use global 90, unable to check for subtitles atm
default:
- // Game does not support speech and subtitles, set it to speech
+ return;
+ }
+ break;
+#endif // ENABLE_SCI32
+ default:
+ return;
+ }
+
+ bool subtitlesOn = ConfMan.getBool("subtitles");
+ bool speechOn = !ConfMan.getBool("speech_mute");
+
+ if (useGlobal90) {
+ if (subtitlesOn && !speechOn) {
+ _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 1); // subtitles
+ } else if (!subtitlesOn && speechOn) {
_gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech
+ } else if (subtitlesOn && speechOn) {
+ // Is it a game that supports simultaneous speech and subtitles?
+ switch (_gameId) {
+ case GID_SQ4:
+ case GID_FREDDYPHARKAS:
+ case GID_ECOQUEST:
+ case GID_LSL6:
+ case GID_LAURABOW2:
+ case GID_KQ6:
+#ifdef ENABLE_SCI32
+ // Unsure about Gabriel Knight 2
+ case GID_KQ7: // SCI2.1
+ case GID_GK1: // SCI2
+ case GID_SQ6: // SCI2.1, SQ6 seems to always use subtitles anyway
+ case GID_TORIN: // SCI2.1
+ case GID_QFG4: // SCI2.1
+#endif // ENABLE_SCI32
+ _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 3); // speech + subtitles
+ break;
+ default:
+ // Game does not support speech and subtitles, set it to speech
+ _gamestate->variables[VAR_GLOBAL][90] = make_reg(0, 2); // speech
+ }
}
}
}
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index c22525b6f2..21c7428621 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -308,6 +308,8 @@ void HelpDialog::reflowLayout() {
int16 x, y;
uint16 w, h;
+ assert(lineHeight);
+
g_gui.xmlEval()->getWidgetData("ScummHelp.HelpText", x, y, w, h);
// Make sure than we don't have more lines than what we can fit
diff --git a/engines/scumm/he/logic/puttrace.cpp b/engines/scumm/he/logic/puttrace.cpp
index 1c3317b131..ba62c118fe 100644
--- a/engines/scumm/he/logic/puttrace.cpp
+++ b/engines/scumm/he/logic/puttrace.cpp
@@ -256,7 +256,7 @@ int32 LogicHErace::op_1102(int32 *args) {
}
int32 LogicHErace::op_1103(int32 *args) {
- double angle = args[0] / args[1] * DEG2RAD;
+ double angle = (double)args[0] / (double)args[1] * DEG2RAD;
writeScummVar(108, (int32)(sin(angle) * args[2]));
writeScummVar(109, (int32)(cos(angle) * args[2]));
diff --git a/engines/scumm/players/player_towns.cpp b/engines/scumm/players/player_towns.cpp
index 5b8ca04021..d540fc4f6b 100644
--- a/engines/scumm/players/player_towns.cpp
+++ b/engines/scumm/players/player_towns.cpp
@@ -202,23 +202,24 @@ Player_Towns_v1::Player_Towns_v1(ScummEngine *vm, Audio::Mixer *mixer) : Player_
memset(_soundOverride, 0, _numSoundMax * sizeof(SoundOvrParameters));
}
- _driver = new TownsEuphonyDriver(mixer);
+ _player = new EuphonyPlayer(mixer);
+ _intf = new TownsAudioInterface(mixer, 0);
}
Player_Towns_v1::~Player_Towns_v1() {
- delete _driver;
+ delete _intf;
+ delete _player;
delete[] _soundOverride;
}
bool Player_Towns_v1::init() {
- if (!_driver)
+ if (!_player)
return false;
- if (!_driver->init())
+ if (!_player->init())
return false;
- _driver->reserveSoundEffectChannels(8);
- _intf = _driver->intf();
+ _player->driver()->reserveSoundEffectChannels(8);
// Treat all 6 fm channels and all 8 pcm channels as sound effect channels
// since music seems to exist as CD audio only in the games which use this
@@ -231,7 +232,7 @@ bool Player_Towns_v1::init() {
}
void Player_Towns_v1::setMusicVolume(int vol) {
- _driver->setMusicVolume(vol);
+ _player->driver()->setMusicVolume(vol);
}
void Player_Towns_v1::startSound(int sound) {
@@ -254,7 +255,9 @@ void Player_Towns_v1::startSound(int sound) {
uint16 len = READ_LE_UINT16(ptr) + 2;
playPcmTrack(sound, ptr + 6, velocity, 64, note ? note : (len > 50 ? ptr[50] : 60), READ_LE_UINT16(ptr + 10));
- } else if (type == 1) {
+ // WORKAROUND for bug #1873 INDY3 FMTOWNS: Music in Venice is distorted
+ // The resource for sound 40 accidently sets the sound type to 255 instead of 1.
+ } else if (type == 1 || (_vm->_game.id == GID_INDY3 && sound == 40)) {
playEuphonyTrack(sound, ptr + 6);
} else if (type == 2) {
@@ -275,7 +278,7 @@ void Player_Towns_v1::stopSound(int sound) {
if (sound != 0 && sound == _eupCurrentSound) {
_eupCurrentSound = 0;
_eupLooping = false;
- _driver->stopParser();
+ _player->stop();
}
stopPcmTrack(sound);
@@ -288,7 +291,7 @@ void Player_Towns_v1::stopAllSounds() {
_eupCurrentSound = 0;
_eupLooping = false;
- _driver->stopParser();
+ _player->stop();
stopPcmTrack(0);
}
@@ -297,7 +300,7 @@ int Player_Towns_v1::getSoundStatus(int sound) const {
if (sound == _cdaCurrentSound)
return _vm->_sound->pollCD();
if (sound == _eupCurrentSound)
- return _driver->parserIsPlaying() ? 1 : 0;
+ return _player->isPlaying() ? 1 : 0;
return Player_Towns::getSoundStatus(sound);
}
@@ -306,7 +309,7 @@ int32 Player_Towns_v1::doCommand(int numargs, int args[]) {
switch (args[0]) {
case 2:
- _driver->intf()->callback(73, 0);
+ _player->driver()->cdaToggle(0);
break;
case 3:
@@ -344,7 +347,7 @@ int32 Player_Towns_v1::doCommand(int numargs, int args[]) {
void Player_Towns_v1::setVolumeCD(int left, int right) {
_cdaVolLeft = left & 0xff;
_cdaVolRight = right & 0xff;
- _driver->setOutputVolume(1, left >> 1, right >> 1);
+ _player->driver()->setOutputVolume(1, left >> 1, right >> 1);
}
void Player_Towns_v1::setSoundVolume(int sound, int left, int right) {
@@ -373,7 +376,7 @@ void Player_Towns_v1::saveLoadWithSerializer(Serializer *ser) {
ser->saveLoadEntries(this, cdEntries);
- if (!_eupLooping && !_driver->parserIsPlaying())
+ if (!_eupLooping && !_player->isPlaying())
_eupCurrentSound = 0;
static const SaveLoadEntry eupEntries[] = {
@@ -409,7 +412,9 @@ void Player_Towns_v1::restoreAfterLoad() {
if (_vm->_game.version != 3)
ptr += 2;
- if (ptr[7] == 1) {
+ // WORKAROUND for bug #1873 INDY3 FMTOWNS: Music in Venice is distorted
+ // The resource for sound 40 accidently sets the sound type to 255 instead of 1.
+ if (ptr[7] == 1 || (_vm->_game.id == GID_INDY3 && _eupCurrentSound == 40)) {
setSoundVolume(_eupCurrentSound, _eupVolLeft, _eupVolRight);
playEuphonyTrack(_eupCurrentSound, ptr);
}
@@ -439,10 +444,10 @@ void Player_Towns_v1::restartLoopingSounds() {
c++;
}
- _driver->playSoundEffect(i + 0x3f, _pcmCurrentSound[i].note, _pcmCurrentSound[i].velo, ptr);
+ _player->driver()->playSoundEffect(i + 0x3f, _pcmCurrentSound[i].note, _pcmCurrentSound[i].velo, ptr);
}
- _driver->intf()->callback(73, 1);
+ _player->driver()->cdaToggle(1);
}
void Player_Towns_v1::startSoundEx(int sound, int velo, int pan, int note) {
@@ -492,9 +497,9 @@ void Player_Towns_v1::stopSoundSuspendLooping(int sound) {
} else {
for (int i = 1; i < 9; i++) {
if (sound == _pcmCurrentSound[i].index) {
- if (!_driver->soundEffectIsPlaying(i + 0x3f))
+ if (!_player->driver()->soundEffectIsPlaying(i + 0x3f))
continue;
- _driver->stopSoundEffect(i + 0x3f);
+ _player->driver()->stopSoundEffect(i + 0x3f);
if (_pcmCurrentSound[i].looping)
_pcmCurrentSound[i].paused = 1;
else
@@ -510,23 +515,23 @@ void Player_Towns_v1::playEuphonyTrack(int sound, const uint8 *data) {
const uint8 *trackData = src + 150;
for (int i = 0; i < 32; i++)
- _driver->configChan_enable(i, *src++);
+ _player->configPart_enable(i, *src++);
for (int i = 0; i < 32; i++)
- _driver->configChan_setMode(i, 0xff);
+ _player->configPart_setType(i, 0xff);
for (int i = 0; i < 32; i++)
- _driver->configChan_remap(i, *src++);
+ _player->configPart_remap(i, *src++);
for (int i = 0; i < 32; i++)
- _driver->configChan_adjustVolume(i, *src++);
+ _player->configPart_adjustVolume(i, *src++);
for (int i = 0; i < 32; i++)
- _driver->configChan_setTranspose(i, *src++);
+ _player->configPart_setTranspose(i, *src++);
src += 8;
for (int i = 0; i < 6; i++)
- _driver->assignChannel(i, *src++);
+ _player->driver()->assignPartToChannel(i, *src++);
for (int i = 0; i < data[14]; i++) {
- _driver->loadInstrument(i, i, pos + i * 48);
- _driver->intf()->callback(4, i, i);
+ _player->driver()->loadInstrument(i, i, pos + i * 48);
+ _player->driver()->setInstrument(i, i);
}
_eupVolLeft = _soundOverride[sound].vLeft;
@@ -537,18 +542,18 @@ void Player_Towns_v1::playEuphonyTrack(int sound, const uint8 *data) {
lvl >>= 2;
for (int i = 0; i < 6; i++)
- _driver->chanVolume(i, lvl);
+ _player->driver()->channelVolume(i, lvl);
uint32 trackSize = READ_LE_UINT32(src);
src += 4;
uint8 startTick = *src++;
- _driver->setMusicTempo(*src++);
- _driver->startMusicTrack(trackData, trackSize, startTick);
+ _player->setTempo(*src++);
+ _player->startTrack(trackData, trackSize, startTick);
_eupLooping = (*src != 1) ? 1 : 0;
- _driver->setMusicLoop(_eupLooping != 0);
- _driver->continueParsing();
+ _player->setLoopStatus(_eupLooping != 0);
+ _player->resume();
_eupCurrentSound = sound;
}
diff --git a/engines/scumm/players/player_towns.h b/engines/scumm/players/player_towns.h
index 3736524ee2..576d17e392 100644
--- a/engines/scumm/players/player_towns.h
+++ b/engines/scumm/players/player_towns.h
@@ -104,8 +104,6 @@ public:
void saveLoadWithSerializer(Serializer *ser);
void restoreAfterLoad();
- TownsEuphonyDriver *driver() { return _driver; }
-
private:
void restartLoopingSounds();
void startSoundEx(int sound, int velo, int pan, int note);
@@ -137,7 +135,7 @@ private:
uint8 _cdaCurrentSoundTemp;
uint8 _cdaNumLoopsTemp;
- TownsEuphonyDriver *_driver;
+ EuphonyPlayer *_player;
};
class Player_Towns_v2 : public Player_Towns {
diff --git a/engines/scumm/players/player_v2.cpp b/engines/scumm/players/player_v2.cpp
index f0aaa4a3be..c7ebd8abff 100644
--- a/engines/scumm/players/player_v2.cpp
+++ b/engines/scumm/players/player_v2.cpp
@@ -77,7 +77,7 @@ void Player_V2::setMusicVolume (int vol) {
vol = 255;
/* scale to int16, FIXME: find best value */
- double out = vol * 128 / 3;
+ double out = vol * 128.0 / 3.0;
/* build volume table (2dB per step) */
for (int i = 0; i < 15; i++) {
diff --git a/engines/sherlock/configure.engine b/engines/sherlock/configure.engine
index a56129a8f0..fd1c354e78 100644
--- a/engines/sherlock/configure.engine
+++ b/engines/sherlock/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine sherlock "The Lost Files of Sherlock Holmes" no
+add_engine sherlock "The Lost Files of Sherlock Holmes" yes
diff --git a/engines/sherlock/decompress.cpp b/engines/sherlock/decompress.cpp
deleted file mode 100644
index 8e02da3212..0000000000
--- a/engines/sherlock/decompress.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "sherlock/decompress.h"
-
-namespace Sherlock {
-
-/**
- * Decompresses an LZW compressed resource. If no outSize is specified, it will
- * decompress the entire resource. If, however, an explicit size is specified,
- * then it means we're already within a resource, and only want to decompress
- * part of it.
- */
-Common::SeekableReadStream *decompressLZ(Common::SeekableReadStream &source, int32 outSize) {
- if (outSize == -1) {
- source.seek(5);
- outSize = source.readSint32LE();
- }
-
- byte lzWindow[4096];
- uint16 lzWindowPos;
- uint16 cmd;
-
- byte *outBuffer = new byte[outSize];
- byte *outBufferEnd = outBuffer + outSize;
- Common::MemoryReadStream *outS = new Common::MemoryReadStream(outBuffer, outSize, DisposeAfterUse::YES);
-
- memset(lzWindow, 0xFF, 0xFEE);
- lzWindowPos = 0xFEE;
- cmd = 0;
-
- do {
- cmd >>= 1;
- if (!(cmd & 0x100))
- cmd = source.readByte() | 0xFF00;
-
- if (cmd & 1) {
- byte literal = source.readByte();
- *outBuffer++ = literal;
- lzWindow[lzWindowPos] = literal;
- lzWindowPos = (lzWindowPos + 1) & 0x0FFF;
- } else {
- int copyPos, copyLen;
- copyPos = source.readByte();
- copyLen = source.readByte();
- copyPos = copyPos | ((copyLen & 0xF0) << 4);
- copyLen = (copyLen & 0x0F) + 3;
- while (copyLen--) {
- byte literal = lzWindow[copyPos];
- copyPos = (copyPos + 1) & 0x0FFF;
- *outBuffer++ = literal;
- lzWindow[lzWindowPos] = literal;
- lzWindowPos = (lzWindowPos + 1) & 0x0FFF;
- }
- }
- } while (outBuffer < outBufferEnd);
-
- return outS;
-}
-
-
-/**
- * Decompresses a Rose Tattoo resource
- *
-Common::SeekableReadStream *decompress32(Common::SeekableReadStream &source, int32 outSize) {
- if (outSize == -1) {
- outSize = source.readSint32LE();
- }
-
- byte lzWindow[8192];
- byte *outBuffer = new byte[outSize];
- byte *outBufferEnd = outBuffer + outSize;
- Common::MemoryReadStream *outS = new Common::MemoryReadStream(outBuffer, outSize, DisposeAfterUse::YES);
-
- memset(lzWindow, 0xFF, 8192);
- int lzWindowPos = 0xFEE;
- int cmd = 0;
-
- do {
- cmd >>= 1;
- if (!(cmd & 0x100))
- cmd = source.readByte() | 0xFF00;
-
- if (cmd & 1) {
- byte literal = source.readByte();
- *outBuffer++ = literal;
- lzWindow[lzWindowPos] = literal;
- lzWindowPos = (lzWindowPos + 1) & 0x0FFF;
- } else {
- int copyPos, copyLen;
- copyPos = source.readByte();
- copyLen = source.readByte();
- copyPos = copyPos | ((copyLen & 0xF0) << 4);
- copyLen = (copyLen & 0x0F) + 3;
- while (copyLen--) {
- byte literal = lzWindow[copyPos];
- copyPos = (copyPos + 1) & 0x0FFF;
- *outBuffer++ = literal;
- lzWindow[lzWindowPos] = literal;
- lzWindowPos = (lzWindowPos + 1) & 0x0FFF;
- }
- }
- } while (outBuffer < outBufferEnd);
-
- return outS;
-}
-*/
-
-} // namespace Sherlock
diff --git a/engines/sherlock/detection_tables.h b/engines/sherlock/detection_tables.h
index 6567369528..ce6eafcaca 100644
--- a/engines/sherlock/detection_tables.h
+++ b/engines/sherlock/detection_tables.h
@@ -32,7 +32,7 @@ static const SherlockGameDescription gameDescriptions[] = {
AD_ENTRY1s("talk.lib", "ad0c4d6865edf15da4e9204c08815875", 238928),
Common::EN_ANY,
Common::kPlatformDOS,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO6(GUIO_NOSPEECH, GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_FADE_STYLE, GAMEOPTION_HELP_STYLE,
GAMEOPTION_PORTRAITS_ON, GAMEOPTION_WINDOW_STYLE)
},
@@ -50,7 +50,7 @@ static const SherlockGameDescription gameDescriptions[] = {
AD_LISTEND},
Common::DE_DEU,
Common::kPlatformDOS,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO6(GUIO_NOSPEECH, GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_FADE_STYLE, GAMEOPTION_HELP_STYLE,
GAMEOPTION_PORTRAITS_ON, GAMEOPTION_WINDOW_STYLE)
},
@@ -68,7 +68,7 @@ static const SherlockGameDescription gameDescriptions[] = {
AD_LISTEND},
Common::DE_DEU,
Common::kPlatformDOS,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO6(GUIO_NOSPEECH, GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_FADE_STYLE, GAMEOPTION_HELP_STYLE,
GAMEOPTION_PORTRAITS_ON, GAMEOPTION_WINDOW_STYLE)
},
@@ -86,7 +86,7 @@ static const SherlockGameDescription gameDescriptions[] = {
AD_LISTEND },
Common::DE_DEU,
Common::kPlatformDOS,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO6(GUIO_NOSPEECH, GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_FADE_STYLE, GAMEOPTION_HELP_STYLE,
GAMEOPTION_PORTRAITS_ON, GAMEOPTION_WINDOW_STYLE)
},
@@ -104,7 +104,7 @@ static const SherlockGameDescription gameDescriptions[] = {
AD_LISTEND},
Common::ES_ESP,
Common::kPlatformDOS,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO6(GUIO_NOSPEECH, GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_FADE_STYLE, GAMEOPTION_HELP_STYLE,
GAMEOPTION_PORTRAITS_ON, GAMEOPTION_WINDOW_STYLE)
},
@@ -134,7 +134,7 @@ static const SherlockGameDescription gameDescriptions[] = {
AD_ENTRY1s("talk.lib", "dbdc8a20c96900aa7e4d02f3fe8a274c", 121102),
Common::EN_ANY,
Common::kPlatformDOS,
- ADGF_TESTING | ADGF_DEMO,
+ ADGF_DEMO,
GUIO1(GUIO_NOSPEECH)
},
GType_SerratedScalpel,
@@ -149,7 +149,7 @@ static const SherlockGameDescription gameDescriptions[] = {
AD_ENTRY1s("music.lib", "ec19a09b7fef6fd90b1ab812ce6e9739", 38563),
Common::EN_ANY,
Common::kPlatformDOS,
- ADGF_TESTING | ADGF_DEMO,
+ ADGF_DEMO,
GUIO1(GUIO_NOSPEECH)
},
GType_SerratedScalpel,
@@ -164,7 +164,7 @@ static const SherlockGameDescription gameDescriptions[] = {
AD_ENTRY1s("talk.lib", "22e8e6406dd2fbbb238c9898928df42e", 770756),
Common::FR_FRA,
Common::kPlatformDOS,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO3(GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_HELP_STYLE, GAMEOPTION_TRANSPARENT_WINDOWS)
},
GType_RoseTattoo
@@ -179,7 +179,7 @@ static const SherlockGameDescription gameDescriptions[] = {
AD_ENTRY1s("talk.lib", "9639a756b0993ebd71cb5f4d8b78b2dc", 765134),
Common::EN_ANY,
Common::kPlatformDOS,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO3(GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_HELP_STYLE, GAMEOPTION_TRANSPARENT_WINDOWS)
},
GType_RoseTattoo,
@@ -194,7 +194,7 @@ static const SherlockGameDescription gameDescriptions[] = {
AD_ENTRY1s("talk.lib", "5027aa72f0d263ed3b1c764a6c397911", 873864),
Common::DE_DEU,
Common::kPlatformDOS,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO3(GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_HELP_STYLE, GAMEOPTION_TRANSPARENT_WINDOWS)
},
GType_RoseTattoo,
@@ -209,7 +209,7 @@ static const SherlockGameDescription gameDescriptions[] = {
AD_ENTRY1s("talk.lib", "4f3ccf50e1012445624569cd605d7449", 783713),
Common::ES_ESP,
Common::kPlatformDOS,
- ADGF_TESTING,
+ ADGF_NO_FLAGS,
GUIO3(GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_HELP_STYLE, GAMEOPTION_TRANSPARENT_WINDOWS)
},
GType_RoseTattoo,
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index e443b6f727..c4aaa07a73 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -715,6 +715,15 @@ void Journal::record(int converseNum, int statementNum, bool replyOnly) {
return;
}
+ // Do a bit of validation here
+ assert(converseNum >= 0 && converseNum < (int)_directory.size());
+ const Common::String &dirFilename = _directory[converseNum];
+ Common::String locStr(dirFilename.c_str() + 4, dirFilename.c_str() + 6);
+ int newLocation = atoi(locStr.c_str());
+ assert(newLocation >= 1 && newLocation <= (int)_locations.size());
+ assert(!_locations[newLocation - 1].empty());
+ assert(statementNum >= 0 && statementNum < (int)_vm->_talk->_statements.size());
+
// Record the entry into the list
_journal.push_back(JournalEntry(converseNum, statementNum, replyOnly));
_index = _journal.size() - 1;
@@ -726,7 +735,7 @@ void Journal::record(int converseNum, int statementNum, bool replyOnly) {
_index = saveIndex;
_sub = saveSub;
- // If new lines were added to the ournal, update the total number of lines
+ // If new lines were added to the journal, update the total number of lines
// the journal continues
if (!_lines.empty()) {
_maxPage += _lines.size();
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp
index 8b8f359de3..43b7275f2d 100644
--- a/engines/sherlock/music.cpp
+++ b/engines/sherlock/music.cpp
@@ -518,7 +518,6 @@ void Music::freeSong() {
_midiParser->unloadMusic();
}
- delete[] _midiMusicData;
_midiMusicData = nullptr;
_musicPlaying = false;
}
diff --git a/engines/sherlock/objects.cpp b/engines/sherlock/objects.cpp
index 0856c226f1..e70b707404 100644
--- a/engines/sherlock/objects.cpp
+++ b/engines/sherlock/objects.cpp
@@ -620,6 +620,7 @@ void Sprite::clear() {
_images = nullptr;
_imageFrame = nullptr;
_walkCount = 0;
+ _oldWalkSequence = 0;
_allow = 0;
_frameNumber = 0;
_position.x = _position.y = 0;
@@ -634,6 +635,7 @@ void Sprite::clear() {
_misc = 0;
_altImages = nullptr;
_altSeq = 0;
+ _centerWalk = 0;
Common::fill(&_stopFrames[0], &_stopFrames[8], (ImageFrame *)nullptr);
}
diff --git a/engines/sherlock/scalpel/scalpel_debugger.cpp b/engines/sherlock/scalpel/scalpel_debugger.cpp
index 7f5e1efa69..1495c76b43 100644
--- a/engines/sherlock/scalpel/scalpel_debugger.cpp
+++ b/engines/sherlock/scalpel/scalpel_debugger.cpp
@@ -42,7 +42,7 @@ bool ScalpelDebugger::cmd3DO_PlayMovie(int argc, const char **argv) {
return true;
}
- // play gets postboned until debugger is closed
+ // play gets postponed until debugger is closed
Common::String filename = argv[1];
_3doPlayMovieFile = filename;
diff --git a/engines/sherlock/scalpel/scalpel_saveload.cpp b/engines/sherlock/scalpel/scalpel_saveload.cpp
index 01ba149813..61830a56b2 100644
--- a/engines/sherlock/scalpel/scalpel_saveload.cpp
+++ b/engines/sherlock/scalpel/scalpel_saveload.cpp
@@ -39,7 +39,8 @@ const int ENV_POINTS[6][3] = {
/*----------------------------------------------------------------*/
-ScalpelSaveManager::ScalpelSaveManager(SherlockEngine *vm, const Common::String &target) : SaveManager(vm, target) {
+ScalpelSaveManager::ScalpelSaveManager(SherlockEngine *vm, const Common::String &target) :
+ SaveManager(vm, target), _envMode(SAVEMODE_NONE) {
}
void ScalpelSaveManager::drawInterface() {
diff --git a/engines/sherlock/scalpel/tsage/logo.cpp b/engines/sherlock/scalpel/tsage/logo.cpp
index 014470dcc8..273d26df74 100644
--- a/engines/sherlock/scalpel/tsage/logo.cpp
+++ b/engines/sherlock/scalpel/tsage/logo.cpp
@@ -163,6 +163,7 @@ Object::Object() {
_angle = _changeCtr = 0;
_walkStartFrame = 0;
_majorDiff = _minorDiff = 0;
+ _updateStartFrame = 0;
}
void Object::setVisage(int visage, int strip) {
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index e9c52276f6..b239fd9fb7 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -994,6 +994,10 @@ OpcodeReturn Talk::cmdAdjustObjectSequence(const byte *&str) {
_seqCount = str[1];
str += (str[0] & 127) + 2;
+ // WORKAROUND: Original German Scalpel crash when moving box at Tobacconists
+ if (_vm->getLanguage() == Common::DE_DEU && _scriptName == "Alfr30Z")
+ _seqCount = 16;
+
// Copy in the new sequence
for (int idx = 0; idx < _seqCount; ++idx, ++str)
scene._bgShapes[objId]._sequences[idx] = str[0] - 1;
diff --git a/engines/sherlock/tattoo/tattoo_darts.cpp b/engines/sherlock/tattoo/tattoo_darts.cpp
index 274d80e3e1..512358933d 100644
--- a/engines/sherlock/tattoo/tattoo_darts.cpp
+++ b/engines/sherlock/tattoo/tattoo_darts.cpp
@@ -70,6 +70,7 @@ Darts::Darts(SherlockEngine *vm) : _vm(vm) {
_handX = 0;
_compPlay = 1;
_escapePressed = false;
+ _spacing = 0;
}
void Darts::playDarts(GameType gameType) {
diff --git a/engines/sherlock/tattoo/tattoo_fixed_text.cpp b/engines/sherlock/tattoo/tattoo_fixed_text.cpp
index 8475870b19..38acd78aba 100644
--- a/engines/sherlock/tattoo/tattoo_fixed_text.cpp
+++ b/engines/sherlock/tattoo/tattoo_fixed_text.cpp
@@ -59,7 +59,7 @@ static const char *const fixedTextEN[] = {
"Picked up",
"Page %d",
- "Close Journal",
+ "Close Journal",
"Search Journal",
"Save Journal",
"Abort Search",
@@ -651,7 +651,7 @@ static const char *const fixedTextES[] = {
"On", // ???
"Salir",
"quieres salir?",
- "\250Est s seguro de que",
+ "\250Est\240s seguro de que",
"Si",
"Non",
"Introducir Palabra Clave",
diff --git a/engines/sherlock/tattoo/widget_base.cpp b/engines/sherlock/tattoo/widget_base.cpp
index 9e10cee0d1..8f0649130a 100644
--- a/engines/sherlock/tattoo/widget_base.cpp
+++ b/engines/sherlock/tattoo/widget_base.cpp
@@ -33,6 +33,7 @@ namespace Tattoo {
WidgetBase::WidgetBase(SherlockEngine *vm) : _vm(vm) {
_scroll = false;
_dialogTimer = 0;
+ _outsideMenu = false;
}
void WidgetBase::summonWindow() {
diff --git a/engines/sherlock/tattoo/widget_files.cpp b/engines/sherlock/tattoo/widget_files.cpp
index 0f5e6793c4..ca5e1bff93 100644
--- a/engines/sherlock/tattoo/widget_files.cpp
+++ b/engines/sherlock/tattoo/widget_files.cpp
@@ -143,19 +143,17 @@ void WidgetFiles::render(FilesRenderMode mode) {
int yp = _surface.fontHeight() + 14;
for (int idx = _savegameIndex; idx < (_savegameIndex + FILES_LINES_COUNT); ++idx) {
- if (OP_NAMES || idx == _selector || idx == _oldSelector) {
- if (idx == _selector && mode != RENDER_ALL)
- color = COMMAND_HIGHLIGHTED;
- else
- color = INFO_TOP;
+ if (idx == _selector && mode != RENDER_ALL)
+ color = COMMAND_HIGHLIGHTED;
+ else
+ color = INFO_TOP;
- if (mode == RENDER_NAMES_AND_SCROLLBAR)
- _surface.fillRect(Common::Rect(4, yp, _surface.w() - BUTTON_SIZE - 9, yp + _surface.fontHeight()), TRANSPARENCY);
+ if (mode == RENDER_NAMES_AND_SCROLLBAR)
+ _surface.fillRect(Common::Rect(4, yp, _surface.w() - BUTTON_SIZE - 9, yp + _surface.fontHeight()), TRANSPARENCY);
- Common::String numStr = Common::String::format("%d.", idx + 1);
- _surface.writeString(numStr, Common::Point(_surface.widestChar(), yp), color);
- _surface.writeString(_savegames[idx], Common::Point(xp, yp), color);
- }
+ Common::String numStr = Common::String::format("%d.", idx + 1);
+ _surface.writeString(numStr, Common::Point(_surface.widestChar(), yp), color);
+ _surface.writeString(_savegames[idx], Common::Point(xp, yp), color);
yp += _surface.fontHeight() + 1;
}
diff --git a/engines/sword25/configure.engine b/engines/sword25/configure.engine
index 1729bbeb33..6a9428c758 100644
--- a/engines/sword25/configure.engine
+++ b/engines/sword25/configure.engine
@@ -1,3 +1,3 @@
# This file is included from the main "configure" script
# add_engine [name] [desc] [build-by-default] [subengines] [base games] [deps]
-add_engine sword25 "Broken Sword 2.5" no "" "" "png zlib 16bit"
+add_engine sword25 "Broken Sword 2.5" yes "" "" "png zlib 16bit"
diff --git a/engines/sword25/detection_tables.h b/engines/sword25/detection_tables.h
index a9f263b7d4..b58f430fcf 100644
--- a/engines/sword25/detection_tables.h
+++ b/engines/sword25/detection_tables.h
@@ -29,7 +29,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("data.b25c", "f8b6e03ada2d2f6cf27fbc11ad1572e9", 654310588),
Common::EN_ANY,
Common::kPlatformUnknown,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO1(GUIO_NOASPECT)
},
{
@@ -38,7 +38,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_fr.b25c", "690caf157387e06d2c3d1ca53c43f428", 1006043),
Common::FR_FRA,
Common::kPlatformUnknown,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO1(GUIO_NOASPECT)
},
{
@@ -47,7 +47,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("data.b25c", "f8b6e03ada2d2f6cf27fbc11ad1572e9", 654310588),
Common::DE_DEU,
Common::kPlatformUnknown,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO1(GUIO_NOASPECT)
},
{
@@ -56,7 +56,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_hr.b25c", "e881054d1f8ec1e527422fc521c25405", 1273217),
Common::HR_HRV,
Common::kPlatformUnknown,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO1(GUIO_NOASPECT)
},
{
@@ -65,7 +65,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_it.b25c", "f3325666da0515cc2b42062e953c0889", 996197),
Common::IT_ITA,
Common::kPlatformUnknown,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO1(GUIO_NOASPECT)
},
{
@@ -74,7 +74,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_pl.b25c", "49dc1a20f95391a808e475c49be2bac0", 1281799),
Common::PL_POL,
Common::kPlatformUnknown,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO1(GUIO_NOASPECT)
},
{
@@ -83,7 +83,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_pt.b25c", "1df701432f9e13dcefe1adeb890b9c69", 993812),
Common::PT_BRA,
Common::kPlatformUnknown,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO1(GUIO_NOASPECT)
},
{
@@ -92,7 +92,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_ru.b25c", "deb33dd2f90a71ff60181918a8ce5063", 1235378),
Common::RU_RUS,
Common::kPlatformUnknown,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO1(GUIO_NOASPECT)
},
{
@@ -101,7 +101,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_es.b25c", "384c19072d83725f351bb9ecb4d3f02b", 987965),
Common::ES_ESP,
Common::kPlatformUnknown,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO1(GUIO_NOASPECT)
},
// Hungarian "psylog" version.
@@ -112,7 +112,7 @@ static const ADGameDescription gameDescriptions[] = {
AD_ENTRY1s("lang_hu.b25c", "7de51a3b4926a192549e75b1a7d81667", 1864915),
Common::HU_HUN,
Common::kPlatformUnknown,
- ADGF_UNSTABLE,
+ ADGF_TESTING,
GUIO1(GUIO_NOASPECT)
},
@@ -126,9 +126,22 @@ static const ADGameDescription gameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY,
Common::kPlatformUnknown,
- GF_EXTRACTED | ADGF_UNSTABLE,
+ GF_EXTRACTED | ADGF_TESTING,
GUIO1(GUIO_NOASPECT)
},
+
+ // Distributed by ScummVM
+ // Contains all language packs, English voice-overs and Hungarian version
+ {
+ "sword25",
+ "Latest version",
+ AD_ENTRY1s("data.b25c", "880a8a67faf4a4e7ab62cf114b771428", 827397764),
+ Common::EN_ANY,
+ Common::kPlatformUnknown,
+ ADGF_TESTING,
+ GUIO1(GUIO_NOASPECT)
+ },
+
AD_TABLE_END_MARKER
};
diff --git a/engines/sword25/gfx/animation.cpp b/engines/sword25/gfx/animation.cpp
index e2662fb2b3..541c44662b 100644
--- a/engines/sword25/gfx/animation.cpp
+++ b/engines/sword25/gfx/animation.cpp
@@ -119,6 +119,10 @@ void Animation::initMembers() {
_animationResourcePtr = 0;
_animationTemplateHandle = 0;
_framesLocked = false;
+
+ _loopPointCallback = 0;
+ _actionCallback = 0;
+ _deleteCallback = 0;
}
Animation::~Animation() {
diff --git a/engines/sword25/gfx/graphicengine.cpp b/engines/sword25/gfx/graphicengine.cpp
index f887c3cd51..fd3b63aeee 100644
--- a/engines/sword25/gfx/graphicengine.cpp
+++ b/engines/sword25/gfx/graphicengine.cpp
@@ -60,13 +60,13 @@ enum {
namespace Sword25 {
-static const uint FRAMETIME_SAMPLE_COUNT = 5; // Anzahl der Framezeiten ќber die, die Framezeit gemittelt wird
+static const uint FRAMETIME_SAMPLE_COUNT = 5; // Frame duration is averaged over FRAMETIME_SAMPLE_COUNT frames
GraphicEngine::GraphicEngine(Kernel *pKernel) :
_width(0),
_height(0),
_bitDepth(0),
- _lastTimeStamp((uint) -1), // max. BS_INT64 um beim ersten Aufruf von _UpdateLastFrameDuration() einen Reset zu erzwingen
+ _lastTimeStamp((uint) -1), // force reset of _UpdateLastFrameDuration() on first call
_lastFrameDuration(0),
_timerActive(true),
_frameTimeSampleSlot(0),
@@ -87,19 +87,18 @@ GraphicEngine::~GraphicEngine() {
}
bool GraphicEngine::init(int width, int height, int bitDepth, int backbufferCount) {
- // Warnung ausgeben, wenn eine nicht unterstќtzte Bittiefe gewфhlt wurde.
+ // Warn when an unsupported bit depth has been selected.
if (bitDepth != BIT_DEPTH) {
warning("Can't use a bit depth of %d (not supported). Falling back to %d.", bitDepth, BIT_DEPTH);
_bitDepth = BIT_DEPTH;
}
- // Warnung ausgeben, wenn nicht genau ein Backbuffer gewфhlt wurde.
+ // Warn when wrong BackBuffer is specified.
if (backbufferCount != BACKBUFFER_COUNT) {
warning("Can't use %d backbuffers (not supported). Falling back to %d.", backbufferCount, BACKBUFFER_COUNT);
backbufferCount = BACKBUFFER_COUNT;
}
- // Parameter in lokale Variablen kopieren
_width = width;
_height = height;
_bitDepth = bitDepth;
@@ -112,13 +111,13 @@ bool GraphicEngine::init(int width, int height, int bitDepth, int backbufferCoun
_backSurface.create(width, height, format);
- // Standardmфпig ist Vsync an.
+ // By default Vsync is on.
setVsync(true);
- // Layer-Manager initialisieren.
+ // Layer-Manager initialization
_renderObjectManagerPtr.reset(new RenderObjectManager(width, height, backbufferCount + 1));
- // Hauptpanel erstellen
+ // Create the main panel
_mainPanelPtr = _renderObjectManagerPtr->getTreeRoot()->addPanel(width, height, BS_ARGB(0, 0, 0, 0));
if (!_mainPanelPtr.isValid())
return false;
@@ -128,11 +127,10 @@ bool GraphicEngine::init(int width, int height, int bitDepth, int backbufferCoun
}
bool GraphicEngine::startFrame(bool updateAll) {
- // Berechnen, wie viel Zeit seit dem letzten Frame vergangen ist.
- // Dieser Wert kann ќber GetLastFrameDuration() von Modulen abgefragt werden, die zeitabhфngig arbeiten.
+ // Calculate how much time has elapsed since the last frame.
updateLastFrameDuration();
- // Den Layer-Manager auf den nфchsten Frame vorbereiten
+ // Prepare the Layer Manager for the next frame
_renderObjectManagerPtr->startFrame();
return true;
@@ -276,7 +274,7 @@ Resource *GraphicEngine::loadResource(const Common::String &filename) {
PackageManager *pPackage = Kernel::getInstance()->getPackage();
assert(pPackage);
- // Datei laden
+ // Loading data
byte *pFileData;
uint fileSize;
pFileData = pPackage->getFile(filename, &fileSize);
@@ -375,10 +373,10 @@ bool GraphicEngine::saveThumbnailScreenshot(const Common::String &filename) {
void GraphicEngine::ARGBColorToLuaColor(lua_State *L, uint color) {
lua_Number components[4] = {
- (lua_Number)((color >> 16) & 0xff), // Rot
- (lua_Number)((color >> 8) & 0xff), // Grќn
- (lua_Number)(color & 0xff), // Blau
- (lua_Number)(color >> 24), // Alpha
+ (lua_Number)((color >> 16) & 0xff), // Red
+ (lua_Number)((color >> 8) & 0xff), // Green
+ (lua_Number)(color & 0xff), // Blue
+ (lua_Number)(color >> 24), // Alpha
};
lua_newtable(L);
@@ -395,11 +393,11 @@ uint GraphicEngine::luaColorToARGBColor(lua_State *L, int stackIndex) {
int __startStackDepth = lua_gettop(L);
#endif
- // Sicherstellen, dass wir wirklich eine Tabelle betrachten
+ // Make sure that we really look at a table
luaL_checktype(L, stackIndex, LUA_TTABLE);
- // Grіпe der Tabelle auslesen
+ // getting table size
uint n = luaL_getn(L, stackIndex);
- // RGB oder RGBA Farben werden unterstќtzt und sonst keine
+ // only RGB or RGBA colors are supported
if (n != 3 && n != 4)
luaL_argcheck(L, 0, stackIndex, "at least 3 of the 4 color components have to be specified");
diff --git a/engines/sword25/gfx/graphicengine.h b/engines/sword25/gfx/graphicengine.h
index cf4289b8bb..cca87b491c 100644
--- a/engines/sword25/gfx/graphicengine.h
+++ b/engines/sword25/gfx/graphicengine.h
@@ -310,8 +310,6 @@ private:
uint _frameTimeSampleSlot;
private:
- byte *_backBuffer;
-
RenderObjectPtr<Panel> _mainPanelPtr;
Common::ScopedPtr<RenderObjectManager> _renderObjectManagerPtr;
diff --git a/engines/sword25/gfx/image/imgloader.cpp b/engines/sword25/gfx/image/imgloader.cpp
index f299cee9d1..6ec0e7c542 100644
--- a/engines/sword25/gfx/image/imgloader.cpp
+++ b/engines/sword25/gfx/image/imgloader.cpp
@@ -33,11 +33,13 @@
#include "sword25/gfx/image/image.h"
#include "sword25/gfx/image/imgloader.h"
#include "graphics/pixelformat.h"
+#include "graphics/surface.h"
#include "image/png.h"
namespace Sword25 {
-bool ImgLoader::decodePNGImage(const byte *fileDataPtr, uint fileSize, byte *&uncompressedDataPtr, int &width, int &height, int &pitch) {
+bool ImgLoader::decodePNGImage(const byte *fileDataPtr, uint fileSize, Graphics::Surface *dest) {
+ assert(dest);
Common::MemoryReadStream *fileStr = new Common::MemoryReadStream(fileDataPtr, fileSize, DisposeAfterUse::NO);
::Image::PNGDecoder png;
@@ -47,12 +49,9 @@ bool ImgLoader::decodePNGImage(const byte *fileDataPtr, uint fileSize, byte *&un
const Graphics::Surface *sourceSurface = png.getSurface();
Graphics::Surface *pngSurface = sourceSurface->convertTo(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0), png.getPalette());
- width = pngSurface->w;
- height = pngSurface->h;
- uncompressedDataPtr = new byte[pngSurface->pitch * pngSurface->h];
- memcpy(uncompressedDataPtr, (byte *)pngSurface->getPixels(), pngSurface->pitch * pngSurface->h);
- pngSurface->free();
+ dest->copyFrom(*pngSurface);
+ pngSurface->free();
delete pngSurface;
delete fileStr;
@@ -60,24 +59,22 @@ bool ImgLoader::decodePNGImage(const byte *fileDataPtr, uint fileSize, byte *&un
return true;
}
-bool ImgLoader::decodeThumbnailImage(const byte *pFileData, uint fileSize, byte *&pUncompressedData, int &width, int &height, int &pitch) {
+bool ImgLoader::decodeThumbnailImage(const byte *pFileData, uint fileSize, Graphics::Surface *dest) {
+ assert(dest);
const byte *src = pFileData + 4; // skip header
- width = READ_LE_UINT16(src); src += 2;
- height = READ_LE_UINT16(src); src += 2;
+ uint width = READ_LE_UINT16(src); src += 2;
+ uint height = READ_LE_UINT16(src); src += 2;
src++; // version, ignored for now
- pitch = width * 4;
- uint32 totalSize = pitch * height;
- pUncompressedData = new byte[totalSize];
- uint32 *dst = (uint32 *)pUncompressedData; // treat as uint32, for pixelformat output
- const Graphics::PixelFormat format = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
+ dest->create(width, height, Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0));
+ uint32 *dst = (uint32 *)dest->getBasePtr(0, 0); // treat as uint32, for pixelformat output
byte r, g, b;
- for (uint32 i = 0; i < totalSize / 4; i++) {
+ for (uint32 i = 0; i < width * height; i++) {
r = *src++;
g = *src++;
b = *src++;
- *dst++ = format.RGBToColor(r, g, b);
+ *dst++ = dest->format.RGBToColor(r, g, b);
}
return true;
diff --git a/engines/sword25/gfx/image/imgloader.h b/engines/sword25/gfx/image/imgloader.h
index b932cdc903..d9cf3f4d6d 100644
--- a/engines/sword25/gfx/image/imgloader.h
+++ b/engines/sword25/gfx/image/imgloader.h
@@ -35,6 +35,10 @@
#include "sword25/kernel/common.h"
#include "sword25/gfx/graphicengine.h"
+namespace Graphics {
+struct Surface;
+} // End of namespace Graphics
+
namespace Sword25 {
/**
@@ -52,25 +56,18 @@ public:
* Decode an image.
* @param[in] fileDatePtr pointer to the image data
* @param[in] fileSize size of the image data in bytes
- * @param[out] pUncompressedData if successful, this is set to a pointer containing the decoded image data
- * @param[out] width if successful, this is set to the width of the image
- * @param[out] height if successful, this is set to the height of the image
- * @param[out] pitch if successful, this is set to the number of bytes per scanline in the image
+ * @param[out] dest if successful, surface will contain the image
+ * data (storage is allocated via create).
* @return false in case of an error
*
- * @remark The size of the output data equals pitch * height.
* @remark This function does not free the image buffer passed to it,
* it is the callers responsibility to do so.
*/
static bool decodePNGImage(const byte *pFileData, uint fileSize,
- byte *&pUncompressedData,
- int &width, int &height,
- int &pitch);
+ Graphics::Surface *dest);
static bool decodeThumbnailImage(const byte *pFileData, uint fileSize,
- byte *&pUncompressedData,
- int &width, int &height,
- int &pitch);
+ Graphics::Surface *dest);
};
} // End of namespace Sword25
diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp
index 8c6369a790..8d90d1fa8b 100644
--- a/engines/sword25/gfx/image/renderedimage.cpp
+++ b/engines/sword25/gfx/image/renderedimage.cpp
@@ -126,19 +126,10 @@ RenderedImage::RenderedImage(const Common::String &filename, bool &result) :
}
// Uncompress the image
- int pitch;
- byte *dst;
- int w, h;
if (isPNG)
- result = ImgLoader::decodePNGImage(pFileData, fileSize, dst, w, h, pitch);
+ result = ImgLoader::decodePNGImage(pFileData, fileSize, &_surface);
else
- result = ImgLoader::decodeThumbnailImage(pFileData, fileSize, dst, w, h, pitch);
-
- _surface.w = w;
- _surface.h = h;
- _surface.pitch = w * 4;
- _surface.setPixels(dst);
- _surface.format = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
+ result = ImgLoader::decodeThumbnailImage(pFileData, fileSize, &_surface);
if (!result) {
error("Could not decode image.");
@@ -187,6 +178,9 @@ RenderedImage::RenderedImage() : _isTransparent(true) {
// -----------------------------------------------------------------------------
RenderedImage::~RenderedImage() {
+ if (_doCleanup) {
+ _surface.free();
+ }
}
// -----------------------------------------------------------------------------
diff --git a/engines/sword25/gfx/image/renderedimage.h b/engines/sword25/gfx/image/renderedimage.h
index 5b65a27355..e4d573f369 100644
--- a/engines/sword25/gfx/image/renderedimage.h
+++ b/engines/sword25/gfx/image/renderedimage.h
@@ -44,6 +44,9 @@
namespace Sword25 {
class RenderedImage : public Image {
+private:
+ RenderedImage(const RenderedImage &) : _doCleanup(false) {}
+ RenderedImage &operator=(const RenderedImage &) { return *this; }
public:
RenderedImage(const Common::String &filename, bool &result);
diff --git a/engines/sword25/gfx/image/swimage.cpp b/engines/sword25/gfx/image/swimage.cpp
index 776f8ce8d3..7a3c95b5f9 100644
--- a/engines/sword25/gfx/image/swimage.cpp
+++ b/engines/sword25/gfx/image/swimage.cpp
@@ -35,10 +35,7 @@
namespace Sword25 {
-SWImage::SWImage(const Common::String &filename, bool &result) :
- _imageDataPtr(0),
- _width(0),
- _height(0) {
+SWImage::SWImage(const Common::String &filename, bool &result) : _image() {
result = false;
PackageManager *pPackage = Kernel::getInstance()->getPackage();
@@ -54,9 +51,7 @@ SWImage::SWImage(const Common::String &filename, bool &result) :
}
// Uncompress the image
- int pitch;
- byte *pUncompressedData;
- if (!ImgLoader::decodePNGImage(pFileData, fileSize, pUncompressedData, _width, _height, pitch)) {
+ if (!ImgLoader::decodePNGImage(pFileData, fileSize, &_image)) {
error("Could not decode image.");
return;
}
@@ -64,14 +59,12 @@ SWImage::SWImage(const Common::String &filename, bool &result) :
// Cleanup FileData
delete[] pFileData;
- _imageDataPtr = (uint *)pUncompressedData;
-
result = true;
return;
}
SWImage::~SWImage() {
- delete[] _imageDataPtr;
+ _image.free();
}
@@ -96,10 +89,10 @@ bool SWImage::setContent(const byte *pixeldata, uint size, uint offset, uint str
}
uint SWImage::getPixel(int x, int y) {
- assert(x >= 0 && x < _width);
- assert(y >= 0 && y < _height);
+ assert(x >= 0 && x < _image.w);
+ assert(y >= 0 && y < _image.h);
- return _imageDataPtr[_width * y + x];
+ return *((const uint32 *)_image.getBasePtr(0, 0));
}
} // End of namespace Sword25
diff --git a/engines/sword25/gfx/image/swimage.h b/engines/sword25/gfx/image/swimage.h
index 60978eb6cc..97c6395278 100644
--- a/engines/sword25/gfx/image/swimage.h
+++ b/engines/sword25/gfx/image/swimage.h
@@ -45,10 +45,10 @@ public:
virtual ~SWImage();
virtual int getWidth() const {
- return _width;
+ return _image.w;
}
virtual int getHeight() const {
- return _height;
+ return _image.h;
}
virtual GraphicEngine::COLOR_FORMATS getColorFormat() const {
return GraphicEngine::CF_ARGB32;
@@ -86,10 +86,7 @@ public:
return false;
}
private:
- uint *_imageDataPtr;
-
- int _width;
- int _height;
+ Graphics::Surface _image;
};
} // End of namespace Sword25
diff --git a/engines/sword25/gfx/image/vectorimage.cpp b/engines/sword25/gfx/image/vectorimage.cpp
index 0e5dfb9c53..a678fdccad 100644
--- a/engines/sword25/gfx/image/vectorimage.cpp
+++ b/engines/sword25/gfx/image/vectorimage.cpp
@@ -283,7 +283,18 @@ VectorImage::VectorImage(const byte *pFileData, uint fileSize, bool &success, co
case 32:
success = parseDefineShape(3, bs);
return;
+ case 9:
+ // SetBackgroundColor
+ {
+ byte r, g, b;
+ r = bs.getByte();
+ g = bs.getByte();
+ b = bs.getByte();
+ _bgColor = Graphics::ARGBToColor<Graphics::ColorMasks<8888> >(0xff, r, g, b);
+ }
+ break;
default:
+ warning("Ignoring tag: %d, %d bytes", tagType, tagLength);
// Ignore unknown tags
bs.skipBytes(tagLength);
}
@@ -300,8 +311,7 @@ VectorImage::~VectorImage() {
if (_elements[j].getPathInfo(i).getVec())
free(_elements[j].getPathInfo(i).getVec());
- if (_pixelData)
- free(_pixelData);
+ free(_pixelData);
}
diff --git a/engines/sword25/gfx/image/vectorimage.h b/engines/sword25/gfx/image/vectorimage.h
index 057064fc6a..b5c2100681 100644
--- a/engines/sword25/gfx/image/vectorimage.h
+++ b/engines/sword25/gfx/image/vectorimage.h
@@ -228,6 +228,7 @@ private:
byte *_pixelData;
Common::String _fname;
+ uint _bgColor;
};
} // End of namespace Sword25
diff --git a/engines/sword25/gfx/image/vectorimagerenderer.cpp b/engines/sword25/gfx/image/vectorimagerenderer.cpp
index c69cb497c1..be734c7b98 100644
--- a/engines/sword25/gfx/image/vectorimagerenderer.cpp
+++ b/engines/sword25/gfx/image/vectorimagerenderer.cpp
@@ -38,8 +38,7 @@
*
*/
-#include "art.h"
-
+#include "sword25/gfx/image/art.h"
#include "sword25/gfx/image/vectorimage.h"
#include "graphics/colormasks.h"
diff --git a/engines/sword25/gfx/panel.cpp b/engines/sword25/gfx/panel.cpp
index 9699db7f6a..2b71854060 100644
--- a/engines/sword25/gfx/panel.cpp
+++ b/engines/sword25/gfx/panel.cpp
@@ -62,7 +62,7 @@ Panel::Panel(RenderObjectPtr<RenderObject> parentPtr, int width, int height, uin
}
Panel::Panel(InputPersistenceBlock &reader, RenderObjectPtr<RenderObject> parentPtr, uint handle) :
- RenderObject(parentPtr, RenderObject::TYPE_PANEL, handle) {
+ RenderObject(parentPtr, RenderObject::TYPE_PANEL, handle), _color(0) {
_initSuccess = unpersist(reader);
}
diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp
index 4b4f967f29..eeaece97f2 100644
--- a/engines/sword25/gfx/screenshot.cpp
+++ b/engines/sword25/gfx/screenshot.cpp
@@ -40,7 +40,7 @@ namespace Sword25 {
bool Screenshot::saveToFile(Graphics::Surface *data, Common::WriteStream *stream) {
// Convert the RGBA data to RGB
- const byte *pSrc = (const byte *)data->getPixels();
+ const uint32 *pSrc = (const uint32 *)data->getPixels();
// Write our own custom header
stream->writeUint32BE(MKTAG('S','C','R','N')); // SCRN, short for "Screenshot"
@@ -52,11 +52,12 @@ bool Screenshot::saveToFile(Graphics::Surface *data, Common::WriteStream *stream
for (uint x = 0; x < data->w; x++) {
// This is only called by createThumbnail below, which
// provides a fake 'surface' with LE data in it.
- uint32 srcPixel = READ_LE_UINT32(pSrc);
- pSrc += sizeof(uint32);
- stream->writeByte((srcPixel >> 16) & 0xff); // R
- stream->writeByte((srcPixel >> 8) & 0xff); // G
- stream->writeByte(srcPixel & 0xff); // B
+ byte a, r, g, b;
+
+ data->format.colorToARGB(*pSrc++, a, r, g, b);
+ stream->writeByte(r);
+ stream->writeByte(g);
+ stream->writeByte(b);
}
}
@@ -81,30 +82,27 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data)
Graphics::Surface thumbnail;
thumbnail.create(200, 125, g_system->getScreenFormat());
- // мber das Zielbild iterieren und einen Pixel zur Zeit berechnen.
+ // Uber das Zielbild iterieren und einen Pixel zur Zeit berechnen.
uint x, y;
x = y = 0;
- for (byte *pDest = (byte *)thumbnail.getPixels(); pDest < ((byte *)thumbnail.getBasePtr(0, thumbnail.h)); ) {
+ for (uint32 *pDest = (uint32 *)thumbnail.getPixels(); pDest < thumbnail.getBasePtr(0, thumbnail.h); ) {
// Get an average over a 4x4 pixel block in the source image
int alpha, red, green, blue;
alpha = red = green = blue = 0;
for (int j = 0; j < 4; ++j) {
const uint32 *srcP = (const uint32 *)data->getBasePtr(x * 4, y * 4 + j + 50);
for (int i = 0; i < 4; ++i) {
- uint32 pixel = READ_UINT32(srcP + i);
- alpha += (pixel >> 24);
- red += (pixel >> 16) & 0xff;
- green += (pixel >> 8) & 0xff;
- blue += pixel & 0xff;
+ byte a, r, g, b;
+ data->format.colorToARGB(*(srcP + i), a, r, g, b);
+ alpha += a;
+ red += r;
+ green += g;
+ blue += b;
}
}
- // Write target pixel
- *pDest++ = blue / 16;
- *pDest++ = green / 16;
- *pDest++ = red / 16;
- *pDest++ = alpha / 16;
+ *pDest++ = thumbnail.format.ARGBToColor(alpha / 16, red / 16, green / 16, blue / 16);
// Move to next block
++x;
diff --git a/engines/sword25/gfx/staticbitmap.cpp b/engines/sword25/gfx/staticbitmap.cpp
index 1a6c812508..7ab76e625e 100644
--- a/engines/sword25/gfx/staticbitmap.cpp
+++ b/engines/sword25/gfx/staticbitmap.cpp
@@ -124,6 +124,10 @@ uint StaticBitmap::getPixel(int x, int y) const {
assert(pResource->getType() == Resource::TYPE_BITMAP);
BitmapResource *pBitmapResource = static_cast<BitmapResource *>(pResource);
uint result = pBitmapResource->getPixel(x, y);
+ // Convert to LUA-ready format
+ byte a;
+ a = result & 0xff;
+ result = (result >> 8) | (a << 24);
pResource->release();
return result;
}
diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp
index 904435fcb0..d409c538c0 100644
--- a/engines/sword25/gfx/text.cpp
+++ b/engines/sword25/gfx/text.cpp
@@ -29,10 +29,6 @@
*
*/
-// TODO:
-// Entweder Fontfile absolut abspeichern, oder Verzeichniswechseln verbieten
-// Eine relative Fontfile-Angabe kіnnte verwandt werden nachdem das Verzeichnis bereits gewechselt wurde und die Datei wќrde nicht mehr gefunden
-
#include "sword25/kernel/kernel.h"
#include "sword25/kernel/outputpersistenceblock.h"
#include "sword25/kernel/inputpersistenceblock.h"
@@ -99,7 +95,7 @@ void Text::setText(const Common::String &text) {
}
void Text::setColor(uint32 modulationColor) {
- uint32 newModulationColor = (modulationColor & 0xffffff00) | (_modulationColor & 0x000000ff);
+ uint32 newModulationColor = (modulationColor & 0x00ffffff) | (_modulationColor & 0xff000000);
if (newModulationColor != _modulationColor) {
_modulationColor = newModulationColor;
forceRefresh();
@@ -108,7 +104,7 @@ void Text::setColor(uint32 modulationColor) {
void Text::setAlpha(int alpha) {
assert(alpha >= 0 && alpha < 256);
- uint32 newModulationColor = (_modulationColor & 0xffffff00) | alpha;
+ uint32 newModulationColor = (_modulationColor & 0xffffff) | (alpha << 24);
if (newModulationColor != _modulationColor) {
_modulationColor = newModulationColor;
forceRefresh();
@@ -132,12 +128,12 @@ void Text::setAutoWrapThreshold(uint32 autoWrapThreshold) {
}
bool Text::doRender(RectangleList *updateRects) {
- // Font-Resource locken.
+ // lock Font Resource
FontResource *fontPtr = lockFontResource();
if (!fontPtr)
return false;
- // Charactermap-Resource locken.
+ // lock Character map resource
ResourceManager *rmPtr = getResourceManager();
BitmapResource *charMapPtr;
{
@@ -154,18 +150,18 @@ bool Text::doRender(RectangleList *updateRects) {
charMapPtr = static_cast<BitmapResource *>(pResource);
}
- // Framebufferobjekt holen.
+ // Getting frame buffer object
GraphicEngine *gfxPtr = Kernel::getInstance()->getGfx();
assert(gfxPtr);
bool result = true;
Common::Array<Line>::iterator iter = _lines.begin();
for (; iter != _lines.end(); ++iter) {
- // Feststellen, ob ќberhaupt Buchstaben der aktuellen Zeile vom Update betroffen sind.
+ // Determine whether any letters of the current line are affected by the update.
Common::Rect checkRect = (*iter).bbox;
checkRect.translate(_absoluteX, _absoluteY);
- // Jeden Buchstaben einzeln Rendern.
+ // Render each letter individually.
int curX = _absoluteX + (*iter).bbox.left;
int curY = _absoluteY + (*iter).bbox.top;
for (uint i = 0; i < (*iter).text.size(); ++i) {
@@ -181,24 +177,24 @@ bool Text::doRender(RectangleList *updateRects) {
}
}
- // Charactermap-Resource freigeben.
+ // Free Character map resource
charMapPtr->release();
- // Font-Resource freigeben.
+ // Free Font resource
fontPtr->release();
return result;
}
ResourceManager *Text::getResourceManager() {
- // Pointer auf den Resource-Manager holen.
+ // Getting pointer to resource manager
return Kernel::getInstance()->getResourceManager();
}
FontResource *Text::lockFontResource() {
ResourceManager *rmPtr = getResourceManager();
- // Font-Resource locken.
+ // Lock font resource
FontResource *fontPtr;
{
Resource *resourcePtr = rmPtr->requestResource(_font);
@@ -278,7 +274,7 @@ void Text::updateFormat() {
i = lastSpace;
}
- // Bounding-Box der einzelnen Zeilen relativ zur ersten festlegen (vor allem zentrieren).
+ // Bounding box of each line relative to the first set (center aligned).
_height = 0;
Common::Array<Line>::iterator iter = _lines.begin();
for (; iter != _lines.end(); ++iter) {
@@ -290,7 +286,7 @@ void Text::updateFormat() {
_height += bbox.height();
}
} else {
- // Keine automatische Formatierung, also wird der gesamte Text in nur eine Zeile kopiert.
+ // No auto format, so all the text is copied to a single line.
_lines[0].text = _text;
_lines[0].bbox = Common::Rect(0, 0, _width, _height);
}
@@ -333,11 +329,11 @@ bool Text::unpersist(InputPersistenceBlock &reader) {
result &= RenderObject::unpersist(reader);
- // Farbe und Alpha einlesen.
+ // Read color and alpha
reader.read(_modulationColor);
- // Beim Laden der anderen Member werden die Set-Methoden benutzt statt der tatsфchlichen Member.
- // So wird das Layout automatisch aktualisiert und auch alle anderen notwendigen Methoden ausgefќhrt.
+ // Run all methods on loading relevant members.
+ // So, the layout is automatically updated and all necessary logic is executed.
Common::String font;
reader.readString(font);
diff --git a/engines/sword25/math/polygon.cpp b/engines/sword25/math/polygon.cpp
index ccefa1901e..99a0d37ed7 100644
--- a/engines/sword25/math/polygon.cpp
+++ b/engines/sword25/math/polygon.cpp
@@ -110,7 +110,7 @@ bool Polygon::computeIsCW() const {
// Cross product form
// If the cross product of the vertex lying fartherest bottom left is positive,
- // the vertecies arrranged in a clockwise order. Otherwise counter-clockwise
+ // the vertecies arranged in a clockwise order. Otherwise counter-clockwise
if (crossProduct(vertices[v1Index], vertices[v2Index], vertices[v3Index]) >= 0)
return true;
}
diff --git a/engines/sword25/sword25.cpp b/engines/sword25/sword25.cpp
index 76142c2534..5223481d50 100644
--- a/engines/sword25/sword25.cpp
+++ b/engines/sword25/sword25.cpp
@@ -95,7 +95,7 @@ Common::Error Sword25Engine::run() {
}
Common::Error Sword25Engine::appStart() {
- // Initialize the graphics mode to ARGB8888
+ // Initialize the graphics mode to RGBA8888
Graphics::PixelFormat format = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
initGraphics(800, 600, true, &format);
if (format != g_system->getScreenFormat())
diff --git a/engines/sword25/util/lua/scummvm_file.cpp b/engines/sword25/util/lua/scummvm_file.cpp
index c38aba004f..bdceff0c0c 100644
--- a/engines/sword25/util/lua/scummvm_file.cpp
+++ b/engines/sword25/util/lua/scummvm_file.cpp
@@ -183,7 +183,7 @@ Common::String Sword25FileProxy::getLanguage() {
case Common::FR_FRA:
return "fr";
case Common::HU_HUN:
- return "hr";
+ return "hu";
case Common::IT_ITA:
return "it";
case Common::PL_POL:
@@ -210,7 +210,7 @@ void Sword25FileProxy::setLanguage(const Common::String &lang) {
ConfMan.set("language", Common::getLanguageCode(Common::ES_ESP));
else if (lang == "fr")
ConfMan.set("language", Common::getLanguageCode(Common::FR_FRA));
- else if (lang == "hr")
+ else if (lang == "hu")
ConfMan.set("language", Common::getLanguageCode(Common::HU_HUN));
else if (lang == "it")
ConfMan.set("language", Common::getLanguageCode(Common::IT_ITA));
diff --git a/engines/testbed/testbed.cpp b/engines/testbed/testbed.cpp
index 635fd09bac..885429cafd 100644
--- a/engines/testbed/testbed.cpp
+++ b/engines/testbed/testbed.cpp
@@ -152,6 +152,9 @@ void TestbedEngine::invokeTestsuites(TestbedConfigManager &cfMan) {
Common::Point pt = Testsuite::getDisplayRegionCoordinates();
int numSuitesEnabled = cfMan.getNumSuitesEnabled();
+ if (!numSuitesEnabled)
+ return;
+
for (iter = _testsuiteList.begin(); iter != _testsuiteList.end(); iter++) {
if (shouldQuit()) {
return;
diff --git a/engines/testbed/testsuite.cpp b/engines/testbed/testsuite.cpp
index 7729c4911b..853f1288b3 100644
--- a/engines/testbed/testsuite.cpp
+++ b/engines/testbed/testsuite.cpp
@@ -283,6 +283,9 @@ void Testsuite::execute() {
pt.y += getLineSeparation();
int numEnabledTests = getNumTestsEnabled();
+ if (!numEnabledTests)
+ return;
+
for (Common::Array<Test *>::iterator i = _testsToExecute.begin(); i != _testsToExecute.end(); ++i) {
if (!(*i)->enabled) {
logPrintf("Info! Skipping Test: %s, Skipped by configuration.\n", ((*i)->featureName).c_str());
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index 6dc8e3bb35..77932a5cdf 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -528,8 +528,6 @@ void SetNewScene(SCNHANDLE scene, int entrance, int transition) {
* Store a scene as hooked
*/
void SetHookScene(SCNHANDLE scene, int entrance, int transition) {
- assert(g_HookScene.scene == 0); // scene already hooked
-
g_HookScene.scene = scene;
g_HookScene.entry = entrance;
g_HookScene.trans = transition;
diff --git a/engines/tony/detection_tables.h b/engines/tony/detection_tables.h
index 28dcaac752..1bb91a862d 100644
--- a/engines/tony/detection_tables.h
+++ b/engines/tony/detection_tables.h
@@ -24,7 +24,7 @@ namespace Tony {
static const TonyGameDescription gameDescriptions[] = {
{
- // Tony Tough English
+ // Tony Tough English not installed
{
"tony",
0,
@@ -32,8 +32,6 @@ static const TonyGameDescription gameDescriptions[] = {
// TODO: AdvancedDetector seems to have a problem where it thinks data1.cab is unrecognized.
// Is it perhaps because the Agos engine also has detection entries for data1.cab?
{"data1.cab", 0, "ce82907242166bfb594d97bdb68f96d2", 4350},
- /*{"roasted.mpr", 0, "06203dbbc85fdd1e6dc8fc211c1a6207", 135911071},
- {"roasted.mpc", 0, "57c4a3860cf899443c357e0078ea6f49", 366773},*/
AD_LISTEND
},
Common::EN_ANY,
@@ -44,6 +42,24 @@ static const TonyGameDescription gameDescriptions[] = {
},
{
+ // Tony Tough Czech not installed
+ {
+ "tony",
+ 0,
+ {
+ // TODO: AdvancedDetector seems to have a problem where it thinks data1.cab is unrecognized.
+ // Is it perhaps because the Agos engine also has detection entries for data1.cab?
+ {"data1.cab", 0, "c6d5dd8f0c1241a6e3f7861b7f27bf7b", 4350},
+ AD_LISTEND
+ },
+ Common::CZ_CZE,
+ Common::kPlatformWindows,
+ ADGF_NO_FLAGS,
+ GUIO1(GUIO_NONE)
+ },
+ },
+
+ {
// Tony Tough English Demo
{
"tony",
diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp
index dad634c9bb..cbb6846340 100644
--- a/engines/voyeur/voyeur.cpp
+++ b/engines/voyeur/voyeur.cpp
@@ -33,8 +33,6 @@
namespace Voyeur {
-VoyeurEngine *g_vm;
-
VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc) : Engine(syst),
_gameDescription(gameDesc), _randomSource("Voyeur"),
_defaultFontInfo(3, 0xff, 0xff, 0, 0, ALIGN_LEFT, 0, Common::Point(), 1, 1,
diff --git a/engines/wintermute/ad/ad_game.cpp b/engines/wintermute/ad/ad_game.cpp
index 3c4383f55e..df0328ce5e 100644
--- a/engines/wintermute/ad/ad_game.cpp
+++ b/engines/wintermute/ad/ad_game.cpp
@@ -2261,7 +2261,7 @@ bool AdGame::onMouseRightUp() {
bool AdGame::displayDebugInfo() {
char str[100];
if (_gameRef->_debugDebugMode) {
- sprintf(str, "Mouse: %d, %d (scene: %d, %d)", _mousePos.x, _mousePos.y, _mousePos.x + _scene->getOffsetLeft(), _mousePos.y + _scene->getOffsetTop());
+ sprintf(str, "Mouse: %d, %d (scene: %d, %d)", _mousePos.x, _mousePos.y, _mousePos.x + (_scene ? _scene->getOffsetLeft() : 0), _mousePos.y + (_scene ? _scene->getOffsetTop() : 0));
_systemFont->drawText((byte *)str, 0, 90, _renderer->getWidth(), TAL_RIGHT);
sprintf(str, "Scene: %s (prev: %s)", (_scene && _scene->getName()) ? _scene->getName() : "???", _prevSceneName ? _prevSceneName : "???");
diff --git a/engines/wintermute/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp
index f672c83d39..d26685a256 100644
--- a/engines/wintermute/base/base_keyboard_state.cpp
+++ b/engines/wintermute/base/base_keyboard_state.cpp
@@ -200,6 +200,12 @@ const char *BaseKeyboardState::scToString() {
bool BaseKeyboardState::readKey(Common::Event *event) {
//_currentPrintable = (event->type == SDL_TEXTINPUT); // TODO
_currentCharCode = keyCodeToVKey(event);
+ // convert all lowercase keys to uppercase to make it easier for handling later on for consistency
+ if (Common::isLower(_currentCharCode) && (event->kbd.hasFlags(Common::KBD_SHIFT) || event->kbd.flags & Common::KBD_CAPS)) {
+ if (!(event->kbd.keycode >= Common::KEYCODE_F1 && event->kbd.keycode <= Common::KEYCODE_F12)) {
+ _currentCharCode = toupper(_currentCharCode);
+ }
+ }
// Verify that this is a printable ISO-8859-character (including the upper charset)
if ((_currentCharCode <= 0x7E && _currentCharCode >= 0x20) || (_currentCharCode <= 0xFF && _currentCharCode >= 0xA0)) {
_currentPrintable = true;
@@ -263,7 +269,11 @@ bool BaseKeyboardState::isCurrentPrintable() const {
//////////////////////////////////////////////////////////////////////////
enum VKeyCodes {
+ kVkBack = 8,
+ kVkTab = 9,
+
kVkReturn = 13,
+ kVkPause = 19,
kVkEscape = 27,
@@ -274,6 +284,7 @@ enum VKeyCodes {
kVkUp = 38,
kVkRight = 39,
kVkDown = 40,
+ kVkInsert = 45,
kVkF1 = 112,
kVkF2 = 113,
@@ -297,26 +308,53 @@ uint32 BaseKeyboardState::keyCodeToVKey(Common::Event *event) {
return 0;
}
+ // return ASCII value if key pressed is an alphanumeric key
+ // number keys pressed on numpad are handled in next block
+ if (Common::isAlnum(event->kbd.keycode)) {
+ return event->kbd.ascii;
+ }
+
+ // if NumLock is active, return ASCII for numpad keys
+ // keys pressed on numpad without NumLock are considered as normal keycodes, handled in the next block
+ if (Common::isDigit(event->kbd.ascii) && ((event->kbd.flags & Common::KBD_NUM) != 0)) {
+ return event->kbd.ascii;
+ }
+
switch (event->kbd.keycode) {
+ case Common::KEYCODE_BACKSPACE:
+ return kVkBack;
+ case Common::KEYCODE_TAB:
+ return kVkTab;
case Common::KEYCODE_RETURN:
case Common::KEYCODE_KP_ENTER:
return kVkReturn;
+ case Common::KEYCODE_PAUSE:
+ return kVkPause;
case Common::KEYCODE_ESCAPE:
return kVkEscape;
case Common::KEYCODE_SPACE:
return kVkSpace;
case Common::KEYCODE_END:
+ case Common::KEYCODE_KP1:
return kVkEnd;
case Common::KEYCODE_HOME:
+ case Common::KEYCODE_KP7:
return kVkHome;
case Common::KEYCODE_LEFT:
+ case Common::KEYCODE_KP4:
return kVkLeft;
case Common::KEYCODE_RIGHT:
+ case Common::KEYCODE_KP6:
return kVkRight;
case Common::KEYCODE_UP:
+ case Common::KEYCODE_KP8:
return kVkUp;
case Common::KEYCODE_DOWN:
+ case Common::KEYCODE_KP2:
return kVkDown;
+ case Common::KEYCODE_INSERT:
+ case Common::KEYCODE_KP0:
+ return kVkInsert;
case Common::KEYCODE_F1:
return kVkF1;
case Common::KEYCODE_F2:
@@ -342,8 +380,12 @@ uint32 BaseKeyboardState::keyCodeToVKey(Common::Event *event) {
case Common::KEYCODE_F12:
return kVkF12;
default:
- warning("Key not handled: %d '%c'", event->kbd.keycode, event->kbd.keycode);
- return event->kbd.keycode;
+ // check if any non-sticky keys were used, otherwise key is unknown to us
+ if ((event->kbd.flags & Common::KBD_NON_STICKY) == 0) {
+ warning("Key pressed is not recognized, ASCII returned (%d '%c').", event->kbd.keycode, event->kbd.keycode);
+ }
+ // return ASCII if no match, since it could be used for typing
+ return event->kbd.ascii;
break;
}
diff --git a/engines/wintermute/base/file/base_save_thumb_file.cpp b/engines/wintermute/base/file/base_save_thumb_file.cpp
index acd5363e89..54f7ee7c62 100644
--- a/engines/wintermute/base/file/base_save_thumb_file.cpp
+++ b/engines/wintermute/base/file/base_save_thumb_file.cpp
@@ -70,11 +70,12 @@ bool BaseSaveThumbFile::open(const Common::String &filename) {
delete[] tempFilename;
BasePersistenceManager *pm = new BasePersistenceManager();
- Common::String slotFilename = pm->getFilenameForSlot(slot);
if (!pm) {
return STATUS_FAILED;
}
+ Common::String slotFilename = pm->getFilenameForSlot(slot);
+
if (DID_FAIL(pm->initLoad(slotFilename))) {
delete pm;
return STATUS_FAILED;
diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp
index f27b565a7f..fa6973c58f 100644
--- a/engines/wintermute/base/font/base_font_truetype.cpp
+++ b/engines/wintermute/base/font/base_font_truetype.cpp
@@ -581,7 +581,7 @@ bool BaseFontTT::initFont() {
}
if (file) {
- _deletableFont = Graphics::loadTTFFont(*file, _fontHeight, 96); // Use the same dpi as WME (96 vs 72).
+ _deletableFont = Graphics::loadTTFFont(*file, _fontHeight, Graphics::kTTFSizeModeCharacter, 96); // Use the same dpi as WME (96 vs 72).
_font = _deletableFont;
BaseFileManager::getEngineInstance()->closeFile(file);
file = nullptr;
@@ -607,7 +607,7 @@ bool BaseFontTT::initFont() {
if (themeArchive->hasFile(fallbackFilename)) {
file = nullptr;
file = themeArchive->createReadStreamForMember(fallbackFilename);
- _deletableFont = Graphics::loadTTFFont(*file, _fontHeight, 96); // Use the same dpi as WME (96 vs 72).
+ _deletableFont = Graphics::loadTTFFont(*file, _fontHeight, Graphics::kTTFSizeModeCharacter, 96); // Use the same dpi as WME (96 vs 72).
_font = _deletableFont;
}
// We're not using BaseFileManager, so clean up after ourselves:
diff --git a/engines/wintermute/detection_tables.h b/engines/wintermute/detection_tables.h
index 4e3320159a..25a01766e4 100644
--- a/engines/wintermute/detection_tables.h
+++ b/engines/wintermute/detection_tables.h
@@ -140,9 +140,18 @@ static const WMEGameDescription gameDescriptions[] = {
// Five Lethal Demons
WME_WINENTRY("5ld", "",
WME_ENTRY1s("data.dcp", "1037a77cbd001e0644898addc022322c", 15407750), Common::EN_ANY, ADGF_UNSTABLE, LATEST_VERSION),
- // Five Magical Amulets
+ // Five Magical Amulets (Czech)
WME_WINENTRY("5ma", "",
- WME_ENTRY1s("data.dcp", "0134e92bcd5fd2837df3971087e96067", 163316498), Common::EN_ANY, ADGF_UNSTABLE, WME_1_7_0),
+ WME_ENTRY2s("czech.dcp", "7b2515a8ceb955c72bc14f0f1fca869e", 184,
+ "data.dcp", "0134e92bcd5fd2837df3971087e96067", 163316498), Common::CZ_CZE, ADGF_UNSTABLE, WME_1_7_0),
+ // Five Magical Amulets (English)
+ WME_WINENTRY("5ma", "",
+ WME_ENTRY2s("english.dcp", "2f97bca09260ba23b645da9f0855ce7f", 893681,
+ "data.dcp", "0134e92bcd5fd2837df3971087e96067", 163316498), Common::EN_ANY, ADGF_UNSTABLE, WME_1_7_0),
+ // Five Magical Amulets (Polish)
+ WME_WINENTRY("5ma", "",
+ WME_ENTRY2s("polish.dcp", "bb877d48795471a17f25b0b5109100d1", 1132197,
+ "data.dcp", "0134e92bcd5fd2837df3971087e96067", 163316498), Common::PL_POL, ADGF_UNSTABLE, WME_1_7_0),
// Actual Destination
WME_WINENTRY("actualdest", "",
WME_ENTRY1s("data.dcp", "6926f44b26f21ceb1d840eaab9aeb510", 9081740), Common::EN_ANY, ADGF_UNSTABLE, LATEST_VERSION),
@@ -334,6 +343,22 @@ static const WMEGameDescription gameDescriptions[] = {
// Oknytt
WME_WINENTRY("oknytt", "Version 1.0",
WME_ENTRY1s("data.dcp", "6456cf8f429905c83f07509f9da536dd", 109502959), Common::EN_ANY, ADGF_UNSTABLE, LATEST_VERSION),
+ // Oknytt (Version 1.13 English) (These are detected along with d_sounds.dcp to avoid mass-detecting in the languages-subfolder.)
+ WME_WINENTRY("oknytt", "Version 1.13",
+ WME_ENTRY2s("english.dcp", "d2afd722c78cfe66b7d4250d11f6ae16", 293274135,
+ "d_sounds.dcp", "7d04dff8ca11174486bd4b7a80fdcabb", 154943401), Common::EN_ANY, ADGF_UNSTABLE, LATEST_VERSION),
+ // Oknytt (Version 1.13 German)
+ WME_WINENTRY("oknytt", "Version 1.13",
+ WME_ENTRY2s("german.dcp", "0fc6401d8d76b04f6da49206ecafa0dc", 304292574,
+ "d_sounds.dcp", "7d04dff8ca11174486bd4b7a80fdcabb", 154943401), Common::DE_DEU, ADGF_UNSTABLE, LATEST_VERSION),
+ // Oknytt (Version 1.13 Russian)
+ WME_WINENTRY("oknytt", "Version 1.13",
+ WME_ENTRY2s("russian.dcp", "dd24a1c0b36a82e2b02fb6c1050d4aad", 362681669,
+ "d_sounds.dcp", "7d04dff8ca11174486bd4b7a80fdcabb", 154943401), Common::RU_RUS, ADGF_UNSTABLE, LATEST_VERSION),
+ // Oknytt (Version 1.13 Spanish)
+ WME_WINENTRY("oknytt", "Version 1.13",
+ WME_ENTRY2s("spanish.dcp", "10c46152cb29581671f3b6b7c229c957", 319406572,
+ "d_sounds.dcp", "7d04dff8ca11174486bd4b7a80fdcabb", 154943401), Common::ES_ESP, ADGF_UNSTABLE, LATEST_VERSION),
// Night Train Demo
WME_WINENTRY("nighttrain", "",
WME_ENTRY1s("data.dcp", "5a027ef84b083a730c9a4c85ec1d3a32", 131760816), Common::EN_ANY, ADGF_UNSTABLE | ADGF_DEMO, LATEST_VERSION),
diff --git a/engines/wintermute/utils/convert_utf.cpp b/engines/wintermute/utils/convert_utf.cpp
index 7ebc011d01..cdb48103d0 100644
--- a/engines/wintermute/utils/convert_utf.cpp
+++ b/engines/wintermute/utils/convert_utf.cpp
@@ -55,8 +55,6 @@ static const UTF32 halfMask = 0x3FFUL;
#define UNI_SUR_HIGH_END (UTF32)0xDBFF
#define UNI_SUR_LOW_START (UTF32)0xDC00
#define UNI_SUR_LOW_END (UTF32)0xDFFF
-#define false 0
-#define true 1
/* --------------------------------------------------------------------- */
@@ -311,7 +309,7 @@ ConversionResult ConvertUTF16toUTF8(
* definition of UTF-8 goes up to 4-byte sequences.
*/
-static Boolean isLegalUTF8(const UTF8 *source, int length) {
+static bool isLegalUTF8(const UTF8 *source, int length) {
UTF8 a;
const UTF8 *srcptr = source + length;
switch (length) {
@@ -356,7 +354,7 @@ static Boolean isLegalUTF8(const UTF8 *source, int length) {
* Exported function to return whether a UTF-8 sequence is legal or not.
* This is not used here; it's just exported.
*/
-Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {
+bool isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {
int length = trailingBytesForUTF8[*source] + 1;
if (source + length > sourceEnd) {
return false;
diff --git a/engines/wintermute/utils/convert_utf.h b/engines/wintermute/utils/convert_utf.h
index a5f34456f5..d2e54f4af4 100644
--- a/engines/wintermute/utils/convert_utf.h
+++ b/engines/wintermute/utils/convert_utf.h
@@ -96,7 +96,6 @@ namespace Wintermute {
typedef uint32 UTF32; /* at least 32 bits */
typedef uint16 UTF16; /* at least 16 bits */
typedef uint8 UTF8; /* typically 8 bits */
-typedef uint8 Boolean; /* 0 or 1 */
/* Some fundamental constants */
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
@@ -141,7 +140,7 @@ ConversionResult ConvertUTF32toUTF16(
const UTF32 **sourceStart, const UTF32 *sourceEnd,
UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags);
-Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
+bool isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd);
} // End of namespace Wintermute
diff --git a/engines/zvision/text/truetype_font.cpp b/engines/zvision/text/truetype_font.cpp
index acb053ea8d..ccb86d9440 100644
--- a/engines/zvision/text/truetype_font.cpp
+++ b/engines/zvision/text/truetype_font.cpp
@@ -123,7 +123,7 @@ bool StyledTTFont::loadFont(const Common::String &fontName, int32 point, uint st
!file.open(freeFontName) && !_engine->getSearchManager()->openFile(file, freeFontName))
error("Unable to open font file %s (Liberation Font alternative: %s, FreeFont alternative: %s)", newFontName.c_str(), liberationFontName.c_str(), freeFontName.c_str());
- Graphics::Font *newFont = Graphics::loadTTFFont(file, point, 60, (sharp ? Graphics::kTTFRenderModeMonochrome : Graphics::kTTFRenderModeNormal)); // 66 dpi for 640 x 480 on 14" display
+ Graphics::Font *newFont = Graphics::loadTTFFont(file, point, Graphics::kTTFSizeModeCell, 0, (sharp ? Graphics::kTTFRenderModeMonochrome : Graphics::kTTFRenderModeNormal));
if (newFont == nullptr) {
return false;
}
diff --git a/graphics/fonts/ttf.cpp b/graphics/fonts/ttf.cpp
index dc7335f1c2..98420f6dfb 100644
--- a/graphics/fonts/ttf.cpp
+++ b/graphics/fonts/ttf.cpp
@@ -33,11 +33,15 @@
#include "common/singleton.h"
#include "common/stream.h"
+#include "common/memstream.h"
#include "common/hashmap.h"
+#include "common/ptr.h"
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
+#include FT_TRUETYPE_TABLES_H
+#include FT_TRUETYPE_TAGS_H
namespace Graphics {
@@ -47,6 +51,10 @@ inline int ftCeil26_6(FT_Pos x) {
return (x + 63) / 64;
}
+inline int divRoundToNearest(int dividend, int divisor) {
+ return (dividend + (divisor / 2)) / divisor;
+}
+
} // End of anonymous namespace
class TTFLibrary : public Common::Singleton<TTFLibrary> {
@@ -101,7 +109,7 @@ public:
TTFFont();
virtual ~TTFFont();
- bool load(Common::SeekableReadStream &stream, int size, uint dpi, TTFRenderMode renderMode, const uint32 *mapping);
+ bool load(Common::SeekableReadStream &stream, int size, TTFSizeMode sizeMode, uint dpi, TTFRenderMode renderMode, const uint32 *mapping);
virtual int getFontHeight() const;
@@ -137,6 +145,12 @@ private:
bool _allowLateCaching;
void assureCached(uint32 chr) const;
+ Common::SeekableReadStream *readTTFTable(FT_ULong tag) const;
+
+ int computePointSize(int size, TTFSizeMode sizeMode) const;
+ int readPointSizeFromVDMXTable(int height) const;
+ int computePointSizeFromHeaders(int height) const;
+
FT_Int32 _loadFlags;
FT_Render_Mode _renderMode;
bool _hasKerning;
@@ -162,7 +176,7 @@ TTFFont::~TTFFont() {
}
}
-bool TTFFont::load(Common::SeekableReadStream &stream, int size, uint dpi, TTFRenderMode renderMode, const uint32 *mapping) {
+bool TTFFont::load(Common::SeekableReadStream &stream, int size, TTFSizeMode sizeMode, uint dpi, TTFRenderMode renderMode, const uint32 *mapping) {
if (!g_ttf.isInitialized())
return false;
@@ -200,7 +214,7 @@ bool TTFFont::load(Common::SeekableReadStream &stream, int size, uint dpi, TTFRe
// Check whether we have kerning support
_hasKerning = (FT_HAS_KERNING(_face) != 0);
- if (FT_Set_Char_Size(_face, 0, size * 64, dpi, dpi)) {
+ if (FT_Set_Char_Size(_face, 0, computePointSize(size, sizeMode) * 64, dpi, dpi)) {
delete[] _ttfFile;
_ttfFile = 0;
@@ -262,6 +276,126 @@ bool TTFFont::load(Common::SeekableReadStream &stream, int size, uint dpi, TTFRe
return _initialized;
}
+int TTFFont::computePointSize(int size, TTFSizeMode sizeMode) const {
+ int ptSize;
+ switch (sizeMode) {
+ case kTTFSizeModeCell: {
+ ptSize = readPointSizeFromVDMXTable(size);
+
+ if (ptSize == 0) {
+ ptSize = computePointSizeFromHeaders(size);
+ }
+
+ if (ptSize == 0) {
+ warning("Unable to compute point size for font '%s'", _face->family_name);
+ ptSize = 1;
+ }
+ break;
+ }
+ case kTTFSizeModeCharacter:
+ ptSize = size;
+ break;
+ }
+
+ return ptSize;
+}
+
+Common::SeekableReadStream *TTFFont::readTTFTable(FT_ULong tag) const {
+ // Find the required buffer size by calling the load function with nullptr
+ FT_ULong size = 0;
+ FT_Error err = FT_Load_Sfnt_Table(_face, tag, 0, nullptr, &size);
+ if (err) {
+ return nullptr;
+ }
+
+ byte *buf = (byte *)malloc(size);
+ if (!buf) {
+ return nullptr;
+ }
+
+ err = FT_Load_Sfnt_Table(_face, tag, 0, buf, &size);
+ if (err) {
+ free(buf);
+ return nullptr;
+ }
+
+ return new Common::MemoryReadStream(buf, size, DisposeAfterUse::YES);
+}
+
+int TTFFont::readPointSizeFromVDMXTable(int height) const {
+ // The Vertical Device Metrics table matches font heights with point sizes.
+ // FreeType does not expose it, we have to parse it ourselves.
+ // See https://www.microsoft.com/typography/otspec/vdmx.htm
+
+ Common::ScopedPtr<Common::SeekableReadStream> vdmxBuf(readTTFTable(TTAG_VDMX));
+ if (!vdmxBuf) {
+ return 0;
+ }
+
+ // Read the main header
+ vdmxBuf->skip(4); // Skip the version
+ uint16 numRatios = vdmxBuf->readUint16BE();
+
+ // Compute the starting position for the group table positions table
+ int32 offsetTableStart = vdmxBuf->pos() + 4 * numRatios;
+
+ // Search the ratio table for the 1:1 ratio, or the default record (0, 0, 0)
+ int32 selectedRatio = -1;
+ for (uint16 i = 0; i < numRatios; i++) {
+ vdmxBuf->skip(1); // Skip the charset subset
+ uint8 xRatio = vdmxBuf->readByte();
+ uint8 yRatio1 = vdmxBuf->readByte();
+ uint8 yRatio2 = vdmxBuf->readByte();
+
+ if ((xRatio == 1 && yRatio1 <= 1 && yRatio2 >= 1)
+ || (xRatio == 0 && yRatio1 == 0 && yRatio2 == 0)) {
+ selectedRatio = i;
+ break;
+ }
+ }
+ if (selectedRatio < 0) {
+ return 0;
+ }
+
+ // Read from group table positions table to get the group table offset
+ vdmxBuf->seek(offsetTableStart + sizeof(uint16) * selectedRatio);
+ uint16 groupOffset = vdmxBuf->readUint16BE();
+
+ // Read the group table header
+ vdmxBuf->seek(groupOffset);
+ uint16 numRecords = vdmxBuf->readUint16BE();
+ vdmxBuf->skip(2); // Skip the table bounds
+
+ // Search a record matching the required height
+ for (uint16 i = 0; i < numRecords; i++) {
+ uint16 pointSize = vdmxBuf->readUint16BE();
+ int16 yMax = vdmxBuf->readSint16BE();
+ int16 yMin = vdmxBuf->readSint16BE();
+
+ if (yMax + -yMin > height) {
+ return 0;
+ }
+ if (yMax + -yMin == height) {
+ return pointSize;
+ }
+ }
+
+ return 0;
+}
+
+int TTFFont::computePointSizeFromHeaders(int height) const {
+ TT_OS2 *os2Header = (TT_OS2 *)FT_Get_Sfnt_Table(_face, ft_sfnt_os2);
+ TT_HoriHeader *horiHeader = (TT_HoriHeader *)FT_Get_Sfnt_Table(_face, ft_sfnt_hhea);
+
+ if (os2Header && (os2Header->usWinAscent + os2Header->usWinDescent != 0)) {
+ return divRoundToNearest(_face->units_per_EM * height, os2Header->usWinAscent + os2Header->usWinDescent);
+ } else if (horiHeader && (horiHeader->Ascender + horiHeader->Descender != 0)) {
+ return divRoundToNearest(_face->units_per_EM * height, horiHeader->Ascender + horiHeader->Descender);
+ }
+
+ return 0;
+}
+
int TTFFont::getFontHeight() const {
return _height;
}
@@ -521,10 +655,10 @@ void TTFFont::assureCached(uint32 chr) const {
}
}
-Font *loadTTFFont(Common::SeekableReadStream &stream, int size, uint dpi, TTFRenderMode renderMode, const uint32 *mapping) {
+Font *loadTTFFont(Common::SeekableReadStream &stream, int size, TTFSizeMode sizeMode, uint dpi, TTFRenderMode renderMode, const uint32 *mapping) {
TTFFont *font = new TTFFont();
- if (!font->load(stream, size, dpi, renderMode, mapping)) {
+ if (!font->load(stream, size, sizeMode, dpi, renderMode, mapping)) {
delete font;
return 0;
}
diff --git a/graphics/fonts/ttf.h b/graphics/fonts/ttf.h
index bd25b69f21..4110486357 100644
--- a/graphics/fonts/ttf.h
+++ b/graphics/fonts/ttf.h
@@ -56,10 +56,32 @@ enum TTFRenderMode {
};
/**
+ * This specifies how the font size is defined.
+ */
+enum TTFSizeMode {
+ /**
+ * Character height only.
+ *
+ * This matches rendering obtained when calling
+ * CreateFont in Windows with negative height values.
+ */
+ kTTFSizeModeCharacter,
+
+ /**
+ * Full cell height.
+ *
+ * This matches rendering obtained when calling
+ * CreateFont in Windows with positive height values.
+ */
+ kTTFSizeModeCell
+};
+
+/**
* Loads a TTF font file from a given data stream object.
*
* @param stream Stream object to load font data from.
* @param size The point size to load.
+ * @param sizeMode The point size definition used for the size parameter.
* @param dpi The dpi to use for size calculations, by default 72dpi
* are used.
* @param renderMode FreeType2 mode used to render glyphs. @see TTFRenderMode
@@ -71,7 +93,7 @@ enum TTFRenderMode {
* supported.
* @return 0 in case loading fails, otherwise a pointer to the Font object.
*/
-Font *loadTTFFont(Common::SeekableReadStream &stream, int size, uint dpi = 0, TTFRenderMode renderMode = kTTFRenderModeLight, const uint32 *mapping = 0);
+Font *loadTTFFont(Common::SeekableReadStream &stream, int size, TTFSizeMode sizeMode = kTTFSizeModeCharacter, uint dpi = 0, TTFRenderMode renderMode = kTTFRenderModeLight, const uint32 *mapping = 0);
void shutdownTTF();
diff --git a/graphics/module.mk b/graphics/module.mk
index 2705322c79..b6919cf1ab 100644
--- a/graphics/module.mk
+++ b/graphics/module.mk
@@ -12,6 +12,7 @@ MODULE_OBJS := \
fonts/ttf.o \
fonts/winfont.o \
maccursor.o \
+ pixelformat.o \
primitives.o \
scaler.o \
scaler/thumbnail_intern.o \
diff --git a/graphics/pixelformat.cpp b/graphics/pixelformat.cpp
new file mode 100644
index 0000000000..0a46411254
--- /dev/null
+++ b/graphics/pixelformat.cpp
@@ -0,0 +1,64 @@
+/* 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.
+ *
+ */
+
+#include "graphics/pixelformat.h"
+#include "common/algorithm.h"
+
+namespace Graphics {
+
+Common::String PixelFormat::toString() const {
+ if (bytesPerPixel == 1)
+ return "CLUT8";
+
+ // We apply a trick to simplify the code here. We encode all the shift,
+ // loss, and component name in the component entry. By having the shift as
+ // highest entry we can sort according to shift.
+ // This works because in valid RGB PixelFormats shift values needs to be
+ // distinct except when the loss is 8. However, components with loss value
+ // of 8 are not printed, thus their position does not matter.
+ int component[4];
+ component[0] = (rShift << 16) | (rLoss << 8) | 'R';
+ component[1] = (gShift << 16) | (gLoss << 8) | 'G';
+ component[2] = (bShift << 16) | (bLoss << 8) | 'B';
+ component[3] = (aShift << 16) | (aLoss << 8) | 'A';
+
+ // Sort components according to descending shift value.
+ Common::sort(component, component + ARRAYSIZE(component), Common::Greater<int>());
+
+ Common::String letters, digits;
+ for (int i = 0; i < ARRAYSIZE(component); ++i) {
+ const int componentLoss = (component[i] >> 8) & 0xFF;
+ // A loss of 8 means that the component does not exist.
+ if (componentLoss == 8) {
+ continue;
+ }
+
+ const char componentName = component[i] & 0xFF;
+
+ letters += componentName;
+ digits += '0' + 8 - componentLoss;
+ }
+
+ return letters + digits;
+}
+
+} // End of namespace Graphics
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index 00db6702fc..9dd06241b7 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -24,6 +24,7 @@
#define GRAPHICS_PIXELFORMAT_H
#include "common/scummsys.h"
+#include "common/str.h"
namespace Graphics {
@@ -260,6 +261,8 @@ struct PixelFormat {
// Unsupported
return 0;
}
+
+ Common::String toString() const;
};
} // End of namespace Graphics
diff --git a/graphics/transparent_surface.cpp b/graphics/transparent_surface.cpp
index f6e8cacb8b..19e7655a93 100644
--- a/graphics/transparent_surface.cpp
+++ b/graphics/transparent_surface.cpp
@@ -41,8 +41,6 @@
namespace Graphics {
-static const int kAShift = 0;//img->format.aShift;
-
static const int kBModShift = 0;//img->format.bShift;
static const int kGModShift = 8;//img->format.gShift;
static const int kRModShift = 16;//img->format.rShift;
@@ -118,7 +116,7 @@ void doBlitBinaryFast(byte *ino, byte *outo, uint32 width, uint32 height, uint32
in = ino;
for (uint32 j = 0; j < width; j++) {
uint32 pix = *(uint32 *)in;
- int a = (pix >> kAShift) & 0xff;
+ int a = in[kAIndex];
if (a != 0) { // Full opacity (Any value not exactly 0 is Opaque here)
*(uint32 *)out = pix;
@@ -338,7 +336,7 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p
retSize.setWidth(0);
retSize.setHeight(0);
// Check if we need to draw anything at all
- int ca = (color >> 24) & 0xff;
+ int ca = (color >> kAModShift) & 0xff;
if (ca == 0) {
return retSize;
diff --git a/graphics/transparent_surface.h b/graphics/transparent_surface.h
index efb28149a5..0cd7d5b2e9 100644
--- a/graphics/transparent_surface.h
+++ b/graphics/transparent_surface.h
@@ -50,22 +50,22 @@ namespace Graphics {
@brief The possible flipping parameters for the blit method.
*/
enum FLIP_FLAGS {
- /// The image will not be flipped.
- FLIP_NONE = 0,
- /// The image will be flipped at the horizontal axis.
- FLIP_H = 1,
- /// The image will be flipped at the vertical axis.
- FLIP_V = 2,
- /// The image will be flipped at the horizontal and vertical axis.
- FLIP_HV = FLIP_H | FLIP_V,
- /// The image will be flipped at the horizontal and vertical axis.
- FLIP_VH = FLIP_H | FLIP_V
+ /// The image will not be flipped.
+ FLIP_NONE = 0,
+ /// The image will be flipped at the horizontal axis.
+ FLIP_H = 1,
+ /// The image will be flipped at the vertical axis.
+ FLIP_V = 2,
+ /// The image will be flipped at the horizontal and vertical axis.
+ FLIP_HV = FLIP_H | FLIP_V,
+ /// The image will be flipped at the horizontal and vertical axis.
+ FLIP_VH = FLIP_H | FLIP_V
};
enum AlphaType {
- ALPHA_OPAQUE = 0,
- ALPHA_BINARY = 1,
- ALPHA_FULL = 2
+ ALPHA_OPAQUE = 0,
+ ALPHA_BINARY = 1,
+ ALPHA_FULL = 2
};
/**
@@ -75,6 +75,18 @@ struct TransparentSurface : public Graphics::Surface {
TransparentSurface();
TransparentSurface(const Graphics::Surface &surf, bool copyData = false);
+ /**
+ * Returns the pixel format all operations of TransparentSurface support.
+ *
+ * Unlike Surface TransparentSurface only works with a fixed pixel format.
+ * This format can be queried using this static function.
+ *
+ * @return Supported pixel format.
+ */
+ static PixelFormat getSupportedPixelFormat() {
+ return PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
+ }
+
void setColorKey(char r, char g, char b);
void disableColorKey();
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 016cfc136d..536e5192e0 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -746,6 +746,7 @@ bool ThemeEngine::loadDefaultXML() {
xmllen += strlen(defaultXML[i]);
byte *tmpXML = (byte *)malloc(xmllen + 1);
+ tmpXML[0] = '\0';
for (int i = 0; i < ARRAYSIZE(defaultXML); i++)
strncat((char *)tmpXML, defaultXML[i], xmllen);
@@ -756,8 +757,6 @@ bool ThemeEngine::loadDefaultXML() {
return false;
}
- free(tmpXML);
-
_themeName = "ScummVM Classic Theme (Builtin Version)";
_themeId = "builtin";
_themeFile.clear();
@@ -765,6 +764,8 @@ bool ThemeEngine::loadDefaultXML() {
bool result = _parser->parse();
_parser->close();
+ free(tmpXML);
+
return result;
#else
warning("The built-in theme is not enabled in the current build. Please load an external theme");
@@ -1458,7 +1459,7 @@ const Graphics::Font *ThemeEngine::loadScalableFont(const Common::String &filena
for (Common::ArchiveMemberList::const_iterator i = members.begin(), end = members.end(); i != end; ++i) {
Common::SeekableReadStream *stream = (*i)->createReadStream();
if (stream) {
- font = Graphics::loadTTFFont(*stream, pointsize, 0, Graphics::kTTFRenderModeLight,
+ font = Graphics::loadTTFFont(*stream, pointsize, Graphics::kTTFSizeModeCharacter, 0, Graphics::kTTFRenderModeLight,
#ifdef USE_TRANSLATION
TransMan.getCharsetMapping()
#else
diff --git a/gui/credits.h b/gui/credits.h
index 7ae12bf599..72fe3fa951 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -77,12 +77,20 @@ static const char *credits[] = {
"C0""Ludvig Strigeus",
"C2""(retired)",
"",
+"C1""Access",
+"A0""Arnaud Boutonne",
+"C0""Arnaud Boutonn\351",
+"C0""Paul Gilbert",
+"",
"C1""Avalanche",
"A0""Peter Bozso",
"C0""Peter Bozs\363",
"A0""Arnaud Boutonne",
"C0""Arnaud Boutonn\351",
"",
+"C1""BBVS",
+"C0""Benjamin Haisch",
+"",
"C1""CGE",
"A0""Arnaud Boutonne",
"C0""Arnaud Boutonn\351",
@@ -233,6 +241,10 @@ static const char *credits[] = {
"C0""Jordi Vilalta Prat",
"C0""Lars Skovlund",
"",
+"C1""Sherlock",
+"C0""Paul Gilbert",
+"C0""Martin Kiewitz",
+"",
"C1""Sky",
"A0""Robert Goeffringmann",
"C0""Robert G\366ffringmann",
@@ -398,6 +410,9 @@ static const char *credits[] = {
"C1""Wii",
"C0""Andre Heider",
"",
+"C1""Raspberry Pi",
+"C0""Manuel Alfayate",
+"",
"",
"C1""Other subsystems",
"C1""Infrastructure",
@@ -872,5 +887,9 @@ static const char *credits[] = {
"C0""",
"C0""Bob Bell, Michel Kripalani, Tommy Yune, from Presto Studios for providing the source code of The Journeyman Project: Pegasus Prime.",
"C0""",
+"C0""Electronic Arts IP Preservation Team, particularly Stefan Serbicki, and Vasyl Tsvirkunov of Electronic Arts for providing the source code of the two Lost Files of Sherlock Holmes games. James M. Ferguson and Barry Duncan for their tenacious efforts to recover the sources.",
+"C0""",
+"C0""The mindFactory team for writing Broken Sword 2.5, a splendid fan-made sequel, and for sharing the source code with us.",
+"C0""",
"",
};
diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat
index ec86f36518..a882cf2c0b 100644
--- a/gui/themes/translations.dat
+++ b/gui/themes/translations.dat
Binary files differ
diff --git a/image/codecs/msvideo1.cpp b/image/codecs/msvideo1.cpp
index 25d7395363..439f219fc5 100644
--- a/image/codecs/msvideo1.cpp
+++ b/image/codecs/msvideo1.cpp
@@ -30,14 +30,15 @@ namespace Image {
#define CHECK_STREAM_PTR(n) \
if ((stream.pos() + n) > stream.size() ) { \
- warning ("MS Video-1: Stream out of bounds (%d >= %d)", stream.pos() + n, stream.size()); \
+ warning ("MS Video-1: Stream out of bounds (%d >= %d) d%d", stream.pos() + n, stream.size(), n); \
return; \
}
MSVideo1Decoder::MSVideo1Decoder(uint16 width, uint16 height, byte bitsPerPixel) : Codec() {
_surface = new Graphics::Surface();
- // TODO: Specify the correct pixel format for 2Bpp mode.
- _surface->create(width, height, (bitsPerPixel == 8) ? Graphics::PixelFormat::createFormatCLUT8() : Graphics::PixelFormat(2, 0, 0, 0, 0, 0, 0, 0, 0));
+ _surface->create(width, height, (bitsPerPixel == 8) ? Graphics::PixelFormat::createFormatCLUT8() :
+ Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0));
+
_bitsPerPixel = bitsPerPixel;
}
@@ -125,13 +126,98 @@ void MSVideo1Decoder::decode8(Common::SeekableReadStream &stream) {
}
}
+void MSVideo1Decoder::decode16(Common::SeekableReadStream &stream) {
+ /* decoding parameters */
+ uint16 colors[8];
+ uint16 *pixels = (uint16 *)_surface->getPixels();
+ int32 stride = _surface->w;
+
+ int32 skip_blocks = 0;
+ int32 blocks_wide = _surface->w / 4;
+ int32 blocks_high = _surface->h / 4;
+ int32 total_blocks = blocks_wide * blocks_high;
+ int32 block_inc = 4;
+ int32 row_dec = stride + 4;
+
+ for (int32 block_y = blocks_high; block_y > 0; block_y--) {
+ int32 block_ptr = ((block_y * 4) - 1) * stride;
+ for (int32 block_x = blocks_wide; block_x > 0; block_x--) {
+ /* check if this block should be skipped */
+ if (skip_blocks) {
+ block_ptr += block_inc;
+ skip_blocks--;
+ total_blocks--;
+ continue;
+ }
+
+ int32 pixel_ptr = block_ptr;
+
+ /* get the next two bytes in the encoded data stream */
+ CHECK_STREAM_PTR(2);
+ byte byte_a = stream.readByte();
+ byte byte_b = stream.readByte();
+
+ /* check if the decode is finished */
+ if ((byte_a == 0) && (byte_b == 0) && (total_blocks == 0)) {
+ return;
+ } else if ((byte_b & 0xFC) == 0x84) {
+ /* skip code, but don't count the current block */
+ skip_blocks = ((byte_b - 0x84) << 8) + byte_a - 1;
+ } else if (byte_b < 0x80) {
+ /* 2- or 8-color encoding modes */
+ uint16 flags = (byte_b << 8) | byte_a;
+
+ CHECK_STREAM_PTR(4);
+ colors[0] = stream.readUint16LE();
+ colors[1] = stream.readUint16LE();
+
+ if (colors[0] & 0x8000) {
+ /* 8-color encoding */
+ CHECK_STREAM_PTR(12);
+ colors[2] = stream.readUint16LE();
+ colors[3] = stream.readUint16LE();
+ colors[4] = stream.readUint16LE();
+ colors[5] = stream.readUint16LE();
+ colors[6] = stream.readUint16LE();
+ colors[7] = stream.readUint16LE();
+
+ for (int pixel_y = 0; pixel_y < 4; pixel_y++) {
+ for (int pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
+ pixels[pixel_ptr++] =
+ colors[((pixel_y & 0x2) << 1) +
+ (pixel_x & 0x2) + ((flags & 0x1) ^ 1)];
+ pixel_ptr -= row_dec;
+ }
+ } else {
+ /* 2-color encoding */
+ for (int pixel_y = 0; pixel_y < 4; pixel_y++) {
+ for (int pixel_x = 0; pixel_x < 4; pixel_x++, flags >>= 1)
+ pixels[pixel_ptr++] = colors[(flags & 0x1) ^ 1];
+ pixel_ptr -= row_dec;
+ }
+ }
+ } else {
+ /* otherwise, it's a 1-color block */
+ colors[0] = (byte_b << 8) | byte_a;
+
+ for (int pixel_y = 0; pixel_y < 4; pixel_y++) {
+ for (int pixel_x = 0; pixel_x < 4; pixel_x++)
+ pixels[pixel_ptr++] = colors[0];
+ pixel_ptr -= row_dec;
+ }
+ }
+
+ block_ptr += block_inc;
+ total_blocks--;
+ }
+ }
+}
+
const Graphics::Surface *MSVideo1Decoder::decodeFrame(Common::SeekableReadStream &stream) {
if (_bitsPerPixel == 8)
decode8(stream);
- else {
- // decode16(stream);
- error ("Unhandled MS Video-1 16bpp encoding");
- }
+ else
+ decode16(stream);
return _surface;
}
diff --git a/image/codecs/msvideo1.h b/image/codecs/msvideo1.h
index 2a6dcd0a9a..f52b1f3127 100644
--- a/image/codecs/msvideo1.h
+++ b/image/codecs/msvideo1.h
@@ -38,7 +38,7 @@ public:
~MSVideo1Decoder();
const Graphics::Surface *decodeFrame(Common::SeekableReadStream &stream);
- Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat::createFormatCLUT8(); }
+ Graphics::PixelFormat getPixelFormat() const { return _surface->format; }
private:
byte _bitsPerPixel;
@@ -46,7 +46,7 @@ private:
Graphics::Surface *_surface;
void decode8(Common::SeekableReadStream &stream);
- //void decode16(Common::SeekableReadStream &stream);
+ void decode16(Common::SeekableReadStream &stream);
};
} // End of namespace Image
diff --git a/po/be_BY.po b/po/be_BY.po
index 5b22098c1c..97e0c0956d 100644
--- a/po/be_BY.po
+++ b/po/be_BY.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.7.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2014-07-02 17:22+0300\n"
"Last-Translator: Ivan Lukyanov <greencis@mail.ru>\n"
"Language-Team: Ivan Lukyanov <greencis@mail.ru>\n"
@@ -54,13 +54,13 @@ msgid "Go up"
msgstr "Уверх"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -69,7 +69,7 @@ msgid "Cancel"
msgstr "Адмена"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Абраць"
@@ -89,6 +89,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Вы сапраўды жадаеце выдаліць гэта захаванне?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Так"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Не"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -386,7 +419,7 @@ msgstr "Гэты ID гульні ўжо выкарыстоўваецца. Калі ласка, абярыце іншы."
msgid "~Q~uit"
msgstr "~В~ыхад"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Завяршыць ScummVM"
@@ -394,7 +427,7 @@ msgstr "Завяршыць ScummVM"
msgid "A~b~out..."
msgstr "Пра п~р~аграму..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Пра праграму ScummVM"
@@ -492,26 +525,6 @@ msgstr ""
"Вы сапраўды жадаеце запусціць дэтэктар усіх гульняў? Гэта патэнцыяльна можа "
"дадаць вялікую колькасць гульняў."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Так"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Не"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM не можа адкрыць азначаную дырэкторыю!"
@@ -664,7 +677,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Спецыяльныя рэжымы рэндэрынгу, падтрымоўваныя некаторымі гульнямі"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Поўнаэкранны рэжым"
@@ -1131,7 +1144,7 @@ msgstr "Без графікі"
msgid "Standard Renderer"
msgstr "Стандартны растарызатар"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Стандартны"
@@ -1377,7 +1390,7 @@ msgstr "Г~а~лоўнае меню"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1390,7 +1403,7 @@ msgstr "Захаваць гульню:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1732,57 +1745,57 @@ msgstr "Сярэдняя пстрычка"
msgid "Right Click"
msgstr "Правая пстрычка"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Схаваць ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Схаваць астатнія"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Паказаць усё"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Акно"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Згарнуць"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Без павелічэння"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Без павелічэння"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Карэкцыя суадносін бакоў уключана"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Карэкцыя суадносін бакоў выключана"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Актыўны графічны фільтр:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Аконны рэжым"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (без фільтраў)"
@@ -2226,13 +2239,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Узнавіць гульню:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Узнавіць"
@@ -2772,36 +2785,36 @@ msgstr "~П~апяр"
msgid "~N~ext"
msgstr "~Н~аст"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Толькі агучка"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Агучка і субтытры"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Толькі субтытры"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Агучка і тэкст"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Абярыце ўзровень складанасці."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "За дапамогай звярніцеся да інструкцыі Loom(TM)."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Практыкант"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Эксперт"
diff --git a/po/ca_ES.po b/po/ca_ES.po
index 096990848c..a36274c660 100644
--- a/po/ca_ES.po
+++ b/po/ca_ES.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.6.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2013-05-05 14:16+0100\n"
"Last-Translator: Jordi Vilalta Prat <jvprat@jvprat.com>\n"
"Language-Team: Catalan <scummvm-devel@lists.sf.net>\n"
@@ -51,13 +51,13 @@ msgid "Go up"
msgstr "Amunt"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -66,7 +66,7 @@ msgid "Cancel"
msgstr "CancelЗla"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Escull"
@@ -86,6 +86,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Realment voleu suprimir aquesta partida?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Sэ"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "No"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -384,7 +417,7 @@ msgstr ""
msgid "~Q~uit"
msgstr "~T~anca"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Surt de ScummVM"
@@ -392,7 +425,7 @@ msgstr "Surt de ScummVM"
msgid "A~b~out..."
msgstr "~Q~uant a..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Quant a ScummVM"
@@ -492,26 +525,6 @@ msgstr ""
"Esteu segur que voleu executar el detector massiu de jocs? Aixђ pot afegir "
"una gran quantitat de jocs."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Sэ"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "No"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM no ha pogut obrir el directori especificat!"
@@ -667,7 +680,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Modes de tramat especials suportats per alguns jocs"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Mode pantalla completa"
@@ -1135,7 +1148,7 @@ msgstr "GFX desactivats"
msgid "Standard Renderer"
msgstr "Pintat estрndard (16bpp)"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Estрndard"
@@ -1385,7 +1398,7 @@ msgstr "~R~etorna al Llanчador"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1398,7 +1411,7 @@ msgstr "Desa la partida:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1736,58 +1749,58 @@ msgstr "Clic central"
msgid "Right Click"
msgstr "Clic dret"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Amaga ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Oculta els altres"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Mostra-ho tot"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Finestra"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimitza"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normal (sense escalar)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (no escalat)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "S'ha activat la correcciѓ de la relaciѓ d'aspecte"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "S'ha desactivat la correcciѓ de la relaciѓ d'aspecte"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Filtre de grрfics actiu:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Mode de finestra"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
#, fuzzy
msgid "OpenGL"
msgstr "Obre"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr ""
@@ -2230,13 +2243,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Recupera la partida:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Restaura"
@@ -2777,36 +2790,36 @@ msgstr "~A~nterior"
msgid "~N~ext"
msgstr "~S~egќent"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Nomщs veus"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Veu i subtэtols"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Nomщs subtэtols"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Veus i sub."
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Seleccioneu el nivell de competшncia."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Consulteu el manual de Loom(TM) per ajuda."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Prрctica"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Expert"
diff --git a/po/cs_CZ.po b/po/cs_CZ.po
index aa3fc856b8..56d37e7f8d 100644
--- a/po/cs_CZ.po
+++ b/po/cs_CZ.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.7.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2015-07-26 18:51+0200\n"
"Last-Translator: Zbynьk Schwarz <zbynek.schwarz@gmail.com>\n"
"Language-Team: \n"
@@ -55,13 +55,13 @@ msgid "Go up"
msgstr "Jэt nahoru"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -70,7 +70,7 @@ msgid "Cancel"
msgstr "ZruЙit"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Zvolit"
@@ -92,6 +92,39 @@ msgstr "Poznсmky:"
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Opravdu chcete tento zсznam smazat?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Ano"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Ne"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -387,7 +420,7 @@ msgstr "Toto ID hry je uО zabranщ. Vyberte si, prosэm, jinщ."
msgid "~Q~uit"
msgstr "~U~konшit"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Ukonшit ScummVM"
@@ -395,7 +428,7 @@ msgstr "Ukonшit ScummVM"
msgid "A~b~out..."
msgstr "~O~ Programu..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "O ScummVM"
@@ -493,26 +526,6 @@ msgstr ""
"Opravdu chcete spustit hromadnou detekci her? Toto by mohlo potenciсlnь "
"pјidat velkou spoustu her. "
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Ano"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Ne"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM nemohl tento adresсј otevјэt!"
@@ -665,7 +678,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Speciсlnэ reОimy chvьnэ podporovanщ nьkter§mi hrami"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "ReОim celщ obrazovky"
@@ -1126,7 +1139,7 @@ msgstr "GFX zakсzсno"
msgid "Standard Renderer"
msgstr "Standardnэ Vykreslovaш"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Standardnэ"
@@ -1373,7 +1386,7 @@ msgstr "~N~сvrat do SpouЙtьшe"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1386,7 +1399,7 @@ msgstr "UloОit hru:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1725,57 +1738,57 @@ msgstr "Kliknutэ prostјednэm tlaшэtkem"
msgid "Right Click"
msgstr "Pravщ kliknutэ"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Skr§t ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Skr§t Ostatnэ"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Zobrazit VЙe"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Okno"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimalizovat"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normсlnэ (bez zmьny velikosti)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normсlnэ (bez zmьny velikosti)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Povolena korekce pomьru stran"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Zakсzсna korekce pomьru stran"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Aktivnэ grafick§ filtr:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "ReОim do okna"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (bez filtrovсnэ)"
@@ -2221,13 +2234,13 @@ msgstr ""
"nabэdek."
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Obnovit hru"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Obnovit"
@@ -2772,36 +2785,36 @@ msgstr "~P~јedchozэ"
msgid "~N~ext"
msgstr "~D~alЙэ"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Pouze иeш"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "иeш a Titulky"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Pouze Titulky"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "иeш a Titulky"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Vyberte њroveђ odbornosti."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Pro nсpovьdu si pјeшtьte manuсl Loom(TM)."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Cviшenэ"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Pokroшil§"
diff --git a/po/da_DA.po b/po/da_DA.po
index 0da2db01f3..a78552ea8f 100644
--- a/po/da_DA.po
+++ b/po/da_DA.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2014-07-09 17:34+0100\n"
"Last-Translator: Steffen Nyeland <steffen@nyeland.dk>\n"
"Language-Team: Steffen Nyeland <steffen@nyeland.dk>\n"
@@ -53,13 +53,13 @@ msgid "Go up"
msgstr "Gх op"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -68,7 +68,7 @@ msgid "Cancel"
msgstr "Fortryd"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Vцlg"
@@ -88,6 +88,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Vil du virkelig slette denne gemmer?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Ja"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Nej"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -385,7 +418,7 @@ msgstr "Dette spil ID er allerede i brug. Vцlg venligst et andet."
msgid "~Q~uit"
msgstr "~A~fslut"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Slut ScummVM"
@@ -393,7 +426,7 @@ msgstr "Slut ScummVM"
msgid "A~b~out..."
msgstr "~O~m..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Om ScummVM"
@@ -491,26 +524,6 @@ msgstr ""
"Vil du virkelig kјre fler spils detektoren? Dette kunne potentielt tilfјje "
"et stort antal spil."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Ja"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Nej"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM kunne ikke хbne det angivne bibliotek!"
@@ -664,7 +677,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Speciel farvereduceringstilstand understјttet a nogle spil"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Fuldskцrms tilstand"
@@ -1125,7 +1138,7 @@ msgstr "Deaktiveret GFX"
msgid "Standard Renderer"
msgstr "Standard renderer"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Standard"
@@ -1373,7 +1386,7 @@ msgstr "~R~etur til oversigt"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1386,7 +1399,7 @@ msgstr "Gemmer:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1725,57 +1738,57 @@ msgstr "Miderste klik"
msgid "Right Click"
msgstr "Hјjre klik"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Skjul ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Skjul andre"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Vis alle"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Vindue"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimer"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normal (ingen skalering)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (ingen skalering)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Aktivщr billedformat korrektion"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Deaktivщr billedformat korrektion"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Aktive grafik filtre:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Vindue tilstand"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (Ingen filtrering)"
@@ -2218,13 +2231,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Gendan spil:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Gendan"
@@ -2762,36 +2775,36 @@ msgstr "Fo~r~rige"
msgid "~N~ext"
msgstr "~N~цste"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Kun tale"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Tale og Undertekster"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Kun undertekster"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Tale & Tekst"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Vцlg et Fцrdighedsniveau."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Se din Loom(TM) manual for hjцlp."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Trцning"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Ekspert"
diff --git a/po/de_DE.po b/po/de_DE.po
index 60fd903be9..53a46373b3 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.8.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2015-10-16 11:00+0200\n"
"Last-Translator: Lothar Serra Mari <scummvm@rootfather.de>\n"
"Language-Team: Simon Sawatzki <SimSaw@gmx.de>, Lothar Serra Mari "
@@ -55,13 +55,13 @@ msgid "Go up"
msgstr "Pfad hoch"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -70,7 +70,7 @@ msgid "Cancel"
msgstr "Abbrechen"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Auswфhlen"
@@ -90,6 +90,39 @@ msgstr "Notizen:"
msgid "Ok"
msgstr "OK"
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Mіchten Sie diese Aufnahme wirklich lіschen?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Ja"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Nein"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -387,7 +420,7 @@ msgstr "Diese Spielkennung ist schon vergeben. Bitte eine andere wфhlen."
msgid "~Q~uit"
msgstr "~B~eenden"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "ScummVM beenden"
@@ -395,7 +428,7 @@ msgstr "ScummVM beenden"
msgid "A~b~out..."
msgstr "мbe~r~"
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "мber ScummVM"
@@ -495,26 +528,6 @@ msgstr ""
"Mіchten Sie wirklich den PC nach Spielen durchsuchen? Mіglicherweise wird "
"dabei eine grіпere Menge an Spielen hinzugefќgt."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Ja"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Nein"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM konnte das gewфhlte Verzeichnis nicht іffnen!"
@@ -668,7 +681,7 @@ msgstr ""
"Spezielle Farbmischungsmethoden werden von manchen Spielen unterstќtzt."
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Vollbildmodus"
@@ -1136,7 +1149,7 @@ msgstr "GFX ausgeschaltet"
msgid "Standard Renderer"
msgstr "Standard-Renderer"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Standard"
@@ -1387,7 +1400,7 @@ msgstr "Zur Spiele~l~iste"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1400,7 +1413,7 @@ msgstr "Speichern:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1742,57 +1755,57 @@ msgstr "Mittelklick"
msgid "Right Click"
msgstr "Rechtsklick"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "ScummVM ausblenden"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Andere ausblenden"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Alle einblenden"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Fenster"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimieren"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normal (keine Skalierung)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal ohn.Skalieren"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Seitenverhфltniskorrektur an"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Seitenverhфltniskorrektur aus"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Aktiver Grafikfilter:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Fenstermodus"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (ohne Filter)"
@@ -1842,8 +1855,9 @@ msgstr "Schneller Modus"
#: backends/platform/symbian/src/SymbianActions.cpp:52
#: backends/platform/wince/CEActionsPocket.cpp:44
#: backends/platform/wince/CEActionsSmartphone.cpp:52
-#: backends/events/default/default-events.cpp:218 engines/scumm/dialogs.cpp:192
-#: engines/scumm/help.cpp:83 engines/scumm/help.cpp:85
+#: backends/events/default/default-events.cpp:218
+#: engines/scumm/dialogs.cpp:192 engines/scumm/help.cpp:83
+#: engines/scumm/help.cpp:85
msgid "Quit"
msgstr "Beenden"
@@ -2238,13 +2252,13 @@ msgstr ""
"und in Menќs innerhalb des Spiels."
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Spiel laden:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Laden"
@@ -2804,36 +2818,36 @@ msgstr "~Z~urќck"
msgid "~N~ext"
msgstr "~W~eiter"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Nur Sprache"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Sprachausgabe und Untertitel"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Nur Untertitel"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Sprache & Text"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Wфhle einen Schwierigkeitsgrad."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Fќr Hilfe schauen Sie ins Loom-Handbuch."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Anfфnger"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Experte"
diff --git a/po/es_ES.po b/po/es_ES.po
index 9d2e236d46..87f165d03f 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.4.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2014-07-06 20:39+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -52,13 +52,13 @@ msgid "Go up"
msgstr "Arriba"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -67,7 +67,7 @@ msgid "Cancel"
msgstr "Cancelar"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Aceptar"
@@ -87,6 +87,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "ПSeguro que quieres borrar esta partida?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Sэ"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "No"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -384,7 +417,7 @@ msgstr "Esta ID ya estс siendo usada. Por favor, elige otra."
msgid "~Q~uit"
msgstr "~S~alir"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Salir de ScummVM"
@@ -392,7 +425,7 @@ msgstr "Salir de ScummVM"
msgid "A~b~out..."
msgstr "Acerca ~d~e"
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Acerca de ScummVM"
@@ -490,26 +523,6 @@ msgstr ""
"ПSeguro que quieres ejecutar la detecciѓn masiva? Puede que se aёada un gran "
"nњmero de juegos."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Sэ"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "No"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ЁScummVM no ha podido abrir el directorio!"
@@ -663,7 +676,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Modos especiales de expansiѓn compatibles con algunos juegos"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Pantalla completa"
@@ -1132,7 +1145,7 @@ msgstr "Grсf. desactivados"
msgid "Standard Renderer"
msgstr "Estсndar"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Estсndar"
@@ -1379,7 +1392,7 @@ msgstr "~V~olver al lanzador"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1392,7 +1405,7 @@ msgstr "Guardar partida"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1733,57 +1746,57 @@ msgstr "Clic central"
msgid "Right Click"
msgstr "Clic derecho"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Ocultar ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Ocultar otros"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Mostrar todo"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Ventana"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimizar"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normal (sin reescalado)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Activar la correcciѓn de aspecto"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Desactivar la correcciѓn de aspecto"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Filtro de grсficos activo:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Modo ventana"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (sin filtros)"
@@ -2228,13 +2241,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Cargar partida:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Cargar"
@@ -2774,36 +2787,36 @@ msgstr "~A~nterior"
msgid "~N~ext"
msgstr "Si~g~uiente"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Solo voces"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Voces y subtэtulos"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Solo subtэtulos"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Voces y sub."
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Selecciona un nivel de dificultad."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Consulta el manual para obtener mсs informaciѓn."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Prсctica"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Experto"
diff --git a/po/eu.po b/po/eu.po
index 97e13810e5..dcaa1f296d 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.5.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2011-12-15 14:53+0100\n"
"Last-Translator: Mikel Iturbe Urretxa <mikel@hamahiru.org>\n"
"Language-Team: Librezale <librezale@librezale.org>\n"
@@ -52,13 +52,13 @@ msgid "Go up"
msgstr "Joan gora"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -67,7 +67,7 @@ msgid "Cancel"
msgstr "Utzi"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Aukeratu"
@@ -87,6 +87,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Ezabatu partida gorde hau?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Bai"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Ez"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -384,7 +417,7 @@ msgstr "ID hau jada erabilia izaten ari da. Mesedez, aukeratu beste bat."
msgid "~Q~uit"
msgstr "~I~rten"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Irten ScummVM-tik"
@@ -392,7 +425,7 @@ msgstr "Irten ScummVM-tik"
msgid "A~b~out..."
msgstr "Ho~n~i buruz..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "ScummVM-i buruz"
@@ -490,26 +523,6 @@ msgstr ""
"Joko detektatzaile masiboa exekutatu nahi al duzu? Honek joko kantitate "
"handia gehitu dezake."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Bai"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Ez"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM-k ezin izan du zehazturiko direktorioa ireki!"
@@ -667,7 +680,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Joko batzuk onarturiko lausotze-modu bereziak"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Pantaila osoa"
@@ -1136,7 +1149,7 @@ msgstr "GFX desgaituta"
msgid "Standard Renderer"
msgstr "Estandarra (16bpp)"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Estandarra"
@@ -1387,7 +1400,7 @@ msgstr "It~z~uli abiarazlera"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1400,7 +1413,7 @@ msgstr "Gorde jokoa:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1738,58 +1751,58 @@ msgstr "Erdiko klika"
msgid "Right Click"
msgstr "Eskuin-klika"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "ScummVM ezkutatu"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Besteak ezkutatu"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Denak erakutsi"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Leihoa"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimizatu"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normala (eskalatu gabe)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normala"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Formatu-ratio zuzenketa gaituta"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Formatu-ratio zuzenketa desgaituta"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Filtro grafiko aktiboa:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Leiho modua"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
#, fuzzy
msgid "OpenGL"
msgstr "Ireki"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr ""
@@ -2231,13 +2244,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Jokoa kargatu:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Kargatu"
@@ -2780,36 +2793,36 @@ msgstr "~A~urrekoa"
msgid "~N~ext"
msgstr "~H~urrengoa"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Ahotsak bakarrik"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Ahotsak eta azpitituluak"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Azpitituluak bakarrik"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Ahotsak & azpit."
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Zailtasuna aukeratu."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Loom(TM)-ko eskuliburura jo ezazu laguntza lortzeko."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Entrenamendua"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Aditua"
diff --git a/po/fi_FI.po b/po/fi_FI.po
index aeed76304e..1f9b99ff7f 100644
--- a/po/fi_FI.po
+++ b/po/fi_FI.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.6.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2012-12-01 19:37+0200\n"
"Last-Translator: Toni Saarela <saarela@gmail.com>\n"
"Language-Team: Finnish\n"
@@ -53,13 +53,13 @@ msgid "Go up"
msgstr "Siirry ylіs"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -68,7 +68,7 @@ msgid "Cancel"
msgstr "Peruuta"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Valitse"
@@ -88,6 +88,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Haluatko varmasti poistaa tфmфn pelitallennuksen?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Kyllф"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Ei"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -385,7 +418,7 @@ msgstr "Pelin tunnus on jo kфytіssф. Valitse jokin muu."
msgid "~Q~uit"
msgstr "~L~opeta"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Lopeta ScummVM"
@@ -393,7 +426,7 @@ msgstr "Lopeta ScummVM"
msgid "A~b~out..."
msgstr "Tietoa..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Tietoa ScummVM:stф"
@@ -491,26 +524,6 @@ msgstr ""
"Haluatko varmasti lisфtф pelejф alihakemistoineen? Tфmф voi lisфtф suuren "
"mффrфn pelejф."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Kyllф"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Ei"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM ei voi avata kyseistф hakemistoa!"
@@ -668,7 +681,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Erityiset dithering asetukset joita jotkut pelit tukevat"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Kokoruututila"
@@ -1134,7 +1147,7 @@ msgstr "Disabloitu GFX"
msgid "Standard Renderer"
msgstr "Standardirenderіijф (16 bpp)"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Standardi"
@@ -1387,7 +1400,7 @@ msgstr "Palaa p~e~livalitsimeen"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1400,7 +1413,7 @@ msgstr "Tallenna peli:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1738,58 +1751,58 @@ msgstr "Keskiklikkaus"
msgid "Right Click"
msgstr "Oikea klikkaus"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Piilota ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Piilota muut"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Nфytф kaikki"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Ikkuna"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimoi"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normaali (ei skaalausta)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normaali (ei skaalausta)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Kuvasuhteen korjaus pффllф"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Kuvasuhteen korjaus pois pффltф"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Valittu grafiikkafiltteri:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Ikkunoitu tila"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
#, fuzzy
msgid "OpenGL"
msgstr "Avaa"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr ""
@@ -2234,13 +2247,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Lataa pelitallenne:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Lataa tallenne"
@@ -2774,36 +2787,36 @@ msgstr "E~d~ellinen"
msgid "~N~ext"
msgstr "Se~u~raava"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Vain puhe"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Puhe ja Tekstitys"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Vain tekstitys"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Puhe & teksti"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Valitse taitotasosi."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Lue Loom(TM) ohjekirjaa saadaksesi ohjeita."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Harjoitus"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Ekspertti"
diff --git a/po/fr_FR.po b/po/fr_FR.po
index c6b785c794..c34836e324 100644
--- a/po/fr_FR.po
+++ b/po/fr_FR.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2014-07-05 13:49-0000\n"
"Last-Translator: Thierry Crozat <criezy@scummvm.org>\n"
"Language-Team: French <scummvm-devel@lists.sf.net>\n"
@@ -53,13 +53,13 @@ msgid "Go up"
msgstr "Remonter"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -68,7 +68,7 @@ msgid "Cancel"
msgstr "Annuler"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Choisir"
@@ -88,6 +88,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Voulez-vous vraiment supprimer cette sauvegarde ?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Oui"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Non"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -385,7 +418,7 @@ msgstr "Cet ID est dщjр utilisщ par un autre jeu. Choisissez en un autre svp."
msgid "~Q~uit"
msgstr "~Q~uitter"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Quitter ScummVM"
@@ -393,7 +426,7 @@ msgstr "Quitter ScummVM"
msgid "A~b~out..."
msgstr "Р ~P~ropos..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Р propos de ScummVM"
@@ -492,26 +525,6 @@ msgstr ""
"Voulez-vous vraiment lancer la dщtection automatique des jeux ? Cela peut "
"potentiellement ajouter un grand nombre de jeux."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Oui"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Non"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM n'a pas pu ouvrir le rщpertoire sщlectionnщ."
@@ -666,7 +679,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Mode spщcial de tramage supportщ par certains jeux"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Plein щcran"
@@ -1138,7 +1151,7 @@ msgstr "GFX dщsactivщ"
msgid "Standard Renderer"
msgstr "Rendu Standard"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Normal"
@@ -1386,7 +1399,7 @@ msgstr "Retour au ~L~anceur"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1399,7 +1412,7 @@ msgstr "Sauvegarde:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1738,57 +1751,57 @@ msgstr "Clic Milieu"
msgid "Right Click"
msgstr "Clic Droit"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Masquer ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Masquer les autres"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Tout afficher"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Fenъtre"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Placer dans le Dock"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normal (щchelle d'origine)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Activer la correction du rapport d'aspect"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Dщsactiver la correction du rapport d'aspect"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Mode graphique actif:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Mode Fenъtre"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (sans filtre)"
@@ -2234,13 +2247,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Charger le jeu:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Charger"
@@ -2781,36 +2794,36 @@ msgstr "~P~rщcщdent"
msgid "~N~ext"
msgstr "~S~uivant"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Voix"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Voix et Sous-titres"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Sous-titres"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Voix & ST"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Sщlectionnez un niveau de compщtence."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Reportez-vous р votre manuel d'instruction."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Essai"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Expert"
diff --git a/po/gl_ES.po b/po/gl_ES.po
index 905c87d316..ca9a698b84 100644
--- a/po/gl_ES.po
+++ b/po/gl_ES.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.6.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2014-07-02 09:51+0100\n"
"Last-Translator: Santiago G. Sanz <s.sanz@uvigo.es>\n"
"Language-Team: Santiago G. Sanz <s.sanz@uvigo.es>\n"
@@ -52,13 +52,13 @@ msgid "Go up"
msgstr "Arriba"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -67,7 +67,7 @@ msgid "Cancel"
msgstr "Cancelar"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Elixir"
@@ -87,6 +87,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Seguro que queres eliminar esta partida?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Si"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Non"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -382,7 +415,7 @@ msgstr "Este ID de xogo xa estс en uso. Selecciona outro."
msgid "~Q~uit"
msgstr "~S~aэr"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Saэr de ScummVM"
@@ -390,7 +423,7 @@ msgstr "Saэr de ScummVM"
msgid "A~b~out..."
msgstr "Ace~r~ca de..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Acerca de ScummVM"
@@ -488,26 +521,6 @@ msgstr ""
"Queres executar o detector de xogos en masa? Щ posible que se engada un gran "
"nњmero de xogos."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Si"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Non"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM non foi quen de abrir o directorio!"
@@ -660,7 +673,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Modos de interpolaciѓn de cores compatibles con algњns xogos"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Pantalla completa"
@@ -1125,7 +1138,7 @@ msgstr "Efectos desactivados"
msgid "Standard Renderer"
msgstr "Procesamento estсndar"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Estсndar"
@@ -1373,7 +1386,7 @@ msgstr "~V~olver ao Iniciador"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1386,7 +1399,7 @@ msgstr "Gardar partida:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1725,57 +1738,57 @@ msgstr "Botѓn central"
msgid "Right Click"
msgstr "Botѓn secundario"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Ocultar ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Ocultar outros"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Mostrar todo"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Ventс"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimizar"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normal (sen escala)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (sen escala)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Correcciѓn de proporciѓn activada"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Correcciѓn de proporciѓn desactivada"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Filtro de grсficos activo:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Modo en ventс"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (Sen filtraxe)"
@@ -2218,13 +2231,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Restaurar xogo:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Restaurar"
@@ -2764,36 +2777,36 @@ msgstr "~A~nterior"
msgid "~N~ext"
msgstr "~S~eguinte"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Sѓ voz"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Voz e subtэtulos"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Sѓ subtэtulos"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Voz e subs"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Selecciona un nivel de habilidade."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Consulta o manual de Loom(TM) para obter axuda."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Prсctica"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Experto"
diff --git a/po/hu_HU.po b/po/hu_HU.po
index 89538e9f61..4ed16eba2a 100644
--- a/po/hu_HU.po
+++ b/po/hu_HU.po
@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
-"PO-Revision-Date: 2015-10-12 11:10+0200\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
+"PO-Revision-Date: 2015-12-23 05:02+0100\n"
"Last-Translator: George Kormendi <grubycza@hotmail.com>\n"
"Language-Team: Hungarian\n"
"Language: Magyar\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SourceCharset: iso-8859-1\n"
-"X-Generator: Poedit 1.8.5\n"
+"X-Generator: Poedit 1.8.6\n"
#: gui/about.cpp:94
#, c-format
@@ -54,13 +54,13 @@ msgid "Go up"
msgstr "Feljebb"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -69,7 +69,7 @@ msgid "Cancel"
msgstr "Mщgse"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Vсlaszt"
@@ -89,6 +89,38 @@ msgstr "Megjegyzщs:"
msgid "Ok"
msgstr "Ok"
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr "Vсlassz betіltendѕ fсjlt"
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr "Эrd be a fсjlnevet mentщshez"
+
+#: gui/filebrowser-dialog.cpp:132
+msgid "Do you really want to overwrite the file?"
+msgstr "Biztos hogy felќl akarod эrni a fсjlt?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Igen"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Nem"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -175,7 +207,8 @@ msgid ""
"Short game identifier used for referring to saved games and running the game "
"from the command line"
msgstr ""
-"Rіvid jсtщkazonosэtѓ a jсtщkmentщsekhez щs a jсtщk parancssori futtatсsсhoz"
+"Rіvid jсtщkazonosэtѓ a jсtщkmentщsekhez щs a jсtщk parancssori "
+"futtatсsсhoz"
#: gui/launcher.cpp:199
msgctxt "lowres"
@@ -200,7 +233,8 @@ msgid ""
"Language of the game. This will not turn your Spanish game version into "
"English"
msgstr ""
-"A jсtщk nyelve. Ne сllэtsd сt a pl. Spanyol nyelvћ jсtщkodat Angol nyelvre"
+"A jсtщk nyelve. Ne сllэtsd сt a pl. Spanyol nyelvћ jсtщkodat Angol "
+"nyelvre"
#: gui/launcher.cpp:212 gui/launcher.cpp:226 gui/options.cpp:87
#: gui/options.cpp:735 gui/options.cpp:748 gui/options.cpp:1208
@@ -384,7 +418,7 @@ msgstr "Ez a jсtщkazonosэtѓ ID mсr foglalt, Vсlassz egy mсsikat."
msgid "~Q~uit"
msgstr "Kilщpщs"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "ScummVM bezсrсsa"
@@ -392,7 +426,7 @@ msgstr "ScummVM bezсrсsa"
msgid "A~b~out..."
msgstr "Nщvjegy"
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "ScummVM nщvjegy"
@@ -487,28 +521,8 @@ msgid ""
"Do you really want to run the mass game detector? This could potentially add "
"a huge number of games."
msgstr ""
-"Biztos hogy futtatod a Masszэv jсtщkdetektort? Ez potenciсlisan sok jсtщkot "
-"hozzсad a listсhoz."
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Igen"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Nem"
+"Biztos hogy futtatod a Masszэv jсtщkdetektort? Ez potenciсlisan sok "
+"jсtщkot hozzсad a listсhoz."
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
@@ -532,12 +546,14 @@ msgstr "Akarod hogy betіltщsem a jсtщkсllсst?"
#: gui/launcher.cpp:1048
msgid "This game does not support loading games from the launcher."
-msgstr "Ez a jсtщk nem tсmogatja a jсtщkсllсs betіltщst az indэtѓbѓl."
+msgstr ""
+"Ez a jсtщk nem tсmogatja a jсtщkсllсs betіltщst az indэtѓbѓl."
#: gui/launcher.cpp:1052
msgid "ScummVM could not find any engine capable of running the selected game!"
msgstr ""
-"ScummVM nem talсlt olyan jсtщkmotort ami a vсlasztott jсtщkot tсmogatja!"
+"ScummVM nem talсlt olyan jсtщkmotort ami a vсlasztott jсtщkot "
+"tсmogatja!"
#: gui/launcher.cpp:1159
msgid "Mass Add..."
@@ -558,7 +574,8 @@ msgstr "Vizsgсlat kщsz!"
#: gui/massadd.cpp:262
#, c-format
msgid "Discovered %d new games, ignored %d previously added games."
-msgstr "%d њj jсtщkot talсltam, %d elѕzѕleg hozzсadott jсtщk kihagyva..."
+msgstr ""
+"%d њj jсtщkot talсltam, %d elѕzѕleg hozzсadott jсtщk kihagyva..."
#: gui/massadd.cpp:266
#, c-format
@@ -568,7 +585,8 @@ msgstr "%d Mappa сtvizsgсlva..."
#: gui/massadd.cpp:269
#, c-format
msgid "Discovered %d new games, ignored %d previously added games ..."
-msgstr "%d њj jсtщkot talсltam, %d elѕzѕleg hozzсadott jсtщk kihagyva..."
+msgstr ""
+"%d њj jсtщkot talсltam, %d elѕzѕleg hozzсadott jсtщk kihagyva..."
#: gui/onscreendialog.cpp:101 gui/onscreendialog.cpp:103
msgid "Stop"
@@ -661,7 +679,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Nщhсny jсtщk tсmogatja a speciсlis сrnyalсsi mѓdokat"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Teljeskщpernyѕs mѓd:"
@@ -716,7 +734,8 @@ msgid ""
"Higher value specifies better sound quality but may be not supported by your "
"soundcard"
msgstr ""
-"Nagyobb щrtщkek jobb hangminѕsщget adnak, de nem minden hangkсrtya tсmogatja"
+"Nagyobb щrtщkek jobb hangminѕsщget adnak, de nem minden hangkсrtya "
+"tсmogatja"
#: gui/options.cpp:820
msgid "GM Device:"
@@ -741,7 +760,8 @@ msgstr "SoundFont:"
#: gui/options.cpp:854 gui/options.cpp:856 gui/options.cpp:857
msgid "SoundFont is supported by some audio cards, FluidSynth and Timidity"
msgstr ""
-"Nщhсny hangkсrya, FluidSynth щs Timidyti tсmogatja a SoundFont betіltщsщt"
+"Nщhсny hangkсrya, FluidSynth щs Timidyti tсmogatja a SoundFont "
+"betіltщsщt"
#: gui/options.cpp:856
msgctxt "lowres"
@@ -770,7 +790,8 @@ msgstr "MT-32 Eszkіz:"
#: gui/options.cpp:879
msgid "Specifies default sound device for Roland MT-32/LAPC1/CM32l/CM64 output"
-msgstr "Roland MT-32/LAPC1/CM32l/CM64 alapщrtelmezett hangeszkіzіk beсllэtсsa"
+msgstr ""
+"Roland MT-32/LAPC1/CM32l/CM64 alapщrtelmezett hangeszkіzіk beсllэtсsa"
#: gui/options.cpp:884
msgid "True Roland MT-32 (disable GM emulation)"
@@ -781,8 +802,8 @@ msgid ""
"Check if you want to use your real hardware Roland-compatible sound device "
"connected to your computer"
msgstr ""
-"Jelіld be, ha hardveres Roland-Kompatibilis hangeszkіz van csatlakoztatva a "
-"gщpedhez щs hasznсlni akarod"
+"Jelіld be, ha hardveres Roland-Kompatibilis hangeszkіz van csatlakoztatva "
+"a gщpedhez щs hasznсlni akarod"
#: gui/options.cpp:886
msgctxt "lowres"
@@ -798,8 +819,8 @@ msgid ""
"Check if you want to enable patch mappings to emulate an MT-32 on a Roland "
"GS device"
msgstr ""
-"Ellenѕrzщs ha engedщlyezni akarod az emulсlt MT-32 Folt lekщpezщst a Roland "
-"GS eszkіzіn"
+"Ellenѕrzщs ha engedщlyezni akarod az emulсlt MT-32 Folt lekщpezщst a "
+"Roland GS eszkіzіn"
#: gui/options.cpp:898
msgid "Don't use Roland MT-32 music"
@@ -1118,7 +1139,7 @@ msgstr "GFX letiltva"
msgid "Standard Renderer"
msgstr "Standard lekщpezѕ"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Сtlagos"
@@ -1218,7 +1239,8 @@ msgstr "Minden FluidSynth beсllэtсs alapщrtelmezett щrtщkre."
msgid ""
"Do you really want to reset all FluidSynth settings to their default values?"
msgstr ""
-"Biztos visszaсllэtassz minden FluidSynth beсllэtсst alapщrtelmezett щrtщkre?"
+"Biztos visszaсllэtassz minden FluidSynth beсllэtсst alapщrtelmezett "
+"щrtщkre?"
#: base/main.cpp:228
#, c-format
@@ -1250,7 +1272,8 @@ msgstr "Hiba a jсtщk futtatсsakor:"
#: base/main.cpp:554
msgid "Could not find any engine capable of running the selected game"
-msgstr "Nem talсlhatѓ olyan jсtщkmotor ami a vсlasztott jсtщkot tсmogatja"
+msgstr ""
+"Nem talсlhatѓ olyan jсtщkmotor ami a vсlasztott jсtщkot tсmogatja"
#: common/error.cpp:38
msgid "No error"
@@ -1323,7 +1346,8 @@ msgstr "A '%s' jсtщk ismeretlennek tћnik."
#: engines/advancedDetector.cpp:318
msgid "Please, report the following data to the ScummVM team along with name"
-msgstr "Kщrlek jelezd a ScummVM csapatnak a kіvetkezѕ adatokat, egyќtt a jсtщk"
+msgstr ""
+"Kщrlek jelezd a ScummVM csapatnak a kіvetkezѕ adatokat, egyќtt a jсtщk"
#: engines/advancedDetector.cpp:320
msgid "of the game you tried to add and its version/language/etc.:"
@@ -1364,7 +1388,7 @@ msgstr "Visszatщrщs az indэtѓba"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1377,7 +1401,7 @@ msgstr "Jсtщk mentщse:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1389,8 +1413,9 @@ msgid ""
"the README for basic information, and for instructions on how to obtain "
"further assistance."
msgstr ""
-"Sajnсlom, a motor jelenleg nem tartalmaz jсtщk kіzbeni sњgѓt. Olvassd el a "
-"README-t az alap informсciѓkrѓl, щs hogy hogyan segэthetsz a kщsѕbbiekben."
+"Sajnсlom, a motor jelenleg nem tartalmaz jсtщk kіzbeni sњgѓt. Olvassd "
+"el a README-t az alap informсciѓkrѓl, щs hogy hogyan segэthetsz a "
+"kщsѕbbiekben."
#: engines/dialogs.cpp:234 engines/pegasus/pegasus.cpp:393
#, c-format
@@ -1465,8 +1490,8 @@ msgid ""
"Gamestate load failed (%s)! Please consult the README for basic information, "
"and for instructions on how to obtain further assistance."
msgstr ""
-"(%s) jсtщkсllсs betіltщse nem sikerќlt!. Olvassd el a README-t az alap "
-"informсciѓkrѓl, щs hogy hogyan segэthetsz a kщsѕbbiekben."
+"(%s) jсtщkсllсs betіltщse nem sikerќlt!. Olvassd el a README-t az "
+"alap informсciѓkrѓl, щs hogy hogyan segэthetsz a kщsѕbbiekben."
#: engines/engine.cpp:480
msgid ""
@@ -1475,8 +1500,8 @@ msgid ""
"not work in future versions of ScummVM."
msgstr ""
"FIGYELEM: A jсtщkot amit indэtani akarsz mщg nem teljesen tсmogatotja a "
-"ScummVM. Szсmэts rс hogy nem stabilan fut, щs a mentщsek nem mћkіdnek a "
-"jіvѕbeni ScummVM verziѓkkal."
+"ScummVM. Szсmэts rс hogy nem stabilan fut, щs a mentщsek nem mћkіdnek "
+"a jіvѕbeni ScummVM verziѓkkal."
#: engines/engine.cpp:483
msgid "Start anyway"
@@ -1500,7 +1525,8 @@ msgid ""
"The selected audio device '%s' was not found (e.g. might be turned off or "
"disconnected)."
msgstr ""
-"A kivсlasztott '%s' hangeszkіz nem talсlhatѓ (Lekapcsoltad, vagy kihњztad)."
+"A kivсlasztott '%s' hangeszkіz nem talсlhatѓ (Lekapcsoltad, vagy "
+"kihњztad)."
#: audio/mididrv.cpp:209 audio/mididrv.cpp:221 audio/mididrv.cpp:257
#: audio/mididrv.cpp:272
@@ -1522,7 +1548,8 @@ msgid ""
"The preferred audio device '%s' was not found (e.g. might be turned off or "
"disconnected)."
msgstr ""
-"Az elsѕdleges '%s' hangeszkіz nem talсlhatѓ (Lekapcsoltad, vagy kihњztad)."
+"Az elsѕdleges '%s' hangeszkіz nem talсlhatѓ (Lekapcsoltad, vagy "
+"kihњztad)."
#: audio/mididrv.cpp:272
#, c-format
@@ -1713,57 +1740,57 @@ msgstr "Kіzщpsѕ katt"
msgid "Right Click"
msgstr "Jobb katt"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "ScummVM elrejtщse"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Tіbbi elrejtщse"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Mutasd mind"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Ablak"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Kis mщret"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normсl (nincs сtmщretezщs)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normсl (nincs сtmщretezщs)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Mщretarсny korrekciѓ engedщlyezve"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Mщretarсny korrekciѓ letiltva"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Aktэv grafikus szћrѕk:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Ablakos mѓd"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (Nincs szћrщs)"
@@ -2079,8 +2106,8 @@ msgstr "Kicsinyэtщs mћvelet (opcionсlis)"
msgid ""
"Don't forget to map a key to 'Hide Toolbar' action to see the whole inventory"
msgstr ""
-"Ne felejts billentyћt tсrsэtani az 'Eszkіztсr rejtщs' mћvelethez, hogy lсsd "
-"a teljes listсt"
+"Ne felejts billentyћt tсrsэtani az 'Eszkіztсr rejtщs' mћvelethez, hogy "
+"lсsd a teljes listсt"
#: backends/events/default/default-events.cpp:196
msgid "Do you really want to return to the Launcher?"
@@ -2179,7 +2206,8 @@ msgstr "Eredeti ment/tіlt kщpernyѕk hasznсlata"
#: engines/dreamweb/detection.cpp:48 engines/neverhood/detection.cpp:161
#: engines/sci/detection.cpp:395 engines/toltecs/detection.cpp:201
msgid "Use the original save/load screens, instead of the ScummVM ones"
-msgstr "Az eredeti mentщs/betіltщs kщpernyѕ hasznсlata a ScummVM kщpek helyett"
+msgstr ""
+"Az eredeti mentщs/betіltщs kщpernyѕ hasznсlata a ScummVM kщpek helyett"
#: engines/agi/detection.cpp:157
msgid "Use an alternative palette"
@@ -2190,8 +2218,8 @@ msgid ""
"Use an alternative palette, common for all Amiga games. This was the old "
"behavior"
msgstr ""
-"Alternatэv paletta hasznсlat, kіzіs minden Amiga jсtщknсl. Ez egy rщgi "
-"megoldсs"
+"Alternatэv paletta hasznсlat, kіzіs minden Amiga jсtщknсl. Ez egy "
+"rщgi megoldсs"
#: engines/agi/detection.cpp:167
msgid "Mouse support"
@@ -2201,17 +2229,17 @@ msgstr "Egщr tсmogatсs"
msgid ""
"Enables mouse support. Allows to use mouse for movement and in game menus."
msgstr ""
-"Egщrmѓd engщlyezve. Lehetѕvщ teszi az egщrrel mozgatсst jсtщkban щs "
-"jсtщkmenќkben."
+"Egщrmѓd engщlyezve. Lehetѕvщ teszi az egщrrel mozgatсst jсtщkban "
+"щs jсtщkmenќkben."
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Jсtщkmenet visszaсllэtсsa:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Visszaсllэtсs"
@@ -2272,12 +2300,13 @@ msgid ""
"Press OK to convert them now, otherwise you will be asked again the next "
"time you start the game.\n"
msgstr ""
-"ScummVM rщgi jсtщkmentщst talсlt a Drascula-hoz, ezt сt kell alakэtani.\n"
-"A rщgi jсtщkmentщs forma tіbbщ nem tсmogatott, ezщrt a jсtщk mentщse nem "
-"tіltѕdik be ha nem akэtod сt azt.\n"
+"ScummVM rщgi jсtщkmentщst talсlt a Drascula-hoz, ezt сt kell alakэ"
+"tani.\n"
+"A rщgi jсtщkmentщs forma tіbbщ nem tсmogatott, ezщrt a jсtщk "
+"mentщse nem tіltѕdik be ha nem akэtod сt azt.\n"
"\n"
-"Nyomj OK-t ha сtalakэtod most, vagy rсkщrdezek њjra ha legkіzelebb elindэtod "
-"a jсtщkot.\n"
+"Nyomj OK-t ha сtalakэtod most, vagy rсkщrdezek њjra ha legkіzelebb "
+"elindэtod a jсtщkot.\n"
#: engines/dreamweb/detection.cpp:57
msgid "Use bright palette mode"
@@ -2451,7 +2480,8 @@ msgid ""
"Do you wish to use this save game file with ScummVM?\n"
"\n"
msgstr ""
-"A kіvetkezѕ eredeti jсtщkmentщs fсjlt talсltam a jсtщkkіnyvtсrban:\n"
+"A kіvetkezѕ eredeti jсtщkmentщs fсjlt talсltam a "
+"jсtщkkіnyvtсrban:\n"
"\n"
"%s %s\n"
"\n"
@@ -2478,7 +2508,8 @@ msgid ""
"\n"
msgstr ""
"%d eredeti jсtщkmentщs fсjlt sikeresen importсlta a\n"
-"ScummVM. Ha kщsѕbb manuсlisan akarod importсlni az eredeti jсtщkmentщseket\n"
+"ScummVM. Ha kщsѕbb manuсlisan akarod importсlni az eredeti "
+"jсtщkmentщseket\n"
"meg kell nyitnod a ScummVM debug konzolt щs hasznсld az 'import_savefile' "
"utasэtсst.\n"
"\n"
@@ -2516,7 +2547,8 @@ msgstr "Hall of Records storyboard сtvezetѕk сtugrсsa"
#: engines/neverhood/detection.cpp:168
msgid "Allows the player to skip past the Hall of Records storyboard scenes"
msgstr ""
-"Lehetѕsщg, hogy a jсtщkos сtugorja a Hall of Records storyboard сtvezetѕket"
+"Lehetѕsщg, hogy a jсtщkos сtugorja a Hall of Records storyboard "
+"сtvezetѕket"
#: engines/neverhood/detection.cpp:174
msgid "Scale the making of videos to full screen"
@@ -2524,7 +2556,9 @@ msgstr "Hogyan kщszќlt videѓk сtmщretezщse teljeskщpernyѕre"
#: engines/neverhood/detection.cpp:175
msgid "Scale the making of videos, so that they use the whole screen"
-msgstr "Hogyan kщszќlt videѓk сtmщretezщse, hogy teljeskщpernyѕt hasznсljanak"
+msgstr ""
+"Hogyan kщszќlt videѓk сtmщretezщse, hogy teljeskщpernyѕt "
+"hasznсljanak"
#: engines/parallaction/saveload.cpp:133
#, c-format
@@ -2552,12 +2586,13 @@ msgid ""
"\n"
"Press OK to convert them now, otherwise you will be asked next time.\n"
msgstr ""
-"ScummVM rщgi jсtщkmentщst talсlt a Nippon Safes hez ezt сt kell nevezni.\n"
-"A rщgi jсtщkmentщs nem tсmogatott, ezщrt a jсtщk nem tіltѕdik be сtnevezщs "
-"nщlkќl..\n"
+"ScummVM rщgi jсtщkmentщst talсlt a Nippon Safes hez ezt сt kell "
+"nevezni.\n"
+"A rщgi jсtщkmentщs nem tсmogatott, ezщrt a jсtщk nem tіltѕdik be "
+"сtnevezщs nщlkќl..\n"
"\n"
-"Nyomj OK-t az сtalakэtсshoz, vagy rсkщrdezzek ha legkіzelebb elindэtod a "
-"jсtщkot.\n"
+"Nyomj OK-t az сtalakэtсshoz, vagy rсkщrdezzek ha legkіzelebb elindэtod "
+"a jсtщkot.\n"
#: engines/parallaction/saveload.cpp:319
msgid "ScummVM successfully converted all your savefiles."
@@ -2570,8 +2605,8 @@ msgid ""
"\n"
"Please report to the team."
msgstr ""
-"ScummVM kiэrt nщhсny figyelmeztetщst a konzolablakba щs nem biztos hogy az "
-"іsszes fсjlod сt lett alakэtva.\n"
+"ScummVM kiэrt nщhсny figyelmeztetщst a konzolablakba щs nem biztos hogy "
+"az іsszes fсjlod сt lett alakэtva.\n"
"\n"
"Lщgyszэves jelentsd a csapatnak."
@@ -2626,7 +2661,8 @@ msgstr "EGA szэnmodulсciѓ сtugrсsa (Szэnes hсttereknщl)"
#: engines/sci/detection.cpp:375
msgid "Skip dithering pass in EGA games, graphics are shown with full colors"
msgstr ""
-"Szэnmodulсciѓ сtugrсsa EGA jсtщkoknсl, grafikсk teljes szэnben lсthatѓk"
+"Szэnmodulсciѓ сtugrсsa EGA jсtщkoknсl, grafikсk teljes szэnben "
+"lсthatѓk"
#: engines/sci/detection.cpp:384
msgid "Prefer digital sound effects"
@@ -2645,8 +2681,8 @@ msgid ""
"Use an IBM Music Feature card or a Yamaha FB-01 FM synth module for MIDI "
"output"
msgstr ""
-"IBM Music Feature kсrtya vagy Yamaha FB-01 FM szintetizсtor modul hasznсlata "
-"MIDI kimenetre"
+"IBM Music Feature kсrtya vagy Yamaha FB-01 FM szintetizсtor modul "
+"hasznсlata MIDI kimenetre"
#: engines/sci/detection.cpp:415
msgid "Use CD audio"
@@ -2663,7 +2699,8 @@ msgstr "Windows kurzorok hasznсlata"
#: engines/sci/detection.cpp:427
msgid ""
"Use the Windows cursors (smaller and monochrome) instead of the DOS ones"
-msgstr "Windows kurzorok hasznсlata (kisebb щs monokrѓm) a DOS-osok helyett "
+msgstr ""
+"Windows kurzorok hasznсlata (kisebb щs monokrѓm) a DOS-osok helyett "
#: engines/sci/detection.cpp:437
msgid "Use silver cursors"
@@ -2757,36 +2794,36 @@ msgstr "~E~lѕzѕ"
msgid "~N~ext"
msgstr "Kіvetkezѕ"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Csak beszщd"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Beszщd щs felirat"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Csak felirat"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Beszщd & Felir"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Vсlassz hozzсщrtщs szintet."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Segэtsщgщrt nщzd meg a Loom(TM) kщzikіnyvedet."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Gyakorlсs"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Szakщrtѕ"
@@ -3354,9 +3391,10 @@ msgid ""
"files for Maniac Mansion have to be in the 'Maniac' directory inside the "
"Tentacle game directory, and the game has to be added to ScummVM."
msgstr ""
-"Сltalсban a Maniac Mansion indulna most. De a mћkіdщshez a Maniac Mansion "
-"fсjljainak, a 'Maniac' mappсban kell lenni a Tentacle jсtщkmappсjсn belќl, "
-"щs a jсtщkot эgy adja hozzс a ScummVM a listсhoz."
+"Сltalсban a Maniac Mansion indulna most. De a mћkіdщshez a Maniac "
+"Mansion fсjljainak, a 'Maniac' mappсban kell lenni a Tentacle "
+"jсtщkmappсjсn belќl, щs a jсtщkot эgy adja hozzс a ScummVM a "
+"listсhoz."
#: engines/scumm/players/player_v3m.cpp:129
msgid ""
@@ -3405,14 +3443,15 @@ msgstr "'%s' PSX stream сtvezetѕ nem jсtszhatѓ le paletta mѓdban"
#: engines/sword1/animation.cpp:545 engines/sword2/animation.cpp:445
msgid "DXA cutscenes found but ScummVM has been built without zlib"
-msgstr "DXA сtvezetѕ elщrhetѕ, de a ScummVM zlib tсmogatсs nincs lefordэtva"
+msgstr ""
+"DXA сtvezetѕ elщrhetѕ, de a ScummVM zlib tсmogatсs nincs lefordэtva"
#: engines/sword1/animation.cpp:561 engines/sword2/animation.cpp:461
msgid ""
"MPEG-2 cutscenes found but ScummVM has been built without MPEG-2 support"
msgstr ""
-"MPEG-2 сtvezetѕfilmet talсltam, de a ScummVM MPEG-2 tсmogatсs nщlkќl van "
-"lefordэtva"
+"MPEG-2 сtvezetѕfilmet talсltam, de a ScummVM MPEG-2 tсmogatсs nщlkќl "
+"van lefordэtva"
#: engines/sword1/animation.cpp:568 engines/sword2/animation.cpp:470
#, c-format
@@ -3431,11 +3470,11 @@ msgid ""
msgstr ""
"ScummVM rщgi jсtщkmentщst talсlt a Broken Sword 1 hez, ezt сt kell "
"alakэtani.\n"
-"A rщgi jсtщkmentщs nem tсmogatott, ezщrt a jсtщk nem tіltѕdik be сtalakэtсs "
-"nщlkќl.\n"
+"A rщgi jсtщkmentщs nem tсmogatott, ezщrt a jсtщk nem tіltѕdik be "
+"сtalakэtсs nщlkќl.\n"
"\n"
-"Nyomj OK-t az сtalakэtсshoz, vagy rсkщrdezzek ha legkіzelebb elindэtod a "
-"jсtщkot.\n"
+"Nyomj OK-t az сtalakэtсshoz, vagy rсkщrdezzek ha legkіzelebb elindэtod "
+"a jсtщkot.\n"
#: engines/sword1/control.cpp:1232
#, c-format
@@ -3462,8 +3501,8 @@ msgstr "Ez a Broken Sword 1 Demo vщge"
msgid ""
"PSX cutscenes found but ScummVM has been built without RGB color support"
msgstr ""
-"PSX сtvezetѕfilmet talсltam, de ez a ScummVM RGB szэntсmogatсs nщlkќl van "
-"lefordэtva"
+"PSX сtvezetѕfilmet talсltam, de ez a ScummVM RGB szэntсmogatсs nщlkќl "
+"van lefordэtva"
#: engines/sword2/sword2.cpp:79
msgid "Show object labels"
@@ -3493,11 +3532,13 @@ msgstr "FPS szсmlсlѓ lсtszik"
#: engines/wintermute/detection.cpp:59
msgid "Show the current number of frames per second in the upper left corner"
msgstr ""
-"A jelenlegi mсsodpercenkщnti kщpkocka szсm kijelzщse a bal felsѕ sarokban"
+"A jelenlegi mсsodpercenkщnti kщpkocka szсm kijelzщse a bal felsѕ "
+"sarokban"
#: engines/zvision/detection_tables.h:52
msgid "Use the original save/load screens instead of the ScummVM interface"
-msgstr "Hasznсld az eredeti mentщs/tіltщs kщpet a ScummVM felќlet helyett"
+msgstr ""
+"Hasznсld az eredeti mentщs/tіltщs kщpet a ScummVM felќlet helyett"
#: engines/zvision/detection_tables.h:61
msgid "Double FPS"
@@ -3529,7 +3570,8 @@ msgstr "Nagyfelbontсsњ MPEG videѓ hasznсlat"
#: engines/zvision/detection_tables.h:92
msgid "Use MPEG video from the DVD version, instead of lower resolution AVI"
-msgstr "MPEG videѓt hasznсl DVD verziѓnсl, a kisebb felbontсsњ AVI helyett"
+msgstr ""
+"MPEG videѓt hasznсl DVD verziѓnсl, a kisebb felbontсsњ AVI helyett"
#~ msgid "EGA undithering"
#~ msgstr "EGA szinjavэtсs"
@@ -3539,7 +3581,8 @@ msgstr "MPEG videѓt hasznсl DVD verziѓnсl, a kisebb felbontсsњ AVI helyett"
#~ msgid "MPEG-2 cutscenes found but ScummVM has been built without MPEG-2"
#~ msgstr ""
-#~ "MPEG-2 сtvezetѕfilmet talсltam, de a ScummVM MPEG-2 nщlkќl van lefordэtva"
+#~ "MPEG-2 сtvezetѕfilmet talсltam, de a ScummVM MPEG-2 nщlkќl van "
+#~ "lefordэtva"
#~ msgctxt "lowres"
#~ msgid "Mass Add..."
@@ -3547,7 +3590,8 @@ msgstr "MPEG videѓt hasznсl DVD verziѓnсl, a kisebb felbontсsњ AVI helyett"
#~ msgid ""
#~ "Turns off General MIDI mapping for games with Roland MT-32 soundtrack"
-#~ msgstr "General MIDI lekщpezщs Roland MT-32 zenщs jсtщkokhoz kikapcsolva"
+#~ msgstr ""
+#~ "General MIDI lekщpezщs Roland MT-32 zenщs jсtщkokhoz kikapcsolva"
#~ msgid "Standard (16bpp)"
#~ msgstr "Standard (16bpp)"
@@ -3606,7 +3650,8 @@ msgstr "MPEG videѓt hasznсl DVD verziѓnсl, a kisebb felbontсsњ AVI helyett"
#~ msgid ""
#~ "Your game version has been detected using filename matching as a variant "
#~ "of %s."
-#~ msgstr "A felismert jсtщkverziѓd a hasznсlt fсjlnщvvel a %s egy vсltozata."
+#~ msgstr ""
+#~ "A felismert jсtщkverziѓd a hasznсlt fсjlnщvvel a %s egy vсltozata."
#~ msgid "If this is an original and unmodified version, please report any"
#~ msgstr "Ha ez egy eredeti nem vсltoztatott verziѓ, kщrlek jelezd minden"
diff --git a/po/it_IT.po b/po/it_IT.po
index 21c4341570..c52eef8f2f 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2014-07-03 17:59-0600\n"
"Last-Translator: Matteo 'Maff' Angelino <matteo.maff at gmail dot com>\n"
"Language-Team: Italian\n"
@@ -51,13 +51,13 @@ msgid "Go up"
msgstr "Su"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -66,7 +66,7 @@ msgid "Cancel"
msgstr "Annulla"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Scegli"
@@ -86,6 +86,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Sei sicuro di voler eliminare questo salvataggio?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Sь"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "No"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -382,7 +415,7 @@ msgstr "Questo ID di gioco ш giр in uso. Si prega di sceglierne un'altro."
msgid "~Q~uit"
msgstr "C~h~iudi"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Esci da ScummVM"
@@ -390,7 +423,7 @@ msgstr "Esci da ScummVM"
msgid "A~b~out..."
msgstr "~I~nfo..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Informazioni su ScummVM"
@@ -488,26 +521,6 @@ msgstr ""
"Vuoi davvero eseguire il rilevatore di giochi in massa? Potrebbe aggiungere "
"un numero enorme di giochi."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Sь"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "No"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM non ha potuto aprire la cartella specificata!"
@@ -664,7 +677,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Modalitр di resa grafica speciali supportate da alcuni giochi"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Modalitр a schermo intero"
@@ -1129,7 +1142,7 @@ msgstr "Grafica disattivata"
msgid "Standard Renderer"
msgstr "Renderer standard"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Medio"
@@ -1378,7 +1391,7 @@ msgstr "~V~ai a elenco giochi"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1391,7 +1404,7 @@ msgstr "Salva gioco:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1732,57 +1745,57 @@ msgstr "Clic centrale"
msgid "Right Click"
msgstr "Clic destro"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Nascondi ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Nascondi altre"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Mostra tutte"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Finestra"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Contrai"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normale (nessun ridimensionamento)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normale (no ridim.)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Correzione proporzioni attivata"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Correzione proporzioni disattivata"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Filtro grafico attivo:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Modalitр finestra"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (senza filtri)"
@@ -2226,13 +2239,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Ripristina gioco:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Ripristina"
@@ -2771,36 +2784,36 @@ msgstr "~P~recedenti"
msgid "~N~ext"
msgstr "~S~uccessivi"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Solo voci"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Voci e testo"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Solo testo"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Voci e testo"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Selezionate un livello di difficoltр."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Consultate il manuale delle istruzioni."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Base"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Expert"
diff --git a/po/nb_NO.po b/po/nb_NO.po
index 086cb488a7..e75e34196c 100644
--- a/po/nb_NO.po
+++ b/po/nb_NO.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2014-07-11 00:02+0100\n"
"Last-Translator: Einar Johan Trјan Sјmхen <einarjohants@gmail.com>\n"
"Language-Team: somaen <einarjohants@gmail.com>\n"
@@ -54,13 +54,13 @@ msgid "Go up"
msgstr "Oppover"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -69,7 +69,7 @@ msgid "Cancel"
msgstr "Avbryt"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Velg"
@@ -89,6 +89,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Vil du virkelig slette dette lagrede spillet?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Ja"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Nei"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -386,7 +419,7 @@ msgstr "Denne spill-IDen er allerede i bruk. Vennligst velg en annen."
msgid "~Q~uit"
msgstr "~A~vslutt"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Avslutt ScummVM"
@@ -394,7 +427,7 @@ msgstr "Avslutt ScummVM"
msgid "A~b~out..."
msgstr "~O~m..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Om ScummVM"
@@ -492,26 +525,6 @@ msgstr ""
"Vil du virkelig kjјre flerspill-finneren? Dette kan potensielt legge til et "
"stort antall spill."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Ja"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Nei"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM kunne ikke хpne den valgte mappen!"
@@ -667,7 +680,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Spesiel dithering-modus stјttet av enkelte spill"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Fullskjermsmodus"
@@ -1126,7 +1139,7 @@ msgstr "Deaktivert GFX"
msgid "Standard Renderer"
msgstr "Standard tegner"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Standard"
@@ -1373,7 +1386,7 @@ msgstr "~T~ilbake til oppstarter"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1386,7 +1399,7 @@ msgstr "Lagret spill:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1725,57 +1738,57 @@ msgstr "Midtklikk"
msgid "Right Click"
msgstr "Hјyreklikk"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Skjul ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Skjul andre"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Vis alle"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Vindu"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimer"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normal (ingen skalering)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (ingen skalering)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Aspekt-rate korrigering aktivert"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Aspekt-rate korrigering deaktivert"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Aktivt grafikkfilter:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Vindusmodus"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (Ingen filtrering)"
@@ -2218,13 +2231,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Gjennopprett spill:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Gjenopprett"
@@ -2762,36 +2775,36 @@ msgstr "~F~orrige"
msgid "~N~ext"
msgstr "~N~este"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Kun tale"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Tale og undertekster"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Kun undertekster"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Tekst & Tale"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Velg ferdighetsnivх"
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Referer til Loom(TM)-hхndboka di for hjelp."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Trening"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Ekspert"
diff --git a/po/nl_NL.po b/po/nl_NL.po
index 0f4548951d..4116ee9838 100644
--- a/po/nl_NL.po
+++ b/po/nl_NL.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.8.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2014-11-25 20:46+0100\n"
"Last-Translator: Ben Castricum <scummvm@bencastricum.nl>\n"
"Language-Team: Ben Castricum <scummvm@bencastricum.nl>\n"
@@ -54,13 +54,13 @@ msgid "Go up"
msgstr "Ga omhoog"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -69,7 +69,7 @@ msgid "Cancel"
msgstr "Annuleren"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Selecteer"
@@ -89,6 +89,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Wilt u dit opgeslagen spel echt verwijderen?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Ja"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Nee"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -386,7 +419,7 @@ msgstr "Dit spel-ID is al in gebruik. Kies a.u.b. een andere."
msgid "~Q~uit"
msgstr "~S~toppen"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Hiermee verlaat u ScummVM."
@@ -394,7 +427,7 @@ msgstr "Hiermee verlaat u ScummVM."
msgid "A~b~out..."
msgstr "O~v~er..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Geeft informatie over ScummVM."
@@ -494,26 +527,6 @@ msgstr ""
"Wilt u echt de mass game detector draaien? Dit voegt potentieel een groot "
"aantal spellen toe."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Ja"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Nee"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM kon de opgegeven map niet openen!"
@@ -672,7 +685,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Speciale ditheringmodi die door sommige games ondersteund worden."
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Volledig-scherm modus"
@@ -1138,7 +1151,7 @@ msgstr "GFX uitgeschakeld"
msgid "Standard Renderer"
msgstr "Standaard Renderer"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Standaard"
@@ -1387,7 +1400,7 @@ msgstr "S~t~artmenu"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1400,7 +1413,7 @@ msgstr "Spel opslaan:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1742,57 +1755,57 @@ msgstr "Middelste Klik"
msgid "Right Click"
msgstr "Rechter klik"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Verberg ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Verberg Anderen"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Toon Alles"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Venster"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimaliseer"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normaal (niet schalen)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normaal (niet schalen)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Pixelverhoudingcorrectie ingeschakeld"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Pixelverhoudingcorrectie uitgeschakeld"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Actieve grafische filter:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Venstermodus"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (geen filters)"
@@ -2238,13 +2251,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Laad opgeslagen spel:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Laad"
@@ -2797,36 +2810,36 @@ msgstr "~V~orige"
msgid "~N~ext"
msgstr "~V~olgende"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Alleen Spraak"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Spraak and Subtitels"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Alleen subtitels"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Tekst en Spraak"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Selecteer een vakkundigheidsniveau."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Raadpleeg uw Loom(TM) handleiding voor hulp."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Oefenen"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Expert"
diff --git a/po/nn_NO.po b/po/nn_NO.po
index a6af5e4b60..5aafe956ee 100644
--- a/po/nn_NO.po
+++ b/po/nn_NO.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2014-07-11 00:04+0100\n"
"Last-Translator: Einar Johan Trјan Sјmхen <einarjohants@gmail.com>\n"
"Language-Team: somaen <einarjohants@gmail.com>\n"
@@ -54,13 +54,13 @@ msgid "Go up"
msgstr "Oppover"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -69,7 +69,7 @@ msgid "Cancel"
msgstr "Avbryt"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Vel"
@@ -89,6 +89,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Vil du verkeleg slette det lagra spelet?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Ja"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Nei"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -387,7 +420,7 @@ msgstr ""
msgid "~Q~uit"
msgstr "~A~vslutt"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Avslutt ScummVM"
@@ -395,7 +428,7 @@ msgstr "Avslutt ScummVM"
msgid "A~b~out..."
msgstr "~O~m..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Om ScummVM"
@@ -491,26 +524,6 @@ msgid ""
"a huge number of games."
msgstr ""
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Ja"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Nei"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM kunne ikkje хpne den velde mappa!"
@@ -665,7 +678,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Spesielle dithering-modus som stјttast av nokre spel"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Fullskjermsmodus"
@@ -1125,7 +1138,7 @@ msgstr "Deaktivert GFX"
msgid "Standard Renderer"
msgstr "Standardteiknar"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Standard"
@@ -1372,7 +1385,7 @@ msgstr "Tilbake til Oppsta~r~tar"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1385,7 +1398,7 @@ msgstr "Lagra spel:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1704,59 +1717,59 @@ msgstr "Midtklikk"
msgid "Right Click"
msgstr "Hјgreklikk"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Skjul ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Skjul Andre"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Syn alle"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Vindu"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimer"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normal (ikkje skaler)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (ikkje skaler)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
#, fuzzy
msgid "Enabled aspect ratio correction"
msgstr "Aspekt-korrigering"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
#, fuzzy
msgid "Disabled aspect ratio correction"
msgstr "Aspekt-korrigering"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Aktivt grafikkfilter:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Vindusmodus"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (Ingen filtrering)"
@@ -2212,13 +2225,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Gjenopprett spel:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Gjenopprett"
@@ -2742,37 +2755,37 @@ msgstr "~F~orrige"
msgid "~N~ext"
msgstr "~N~este"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Berre Tale"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Tale og undertekstar"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Berre undertekstar"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Tekst & Tale"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
#, fuzzy
msgid "Select a Proficiency Level."
msgstr "Gх til forrige mappenivх"
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Sjх i Loom(TM)-manualen for hjelp."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr ""
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Ekspert"
diff --git a/po/pl_PL.po b/po/pl_PL.po
index 477ecb6e69..5763d3940e 100644
--- a/po/pl_PL.po
+++ b/po/pl_PL.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2014-07-02 12:28+0100\n"
"Last-Translator: MichaГ ZiБbkowski <mziab@o2.pl>\n"
"Language-Team: Grajpopolsku.pl <grajpopolsku@gmail.com>\n"
@@ -55,13 +55,13 @@ msgid "Go up"
msgstr "W gѓrъ"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -70,7 +70,7 @@ msgid "Cancel"
msgstr "Anuluj"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Wybierz"
@@ -90,6 +90,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Na pewno chcesz skasowaц ten zapis?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Tak"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Nie"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -385,7 +418,7 @@ msgstr "Identyfikator jest juП zajъty. Wybierz inny."
msgid "~Q~uit"
msgstr "~Z~akoёcz"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Zakoёcz ScummVM"
@@ -393,7 +426,7 @@ msgstr "Zakoёcz ScummVM"
msgid "A~b~out..."
msgstr "I~n~formacje..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "KsiБПka ScummVM"
@@ -490,26 +523,6 @@ msgid ""
msgstr ""
"Chcesz uruchomiц masowy detektor gier? MoПe dodaц wiele tytuГѓw do listy"
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Tak"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Nie"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM nie moПe otworzyц katalogu!"
@@ -662,7 +675,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Specjalne tryby ditheringu wspierane przez niektѓre gry"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "PeГny ekran"
@@ -1126,7 +1139,7 @@ msgstr "WyГБczona grafika"
msgid "Standard Renderer"
msgstr "Standardowy renderer"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Standardowy"
@@ -1372,7 +1385,7 @@ msgstr "~P~owrѓt do launchera"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1385,7 +1398,7 @@ msgstr "Zapis:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1720,57 +1733,57 @@ msgstr "Іrodkowy przycisk"
msgid "Right Click"
msgstr "Klikniъcie PPM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Ukryj ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Ukryj pozostaГe"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "PokaП wszystkie"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Okno"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Miniaturka"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "ZwykГy (bez skalowania)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "ZwykГy (bez skalowania)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "WГБczono korekcjъ formatu obrazu"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "WyГБczono korekcjъ formatu obrazu"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Aktywny filtr graficzny:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Okno"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (bez filtrowania)"
@@ -2210,13 +2223,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Wznѓw grъ:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Wznѓw"
@@ -2751,36 +2764,36 @@ msgstr "~P~oprzednia"
msgid "~N~ext"
msgstr "~N~astъpna"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Tylko mowa"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Mowa i napisy"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Tylko napisy"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Mowa i napisy"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Wybierz poziom umiejъtnoЖci."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Pomocy szukaj w instrukcji doГБczonej do Loom(TM)."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Trening"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Ekspert"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index a406d5e096..5ae1948a78 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2011-10-21 21:30-0300\n"
"Last-Translator: Saulo Benigno <saulobenigno@gmail.com>\n"
"Language-Team: ScummBR (www.scummbr.com) <scummbr@yahoo.com.br>\n"
@@ -56,13 +56,13 @@ msgid "Go up"
msgstr "Acima"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -71,7 +71,7 @@ msgid "Cancel"
msgstr "Cancelar"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Escolher"
@@ -91,6 +91,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Vocъ realmente quer excluir este jogo salvo?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Sim"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Nуo"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -388,7 +421,7 @@ msgstr "Este cѓdigo jс esta sendo utilizado. Por favor, escolha outro."
msgid "~Q~uit"
msgstr "~S~air"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Sair do ScummVM"
@@ -396,7 +429,7 @@ msgstr "Sair do ScummVM"
msgid "A~b~out..."
msgstr "So~b~re..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Sobre o ScumnmVM"
@@ -495,26 +528,6 @@ msgstr ""
"Vocъ realmente deseja adicionar vсrios jogos ao mesmo tempo? Isso poderс "
"resultar em uma adiчуo gigantesca de jogos."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Sim"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Nуo"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM nуo conseguiu abrir a pasta especificada!"
@@ -674,7 +687,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Modos especiais de dithering suportados por alguns jogos"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Modo Tela Cheia"
@@ -1142,7 +1155,7 @@ msgstr "GFX desabilitado"
msgid "Standard Renderer"
msgstr "Renderizador padrуo (16bpp)"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
#, fuzzy
msgid "Standard"
msgstr "Padrуo (16bpp)"
@@ -1397,7 +1410,7 @@ msgstr "~V~oltar ao menu"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1410,7 +1423,7 @@ msgstr "Salvar jogo:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1753,58 +1766,58 @@ msgstr "Item do meio na esquerda"
msgid "Right Click"
msgstr "Clique com o botуo direito"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Ocultar ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Ocultar Outros"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Mostrar Tudo"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Janela"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimizar"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normal (sem escala)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (sem escala)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Correчуo de proporчуo habilitada"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Correчуo de proporчуo desabilitada"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Ativa os filtros grсficos"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Modo janela"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
#, fuzzy
msgid "OpenGL"
msgstr "Abrir"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr ""
@@ -2246,13 +2259,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Restaurar jogo:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Restaurar"
@@ -2806,36 +2819,36 @@ msgstr "~A~nterior"
msgid "~N~ext"
msgstr "~P~rѓximo"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Somente Voz"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Voz e Legendas"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Somente Legendas"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Voz e Legendas"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr ""
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr ""
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr ""
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr ""
diff --git a/po/ru_RU.po b/po/ru_RU.po
index 5fbb8dcb24..276e34f3e0 100644
--- a/po/ru_RU.po
+++ b/po/ru_RU.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.8.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2015-11-06 09:23+0300\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
"Language-Team: Russian\n"
@@ -15,7 +15,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-5\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Poedit 1.5.5\n"
#: gui/about.cpp:94
@@ -53,13 +54,13 @@ msgid "Go up"
msgstr "Вверх"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -68,7 +69,7 @@ msgid "Cancel"
msgstr "Отмена"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Выбрать"
@@ -88,6 +89,39 @@ msgstr "Заметки:"
msgid "Ok"
msgstr "Ok"
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Вы действительно хотите удалить эту запись?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Да"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Нет"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -384,7 +418,7 @@ msgstr "Этот ID игры уже используется. Пожалуйста, выберите другой."
msgid "~Q~uit"
msgstr "~В~ыход"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Завершить ScummVM"
@@ -392,7 +426,7 @@ msgstr "Завершить ScummVM"
msgid "A~b~out..."
msgstr "О п~р~ограмме..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "О программе ScummVM"
@@ -490,26 +524,6 @@ msgstr ""
"Вы действительно хотите запустить детектор всех игр? Это потенциально может "
"добавить большое количество игр."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Да"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Нет"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM не может открыть указанную директорию!"
@@ -660,7 +674,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Специальные режимы рендеринга, поддерживаемые некоторыми играми"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Полноэкранный режим"
@@ -1124,7 +1138,7 @@ msgstr "Без графики"
msgid "Standard Renderer"
msgstr "Стандартный растеризатор"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Стандартный"
@@ -1372,7 +1386,7 @@ msgstr "~В~ главное меню"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1385,7 +1399,7 @@ msgstr "Сохранить игру:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1727,57 +1741,57 @@ msgstr "Средний щелчок"
msgid "Right Click"
msgstr "Правый щелчок"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Скрыть ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Скрыть остальные"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Показать все"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Окно"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Убрать в Dock"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Без увеличения"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Без увеличения"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Коррекция соотношения сторон включена"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Коррекция соотношения сторон выключена"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Активный графический фильтр:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Оконный режим"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (без фильтров)"
@@ -2206,7 +2220,8 @@ msgid ""
"Use an alternative palette, common for all Amiga games. This was the old "
"behavior"
msgstr ""
-"Использовать альтернативную палитру для всех игр Amiga. Это было старое поведение"
+"Использовать альтернативную палитру для всех игр Amiga. Это было старое "
+"поведение"
#: engines/agi/detection.cpp:167
msgid "Mouse support"
@@ -2216,16 +2231,17 @@ msgstr "Поддержка мыши"
msgid ""
"Enables mouse support. Allows to use mouse for movement and in game menus."
msgstr ""
-"Включает поддержку мыши. Позволяет использовать мышь для перемещения и в меню игры."
+"Включает поддержку мыши. Позволяет использовать мышь для перемещения и в "
+"меню игры."
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Восстановить игру:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Восстановить"
@@ -2467,7 +2483,8 @@ msgid ""
"Do you wish to use this save game file with ScummVM?\n"
"\n"
msgstr ""
-"Нижеследующий файл сохранения из оригинальной игры был найден в вашей игровой директории:\n"
+"Нижеследующий файл сохранения из оригинальной игры был найден в вашей "
+"игровой директории:\n"
"\n"
"%s %s\n"
"\n"
@@ -2639,7 +2656,9 @@ msgstr "Не делать аппроксимацию цветов EGA (полноцветные фоны)"
#: engines/sci/detection.cpp:375
msgid "Skip dithering pass in EGA games, graphics are shown with full colors"
-msgstr "Пропускает проход аппроксимации цветов EGA, графика будет показана со всеми цветами"
+msgstr ""
+"Пропускает проход аппроксимации цветов EGA, графика будет показана со всеми "
+"цветами"
#: engines/sci/detection.cpp:384
msgid "Prefer digital sound effects"
@@ -2776,36 +2795,36 @@ msgstr "~П~ред"
msgid "~N~ext"
msgstr "~С~лед"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Только озвучка"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Озвучка и субтитры"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Только субтитры"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Озвучка и текст"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Выберите уровень сложности."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "За помощью обратитесь к инстукции Loom(TM)"
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Практикант"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Эксперт"
@@ -3550,7 +3569,8 @@ msgstr "Использовать видео MPEG высокого разрешения"
#: engines/zvision/detection_tables.h:92
msgid "Use MPEG video from the DVD version, instead of lower resolution AVI"
msgstr ""
-"Использовать MPEG видео из DVD версии, вместо видео низкого разрешения в формате AVI"
+"Использовать MPEG видео из DVD версии, вместо видео низкого разрешения в "
+"формате AVI"
#~ msgid "EGA undithering"
#~ msgstr "EGA без растра"
diff --git a/po/scummvm.pot b/po/scummvm.pot
index 1d6b4028bc..0445534008 100644
--- a/po/scummvm.pot
+++ b/po/scummvm.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.8.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -52,13 +52,13 @@ msgid "Go up"
msgstr ""
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -67,7 +67,7 @@ msgid "Cancel"
msgstr ""
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr ""
@@ -87,6 +87,38 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+msgid "Do you really want to overwrite the file?"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr ""
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -380,7 +412,7 @@ msgstr ""
msgid "~Q~uit"
msgstr ""
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr ""
@@ -388,7 +420,7 @@ msgstr ""
msgid "A~b~out..."
msgstr ""
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr ""
@@ -484,26 +516,6 @@ msgid ""
"a huge number of games."
msgstr ""
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr ""
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr ""
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr ""
@@ -654,7 +666,7 @@ msgid "Special dithering modes supported by some games"
msgstr ""
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr ""
@@ -1103,7 +1115,7 @@ msgstr ""
msgid "Standard Renderer"
msgstr ""
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr ""
@@ -1348,7 +1360,7 @@ msgstr ""
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1361,7 +1373,7 @@ msgstr ""
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1672,57 +1684,57 @@ msgstr ""
msgid "Right Click"
msgstr ""
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr ""
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr ""
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr ""
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr ""
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr ""
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr ""
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr ""
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr ""
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr ""
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr ""
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr ""
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr ""
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr ""
@@ -2158,13 +2170,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr ""
@@ -2661,36 +2673,36 @@ msgstr ""
msgid "~N~ext"
msgstr ""
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr ""
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr ""
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr ""
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr ""
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr ""
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr ""
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr ""
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr ""
diff --git a/po/se_SE.po b/po/se_SE.po
index 814a5b1e86..e6ab951cd5 100644
--- a/po/se_SE.po
+++ b/po/se_SE.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.5.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2014-07-02 16:30+0100\n"
"Last-Translator: Hampus Flink <hampus.flink@gmail.com>\n"
"Language-Team: \n"
@@ -54,13 +54,13 @@ msgid "Go up"
msgstr "Uppхt"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -69,7 +69,7 @@ msgid "Cancel"
msgstr "Avbryt"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Vфlj"
@@ -89,6 +89,39 @@ msgstr ""
msgid "Ok"
msgstr ""
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Vill du verkligen radera den hфr spardatan?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Ja"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Nej"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -386,7 +419,7 @@ msgstr "Detta ID-namn фr upptaget. Var god vфlj ett annat."
msgid "~Q~uit"
msgstr "~A~vsluta"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Avsluta ScummVM"
@@ -394,7 +427,7 @@ msgstr "Avsluta ScummVM"
msgid "A~b~out..."
msgstr "O~m~..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Om ScummVM"
@@ -492,26 +525,6 @@ msgstr ""
"Vill du verkligen anvфnda mass-speldetektorn? Processen kan potentiellt "
"lфgga till ett enormt antal spel."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Ja"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Nej"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM kunde inte іppna den valda katalogen!"
@@ -665,7 +678,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Speciella gitterlфgen stіdda av vissa spel"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Fullskфrmslфge"
@@ -1129,7 +1142,7 @@ msgstr "Inaktiverad GFX"
msgid "Standard Renderer"
msgstr "Standard rendering"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Standard"
@@ -1378,7 +1391,7 @@ msgstr "Хte~r~vфnd till launcher"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1391,7 +1404,7 @@ msgstr "Spara spelet:"
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1730,57 +1743,57 @@ msgstr "Mittenklick"
msgid "Right Click"
msgstr "Hіgerklick"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Gіm ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Gіm іvriga"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Visa alla"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Fіnster"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Minimera"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Normalt (ingen skalning)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normalt (ingen skalning)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Korrektion av bildfіrhхllande pх"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Korrektion av bildfіrhхllande av"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Aktivt grafikfilter:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Fіnsterlфge"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (ingen filtrering)"
@@ -2223,13 +2236,13 @@ msgid ""
msgstr ""
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Хterstфll spel:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Хterstфll"
@@ -2767,36 +2780,36 @@ msgstr "~F~іregхende"
msgid "~N~ext"
msgstr "~N~фsta"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Endast tal"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Tal och undertexter"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Endast undertexter"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Tal & text"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Vфlj en skicklighetsnivх."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "Hфnvisa till din Loom(TM)-manual fіr hjфlp."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "жvning"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Expert"
diff --git a/po/uk_UA.po b/po/uk_UA.po
index c4264f84c2..11399efb7e 100644
--- a/po/uk_UA.po
+++ b/po/uk_UA.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2015-10-11 18:59+0100\n"
+"POT-Creation-Date: 2015-12-23 00:28+0000\n"
"PO-Revision-Date: 2015-11-06 10:07+0300\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
"Language-Team: Ukrainian\n"
@@ -16,7 +16,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-5\n"
"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
#: gui/about.cpp:94
#, c-format
@@ -53,13 +54,13 @@ msgid "Go up"
msgstr "Вгору"
#: gui/browser.cpp:75 gui/chooser.cpp:46 gui/editrecorddialog.cpp:67
-#: gui/KeysDialog.cpp:43 gui/launcher.cpp:351 gui/massadd.cpp:95
-#: gui/options.cpp:1237 gui/predictivedialog.cpp:74 gui/recorderdialog.cpp:70
-#: gui/recorderdialog.cpp:156 gui/saveload-dialog.cpp:216
-#: gui/saveload-dialog.cpp:276 gui/saveload-dialog.cpp:547
-#: gui/saveload-dialog.cpp:931 gui/themebrowser.cpp:55
-#: gui/fluidsynth-dialog.cpp:152 engines/engine.cpp:483
-#: backends/platform/wii/options.cpp:48
+#: gui/filebrowser-dialog.cpp:64 gui/KeysDialog.cpp:43 gui/launcher.cpp:351
+#: gui/massadd.cpp:95 gui/options.cpp:1237 gui/predictivedialog.cpp:74
+#: gui/recorderdialog.cpp:70 gui/recorderdialog.cpp:156
+#: gui/saveload-dialog.cpp:216 gui/saveload-dialog.cpp:276
+#: gui/saveload-dialog.cpp:547 gui/saveload-dialog.cpp:931
+#: gui/themebrowser.cpp:55 gui/fluidsynth-dialog.cpp:152
+#: engines/engine.cpp:483 backends/platform/wii/options.cpp:48
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
#: engines/drascula/saveload.cpp:49 engines/parallaction/saveload.cpp:274
@@ -68,7 +69,7 @@ msgid "Cancel"
msgstr "Відміна"
#: gui/browser.cpp:76 gui/browser_osx.mm:103 gui/chooser.cpp:47
-#: gui/themebrowser.cpp:56
+#: gui/filebrowser-dialog.cpp:65 gui/themebrowser.cpp:56
msgid "Choose"
msgstr "Вибрати"
@@ -88,6 +89,39 @@ msgstr "Примітки:"
msgid "Ok"
msgstr "Гаразд"
+#: gui/filebrowser-dialog.cpp:49
+msgid "Choose file for loading"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:49
+msgid "Enter filename for saving"
+msgstr ""
+
+#: gui/filebrowser-dialog.cpp:132
+#, fuzzy
+msgid "Do you really want to overwrite the file?"
+msgstr "Ви дійсно хочете видалити цей запис?"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "Yes"
+msgstr "Так"
+
+#: gui/filebrowser-dialog.cpp:132 gui/launcher.cpp:793 gui/launcher.cpp:941
+#: gui/launcher.cpp:1000 gui/fluidsynth-dialog.cpp:217
+#: backends/events/symbiansdl/symbiansdl-events.cpp:186
+#: backends/platform/wince/CEActionsPocket.cpp:326
+#: backends/platform/wince/CEActionsSmartphone.cpp:287
+#: backends/platform/wince/CELauncherDialog.cpp:83
+#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
+msgid "No"
+msgstr "Ні"
+
#: gui/gui-manager.cpp:117 backends/keymapper/remap-dialog.cpp:53
#: engines/scumm/help.cpp:126 engines/scumm/help.cpp:141
#: engines/scumm/help.cpp:166 engines/scumm/help.cpp:192
@@ -385,7 +419,7 @@ msgstr "Цей ID гри вже використовується. Будь ласка, виберіть інший."
msgid "~Q~uit"
msgstr "~В~ихід"
-#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:95
+#: gui/launcher.cpp:626 backends/platform/sdl/macosx/appmenu_osx.mm:106
msgid "Quit ScummVM"
msgstr "Вихід зі ScummVM"
@@ -393,7 +427,7 @@ msgstr "Вихід зі ScummVM"
msgid "A~b~out..."
msgstr "Про п~р~ограму..."
-#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:69
+#: gui/launcher.cpp:627 backends/platform/sdl/macosx/appmenu_osx.mm:80
msgid "About ScummVM"
msgstr "Про ScummVM"
@@ -491,26 +525,6 @@ msgstr ""
"Чи ви дійсно хочете запустити пошук усіх ігор? Це потенційно може додати "
"велику кількість ігор."
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "Yes"
-msgstr "Так"
-
-#: gui/launcher.cpp:793 gui/launcher.cpp:941 gui/launcher.cpp:1000
-#: gui/fluidsynth-dialog.cpp:217
-#: backends/events/symbiansdl/symbiansdl-events.cpp:186
-#: backends/platform/wince/CEActionsPocket.cpp:326
-#: backends/platform/wince/CEActionsSmartphone.cpp:287
-#: backends/platform/wince/CELauncherDialog.cpp:83
-#: engines/kyra/saveload_eob.cpp:557 engines/kyra/saveload_eob.cpp:590
-msgid "No"
-msgstr "Ні"
-
#: gui/launcher.cpp:841
msgid "ScummVM couldn't open the specified directory!"
msgstr "ScummVM не може відкрити вказану папку!"
@@ -661,7 +675,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Спеціальні режими растрування, які підтримують деякі ігри"
#: gui/options.cpp:758
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2298
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2313
msgid "Fullscreen mode"
msgstr "Повноекранний режим"
@@ -1123,7 +1137,7 @@ msgstr "Без графіки"
msgid "Standard Renderer"
msgstr "Стандартний растеризатор"
-#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:661
+#: gui/ThemeEngine.cpp:348 engines/scumm/dialogs.cpp:663
msgid "Standard"
msgstr "Стандартний"
@@ -1370,7 +1384,7 @@ msgstr "~П~овер.в головне меню"
#: engines/dialogs.cpp:116 engines/agi/saveload.cpp:803
#: engines/cruise/menu.cpp:212 engines/drascula/saveload.cpp:336
-#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:873
+#: engines/dreamweb/saveload.cpp:261 engines/neverhood/menumodule.cpp:877
#: engines/pegasus/pegasus.cpp:377 engines/sci/engine/kfile.cpp:759
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save game:"
@@ -1383,7 +1397,7 @@ msgstr "Зберегти гру: "
#: backends/platform/wince/CEActionsSmartphone.cpp:231
#: engines/agi/saveload.cpp:803 engines/cruise/menu.cpp:212
#: engines/drascula/saveload.cpp:336 engines/dreamweb/saveload.cpp:261
-#: engines/neverhood/menumodule.cpp:873 engines/pegasus/pegasus.cpp:377
+#: engines/neverhood/menumodule.cpp:877 engines/pegasus/pegasus.cpp:377
#: engines/sci/engine/kfile.cpp:759 engines/scumm/dialogs.cpp:188
#: engines/toltecs/menu.cpp:281 engines/tsage/scenes.cpp:598
msgid "Save"
@@ -1722,57 +1736,57 @@ msgstr "Середній клік"
msgid "Right Click"
msgstr "Правий клік"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:77
+#: backends/platform/sdl/macosx/appmenu_osx.mm:88
msgid "Hide ScummVM"
msgstr "Сховати ScummVM"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:82
+#: backends/platform/sdl/macosx/appmenu_osx.mm:93
msgid "Hide Others"
msgstr "Сховати Інші"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:87
+#: backends/platform/sdl/macosx/appmenu_osx.mm:98
msgid "Show All"
msgstr "Показати Все"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:109
#: backends/platform/sdl/macosx/appmenu_osx.mm:120
+#: backends/platform/sdl/macosx/appmenu_osx.mm:131
msgid "Window"
msgstr "Вікно"
-#: backends/platform/sdl/macosx/appmenu_osx.mm:114
+#: backends/platform/sdl/macosx/appmenu_osx.mm:125
msgid "Minimize"
msgstr "Мінімізувати"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:46
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:47
msgid "Normal (no scaling)"
msgstr "Без збільшення"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:65
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:66
msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Без збільшення"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2197
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2212
msgid "Enabled aspect ratio correction"
msgstr "Корекцію співвідношення сторін увімкнено"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2203
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2218
msgid "Disabled aspect ratio correction"
msgstr "Корекцію співвідношення сторін вимкнено"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2258
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2273
msgid "Active graphics filter:"
msgstr "Поточний графічний фільтр:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2300
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2315
msgid "Windowed mode"
msgstr "Віконний режим"
-#: backends/graphics/opengl/opengl-graphics.cpp:118
+#: backends/graphics/opengl/opengl-graphics.cpp:119
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:119
+#: backends/graphics/opengl/opengl-graphics.cpp:120
msgid "OpenGL (No filtering)"
msgstr "OpenGL (без фільтрів)"
@@ -2202,7 +2216,8 @@ msgid ""
"Use an alternative palette, common for all Amiga games. This was the old "
"behavior"
msgstr ""
-"Використовувати альтернативну палітру, звичайну для ігор з Amiga. Це була стара поведінка."
+"Використовувати альтернативну палітру, звичайну для ігор з Amiga. Це була "
+"стара поведінка."
#: engines/agi/detection.cpp:167
msgid "Mouse support"
@@ -2212,16 +2227,17 @@ msgstr "Підтримка миші"
msgid ""
"Enables mouse support. Allows to use mouse for movement and in game menus."
msgstr ""
-"Включає підтримку миші. Дозволяє використовувати мишу для пересування та управління меню."
+"Включає підтримку миші. Дозволяє використовувати мишу для пересування та "
+"управління меню."
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore game:"
msgstr "Відновити гру:"
#: engines/agi/saveload.cpp:816 engines/drascula/saveload.cpp:349
-#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:886
+#: engines/dreamweb/saveload.cpp:169 engines/neverhood/menumodule.cpp:890
#: engines/sci/engine/kfile.cpp:858 engines/toltecs/menu.cpp:256
msgid "Restore"
msgstr "Відновити"
@@ -2488,7 +2504,8 @@ msgid ""
"\n"
msgstr ""
"%d оригінальних файлів зі станом гри було успішно імпортовано у\n"
-"ScummVM. Якщо ви захочете пізніше імпортувати оригінальні файли зі станом гри, вам потрібно\n"
+"ScummVM. Якщо ви захочете пізніше імпортувати оригінальні файли зі станом "
+"гри, вам потрібно\n"
"відкрити консоль відладчика і ввести команду 'import_savefile'.\n"
"\n"
@@ -2766,36 +2783,36 @@ msgstr "~П~опер"
msgid "~N~ext"
msgstr "~Н~аст"
-#: engines/scumm/dialogs.cpp:600
+#: engines/scumm/dialogs.cpp:602
msgid "Speech Only"
msgstr "Тільки озвучка"
-#: engines/scumm/dialogs.cpp:601
+#: engines/scumm/dialogs.cpp:603
msgid "Speech and Subtitles"
msgstr "Озвучка та субтитри"
-#: engines/scumm/dialogs.cpp:602
+#: engines/scumm/dialogs.cpp:604
msgid "Subtitles Only"
msgstr "Тільки субтитри"
-#: engines/scumm/dialogs.cpp:610
+#: engines/scumm/dialogs.cpp:612
msgctxt "lowres"
msgid "Speech & Subs"
msgstr "Озвучка та текст"
-#: engines/scumm/dialogs.cpp:656
+#: engines/scumm/dialogs.cpp:658
msgid "Select a Proficiency Level."
msgstr "Оберіть режим складності."
-#: engines/scumm/dialogs.cpp:658
+#: engines/scumm/dialogs.cpp:660
msgid "Refer to your Loom(TM) manual for help."
msgstr "За допомогою звертайтеся до інструкції Loom(TM)."
-#: engines/scumm/dialogs.cpp:662
+#: engines/scumm/dialogs.cpp:664
msgid "Practice"
msgstr "Практика"
-#: engines/scumm/dialogs.cpp:663
+#: engines/scumm/dialogs.cpp:665
msgid "Expert"
msgstr "Експерт"
@@ -3537,4 +3554,5 @@ msgstr "Використовувати відео MPEG з підвищеною роздільністю"
#: engines/zvision/detection_tables.h:92
msgid "Use MPEG video from the DVD version, instead of lower resolution AVI"
msgstr ""
-"Використовувати відео MPEG з DVD-версії, замість файлів AVI з ніжчою роздільною здатністю"
+"Використовувати відео MPEG з DVD-версії, замість файлів AVI з ніжчою "
+"роздільною здатністю"
diff --git a/ports.mk b/ports.mk
index 398a0c4b5a..adc28d4fd4 100644
--- a/ports.mk
+++ b/ports.mk
@@ -91,17 +91,11 @@ endif
cp $(srcdir)/dists/iphone/icon.png $(bundle_name)/
cp $(srcdir)/dists/iphone/icon-72.png $(bundle_name)/
cp $(srcdir)/dists/iphone/Default.png $(bundle_name)/
- # Binary patch workaround for Iphone 5/IPad 4 "Illegal instruction: 4" toolchain issue (http://code.google.com/p/iphone-gcc-full/issues/detail?id=6)
- cp scummvm scummvm-iph5
- sed -i'' 's/\x00\x30\x93\xe4/\x00\x30\x93\xe5/g;s/\x00\x30\xd3\xe4/\x00\x30\xd3\xe5/g;' scummvm-iph5
- ldid -S scummvm-iph5
- chmod 755 scummvm-iph5
- cp scummvm-iph5 $(bundle_name)/ScummVM-iph5
# Location of static libs for the iPhone
ifneq ($(BACKEND), iphone)
# Static libaries, used for the scummvm-static and iphone targets
-OSX_STATIC_LIBS := `$(STATICLIBPATH)/bin/sdl-config --static-libs`
+OSX_STATIC_LIBS := `$(SDLCONFIG) --static-libs`
endif
ifdef USE_FREETYPE2
@@ -331,5 +325,13 @@ endif
@echo Now run
@echo "\tgit commit -m 'DISTS: Generated Code::Blocks and MSVC project files'"
+# Target to create Raspberry Pi zip containig binary and specific README
+raspberrypi_dist:
+ mkdir -p $(srcdir)/scummvm-rpi
+ cp $(srcdir)/backends/platform/sdl/raspberrypi/README.RASPBERRYPI $(srcdir)/scummvm-rpi/README
+ cp $(srcdir)/scummvm $(srcdir)/scummvm-rpi
+ zip -r scummvm-rpi.zip scummvm-rpi
+ rm -f -R scummvm-rpi
+
# Mark special targets as phony
.PHONY: deb bundle osxsnap win32dist install uninstall
diff --git a/test/common/algorithm.h b/test/common/algorithm.h
index 6eecae3635..ccf6469f67 100644
--- a/test/common/algorithm.h
+++ b/test/common/algorithm.h
@@ -47,10 +47,28 @@ public:
void test_pod_sort() {
{
+ int dummy;
+ Common::sort(&dummy, &dummy);
+ TS_ASSERT_EQUALS(checkSort(&dummy, &dummy, Common::Less<int>()), true);
+ }
+ {
+ int array[] = { 12 };
+ Common::sort(array, ARRAYEND(array));
+ TS_ASSERT_EQUALS(checkSort(array, ARRAYEND(array), Common::Less<int>()), true);
+
+ // already sorted
+ Common::sort(array, ARRAYEND(array));
+ TS_ASSERT_EQUALS(checkSort(array, ARRAYEND(array), Common::Less<int>()), true);
+ }
+ {
int array[] = { 63, 11, 31, 72, 1, 48, 32, 69, 38, 31 };
Common::sort(array, ARRAYEND(array));
TS_ASSERT_EQUALS(checkSort(array, ARRAYEND(array), Common::Less<int>()), true);
+ int sortedArray[] = { 1, 11, 31, 31, 32, 38, 48, 63, 69, 72 };
+ for (size_t i = 0; i < 10; ++i)
+ TS_ASSERT_EQUALS(array[i], sortedArray[i]);
+
// already sorted
Common::sort(array, ARRAYEND(array));
TS_ASSERT_EQUALS(checkSort(array, ARRAYEND(array), Common::Less<int>()), true);